scb-wc 0.1.237 → 0.1.239

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.
Files changed (81) hide show
  1. package/README.md +19 -16
  2. package/all.d.ts +14 -0
  3. package/all.js +14 -0
  4. package/index.js +99 -85
  5. package/mvc/components/all.js +9 -0
  6. package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
  7. package/mvc/components/scb-accordion/scb-accordion.js +1 -1
  8. package/mvc/components/scb-app-bar/scb-app-bar.js +1 -1
  9. package/mvc/components/scb-button/scb-button.js +3 -3
  10. package/mvc/components/scb-calendar/scb-calendar.js +1 -1
  11. package/mvc/components/scb-calendar-card/scb-calendar-card.js +4 -4
  12. package/mvc/components/scb-card/scb-card.js +2 -2
  13. package/mvc/{vendor → components/scb-chevron}/scb-chevron.js +1 -1
  14. package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +1 -1
  15. package/mvc/components/scb-datepicker/scb-datepicker.js +143 -0
  16. package/mvc/components/scb-dialog/scb-dialog.js +1 -1
  17. package/mvc/components/scb-drawer/scb-drawer.js +3 -3
  18. package/mvc/components/scb-drop-zone/scb-drop-zone.js +1 -1
  19. package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
  20. package/mvc/components/scb-fact-card/scb-fact-card.js +1 -1
  21. package/mvc/components/scb-header/scb-header.js +2 -2
  22. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
  23. package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
  24. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
  25. package/mvc/components/scb-link/scb-link.js +1 -1
  26. package/mvc/components/scb-link-button/scb-link-button.js +1 -1
  27. package/mvc/components/scb-list/scb-list-item.js +6 -6
  28. package/mvc/components/scb-menu/scb-menu-item.js +3 -3
  29. package/mvc/components/scb-menu/scb-menu.js +5 -5
  30. package/mvc/components/scb-nav/scb-nav.js +1 -1
  31. package/mvc/components/scb-notification-card/scb-notification-card.js +1 -1
  32. package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
  33. package/mvc/components/scb-options-menu/scb-options-menu.js +2 -2
  34. package/mvc/components/scb-options-menu/scb-options-sub-menu.js +1 -1
  35. package/mvc/components/scb-overlay/scb-overlay.js +3 -3
  36. package/mvc/components/scb-pagination/scb-pagination.js +1 -1
  37. package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
  38. package/mvc/components/scb-search/scb-search.js +3 -3
  39. package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
  40. package/mvc/components/scb-select/scb-select-option.js +1 -1
  41. package/mvc/components/scb-select/scb-select.js +1 -1
  42. package/mvc/components/scb-snackbar/scb-snackbar.js +1 -1
  43. package/mvc/components/scb-stepper/scb-step.js +1 -1
  44. package/mvc/components/scb-table/scb-table.js +1 -1
  45. package/mvc/components/scb-table-advanced/scb-table-advanced.js +1 -1
  46. package/mvc/components/scb-table-next/read-table.js +1 -0
  47. package/mvc/components/scb-table-next/scb-table-next.js +6 -0
  48. package/mvc/components/scb-textfield/scb-textfield.js +34 -176
  49. package/mvc/components/scb-toc/scb-toc-item.js +1 -1
  50. package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
  51. package/mvc/{vendor → components/shared}/component-size-token.js +1 -1
  52. package/mvc/components/shared/lazy-focus-ring.js +2 -0
  53. package/mvc/components/shared/lazy-ripple.js +2 -0
  54. package/mvc/{vendor → components/shared}/manual-popover.js +1 -1
  55. package/mvc/components/shared/scb-icon-svg.js +11 -0
  56. package/package.json +12 -2
  57. package/scb-components/index.d.ts +108 -0
  58. package/scb-components/scb-table-next/read-table.d.ts +29 -0
  59. package/scb-components/scb-table-next/scb-table-next.d.ts +22 -0
  60. package/scb-components/scb-viz/scb-viz-actions-runtime.d.ts +26 -0
  61. package/scb-components/scb-viz/scb-viz-print-runtime.d.ts +30 -0
  62. package/scb-components/scb-viz/scb-viz-series-differentiation-registry.d.ts +21 -0
  63. package/scb-components/scb-viz/scb-viz-series-differentiation-runtime.d.ts +42 -0
  64. package/scb-components/scb-viz/scb-viz-table-runtime.d.ts +28 -0
  65. package/scb-components/shared/component-size-token.d.ts +1 -0
  66. package/scb-components/shared/lazy-focus-ring.d.ts +4 -0
  67. package/scb-components/shared/lazy-ripple.d.ts +9 -0
  68. package/scb-components/shared/manual-popover.d.ts +7 -0
  69. package/scb-components/shared/scb-icon-svg.d.ts +3 -0
  70. package/scb-menu/scb-menu-item.js +7 -1
  71. package/scb-menu/scb-menu.js +3 -0
  72. package/scb-table-next/read-table.js +87 -0
  73. package/scb-table-next/scb-table-next.js +226 -0
  74. package/scb-viz/scb-viz-series-differentiation-registry.js +10 -7
  75. package/scb-viz/scb-viz.js +43 -43
  76. package/scb-wc.bundle.js +417 -287
  77. package/scb-wc.d.ts +28 -0
  78. package/shared/scb-icon-svg.js +5 -2
  79. package/mvc/vendor/lazy-focus-ring.js +0 -2
  80. package/mvc/vendor/lazy-ripple.js +0 -2
  81. package/mvc/vendor/scb-icon-svg.js +0 -11
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/icon.js","../../vendor/rolldown-runtime.js","../../vendor/vendor.js","../../vendor/vendor-lit.js"])))=>i.map(i=>d[i]);
2
- import{f,h as v,m,p as s,v as p,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as _}from"../../vendor/preload-helper.js";import{t as k}from"../../vendor/component-size-token.js";import{t as r}from"../../vendor/decorate.js";import{t as h}from"../../vendor/assertClassBrand.js";import{t as w}from"../../vendor/classPrivateMethodInitSpec.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"./scb-fact-card-content.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,n,d){try{customElements.get(e)||t(e,n,d)}catch(g){var o=String(g||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw g}}}}catch{}})();var b,l,i,x={fromAttribute:c=>c??"",toAttribute:c=>typeof c!="string"||c.trim()===""?null:c},a=(b=new WeakSet,l=class extends v{constructor(...t){super(...t),w(this,b),this.__onCloseClick=e=>{e.stopPropagation(),this.__setOpen(!1)},this.variant="filled",this.title="",this.subtitle="",this.supportingText="",this.icon="",this.showCloseButton=!1,this.closeLabel="Stäng faktakort",this.__hasIconSlot=!1,this.open=!0,this.__lastTriggerEl=null,this.sizing="",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__onIconSlotChange=()=>{const e=this.renderRoot.querySelector('slot[name="icon"]');this.__hasIconSlot=!!e?.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.TEXT_NODE?!!n.textContent?.trim():!0)}}static __handleDocClick(t){const e=t.composedPath();for(const n of e){if(!(n instanceof Element))continue;const d=n.getAttribute("data-fact-card-toggle")||n.getAttribute("aria-controls");if(!d)continue;const o=i.__instances.get(d);if(!o){i.__instances.delete(d);continue}o.__lastTriggerEl=n,o.__setOpen(!o.open);break}}static __ensureDocListener(){i.__docListenerAttached||(document.addEventListener("click",i.__handleDocClick,!0),i.__docListenerAttached=!0)}static __maybeRemoveDocListener(){i.__docListenerAttached&&i.__instances.size===0&&(document.removeEventListener("click",i.__handleDocClick,!0),i.__docListenerAttached=!1)}connectedCallback(){super.connectedCallback(),this.id&&i.__instances.set(this.id,this),i.__ensureDocListener()}disconnectedCallback(){this.id&&i.__instances.delete(this.id),i.__maybeRemoveDocListener(),super.disconnectedCallback()}updated(t){t.has("open")&&this.__updateTriggersExpanded(),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&h(b,this,u).call(this)}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__setOpen(t){const e=this.open;e!==t&&(this.open=t,this.dispatchEvent(new CustomEvent("openchange",{bubbles:!0,composed:!0,detail:{open:this.open}})),t&&!e?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):!t&&e&&this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}render(){if(!this.open)return p``;const t=this.variant==="outlined"?"outlined":"filled",e=!!this.icon||this.__hasIconSlot||this.__hasLightDomSlot("icon");return p`
2
+ import{f,h as v,m,p as s,v as p,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as _}from"../../vendor/preload-helper.js";import{componentSizeToken as k}from"../shared/component-size-token.js";import{t as r}from"../../vendor/decorate.js";import{t as h}from"../../vendor/assertClassBrand.js";import{t as w}from"../../vendor/classPrivateMethodInitSpec.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";import"./scb-fact-card-content.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,n,d){try{customElements.get(e)||t(e,n,d)}catch(g){var o=String(g||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw g}}}}catch{}})();var b,l,i,x={fromAttribute:c=>c??"",toAttribute:c=>typeof c!="string"||c.trim()===""?null:c},a=(b=new WeakSet,l=class extends v{constructor(...t){super(...t),w(this,b),this.__onCloseClick=e=>{e.stopPropagation(),this.__setOpen(!1)},this.variant="filled",this.title="",this.subtitle="",this.supportingText="",this.icon="",this.showCloseButton=!1,this.closeLabel="Stäng faktakort",this.__hasIconSlot=!1,this.open=!0,this.__lastTriggerEl=null,this.sizing="",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__onIconSlotChange=()=>{const e=this.renderRoot.querySelector('slot[name="icon"]');this.__hasIconSlot=!!e?.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.TEXT_NODE?!!n.textContent?.trim():!0)}}static __handleDocClick(t){const e=t.composedPath();for(const n of e){if(!(n instanceof Element))continue;const d=n.getAttribute("data-fact-card-toggle")||n.getAttribute("aria-controls");if(!d)continue;const o=i.__instances.get(d);if(!o){i.__instances.delete(d);continue}o.__lastTriggerEl=n,o.__setOpen(!o.open);break}}static __ensureDocListener(){i.__docListenerAttached||(document.addEventListener("click",i.__handleDocClick,!0),i.__docListenerAttached=!0)}static __maybeRemoveDocListener(){i.__docListenerAttached&&i.__instances.size===0&&(document.removeEventListener("click",i.__handleDocClick,!0),i.__docListenerAttached=!1)}connectedCallback(){super.connectedCallback(),this.id&&i.__instances.set(this.id,this),i.__ensureDocListener()}disconnectedCallback(){this.id&&i.__instances.delete(this.id),i.__maybeRemoveDocListener(),super.disconnectedCallback()}updated(t){t.has("open")&&this.__updateTriggersExpanded(),t.has("width")&&(this.width?this.style.inlineSize=this.width:this.style.removeProperty("inline-size")),t.has("maxWidth")&&(this.maxWidth?this.style.maxInlineSize=this.maxWidth:this.style.removeProperty("max-inline-size")),t.has("height")&&(this.height?this.style.blockSize=this.height:this.style.removeProperty("block-size")),t.has("maxHeight")&&(this.maxHeight?this.style.maxBlockSize=this.maxHeight:this.style.removeProperty("max-block-size")),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&h(b,this,u).call(this)}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-fact-card-toggle="${this.id}"]`).forEach(t=>{t.hasAttribute("aria-controls")&&t.setAttribute("aria-expanded",String(this.open))})}__setOpen(t){const e=this.open;e!==t&&(this.open=t,this.dispatchEvent(new CustomEvent("openchange",{bubbles:!0,composed:!0,detail:{open:this.open}})),t&&!e?this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})):!t&&e&&this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))}render(){if(!this.open)return p``;const t=this.variant==="outlined"?"outlined":"filled",e=!!this.icon||this.__hasIconSlot||this.__hasLightDomSlot("icon");return p`
3
3
  <div class="outer ${e?"has-icon":""}">
4
4
  <div class="icon-wrapper ${t}" ?hidden=${!e}>
5
5
  <slot name="icon" @slotchange=${this.__onIconSlotChange}>
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../scb-drawer/scb-drawer.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../../vendor/decorate.js","../../vendor/manual-popover.js","../scb-divider/scb-divider.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateMethodInitSpec.js","../scb-menu/scb-menu.js","../scb-menu/scb-menu-item.js","../../vendor/scb-chevron.js","../scb-menu/scb-menu-section.js","../scb-menu/scb-sub-menu.js","../scb-search/scb-search.js","../../vendor/icon.js","../../vendor/ripple.js","../../vendor/attachable-controller.js","../../vendor/component-size-token.js","../../vendor/component-defaults.js","../../vendor/scb-header-drawer.internal.js","../scb-button/scb-button.js","../scb-icon-button/scb-icon-button.js","../scb-skeleton/scb-skeleton.js","../scb-grid/scb-grid.js","../scb-grid/scb-grid-item.js","../scb-grid/scb-stack.js","../scb-dropdown/scb-dropdown.js","../scb-options-menu/scb-options-menu.js","../scb-options-menu/scb-options-menu-item.js","../scb-options-menu/scb-options-sub-menu.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../scb-drawer/scb-drawer.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../../vendor/decorate.js","../shared/manual-popover.js","../scb-divider/scb-divider.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateMethodInitSpec.js","../scb-menu/scb-menu.js","../scb-menu/scb-menu-item.js","../scb-chevron/scb-chevron.js","../scb-menu/scb-menu-section.js","../scb-menu/scb-sub-menu.js","../scb-search/scb-search.js","../../vendor/icon.js","../../vendor/rolldown-runtime.js","../../vendor/ripple.js","../../vendor/attachable-controller.js","../shared/component-size-token.js","../../vendor/component-defaults.js","../../vendor/scb-header-drawer.internal.js","../scb-button/scb-button.js","../scb-icon-button/scb-icon-button.js","../scb-skeleton/scb-skeleton.js","../scb-grid/scb-grid.js","../scb-grid/scb-grid-item.js","../scb-grid/scb-stack.js","../scb-dropdown/scb-dropdown.js","../scb-options-menu/scb-options-menu.js","../scb-options-menu/scb-options-menu-item.js","../scb-options-menu/scb-options-sub-menu.js"])))=>i.map(i=>d[i]);
2
2
  import{f as _,g as w,h as R,m as N,p as l,v,y as O}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as S}from"../../vendor/preload-helper.js";import{t as B}from"../../vendor/component-defaults.js";import{t as c}from"../../vendor/decorate.js";(function(){try{var u=typeof globalThis<"u"?globalThis:window;if(!u.__scb_ce_guard_installed__){u.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,a,r){try{customElements.get(t)||e(t,a,r)}catch(o){var s=String(o||"");if(s.indexOf("already been used")===-1&&s.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var C,T,H=0,I=[0,2,4,8,12,16,20,24,32,40,48,64,80,96,120],W=()=>{if(typeof window>"u"||typeof document>"u"||!("customElements"in window)||document.head.querySelector("style[data-scb-header-pre-upgrade]"))return;const u=document.createElement("style");u.setAttribute("data-scb-header-pre-upgrade",""),u.textContent=`
3
3
  scb-header:not(:defined),
4
4
  scb-header[data-upgrading] {
@@ -52,7 +52,7 @@ import{f as _,g as w,h as R,m as N,p as l,v,y as O}from"../../vendor/vendor.js";
52
52
  );
53
53
  }
54
54
  }
55
- `,document.head.appendChild(u);const e=n=>{const g=String(n??"").trim();if(g){if(/^\d+$/.test(g)){const b=Math.max(0,Math.min(14,parseInt(g,10)));return`var(--spacing-${b}, ${I[b]}px)`}return g}},t=n=>{const g=String(n??"").trim();if(!g)return!1;try{const b=JSON.parse(g);return Array.isArray(b)&&b.length>0}catch{return!1}},a=n=>n!=null&&!/^(false|0|off|no)$/i.test(n.trim()),r=n=>{for(const g of Array.from(n.children)){const b=g.tagName.toLowerCase();if(b==="scb-header-tab"||b==="scb-dropdown")return!0}return!1},s=n=>{r(n)||t(n.getAttribute("tabs"))||a(n.getAttribute("reserve-tabs"))||a(n.getAttribute("layout-pending"))?n.setAttribute("data-pre-has-tabs",""):n.removeAttribute("data-pre-has-tabs");const g=e(n.getAttribute("spacing")),b=e(n.getAttribute("spacing-top"))??g,y=e(n.getAttribute("spacing-bottom"))??g,x=e(n.getAttribute("padding-inline")),k=e(n.getAttribute("padding-inline-expanded"))??x;b?n.style.setProperty("--scb-header-spacing-block-start",b):n.style.removeProperty("--scb-header-spacing-block-start"),y?n.style.setProperty("--scb-header-spacing-block-end",y):n.style.removeProperty("--scb-header-spacing-block-end"),x?n.style.setProperty("--scb-header-padding-inline",x):n.style.removeProperty("--scb-header-padding-inline"),k?n.style.setProperty("--scb-header-padding-inline-expanded",k):n.style.removeProperty("--scb-header-padding-inline-expanded");const d=(n.getAttribute("logo-width")??"").trim();d?n.style.setProperty("--scb-header-pre-logo-w",d):n.style.removeProperty("--scb-header-pre-logo-w");const f=(n.getAttribute("logo-height")??"").trim();f?n.style.setProperty("--scb-header-pre-logo-img-h",f):n.style.removeProperty("--scb-header-pre-logo-img-h");const m=(n.getAttribute("search-height")??"").trim();m?n.style.setProperty("--scb-header-pre-control-size",m):n.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(s);const h=new MutationObserver(n=>{for(const g of n){if(g.type==="attributes"){const b=g.target;b instanceof HTMLElement&&b.tagName.toLowerCase()==="scb-header"&&s(b);continue}if(g.type==="childList"){const b=[...Array.from(g.addedNodes),...Array.from(g.removedNodes)];for(const y of b){if(!(y instanceof HTMLElement))continue;if(y.tagName.toLowerCase()==="scb-header"){s(y);continue}const x=y.closest?.("scb-header");x&&s(x)}}}});h.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","padding-inline","padding-inline-expanded","logo-width","logo-height","logo-aspect-ratio","logo-alt","logotype-text","search-height","reserve-tabs","layout-pending"]}),customElements.whenDefined("scb-header").then(()=>{h.disconnect()})};W();var P={fromAttribute:u=>u==null?!0:!/^(false|0|off|no)$/i.test(u),toAttribute:u=>String(!!u)},L={fromAttribute:u=>u==null?!1:!/^(false|0|off|no)$/i.test(u),toAttribute:u=>u?"":null},F={fromAttribute:u=>u==="small"||u==="medium"||u==="large"?u:"medium",toAttribute:u=>{const e=String(u??"");return e==="small"||e==="medium"||e==="large"?e:null}},i=(C=class extends R{constructor(){super(),this.maxWidth="1440px",this.size=B["scb-header"].size,this.logoText="",this.logotypeText="",this.logoAlt="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel="Sök",this.searchClearLabel="Rensa sökfält",this.searchCloseLabel="Stäng sök",this.menuButtonLabel="Meny",this.menuOpenLabel="Öppna meny",this.utilityNavigationLabel="Funktionslänkar",this.mainNavigationLabel="Huvudnavigering",this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._observedLayout=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=t=>{t.stopPropagation();const a=t.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:a,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:a,bubbles:!0,composed:!0}));const r=a?.item,s=typeof a?.href=="string"?a.href:typeof a?.itemHref=="string"?a.itemHref:typeof a?.item_href=="string"?a.item_href:"",o=r?r.getAttribute("item-href")??r.getAttribute("href")??"":"";String(s||o||"").trim()&&this._closeDrawerNow()},this._onMenuSelectAlias=t=>{t.stopPropagation()},this._collapsed=!1,this._unlockAtWidth=0,this._tabsCollapsed=!1,this._desktop=typeof window<"u"&&window.innerWidth>=T.BP_MD_DEFAULT,this._hideLogoText=!1,this._slotWatchers=[],this._harvestPending=!1,this._harvest=(t={})=>{const a=Array.from(this.children),r=[],s=[],o=[];let h=-1,n=!1;const g=d=>({label:d.getAttribute("label")??"",href:d.getAttribute("href")??void 0,icon:d.getAttribute("icon")??void 0}),b=d=>{d.hasAttribute("role")&&d.removeAttribute("role"),d.hasAttribute("hidden")||d.setAttribute("hidden",""),d.getAttribute("aria-hidden")!=="true"&&d.setAttribute("aria-hidden","true")};for(const d of a){const f=d.tagName.toLowerCase();if(this._isDrawerCloseNode(d)){this._syncDrawerCloseNode(d);continue}if(f==="scb-header-tab"){b(d);const m=d.getAttribute("label")??"",p=d.getAttribute("href"),A=p&&p.trim()!==""?p:void 0;(d.hasAttribute("selected")||d.getAttribute("selected")==="true"||d.getAttribute("active")==="true"||d.getAttribute("aria-current")==="page")&&h===-1&&(h=r.length),r.push({kind:"tab",label:m,href:A});continue}if(f==="scb-badge"){const m=d.querySelector("scb-dropdown");if(m){n=!0;const p=m.getAttribute("label")??"";(m.hasAttribute("selected")||m.getAttribute("selected")==="true"||m.getAttribute("active")==="true"||m.getAttribute("aria-current")==="page")&&h===-1&&(h=r.length);const A=`scb-header-tab-${r.length}`;d.getAttribute("slot")!==A&&d.setAttribute("slot",A),m.hasAttribute("slot")&&m.removeAttribute("slot"),m.hasAttribute("as-tab")||m.setAttribute("as-tab",""),r.push({kind:"dropdown",slotName:A,label:p});continue}}if(f==="scb-dropdown"){n=!0;const m=d.getAttribute("label")??"";(d.hasAttribute("selected")||d.getAttribute("selected")==="true"||d.getAttribute("active")==="true"||d.getAttribute("aria-current")==="page")&&h===-1&&(h=r.length);const p=`scb-header-tab-${r.length}`;d.getAttribute("slot")!==p&&d.setAttribute("slot",p),d.hasAttribute("as-tab")||d.setAttribute("as-tab",""),r.push({kind:"dropdown",slotName:p,label:m});continue}if(f==="scb-header-utility"){b(d),s.push({label:d.getAttribute("label")??"",href:d.getAttribute("href")??"#",target:d.getAttribute("target")??void 0});continue}if(f==="scb-header-menu-group"){b(d);const m={label:d.getAttribute("label")??"",icon:d.getAttribute("icon")??void 0,children:[]};d.querySelectorAll("scb-header-menu-item").forEach(p=>m.children.push(g(p))),o.push(m);continue}if(f==="scb-header-menu-item"){b(d),o.push(g(d));continue}d.hasAttribute("slot")||b(d)}const y=!this._sameNavItems(this._slotNavItems,r),x=!this._sameUtilityItems(this._slotUtils,s),k=!this._sameMenuNodes(this._slotMenu,o);y&&(this._slotNavItems=r),x&&(this._slotUtils=s),k&&(this._slotMenu=o),n&&this._ensureDropdownReady(),!this.hasAttribute("active-tab")&&h>=0&&this.activeTab!==h&&(this.activeTab=h),(t.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;const t=this._top,a=this._logoGroup;if(!t||!a)return;const r=window.innerWidth;this._desktop=r>=this.BP_MD;const s=t.clientWidth,o=this._overflows(this._util),h=!this._desktop||o;this._collapsed?!h&&s>=this._unlockAtWidth&&this._setCollapsed(!1):h&&(this._unlockAtWidth=s+this._HYST,this._setCollapsed(!0)),this._setTabsCollapsed(this._tabsOverflows());let n=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const x=getComputedStyle(this._searchWrap),k=Math.max(this._num(x.minWidth,this._tokenPx("--scb-header-search-min",250)),this._tokenPx("--scb-header-search-min",250)),d=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),f=this.showDrawer&&(this.alwaysShowMenuButton||r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;n=a.getBoundingClientRect().width+d+k+d+f+8>s+.5}this._setHideSearch(n);let g=!1;const b=this.renderRoot.querySelector(".actions"),y=Array.from(b?.querySelectorAll(".header-icon-button")??[]).filter(x=>this._visible(x));if(y.length>0&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const x=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),k=b?this._num(getComputedStyle(b).columnGap,0):0,d=y.reduce((m,p)=>m+p.getBoundingClientRect().width,0)+k*Math.max(0,y.length-1);this._hideLogoText&&this.removeAttribute("data-hide-logo-text");const f=a.getBoundingClientRect().width;this._hideLogoText&&this.setAttribute("data-hide-logo-text",""),g=f+x+d+(this._hideLogoText?this._HYST:0)>s+.5}this._setHideLogoText(g)},this._onGlobalFocusRingKeydown=t=>{t.key==="Tab"&&(this.toggleAttribute("data-keyboard-focus",!0),this._ensureFocusRingReady())},this._onGlobalFocusRingPointerDown=()=>{this.removeAttribute("data-keyboard-focus")},this._onLocalFocusIn=t=>{const a=t.composedPath()[0];a instanceof HTMLElement&&a.matches(":focus-visible")&&this._ensureFocusRingReady()},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=async t=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})),!this._drawerReady&&(t.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onMobileSearchToggle=()=>{const t=!this._mobileSearchOpen;this._setMobileSearchOpen(t),t&&this.updateComplete.then(()=>{this.renderRoot.querySelector(".mobile-search-panel .header-search-input")?.focus?.()})},this._onTabClick=t=>{const a=t.currentTarget;if(!a)return;const r=a.tagName.toLowerCase()==="a";if(r&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const s=a.getAttribute("data-index"),o=s!=null?Number(s):0,h=this._getNavItems()[o];if(h?.kind==="dropdown")return;this.activeTab=o;const n=h?.kind==="tab"?h.href??"":"",g=new CustomEvent("tab-change",{detail:{index:o,href:n},bubbles:!0,composed:!0,cancelable:!0}),b=new CustomEvent("tabchange",{detail:{index:o,href:n},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(g)&&this.dispatchEvent(b))&&r&&t.preventDefault()},this._onDropdownTabActivate=t=>{const a=t.detail?.dataIndex,r=typeof a=="number"?a:typeof a=="string"?Number(a):this._readTabIndexFromEvent(t);if(r==null||!Number.isFinite(r))return;const s=this._getNavItems();r<0||r>=s.length||s[r]?.kind==="dropdown"&&(this.activeTab=r,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:r,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=t=>{const a=t.key;if(a!=="ArrowLeft"&&a!=="ArrowRight"&&a!=="Home"&&a!=="End")return;const r=this._getNavItems();if(!r.length)return;const s=this._readTabIndexFromEvent(t);if(s==null)return;let o=Math.max(0,Math.min(r.length-1,s));a==="ArrowRight"?o=(o+1)%r.length:a==="ArrowLeft"?o=(o-1+r.length)%r.length:a==="Home"?o=0:a==="End"&&(o=r.length-1),t.preventDefault(),this._focusTabAtIndex(o)},this._onNativeSearchInput=t=>{const a=t.currentTarget;this._emitSearchInput(a?.value??"")},this._onNativeSearchSubmit=t=>{t.preventDefault();const a=t.currentTarget?.querySelector(".header-search-input");this._emitSearchChange(a?.value??"")},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))},this._onNativeSearchClear=t=>{t.preventDefault(),this._onSearchClear(),this.updateComplete.then(()=>{const a=t.currentTarget?.closest("form")?.querySelector(".header-search-input");a&&(a.value=""),a?.focus()})};const e=++H;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}requestLayout(){this.layoutPending||(this.setAttribute("data-layout-settling",""),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-layout-settling"))}))}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",T.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",T.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(s=>s.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active","role"],t=s=>{const o=new MutationObserver(h=>{this._scheduleHarvest()});this._slotWatchers.push(o),o.observe(s,{attributes:!0,attributeFilter:e})},a=()=>{this._slotWatchers.forEach(o=>o.disconnect()),this._slotWatchers=[];const s=Array.from(this.children);for(const o of s){const h=o.tagName.toLowerCase();if((h==="scb-header-tab"||h==="scb-dropdown"||h==="scb-header-utility"||h==="scb-header-menu-item"||h==="scb-header-menu-group"||h==="scb-badge")&&t(o),h==="scb-badge"){const n=o,g=new MutationObserver(y=>{a(),this._scheduleHarvest()});this._slotWatchers.push(g),g.observe(n,{childList:!0});const b=n.querySelector("scb-dropdown");b&&t(b);continue}if(h==="scb-header-menu-group"){const n=o,g=new MutationObserver(b=>{a(),this._scheduleHarvest()});this._slotWatchers.push(g),g.observe(n,{childList:!0,subtree:!0}),n.querySelectorAll("scb-header-menu-item").forEach(b=>t(b))}}},r=new MutationObserver(s=>{let o=!1;for(const h of s)if(h.type==="childList"){o=!0;break}o&&a(),this._scheduleHarvest()});this._slotMo=r,r.observe(this,{childList:!0}),a()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a+=1){const r=e[a],s=t[a];if(!r||!s||r.kind!==s.kind||r.label!==s.label)return!1;if(r.kind==="tab"&&s.kind==="tab"){if((r.href??"")!==(s.href??""))return!1}else if(r.kind==="dropdown"&&s.kind==="dropdown"&&r.slotName!==s.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a+=1){const r=e[a],s=t[a];if(!r||!s||r.label!==s.label||r.href!==s.href||(r.target??"")!==(s.target??""))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a+=1){const r=e[a],s=t[a];if(!r||!s||r.label!==s.label||(r.href??"")!==(s.href??"")||(r.icon??"")!==(s.icon??"")||!this._sameMenuNodes(r.children??[],s.children??[]))return!1}return!0}_isDrawerCloseNode(e){const t=e.tagName.toLowerCase(),a=e.getAttribute("slot");if(a==="drawer-close")return!0;if(a||t!=="scb-icon-button")return!1;const r=(e.getAttribute("icon")??"").trim().toLowerCase(),s=(e.getAttribute("aria-label")??"").trim().toLowerCase();return r==="close"||s.includes("stäng")||s.includes("close")}_syncDrawerCloseNode(e){e.getAttribute("slot")!=="drawer-close"&&e.setAttribute("slot","drawer-close"),e.setAttribute("data-drawer-close",this._drawerId),e.setAttribute("aria-controls",this._drawerId),this._drawerReady?(e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.hasAttribute("hidden")||e.setAttribute("hidden",""),e.getAttribute("aria-hidden")!=="true"&&e.setAttribute("aria-hidden","true"))}_syncDrawerCloseNodes(){for(const e of Array.from(this.children))this._isDrawerCloseNode(e)&&this._syncDrawerCloseNode(e)}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute("data-mobile-search-open",e))}_num(e,t){const a=Number.parseFloat(String(e??"").trim());return Number.isFinite(a)?a:t}_tokenPx(e,t){const a=getComputedStyle(this);return this._num(a.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){const e=this._tabsNav,t=e?.closest(".tabs-row");if(!e||!t||!this._desktop||!this.showDrawer)return!1;const a=t.querySelector(".menu-trigger--tabs-right"),r=a&&(this.alwaysShowMenuButton||this._collapsed),s=r?a.getBoundingClientRect().width:0,o=r?this._num(getComputedStyle(t).columnGap,0):0,h=t.getBoundingClientRect().width-s-o;return e.getBoundingClientRect().width>h+.5}_setTabsCollapsed(e){if(this._tabsCollapsed===e)return;const t=this._tabsNav;let a=e&&!!t?.contains(this.shadowRoot?.activeElement??null);if(e)for(const r of this._getNavItems()){if(r.kind!=="dropdown")continue;const s=this._getDropdownForSlot(r.slotName);a||(a=s===document.activeElement),s?.removeAttribute("open")}this._tabsCollapsed=e,this.toggleAttribute("data-tabs-collapsed",e),a&&this.updateComplete.then(()=>this._menuBtn?.focus())}_observeLayout(){const e=[this._top,this._tabsNav,this._tabsNav?.closest(".tabs-row"),this._menuBtn].filter(t=>!!t);if(!(e.length===this._observedLayout.length&&e.every((t,a)=>t===this._observedLayout[a]))){this._ro?.disconnect(),this._observedLayout=e;for(const t of e)this._ro?.observe(t,{box:"border-box"})}}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.addEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),this._initialUpgradeComplete||this.setAttribute("data-upgrading",""),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-upgrading"))}))}firstUpdated(){this._syncLandmarkAttributes(),this.renderRoot.addEventListener("focusin",this._onLocalFocusIn),this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()}),this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._observeLayout(),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"380px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"250px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("paddingInline")||e.has("paddingInlineExpanded"))&&this._applyPaddingInline(),(e.has("banner")||e.has("bannerLabel"))&&this._syncLandmarkAttributes(),(e.has("utilityItems")||e.has("_collapsed")||e.has("_tabsCollapsed")||e.has("_desktop")||e.has("_mobileSearchOpen")||e.has("tabs")||e.has("logoText")||e.has("logotypeText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("layoutPending")||e.has("searchMax")||e.has("searchMin")||e.has("paddingInline")||e.has("paddingInlineExpanded")||e.has("size"))&&this.updateComplete.then(()=>{this._observeLayout(),this._scheduleMeasure()}),(e.has("showDrawer")||e.has("deferDrawer"))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has("showSearch")&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has("layoutPending")&&!this.layoutPending&&this.requestLayout(),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._observedLayout=[],this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],this.renderRoot.removeEventListener("focusin",this._onLocalFocusIn),window.removeEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t){if(/^\d+$/.test(t)){const a=Math.max(0,Math.min(14,parseInt(t,10)));return`var(--spacing-${a}, ${I[a]}px)`}return t}}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,a=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty("--scb-header-spacing-block-start",t):this.style.removeProperty("--scb-header-spacing-block-start"),a?this.style.setProperty("--scb-header-spacing-block-end",a):this.style.removeProperty("--scb-header-spacing-block-end")}_applyPaddingInline(){const e=this._mapSpacingToken(this.paddingInline),t=this._mapSpacingToken(this.paddingInlineExpanded)??e;e?this.style.setProperty("--scb-header-padding-inline",e):this.style.removeProperty("--scb-header-padding-inline"),t?this.style.setProperty("--scb-header-padding-inline-expanded",t):this.style.removeProperty("--scb-header-padding-inline-expanded")}_syncLandmarkAttributes(){const e=this.renderRoot.querySelector(".header-landmark");if(!e)return;if(!this.banner){e.removeAttribute("role"),e.removeAttribute("aria-label");return}e.setAttribute("role","banner");const t=(this.bannerLabel??"").trim();t?e.setAttribute("aria-label",t):e.removeAttribute("aria-label")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),t=(this.logoHeight??"").trim(),a=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),t?this.style.setProperty("--scb-header-logo-img-h",t):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),a?this.style.setProperty("--scb-header-logo-img-aspect-ratio",a):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}_ensureFocusRingReady(){customElements.get("md-focus-ring")||(this._focusRingImportPromise??(this._focusRingImportPromise=S(()=>import("../../vendor/lazy-focus-ring.js").then(e=>e.i),__vite__mapDeps([0,1,2]),import.meta.url)),this._focusRingImportPromise.then(({ensureFocusRingReady:e})=>{e()}))}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??(this._drawerImportPromise=Promise.all([S(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([3,4,5,6,7,8,9,10]),import.meta.url),S(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([11,4,5,6,9,10,8,12,2,13,14,15]),import.meta.url),S(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([16,4,5,17,1,18,19,2,0,20,21,6,7]),import.meta.url),S(()=>import("../../vendor/scb-header-drawer.internal.js").then(e=>{this._drawerRenderer=e}),__vite__mapDeps([22,4,5]),import.meta.url),this._ensureDrawerSlotComponentsReady()]).then(()=>{})),await this._drawerImportPromise,this._drawerReady=!0,this._syncDrawerCloseNodes())}_drawerSlotContains(e){return[...this.querySelectorAll('[slot="drawer-menu"], [slot="drawer-close"]')].some(t=>t.matches(e)||!!t.querySelector(e))}async _ensureDrawerSlotComponentsReady(){this.querySelector('[slot="drawer-menu"], [slot="drawer-close"]')&&await Promise.all([this._drawerSlotContains("scb-button")?S(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([23,4,5,2,21,6,9,10]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-icon-button")?S(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([24,4,5,2,21,6,9,10]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-skeleton")?S(()=>import("../scb-skeleton/scb-skeleton.js"),__vite__mapDeps([25,4,5,6]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid")?S(()=>import("../scb-grid/scb-grid.js"),__vite__mapDeps([26,4,5,6,9,10,27,28]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid-item")?S(()=>import("../scb-grid/scb-grid-item.js"),__vite__mapDeps([27,4,5,6,9,10]),import.meta.url):Promise.resolve()])}async _ensureDropdownReady(){customElements.get("scb-dropdown")||(this._dropdownImportPromise??(this._dropdownImportPromise=S(()=>import("../scb-dropdown/scb-dropdown.js").then(()=>{}),__vite__mapDeps([29,4,5,17,1,0,2,21,6,13,23,9,10,7,30,31,18,19,8,32]),import.meta.url)),await this._dropdownImportPromise)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(".menu-trigger").forEach(e=>{e.setAttribute("aria-expanded",String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()==="scb-dropdown"?t:t.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!=="dropdown")return;const a=this._getDropdownForSlot(e.slotName);if(!a)return;const r=String(t);a.getAttribute("data-index")!==r&&a.setAttribute("data-index",r),a.hasAttribute("as-tab")||a.setAttribute("as-tab","");const s=this.size,o=a;o?.size!==s&&(o.size=s),t===this.activeTab?a.getAttribute("aria-current")!=="page"&&a.setAttribute("aria-current","page"):a.hasAttribute("aria-current")&&a.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const a of t){if(!(a instanceof HTMLElement))continue;const r=a.getAttribute("data-index");if(r==null)continue;const s=Number(r);if(Number.isFinite(s))return s}return null}_focusTabAtIndex(e){const t=this._getNavItems()[e];if(t){if(t.kind==="dropdown"){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}_emitSearchInput(e){this.searchText=e,this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))}_emitSearchChange(e,t){this.searchText=e,this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0}))}_renderMenuButton(e="",t=!1){const a=e?`menu-trigger ${e}`:"menu-trigger",r=(this.menuButtonLabel??"").trim(),s=(this.menuOpenLabel??"").trim()||r,o=this._menuExpanded?"true":"false";return t?v`
55
+ `,document.head.appendChild(u);const e=n=>{const g=String(n??"").trim();if(g){if(/^\d+$/.test(g)){const b=Math.max(0,Math.min(14,parseInt(g,10)));return`var(--spacing-${b}, ${I[b]}px)`}return g}},t=n=>{const g=String(n??"").trim();if(!g)return!1;try{const b=JSON.parse(g);return Array.isArray(b)&&b.length>0}catch{return!1}},a=n=>n!=null&&!/^(false|0|off|no)$/i.test(n.trim()),r=n=>{for(const g of Array.from(n.children)){const b=g.tagName.toLowerCase();if(b==="scb-header-tab"||b==="scb-dropdown")return!0}return!1},s=n=>{r(n)||t(n.getAttribute("tabs"))||a(n.getAttribute("reserve-tabs"))||a(n.getAttribute("layout-pending"))?n.setAttribute("data-pre-has-tabs",""):n.removeAttribute("data-pre-has-tabs");const g=e(n.getAttribute("spacing")),b=e(n.getAttribute("spacing-top"))??g,y=e(n.getAttribute("spacing-bottom"))??g,x=e(n.getAttribute("padding-inline")),k=e(n.getAttribute("padding-inline-expanded"))??x;b?n.style.setProperty("--scb-header-spacing-block-start",b):n.style.removeProperty("--scb-header-spacing-block-start"),y?n.style.setProperty("--scb-header-spacing-block-end",y):n.style.removeProperty("--scb-header-spacing-block-end"),x?n.style.setProperty("--scb-header-padding-inline",x):n.style.removeProperty("--scb-header-padding-inline"),k?n.style.setProperty("--scb-header-padding-inline-expanded",k):n.style.removeProperty("--scb-header-padding-inline-expanded");const d=(n.getAttribute("logo-width")??"").trim();d?n.style.setProperty("--scb-header-pre-logo-w",d):n.style.removeProperty("--scb-header-pre-logo-w");const f=(n.getAttribute("logo-height")??"").trim();f?n.style.setProperty("--scb-header-pre-logo-img-h",f):n.style.removeProperty("--scb-header-pre-logo-img-h");const m=(n.getAttribute("search-height")??"").trim();m?n.style.setProperty("--scb-header-pre-control-size",m):n.style.removeProperty("--scb-header-pre-control-size")};document.querySelectorAll("scb-header").forEach(s);const h=new MutationObserver(n=>{for(const g of n){if(g.type==="attributes"){const b=g.target;b instanceof HTMLElement&&b.tagName.toLowerCase()==="scb-header"&&s(b);continue}if(g.type==="childList"){const b=[...Array.from(g.addedNodes),...Array.from(g.removedNodes)];for(const y of b){if(!(y instanceof HTMLElement))continue;if(y.tagName.toLowerCase()==="scb-header"){s(y);continue}const x=y.closest?.("scb-header");x&&s(x)}}}});h.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabs","spacing","spacing-top","spacing-bottom","padding-inline","padding-inline-expanded","logo-width","logo-height","logo-aspect-ratio","logo-alt","logotype-text","search-height","reserve-tabs","layout-pending"]}),customElements.whenDefined("scb-header").then(()=>{h.disconnect()})};W();var P={fromAttribute:u=>u==null?!0:!/^(false|0|off|no)$/i.test(u),toAttribute:u=>String(!!u)},L={fromAttribute:u=>u==null?!1:!/^(false|0|off|no)$/i.test(u),toAttribute:u=>u?"":null},F={fromAttribute:u=>u==="small"||u==="medium"||u==="large"?u:"medium",toAttribute:u=>{const e=String(u??"");return e==="small"||e==="medium"||e==="large"?e:null}},i=(C=class extends R{constructor(){super(),this.maxWidth="1440px",this.size=B["scb-header"].size,this.logoText="",this.logotypeText="",this.logoAlt="",this.logoHref="/",this.logoSrc="",this.logoWidth="",this.logoHeight="",this.logoAspectRatio="",this.logoInvertDm=!1,this.banner=!1,this.tabs=[],this.activeTab=null,this.reserveTabs=!1,this.layoutPending=!1,this.utilityItems=[],this.searchButtonLabel="Sök",this.searchClearLabel="Rensa sökfält",this.searchCloseLabel="Stäng sök",this.menuButtonLabel="Meny",this.menuOpenLabel="Öppna meny",this.utilityNavigationLabel="Funktionslänkar",this.mainNavigationLabel="Huvudnavigering",this.deferDrawer=!1,this.showDrawer=!0,this.alwaysShowMenuButton=!1,this.showSearch=!0,this.includeUtilityInMenu=!1,this.drawerOverlay=!0,this.searchText="",this._drawerId="main-drawer",this._menuExpanded=!1,this._searchId="header-search",this._drawerReady=!1,this._mobileSearchOpen=!1,this._initialUpgradeComplete=!1,this._slotNavItems=[],this._slotUtils=[],this._slotMenu=[],this._observedLayout=[],this._measureScheduled=!1,this._scheduleMeasure=()=>{this.layoutPending||this._measureScheduled||(this._measureScheduled=!0,requestAnimationFrame(()=>{this._measureScheduled=!1,this._measure()}))},this._onWindowResize=()=>{window.innerWidth>=this.BP_SM&&this._mobileSearchOpen&&this._setMobileSearchOpen(!1),this._scheduleMeasure()},this._onMenuSelect=t=>{t.stopPropagation();const a=t.detail;this.dispatchEvent(new CustomEvent("scb-menu-select",{detail:a,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbmenuselect",{detail:a,bubbles:!0,composed:!0}));const r=a?.item,s=typeof a?.href=="string"?a.href:typeof a?.itemHref=="string"?a.itemHref:typeof a?.item_href=="string"?a.item_href:"",o=r?r.getAttribute("item-href")??r.getAttribute("href")??"":"";String(s||o||"").trim()&&this._closeDrawerNow()},this._onMenuSelectAlias=t=>{t.stopPropagation()},this._collapsed=!1,this._unlockAtWidth=0,this._tabsCollapsed=!1,this._desktop=typeof window<"u"&&window.innerWidth>=T.BP_MD_DEFAULT,this._hideLogoText=!1,this._slotWatchers=[],this._harvestPending=!1,this._harvest=(t={})=>{const a=Array.from(this.children),r=[],s=[],o=[];let h=-1,n=!1;const g=d=>({label:d.getAttribute("label")??"",href:d.getAttribute("href")??void 0,icon:d.getAttribute("icon")??void 0}),b=d=>{d.hasAttribute("role")&&d.removeAttribute("role"),d.hasAttribute("hidden")||d.setAttribute("hidden",""),d.getAttribute("aria-hidden")!=="true"&&d.setAttribute("aria-hidden","true")};for(const d of a){const f=d.tagName.toLowerCase();if(this._isDrawerCloseNode(d)){this._syncDrawerCloseNode(d);continue}if(f==="scb-header-tab"){b(d);const m=d.getAttribute("label")??"",p=d.getAttribute("href"),A=p&&p.trim()!==""?p:void 0;(d.hasAttribute("selected")||d.getAttribute("selected")==="true"||d.getAttribute("active")==="true"||d.getAttribute("aria-current")==="page")&&h===-1&&(h=r.length),r.push({kind:"tab",label:m,href:A});continue}if(f==="scb-badge"){const m=d.querySelector("scb-dropdown");if(m){n=!0;const p=m.getAttribute("label")??"";(m.hasAttribute("selected")||m.getAttribute("selected")==="true"||m.getAttribute("active")==="true"||m.getAttribute("aria-current")==="page")&&h===-1&&(h=r.length);const A=`scb-header-tab-${r.length}`;d.getAttribute("slot")!==A&&d.setAttribute("slot",A),m.hasAttribute("slot")&&m.removeAttribute("slot"),m.hasAttribute("as-tab")||m.setAttribute("as-tab",""),r.push({kind:"dropdown",slotName:A,label:p});continue}}if(f==="scb-dropdown"){n=!0;const m=d.getAttribute("label")??"";(d.hasAttribute("selected")||d.getAttribute("selected")==="true"||d.getAttribute("active")==="true"||d.getAttribute("aria-current")==="page")&&h===-1&&(h=r.length);const p=`scb-header-tab-${r.length}`;d.getAttribute("slot")!==p&&d.setAttribute("slot",p),d.hasAttribute("as-tab")||d.setAttribute("as-tab",""),r.push({kind:"dropdown",slotName:p,label:m});continue}if(f==="scb-header-utility"){b(d),s.push({label:d.getAttribute("label")??"",href:d.getAttribute("href")??"#",target:d.getAttribute("target")??void 0});continue}if(f==="scb-header-menu-group"){b(d);const m={label:d.getAttribute("label")??"",icon:d.getAttribute("icon")??void 0,children:[]};d.querySelectorAll("scb-header-menu-item").forEach(p=>m.children.push(g(p))),o.push(m);continue}if(f==="scb-header-menu-item"){b(d),o.push(g(d));continue}d.hasAttribute("slot")||b(d)}const y=!this._sameNavItems(this._slotNavItems,r),x=!this._sameUtilityItems(this._slotUtils,s),k=!this._sameMenuNodes(this._slotMenu,o);y&&(this._slotNavItems=r),x&&(this._slotUtils=s),k&&(this._slotMenu=o),n&&this._ensureDropdownReady(),!this.hasAttribute("active-tab")&&h>=0&&this.activeTab!==h&&(this.activeTab=h),(t.scheduleMeasure??!0)&&queueMicrotask(()=>{this.updateComplete.then(()=>{this._scheduleMeasure()})})},this._measure=()=>{if(this.layoutPending)return;const t=this._top,a=this._logoGroup;if(!t||!a)return;const r=window.innerWidth;this._desktop=r>=this.BP_MD;const s=t.clientWidth,o=this._overflows(this._util),h=!this._desktop||o;this._collapsed?!h&&s>=this._unlockAtWidth&&this._setCollapsed(!1):h&&(this._unlockAtWidth=s+this._HYST,this._setCollapsed(!0)),this._setTabsCollapsed(this._tabsOverflows());let n=!1;if(this.showSearch&&r>=this.BP_SM&&r<this.BP_MD&&this._searchWrap){const x=getComputedStyle(this._searchWrap),k=Math.max(this._num(x.minWidth,this._tokenPx("--scb-header-search-min",250)),this._tokenPx("--scb-header-search-min",250)),d=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),f=this.showDrawer&&(this.alwaysShowMenuButton||r<this.BP_MD||this._collapsed)?this._menuBtn?.getBoundingClientRect().width||this._tokenPx("--icon-size-extra-extra-large",48):0;n=a.getBoundingClientRect().width+d+k+d+f+8>s+.5}this._setHideSearch(n);let g=!1;const b=this.renderRoot.querySelector(".actions"),y=Array.from(b?.querySelectorAll(".header-icon-button")??[]).filter(x=>this._visible(x));if(y.length>0&&!this._visible(this._util)&&!this._visible(this._searchWrap)){const x=this._num(getComputedStyle(t).gap,this._tokenPx("--spacing-7",24)),k=b?this._num(getComputedStyle(b).columnGap,0):0,d=y.reduce((m,p)=>m+p.getBoundingClientRect().width,0)+k*Math.max(0,y.length-1);this._hideLogoText&&this.removeAttribute("data-hide-logo-text");const f=a.getBoundingClientRect().width;this._hideLogoText&&this.setAttribute("data-hide-logo-text",""),g=f+x+d+(this._hideLogoText?this._HYST:0)>s+.5}this._setHideLogoText(g)},this._onGlobalFocusRingKeydown=t=>{t.key==="Tab"&&(this.toggleAttribute("data-keyboard-focus",!0),this._ensureFocusRingReady())},this._onGlobalFocusRingPointerDown=()=>{this.removeAttribute("data-keyboard-focus")},this._onLocalFocusIn=t=>{const a=t.composedPath()[0];a instanceof HTMLElement&&a.matches(":focus-visible")&&this._ensureFocusRingReady()},this._onDrawerOpened=()=>{this._menuExpanded=!0,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("draweropen",{bubbles:!0,composed:!0}))},this._onDrawerClosed=()=>{this._menuExpanded=!1,this._syncMenuBtnAria(),this.dispatchEvent(new CustomEvent("drawer-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("drawerclose",{bubbles:!0,composed:!0}))},this._onMenuClick=async t=>{this.showDrawer&&(this._setMobileSearchOpen(!1),this.dispatchEvent(new CustomEvent("menu-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("menuclick",{bubbles:!0,composed:!0})),!this._drawerReady&&(t.stopPropagation(),await this._ensureDrawerReady(),await this.updateComplete,this._openDrawerNow()))},this._onMobileSearchToggle=()=>{const t=!this._mobileSearchOpen;this._setMobileSearchOpen(t),t&&this.updateComplete.then(()=>{this.renderRoot.querySelector(".mobile-search-panel .header-search-input")?.focus?.()})},this._onTabClick=t=>{const a=t.currentTarget;if(!a)return;const r=a.tagName.toLowerCase()==="a";if(r&&(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey))return;const s=a.getAttribute("data-index"),o=s!=null?Number(s):0,h=this._getNavItems()[o];if(h?.kind==="dropdown")return;this.activeTab=o;const n=h?.kind==="tab"?h.href??"":"",g=new CustomEvent("tab-change",{detail:{index:o,href:n},bubbles:!0,composed:!0,cancelable:!0}),b=new CustomEvent("tabchange",{detail:{index:o,href:n},bubbles:!0,composed:!0,cancelable:!0});!(this.dispatchEvent(g)&&this.dispatchEvent(b))&&r&&t.preventDefault()},this._onDropdownTabActivate=t=>{const a=t.detail?.dataIndex,r=typeof a=="number"?a:typeof a=="string"?Number(a):this._readTabIndexFromEvent(t);if(r==null||!Number.isFinite(r))return;const s=this._getNavItems();r<0||r>=s.length||s[r]?.kind==="dropdown"&&(this.activeTab=r,this.dispatchEvent(new CustomEvent("tab-change",{detail:{index:r,href:""},bubbles:!0,composed:!0,cancelable:!0})),this.dispatchEvent(new CustomEvent("tabchange",{detail:{index:r,href:""},bubbles:!0,composed:!0,cancelable:!0})))},this._onTabsKeydown=t=>{const a=t.key;if(a!=="ArrowLeft"&&a!=="ArrowRight"&&a!=="Home"&&a!=="End")return;const r=this._getNavItems();if(!r.length)return;const s=this._readTabIndexFromEvent(t);if(s==null)return;let o=Math.max(0,Math.min(r.length-1,s));a==="ArrowRight"?o=(o+1)%r.length:a==="ArrowLeft"?o=(o-1+r.length)%r.length:a==="Home"?o=0:a==="End"&&(o=r.length-1),t.preventDefault(),this._focusTabAtIndex(o)},this._onNativeSearchInput=t=>{const a=t.currentTarget;this._emitSearchInput(a?.value??"")},this._onNativeSearchSubmit=t=>{t.preventDefault();const a=t.currentTarget?.querySelector(".header-search-input");this._emitSearchChange(a?.value??"")},this._onSearchClear=()=>{this.searchText="",this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:""},bubbles:!0,composed:!0}))},this._onNativeSearchClear=t=>{t.preventDefault(),this._onSearchClear(),this.updateComplete.then(()=>{const a=t.currentTarget?.closest("form")?.querySelector(".header-search-input");a&&(a.value=""),a?.focus()})};const e=++H;this._drawerId=`scb-header-drawer-${e}`,this._searchId=`scb-header-search-${e}`}requestLayout(){this.layoutPending||(this.setAttribute("data-layout-settling",""),this.updateComplete.then(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-layout-settling"))}))}get _HYST(){return this._tokenPx("--spacing-11",64)}get BP_SM(){return this._tokenPx("--bp-sm",T.BP_SM_DEFAULT)}get BP_MD(){return this._tokenPx("--bp-md",T.BP_MD_DEFAULT)}_scheduleHarvest(){this._harvestPending||(this._harvestPending=!0,queueMicrotask(()=>{this._harvestPending=!1,this._harvest()}))}get _top(){return this.renderRoot.querySelector(".top-row")}get _util(){return this.renderRoot.querySelector(".utility")}get _logoGroup(){return this.renderRoot.querySelector(".logo-wrap")||this.renderRoot.querySelector(".logo-group")}get _searchWrap(){return this.renderRoot.querySelector(".search")}get _menuBtn(){return this.renderRoot.querySelector(".menu-trigger")}get _tabsNav(){return this.renderRoot.querySelector(".tabs-nav")}_attachSlotObservers(){this._slotMo?.disconnect(),this._slotWatchers.forEach(s=>s.disconnect()),this._slotWatchers=[];const e=["label","href","icon","target","selected","aria-current","active","role"],t=s=>{const o=new MutationObserver(h=>{this._scheduleHarvest()});this._slotWatchers.push(o),o.observe(s,{attributes:!0,attributeFilter:e})},a=()=>{this._slotWatchers.forEach(o=>o.disconnect()),this._slotWatchers=[];const s=Array.from(this.children);for(const o of s){const h=o.tagName.toLowerCase();if((h==="scb-header-tab"||h==="scb-dropdown"||h==="scb-header-utility"||h==="scb-header-menu-item"||h==="scb-header-menu-group"||h==="scb-badge")&&t(o),h==="scb-badge"){const n=o,g=new MutationObserver(y=>{a(),this._scheduleHarvest()});this._slotWatchers.push(g),g.observe(n,{childList:!0});const b=n.querySelector("scb-dropdown");b&&t(b);continue}if(h==="scb-header-menu-group"){const n=o,g=new MutationObserver(b=>{a(),this._scheduleHarvest()});this._slotWatchers.push(g),g.observe(n,{childList:!0,subtree:!0}),n.querySelectorAll("scb-header-menu-item").forEach(b=>t(b))}}},r=new MutationObserver(s=>{let o=!1;for(const h of s)if(h.type==="childList"){o=!0;break}o&&a(),this._scheduleHarvest()});this._slotMo=r,r.observe(this,{childList:!0}),a()}_sameNavItems(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a+=1){const r=e[a],s=t[a];if(!r||!s||r.kind!==s.kind||r.label!==s.label)return!1;if(r.kind==="tab"&&s.kind==="tab"){if((r.href??"")!==(s.href??""))return!1}else if(r.kind==="dropdown"&&s.kind==="dropdown"&&r.slotName!==s.slotName)return!1}return!0}_sameUtilityItems(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a+=1){const r=e[a],s=t[a];if(!r||!s||r.label!==s.label||r.href!==s.href||(r.target??"")!==(s.target??""))return!1}return!0}_sameMenuNodes(e,t){if(e.length!==t.length)return!1;for(let a=0;a<e.length;a+=1){const r=e[a],s=t[a];if(!r||!s||r.label!==s.label||(r.href??"")!==(s.href??"")||(r.icon??"")!==(s.icon??"")||!this._sameMenuNodes(r.children??[],s.children??[]))return!1}return!0}_isDrawerCloseNode(e){const t=e.tagName.toLowerCase(),a=e.getAttribute("slot");if(a==="drawer-close")return!0;if(a||t!=="scb-icon-button")return!1;const r=(e.getAttribute("icon")??"").trim().toLowerCase(),s=(e.getAttribute("aria-label")??"").trim().toLowerCase();return r==="close"||s.includes("stäng")||s.includes("close")}_syncDrawerCloseNode(e){e.getAttribute("slot")!=="drawer-close"&&e.setAttribute("slot","drawer-close"),e.setAttribute("data-drawer-close",this._drawerId),e.setAttribute("aria-controls",this._drawerId),this._drawerReady?(e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.hasAttribute("hidden")||e.setAttribute("hidden",""),e.getAttribute("aria-hidden")!=="true"&&e.setAttribute("aria-hidden","true"))}_syncDrawerCloseNodes(){for(const e of Array.from(this.children))this._isDrawerCloseNode(e)&&this._syncDrawerCloseNode(e)}_setCollapsed(e){this._collapsed!==e&&(this._collapsed=e,e?this.setAttribute("data-collapsed",""):this.removeAttribute("data-collapsed"))}_setHideSearch(e){e?this.setAttribute("data-hide-search",""):this.removeAttribute("data-hide-search")}_setHideLogoText(e){this._hideLogoText!==e&&(this._hideLogoText=e,e?this.setAttribute("data-hide-logo-text",""):this.removeAttribute("data-hide-logo-text"))}_setMobileSearchOpen(e){this._mobileSearchOpen!==e&&(this._mobileSearchOpen=e,this.toggleAttribute("data-mobile-search-open",e))}_num(e,t){const a=Number.parseFloat(String(e??"").trim());return Number.isFinite(a)?a:t}_tokenPx(e,t){const a=getComputedStyle(this);return this._num(a.getPropertyValue(e),t)}_visible(e){return e?getComputedStyle(e).display!=="none":!1}_overflows(e){return!e||!this._visible(e)?!1:e.scrollWidth>e.clientWidth+1}_tabsOverflows(){const e=this._tabsNav,t=e?.closest(".tabs-row");if(!e||!t||!this._desktop||!this.showDrawer)return!1;const a=t.querySelector(".menu-trigger--tabs-right"),r=a&&(this.alwaysShowMenuButton||this._collapsed),s=r?a.getBoundingClientRect().width:0,o=r?this._num(getComputedStyle(t).columnGap,0):0,h=t.getBoundingClientRect().width-s-o;return e.getBoundingClientRect().width>h+.5}_setTabsCollapsed(e){if(this._tabsCollapsed===e)return;const t=this._tabsNav;let a=e&&!!t?.contains(this.shadowRoot?.activeElement??null);if(e)for(const r of this._getNavItems()){if(r.kind!=="dropdown")continue;const s=this._getDropdownForSlot(r.slotName);a||(a=s===document.activeElement),s?.removeAttribute("open")}this._tabsCollapsed=e,this.toggleAttribute("data-tabs-collapsed",e),a&&this.updateComplete.then(()=>this._menuBtn?.focus())}_observeLayout(){const e=[this._top,this._tabsNav,this._tabsNav?.closest(".tabs-row"),this._menuBtn].filter(t=>!!t);if(!(e.length===this._observedLayout.length&&e.every((t,a)=>t===this._observedLayout[a]))){this._ro?.disconnect(),this._observedLayout=e;for(const t of e)this._ro?.observe(t,{box:"border-box"})}}connectedCallback(){super.connectedCallback(),window.addEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.addEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),this._initialUpgradeComplete||this.setAttribute("data-upgrading",""),this._harvest({scheduleMeasure:!1}),this._attachSlotObservers()}_finishInitialUpgrade(){this._initialUpgradeComplete||(this._initialUpgradeComplete=!0,requestAnimationFrame(()=>{this.isConnected&&(this._measure(),this.removeAttribute("data-upgrading"))}))}firstUpdated(){this._syncLandmarkAttributes(),this.renderRoot.addEventListener("focusin",this._onLocalFocusIn),this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),this.updateComplete.then(()=>{this._harvest({scheduleMeasure:!1}),this._attachSlotObservers(),this._syncDropdownTabs(),this._finishInitialUpgrade()}),this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._observeLayout(),window.addEventListener("resize",this._onWindowResize,{passive:!0})}updated(e){e.has("searchMax")&&this.style.setProperty("--scb-header-search-max",this.searchMax??"380px"),e.has("searchMin")&&this.style.setProperty("--scb-header-search-min",this.searchMin??"250px"),e.has("searchHeight")&&(this.searchHeight&&this.searchHeight.trim()?this.style.setProperty("--scb-search-height",this.searchHeight.trim()):this.style.removeProperty("--scb-search-height")),(e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio"))&&this._applyLogoSizing(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom"))&&this._applySpacing(),(e.has("paddingInline")||e.has("paddingInlineExpanded"))&&this._applyPaddingInline(),(e.has("banner")||e.has("bannerLabel"))&&this._syncLandmarkAttributes(),(e.has("utilityItems")||e.has("_collapsed")||e.has("_tabsCollapsed")||e.has("_desktop")||e.has("_mobileSearchOpen")||e.has("tabs")||e.has("logoText")||e.has("logotypeText")||e.has("logoSrc")||e.has("logoWidth")||e.has("logoHeight")||e.has("logoAspectRatio")||e.has("activeTab")||e.has("_slotNavItems")||e.has("_slotUtils")||e.has("_slotMenu")||e.has("showDrawer")||e.has("alwaysShowMenuButton")||e.has("showSearch")||e.has("layoutPending")||e.has("searchMax")||e.has("searchMin")||e.has("paddingInline")||e.has("paddingInlineExpanded")||e.has("size"))&&this.updateComplete.then(()=>{this._observeLayout(),this._scheduleMeasure()}),(e.has("showDrawer")||e.has("deferDrawer"))&&this.showDrawer&&!this.deferDrawer&&this._ensureDrawerReady(),e.has("showSearch")&&!this.showSearch&&this._setMobileSearchOpen(!1),e.has("layoutPending")&&!this.layoutPending&&this.requestLayout(),(e.has("activeTab")||e.has("_slotNavItems")||e.has("tabs")||e.has("size"))&&this.updateComplete.then(()=>{this._syncDropdownTabs()})}disconnectedCallback(){this._ro?.disconnect(),this._observedLayout=[],this._slotMo?.disconnect(),this._slotWatchers.forEach(e=>e.disconnect()),this._slotWatchers=[],this.renderRoot.removeEventListener("focusin",this._onLocalFocusIn),window.removeEventListener("keydown",this._onGlobalFocusRingKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalFocusRingPointerDown,!0),window.removeEventListener("resize",this._onWindowResize),super.disconnectedCallback()}_mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t){if(/^\d+$/.test(t)){const a=Math.max(0,Math.min(14,parseInt(t,10)));return`var(--spacing-${a}, ${I[a]}px)`}return t}}_applySpacing(){const e=this._mapSpacingToken(this.spacing),t=this._mapSpacingToken(this.spacingTop)??e,a=this._mapSpacingToken(this.spacingBottom)??e;t?this.style.setProperty("--scb-header-spacing-block-start",t):this.style.removeProperty("--scb-header-spacing-block-start"),a?this.style.setProperty("--scb-header-spacing-block-end",a):this.style.removeProperty("--scb-header-spacing-block-end")}_applyPaddingInline(){const e=this._mapSpacingToken(this.paddingInline),t=this._mapSpacingToken(this.paddingInlineExpanded)??e;e?this.style.setProperty("--scb-header-padding-inline",e):this.style.removeProperty("--scb-header-padding-inline"),t?this.style.setProperty("--scb-header-padding-inline-expanded",t):this.style.removeProperty("--scb-header-padding-inline-expanded")}_syncLandmarkAttributes(){const e=this.renderRoot.querySelector(".header-landmark");if(!e)return;if(!this.banner){e.removeAttribute("role"),e.removeAttribute("aria-label");return}e.setAttribute("role","banner");const t=(this.bannerLabel??"").trim();t?e.setAttribute("aria-label",t):e.removeAttribute("aria-label")}_applyLogoSizing(){const e=(this.logoWidth??"").trim(),t=(this.logoHeight??"").trim(),a=(this.logoAspectRatio??"").trim();e?this.style.setProperty("--scb-header-logo-img-w",e):this.style.removeProperty("--scb-header-logo-img-w"),t?this.style.setProperty("--scb-header-logo-img-h",t):e?this.style.setProperty("--scb-header-logo-img-h","auto"):this.style.removeProperty("--scb-header-logo-img-h"),a?this.style.setProperty("--scb-header-logo-img-aspect-ratio",a):this.style.removeProperty("--scb-header-logo-img-aspect-ratio")}_closeDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!1)}_openDrawerNow(){const e=this.renderRoot.querySelector(`#${this._drawerId}`);e&&(e.open=!0)}_ensureFocusRingReady(){customElements.get("md-focus-ring")||(this._focusRingImportPromise??(this._focusRingImportPromise=S(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),this._focusRingImportPromise.then(({ensureFocusRingReady:e})=>{e()}))}async _ensureDrawerReady(){this._drawerReady||(this._drawerImportPromise??(this._drawerImportPromise=Promise.all([S(()=>import("../scb-drawer/scb-drawer.js"),__vite__mapDeps([2,3,4,5,6,7,8,9]),import.meta.url),S(()=>import("../scb-menu/scb-menu.js"),__vite__mapDeps([10,3,4,5,8,9,7,11,1,12,13,14]),import.meta.url),S(()=>import("../scb-search/scb-search.js"),__vite__mapDeps([15,3,4,16,17,18,19,1,0,20,21,5,6]),import.meta.url),S(()=>import("../../vendor/scb-header-drawer.internal.js").then(e=>{this._drawerRenderer=e}),__vite__mapDeps([22,3,4]),import.meta.url),this._ensureDrawerSlotComponentsReady()]).then(()=>{})),await this._drawerImportPromise,this._drawerReady=!0,this._syncDrawerCloseNodes())}_drawerSlotContains(e){return[...this.querySelectorAll('[slot="drawer-menu"], [slot="drawer-close"]')].some(t=>t.matches(e)||!!t.querySelector(e))}async _ensureDrawerSlotComponentsReady(){this.querySelector('[slot="drawer-menu"], [slot="drawer-close"]')&&await Promise.all([this._drawerSlotContains("scb-button")?S(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([23,3,4,1,21,5,8,9]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-icon-button")?S(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([24,3,4,1,21,5,8,9]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-skeleton")?S(()=>import("../scb-skeleton/scb-skeleton.js"),__vite__mapDeps([25,3,4,5]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid")?S(()=>import("../scb-grid/scb-grid.js"),__vite__mapDeps([26,3,4,5,8,9,27,28]),import.meta.url):Promise.resolve(),this._drawerSlotContains("scb-grid-item")?S(()=>import("../scb-grid/scb-grid-item.js"),__vite__mapDeps([27,3,4,5,8,9]),import.meta.url):Promise.resolve()])}async _ensureDropdownReady(){customElements.get("scb-dropdown")||(this._dropdownImportPromise??(this._dropdownImportPromise=S(()=>import("../scb-dropdown/scb-dropdown.js").then(()=>{}),__vite__mapDeps([29,3,4,16,17,0,1,21,5,12,23,8,9,6,30,31,18,19,7,32]),import.meta.url)),await this._dropdownImportPromise)}_syncMenuBtnAria(){this.renderRoot.querySelectorAll(".menu-trigger").forEach(e=>{e.setAttribute("aria-expanded",String(this._menuExpanded))})}_getNavItems(){return this._slotNavItems.length?this._slotNavItems:(this.tabs??[]).map(e=>({kind:"tab",...e}))}_getDropdownForSlot(e){const t=this.querySelector(`[slot="${e}"]`);return t?t.tagName.toLowerCase()==="scb-dropdown"?t:t.querySelector("scb-dropdown"):null}_syncDropdownTabs(){this._getNavItems().forEach((e,t)=>{if(e.kind!=="dropdown")return;const a=this._getDropdownForSlot(e.slotName);if(!a)return;const r=String(t);a.getAttribute("data-index")!==r&&a.setAttribute("data-index",r),a.hasAttribute("as-tab")||a.setAttribute("as-tab","");const s=this.size,o=a;o?.size!==s&&(o.size=s),t===this.activeTab?a.getAttribute("aria-current")!=="page"&&a.setAttribute("aria-current","page"):a.hasAttribute("aria-current")&&a.removeAttribute("aria-current")})}_readTabIndexFromEvent(e){const t=e.composedPath?e.composedPath():[];for(const a of t){if(!(a instanceof HTMLElement))continue;const r=a.getAttribute("data-index");if(r==null)continue;const s=Number(r);if(Number.isFinite(s))return s}return null}_focusTabAtIndex(e){const t=this._getNavItems()[e];if(t){if(t.kind==="dropdown"){this._getDropdownForSlot(t.slotName)?.focus?.();return}this.renderRoot.querySelector(`.tab-link[data-index="${e}"]`)?.focus?.()}}_syncFlags(e,t){this.toggleAttribute("data-no-utility",e),this.toggleAttribute("data-no-search",t)}_emitSearchInput(e){this.searchText=e,this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchinput",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("search-text-change",{detail:{value:this.searchText},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchtextchange",{detail:{value:this.searchText},bubbles:!0,composed:!0}))}_emitSearchChange(e,t){this.searchText=e,this.dispatchEvent(new CustomEvent("search-change",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("searchchange",{detail:{value:this.searchText,active:t},bubbles:!0,composed:!0}))}_renderMenuButton(e="",t=!1){const a=e?`menu-trigger ${e}`:"menu-trigger",r=(this.menuButtonLabel??"").trim(),s=(this.menuOpenLabel??"").trim()||r,o=this._menuExpanded?"true":"false";return t?v`
56
56
  <button
57
57
  type="button"
58
58
  class=${`${a} header-icon-button`}
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
2
- import{f,h as m,m as v,p as e,v as c,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as z}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";import{t as d}from"../../vendor/scb-icon-svg.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(t,l,i){try{customElements.get(t)||o(t,l,i)}catch(a){var n=String(a||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var p,b;function u(){return b??(b=z(()=>import("../../vendor/lazy-focus-ring.js").then(h=>h.i),__vite__mapDeps([0,1,2]),import.meta.url)),b}var r=(p=class extends m{constructor(...o){super(...o),this.variant="standard",this.width="100%",this.showScrollbar=!1,this.rightScrollButtonLabel="Scrolla höger",this.leftScrollButtonLabel="Scrolla vänster",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.contentFlex=!1,this.internalGap="",this.snap=!1,this._canScrollLeft=!1,this._canScrollRight=!1,this.__scrollLeft=()=>{this.doScrollBy(-this.getScrollStep())},this.__scrollRight=()=>{this.doScrollBy(this.getScrollStep())},this.updateScrollButtons=()=>{const t=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t){this._canScrollLeft=!1,this._canScrollRight=!1,this.toggleAttribute("data-scroll-left",!1),this.toggleAttribute("data-scroll-right",!1);return}const l=t.scrollLeft>0,i=t.scrollLeft+t.clientWidth<t.scrollWidth-1;this._canScrollLeft=l,this._canScrollRight=i,this.toggleAttribute("data-scroll-left",l),this.toggleAttribute("data-scroll-right",i)},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.scrollerEl=null,this.slotEl=null,this.sizeObserver=null,this.resizeRaf=null,this.__onFocusIn=()=>{u().then(({ensureFocusRingReady:t})=>t())},this.__onLazyFocusRingKeydown=t=>{!(t instanceof KeyboardEvent)||t.key!=="Tab"||u().then(({ensureFocusRingOnTab:l})=>l(t))},this.handleScroll=()=>{const t=this.scrollerEl;t&&(this.updateScrollButtons(),this.dispatchCustomEventWithAlias("scb-scroll",{scrollLeft:t.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEventWithAlias("scb-scroll-start",{scrollLeft:t.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEventWithAlias("scb-scroll-end",{scrollLeft:t.scrollLeft})},120),t.scrollLeft>this.lastScrollLeft?this.dispatchCustomEventWithAlias("scb-scroll-right",{scrollLeft:t.scrollLeft}):t.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEventWithAlias("scb-scroll-left",{scrollLeft:t.scrollLeft}),this.lastScrollLeft=t.scrollLeft)},this.handleWheel=t=>{const l=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!l||t.deltaY===0)return;const i=l.scrollLeft,n=i>0,a=i+l.clientWidth<l.scrollWidth-1;!n&&!a||(l.scrollLeft+=t.deltaY,l.scrollLeft!==i&&t.preventDefault())}}getScrollStep(){const o=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");return o?Math.max(Math.round(o.clientWidth*.8),120):200}doScrollBy(o){this.scrollerEl?.scrollBy({left:o,behavior:"smooth"})}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.style.setProperty("--scb-horizontal-scroller-width",this.width)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.renderRoot.removeEventListener("focusin",this.__onFocusIn),this.renderRoot.removeEventListener("keydown",this.__onLazyFocusRingKeydown),super.disconnectedCallback(),this.scrollerEl&&(this.scrollerEl.removeEventListener("scroll",this.handleScroll),this.scrollerEl.removeEventListener("wheel",this.handleWheel)),this.sizeObserver&&(this.sizeObserver.disconnect(),this.sizeObserver=null),this.resizeRaf!==null&&(cancelAnimationFrame(this.resizeRaf),this.resizeRaf=null),this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollerEl=null,this.slotEl=null}dispatchCustomEvent(o,t={}){this.dispatchEvent(new CustomEvent(o,{detail:t,bubbles:!0,composed:!0}))}dispatchCustomEventWithAlias(o,t={}){if(this.dispatchCustomEvent(o,t),o.includes("-")){const l=o.replace(/-/g,"");this.dispatchCustomEvent(l,t)}}firstUpdated(){this.renderRoot.addEventListener("focusin",this.__onFocusIn),this.renderRoot.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.scrollerEl=this.shadowRoot?.querySelector(".scb-horizontal-scroller"),this.slotEl=this.shadowRoot?.querySelector("slot"),this.scrollerEl&&(this.scrollerEl.addEventListener("scroll",this.handleScroll),this.scrollerEl.addEventListener("wheel",this.handleWheel,{passive:!1}));const o=()=>{this.resizeRaf===null&&(this.resizeRaf=requestAnimationFrame(()=>{this.resizeRaf=null,this.updateScrollButtons()}))};requestAnimationFrame(()=>{this.updateScrollButtons()}),this.slotEl&&this.slotEl.addEventListener("slotchange",()=>{o()}),this.sizeObserver=new ResizeObserver(()=>{o()}),this.scrollerEl&&this.sizeObserver.observe(this.scrollerEl),this.slotEl&&this.sizeObserver.observe(this.slotEl),this.__applySpacing(),this.__applyInternalGap()}updated(o){o.has("width")&&this.style.setProperty("--scb-horizontal-scroller-width",this.width),(o.has("spacing")||o.has("spacingTop")||o.has("spacingBottom")||o.has("spacingLeft")||o.has("spacingRight"))&&this.__applySpacing(),(o.has("internalGap")||o.has("contentFlex"))&&this.__applyInternalGap()}mapSpacingToken(o){if(!o)return;const t=String(o).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const o=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop),l=this.mapSpacingToken(this.spacingBottom),i=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight),a=t??o,g=l??o;a?this.style.setProperty("--scb-horizontal-scroller-spacing-block-start",a):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"),g?this.style.setProperty("--scb-horizontal-scroller-spacing-block-end",g):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-end"),i?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-start",i):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-start"),n?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-end",n):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-end")}__applyInternalGap(){const o=this.mapSpacingToken(this.internalGap);this.contentFlex&&o?this.style.setProperty("--scb-horizontal-scroller-internal-gap",o):this.style.removeProperty("--scb-horizontal-scroller-internal-gap")}render(){const o=this.variant,t=this._canScrollLeft||this._canScrollRight;return o==="inline"?c`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js"])))=>i.map(i=>d[i]);
2
+ import{f,h as m,m as v,p as e,v as c,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as z}from"../../vendor/preload-helper.js";import{t as s}from"../../vendor/decorate.js";import{renderScbIcon as h}from"../shared/scb-icon-svg.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(t,l,i){try{customElements.get(t)||o(t,l,i)}catch(a){var n=String(a||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var p,b;function u(){return b??(b=z(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),b}var r=(p=class extends m{constructor(...o){super(...o),this.variant="standard",this.width="100%",this.showScrollbar=!1,this.rightScrollButtonLabel="Scrolla höger",this.leftScrollButtonLabel="Scrolla vänster",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.contentFlex=!1,this.internalGap="",this.snap=!1,this._canScrollLeft=!1,this._canScrollRight=!1,this.__scrollLeft=()=>{this.doScrollBy(-this.getScrollStep())},this.__scrollRight=()=>{this.doScrollBy(this.getScrollStep())},this.updateScrollButtons=()=>{const t=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!t){this._canScrollLeft=!1,this._canScrollRight=!1,this.toggleAttribute("data-scroll-left",!1),this.toggleAttribute("data-scroll-right",!1);return}const l=t.scrollLeft>0,i=t.scrollLeft+t.clientWidth<t.scrollWidth-1;this._canScrollLeft=l,this._canScrollRight=i,this.toggleAttribute("data-scroll-left",l),this.toggleAttribute("data-scroll-right",i)},this.lastScrollLeft=0,this.isScrolling=!1,this.scrollEndTimeout=null,this.scrollerEl=null,this.slotEl=null,this.sizeObserver=null,this.resizeRaf=null,this.__onFocusIn=()=>{u().then(({ensureFocusRingReady:t})=>t())},this.__onLazyFocusRingKeydown=t=>{!(t instanceof KeyboardEvent)||t.key!=="Tab"||u().then(({ensureFocusRingOnTab:l})=>l(t))},this.handleScroll=()=>{const t=this.scrollerEl;t&&(this.updateScrollButtons(),this.dispatchCustomEventWithAlias("scb-scroll",{scrollLeft:t.scrollLeft}),this.isScrolling||(this.isScrolling=!0,this.dispatchCustomEventWithAlias("scb-scroll-start",{scrollLeft:t.scrollLeft})),clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=setTimeout(()=>{this.isScrolling=!1,this.dispatchCustomEventWithAlias("scb-scroll-end",{scrollLeft:t.scrollLeft})},120),t.scrollLeft>this.lastScrollLeft?this.dispatchCustomEventWithAlias("scb-scroll-right",{scrollLeft:t.scrollLeft}):t.scrollLeft<this.lastScrollLeft&&this.dispatchCustomEventWithAlias("scb-scroll-left",{scrollLeft:t.scrollLeft}),this.lastScrollLeft=t.scrollLeft)},this.handleWheel=t=>{const l=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");if(!l||t.deltaY===0)return;const i=l.scrollLeft,n=i>0,a=i+l.clientWidth<l.scrollWidth-1;!n&&!a||(l.scrollLeft+=t.deltaY,l.scrollLeft!==i&&t.preventDefault())}}getScrollStep(){const o=this.scrollerEl||this.shadowRoot?.querySelector(".scb-horizontal-scroller");return o?Math.max(Math.round(o.clientWidth*.8),120):200}doScrollBy(o){this.scrollerEl?.scrollBy({left:o,behavior:"smooth"})}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",this.__onFocusIn),this.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.style.setProperty("--scb-horizontal-scroller-width",this.width)}disconnectedCallback(){this.removeEventListener("focusin",this.__onFocusIn),this.removeEventListener("keydown",this.__onLazyFocusRingKeydown),this.renderRoot.removeEventListener("focusin",this.__onFocusIn),this.renderRoot.removeEventListener("keydown",this.__onLazyFocusRingKeydown),super.disconnectedCallback(),this.scrollerEl&&(this.scrollerEl.removeEventListener("scroll",this.handleScroll),this.scrollerEl.removeEventListener("wheel",this.handleWheel)),this.sizeObserver&&(this.sizeObserver.disconnect(),this.sizeObserver=null),this.resizeRaf!==null&&(cancelAnimationFrame(this.resizeRaf),this.resizeRaf=null),this.scrollEndTimeout&&(clearTimeout(this.scrollEndTimeout),this.scrollEndTimeout=null),this.scrollerEl=null,this.slotEl=null}dispatchCustomEvent(o,t={}){this.dispatchEvent(new CustomEvent(o,{detail:t,bubbles:!0,composed:!0}))}dispatchCustomEventWithAlias(o,t={}){if(this.dispatchCustomEvent(o,t),o.includes("-")){const l=o.replace(/-/g,"");this.dispatchCustomEvent(l,t)}}firstUpdated(){this.renderRoot.addEventListener("focusin",this.__onFocusIn),this.renderRoot.addEventListener("keydown",this.__onLazyFocusRingKeydown),this.scrollerEl=this.shadowRoot?.querySelector(".scb-horizontal-scroller"),this.slotEl=this.shadowRoot?.querySelector("slot"),this.scrollerEl&&(this.scrollerEl.addEventListener("scroll",this.handleScroll),this.scrollerEl.addEventListener("wheel",this.handleWheel,{passive:!1}));const o=()=>{this.resizeRaf===null&&(this.resizeRaf=requestAnimationFrame(()=>{this.resizeRaf=null,this.updateScrollButtons()}))};requestAnimationFrame(()=>{this.updateScrollButtons()}),this.slotEl&&this.slotEl.addEventListener("slotchange",()=>{o()}),this.sizeObserver=new ResizeObserver(()=>{o()}),this.scrollerEl&&this.sizeObserver.observe(this.scrollerEl),this.slotEl&&this.sizeObserver.observe(this.slotEl),this.__applySpacing(),this.__applyInternalGap()}updated(o){o.has("width")&&this.style.setProperty("--scb-horizontal-scroller-width",this.width),(o.has("spacing")||o.has("spacingTop")||o.has("spacingBottom")||o.has("spacingLeft")||o.has("spacingRight"))&&this.__applySpacing(),(o.has("internalGap")||o.has("contentFlex"))&&this.__applyInternalGap()}mapSpacingToken(o){if(!o)return;const t=String(o).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const o=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop),l=this.mapSpacingToken(this.spacingBottom),i=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight),a=t??o,g=l??o;a?this.style.setProperty("--scb-horizontal-scroller-spacing-block-start",a):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-start"),g?this.style.setProperty("--scb-horizontal-scroller-spacing-block-end",g):this.style.removeProperty("--scb-horizontal-scroller-spacing-block-end"),i?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-start",i):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-start"),n?this.style.setProperty("--scb-horizontal-scroller-spacing-inline-end",n):this.style.removeProperty("--scb-horizontal-scroller-spacing-inline-end")}__applyInternalGap(){const o=this.mapSpacingToken(this.internalGap);this.contentFlex&&o?this.style.setProperty("--scb-horizontal-scroller-internal-gap",o):this.style.removeProperty("--scb-horizontal-scroller-internal-gap")}render(){const o=this.variant,t=this._canScrollLeft||this._canScrollRight;return o==="inline"?c`
3
3
  <div class="scb-horizontal-scroller ${t?"canScroll":""}" tabindex="0">
4
4
  <slot></slot>
5
5
  <md-focus-ring inward></md-focus-ring>
@@ -13,7 +13,7 @@ import{f,h as m,m as v,p as e,v as c,y}from"../../vendor/vendor.js";import"../..
13
13
  aria-label=${this.leftScrollButtonLabel}
14
14
  @click=${this.__scrollLeft}
15
15
  >
16
- ${d("chevron_left","scroll-control-icon")}
16
+ ${h("chevron_left","scroll-control-icon")}
17
17
  <span>${this.leftScrollButtonLabel}</span>
18
18
  </button>
19
19
  `:""}
@@ -26,7 +26,7 @@ import{f,h as m,m as v,p as e,v as c,y}from"../../vendor/vendor.js";import"../..
26
26
  @click=${this.__scrollRight}
27
27
  >
28
28
  <span>${this.rightScrollButtonLabel}</span>
29
- ${d("chevron_right","scroll-control-icon")}
29
+ ${h("chevron_right","scroll-control-icon")}
30
30
  </button>
31
31
  `:""}
32
32
  </div>
@@ -39,7 +39,7 @@ import{f,h as m,m as v,p as e,v as c,y}from"../../vendor/vendor.js";import"../..
39
39
  aria-label=${this.leftScrollButtonLabel}
40
40
  @click=${this.__scrollLeft}
41
41
  >
42
- ${d("chevron_left","scroll-control-icon")}
42
+ ${h("chevron_left","scroll-control-icon")}
43
43
  </button>
44
44
  `:""}
45
45
  <div class="scroll-shadow-left"></div>
@@ -55,7 +55,7 @@ import{f,h as m,m as v,p as e,v as c,y}from"../../vendor/vendor.js";import"../..
55
55
  aria-label=${this.rightScrollButtonLabel}
56
56
  @click=${this.__scrollRight}
57
57
  >
58
- ${d("chevron_right","scroll-control-icon")}
58
+ ${h("chevron_right","scroll-control-icon")}
59
59
  </button>
60
60
  `:""}
61
61
  `}},p.styles=y`:host{display:flex;position:relative;align-items:center;gap:var(--scb-horizontal-scroller-design-scroller-host-gap-medium);padding:0;overflow:hidden;margin-block-start:var(--scb-horizontal-scroller-spacing-block-start, 0);margin-block-end:var(--scb-horizontal-scroller-spacing-block-end, 0);margin-inline-start:var(--scb-horizontal-scroller-spacing-inline-start, 0);margin-inline-end:var(--scb-horizontal-scroller-spacing-inline-end, 0)}.scb-horizontal-scroller{overflow-x:auto;-ms-overflow-style:none;scrollbar-width:none;width:100%;--scb-effect-mask-edge-fade-size:var(--scb-horizontal-scroller-design-scroller-edge-fade-size-medium)}:host([snap]) .scb-horizontal-scroller{scroll-snap-type:x mandatory}:host([data-scroll-left]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:var(--scb-effect-mask-horizontal-start);mask-image:var(--scb-effect-mask-horizontal-start)}:host([data-scroll-right]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:var(--scb-effect-mask-horizontal-end);mask-image:var(--scb-effect-mask-horizontal-end)}:host([data-scroll-left][data-scroll-right]:not([variant='inline'])) .scb-horizontal-scroller{-webkit-mask-image:var(--scb-effect-mask-horizontal-both);mask-image:var(--scb-effect-mask-horizontal-both)}:host([show-scrollbar]) .scb-horizontal-scroller{scrollbar-width:auto}:host([content-flex]) .scb-horizontal-scroller{display:flex;flex-direction:row;flex:1 1 auto}.scb-horizontal-scroller::-webkit-scrollbar{border-radius:var(--md-sys-shape-corner-large);height:var(--scb-horizontal-scroller-design-scroller-scrollbar-height-medium);width:var(--scb-horizontal-scroller-design-scroller-scrollbar-width-medium)}.scb-horizontal-scroller::-webkit-scrollbar-thumb{background:var(--scb-horizontal-scroller-scrollbar-thumb-color, var(--md-sys-color-on-surface));border-radius:var(--md-sys-shape-corner-large);cursor:pointer}.scb-horizontal-scroller::-webkit-scrollbar-track{background:var(--scb-horizontal-scroller-scrollbar-track-color, var(--md-sys-color-secondary-container));border-radius:var(--md-sys-shape-corner-large)}.scb-horizontal-scroller:focus,.scroll-control:focus,.scroll-text-button:focus{outline:0}md-focus-ring{border-radius:var(--scb-card-focus-ring-radius, var(--md-sys-shape-corner-large))}:host([show-scrollbar]) .scb-horizontal-scroller.canScroll{padding-bottom:var(--scb-horizontal-scroller-design-scroller-scrollbar-padding-block-end-medium)}slot{display:block;box-sizing:border-box;padding-block:var(--scb-horizontal-scroller-design-scroller-slot-padding-block-medium);padding-inline:var(--scb-horizontal-scroller-design-scroller-slot-padding-inline-medium);min-width:var(--scb-horizontal-scroller-width, auto)}:host([content-flex]) .scb-horizontal-scroller slot{display:flex;gap:var(--scb-horizontal-scroller-internal-gap)}:host([snap]) slot::slotted(*){scroll-snap-align:start;scroll-snap-stop:always}.scroll-button-left{left:0;position:absolute;z-index:3}.scroll-button-right{right:2px;position:absolute;z-index:3}.scroll-control,.scroll-text-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border:0;font-family:var(--brand-font, var(--brand, "Inter"), sans-serif);font-weight:var(--weight-semibold, 600);cursor:pointer;appearance:none;-webkit-appearance:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;border-radius:var(--radius-full, 1000px)}.scroll-control{inline-size:var(--scb-horizontal-scroller-design-scroller-control-size-medium);block-size:var(--scb-horizontal-scroller-design-scroller-control-size-medium);padding:0;overflow:hidden;background:var(--scb-horizontal-scroller-control-container-color, var(--md-sys-color-secondary-container, var(--p-90)));color:var(--scb-horizontal-scroller-control-content-color, var(--md-sys-color-on-secondary-container, var(--p-30)))}.scroll-text-button{position:relative;min-block-size:calc(var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px)) + var(--scb-horizontal-scroller-design-scroller-text-padding-block-medium) + var(--scb-horizontal-scroller-design-scroller-text-padding-block-medium));gap:var(--scb-horizontal-scroller-design-scroller-text-gap-medium);padding-block:var(--scb-horizontal-scroller-design-scroller-text-padding-block-medium);padding-inline:var(--scb-horizontal-scroller-design-scroller-text-padding-inline-medium);background:0 0;color:var(--scb-horizontal-scroller-text-content-color, var(--md-sys-color-primary, var(--p-40)));font-size:var(--scb-typography-label-small-size, var(--md-sys-typescale-label-small-size, 16px));line-height:var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px));letter-spacing:var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, 0))}.scroll-control::before,.scroll-text-button::before{content:"";position:absolute;inset:0;border-radius:inherit;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.scroll-control:hover::before,.scroll-text-button:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.scroll-control:active::before,.scroll-text-button:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.scroll-control:focus-visible,.scroll-text-button:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary, var(--p-40)));outline-offset:var(--spacing-1, 2px)}.scroll-control-icon{position:relative;display:inline-block;inline-size:var(--scb-horizontal-scroller-design-scroller-control-icon-size-medium);block-size:var(--scb-horizontal-scroller-design-scroller-control-icon-size-medium);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--scb-horizontal-scroller-design-scroller-control-icon-size-medium);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:"FILL"0,"wght"400,"GRAD"0,"opsz"24;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.scroll-control-icon.scb-svg-icon{fill:currentColor;font:inherit}.scroll-shadow-left,.scroll-shadow-right{position:absolute;top:0;width:5px;bottom:0;pointer-events:none;background:0 0;box-shadow:none;transition:box-shadow .2s;z-index:2}.scroll-shadow-left{left:0}.scroll-shadow-right{right:0}:host([data-scroll-left]) .scroll-shadow-left{background:0 0;box-shadow:12px 0 30px color-mix(in srgb,currentColor 18%,transparent),4px 0 12px color-mix(in srgb,currentColor 12%,transparent)}:host([data-scroll-left]) .scroll-shadow-left::after,:host([data-scroll-right]) .scroll-shadow-right::after{content:"";position:absolute;inset-block:0}:host([data-scroll-right]) .scroll-shadow-right{background:0 0;box-shadow:-12px 0 30px color-mix(in srgb,currentColor 18%,transparent),-4px 0 12px color-mix(in srgb,currentColor 12%,transparent)}:host([variant='inline']){flex-direction:column;align-items:unset;padding:0}:host([variant='inline'][show-scrollbar]){gap:var(--spacing-5)}:host{--scb-horizontal-scroller-design-scroller-host-gap-medium:var(--scb-horizontal-scroller-host-gap, var(--spacing-3, 8px));--scb-horizontal-scroller-design-scroller-edge-fade-size-medium:var(--scb-horizontal-scroller-edge-fade-size, var(--scale-12, 56px));--scb-horizontal-scroller-design-scroller-slot-padding-block-medium:var(--scb-horizontal-scroller-slot-padding-block, var(--spacing-3, 8px));--scb-horizontal-scroller-design-scroller-slot-padding-inline-medium:var(--scb-horizontal-scroller-slot-padding-inline, var(--spacing-1, 2px));--scb-horizontal-scroller-design-scroller-control-size-medium:var(--scb-horizontal-scroller-control-size, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-horizontal-scroller-design-scroller-control-icon-size-medium:var(--scb-horizontal-scroller-control-icon-size, var(--icon-size-medium, 24px));--scb-horizontal-scroller-design-scroller-text-gap-medium:var(--scb-horizontal-scroller-text-gap, var(--spacing-3, 8px));--scb-horizontal-scroller-design-scroller-text-padding-block-medium:var(--scb-horizontal-scroller-text-padding-block, calc(var(--spacing-4, 12px) - var(--spacing-1, 2px)));--scb-horizontal-scroller-design-scroller-text-padding-inline-medium:var(--scb-horizontal-scroller-text-padding-inline, var(--spacing-5, 16px));--scb-horizontal-scroller-design-scroller-scrollbar-height-medium:var(--scb-horizontal-scroller-scrollbar-height, var(--spacing-2, 4px));--scb-horizontal-scroller-design-scroller-scrollbar-width-medium:var(--scb-horizontal-scroller-scrollbar-width, var(--spacing-3, 8px));--scb-horizontal-scroller-design-scroller-scrollbar-padding-block-end-medium:var(--scb-horizontal-scroller-scrollbar-padding-block-end, var(--spacing-5, 16px))}`,p);s([e({type:String,reflect:!0})],r.prototype,"variant",void 0);s([e({type:String,reflect:!0})],r.prototype,"width",void 0);s([e({type:Boolean,reflect:!0,attribute:"show-scrollbar"})],r.prototype,"showScrollbar",void 0);s([e({type:String,reflect:!0,attribute:"right-scroll-button-label"})],r.prototype,"rightScrollButtonLabel",void 0);s([e({type:String,reflect:!0,attribute:"left-scroll-button-label"})],r.prototype,"leftScrollButtonLabel",void 0);s([e({type:String,reflect:!0})],r.prototype,"spacing",void 0);s([e({type:String,reflect:!0,attribute:"spacing-top"})],r.prototype,"spacingTop",void 0);s([e({type:String,reflect:!0,attribute:"spacing-bottom"})],r.prototype,"spacingBottom",void 0);s([e({type:String,reflect:!0,attribute:"spacing-left"})],r.prototype,"spacingLeft",void 0);s([e({type:String,reflect:!0,attribute:"spacing-right"})],r.prototype,"spacingRight",void 0);s([e({type:Boolean,reflect:!0,attribute:"content-flex"})],r.prototype,"contentFlex",void 0);s([e({type:String,reflect:!0,attribute:"internal-gap"})],r.prototype,"internalGap",void 0);s([e({type:Boolean,reflect:!0})],r.prototype,"snap",void 0);s([f()],r.prototype,"_canScrollLeft",void 0);s([f()],r.prototype,"_canScrollRight",void 0);r=s([v("scb-horizontal-scroller")],r);
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js"])))=>i.map(i=>d[i]);
2
- import{g as s,h as y,m as x,p as r,v as d,y as z}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as _}from"../../vendor/preload-helper.js";import{t as R}from"../../vendor/component-defaults.js";import{t as e}from"../../vendor/decorate.js";import{t as g}from"../../vendor/assertClassBrand.js";import{t as k}from"../../vendor/classPrivateMethodInitSpec.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(t,i,a){try{customElements.get(t)||o(t,i,a)}catch(u){var l=String(u||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var b,p,v,h;function S(){return v??(v=_(()=>import("../../vendor/lazy-focus-ring.js").then(c=>c.i),__vite__mapDeps([0,1,2]),import.meta.url)),v}function m(){return h??(h=_(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),h}var n=(b=new WeakSet,p=class extends y{constructor(...o){super(...o),k(this,b),this.icon="home",this.ariaLabel="",this.variant="standard",this.size=R["scb-icon-button"].size,this.toggle=!1,this.selected=!1,this.toggleofficon="add",this.toggleonicon="remove",this.disabled=!1,this.href="",this.target="",this.rel="",this.__filledValue=!1,this.__focusRingReady=!1,this.__focusRingImportRequested=!1,this.__rippleReady=!1,this.__pendingRippleClick=!1,this.__ensureFocusRing=()=>{this.__focusRingReady||this.__focusRingImportRequested||(this.__focusRingImportRequested=!0,S().then(({ensureFocusRingReady:t})=>(t(),customElements.whenDefined("md-focus-ring"))).then(()=>{this.__focusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncInteractiveState())}))},this.__onFocusIn=t=>{const i=t.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureFocusRing()},this.__ensureRipple=(t,i=!1)=>{this.__rippleReady||this.disabled||(t&&(this.__pendingRippleEvent=t),i&&(this.__pendingRippleClick=!0),m().then(({ensureRippleReady:a})=>a()).then(()=>{this.disabled||(this.__rippleReady=!0,this.toggleAttribute("data-native-ripple-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__replayRippleState()))}))},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onClick=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}this.toggle&&(this.selected=!this.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))),this.__ensureRipple(void 0,!0)}}get filled(){return this.__filledValue}set filled(o){const t=!!o,i=this.__filledValue;i!==t&&(this.__filledValue=t,this.requestUpdate("filled",i),this.requestUpdate("iconFilled",i))}get iconFilled(){return this.__filledValue}set iconFilled(o){const t=!!o,i=this.__filledValue;i!==t&&(this.__filledValue=t,this.requestUpdate("iconFilled",i),this.requestUpdate("filled",i))}firstUpdated(){g(b,this,f).call(this),this.__syncInteractiveState()}updated(o){super.updated(o),(o.has("spacing")||o.has("spacingTop")||o.has("spacingBottom")||o.has("spacingLeft")||o.has("spacingRight"))&&g(b,this,f).call(this),(this.__focusRingReady||this.__rippleReady)&&this.updateComplete.then(()=>this.__syncInteractiveState())}focus(o){const t=this.__getNativeControl();if(t){t.focus(o);return}super.focus(o)}__getNativeControl(){return this.renderRoot.querySelector(".native-icon-button")}__syncInteractiveState(){const o=this.__getNativeControl(),t=this.renderRoot.querySelector("md-focus-ring");t&&o&&(t.control=o,t.visible=o.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&o&&(i.control=o)}async __replayRippleState(){const o=this.renderRoot.querySelector("md-ripple"),t=this.__getNativeControl(),i=this.__pendingRippleEvent,a=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:l}=await m();await l(o,t,i,a),this.__syncInteractiveState()}__effectiveLabel(){return(this.ariaLabel||this.getAttribute("aria-label")||"").trim()||this.__currentIcon()||s}__currentIcon(){return this.toggle?this.selected?this.toggleonicon:this.toggleofficon:this.icon}mapSpacingToken(o){if(!o)return;const t=String(o).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__renderControl(o){const t=this.__effectiveLabel(),i=this.getAttribute("aria-controls")??s,a=this.getAttribute("aria-expanded")??s,l=this.toggle?String(this.selected):s,u=this.getAttribute("title")??s;return this.href?d`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../shared/lazy-ripple.js"])))=>i.map(i=>d[i]);
2
+ import{g as s,h as y,m as x,p as r,v as d,y as z}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as _}from"../../vendor/preload-helper.js";import{t as R}from"../../vendor/component-defaults.js";import{t as e}from"../../vendor/decorate.js";import{t as g}from"../../vendor/assertClassBrand.js";import{t as k}from"../../vendor/classPrivateMethodInitSpec.js";(function(){try{var l=typeof globalThis<"u"?globalThis:window;if(!l.__scb_ce_guard_installed__){l.__scb_ce_guard_installed__=!0;var o=customElements.define.bind(customElements);customElements.define=function(t,i,a){try{customElements.get(t)||o(t,i,a)}catch(u){var c=String(u||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var b,p,v,h;function S(){return v??(v=_(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),v}function m(){return h??(h=_(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),h}var n=(b=new WeakSet,p=class extends y{constructor(...o){super(...o),k(this,b),this.icon="home",this.ariaLabel="",this.variant="standard",this.size=R["scb-icon-button"].size,this.toggle=!1,this.selected=!1,this.toggleofficon="add",this.toggleonicon="remove",this.disabled=!1,this.href="",this.target="",this.rel="",this.__filledValue=!1,this.__focusRingReady=!1,this.__focusRingImportRequested=!1,this.__rippleReady=!1,this.__pendingRippleClick=!1,this.__ensureFocusRing=()=>{this.__focusRingReady||this.__focusRingImportRequested||(this.__focusRingImportRequested=!0,S().then(({ensureFocusRingReady:t})=>(t(),customElements.whenDefined("md-focus-ring"))).then(()=>{this.__focusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncInteractiveState())}))},this.__onFocusIn=t=>{const i=t.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureFocusRing()},this.__ensureRipple=(t,i=!1)=>{this.__rippleReady||this.disabled||(t&&(this.__pendingRippleEvent=t),i&&(this.__pendingRippleClick=!0),m().then(({ensureRippleReady:a})=>a()).then(()=>{this.disabled||(this.__rippleReady=!0,this.toggleAttribute("data-native-ripple-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__replayRippleState()))}))},this.__onPointerInteraction=t=>{this.__ensureRipple(t)},this.__onClick=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}this.toggle&&(this.selected=!this.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))),this.__ensureRipple(void 0,!0)}}get filled(){return this.__filledValue}set filled(o){const t=!!o,i=this.__filledValue;i!==t&&(this.__filledValue=t,this.requestUpdate("filled",i),this.requestUpdate("iconFilled",i))}get iconFilled(){return this.__filledValue}set iconFilled(o){const t=!!o,i=this.__filledValue;i!==t&&(this.__filledValue=t,this.requestUpdate("iconFilled",i),this.requestUpdate("filled",i))}firstUpdated(){g(b,this,f).call(this),this.__syncInteractiveState()}updated(o){super.updated(o),(o.has("spacing")||o.has("spacingTop")||o.has("spacingBottom")||o.has("spacingLeft")||o.has("spacingRight"))&&g(b,this,f).call(this),(this.__focusRingReady||this.__rippleReady)&&this.updateComplete.then(()=>this.__syncInteractiveState())}focus(o){const t=this.__getNativeControl();if(t){t.focus(o);return}super.focus(o)}__getNativeControl(){return this.renderRoot.querySelector(".native-icon-button")}__syncInteractiveState(){const o=this.__getNativeControl(),t=this.renderRoot.querySelector("md-focus-ring");t&&o&&(t.control=o,t.visible=o.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&o&&(i.control=o)}async __replayRippleState(){const o=this.renderRoot.querySelector("md-ripple"),t=this.__getNativeControl(),i=this.__pendingRippleEvent,a=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await m();await c(o,t,i,a),this.__syncInteractiveState()}__effectiveLabel(){return(this.ariaLabel||this.getAttribute("aria-label")||"").trim()||this.__currentIcon()||s}__currentIcon(){return this.toggle?this.selected?this.toggleonicon:this.toggleofficon:this.icon}mapSpacingToken(o){if(!o)return;const t=String(o).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__renderControl(o){const t=this.__effectiveLabel(),i=this.getAttribute("aria-controls")??s,a=this.getAttribute("aria-expanded")??s,c=this.toggle?String(this.selected):s,u=this.getAttribute("title")??s;return this.href?d`
3
3
  <a
4
4
  class="native-icon-button"
5
5
  part="button"
@@ -10,7 +10,7 @@ import{g as s,h as y,m as x,p as r,v as d,y as z}from"../../vendor/vendor.js";im
10
10
  aria-label=${t}
11
11
  aria-controls=${i}
12
12
  aria-expanded=${a}
13
- aria-pressed=${l}
13
+ aria-pressed=${c}
14
14
  aria-disabled=${this.disabled?"true":s}
15
15
  tabindex=${this.disabled?"-1":s}
16
16
  @click=${this.__onClick}
@@ -30,7 +30,7 @@ import{g as s,h as y,m as x,p as r,v as d,y as z}from"../../vendor/vendor.js";im
30
30
  aria-label=${t}
31
31
  aria-controls=${i}
32
32
  aria-expanded=${a}
33
- aria-pressed=${l}
33
+ aria-pressed=${c}
34
34
  @click=${this.__onClick}
35
35
  @focusin=${this.__onFocusIn}
36
36
  @pointerenter=${this.__onPointerInteraction}
@@ -56,4 +56,4 @@ import{g as s,h as y,m as x,p as r,v as d,y as z}from"../../vendor/vendor.js";im
56
56
  var(--scb-icon-button-tonal-selected-container-color, var(--md-sys-color-secondary-container, var(--p-90)))
57
57
  );color:var(--md-filled-tonal-icon-button-selected-icon-color,
58
58
  var(--scb-icon-button-tonal-selected-content-color, var(--md-sys-color-on-secondary-container, var(--p-30)))
59
- )}:host([variant='outlined'][toggle][selected]) .native-icon-button{color:var(--md-outlined-icon-button-selected-icon-color, var(--scb-icon-button-outlined-selected-content-color, var(--md-sys-color-primary, var(--p-40))));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-selected-outline-color, var(--scb-icon-button-outlined-selected-outline-color, var(--md-sys-color-outline, var(--p-20))))}.native-icon-button:disabled,.native-icon-button[aria-disabled=true]{color:var(--md-icon-button-disabled-icon-color, var(--_disabled-content-color, var(--scb-color-compat-disabled-content)));cursor:default;pointer-events:none}:host([variant='filled']) .native-icon-button:disabled,:host([variant='filled']) .native-icon-button[aria-disabled=true],:host([variant='filled-tonal']) .native-icon-button:disabled,:host([variant='filled-tonal']) .native-icon-button[aria-disabled=true]{background:var(--md-filled-icon-button-disabled-container-color, var(--_disabled-container-color, var(--scb-color-compat-disabled-container)));color:var(--md-filled-icon-button-disabled-icon-color, var(--_disabled-content-color, var(--scb-color-compat-disabled-content)))}:host([variant='outlined']) .native-icon-button:disabled,:host([variant='outlined']) .native-icon-button[aria-disabled=true]{color:var(--md-outlined-icon-button-disabled-icon-color, var(--_disabled-content-color, var(--scb-color-compat-disabled-content)));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-disabled-outline-color, var(--_disabled-outline-color, var(--scb-color-compat-disabled-container)))}.native-icon-button-wrap md-ripple{position:absolute;inset:0;--md-ripple-hover-color:var(--scb-icon-button-state-layer-color, currentColor);--md-ripple-pressed-color:var(--scb-icon-button-state-layer-color, currentColor)}.native-icon-button-wrap md-focus-ring,.native-icon-button-wrap md-ripple{pointer-events:none;border-radius:inherit}:host{--scb-icon-button-design-height-tiny:var(--scb-buttons-control-size-tiny, var(--scb-control-size-tiny, var(--scale-06, 24px)));--scb-icon-button-design-height-extra-small:var(--scb-buttons-control-size-extra-small, var(--scale-07, 28px));--scb-icon-button-design-height-small:var(--scb-buttons-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)));--scb-icon-button-design-height-medium:var(--scb-buttons-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-icon-button-design-height-large:var(--scb-buttons-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)));--scb-icon-button-design-icon-tiny:var(--scb-buttons-icon-size-tiny, var(--icon-size-tiny, 12px));--scb-icon-button-design-icon-extra-small:var(--scb-buttons-icon-size-extra-small, var(--icon-size-small, 20px));--scb-icon-button-design-icon-small:var(--scb-buttons-icon-size-small, var(--icon-size-small, 20px));--scb-icon-button-design-icon-medium:var(--scb-icon-button-icon-size-medium, var(--icon-size-medium, 24px));--scb-icon-button-design-icon-large:var(--scb-icon-button-icon-size-large, var(--icon-size-large, 32px));--scb-icon-button-design-icon-button-round-radius-tiny:var(--scb-buttons-shape-radius-tiny, var(--radius-full, 1000px));--scb-icon-button-design-icon-button-round-radius-extra-small:var(--scb-buttons-shape-radius-extra-small, var(--radius-full, 1000px));--scb-icon-button-design-icon-button-round-radius-small:var(--scb-buttons-shape-radius-small, var(--radius-full, 1000px));--scb-icon-button-design-icon-button-round-radius-medium:var(--scb-buttons-shape-radius-medium, var(--radius-full, 1000px));--scb-icon-button-design-icon-button-round-radius-large:var(--scb-buttons-shape-radius-large, var(--radius-full, 1000px))}`,p);function f(){const c=this.mapSpacingToken(this.spacing),o=this.mapSpacingToken(this.spacingTop)??c,t=this.mapSpacingToken(this.spacingBottom)??c,i=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);o?this.style.setProperty("--scb-icon-button-spacing-block-start",o):this.style.removeProperty("--scb-icon-button-spacing-block-start"),t?this.style.setProperty("--scb-icon-button-spacing-block-end",t):this.style.removeProperty("--scb-icon-button-spacing-block-end"),i?this.style.setProperty("--scb-icon-button-spacing-inline-start",i):this.style.removeProperty("--scb-icon-button-spacing-inline-start"),a?this.style.setProperty("--scb-icon-button-spacing-inline-end",a):this.style.removeProperty("--scb-icon-button-spacing-inline-end")}e([r({type:String})],n.prototype,"icon",void 0);e([r({type:Boolean,reflect:!0})],n.prototype,"filled",null);e([r({type:Boolean,attribute:"icon-filled",reflect:!0})],n.prototype,"iconFilled",null);e([r({type:String,attribute:"aria-label"})],n.prototype,"ariaLabel",void 0);e([r({type:String,reflect:!0})],n.prototype,"variant",void 0);e([r({type:String,reflect:!0})],n.prototype,"size",void 0);e([r({type:Boolean,reflect:!0})],n.prototype,"toggle",void 0);e([r({type:Boolean,reflect:!0})],n.prototype,"selected",void 0);e([r({type:String})],n.prototype,"toggleofficon",void 0);e([r({type:String})],n.prototype,"toggleonicon",void 0);e([r({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);e([r({type:String,reflect:!0})],n.prototype,"spacing",void 0);e([r({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",void 0);e([r({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",void 0);e([r({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",void 0);e([r({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",void 0);e([r({type:String})],n.prototype,"href",void 0);e([r({type:String})],n.prototype,"target",void 0);e([r({type:String})],n.prototype,"rel",void 0);n=e([x("scb-icon-button")],n);export{n as ScbIconButton};
59
+ )}:host([variant='outlined'][toggle][selected]) .native-icon-button{color:var(--md-outlined-icon-button-selected-icon-color, var(--scb-icon-button-outlined-selected-content-color, var(--md-sys-color-primary, var(--p-40))));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-selected-outline-color, var(--scb-icon-button-outlined-selected-outline-color, var(--md-sys-color-outline, var(--p-20))))}.native-icon-button:disabled,.native-icon-button[aria-disabled=true]{color:var(--md-icon-button-disabled-icon-color, var(--_disabled-content-color, var(--scb-color-compat-disabled-content)));cursor:default;pointer-events:none}:host([variant='filled']) .native-icon-button:disabled,:host([variant='filled']) .native-icon-button[aria-disabled=true],:host([variant='filled-tonal']) .native-icon-button:disabled,:host([variant='filled-tonal']) .native-icon-button[aria-disabled=true]{background:var(--md-filled-icon-button-disabled-container-color, var(--_disabled-container-color, var(--scb-color-compat-disabled-container)));color:var(--md-filled-icon-button-disabled-icon-color, var(--_disabled-content-color, var(--scb-color-compat-disabled-content)))}:host([variant='outlined']) .native-icon-button:disabled,:host([variant='outlined']) .native-icon-button[aria-disabled=true]{color:var(--md-outlined-icon-button-disabled-icon-color, var(--_disabled-content-color, var(--scb-color-compat-disabled-content)));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--md-outlined-icon-button-disabled-outline-color, var(--_disabled-outline-color, var(--scb-color-compat-disabled-container)))}.native-icon-button-wrap md-ripple{position:absolute;inset:0;--md-ripple-hover-color:var(--scb-icon-button-state-layer-color, currentColor);--md-ripple-pressed-color:var(--scb-icon-button-state-layer-color, currentColor)}.native-icon-button-wrap md-focus-ring,.native-icon-button-wrap md-ripple{pointer-events:none;border-radius:inherit}:host{--scb-icon-button-design-height-tiny:var(--scb-buttons-control-size-tiny, var(--scb-control-size-tiny, var(--scale-06, 24px)));--scb-icon-button-design-height-extra-small:var(--scb-buttons-control-size-extra-small, var(--scale-07, 28px));--scb-icon-button-design-height-small:var(--scb-buttons-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)));--scb-icon-button-design-height-medium:var(--scb-buttons-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-icon-button-design-height-large:var(--scb-buttons-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)));--scb-icon-button-design-icon-tiny:var(--scb-buttons-icon-size-tiny, var(--icon-size-tiny, 12px));--scb-icon-button-design-icon-extra-small:var(--scb-buttons-icon-size-extra-small, var(--icon-size-small, 20px));--scb-icon-button-design-icon-small:var(--scb-buttons-icon-size-small, var(--icon-size-small, 20px));--scb-icon-button-design-icon-medium:var(--scb-icon-button-icon-size-medium, var(--icon-size-medium, 24px));--scb-icon-button-design-icon-large:var(--scb-icon-button-icon-size-large, var(--icon-size-large, 32px));--scb-icon-button-design-icon-button-round-radius-tiny:var(--scb-buttons-shape-radius-tiny, var(--radius-full, 1000px));--scb-icon-button-design-icon-button-round-radius-extra-small:var(--scb-buttons-shape-radius-extra-small, var(--radius-full, 1000px));--scb-icon-button-design-icon-button-round-radius-small:var(--scb-buttons-shape-radius-small, var(--radius-full, 1000px));--scb-icon-button-design-icon-button-round-radius-medium:var(--scb-buttons-shape-radius-medium, var(--radius-full, 1000px));--scb-icon-button-design-icon-button-round-radius-large:var(--scb-buttons-shape-radius-large, var(--radius-full, 1000px))}`,p);function f(){const l=this.mapSpacingToken(this.spacing),o=this.mapSpacingToken(this.spacingTop)??l,t=this.mapSpacingToken(this.spacingBottom)??l,i=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);o?this.style.setProperty("--scb-icon-button-spacing-block-start",o):this.style.removeProperty("--scb-icon-button-spacing-block-start"),t?this.style.setProperty("--scb-icon-button-spacing-block-end",t):this.style.removeProperty("--scb-icon-button-spacing-block-end"),i?this.style.setProperty("--scb-icon-button-spacing-inline-start",i):this.style.removeProperty("--scb-icon-button-spacing-inline-start"),a?this.style.setProperty("--scb-icon-button-spacing-inline-end",a):this.style.removeProperty("--scb-icon-button-spacing-inline-end")}e([r({type:String})],n.prototype,"icon",void 0);e([r({type:Boolean,reflect:!0})],n.prototype,"filled",null);e([r({type:Boolean,attribute:"icon-filled",reflect:!0})],n.prototype,"iconFilled",null);e([r({type:String,attribute:"aria-label"})],n.prototype,"ariaLabel",void 0);e([r({type:String,reflect:!0})],n.prototype,"variant",void 0);e([r({type:String,reflect:!0})],n.prototype,"size",void 0);e([r({type:Boolean,reflect:!0})],n.prototype,"toggle",void 0);e([r({type:Boolean,reflect:!0})],n.prototype,"selected",void 0);e([r({type:String})],n.prototype,"toggleofficon",void 0);e([r({type:String})],n.prototype,"toggleonicon",void 0);e([r({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);e([r({type:String,reflect:!0})],n.prototype,"spacing",void 0);e([r({type:String,attribute:"spacing-top",reflect:!0})],n.prototype,"spacingTop",void 0);e([r({type:String,attribute:"spacing-bottom",reflect:!0})],n.prototype,"spacingBottom",void 0);e([r({type:String,attribute:"spacing-left",reflect:!0})],n.prototype,"spacingLeft",void 0);e([r({type:String,attribute:"spacing-right",reflect:!0})],n.prototype,"spacingRight",void 0);e([r({type:String})],n.prototype,"href",void 0);e([r({type:String})],n.prototype,"target",void 0);e([r({type:String})],n.prototype,"rel",void 0);n=e([x("scb-icon-button")],n);export{n as ScbIconButton};