UNPKG

@utahdts/utah-design-system-header

Version:
1,514 lines (1,507 loc) 121 kB
const Z = { FLYOUT: ( /** @type {ChildrenMenuTypes} */ "flyout" ), INLINE: ( /** @type {ChildrenMenuTypes} */ "inline" ), MEGA_MENU: ( /** @type {ChildrenMenuTypes} */ "mega-menu" ), PLAIN: ( /** @type {ChildrenMenuTypes} */ "plain" ) }, it = { AUTO: ( /** @type {PopupPlacementType} */ "auto" ), AUTO_START: ( /** @type {PopupPlacementType} */ "auto-start" ), AUTO_END: ( /** @type {PopupPlacementType} */ "auto-end" ), BOTTOM: ( /** @type {PopupPlacementType} */ "bottom" ), BOTTOM_START: ( /** @type {PopupPlacementType} */ "bottom-start" ), BOTTOM_END: ( /** @type {PopupPlacementType} */ "bottom-end" ), LEFT: ( /** @type {PopupPlacementType} */ "left" ), LEFT_START: ( /** @type {PopupPlacementType} */ "left-start" ), LEFT_END: ( /** @type {PopupPlacementType} */ "left-end" ), RIGHT: ( /** @type {PopupPlacementType} */ "right" ), RIGHT_START: ( /** @type {PopupPlacementType} */ "right-start" ), RIGHT_END: ( /** @type {PopupPlacementType} */ "right-end" ), TOP: ( /** @type {PopupPlacementType} */ "top" ), TOP_START: ( /** @type {PopupPlacementType} */ "top-start" ), TOP_END: ( /** @type {PopupPlacementType} */ "top-end" ) }, Zt = { // Fired when the utah header is first loaded (setUtahHeaderSettings does not trigger this) HEADER_LOADED: ( /** @type {Events} */ "utahHeaderLoaded" ), // Fired when the header unloads by code calling the function removeHeader() (not when settings updated) HEADER_UNLOADED: ( /** @type {Events} */ "utahHeaderUnloaded" ) }, we = { SMALL: ( /** @type {Size} */ "SMALL" ), MEDIUM: ( /** @type {Size} */ "MEDIUM" ), LARGE: ( /** @type {Size} */ "LARGE" ) }, Ln = `/* @media is never in scope for --variables, so this is the only way to solve this. :-( */ @media screen and (max-width: media-size__tablet-landscape__PLACEHOLDER) { /* put your media query here for tablet landscape */ .utah-design-system .search-modal__input[type=text] { width: 75vw; } } @media screen and (max-width: media-size__tablet-portrait__PLACEHOLDER) { .utds-header-desktop--hidden { display: block !important; } .utds-header-mobile--hidden { display: none !important; } .utds-header { height: 60px; padding: var(--spacing-xs) var(--spacing); } .utds-title-wrapper { font-size: var(--font-size-xl); } .utds-citizen-experience-wrapper { display: none; } .utds-citizen-experience-wrapper--mobile { display: flex; } .utah-design-system .main-menu__wrapper { padding: 0 var(--spacing); /* The utah id button is this tall, but without it, the menu doesn't fill the space up to the mobile menu content popup */ min-height: 46px; } .utah-design-system .main-menu__nav { display: none; } .utah-design-system.utds-header-mobile-menu, .utah-design-system .utds-header-mobile__utah-id-wrapper { display: block; } .utah-design-system .icon-button.main-menu__hamburger, .utah-design-system .utds-header-mobile__vip-action-items--left, .utah-design-system .utds-header-mobile__vip-action-items--right, .utah-design-system .main-menu__search-placeholder { display: flex; } .utah-design-system .search-modal__input[type=text] { width: 80vw; padding: var(--spacing) var(--spacing) var(--spacing) var(--spacing-3xl); } .utah-design-system .search-modal__button-wrapper { right: unset; left: 50%; transform: translateX(-50%) translateY(110%); } .utah-design-system .search-modal__button.button--solid.button--primary-color { border-color: white; width: max-content; } .utah-design-system .utds-official-website-popup__content { flex-wrap: wrap; gap: var(--spacing-l); } .utah-design-system .utds-official-website-popup__col { width: 100%; } .utah-design-system .utds-official-website-popup__address-bar { width: auto; background-size: contain; background-repeat: no-repeat; } .color-example { flex-direction: column; } .color-example > div:not(:last-child) { margin-bottom: var(--spacing-l); } .search-page { .search-modal__form { margin-bottom: var(--spacing-4xl); } .search-modal__input[type=text] { padding: var(--spacing) var(--spacing) var(--spacing) var(--spacing-3xl); } } } @media screen and (max-width: media-size__mobile__PLACEHOLDER) { /* put your media query here for mobile */ } `; function p(e) { return `.${(Array.isArray(e) ? e : [e]).join(".")}`; } const a = { // Global Information UTAH_DESIGN_SYSTEM: "utah-design-system", HEADER: "utds-header", FOOTER: "utds-footer", // HTML elements ICON_BUTTON: "icon-button", // IDs CSS_HEADER_MEDIA_TAG_ID: "cssHeaderMediaTag", // Modifiers IS_CLOSED: "is-closed", IS_OPEN: "is-open", VISUALLY_HIDDEN: "visually-hidden", // Replacement Placeholders 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", // Header Components 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__SMALL: "utds-badge__wrapper--small", BADGE_WRAPPER__ACTION_ITEM: "utds-badge__wrapper--action-item", CITIZEN_EXPERIENCE: "utds-citizen-experience-wrapper", CITIZEN_EXPERIENCE_MOBILE: "utds-citizen-experience-wrapper--mobile", FOOTER_COPYRIGHT_YEAR: "utds-footer__copyright-year", FOOTER_HORIZONTAL_DIVIDER: "utds-footer__horizontal-divider", FOOTER_LINK_PRIVACY_ID: "utds-footer-privacy-link", FOOTER_LINK_TERMS_ID: "utds-footer-terms-link", FOOTER_LINKS: "utds-footer__links", 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", MAIN_MENU: "main-menu__wrapper", 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__REMOVED: "main-menu-is-removed", MAIN_MENU__SEARCH: "main-menu__search", MAIN_MENU__TITLE: "main-menu__title", MENU_ITEM__ARROW: "menu-item__menu-arrow", MENU_ITEM__BUTTON_TITLE: "menu-item__button-title", MENU_ITEM__LINK_TITLE: "menu-item__link-title", MENU_ITEM__LINK_TITLE_SPAN: "menu-item__link-title-span", MENU_ITEM__SELECTED: "menu-item--selected", MENU_ITEM__SELECTED_PARENT: "menu-item--selected_parent", 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", DESKTOP__HIDDEN: "utds-header-desktop--hidden", MOBILE__HIDDEN: "utds-header-mobile--hidden", MOBILE__UTAH_ID: "utds-header-mobile__utah-id-wrapper", 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__LAST_FOCUSABLE: "utds-header-mobile-menu__hidden-last-focusable", 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", VERTICAL_MENU__BUTTON_TITLE: "vertical-menu__button-title", VERTICAL_MENU__CHEVRON: "vertical-menu__chevron", VERTICAL_MENU__DIVIDER: "vertical-menu__divider", VERTICAL_MENU__LINK_TEXT: "vertical-menu__link-text", VERTICAL_MENU__LINK_TITLE: "vertical-menu__link-title", VERTICAL_MENU__PLAIN_TITLE: "vertical-menu__plain-title", VERTICAL_MENU__TITLE: "vertical-menu__title", VERTICAL_MENU_WRAPPER__WRAPPER_TITLE: "vertical-menu__wrapper-title", POPUP__HIDDEN: "popup__wrapper--hidden", POPUP__VISIBLE: "popup__wrapper--visible", 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", SKIP_LINK_LINK: "skip-link__link", SKIP_LINK_WRAPPER: "skip-link__wrapper", TITLE__LOGO: "utds-title-wrapper__logo", TITLE__TITLE: "utds-title-wrapper__title", 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 j(e, t) { if (e) throw new Error(t); } function M(e, t) { if (e == null) throw new Error(t); return e; } function St(e) { return typeof e == "string" || e instanceof String; } function wn(e) { const t = new DOMParser(); let n; if (St(e)) { const o = ( /** @type {Document} */ St(e) ? t.parseFromString(e, "text/html") : e ), r = o.body.children.length > 1 ? o.body.children : o.body.children.item(0); if (!r) throw console.error(e), new Error("renderDOM: nothing rendered"); n = r; } else if ( /** @type {unknown} */ 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 g(e) { const t = typeof e == "string" ? wn(e) : e; if (t instanceof HTMLCollection && t.length > 1) throw new Error("renderDOMSingle: must render a single element"); const n = ( /** @type {HTMLElement | null} */ t instanceof HTMLCollection ? t[0] : t ); if (!n) throw console.error(e), new Error("renderDOMSingle: nothing rendered"); return n; } const Fe = { // @ts-expect-error a blank string is not a valid value; applicationType needs set in the header settings by the application applicationType: "", onSearch: !1, mainMenu: !1, mediaSizes: { mobile: 640, tabletPortrait: 768, tabletLandscape: 1024 }, showTitle: !0, size: we.MEDIUM, skipLinkUrl: "#main-content", title: "My Utah.gov Site", titleUrl: "/", utahId: !1 }; function On(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."); } class yn { constructor() { this.settings = { ...Fe }; } /** * @param {SettingsInput} settings */ setSettings(t) { const n = { ...Fe, ...this.settings, ...t }; On(n), this.settings = n; } /** * @returns {Settings} */ getSettings() { return this.settings; } /** * Mainly for testing purposes? since tests will want a fresh slate every time, and calling * setUtahHeaderSettings() does a merge of the settings, this puts settings back to blank * starting settings */ clearSettings() { this.settings = { ...Fe }; } } const qe = new yn(); function y() { return qe.getSettings(); } function H() { return ( // @ts-expect-error this is some funky shtuff ("10000000-1000-4000-8000" + -1e11).replace( /[018]/g, /** * @param {number} c * @returns {string} */ // eslint-disable-next-line no-bitwise (e) => (e ^ M(crypto.getRandomValues(new Uint8Array(1))[0], "uuidv4: crypto") & (15 >> e) / 4).toString(16) ) ); } const Nn = `<div class="utds-header-mobile-menu__content-item" role="tabpanel"> </div> `; function at(e) { const t = document.querySelector(p(a.MOBILE_MENU__WRAPPER)); if (!t) throw new Error("addMobileMenuContentItem: mobileMenuWrapper not found"); const n = t.querySelector(p(a.MOBILE_MENU__CONTENT)); if (!n) throw new Error("addMobileMenuContentItem: mobileContentWrapper not found"); const o = g(Nn); return o.appendChild(e), n.appendChild(o), o.setAttribute("id", H()), o; } function ee(e) { return e instanceof Function ? e() : e; } function Se(e) { const t = ( /** @type {HTMLElement} */ M( document.querySelector(p(a.MOBILE_MENU)), `${e}: mobileMenu not found` ) ), n = document.getElementById(a.MAIN_MENU__HAMBURGER_ID), o = document.getElementById(a.MAIN_MENU__HAMBURGER_ICON_ID); return { hamburger: n, hamburgerIcon: o, mobileMenu: t }; } function Ye() { const { hamburger: e, hamburgerIcon: t, mobileMenu: n } = Se("hideMobileMenu"); e == null || e.setAttribute("aria-expanded", "false"), n.classList.remove(a.IS_OPEN), e == null || e.setAttribute("aria-label", "Open the mobile menu"), t == null || t.classList.add("utds-icon-before-hamburger"), t == null || t.classList.remove("utds-icon-before-x-icon"), document.body.style.position = ""; } function Sn() { var r; const e = document.querySelector(p(a.MAIN_MENU)); e != null && e.classList.contains(a.MOBILE__HIDDEN) && ((r = document.querySelector(`${p(a.UTAH_DESIGN_SYSTEM)}${p(a.MOBILE_MENU)}`)) == null || r.classList.add(a.MAIN_MENU__REMOVED)); const { hamburger: t, hamburgerIcon: n, mobileMenu: o } = Se("showMobileMenu"); t == null || t.setAttribute("aria-expanded", "true"), o.classList.add(a.IS_OPEN), t == null || t.setAttribute("aria-label", "Close the mobile menu"), n == null || n.classList.remove("utds-icon-before-hamburger"), n == null || n.classList.add("utds-icon-before-x-icon"), document.body.style.position = "relative"; } function Je(e, t) { e.querySelectorAll(p(a.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER)).forEach((o) => { o.classList.remove(a.ACTION_ITEM__SELECTED); const r = o.querySelector("button"); if (!r) throw new Error("showActionItem: actionWrapper does not have actionItem A"); r.setAttribute("aria-selected", "false"), r.setAttribute("tabIndex", "-1"); }), t.classList.add(a.ACTION_ITEM__SELECTED); const n = t.querySelector("button"); if (!n) throw new Error("showActionItem: actionWrapper does not have actionItem B"); n.setAttribute("aria-selected", "true"), n.removeAttribute("tabIndex"), n.focus(); } function Pt(e, t) { e.querySelectorAll(p(a.MOBILE_MENU__CONTENT_ITEM)).forEach((n) => n.classList.remove(a.IS_OPEN)), t.classList.add(a.IS_OPEN); } function st(e, t, n, { ariaHasPopupType: o, additionalOnClick: r, onClickHandler: i, shouldOnClickCloseMenu: u }) { var m, f; if (t && !o) throw new Error("mobileMenuInteractionHandler: there is content, but the aria type is not given"); const l = ( /** @type {HTMLElement} */ document.querySelector(p(a.MOBILE_MENU)) ); if (!l) throw new Error("mobileMenuInteractionHandler: mobileMenu not found"); const c = ( /** @type {HTMLElement} */ document.querySelector(p(a.MOBILE_MENU__WRAPPER)) ); if (!c) throw new Error("mobileMenuInteractionHandler: mobileMenuWrapper not found"); const s = ( /** @type {HTMLElement} */ c.querySelector(p(a.MOBILE_MENU__CONTENT)) ); if (!s) throw new Error("mobileMenuInteractionHandler: mobileContentWrapper not found"); const d = ee(n), _ = (f = (m = ee(n)) == null ? void 0 : m.querySelector) == null ? void 0 : f.call(m, "button"), h = (_ || e).getAttribute("id"); if (!h) throw new Error("mobileMenuInteractionHandler: interactiveElementId not found"); if (t) { const v = ee(t); if (v) { const E = v.getAttribute("id"); if (!E) throw new Error("mobileMenuInteractionHandler: mobileMenuContentId not found"); (_ || e).setAttribute("aria-controls", E), v.setAttribute("aria-labelledby", h); } } if (e.onclick) throw new Error("mobileMenuInteractionHandler: interactiveElement already has onclick"); if (e.onclick = (v) => { if (!(i != null && i(v))) if (r == null || r(v), l.classList.contains(a.IS_OPEN)) u && Ye(); else { Sn(); const b = ee(t); b && Pt(s, b), Je(c, ee(n)); } }, t) { if (d !== e && d.onclick) throw new Error("mobileMenuInteractionHandler: actionItemWrapperValue already has onclick"); d.onclick = (v) => { if (!(i != null && i(v))) { const E = ee(t); E && Pt(s, E), Je(c, ee(n)); } }; } } function ie(e) { return !e.closest(".menu-item__title") && !e.closest(".vertical-menu__title"); } function Qe(e, t, n) { var r; let o = !1; return e && (Array.isArray(e) ? o = e.some((i) => Qe(i, t, n)) : (o = n(e), o || (o = !!((r = t == null ? void 0 : t.filter((i) => e[i])) != null && r.some((i) => Qe(e[i], t, n)))))), o; } var V = "top", z = "bottom", K = "right", q = "left", ct = "auto", Re = [V, z, K, q], _e = "start", Pe = "end", Pn = "clippingParents", Xt = "viewport", Te = "popper", Cn = "reference", Ct = /* @__PURE__ */ Re.reduce(function(e, t) { return e.concat([t + "-" + _e, t + "-" + Pe]); }, []), Jt = /* @__PURE__ */ [].concat(Re, [ct]).reduce(function(e, t) { return e.concat([t, t + "-" + _e, t + "-" + Pe]); }, []), Un = "beforeRead", Rn = "read", Dn = "afterRead", Hn = "beforeMain", Bn = "main", xn = "afterMain", kn = "beforeWrite", Wn = "write", Fn = "afterWrite", Vn = [Un, Rn, Dn, Hn, Bn, xn, kn, Wn, Fn]; function ne(e) { return e ? (e.nodeName || "").toLowerCase() : null; } function G(e) { if (e == null) return window; if (e.toString() !== "[object Window]") { var t = e.ownerDocument; return t && t.defaultView || window; } return e; } function ue(e) { var t = G(e).Element; return e instanceof t || e instanceof Element; } function Y(e) { var t = G(e).HTMLElement; return e instanceof t || e instanceof HTMLElement; } function lt(e) { if (typeof ShadowRoot > "u") return !1; var t = G(e).ShadowRoot; return e instanceof t || e instanceof ShadowRoot; } function qn(e) { var t = e.state; Object.keys(t.elements).forEach(function(n) { var o = t.styles[n] || {}, r = t.attributes[n] || {}, i = t.elements[n]; !Y(i) || !ne(i) || (Object.assign(i.style, o), Object.keys(r).forEach(function(u) { var l = r[u]; l === !1 ? i.removeAttribute(u) : i.setAttribute(u, l === !0 ? "" : l); })); }); } function $n(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(o) { var r = t.elements[o], i = t.attributes[o] || {}, u = Object.keys(t.styles.hasOwnProperty(o) ? t.styles[o] : n[o]), l = u.reduce(function(c, s) { return c[s] = "", c; }, {}); !Y(r) || !ne(r) || (Object.assign(r.style, l), Object.keys(i).forEach(function(c) { r.removeAttribute(c); })); }); }; } const Gn = { name: "applyStyles", enabled: !0, phase: "write", fn: qn, effect: $n, requires: ["computeStyles"] }; function te(e) { return e.split("-")[0]; } var le = Math.max, $e = Math.min, he = Math.round; function et() { 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 Qt() { return !/^((?!chrome|android).)*safari/i.test(et()); } function me(e, t, n) { t === void 0 && (t = !1), n === void 0 && (n = !1); var o = e.getBoundingClientRect(), r = 1, i = 1; t && Y(e) && (r = e.offsetWidth > 0 && he(o.width) / e.offsetWidth || 1, i = e.offsetHeight > 0 && he(o.height) / e.offsetHeight || 1); var u = ue(e) ? G(e) : window, l = u.visualViewport, c = !Qt() && n, s = (o.left + (c && l ? l.offsetLeft : 0)) / r, d = (o.top + (c && l ? l.offsetTop : 0)) / i, _ = o.width / r, h = o.height / i; return { width: _, height: h, top: d, right: s + _, bottom: d + h, left: s, x: s, y: d }; } function ut(e) { var t = me(e), n = e.offsetWidth, o = e.offsetHeight; return Math.abs(t.width - n) <= 1 && (n = t.width), Math.abs(t.height - o) <= 1 && (o = t.height), { x: e.offsetLeft, y: e.offsetTop, width: n, height: o }; } function en(e, t) { var n = t.getRootNode && t.getRootNode(); if (e.contains(t)) return !0; if (n && lt(n)) { var o = t; do { if (o && e.isSameNode(o)) return !0; o = o.parentNode || o.host; } while (o); } return !1; } function oe(e) { return G(e).getComputedStyle(e); } function Yn(e) { return ["table", "td", "th"].indexOf(ne(e)) >= 0; } function ae(e) { return ((ue(e) ? e.ownerDocument : ( // $FlowFixMe[prop-missing] e.document )) || window.document).documentElement; } function ze(e) { return ne(e) === "html" ? e : ( // this is a quicker (but less type safe) way to save quite some bytes from the bundle // $FlowFixMe[incompatible-return] // $FlowFixMe[prop-missing] e.assignedSlot || // step into the shadow DOM of the parent of a slotted node e.parentNode || // DOM Element detected (lt(e) ? e.host : null) || // ShadowRoot detected // $FlowFixMe[incompatible-call]: HTMLElement is a Node ae(e) ); } function Ut(e) { return !Y(e) || // https://github.com/popperjs/popper-core/issues/837 oe(e).position === "fixed" ? null : e.offsetParent; } function zn(e) { var t = /firefox/i.test(et()), n = /Trident/i.test(et()); if (n && Y(e)) { var o = oe(e); if (o.position === "fixed") return null; } var r = ze(e); for (lt(r) && (r = r.host); Y(r) && ["html", "body"].indexOf(ne(r)) < 0; ) { var i = oe(r); 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 r; r = r.parentNode; } return null; } function De(e) { for (var t = G(e), n = Ut(e); n && Yn(n) && oe(n).position === "static"; ) n = Ut(n); return n && (ne(n) === "html" || ne(n) === "body" && oe(n).position === "static") ? t : n || zn(e) || t; } function dt(e) { return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y"; } function Oe(e, t, n) { return le(e, $e(t, n)); } function Kn(e, t, n) { var o = Oe(e, t, n); return o > n ? n : o; } function tn() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function nn(e) { return Object.assign({}, tn(), e); } function on(e, t) { return t.reduce(function(n, o) { return n[o] = e, n; }, {}); } var jn = function(t, n) { return t = typeof t == "function" ? t(Object.assign({}, n.rects, { placement: n.placement })) : t, nn(typeof t != "number" ? t : on(t, Re)); }; function Zn(e) { var t, n = e.state, o = e.name, r = e.options, i = n.elements.arrow, u = n.modifiersData.popperOffsets, l = te(n.placement), c = dt(l), s = [q, K].indexOf(l) >= 0, d = s ? "height" : "width"; if (!(!i || !u)) { var _ = jn(r.padding, n), h = ut(i), m = c === "y" ? V : q, f = c === "y" ? z : K, v = n.rects.reference[d] + n.rects.reference[c] - u[c] - n.rects.popper[d], E = u[c] - n.rects.reference[c], b = De(i), T = b ? c === "y" ? b.clientHeight || 0 : b.clientWidth || 0 : 0, w = v / 2 - E / 2, I = _[m], L = T - h[d] - _[f], A = T / 2 - h[d] / 2 + w, O = Oe(I, A, L), N = c; n.modifiersData[o] = (t = {}, t[N] = O, t.centerOffset = O - A, t); } } function Xn(e) { var t = e.state, n = e.options, o = n.element, r = o === void 0 ? "[data-popper-arrow]" : o; r != null && (typeof r == "string" && (r = t.elements.popper.querySelector(r), !r) || en(t.elements.popper, r) && (t.elements.arrow = r)); } const Jn = { name: "arrow", enabled: !0, phase: "main", fn: Zn, effect: Xn, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function Ee(e) { return e.split("-")[1]; } var Qn = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function eo(e, t) { var n = e.x, o = e.y, r = t.devicePixelRatio || 1; return { x: he(n * r) / r || 0, y: he(o * r) / r || 0 }; } function Rt(e) { var t, n = e.popper, o = e.popperRect, r = e.placement, i = e.variation, u = e.offsets, l = e.position, c = e.gpuAcceleration, s = e.adaptive, d = e.roundOffsets, _ = e.isFixed, h = u.x, m = h === void 0 ? 0 : h, f = u.y, v = f === void 0 ? 0 : f, E = typeof d == "function" ? d({ x: m, y: v }) : { x: m, y: v }; m = E.x, v = E.y; var b = u.hasOwnProperty("x"), T = u.hasOwnProperty("y"), w = q, I = V, L = window; if (s) { var A = De(n), O = "clientHeight", N = "clientWidth"; if (A === G(n) && (A = ae(n), oe(A).position !== "static" && l === "absolute" && (O = "scrollHeight", N = "scrollWidth")), A = A, r === V || (r === q || r === K) && i === Pe) { I = z; var C = _ && A === L && L.visualViewport ? L.visualViewport.height : ( // $FlowFixMe[prop-missing] A[O] ); v -= C - o.height, v *= c ? 1 : -1; } if (r === q || (r === V || r === z) && i === Pe) { w = K; var P = _ && A === L && L.visualViewport ? L.visualViewport.width : ( // $FlowFixMe[prop-missing] A[N] ); m -= P - o.width, m *= c ? 1 : -1; } } var U = Object.assign({ position: l }, s && Qn), W = d === !0 ? eo({ x: m, y: v }, G(n)) : { x: m, y: v }; if (m = W.x, v = W.y, c) { var D; return Object.assign({}, U, (D = {}, D[I] = T ? "0" : "", D[w] = b ? "0" : "", D.transform = (L.devicePixelRatio || 1) <= 1 ? "translate(" + m + "px, " + v + "px)" : "translate3d(" + m + "px, " + v + "px, 0)", D)); } return Object.assign({}, U, (t = {}, t[I] = T ? v + "px" : "", t[w] = b ? m + "px" : "", t.transform = "", t)); } function to(e) { var t = e.state, n = e.options, o = n.gpuAcceleration, r = o === void 0 ? !0 : o, i = n.adaptive, u = i === void 0 ? !0 : i, l = n.roundOffsets, c = l === void 0 ? !0 : l, s = { placement: te(t.placement), variation: Ee(t.placement), popper: t.elements.popper, popperRect: t.rects.popper, gpuAcceleration: r, isFixed: t.options.strategy === "fixed" }; t.modifiersData.popperOffsets != null && (t.styles.popper = Object.assign({}, t.styles.popper, Rt(Object.assign({}, s, { offsets: t.modifiersData.popperOffsets, position: t.options.strategy, adaptive: u, roundOffsets: c })))), t.modifiersData.arrow != null && (t.styles.arrow = Object.assign({}, t.styles.arrow, Rt(Object.assign({}, s, { offsets: t.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: c })))), t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-placement": t.placement }); } const no = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: to, data: {} }; var ke = { passive: !0 }; function oo(e) { var t = e.state, n = e.instance, o = e.options, r = o.scroll, i = r === void 0 ? !0 : r, u = o.resize, l = u === void 0 ? !0 : u, c = G(t.elements.popper), s = [].concat(t.scrollParents.reference, t.scrollParents.popper); return i && s.forEach(function(d) { d.addEventListener("scroll", n.update, ke); }), l && c.addEventListener("resize", n.update, ke), function() { i && s.forEach(function(d) { d.removeEventListener("scroll", n.update, ke); }), l && c.removeEventListener("resize", n.update, ke); }; } const ro = { name: "eventListeners", enabled: !0, phase: "write", fn: function() { }, effect: oo, data: {} }; var io = { left: "right", right: "left", bottom: "top", top: "bottom" }; function Ve(e) { return e.replace(/left|right|bottom|top/g, function(t) { return io[t]; }); } var ao = { start: "end", end: "start" }; function Dt(e) { return e.replace(/start|end/g, function(t) { return ao[t]; }); } function pt(e) { var t = G(e), n = t.pageXOffset, o = t.pageYOffset; return { scrollLeft: n, scrollTop: o }; } function ft(e) { return me(ae(e)).left + pt(e).scrollLeft; } function so(e, t) { var n = G(e), o = ae(e), r = n.visualViewport, i = o.clientWidth, u = o.clientHeight, l = 0, c = 0; if (r) { i = r.width, u = r.height; var s = Qt(); (s || !s && t === "fixed") && (l = r.offsetLeft, c = r.offsetTop); } return { width: i, height: u, x: l + ft(e), y: c }; } function co(e) { var t, n = ae(e), o = pt(e), r = (t = e.ownerDocument) == null ? void 0 : t.body, i = le(n.scrollWidth, n.clientWidth, r ? r.scrollWidth : 0, r ? r.clientWidth : 0), u = le(n.scrollHeight, n.clientHeight, r ? r.scrollHeight : 0, r ? r.clientHeight : 0), l = -o.scrollLeft + ft(e), c = -o.scrollTop; return oe(r || n).direction === "rtl" && (l += le(n.clientWidth, r ? r.clientWidth : 0) - i), { width: i, height: u, x: l, y: c }; } function _t(e) { var t = oe(e), n = t.overflow, o = t.overflowX, r = t.overflowY; return /auto|scroll|overlay|hidden/.test(n + r + o); } function rn(e) { return ["html", "body", "#document"].indexOf(ne(e)) >= 0 ? e.ownerDocument.body : Y(e) && _t(e) ? e : rn(ze(e)); } function ye(e, t) { var n; t === void 0 && (t = []); var o = rn(e), r = o === ((n = e.ownerDocument) == null ? void 0 : n.body), i = G(o), u = r ? [i].concat(i.visualViewport || [], _t(o) ? o : []) : o, l = t.concat(u); return r ? l : ( // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here l.concat(ye(ze(u))) ); } function tt(e) { return Object.assign({}, e, { left: e.x, top: e.y, right: e.x + e.width, bottom: e.y + e.height }); } function lo(e, t) { var n = me(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 === Xt ? tt(so(e, n)) : ue(t) ? lo(t, n) : tt(co(ae(e))); } function uo(e) { var t = ye(ze(e)), n = ["absolute", "fixed"].indexOf(oe(e).position) >= 0, o = n && Y(e) ? De(e) : e; return ue(o) ? t.filter(function(r) { return ue(r) && en(r, o) && ne(r) !== "body"; }) : []; } function po(e, t, n, o) { var r = t === "clippingParents" ? uo(e) : [].concat(t), i = [].concat(r, [n]), u = i[0], l = i.reduce(function(c, s) { var d = Ht(e, s, o); return c.top = le(d.top, c.top), c.right = $e(d.right, c.right), c.bottom = $e(d.bottom, c.bottom), c.left = le(d.left, c.left), c; }, Ht(e, u, o)); return l.width = l.right - l.left, l.height = l.bottom - l.top, l.x = l.left, l.y = l.top, l; } function an(e) { var t = e.reference, n = e.element, o = e.placement, r = o ? te(o) : null, i = o ? Ee(o) : null, u = t.x + t.width / 2 - n.width / 2, l = t.y + t.height / 2 - n.height / 2, c; switch (r) { case V: c = { x: u, y: t.y - n.height }; break; case z: c = { x: u, y: t.y + t.height }; break; case K: c = { x: t.x + t.width, y: l }; break; case q: c = { x: t.x - n.width, y: l }; break; default: c = { x: t.x, y: t.y }; } var s = r ? dt(r) : null; if (s != null) { var d = s === "y" ? "height" : "width"; switch (i) { case _e: c[s] = c[s] - (t[d] / 2 - n[d] / 2); break; case Pe: c[s] = c[s] + (t[d] / 2 - n[d] / 2); break; } } return c; } function Ce(e, t) { t === void 0 && (t = {}); var n = t, o = n.placement, r = o === void 0 ? e.placement : o, i = n.strategy, u = i === void 0 ? e.strategy : i, l = n.boundary, c = l === void 0 ? Pn : l, s = n.rootBoundary, d = s === void 0 ? Xt : s, _ = n.elementContext, h = _ === void 0 ? Te : _, m = n.altBoundary, f = m === void 0 ? !1 : m, v = n.padding, E = v === void 0 ? 0 : v, b = nn(typeof E != "number" ? E : on(E, Re)), T = h === Te ? Cn : Te, w = e.rects.popper, I = e.elements[f ? T : h], L = po(ue(I) ? I : I.contextElement || ae(e.elements.popper), c, d, u), A = me(e.elements.reference), O = an({ reference: A, element: w, placement: r }), N = tt(Object.assign({}, w, O)), C = h === Te ? N : A, P = { top: L.top - C.top + b.top, bottom: C.bottom - L.bottom + b.bottom, left: L.left - C.left + b.left, right: C.right - L.right + b.right }, U = e.modifiersData.offset; if (h === Te && U) { var W = U[r]; Object.keys(P).forEach(function(D) { var X = [K, z].indexOf(D) >= 0 ? 1 : -1, J = [V, z].indexOf(D) >= 0 ? "y" : "x"; P[D] += W[J] * X; }); } return P; } function fo(e, t) { t === void 0 && (t = {}); var n = t, o = n.placement, r = n.boundary, i = n.rootBoundary, u = n.padding, l = n.flipVariations, c = n.allowedAutoPlacements, s = c === void 0 ? Jt : c, d = Ee(o), _ = d ? l ? Ct : Ct.filter(function(f) { return Ee(f) === d; }) : Re, h = _.filter(function(f) { return s.indexOf(f) >= 0; }); h.length === 0 && (h = _); var m = h.reduce(function(f, v) { return f[v] = Ce(e, { placement: v, boundary: r, rootBoundary: i, padding: u })[te(v)], f; }, {}); return Object.keys(m).sort(function(f, v) { return m[f] - m[v]; }); } function _o(e) { if (te(e) === ct) return []; var t = Ve(e); return [Dt(e), t, Dt(t)]; } function ho(e) { var t = e.state, n = e.options, o = e.name; if (!t.modifiersData[o]._skip) { for (var r = n.mainAxis, i = r === void 0 ? !0 : r, u = n.altAxis, l = u === void 0 ? !0 : u, c = n.fallbackPlacements, s = n.padding, d = n.boundary, _ = n.rootBoundary, h = n.altBoundary, m = n.flipVariations, f = m === void 0 ? !0 : m, v = n.allowedAutoPlacements, E = t.options.placement, b = te(E), T = b === E, w = c || (T || !f ? [Ve(E)] : _o(E)), I = [E].concat(w).reduce(function(pe, re) { return pe.concat(te(re) === ct ? fo(t, { placement: re, boundary: d, rootBoundary: _, padding: s, flipVariations: f, allowedAutoPlacements: v }) : re); }, []), L = t.rects.reference, A = t.rects.popper, O = /* @__PURE__ */ new Map(), N = !0, C = I[0], P = 0; P < I.length; P++) { var U = I[P], W = te(U), D = Ee(U) === _e, X = [V, z].indexOf(W) >= 0, J = X ? "width" : "height", B = Ce(t, { placement: U, boundary: d, rootBoundary: _, altBoundary: h, padding: s }), F = X ? D ? K : q : D ? z : V; L[J] > A[J] && (F = Ve(F)); var be = Ve(F), x = []; if (i && x.push(B[W] <= 0), l && x.push(B[F] <= 0, B[be] <= 0), x.every(function(pe) { return pe; })) { C = U, N = !1; break; } O.set(U, x); } if (N) for (var Ie = f ? 3 : 1, He = function(re) { var ge = I.find(function(Be) { var se = O.get(Be); if (se) return se.slice(0, re).every(function(Ke) { return Ke; }); }); if (ge) return C = ge, "break"; }, S = Ie; S > 0; S--) { var de = He(S); if (de === "break") break; } t.placement !== C && (t.modifiersData[o]._skip = !0, t.placement = C, t.reset = !0); } } const mo = { name: "flip", enabled: !0, phase: "main", fn: ho, 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 xt(e) { return [V, K, z, q].some(function(t) { return e[t] >= 0; }); } function Eo(e) { var t = e.state, n = e.name, o = t.rects.reference, r = t.rects.popper, i = t.modifiersData.preventOverflow, u = Ce(t, { elementContext: "reference" }), l = Ce(t, { altBoundary: !0 }), c = Bt(u, o), s = Bt(l, r, i), d = xt(c), _ = xt(s); t.modifiersData[n] = { referenceClippingOffsets: c, popperEscapeOffsets: s, isReferenceHidden: d, hasPopperEscaped: _ }, t.attributes.popper = Object.assign({}, t.attributes.popper, { "data-popper-reference-hidden": d, "data-popper-escaped": _ }); } const vo = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: Eo }; function bo(e, t, n) { var o = te(e), r = [q, V].indexOf(o) >= 0 ? -1 : 1, i = typeof n == "function" ? n(Object.assign({}, t, { placement: e })) : n, u = i[0], l = i[1]; return u = u || 0, l = (l || 0) * r, [q, K].indexOf(o) >= 0 ? { x: l, y: u } : { x: u, y: l }; } function Io(e) { var t = e.state, n = e.options, o = e.name, r = n.offset, i = r === void 0 ? [0, 0] : r, u = Jt.reduce(function(d, _) { return d[_] = bo(_, t.rects, i), d; }, {}), l = u[t.placement], c = l.x, s = l.y; t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += c, t.modifiersData.popperOffsets.y += s), t.modifiersData[o] = u; } const go = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: Io }; function To(e) { var t = e.state, n = e.name; t.modifiersData[n] = an({ reference: t.rects.reference, element: t.rects.popper, placement: t.placement }); } const Ao = { name: "popperOffsets", enabled: !0, phase: "read", fn: To, data: {} }; function Mo(e) { return e === "x" ? "y" : "x"; } function Lo(e) { var t = e.state, n = e.options, o = e.name, r = n.mainAxis, i = r === void 0 ? !0 : r, u = n.altAxis, l = u === void 0 ? !1 : u, c = n.boundary, s = n.rootBoundary, d = n.altBoundary, _ = n.padding, h = n.tether, m = h === void 0 ? !0 : h, f = n.tetherOffset, v = f === void 0 ? 0 : f, E = Ce(t, { boundary: c, rootBoundary: s, padding: _, altBoundary: d }), b = te(t.placement), T = Ee(t.placement), w = !T, I = dt(b), L = Mo(I), A = t.modifiersData.popperOffsets, O = t.rects.reference, N = t.rects.popper, C = typeof v == "function" ? v(Object.assign({}, t.rects, { placement: t.placement })) : v, P = typeof C == "number" ? { mainAxis: C, altAxis: C } : Object.assign({ mainAxis: 0, altAxis: 0 }, C), U = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, W = { x: 0, y: 0 }; if (A) { if (i) { var D, X = I === "y" ? V : q, J = I === "y" ? z : K, B = I === "y" ? "height" : "width", F = A[I], be = F + E[X], x = F - E[J], Ie = m ? -N[B] / 2 : 0, He = T === _e ? O[B] : N[B], S = T === _e ? -N[B] : -O[B], de = t.elements.arrow, pe = m && de ? ut(de) : { width: 0, height: 0 }, re = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : tn(), ge = re[X], Be = re[J], se = Oe(0, O[B], pe[B]), Ke = w ? O[B] / 2 - Ie - se - ge - P.mainAxis : He - se - ge - P.mainAxis, bn = w ? -O[B] / 2 + Ie + se + Be + P.mainAxis : S + se + Be + P.mainAxis, je = t.elements.arrow && De(t.elements.arrow), In = je ? I === "y" ? je.clientTop || 0 : je.clientLeft || 0 : 0, gt = (D = U == null ? void 0 : U[I]) != null ? D : 0, gn = F + Ke - gt - In, Tn = F + bn - gt, Tt = Oe(m ? $e(be, gn) : be, F, m ? le(x, Tn) : x); A[I] = Tt, W[I] = Tt - F; } if (l) { var At, An = I === "x" ? V : q, Mn = I === "x" ? z : K, ce = A[L], xe = L === "y" ? "height" : "width", Mt = ce + E[An], Lt = ce - E[Mn], Ze = [V, q].indexOf(b) !== -1, wt = (At = U == null ? void 0 : U[L]) != null ? At : 0, Ot = Ze ? Mt : ce - O[xe] - N[xe] - wt + P.altAxis, yt = Ze ? ce + O[xe] + N[xe] - wt - P.altAxis : Lt, Nt = m && Ze ? Kn(Ot, ce, yt) : Oe(m ? Ot : Mt, ce, m ? yt : Lt); A[L] = Nt, W[L] = Nt - ce; } t.modifiersData[o] = W; } } const wo = { name: "preventOverflow", enabled: !0, phase: "main", fn: Lo, requiresIfExists: ["offset"] }; function Oo(e) { return { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop }; } function yo(e) { return e === G(e) || !Y(e) ? pt(e) : Oo(e); } function No(e) { var t = e.getBoundingClientRect(), n = he(t.width) / e.offsetWidth || 1, o = he(t.height) / e.offsetHeight || 1; return n !== 1 || o !== 1; } function So(e, t, n) { n === void 0 && (n = !1); var o = Y(t), r = Y(t) && No(t), i = ae(t), u = me(e, r, n), l = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 }; return (o || !o && !n) && ((ne(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078 _t(i)) && (l = yo(t)), Y(t) ? (c = me(t, !0), c.x += t.clientLeft, c.y += t.clientTop) : i && (c.x = ft(i))), { x: u.left + l.scrollLeft - c.x, y: u.top + l.scrollTop - c.y, width: u.width, height: u.height }; } function Po(e) { var t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), o = []; e.forEach(function(i) { t.set(i.name, i); }); function r(i) { n.add(i.name); var u = [].concat(i.requires || [], i.requiresIfExists || []); u.forEach(function(l) { if (!n.has(l)) { var c = t.get(l); c && r(c); } }), o.push(i); } return e.forEach(function(i) { n.has(i.name) || r(i); }), o; } function Co(e) { var t = Po(e); return Vn.reduce(function(n, o) { return n.concat(t.filter(function(r) { return r.phase === o; })); }, []); } function Uo(e) { var t; return function() { return t || (t = new Promise(function(n) { Promise.resolve().then(function() { t = void 0, n(e()); }); })), t; }; } function Ro(e) { var t = e.reduce(function(n, o) { var r = n[o.name]; return n[o.name] = r ? Object.assign({}, r, o, { options: Object.assign({}, r.options, o.options), data: Object.assign({}, r.data, o.data) }) : o, n; }, {}); return Object.keys(t).map(function(n) { return t[n]; }); } var kt = { placement: "bottom", modifiers: [], strategy: "absolute" }; function Wt() { for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n]; return !t.some(function(o) { return !(o && typeof o.getBoundingClientRect == "function"); }); } function Do(e) { e === void 0 && (e = {}); var t = e, n = t.defaultModifiers, o = n === void 0 ? [] : n, r = t.defaultOptions, i = r === void 0 ? kt : r; return function(l, c, s) { s === void 0 && (s = i); var d = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, kt, i), modifiersData: {}, elements: { reference: l, popper: c }, attributes: {}, styles: {} }, _ = [], h = !1, m = { state: d, setOptions: function(b) { var T = typeof b == "function" ? b(d.options) : b; v(), d.options = Object.assign({}, i, d.options, T), d.scrollParents = { reference: ue(l) ? ye(l) : l.contextElement ? ye(l.contextElement) : [], popper: ye(c) }; var w = Co(Ro([].concat(o, d.options.modifiers))); return d.orderedModifiers = w.filter(function(I) { return I.enabled; }), f(), m.update(); }, // Sync update – it will always be executed, even if not necessary. This // is useful for low frequency updates where sync behavior simplifies the // logic. // For high frequency updates (e.g. `resize` and `scroll` events), always // prefer the async Popper#update method forceUpdate: function() { if (!h) { var b = d.elements, T = b.reference, w = b.popper; if (Wt(T, w)) { d.rects = { reference: So(T, De(w), d.options.strategy === "fixed"), popper: ut(w) }, d.reset = !1, d.placement = d.options.placement, d.orderedModifiers.forEach(function(P) { return d.modifiersData[P.name] = Object.assign({}, P.data); }); for (var I = 0; I < d.orderedModifiers.length; I++) { if (d.reset === !0) { d.reset = !1, I = -1; continue; } var L = d.orderedModifiers[I], A = L.fn, O = L.options, N = O === void 0 ? {} : O, C = L.name; typeof A == "function" && (d = A({ state: d, options: N, name: C, instance: m }) || d); } } } }, // Async and optimistically optimized update – it will not be executed if // not necessary (debounced to run at most once-per-tick) update: Uo(function() { return new Promise(function(E) { m.forceUpdate(), E(d); }); }), destroy: function() { v(), h = !0; } }; if (!Wt(l, c)) return m; m.setOptions(s).then(function(E) { !h && s.onFirstUpdate && s.onFirstUpdate(E); }); function f() { d.orderedModifiers.forEach(function(E) { var b = E.name, T = E.options, w = T === void 0 ? {} : T, I = E.effect; if (typeof I == "function") { var L = I({ state: d, name: b, instance: m, options: w }), A = function() { }; _.push(L || A); } }); } function v() { _.forEach(function(E) { return E(); }), _ = []; } return m; }; } var Ho = [ro, Ao, no, Gn, go, mo, wo, Jn, vo], sn = /* @__PURE__ */ Do({ defaultModifiers: Ho }); function nt(e, t, n, o) { t ? (e.classList.remove(o), e.classList.add(n)) : (e.classList.add(o), e.classList.remove(n)); } let $; const Me = {}, ot = { SHIFT: "shift-key" }; function cn() { $ && (document.removeEventListener("click", $.globalOnClick), document.removeEventListener("keyup", $.globalOnKeyup), document.removeEventListener("keydown", $.globalOnKeydown), $ = null); } function rt() { const e = [ `${p(a.UTAH_DESIGN_SYSTEM)} ${p(a.HEADER)} ${p(a.POPUP_WRAPPER)}`, `${p(a.UTAH_DESIGN_SYSTEM)} ${p(a.MAIN_MENU)} ${p(a.POPUP_WRAPPER)}` ], t = document.querySelectorAll(e.join(",")); Array.from(t).filter((n) => !n.classList.contains(a.POPUP__HIDDEN)).forEach((n) => { const o = n.getAttribute("id"); if (o) { const r = document.querySelector(`[aria-controls="${o}"]`); r && ie(r) && r.setAttribute("aria-expanded", "false"); } nt(n, !1, a.POPUP__VISIBLE, a.POPUP__HIDDEN); }); } function Bo() { $ && cn(), $ = { // eslint-disable-next-line @typescript-eslint/no-empty-function globalOnClick: () => { }, // eslint-disable-next-line @typescript-eslint/no-empty-function globalOnKeyup: () => { }, // eslint-disable-next-line @typescript-eslint/no-empty-function globalOnKeydown: () => { } }, $.globalOnClick = rt, document.addEventListener("click", $.globalOnClick), $.globalOnKeyup = /** @param {KeyboardEvent} e */ (e) => { e.key === "Escape" && rt(), e.shiftKey || (Me[ot.SHIFT] = !1), Me[e.key] = !1; }, document.addEventListener("keyup", $.globalOnKeyup), $.globalOnKeydown = (e) => { e.shiftKey && (Me[ot.SHIFT] = !0), Me[e.key] = !0; }, document.addEventListener("keydown", $.globalOnKeydown); } function xo() { return "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; } function Ue(e, t, n, o, r) { let i = NaN, u = NaN; const l = 350, c = 150, s = 50; ie(t) && t.setAttribute("aria-expanded", "false"), t.setAttribute("aria-haspopup", o); function d(h) { clearTimeout(i), clearTimeout(u), (!(r != null && r.isPerformPopup) || r != null && r.isPerformPopup()) && (i = window.setTimeout( () => { sn(t, n, { placement: (r == null ? void 0 : r.popupPlacement) || it.BOTTOM, modifiers: [ { name: "offset", options: { offset: [0, 11] } } ] }), nt(n, !0, a.POPUP__VISIBLE, a.POPUP__HIDDEN), ie(t) && t.setAttribute("aria-expanded", "true"), document.querySelectorAll(p(a.TOOLTIP__WRAPPER)).forEach((m) => m.classList.add(a.TOOLTIP__WRAPPER__HIDDEN)); }, h )); } function _(h) { clearTimeout(i), clearTimeout(u), (!(r != null && r.isPerformPopup) || r.isPerformPopup()) && (u = window.setTimeout( () => { nt(n, !1, a.POPUP__VISIBLE, a.POPUP__HIDDEN), ie(t) && t.setAttribute("aria-expanded", "false"); }, h )); } if (r != null && r.preventOnClickHandling && (j(!!e.onclick, "popupFocusHandler: wrapper already has an onclick"), e.onclick = (h) => { h.stopPropagation(); }), e.addEventListener("focusin", () => d(c)), e.addEventListener("focusout", () => _(c)), r != null && r.shouldFocusOnHover && (e.addEventListener("mouseenter", () => d(l)), e.addEventListener("mouseleave", () => _(l))), !(r != null && r.preventOnClickHandling)) { if (t.onclick) throw new Error("popupFocusHandler: button alre