UNPKG

@utahdts/utah-design-system-header

Version:
1,334 lines 159 kB
//#region src/js/enumerations/childrenMenuTypes.js var e = { FLYOUT: "flyout", INLINE: "inline", MEGA_MENU: "mega-menu", PLAIN: "plain" }, t = { 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" }, n = { HEADER_LOADED: "utahHeaderLoaded", HEADER_UNLOADED: "utahHeaderUnloaded" }, r = { SMALL: "SMALL", MEDIUM: "MEDIUM", LARGE: "LARGE" }, i = "/* @media is never in scope for --variables, so this is the only way to solve this. :-( */\n\n@media screen and (max-width: media-size__tablet-landscape__PLACEHOLDER) {\n /* put your media query here for tablet landscape */\n .utah-design-system .search-modal__input[type=text] {\n width: 75vw;\n }\n}\n\n@media screen and (max-width: media-size__tablet-portrait__PLACEHOLDER) {\n .utds-header-desktop--hidden {\n display: flex !important;\n }\n .utds-header-mobile--hidden {\n display: none !important;\n }\n .utds-header {\n height: 60px;\n padding: var(--spacing-xs) var(--spacing-s);\n display: flex;\n justify-content: space-between;\n }\n .utds-citizen-experience-wrapper {\n display: none;\n }\n .utds-citizen-experience-wrapper--mobile {\n display: flex;\n }\n .utah-design-system .main-menu__wrapper {\n padding: 0 var(--spacing);\n /* The utah id button is this tall, but without it, the menu doesn't fill the space up to the mobile menu content popup */\n min-height: 46px;\n }\n .utah-design-system .main-menu__nav {\n display: none;\n }\n .utah-design-system.utds-header-mobile-menu,\n .utah-design-system .utds-header-mobile__utah-id-wrapper {\n display: block;\n }\n .utah-design-system .icon-button.main-menu__hamburger,\n .utah-design-system .utds-header-mobile__vip-action-items--left,\n .utah-design-system .utds-header-mobile__vip-action-items--right,\n .utah-design-system .main-menu__search-placeholder {\n display: flex;\n }\n\n .utah-design-system .search-modal__input[type=text] {\n width: 80vw;\n padding: var(--spacing) var(--spacing) var(--spacing) var(--spacing-3xl);\n }\n .utah-design-system .search-modal__button-wrapper {\n right: unset;\n left: 50%;\n transform: translateX(-50%) translateY(110%);\n }\n .utah-design-system .search-modal__button.button--solid.button--primary-color {\n border-color: white;\n width: max-content;\n }\n\n .utah-design-system .utds-official-website-popup__col {\n width: 100%;\n }\n .utah-design-system .utds-official-website-popup__address-bar {\n width: auto;\n background-size: contain;\n background-repeat: no-repeat;\n }\n\n .color-example {\n flex-direction: column;\n &.col-3 > div {\n width: 100%;\n }\n }\n .color-example > div:not(:last-child) {\n margin-bottom: var(--spacing-l);\n }\n\n .search-page {\n .search-modal__form {\n margin-bottom: var(--spacing-4xl);\n }\n .search-modal__input[type=text] {\n padding: var(--spacing) var(--spacing) var(--spacing) var(--spacing-3xl);\n }\n }\n}\n\n@media screen and (max-width: media-size__mobile__PLACEHOLDER) {\n /* put your media query here for mobile */\n}\n"; //#endregion //#region src/js/enumerations/domConstants.js function a(e) { return `.${(Array.isArray(e) ? e : [e]).join(".")}`; } var o = { UTAH_DESIGN_SYSTEM: "utah-design-system", HEADER: "utds-header", FOOTER: "utds-footer", ICON_BUTTON: "icon-button", CSS_HEADER_MEDIA_TAG_ID: "cssHeaderMediaTag", SSO_HEADER_SCRIPT_TAG_ID: "ssoHeaderScriptTag", 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", ACTION_ITEMS__WRAPPER: "utds-action-items-wrapper", 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", 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: "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__REMOVED: "main-menu-is-removed", MAIN_MENU__SEARCH: "main-menu__search", MENU_ITEM: "menu-item", 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", MOBILE__VIP_ACTION_ITEMS__LEFT: "utds-header-mobile__vip-action-items--left", 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__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", OFFICIAL_BANNER: "utds-official-website__wrapper", OFFICIAL_BUTTON: "utds-official-website__button", OFFICIAL_WRAPPER: "utds-official-website-popup__wrapper", VERTICAL_MENU: "vertical-menu", 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: "vertical-menu__wrapper", VERTICAL_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", SKIP_LINK_LINK: "skip-link__link", SKIP_LINK_WRAPPER: "skip-link__wrapper", TITLE: "utds-title-wrapper", TITLE__LOGO: "utds-title-wrapper__logo", TITLE__TITLE: "utds-title-wrapper__title", TOOLTIP: "utds-tooltip", TOOLTIP__ARROW: "tooltip__arrow", 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", NOTIFICATIONS__IFRAME: "utds-notifications-iframe", NOTIFICATIONS__CACHE_KEY: "utds-notifications-cache", NOTIFICATIONS__DRAWER_ID: "utds-notifications__drawer", NOTIFICATIONS__DRAWER_HEADER_BUTTONS: "utds-notifications-drawer__header-buttons", NOTIFICATIONS__DRAWER_MARK_ALL_READ_ID: "utds-notifications__mark-all-read", NOTIFICATIONS__DRAWER_VIEW_ALL_ID: "utds-notifications__view-all", NOTIFICATIONS__DRAWER_CLOSE_BUTTON: "drawer__close-button", NOTIFICATIONS__DRAWER_BACKDROP: "drawer__backdrop", NOTIFICATIONS__DRAWER_INNER: "drawer__inner", NOTIFICATIONS__DRAWER_TITLE: "drawer__title", NOTIFICATIONS__DRAWER_END_FOCUS: "drawer__end-focus", NOTIFICATIONS__LIST: "utds-notifications__list", NOTIFICATIONS__LOAD_MORE: "load-more-notifications", NOTIFY__LIST_ITEM: "utds-notify-list-item", NOTIFY__LIST_ITEM_IS_READ: "utds-notify-list-item--is-read", NOTIFY__LIST_ITEM_STATUS: "utds-notify-list-item__status", NOTIFY__LIST_ITEM_STATUS_IS_READ: "utds-notify-list-item__status--is-read", NOTIFY__LIST_ITEM_ICON: "utds-notify-list-item__icon", NOTIFY__LIST_ITEM_TITLE: "utds-notify-list-item__title", NOTIFY__LIST_ITEM_TIME: "utds-notify-list-item__time", NOTIFY__LIST_ITEM_BRAND: "utds-notify-list-item__brand", NOTIFY__LIST_ITEM_MESSAGE: "utds-notify-list-item__message", NOTIFY__LIST_ITEM_LINK: "utds-notify-list-item__link", NOTIFY__LIST_ITEM_LINK_TEXT: "utds-notify-list-item__link-text", NOTIFY__BUSY_CARD: "utds-notify-list-item--busy-card", NOTIFICATIONS__ACTION_ITEM: "utds-header-action-item--notifications", NOTIFICATIONS__ACTION_ITEM_BADGE: "utds-badge--notifications", SPINNER__ANIMATION: "spinner__animation", SPINNER__VALUE: "spinner__value" }; //#endregion //#region src/js/misc/checkForError.js function s(e, t) { if (e) throw Error(t); } //#endregion //#region src/js/misc/notNull.js function c(e, t) { if (e == null) throw Error(t); return e; } //#endregion //#region src/js/misc/isString.js function l(e) { return typeof e == "string" || e instanceof String; } //#endregion //#region src/js/misc/renderDOMSingle.js function u(e) { let t = new DOMParser(), n; if (l(e)) { let r = l(e) ? t.parseFromString(e, "text/html") : e, i = r.body.children.length > 1 ? r.body.children : r.body.children.item(0); if (!i) throw console.error(e), Error("renderDOM: nothing rendered"); n = i; } else if (e instanceof Element) n = e; else if (e) throw console.error(e), Error(`renderDOM: str is not a string nor a DOM Element : '${e}'`); else throw Error("renderDOM: falsy string passed; cannot render nothing"); return n; } function d(e) { let t = typeof e == "string" ? u(e) : e; if (t instanceof HTMLCollection && t.length > 1) throw Error("renderDOMSingle: must render a single element"); let n = t instanceof HTMLCollection ? t[0] : t; if (!n) throw console.error(e), Error("renderDOMSingle: nothing rendered"); return n; } //#endregion //#region src/js/settings/defaultSettings.js var f = { applicationType: "", onSearch: !1, mainMenu: !1, mediaSizes: { mobile: 640, tabletPortrait: 768, tabletLandscape: 1024 }, notifications: !1, showTitle: !0, size: r.MEDIUM, skipLinkUrl: "#main-content", title: "My Utah.gov Site", titleUrl: "/", utahId: !1 }; //#endregion //#region src/js/settings/settingsKeeper.js function p(e) { if (!e.showTitle && !e.logo) throw 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."); } var m = new class { constructor() { this.settings = { ...f }; } setSettings(e) { let t = { ...f, ...this.settings, ...e }; p(t), this.settings = t; } getSettings() { return this.settings; } clearSettings() { this.settings = { ...f }; } }(); //#endregion //#region src/js/settings/getUtahHeaderSettings.js function h() { return m.getSettings(); } //#endregion //#region src/js/misc/uuidv4.js function g() { return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (e) => (e ^ c(crypto.getRandomValues(new Uint8Array(1))[0], "uuidv4: crypto") & (15 >> e) / 4).toString(16)); } //#endregion //#region src/js/renderables/mobile/html/MobileMenuContentItemWrapper.html?raw var _ = "<div class=\"utds-header-mobile-menu__content-item\" role=\"tabpanel\">\n</div>\n"; //#endregion //#region src/js/renderables/mobile/addMobileMenuContentItem.js function v(e) { let t = document.querySelector(a(o.MOBILE_MENU__WRAPPER)); if (!t) throw Error("addMobileMenuContentItem: mobileMenuWrapper not found"); let n = t.querySelector(a(o.MOBILE_MENU__CONTENT)); if (!n) throw Error("addMobileMenuContentItem: mobileContentWrapper not found"); let r = d(_); return r.appendChild(e), n.appendChild(r), r.setAttribute("id", g()), r; } //#endregion //#region src/js/misc/valueOrFunctionValue.js function y(e) { return e instanceof Function ? e() : e; } //#endregion //#region src/js/renderables/mobile/util/getHamburgerElements.js function b(e) { let t = c(document.querySelector(a(o.MOBILE_MENU)), `${e}: mobileMenu not found`); return { hamburger: document.getElementById(o.MAIN_MENU__HAMBURGER_ID), hamburgerIcon: document.getElementById(o.MAIN_MENU__HAMBURGER_ICON_ID), mobileMenu: t }; } //#endregion //#region src/js/renderables/mobile/util/showHideHamburgerElements.js function x() { let { hamburger: e, hamburgerIcon: t, mobileMenu: n } = b("hideMobileMenu"); e?.setAttribute("aria-expanded", "false"), n.classList.remove(o.IS_OPEN), e?.setAttribute("aria-label", "Open the mobile menu"), t?.classList.add("utds-icon-before-hamburger"), t?.classList.remove("utds-icon-before-x-icon"), document.body.style.position = ""; } function ee() { document.querySelector(a(o.MAIN_MENU))?.classList.contains(o.MOBILE__HIDDEN) && document.querySelector(`${a(o.UTAH_DESIGN_SYSTEM)}${a(o.MOBILE_MENU)}`)?.classList.add(o.MAIN_MENU__REMOVED); let { hamburger: e, hamburgerIcon: t, mobileMenu: n } = b("showMobileMenu"); e?.setAttribute("aria-expanded", "true"), n.classList.add(o.IS_OPEN), e?.setAttribute("aria-label", "Close the mobile menu"), t?.classList.remove("utds-icon-before-hamburger"), t?.classList.add("utds-icon-before-x-icon"), document.body.style.position = "relative"; } //#endregion //#region src/js/renderables/mobile/mobileMenuInteractionHandler.js function S(e, t) { e.querySelectorAll(a(o.MOBILE_MENU_ACTION_BAR__ACTION_ITEM_WRAPPER)).forEach((e) => { e.classList.remove(o.ACTION_ITEM__SELECTED); let t = e.querySelector("button"); if (!t) throw Error("showActionItem: actionWrapper does not have actionItem A"); t.setAttribute("aria-selected", "false"), t.setAttribute("tabIndex", "-1"); }), t.classList.add(o.ACTION_ITEM__SELECTED); let n = t.querySelector("button"); if (!n) throw Error("showActionItem: actionWrapper does not have actionItem B"); n.setAttribute("aria-selected", "true"), n.removeAttribute("tabIndex"), n.focus(); } function C(e, t) { e.querySelectorAll(a(o.MOBILE_MENU__CONTENT_ITEM)).forEach((e) => e.classList.remove(o.IS_OPEN)), t.classList.add(o.IS_OPEN); } function w(e, t, n, { ariaHasPopupType: r, additionalOnClick: i, onClickHandler: s, shouldOnClickCloseMenu: c }) { let l = h(); if (t && !r) throw Error("mobileMenuInteractionHandler: there is content, but the aria type is not given"); let u = document.querySelector(a(o.MOBILE_MENU)); if (!u) throw Error("mobileMenuInteractionHandler: mobileMenu not found"); let d = document.querySelector(a(o.MOBILE_MENU__WRAPPER)); if (!d) throw Error("mobileMenuInteractionHandler: mobileMenuWrapper not found"); let f = d.querySelector(a(o.MOBILE_MENU__CONTENT)); if (!f) throw Error("mobileMenuInteractionHandler: mobileContentWrapper not found"); let p = y(n), m = y(n)?.querySelector?.("button"), g = (m || e).getAttribute("id"); if (!g) throw Error("mobileMenuInteractionHandler: interactiveElementId not found"); if (t && l.mainMenu) { let n = y(t); if (n) { let t = n.getAttribute("id"); if (!t) throw Error("mobileMenuInteractionHandler: mobileMenuContentId not found"); (m || e).setAttribute("aria-controls", t), n.setAttribute("aria-labelledby", g); } } if (e.onclick) throw Error("mobileMenuInteractionHandler: interactiveElement already has onclick"); if (e.onclick = (e) => { if (!s?.(e)) if (i?.(e), u.classList.contains(o.IS_OPEN)) c && x(); else { ee(); let e = y(t); e && C(f, e), S(d, y(n)); } }, t) { if (p !== e && p.onclick) throw Error("mobileMenuInteractionHandler: actionItemWrapperValue already has onclick"); p.onclick = (e) => { if (!s?.(e)) { let e = y(t); e && C(f, e), S(d, y(n)); } }; } } var T = new class { #e = { notifications: null, isBusy: !1 }; constructor(e) { this.#e = JSON.parse(JSON.stringify(e)); } getState() { return JSON.parse(JSON.stringify(this.#e)); } setState(e) { this.#e = { ...this.#e, ...e }; } }({}), E = Math.min, D = Math.max, O = Math.round, k = Math.floor, A = (e) => ({ x: e, y: e }), te = { left: "right", right: "left", bottom: "top", top: "bottom" }; function ne(e, t, n) { return D(e, E(t, n)); } function j(e, t) { return typeof e == "function" ? e(t) : e; } function M(e) { return e.split("-")[0]; } function re(e) { return e.split("-")[1]; } function ie(e) { return e === "x" ? "y" : "x"; } function ae(e) { return e === "y" ? "height" : "width"; } function N(e) { let t = e[0]; return t === "t" || t === "b" ? "y" : "x"; } function oe(e) { return ie(N(e)); } function se(e, t, n) { n === void 0 && (n = !1); let r = re(e), i = oe(e), a = ae(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top"; return t.reference[a] > t.floating[a] && (o = ge(o)), [o, ge(o)]; } function ce(e) { let t = ge(e); return [ le(e), t, le(t) ]; } function le(e) { return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start"); } var ue = ["left", "right"], de = ["right", "left"], fe = ["top", "bottom"], pe = ["bottom", "top"]; function me(e, t, n) { switch (e) { case "top": case "bottom": return n ? t ? de : ue : t ? ue : de; case "left": case "right": return t ? fe : pe; default: return []; } } function he(e, t, n, r) { let i = re(e), a = me(M(e), n === "start", r); return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(le)))), a; } function ge(e) { let t = M(e); return te[t] + e.slice(t.length); } function _e(e) { return { top: 0, right: 0, bottom: 0, left: 0, ...e }; } function ve(e) { return typeof e == "number" ? { top: e, right: e, bottom: e, left: e } : _e(e); } function ye(e) { let { x: t, y: n, width: r, height: i } = e; return { width: r, height: i, top: n, left: t, right: t + r, bottom: n + i, x: t, y: n }; } //#endregion //#region ../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs function be(e, t, n) { let { reference: r, floating: i } = e, a = N(t), o = oe(t), s = ae(o), c = M(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p; switch (c) { case "top": p = { x: u, y: r.y - i.height }; break; case "bottom": p = { x: u, y: r.y + r.height }; break; case "right": p = { x: r.x + r.width, y: d }; break; case "left": p = { x: r.x - i.width, y: d }; break; default: p = { x: r.x, y: r.y }; } switch (re(t)) { case "start": p[o] -= f * (n && l ? -1 : 1); break; case "end": p[o] += f * (n && l ? -1 : 1); break; } return p; } async function xe(e, t) { t === void 0 && (t = {}); let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = j(t, e), p = ve(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = ye(await i.getClippingRect({ element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)), boundary: c, rootBoundary: l, strategy: s })), g = u === "floating" ? { x: n, y: r, width: a.floating.width, height: a.floating.height } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || { x: 1, y: 1 }, y = ye(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({ elements: o, rect: g, offsetParent: _, strategy: s }) : g); return { top: (h.top - y.top + p.top) / v.y, bottom: (y.bottom - h.bottom + p.bottom) / v.y, left: (h.left - y.left + p.left) / v.x, right: (y.right - h.right + p.right) / v.x }; } var Se = 50, Ce = async (e, t, n) => { let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : { ...o, detectOverflow: xe }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({ reference: e, floating: t, strategy: i }), { x: u, y: d } = be(l, r, c), f = r, p = 0, m = {}; for (let n = 0; n < a.length; n++) { let h = a[n]; if (!h) continue; let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({ x: u, y: d, initialPlacement: r, placement: f, strategy: i, middlewareData: m, rects: l, platform: s, elements: { reference: e, floating: t } }); u = v ?? u, d = y ?? d, m[g] = { ...m[g], ...b }, x && p < Se && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({ reference: e, floating: t, strategy: i }) : x.rects), {x: u, y: d} = be(l, f, c)), n = -1); } return { x: u, y: d, placement: f, strategy: i, middlewareData: m }; }, we = (e) => ({ name: "arrow", options: e, async fn(t) { let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = j(e, t) || {}; if (l == null) return {}; let d = ve(u), f = { x: n, y: r }, p = oe(i), m = ae(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], ee = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), S = ee ? ee[y] : 0; (!S || !await (o.isElement == null ? void 0 : o.isElement(ee))) && (S = s.floating[y] || a.floating[m]); let C = b / 2 - x / 2, w = S / 2 - h[m] / 2 - 1, T = E(d[_], w), D = E(d[v], w), O = T, k = S - h[m] - D, A = S / 2 - h[m] / 2 + C, te = ne(O, A, k), M = !c.arrow && re(i) != null && A !== te && a.reference[m] / 2 - (A < O ? T : D) - h[m] / 2 < 0, ie = M ? A < O ? A - O : A - k : 0; return { [p]: f[p] + ie, data: { [p]: te, centerOffset: A - te - ie, ...M && { alignmentOffset: ie } }, reset: M }; } }), Te = function(e) { return e === void 0 && (e = {}), { name: "flip", options: e, async fn(t) { var n; let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = j(e, t); if ((n = i.arrow) != null && n.alignmentOffset) return {}; let g = M(r), _ = N(o), v = M(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [ge(o)] : ce(o)), x = p !== "none"; !d && x && b.push(...he(o, m, p, y)); let ee = [o, ...b], S = await s.detectOverflow(t, h), C = [], w = i.flip?.overflows || []; if (l && C.push(S[g]), u) { let e = se(r, a, y); C.push(S[e[0]], S[e[1]]); } if (w = [...w, { placement: r, overflows: C }], !C.every((e) => e <= 0)) { let e = (i.flip?.index || 0) + 1, t = ee[e]; if (t && (!(u === "alignment" && _ !== N(t)) || w.every((e) => N(e.placement) === _ ? e.overflows[0] > 0 : !0))) return { data: { index: e, overflows: w }, reset: { placement: t } }; let n = w.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement; if (!n) switch (f) { case "bestFit": { let e = w.filter((e) => { if (x) { let t = N(e.placement); return t === _ || t === "y"; } return !0; }).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0]; e && (n = e); break; } case "initialPlacement": n = o; break; } if (r !== n) return { reset: { placement: n } }; } return {}; } }; }, Ee = /* @__PURE__ */ new Set(["left", "top"]); async function De(e, t) { let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = M(n), s = re(n), c = N(n) === "y", l = Ee.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = j(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? { mainAxis: d, crossAxis: 0, alignmentAxis: null } : { mainAxis: d.mainAxis || 0, crossAxis: d.crossAxis || 0, alignmentAxis: d.alignmentAxis }; return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? { x: p * u, y: f * l } : { x: f * l, y: p * u }; } var Oe = function(e) { return e === void 0 && (e = 0), { name: "offset", options: e, async fn(t) { var n; let { x: r, y: i, placement: a, middlewareData: o } = t, s = await De(t, e); return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : { x: r + s.x, y: i + s.y, data: { ...s, placement: a } }; } }; }, ke = function(e) { return e === void 0 && (e = {}), { name: "shift", options: e, async fn(t) { let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => { let { x: t, y: n } = e; return { x: t, y: n }; } }, ...l } = j(e, t), u = { x: n, y: r }, d = await a.detectOverflow(t, l), f = N(M(i)), p = ie(f), m = u[p], h = u[f]; if (o) { let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t]; m = ne(n, m, r); } if (s) { let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t]; h = ne(n, h, r); } let g = c.fn({ ...t, [p]: m, [f]: h }); return { ...g, data: { x: g.x - n, y: g.y - r, enabled: { [p]: o, [f]: s } } }; } }; }; //#endregion //#region ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function Ae() { return typeof window < "u"; } function P(e) { return je(e) ? (e.nodeName || "").toLowerCase() : "#document"; } function F(e) { var t; return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window; } function I(e) { return ((je(e) ? e.ownerDocument : e.document) || window.document)?.documentElement; } function je(e) { return Ae() ? e instanceof Node || e instanceof F(e).Node : !1; } function L(e) { return Ae() ? e instanceof Element || e instanceof F(e).Element : !1; } function R(e) { return Ae() ? e instanceof HTMLElement || e instanceof F(e).HTMLElement : !1; } function Me(e) { return !Ae() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof F(e).ShadowRoot; } function z(e) { let { overflow: t, overflowX: n, overflowY: r, display: i } = H(e); return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents"; } function Ne(e) { return /^(table|td|th)$/.test(P(e)); } function Pe(e) { try { if (e.matches(":popover-open")) return !0; } catch {} try { return e.matches(":modal"); } catch { return !1; } } var Fe = /transform|translate|scale|rotate|perspective|filter/, Ie = /paint|layout|strict|content/, B = (e) => !!e && e !== "none", Le; function Re(e) { let t = L(e) ? H(e) : e; return B(t.transform) || B(t.translate) || B(t.scale) || B(t.rotate) || B(t.perspective) || !Be() && (B(t.backdropFilter) || B(t.filter)) || Fe.test(t.willChange || "") || Ie.test(t.contain || ""); } function ze(e) { let t = U(e); for (; R(t) && !V(t);) { if (Re(t)) return t; if (Pe(t)) return null; t = U(t); } return null; } function Be() { return Le ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), Le; } function V(e) { return /^(html|body|#document)$/.test(P(e)); } function H(e) { return F(e).getComputedStyle(e); } function Ve(e) { return L(e) ? { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop } : { scrollLeft: e.scrollX, scrollTop: e.scrollY }; } function U(e) { if (P(e) === "html") return e; let t = e.assignedSlot || e.parentNode || Me(e) && e.host || I(e); return Me(t) ? t.host : t; } function He(e) { let t = U(e); return V(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : R(t) && z(t) ? t : He(t); } function Ue(e, t, n) { t === void 0 && (t = []), n === void 0 && (n = !0); let r = He(e), i = r === e.ownerDocument?.body, a = F(r); if (i) { let e = We(a); return t.concat(a, a.visualViewport || [], z(r) ? r : [], e && n ? Ue(e) : []); } else return t.concat(r, Ue(r, [], n)); } function We(e) { return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null; } //#endregion //#region ../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs function Ge(e) { let t = H(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = R(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = O(n) !== a || O(r) !== o; return s && (n = a, r = o), { width: n, height: r, $: s }; } function Ke(e) { return L(e) ? e : e.contextElement; } function W(e) { let t = Ke(e); if (!R(t)) return A(1); let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = Ge(t), o = (a ? O(n.width) : n.width) / r, s = (a ? O(n.height) : n.height) / i; return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), { x: o, y: s }; } var qe = /* @__PURE__ */ A(0); function Je(e) { let t = F(e); return !Be() || !t.visualViewport ? qe : { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop }; } function Ye(e, t, n) { return t === void 0 && (t = !1), !n || t && n !== F(e) ? !1 : t; } function G(e, t, n, r) { t === void 0 && (t = !1), n === void 0 && (n = !1); let i = e.getBoundingClientRect(), a = Ke(e), o = A(1); t && (r ? L(r) && (o = W(r)) : o = W(e)); let s = Ye(a, n, r) ? Je(a) : A(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y; if (a) { let e = F(a), t = r && L(r) ? F(r) : r, n = e, i = We(n); for (; i && r && t !== n;) { let e = W(i), t = i.getBoundingClientRect(), r = H(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y; c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = F(i), i = We(n); } } return ye({ width: u, height: d, x: c, y: l }); } function Xe(e, t) { let n = Ve(e).scrollLeft; return t ? t.left + n : G(I(e)).left + n; } function Ze(e, t) { let n = e.getBoundingClientRect(); return { x: n.left + t.scrollLeft - Xe(e, n), y: n.top + t.scrollTop }; } function Qe(e) { let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = I(r), s = t ? Pe(t.floating) : !1; if (r === o || s && a) return n; let c = { scrollLeft: 0, scrollTop: 0 }, l = A(1), u = A(0), d = R(r); if ((d || !d && !a) && ((P(r) !== "body" || z(o)) && (c = Ve(r)), d)) { let e = G(r); l = W(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop; } let f = o && !d && !a ? Ze(o, c) : A(0); return { width: n.width * l.x, height: n.height * l.y, x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x, y: n.y * l.y - c.scrollTop * l.y + u.y + f.y }; } function $e(e) { return Array.from(e.getClientRects()); } function et(e) { let t = I(e), n = Ve(e), r = e.ownerDocument.body, i = D(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = D(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Xe(e), s = -n.scrollTop; return H(r).direction === "rtl" && (o += D(t.clientWidth, r.clientWidth) - i), { width: i, height: a, x: o, y: s }; } var tt = 25; function nt(e, t) { let n = F(e), r = I(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0; if (i) { a = i.width, o = i.height; let e = Be(); (!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop); } let l = Xe(r); if (l <= 0) { let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i); o <= tt && (a -= o); } else l <= tt && (a += l); return { width: a, height: o, x: s, y: c }; } function rt(e, t) { let n = G(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = R(e) ? W(e) : A(1); return { width: e.clientWidth * a.x, height: e.clientHeight * a.y, x: i * a.x, y: r * a.y }; } function it(e, t, n) { let r; if (t === "viewport") r = nt(e, n); else if (t === "document") r = et(I(e)); else if (L(t)) r = rt(t, n); else { let n = Je(e); r = { x: t.x - n.x, y: t.y - n.y, width: t.width, height: t.height }; } return ye(r); } function at(e, t) { let n = U(e); return n === t || !L(n) || V(n) ? !1 : H(n).position === "fixed" || at(n, t); } function ot(e, t) { let n = t.get(e); if (n) return n; let r = Ue(e, [], !1).filter((e) => L(e) && P(e) !== "body"), i = null, a = H(e).position === "fixed", o = a ? U(e) : e; for (; L(o) && !V(o);) { let t = H(o), n = Re(o); !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || z(o) && !n && at(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = U(o); } return t.set(e, r), r; } function st(e) { let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? Pe(t) ? [] : ot(t, this._c) : [].concat(n), r], o = it(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left; for (let e = 1; e < a.length; e++) { let n = it(t, a[e], i); s = D(n.top, s), c = E(n.right, c), l = E(n.bottom, l), u = D(n.left, u); } return { width: c - u, height: l - s, x: u, y: s }; } function ct(e) { let { width: t, height: n } = Ge(e); return { width: t, height: n }; } function lt(e, t, n) { let r = R(t), i = I(t), a = n === "fixed", o = G(e, !0, a, t), s = { scrollLeft: 0, scrollTop: 0 }, c = A(0); function l() { c.x = Xe(i); } if (r || !r && !a) if ((P(t) !== "body" || z(i)) && (s = Ve(t)), r) { let e = G(t, !0, a, t); c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop; } else i && l(); a && !r && i && l(); let u = i && !r && !a ? Ze(i, s) : A(0); return { x: o.left + s.scrollLeft - c.x - u.x, y: o.top + s.scrollTop - c.y - u.y, width: o.width, height: o.height }; } function ut(e) { return H(e).position === "static"; } function dt(e, t) { if (!R(e) || H(e).position === "fixed") return null; if (t) return t(e); let n = e.offsetParent; return I(e) === n && (n = n.ownerDocument.body), n; } function ft(e, t) { let n = F(e); if (Pe(e)) return n; if (!R(e)) { let t = U(e); for (; t && !V(t);) { if (L(t) && !ut(t)) return t; t = U(t); } return n; } let r = dt(e, t); for (; r && Ne(r) && ut(r);) r = dt(r, t); return r && V(r) && ut(r) && !Re(r) ? n : r || ze(e) || n; } var pt = async function(e) { let t = this.getOffsetParent || ft, n = this.getDimensions, r = await n(e.floating); return { reference: lt(e.reference, await t(e.floating), e.strategy), floating: { x: 0, y: 0, width: r.width, height: r.height } }; }; function mt(e) { return H(e).direction === "rtl"; } var ht = { convertOffsetParentRelativeRectToViewportRelativeRect: Qe, getDocumentElement: I, getClippingRect: st, getOffsetParent: ft, getElementRects: pt, getClientRects: $e, getDimensions: ct, getScale: W, isElement: L, isRTL: mt }; function gt(e, t) { return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height; } function _t(e, t) { let n = null, r, i = I(e); function a() { var e; clearTimeout(r), (e = n) == null || e.disconnect(), n = null; } function o(s, c) { s === void 0 && (s = !1), c === void 0 && (c = 1), a(); let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l; if (s || t(), !f || !p) return; let m = k(d), h = k(i.clientWidth - (u + f)), g = k(i.clientHeight - (d + p)), _ = k(u), v = { rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px", threshold: D(0, E(1, c)) || 1 }, y = !0; function b(t) { let n = t[0].intersectionRatio; if (n !== c) { if (!y) return o(); n ? o(!1, n) : r = setTimeout(() => { o(!1, 1e-7); }, 1e3); } n === 1 && !gt(l, e.getBoundingClientRect()) && o(), y = !1; } try { n = new IntersectionObserver(b, { ...v, root: i.ownerDocument }); } catch { n = new IntersectionObserver(b, v); } n.observe(e); } return o(!0), a; } function vt(e, t, n, r) { r === void 0 && (r = {}); let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = Ke(e), u = i || a ? [...l ? Ue(l) : [], ...t ? Ue(t) : []] : []; u.forEach((e) => { i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n); }); let d = l && s ? _t(l, n) : null, f = -1, p = null; o && (p = new ResizeObserver((e) => { let [r] = e; r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => { var e; (e = p) == null || e.observe(t); })), n(); }), l && !c && p.observe(l), t && p.observe(t)); let m, h = c ? G(e) : null; c && g(); function g() { let t = G(e); h && !gt(h, t) && n(), h = t, m = requestAnimationFrame(g); } return n(), () => { var e; u.forEach((e) => { i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n); }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m); }; } var yt = Oe, bt = ke, xt = Te, St = we, Ct = (e, t, n) => { let r = /* @__PURE__ */ new Map(), i = { platform: ht, ...n }, a = { ...i.platform, _c: r }; return Ce(e, t, { ...i, platform: a }); }, wt = "<div class=\"tooltip__wrapper tooltip__wrapper--hidden\" aria-hidden=\"true\">\n <div class=\"tooltip__content\">\n <div class=\"tooltip__arrow\"></div>\n </div>\n</div>\n", Tt = NaN; function Et(e, n) { let r = d(wt), i = r.querySelector(a(o.TOOLTIP__CONTENT)), s = r.querySelector(a(o.TOOLTIP__ARROW)), c; if (!i) throw Error("hookupTooltip: tooltipContent not found"); i.appendChild(n), e.appendChild(r); let l = [ yt(5), xt(), bt() ]; s && l.push(St({ element: s })); let u = () => Ct(e, r, { placement: t.BOTTOM, middleware: l }).then(({ x: e, y: n, middlewareData: i }) => { r.setAttribute("data-popup-placement", t.BOTTOM), Object.assign(r.style, { left: `${e}px`, top: `${n}px` }), s && Object.assign(s?.style, { left: `${i.arrow?.x}px`, top: `${i?.arrow?.y}px` }); }); if (e.onmouseenter || e.onmouseleave) throw Error("hookupTooltip: element already has an onmouseenter and/or onmouseleave event"); let f = NaN, p = () => { clearTimeout(f), r.classList.add(o.TOOLTIP__WRAPPER__HIDDEN), r.classList.remove(o.TOOLTIP__WRAPPER__VISIBLE), typeof c == "function" && c(), Tt = window.setTimeout(() => { Tt = NaN; }, 500); }, m = (e) => { (e.code === "Escape" || e.key === "Escape") && (p(), document.removeEventListener("keyup", m)); }; e.onmouseleave = () => { p(), document.removeEventListener("keyup", m); }, e.onmouseenter = () => { clearTimeout(f), f = window.setTimeout(() => { clearTimeout(Tt), Tt = -1; let t = e.querySelector(a(o.POPUP_WRAPPER)); (!t || t.classList.contains(o.POPUP__HIDDEN)) && (r.classList.remove(o.TOOLTIP__WRAPPER__HIDDEN), r.classList.add(o.TOOLTIP__WRAPPER__VISIBLE), c = vt(e, r, u), document.addEventListener("keyup", m)); }, Tt ? 0 : 500); }; } //#endregion //#region src/js/renderables/actionItems/html/AnchorActionItem.html?raw var Dt = "<div class=\"utds-header-action-item\">\n <a href=\"#\" class=\"icon-button utds-header-action-item__icon-button\">\n <span class=\"utds-header-action-item__title visually-hidden\"></span>\n </a>\n</div>\n", Ot = "<div class=\"utds-badge__wrapper\">\n <span class=\"utds-badge__value\"></span>\n <span class=\"utds-badge__label visually-hidden\"></span>\n</div>\n"; //#endregion //#region src/js/renderables/actionItems/renderActionItemBadge.js function kt(e) { let t = null; if (e) { t = d(Ot), t.classList.add(o.BADGE_WRAPPER__ACTION_ITEM); let n = t.querySelector(a(o.BADGE__LABEL)); if (!n) throw Error("renderActionItemBadge: badgeLabel not found"); if (n.appendChild(document.createTextNode(e.label)), e.value || e.value === 0) { let n = t.querySelector(a(o.BADGE__VALUE)); if (!n) throw Error("renderActionItemBadge: badgeValue not found"); n.appendChild(document.createTextNode(`${e.value}`)); } else t.classList.add(o.BADGE_WRAPPER__SMALL); e.className && t.classList.add(e.className); } return t; } //#endregion //#region src/js/renderables/actionItems/renderAnchorActionItem.js function At(e) { let t = d(Dt), n = document.createTextNode(e.title), r = t instanceof HTMLCollection ? t[0] : t; e.showTitle && r.classList.add(o.ACTION_ITEM__ICON_BUTTON_TITLE); let i = r.querySelector(a(o.ACTION_ITEM__TITLE)); if (!i) throw Error("renderActionItem: titleDiv not found"); i.appendChild(n), e.showTitle ? i.classList.remove(o.VISUALLY_HIDDEN) : i.classList.add(o.VISUALLY_HIDDEN); let s = t.querySelector(a(o.ACTION_ITEM__ICON_BUTTON)); if (!s) throw Error("renderActionItem: iconAnchor not found"); e.className && s.classList.add(e.className); let c = kt(e.badge); c && s.appendChild(c); let l = d(e.icon); if (l.setAttribute("role", "presentation"), s.appendChild(l), !(s instanceof HTMLElement)) throw Error("renderActionItem: iconAnchor is not an HTMLElement"); if (e.actionLink) s.href = e.actionLink; else throw console.error(e), Error("Action Item: no defined action; must have an actionLink"); return Et(t, document.createTextNode(e.title)), t; } //#endregion //#region src/js/renderables/notifications/html/NotificationsDrawer.html?raw var jt = "<div class=\"utah-design-system\" id=\"utds-notifications__drawer\">\n <div class=\"drawer-wrapper utds-notifications-drawer\">\n <div class=\"drawer__backdrop backdrop-dark\">\n <dialog\n aria-labelledby=\"notifications-drawer-title\"\n class=\"drawer__inner drawer--right\"\n >\n <div\n class=\"drawer__title\"\n id=\"notifications-drawer-title\"\n tabindex=\"0\"\n >\n <span class=\"utds-icon-before-alert\" aria-hidden=\"true\"></span> Notifications\n </div>\n\n <div\n class=\"utds-notifications-drawer__header-buttons\"\n >\n <button\n class=\"button button--solid button--primary-color\"\n type=\"button\"\n id=\"utds-notifications__mark-all-read\"\n disabled\n >\n Mark all as read\n </button>\n <a\n class=\"button button--solid\"\n type=\"button\"\n id=\"utds-notifications__view-all\"\n >\n View all\n <span class=\"utds-new-tab-link-a11y\">\n <span class=\"visually-hidden\">opens in a new tab</span>\n <span class=\"utds-icon-after-external-link\" aria-hidden=\"true\" />\n </span>\n </a>\n </div>\n <ul class=\"utds-notifications__list\"></ul>\n <button class=\"button icon-button drawer__close-button icon-button--borderless icon-button--small drawer__close-button\" type=\"button\"><span class=\"utds-icon-before-x-icon\" aria-hidden=\"true\"></span><span class=\"visually-hidden\">Close</span></button>\n </dialog>\n <a href=\"#endofdialog\" class=\"drawer__end-focus visually-hidden\">End of dialog</a>\n </div>\n </div>\n</div>\n"; //#endregion //#region src/js/renderables/notifications/getNotificationCardDom.js function Mt(e) { return { status: c(e.querySelector(a(o.NOTIFY__LIST_ITEM_STATUS)), "renderNotificationItem: status not found"), icon: c(e.querySelector(`.${o.NOTIFY__LIST_ITEM_ICON} span`), "renderNotificationItem: icon not found"), title: c(e.querySelector(a(o.NOTIFY__LIST_ITEM_TITLE)), "renderNotificationItem: title not found"), time: c(e.querySelector(a(o.NOTIFY__LIST_ITEM_TIME)), "renderNotificationItem: time not found"), brand: c(e.querySelector(a(o.NOTIFY__LIST_ITEM_BRAND)), "renderNotificationItem: brand not found"), message: c(e.querySelector(a(o.NOTIFY__LIST_ITEM_MESSAGE)), "renderNotificationItem: message not found"), link: c(e.querySelector(a(o.NOTIFY__LIST_ITEM_LINK)), "renderNotificationItem: link not found"), linkText: c(e.querySelector(a(o.NOTIFY__LIST_ITEM_LINK_TEXT)), "renderNotificationItem: link text not found") }; } //#endregion //#region src/js/renderables/notifications/renderNotificationBadge.js function Nt(e = NaN) { let t = T.getState(), n = c(document.getElementsByClassName(o.NOTIFICATIONS__ACTION_ITEM), "renderNotificationBadge: notifications action item not found"), r = c(document.getElementById(o.MAIN_MENU__HAMBURGER_ID), "renderNotificationBadge: notifications hamburger menu item not found"), i = Array.from(n); r && i.push(r), i.forEach((n) => { let r = n.querySelector(`.${o.NOTIFICATIONS__ACTION_ITEM_BADGE}`); if (e || t.notifications?.unreadCount && t.notifications.unreadCount > 0) { let i = { label: "Notifications", value: t.notifications?.unreadCount || e, className: o.NOTIFICATIONS__ACTION_ITEM_BADGE }; r && r.remove(), r = c(kt(i), "renderNotificationBadge: notifications badge not found"), n.appendChild(r); } else r && r.remove(); }); } //#endregion //#region src/js/renderables/notifications/getIframeUrl.js function Pt() { if (!(window.location.href.includes(".local") && !1)) return "https://cdn.utah.gov/dts-ds-custom-header-plugin/notifications/v1/index.html"; } //#endregion //#region src/js/renderables/notifications/utahHeaderSetDebug.js var Ft = "setDebug"; function It(e = void 0) { localStorage.removeItem(Ft); let t = [ "localhost", "127.0.0.1", "::1", ".local", ".dev", ".at" ].find((e) => window.location.hostname.includes(e)) ? "true" : "false", n = typeof e == "boolean" ? e ? "true" : "false" : t; localStorage.setItem(Ft, n); } //#endregion //#region src/js/renderables/notifications/showDebugMessage.js function K() { localStorage.getItem("setDebug") === "true" && console.log(...arguments); } function Lt() { localStorage.getItem("setDebug") === "true" && console.warn(...arguments); } function Rt() { localStorage.getItem("setDebug") === "true" && console.error(...arguments); } //#endregion //#region src/js/renderables/notifications/postMessageMarkAllAsRead.js function zt() { let e = document.getElementById(o.NOTIFICATIONS__IFRAME), t = Pt(); e?.contentWindow ? (K("Parent: Mark all notifications as read:"), e.contentWindow.postMessage({ request: "markAllAsRead" }, t)) : console.error("postMessageMarkAllAsRead: Iframe is not ready or not found. Cannot mark notification as read."); } //#endregion //#region src/js/renderables/notifications/markAllAsRead.js function Bt() { c(Array.from(document.querySelectorAll(a(o.NOTIFY__LIST_ITEM))), "renderNotificationItem: Notifications List not found").forEach((e) => { let { status: t, title: n } = Mt(e); t.classList.add(o.NOTIFY__LIST_ITEM_STATUS_IS_READ), n.classList.add(o.NOTIFY__LIST_ITEM_STATUS_IS_READ), e.classList.add(o.NOTIFY__LIST_ITEM_IS_READ); }); let e = T.getState()?.notifications; if (!e || !e.edges) throw Error("No notifications object found in current state!"); { let t = e.edges.map((e) => { if (e.node.isRead) return e; { let t = { ...e.node, isRead: !0 }; return { ...e, node: t }; } }); T.setState({ notifications: { ...e, edges: t, unreadCount: 0 } }), Nt(), zt(); } } //#endregion //#region src/js/renderables/notifications/html/NotificationCa