@taprootio/espalier 6.15.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
- var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(f,e,t,r);else for(var d=f.length-1;d>=0;d--)(a=f[d])&&(i=(n<3?a(i):n>3?a(e,t,i):a(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i};import{paintedSurface as Q}from"../shared/surface-layer.js";import{css as W,html as b,nothing as p,unsafeCSS as Y}from"lit";import{customElement as K,property as l,state as v}from"lit/decorators.js";import{classMap as q}from"lit/directives/class-map.js";import{styleMap as Z}from"lit/directives/style-map.js";import"../burger/esp-burger.js";import{createRef as A,ref as H}from"lit/directives/ref.js";import{MENU_PRESENTATION_CHANGED as S,MENU_LAYOUT_CHANGED as R,MENU_FIT_PROBE_STYLES as J,menuPresentationStyle as X,renderMenuNode as ee}from"../menu/menu-presentation.js";import{EspalierMenu as T}from"../menu/esp-menu.js";import{RafThrottle as U}from"../shared/raf-throttle.js";import{viewportSize as te}from"../shared/viewport.js";import{CONFIGURED_BRAND_LOGO_ASPECT_RATIO as I,configuredBrandLogoGeometry as re,renderConfiguredBrand as F,resolveConfiguredBrand as ne}from"../shared/configured-brand.js";import{EspalierElementBase as V}from"../shared/esp-element-base.js";import{ESP_EVENTS as x}from"../shared/events.js";import{HEADER_GEOMETRY_PAINT_PROPERTIES as oe,HeaderGeometryController as ae}from"./header-geometry-controller.js";const se="(max-width: 36rem)",N=W`
1
+ var a=function(f,e,t,r){var n=arguments.length,s=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(f,e,t,r);else for(var d=f.length-1;d>=0;d--)(i=f[d])&&(s=(n<3?i(s):n>3?i(e,t,s):i(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};import{paintedSurface as Q}from"../shared/surface-layer.js";import{css as I,html as b,nothing as p,unsafeCSS as Y}from"lit";import{customElement as K,property as l,state as v}from"lit/decorators.js";import{classMap as W}from"lit/directives/class-map.js";import{styleMap as Z}from"lit/directives/style-map.js";import"../burger/esp-burger.js";import{createRef as A,ref as H}from"lit/directives/ref.js";import{MENU_PRESENTATION_CHANGED as S,MENU_LAYOUT_CHANGED as R,MENU_FIT_PROBE_STYLES as J,menuPresentationStyle as X,renderMenuNode as ee}from"../menu/menu-presentation.js";import{EspalierMenu as T}from"../menu/esp-menu.js";import{RafThrottle as q}from"../shared/raf-throttle.js";import{viewportSize as te}from"../shared/viewport.js";import{CONFIGURED_BRAND_LOGO_ASPECT_RATIO as U,configuredBrandLogoGeometry as re,renderConfiguredBrand as F,resolveConfiguredBrand as ne}from"../shared/configured-brand.js";import{EspalierElementBase as V}from"../shared/esp-element-base.js";import{ESP_EVENTS as x}from"../shared/events.js";import{HEADER_GEOMETRY_PAINT_PROPERTIES as oe,HeaderGeometryController as ie}from"./header-geometry-controller.js";const ae="(max-width: 36rem)",G=I`
2
2
  background-color 0.24s ease,
3
3
  border-color 0.24s ease,
4
4
  box-shadow 0.24s ease,
5
5
  color 0.24s ease,
6
6
  transform 0.24s ease
7
- `;function L(f,e){const t=new Set(f);return{allowedValues:t,converter:{fromAttribute(n){return n??e},toAttribute(n){return t.has(n)?n:e}},defaultValue:e}}const ie=["standard","centered-brand","centered-menu","extended","extended-centered","minimal"],de=["start","center","end"],le=["truncate","wrap","nowrap"],he=["auto","inline","drawer"],ce=["hidden","visible"],ue=["compact","standard"],j=new Set(Array.from({length:41},(f,e)=>(e+10)/10)),M=L(ie,"standard"),D=L(de,"start"),z=L(le,"truncate"),B=L(he,"auto"),O=L(ce,"hidden"),P=L(ue,"compact");let o=class extends V{constructor(){super(...arguments),this.menuOpen=!1,this.navigationConstrained=!1,this.menuTooLarge=!1,this.mobileMenu=!1,this.scrolled=!1,this.hiddenByScroll=!1,this.scrollProgress=0,this.showBurger=!1,this.layout=M.defaultValue,this.brandText="",this.brandLogo="",this.lightBrandLogo="",this.darkBrandLogo="",this.compactBrandLogo="",this.lightCompactBrandLogo="",this.darkCompactBrandLogo="",this.heightMultiplier=1,this.minHeightMultiplier=1,this.compactSize=P.defaultValue,this.brandHref="",this.brandAlt="",this.brandColor="",this.lightBrandColor="",this.darkBrandColor="",this.brandAlign=D.defaultValue,this.brandWrap=z.defaultValue,this.menuDisplay=B.defaultValue,this.themeToggle=O.defaultValue,this.scrollBehavior="none",this.scrollThreshold=16,this.dockOffset=0,this.drawerTarget="",this.previewCollapseRequested=!1,this.fullBleedContent=!1,this.geometry=new ae(this,()=>({heightMultiplier:this.heightMultiplier,minHeightMultiplier:this.minHeightMultiplier,compactSize:this.compactSize,compactLogo:!!(this.compactBrandLogo||this.lightCompactBrandLogo||this.darkCompactBrandLogo)}),()=>this.syncBrandFitWidth(),()=>this.runScrollStateUpdate(!0)),this.readyCompactLogo="",this.naturalBrandWidth=0,this.syncCompactLogoReadiness=()=>{const e=this.shadowRoot?.querySelector(".compact-brand-fit .brand-logo"),t=this.compactLogoSource,r=t&&e?.getAttribute("src")===t&&e.complete&&e.naturalWidth>0?t:"";r!==this.readyCompactLogo&&(this.readyCompactLogo=r)},this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.onGeometryKeyboard=()=>{this.pointerFocusPending=!1,this.keyboardFocusHeld=!0,this.updateScrollState()},this.onGeometryPointer=()=>{this.pointerFocusPending=!0,this.keyboardFocusHeld=!1,this.updateScrollState()},this.onGeometryPointerEnd=()=>{this.pointerFocusPending=!1},this.openHeaderPopovers=new Set,this.onHeaderPopoverOpened=e=>{e.target&&this.openHeaderPopovers.add(e.target),this.updateScrollState()},this.onHeaderPopoverClosed=e=>{e.target&&this.openHeaderPopovers.delete(e.target),this.updateScrollState()},this.onHeaderGroupToggle=e=>{e.detail.open?this.onHeaderPopoverOpened(e):this.onHeaderPopoverClosed(e)},this.onGeometryFocus=e=>{const t=e.composedPath();this.keyboardFocusHeld=!this.pointerFocusPending&&t.some(r=>r instanceof Element&&r.matches(":focus-visible")),this.updateScrollState()},this.onGeometryFocusOut=()=>{queueMicrotask(()=>{this.matches(":focus-within")||(this.keyboardFocusHeld=!1,this.pointerFocusPending=!1),this.updateScrollState()})},this.menuContainer=A(),this.menuButton=A(),this.menu=void 0,this.externalDrawerTarget=null,this.lastScrollY=0,this.lastInlineMenuWidth=0,this.mobileMenuQuery=null,this.menuDrawerListenersAttached=!1,this.observingMenuContainer=!1,this.scrollListenersAttached=!1,this.scrollFrame=new U(()=>this.runScrollStateUpdate()),this.resizeObserver=new ResizeObserver(()=>this.syncMenuLayout()),this.menuChildObserver=null,this.endProbe=A(),this.observedEndProbe=null,this.endProbeObserver=null,this.invalidMenuSlot=null,this.actionsWidth=0,this.syncPrimaryMenu=()=>{const r=(this.menuContainer.value?.querySelector('slot[name="menu"]')?.assignedElements()??[])[0],n=r instanceof T&&r.parentElement===this?r:void 0,i=r&&!n?r:null;i&&i!==this.invalidMenuSlot&&console.warn("<esp-header>: the menu slot expects an <esp-menu> element, received",i),this.invalidMenuSlot=i,this.geometry.setPrimaryMenu(n),n!==this.menu&&(this.demoteMenuToggle(),this.removeMenuDrawerListeners(),this.menu?.removeEventListener(S,this.onPrimaryPresentationChanged),this.menu?.removeEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=null,this.menu.sliding=!1),this.menuChildObserver?.disconnect(),this.menuChildObserver=null,this.menu=n,this.lastInlineMenuWidth=0,this.lastDrawerBrandKey="",this.addMenuDrawerListeners(),this.menu?.addEventListener(S,this.onPrimaryPresentationChanged),this.observeMenuChildren(),this.syncDrawerBrand(),this.requestUpdate()),this.menu?.addEventListener(S,this.onPrimaryPresentationChanged),this.menu?.addEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=this.menu.mode==="horizontal"?this:null),this.syncExternalDrawerTarget(),this.syncMenuLayout()},this.onPrimaryPresentationChanged=()=>{this.menu?.headerDrawerActive&&this.returnEndFocusToBurger(),this.requestUpdate()},this.onPrimaryLayoutChanged=()=>{if(!this.menu)return;this.geometry.invalidate();const e=this.menu.mode==="horizontal"&&this.menu.parentElement===this?this:null;this.menu.headerEndOwner!==e&&(this.menu.headerEndOwner=e),this.menu.headerDrawerActive&&this.returnEndFocusToBurger(),this.observeMenuChildren(),this.requestUpdate(),this.syncMenuLayout()},this.updateScrollState=()=>this.scrollFrame.schedule(),this.handleMobileMenuQueryChange=e=>{this.mobileMenu=e.matches,this.syncMenuLayout(),this.syncExternalDrawerControl()},this.toggleTheme=()=>{const e=this.getThemeRoot();if(!e)return;e.scheme=e.scheme==="dark"?"light":"dark";const t=e.scheme==="dark"?"dark":"light";this.dispatchEvent(new CustomEvent(x.HEADER_THEME_TOGGLE,{detail:{scheme:t},bubbles:!0,composed:!0}))},this.handleMenuToggleClicked=()=>{if(this.menuOpen){this.closeNav();return}this.openNav()},this.onMenuDrawerOpened=()=>{this.menuOpen=!0,document.body.classList.add("menu-open"),this.burger&&(this.burger.menuOpen=!0)},this.onMenuDrawerClosed=()=>{this.menuOpen=!1,document.body.classList.remove("menu-open"),this.burger&&(this.burger.menuOpen=!1),this.demoteMenuToggle(),this.updateScrollState()},this.onMenuDrawerPresented=e=>{e.target!==this.menu||!this.menu?.isFullScreenDrawer||this.promoteMenuToggle()},this.menuTogglePromoted=!1,this.promotedToggleFrame=new U(()=>this.positionPromotedToggle()),this.handlePromotedViewportResize=()=>this.promotedToggleFrame.schedule(),this.lastDrawerBrandKey="",this.inertedHeaderChrome=[],this.onGeometryContentChanged=()=>this.geometry.invalidate()}resolveBrand(){return ne({scheme:this.scheme,brandLogo:this.brandLogo,brandColor:this.brandColor,lightBrandLogo:this.lightBrandLogo,darkBrandLogo:this.darkBrandLogo,lightBrandColor:this.lightBrandColor,darkBrandColor:this.darkBrandColor})}get compactLogoSource(){if(!this.resolveBrand().brandLogo)return"";const e=this.scheme==="dark"?this.darkCompactBrandLogo:this.lightCompactBrandLogo,t=this.scheme==="dark"?this.lightCompactBrandLogo:this.darkCompactBrandLogo;return e||this.compactBrandLogo||t}syncBrandFitWidth(){const e=this.menuContainer.value?.parentElement;if(!e)return;const t=e.querySelector(".brand-fit-probe");this.naturalBrandWidth=t?.getBoundingClientRect().width??0;const r=e.querySelector('slot[name="brand"]')?.assignedElements().length,n=[...t?.querySelectorAll(".brand-logo")??[]].map(d=>d.getBoundingClientRect().width),i=getComputedStyle(e),a=[i.paddingTop,i.paddingBottom,i.borderTopWidth,i.borderBottomWidth].reduce((d,h)=>d+(parseFloat(h)||0),0);for(const[d,h]of[["--_esp-header-stable-brand-width",this.geometry.active&&!r?this.naturalBrandWidth:null],["--_esp-header-logo-reservation-width",Math.max(0,...n)],["--_esp-header-bar-block-insets",a]])if(h===null)e.style.removeProperty(d);else{const c=`${h}px`;e.style.getPropertyValue(d)!==c&&e.style.setProperty(d,c)}}get headerOverlayHeld(){for(const e of this.openHeaderPopovers)e instanceof Element&&!e.isConnected&&this.openHeaderPopovers.delete(e);return this.menuOpen||this.openHeaderPopovers.size>0}get usesIntrinsicNavigation(){return!!this.menu?.headerNavigationOwned}syncEndProbeObserver(){const e=this.endProbe.value??null;e!==this.observedEndProbe&&(this.endProbeObserver?.disconnect(),this.observedEndProbe=e,e&&(this.endProbeObserver??=new ResizeObserver(()=>this.syncMenuLayout()),this.endProbeObserver.observe(e,{box:"border-box"})),this.syncMenuLayout())}returnEndFocusToBurger(){const e=this.shadowRoot?.querySelector(".header-end"),t=this.shadowRoot?.activeElement;t&&e?.contains(t)&&this.updateComplete.then(()=>this.getBurgerFocusTarget()?.focus({preventScroll:!0}))}readHeaderEndFit(){const e=this.menuContainer.value?.parentElement;if(!e||!this.menu)return null;const t=getComputedStyle(e),r=e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0),n=parseFloat(t.columnGap)||0,i=e.querySelector(":scope > .brand"),d=i?.querySelector("slot")?.assignedElements().length?Math.max(i?.scrollWidth??0,i?.getBoundingClientRect().width??0):this.naturalBrandWidth,h=e.querySelector(":scope > .buttons"),c=Array.from(h?.children??[]).flatMap(g=>g.matches(".header-end, .header-end-measurement, .menu-toggle")?[]:g instanceof HTMLSlotElement?g.assignedElements():[g]).filter(g=>getComputedStyle(g).display!=="none");let u=c.reduce((g,G)=>{const $=getComputedStyle(G);return g+G.getBoundingClientRect().width+(parseFloat($.marginLeft)||0)+(parseFloat($.marginRight)||0)},0);const E=this.endProbe.value?.getBoundingClientRect().width??0,m=h&&parseFloat(getComputedStyle(h).columnGap)||0;u+=m*Math.max(0,c.length-1+(E>0?1:0));const y=this.menu.getHeaderNavigationWidths().main,w=E+u,_=this.layout==="extended"?y>r||d+w+n>r:this.layout==="extended-centered"?y>r||d+2*w+2*n>r:this.layout==="centered-brand"?d+2*Math.max(y,w)+2*n>r:d+y+w+2*n>r,C=this.getExternalDrawerTarget()?h?.querySelector(".menu-toggle"):null,k=u+(C&&getComputedStyle(C).display!=="none"?C.getBoundingClientRect().width+(c.length||E?m:0):0);return{width:r,brandWidth:d,main:y,endWidth:E,actions:u,actionFloor:k,gap:n,tooWide:_}}syncMenuLayout(){if(this.syncBrandFitWidth(),!this.menuContainer.value||!this.menu||!this.menu.getWidth)return;this.positionPromotedToggle();const e=this.menu.getWidth();e>0&&(this.lastInlineMenuWidth=e);const t=this.lastInlineMenuWidth||e,r=this.getExternalDrawerTarget(),n=this.menuDisplay!=="inline",i=this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested,a=n&&this.menuDisplay==="auto",d=a?this.layout==="centered-menu"?this.centeredMenuCapacity():this.menuContainer.value.clientWidth:0,h=this.usesIntrinsicNavigation?this.readHeaderEndFit():null;h&&this.actionsWidth!==h.actionFloor&&(this.actionsWidth=h.actionFloor,this.requestUpdate()),this.menuTooLarge=a&&(h?h.tooWide:t>d);const c=n&&!r&&this.hasDrawerableContent()&&(this.menuTooLarge||i||this.mobileMenu);c&&this.returnEndFocusToBurger(),this.menu.sliding=c,this.navigationConstrained=h?.tooWide??!1}centeredMenuCapacity(){const e=this.menuContainer.value?.parentElement;if(!(e instanceof HTMLElement))return 0;const t=d=>d?d.getBoundingClientRect().width:0,r=getComputedStyle(e),n=e.clientWidth-(Number.parseFloat(r.paddingLeft)||0)-(Number.parseFloat(r.paddingRight)||0),i=e.querySelector(":scope > section.brand"),a=e.querySelector(":scope > section.buttons");return n-t(i)-t(a)+t(a?.querySelector("esp-header-button.menu-toggle"))}menuHasContent(){return!!(this.menu??this.querySelector(':scope > [slot="menu"]'))?.querySelector("esp-menu-item, esp-menu-group")}hasDrawerableContent(){return this.showBurger||!!this.getExternalDrawerTarget()||this.menuHasContent()}getExternalDrawerTarget(){if(!this.drawerTarget)return null;const e=document.getElementById(this.drawerTarget);return e===this.menu?null:e&&"openDrawer"in e&&typeof e.openDrawer=="function"&&"closeDrawer"in e&&typeof e.closeDrawer=="function"?e:null}getBurgerFocusTarget(){const t=this.shadowRoot?.querySelector("esp-header-button.menu-toggle")?.shadowRoot?.querySelector("button"),r=this.menuButton.value?.shadowRoot?.querySelector("button");return t??r??null}getScrollTokens(){const e=this.scrollBehavior.split(/\s+/).map(t=>t.trim().toLowerCase()).filter(Boolean);return new Set(e.filter(t=>t!=="none"))}getEffectiveScrollThreshold(){return Number.isFinite(this.scrollThreshold)?Math.max(0,this.scrollThreshold):0}clearScrollState(){this.geometry.requestScroll(0,!1,!1,this.getEffectiveScrollThreshold(),!1),this.scrolled=!1,this.hiddenByScroll=!1,this.scrollProgress=0}runScrollStateUpdate(e=!1){const t=this.getScrollTokens();if(!t.size){e||this.clearScrollState();return}const r=Math.max(0,window.scrollY||document.documentElement.scrollTop||0),n=this.getEffectiveScrollThreshold(),i=Number.isFinite(this.dockOffset)?Math.max(0,this.dockOffset):n,a=r>(t.has("dock")?i:n),d=r>this.lastScrollY,h=t.has("reveal")&&d&&r>n&&!this.menuOpen;if(this.geometry.requestScroll(r,t.has("compact"),t.has("collapse-topbar")&&a,n,this.headerOverlayHeld||this.keyboardFocusHeld),!e){if(this.scrolled=a,this.hiddenByScroll=h,t.has("progress")){const c=document.documentElement,u=Math.max(1,c.scrollHeight-window.innerHeight);this.scrollProgress=Math.min(1,r/u)}else this.scrollProgress=0;this.lastScrollY=r}}cancelScrollUpdate(){this.scrollFrame.cancel()}syncScrollListeners(){const e=this.getScrollTokens().size>0;if(e&&!this.scrollListenersAttached?(window.addEventListener("scroll",this.updateScrollState,{passive:!0}),window.addEventListener("resize",this.updateScrollState,{passive:!0}),this.scrollListenersAttached=!0):!e&&this.scrollListenersAttached&&this.removeScrollListeners(),e){this.updateScrollState();return}this.cancelScrollUpdate(),this.clearScrollState()}removeScrollListeners(){this.scrollListenersAttached&&(window.removeEventListener("scroll",this.updateScrollState),window.removeEventListener("resize",this.updateScrollState),this.scrollListenersAttached=!1)}addMenuDrawerListeners(){!this.menu||this.menuDrawerListenersAttached||(this.menu.addEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.menu.addEventListener("esp-menu-drawer-presented",this.onMenuDrawerPresented),this.menu.addEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.menuDrawerListenersAttached=!0)}removeMenuDrawerListeners(){!this.menu||!this.menuDrawerListenersAttached||(this.menu.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.menu.removeEventListener("esp-menu-drawer-presented",this.onMenuDrawerPresented),this.menu.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.menuDrawerListenersAttached=!1)}observeMenuContainer(){if(!this.menuContainer.value||this.observingMenuContainer)return;this.resizeObserver.observe(this.menuContainer.value);const e=this.menuContainer.value.parentElement;if(e){this.resizeObserver.observe(e);for(const t of e.querySelectorAll(":scope > section.brand, :scope > section.buttons, :scope > .brand-fit-probe"))this.resizeObserver.observe(t)}this.observingMenuContainer=!0}disconnectResizeObserver(){this.observingMenuContainer&&(this.resizeObserver.disconnect(),this.observingMenuContainer=!1)}observeMenuChildren(){if(this.usesIntrinsicNavigation){this.menuChildObserver?.disconnect(),this.menuChildObserver=null;return}!this.menu||this.menuChildObserver||(this.menuChildObserver=new MutationObserver(()=>{this.syncMenuLayout(),this.requestUpdate()}),this.menuChildObserver.observe(this.menu,{childList:!0,subtree:!0}))}syncMobileMenuQuery(){if("matchMedia"in window){if(!this.mobileMenuQuery){this.mobileMenuQuery=window.matchMedia(se),this.mobileMenu=this.mobileMenuQuery.matches,this.mobileMenuQuery.addEventListener("change",this.handleMobileMenuQueryChange);return}this.mobileMenu=this.mobileMenuQuery.matches}}getThemeRoot(){return this.traverseToClosest("esp-root")}syncExternalDrawerTarget(){const e=this.getExternalDrawerTarget(),t=e===this.menu?null:e;t!==this.externalDrawerTarget&&(this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=!1),this.externalDrawerTarget=t,this.externalDrawerTarget?.addEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.addEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed)),this.syncExternalDrawerControl()}burgerVisibleForTarget(){if(this.menuDisplay==="inline")return!1;const e=this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested;return this.menuTooLarge||this.mobileMenu||e}syncExternalDrawerControl(){this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=this.burgerVisibleForTarget())}openNav(){const e=this.getBurgerFocusTarget(),t=this.getExternalDrawerTarget();if(this.burger&&(this.burger.menuOpen=!0),t){this.menuOpen=!0,t.openDrawer(e),document.body.classList.add("menu-open");return}if(this.menu){this.menu.sliding=!0,this.menuOpen=!0,this.menu.isFullScreenDrawer&&this.canPromoteMenuToggle()&&(this.menu.liftedCloseControl=this.getMenuToggleElement()),this.menu.openDrawer(e),document.body.classList.add("menu-open");return}this.burger&&(this.burger.menuOpen=!1)}closeNav(){this.menuOpen=!1,this.burger&&(this.burger.menuOpen=!1),this.demoteMenuToggle();const e=this.getExternalDrawerTarget();if(e){e.closeDrawer(),document.body.classList.remove("menu-open");return}this.menu&&(this.menu.closeDrawer(),document.body.classList.remove("menu-open"))}getMenuToggleElement(){return this.shadowRoot?.querySelector("esp-header-button.menu-toggle")??null}canPromoteMenuToggle(){const e=this.getMenuToggleElement();return!!e&&typeof e?.showPopover=="function"}setHeaderChromeInert(e){if(!e){for(const a of this.inertedHeaderChrome)a.inert=!1;this.inertedHeaderChrome=[];return}const t=this.menuContainer.value?.parentElement,r=this.getMenuToggleElement();if(!t||!r)return;const n=[];for(const a of t.querySelectorAll(":scope > section.brand, :scope > section.topbar"))n.push(a);const i=t.querySelector(":scope > section.buttons");for(const a of i?.children??[])if(!(!(a instanceof HTMLElement)||a===r)){if(a instanceof HTMLSlotElement){for(const d of a.assignedElements())d instanceof HTMLElement&&n.push(d);continue}n.push(a)}for(const a of n)a.inert||(a.inert=!0,this.inertedHeaderChrome.push(a))}promoteMenuToggle(){const e=this.getMenuToggleElement();if(!e||this.menuTogglePromoted||typeof e.showPopover!="function")return;const t=e.getBoundingClientRect();e.setAttribute("popover","manual"),Object.assign(e.style,{position:"fixed",inset:"auto",margin:"0",padding:"0",border:"0",background:"transparent",overflow:"visible"}),this.setPromotedTogglePosition(e,t.width);try{e.showPopover()}catch{e.removeAttribute("popover"),e.removeAttribute("style"),this.menu&&(this.menu.liftedCloseControl=null);return}this.menuTogglePromoted=!0,window.addEventListener("resize",this.handlePromotedViewportResize),this.menu&&(this.menu.liftedCloseControl=e),this.setHeaderChromeInert(!0)}positionPromotedToggle(){if(!this.menuTogglePromoted)return;const e=this.getMenuToggleElement();if(!e)return;const t=e.getBoundingClientRect();this.setPromotedTogglePosition(e,t.width)}setPromotedTogglePosition(e,t){const r=te(),n=getComputedStyle(e).direction==="rtl";e.style.left=`${n?0:Math.max(0,r.width-t)}px`,e.style.top="0px"}demoteMenuToggle(){if(window.removeEventListener("resize",this.handlePromotedViewportResize),this.promotedToggleFrame.cancel(),this.menu?.liftedCloseControl&&(this.menu.liftedCloseControl=null),!this.menuTogglePromoted)return;this.menuTogglePromoted=!1,this.setHeaderChromeInert(!1);const e=this.getMenuToggleElement();if(e){try{e.hidePopover()}catch{}e.removeAttribute("popover"),e.removeAttribute("style")}}syncDrawerBrand(){if(!this.menu)return;const e=this.resolveBrand(),t=e.brandLogo||this.brandText?{brandLogo:e.brandLogo,brandText:this.brandText,brandHref:this.brandHref,brandAlt:this.brandAlt,brandColor:e.brandColor}:null,r=JSON.stringify(t);r!==this.lastDrawerBrandKey&&(this.lastDrawerBrandKey=r,this.menu.drawerBrand=t)}get burger(){return this.menuButton.value??void 0}willUpdate(e){super.willUpdate(e),j.has(this.heightMultiplier)||(this.heightMultiplier=1),j.has(this.minHeightMultiplier)||(this.minHeightMultiplier=1),P.allowedValues.has(this.compactSize)||(this.compactSize=P.defaultValue),["heightMultiplier","minHeightMultiplier","compactSize","compactBrandLogo","lightCompactBrandLogo","darkCompactBrandLogo"].some(t=>e.has(t))&&this.geometry.configure(),["scheme","brandLogo","lightBrandLogo","darkBrandLogo","compactBrandLogo","lightCompactBrandLogo","darkCompactBrandLogo"].some(t=>e.has(t))&&(this.readyCompactLogo=""),e.has("layout")&&!M.allowedValues.has(this.layout)&&(this.layout=M.defaultValue),e.has("brandAlign")&&!D.allowedValues.has(this.brandAlign)&&(this.brandAlign=D.defaultValue),e.has("brandWrap")&&!z.allowedValues.has(this.brandWrap)&&(this.brandWrap=z.defaultValue),e.has("menuDisplay")&&!B.allowedValues.has(this.menuDisplay)&&(this.menuDisplay=B.defaultValue),e.has("themeToggle")&&!O.allowedValues.has(this.themeToggle)&&(this.themeToggle=O.defaultValue)}firstUpdated(e){super.firstUpdated(e),this.shadowRoot?.addEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.addEventListener("error",this.syncCompactLogoReadiness,!0),this.menuContainer.value&&(this.syncPrimaryMenu(),this.observeMenuContainer(),this.syncExternalDrawerTarget(),this.syncMobileMenuQuery(),this.syncScrollListeners(),this.syncMenuLayout())}updated(e){super.updated(e),this.syncCompactLogoReadiness(),this.syncDrawerBrand(),this.syncEndProbeObserver(),(e.has("scheme")||e.has("layout")||e.has("brandLogo")||e.has("brandText")||e.has("lightBrandLogo")||e.has("darkBrandLogo"))&&this.geometry.invalidate(),(!e.size||[...e.keys()].some(t=>t!=="scrollProgress"&&t!=="hiddenByScroll"))&&this.geometry.measure(),this.observeMenuChildren(),(e.has("showBurger")||e.has("drawerTarget")||e.has("menuDisplay")||e.has("layout")||e.has("previewCollapseRequested"))&&(this.syncExternalDrawerTarget(),this.syncMenuLayout()),(e.has("mobileMenu")||e.has("menuTooLarge"))&&this.syncExternalDrawerControl(),e.has("scrollBehavior")?this.syncScrollListeners():(e.has("scrollThreshold")||e.has("dockOffset"))&&this.updateScrollState()}connectedCallback(){super.connectedCallback(),this.geometry.connect(),this.shadowRoot?.addEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.addEventListener("error",this.syncCompactLogoReadiness,!0),this.addEventListener(x.POPOVER_OPENED,this.onHeaderPopoverOpened),this.addEventListener(x.POPOVER_CLOSED,this.onHeaderPopoverClosed),this.addEventListener(x.MENU_GROUP_TOGGLE,this.onHeaderGroupToggle),this.addEventListener("keydown",this.onGeometryKeyboard),this.addEventListener("pointerdown",this.onGeometryPointer),this.addEventListener("pointerup",this.onGeometryPointerEnd),this.addEventListener("pointercancel",this.onGeometryPointerEnd),this.addEventListener("focusin",this.onGeometryFocus),this.addEventListener("focusout",this.onGeometryFocusOut),this.addEventListener("slotchange",this.onGeometryContentChanged),this.syncScrollListeners(),this.syncMobileMenuQuery(),this.addMenuDrawerListeners(),this.syncExternalDrawerTarget(),this.observeMenuContainer(),this.hasUpdated&&this.syncPrimaryMenu(),this.observeMenuChildren()}disconnectedCallback(){this.geometry.disconnect(),this.shadowRoot?.removeEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.removeEventListener("error",this.syncCompactLogoReadiness,!0),this.readyCompactLogo="",this.removeEventListener(x.POPOVER_OPENED,this.onHeaderPopoverOpened),this.removeEventListener(x.POPOVER_CLOSED,this.onHeaderPopoverClosed),this.removeEventListener(x.MENU_GROUP_TOGGLE,this.onHeaderGroupToggle),this.openHeaderPopovers.clear(),this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.removeEventListener("keydown",this.onGeometryKeyboard),this.removeEventListener("pointerdown",this.onGeometryPointer),this.removeEventListener("pointerup",this.onGeometryPointerEnd),this.removeEventListener("pointercancel",this.onGeometryPointerEnd),this.removeEventListener("focusin",this.onGeometryFocus),this.removeEventListener("focusout",this.onGeometryFocusOut),this.removeEventListener("slotchange",this.onGeometryContentChanged),this.menu?.removeEventListener(S,this.onPrimaryPresentationChanged),this.menu?.removeEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=null),this.removeMenuDrawerListeners(),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=!1),this.externalDrawerTarget=null,this.mobileMenuQuery?.removeEventListener("change",this.handleMobileMenuQueryChange),this.mobileMenuQuery=null,this.removeScrollListeners(),this.cancelScrollUpdate(),this.disconnectResizeObserver(),this.endProbeObserver?.disconnect(),this.observedEndProbe=null,this.menuChildObserver?.disconnect(),this.menuChildObserver=null,this.demoteMenuToggle(),super.disconnectedCallback()}renderHeaderEnd(e,t,r){return b`<nav
8
- class=${q({"header-end":!t,"header-end-probe":t})}
7
+ `;function L(f,e){const t=new Set(f);return{allowedValues:t,converter:{fromAttribute(n){return n??e},toAttribute(n){return t.has(n)?n:e}},defaultValue:e}}const se=["standard","centered-brand","centered-menu","extended","extended-centered","minimal"],de=["start","center","end"],le=["truncate","wrap","nowrap"],he=["auto","inline","drawer"],ce=["hidden","visible"],ue=["compact","standard"],j=new Set(Array.from({length:41},(f,e)=>(e+10)/10)),M=L(se,"standard"),D=L(de,"start"),B=L(le,"truncate"),z=L(he,"auto"),P=L(ce,"hidden"),k=L(ue,"compact");let o=class extends V{constructor(){super(...arguments),this.menuOpen=!1,this.navigationConstrained=!1,this.menuTooLarge=!1,this.mobileMenu=!1,this.scrolled=!1,this.hiddenByScroll=!1,this.scrollProgress=0,this.showBurger=!1,this.layout=M.defaultValue,this.brandText="",this.brandLogo="",this.lightBrandLogo="",this.darkBrandLogo="",this.compactBrandLogo="",this.lightCompactBrandLogo="",this.darkCompactBrandLogo="",this.heightMultiplier=1,this.minHeightMultiplier=1,this.compactSize=k.defaultValue,this.brandHref="",this.brandAlt="",this.brandColor="",this.lightBrandColor="",this.darkBrandColor="",this.brandAlign=D.defaultValue,this.brandWrap=B.defaultValue,this.menuDisplay=z.defaultValue,this.themeToggle=P.defaultValue,this.scrollBehavior="none",this.scrollThreshold=16,this.dockOffset=0,this.drawerTarget="",this.previewCollapseRequested=!1,this.fullBleedContent=!1,this.geometry=new ie(this,()=>({heightMultiplier:this.heightMultiplier,minHeightMultiplier:this.minHeightMultiplier,compactSize:this.compactSize,compactLogo:!!(this.compactBrandLogo||this.lightCompactBrandLogo||this.darkCompactBrandLogo)}),()=>this.syncBrandFitWidth(),()=>this.runScrollStateUpdate(!0)),this.readyCompactLogo="",this.naturalBrandWidth=0,this.syncCompactLogoReadiness=()=>{const e=this.shadowRoot?.querySelector(".compact-brand-fit .brand-logo"),t=this.compactLogoSource,r=t&&e?.getAttribute("src")===t&&e.complete&&e.naturalWidth>0?t:"";r!==this.readyCompactLogo&&(this.readyCompactLogo=r)},this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.pointerActivation=null,this.onGeometryKeyboard=()=>{this.pointerFocusPending=!1,this.keyboardFocusHeld=!0,this.updateScrollState()},this.onGeometryPointer=e=>{if(!e.isPrimary||e.button!==0||this.pointerActivation)return;this.pointerFocusPending=!0;const t=e.composedPath();this.geometryPointerBlocked(t)||(this.pointerActivation={pointerId:e.pointerId,path:t}),this.keyboardFocusHeld=!1,this.updateScrollState()},this.releaseGeometryPointer=()=>{this.pointerActivation&&(this.pointerActivation=null,this.updateScrollState())},this.onGeometryPointerEnd=e=>{if(!e.isPrimary||this.pointerActivation&&e.pointerId!==this.pointerActivation.pointerId)return;this.pointerFocusPending=!1;const t=e.composedPath();(e.type==="pointercancel"||!t.includes(this)||this.geometryPointerBlocked(t)||this.pointerActivation&&this.geometryPointerBlocked(this.pointerActivation.path))&&this.releaseGeometryPointer()},this.onGeometryClick=e=>{e instanceof PointerEvent&&e.pointerId!==this.pointerActivation?.pointerId||this.releaseGeometryPointer()},this.onGeometryDrag=()=>{this.pointerFocusPending=!1,this.releaseGeometryPointer()},this.onGeometryBlur=()=>{this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.releaseGeometryPointer(),this.updateScrollState()},this.openHeaderPopovers=new Set,this.onHeaderPopoverOpened=e=>{e.target&&this.openHeaderPopovers.add(e.target),this.updateScrollState()},this.onHeaderPopoverClosed=e=>{e.target&&this.openHeaderPopovers.delete(e.target),this.updateScrollState()},this.onHeaderGroupToggle=e=>{e.detail.open?this.onHeaderPopoverOpened(e):this.onHeaderPopoverClosed(e)},this.onGeometryFocus=e=>{const t=e.composedPath();this.keyboardFocusHeld=!this.pointerFocusPending&&t.some(r=>r instanceof Element&&r.matches(":focus-visible")),this.updateScrollState()},this.onGeometryFocusOut=()=>{queueMicrotask(()=>{this.isConnected&&(this.matches(":focus-within")||(this.keyboardFocusHeld=!1,this.pointerFocusPending=!1),this.updateScrollState())})},this.menuContainer=A(),this.menuButton=A(),this.menu=void 0,this.externalDrawerTarget=null,this.lastScrollY=0,this.lastInlineMenuWidth=0,this.mobileMenuQuery=null,this.menuDrawerListenersAttached=!1,this.observingMenuContainer=!1,this.scrollListenersAttached=!1,this.scrollFrame=new q(()=>this.runScrollStateUpdate()),this.resizeObserver=new ResizeObserver(()=>this.syncMenuLayout()),this.menuChildObserver=null,this.endProbe=A(),this.observedEndProbe=null,this.endProbeObserver=null,this.invalidMenuSlot=null,this.actionsWidth=0,this.syncPrimaryMenu=()=>{const r=(this.menuContainer.value?.querySelector('slot[name="menu"]')?.assignedElements()??[])[0],n=r instanceof T&&r.parentElement===this?r:void 0,s=r&&!n?r:null;s&&s!==this.invalidMenuSlot&&console.warn("<esp-header>: the menu slot expects an <esp-menu> element, received",s),this.invalidMenuSlot=s,this.geometry.setPrimaryMenu(n),n!==this.menu&&(this.demoteMenuToggle(),this.removeMenuDrawerListeners(),this.menu?.removeEventListener(S,this.onPrimaryPresentationChanged),this.menu?.removeEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=null,this.menu.sliding=!1),this.menuChildObserver?.disconnect(),this.menuChildObserver=null,this.menu=n,this.lastInlineMenuWidth=0,this.lastDrawerBrandKey="",this.addMenuDrawerListeners(),this.menu?.addEventListener(S,this.onPrimaryPresentationChanged),this.observeMenuChildren(),this.syncDrawerBrand(),this.requestUpdate()),this.menu?.addEventListener(S,this.onPrimaryPresentationChanged),this.menu?.addEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=this.menu.mode==="horizontal"?this:null),this.syncExternalDrawerTarget(),this.syncMenuLayout()},this.onPrimaryPresentationChanged=()=>{this.menu?.headerDrawerActive&&this.returnEndFocusToBurger(),this.requestUpdate()},this.onPrimaryLayoutChanged=()=>{if(!this.menu)return;this.geometry.invalidate();const e=this.menu.mode==="horizontal"&&this.menu.parentElement===this?this:null;this.menu.headerEndOwner!==e&&(this.menu.headerEndOwner=e),this.menu.headerDrawerActive&&this.returnEndFocusToBurger(),this.observeMenuChildren(),this.requestUpdate(),this.syncMenuLayout()},this.updateScrollState=()=>this.scrollFrame.schedule(),this.handleMobileMenuQueryChange=e=>{this.mobileMenu=e.matches,this.syncMenuLayout(),this.syncExternalDrawerControl()},this.toggleTheme=()=>{const e=this.getThemeRoot();if(!e)return;e.scheme=e.scheme==="dark"?"light":"dark";const t=e.scheme==="dark"?"dark":"light";this.dispatchEvent(new CustomEvent(x.HEADER_THEME_TOGGLE,{detail:{scheme:t},bubbles:!0,composed:!0}))},this.handleMenuToggleClicked=()=>{if(this.menuOpen){this.closeNav();return}this.openNav()},this.onMenuDrawerOpened=()=>{this.menuOpen=!0,document.body.classList.add("menu-open"),this.burger&&(this.burger.menuOpen=!0)},this.onMenuDrawerClosed=()=>{this.menuOpen=!1,document.body.classList.remove("menu-open"),this.burger&&(this.burger.menuOpen=!1),this.demoteMenuToggle(),this.updateScrollState()},this.onMenuDrawerPresented=e=>{e.target!==this.menu||!this.menu?.isFullScreenDrawer||this.promoteMenuToggle()},this.menuTogglePromoted=!1,this.promotedToggleFrame=new q(()=>this.positionPromotedToggle()),this.handlePromotedViewportResize=()=>this.promotedToggleFrame.schedule(),this.lastDrawerBrandKey="",this.inertedHeaderChrome=[],this.onGeometryContentChanged=()=>this.geometry.invalidate()}resolveBrand(){return ne({scheme:this.scheme,brandLogo:this.brandLogo,brandColor:this.brandColor,lightBrandLogo:this.lightBrandLogo,darkBrandLogo:this.darkBrandLogo,lightBrandColor:this.lightBrandColor,darkBrandColor:this.darkBrandColor})}get compactLogoSource(){if(!this.resolveBrand().brandLogo)return"";const e=this.scheme==="dark"?this.darkCompactBrandLogo:this.lightCompactBrandLogo,t=this.scheme==="dark"?this.lightCompactBrandLogo:this.darkCompactBrandLogo;return e||this.compactBrandLogo||t}syncBrandFitWidth(){const e=this.menuContainer.value?.parentElement;if(!e)return;const t=e.querySelector(".brand-fit-probe");this.naturalBrandWidth=t?.getBoundingClientRect().width??0;const r=e.querySelector('slot[name="brand"]')?.assignedElements().length,n=[...t?.querySelectorAll(".brand-logo")??[]].map(d=>d.getBoundingClientRect().width),s=getComputedStyle(e),i=[s.paddingTop,s.paddingBottom,s.borderTopWidth,s.borderBottomWidth].reduce((d,h)=>d+(parseFloat(h)||0),0);for(const[d,h]of[["--_esp-header-stable-brand-width",this.geometry.active&&!r?this.naturalBrandWidth:null],["--_esp-header-logo-reservation-width",Math.max(0,...n)],["--_esp-header-bar-block-insets",i]])if(h===null)e.style.removeProperty(d);else{const c=`${h}px`;e.style.getPropertyValue(d)!==c&&e.style.setProperty(d,c)}}geometryPointerBlocked(e){return e.some(t=>t instanceof Element&&(!t.isConnected||t.matches(":disabled, [aria-disabled=true], [inert]")))}get headerOverlayHeld(){for(const e of this.openHeaderPopovers)e instanceof Element&&!e.isConnected&&this.openHeaderPopovers.delete(e);return this.menuOpen||this.openHeaderPopovers.size>0}get usesIntrinsicNavigation(){return!!this.menu?.headerNavigationOwned}syncEndProbeObserver(){const e=this.endProbe.value??null;e!==this.observedEndProbe&&(this.endProbeObserver?.disconnect(),this.observedEndProbe=e,e&&(this.endProbeObserver??=new ResizeObserver(()=>this.syncMenuLayout()),this.endProbeObserver.observe(e,{box:"border-box"})),this.syncMenuLayout())}returnEndFocusToBurger(){const e=this.shadowRoot?.querySelector(".header-end"),t=this.shadowRoot?.activeElement;t&&e?.contains(t)&&this.updateComplete.then(()=>this.getBurgerFocusTarget()?.focus({preventScroll:!0}))}readHeaderEndFit(){const e=this.menuContainer.value?.parentElement;if(!e||!this.menu)return null;const t=getComputedStyle(e),r=e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0),n=parseFloat(t.columnGap)||0,s=e.querySelector(":scope > .brand"),d=s?.querySelector("slot")?.assignedElements().length?Math.max(s?.scrollWidth??0,s?.getBoundingClientRect().width??0):this.naturalBrandWidth,h=e.querySelector(":scope > .buttons"),c=Array.from(h?.children??[]).flatMap(g=>g.matches(".header-end, .header-end-measurement, .menu-toggle")?[]:g instanceof HTMLSlotElement?g.assignedElements():[g]).filter(g=>getComputedStyle(g).display!=="none");let u=c.reduce((g,N)=>{const $=getComputedStyle(N);return g+N.getBoundingClientRect().width+(parseFloat($.marginLeft)||0)+(parseFloat($.marginRight)||0)},0);const E=this.endProbe.value?.getBoundingClientRect().width??0,m=h&&parseFloat(getComputedStyle(h).columnGap)||0;u+=m*Math.max(0,c.length-1+(E>0?1:0));const y=this.menu.getHeaderNavigationWidths().main,w=E+u,_=this.layout==="extended"?y>r||d+w+n>r:this.layout==="extended-centered"?y>r||d+2*w+2*n>r:this.layout==="centered-brand"?d+2*Math.max(y,w)+2*n>r:d+y+w+2*n>r,C=this.getExternalDrawerTarget()?h?.querySelector(".menu-toggle"):null,O=u+(C&&getComputedStyle(C).display!=="none"?C.getBoundingClientRect().width+(c.length||E?m:0):0);return{width:r,brandWidth:d,main:y,endWidth:E,actions:u,actionFloor:O,gap:n,tooWide:_}}syncMenuLayout(){if(this.syncBrandFitWidth(),!this.menuContainer.value||!this.menu||!this.menu.getWidth)return;this.positionPromotedToggle();const e=this.menu.getWidth();e>0&&(this.lastInlineMenuWidth=e);const t=this.lastInlineMenuWidth||e,r=this.getExternalDrawerTarget(),n=this.menuDisplay!=="inline",s=this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested,i=n&&this.menuDisplay==="auto",d=i?this.layout==="centered-menu"?this.centeredMenuCapacity():this.menuContainer.value.clientWidth:0,h=this.usesIntrinsicNavigation?this.readHeaderEndFit():null;h&&this.actionsWidth!==h.actionFloor&&(this.actionsWidth=h.actionFloor,this.requestUpdate()),this.menuTooLarge=i&&(h?h.tooWide:t>d);const c=n&&!r&&this.hasDrawerableContent()&&(this.menuTooLarge||s||this.mobileMenu);c&&this.returnEndFocusToBurger(),this.menu.sliding=c,this.navigationConstrained=h?.tooWide??!1}centeredMenuCapacity(){const e=this.menuContainer.value?.parentElement;if(!(e instanceof HTMLElement))return 0;const t=d=>d?d.getBoundingClientRect().width:0,r=getComputedStyle(e),n=e.clientWidth-(Number.parseFloat(r.paddingLeft)||0)-(Number.parseFloat(r.paddingRight)||0),s=e.querySelector(":scope > section.brand"),i=e.querySelector(":scope > section.buttons");return n-t(s)-t(i)+t(i?.querySelector("esp-header-button.menu-toggle"))}menuHasContent(){return!!(this.menu??this.querySelector(':scope > [slot="menu"]'))?.querySelector("esp-menu-item, esp-menu-group")}hasDrawerableContent(){return this.showBurger||!!this.getExternalDrawerTarget()||this.menuHasContent()}getExternalDrawerTarget(){if(!this.drawerTarget)return null;const e=document.getElementById(this.drawerTarget);return e===this.menu?null:e&&"openDrawer"in e&&typeof e.openDrawer=="function"&&"closeDrawer"in e&&typeof e.closeDrawer=="function"?e:null}getBurgerFocusTarget(){const t=this.shadowRoot?.querySelector("esp-header-button.menu-toggle")?.shadowRoot?.querySelector("button"),r=this.menuButton.value?.shadowRoot?.querySelector("button");return t??r??null}getScrollTokens(){const e=this.scrollBehavior.split(/\s+/).map(t=>t.trim().toLowerCase()).filter(Boolean);return new Set(e.filter(t=>t!=="none"))}getEffectiveScrollThreshold(){return Number.isFinite(this.scrollThreshold)?Math.max(0,this.scrollThreshold):0}clearScrollState(){this.geometry.requestScroll(0,!1,!1,this.getEffectiveScrollThreshold(),!1),this.scrolled=!1,this.hiddenByScroll=!1,this.scrollProgress=0}runScrollStateUpdate(e=!1){const t=this.getScrollTokens();if(!t.size){e||this.clearScrollState();return}const r=Math.max(0,window.scrollY||document.documentElement.scrollTop||0),n=this.getEffectiveScrollThreshold(),s=Number.isFinite(this.dockOffset)?Math.max(0,this.dockOffset):n,i=r>(t.has("dock")?s:n),d=r>this.lastScrollY,h=t.has("reveal")&&d&&r>n&&!this.menuOpen;if(this.geometry.requestScroll(r,t.has("compact"),t.has("collapse-topbar")&&i,n,this.headerOverlayHeld||this.keyboardFocusHeld||this.pointerActivation!==null),!e){if(this.scrolled=i,this.hiddenByScroll=h,t.has("progress")){const c=document.documentElement,u=Math.max(1,c.scrollHeight-window.innerHeight);this.scrollProgress=Math.min(1,r/u)}else this.scrollProgress=0;this.lastScrollY=r}}cancelScrollUpdate(){this.scrollFrame.cancel()}syncScrollListeners(){const e=this.getScrollTokens().size>0;if(e&&!this.scrollListenersAttached?(window.addEventListener("scroll",this.updateScrollState,{passive:!0}),window.addEventListener("resize",this.updateScrollState,{passive:!0}),this.scrollListenersAttached=!0):!e&&this.scrollListenersAttached&&this.removeScrollListeners(),e){this.updateScrollState();return}this.cancelScrollUpdate(),this.clearScrollState()}removeScrollListeners(){this.scrollListenersAttached&&(window.removeEventListener("scroll",this.updateScrollState),window.removeEventListener("resize",this.updateScrollState),this.scrollListenersAttached=!1)}addMenuDrawerListeners(){!this.menu||this.menuDrawerListenersAttached||(this.menu.addEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.menu.addEventListener("esp-menu-drawer-presented",this.onMenuDrawerPresented),this.menu.addEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.menuDrawerListenersAttached=!0)}removeMenuDrawerListeners(){!this.menu||!this.menuDrawerListenersAttached||(this.menu.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.menu.removeEventListener("esp-menu-drawer-presented",this.onMenuDrawerPresented),this.menu.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.menuDrawerListenersAttached=!1)}observeMenuContainer(){if(!this.menuContainer.value||this.observingMenuContainer)return;this.resizeObserver.observe(this.menuContainer.value);const e=this.menuContainer.value.parentElement;if(e){this.resizeObserver.observe(e);for(const t of e.querySelectorAll(":scope > section.brand, :scope > section.buttons, :scope > .brand-fit-probe"))this.resizeObserver.observe(t)}this.observingMenuContainer=!0}disconnectResizeObserver(){this.observingMenuContainer&&(this.resizeObserver.disconnect(),this.observingMenuContainer=!1)}observeMenuChildren(){if(this.usesIntrinsicNavigation){this.menuChildObserver?.disconnect(),this.menuChildObserver=null;return}!this.menu||this.menuChildObserver||(this.menuChildObserver=new MutationObserver(()=>{this.syncMenuLayout(),this.requestUpdate()}),this.menuChildObserver.observe(this.menu,{childList:!0,subtree:!0}))}syncMobileMenuQuery(){if("matchMedia"in window){if(!this.mobileMenuQuery){this.mobileMenuQuery=window.matchMedia(ae),this.mobileMenu=this.mobileMenuQuery.matches,this.mobileMenuQuery.addEventListener("change",this.handleMobileMenuQueryChange);return}this.mobileMenu=this.mobileMenuQuery.matches}}getThemeRoot(){return this.traverseToClosest("esp-root")}syncExternalDrawerTarget(){const e=this.getExternalDrawerTarget(),t=e===this.menu?null:e;t!==this.externalDrawerTarget&&(this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=!1),this.externalDrawerTarget=t,this.externalDrawerTarget?.addEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.addEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed)),this.syncExternalDrawerControl()}burgerVisibleForTarget(){if(this.menuDisplay==="inline")return!1;const e=this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested;return this.menuTooLarge||this.mobileMenu||e}syncExternalDrawerControl(){this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=this.burgerVisibleForTarget())}openNav(){const e=this.getBurgerFocusTarget(),t=this.getExternalDrawerTarget();if(this.burger&&(this.burger.menuOpen=!0),t){this.menuOpen=!0,t.openDrawer(e),document.body.classList.add("menu-open");return}if(this.menu){this.menu.sliding=!0,this.menuOpen=!0,this.menu.isFullScreenDrawer&&this.canPromoteMenuToggle()&&(this.menu.liftedCloseControl=this.getMenuToggleElement()),this.menu.openDrawer(e),document.body.classList.add("menu-open");return}this.burger&&(this.burger.menuOpen=!1)}closeNav(){this.menuOpen=!1,this.burger&&(this.burger.menuOpen=!1),this.demoteMenuToggle();const e=this.getExternalDrawerTarget();if(e){e.closeDrawer(),document.body.classList.remove("menu-open");return}this.menu&&(this.menu.closeDrawer(),document.body.classList.remove("menu-open"))}getMenuToggleElement(){return this.shadowRoot?.querySelector("esp-header-button.menu-toggle")??null}canPromoteMenuToggle(){const e=this.getMenuToggleElement();return!!e&&typeof e?.showPopover=="function"}setHeaderChromeInert(e){if(!e){for(const i of this.inertedHeaderChrome)i.inert=!1;this.inertedHeaderChrome=[];return}const t=this.menuContainer.value?.parentElement,r=this.getMenuToggleElement();if(!t||!r)return;const n=[];for(const i of t.querySelectorAll(":scope > section.brand, :scope > section.topbar"))n.push(i);const s=t.querySelector(":scope > section.buttons");for(const i of s?.children??[])if(!(!(i instanceof HTMLElement)||i===r)){if(i instanceof HTMLSlotElement){for(const d of i.assignedElements())d instanceof HTMLElement&&n.push(d);continue}n.push(i)}for(const i of n)i.inert||(i.inert=!0,this.inertedHeaderChrome.push(i))}promoteMenuToggle(){const e=this.getMenuToggleElement();if(!e||this.menuTogglePromoted||typeof e.showPopover!="function")return;const t=e.getBoundingClientRect();e.setAttribute("popover","manual"),Object.assign(e.style,{position:"fixed",inset:"auto",margin:"0",padding:"0",border:"0",background:"transparent",overflow:"visible"}),this.setPromotedTogglePosition(e,t.width);try{e.showPopover()}catch{e.removeAttribute("popover"),e.removeAttribute("style"),this.menu&&(this.menu.liftedCloseControl=null);return}this.menuTogglePromoted=!0,window.addEventListener("resize",this.handlePromotedViewportResize),this.menu&&(this.menu.liftedCloseControl=e),this.setHeaderChromeInert(!0)}positionPromotedToggle(){if(!this.menuTogglePromoted)return;const e=this.getMenuToggleElement();if(!e)return;const t=e.getBoundingClientRect();this.setPromotedTogglePosition(e,t.width)}setPromotedTogglePosition(e,t){const r=te(),n=getComputedStyle(e).direction==="rtl";e.style.left=`${n?0:Math.max(0,r.width-t)}px`,e.style.top="0px"}demoteMenuToggle(){if(window.removeEventListener("resize",this.handlePromotedViewportResize),this.promotedToggleFrame.cancel(),this.menu?.liftedCloseControl&&(this.menu.liftedCloseControl=null),!this.menuTogglePromoted)return;this.menuTogglePromoted=!1,this.setHeaderChromeInert(!1);const e=this.getMenuToggleElement();if(e){try{e.hidePopover()}catch{}e.removeAttribute("popover"),e.removeAttribute("style")}}syncDrawerBrand(){if(!this.menu)return;const e=this.resolveBrand(),t=e.brandLogo||this.brandText?{brandLogo:e.brandLogo,brandText:this.brandText,brandHref:this.brandHref,brandAlt:this.brandAlt,brandColor:e.brandColor}:null,r=JSON.stringify(t);r!==this.lastDrawerBrandKey&&(this.lastDrawerBrandKey=r,this.menu.drawerBrand=t)}get burger(){return this.menuButton.value??void 0}willUpdate(e){super.willUpdate(e),j.has(this.heightMultiplier)||(this.heightMultiplier=1),j.has(this.minHeightMultiplier)||(this.minHeightMultiplier=1),k.allowedValues.has(this.compactSize)||(this.compactSize=k.defaultValue),["heightMultiplier","minHeightMultiplier","compactSize","compactBrandLogo","lightCompactBrandLogo","darkCompactBrandLogo"].some(t=>e.has(t))&&this.geometry.configure(),["scheme","brandLogo","lightBrandLogo","darkBrandLogo","compactBrandLogo","lightCompactBrandLogo","darkCompactBrandLogo"].some(t=>e.has(t))&&(this.readyCompactLogo=""),e.has("layout")&&!M.allowedValues.has(this.layout)&&(this.layout=M.defaultValue),e.has("brandAlign")&&!D.allowedValues.has(this.brandAlign)&&(this.brandAlign=D.defaultValue),e.has("brandWrap")&&!B.allowedValues.has(this.brandWrap)&&(this.brandWrap=B.defaultValue),e.has("menuDisplay")&&!z.allowedValues.has(this.menuDisplay)&&(this.menuDisplay=z.defaultValue),e.has("themeToggle")&&!P.allowedValues.has(this.themeToggle)&&(this.themeToggle=P.defaultValue)}firstUpdated(e){super.firstUpdated(e),this.shadowRoot?.addEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.addEventListener("error",this.syncCompactLogoReadiness,!0),this.menuContainer.value&&(this.syncPrimaryMenu(),this.observeMenuContainer(),this.syncExternalDrawerTarget(),this.syncMobileMenuQuery(),this.syncScrollListeners(),this.syncMenuLayout())}updated(e){super.updated(e),this.syncCompactLogoReadiness(),this.syncDrawerBrand(),this.syncEndProbeObserver(),(e.has("scheme")||e.has("layout")||e.has("brandLogo")||e.has("brandText")||e.has("lightBrandLogo")||e.has("darkBrandLogo"))&&this.geometry.invalidate(),(!e.size||[...e.keys()].some(t=>t!=="scrollProgress"&&t!=="hiddenByScroll"))&&this.geometry.measure(),this.observeMenuChildren(),(e.has("showBurger")||e.has("drawerTarget")||e.has("menuDisplay")||e.has("layout")||e.has("previewCollapseRequested"))&&(this.syncExternalDrawerTarget(),this.syncMenuLayout()),(e.has("mobileMenu")||e.has("menuTooLarge"))&&this.syncExternalDrawerControl(),e.has("scrollBehavior")?this.syncScrollListeners():(e.has("scrollThreshold")||e.has("dockOffset"))&&this.updateScrollState()}connectedCallback(){super.connectedCallback(),this.geometry.connect(),this.shadowRoot?.addEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.addEventListener("error",this.syncCompactLogoReadiness,!0),this.addEventListener(x.POPOVER_OPENED,this.onHeaderPopoverOpened),this.addEventListener(x.POPOVER_CLOSED,this.onHeaderPopoverClosed),this.addEventListener(x.MENU_GROUP_TOGGLE,this.onHeaderGroupToggle),this.addEventListener("keydown",this.onGeometryKeyboard),this.addEventListener("pointerdown",this.onGeometryPointer,!0),this.addEventListener("dragstart",this.onGeometryDrag,!0),window.addEventListener("pointerup",this.onGeometryPointerEnd,!0),window.addEventListener("pointercancel",this.onGeometryPointerEnd,!0),window.addEventListener("click",this.onGeometryClick,!0),window.addEventListener("blur",this.onGeometryBlur),this.addEventListener("focusin",this.onGeometryFocus),this.addEventListener("focusout",this.onGeometryFocusOut),this.addEventListener("slotchange",this.onGeometryContentChanged),this.syncScrollListeners(),this.syncMobileMenuQuery(),this.addMenuDrawerListeners(),this.syncExternalDrawerTarget(),this.observeMenuContainer(),this.hasUpdated&&this.syncPrimaryMenu(),this.observeMenuChildren()}disconnectedCallback(){this.geometry.disconnect(),this.shadowRoot?.removeEventListener("load",this.syncCompactLogoReadiness,!0),this.shadowRoot?.removeEventListener("error",this.syncCompactLogoReadiness,!0),this.readyCompactLogo="",this.removeEventListener(x.POPOVER_OPENED,this.onHeaderPopoverOpened),this.removeEventListener(x.POPOVER_CLOSED,this.onHeaderPopoverClosed),this.removeEventListener(x.MENU_GROUP_TOGGLE,this.onHeaderGroupToggle),this.openHeaderPopovers.clear(),this.pointerActivation=null,this.keyboardFocusHeld=!1,this.pointerFocusPending=!1,this.removeEventListener("keydown",this.onGeometryKeyboard),this.removeEventListener("pointerdown",this.onGeometryPointer,!0),this.removeEventListener("dragstart",this.onGeometryDrag,!0),window.removeEventListener("pointerup",this.onGeometryPointerEnd,!0),window.removeEventListener("pointercancel",this.onGeometryPointerEnd,!0),window.removeEventListener("click",this.onGeometryClick,!0),window.removeEventListener("blur",this.onGeometryBlur),this.removeEventListener("focusin",this.onGeometryFocus),this.removeEventListener("focusout",this.onGeometryFocusOut),this.removeEventListener("slotchange",this.onGeometryContentChanged),this.menu?.removeEventListener(S,this.onPrimaryPresentationChanged),this.menu?.removeEventListener(R,this.onPrimaryLayoutChanged),this.menu&&(this.menu.headerEndOwner=null),this.removeMenuDrawerListeners(),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-opened",this.onMenuDrawerOpened),this.externalDrawerTarget?.removeEventListener("esp-menu-drawer-closed",this.onMenuDrawerClosed),this.externalDrawerTarget instanceof T&&(this.externalDrawerTarget.hasExternalDrawerControl=!1),this.externalDrawerTarget=null,this.mobileMenuQuery?.removeEventListener("change",this.handleMobileMenuQueryChange),this.mobileMenuQuery=null,this.removeScrollListeners(),this.cancelScrollUpdate(),this.disconnectResizeObserver(),this.endProbeObserver?.disconnect(),this.observedEndProbe=null,this.menuChildObserver?.disconnect(),this.menuChildObserver=null,this.demoteMenuToggle(),super.disconnectedCallback()}renderHeaderEnd(e,t,r){return b`<nav
8
+ class=${W({"header-end":!t,"header-end-probe":t})}
9
9
  ${t?H(this.endProbe):p}
10
10
  aria-label=${t?p:`${this.menu?.ariaLabel??"Navigation"} links`}
11
11
  aria-hidden=${t?"true":p}
@@ -14,8 +14,8 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
14
14
  style=${X(this.menu)}
15
15
  >
16
16
  ${e.map(n=>ee(n,{mode:"horizontal",sourceStyle:!0}))}
17
- </nav>`}render(){const{menuOpen:e,menuTooLarge:t,mobileMenu:r}=this,n=this.menuDisplay!=="inline",i=n&&(this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested),a=this.getScrollTokens(),d=a.has("progress"),h=this.resolveBrand(),c={"--_esp-header-brand-color":h.brandColor||null,"--_esp-header-scroll-progress":String(this.scrollProgress),"--_esp-header-actions-width":`${this.actionsWidth}px`,"--_esp-header-height-multiplier":String(this.geometry.multiplier),"--_esp-header-min-height-multiplier":String(this.geometry.minimumMultiplier),"--_esp-header-scroll-row-size":this.geometry.scrollDriven?`${this.geometry.primarySize}px`:null,"--_esp-header-collapse-progress":String(this.geometry.progress),"--_esp-header-own-menu-offset":this.geometry.active?`${this.geometry.record.visibleBlockSize}px`:null},u=this.compactLogoSource,E=this.geometry.compact&&u&&this.readyCompactLogo===u,m=this.menu?.headerEndNodes??[],y=!m.length||!!this.menu?.headerDrawerActive,w=!!this.menu?.headerDrawerActive,_=this.menuDisplay==="inline"||this.usesIntrinsicNavigation&&!w&&!!this.getExternalDrawerTarget(),C={"primary-drawer":w,"has-header-end":m.length>0,"explicit-inline":_,"navigation-constrained":this.navigationConstrained,"menu-open":e,"too-wide":n&&this.hasDrawerableContent()&&(t||r||i),[`layout-${this.layout==="minimal"&&_?"standard":this.layout}`]:!0,"is-scrolled":this.scrolled,"geometry-topbar-collapsed":this.geometry.topbarCollapsed,"geometry-active":this.geometry.active,"scaled-header":this.heightMultiplier>1,"geometry-compact":this.geometry.compact,"geometry-scroll-driven":this.geometry.scrollDriven,"geometry-complete":this.geometry.complete,"geometry-tall-chrome":this.geometry.tallChrome,"geometry-standard":this.geometry.standard,"geometry-initial":this.geometry.pending,"hide-on-scroll":this.hiddenByScroll,"scroll-compact":a.has("compact"),"scroll-elevate":a.has("elevate"),"scroll-transparent":a.has("transparent")||a.has("transparent-to-solid"),"scroll-collapse-topbar":a.has("collapse-topbar")};this.toggleAttribute("data-esp-compact",this.geometry.compact);const k=this.scheme==="dark"?"light":"dark";return b`
18
- <header class=${q(C)} style=${Z(c)}>
17
+ </nav>`}render(){const{menuOpen:e,menuTooLarge:t,mobileMenu:r}=this,n=this.menuDisplay!=="inline",s=n&&(this.showBurger||this.menuDisplay==="drawer"||this.layout==="minimal"||this.previewCollapseRequested),i=this.getScrollTokens(),d=i.has("progress"),h=this.resolveBrand(),c={"--_esp-header-brand-color":h.brandColor||null,"--_esp-header-scroll-progress":String(this.scrollProgress),"--_esp-header-actions-width":`${this.actionsWidth}px`,"--_esp-header-height-multiplier":String(this.geometry.multiplier),"--_esp-header-min-height-multiplier":String(this.geometry.minimumMultiplier),"--_esp-header-scroll-row-size":this.geometry.scrollDriven?`${this.geometry.primarySize}px`:null,"--_esp-header-collapse-progress":String(this.geometry.progress),"--_esp-header-own-menu-offset":this.geometry.active?`${this.geometry.record.visibleBlockSize}px`:null},u=this.compactLogoSource,E=this.geometry.compact&&u&&this.readyCompactLogo===u,m=this.menu?.headerEndNodes??[],y=!m.length||!!this.menu?.headerDrawerActive,w=!!this.menu?.headerDrawerActive,_=this.menuDisplay==="inline"||this.usesIntrinsicNavigation&&!w&&!!this.getExternalDrawerTarget(),C={"primary-drawer":w,"has-header-end":m.length>0,"explicit-inline":_,"navigation-constrained":this.navigationConstrained,"menu-open":e,"too-wide":n&&this.hasDrawerableContent()&&(t||r||s),[`layout-${this.layout==="minimal"&&_?"standard":this.layout}`]:!0,"is-scrolled":this.scrolled,"geometry-topbar-collapsed":this.geometry.topbarCollapsed,"geometry-active":this.geometry.active,"scaled-header":this.heightMultiplier>1,"geometry-compact":this.geometry.compact,"geometry-scroll-driven":this.geometry.scrollDriven,"geometry-complete":this.geometry.complete,"geometry-tall-chrome":this.geometry.tallChrome,"geometry-standard":this.geometry.standard,"geometry-initial":this.geometry.pending,"hide-on-scroll":this.hiddenByScroll,"scroll-compact":i.has("compact"),"scroll-elevate":i.has("elevate"),"scroll-transparent":i.has("transparent")||i.has("transparent-to-solid"),"scroll-collapse-topbar":i.has("collapse-topbar")};this.toggleAttribute("data-esp-compact",this.geometry.compact);const O=this.scheme==="dark"?"light":"dark";return b`
18
+ <header class=${W(C)} style=${Z(c)}>
19
19
  <section class="topbar">
20
20
  <slot name="topbar" @slotchange=${this.onGeometryContentChanged}></slot>
21
21
  </section>
@@ -39,7 +39,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
39
39
  ${this.themeToggle==="visible"?b`<esp-header-button
40
40
  class="theme-toggle"
41
41
  icon=${this.scheme==="dark"?"sun":"moon"}
42
- aria-label=${`Switch to ${k} mode`}
42
+ aria-label=${`Switch to ${O} mode`}
43
43
  @esp-clicked=${this.toggleTheme}
44
44
  ></esp-header-button>`:p}
45
45
 
@@ -68,7 +68,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
68
68
  </div>
69
69
  ${d?b`<div class="scroll-progress" aria-hidden="true"></div>`:p}
70
70
  </header>
71
- `}};o.styles=[...V.styles,J,Q(2,"header"),re,W`
71
+ `}};o.styles=[...V.styles,J,Q(2,"header"),re,I`
72
72
  :host {
73
73
  --_esp-header-base-height: var(--esp-header-height, calc(4.5 * var(--esp-size-small)));
74
74
  --_esp-header-current-height: var(--_esp-header-base-height);
@@ -109,7 +109,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
109
109
  box-shadow: var(--esp-header-shadow, 0 0 2px var(--esp-color-shadow));
110
110
  color: var(--esp-header-color, var(--esp-color-text));
111
111
  transform: translateY(0);
112
- transition: min-height 0.24s ease, ${N};
112
+ transition: min-height 0.24s ease, ${G};
113
113
 
114
114
  > section {
115
115
  min-height: var(--_esp-header-bar-height, var(--_esp-header-current-height));
@@ -221,7 +221,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
221
221
  .brand-logo {
222
222
 
223
223
  aspect-ratio: auto
224
- var(--esp-header-brand-logo-aspect-ratio, ${I});
224
+ var(--esp-header-brand-logo-aspect-ratio, ${U});
225
225
  width: auto;
226
226
  height: var(
227
227
  --esp-header-brand-logo-size,
@@ -567,7 +567,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
567
567
  --_esp-header-compact-logo-size: min(var(--_esp-header-expanded-logo-size), max(0px, calc(var(--_esp-header-compact-bar-height) - var(--_esp-header-bar-block-insets, 0px))));
568
568
  --_esp-header-resolved-logo-size: var(--_esp-header-expanded-logo-size);
569
569
  grid-template-rows: min-content minmax(var(--_esp-header-bar-height), max-content);
570
- transition: grid-template-rows 0.24s ease, min-height 0.24s ease, ${N};
570
+ transition: grid-template-rows 0.24s ease, min-height 0.24s ease, ${G};
571
571
 
572
572
  > section:not(.topbar) { min-height: 0; }
573
573
  section.menu-container { align-self: center; }
@@ -596,7 +596,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
596
596
  --_esp-header-current-height: calc(var(--_esp-header-base-height) + (var(--_esp-header-compact-control-height) - var(--_esp-header-base-height)) * var(--_esp-header-collapse-progress));
597
597
  --_esp-header-bar-height: var(--_esp-header-scroll-row-size);
598
598
  --_esp-header-resolved-logo-size: calc(var(--_esp-header-expanded-logo-size) + (var(--_esp-header-compact-logo-size) - var(--_esp-header-expanded-logo-size)) * var(--_esp-header-collapse-progress));
599
- transition: ${N};
599
+ transition: ${G};
600
600
 
601
601
  .brand-logo { transition: none; }
602
602
  }
@@ -614,7 +614,7 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
614
614
  .brand-logo-reservation .brand-logo { max-inline-size: 100%; }
615
615
  .compact-brand-fit .brand-logo {
616
616
  height: var(--_esp-header-compact-logo-size);
617
- aspect-ratio: auto var(--esp-header-compact-brand-logo-aspect-ratio, var(--esp-header-brand-logo-aspect-ratio, ${I}));
617
+ aspect-ratio: auto var(--esp-header-compact-brand-logo-aspect-ratio, var(--esp-header-brand-logo-aspect-ratio, ${U}));
618
618
  }
619
619
 
620
620
  .header-expanded-size-probe,
@@ -792,4 +792,4 @@ var s=function(f,e,t,r){var n=arguments.length,i=n<3?e:r===null?r=Object.getOwnP
792
792
  transition: none;
793
793
  }
794
794
  }
795
- `],s([v()],o.prototype,"menuOpen",void 0),s([v()],o.prototype,"navigationConstrained",void 0),s([v()],o.prototype,"menuTooLarge",void 0),s([v()],o.prototype,"mobileMenu",void 0),s([v()],o.prototype,"scrolled",void 0),s([v()],o.prototype,"hiddenByScroll",void 0),s([v()],o.prototype,"scrollProgress",void 0),s([l({attribute:"show-burger",type:Boolean})],o.prototype,"showBurger",void 0),s([l({converter:M.converter,reflect:!0})],o.prototype,"layout",void 0),s([l({attribute:"brand-text",type:String})],o.prototype,"brandText",void 0),s([l({attribute:"brand-logo",type:String})],o.prototype,"brandLogo",void 0),s([l({attribute:"light-brand-logo",type:String})],o.prototype,"lightBrandLogo",void 0),s([l({attribute:"dark-brand-logo",type:String})],o.prototype,"darkBrandLogo",void 0),s([l({attribute:"compact-brand-logo",type:String})],o.prototype,"compactBrandLogo",void 0),s([l({attribute:"light-compact-brand-logo",type:String})],o.prototype,"lightCompactBrandLogo",void 0),s([l({attribute:"dark-compact-brand-logo",type:String})],o.prototype,"darkCompactBrandLogo",void 0),s([l({attribute:"height-multiplier",type:Number,reflect:!0})],o.prototype,"heightMultiplier",void 0),s([l({attribute:"min-height-multiplier",type:Number,reflect:!0})],o.prototype,"minHeightMultiplier",void 0),s([l({attribute:"compact-size",converter:P.converter,reflect:!0})],o.prototype,"compactSize",void 0),s([l({attribute:"brand-href",type:String})],o.prototype,"brandHref",void 0),s([l({attribute:"brand-alt",type:String})],o.prototype,"brandAlt",void 0),s([l({attribute:"brand-color",type:String})],o.prototype,"brandColor",void 0),s([l({attribute:"light-brand-color",type:String})],o.prototype,"lightBrandColor",void 0),s([l({attribute:"dark-brand-color",type:String})],o.prototype,"darkBrandColor",void 0),s([l({attribute:"brand-align",converter:D.converter,reflect:!0})],o.prototype,"brandAlign",void 0),s([l({attribute:"brand-wrap",converter:z.converter,reflect:!0})],o.prototype,"brandWrap",void 0),s([l({attribute:"menu-display",converter:B.converter,reflect:!0})],o.prototype,"menuDisplay",void 0),s([l({attribute:"theme-toggle",converter:O.converter,reflect:!0})],o.prototype,"themeToggle",void 0),s([l({attribute:"scroll-behavior",type:String})],o.prototype,"scrollBehavior",void 0),s([l({attribute:"scroll-threshold",type:Number})],o.prototype,"scrollThreshold",void 0),s([l({attribute:"dock-offset",type:Number})],o.prototype,"dockOffset",void 0),s([l({attribute:"drawer-target",type:String})],o.prototype,"drawerTarget",void 0),s([l({attribute:!1})],o.prototype,"previewCollapseRequested",void 0),s([l({attribute:"full-bleed-content",type:Boolean,reflect:!0})],o.prototype,"fullBleedContent",void 0),s([v()],o.prototype,"readyCompactLogo",void 0),o=s([K("esp-header")],o);export{o as EspalierHeader};
795
+ `],a([v()],o.prototype,"menuOpen",void 0),a([v()],o.prototype,"navigationConstrained",void 0),a([v()],o.prototype,"menuTooLarge",void 0),a([v()],o.prototype,"mobileMenu",void 0),a([v()],o.prototype,"scrolled",void 0),a([v()],o.prototype,"hiddenByScroll",void 0),a([v()],o.prototype,"scrollProgress",void 0),a([l({attribute:"show-burger",type:Boolean})],o.prototype,"showBurger",void 0),a([l({converter:M.converter,reflect:!0})],o.prototype,"layout",void 0),a([l({attribute:"brand-text",type:String})],o.prototype,"brandText",void 0),a([l({attribute:"brand-logo",type:String})],o.prototype,"brandLogo",void 0),a([l({attribute:"light-brand-logo",type:String})],o.prototype,"lightBrandLogo",void 0),a([l({attribute:"dark-brand-logo",type:String})],o.prototype,"darkBrandLogo",void 0),a([l({attribute:"compact-brand-logo",type:String})],o.prototype,"compactBrandLogo",void 0),a([l({attribute:"light-compact-brand-logo",type:String})],o.prototype,"lightCompactBrandLogo",void 0),a([l({attribute:"dark-compact-brand-logo",type:String})],o.prototype,"darkCompactBrandLogo",void 0),a([l({attribute:"height-multiplier",type:Number,reflect:!0})],o.prototype,"heightMultiplier",void 0),a([l({attribute:"min-height-multiplier",type:Number,reflect:!0})],o.prototype,"minHeightMultiplier",void 0),a([l({attribute:"compact-size",converter:k.converter,reflect:!0})],o.prototype,"compactSize",void 0),a([l({attribute:"brand-href",type:String})],o.prototype,"brandHref",void 0),a([l({attribute:"brand-alt",type:String})],o.prototype,"brandAlt",void 0),a([l({attribute:"brand-color",type:String})],o.prototype,"brandColor",void 0),a([l({attribute:"light-brand-color",type:String})],o.prototype,"lightBrandColor",void 0),a([l({attribute:"dark-brand-color",type:String})],o.prototype,"darkBrandColor",void 0),a([l({attribute:"brand-align",converter:D.converter,reflect:!0})],o.prototype,"brandAlign",void 0),a([l({attribute:"brand-wrap",converter:B.converter,reflect:!0})],o.prototype,"brandWrap",void 0),a([l({attribute:"menu-display",converter:z.converter,reflect:!0})],o.prototype,"menuDisplay",void 0),a([l({attribute:"theme-toggle",converter:P.converter,reflect:!0})],o.prototype,"themeToggle",void 0),a([l({attribute:"scroll-behavior",type:String})],o.prototype,"scrollBehavior",void 0),a([l({attribute:"scroll-threshold",type:Number})],o.prototype,"scrollThreshold",void 0),a([l({attribute:"dock-offset",type:Number})],o.prototype,"dockOffset",void 0),a([l({attribute:"drawer-target",type:String})],o.prototype,"drawerTarget",void 0),a([l({attribute:!1})],o.prototype,"previewCollapseRequested",void 0),a([l({attribute:"full-bleed-content",type:Boolean,reflect:!0})],o.prototype,"fullBleedContent",void 0),a([v()],o.prototype,"readyCompactLogo",void 0),o=a([K("esp-header")],o);export{o as EspalierHeader};
@@ -649,10 +649,26 @@
649
649
  "name": "--esp-footer-brand-logo-max-width",
650
650
  "description": "Configured logo maximum inline size. Defaults to `12rem`."
651
651
  },
652
+ {
653
+ "name": "--esp-footer-brand-logo-max-width-compact",
654
+ "description": "Configured logo maximum inline size at 48rem and below. Defaults to `var(--esp-footer-brand-logo-max-width, 12rem)`."
655
+ },
652
656
  {
653
657
  "name": "--esp-footer-brand-logo-size",
654
658
  "description": "Configured logo block size. Defaults to `3rem`."
655
659
  },
660
+ {
661
+ "name": "--esp-footer-brand-logo-size-compact",
662
+ "description": "Configured logo block size at 48rem and below. Defaults to `var(--esp-footer-brand-logo-size, 3rem)`."
663
+ },
664
+ {
665
+ "name": "--esp-footer-brand-text-size",
666
+ "description": "Configured brand text size. Defaults to `var(--esp-type-medium)`."
667
+ },
668
+ {
669
+ "name": "--esp-footer-brand-text-size-compact",
670
+ "description": "Configured brand text size at 48rem and below. Defaults to `var(--esp-footer-brand-text-size, var(--esp-type-medium))`."
671
+ },
656
672
  {
657
673
  "name": "--esp-footer-color",
658
674
  "description": "Body text color. Defaults to `var(--esp-color-text)`."
@@ -685,10 +701,6 @@
685
701
  "name": "--esp-footer-link-group-gap",
686
702
  "description": "Space between a link-group heading and its links. Defaults to `var(--esp-size-small)`."
687
703
  },
688
- {
689
- "name": "--esp-footer-link-group-min-width",
690
- "description": "Intrinsic minimum link-group column width. Defaults to `10rem`."
691
- },
692
704
  {
693
705
  "name": "--esp-footer-link-hover-bg",
694
706
  "description": "Hovered link background. Defaults to `var(--esp-color-link-hover-bg)`."
@@ -707,7 +719,7 @@
707
719
  },
708
720
  {
709
721
  "name": "--esp-footer-row-gap",
710
- "description": "Vertical gap between footer grid rows and link groups stacked in `esp-footer-column`. Defaults to `var(--esp-size-big)`."
722
+ "description": "Vertical gap between footer rows and link groups stacked in `esp-footer-column`. Defaults to `var(--esp-size-big)`."
711
723
  },
712
724
  {
713
725
  "name": "--esp-footer-section-gap",
@@ -888,12 +888,36 @@
888
888
  "component": "esp-footer",
889
889
  "description": "Configured logo maximum inline size. Defaults to `12rem`."
890
890
  },
891
+ {
892
+ "name": "--esp-footer-brand-logo-max-width-compact",
893
+ "category": "component",
894
+ "component": "esp-footer",
895
+ "description": "Configured logo maximum inline size at 48rem and below. Defaults to `var(--esp-footer-brand-logo-max-width, 12rem)`."
896
+ },
891
897
  {
892
898
  "name": "--esp-footer-brand-logo-size",
893
899
  "category": "component",
894
900
  "component": "esp-footer",
895
901
  "description": "Configured logo block size. Defaults to `3rem`."
896
902
  },
903
+ {
904
+ "name": "--esp-footer-brand-logo-size-compact",
905
+ "category": "component",
906
+ "component": "esp-footer",
907
+ "description": "Configured logo block size at 48rem and below. Defaults to `var(--esp-footer-brand-logo-size, 3rem)`."
908
+ },
909
+ {
910
+ "name": "--esp-footer-brand-text-size",
911
+ "category": "component",
912
+ "component": "esp-footer",
913
+ "description": "Configured brand text size. Defaults to `var(--esp-type-medium)`."
914
+ },
915
+ {
916
+ "name": "--esp-footer-brand-text-size-compact",
917
+ "category": "component",
918
+ "component": "esp-footer",
919
+ "description": "Configured brand text size at 48rem and below. Defaults to `var(--esp-footer-brand-text-size, var(--esp-type-medium))`."
920
+ },
897
921
  {
898
922
  "name": "--esp-footer-color",
899
923
  "category": "component",
@@ -942,12 +966,6 @@
942
966
  "component": "esp-footer",
943
967
  "description": "Space between a link-group heading and its links. Defaults to `var(--esp-size-small)`."
944
968
  },
945
- {
946
- "name": "--esp-footer-link-group-min-width",
947
- "category": "component",
948
- "component": "esp-footer",
949
- "description": "Intrinsic minimum link-group column width. Defaults to `10rem`."
950
- },
951
969
  {
952
970
  "name": "--esp-footer-link-hover-bg",
953
971
  "category": "component",
@@ -976,7 +994,7 @@
976
994
  "name": "--esp-footer-row-gap",
977
995
  "category": "component",
978
996
  "component": "esp-footer",
979
- "description": "Vertical gap between footer grid rows and link groups stacked in `esp-footer-column`. Defaults to `var(--esp-size-big)`."
997
+ "description": "Vertical gap between footer rows and link groups stacked in `esp-footer-column`. Defaults to `var(--esp-size-big)`."
980
998
  },
981
999
  {
982
1000
  "name": "--esp-footer-section-gap",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taprootio/espalier",
3
- "version": "6.15.0",
3
+ "version": "7.0.0",
4
4
  "packageManager": "bun@1.3.12",
5
5
  "description": "Espalier — a themeable, accessible, framework-agnostic, enterprise-grade design system built on web standards and love.",
6
6
  "customElements": "custom-elements.json",