@utahdts/utah-design-system-header 0.6.0-beta.0 β 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(H,Pe){typeof exports=="object"&&typeof module<"u"?Pe(exports):typeof define=="function"&&define.amd?define(["exports"],Pe):(H=typeof globalThis<"u"?globalThis:H||self,Pe(H["@utahdts/utah-design-system-header"]={}))})(this,function(H){"use strict";const fn={name:"@utahdts/utah-design-system-header",version:"0.6.0",description:"Utah Header for the Utah Design System",exports:{".":{"development-local":"./src/index.js",development:"./dist/utah-design-system-header.es.js",production:"./dist/utah-design-system-header.es.js",import:"./dist/utah-design-system-header.es.js",require:"./dist/utah-design-system-header.umd.js",default:["./dist/utah-design-system-header.es.js","./dist/utah-design-system-header.umd.js","./src/index.js"]},"./css":"./dist/style.css","./src/css/index.scss":"./src/css/index.scss"},main:"./src/index.js",files:["src/css","dist"],scripts:{build:"vite build",preview:"vite preview",publishHeader:"npm publish --access public","sass-build":"sass --no-source-map ./src/css/index.scss ./src/css/build/utah-design-system-header.css","test-publish":"npm publish --dry-run",test:"vitest",testc:"vitest run --coverage",watch:"vite build --watch"},repository:{type:"git",url:"git+https://github.com/utahdts/utah-design-system.git"},license:"Apache-2.0",bugs:{url:"https://github.com/utahdts/utah-design-system/issues"},homepage:"https://github.com/utahdts/utah-design-system#readme",dependencies:{"@popperjs/core":"2.11.7"},devDependencies:{eslint:"8.38.0","eslint-config-airbnb":"19.0.4","eslint-plugin-import":"2.27.5","eslint-plugin-jsx-a11y":"6.7.1",sass:"1.62.0",vite:"4.2.2","vite-plugin-eslint":"1.8.1",vitest:"0.30.1"},type:"module"},Xo="",x={FLYOUT:"flyout",INLINE:"inline",MEGA_MENU:"mega-menu"},Fe={HEADER_LOADED:"utahHeaderLoaded",HEADER_UNLOADED:"utahHeaderUnloaded"},ee={SMALL:"SMALL",MEDIUM:"MEDIUM",LARGE:"LARGE"},hn=`/* @media is never in scope for --variables, so this is the only way to solve this. :-( */
|
|
2
2
|
|
|
3
3
|
@media screen and (max-width: media-size__tablet-landscape__PLACEHOLDER) {
|
|
4
4
|
/* put your media query here for tablet landscape */
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
@media screen and (max-width: media-size__mobile__PLACEHOLDER) {
|
|
57
57
|
/* put your media query here for mobile */
|
|
58
58
|
}
|
|
59
|
-
`,
|
|
59
|
+
`,_n=`<div class="utah-design-system utds-header-mobile-menu" id="utds-header-mobile-menu">
|
|
60
60
|
<div class="utds-header-mobile-menu__backdrop" aria-hidden></div>
|
|
61
61
|
<div class="utds-header-mobile-menu__wrapper">
|
|
62
62
|
<div class="utds-header-mobile-menu__action-bar" role="tablist">
|
|
@@ -85,17 +85,17 @@
|
|
|
85
85
|
<div class="utds-header-mobile-menu__content"> </div>
|
|
86
86
|
</div>
|
|
87
87
|
</div>
|
|
88
|
-
`;function f(e){return`.${(Array.isArray(e)?e:[e]).join(".")}`}const s={UTAH_DESIGN_SYSTEM:"utah-design-system",HEADER:"utds-header",ICON_BUTTON:"icon-button",CSS_HEADER_MEDIA_TAG_ID:"cssHeaderMediaTag",IS_CLOSED:"is-closed",IS_OPEN:"is-open",VISUALLY_HIDDEN:"visually-hidden",MEDIA_SIZE__MOBILE__PLACEHOLDER:"media-size__mobile__PLACEHOLDER",MEDIA_SIZE__TABLET_LANDSCAPE__PLACEHOLDER:"media-size__tablet-landscape__PLACEHOLDER",MEDIA_SIZE__TABLET_PORTRAIT__PLACEHOLDER:"media-size__tablet-portrait__PLACEHOLDER",ACTION_ITEM:"utds-header-action-item",ACTION_ITEM__ICON_BUTTON:"utds-header-action-item__icon-button",ACTION_ITEM__ICON_BUTTON_TITLE:"utds-header-action-item__icon-button--has-title",ACTION_ITEM__TITLE:"utds-header-action-item__title",BADGE__LABEL:"utds-badge__label",BADGE__VALUE:"utds-badge__value",BADGE_WRAPPER:"utds-badge__wrapper",BADGE_WRAPPER__SMALL:"utds-badge__wrapper--small",BADGE_WRAPPER__ACTION_ITEM:"utds-badge__wrapper--action-item",CITIZEN_EXPERIENCE:"utds-citizen-experience-wrapper",LOGO:"utds-logo-wrapper",LOGO_OFFICIAL_CLOSE_BUTTON:"utds-official-website-popup__close-button",LOGO_OFFICIAL_WRAPPER:"utds-official-website-popup__wrapper",LOGO_SVG:"utah-logo-svg",LOGO_VERT_LINE:"utds-logo-vert-line",MAIN_MENU:"main-menu__wrapper",MAIN_MENU__HAMBURGER:"main-menu__hamburger",MAIN_MENU__HAMBURGER_ID:"utds-main-menu__hamburger",MAIN_MENU__HAMBURGER_ICON_ID:"utds-main-menu__hamburger-icon",MAIN_MENU__MENU_TOP:"main-menu__menu-top",MAIN_MENU__NAV:"main-menu__nav",MAIN_MENU__OUTER:"main-menu__outer",MAIN_MENU__SEARCH:"main-menu__search",MAIN_MENU__TITLE:"main-menu__title",MENU_ITEM:"menu-item",MENU_ITEM__BUTTON_TITLE:"menu-item__button-title",MENU_ITEM__LINK_TITLE:"menu-item__link-title",MENU_ITEM__SELECTED:"menu-item--selected",MENU_ITEM__TITLE:"menu-item__title",MENU_ITEM__FLY_OUT:"menu-item--fly_out",MENU_ITEM__INLINE:"menu-item--inline",MENU_ITEM__MEGA_MENU:"menu-item--mega-menu",MOBILE__VIP_ACTION_ITEMS__LEFT:"utds-header-mobile__vip-action-items--left",MOBILE__UTAH_ID:"utds-header-mobile__utah-id-wrapper",MOBILE__VIP_ACTION_ITEMS__RIGHT:"utds-header-mobile__vip-action-items--right",ACTION_ITEM__SELECTED:"utds-header-mobile-menu__action-item--selected",MOBILE_MENU:"utds-header-mobile-menu",MOBILE_MENU__ACTION_BAR:"utds-header-mobile-menu__action-bar",MOBILE_MENU__BACKDROP:"utds-header-mobile-menu__backdrop",MOBILE_MENU__CONTENT:"utds-header-mobile-menu__content",MOBILE_MENU__CONTENT_ITEM:"utds-header-mobile-menu__content-item",MOBILE_MENU__WRAPPER:"utds-header-mobile-menu__wrapper",MOBILE_MENU_ACTON_BAR__HOME_ID:"utds-header-mobile-menu_action-bar__home",MOBILE_MENU_ACTON_BAR__PROFILE_ID:"utds-header-mobile-menu_action-bar__profile",MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER:"utds-header-mobile-menu__action-item",POPUP_MENU:"vertical-menu",POPUP_MENU__BUTTON_TITLE:"vertical-menu__button-title",POPUP_MENU__CHEVRON:"vertical-menu__chevron",POPUP_MENU__DIVIDER:"vertical-menu__divider",POPUP_MENU__LINK_TEXT:"vertical-menu__link-text",POPUP_MENU__LINK_TITLE:"vertical-menu__link-title",POPUP_MENU__PLAIN_TITLE:"vertical-menu__plain-title",POPUP_MENU__TITLE:"vertical-menu__title",POPUP_MENU_WRAPPER__WRAPPER:"vertical-menu__wrapper",POPUP_MENU_WRAPPER__WRAPPER_TITLE:"vertical-menu__wrapper-title",POPUP__HIDDEN:"popup__wrapper--hidden",POPUP__VISIBLE:"popup__wrapper--visible",POPUP__WRAPPER:"popup__wrapper",EXTERNAL_LINK:"utds-icon-after-external-link",EXTERNAL_LINK__NEW_TAB:"utds-new-tab-link-a11y",POPUP_ARROW:"popup__arrow",POPUP_CONTENT_WRAPPER:"popup__content",POPUP_WRAPPER:"popup__wrapper",SEARCH__SEARCH_BACKDROP:"search-backdrop",SEARCH__SEARCH_CLOSE_BUTTON:"search-modal__close-button",SEARCH__SEARCH_BUTTON:"search-modal__button",SEARCH__SEARCH_BUTTON_WRAPPER:"search-modal__button-wrapper",SEARCH__SEARCH_INPUT:"search-modal__input",SEARCH__SEARCH_MODAL:"search-modal",SIZE__LARGE:"large",SIZE__MEDIUM:"medium",TITLE:"utds-title-wrapper",TITLE__LOGO:"utds-title-wrapper__logo",TITLE__TITLE:"utds-title-wrapper__title",TOOLTIP:"utds-tooltip",TOOLTIP__CONTENT:"tooltip__content",TOOLTIP__WRAPPER:"tooltip__wrapper",TOOLTIP__WRAPPER__HIDDEN:"tooltip__wrapper--hidden",TOOLTIP__WRAPPER__VISIBLE:"tooltip__wrapper--visible",UTAH_ID:"utds-utah-id-wrapper",UTAH_ID__BUTTON:"utds-utah-id__button"};function
|
|
88
|
+
`;function f(e){return`.${(Array.isArray(e)?e:[e]).join(".")}`}const s={UTAH_DESIGN_SYSTEM:"utah-design-system",HEADER:"utds-header",ICON_BUTTON:"icon-button",CSS_HEADER_MEDIA_TAG_ID:"cssHeaderMediaTag",IS_CLOSED:"is-closed",IS_OPEN:"is-open",VISUALLY_HIDDEN:"visually-hidden",MEDIA_SIZE__MOBILE__PLACEHOLDER:"media-size__mobile__PLACEHOLDER",MEDIA_SIZE__TABLET_LANDSCAPE__PLACEHOLDER:"media-size__tablet-landscape__PLACEHOLDER",MEDIA_SIZE__TABLET_PORTRAIT__PLACEHOLDER:"media-size__tablet-portrait__PLACEHOLDER",ACTION_ITEM:"utds-header-action-item",ACTION_ITEM__ICON_BUTTON:"utds-header-action-item__icon-button",ACTION_ITEM__ICON_BUTTON_TITLE:"utds-header-action-item__icon-button--has-title",ACTION_ITEM__TITLE:"utds-header-action-item__title",BADGE__LABEL:"utds-badge__label",BADGE__VALUE:"utds-badge__value",BADGE_WRAPPER:"utds-badge__wrapper",BADGE_WRAPPER__SMALL:"utds-badge__wrapper--small",BADGE_WRAPPER__ACTION_ITEM:"utds-badge__wrapper--action-item",CITIZEN_EXPERIENCE:"utds-citizen-experience-wrapper",LOGO:"utds-logo-wrapper",LOGO_OFFICIAL_CLOSE_BUTTON:"utds-official-website-popup__close-button",LOGO_OFFICIAL_WRAPPER:"utds-official-website-popup__wrapper",LOGO_SVG:"utah-logo-svg",LOGO_VERT_LINE:"utds-logo-vert-line",MAIN_MENU:"main-menu__wrapper",MAIN_MENU__HAMBURGER:"main-menu__hamburger",MAIN_MENU__HAMBURGER_ID:"utds-main-menu__hamburger",MAIN_MENU__HAMBURGER_ICON_ID:"utds-main-menu__hamburger-icon",MAIN_MENU__MENU_TOP:"main-menu__menu-top",MAIN_MENU__NAV:"main-menu__nav",MAIN_MENU__OUTER:"main-menu__outer",MAIN_MENU__SEARCH:"main-menu__search",MAIN_MENU__TITLE:"main-menu__title",MENU_ITEM:"menu-item",MENU_ITEM__BUTTON_TITLE:"menu-item__button-title",MENU_ITEM__LINK_TITLE:"menu-item__link-title",MENU_ITEM__SELECTED:"menu-item--selected",MENU_ITEM__TITLE:"menu-item__title",MENU_ITEM__FLY_OUT:"menu-item--fly_out",MENU_ITEM__INLINE:"menu-item--inline",MENU_ITEM__MEGA_MENU:"menu-item--mega-menu",MOBILE__VIP_ACTION_ITEMS__LEFT:"utds-header-mobile__vip-action-items--left",MOBILE__UTAH_ID:"utds-header-mobile__utah-id-wrapper",MOBILE__VIP_ACTION_ITEMS__RIGHT:"utds-header-mobile__vip-action-items--right",ACTION_ITEM__SELECTED:"utds-header-mobile-menu__action-item--selected",MOBILE_MENU:"utds-header-mobile-menu",MOBILE_MENU__ACTION_BAR:"utds-header-mobile-menu__action-bar",MOBILE_MENU__BACKDROP:"utds-header-mobile-menu__backdrop",MOBILE_MENU__CONTENT:"utds-header-mobile-menu__content",MOBILE_MENU__CONTENT_ITEM:"utds-header-mobile-menu__content-item",MOBILE_MENU__WRAPPER:"utds-header-mobile-menu__wrapper",MOBILE_MENU_ACTON_BAR__HOME_ID:"utds-header-mobile-menu_action-bar__home",MOBILE_MENU_ACTON_BAR__PROFILE_ID:"utds-header-mobile-menu_action-bar__profile",MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER:"utds-header-mobile-menu__action-item",POPUP_MENU:"vertical-menu",POPUP_MENU__BUTTON_TITLE:"vertical-menu__button-title",POPUP_MENU__CHEVRON:"vertical-menu__chevron",POPUP_MENU__DIVIDER:"vertical-menu__divider",POPUP_MENU__LINK_TEXT:"vertical-menu__link-text",POPUP_MENU__LINK_TITLE:"vertical-menu__link-title",POPUP_MENU__PLAIN_TITLE:"vertical-menu__plain-title",POPUP_MENU__TITLE:"vertical-menu__title",POPUP_MENU_WRAPPER__WRAPPER:"vertical-menu__wrapper",POPUP_MENU_WRAPPER__WRAPPER_TITLE:"vertical-menu__wrapper-title",POPUP__HIDDEN:"popup__wrapper--hidden",POPUP__VISIBLE:"popup__wrapper--visible",POPUP__WRAPPER:"popup__wrapper",EXTERNAL_LINK:"utds-icon-after-external-link",EXTERNAL_LINK__NEW_TAB:"utds-new-tab-link-a11y",POPUP_ARROW:"popup__arrow",POPUP_CONTENT_WRAPPER:"popup__content",POPUP_WRAPPER:"popup__wrapper",SEARCH__SEARCH_BACKDROP:"search-backdrop",SEARCH__SEARCH_CLOSE_BUTTON:"search-modal__close-button",SEARCH__SEARCH_BUTTON:"search-modal__button",SEARCH__SEARCH_BUTTON_WRAPPER:"search-modal__button-wrapper",SEARCH__SEARCH_INPUT:"search-modal__input",SEARCH__SEARCH_MODAL:"search-modal",SIZE__LARGE:"large",SIZE__MEDIUM:"medium",TITLE:"utds-title-wrapper",TITLE__LOGO:"utds-title-wrapper__logo",TITLE__TITLE:"utds-title-wrapper__title",TOOLTIP:"utds-tooltip",TOOLTIP__CONTENT:"tooltip__content",TOOLTIP__WRAPPER:"tooltip__wrapper",TOOLTIP__WRAPPER__HIDDEN:"tooltip__wrapper--hidden",TOOLTIP__WRAPPER__VISIBLE:"tooltip__wrapper--visible",UTAH_ID:"utds-utah-id-wrapper",UTAH_ID__BUTTON:"utds-utah-id__button"};function vt(e,t){if(e)throw new Error(t)}function mn(e,t){if(e==null)throw new Error(t);return e}function Ve(e){return typeof e=="string"||e instanceof String}function vn(e){const t=new DOMParser;let n;if(Ve(e)){const r=Ve(e)?t.parseFromString(e,"text/html"):e,o=r.body.children.length>1?r.body.children:r.body.children.item(0);if(!o)throw console.error(e),new Error("renderDOM: nothing rendered");n=o}else if(e instanceof Element)n=e;else throw e?(console.error(e),new Error(`renderDOM: str is not a string nor a DOM Element : '${e}'`)):new Error("renderDOM: falsy string passed; cannot render nothing");return n}function b(e){const t=typeof e=="string"?vn(e):e;if(t instanceof HTMLCollection&&t.length>1)throw new Error("renderDOMSingle: must render a single element");const n=t instanceof HTMLCollection?t[0]:t;if(!n)throw console.error(e),new Error("renderDOMSingle: nothing rendered");return n}const Et={mainMenu:{menuItems:[{title:"Home",actionUrl:{url:"/"}}],title:"Main Menu"},mediaSizes:{mobile:640,tabletPortrait:768,tabletLandscape:1024},showTitle:!0,size:ee.MEDIUM,title:"Utah Design System",titleURL:"/",utahId:!0};let Le={...{actionItems:[{actionPopupMenu:{menuItems:[{actionUrl:{url:"https://google.com?search=how realisitic can you be"},title:"Item #1"},{actionUrl:{url:"https://utah.gov",openInNewTab:!0},title:"Utah.Gov"},{actionFunction:e=>{e.stopPropagation(),e.preventDefault(),console.log("Custom menu item triggered")},title:"Custom menu item"},{actionMenu:[{title:"i am a child",actionMenu:[{title:"i am a child",actionUrl:{url:"https://dts.utah.gov"}},{title:"i am a child 2oo",actionUrl:{url:"https://dts.utah.gov/2"}}]},{title:"i am a child 2oo",actionMenu:[{title:"i am a child2",actionUrl:{url:"https://dts.utah.gov"}},{title:"i am a child 2oo2",actionUrl:{url:"https://dts.utah.gov/2"}}]}],title:"I have children!!"}],title:"Divisions Menu"},className:"icon-waffle",icon:`<span class="utds-icon-before-waffle" aria-hidden="true" />
|
|
89
89
|
`,showTitle:!0,title:"Divisions"},{actionFunction:()=>console.log("Alerts clicked"),badge:{label:"Unread Alert",value:1},icon:`<span class="utds-icon-before-alert" aria-hidden="true" />
|
|
90
90
|
`,showTitle:!1,title:"Alerts"},{actionDom:()=>{const e=document.createElement("div");e.appendChild(document.createTextNode("Hello World!"));const t=document.createElement("button");return t.appendChild(document.createTextNode("Do not press me.")),e.appendChild(t),e},badge:{label:"Help Items Available"},icon:`<span class="utds-icon-before-help" aria-hidden="true" />
|
|
91
91
|
`,showTitle:!1,title:"Help"},{actionDom:()=>{const e=document.createElement("div");e.appendChild(document.createTextNode("Toggle Language"));const t=document.createElement("button");return t.appendChild(document.createTextNode("Speak Different")),t.onclick=()=>alert("lorem ipsum"),e.appendChild(t),e},icon:`<span class="utds-icon-before-gear" aria-hidden="true" />
|
|
92
|
-
`,showTitle:!1,title:"Settings"}],mediaSizes:{mobile:640,tabletPortrait:768,tabletLandscape:1024},onSearch:e=>alert(e),showTitle:!0,size:
|
|
92
|
+
`,showTitle:!1,title:"Settings"}],mediaSizes:{mobile:640,tabletPortrait:768,tabletLandscape:1024},onSearch:e=>alert(e),showTitle:!0,size:ee.MEDIUM,title:"Utah Design System",titleURL:"/",utahId:!0,mainMenu:{menuItems:[{actionUrl:{url:"/"},title:"Home"},{actionUrl:{url:"#"},title:"Link to Somewhere"},{isSelected:!0,actionFunction:()=>alert("hello yous guy"),title:"do func"},{actionMenu:[{title:"Guidelines and Standards",actionUrl:{url:"/guidelines"}}],title:"Guidelines/Standards"},{actionMenu:[{title:"child1",actionMenu:[{title:"child1-1",actionMenu:[{title:"child1-1-1",actionUrl:{url:"/children"}},{title:"child1-1-2",actionUrl:{url:"/children"}},{title:"child1-1-3",actionUrl:{url:"/children"}}]},{title:"child1-2",actionMenu:[{title:"child1-2-1",actionUrl:{url:"/children"}},{title:"child1-2-2",actionUrl:{url:"/children"}},{title:"child1-2-3",actionUrl:{url:"/children"}}]}]},{title:"child2",actionMenu:[{title:"child2-1",actionMenu:[{title:"child2-1-1",actionUrl:{url:"/children"}},{title:"child2-1-2",actionUrl:{url:"/children"}},{title:"child2-1-3",actionUrl:{url:"/children"}}]},{title:"child2-2",actionMenu:[{title:"child2-2-1",actionUrl:{url:"/children"}},{title:"child2-2-2",actionUrl:{url:"/children"}},{title:"child2-2-3",actionUrl:{url:"/children"}}]}]}],childrenMenuType:x.FLYOUT,title:"Childrens"},{actionMenu:[{title:"Title of section 1",actionMenu:[{title:"child1-1",actionMenu:[{title:"child1-1-1",actionUrl:{url:"/children"}},{title:"child1-1-2",actionUrl:{url:"/children"}},{title:"child1-1-3",actionUrl:{url:"/children"}}]},{title:"child1-2",actionMenu:[{title:"child1-2-1",actionUrl:{url:"/children"}},{title:"child1-2-2",actionUrl:{url:"/children"}},{title:"child1-2-3",actionUrl:{url:"/children"}}]}]},{title:"Title of section 2",actionMenu:[{title:"child2-1",actionMenu:[{title:"child2-1-1",actionUrl:{url:"/children"}},{title:"child2-1-2",actionUrl:{url:"/children"}},{title:"child2-1-3",actionUrl:{url:"/children"}}]},{title:"child2-2",actionMenu:[{title:"child2-2-1",actionUrl:{url:"/children"}},{title:"child2-2-2",actionUrl:{url:"/children"}},{title:"child2-2-3",actionUrl:{url:"/children"}}]}]}],childrenMenuType:x.MEGA_MENU,title:"MEGA MENU!"}],title:"Utah Design System Main Menu"}}};function O(){return Le}function En(e){if(!e.showTitle&&!e.logo)throw new Error("validateSettings: A title must be shown if there is no logo. Please change the `showTitle` setting to be `true` or provide a logo image.")}function bt(){nn(!1),tn()}let gt=!1;const bn=15e3;let It=0;const gn=setInterval(()=>{It+=1,It>=bn||gt?clearInterval(gn):document.dispatchEvent(new Event(Fe.HEADER_LOADED))},2);function In(e){return Le={...Et,...e},En(Le),gt=!0,document!=null&&document.body?bt():window.addEventListener("load",()=>bt()),Le}const Tn=`<div class="utds-header-mobile-menu__content-item" role="tabpanel">
|
|
93
93
|
</div>
|
|
94
|
-
`;function C(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&(15>>e)/4).toString(16))}function Ge(e){const t=document.querySelector(f(s.MOBILE_MENU__WRAPPER));if(!t)throw new Error("addMobileMenuContentItem: mobileMenuWrapper not found");const n=t.querySelector(f(s.MOBILE_MENU__CONTENT));if(!n)throw new Error("addMobileMenuContentItem: mobileContentWrapper not found");const r=b(
|
|
94
|
+
`;function C(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&(15>>e)/4).toString(16))}function Ge(e){const t=document.querySelector(f(s.MOBILE_MENU__WRAPPER));if(!t)throw new Error("addMobileMenuContentItem: mobileMenuWrapper not found");const n=t.querySelector(f(s.MOBILE_MENU__CONTENT));if(!n)throw new Error("addMobileMenuContentItem: mobileContentWrapper not found");const r=b(Tn);return r.appendChild(e),n.appendChild(r),r.setAttribute("id",C()),r}const Mn=`<div class="utds-badge__wrapper">
|
|
95
95
|
<span class="utds-badge__value"></span>
|
|
96
96
|
<span class="utds-badge__label visually-hidden"></span>
|
|
97
97
|
</div>
|
|
98
|
-
`;function $e(e){let t=null;if(e){t=b(
|
|
98
|
+
`;function $e(e){let t=null;if(e){t=b(Mn),t.classList.add(s.BADGE_WRAPPER__ACTION_ITEM);const n=t.querySelector(f(s.BADGE__LABEL));if(!n)throw new Error("renderActionItemBadge: badgeLabel not found");if(n.appendChild(document.createTextNode(e.label)),e.value||e.value===0){const r=t.querySelector(f(s.BADGE__VALUE));if(!r)throw new Error("renderActionItemBadge: badgeValue not found");r.appendChild(document.createTextNode(`${e.value}`))}else t.classList.add(s.BADGE_WRAPPER__SMALL);e.className&&t.classList.add(e.className)}return t}function je(e){const t=document.querySelector(f(s.MOBILE_MENU));if(!t)throw new Error(`${e}: mobileMenu not found`);const n=document.getElementById(s.MAIN_MENU__HAMBURGER_ID);if(!n)throw new Error(`${e}: hamburger not found (π πΆ I will gladly pay you Tuesday for a hamburger today π΅ π)`);const r=document.getElementById(s.MAIN_MENU__HAMBURGER_ICON_ID);if(!r)throw new Error(`${e}: hamburgerIcon not found`);return{hamburger:n,hamburgerIcon:r,mobileMenu:t}}function Ye(){const{hamburger:e,hamburgerIcon:t,mobileMenu:n}=je("hideMobileMenu");e.setAttribute("aria-expanded","false"),n.classList.remove(s.IS_OPEN),t.classList.add("utds-icon-before-hamburger"),t.classList.remove("utds-icon-before-x-icon")}function wn(){const{hamburger:e,hamburgerIcon:t,mobileMenu:n}=je("showMobileMenu");e.setAttribute("aria-expanded","true"),n.classList.add(s.IS_OPEN),t.classList.remove("utds-icon-before-hamburger"),t.classList.add("utds-icon-before-x-icon")}function An(e){var c;const{hamburger:t}=je("hookupHamburger");if((c=O().actionItems)==null?void 0:c.some(a=>!!a.badge)){const a=$e({label:"Home Badge"});a&&t.appendChild(a)}Ye();const o=document.getElementById(s.MOBILE_MENU_ACTON_BAR__HOME_ID);if(!o)throw new Error("hookupHamburger: homeActionItem not found");const i=o.closest(f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));if(!i)throw new Error("hookupHamburger: homeActionItemWrapper not found");Ke(t,e,i,{ariaHasPopupType:"menu",shouldOnClickCloseMenu:!0})}function ze(e,t){e.querySelectorAll(f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER)).forEach(r=>{r.classList.remove(s.ACTION_ITEM__SELECTED);const o=r.querySelector("button");if(!o)throw new Error("showActionItem: actionWrapper does not have actionItem");o.setAttribute("aria-selected","false"),o.setAttribute("tabIndex","-1")}),t.classList.add(s.ACTION_ITEM__SELECTED);const n=t.querySelector("button");if(!n)throw new Error("showActionItem: actionWrapper does not have actionItem");n.setAttribute("aria-selected","true"),n.removeAttribute("tabIndex"),n.focus()}function Tt(e,t){e.querySelectorAll(f(s.MOBILE_MENU__CONTENT_ITEM)).forEach(n=>n.classList.remove(s.IS_OPEN)),t.classList.add(s.IS_OPEN)}function Ke(e,t,n,{ariaHasPopupType:r,onClickHandler:o,shouldOnClickCloseMenu:i}){var h;if(t&&!r)throw new Error("mobileMenuInteractionHandler: there is content, but the aria type is not given");const c=document.querySelector(f(s.MOBILE_MENU));if(!c)throw new Error("mobileMenuInteractionHandler: mobileMenu not found");const a=document.querySelector(f(s.MOBILE_MENU__WRAPPER));if(!a)throw new Error("mobileMenuInteractionHandler: mobileMenuWrapper not found");const l=a.querySelector(f(s.MOBILE_MENU__CONTENT));if(!l)throw new Error("mobileMenuInteractionHandler: mobileContentWrapper not found");const u=(h=n==null?void 0:n.querySelector)==null?void 0:h.call(n,"button"),d=(u||e).getAttribute("id");if(!d)throw new Error("mobileMenuInteractionHandler: interactiveElementId not found");if(t){const _=t.getAttribute("id");if(!_)throw new Error("mobileMenuInteractionHandler: mobileMenuContentId not found");(u||e).setAttribute("aria-controls",_),t.setAttribute("aria-labelledby",d)}if(e.onclick)throw new Error("mobileMenuInteractionHandler: interactiveElement already has onclick");if(e.onclick=_=>{o&&o(_)||(c.classList.contains(s.IS_OPEN)?i&&Ye():(wn(),t&&Tt(l,t),ze(a,n)))},t){if(n!==e&&n.onclick)throw new Error("mobileMenuInteractionHandler: actionItemWrapper already has onclick");n.onclick=_=>{o&&o(_)||(Tt(l,t),ze(a,n))}}}const On=`<div class="utds-header-mobile-menu__action-item" role="tab">
|
|
99
99
|
<button type="button" class="icon-button icon-button--borderless utds-header-action-item__icon-button">
|
|
100
100
|
<div class="utds-header-action-item__title visually-hidden"></div>
|
|
101
101
|
<span aria-hidden="true" role="presentation">
|
|
@@ -105,13 +105,13 @@
|
|
|
105
105
|
`,yn=`<div class="utds-header-action-item-menu">
|
|
106
106
|
<div class="vertical-menu__wrapper-title"></div>
|
|
107
107
|
</div>
|
|
108
|
-
`,
|
|
109
|
-
`,
|
|
108
|
+
`,Pn=`<span class="utds-icon-before-chevron-right vertical-menu__chevron" aria-hidden="true"></span>
|
|
109
|
+
`,Mt=`<span class="utds-new-tab-link-a11y">
|
|
110
110
|
<span class="visually-hidden">opens in a new tab</span>
|
|
111
111
|
<span class="utds-icon-after-external-link" aria-hidden="true"></span>
|
|
112
112
|
</span>
|
|
113
|
-
`,
|
|
114
|
-
`,
|
|
113
|
+
`,Ln=`<ul class="vertical-menu" role="menu" />
|
|
114
|
+
`,Nn=`<li class="vertical-menu__item">
|
|
115
115
|
<span class="vertical-menu__title">
|
|
116
116
|
<span class="vertical-menu__plain-title"></span>
|
|
117
117
|
<a href="#" class="vertical-menu__link-title">
|
|
@@ -123,44 +123,44 @@
|
|
|
123
123
|
</span>
|
|
124
124
|
<span class="vertical-menu__divider" />
|
|
125
125
|
</li>
|
|
126
|
-
|
|
126
|
+
`,Ze={AUTO:"auto",AUTO_START:"auto-start",AUTO_END:"auto-end",BOTTOM:"bottom",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT:"left",LEFT_START:"left-start",LEFT_END:"left-end",RIGHT:"right",RIGHT_START:"right-start",RIGHT_END:"right-end",TOP:"top",TOP_START:"top-start",TOP_END:"top-end"};function Ne(e,t,n){var o;let r=!1;return e&&(Array.isArray(e)?r=e.some(i=>Ne(i,t,n)):(r=n(e),r||(r=!!((o=t==null?void 0:t.filter(i=>e[i]))!=null&&o.some(i=>Ne(e[i],t,n)))))),r}var B="top",G="bottom",$="right",k="left",Se="auto",me=[B,G,$,k],ce="start",ve="end",Sn="clippingParents",wt="viewport",Ee="popper",Un="reference",At=me.reduce(function(e,t){return e.concat([t+"-"+ce,t+"-"+ve])},[]),Ot=[].concat(me,[Se]).reduce(function(e,t){return e.concat([t,t+"-"+ce,t+"-"+ve])},[]),Cn="beforeRead",Dn="read",Rn="afterRead",Hn="beforeMain",xn="main",Bn="afterMain",kn="beforeWrite",Wn="write",qn="afterWrite",Xe=[Cn,Dn,Rn,Hn,xn,Bn,kn,Wn,qn];function K(e){return e?(e.nodeName||"").toLowerCase():null}function W(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function te(e){var t=W(e).Element;return e instanceof t||e instanceof Element}function q(e){var t=W(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Qe(e){if(typeof ShadowRoot>"u")return!1;var t=W(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Fn(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!q(i)||!K(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(c){var a=o[c];a===!1?i.removeAttribute(c):i.setAttribute(c,a===!0?"":a)}))})}function Vn(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},c=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=c.reduce(function(l,u){return l[u]="",l},{});!q(o)||!K(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const Gn={name:"applyStyles",enabled:!0,phase:"write",fn:Fn,effect:Vn,requires:["computeStyles"]};function j(e){return e.split("-")[0]}var ne=Math.max,Ue=Math.min,ue=Math.round;function Je(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function yt(){return!/^((?!chrome|android).)*safari/i.test(Je())}function de(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&q(e)&&(o=e.offsetWidth>0&&ue(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&ue(r.height)/e.offsetHeight||1);var c=te(e)?W(e):window,a=c.visualViewport,l=!yt()&&n,u=(r.left+(l&&a?a.offsetLeft:0))/o,d=(r.top+(l&&a?a.offsetTop:0))/i,h=r.width/o,_=r.height/i;return{width:h,height:_,top:d,right:u+h,bottom:d+_,left:u,x:u,y:d}}function et(e){var t=de(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Pt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Qe(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Y(e){return W(e).getComputedStyle(e)}function $n(e){return["table","td","th"].indexOf(K(e))>=0}function X(e){return((te(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ce(e){return K(e)==="html"?e:e.assignedSlot||e.parentNode||(Qe(e)?e.host:null)||X(e)}function Lt(e){return!q(e)||Y(e).position==="fixed"?null:e.offsetParent}function jn(e){var t=/firefox/i.test(Je()),n=/Trident/i.test(Je());if(n&&q(e)){var r=Y(e);if(r.position==="fixed")return null}var o=Ce(e);for(Qe(o)&&(o=o.host);q(o)&&["html","body"].indexOf(K(o))<0;){var i=Y(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function be(e){for(var t=W(e),n=Lt(e);n&&$n(n)&&Y(n).position==="static";)n=Lt(n);return n&&(K(n)==="html"||K(n)==="body"&&Y(n).position==="static")?t:n||jn(e)||t}function tt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ge(e,t,n){return ne(e,Ue(t,n))}function Yn(e,t,n){var r=ge(e,t,n);return r>n?n:r}function Nt(){return{top:0,right:0,bottom:0,left:0}}function St(e){return Object.assign({},Nt(),e)}function Ut(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var zn=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,St(typeof t!="number"?t:Ut(t,me))};function Kn(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,c=n.modifiersData.popperOffsets,a=j(n.placement),l=tt(a),u=[k,$].indexOf(a)>=0,d=u?"height":"width";if(!(!i||!c)){var h=zn(o.padding,n),_=et(i),p=l==="y"?B:k,m=l==="y"?G:$,E=n.rects.reference[d]+n.rects.reference[l]-c[l]-n.rects.popper[d],v=c[l]-n.rects.reference[l],T=be(i),w=T?l==="y"?T.clientHeight||0:T.clientWidth||0:0,P=E/2-v/2,g=h[p],I=w-_[d]-h[m],M=w/2-_[d]/2+P,L=ge(g,M,I),N=l;n.modifiersData[r]=(t={},t[N]=L,t.centerOffset=L-M,t)}}function Zn(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;if(o!=null&&!(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o))){if({}.NODE_ENV!=="production"&&(q(o)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),!Pt(t.elements.popper,o)){({}).NODE_ENV!=="production"&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" "));return}t.elements.arrow=o}}const Xn={name:"arrow",enabled:!0,phase:"main",fn:Kn,effect:Zn,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function pe(e){return e.split("-")[1]}var Qn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Jn(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:ue(n*o)/o||0,y:ue(r*o)/o||0}}function Ct(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,c=e.offsets,a=e.position,l=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,h=e.isFixed,_=c.x,p=_===void 0?0:_,m=c.y,E=m===void 0?0:m,v=typeof d=="function"?d({x:p,y:E}):{x:p,y:E};p=v.x,E=v.y;var T=c.hasOwnProperty("x"),w=c.hasOwnProperty("y"),P=k,g=B,I=window;if(u){var M=be(n),L="clientHeight",N="clientWidth";if(M===W(n)&&(M=X(n),Y(M).position!=="static"&&a==="absolute"&&(L="scrollHeight",N="scrollWidth")),M=M,o===B||(o===k||o===$)&&i===ve){g=G;var S=h&&M===I&&I.visualViewport?I.visualViewport.height:M[L];E-=S-r.height,E*=l?1:-1}if(o===k||(o===B||o===G)&&i===ve){P=$;var U=h&&M===I&&I.visualViewport?I.visualViewport.width:M[N];p-=U-r.width,p*=l?1:-1}}var A=Object.assign({position:a},u&&Qn),D=d===!0?Jn({x:p,y:E},W(n)):{x:p,y:E};if(p=D.x,E=D.y,l){var R;return Object.assign({},A,(R={},R[g]=w?"0":"",R[P]=T?"0":"",R.transform=(I.devicePixelRatio||1)<=1?"translate("+p+"px, "+E+"px)":"translate3d("+p+"px, "+E+"px, 0)",R))}return Object.assign({},A,(t={},t[g]=w?E+"px":"",t[P]=T?p+"px":"",t.transform="",t))}function er(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,c=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a;if({}.NODE_ENV!=="production"){var u=Y(t.elements.popper).transitionProperty||"";c&&["transform","top","right","bottom","left"].some(function(h){return u.indexOf(h)>=0})&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',`
|
|
127
127
|
|
|
128
128
|
`,'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.",`
|
|
129
129
|
|
|
130
|
-
`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var d={placement:j(t.placement),variation:fe(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ut(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ut(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const er={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Jn,data:{}};var De={passive:!0};function tr(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,c=r.resize,a=c===void 0?!0:c,l=W(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,De)}),a&&l.addEventListener("resize",n.update,De),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,De)}),a&&l.removeEventListener("resize",n.update,De)}}const nr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:tr,data:{}};var rr={left:"right",right:"left",bottom:"top",top:"bottom"};function Re(e){return e.replace(/left|right|bottom|top/g,function(t){return rr[t]})}var or={start:"end",end:"start"};function Ct(e){return e.replace(/start|end/g,function(t){return or[t]})}function tt(e){var t=W(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function nt(e){return pe(X(e)).left+tt(e).scrollLeft}function ir(e,t){var n=W(e),r=X(e),o=n.visualViewport,i=r.clientWidth,c=r.clientHeight,a=0,l=0;if(o){i=o.width,c=o.height;var u=yt();(u||!u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:c,x:a+nt(e),y:l}}function ar(e){var t,n=X(e),r=tt(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=re(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),c=re(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+nt(e),l=-r.scrollTop;return Y(o||n).direction==="rtl"&&(a+=re(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:c,x:a,y:l}}function rt(e){var t=Y(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Dt(e){return["html","body","#document"].indexOf(K(e))>=0?e.ownerDocument.body:q(e)&&rt(e)?e:Dt(Ce(e))}function we(e,t){var n;t===void 0&&(t=[]);var r=Dt(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=W(r),c=o?[i].concat(i.visualViewport||[],rt(r)?r:[]):r,a=t.concat(c);return o?a:a.concat(we(Ce(c)))}function ot(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function sr(e,t){var n=pe(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Rt(e,t,n){return t===Mt?ot(ir(e,n)):ne(t)?sr(t,n):ot(ar(X(e)))}function lr(e){var t=we(Ce(e)),n=["absolute","fixed"].indexOf(Y(e).position)>=0,r=n&&q(e)?ge(e):e;return ne(r)?t.filter(function(o){return ne(o)&&Ot(o,r)&&K(o)!=="body"}):[]}function cr(e,t,n,r){var o=t==="clippingParents"?lr(e):[].concat(t),i=[].concat(o,[n]),c=i[0],a=i.reduce(function(l,u){var d=Rt(e,u,r);return l.top=re(d.top,l.top),l.right=Ue(d.right,l.right),l.bottom=Ue(d.bottom,l.bottom),l.left=re(d.left,l.left),l},Rt(e,c,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Ht(e){var t=e.reference,n=e.element,r=e.placement,o=r?j(r):null,i=r?fe(r):null,c=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(o){case B:l={x:c,y:t.y-n.height};break;case G:l={x:c,y:t.y+t.height};break;case $:l={x:t.x+t.width,y:a};break;case k:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=o?et(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case ue:l[u]=l[u]-(t[d]/2-n[d]/2);break;case Ee:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function Me(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,c=i===void 0?e.strategy:i,a=n.boundary,l=a===void 0?Nn:a,u=n.rootBoundary,d=u===void 0?Mt:u,h=n.elementContext,_=h===void 0?be:h,p=n.altBoundary,m=p===void 0?!1:p,E=n.padding,v=E===void 0?0:E,w=Nt(typeof v!="number"?v:St(v,ve)),T=_===be?Sn:be,P=e.rects.popper,g=e.elements[m?T:_],I=cr(ne(g)?g:g.contextElement||X(e.elements.popper),l,d,c),M=pe(e.elements.reference),L=Ht({reference:M,element:P,strategy:"absolute",placement:o}),N=ot(Object.assign({},P,L)),S=_===be?N:M,U={top:I.top-S.top+w.top,bottom:S.bottom-I.bottom+w.bottom,left:I.left-S.left+w.left,right:S.right-I.right+w.right},A=e.modifiersData.offset;if(_===be&&A){var R=A[o];Object.keys(U).forEach(function(H){var ie=[$,G].indexOf(H)>=0?1:-1,ae=[B,G].indexOf(H)>=0?"y":"x";U[H]+=R[ae]*ie})}return U}function ur(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,c=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?At:l,d=fe(r),h=d?a?Tt:Tt.filter(function(m){return fe(m)===d}):ve,_=h.filter(function(m){return u.indexOf(m)>=0});_.length===0&&(_=h,{}.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=_.reduce(function(m,E){return m[E]=Me(e,{placement:E,boundary:o,rootBoundary:i,padding:c})[j(E)],m},{});return Object.keys(p).sort(function(m,E){return p[m]-p[E]})}function dr(e){if(j(e)===Se)return[];var t=Re(e);return[Ct(e),t,Ct(t)]}function pr(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,c=n.altAxis,a=c===void 0?!0:c,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,_=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,E=n.allowedAutoPlacements,v=t.options.placement,w=j(v),T=w===v,P=l||(T||!m?[Re(v)]:dr(v)),g=[v].concat(P).reduce(function(me,J){return me.concat(j(J)===Se?ur(t,{placement:J,boundary:d,rootBoundary:h,padding:u,flipVariations:m,allowedAutoPlacements:E}):J)},[]),I=t.rects.reference,M=t.rects.popper,L=new Map,N=!0,S=g[0],U=0;U<g.length;U++){var A=g[U],R=j(A),H=fe(A)===ue,ie=[B,G].indexOf(R)>=0,ae=ie?"width":"height",F=Me(t,{placement:A,boundary:d,rootBoundary:h,altBoundary:_,padding:u}),z=ie?H?$:k:H?G:B;I[ae]>M[ae]&&(z=Re(z));var xe=Re(z),se=[];if(i&&se.push(F[R]<=0),a&&se.push(F[z]<=0,F[xe]<=0),se.every(function(me){return me})){S=A,N=!1;break}L.set(A,se)}if(N)for(var Be=m?3:1,pt=function(J){var Pe=g.find(function(We){var le=L.get(We);if(le)return le.slice(0,J).every(function(ft){return ft})});if(Pe)return S=Pe,"break"},Oe=Be;Oe>0;Oe--){var ke=pt(Oe);if(ke==="break")break}t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}}const fr={name:"flip",enabled:!0,phase:"main",fn:pr,requiresIfExists:["offset"],data:{_skip:!1}};function xt(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Bt(e){return[B,$,G,k].some(function(t){return e[t]>=0})}function hr(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,c=Me(t,{elementContext:"reference"}),a=Me(t,{altBoundary:!0}),l=xt(c,r),u=xt(a,o,i),d=Bt(l),h=Bt(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const _r={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hr};function mr(e,t,n){var r=j(e),o=[k,B].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,c=i[0],a=i[1];return c=c||0,a=(a||0)*o,[k,$].indexOf(r)>=0?{x:a,y:c}:{x:c,y:a}}function vr(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,c=At.reduce(function(d,h){return d[h]=mr(h,t.rects,i),d},{}),a=c[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=c}const Er={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:vr};function br(e){var t=e.state,n=e.name;t.modifiersData[n]=Ht({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const gr={name:"popperOffsets",enabled:!0,phase:"read",fn:br,data:{}};function Ir(e){return e==="x"?"y":"x"}function wr(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,c=n.altAxis,a=c===void 0?!1:c,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,_=n.tether,p=_===void 0?!0:_,m=n.tetherOffset,E=m===void 0?0:m,v=Me(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),w=j(t.placement),T=fe(t.placement),P=!T,g=et(w),I=Ir(g),M=t.modifiersData.popperOffsets,L=t.rects.reference,N=t.rects.popper,S=typeof E=="function"?E(Object.assign({},t.rects,{placement:t.placement})):E,U=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(M){if(i){var H,ie=g==="y"?B:k,ae=g==="y"?G:$,F=g==="y"?"height":"width",z=M[g],xe=z+v[ie],se=z-v[ae],Be=p?-N[F]/2:0,pt=T===ue?L[F]:N[F],Oe=T===ue?-N[F]:-L[F],ke=t.elements.arrow,me=p&&ke?Je(ke):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Lt(),Pe=J[ie],We=J[ae],le=Ie(0,L[F],me[F]),ft=P?L[F]/2-Be-le-Pe-U.mainAxis:pt-le-Pe-U.mainAxis,Uo=P?-L[F]/2+Be+le+We+U.mainAxis:Oe+le+We+U.mainAxis,ht=t.elements.arrow&&ge(t.elements.arrow),Co=ht?g==="y"?ht.clientTop||0:ht.clientLeft||0:0,nn=(H=A==null?void 0:A[g])!=null?H:0,Do=z+ft-nn-Co,Ro=z+Uo-nn,rn=Ie(p?Ue(xe,Do):xe,z,p?re(se,Ro):se);M[g]=rn,R[g]=rn-z}if(a){var on,Ho=g==="x"?B:k,xo=g==="x"?G:$,ce=M[I],qe=I==="y"?"height":"width",an=ce+v[Ho],sn=ce-v[xo],_t=[B,k].indexOf(w)!==-1,ln=(on=A==null?void 0:A[I])!=null?on:0,cn=_t?an:ce-L[qe]-N[qe]-ln+U.altAxis,un=_t?ce+L[qe]+N[qe]-ln-U.altAxis:sn,dn=p&&_t?jn(cn,ce,un):Ie(p?cn:an,ce,p?un:sn);M[I]=dn,R[I]=dn-ce}t.modifiersData[r]=R}}const Mr={name:"preventOverflow",enabled:!0,phase:"main",fn:wr,requiresIfExists:["offset"]};function Tr(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ar(e){return e===W(e)||!q(e)?tt(e):Tr(e)}function yr(e){var t=e.getBoundingClientRect(),n=de(t.width)/e.offsetWidth||1,r=de(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Or(e,t,n){n===void 0&&(n=!1);var r=q(t),o=q(t)&&yr(t),i=X(t),c=pe(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((K(t)!=="body"||rt(i))&&(a=Ar(t)),q(t)?(l=pe(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=nt(i))),{x:c.left+a.scrollLeft-l.x,y:c.top+a.scrollTop-l.y,width:c.width,height:c.height}}function Pr(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var c=[].concat(i.requires||[],i.requiresIfExists||[]);c.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function Lr(e){var t=Pr(e);return Ze.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function Nr(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(o,i){return o.replace(/%s/,i)},e)}var oe='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',Sr='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',kt=["name","enabled","phase","fn","effect","requires","options"];function Ur(e){e.forEach(function(t){[].concat(Object.keys(t),kt).filter(function(n,r,o){return o.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(Q(oe,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(Q(oe,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":Ze.indexOf(t.phase)<0&&console.error(Q(oe,t.name,'"phase"',"either "+Ze.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(Q(oe,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(Q(oe,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(Q(oe,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Q(oe,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+kt.map(function(r){return'"'+r+'"'}).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach(function(r){e.find(function(o){return o.name===r})==null&&console.error(Q(Sr,String(t.name),r,r))})})})}function Cr(e,t){var n=new Set;return e.filter(function(r){var o=t(r);if(!n.has(o))return n.add(o),!0})}function Dr(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Wt="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Rr="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",qt={placement:"bottom",modifiers:[],strategy:"absolute"};function Vt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Hr(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?qt:o;return function(a,l,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},qt,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},h=[],_=!1,p={state:d,setOptions:function(w){var T=typeof w=="function"?w(d.options):w;E(),d.options=Object.assign({},i,d.options,T),d.scrollParents={reference:ne(a)?we(a):a.contextElement?we(a.contextElement):[],popper:we(l)};var P=Lr(Dr([].concat(r,d.options.modifiers)));if(d.orderedModifiers=P.filter(function(A){return A.enabled}),{}.NODE_ENV!=="production"){var g=Cr([].concat(P,d.options.modifiers),function(A){var R=A.name;return R});if(Ur(g),j(d.options.placement)===Se){var I=d.orderedModifiers.find(function(A){var R=A.name;return R==="flip"});I||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var M=Y(l),L=M.marginTop,N=M.marginRight,S=M.marginBottom,U=M.marginLeft;[L,N,S,U].some(function(A){return parseFloat(A)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return m(),p.update()},forceUpdate:function(){if(!_){var w=d.elements,T=w.reference,P=w.popper;if(!Vt(T,P)){({}).NODE_ENV!=="production"&&console.error(Wt);return}d.rects={reference:Or(T,ge(P),d.options.strategy==="fixed"),popper:Je(P)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(A){return d.modifiersData[A.name]=Object.assign({},A.data)});for(var g=0,I=0;I<d.orderedModifiers.length;I++){if({}.NODE_ENV!=="production"&&(g+=1,g>100)){console.error(Rr);break}if(d.reset===!0){d.reset=!1,I=-1;continue}var M=d.orderedModifiers[I],L=M.fn,N=M.options,S=N===void 0?{}:N,U=M.name;typeof L=="function"&&(d=L({state:d,options:S,name:U,instance:p})||d)}}},update:Nr(function(){return new Promise(function(v){p.forceUpdate(),v(d)})}),destroy:function(){E(),_=!0}};if(!Vt(a,l))return{}.NODE_ENV!=="production"&&console.error(Wt),p;p.setOptions(u).then(function(v){!_&&u.onFirstUpdate&&u.onFirstUpdate(v)});function m(){d.orderedModifiers.forEach(function(v){var w=v.name,T=v.options,P=T===void 0?{}:T,g=v.effect;if(typeof g=="function"){var I=g({state:d,name:w,instance:p,options:P}),M=function(){};h.push(I||M)}})}function E(){h.forEach(function(v){return v()}),h=[]}return p}}var xr=[nr,gr,er,Fn,Er,fr,Mr,Zn,_r],Ft=Hr({defaultModifiers:xr});function it(e,t,n,r){t?(e.classList.remove(r),e.classList.add(n)):(e.classList.add(r),e.classList.remove(n))}let V;const Te={},at={SHIFT:"shift-key"};function Gt(){V&&(document.removeEventListener("click",V.globalOnClick),document.removeEventListener("keyup",V.globalOnKeyup),document.removeEventListener("keydown",V.globalOnKeydown),V=null)}function st(){const e=document.querySelectorAll(`${f(s.UTAH_DESIGN_SYSTEM)} ${f(s.POPUP_WRAPPER)}`);Array.from(e).filter(t=>!t.classList.contains(s.POPUP__HIDDEN)).forEach(t=>{const n=t.getAttribute("id");if(n){const r=document.querySelector(`[aria-controls="${n}"]`);r&&r.setAttribute("aria-expanded","false")}it(t,!1,s.POPUP__VISIBLE,s.POPUP__HIDDEN)})}function Br(){V&&Gt(),V={},V.globalOnClick=st,document.addEventListener("click",V.globalOnClick),V.globalOnKeyup=e=>{e.key==="Escape"&&st(),e.shiftKey||(Te[at.SHIFT]=!1),Te[e.key]=!1},document.addEventListener("keyup",V.globalOnKeyup),V.globalOnKeydown=e=>{e.shiftKey&&(Te[at.SHIFT]=!0),Te[e.key]=!0},document.addEventListener("keydown",V.globalOnKeydown)}function kr(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function Ae(e,t,n,r,o){let i=NaN,c=NaN;const a=300,l=150,u=50;t.setAttribute("aria-expanded","false"),t.setAttribute("aria-haspopup",r);function d(_){clearTimeout(i),clearTimeout(c),(!(o!=null&&o.isPerformPopup)||o!=null&&o.isPerformPopup&&o.isPerformPopup())&&(i=window.setTimeout(()=>{Ft(t,n,{placement:(o==null?void 0:o.popupPlacement)||ee.popupPlacement.BOTTOM,modifiers:[{name:"offset",options:{offset:[0,11]}}]}),it(n,!0,s.POPUP__VISIBLE,s.POPUP__HIDDEN),t.setAttribute("aria-expanded","true"),document.querySelectorAll(f(s.TOOLTIP__WRAPPER)).forEach(p=>p.classList.add(s.TOOLTIP__WRAPPER__HIDDEN))},_))}function h(_){clearTimeout(i),clearTimeout(c),(!(o!=null&&o.isPerformPopup)||o.isPerformPopup())&&(c=window.setTimeout(()=>{it(n,!1,s.POPUP__VISIBLE,s.POPUP__HIDDEN),t.setAttribute("aria-expanded","false")},_))}if(o!=null&&o.preventOnClickHandling||(e.addEventListener("focusin",()=>d(l)),e.addEventListener("focusout",()=>h(l))),o!=null&&o.shouldFocusOnHover&&(e.addEventListener("mouseenter",()=>d(a)),e.addEventListener("mouseleave",()=>h(a))),!(o!=null&&o.preventOnClickHandling)){if(t.onclick)throw new Error("popupFocusHandler: button already has onclick");t.onclick=_=>{var m;const p=t.getAttribute("aria-expanded")==="true";(!(o!=null&&o.isPerformPopup)||o.isPerformPopup())&&(_.stopPropagation(),_.preventDefault(),p&&t.getAttribute("aria-expanded")==="true"?(h(u),(m=document.activeElement)==null||m.blur()):(kr()&&st(),d(u))),o!=null&&o.onClick&&o.onClick(_)}}}const Wr=`<div class="popup__wrapper popup__wrapper--hidden">
|
|
130
|
+
`,"We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var d={placement:j(t.placement),variation:pe(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ct(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ct(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const tr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:er,data:{}};var De={passive:!0};function nr(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,c=r.resize,a=c===void 0?!0:c,l=W(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,De)}),a&&l.addEventListener("resize",n.update,De),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,De)}),a&&l.removeEventListener("resize",n.update,De)}}const rr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:nr,data:{}};var or={left:"right",right:"left",bottom:"top",top:"bottom"};function Re(e){return e.replace(/left|right|bottom|top/g,function(t){return or[t]})}var ir={start:"end",end:"start"};function Dt(e){return e.replace(/start|end/g,function(t){return ir[t]})}function nt(e){var t=W(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function rt(e){return de(X(e)).left+nt(e).scrollLeft}function ar(e,t){var n=W(e),r=X(e),o=n.visualViewport,i=r.clientWidth,c=r.clientHeight,a=0,l=0;if(o){i=o.width,c=o.height;var u=yt();(u||!u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:c,x:a+rt(e),y:l}}function sr(e){var t,n=X(e),r=nt(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=ne(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),c=ne(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+rt(e),l=-r.scrollTop;return Y(o||n).direction==="rtl"&&(a+=ne(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:c,x:a,y:l}}function ot(e){var t=Y(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Rt(e){return["html","body","#document"].indexOf(K(e))>=0?e.ownerDocument.body:q(e)&&ot(e)?e:Rt(Ce(e))}function Ie(e,t){var n;t===void 0&&(t=[]);var r=Rt(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=W(r),c=o?[i].concat(i.visualViewport||[],ot(r)?r:[]):r,a=t.concat(c);return o?a:a.concat(Ie(Ce(c)))}function it(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function lr(e,t){var n=de(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Ht(e,t,n){return t===wt?it(ar(e,n)):te(t)?lr(t,n):it(sr(X(e)))}function cr(e){var t=Ie(Ce(e)),n=["absolute","fixed"].indexOf(Y(e).position)>=0,r=n&&q(e)?be(e):e;return te(r)?t.filter(function(o){return te(o)&&Pt(o,r)&&K(o)!=="body"}):[]}function ur(e,t,n,r){var o=t==="clippingParents"?cr(e):[].concat(t),i=[].concat(o,[n]),c=i[0],a=i.reduce(function(l,u){var d=Ht(e,u,r);return l.top=ne(d.top,l.top),l.right=Ue(d.right,l.right),l.bottom=Ue(d.bottom,l.bottom),l.left=ne(d.left,l.left),l},Ht(e,c,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function xt(e){var t=e.reference,n=e.element,r=e.placement,o=r?j(r):null,i=r?pe(r):null,c=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(o){case B:l={x:c,y:t.y-n.height};break;case G:l={x:c,y:t.y+t.height};break;case $:l={x:t.x+t.width,y:a};break;case k:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var u=o?tt(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case ce:l[u]=l[u]-(t[d]/2-n[d]/2);break;case ve:l[u]=l[u]+(t[d]/2-n[d]/2);break}}return l}function Te(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,c=i===void 0?e.strategy:i,a=n.boundary,l=a===void 0?Sn:a,u=n.rootBoundary,d=u===void 0?wt:u,h=n.elementContext,_=h===void 0?Ee:h,p=n.altBoundary,m=p===void 0?!1:p,E=n.padding,v=E===void 0?0:E,T=St(typeof v!="number"?v:Ut(v,me)),w=_===Ee?Un:Ee,P=e.rects.popper,g=e.elements[m?w:_],I=ur(te(g)?g:g.contextElement||X(e.elements.popper),l,d,c),M=de(e.elements.reference),L=xt({reference:M,element:P,strategy:"absolute",placement:o}),N=it(Object.assign({},P,L)),S=_===Ee?N:M,U={top:I.top-S.top+T.top,bottom:S.bottom-I.bottom+T.bottom,left:I.left-S.left+T.left,right:S.right-I.right+T.right},A=e.modifiersData.offset;if(_===Ee&&A){var D=A[o];Object.keys(U).forEach(function(R){var oe=[$,G].indexOf(R)>=0?1:-1,ie=[B,G].indexOf(R)>=0?"y":"x";U[R]+=D[ie]*oe})}return U}function dr(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,c=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?Ot:l,d=pe(r),h=d?a?At:At.filter(function(m){return pe(m)===d}):me,_=h.filter(function(m){return u.indexOf(m)>=0});_.length===0&&(_=h,{}.NODE_ENV!=="production"&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var p=_.reduce(function(m,E){return m[E]=Te(e,{placement:E,boundary:o,rootBoundary:i,padding:c})[j(E)],m},{});return Object.keys(p).sort(function(m,E){return p[m]-p[E]})}function pr(e){if(j(e)===Se)return[];var t=Re(e);return[Dt(e),t,Dt(t)]}function fr(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,c=n.altAxis,a=c===void 0?!0:c,l=n.fallbackPlacements,u=n.padding,d=n.boundary,h=n.rootBoundary,_=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,E=n.allowedAutoPlacements,v=t.options.placement,T=j(v),w=T===v,P=l||(w||!m?[Re(v)]:pr(v)),g=[v].concat(P).reduce(function(_e,J){return _e.concat(j(J)===Se?dr(t,{placement:J,boundary:d,rootBoundary:h,padding:u,flipVariations:m,allowedAutoPlacements:E}):J)},[]),I=t.rects.reference,M=t.rects.popper,L=new Map,N=!0,S=g[0],U=0;U<g.length;U++){var A=g[U],D=j(A),R=pe(A)===ce,oe=[B,G].indexOf(D)>=0,ie=oe?"width":"height",V=Te(t,{placement:A,boundary:d,rootBoundary:h,altBoundary:_,padding:u}),z=oe?R?$:k:R?G:B;I[ie]>M[ie]&&(z=Re(z));var xe=Re(z),ae=[];if(i&&ae.push(V[D]<=0),a&&ae.push(V[z]<=0,V[xe]<=0),ae.every(function(_e){return _e})){S=A,N=!1;break}L.set(A,ae)}if(N)for(var Be=m?3:1,ft=function(J){var ye=g.find(function(We){var se=L.get(We);if(se)return se.slice(0,J).every(function(ht){return ht})});if(ye)return S=ye,"break"},Oe=Be;Oe>0;Oe--){var ke=ft(Oe);if(ke==="break")break}t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}}const hr={name:"flip",enabled:!0,phase:"main",fn:fr,requiresIfExists:["offset"],data:{_skip:!1}};function Bt(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function kt(e){return[B,$,G,k].some(function(t){return e[t]>=0})}function _r(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,c=Te(t,{elementContext:"reference"}),a=Te(t,{altBoundary:!0}),l=Bt(c,r),u=Bt(a,o,i),d=kt(l),h=kt(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":h})}const mr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:_r};function vr(e,t,n){var r=j(e),o=[k,B].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,c=i[0],a=i[1];return c=c||0,a=(a||0)*o,[k,$].indexOf(r)>=0?{x:a,y:c}:{x:c,y:a}}function Er(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,c=Ot.reduce(function(d,h){return d[h]=vr(h,t.rects,i),d},{}),a=c[t.placement],l=a.x,u=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=c}const br={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Er};function gr(e){var t=e.state,n=e.name;t.modifiersData[n]=xt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Ir={name:"popperOffsets",enabled:!0,phase:"read",fn:gr,data:{}};function Tr(e){return e==="x"?"y":"x"}function Mr(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,c=n.altAxis,a=c===void 0?!1:c,l=n.boundary,u=n.rootBoundary,d=n.altBoundary,h=n.padding,_=n.tether,p=_===void 0?!0:_,m=n.tetherOffset,E=m===void 0?0:m,v=Te(t,{boundary:l,rootBoundary:u,padding:h,altBoundary:d}),T=j(t.placement),w=pe(t.placement),P=!w,g=tt(T),I=Tr(g),M=t.modifiersData.popperOffsets,L=t.rects.reference,N=t.rects.popper,S=typeof E=="function"?E(Object.assign({},t.rects,{placement:t.placement})):E,U=typeof S=="number"?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,D={x:0,y:0};if(M){if(i){var R,oe=g==="y"?B:k,ie=g==="y"?G:$,V=g==="y"?"height":"width",z=M[g],xe=z+v[oe],ae=z-v[ie],Be=p?-N[V]/2:0,ft=w===ce?L[V]:N[V],Oe=w===ce?-N[V]:-L[V],ke=t.elements.arrow,_e=p&&ke?et(ke):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Nt(),ye=J[oe],We=J[ie],se=ge(0,L[V],_e[V]),ht=P?L[V]/2-Be-se-ye-U.mainAxis:ft-se-ye-U.mainAxis,Uo=P?-L[V]/2+Be+se+We+U.mainAxis:Oe+se+We+U.mainAxis,_t=t.elements.arrow&&be(t.elements.arrow),Co=_t?g==="y"?_t.clientTop||0:_t.clientLeft||0:0,rn=(R=A==null?void 0:A[g])!=null?R:0,Do=z+ht-rn-Co,Ro=z+Uo-rn,on=ge(p?Ue(xe,Do):xe,z,p?ne(ae,Ro):ae);M[g]=on,D[g]=on-z}if(a){var an,Ho=g==="x"?B:k,xo=g==="x"?G:$,le=M[I],qe=I==="y"?"height":"width",sn=le+v[Ho],ln=le-v[xo],mt=[B,k].indexOf(T)!==-1,cn=(an=A==null?void 0:A[I])!=null?an:0,un=mt?sn:le-L[qe]-N[qe]-cn+U.altAxis,dn=mt?le+L[qe]+N[qe]-cn-U.altAxis:ln,pn=p&&mt?Yn(un,le,dn):ge(p?un:sn,le,p?dn:ln);M[I]=pn,D[I]=pn-le}t.modifiersData[r]=D}}const wr={name:"preventOverflow",enabled:!0,phase:"main",fn:Mr,requiresIfExists:["offset"]};function Ar(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Or(e){return e===W(e)||!q(e)?nt(e):Ar(e)}function yr(e){var t=e.getBoundingClientRect(),n=ue(t.width)/e.offsetWidth||1,r=ue(t.height)/e.offsetHeight||1;return n!==1||r!==1}function Pr(e,t,n){n===void 0&&(n=!1);var r=q(t),o=q(t)&&yr(t),i=X(t),c=de(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((K(t)!=="body"||ot(i))&&(a=Or(t)),q(t)?(l=de(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=rt(i))),{x:c.left+a.scrollLeft-l.x,y:c.top+a.scrollTop-l.y,width:c.width,height:c.height}}function Lr(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var c=[].concat(i.requires||[],i.requiresIfExists||[]);c.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function Nr(e){var t=Lr(e);return Xe.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function Sr(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function Q(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return[].concat(n).reduce(function(o,i){return o.replace(/%s/,i)},e)}var re='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s',Ur='Popper: modifier "%s" requires "%s", but "%s" modifier is not available',Wt=["name","enabled","phase","fn","effect","requires","options"];function Cr(e){e.forEach(function(t){[].concat(Object.keys(t),Wt).filter(function(n,r,o){return o.indexOf(n)===r}).forEach(function(n){switch(n){case"name":typeof t.name!="string"&&console.error(Q(re,String(t.name),'"name"','"string"','"'+String(t.name)+'"'));break;case"enabled":typeof t.enabled!="boolean"&&console.error(Q(re,t.name,'"enabled"','"boolean"','"'+String(t.enabled)+'"'));break;case"phase":Xe.indexOf(t.phase)<0&&console.error(Q(re,t.name,'"phase"',"either "+Xe.join(", "),'"'+String(t.phase)+'"'));break;case"fn":typeof t.fn!="function"&&console.error(Q(re,t.name,'"fn"','"function"','"'+String(t.fn)+'"'));break;case"effect":t.effect!=null&&typeof t.effect!="function"&&console.error(Q(re,t.name,'"effect"','"function"','"'+String(t.fn)+'"'));break;case"requires":t.requires!=null&&!Array.isArray(t.requires)&&console.error(Q(re,t.name,'"requires"','"array"','"'+String(t.requires)+'"'));break;case"requiresIfExists":Array.isArray(t.requiresIfExists)||console.error(Q(re,t.name,'"requiresIfExists"','"array"','"'+String(t.requiresIfExists)+'"'));break;case"options":case"data":break;default:console.error('PopperJS: an invalid property has been provided to the "'+t.name+'" modifier, valid properties are '+Wt.map(function(r){return'"'+r+'"'}).join(", ")+'; but "'+n+'" was provided.')}t.requires&&t.requires.forEach(function(r){e.find(function(o){return o.name===r})==null&&console.error(Q(Ur,String(t.name),r,r))})})})}function Dr(e,t){var n=new Set;return e.filter(function(r){var o=t(r);if(!n.has(o))return n.add(o),!0})}function Rr(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var qt="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Hr="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",Ft={placement:"bottom",modifiers:[],strategy:"absolute"};function Vt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function xr(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,o=t.defaultOptions,i=o===void 0?Ft:o;return function(a,l,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ft,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},h=[],_=!1,p={state:d,setOptions:function(T){var w=typeof T=="function"?T(d.options):T;E(),d.options=Object.assign({},i,d.options,w),d.scrollParents={reference:te(a)?Ie(a):a.contextElement?Ie(a.contextElement):[],popper:Ie(l)};var P=Nr(Rr([].concat(r,d.options.modifiers)));if(d.orderedModifiers=P.filter(function(A){return A.enabled}),{}.NODE_ENV!=="production"){var g=Dr([].concat(P,d.options.modifiers),function(A){var D=A.name;return D});if(Cr(g),j(d.options.placement)===Se){var I=d.orderedModifiers.find(function(A){var D=A.name;return D==="flip"});I||console.error(['Popper: "auto" placements require the "flip" modifier be',"present and enabled to work."].join(" "))}var M=Y(l),L=M.marginTop,N=M.marginRight,S=M.marginBottom,U=M.marginLeft;[L,N,S,U].some(function(A){return parseFloat(A)})&&console.warn(['Popper: CSS "margin" styles cannot be used to apply padding',"between the popper and its reference element or boundary.","To replicate margin, use the `offset` modifier, as well as","the `padding` option in the `preventOverflow` and `flip`","modifiers."].join(" "))}return m(),p.update()},forceUpdate:function(){if(!_){var T=d.elements,w=T.reference,P=T.popper;if(!Vt(w,P)){({}).NODE_ENV!=="production"&&console.error(qt);return}d.rects={reference:Pr(w,be(P),d.options.strategy==="fixed"),popper:et(P)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(A){return d.modifiersData[A.name]=Object.assign({},A.data)});for(var g=0,I=0;I<d.orderedModifiers.length;I++){if({}.NODE_ENV!=="production"&&(g+=1,g>100)){console.error(Hr);break}if(d.reset===!0){d.reset=!1,I=-1;continue}var M=d.orderedModifiers[I],L=M.fn,N=M.options,S=N===void 0?{}:N,U=M.name;typeof L=="function"&&(d=L({state:d,options:S,name:U,instance:p})||d)}}},update:Sr(function(){return new Promise(function(v){p.forceUpdate(),v(d)})}),destroy:function(){E(),_=!0}};if(!Vt(a,l))return{}.NODE_ENV!=="production"&&console.error(qt),p;p.setOptions(u).then(function(v){!_&&u.onFirstUpdate&&u.onFirstUpdate(v)});function m(){d.orderedModifiers.forEach(function(v){var T=v.name,w=v.options,P=w===void 0?{}:w,g=v.effect;if(typeof g=="function"){var I=g({state:d,name:T,instance:p,options:P}),M=function(){};h.push(I||M)}})}function E(){h.forEach(function(v){return v()}),h=[]}return p}}var Br=[rr,Ir,tr,Gn,br,hr,wr,Xn,mr],Gt=xr({defaultModifiers:Br});function at(e,t,n,r){t?(e.classList.remove(r),e.classList.add(n)):(e.classList.add(r),e.classList.remove(n))}let F;const Me={},st={SHIFT:"shift-key"};function $t(){F&&(document.removeEventListener("click",F.globalOnClick),document.removeEventListener("keyup",F.globalOnKeyup),document.removeEventListener("keydown",F.globalOnKeydown),F=null)}function lt(){const e=document.querySelectorAll(`${f(s.UTAH_DESIGN_SYSTEM)} ${f(s.POPUP_WRAPPER)}`);Array.from(e).filter(t=>!t.classList.contains(s.POPUP__HIDDEN)).forEach(t=>{const n=t.getAttribute("id");if(n){const r=document.querySelector(`[aria-controls="${n}"]`);r&&r.setAttribute("aria-expanded","false")}at(t,!1,s.POPUP__VISIBLE,s.POPUP__HIDDEN)})}function kr(){F&&$t(),F={},F.globalOnClick=lt,document.addEventListener("click",F.globalOnClick),F.globalOnKeyup=e=>{e.key==="Escape"&<(),e.shiftKey||(Me[st.SHIFT]=!1),Me[e.key]=!1},document.addEventListener("keyup",F.globalOnKeyup),F.globalOnKeydown=e=>{e.shiftKey&&(Me[st.SHIFT]=!0),Me[e.key]=!0},document.addEventListener("keydown",F.globalOnKeydown)}function Wr(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function we(e,t,n,r,o){let i=NaN,c=NaN;const a=300,l=150,u=50;t.setAttribute("aria-expanded","false"),t.setAttribute("aria-haspopup",r);function d(_){clearTimeout(i),clearTimeout(c),(!(o!=null&&o.isPerformPopup)||o!=null&&o.isPerformPopup&&o.isPerformPopup())&&(i=window.setTimeout(()=>{Gt(t,n,{placement:(o==null?void 0:o.popupPlacement)||Ze.BOTTOM,modifiers:[{name:"offset",options:{offset:[0,11]}}]}),at(n,!0,s.POPUP__VISIBLE,s.POPUP__HIDDEN),t.setAttribute("aria-expanded","true"),document.querySelectorAll(f(s.TOOLTIP__WRAPPER)).forEach(p=>p.classList.add(s.TOOLTIP__WRAPPER__HIDDEN))},_))}function h(_){clearTimeout(i),clearTimeout(c),(!(o!=null&&o.isPerformPopup)||o.isPerformPopup())&&(c=window.setTimeout(()=>{at(n,!1,s.POPUP__VISIBLE,s.POPUP__HIDDEN),t.setAttribute("aria-expanded","false")},_))}if(o!=null&&o.preventOnClickHandling||(e.addEventListener("focusin",()=>d(l)),e.addEventListener("focusout",()=>h(l))),o!=null&&o.shouldFocusOnHover&&(e.addEventListener("mouseenter",()=>d(a)),e.addEventListener("mouseleave",()=>h(a))),!(o!=null&&o.preventOnClickHandling)){if(t.onclick)throw new Error("popupFocusHandler: button already has onclick");t.onclick=_=>{var m;const p=t.getAttribute("aria-expanded")==="true";(!(o!=null&&o.isPerformPopup)||o.isPerformPopup())&&(_.stopPropagation(),_.preventDefault(),p&&t.getAttribute("aria-expanded")==="true"?(h(u),(m=document.activeElement)==null||m.blur()):(Wr()&<(),d(u))),o!=null&&o.onClick&&o.onClick(_)}}}const qr=`<div class="popup__wrapper popup__wrapper--hidden">
|
|
131
131
|
<div class="popup__content">
|
|
132
132
|
<div class="popup__arrow" data-popper-arrow></div>
|
|
133
133
|
</div>
|
|
134
134
|
</div>
|
|
135
|
-
`;function
|
|
136
|
-
`,
|
|
137
|
-
`,
|
|
138
|
-
`,
|
|
139
|
-
`,
|
|
140
|
-
`,
|
|
135
|
+
`;function ct(e,t){const n=e.getAttribute("id");if(!n)throw new Error("renderPopup: labelledByElement does not have an `id` attribute");const r=C();e.setAttribute("aria-controls",r);const o=b(qr);if(o.setAttribute("id",r),o.setAttribute("aria-labelledby",n),t!=null&&t.removePopupArrow){const i=o.querySelector(f(s.POPUP_ARROW));if(!i)throw new Error("renderPopup(): popup arrow missing (I wanted to remove it!!)");i.remove()}return o}function Fr(e){const t=e.closest("li");if(!t)throw console.error("element",e),new Error("toggleChildMenuExpansion: parent not found for child");t.querySelectorAll(":scope > ul").forEach(n=>{var i;const r=(i=n.closest("li"))==null?void 0:i.querySelector(f(s.POPUP_MENU__BUTTON_TITLE));if(!r)throw new Error("toggleChildMenuExpansion: button not found");const o=r.querySelector(`:scope > ${f(s.POPUP_MENU__CHEVRON)}`);if(!o)throw new Error("toggleChildMenuExpansion: chevron not found");n.classList.toggle(s.VISUALLY_HIDDEN),n.classList.contains(s.VISUALLY_HIDDEN)?(r.setAttribute("aria-expanded","false"),o.classList.add(s.IS_CLOSED),o.classList.remove(s.IS_OPEN)):(r.setAttribute("aria-expanded","true"),o.classList.remove(s.IS_CLOSED),o.classList.add(s.IS_OPEN))})}function Vr(e){return t=>{t.preventDefault(),t.stopPropagation(),Fr(e)}}function jt(){const e=b(Pn);return e.classList.add(s.IS_CLOSED),e}function Gr(e,t,n){var h,_;const r=b(Nn),o=r.querySelector(f(s.POPUP_MENU__TITLE));if(!o)throw new Error("renderPopupMenuItem: menuItemTitleWrapper not found");const i=r.querySelector(f(s.POPUP_MENU__BUTTON_TITLE));if(!i)throw new Error("renderPopupMenuItem: menuButton not found");const c=r.querySelector(f(s.POPUP_MENU__LINK_TITLE));if(!c)throw new Error("renderPopupMenuItem: aHref not found");const a=r.querySelector(f(s.POPUP_MENU__PLAIN_TITLE));if(!a)throw new Error("renderPopupMenuItem: plainTitle not found");const l=r.querySelector(f(s.POPUP_MENU__DIVIDER));if(!l)throw new Error("renderPopupMenuItem: menuDivider not found");const u=r.querySelector(`button ${f(s.POPUP_MENU__LINK_TEXT)}`);if(!u)throw new Error("renderPopupMenuItem: titleSpanButton not found");const d=r.querySelector(`a ${f(s.POPUP_MENU__LINK_TEXT)}`);if(!d)throw new Error("renderPopupMenuItem: titleSpanLink not found");if(t.actionMenu){let p;switch(n.childrenMenuType){case x.FLYOUT:{p=jt(),i.appendChild(p),i.setAttribute("id",C());const m=ut({menuItems:t.actionMenu,title:t.title},i,{...n,removePopupArrow:!0});r.appendChild(m),we(r,i,m,"menu",{popupPlacement:Ze.RIGHT_START,preventOnClickHandling:!0,shouldFocusOnHover:!0}),c.remove(),a.remove();break}case x.INLINE:{const m=fe(t.actionMenu,n),E=C();m.setAttribute("id",E),m.classList.add(s.VISUALLY_HIDDEN),r.appendChild(m),i.onclick=Vr(i),i.setAttribute("aria-expanded","false"),i.setAttribute("aria-controls",E),p=jt(),i.appendChild(p),c.remove(),a.remove(),r.addEventListener("focusin",v=>{var T,w,P,g;for(let I=(T=v.target)==null?void 0:T.closest("ul");I;I=(w=I.parentElement)==null?void 0:w.closest("ul"))I.classList.remove(s.VISUALLY_HIDDEN),i.setAttribute("aria-expanded","true"),v.target!==i&&((P=p==null?void 0:p.classList)==null||P.remove(s.IS_CLOSED),(g=p==null?void 0:p.classList)==null||g.add(s.IS_OPEN))});break}case x.MEGA_MENU:{const m=fe(t.actionMenu,n),E=C();m.setAttribute("id",E),r.appendChild(m),c.remove(),i.remove(),a.appendChild(document.createTextNode(t.title));break}default:throw new Error(`renderPopupMenuItem: childrenMenuType unknown '${t.actionMenu}'`)}l.remove()}else if(t.actionFunction)i.onclick=t.actionFunction,c.remove(),l.remove(),a.remove();else if(t.actionUrl)c.setAttribute("href",t.actionUrl.url),i.remove(),l.remove(),a.remove();else if(t.actionFunctionUrl)c.setAttribute("href",t.actionFunctionUrl.url),c.onclick=p=>{var m,E;(m=t.actionFunctionUrl)!=null&&m.skipHandleEvent||(p.stopPropagation(),p.preventDefault()),(E=t.actionFunctionUrl)==null||E.actionFunction(p)},i.remove(),l.remove(),a.remove();else if(t.isDivider)o.remove(),r.setAttribute("aria-hidden","true"),r.setAttribute("role","separator");else throw console.error(t),new Error("renderPopupMenuItem: popupMenuItem must have either actionMenu, actionFunction, actionUrl, or isDivider (popupMenuItem.title)");if(!t.isDivider&&(u.appendChild(document.createTextNode(t.title)),d.appendChild(document.createTextNode(t.title)),(h=t.actionUrl)!=null&&h.openInNewTab||(_=t.actionFunctionUrl)!=null&&_.openInNewTab)){c.setAttribute("target","_blank");const p=b(Mt);u.appendChild(p),d.appendChild(p)}return(t.isSelected||t.actionMenu&&Ne(t.actionMenu,["actionMenu"],p=>!!p.isSelected))&&(i.classList.add(s.MENU_ITEM__SELECTED),c.classList.add(s.MENU_ITEM__SELECTED)),t.isSelected?r.classList.add(s.MENU_ITEM__SELECTED):r.classList.remove(s.MENU_ITEM__SELECTED),e.appendChild(r),r}function fe(e,t){const n=b(Ln);return e.forEach(r=>Gr(n,r,t)),n}function ut(e,t,n){const r=ct(t,{removePopupArrow:n.removePopupArrow}),o=r.querySelector(f(s.POPUP_CONTENT_WRAPPER));if(!o)throw new Error("renderPopupMenu: contentWrapper not found");const i=fe(e.menuItems,n);return i.setAttribute("aria-label",e.title),o.appendChild(i),r}function $r(e){const t=b(On);t.getAttribute("id")||t.setAttribute("id",C());const n=document.createTextNode(e.title),r=t instanceof HTMLCollection?t[0]:t;e.showTitle&&r.classList.add(s.ACTION_ITEM__ICON_BUTTON_TITLE),r.classList.add(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER),r.classList.remove(s.ACTION_ITEM);const o=r.querySelector(f(s.ACTION_ITEM__TITLE));if(!o)throw new Error("renderActionItem: titleDiv not found");o.appendChild(n),e.showTitle?o.classList.remove(s.VISUALLY_HIDDEN):o.classList.add(s.VISUALLY_HIDDEN);const i=t.querySelector(f(s.ACTION_ITEM__ICON_BUTTON));if(!i)throw new Error("renderActionItem: iconButton not found");e.className&&i.classList.add(e.className);const c=$e(e.badge);c&&i.appendChild(c);const a=b(e.icon);a.setAttribute("role","presentation"),i.appendChild(a);let l=null;if(e.actionFunction)i.onclick=e.actionFunction;else if(e.actionDom){const u=C();i.setAttribute("id",u),l=b(typeof e.actionDom=="function"?e.actionDom():e.actionDom)}else if(e.actionPopupMenu){const u=C();i.setAttribute("id",u),l=b(yn);const d=l.querySelector(f(s.POPUP_MENU_WRAPPER__WRAPPER_TITLE));if(!d)throw new Error("renderMobileActionItem: actionItemContentTitle not found");d.appendChild(document.createTextNode(e.actionPopupMenu.title));const h=fe(e.actionPopupMenu.menuItems,{childrenMenuType:x.INLINE});l.appendChild(h)}else throw console.error(e),new Error("Action Item: no defined action; must have either actionFunction, actionDom, or actionPopupMenu");return{actionItemElement:t,actionItemContent:l}}function jr(){var i,c,a;const e=document.getElementById(s.MOBILE_MENU_ACTON_BAR__HOME_ID);if(!e)throw new Error("renderMobileActionItems: homeActionItem not found");const t=e.closest(f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));if(!t)throw new Error("renderMobileActionItems: homeActionItemWrapper not found");const r=!!O().utahId?document.getElementById(s.MOBILE_MENU_ACTON_BAR__PROFILE_ID):null,o=(i=r==null?void 0:r.closest)==null?void 0:i.call(r,f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));(a=(c=[...O().actionItems||[]].reverse())==null?void 0:c.map(l=>({actionItem:l,...$r(l)})))==null||a.forEach(({actionItem:l,actionItemContent:u,actionItemElement:d})=>{let h;switch(l.mobileMenuLocation){case"left":h=t;break;case"none":h=null;break;case"right":default:h=o||t;break}if(h&&(h.after(d),u)){const _=Ge(u);let p=null;l.actionDom?p="dialog":l.actionPopupMenu&&(p="menu"),Ke(d,_,d,{ariaHasPopupType:p,shouldOnClickCloseMenu:!1})}})}const Yr=`<h1 class="utds-logo-wrapper"></h1>
|
|
136
|
+
`,zr=`<div class="utah-design-system utds-header" role="banner" aria-label="Utah.gov Header"></div>
|
|
137
|
+
`,Kr=`<span class="utds-logo-vert-line"></span>
|
|
138
|
+
`,Zr=`<div class="utds-citizen-experience-wrapper"></div>
|
|
139
|
+
`,Xr=`<div class="utds-action-items-wrapper"></div>
|
|
140
|
+
`,Qr=`<div class="utds-header-action-item">
|
|
141
141
|
<button type="button" class="icon-button utds-header-action-item__icon-button">
|
|
142
142
|
<div class="utds-header-action-item__title visually-hidden"></div>
|
|
143
143
|
</button>
|
|
144
144
|
</div>
|
|
145
|
-
`,
|
|
145
|
+
`,Jr=`<div class="tooltip__wrapper tooltip__wrapper--hidden" aria-hidden="true">
|
|
146
146
|
<div class="tooltip__content">
|
|
147
147
|
<div class="tooltip__arrow" data-popper-arrow></div>
|
|
148
148
|
</div>
|
|
149
149
|
</div>
|
|
150
|
-
`;let
|
|
151
|
-
`,
|
|
152
|
-
`,
|
|
150
|
+
`;let he=NaN;function dt(e,t){const n=b(Jr),r=n.querySelector(f(s.TOOLTIP__CONTENT));if(!r)throw new Error("hookupToolTip: toolTipContent not found");r.appendChild(t),e.appendChild(n);const o=Gt(e,n,{placement:Ze.BOTTOM,modifiers:[{name:"offset",options:{offset:[0,5]}}]});if(e.onmouseenter||e.onmouseleave)throw new Error("hookupToolTip: element already has an onmouseenter and/or onmouseleave event");let i=NaN;e.onmouseenter=()=>{clearTimeout(i),i=window.setTimeout(()=>{clearTimeout(he),he=-1;const c=e.querySelector(f(s.POPUP_WRAPPER));(!c||c.classList.contains(s.POPUP__HIDDEN))&&(n.classList.remove(s.TOOLTIP__WRAPPER__HIDDEN),n.classList.add(s.TOOLTIP__WRAPPER__VISIBLE),o.update())},he?0:500)},e.onmouseleave=()=>{clearTimeout(i),n.classList.add(s.TOOLTIP__WRAPPER__HIDDEN),n.classList.remove(s.TOOLTIP__WRAPPER__VISIBLE),clearTimeout(he),he=window.setTimeout(()=>{he=NaN},500)}}function eo(e){const t=b(Qr),n=document.createTextNode(e.title),r=t instanceof HTMLCollection?t[0]:t;e.showTitle&&r.classList.add(s.ACTION_ITEM__ICON_BUTTON_TITLE);const o=r.querySelector(f(s.ACTION_ITEM__TITLE));if(!o)throw new Error("renderActionItem: titleDiv not found");o.appendChild(n),e.showTitle?o.classList.remove(s.VISUALLY_HIDDEN):o.classList.add(s.VISUALLY_HIDDEN);const i=t.querySelector(f(s.ACTION_ITEM__ICON_BUTTON));if(!i)throw new Error("renderActionItem: iconButton not found");e.className&&i.classList.add(e.className);const c=$e(e.badge);c&&i.appendChild(c);const a=b(e.icon);if(a.setAttribute("role","presentation"),i.appendChild(a),!(i instanceof HTMLElement))throw new Error("renderActionItem: iconButton is not an HTMLElement");if(e.actionFunction)i.onclick=e.actionFunction;else if(e.actionDom){const l=C();i.setAttribute("id",l);const u=ct(i),d=u.querySelector(f(s.POPUP_CONTENT_WRAPPER));if(!d)throw new Error("renderPopupMenu: contentWrapper not found");d.appendChild(b(typeof e.actionDom=="function"?e.actionDom():e.actionDom)),t.appendChild(u),we(r,i,u,"dialog",void 0)}else if(e.actionPopupMenu){const l=C();i.setAttribute("id",l);const u=ut(e.actionPopupMenu,i,{childrenMenuType:x.INLINE});t.appendChild(u),we(r,i,u,"menu",void 0)}else throw console.error(e),new Error("Action Item: no defined action; must have either actionFunction, actionDom, or actionPopupMenu");return dt(t,document.createTextNode(e.title)),t}function to(){var n,r;const{actionItems:e}=O();let t=null;return e!=null&&e.length&&(t=b(Xr),(r=(n=O().actionItems)==null?void 0:n.map(o=>eo(o)))==null||r.forEach(o=>t.appendChild(o))),t}const no=`<button class="utds-utah-id__button button--solid" type="button">UtahID Sign In</button>
|
|
151
|
+
`,Yt=`<div class="utds-utah-id-wrapper"></div>
|
|
152
|
+
`,Ae={PROFILE:"https://id.utah.gov",SIGN_IN:`https://id.utah.gov/login?goto=${window.location}`,SIGN_OUT:`https://id.utah.gov/logout?goto=${window.location}`,USER_INFO:"https://id.utah.gov/api/userInfo"},ro=`<div class="vertical-menu__wrapper">
|
|
153
153
|
<div class="vertical-menu__wrapper-title"></div>
|
|
154
154
|
</div>
|
|
155
|
-
`;function
|
|
155
|
+
`;function zt(e,t){const n=b(ro),r=n.querySelector(f(s.POPUP_MENU_WRAPPER__WRAPPER_TITLE));if(!r)throw new Error("renderMenuWithTitle: menuTitleDiv not found");return r.appendChild(document.createTextNode(t)),n.appendChild(e),n}let y=null;function Kt(e){y=e,document.querySelectorAll(f(s.UTAH_ID__BUTTON)).forEach(n=>{var r;if(n){if(n.innerHTML="",y!=null&&y.userInfo&&((r=y.userInfo)!=null&&r.authenticated)){const c=document.createElement("span");c.appendChild(document.createTextNode("UtahID Account:")),c.classList.add(s.VISUALLY_HIDDEN),n.appendChild(c),n.appendChild(document.createTextNode(`Hello, ${y.userInfo.first||""}`))}else n.appendChild(document.createTextNode("UtahID Sign In"));const o=n.getAttribute("aria-controls");if(!o)throw new Error(`authChangedEventHandler: popup id for button not found - ${o}`);const i=document.getElementById(o);i&&pt(n,i)}})}function pt(e,t){var n;e&&t&&(!!(y!=null&&y.isDefinitive)&&!!((n=y==null?void 0:y.userInfo)!=null&&n.authenticated)?(e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false"),t.removeAttribute("aria-hidden")):(e.removeAttribute("aria-haspopup"),e.removeAttribute("aria-expanded"),t.setAttribute("aria-hidden","true")))}function Zt(){const e=b(no);return e.setAttribute("id",C()),y&&Kt(y),e}function Xt(e){var l;const t=O(),n=t.utahId!==!1&&t.utahId!==!0&&t.utahId.onProfile,r=t.utahId!==!1&&t.utahId!==!0&&t.utahId.onSignOut,o=[...t.utahId!==!0&&t.utahId!==!1&&((l=t.utahId)==null?void 0:l.menuItems)||[]];o.length&&o.push({isDivider:!0,title:"--divider--"});const i=[...o,{actionUrl:n?void 0:{url:Ae.PROFILE,openInNewTab:!0},actionFunction:n||void 0,className:"external-link",title:"UtahID Profile"},{actionUrl:r?void 0:{url:Ae.SIGN_OUT},actionFunction:r||void 0,title:"Sign Out"}],c=fe(i,{childrenMenuType:x.INLINE}),a=e?zt(c,"Utah ID Menu"):c;return a.setAttribute("aria-label","Utah Id Menu"),a.setAttribute("id",C()),a}function oo(){const e=b(Yt),t=Zt();t.setAttribute("id",C()),e.appendChild(t);const n=Xt(!1),r=ct(t),o=r.querySelector(f(s.POPUP_CONTENT_WRAPPER));if(!o)throw new Error("renderUtahIdForDesktop: contentWrapper not found");o.appendChild(n),e.appendChild(r),pt(t,r);const i=O(),c=i.utahId!==!1&&i.utahId!==!0&&i.utahId.onSignIn;return we(e,t,r,"menu",{isPerformPopup:()=>{var a;return!!(y!=null&&y.isDefinitive)&&!!((a=y==null?void 0:y.userInfo)!=null&&a.authenticated)},onClick:a=>{var l;(!(y!=null&&y.isDefinitive)||!((l=y==null?void 0:y.userInfo)!=null&&l.authenticated))&&(c?c(a):(a.preventDefault(),a.stopPropagation(),window.location.href=Ae.SIGN_IN))}}),e}function io(){const e=b(Yt),t=Zt(),n=t.getAttribute("id");if(!n)throw new Error("renderUtahIdForMobile: utahIdButton has no id");e.appendChild(t);const r=Xt(!0),o=r.getAttribute("id");if(!o)throw new Error("renderUtahIdForMobile: utahIdPopupMenu has no id");return e.appendChild(r),t.setAttribute("aria-controls",o),r.setAttribute("aria-labelledby",n),pt(t,r),{button:t,menu:r}}function ao(){const e=b(Zr),t=to();return t&&e.appendChild(t),O().utahId!==!1&&e.appendChild(oo()),e}const so=`<div class="utds-title-wrapper">
|
|
156
156
|
<div class="utds-title-wrapper__logo"></div>
|
|
157
157
|
<div class="utds-title-wrapper__title"></div>
|
|
158
158
|
</div>
|
|
159
|
-
`,
|
|
159
|
+
`,lo=`<a class="utds-title-wrapper">
|
|
160
160
|
<div class="utds-title-wrapper__logo"></div>
|
|
161
161
|
<div class="utds-title-wrapper__title"></div>
|
|
162
162
|
</a>
|
|
163
|
-
`;function
|
|
163
|
+
`;function co(){const e=O().titleURL,t=b(e?lo:so);if(!t)throw new Error("LogoTitle: titleWrapper is null");e&&t.setAttribute("href",e);const n=t.querySelector(f(s.TITLE__LOGO));if(!n)throw new Error("LogoTitle: logoWrapper is null");const r=O().logo,o=O().showTitle,i=O().title;if(r){let l;Ve(r)?l=b(r):l=r,l.setAttribute("role","presentation"),n.appendChild(l)}else t.removeChild(n);const c=document.createTextNode(i),a=t.querySelector(f(s.TITLE__TITLE));return a==null||a.appendChild(c),!o&&r&&(a==null||a.classList.add(s.VISUALLY_HIDDEN)),t}const uo=`<div class="utah-logo-wrapper">
|
|
164
164
|
<button class="utah-logo-svg" id="utah-logo-svg" aria-haspopup="dialog">
|
|
165
165
|
<span class="visually-hidden" id="utah-logo-description">An official website of the State of Utah. Click to learn
|
|
166
166
|
more.</span>
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
</svg>
|
|
186
186
|
</button>
|
|
187
187
|
</div>
|
|
188
|
-
`,
|
|
188
|
+
`,po=`<div class="utah-logo-wrapper">
|
|
189
189
|
<button class="utah-logo-svg" id="utah-logo-svg" aria-haspopup="dialog">
|
|
190
190
|
<span class="visually-hidden" id="utah-logo-description">An official website of the State of Utah. Click to learn
|
|
191
191
|
more.</span>
|
|
@@ -206,18 +206,18 @@
|
|
|
206
206
|
</svg>
|
|
207
207
|
</button>
|
|
208
208
|
</div>
|
|
209
|
-
`,
|
|
209
|
+
`,fo=`<div class="utds-official-website-hover__wrapper">
|
|
210
210
|
How do I know itβs official?<br />
|
|
211
211
|
Learn more.
|
|
212
212
|
</div>
|
|
213
|
-
`;function
|
|
213
|
+
`;function ho(){let e;switch(O().size){case ee.LARGE:e=uo;break;case ee.SMALL:case ee.MEDIUM:e=po;break;default:throw new Error(`Unknown settings size: '${O().size}'`)}const t=b(e);if(!t.querySelector(f(s.LOGO_SVG)))throw new Error("UtahLogo: logoButton not found");return t.setAttribute("id",C()),dt(t,b(fo)),t}function _o(){var n;const e=b(zr);e.classList.add(`utds-header--${((n=O().size)==null?void 0:n.toLowerCase())||ee.MEDIUM}`);const t=b(Yr);return e.appendChild(t),t.appendChild(ho()),t.appendChild(b(Kr)),t.appendChild(co()),e.appendChild(ao()),e}const mo=`<li class="menu-item">
|
|
214
214
|
<span class="menu-item__title">
|
|
215
215
|
<button class="menu-item__button-title" type="button"></button>
|
|
216
216
|
<a class="menu-item__link-title"></a>
|
|
217
217
|
<span class="menu-chiclet"></span>
|
|
218
218
|
</span>
|
|
219
219
|
</li>
|
|
220
|
-
`,
|
|
220
|
+
`,vo=`<div class="utah-design-system main-menu__outer">
|
|
221
221
|
<div class="main-menu__wrapper">
|
|
222
222
|
<nav class="horizontal-menu main-menu__nav">
|
|
223
223
|
<h2 class="main-menu__title visually-hidden"></h2>
|
|
@@ -244,7 +244,7 @@
|
|
|
244
244
|
</button>
|
|
245
245
|
</div>
|
|
246
246
|
</div>
|
|
247
|
-
`,
|
|
247
|
+
`,Eo=`<div class="utah-design-system" id="search-modal">
|
|
248
248
|
<div class="search-modal__close-button-wrapper">
|
|
249
249
|
<button type="button" class="search-modal__close-button button icon-button icon-button--borderless">
|
|
250
250
|
<span class="utds-icon-before-x-icon" aria-hidden="true"></span>
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
</div>
|
|
270
270
|
<div class="search-backdrop modal-backdrop backdrop-dark"></div>
|
|
271
271
|
</div>
|
|
272
|
-
`;function He(){const e=document.getElementById(s.SEARCH__SEARCH_MODAL);if(!e)throw new Error("closSearchModal: searchModal not found");e.remove();const t=document.querySelector(f(s.MAIN_MENU__SEARCH));if(!t)throw new Error("closSearchModal: searchIcon not found");t.focus()}function
|
|
272
|
+
`;function He(){const e=document.getElementById(s.SEARCH__SEARCH_MODAL);if(!e)throw new Error("closSearchModal: searchModal not found");e.remove();const t=document.querySelector(f(s.MAIN_MENU__SEARCH));if(!t)throw new Error("closSearchModal: searchIcon not found");t.focus()}function bo(){const e=b(Eo),t=e.querySelector(f(s.SEARCH__SEARCH_BACKDROP));if(!t)throw new Error("showSearchModal: backdrop not found");const n=e.querySelector(f(s.SEARCH__SEARCH_CLOSE_BUTTON));if(!n)throw new Error("showSearchModal: closeButton not found");const r=e.querySelector(f(s.SEARCH__SEARCH_BUTTON));if(!r)throw new Error("showSearchModal: searchButton not found");const o=e.querySelector(f(s.SEARCH__SEARCH_BUTTON_WRAPPER));if(!o)throw new Error("showSearchModal: searchButtonWrapper not found");const i=e.querySelector(f(s.SEARCH__SEARCH_INPUT));if(!i)throw new Error("showSearchModal: searchInput not found");r.onclick=a=>{var l,u;a.preventDefault(),a.stopPropagation(),He(),(u=(l=O()).onSearch)==null||u.call(l,i.value)},n.onclick=a=>{a.preventDefault(),a.stopPropagation(),He()},t.onclick=a=>{a.preventDefault(),a.stopPropagation(),He()},document.body.appendChild(e),i.focus(),i.oninput=()=>{o.classList.remove(s.VISUALLY_HIDDEN)},r.onfocus=()=>{o.classList.remove(s.VISUALLY_HIDDEN)},e.onkeyup=a=>{(a.code==="Escape"||a.key==="Escape")&&(a.preventDefault(),a.stopPropagation(),He())},n.addEventListener("focusout",a=>{a.preventDefault(),a.stopPropagation(),Me[st.SHIFT]?r.focus():i.focus()});const c=e.querySelector(".search-modal__hidden-last-focusable");if(!c)throw new Error("showSearchModal: hiddenLastFocusableButton not found");c.addEventListener("focusin",a=>{a.preventDefault(),a.stopPropagation(),n.focus()})}function go(){var l;const e=O(),t=b(vo),n=t.querySelector(f(s.MAIN_MENU__NAV));if(!n)throw new Error("renderMainMenu(): mainMenu not created");const r=n.querySelector(f(s.MAIN_MENU__TITLE));if(!r)throw new Error("renderMainMenu(): titleTag not found");const o="main-menu__nav";n.setAttribute("aria-labelledby",o),r.setAttribute("id",o),r.innerHTML=e.mainMenu.title;const i=n.querySelector(f(s.MAIN_MENU__MENU_TOP));if(!i)throw new Error("renderMainMenu(): mainMenuTop not found");e.mainMenu.menuItems.forEach(u=>{var m,E;const d=b(mo);i.appendChild(d);const h=d.querySelector(f(s.MENU_ITEM__TITLE));if(!h)throw new Error(`renderMainMenu(): sub menu title not found for ${u.title}`);const _=h.querySelector(f(s.MENU_ITEM__BUTTON_TITLE));if(!_)throw new Error(`renderMainMenu(): button title not found for ${u.title}`);_.setAttribute("id",`${s.MENU_ITEM__BUTTON_TITLE}__${u.title}-${C()}`);const p=h.querySelector(f(s.MENU_ITEM__LINK_TITLE));if(!p)throw new Error(`renderMainMenu(): link title not found for ${u.title}`);if((u.isSelected||u.actionMenu&&Ne(u.actionMenu,["actionMenu"],v=>!!v.isSelected))&&(_.classList.add(s.MENU_ITEM__SELECTED),p.classList.add(s.MENU_ITEM__SELECTED)),u.actionMenu){_.innerHTML=u.title,p.remove();const v={menuItems:u.actionMenu,title:u.title},T=ut(v,_,{childrenMenuType:u.childrenMenuType||x.FLYOUT});d.appendChild(T),we(d,_,T,"menu",{shouldFocusOnHover:!0});let w;switch(u.childrenMenuType){case x.INLINE:w=s.MENU_ITEM__INLINE;break;case x.MEGA_MENU:w=s.MENU_ITEM__MEGA_MENU;break;case x.FLYOUT:default:w=s.MENU_ITEM__FLY_OUT;break}d.classList.add(w)}else if(u.actionFunction)_.innerHTML=u.title,_.onclick=u.actionFunction,p.remove();else if(u.actionFunctionUrl)p.innerHTML=u.title,p.setAttribute("href",u.actionFunctionUrl.url),p.onclick=v=>{var T,w;(T=u.actionFunctionUrl)!=null&&T.skipHandleEvent||(v.stopPropagation(),v.preventDefault()),(w=u.actionFunctionUrl)==null||w.actionFunction(v)},_.remove();else if(u.actionUrl)p.innerHTML=u.title,p.setAttribute("href",u.actionUrl.url),_.remove();else throw new Error(`renderMainMenu(): menuItem is missing an action: ${u.title}`);((m=u.actionUrl)!=null&&m.openInNewTab||(E=u.actionFunctionUrl)!=null&&E.openInNewTab)&&(p.setAttribute("target","_blank"),p.appendChild(b(Mt)))});let c=null;if(e.utahId){const{button:u,menu:d}=io();c=d;const h=t.querySelector(f(s.MOBILE__UTAH_ID));if(!h)throw new Error("renderMainMenu: utahIdButtonWrapper not found");h.appendChild(u)}const a=t.querySelector(f(s.MAIN_MENU__SEARCH));if(!a||!(a instanceof HTMLElement))throw new Error("renderMainMenu: searchIcon not found");if(e.onSearch){if(dt(a,document.createTextNode("Search")),a.onclick)throw new Error("searchIcon already has onclick");a.onclick=()=>bo()}else(l=a.parentElement)==null||l.insertBefore(b('<div class="main-menu__search-placeholder">'),a),a.remove();return{mainMenuWrapper:t,utahIdPopup:c}}function Io(e){let t=NaN,n=null,r=null;return{promise:new Promise((i,c)=>{t=setTimeout(()=>{t=NaN,i()},e),n=i,r=c}),clearTimeout:i=>{t&&(clearTimeout(t),t=NaN,i(n,r))}}}const Z={isDefinitive:null,lastError:null,userInfo:null};function Qt(e){var t,n,r;e.isDefinitive&&(Kt(e),(r=(n=(t=O())==null?void 0:t.utahId)==null?void 0:n.onAuthChanged)==null||r.call(n,e))}let Jt=!0;const To=500;async function en(){var t,n;let e=null;if(Z.isDefinitive===!1)e=Promise.resolve(Z);else if(Jt)e=Io(To).promise.then(()=>{Jt=!1,en()});else{const r=O();if(r.utahId===!1)e=Promise.resolve({isDefinitive:!0,lastError:"Utah ID is off",userInfo:null});else if(r.utahId===!0||((t=r.utahId)==null?void 0:t.currentUser)===void 0)Z.isDefinitive=!1,e=fetch(Ae.USER_INFO,{credentials:"include"}).then(o=>o.json()).then(o=>{if(o.status===200)Z.lastError=null,Z.userInfo=o.data;else throw new Error(o.err)}).catch(o=>{Z.lastError=o,Z.userInfo=null}).finally(()=>{Z.isDefinitive=!0,Qt(Z)});else{const o={isDefinitive:!0,lastError:null,userInfo:(n=r.utahId)==null?void 0:n.currentUser};e=Promise.resolve(o),Qt(o)}}return e}function Mo(){return Z}function wo(){const e=document.getElementById(s.MOBILE_MENU_ACTON_BAR__PROFILE_ID);if(!e)throw new Error("removeUtahIdInMobileMenu: profileActionItem not found");const t=e.closest(f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));if(!t)throw new Error("removeUtahIdInMobileMenu: profileActionItemWrapper not found");t.remove()}function Ao(e,t){const n=document.querySelector(f(s.MOBILE__UTAH_ID));if(!n)throw new Error("hookupUtahIdInMobileMenu: utahIdWrapper not found");const r=n.querySelector(f(s.UTAH_ID__BUTTON));if(!r)throw new Error("hookupUtahIdInMobileMenu: utahIdButton not found");if(!e.querySelector(f(s.MOBILE_MENU__CONTENT)))throw new Error("hookupUtahIdInMobileMenu: mobileContentWrapper not found");const i=document.getElementById(s.MOBILE_MENU_ACTON_BAR__PROFILE_ID);if(!i)throw new Error("hookupUtahIdInMobileMenu: profileActionItem not found");const c=i.closest(f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));if(!c)throw new Error("hookupHamburger: profileActionItemWrapper not found");const a=Ge(t);Ke(r,a,c,{ariaHasPopupType:"menu",onClickHandler:l=>{var _;const u=Mo(),d=O();let h=!1;if(!(u!=null&&u.isDefinitive)||!((_=u==null?void 0:u.userInfo)!=null&&_.authenticated)){h=!0;const p=d.utahId!==!1&&d.utahId!==!0&&d.utahId.onSignIn;p?p(l):(l.preventDefault(),l.stopPropagation(),window.location.href=Ae.SIGN_IN)}return h},shouldOnClickCloseMenu:!0})}function Oo(){return fe(O().mainMenu.menuItems,{childrenMenuType:x.INLINE,removePopupArrow:!0})}const yo=`<div class="utah-design-system utds-official-website-popup__wrapper visually-hidden" tabindex="0">
|
|
273
273
|
<h2 class="utds-official-website-popup__heading">
|
|
274
274
|
This is an official website of the State of Utah. Hereβs how you know:
|
|
275
275
|
</h2>
|
|
@@ -296,8 +296,8 @@
|
|
|
296
296
|
<span class="visually-hidden">Close official website popup</span>
|
|
297
297
|
</button>
|
|
298
298
|
</div>
|
|
299
|
-
`;function
|
|
299
|
+
`;function Po(){const e=b(yo),n=document.querySelector(f(s.LOGO)).querySelector(f(s.LOGO_SVG));if(!n)throw new Error("renderOfficialWebsite: logoButton not found");if(n.onclick)throw new Error("renderOfficialWebsite: logoButton already has an onclick");n.onclick=()=>{e.classList.toggle(s.VISUALLY_HIDDEN),e.classList.contains(s.VISUALLY_HIDDEN)?(n.setAttribute("aria-expanded","false"),e.setAttribute("aria-hidden","true")):(n.setAttribute("aria-expanded","true"),e.setAttribute("aria-hidden","false"),e.focus());const o=document.querySelectorAll(f(s.TOOLTIP__WRAPPER));o==null||o.forEach(i=>{i.classList.add(s.TOOLTIP__WRAPPER__HIDDEN),i.classList.remove(s.TOOLTIP__WRAPPER__VISIBLE)})};const r=e.querySelector(f(s.LOGO_OFFICIAL_CLOSE_BUTTON));if(!r)throw new Error("renderOfficialWebsite: closeButton not found");return r.onclick=()=>{e.classList.toggle(s.VISUALLY_HIDDEN),n.focus(),n.setAttribute("aria-expanded","false"),e.setAttribute("aria-hidden","true")},r.id||(r.id=C()),e.id||(e.id=C()),n.setAttribute("aria-controls",e.id),n.setAttribute("aria-expanded","false"),e.setAttribute("aria-hidden","true"),e.setAttribute("aria-labelledby",n.id),e}function Lo(){const t=[...document.querySelectorAll(`
|
|
300
300
|
${f(s.MOBILE_MENU__ACTION_BAR)}
|
|
301
301
|
${f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER)}
|
|
302
302
|
${f(s.ACTION_ITEM__ICON_BUTTON)}
|
|
303
|
-
`)];t.forEach(n=>{n.onkeydown=r=>{(r.code==="Home"||r.code==="End"||r.code==="ArrowRight"||r.code==="ArrowLeft")&&r.preventDefault()},n.onkeyup=r=>{const o=t.indexOf(n);let i=NaN;if(r.code==="Home"?i=0:r.code==="End"?i=t.length-1:r.code==="ArrowRight"?i=(o+1)%t.length:r.code==="ArrowLeft"&&(i=(t.length+o-1)%t.length),!Number.isNaN(i)){r.preventDefault(),r.stopPropagation();const c=t[i],a=c.closest(f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));if(!a)throw new Error("hookupMobileActionItemKeyboarding: newWrapper not found... how in the blazes?!");const l=c.getAttribute("aria-controls");if(l&&document.getElementById(l))c.click();else{const h=document.querySelector(f(s.MOBILE_MENU__WRAPPER));if(!h)throw new Error("hookupMobileActionItemKeyboarding: mobileMenuWrapper not found");const _=h.querySelector(f(s.MOBILE_MENU__CONTENT));if(!_)throw new Error("hookupMobileActionItemKeyboarding: mobileContentWrapper not found");_.querySelectorAll(f(s.MOBILE_MENU__CONTENT_ITEM)).forEach(p=>p.classList.remove(s.IS_OPEN))}const d=document.querySelector(f(s.MOBILE_MENU__WRAPPER));if(!d)throw new Error("hookupMobileActionItemKeyboarding: mobileMenuWrapper not found");ze(d,a)}}})}function
|
|
303
|
+
`)];t.forEach(n=>{n.onkeydown=r=>{(r.code==="Home"||r.code==="End"||r.code==="ArrowRight"||r.code==="ArrowLeft")&&r.preventDefault()},n.onkeyup=r=>{const o=t.indexOf(n);let i=NaN;if(r.code==="Home"?i=0:r.code==="End"?i=t.length-1:r.code==="ArrowRight"?i=(o+1)%t.length:r.code==="ArrowLeft"&&(i=(t.length+o-1)%t.length),!Number.isNaN(i)){r.preventDefault(),r.stopPropagation();const c=t[i],a=c.closest(f(s.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER));if(!a)throw new Error("hookupMobileActionItemKeyboarding: newWrapper not found... how in the blazes?!");const l=c.getAttribute("aria-controls");if(l&&document.getElementById(l))c.click();else{const h=document.querySelector(f(s.MOBILE_MENU__WRAPPER));if(!h)throw new Error("hookupMobileActionItemKeyboarding: mobileMenuWrapper not found");const _=h.querySelector(f(s.MOBILE_MENU__CONTENT));if(!_)throw new Error("hookupMobileActionItemKeyboarding: mobileContentWrapper not found");_.querySelectorAll(f(s.MOBILE_MENU__CONTENT_ITEM)).forEach(p=>p.classList.remove(s.IS_OPEN))}const d=document.querySelector(f(s.MOBILE_MENU__WRAPPER));if(!d)throw new Error("hookupMobileActionItemKeyboarding: mobileMenuWrapper not found");ze(d,a)}}})}function No(){const e=hn.replace(s.MEDIA_SIZE__TABLET_PORTRAIT__PLACEHOLDER,`${O().mediaSizes.tabletPortrait}px`).replace(s.MEDIA_SIZE__TABLET_LANDSCAPE__PLACEHOLDER,`${O().mediaSizes.tabletLandscape}px`).replace(s.MEDIA_SIZE__MOBILE__PLACEHOLDER,`${O().mediaSizes.mobile}px`);let t=document.getElementById(s.CSS_HEADER_MEDIA_TAG_ID);t||(t=document.createElement("style"),t.id=s.CSS_HEADER_MEDIA_TAG_ID),t.innerHTML=e,document.body.appendChild(t)}function So(){const e=O();let t=document.body;if(e.domLocationTarget){const n=[e.domLocationTarget.cssSelector,e.domLocationTarget.element,e.domLocationTarget.elementFunction].filter(r=>r);if(n.length<1)throw new Error("loadHeader: domLocationTarget must either have a value for one of its properties or not be specified at all");if(n.length>1)throw new Error("loadHeader: domLocationTarget must only have one target specified");if(e.domLocationTarget.cssSelector)t=document.querySelector(e.domLocationTarget.cssSelector),vt(!t,`loadHeader: element not found for domLocationTarget.cssSelector ${e.domLocationTarget.cssSelector}`);else if(e.domLocationTarget.element)t=e.domLocationTarget.element;else if(e.domLocationTarget.elementFunction)t=e.domLocationTarget.elementFunction(),vt(!t,"loadHeader: element not returned from domLocationTarget.elementFunction");else throw new Error("loadHeader: domLocationTarget must have at least one field set")}return mn(t,"loadHeader: domTarget is null (how?!)")}function tn(){var t;if(!document.querySelector(f([s.UTAH_DESIGN_SYSTEM,s.HEADER]))){const n=_o(),r=So();r.insertBefore(n,r.firstChild);const o=Po();n.after(o);const{mainMenuWrapper:i,utahIdPopup:c}=go();i&&o.after(i);const a=b(_n);o.after(a);const l=document.querySelector(f(s.MOBILE_MENU__BACKDROP));if(!l)throw new Error("mobileMenuInteractionHandler: mobileMenuBackdrop not found");if(l.onclick)throw new Error("mobileMenuInteractionHandler: mobileMenuBackdrop already has onclick");l.onclick=()=>Ye();const u=Oo(),d=zt(u,"Main Menu");d.appendChild(u);const h=Ge(d);An(h),c?((t=c.closest("div"))==null||t.removeAttribute("aria-labelledby"),Ao(a,c)):wo(),jr(),Lo(),kr(),No(),en()}}function nn(e){var t,n,r,o;(t=document.querySelector(f([s.UTAH_DESIGN_SYSTEM,s.HEADER])))==null||t.remove(),(n=document.querySelector(f([s.UTAH_DESIGN_SYSTEM,s.MAIN_MENU__OUTER])))==null||n.remove(),(r=document.querySelector(f([s.UTAH_DESIGN_SYSTEM,s.MOBILE_MENU])))==null||r.remove(),(o=document.querySelector(f([s.UTAH_DESIGN_SYSTEM,s.LOGO_OFFICIAL_WRAPPER])))==null||o.remove(),$t(),e&&setTimeout(()=>document.dispatchEvent(new Event(Fe.HEADER_UNLOADED)),0)}console.log(`Utah Header v${fn.version}`),H.baseSettings=Et,H.childrenMenuTypes=x,H.events=Fe,H.getUtahHeaderSettings=O,H.loadHeader=tn,H.removeHeader=nn,H.renderDOMSingle=b,H.setUtahHeaderSettings=In,H.sizes=ee,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utahdts/utah-design-system-header",
|
|
3
|
-
"version": "0.6.0
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Utah Header for the Utah Design System",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"build": "vite build",
|
|
24
24
|
"preview": "vite preview",
|
|
25
25
|
"publishHeader": "npm publish --access public",
|
|
26
|
-
"publishHeaderBeta": "npm publish --access public --tag beta",
|
|
27
26
|
"sass-build": "sass --no-source-map ./src/css/index.scss ./src/css/build/utah-design-system-header.css",
|
|
28
27
|
"test-publish": "npm publish --dry-run",
|
|
29
28
|
"test": "vitest",
|
|
@@ -40,8 +39,7 @@
|
|
|
40
39
|
},
|
|
41
40
|
"homepage": "https://github.com/utahdts/utah-design-system#readme",
|
|
42
41
|
"dependencies": {
|
|
43
|
-
"@popperjs/core": "2.11.7"
|
|
44
|
-
"@utahdts/utah-design-system": "0.6.0-beta.0"
|
|
42
|
+
"@popperjs/core": "2.11.7"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
45
|
"eslint": "8.38.0",
|