weg-shared-layout 0.0.52 → 0.0.54

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.
@@ -2385,6 +2385,7 @@ function transformTag(tag) {
2385
2385
  return tag;
2386
2386
  }
2387
2387
 
2388
+ exports.Host = Host;
2388
2389
  exports.bootstrapLazy = bootstrapLazy;
2389
2390
  exports.createEvent = createEvent;
2390
2391
  exports.getElement = getElement;
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Bq6Rv2aB.js');
3
+ var index = require('./index-7WCqkJs6.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
7
7
  if (typeof window === 'undefined') return undefined;
8
8
  await appGlobals.globalScripts();
9
- return index.bootstrapLazy([["weg-footer_2.cjs",[[513,"weg-footer",{"layout":[1],"resolved":[32]},null,{"layout":[{"watchLayout":0}]}],[513,"weg-header",{"layout":[1],"signedIn":[516,"signed-in"],"userName":[1,"user-name"],"accountBaseUrl":[1,"account-base-url"],"currentPath":[1,"current-path"],"resolved":[32],"menuOpen":[32],"openDropdown":[32],"headerHidden":[32]},[[8,"keydown","handleKeyDown"]],{"layout":[{"watchLayout":0}]}]]]], options);
9
+ return index.bootstrapLazy([["weg-footer_2.cjs",[[513,"weg-footer",{"layout":[1],"resolved":[32]},null,{"layout":[{"watchLayout":0}]}],[513,"weg-header",{"layout":[1],"signedIn":[516,"signed-in"],"userName":[1,"user-name"],"accountBaseUrl":[1,"account-base-url"],"currentPath":[1,"current-path"],"resolved":[32],"menuOpen":[32],"openDropdown":[32],"headerScrollMode":[32],"headerScrollHidden":[32]},[[8,"keydown","handleKeyDown"]],{"layout":[{"watchLayout":0}]}]]]], options);
10
10
  };
11
11
 
12
12
  exports.setNonce = index.setNonce;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Bq6Rv2aB.js');
3
+ var index = require('./index-7WCqkJs6.js');
4
4
 
5
5
  const LINK_TARGETS = new Set(['_blank', '_self', '_parent', '_top']);
6
6
  function parseJsonProp(value) {
@@ -377,13 +377,10 @@ const LOGO_SRC = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA4QAAAFcCAYAAACQ
377
377
 
378
378
  const sharedCss = () => `:host{--weg-breakpoint-sm:640px;--weg-breakpoint-md:960px;--weg-breakpoint-lg:1280px;--weg-breakpoint-xl:1440px}:root,:host{--weg-container-breakpoint-sm:40rem;--weg-container-breakpoint-md:48rem;--weg-container-breakpoint-lg:64rem;--weg-container-breakpoint-xl:80rem;--weg-container-breakpoint-2xl:86rem;--weg-container-max-vw:95vw;--weg-container-padding-inline:1rem}@media (width >= 48rem){:root,:host{--weg-container-padding-inline:2rem}}.container{width:100%;max-width:var(--weg-container-max-vw);margin-inline:auto;padding-inline:var(--weg-container-padding-inline)}@media (width >= 40rem){.container{max-width:min(var(--weg-container-breakpoint-sm), var(--weg-container-max-vw))}}@media (width >= 48rem){.container{max-width:min(var(--weg-container-breakpoint-md), var(--weg-container-max-vw))}}@media (width >= 64rem){.container{max-width:min(var(--weg-container-breakpoint-lg), var(--weg-container-max-vw))}}@media (width >= 80rem){.container{max-width:min(var(--weg-container-breakpoint-xl), var(--weg-container-max-vw))}}@media (width >= 86rem){.container{max-width:min(var(--weg-container-breakpoint-xl), var(--weg-container-max-vw))}}*,*::before,*::after{box-sizing:border-box}:host{display:block;--weg-font-family:ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji';--weg-color-accent:#948eeb;--weg-purple-200:#cdcff8}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}`;
379
379
 
380
- const wegHeaderCss = () => `:host{--weg-breakpoint-sm:640px;--weg-breakpoint-md:960px;--weg-breakpoint-lg:1280px;--weg-breakpoint-xl:1440px}.weg-header-shell{display:contents}.skip-to-content{position:fixed;top:-100%;left:0;z-index:10001;padding:0.75rem 1rem;background:#ffffff;color:#0f172a;font-family:var(--weg-font-family);font-weight:600;text-decoration:none;border:2px solid #312e81;border-radius:0 0 0.25rem 0;box-shadow:0 0.25rem 0.75rem rgba(17, 24, 39, 0.15)}.skip-to-content:focus,.skip-to-content:focus-visible{top:0;outline:2px solid var(--weg-color-accent);outline-offset:2px}.header{width:100%;border-bottom:2px solid var(--weg-color-accent);background:#ffffff;color:#0f172a;font-family:var(--weg-font-family)}@media (width >= 960px){.header{border-bottom-width:0.25rem}}:host{position:relative;z-index:20;display:block;height:var(--weg-header-height, auto)}.header--fixed{position:fixed;top:0;left:0;right:0;z-index:20;transform:translateY(0);transition:transform 0.25s ease}.header--fixed.header--hidden{transform:translateY(-100%)}@media (prefers-reduced-motion: reduce){.header--fixed{transition:none}}.header--menu-open{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;overflow:hidden}.header--menu-open .header-inner{flex:1 1 auto;flex-wrap:wrap;align-content:flex-start;min-height:0}.header--menu-open .main-nav-panel{display:block;flex:1 1 100%;width:100%;min-height:0;overflow-y:auto;border-top:1px solid #d8d4f7}@media (width >= 960px){.header--menu-open{position:static;inset:auto;z-index:auto;display:block;overflow:visible}.header--menu-open .header-inner{flex:unset;flex-wrap:nowrap;align-content:unset;min-height:unset}}.logo-link{display:inline-flex;align-items:center;text-decoration:none;outline:none}.logo-link:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:4px;border-radius:4px}.logo{height:2.5rem;width:auto}@media (width >= 960px){.logo{height:3rem}}@media (width >= 1280px){.logo{height:5rem}}.header-inner{display:flex;width:100%;min-width:0;align-items:center;justify-content:space-between;gap:0.75rem;padding-block:0.75rem;padding-inline:var(--weg-container-padding-inline)}@media (width >= 960px){.header-inner{flex-wrap:nowrap;gap:1.5rem;padding-block:1.25rem}}@media (width >= 1440px){.header-inner{padding-block:1.75rem}}.header-inner .logo-link{flex:1 1 auto;min-width:0;justify-content:center}@media (width >= 960px){.header-inner .logo-link{flex:0 0 auto;justify-content:flex-start}}.header-inner .logo{max-width:100%}.header-actions{display:flex;align-items:center;flex-shrink:0}@media (width >= 960px){.header-actions{display:none}}.main-nav-panel{display:none;margin-inline:-0.5rem}@media (width >= 960px){.main-nav-panel{display:flex;flex:1 1 auto;width:auto;min-width:0;justify-content:flex-end;overflow:visible;border-top:none}}.main-nav{padding:0 0 1.5rem}@media (width >= 960px){.main-nav{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:1rem;padding:0}}.main-nav__list{list-style:none;margin:0;padding:0}@media (width >= 960px){.main-nav__list{display:flex;align-items:center;flex-wrap:wrap;gap:0.5rem}}@media (width >= 1280px){.main-nav__list{gap:1.5rem}}.main-nav__item{border-bottom:1px solid #d8d4f7}@media (width >= 960px){.main-nav__item{border-bottom:none}}.main-nav__item--dropdown{position:static}.nav-dropdown{position:relative}.nav-link{display:block;width:100%;padding:1rem;font-weight:600;color:inherit;text-decoration:none;outline:none}.nav-link:hover{opacity:0.85}.nav-link:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:2px;border-radius:4px}.nav-link--active{background:var(--weg-purple-200)}.nav-dropdown__trigger{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;width:100%;padding:1rem;border:none;background:transparent;font:inherit;font-weight:600;color:inherit;text-align:left;cursor:pointer;outline:none}.nav-dropdown__trigger:hover{opacity:0.85}.nav-dropdown__trigger:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:2px;border-radius:4px}.nav-dropdown__trigger--open{background:transparent}.nav-dropdown__trigger--active{background:var(--weg-purple-200)}.toggle-icon{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:999rem;background:#312e81;color:#ffffff;flex-shrink:0}.nav-dropdown__panel{padding:0 0 0.75rem}@media (width >= 960px){.nav-dropdown__panel{position:absolute;top:calc(100% + 0.5rem);left:0;z-index:500;min-width:17.5rem;padding:0.75rem 0 0.75rem 0.75rem;border:1px solid #e2e8f0;border-radius:0.5rem;background:#f8fafc;box-shadow:0 0.25rem 1rem rgba(15, 23, 42, 0.08)}.nav-dropdown__panel::before{content:'';position:absolute;top:-0.5rem;left:0;right:0;height:0.5rem}}.nav-dropdown__accent{border-left:0.25rem solid var(--weg-color-accent);padding-left:0.75rem}.nav-dropdown__links{display:flex;flex-direction:column;gap:0.25rem;list-style:none;margin:0;padding:0}.nav-dropdown__link{display:block;padding:0.625rem 0;font-weight:400;color:inherit;text-decoration:none;outline:none}.nav-dropdown__link:hover{opacity:0.85}.nav-dropdown__link:focus-visible{outline:0.125rem solid var(--weg-color-accent);outline-offset:0.125rem;border-radius:0.25rem}.nav-dropdown__link--active{background:var(--weg-purple-200)}@media (width >= 960px){.nav-dropdown__link{padding:0.5rem;margin-right:0.75rem;border-radius:0.5rem;font-weight:600}.nav-dropdown__link:hover,.nav-dropdown__link:focus-visible{background:var(--weg-purple-200);opacity:1}.nav-dropdown__link--active{opacity:1}}@media (width >= 1280px){.nav-dropdown__link{padding:0.5rem 0.75rem}}.main-nav__item--auth>a{display:flex;align-items:center;gap:0.5rem;width:100%;padding:1rem}@media (width >= 960px){.nav-link,.nav-dropdown__trigger,.main-nav__item--auth>a{display:inline-flex;align-items:center;width:auto;padding:0.5rem;border-radius:0.5rem}.nav-link--active,.main-nav__item--auth>a.nav-link--active{background:var(--weg-purple-200)}.nav-dropdown__trigger{gap:0.5rem;cursor:pointer}.nav-dropdown__trigger--open{background:#f1f5f9}.nav-dropdown__trigger--active{background:var(--weg-purple-200)}}@media (width >= 1280px){.main-nav{font-size:1.25rem}.main-nav__item--auth>a{padding:0.5rem 0.75rem}}.sign-in-link,.sign-out-link,.auth-button{display:inline-flex;align-items:center;gap:0.5rem;font-weight:600;color:inherit;text-decoration:none;outline:none}.auth-button{padding:0;border:none;background:transparent;font:inherit;cursor:pointer}.sign-in-link:hover,.sign-out-link:hover,.auth-button:hover{opacity:0.85}.sign-in-link:focus-visible,.sign-out-link:focus-visible,.auth-button:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:4px;border-radius:4px}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;padding:0;border:none;border-radius:0.5rem;background:transparent;color:inherit;cursor:pointer;text-decoration:none;outline:none}.icon-button:hover{background:#f1f5f9}.icon-button:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:2px}.menu-toggle{flex-shrink:0}@media (width >= 960px){.menu-toggle{display:none}}`;
380
+ const wegHeaderCss = () => `:host{--weg-breakpoint-sm:640px;--weg-breakpoint-md:960px;--weg-breakpoint-lg:1280px;--weg-breakpoint-xl:1440px}.weg-header-shell{display:contents}:host{display:block}:host(.weg-header--scroll-mode){min-height:4.25rem}@media (width >= 960px){:host(.weg-header--scroll-mode){min-height:5.75rem}}@media (width >= 1280px){:host(.weg-header--scroll-mode){min-height:7.75rem}}@media (width >= 1440px){:host(.weg-header--scroll-mode){min-height:8.75rem}}.skip-to-content{position:fixed;top:-100%;left:0;z-index:10001;padding:0.75rem 1rem;background:#ffffff;color:#0f172a;font-family:var(--weg-font-family);font-weight:600;text-decoration:none;border:2px solid #312e81;border-radius:0 0 0.25rem 0;box-shadow:0 0.25rem 0.75rem rgba(17, 24, 39, 0.15)}.skip-to-content:focus,.skip-to-content:focus-visible{top:0;outline:2px solid var(--weg-color-accent);outline-offset:2px}.header{width:100%;position:relative;z-index:1000;transition:transform 0.25s ease;border-bottom:2px solid var(--weg-color-accent);background:#ffffff;color:#0f172a;font-family:var(--weg-font-family)}.header--scroll-mode{position:fixed;top:0;left:0;right:0}.header--scroll-hidden{transform:translateY(-100%)}.header:not(.header--scroll-mode).header--scroll-hidden{transform:none}@media (prefers-reduced-motion: reduce){.header{transition:none}}@media (width >= 960px){.header{border-bottom-width:0.25rem}}.header--menu-open{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;transform:none;display:flex;flex-direction:column;overflow:hidden}.header--menu-open .header-inner{flex:1 1 auto;flex-wrap:wrap;align-content:flex-start;min-height:0}.header--menu-open .main-nav-panel{display:block;flex:1 1 100%;width:100%;min-height:0;overflow-y:auto;border-top:1px solid #d8d4f7}@media (width >= 960px){.header--menu-open{position:static;inset:auto;z-index:auto;display:block;overflow:visible}.header--menu-open .header-inner{flex:unset;flex-wrap:nowrap;align-content:unset;min-height:unset}}.logo-link{display:inline-flex;align-items:center;text-decoration:none;outline:none}.logo-link:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:4px;border-radius:4px}.logo{height:2.5rem;width:auto}@media (width >= 960px){.logo{height:3rem}}@media (width >= 1280px){.logo{height:5rem}}.header-inner{display:flex;width:100%;min-width:0;align-items:center;justify-content:space-between;gap:0.75rem;padding-block:0.75rem;padding-inline:var(--weg-container-padding-inline)}@media (width >= 960px){.header-inner{flex-wrap:nowrap;gap:1.5rem;padding-block:1.25rem}}@media (width >= 1440px){.header-inner{padding-block:1.75rem}}.header-inner .logo-link{flex:1 1 auto;min-width:0;justify-content:center}@media (width >= 960px){.header-inner .logo-link{flex:0 0 auto;justify-content:flex-start}}.header-inner .logo{max-width:100%}.header-actions{display:flex;align-items:center;flex-shrink:0}@media (width >= 960px){.header-actions{display:none}}.main-nav-panel{display:none;margin-inline:-0.5rem}@media (width >= 960px){.main-nav-panel{display:flex;flex:1 1 auto;width:auto;min-width:0;justify-content:flex-end;overflow:visible;border-top:none}}.main-nav{padding:0 0 1.5rem}@media (width >= 960px){.main-nav{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:1rem;padding:0}}.main-nav__list{list-style:none;margin:0;padding:0}@media (width >= 960px){.main-nav__list{display:flex;align-items:center;flex-wrap:wrap;gap:0.5rem}}@media (width >= 1280px){.main-nav__list{gap:1.5rem}}.main-nav__item{border-bottom:1px solid #d8d4f7}@media (width >= 960px){.main-nav__item{border-bottom:none}}.main-nav__item--dropdown{position:static}.nav-dropdown{position:relative}.nav-link{display:block;width:100%;padding:1rem;font-weight:600;color:inherit;text-decoration:none;outline:none}.nav-link:hover{opacity:0.85}.nav-link:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:2px;border-radius:4px}.nav-link--active{background:var(--weg-purple-200)}.nav-dropdown__trigger{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;width:100%;padding:1rem;border:none;background:transparent;font:inherit;font-weight:600;color:inherit;text-align:left;cursor:pointer;outline:none}.nav-dropdown__trigger:hover{opacity:0.85}.nav-dropdown__trigger:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:2px;border-radius:4px}.nav-dropdown__trigger--open{background:transparent}.nav-dropdown__trigger--active{background:var(--weg-purple-200)}.toggle-icon{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:999rem;background:#312e81;color:#ffffff;flex-shrink:0}.nav-dropdown__panel{padding:0 0 0.75rem}@media (width >= 960px){.nav-dropdown__panel{position:absolute;top:calc(100% + 0.5rem);left:0;z-index:500;min-width:17.5rem;padding:0.75rem 0 0.75rem 0.75rem;border:1px solid #e2e8f0;border-radius:0.5rem;background:#f8fafc;box-shadow:0 0.25rem 1rem rgba(15, 23, 42, 0.08)}.nav-dropdown__panel::before{content:'';position:absolute;top:-0.5rem;left:0;right:0;height:0.5rem}}.nav-dropdown__accent{border-left:0.25rem solid var(--weg-color-accent);padding-left:0.75rem}.nav-dropdown__links{display:flex;flex-direction:column;gap:0.25rem;list-style:none;margin:0;padding:0}.nav-dropdown__link{display:block;padding:0.625rem 0;font-weight:400;color:inherit;text-decoration:none;outline:none}.nav-dropdown__link:hover{opacity:0.85}.nav-dropdown__link:focus-visible{outline:0.125rem solid var(--weg-color-accent);outline-offset:0.125rem;border-radius:0.25rem}.nav-dropdown__link--active{background:var(--weg-purple-200)}@media (width >= 960px){.nav-dropdown__link{padding:0.5rem;margin-right:0.75rem;border-radius:0.5rem;font-weight:600}.nav-dropdown__link:hover,.nav-dropdown__link:focus-visible{background:var(--weg-purple-200);opacity:1}.nav-dropdown__link--active{opacity:1}}@media (width >= 1280px){.nav-dropdown__link{padding:0.5rem 0.75rem}}.main-nav__item--auth>a{display:flex;align-items:center;gap:0.5rem;width:100%;padding:1rem}@media (width >= 960px){.nav-link,.nav-dropdown__trigger,.main-nav__item--auth>a{display:inline-flex;align-items:center;width:auto;padding:0.5rem;border-radius:0.5rem}.nav-link--active,.main-nav__item--auth>a.nav-link--active{background:var(--weg-purple-200)}.nav-dropdown__trigger{gap:0.5rem;cursor:pointer}.nav-dropdown__trigger--open{background:#f1f5f9}.nav-dropdown__trigger--active{background:var(--weg-purple-200)}}@media (width >= 1280px){.main-nav{font-size:1.25rem}.main-nav__item--auth>a{padding:0.5rem 0.75rem}}.sign-in-link,.sign-out-link,.auth-button{display:inline-flex;align-items:center;gap:0.5rem;font-weight:600;color:inherit;text-decoration:none;outline:none}.auth-button{padding:0;border:none;background:transparent;font:inherit;cursor:pointer}.sign-in-link:hover,.sign-out-link:hover,.auth-button:hover{opacity:0.85}.sign-in-link:focus-visible,.sign-out-link:focus-visible,.auth-button:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:4px;border-radius:4px}.icon-button{display:inline-flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;padding:0;border:none;border-radius:0.5rem;background:transparent;color:inherit;cursor:pointer;text-decoration:none;outline:none}.icon-button:hover{background:#f1f5f9}.icon-button:focus-visible{outline:2px solid var(--weg-color-accent);outline-offset:2px}.menu-toggle{flex-shrink:0}@media (width >= 960px){.menu-toggle{display:none}}`;
381
381
 
382
382
  const WEG_HOME = 'https://www.warwickemploymentgroup.com';
383
383
  const DEFAULT_ACCOUNT_HOME = 'https://account.warwickemploymentgroup.com';
384
- /** Stay visible while scrolling down through the first half of the viewport. */
385
- const HEADER_SCROLL_HIDE_THRESHOLD_VH = 0.5;
386
- const HEADER_SCROLL_DIRECTION_DELTA = 5;
387
384
  const DEFAULT_LOGO_HREF = `${WEG_HOME}/`;
388
385
  /** Placeholder href — sign-out is handled via `wegAuthClick`, not navigation. */
389
386
  const SIGN_OUT_HREF = '#';
@@ -442,7 +439,12 @@ function isManageAccountLink(link, accountHome) {
442
439
  function isFindJobLink(link) {
443
440
  if (link.label.trim().toLowerCase() === 'find a job')
444
441
  return true;
445
- return link.href === `${WEG_HOME}/find-a-job`;
442
+ const href = link.href?.trim();
443
+ if (!href)
444
+ return false;
445
+ if (href === `${WEG_HOME}/find-a-job` || href === '/find-a-job')
446
+ return true;
447
+ return href.endsWith('/find-a-job');
446
448
  }
447
449
  function isDashboardLink(link, accountHome) {
448
450
  if (link.label.trim().toLowerCase() === 'dashboard')
@@ -489,6 +491,7 @@ const WegHeader = class {
489
491
  index.registerInstance(this, hostRef);
490
492
  this.wegAuthClick = index.createEvent(this, "wegAuthClick");
491
493
  }
494
+ static SCROLL_REVEAL_VIEWPORT_FRACTION = 0.5;
492
495
  /**
493
496
  * Layout payload, supplied by the host application.
494
497
  *
@@ -507,7 +510,9 @@ const WegHeader = class {
507
510
  */
508
511
  layout;
509
512
  /**
510
- * When true, the header uses the built-in signed-in menu instead of the CMS layout.
513
+ * Session flag from the host app. Enables signed-in UI (icons, compact manage account).
514
+ * Navigation uses `layout.header.menu` when provided; falls back to the built-in
515
+ * signed-in menu only when signed in and the layout menu is empty.
511
516
  */
512
517
  signedIn = false;
513
518
  /**
@@ -533,20 +538,19 @@ const WegHeader = class {
533
538
  resolved = EMPTY_HEADER;
534
539
  menuOpen = false;
535
540
  openDropdown = null;
536
- headerHidden = false;
537
541
  boundHandleDocumentClick = this.handleDocumentClick.bind(this);
538
542
  boundHandleViewportChange = this.handleViewportChange.bind(this);
539
543
  boundHandleHoverCapabilityChange = this.handleHoverCapabilityChange.bind(this);
540
544
  boundHandleScroll = this.handleScroll.bind(this);
541
- headerResizeObserver;
542
- lastScrollY = 0;
543
- scrollTicking = false;
544
545
  bodyScrollLocked = false;
545
546
  bodyScrollLockY = 0;
546
547
  hoverCloseTimer = null;
547
548
  hoverOpenEnabled = false;
548
549
  desktopMediaQuery;
549
550
  hoverCapableMediaQuery;
551
+ headerScrollMode = false;
552
+ headerScrollHidden = false;
553
+ lastScrollY = 0;
550
554
  resolve() {
551
555
  if (this.layout === undefined || this.layout === null) {
552
556
  this.resolved = EMPTY_HEADER;
@@ -563,69 +567,25 @@ const WegHeader = class {
563
567
  this.updateHoverDropdownEnabled();
564
568
  this.handleViewportChange();
565
569
  }
566
- componentDidLoad() {
567
- const header = this.el.shadowRoot?.querySelector('.header');
568
- if (!header)
569
- return;
570
- this.headerResizeObserver = new ResizeObserver(() => this.syncHeaderHeight());
571
- this.headerResizeObserver.observe(header);
572
- this.syncHeaderHeight();
573
- this.lastScrollY = window.scrollY;
574
- this.updateHeaderVisibility();
575
- }
576
570
  connectedCallback() {
577
571
  document.addEventListener('click', this.boundHandleDocumentClick);
572
+ }
573
+ componentDidLoad() {
574
+ this.lastScrollY = Math.max(0, window.scrollY);
578
575
  window.addEventListener('scroll', this.boundHandleScroll, { passive: true });
576
+ this.applyScrollState();
577
+ }
578
+ componentDidRender() {
579
+ this.applyScrollState();
579
580
  }
580
581
  disconnectedCallback() {
581
582
  document.removeEventListener('click', this.boundHandleDocumentClick);
582
583
  window.removeEventListener('scroll', this.boundHandleScroll);
583
584
  this.unlockBodyScroll();
584
- this.headerResizeObserver?.disconnect();
585
585
  this.desktopMediaQuery?.removeEventListener('change', this.boundHandleViewportChange);
586
586
  this.hoverCapableMediaQuery?.removeEventListener('change', this.boundHandleHoverCapabilityChange);
587
587
  this.cancelScheduledDropdownClose();
588
588
  }
589
- syncHeaderHeight() {
590
- if (this.isMobileMenuActive())
591
- return;
592
- const header = this.el.shadowRoot?.querySelector('.header');
593
- if (!header)
594
- return;
595
- this.el.style.setProperty('--weg-header-height', `${header.offsetHeight}px`);
596
- }
597
- handleScroll() {
598
- if (this.scrollTicking)
599
- return;
600
- this.scrollTicking = true;
601
- requestAnimationFrame(() => {
602
- this.scrollTicking = false;
603
- this.updateHeaderVisibility();
604
- });
605
- }
606
- updateHeaderVisibility() {
607
- if (this.isMobileMenuActive()) {
608
- if (this.headerHidden)
609
- this.headerHidden = false;
610
- return;
611
- }
612
- const scrollY = window.scrollY;
613
- const delta = scrollY - this.lastScrollY;
614
- const threshold = window.innerHeight * HEADER_SCROLL_HIDE_THRESHOLD_VH;
615
- let nextHidden = this.headerHidden;
616
- if (scrollY <= threshold) {
617
- nextHidden = false;
618
- }
619
- else if (Math.abs(delta) >= HEADER_SCROLL_DIRECTION_DELTA) {
620
- nextHidden = delta > 0;
621
- }
622
- this.lastScrollY = scrollY;
623
- if (nextHidden === this.headerHidden)
624
- return;
625
- if (nextHidden)
626
- this.closeDropdown();
627
- this.headerHidden = nextHidden;
628
- }
629
589
  /**
630
590
  * Desktop dropdowns open on hover when viewport is md+ and the device reports hover support.
631
591
  * Uses (hover: hover) only — not (pointer: fine), which breaks in DevTools and hybrid devices.
@@ -714,6 +674,65 @@ const WegHeader = class {
714
674
  isMobileMenuActive() {
715
675
  return this.menuOpen && !this.desktopMediaQuery?.matches;
716
676
  }
677
+ handleScroll() {
678
+ this.applyScrollState();
679
+ }
680
+ applyScrollState() {
681
+ if (this.isMobileMenuActive()) {
682
+ if (this.headerScrollHidden) {
683
+ this.headerScrollHidden = false;
684
+ }
685
+ if (this.headerScrollMode) {
686
+ this.headerScrollMode = false;
687
+ }
688
+ this.lastScrollY = Math.max(0, window.scrollY);
689
+ return;
690
+ }
691
+ const scrollY = Math.max(0, window.scrollY);
692
+ const threshold = this.getScrollRevealThreshold();
693
+ const pastRevealThreshold = scrollY >= threshold;
694
+ let nextScrollMode = this.headerScrollMode;
695
+ let nextHidden = this.headerScrollHidden;
696
+ if (!pastRevealThreshold) {
697
+ if (scrollY === 0) {
698
+ nextScrollMode = false;
699
+ nextHidden = false;
700
+ }
701
+ else if (this.headerScrollMode && !this.headerScrollHidden) {
702
+ // Keep a revealed header pinned while scrolling up toward the top.
703
+ nextScrollMode = true;
704
+ nextHidden = scrollY > this.lastScrollY;
705
+ }
706
+ else {
707
+ nextScrollMode = false;
708
+ nextHidden = false;
709
+ }
710
+ }
711
+ else if (scrollY === 0) {
712
+ nextScrollMode = false;
713
+ nextHidden = false;
714
+ }
715
+ else {
716
+ nextScrollMode = true;
717
+ if (scrollY > this.lastScrollY) {
718
+ nextHidden = true;
719
+ }
720
+ else if (scrollY < this.lastScrollY) {
721
+ nextHidden = false;
722
+ }
723
+ }
724
+ this.lastScrollY = scrollY;
725
+ if (nextScrollMode !== this.headerScrollMode) {
726
+ this.headerScrollMode = nextScrollMode;
727
+ }
728
+ if (nextHidden !== this.headerScrollHidden) {
729
+ this.headerScrollHidden = nextHidden;
730
+ }
731
+ }
732
+ getScrollRevealThreshold() {
733
+ const viewportHeight = window.visualViewport?.height ?? window.innerHeight;
734
+ return viewportHeight * WegHeader.SCROLL_REVEAL_VIEWPORT_FRACTION;
735
+ }
717
736
  watchLayout() {
718
737
  this.resolve();
719
738
  }
@@ -923,7 +942,6 @@ const WegHeader = class {
923
942
  }
924
943
  openMenu() {
925
944
  this.menuOpen = true;
926
- this.headerHidden = false;
927
945
  this.closeDropdown();
928
946
  if (!this.desktopMediaQuery?.matches) {
929
947
  this.lockBodyScroll();
@@ -938,8 +956,6 @@ const WegHeader = class {
938
956
  this.menuOpen = false;
939
957
  this.closeDropdown();
940
958
  this.unlockBodyScroll();
941
- this.syncHeaderHeight();
942
- this.updateHeaderVisibility();
943
959
  if (announce && wasMobileActive) {
944
960
  this.announceToScreenReader(`${MAIN_NAV_LABEL} closed.`);
945
961
  }
@@ -951,7 +967,13 @@ const WegHeader = class {
951
967
  return normalizeAccountBase(this.accountBaseUrl);
952
968
  }
953
969
  getActiveMenu() {
954
- return this.signedIn ? buildSignedInMenu(this.getAccountHome()) : this.resolved.menu;
970
+ if (this.resolved.menu.length > 0) {
971
+ return this.resolved.menu;
972
+ }
973
+ if (this.signedIn) {
974
+ return buildSignedInMenu(this.getAccountHome());
975
+ }
976
+ return this.resolved.menu;
955
977
  }
956
978
  getLogoSrc() {
957
979
  return this.resolved.logoSrc ?? LOGO_SRC;
@@ -1122,12 +1144,12 @@ const WegHeader = class {
1122
1144
  const logoSrc = this.getLogoSrc();
1123
1145
  const closeMenu = () => this.closeMenu();
1124
1146
  const mobileMenuActive = this.isMobileMenuActive();
1125
- return (index.h("div", { key: '7de9456349faccdc02caa1458af12361c509881f', class: "weg-header-shell" }, index.h("a", { key: 'a2c27545363d362bbdeb80d830b0b757a1090585', class: "skip-to-content", href: "#", title: SKIP_TO_CONTENT_LABEL, onClick: (event) => this.handleSkipToContent(event) }, SKIP_TO_CONTENT_LABEL), index.h("header", { key: '592fccf957ad7e29f3113143e853a2d0a0d84b25', class: {
1147
+ return (index.h(index.Host, { key: 'e0ed16abe9a49db723b627ea8bccfde470406f57', class: { 'weg-header--scroll-mode': this.headerScrollMode } }, index.h("div", { key: '574712a024543f0653f9956949b2796377451847', class: "weg-header-shell" }, index.h("a", { key: '279c196e293d93db62fc29915f63b7b24b38e6c1', class: "skip-to-content", href: "#", title: SKIP_TO_CONTENT_LABEL, onClick: (event) => this.handleSkipToContent(event) }, SKIP_TO_CONTENT_LABEL), index.h("header", { key: '29bbed6bde5ccf8cd2b4e4df4a7ba58b122c2d6a', class: {
1126
1148
  header: true,
1127
- 'header--fixed': !mobileMenuActive,
1128
- 'header--hidden': this.headerHidden && !mobileMenuActive,
1129
1149
  'header--menu-open': mobileMenuActive,
1130
- } }, index.h("div", { key: 'b36223997721eb185813831b34fe59efeb8d55c7', class: "header-inner" }, index.h("div", { key: '032b4e9682d9a271a8be93e0f11125a1ee673680', class: "sr-only", "aria-live": "polite", "aria-atomic": "true", "data-weg-sr-live": true }), index.h("button", { key: 'c74ea7c3cb31fb21aa7d976a615487d7121739eb', type: "button", class: "menu-toggle icon-button", "aria-label": mobileMenuActive ? CLOSE_MAIN_NAV_LABEL : OPEN_MAIN_NAV_LABEL, "aria-expanded": mobileMenuActive ? 'true' : 'false', "aria-controls": "weg-header-main-nav", onClick: () => this.toggleMenu() }, mobileMenuActive ? index.h(CloseIcon, null) : index.h(HamburgerIcon, null)), index.h(Logo, { key: '0107f366b4e69e7ceddc05715b06a110bb9f22bc', href: logoHref, src: logoSrc }), index.h("div", { key: '6e273b0ea6b4f9f8ee4533af7b6df1c10a91ed9b', class: "header-actions" }, this.renderCompactAuth(mobileMenuActive ? closeMenu : undefined)), index.h("div", { key: '5c06b9fa77e50e9357bc6f5d27805c895ec4ea0c', class: "main-nav-panel", id: "weg-header-main-nav", role: mobileMenuActive ? 'dialog' : undefined, "aria-modal": mobileMenuActive ? 'true' : undefined, "aria-label": mobileMenuActive ? MAIN_NAV_LABEL : undefined }, this.renderNav(mobileMenuActive ? closeMenu : undefined))))));
1150
+ 'header--scroll-mode': this.headerScrollMode,
1151
+ 'header--scroll-hidden': this.headerScrollHidden && this.headerScrollMode,
1152
+ } }, index.h("div", { key: '85650e9d0d244fefbd9f216130703de9288baa93', class: "header-inner" }, index.h("div", { key: '34e7bf3d15733e9acefb12b2c77fee9a4cf7479c', class: "sr-only", "aria-live": "polite", "aria-atomic": "true", "data-weg-sr-live": true }), index.h("button", { key: '9e35626afcecc92d93deb2fb25f8f93727f85d4d', type: "button", class: "menu-toggle icon-button", "aria-label": mobileMenuActive ? CLOSE_MAIN_NAV_LABEL : OPEN_MAIN_NAV_LABEL, "aria-expanded": mobileMenuActive ? 'true' : 'false', "aria-controls": "weg-header-main-nav", onClick: () => this.toggleMenu() }, mobileMenuActive ? index.h(CloseIcon, null) : index.h(HamburgerIcon, null)), index.h(Logo, { key: '99ffa62e443e939316b58d36cab8e9e0a10cfa36', href: logoHref, src: logoSrc }), index.h("div", { key: 'c9b453f5187d5b6ad782ae03400c13f16a31c383', class: "header-actions" }, this.renderCompactAuth(mobileMenuActive ? closeMenu : undefined)), index.h("div", { key: '0f15f985cf4931a9867c341d053f5ebd2b398d42', class: "main-nav-panel", id: "weg-header-main-nav", role: mobileMenuActive ? 'dialog' : undefined, "aria-modal": mobileMenuActive ? 'true' : undefined, "aria-label": mobileMenuActive ? MAIN_NAV_LABEL : undefined }, this.renderNav(mobileMenuActive ? closeMenu : undefined)))))));
1131
1153
  }
1132
1154
  static get watchers() { return {
1133
1155
  "layout": [{
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Bq6Rv2aB.js');
3
+ var index = require('./index-7WCqkJs6.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["weg-footer_2.cjs",[[513,"weg-footer",{"layout":[1],"resolved":[32]},null,{"layout":[{"watchLayout":0}]}],[513,"weg-header",{"layout":[1],"signedIn":[516,"signed-in"],"userName":[1,"user-name"],"accountBaseUrl":[1,"account-base-url"],"currentPath":[1,"current-path"],"resolved":[32],"menuOpen":[32],"openDropdown":[32],"headerHidden":[32]},[[8,"keydown","handleKeyDown"]],{"layout":[{"watchLayout":0}]}]]]], options);
22
+ return index.bootstrapLazy([["weg-footer_2.cjs",[[513,"weg-footer",{"layout":[1],"resolved":[32]},null,{"layout":[{"watchLayout":0}]}],[513,"weg-header",{"layout":[1],"signedIn":[516,"signed-in"],"userName":[1,"user-name"],"accountBaseUrl":[1,"account-base-url"],"currentPath":[1,"current-path"],"resolved":[32],"menuOpen":[32],"openDropdown":[32],"headerScrollMode":[32],"headerScrollHidden":[32]},[[8,"keydown","handleKeyDown"]],{"layout":[{"watchLayout":0}]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -20,6 +20,33 @@
20
20
  display: contents;
21
21
  }
22
22
 
23
+ :host {
24
+ display: block;
25
+ }
26
+
27
+ :host(.weg-header--scroll-mode) {
28
+ /* Reserves flow space while the header is fixed past 50vh. */
29
+ min-height: 4.25rem;
30
+ }
31
+
32
+ @media (width >= 960px) {
33
+ :host(.weg-header--scroll-mode) {
34
+ min-height: 5.75rem;
35
+ }
36
+ }
37
+
38
+ @media (width >= 1280px) {
39
+ :host(.weg-header--scroll-mode) {
40
+ min-height: 7.75rem;
41
+ }
42
+ }
43
+
44
+ @media (width >= 1440px) {
45
+ :host(.weg-header--scroll-mode) {
46
+ min-height: 8.75rem;
47
+ }
48
+ }
49
+
23
50
  .skip-to-content {
24
51
  position: fixed;
25
52
  top: -100%;
@@ -45,49 +72,50 @@
45
72
 
46
73
  .header {
47
74
  width: 100%;
75
+ position: relative;
76
+ z-index: 1000;
77
+ transition: transform 0.25s ease;
48
78
  border-bottom: 2px solid var(--weg-color-accent);
49
79
  background: #ffffff;
50
80
  color: #0f172a;
51
81
  font-family: var(--weg-font-family);
52
82
  }
53
83
 
54
- @media (width >= 960px) {
55
- .header {
56
- border-bottom-width: 0.25rem;
57
- }
58
- }
59
-
60
- :host {
61
- position: relative;
62
- z-index: 20;
63
- display: block;
64
- height: var(--weg-header-height, auto);
65
- }
66
-
67
- .header--fixed {
84
+ .header--scroll-mode {
68
85
  position: fixed;
69
86
  top: 0;
70
87
  left: 0;
71
88
  right: 0;
72
- z-index: 20;
73
- transform: translateY(0);
74
- transition: transform 0.25s ease;
75
89
  }
76
90
 
77
- .header--fixed.header--hidden {
91
+ .header--scroll-hidden {
78
92
  transform: translateY(-100%);
79
93
  }
80
94
 
95
+ .header:not(.header--scroll-mode).header--scroll-hidden {
96
+ transform: none;
97
+ }
98
+
81
99
  @media (prefers-reduced-motion: reduce) {
82
- .header--fixed {
100
+ .header {
83
101
  transition: none;
84
102
  }
85
103
  }
86
104
 
105
+ @media (width >= 960px) {
106
+ .header {
107
+ border-bottom-width: 0.25rem;
108
+ }
109
+ }
110
+
87
111
  .header--menu-open {
88
112
  position: fixed;
89
- inset: 0;
113
+ top: 0;
114
+ left: 0;
115
+ right: 0;
116
+ bottom: 0;
90
117
  z-index: 1000;
118
+ transform: none;
91
119
  display: flex;
92
120
  flex-direction: column;
93
121
  overflow: hidden;