scb-wc 0.1.243 → 0.1.245

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 (90) hide show
  1. package/README.md +16 -19
  2. package/all.d.ts +0 -14
  3. package/all.js +0 -14
  4. package/index.js +85 -99
  5. package/mvc/components/all.js +0 -9
  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-avatar/scb-avatar.js +20 -9
  10. package/mvc/components/scb-button/scb-button.js +3 -3
  11. package/mvc/components/scb-calendar/scb-calendar.js +1 -1
  12. package/mvc/components/scb-calendar-card/scb-calendar-card.js +2 -2
  13. package/mvc/components/scb-card/scb-card.js +2 -2
  14. package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +2 -2
  15. package/mvc/components/scb-dialog/scb-dialog.js +1 -1
  16. package/mvc/components/scb-drawer/scb-drawer.js +4 -4
  17. package/mvc/components/scb-drop-zone/scb-drop-zone.js +1 -1
  18. package/mvc/components/scb-dropdown/scb-dropdown.js +5 -5
  19. package/mvc/components/scb-fact-card/scb-fact-card.js +1 -1
  20. package/mvc/components/scb-header/scb-header.js +2 -2
  21. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
  22. package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
  23. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
  24. package/mvc/components/scb-link/scb-link.js +1 -1
  25. package/mvc/components/scb-link-button/scb-link-button.js +1 -1
  26. package/mvc/components/scb-list/scb-list-item.js +6 -6
  27. package/mvc/components/scb-menu/scb-menu-item.js +1 -1
  28. package/mvc/components/scb-nav/scb-nav.js +1 -1
  29. package/mvc/components/scb-notification-card/scb-notification-card.js +1 -1
  30. package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
  31. package/mvc/components/scb-options-menu/scb-options-menu.js +2 -2
  32. package/mvc/components/scb-options-menu/scb-options-sub-menu.js +1 -1
  33. package/mvc/components/scb-overlay/scb-overlay.js +3 -3
  34. package/mvc/components/scb-pagination/scb-pagination.js +1 -1
  35. package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
  36. package/mvc/components/scb-search/scb-search.js +3 -3
  37. package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
  38. package/mvc/components/scb-select/scb-select-option.js +1 -1
  39. package/mvc/components/scb-select/scb-select.js +1 -1
  40. package/mvc/components/scb-slider/scb-slider.js +1 -1
  41. package/mvc/components/scb-snackbar/scb-snackbar.js +1 -1
  42. package/mvc/components/scb-stepper/scb-step.js +1 -1
  43. package/mvc/components/scb-switch/scb-switch.js +2 -2
  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-textfield/scb-textfield.js +176 -34
  47. package/mvc/components/scb-toc/scb-toc-item.js +1 -1
  48. package/mvc/components/scb-tooltip/scb-tooltip.js +2 -2
  49. package/mvc/{components/shared → vendor}/component-size-token.js +1 -1
  50. package/mvc/vendor/lazy-focus-ring.js +2 -0
  51. package/mvc/vendor/lazy-ripple.js +2 -0
  52. package/mvc/{components/shared → vendor}/manual-popover.js +1 -1
  53. package/mvc/{components/scb-chevron → vendor}/scb-chevron.js +1 -1
  54. package/mvc/vendor/scb-icon-svg.js +11 -0
  55. package/package.json +2 -12
  56. package/scb-avatar/scb-avatar.js +105 -28
  57. package/scb-button/scb-button.js +27 -27
  58. package/scb-components/scb-avatar/scb-avatar.d.ts +5 -0
  59. package/scb-components/scb-dropdown/scb-dropdown.d.ts +6 -1
  60. package/scb-drawer/scb-drawer.js +4 -2
  61. package/scb-dropdown/scb-dropdown.js +36 -12
  62. package/scb-icon-button/scb-icon-button.js +18 -18
  63. package/scb-slider/scb-slider.js +22 -22
  64. package/scb-switch/scb-switch.js +21 -21
  65. package/scb-viz/scb-viz-series-differentiation-registry.js +7 -10
  66. package/scb-viz/scb-viz.js +43 -43
  67. package/scb-wc.bundle.js +365 -440
  68. package/scb-wc.d.ts +0 -28
  69. package/shared/scb-icon-svg.js +2 -5
  70. package/mvc/components/scb-datepicker/scb-datepicker.js +0 -143
  71. package/mvc/components/scb-table-next/read-table.js +0 -1
  72. package/mvc/components/scb-table-next/scb-table-next.js +0 -6
  73. package/mvc/components/shared/lazy-focus-ring.js +0 -2
  74. package/mvc/components/shared/lazy-ripple.js +0 -2
  75. package/mvc/components/shared/scb-icon-svg.js +0 -11
  76. package/scb-components/index.d.ts +0 -108
  77. package/scb-components/scb-table-next/read-table.d.ts +0 -29
  78. package/scb-components/scb-table-next/scb-table-next.d.ts +0 -22
  79. package/scb-components/scb-viz/scb-viz-actions-runtime.d.ts +0 -26
  80. package/scb-components/scb-viz/scb-viz-print-runtime.d.ts +0 -36
  81. package/scb-components/scb-viz/scb-viz-series-differentiation-registry.d.ts +0 -21
  82. package/scb-components/scb-viz/scb-viz-series-differentiation-runtime.d.ts +0 -42
  83. package/scb-components/scb-viz/scb-viz-table-runtime.d.ts +0 -31
  84. package/scb-components/shared/component-size-token.d.ts +0 -1
  85. package/scb-components/shared/lazy-focus-ring.d.ts +0 -4
  86. package/scb-components/shared/lazy-ripple.d.ts +0 -9
  87. package/scb-components/shared/manual-popover.d.ts +0 -7
  88. package/scb-components/shared/scb-icon-svg.d.ts +0 -3
  89. package/scb-table-next/read-table.js +0 -87
  90. package/scb-table-next/scb-table-next.js +0 -226
@@ -1,4 +1,4 @@
1
- import{g as v,h as _,m as z,p,v as g,y as P}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{componentSizeToken as L}from"../shared/component-size-token.js";import{t as r}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";(function(){try{var u=typeof globalThis<"u"?globalThis:window;if(!u.__scb_ce_guard_installed__){u.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(a,e,s){try{customElements.get(a)||i(a,e,s)}catch(b){var n=String(b||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var y,o=(y=class extends _{constructor(...i){super(...i),this.variant="icon-text",this.alignment="start",this.page=1,this.totalPages=0,this.pagingHref="",this.baseUri="",this.paginationAriaLabel="Paginering",this.currentAriaLabel="Nuvarande sida, ",this.pagingNumberAriaLabel="Gå till sida ",this.previousLabel="Föregående",this.nextLabel="Nästa",this.previousAriaLabel="Föregående sida",this.nextAriaLabel="Nästa sida",this.isNarrow=window.innerWidth<=768,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onResize=()=>{const a=(this.getBoundingClientRect().width||window.innerWidth)<=768||window.innerWidth<=768;this.isNarrow!==a&&(this.isNarrow=a)}}_emitPageChange(i){const a={page:i};this.dispatchEvent(new CustomEvent("page-change",{detail:a,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("pagechange",{detail:a,bubbles:!0,composed:!0}))}_getPagingHref(i){if(!this.pagingHref)return;const a=(this.baseUri||"").trim(),e=a||window.location.href,s=new URL(e,window.location.href),n=this.pagingHref.trim().replace(/^[?&]/,"").split("=")[0];if(n)return s.searchParams.delete(n),s.searchParams.set(n,String(i)),/^https?:\/\//i.test(a)?s.toString():`${s.pathname}${s.search}${s.hash}`}_composePageLabel(i,a){const e=String(i??"").trimEnd();return e?`${e} ${a}`:String(a)}_handlePageSelection(i,a){!this.pagingHref&&a&&a.preventDefault(),this.page=i,this._emitPageChange(i)}_prevPage(i){if(this.page<=1){!this.pagingHref&&i&&i.preventDefault();return}this._handlePageSelection(this.page-1,i)}_nextPage(i){if(this.page>=this.totalPages){!this.pagingHref&&i&&i.preventDefault();return}this._handlePageSelection(this.page+1,i)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._onResize),this._resizeObserver=new ResizeObserver(this._onResize),this._resizeObserver.observe(this),this._onResize()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._onResize),this._resizeObserver?.disconnect(),this._resizeObserver=void 0}mapSpacingToken(i){if(i==null)return;const a=String(i).trim();if(a)return/^\d+$/.test(a)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(a,10)))})`:a}__applySpacing(){const i=this.mapSpacingToken(this.spacing),a=this.mapSpacingToken(this.spacingTop)??i,e=this.mapSpacingToken(this.spacingBottom)??i,s=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);a?this.style.setProperty("--scb-pagination-spacing-block-start",a):this.style.removeProperty("--scb-pagination-spacing-block-start"),e?this.style.setProperty("--scb-pagination-spacing-block-end",e):this.style.removeProperty("--scb-pagination-spacing-block-end"),s?this.style.setProperty("--scb-pagination-spacing-inline-start",s):this.style.removeProperty("--scb-pagination-spacing-inline-start"),n?this.style.setProperty("--scb-pagination-spacing-inline-end",n):this.style.removeProperty("--scb-pagination-spacing-inline-end")}firstUpdated(){this.__applySpacing()}updated(i){super.updated(i),(i.has("spacing")||i.has("spacingTop")||i.has("spacingBottom")||i.has("spacingLeft")||i.has("spacingRight"))&&this.__applySpacing()}render(){if(this.totalPages===0)return null;const i=this.variant?`${this.variant.toLowerCase()}`:"",a=this.alignment==="center"||this.alignment==="end"?`align-${this.alignment}`:"align-start",e=[],{page:s,totalPages:n}=this,b=this.isNarrow,m=b?1:2,f=this._getPagingHref(Math.max(1,this.page-1)),x=this._getPagingHref(Math.min(this.totalPages,this.page+1)),d=this.page===1,h=this.page===this.totalPages,l=L(this,"--scb-pagination-design-navigation-button-size-medium",["small","medium","large"],"medium"),w=this.pagingHref?this.variant==="icon"?g`<scb-icon-button
1
+ import{g as v,h as _,m as z,p,v as g,y as P}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{t as L}from"../../vendor/component-size-token.js";import{t as r}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-link/scb-link.js";(function(){try{var u=typeof globalThis<"u"?globalThis:window;if(!u.__scb_ce_guard_installed__){u.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(a,e,s){try{customElements.get(a)||i(a,e,s)}catch(b){var n=String(b||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw b}}}}catch{}})();var y,o=(y=class extends _{constructor(...i){super(...i),this.variant="icon-text",this.alignment="start",this.page=1,this.totalPages=0,this.pagingHref="",this.baseUri="",this.paginationAriaLabel="Paginering",this.currentAriaLabel="Nuvarande sida, ",this.pagingNumberAriaLabel="Gå till sida ",this.previousLabel="Föregående",this.nextLabel="Nästa",this.previousAriaLabel="Föregående sida",this.nextAriaLabel="Nästa sida",this.isNarrow=window.innerWidth<=768,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._onResize=()=>{const a=(this.getBoundingClientRect().width||window.innerWidth)<=768||window.innerWidth<=768;this.isNarrow!==a&&(this.isNarrow=a)}}_emitPageChange(i){const a={page:i};this.dispatchEvent(new CustomEvent("page-change",{detail:a,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("pagechange",{detail:a,bubbles:!0,composed:!0}))}_getPagingHref(i){if(!this.pagingHref)return;const a=(this.baseUri||"").trim(),e=a||window.location.href,s=new URL(e,window.location.href),n=this.pagingHref.trim().replace(/^[?&]/,"").split("=")[0];if(n)return s.searchParams.delete(n),s.searchParams.set(n,String(i)),/^https?:\/\//i.test(a)?s.toString():`${s.pathname}${s.search}${s.hash}`}_composePageLabel(i,a){const e=String(i??"").trimEnd();return e?`${e} ${a}`:String(a)}_handlePageSelection(i,a){!this.pagingHref&&a&&a.preventDefault(),this.page=i,this._emitPageChange(i)}_prevPage(i){if(this.page<=1){!this.pagingHref&&i&&i.preventDefault();return}this._handlePageSelection(this.page-1,i)}_nextPage(i){if(this.page>=this.totalPages){!this.pagingHref&&i&&i.preventDefault();return}this._handlePageSelection(this.page+1,i)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this._onResize),this._resizeObserver=new ResizeObserver(this._onResize),this._resizeObserver.observe(this),this._onResize()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._onResize),this._resizeObserver?.disconnect(),this._resizeObserver=void 0}mapSpacingToken(i){if(i==null)return;const a=String(i).trim();if(a)return/^\d+$/.test(a)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(a,10)))})`:a}__applySpacing(){const i=this.mapSpacingToken(this.spacing),a=this.mapSpacingToken(this.spacingTop)??i,e=this.mapSpacingToken(this.spacingBottom)??i,s=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);a?this.style.setProperty("--scb-pagination-spacing-block-start",a):this.style.removeProperty("--scb-pagination-spacing-block-start"),e?this.style.setProperty("--scb-pagination-spacing-block-end",e):this.style.removeProperty("--scb-pagination-spacing-block-end"),s?this.style.setProperty("--scb-pagination-spacing-inline-start",s):this.style.removeProperty("--scb-pagination-spacing-inline-start"),n?this.style.setProperty("--scb-pagination-spacing-inline-end",n):this.style.removeProperty("--scb-pagination-spacing-inline-end")}firstUpdated(){this.__applySpacing()}updated(i){super.updated(i),(i.has("spacing")||i.has("spacingTop")||i.has("spacingBottom")||i.has("spacingLeft")||i.has("spacingRight"))&&this.__applySpacing()}render(){if(this.totalPages===0)return null;const i=this.variant?`${this.variant.toLowerCase()}`:"",a=this.alignment==="center"||this.alignment==="end"?`align-${this.alignment}`:"align-start",e=[],{page:s,totalPages:n}=this,b=this.isNarrow,m=b?1:2,f=this._getPagingHref(Math.max(1,this.page-1)),x=this._getPagingHref(Math.min(this.totalPages,this.page+1)),d=this.page===1,h=this.page===this.totalPages,l=L(this,"--scb-pagination-design-navigation-button-size-medium",["small","medium","large"],"medium"),w=this.pagingHref?this.variant==="icon"?g`<scb-icon-button
2
2
  size=${l}
3
3
  class="paging-action-link"
4
4
  href=${d?v:f}
@@ -1,4 +1,4 @@
1
- import{f as $,g as v,h as k,m as T,p as a,v as d,y as S}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{ensureFocusRingOnFocusVisible as f}from"../shared/lazy-focus-ring.js";import{t as r}from"../../vendor/decorate.js";import{closeManualPopover as m,isManualPopoverOpen as y,openManualPopover as E}from"../shared/manual-popover.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,p,l){try{customElements.get(t)||e(t,p,l)}catch(i){var o=String(i||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var b,s=(b=class extends k{constructor(...e){super(...e),this.width="100%",this.active=!1,this.current=!1,this.disabled=!1,this.href="",this.label="",this.position="top",this._stepId=`scb-step-${Math.random().toString(36).slice(2)}`,this._showTooltip=()=>{const t=this.renderRoot.querySelector(".tooltip"),p=this.renderRoot.querySelector(".progress-step");!this.label||this.disabled||!E(t,p,"hint")||this._adjustTooltipPosition()},this._hideTooltip=()=>{m(this.renderRoot.querySelector(".tooltip"))},this._adjustTooltipPosition=()=>{const t=this.renderRoot.querySelector(".tooltip"),p=this.renderRoot.querySelector(".progress-step");if(!t||!p||!y(t))return;const l=10,o=8,i=p.getBoundingClientRect(),n=t.getBoundingClientRect(),w=this.position==="top",u=i.bottom+l+n.height<=window.innerHeight-o,g=i.top-l-n.height>=o,h=w?u||!g:!g&&u,_=Math.min(Math.max(i.left+(i.width-n.width)/2,o),Math.max(o,window.innerWidth-n.width-o)),x=h?Math.min(i.bottom+l,window.innerHeight-n.height-o):Math.max(o,i.top-l-n.height);t.classList.toggle("top",h),t.classList.toggle("bottom",!h),t.classList.remove("tooltip-left","tooltip-right"),t.style.left=`${_}px`,t.style.right="",t.style.top=`${x}px`,t.style.bottom="auto",t.style.transform="none"}}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}disconnectedCallback(){this._tooltipObserver?.disconnect(),window.removeEventListener("resize",this._adjustTooltipPosition),window.removeEventListener("scroll",this._adjustTooltipPosition,!0),m(this.renderRoot.querySelector(".tooltip")),super.disconnectedCallback()}updated(e){super.updated?.(e),this.style.setProperty("--progress-step-width",this.width),(e.has("label")||e.has("position"))&&y(this.renderRoot.querySelector(".tooltip"))&&this._adjustTooltipPosition()}_onClick(){if(this.disabled)return;const e={width:this.width,label:this.label,active:this.active,disabled:this.disabled,href:this.href||void 0};this.dispatchEvent(new CustomEvent("step-click",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("stepclick",{detail:e,bubbles:!0,composed:!0}))}_onKeydown(e){if(e.key==="Tab"){this._hideTooltip();return}this.disabled||this.href||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this._onClick())}firstUpdated(e){super.firstUpdated?.(e),this._setupTooltipPositioning()}_setupTooltipPositioning(){this._tooltipObserver=new MutationObserver(()=>this._adjustTooltipPosition()),this._tooltipObserver.observe(this,{attributes:!0}),window.addEventListener("resize",this._adjustTooltipPosition),window.addEventListener("scroll",this._adjustTooltipPosition,{passive:!0,capture:!0})}render(){const e=!!this.href&&!this.disabled,t=this.label?.trim()||"Steg";return d`
1
+ import{f as $,g as v,h as k,m as T,p as a,v as d,y as S}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{n as f}from"../../vendor/lazy-focus-ring.js";import{t as r}from"../../vendor/decorate.js";import{a as E,i as m,t as y}from"../../vendor/manual-popover.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,p,l){try{customElements.get(t)||e(t,p,l)}catch(i){var o=String(i||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw i}}}}catch{}})();var b,s=(b=class extends k{constructor(...e){super(...e),this.width="100%",this.active=!1,this.current=!1,this.disabled=!1,this.href="",this.label="",this.position="top",this._stepId=`scb-step-${Math.random().toString(36).slice(2)}`,this._showTooltip=()=>{const t=this.renderRoot.querySelector(".tooltip"),p=this.renderRoot.querySelector(".progress-step");!this.label||this.disabled||!E(t,p,"hint")||this._adjustTooltipPosition()},this._hideTooltip=()=>{y(this.renderRoot.querySelector(".tooltip"))},this._adjustTooltipPosition=()=>{const t=this.renderRoot.querySelector(".tooltip"),p=this.renderRoot.querySelector(".progress-step");if(!t||!p||!m(t))return;const l=10,o=8,i=p.getBoundingClientRect(),n=t.getBoundingClientRect(),w=this.position==="top",u=i.bottom+l+n.height<=window.innerHeight-o,g=i.top-l-n.height>=o,h=w?u||!g:!g&&u,_=Math.min(Math.max(i.left+(i.width-n.width)/2,o),Math.max(o,window.innerWidth-n.width-o)),x=h?Math.min(i.bottom+l,window.innerHeight-n.height-o):Math.max(o,i.top-l-n.height);t.classList.toggle("top",h),t.classList.toggle("bottom",!h),t.classList.remove("tooltip-left","tooltip-right"),t.style.left=`${_}px`,t.style.right="",t.style.top=`${x}px`,t.style.bottom="auto",t.style.transform="none"}}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}disconnectedCallback(){this._tooltipObserver?.disconnect(),window.removeEventListener("resize",this._adjustTooltipPosition),window.removeEventListener("scroll",this._adjustTooltipPosition,!0),y(this.renderRoot.querySelector(".tooltip")),super.disconnectedCallback()}updated(e){super.updated?.(e),this.style.setProperty("--progress-step-width",this.width),(e.has("label")||e.has("position"))&&m(this.renderRoot.querySelector(".tooltip"))&&this._adjustTooltipPosition()}_onClick(){if(this.disabled)return;const e={width:this.width,label:this.label,active:this.active,disabled:this.disabled,href:this.href||void 0};this.dispatchEvent(new CustomEvent("step-click",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("stepclick",{detail:e,bubbles:!0,composed:!0}))}_onKeydown(e){if(e.key==="Tab"){this._hideTooltip();return}this.disabled||this.href||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this._onClick())}firstUpdated(e){super.firstUpdated?.(e),this._setupTooltipPositioning()}_setupTooltipPositioning(){this._tooltipObserver=new MutationObserver(()=>this._adjustTooltipPosition()),this._tooltipObserver.observe(this,{attributes:!0}),window.addEventListener("resize",this._adjustTooltipPosition),window.addEventListener("scroll",this._adjustTooltipPosition,{passive:!0,capture:!0})}render(){const e=!!this.href&&!this.disabled,t=this.label?.trim()||"Steg";return d`
2
2
  ${e?d`
3
3
  <a
4
4
  id=${this._stepId}
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-list/scb-list.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../../vendor/component-defaults.js","../../vendor/decorate.js","../scb-list/scb-list-item.js","../../vendor/preload-helper.js","../shared/component-size-token.js"])))=>i.map(i=>d[i]);
2
- import{f as w,g as b,h as k,m as z,p as c,v as d,y as S}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as A}from"../../vendor/preload-helper.js";import{ensureFocusRingReady as E}from"../shared/lazy-focus-ring.js";import{componentSizeToken as V}from"../shared/component-size-token.js";import{t as I}from"../../vendor/component-defaults.js";import{t as n}from"../../vendor/decorate.js";import{closeManualPopover as _,isManualPopoverOpen as L,openManualPopover as R}from"../shared/manual-popover.js";(function(){try{var f=typeof globalThis<"u"?globalThis:window;if(!f.__scb_ce_guard_installed__){f.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,t,r){try{customElements.get(s)||e(s,t,r)}catch(l){var i=String(l||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var m,C=0,a=(m=class extends k{async _ensureListDepsLoaded(){this._listDepsLoaded||(this._listDepsPromise??(this._listDepsPromise=A(()=>import("../scb-list/scb-list.js").then(()=>{this._listDepsLoaded=!0}),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),await this._listDepsPromise)}_ensureListDepsWhenNeeded(){const e=(this.value??"").trim().length>0;!this._inputFocused||!e||!this._hasSuggestions||this._ensureListDepsLoaded().then(()=>this.requestUpdate())}constructor(){super(),this._internals=null,this.supportingText="",this.inputLabel="",this.clearLabel="Rensa sökfält",this.suggestionsLabel="Sökförslag",this.errorText="",this.value="",this.name="",this.disabled=!1,this.required=!1,this.error=!1,this.autocomplete=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size=I["scb-search"].size,this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._listDepsLoaded=!1,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++C}`,this._kbMode=!1,this._valueOnFocus="",this._lastChangeValue="",this._kbShouldShowRing=!1,this._onGlobalKeydown=e=>{e.key==="Tab"&&(E(),this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue="",this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._onViewportScroll=()=>{this._positionSuggestionPopover()},this._listScrollHandler=()=>{const e=this._getActiveItem();this._kbMode&&e&&this._positionOptionRing(e)},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="extra-small"?this.setAttribute("data-density","-5"):this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._onWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._onWindowResize,{passive:!0}),window.addEventListener("scroll",this._onViewportScroll,{passive:!0,capture:!0}),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0),this._initialValue=this.value??"",this._lastChangeValue=this.value??"",this._form=this.closest("form"),this._form&&(this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const e=this._inputEl();e&&(e.value=this._initialValue),this._lastChangeValue=this._initialValue,this._syncFormValue(),this._filterSuggestions(this.value),this._activeIndex=-1,this._kbMode=!1,this.error=!1,this._hasValidationBeenReported=!1,this._updateComboboxA11y(),this._syncValidity()},this._form.addEventListener("reset",this._formResetHandler,!0)),this._syncFormValue(),this._syncValidity()}disconnectedCallback(){const e=this._inputEl();e&&this._boundNativeKeydown&&e.removeEventListener("keydown",this._boundNativeKeydown,!0),this._detachListScrollListener(),window.removeEventListener("resize",this._onWindowResize),window.removeEventListener("scroll",this._onViewportScroll,!0),_(this._listEl()),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),super.disconnectedCallback()}firstUpdated(){this._ensureListboxA11y(),this._updateComboboxA11y();const e=this._inputEl();e&&(this._boundNativeKeydown=s=>this._handleKey(s),e.addEventListener("keydown",this._boundNativeKeydown,!0),e.disabled=this.disabled),this.applySpacing()}updated(e){if(super.updated(e),e.has("size")&&this._syncDensityForSize(),this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener(),this._syncSuggestionPopover(),(e.has("value")||e.has("disabled"))&&this._syncFormValue(),(e.has("value")||e.has("disabled")||e.has("required")||e.has("errorText"))&&this._syncValidity(),e.has("disabled")){this.toggleAttribute("aria-disabled",this.disabled);const s=this._inputEl();s&&(s.disabled=this.disabled)}(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.applySpacing()}render(){const e=(this.value??"").trim().length>0,s=this._inputFocused&&e&&this._hasSuggestions&&this._listDepsLoaded,t=this.error?this._validationMessage||this.errorText||"Ogiltig sökning.":"",r=t?"search-supporting-text":void 0,i=this.inputLabel||this.supportingText||"Sök";return d`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-list/scb-list.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../../vendor/component-defaults.js","../../vendor/decorate.js","../scb-list/scb-list-item.js","../../vendor/preload-helper.js","../../vendor/component-size-token.js"])))=>i.map(i=>d[i]);
2
+ import{f as w,g as b,h as k,m as z,p as c,v as d,y as S}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as A}from"../../vendor/preload-helper.js";import{r as E}from"../../vendor/lazy-focus-ring.js";import{t as V}from"../../vendor/component-size-token.js";import{t as I}from"../../vendor/component-defaults.js";import{t as n}from"../../vendor/decorate.js";import{a as L,i as R,t as _}from"../../vendor/manual-popover.js";(function(){try{var f=typeof globalThis<"u"?globalThis:window;if(!f.__scb_ce_guard_installed__){f.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,t,r){try{customElements.get(s)||e(s,t,r)}catch(l){var i=String(l||"");if(i.indexOf("already been used")===-1&&i.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var m,C=0,a=(m=class extends k{async _ensureListDepsLoaded(){this._listDepsLoaded||(this._listDepsPromise??(this._listDepsPromise=A(()=>import("../scb-list/scb-list.js").then(()=>{this._listDepsLoaded=!0}),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),await this._listDepsPromise)}_ensureListDepsWhenNeeded(){const e=(this.value??"").trim().length>0;!this._inputFocused||!e||!this._hasSuggestions||this._ensureListDepsLoaded().then(()=>this.requestUpdate())}constructor(){super(),this._internals=null,this.supportingText="",this.inputLabel="",this.clearLabel="Rensa sökfält",this.suggestionsLabel="Sökförslag",this.errorText="",this.value="",this.name="",this.disabled=!1,this.required=!1,this.error=!1,this.autocomplete=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.size=I["scb-search"].size,this.fullScreen=!1,this._inputFocused=!1,this._visibleSuggestions=0,this._listDepsLoaded=!1,this._activeIndex=-1,this._listboxId=`scb-search-listbox-${++C}`,this._kbMode=!1,this._valueOnFocus="",this._lastChangeValue="",this._kbShouldShowRing=!1,this._onGlobalKeydown=e=>{e.key==="Tab"&&(E(),this._kbShouldShowRing=!0,this._inputFocused&&this._updateInputRingVisibility())},this._onGlobalPointerDown=()=>{this._kbShouldShowRing=!1,this._inputFocused&&this._updateInputRingVisibility()},this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue="",this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._onViewportScroll=()=>{this._positionSuggestionPopover()},this._listScrollHandler=()=>{const e=this._getActiveItem();this._kbMode&&e&&this._positionOptionRing(e)},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="extra-small"?this.setAttribute("data-density","-5"):this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),this._syncDensityForSize(),this._onWindowResize=this._onWindowResize.bind(this),window.addEventListener("resize",this._onWindowResize,{passive:!0}),window.addEventListener("scroll",this._onViewportScroll,{passive:!0,capture:!0}),window.addEventListener("keydown",this._onGlobalKeydown,!0),window.addEventListener("pointerdown",this._onGlobalPointerDown,!0),this._initialValue=this.value??"",this._lastChangeValue=this.value??"",this._form=this.closest("form"),this._form&&(this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("submit",this._formSubmitHandler,!0),this._formResetHandler=()=>{this.value=this._initialValue;const e=this._inputEl();e&&(e.value=this._initialValue),this._lastChangeValue=this._initialValue,this._syncFormValue(),this._filterSuggestions(this.value),this._activeIndex=-1,this._kbMode=!1,this.error=!1,this._hasValidationBeenReported=!1,this._updateComboboxA11y(),this._syncValidity()},this._form.addEventListener("reset",this._formResetHandler,!0)),this._syncFormValue(),this._syncValidity()}disconnectedCallback(){const e=this._inputEl();e&&this._boundNativeKeydown&&e.removeEventListener("keydown",this._boundNativeKeydown,!0),this._detachListScrollListener(),window.removeEventListener("resize",this._onWindowResize),window.removeEventListener("scroll",this._onViewportScroll,!0),_(this._listEl()),window.removeEventListener("keydown",this._onGlobalKeydown,!0),window.removeEventListener("pointerdown",this._onGlobalPointerDown,!0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),super.disconnectedCallback()}firstUpdated(){this._ensureListboxA11y(),this._updateComboboxA11y();const e=this._inputEl();e&&(this._boundNativeKeydown=s=>this._handleKey(s),e.addEventListener("keydown",this._boundNativeKeydown,!0),e.disabled=this.disabled),this.applySpacing()}updated(e){if(super.updated(e),e.has("size")&&this._syncDensityForSize(),this._ensureListboxA11y(),this._updateComboboxA11y(),this._attachListScrollListener(),this._syncSuggestionPopover(),(e.has("value")||e.has("disabled"))&&this._syncFormValue(),(e.has("value")||e.has("disabled")||e.has("required")||e.has("errorText"))&&this._syncValidity(),e.has("disabled")){this.toggleAttribute("aria-disabled",this.disabled);const s=this._inputEl();s&&(s.disabled=this.disabled)}(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.applySpacing()}render(){const e=(this.value??"").trim().length>0,s=this._inputFocused&&e&&this._hasSuggestions&&this._listDepsLoaded,t=this.error?this._validationMessage||this.errorText||"Ogiltig sökning.":"",r=t?"search-supporting-text":void 0,i=this.inputLabel||this.supportingText||"Sök";return d`
3
3
  <div class="ripple-wrapper">
4
4
  <md-icon class="leading">${e?"arrow_back":"search"}</md-icon>
5
5
 
@@ -50,7 +50,7 @@ import{f as w,g as b,h as k,m as z,p as c,v as d,y as S}from"../../vendor/vendor
50
50
  <md-focus-ring id="optionRing" class="option-ring"></md-focus-ring>
51
51
  `:b}
52
52
  ${t?d`<span id="search-supporting-text" class="supporting-text">${t}</span>`:b}
53
- `}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.value??"").trim()?this.errorText||"Fyll i det här fältet.":""}_syncValidity(){const e=this._inputEl(),s=this.disabled?"":this._getValidationMessage(),t=this.error,r=this._validationMessage;if(e&&e.setCustomValidity(s),this._internals)if(s){const i=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(i,s,e??void 0)}else this._internals.setValidity({});this._validationMessage=s,this.error=this.disabled?!1:s?this._hasValidationBeenReported||t:t&&!this._hasValidationBeenReported&&!r,e&&e.setAttribute("aria-invalid",this.error?"true":"false"),this.toggleAttribute("aria-invalid",this.error),(t!==this.error||r!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this._syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){this._hasValidationBeenReported=!0,this._syncValidity();const e=this._inputEl();return e?e.reportValidity():this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??""),this._syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}submit(){const e=this._getActiveItem(),s={value:this.value};e&&(s.active=this._itemPayload(e)),this._dispatchSubmit(s)}focus(e){const s=this._inputEl();if(s){s.focus(e);return}this.updateComplete.then(()=>this._inputEl()?.focus(e))}blur(){this._inputEl()?.blur()}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded()}_onInput(e){e.stopPropagation();const s=e.target;this.value=s.value,this._syncFormValue(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y();const t={value:this.value};this.dispatchEvent(new CustomEvent("scb-search-input",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchinput",{detail:t,bubbles:!0,composed:!0})),this._dispatchStandardInput()}_onNativeChange(e){e.stopPropagation()}_onFocus(){this.disabled||(this._valueOnFocus=this.value??"",this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this._valueOnFocus!==(this.value??"")&&this._dispatchStandardChangeIfNeeded(),this.requestUpdate()},100)}_updateInputRingVisibility(){const e=this.renderRoot?.querySelector(".ripple-wrapper");e&&(this._inputFocused&&this._kbShouldShowRing?e.setAttribute("data-kb-focus","true"):e.removeAttribute("data-kb-focus"))}_handleKey(e){if(this.disabled||!this._inputEl())return;const s=this._getVisibleItems(),t=(this.value??"").trim().length>0,r=this._inputFocused&&t&&s.length>0,i=e.key,l=e.keyCode,h=i==="ArrowDown"||i==="Down"||l===40,g=i==="ArrowUp"||i==="Up"||l===38,o=i==="Home"||l===36,p=i==="End"||l===35,u=i==="Enter"||l===13,y=i==="Escape"||i==="Esc"||l===27;if(h){if(!r)return;e.preventDefault(),this._kbMode=!0,this._moveActive(s,1);return}if(g){if(!r)return;e.preventDefault(),this._kbMode=!0,this._moveActive(s,-1);return}if(o){if(!r)return;e.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(p){if(!r)return;e.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?s.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(u){if(!r){const v=this._internals?.form??this._form??this.closest("form");v?(e.preventDefault(),this.reportValidity()&&v.requestSubmit()):this.submit();return}e.preventDefault();const x=this._getActiveItem();if(x){const v=x.getAttribute("label")||"";this.value=v,this._syncFormValue(),this._dispatchStandardInput(),this._dispatchSubmit({value:this.value,active:this._itemPayload(x)}),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(y){e.preventDefault(),this._clearInput();return}}_clearInput(){if(this.disabled)return;this.value="",this._activeIndex=-1,this._kbMode=!1;const e=this._inputEl();e&&(e.value="",e.focus()),this._filterSuggestions(""),this._updateComboboxA11y(),this._hideOptionRing(),this._syncFormValue(),this._dispatchStandardInput(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchclear",{bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}_filterSuggestions(e){const s=(e??"").trim().toLowerCase(),t=Array.from(this.querySelectorAll("scb-list-item"));let r=0;for(const i of t){const l=`${(i.getAttribute("label")||"").toLowerCase()} ${(i.getAttribute("supporting-text")||"").toLowerCase()}`.trim();s!==""&&l.includes(s)?(i.removeAttribute("hidden"),r++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=r,this._activeIndex>=r&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector("#searchInput")??null}_listEl(){return this.renderRoot?.querySelector("scb-list.suggestion-list")??null}_ringEl(){return this.renderRoot?.querySelector("#optionRing")??null}_getVisibleItems(){return Array.from(this.querySelectorAll("scb-list-item")).filter(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_getActiveItem(){const e=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=e.length?null:e[this._activeIndex]??null}_moveActive(e,s){if(!e.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let t=this._activeIndex+s;this._activeIndex===-1?t=s>0?0:e.length-1:(t<0&&(t=0),t>=e.length&&(t=e.length-1)),this._activeIndex=t,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){const e=this._getActiveItem(),s=this._listEl();if(!e||!s)return;const t=s.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<t.top?s.scrollTop-=t.top-r.top:r.bottom>t.bottom&&(s.scrollTop+=r.bottom-t.bottom)}_itemPayload(e){return{label:e.getAttribute("label")||"",supportingText:e.getAttribute("supporting-text")||"",href:e.getAttribute("href")||"",type:e.getAttribute("type")||"",id:e.id||""}}_ensureListboxA11y(){const e=this._listEl();e&&(e.id||(e.id=this._listboxId),e.setAttribute("role","listbox"),e.setAttribute("aria-label",this.suggestionsLabel)),Array.from(this.querySelectorAll("scb-list-item")).forEach(s=>this._ensureOptionA11y(s))}_ensureOptionA11y(e){e.id||(e.id=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`),e.setAttribute("role","option"),e.setAttribute("tabindex","-1")}_updateComboboxA11y(){const e=this._inputEl();if(!e)return;const s=this._getVisibleItems(),t=(this.value??"").trim().length>0,r=this._inputFocused&&t&&s.length>0;e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls",this._listboxId),e.setAttribute("aria-expanded",String(r));const i=r?this._getActiveItem():null;"ariaActiveDescendantElement"in Element.prototype?e.ariaActiveDescendantElement=i:i?.id?e.setAttribute("aria-activedescendant",i.id):e.removeAttribute("aria-activedescendant"),this._kbMode&&i&&r?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(e){const s=this._ringEl(),t=this._listEl();if(!s||!t)return;const r=this.getBoundingClientRect(),i=e.getBoundingClientRect(),l=i.top-r.top,h=i.left-r.left,g=i.width,o=i.height;s.style.top=`${l}px`,s.style.left=`${h}px`,s.style.width=`${g}px`,s.style.height=`${o}px`,s.setAttribute("data-show","true")}_hideOptionRing(){const e=this._ringEl();e&&e.removeAttribute("data-show")}_onWindowResize(){const e=this._getActiveItem();this._kbMode&&e&&this._positionOptionRing(e),this._positionSuggestionPopover()}_syncSuggestionPopover(){const e=this._listEl();if(!e||this.fullScreen){_(e);return}R(e)&&requestAnimationFrame(()=>this._positionSuggestionPopover())}_positionSuggestionPopover(){const e=this._listEl(),s=this._inputEl();if(!e||!s||!L(e))return;const t=s.getBoundingClientRect(),r=8,i=Math.max(0,window.innerWidth-r*2),l=Math.min(t.width,i),h=Math.min(Math.max(t.left,r),window.innerWidth-r-l),g=e.getBoundingClientRect().height||e.scrollHeight,o=window.innerHeight-t.bottom-r,p=t.top-r,u=g>o&&p>o,y=Math.max(0,u?p:o);e.style.position="fixed",e.style.left=`${Math.round(h)}px`,e.style.width=`${Math.round(l)}px`,e.style.right="auto",e.style.maxHeight=`${Math.round(y)}px`,u?(e.style.top="auto",e.style.bottom=`${Math.round(window.innerHeight-t.top)}px`):(e.style.top=`${Math.round(t.bottom)}px`,e.style.bottom="auto")}_attachListScrollListener(){const e=this._listEl();!e||this._listWithHandler===e||(this._detachListScrollListener(),e.addEventListener("scroll",this._listScrollHandler,{passive:!0}),this._listWithHandler=e)}_detachListScrollListener(){this._listWithHandler&&(this._listWithHandler.removeEventListener("scroll",this._listScrollHandler),this._listWithHandler=void 0)}_dispatchStandardInput(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}_dispatchStandardChangeIfNeeded(){const e=this.value??"";e!==this._lastChangeValue&&(this._lastChangeValue=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_dispatchSubmit(e){this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchsubmit",{detail:e,bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}mapSpacingToken(e){if(!e)return;const s=String(e).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}applySpacing(){const e=this.mapSpacingToken(this.spacing),s=this.mapSpacingToken(this.spacingTop)??e,t=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);s?this.style.setProperty("--scb-search-spacing-block-start",s):this.style.removeProperty("--scb-search-spacing-block-start"),t?this.style.setProperty("--scb-search-spacing-block-end",t):this.style.removeProperty("--scb-search-spacing-block-end"),r?this.style.setProperty("--scb-search-spacing-inline-start",r):this.style.removeProperty("--scb-search-spacing-inline-start"),i?this.style.setProperty("--scb-search-spacing-inline-end",i):this.style.removeProperty("--scb-search-spacing-inline-end")}_syncFormValue(){if(!this._internals)return;const e=this.disabled?null:this.value;this._internals.setFormValue(e)}},m.formAssociated=!0,m.styles=S`:host{--scb-fields-text-font-weight-current:var(--scb-fields-text-medium-font-weight, var(--scb-fields-text-medium-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-medium-letter-spacing, var(--scb-fields-text-medium-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-medium-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-medium-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-medium-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-medium-font-weight, var(--scb-fields-label-medium-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-medium-letter-spacing, var(--scb-fields-label-medium-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-medium-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-medium-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-medium-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-medium-font-weight, var(--scb-fields-supporting-medium-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-medium-letter-spacing, var(--scb-fields-supporting-medium-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-medium-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-medium-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-medium-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-medium-font-weight, var(--scb-fields-option-text-medium-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-medium-letter-spacing, var(--scb-fields-option-text-medium-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-medium-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-medium-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-medium-font, var(--scb-fields-option-text-font));display:flex;flex-direction:column;position:relative;color:var(--scb-fields-content-color, var(--md-sys-color-on-surface));--md-focus-ring-color:var(--scb-fields-focus-color, var(--md-sys-color-primary));-webkit-tap-highlight-color:transparent;margin-block-start:var(--scb-search-spacing-block-start, 0);margin-block-end:var(--scb-search-spacing-block-end, 0);margin-inline-start:var(--scb-search-spacing-inline-start, 0);margin-inline-end:var(--scb-search-spacing-inline-end, 0);--scb-search-radius:var(--scb-search-design-surface-radius-medium);--scb-search-open-radius:var(--radius-xl, 24px);--scb-search-height:var(--scb-search-design-height-medium);--scb-search-padding-x:var(--scb-search-design-search-padding-inline-medium);--scb-search-padding-y:var(--scb-search-design-padding-block-medium);--scb-search-leading-size:var(--scb-search-design-search-action-size-medium);--scb-search-trailing-size:var(--scb-search-design-search-action-size-medium);--scb-search-gap:var(--scb-search-design-search-icon-gap);--scb-search-leading-gap:calc(
53
+ `}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.value??"").trim()?this.errorText||"Fyll i det här fältet.":""}_syncValidity(){const e=this._inputEl(),s=this.disabled?"":this._getValidationMessage(),t=this.error,r=this._validationMessage;if(e&&e.setCustomValidity(s),this._internals)if(s){const i=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(i,s,e??void 0)}else this._internals.setValidity({});this._validationMessage=s,this.error=this.disabled?!1:s?this._hasValidationBeenReported||t:t&&!this._hasValidationBeenReported&&!r,e&&e.setAttribute("aria-invalid",this.error?"true":"false"),this.toggleAttribute("aria-invalid",this.error),(t!==this.error||r!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this._syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){this._hasValidationBeenReported=!0,this._syncValidity();const e=this._inputEl();return e?e.reportValidity():this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??""),this._syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}submit(){const e=this._getActiveItem(),s={value:this.value};e&&(s.active=this._itemPayload(e)),this._dispatchSubmit(s)}focus(e){const s=this._inputEl();if(s){s.focus(e);return}this.updateComplete.then(()=>this._inputEl()?.focus(e))}blur(){this._inputEl()?.blur()}get _hasSuggestions(){return this._visibleSuggestions>=0?this._visibleSuggestions>0:Array.from(this.getElementsByTagName("scb-list-item")).some(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_onSlotChange(){this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded()}_onInput(e){e.stopPropagation();const s=e.target;this.value=s.value,this._syncFormValue(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._activeIndex=-1,this._kbMode=!1,this._updateComboboxA11y();const t={value:this.value};this.dispatchEvent(new CustomEvent("scb-search-input",{detail:t,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchinput",{detail:t,bubbles:!0,composed:!0})),this._dispatchStandardInput()}_onNativeChange(e){e.stopPropagation()}_onFocus(){this.disabled||(this._valueOnFocus=this.value??"",this._inputFocused=!0,this._updateInputRingVisibility(),this._filterSuggestions(this.value),this._ensureListDepsWhenNeeded(),this._updateComboboxA11y(),this.requestUpdate())}_onBlur(){setTimeout(()=>{this._inputFocused=!1,this._activeIndex=-1,this._kbMode=!1,this._updateInputRingVisibility(),this._updateComboboxA11y(),this._hideOptionRing(),this._valueOnFocus!==(this.value??"")&&this._dispatchStandardChangeIfNeeded(),this.requestUpdate()},100)}_updateInputRingVisibility(){const e=this.renderRoot?.querySelector(".ripple-wrapper");e&&(this._inputFocused&&this._kbShouldShowRing?e.setAttribute("data-kb-focus","true"):e.removeAttribute("data-kb-focus"))}_handleKey(e){if(this.disabled||!this._inputEl())return;const s=this._getVisibleItems(),t=(this.value??"").trim().length>0,r=this._inputFocused&&t&&s.length>0,i=e.key,l=e.keyCode,h=i==="ArrowDown"||i==="Down"||l===40,g=i==="ArrowUp"||i==="Up"||l===38,o=i==="Home"||l===36,p=i==="End"||l===35,u=i==="Enter"||l===13,y=i==="Escape"||i==="Esc"||l===27;if(h){if(!r)return;e.preventDefault(),this._kbMode=!0,this._moveActive(s,1);return}if(g){if(!r)return;e.preventDefault(),this._kbMode=!0,this._moveActive(s,-1);return}if(o){if(!r)return;e.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?0:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(p){if(!r)return;e.preventDefault(),this._kbMode=!0,this._activeIndex=s.length?s.length-1:-1,this._updateComboboxA11y(),this._scrollActiveIntoView();return}if(u){if(!r){const v=this._internals?.form??this._form??this.closest("form");v?(e.preventDefault(),this.reportValidity()&&v.requestSubmit()):this.submit();return}e.preventDefault();const x=this._getActiveItem();if(x){const v=x.getAttribute("label")||"";this.value=v,this._syncFormValue(),this._dispatchStandardInput(),this._dispatchSubmit({value:this.value,active:this._itemPayload(x)}),this._visibleSuggestions=0,this._activeIndex=-1,this._kbMode=!1,this._hideOptionRing(),this.requestUpdate()}else this.submit();return}if(y){e.preventDefault(),this._clearInput();return}}_clearInput(){if(this.disabled)return;this.value="",this._activeIndex=-1,this._kbMode=!1;const e=this._inputEl();e&&(e.value="",e.focus()),this._filterSuggestions(""),this._updateComboboxA11y(),this._hideOptionRing(),this._syncFormValue(),this._dispatchStandardInput(),this.dispatchEvent(new CustomEvent("scb-search-clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchclear",{bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}_filterSuggestions(e){const s=(e??"").trim().toLowerCase(),t=Array.from(this.querySelectorAll("scb-list-item"));let r=0;for(const i of t){const l=`${(i.getAttribute("label")||"").toLowerCase()} ${(i.getAttribute("supporting-text")||"").toLowerCase()}`.trim();s!==""&&l.includes(s)?(i.removeAttribute("hidden"),r++):i.setAttribute("hidden",""),this._ensureOptionA11y(i)}this._visibleSuggestions=r,this._activeIndex>=r&&(this._activeIndex=-1),this._updateComboboxA11y(),this.requestUpdate()}_inputEl(){return this.renderRoot?.querySelector("#searchInput")??null}_listEl(){return this.renderRoot?.querySelector("scb-list.suggestion-list")??null}_ringEl(){return this.renderRoot?.querySelector("#optionRing")??null}_getVisibleItems(){return Array.from(this.querySelectorAll("scb-list-item")).filter(e=>!e.hasAttribute("hidden")&&e.style.display!=="none")}_getActiveItem(){const e=this._getVisibleItems();return this._activeIndex<0||this._activeIndex>=e.length?null:e[this._activeIndex]??null}_moveActive(e,s){if(!e.length){this._activeIndex=-1,this._updateComboboxA11y(),this._hideOptionRing();return}let t=this._activeIndex+s;this._activeIndex===-1?t=s>0?0:e.length-1:(t<0&&(t=0),t>=e.length&&(t=e.length-1)),this._activeIndex=t,this._updateComboboxA11y(),this._scrollActiveIntoView()}_scrollActiveIntoView(){const e=this._getActiveItem(),s=this._listEl();if(!e||!s)return;const t=s.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<t.top?s.scrollTop-=t.top-r.top:r.bottom>t.bottom&&(s.scrollTop+=r.bottom-t.bottom)}_itemPayload(e){return{label:e.getAttribute("label")||"",supportingText:e.getAttribute("supporting-text")||"",href:e.getAttribute("href")||"",type:e.getAttribute("type")||"",id:e.id||""}}_ensureListboxA11y(){const e=this._listEl();e&&(e.id||(e.id=this._listboxId),e.setAttribute("role","listbox"),e.setAttribute("aria-label",this.suggestionsLabel)),Array.from(this.querySelectorAll("scb-list-item")).forEach(s=>this._ensureOptionA11y(s))}_ensureOptionA11y(e){e.id||(e.id=`${this._listboxId}-opt-${Math.random().toString(36).slice(2,8)}`),e.setAttribute("role","option"),e.setAttribute("tabindex","-1")}_updateComboboxA11y(){const e=this._inputEl();if(!e)return;const s=this._getVisibleItems(),t=(this.value??"").trim().length>0,r=this._inputFocused&&t&&s.length>0;e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls",this._listboxId),e.setAttribute("aria-expanded",String(r));const i=r?this._getActiveItem():null;"ariaActiveDescendantElement"in Element.prototype?e.ariaActiveDescendantElement=i:i?.id?e.setAttribute("aria-activedescendant",i.id):e.removeAttribute("aria-activedescendant"),this._kbMode&&i&&r?this._positionOptionRing(i):this._hideOptionRing()}_positionOptionRing(e){const s=this._ringEl(),t=this._listEl();if(!s||!t)return;const r=this.getBoundingClientRect(),i=e.getBoundingClientRect(),l=i.top-r.top,h=i.left-r.left,g=i.width,o=i.height;s.style.top=`${l}px`,s.style.left=`${h}px`,s.style.width=`${g}px`,s.style.height=`${o}px`,s.setAttribute("data-show","true")}_hideOptionRing(){const e=this._ringEl();e&&e.removeAttribute("data-show")}_onWindowResize(){const e=this._getActiveItem();this._kbMode&&e&&this._positionOptionRing(e),this._positionSuggestionPopover()}_syncSuggestionPopover(){const e=this._listEl();if(!e||this.fullScreen){_(e);return}L(e)&&requestAnimationFrame(()=>this._positionSuggestionPopover())}_positionSuggestionPopover(){const e=this._listEl(),s=this._inputEl();if(!e||!s||!R(e))return;const t=s.getBoundingClientRect(),r=8,i=Math.max(0,window.innerWidth-r*2),l=Math.min(t.width,i),h=Math.min(Math.max(t.left,r),window.innerWidth-r-l),g=e.getBoundingClientRect().height||e.scrollHeight,o=window.innerHeight-t.bottom-r,p=t.top-r,u=g>o&&p>o,y=Math.max(0,u?p:o);e.style.position="fixed",e.style.left=`${Math.round(h)}px`,e.style.width=`${Math.round(l)}px`,e.style.right="auto",e.style.maxHeight=`${Math.round(y)}px`,u?(e.style.top="auto",e.style.bottom=`${Math.round(window.innerHeight-t.top)}px`):(e.style.top=`${Math.round(t.bottom)}px`,e.style.bottom="auto")}_attachListScrollListener(){const e=this._listEl();!e||this._listWithHandler===e||(this._detachListScrollListener(),e.addEventListener("scroll",this._listScrollHandler,{passive:!0}),this._listWithHandler=e)}_detachListScrollListener(){this._listWithHandler&&(this._listWithHandler.removeEventListener("scroll",this._listScrollHandler),this._listWithHandler=void 0)}_dispatchStandardInput(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0}))}_dispatchStandardChangeIfNeeded(){const e=this.value??"";e!==this._lastChangeValue&&(this._lastChangeValue=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}_dispatchSubmit(e){this.dispatchEvent(new CustomEvent("scb-search-submit",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbsearchsubmit",{detail:e,bubbles:!0,composed:!0})),this._dispatchStandardChangeIfNeeded()}mapSpacingToken(e){if(!e)return;const s=String(e).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}applySpacing(){const e=this.mapSpacingToken(this.spacing),s=this.mapSpacingToken(this.spacingTop)??e,t=this.mapSpacingToken(this.spacingBottom)??e,r=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);s?this.style.setProperty("--scb-search-spacing-block-start",s):this.style.removeProperty("--scb-search-spacing-block-start"),t?this.style.setProperty("--scb-search-spacing-block-end",t):this.style.removeProperty("--scb-search-spacing-block-end"),r?this.style.setProperty("--scb-search-spacing-inline-start",r):this.style.removeProperty("--scb-search-spacing-inline-start"),i?this.style.setProperty("--scb-search-spacing-inline-end",i):this.style.removeProperty("--scb-search-spacing-inline-end")}_syncFormValue(){if(!this._internals)return;const e=this.disabled?null:this.value;this._internals.setFormValue(e)}},m.formAssociated=!0,m.styles=S`:host{--scb-fields-text-font-weight-current:var(--scb-fields-text-medium-font-weight, var(--scb-fields-text-medium-weight, var(--scb-fields-text-font-weight, var(--scb-fields-text-weight))));--scb-fields-text-letter-spacing-current:var(--scb-fields-text-medium-letter-spacing, var(--scb-fields-text-medium-tracking, var(--scb-fields-text-letter-spacing, var(--scb-fields-text-tracking))));--scb-fields-text-line-height-current:var(--scb-fields-text-medium-line-height, var(--scb-fields-text-line-height));--scb-fields-text-size-current:var(--scb-fields-text-medium-size, var(--scb-fields-text-size));--scb-fields-text-font-current:var(--scb-fields-text-medium-font, var(--scb-fields-text-font));--scb-fields-label-font-weight-current:var(--scb-fields-label-medium-font-weight, var(--scb-fields-label-medium-weight, var(--scb-fields-label-font-weight, var(--scb-fields-label-weight))));--scb-fields-label-letter-spacing-current:var(--scb-fields-label-medium-letter-spacing, var(--scb-fields-label-medium-tracking, var(--scb-fields-label-letter-spacing, var(--scb-fields-label-tracking))));--scb-fields-label-line-height-current:var(--scb-fields-label-medium-line-height, var(--scb-fields-label-line-height));--scb-fields-label-size-current:var(--scb-fields-label-medium-size, var(--scb-fields-label-size));--scb-fields-label-font-current:var(--scb-fields-label-medium-font, var(--scb-fields-label-font));--scb-fields-supporting-font-weight-current:var(--scb-fields-supporting-medium-font-weight, var(--scb-fields-supporting-medium-weight, var(--scb-fields-supporting-font-weight, var(--scb-fields-supporting-weight))));--scb-fields-supporting-letter-spacing-current:var(--scb-fields-supporting-medium-letter-spacing, var(--scb-fields-supporting-medium-tracking, var(--scb-fields-supporting-letter-spacing, var(--scb-fields-supporting-tracking))));--scb-fields-supporting-line-height-current:var(--scb-fields-supporting-medium-line-height, var(--scb-fields-supporting-line-height));--scb-fields-supporting-size-current:var(--scb-fields-supporting-medium-size, var(--scb-fields-supporting-size));--scb-fields-supporting-font-current:var(--scb-fields-supporting-medium-font, var(--scb-fields-supporting-font));--scb-fields-option-text-font-weight-current:var(--scb-fields-option-text-medium-font-weight, var(--scb-fields-option-text-medium-weight, var(--scb-fields-option-text-font-weight, var(--scb-fields-option-text-weight))));--scb-fields-option-text-letter-spacing-current:var(--scb-fields-option-text-medium-letter-spacing, var(--scb-fields-option-text-medium-tracking, var(--scb-fields-option-text-letter-spacing, var(--scb-fields-option-text-tracking))));--scb-fields-option-text-line-height-current:var(--scb-fields-option-text-medium-line-height, var(--scb-fields-option-text-line-height));--scb-fields-option-text-size-current:var(--scb-fields-option-text-medium-size, var(--scb-fields-option-text-size));--scb-fields-option-text-font-current:var(--scb-fields-option-text-medium-font, var(--scb-fields-option-text-font));display:flex;flex-direction:column;position:relative;color:var(--scb-fields-content-color, var(--md-sys-color-on-surface));--md-focus-ring-color:var(--scb-fields-focus-color, var(--md-sys-color-primary));-webkit-tap-highlight-color:transparent;margin-block-start:var(--scb-search-spacing-block-start, 0);margin-block-end:var(--scb-search-spacing-block-end, 0);margin-inline-start:var(--scb-search-spacing-inline-start, 0);margin-inline-end:var(--scb-search-spacing-inline-end, 0);--scb-search-radius:var(--scb-search-design-surface-radius-medium);--scb-search-open-radius:var(--radius-xl, 24px);--scb-search-height:var(--scb-search-design-height-medium);--scb-search-padding-x:var(--scb-search-design-search-padding-inline-medium);--scb-search-padding-y:var(--scb-search-design-padding-block-medium);--scb-search-leading-size:var(--scb-search-design-search-action-size-medium);--scb-search-trailing-size:var(--scb-search-design-search-action-size-medium);--scb-search-gap:var(--scb-search-design-search-icon-gap);--scb-search-leading-gap:calc(
54
54
  var(--scb-search-padding-x) + var(--scb-search-leading-size) + var(--scb-search-gap)
55
55
  );--scb-search-trailing-gap:calc(
56
56
  var(--scb-search-padding-x) + var(--scb-search-trailing-size) + var(--scb-search-gap)
@@ -1,4 +1,4 @@
1
- import{h as p,m as v,p as a,v as s,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{ensureFocusRingOnFocusVisible as m}from"../shared/lazy-focus-ring.js";import{t as n}from"../../vendor/decorate.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,l){try{customElements.get(t)||e(t,i,l)}catch(o){var d=String(o||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var b,r=(b=class extends p{constructor(...e){super(...e),this.label="",this.value="",this.selected=!1,this.icon="",this.href="",this.disabled=!1,this.onHostKeydown=t=>{if(!this.href||this.isEffectivelyDisabled||t.code!=="Space"&&t.code!=="Enter"&&t.code!=="NumpadEnter")return;const i=this.shadowRoot?.querySelector("a[href]");i&&(t.preventDefault(),t.stopPropagation(),i.click())}}get isEffectivelyDisabled(){const e=this.parentElement?.hasAttribute?.("disabled");return this.disabled||!!e}get hasDefaultSlotContent(){return Array.from(this.childNodes).some(e=>e.nodeType===1?!0:e.nodeType===3?(e.textContent??"").trim()!=="":!1)}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",m)}render(){const e=this.isEffectivelyDisabled,t=!!this.icon,i=!!this.label||this.hasDefaultSlotContent,l=this.label?s`${this.label}`:s`<slot></slot>`,d=`segmented-item${t||this.selected?" has-icon":""}${i?"":" no-label"}`,o=s`<md-icon>check</md-icon>`,h=s`<md-icon class="selection-icon-placeholder" aria-hidden="true">check</md-icon>`,u=s`
1
+ import{h as p,m as v,p as a,v as s,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as m}from"../../vendor/lazy-focus-ring.js";import{t as n}from"../../vendor/decorate.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,l){try{customElements.get(t)||e(t,i,l)}catch(o){var d=String(o||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var b,r=(b=class extends p{constructor(...e){super(...e),this.label="",this.value="",this.selected=!1,this.icon="",this.href="",this.disabled=!1,this.onHostKeydown=t=>{if(!this.href||this.isEffectivelyDisabled||t.code!=="Space"&&t.code!=="Enter"&&t.code!=="NumpadEnter")return;const i=this.shadowRoot?.querySelector("a[href]");i&&(t.preventDefault(),t.stopPropagation(),i.click())}}get isEffectivelyDisabled(){const e=this.parentElement?.hasAttribute?.("disabled");return this.disabled||!!e}get hasDefaultSlotContent(){return Array.from(this.childNodes).some(e=>e.nodeType===1?!0:e.nodeType===3?(e.textContent??"").trim()!=="":!1)}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",m)}render(){const e=this.isEffectivelyDisabled,t=!!this.icon,i=!!this.label||this.hasDefaultSlotContent,l=this.label?s`${this.label}`:s`<slot></slot>`,d=`segmented-item${t||this.selected?" has-icon":""}${i?"":" no-label"}`,o=s`<md-icon>check</md-icon>`,h=s`<md-icon class="selection-icon-placeholder" aria-hidden="true">check</md-icon>`,u=s`
2
2
  <md-ripple ?disabled="${e}"></md-ripple>
3
3
  ${this.selected?t&&i?o:t?s`${o}<md-icon>${this.icon}</md-icon>`:o:t?s`<md-icon>${this.icon}</md-icon>`:i?h:""}
4
4
  ${i?s`<span>${l}</span>`:""}
@@ -1,4 +1,4 @@
1
- import{_ as d,h as v,m,p as i,v as s,y as h}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{ensureFocusRingOnFocusVisible as p}from"../shared/lazy-focus-ring.js";import{t}from"../../vendor/decorate.js";(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(a,g,b){try{customElements.get(a)||r(a,g,b)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var n,e=(n=class extends v{constructor(...r){super(...r),this.value="",this.disabled=!1,this.showCheckbox=!1,this.checked=!1,this.showRadio=!1,this.label="",this.noHighlightSelected=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",p)}updated(){this.setAttribute("role","option"),this.setAttribute("aria-selected",this.checked?"true":"false"),this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}disconnectedCallback(){this.removeEventListener("focusin",p),super.disconnectedCallback()}render(){return s`
1
+ import{_ as d,h as v,m,p as i,v as s,y as h}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{n as p}from"../../vendor/lazy-focus-ring.js";import{t}from"../../vendor/decorate.js";(function(){try{var o=typeof globalThis<"u"?globalThis:window;if(!o.__scb_ce_guard_installed__){o.__scb_ce_guard_installed__=!0;var r=customElements.define.bind(customElements);customElements.define=function(a,g,b){try{customElements.get(a)||r(a,g,b)}catch(l){var c=String(l||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var n,e=(n=class extends v{constructor(...r){super(...r),this.value="",this.disabled=!1,this.showCheckbox=!1,this.checked=!1,this.showRadio=!1,this.label="",this.noHighlightSelected=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("focusin",p)}updated(){this.setAttribute("role","option"),this.setAttribute("aria-selected",this.checked?"true":"false"),this.disabled?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}disconnectedCallback(){this.removeEventListener("focusin",p),super.disconnectedCallback()}render(){return s`
2
2
  <div class="item ${this.checked?"checked":""}">
3
3
  <md-ripple></md-ripple>
4
4
  ${this.showCheckbox?s`
@@ -1,4 +1,4 @@
1
- import{a as b,f as O,h as I,m as $,p as n,v as u,y as T}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{ensureFocusRingOnFocusVisible as q}from"../shared/lazy-focus-ring.js";import{componentSizeToken as F}from"../shared/component-size-token.js";import{t as M}from"../../vendor/component-defaults.js";import{t as a}from"../../vendor/decorate.js";import"../scb-chevron/scb-chevron.js";import"../scb-icon-button/scb-icon-button.js";import{closeManualPopover as k,closeManualPopoverAfterAnimations as P,isManualPopoverOpen as _,openManualPopover as E}from"../shared/manual-popover.js";import"../scb-tooltip/scb-tooltip.js";import"./scb-select-option.js";(function(){try{var x=typeof globalThis<"u"?globalThis:window;if(!x.__scb_ce_guard_installed__){x.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,t,i){try{customElements.get(s)||e(s,t,i)}catch(c){var l=String(c||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var y,r=(y=class extends I{constructor(){super(),this._optionsObserver=null,this._internals=null,this.focusedIndex=-1,this.variant="single-select",this.value="",this.values=[],this.disabled=!1,this.required=!1,this.error=!1,this.open=!1,this.label="",this.name="",this.placeholder="",this.supportingText="",this.errorText="",this.helpText="",this.helpLabel="Visa hjälptext",this.withRadiobuttons=!1,this.noHighlightSelected=!1,this.size=M["scb-select"].size,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.zIndex=void 0,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue="",this._initialValues=[],this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._selectId=`scb-select-${Math.random().toString(36).slice(2,11)}`,this._placementFrame=0,this._optionsPlacement="below",this._activeOption=null,this._onDocumentClick=e=>{if(!this.open)return;const s=e.composedPath();if(!s.includes(this)){const t=s.find(i=>i instanceof HTMLElement?i.tagName.toLowerCase()==="scb-select":!1);if(t&&t!==this){this._setOpen(!1);return}this._setOpen(!1),requestAnimationFrame(()=>{this.open||this._focusTrigger()})}},this._scheduleOptionsPlacement=()=>{!this.open||!this.isConnected||(this._placementFrame&&cancelAnimationFrame(this._placementFrame),this._placementFrame=requestAnimationFrame(()=>{this._placementFrame=0,this._updateOptionsPlacement()}))},this._onSlotClick=e=>{const s=this._getOptions(),t=e.composedPath(),i=s.find(l=>t.includes(l));i&&(this._selectOption(i),this._focusTrigger(),e.stopPropagation())},this._onKeyDown=e=>{if(e.key==="Tab"&&this.open){this._setOpen(!1),this._syncOptionsPopover();return}if(e.key==="Escape"&&this.open){e.preventDefault(),e.stopPropagation(),this._setOpen(!1),this._focusTrigger();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),e.stopPropagation();const s=e.key==="ArrowDown"?1:-1;if(!this.open){this._setOpen(!0,{keyboard:!0}),this.updateComplete.then(()=>{this._setFocusedIndex(this._getInitialFocusedIndex(),{scroll:!1}),this.focusedIndex>=0&&e.key==="ArrowUp"&&this._moveFocusedIndex(-1)});return}this._moveFocusedIndex(s);return}if((e.key==="Home"||e.key==="End")&&this.open){e.preventDefault(),e.stopPropagation();const s=this._getOptions();let t=s.findIndex(i=>!i.disabled);if(e.key==="End"){for(let i=s.length-1;i>=0;i-=1)if(!s[i]?.disabled){t=i;break}}this._setFocusedIndex(t);return}if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),this.open){const s=this._getFocusedOption();s&&this._selectOption(s);return}this._setOpen(!0,{keyboard:!0})}},this._onOptionKeyDown=e=>{if(e.key==="Escape"&&this.open){e.preventDefault(),e.stopPropagation(),this._setOpen(!1),this._focusTrigger();return}if(e.key==="Enter"||e.key===" "){e.preventDefault();const s=this._getOptions(),t=e.composedPath(),i=s.find(l=>t.includes(l));i&&this._selectOption(i)}},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="extra-small"?this.setAttribute("data-density","-5"):this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._onDocumentClick),document.addEventListener("scroll",this._scheduleOptionsPlacement,!0),window.addEventListener("resize",this._scheduleOptionsPlacement),this._optionsObserver=new MutationObserver(()=>{this.requestUpdate()}),this._optionsObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","value","disabled"]}),this._syncDensityForSize(),this._initialValue=this.value,this._initialValues=Array.isArray(this.values)?[...this.values]:[],this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.values=Array.isArray(this._initialValues)?[...this._initialValues]:[],this.error=!1,this._hasValidationBeenReported=!1,this._syncFormValue(),this._syncValidity(),this.requestUpdate()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("reset",this._formResetHandler,!0),this._form.addEventListener("submit",this._formSubmitHandler,!0))}disconnectedCallback(){document.removeEventListener("mousedown",this._onDocumentClick),document.removeEventListener("scroll",this._scheduleOptionsPlacement,!0),window.removeEventListener("resize",this._scheduleOptionsPlacement),this._placementFrame&&(cancelAnimationFrame(this._placementFrame),this._placementFrame=0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),this._optionsObserver?.disconnect(),this._optionsObserver=null,k(this.shadowRoot?.querySelector(".options")),super.disconnectedCallback()}_getMultiValues(){return Array.isArray(this.values)&&this.values.length>0?this.values:this.value?this.value.split(",").map(e=>e.trim()).filter(Boolean):[]}_mapSpacingToken(e){if(!e)return;const s=String(e).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}_applySpacing(){const e=this._mapSpacingToken(this.spacing),s=this._mapSpacingToken(this.spacingTop)??e,t=this._mapSpacingToken(this.spacingBottom)??e,i=this._mapSpacingToken(this.spacingLeft),l=this._mapSpacingToken(this.spacingRight);s?this.style.setProperty("--scb-select-spacing-block-start",s):this.style.removeProperty("--scb-select-spacing-block-start"),t?this.style.setProperty("--scb-select-spacing-block-end",t):this.style.removeProperty("--scb-select-spacing-block-end"),i?this.style.setProperty("--scb-select-spacing-inline-start",i):this.style.removeProperty("--scb-select-spacing-inline-start"),l?this.style.setProperty("--scb-select-spacing-inline-end",l):this.style.removeProperty("--scb-select-spacing-inline-end")}_setOpen(e,s={}){if(this.open!==e)if(e){const t=this._getInitialFocusedIndex();this._updateOptionsPlacement(),this._prepareOptionsScroll(t),this.focusedIndex=s.keyboard?t:-1,this.open=e,this.requestUpdate()}else this.open=e,this.focusedIndex=-1}_toggleOpen(){this.disabled||this._setOpen(!this.open)}_focusTrigger(){this.shadowRoot?.querySelector(".selected-value-container")?.focus({preventScroll:!0})}_getOptions(){const e=this.shadowRoot?.querySelector("slot");return e?e.assignedElements({flatten:!0}).filter(s=>s.tagName.toLowerCase()==="scb-select-option"):[]}_ensureOptionIds(e=this._getOptions()){e.forEach((s,t)=>{s.id||(s.id=`${this._selectId}-option-${t}`)})}_getInitialFocusedIndex(){const e=this._getOptions(),s=this.variant==="multi-select"?this._getMultiValues():[this.value],t=e.findIndex(i=>!i.disabled&&s.includes(i.value));return t>=0?t:e.findIndex(i=>!i.disabled)}_setFocusedIndex(e,s={}){const t=this._getOptions();if(this._ensureOptionIds(t),t.forEach(c=>c.removeAttribute("data-focused")),e<0||t.length===0){this.focusedIndex=-1,this._activeOption=null;return}let i=Math.max(0,Math.min(e,t.length-1));if(t[i]?.disabled){const c=t.findIndex((o,g)=>g>=i&&!o.disabled);let d=-1;for(let o=t.length-1;o>=0;o-=1)if(!t[o]?.disabled){d=o;break}i=c>=0?c:d}const l=t[i];if(!l||l.disabled){this.focusedIndex=-1,this._activeOption=null;return}l.setAttribute("data-focused",""),this.focusedIndex=i,this._activeOption=l,s.scroll!==!1&&this._prepareOptionsScroll(i)}_prepareOptionsScroll(e){const s=this.shadowRoot?.querySelector(".options"),t=this._getOptions()[e];if(!s||!t)return;const i=getComputedStyle(s),l=getComputedStyle(this),c=Number.parseFloat(i.paddingTop)||0,d=Number.parseFloat(i.paddingBottom)||0,o=l.getPropertyValue("--scb-select-options-current-max-height").trim()||l.getPropertyValue("--scb-select-options-max-height").trim()||i.maxHeight,g=Number.parseFloat(o);if(!Number.isFinite(g)||g<=0){s.scrollTop=0;return}const v=s.getBoundingClientRect(),m=t.getBoundingClientRect(),p=m.top-v.top+s.scrollTop,f=p+m.height,h=g,w=Math.max(0,s.scrollHeight-h),S=s.scrollTop+c,V=s.scrollTop+h-d;let z=s.scrollTop;p<S?z=p-c:f>V&&(z=f-h+d),s.scrollTop=Math.max(0,Math.min(w,z))}_moveFocusedIndex(e){const s=this._getOptions();if(s.length===0)return;if(this.focusedIndex<0&&e>0){this._setFocusedIndex(this._getInitialFocusedIndex());return}let t=this.focusedIndex>=0?this.focusedIndex:this._getInitialFocusedIndex();for(let i=0;i<s.length;i+=1)if(t=(t+e+s.length)%s.length,!s[t]?.disabled){this._setFocusedIndex(t);return}}_getFocusedOption(){return this._getOptions()[this.focusedIndex]}_updateOptionsPlacement(){const e=this.shadowRoot?.querySelector(".selected-value-container"),s=this.shadowRoot?.querySelector(".options");if(!e||!s)return;const t=e.getBoundingClientRect(),i=8,l=3,c=Number.parseFloat(getComputedStyle(this).getPropertyValue("--scb-select-options-max-height")),d=Number.isFinite(c)&&c>0?c:240,o=s.scrollHeight,g=Math.min(d,o),v=window.innerHeight-t.bottom-l-i,m=t.top-l-i,p=v<g&&m>v,f=Math.max(0,Math.min(g,p?m:v));if(this._optionsPlacement=p?"above":"below",this.style.setProperty("--scb-select-options-current-max-height",`${f}px`),s.style.overflowY=o>f+.5?"auto":"",_(s)){const h=Math.min(t.width,window.innerWidth-i*2),w=Math.min(Math.max(t.left,i),window.innerWidth-i-h);s.style.position="fixed",s.style.left=`${Math.round(w)}px`,s.style.right="auto",s.style.width=`${Math.round(h)}px`,p?(s.style.top="auto",s.style.bottom=`${Math.round(window.innerHeight-t.top+l)}px`):(s.style.top=`${Math.round(t.bottom+l)}px`,s.style.bottom="auto")}}_syncOptionsPopover(){const e=this.shadowRoot?.querySelector(".options")??null;if(e){if(this.open){E(e)&&this._scheduleOptionsPlacement();return}_(e)?P(e,()=>this._resetOptionsPlacement()):(k(e),this._resetOptionsPlacement())}}_resetOptionsPlacement(){this._optionsPlacement="below",this.style.removeProperty("--scb-select-options-current-max-height");const e=this.shadowRoot?.querySelector(".options");e?.style.removeProperty("position"),e?.style.removeProperty("left"),e?.style.removeProperty("right"),e?.style.removeProperty("top"),e?.style.removeProperty("bottom"),e?.style.removeProperty("width"),e?.style.removeProperty("overflow-y")}_hasMoreThanFourOptions(){const e=this._getOptions();return["extra-small","small","medium"].includes(this.size)?e.length>5:e.length>4}_selectOption(e){if(!e.disabled){if(this.variant==="multi-select"){const s=this._getMultiValues();s.indexOf(e.value)>-1?this.values=s.filter(t=>t!==e.value):this.values=[...s,e.value],this.value=this.values.join(","),this.dispatchEvent(new CustomEvent("change",{detail:{values:this.values},bubbles:!0,composed:!0}))}else this.variant==="single-select"&&this.withRadiobuttons?(this.value=e.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))):(this.value=e.value,this._setOpen(!1),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this.updateComplete.then(()=>this._focusTrigger()));this._updateOptionsChecked(),this.requestUpdate()}}_getOptionLabel(e){return e.label||e.textContent?.trim()||""}_getSelectedLabel(){const e=this._getOptions();if(this.variant==="multi-select"){const s=this._getMultiValues(),t=e.filter(i=>s.includes(i.value));return t&&t.length>0?t.map(i=>this._getOptionLabel(i)).join(", "):""}else{const s=e.find(t=>t.value===this.value);return s?this._getOptionLabel(s):""}}firstUpdated(){this._updateOptionsChecked(),this._syncFormValue(),this._syncValidity(),this._applySpacing()}updated(e){this._updateOptionsChecked(),this._syncFormValue(),this._syncValidity();const s=this.renderRoot.querySelector(".selected-value-container"),t=this.open&&this._activeOption?.assignedSlot&&!this._activeOption.disabled?this._activeOption:null;s&&("ariaActiveDescendantElement"in Element.prototype?s.ariaActiveDescendantElement=t:t?s.setAttribute("aria-activedescendant",t.id):s.removeAttribute("aria-activedescendant")),e.has("size")&&this._syncDensityForSize(),e.has("errorText")&&this.error&&this._syncValidity(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this._applySpacing(),e.has("open")&&(this.open?(this._syncOptionsPopover(),this.updateComplete.then(()=>{this.open&&(this._setFocusedIndex(this.focusedIndex,{scroll:!1}),this._scheduleOptionsPlacement())})):(this._syncOptionsPopover(),this._setFocusedIndex(-1)))}_syncFormValue(){if(this._internals){if(this.disabled||!this.name){this._internals.setFormValue(null);return}if(this.variant==="multi-select"){const e=this._getMultiValues();if(e.length===0){this._internals.setFormValue(null);return}const s=new FormData;e.forEach(t=>s.append(this.name,t)),this._internals.setFormValue(s);return}this._internals.setFormValue(this.value||null)}}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.variant==="multi-select"?this._getMultiValues().length>0:this.value)?this.errorText||"Välj ett alternativ.":""}_syncValidity(){const e=this.disabled?"":this._getValidationMessage(),s=this.shadowRoot?.querySelector(".selected-value"),t=this.error,i=this._validationMessage;if(this._validationMessage=e,this.error=this.disabled?!1:e?this._hasValidationBeenReported||t:t&&!this._hasValidationBeenReported&&!i,!e)this.removeAttribute("aria-invalid"),s&&s.setCustomValidity(""),this._internals&&this._internals.setValidity({});else if(s&&s.setCustomValidity(e),this._internals){const l=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(l,e,s??void 0)}this.toggleAttribute("aria-invalid",this.error),(t!==this.error||i!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this._syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){return this._hasValidationBeenReported=!0,this._syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??""),this._syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}_updateOptionsChecked(){const e=this._getOptions();this._ensureOptionIds(e),e.forEach(s=>{if(this.noHighlightSelected?s.setAttribute("no-highlight-selected",""):s.removeAttribute("no-highlight-selected"),this.variant==="multi-select"){const t=this._getMultiValues();s.showCheckbox=!0,s.checked=t.includes(s.value),s.showRadio=!1}else s.showCheckbox=!1,s.checked=this.value===s.value,this.withRadiobuttons&&(s.showRadio=!0)})}_renderLabel(){if(!this.label)return null;const e=!!this._getVisibleSupportingText(),s=`${this._selectId}-label`,t=u`
1
+ import{a as b,f as O,h as I,m as $,p as n,v as u,y as T}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{n as q}from"../../vendor/lazy-focus-ring.js";import{t as F}from"../../vendor/component-size-token.js";import{t as M}from"../../vendor/component-defaults.js";import{t as a}from"../../vendor/decorate.js";import"../../vendor/scb-chevron.js";import"../scb-icon-button/scb-icon-button.js";import{a as P,i as k,n as E,t as _}from"../../vendor/manual-popover.js";import"../scb-tooltip/scb-tooltip.js";import"./scb-select-option.js";(function(){try{var x=typeof globalThis<"u"?globalThis:window;if(!x.__scb_ce_guard_installed__){x.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,t,i){try{customElements.get(s)||e(s,t,i)}catch(c){var l=String(c||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var y,r=(y=class extends I{constructor(){super(),this._optionsObserver=null,this._internals=null,this.focusedIndex=-1,this.variant="single-select",this.value="",this.values=[],this.disabled=!1,this.required=!1,this.error=!1,this.open=!1,this.label="",this.name="",this.placeholder="",this.supportingText="",this.errorText="",this.helpText="",this.helpLabel="Visa hjälptext",this.withRadiobuttons=!1,this.noHighlightSelected=!1,this.size=M["scb-select"].size,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.zIndex=void 0,this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialValue="",this._initialValues=[],this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,this._selectId=`scb-select-${Math.random().toString(36).slice(2,11)}`,this._placementFrame=0,this._optionsPlacement="below",this._activeOption=null,this._onDocumentClick=e=>{if(!this.open)return;const s=e.composedPath();if(!s.includes(this)){const t=s.find(i=>i instanceof HTMLElement?i.tagName.toLowerCase()==="scb-select":!1);if(t&&t!==this){this._setOpen(!1);return}this._setOpen(!1),requestAnimationFrame(()=>{this.open||this._focusTrigger()})}},this._scheduleOptionsPlacement=()=>{!this.open||!this.isConnected||(this._placementFrame&&cancelAnimationFrame(this._placementFrame),this._placementFrame=requestAnimationFrame(()=>{this._placementFrame=0,this._updateOptionsPlacement()}))},this._onSlotClick=e=>{const s=this._getOptions(),t=e.composedPath(),i=s.find(l=>t.includes(l));i&&(this._selectOption(i),this._focusTrigger(),e.stopPropagation())},this._onKeyDown=e=>{if(e.key==="Tab"&&this.open){this._setOpen(!1),this._syncOptionsPopover();return}if(e.key==="Escape"&&this.open){e.preventDefault(),e.stopPropagation(),this._setOpen(!1),this._focusTrigger();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),e.stopPropagation();const s=e.key==="ArrowDown"?1:-1;if(!this.open){this._setOpen(!0,{keyboard:!0}),this.updateComplete.then(()=>{this._setFocusedIndex(this._getInitialFocusedIndex(),{scroll:!1}),this.focusedIndex>=0&&e.key==="ArrowUp"&&this._moveFocusedIndex(-1)});return}this._moveFocusedIndex(s);return}if((e.key==="Home"||e.key==="End")&&this.open){e.preventDefault(),e.stopPropagation();const s=this._getOptions();let t=s.findIndex(i=>!i.disabled);if(e.key==="End"){for(let i=s.length-1;i>=0;i-=1)if(!s[i]?.disabled){t=i;break}}this._setFocusedIndex(t);return}if(e.key==="Enter"||e.key===" "){if(e.preventDefault(),this.open){const s=this._getFocusedOption();s&&this._selectOption(s);return}this._setOpen(!0,{keyboard:!0})}},this._onOptionKeyDown=e=>{if(e.key==="Escape"&&this.open){e.preventDefault(),e.stopPropagation(),this._setOpen(!1),this._focusTrigger();return}if(e.key==="Enter"||e.key===" "){e.preventDefault();const s=this._getOptions(),t=e.composedPath(),i=s.find(l=>t.includes(l));i&&this._selectOption(i)}},"attachInternals"in this&&(this._internals=this.attachInternals())}_syncDensityForSize(){this.size==="extra-small"?this.setAttribute("data-density","-5"):this.size==="small"?this.setAttribute("data-density","-4"):this.size==="medium"?this.setAttribute("data-density","-2"):this.removeAttribute("data-density")}connectedCallback(){super.connectedCallback(),document.addEventListener("mousedown",this._onDocumentClick),document.addEventListener("scroll",this._scheduleOptionsPlacement,!0),window.addEventListener("resize",this._scheduleOptionsPlacement),this._optionsObserver=new MutationObserver(()=>{this.requestUpdate()}),this._optionsObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","value","disabled"]}),this._syncDensityForSize(),this._initialValue=this.value,this._initialValues=Array.isArray(this.values)?[...this.values]:[],this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.values=Array.isArray(this._initialValues)?[...this._initialValues]:[],this.error=!1,this._hasValidationBeenReported=!1,this._syncFormValue(),this._syncValidity(),this.requestUpdate()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("reset",this._formResetHandler,!0),this._form.addEventListener("submit",this._formSubmitHandler,!0))}disconnectedCallback(){document.removeEventListener("mousedown",this._onDocumentClick),document.removeEventListener("scroll",this._scheduleOptionsPlacement,!0),window.removeEventListener("resize",this._scheduleOptionsPlacement),this._placementFrame&&(cancelAnimationFrame(this._placementFrame),this._placementFrame=0),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),this._optionsObserver?.disconnect(),this._optionsObserver=null,_(this.shadowRoot?.querySelector(".options")),super.disconnectedCallback()}_getMultiValues(){return Array.isArray(this.values)&&this.values.length>0?this.values:this.value?this.value.split(",").map(e=>e.trim()).filter(Boolean):[]}_mapSpacingToken(e){if(!e)return;const s=String(e).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}_applySpacing(){const e=this._mapSpacingToken(this.spacing),s=this._mapSpacingToken(this.spacingTop)??e,t=this._mapSpacingToken(this.spacingBottom)??e,i=this._mapSpacingToken(this.spacingLeft),l=this._mapSpacingToken(this.spacingRight);s?this.style.setProperty("--scb-select-spacing-block-start",s):this.style.removeProperty("--scb-select-spacing-block-start"),t?this.style.setProperty("--scb-select-spacing-block-end",t):this.style.removeProperty("--scb-select-spacing-block-end"),i?this.style.setProperty("--scb-select-spacing-inline-start",i):this.style.removeProperty("--scb-select-spacing-inline-start"),l?this.style.setProperty("--scb-select-spacing-inline-end",l):this.style.removeProperty("--scb-select-spacing-inline-end")}_setOpen(e,s={}){if(this.open!==e)if(e){const t=this._getInitialFocusedIndex();this._updateOptionsPlacement(),this._prepareOptionsScroll(t),this.focusedIndex=s.keyboard?t:-1,this.open=e,this.requestUpdate()}else this.open=e,this.focusedIndex=-1}_toggleOpen(){this.disabled||this._setOpen(!this.open)}_focusTrigger(){this.shadowRoot?.querySelector(".selected-value-container")?.focus({preventScroll:!0})}_getOptions(){const e=this.shadowRoot?.querySelector("slot");return e?e.assignedElements({flatten:!0}).filter(s=>s.tagName.toLowerCase()==="scb-select-option"):[]}_ensureOptionIds(e=this._getOptions()){e.forEach((s,t)=>{s.id||(s.id=`${this._selectId}-option-${t}`)})}_getInitialFocusedIndex(){const e=this._getOptions(),s=this.variant==="multi-select"?this._getMultiValues():[this.value],t=e.findIndex(i=>!i.disabled&&s.includes(i.value));return t>=0?t:e.findIndex(i=>!i.disabled)}_setFocusedIndex(e,s={}){const t=this._getOptions();if(this._ensureOptionIds(t),t.forEach(c=>c.removeAttribute("data-focused")),e<0||t.length===0){this.focusedIndex=-1,this._activeOption=null;return}let i=Math.max(0,Math.min(e,t.length-1));if(t[i]?.disabled){const c=t.findIndex((o,g)=>g>=i&&!o.disabled);let d=-1;for(let o=t.length-1;o>=0;o-=1)if(!t[o]?.disabled){d=o;break}i=c>=0?c:d}const l=t[i];if(!l||l.disabled){this.focusedIndex=-1,this._activeOption=null;return}l.setAttribute("data-focused",""),this.focusedIndex=i,this._activeOption=l,s.scroll!==!1&&this._prepareOptionsScroll(i)}_prepareOptionsScroll(e){const s=this.shadowRoot?.querySelector(".options"),t=this._getOptions()[e];if(!s||!t)return;const i=getComputedStyle(s),l=getComputedStyle(this),c=Number.parseFloat(i.paddingTop)||0,d=Number.parseFloat(i.paddingBottom)||0,o=l.getPropertyValue("--scb-select-options-current-max-height").trim()||l.getPropertyValue("--scb-select-options-max-height").trim()||i.maxHeight,g=Number.parseFloat(o);if(!Number.isFinite(g)||g<=0){s.scrollTop=0;return}const v=s.getBoundingClientRect(),m=t.getBoundingClientRect(),p=m.top-v.top+s.scrollTop,f=p+m.height,h=g,w=Math.max(0,s.scrollHeight-h),S=s.scrollTop+c,V=s.scrollTop+h-d;let z=s.scrollTop;p<S?z=p-c:f>V&&(z=f-h+d),s.scrollTop=Math.max(0,Math.min(w,z))}_moveFocusedIndex(e){const s=this._getOptions();if(s.length===0)return;if(this.focusedIndex<0&&e>0){this._setFocusedIndex(this._getInitialFocusedIndex());return}let t=this.focusedIndex>=0?this.focusedIndex:this._getInitialFocusedIndex();for(let i=0;i<s.length;i+=1)if(t=(t+e+s.length)%s.length,!s[t]?.disabled){this._setFocusedIndex(t);return}}_getFocusedOption(){return this._getOptions()[this.focusedIndex]}_updateOptionsPlacement(){const e=this.shadowRoot?.querySelector(".selected-value-container"),s=this.shadowRoot?.querySelector(".options");if(!e||!s)return;const t=e.getBoundingClientRect(),i=8,l=3,c=Number.parseFloat(getComputedStyle(this).getPropertyValue("--scb-select-options-max-height")),d=Number.isFinite(c)&&c>0?c:240,o=s.scrollHeight,g=Math.min(d,o),v=window.innerHeight-t.bottom-l-i,m=t.top-l-i,p=v<g&&m>v,f=Math.max(0,Math.min(g,p?m:v));if(this._optionsPlacement=p?"above":"below",this.style.setProperty("--scb-select-options-current-max-height",`${f}px`),s.style.overflowY=o>f+.5?"auto":"",k(s)){const h=Math.min(t.width,window.innerWidth-i*2),w=Math.min(Math.max(t.left,i),window.innerWidth-i-h);s.style.position="fixed",s.style.left=`${Math.round(w)}px`,s.style.right="auto",s.style.width=`${Math.round(h)}px`,p?(s.style.top="auto",s.style.bottom=`${Math.round(window.innerHeight-t.top+l)}px`):(s.style.top=`${Math.round(t.bottom+l)}px`,s.style.bottom="auto")}}_syncOptionsPopover(){const e=this.shadowRoot?.querySelector(".options")??null;if(e){if(this.open){P(e)&&this._scheduleOptionsPlacement();return}k(e)?E(e,()=>this._resetOptionsPlacement()):(_(e),this._resetOptionsPlacement())}}_resetOptionsPlacement(){this._optionsPlacement="below",this.style.removeProperty("--scb-select-options-current-max-height");const e=this.shadowRoot?.querySelector(".options");e?.style.removeProperty("position"),e?.style.removeProperty("left"),e?.style.removeProperty("right"),e?.style.removeProperty("top"),e?.style.removeProperty("bottom"),e?.style.removeProperty("width"),e?.style.removeProperty("overflow-y")}_hasMoreThanFourOptions(){const e=this._getOptions();return["extra-small","small","medium"].includes(this.size)?e.length>5:e.length>4}_selectOption(e){if(!e.disabled){if(this.variant==="multi-select"){const s=this._getMultiValues();s.indexOf(e.value)>-1?this.values=s.filter(t=>t!==e.value):this.values=[...s,e.value],this.value=this.values.join(","),this.dispatchEvent(new CustomEvent("change",{detail:{values:this.values},bubbles:!0,composed:!0}))}else this.variant==="single-select"&&this.withRadiobuttons?(this.value=e.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))):(this.value=e.value,this._setOpen(!1),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this.updateComplete.then(()=>this._focusTrigger()));this._updateOptionsChecked(),this.requestUpdate()}}_getOptionLabel(e){return e.label||e.textContent?.trim()||""}_getSelectedLabel(){const e=this._getOptions();if(this.variant==="multi-select"){const s=this._getMultiValues(),t=e.filter(i=>s.includes(i.value));return t&&t.length>0?t.map(i=>this._getOptionLabel(i)).join(", "):""}else{const s=e.find(t=>t.value===this.value);return s?this._getOptionLabel(s):""}}firstUpdated(){this._updateOptionsChecked(),this._syncFormValue(),this._syncValidity(),this._applySpacing()}updated(e){this._updateOptionsChecked(),this._syncFormValue(),this._syncValidity();const s=this.renderRoot.querySelector(".selected-value-container"),t=this.open&&this._activeOption?.assignedSlot&&!this._activeOption.disabled?this._activeOption:null;s&&("ariaActiveDescendantElement"in Element.prototype?s.ariaActiveDescendantElement=t:t?s.setAttribute("aria-activedescendant",t.id):s.removeAttribute("aria-activedescendant")),e.has("size")&&this._syncDensityForSize(),e.has("errorText")&&this.error&&this._syncValidity(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this._applySpacing(),e.has("open")&&(this.open?(this._syncOptionsPopover(),this.updateComplete.then(()=>{this.open&&(this._setFocusedIndex(this.focusedIndex,{scroll:!1}),this._scheduleOptionsPlacement())})):(this._syncOptionsPopover(),this._setFocusedIndex(-1)))}_syncFormValue(){if(this._internals){if(this.disabled||!this.name){this._internals.setFormValue(null);return}if(this.variant==="multi-select"){const e=this._getMultiValues();if(e.length===0){this._internals.setFormValue(null);return}const s=new FormData;e.forEach(t=>s.append(this.name,t)),this._internals.setFormValue(s);return}this._internals.setFormValue(this.value||null)}}_getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!(this.variant==="multi-select"?this._getMultiValues().length>0:this.value)?this.errorText||"Välj ett alternativ.":""}_syncValidity(){const e=this.disabled?"":this._getValidationMessage(),s=this.shadowRoot?.querySelector(".selected-value"),t=this.error,i=this._validationMessage;if(this._validationMessage=e,this.error=this.disabled?!1:e?this._hasValidationBeenReported||t:t&&!this._hasValidationBeenReported&&!i,!e)this.removeAttribute("aria-invalid"),s&&s.setCustomValidity(""),this._internals&&this._internals.setValidity({});else if(s&&s.setCustomValidity(e),this._internals){const l=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(l,e,s??void 0)}this.toggleAttribute("aria-invalid",this.error),(t!==this.error||i!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this._syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){return this._hasValidationBeenReported=!0,this._syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??""),this._syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this._getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}_updateOptionsChecked(){const e=this._getOptions();this._ensureOptionIds(e),e.forEach(s=>{if(this.noHighlightSelected?s.setAttribute("no-highlight-selected",""):s.removeAttribute("no-highlight-selected"),this.variant==="multi-select"){const t=this._getMultiValues();s.showCheckbox=!0,s.checked=t.includes(s.value),s.showRadio=!1}else s.showCheckbox=!1,s.checked=this.value===s.value,this.withRadiobuttons&&(s.showRadio=!0)})}_renderLabel(){if(!this.label)return null;const e=!!this._getVisibleSupportingText(),s=`${this._selectId}-label`,t=u`
2
2
  <label
3
3
  class="select-label ${!e&&!this.helpText?"select-label--without-supporting":""}"
4
4
  id=${s}
@@ -1,4 +1,4 @@
1
- import{d as g,f as p,g as h,h as _,i as L,m as S,o as m,p as i,r as y,s as l,u as E,v as u,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{t as o}from"../../vendor/decorate.js";import{n as T}from"../../vendor/aria-references.internal.js";import"../../vendor/md-focus-ring.js";import{t as F}from"../../vendor/delegate.js";import{a as M,n as B,o as I,r as R,s as H}from"../../vendor/form-associated.js";import{t as x}from"../../vendor/redispatch-event.js";import"../../vendor/elevation.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(a,r,d){try{customElements.get(a)||t(a,r,d)}catch(v){var c=String(v||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw v}}}}catch{}})();var O=k`@media(forced-colors: active){:host{--md-slider-active-track-color: CanvasText;--md-slider-disabled-active-track-color: GrayText;--md-slider-disabled-active-track-opacity: 1;--md-slider-disabled-handle-color: GrayText;--md-slider-disabled-inactive-track-color: GrayText;--md-slider-disabled-inactive-track-opacity: 1;--md-slider-focus-handle-color: CanvasText;--md-slider-handle-color: CanvasText;--md-slider-handle-shadow-color: Canvas;--md-slider-hover-handle-color: CanvasText;--md-slider-hover-state-layer-color: Canvas;--md-slider-hover-state-layer-opacity: 1;--md-slider-inactive-track-color: Canvas;--md-slider-label-container-color: Canvas;--md-slider-label-text-color: CanvasText;--md-slider-pressed-handle-color: CanvasText;--md-slider-pressed-state-layer-color: Canvas;--md-slider-pressed-state-layer-opacity: 1;--md-slider-with-overlap-handle-outline-color: CanvasText}.label,.label::before{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}:host(:not([disabled])) .track::before{border:1px solid var(--_active-track-color)}.tickmarks::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='CanvasText'%3E%3Ccircle cx='2' cy='2' r='1'/%3E%3C/svg%3E")}.tickmarks::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='Canvas'%3E%3Ccircle cx='2' cy='2' r='1'/%3E%3C/svg%3E")}:host([disabled]) .tickmarks::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='Canvas'%3E%3Ccircle cx='2' cy='2' r='1'/%3E%3C/svg%3E")}}
1
+ import{d as g,f as p,g as h,h as _,i as L,m as S,o as m,p as i,r as y,s as l,u as E,v as u,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{n as T}from"../../vendor/aria-references.internal.js";import{t as o}from"../../vendor/decorate.js";import"../../vendor/md-focus-ring.js";import{t as F}from"../../vendor/delegate.js";import{a as M,n as B,o as I,r as R,s as H}from"../../vendor/form-associated.js";import{t as x}from"../../vendor/redispatch-event.js";import"../../vendor/elevation.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(a,r,d){try{customElements.get(a)||t(a,r,d)}catch(v){var c=String(v||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw v}}}}catch{}})();var O=k`@media(forced-colors: active){:host{--md-slider-active-track-color: CanvasText;--md-slider-disabled-active-track-color: GrayText;--md-slider-disabled-active-track-opacity: 1;--md-slider-disabled-handle-color: GrayText;--md-slider-disabled-inactive-track-color: GrayText;--md-slider-disabled-inactive-track-opacity: 1;--md-slider-focus-handle-color: CanvasText;--md-slider-handle-color: CanvasText;--md-slider-handle-shadow-color: Canvas;--md-slider-hover-handle-color: CanvasText;--md-slider-hover-state-layer-color: Canvas;--md-slider-hover-state-layer-opacity: 1;--md-slider-inactive-track-color: Canvas;--md-slider-label-container-color: Canvas;--md-slider-label-text-color: CanvasText;--md-slider-pressed-handle-color: CanvasText;--md-slider-pressed-state-layer-color: Canvas;--md-slider-pressed-state-layer-opacity: 1;--md-slider-with-overlap-handle-outline-color: CanvasText}.label,.label::before{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}:host(:not([disabled])) .track::before{border:1px solid var(--_active-track-color)}.tickmarks::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='CanvasText'%3E%3Ccircle cx='2' cy='2' r='1'/%3E%3C/svg%3E")}.tickmarks::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='Canvas'%3E%3Ccircle cx='2' cy='2' r='1'/%3E%3C/svg%3E")}:host([disabled]) .tickmarks::before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='Canvas'%3E%3Ccircle cx='2' cy='2' r='1'/%3E%3C/svg%3E")}}
2
2
  `,P=R(M(_)),s=class extends P{get nameStart(){return this.getAttribute("name-start")??this.name}set nameStart(e){this.setAttribute("name-start",e)}get nameEnd(){return this.getAttribute("name-end")??this.nameStart}set nameEnd(e){this.setAttribute("name-end",e)}get renderAriaLabelStart(){const{ariaLabel:e}=this;return this.ariaLabelStart||e&&`${e} start`||this.valueLabelStart||String(this.valueStart)}get renderAriaValueTextStart(){return this.ariaValueTextStart||this.valueLabelStart||String(this.valueStart)}get renderAriaLabelEnd(){const{ariaLabel:e}=this;return this.range?this.ariaLabelEnd||e&&`${e} end`||this.valueLabelEnd||String(this.valueEnd):e||this.valueLabel||String(this.value)}get renderAriaValueTextEnd(){if(this.range)return this.ariaValueTextEnd||this.valueLabelEnd||String(this.valueEnd);const{ariaValueText:e}=this;return e||this.valueLabel||String(this.value)}constructor(){super(),this.min=0,this.max=100,this.valueLabel="",this.valueLabelStart="",this.valueLabelEnd="",this.ariaLabelStart="",this.ariaValueTextStart="",this.ariaLabelEnd="",this.ariaValueTextEnd="",this.step=1,this.ticks=!1,this.labeled=!1,this.range=!1,this.handleStartHover=!1,this.handleEndHover=!1,this.startOnTop=!1,this.handlesOverlapping=!1,this.ripplePointerId=1,this.isRedispatchingEvent=!1,this.addEventListener("click",e=>{!H(e)||!this.inputEnd||(this.focus(),I(this.inputEnd))})}focus(){this.inputEnd?.focus()}willUpdate(e){this.renderValueStart=e.has("valueStart")?this.valueStart:this.inputStart?.valueAsNumber;const t=e.has("valueEnd")&&this.range||e.has("value");this.renderValueEnd=t?this.range?this.valueEnd:this.value:this.inputEnd?.valueAsNumber,e.get("handleStartHover")!==void 0?this.toggleRippleHover(this.rippleStart,this.handleStartHover):e.get("handleEndHover")!==void 0&&this.toggleRippleHover(this.rippleEnd,this.handleEndHover)}updated(e){if(this.range&&(this.renderValueStart=this.inputStart.valueAsNumber),this.renderValueEnd=this.inputEnd.valueAsNumber,this.range){const t=(this.max-this.min)/3;if(this.valueStart===void 0){this.inputStart.valueAsNumber=this.min+t;const a=this.inputStart.valueAsNumber;this.valueStart=this.renderValueStart=a}if(this.valueEnd===void 0){this.inputEnd.valueAsNumber=this.min+2*t;const a=this.inputEnd.valueAsNumber;this.valueEnd=this.renderValueEnd=a}}else this.value??(this.value=this.renderValueEnd);if(e.has("range")||e.has("renderValueStart")||e.has("renderValueEnd")||this.isUpdatePending){const t=this.handleStart?.querySelector(".handleNub"),a=this.handleEnd?.querySelector(".handleNub");this.handlesOverlapping=q(t,a)}this.performUpdate()}render(){const e=this.step===0?1:this.step,t=Math.max(this.max-this.min,e),a=this.range?((this.renderValueStart??this.min)-this.min)/t:0,r=((this.renderValueEnd??this.min)-this.min)/t,d={"--_start-fraction":String(a),"--_end-fraction":String(r),"--_tick-count":String(t/e)},c={ranged:this.range},v=this.valueLabelStart||String(this.renderValueStart),z=(this.range?this.valueLabelEnd:this.valueLabel)||String(this.renderValueEnd),V={start:!0,value:this.renderValueStart,ariaLabel:this.renderAriaLabelStart,ariaValueText:this.renderAriaValueTextStart,ariaMin:this.min,ariaMax:this.valueEnd??this.max},$={start:!1,value:this.renderValueEnd,ariaLabel:this.renderAriaLabelEnd,ariaValueText:this.renderAriaValueTextEnd,ariaMin:this.range?this.valueStart??this.min:this.min,ariaMax:this.max},N={start:!0,hover:this.handleStartHover,label:v},C={start:!1,hover:this.handleEndHover,label:z},A={hover:this.handleStartHover||this.handleEndHover};return u` <div
3
3
  class="container ${m(c)}"
4
4
  style=${L(d)}>
@@ -1,4 +1,4 @@
1
- import{h as u,m as v,p as i,v as o,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{componentSizeToken as b}from"../shared/component-size-token.js";import{t}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import{closeManualPopover as p,closeManualPopoverAfterAnimations as h,isManualPopoverOpen as k,openManualPopover as f}from"../shared/manual-popover.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(a,n,r){try{customElements.get(a)||s(a,n,r)}catch(m){var c=String(m||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw m}}}}catch{}})();var l,e=(l=class extends u{constructor(...s){super(...s),this.message="",this.open=!1,this.actionText="",this.showClose=!1,this.closeLabel="Stäng meddelande",this.fixed=!1,this.fadeout=!1,this.withLongerAction=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}mapSpacingToken(s){if(!s)return;const a=String(s).trim();if(a)return/^\d+$/.test(a)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(a,10)))})`:a}applySpacing(){const s=this.mapSpacingToken(this.spacing),a=this.mapSpacingToken(this.spacingTop)??s,n=this.mapSpacingToken(this.spacingBottom)??s,r=this.mapSpacingToken(this.spacingLeft),c=this.mapSpacingToken(this.spacingRight);a?this.style.setProperty("--scb-snackbar-spacing-block-start",a):this.style.removeProperty("--scb-snackbar-spacing-block-start"),n?this.style.setProperty("--scb-snackbar-spacing-block-end",n):this.style.removeProperty("--scb-snackbar-spacing-block-end"),r?this.style.setProperty("--scb-snackbar-spacing-inline-start",r):this.style.removeProperty("--scb-snackbar-spacing-inline-start"),c?this.style.setProperty("--scb-snackbar-spacing-inline-end",c):this.style.removeProperty("--scb-snackbar-spacing-inline-end")}connectedCallback(){super.connectedCallback(),this.applySpacing()}disconnectedCallback(){window.clearTimeout(this._fadeoutTimer),p(this.renderRoot.querySelector(".snackbar")),super.disconnectedCallback()}handleAction(){this.dispatchEvent(new CustomEvent("snackbar-action",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("snackbaraction",{bubbles:!0,composed:!0})),this.open=!1}handleClose(){this.open=!1}updated(s){if(super.updated(s),s.has("open")||s.has("fixed")){const a=this.renderRoot.querySelector(".snackbar");this.open&&this.fixed?f(a):!this.open&&k(a)?h(a):p(a)}s.has("open")&&(this.open?(this.dispatchEvent(new CustomEvent("snackbar-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("snackbaropen",{bubbles:!0,composed:!0}))):(this.dispatchEvent(new CustomEvent("snackbar-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("snackbarclose",{bubbles:!0,composed:!0})))),(s.has("open")||s.has("fadeout"))&&(this.open&&this.fadeout?(window.clearTimeout(this._fadeoutTimer),this._fadeoutTimer=window.setTimeout(()=>{this.open=!1},5e3)):window.clearTimeout(this._fadeoutTimer)),(s.has("spacing")||s.has("spacingTop")||s.has("spacingBottom")||s.has("spacingLeft")||s.has("spacingRight"))&&this.applySpacing()}render(){const s=!!this.actionText,a=!!this.showClose;let n="snackbar";return!s&&!a&&(n+=" no-actions"),this.withLongerAction&&(n+=" longer-action"),o`
1
+ import{h as u,m as v,p as i,v as o,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as b}from"../../vendor/component-size-token.js";import{t}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import{a as h,i as k,n as f,t as p}from"../../vendor/manual-popover.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var s=customElements.define.bind(customElements);customElements.define=function(a,n,r){try{customElements.get(a)||s(a,n,r)}catch(m){var c=String(m||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw m}}}}catch{}})();var l,e=(l=class extends u{constructor(...s){super(...s),this.message="",this.open=!1,this.actionText="",this.showClose=!1,this.closeLabel="Stäng meddelande",this.fixed=!1,this.fadeout=!1,this.withLongerAction=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}mapSpacingToken(s){if(!s)return;const a=String(s).trim();if(a)return/^\d+$/.test(a)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(a,10)))})`:a}applySpacing(){const s=this.mapSpacingToken(this.spacing),a=this.mapSpacingToken(this.spacingTop)??s,n=this.mapSpacingToken(this.spacingBottom)??s,r=this.mapSpacingToken(this.spacingLeft),c=this.mapSpacingToken(this.spacingRight);a?this.style.setProperty("--scb-snackbar-spacing-block-start",a):this.style.removeProperty("--scb-snackbar-spacing-block-start"),n?this.style.setProperty("--scb-snackbar-spacing-block-end",n):this.style.removeProperty("--scb-snackbar-spacing-block-end"),r?this.style.setProperty("--scb-snackbar-spacing-inline-start",r):this.style.removeProperty("--scb-snackbar-spacing-inline-start"),c?this.style.setProperty("--scb-snackbar-spacing-inline-end",c):this.style.removeProperty("--scb-snackbar-spacing-inline-end")}connectedCallback(){super.connectedCallback(),this.applySpacing()}disconnectedCallback(){window.clearTimeout(this._fadeoutTimer),p(this.renderRoot.querySelector(".snackbar")),super.disconnectedCallback()}handleAction(){this.dispatchEvent(new CustomEvent("snackbar-action",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("snackbaraction",{bubbles:!0,composed:!0})),this.open=!1}handleClose(){this.open=!1}updated(s){if(super.updated(s),s.has("open")||s.has("fixed")){const a=this.renderRoot.querySelector(".snackbar");this.open&&this.fixed?h(a):!this.open&&k(a)?f(a):p(a)}s.has("open")&&(this.open?(this.dispatchEvent(new CustomEvent("snackbar-open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("snackbaropen",{bubbles:!0,composed:!0}))):(this.dispatchEvent(new CustomEvent("snackbar-close",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("snackbarclose",{bubbles:!0,composed:!0})))),(s.has("open")||s.has("fadeout"))&&(this.open&&this.fadeout?(window.clearTimeout(this._fadeoutTimer),this._fadeoutTimer=window.setTimeout(()=>{this.open=!1},5e3)):window.clearTimeout(this._fadeoutTimer)),(s.has("spacing")||s.has("spacingTop")||s.has("spacingBottom")||s.has("spacingLeft")||s.has("spacingRight"))&&this.applySpacing()}render(){const s=!!this.actionText,a=!!this.showClose;let n="snackbar";return!s&&!a&&(n+=" no-actions"),this.withLongerAction&&(n+=" longer-action"),o`
2
2
  <div class="${n}" ?hidden=${!this.open}>
3
3
  ${this.withLongerAction?o`
4
4
  <div
@@ -1,4 +1,4 @@
1
- import{h as m,m as d,p as r,v as i,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{ensureFocusRingReady as v}from"../shared/lazy-focus-ring.js";import{t as a}from"../../vendor/decorate.js";(function(){try{var b=typeof globalThis<"u"?globalThis:window;if(!b.__scb_ce_guard_installed__){b.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,l,p){try{customElements.get(t)||e(t,l,p)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var c,s=(c=class extends m{constructor(...e){super(...e),this.label="",this.subLabel="",this.symbolVariant="number",this.number=0,this.active=!1,this.completed=!1,this.changeOnCompleted=!1,this.islast=!1,this.variant="horizontal",this.widthWeight=1,this.icon="",this.__nativeFocusRingReady=!1,this.__nativeFocusRingPending=!1,this.__onFocusIn=t=>{const l=t.composedPath()[0];l instanceof HTMLElement&&l.matches(":focus-visible")&&this.__ensureNativeFocusRing()},this.__onFocusOut=()=>{this.__syncInteractiveParts()}}updated(){!this.subLabel||this.subLabel.trim()===""?this.setAttribute("no-content",""):this.removeAttribute("no-content"),this.widthWeight>0?this.style.setProperty("--scb-step-width-weight",String(this.widthWeight)):this.style.removeProperty("--scb-step-width-weight"),this.__syncInteractiveParts()}__getControl(){return this.renderRoot.querySelector(".scb-step-content")}__syncInteractiveParts(){const e=this.__getControl(),t=this.renderRoot.querySelector(".symbol-target"),l=this.renderRoot.querySelector("md-focus-ring"),p=this.renderRoot.querySelector("md-ripple");l&&e&&(l.control=e,l.visible=e.matches(":focus-visible")),p&&t&&(p.control=t)}__ensureNativeFocusRing(){this.__nativeFocusRingReady||this.__nativeFocusRingPending||(this.__nativeFocusRingPending=!0,v(),customElements.whenDefined("md-focus-ring").then(()=>{this.__nativeFocusRingPending=!1,this.__nativeFocusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncInteractiveParts())}))}handleKeyDown(e){e.key==="Enter"||e.key===" "?(e.preventDefault(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))):["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(this.dispatchEvent(new CustomEvent("scb-stepper-keynav",{detail:{key:e.key},bubbles:!0,composed:!0})),e.preventDefault())}render(){const e=this.active?"step":void 0,t=this.label?`${this.label}${this.subLabel?": "+this.subLabel:""}`:`Steg ${this.number||""}`.trim();switch(this.symbolVariant){case"icon":return i`
1
+ import{h as m,m as d,p as r,v as i,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{r as v}from"../../vendor/lazy-focus-ring.js";import{t as a}from"../../vendor/decorate.js";(function(){try{var b=typeof globalThis<"u"?globalThis:window;if(!b.__scb_ce_guard_installed__){b.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,l,p){try{customElements.get(t)||e(t,l,p)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var c,s=(c=class extends m{constructor(...e){super(...e),this.label="",this.subLabel="",this.symbolVariant="number",this.number=0,this.active=!1,this.completed=!1,this.changeOnCompleted=!1,this.islast=!1,this.variant="horizontal",this.widthWeight=1,this.icon="",this.__nativeFocusRingReady=!1,this.__nativeFocusRingPending=!1,this.__onFocusIn=t=>{const l=t.composedPath()[0];l instanceof HTMLElement&&l.matches(":focus-visible")&&this.__ensureNativeFocusRing()},this.__onFocusOut=()=>{this.__syncInteractiveParts()}}updated(){!this.subLabel||this.subLabel.trim()===""?this.setAttribute("no-content",""):this.removeAttribute("no-content"),this.widthWeight>0?this.style.setProperty("--scb-step-width-weight",String(this.widthWeight)):this.style.removeProperty("--scb-step-width-weight"),this.__syncInteractiveParts()}__getControl(){return this.renderRoot.querySelector(".scb-step-content")}__syncInteractiveParts(){const e=this.__getControl(),t=this.renderRoot.querySelector(".symbol-target"),l=this.renderRoot.querySelector("md-focus-ring"),p=this.renderRoot.querySelector("md-ripple");l&&e&&(l.control=e,l.visible=e.matches(":focus-visible")),p&&t&&(p.control=t)}__ensureNativeFocusRing(){this.__nativeFocusRingReady||this.__nativeFocusRingPending||(this.__nativeFocusRingPending=!0,v(),customElements.whenDefined("md-focus-ring").then(()=>{this.__nativeFocusRingPending=!1,this.__nativeFocusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncInteractiveParts())}))}handleKeyDown(e){e.key==="Enter"||e.key===" "?(e.preventDefault(),this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))):["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(e.key)&&(this.dispatchEvent(new CustomEvent("scb-stepper-keynav",{detail:{key:e.key},bubbles:!0,composed:!0})),e.preventDefault())}render(){const e=this.active?"step":void 0,t=this.label?`${this.label}${this.subLabel?": "+this.subLabel:""}`:`Steg ${this.number||""}`.trim();switch(this.symbolVariant){case"icon":return i`
2
2
  <div
3
3
  class="scb-step-content"
4
4
  tabindex="0"
@@ -1,4 +1,4 @@
1
- import{d as T,g as p,h as _,m as S,o as w,p as s,s as u,v as o,y as z}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{t as c}from"../../vendor/decorate.js";import{t as m}from"../../vendor/assertClassBrand.js";import{t as E}from"../../vendor/classPrivateMethodInitSpec.js";import{n as B}from"../../vendor/aria-references.internal.js";import"../../vendor/md-focus-ring.js";import{t as C}from"../../vendor/delegate.js";import{a as M,n as R,o as I,r as H,s as L,t as q}from"../../vendor/form-associated.js";import{t as O}from"../../vendor/redispatch-event.js";import{i as P,n as A,r as F}from"../../vendor/validator.js";import{t as D}from"../../vendor/checkbox-validator.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,a,n){try{customElements.get(r)||e(r,a,n)}catch(v){var l=String(v||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw v}}}}catch{}})();var V=Symbol("dispatchHooks");function j(t,e){const r=t[V];if(!r)throw new Error(`'${t.type}' event needs setupDispatchHooks().`);r.addEventListener("after",e)}var k=new WeakMap;function G(t,...e){let r=k.get(t);r||(r=new Set,k.set(t,r));for(const a of e){if(r.has(a))continue;let n=!1;t.addEventListener(a,l=>{if(n)return;l.stopImmediatePropagation();const v=Reflect.construct(l.constructor,[l.type,l]),f=new EventTarget;v[V]=f,n=!0;const $=t.dispatchEvent(v);n=!1,$||l.preventDefault(),f.dispatchEvent(new Event("after"))},{capture:!0}),r.add(a)}}var U=P(H(M(_))),h=class extends U{constructor(){super(),this.selected=!1,this.icons=!1,this.showOnlySelectedIcon=!1,this.required=!1,this.value="on",this.addEventListener("click",t=>{!L(t)||!this.input||(this.focus(),I(this.input))}),G(this,"keydown"),this.addEventListener("keydown",t=>{j(t,()=>{t.defaultPrevented||t.key!=="Enter"||this.disabled||!this.input||this.input.click()})})}render(){return o`
1
+ import{d as T,g as p,h as _,m as S,o as w,p as s,s as u,v as o,y as z}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import"../../vendor/ripple.js";import{n as E}from"../../vendor/aria-references.internal.js";import{t as c}from"../../vendor/decorate.js";import{t as m}from"../../vendor/assertClassBrand.js";import{t as B}from"../../vendor/classPrivateMethodInitSpec.js";import"../../vendor/md-focus-ring.js";import{t as C}from"../../vendor/delegate.js";import{a as M,n as R,o as I,r as H,s as L,t as q}from"../../vendor/form-associated.js";import{t as O}from"../../vendor/redispatch-event.js";import{i as P,n as A,r as F}from"../../vendor/validator.js";import{t as D}from"../../vendor/checkbox-validator.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,a,n){try{customElements.get(r)||e(r,a,n)}catch(v){var l=String(v||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw v}}}}catch{}})();var V=Symbol("dispatchHooks");function j(t,e){const r=t[V];if(!r)throw new Error(`'${t.type}' event needs setupDispatchHooks().`);r.addEventListener("after",e)}var k=new WeakMap;function G(t,...e){let r=k.get(t);r||(r=new Set,k.set(t,r));for(const a of e){if(r.has(a))continue;let n=!1;t.addEventListener(a,l=>{if(n)return;l.stopImmediatePropagation();const v=Reflect.construct(l.constructor,[l.type,l]),f=new EventTarget;v[V]=f,n=!0;const $=t.dispatchEvent(v);n=!1,$||l.preventDefault(),f.dispatchEvent(new Event("after"))},{capture:!0}),r.add(a)}}var U=P(H(M(_))),h=class extends U{constructor(){super(),this.selected=!1,this.icons=!1,this.showOnlySelectedIcon=!1,this.required=!1,this.value="on",this.addEventListener("click",t=>{!L(t)||!this.input||(this.focus(),I(this.input))}),G(this,"keydown"),this.addEventListener("keydown",t=>{j(t,()=>{t.defaultPrevented||t.key!=="Enter"||this.disabled||!this.input||this.input.click()})})}render(){return o`
2
2
  <div class="switch ${w(this.getRenderClasses())}">
3
3
  <input
4
4
  id="switch"
@@ -43,7 +43,7 @@ import{d as T,g as p,h as _,m as S,o as w,p as s,s as u,v as o,y as z}from"../..
43
43
  </svg>
44
44
  </slot>
45
45
  `}renderTouchTarget(){return o`<span class="touch"></span>`}shouldShowIcons(){return this.icons||this.showOnlySelectedIcon}handleInput(t){const e=t.target;this.selected=e.checked}handleChange(t){O(this,t)}[R](){return this.selected?this.value:null}[q](){return String(this.selected)}formResetCallback(){this.selected=this.hasAttribute("selected")}formStateRestoreCallback(t){this.selected=t==="true"}[A](){return new D(()=>({checked:this.selected,required:this.required}))}[F](){return this.input}};C(h);h.shadowRootOptions={mode:"open",delegatesFocus:!0};u([s({type:Boolean})],h.prototype,"selected",void 0);u([s({type:Boolean})],h.prototype,"icons",void 0);u([s({type:Boolean,attribute:"show-only-selected-icon"})],h.prototype,"showOnlySelectedIcon",void 0);u([s({type:Boolean})],h.prototype,"required",void 0);u([s()],h.prototype,"value",void 0);u([T("input")],h.prototype,"input",void 0);var W=z`@layer styles, hcm;@layer styles{:host{display:inline-flex;outline:none;vertical-align:top;-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-switch-track-height, 32px))/2) 0px}md-focus-ring{--md-focus-ring-shape-start-start: var(--md-switch-track-shape-start-start, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));--md-focus-ring-shape-start-end: var(--md-switch-track-shape-start-end, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));--md-focus-ring-shape-end-end: var(--md-switch-track-shape-end-end, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));--md-focus-ring-shape-end-start: var(--md-switch-track-shape-end-start, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)))}.switch{align-items:center;display:inline-flex;flex-shrink:0;position:relative;width:var(--md-switch-track-width, 52px);height:var(--md-switch-track-height, 32px);border-start-start-radius:var(--md-switch-track-shape-start-start, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));border-start-end-radius:var(--md-switch-track-shape-start-end, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));border-end-end-radius:var(--md-switch-track-shape-end-end, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)));border-end-start-radius:var(--md-switch-track-shape-end-start, var(--md-switch-track-shape, var(--md-sys-shape-corner-full, 9999px)))}input{appearance:none;height:48px;outline:none;margin:0;position:absolute;width:100%;z-index:1;cursor:inherit}:host([touch-target=none]) input{display:none}}@layer styles{.track{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:inherit;display:flex;justify-content:center;align-items:center}.track::before{content:"";display:flex;position:absolute;height:100%;width:100%;border-radius:inherit;box-sizing:border-box;transition-property:opacity,background-color;transition-timing-function:linear;transition-duration:67ms}.disabled .track{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}.disabled .track::before,.disabled .track::after{transition:none;opacity:var(--md-switch-disabled-track-opacity, 0.12)}.disabled .track::before{background-clip:content-box}.selected .track::before{background-color:var(--md-switch-selected-track-color, var(--md-sys-color-primary, #6750a4))}.selected:hover .track::before{background-color:var(--md-switch-selected-hover-track-color, var(--md-sys-color-primary, #6750a4))}.selected:focus-within .track::before{background-color:var(--md-switch-selected-focus-track-color, var(--md-sys-color-primary, #6750a4))}.selected:active .track::before{background-color:var(--md-switch-selected-pressed-track-color, var(--md-sys-color-primary, #6750a4))}.selected.disabled .track{background-clip:border-box}.selected.disabled .track::before{background-color:var(--md-switch-disabled-selected-track-color, var(--md-sys-color-on-surface, #1d1b20))}.unselected .track::before{background-color:var(--md-switch-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-track-outline-color, var(--md-sys-color-outline, #79747e));border-style:solid;border-width:var(--md-switch-track-outline-width, 2px)}.unselected:hover .track::before{background-color:var(--md-switch-hover-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-hover-track-outline-color, var(--md-sys-color-outline, #79747e))}.unselected:focus-visible .track::before{background-color:var(--md-switch-focus-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-focus-track-outline-color, var(--md-sys-color-outline, #79747e))}.unselected:active .track::before{background-color:var(--md-switch-pressed-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-pressed-track-outline-color, var(--md-sys-color-outline, #79747e))}.unselected.disabled .track::before{background-color:var(--md-switch-disabled-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));border-color:var(--md-switch-disabled-track-outline-color, var(--md-sys-color-on-surface, #1d1b20))}}@layer hcm{@media(forced-colors: active){.selected .track::before{background:ButtonText;border-color:ButtonText}.disabled .track::before{border-color:GrayText;opacity:1}.disabled.selected .track::before{background:GrayText}}}@layer styles{.handle-container{display:flex;place-content:center;place-items:center;position:relative;transition:margin 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275)}.selected .handle-container{margin-inline-start:calc(var(--md-switch-track-width, 52px) - var(--md-switch-track-height, 32px))}.unselected .handle-container{margin-inline-end:calc(var(--md-switch-track-width, 52px) - var(--md-switch-track-height, 32px))}.disabled .handle-container{transition:none}.handle{border-start-start-radius:var(--md-switch-handle-shape-start-start, var(--md-switch-handle-shape, var(--md-sys-shape-corner-full, 9999px)));border-start-end-radius:var(--md-switch-handle-shape-start-end, var(--md-switch-handle-shape, var(--md-sys-shape-corner-full, 9999px)));border-end-end-radius:var(--md-switch-handle-shape-end-end, var(--md-switch-handle-shape, var(--md-sys-shape-corner-full, 9999px)));border-end-start-radius:var(--md-switch-handle-shape-end-start, var(--md-switch-handle-shape, var(--md-sys-shape-corner-full, 9999px)));height:var(--md-switch-handle-height, 16px);width:var(--md-switch-handle-width, 16px);transform-origin:center;transition-property:height,width;transition-duration:250ms,250ms;transition-timing-function:cubic-bezier(0.2, 0, 0, 1),cubic-bezier(0.2, 0, 0, 1);z-index:0}.handle::before{content:"";display:flex;inset:0;position:absolute;border-radius:inherit;box-sizing:border-box;transition:background-color 67ms linear}.disabled .handle,.disabled .handle::before{transition:none}.selected .handle{height:var(--md-switch-selected-handle-height, 24px);width:var(--md-switch-selected-handle-width, 24px)}.handle.with-icon{height:var(--md-switch-with-icon-handle-height, 24px);width:var(--md-switch-with-icon-handle-width, 24px)}.selected:not(.disabled):active .handle,.unselected:not(.disabled):active .handle{height:var(--md-switch-pressed-handle-height, 28px);width:var(--md-switch-pressed-handle-width, 28px);transition-timing-function:linear;transition-duration:100ms}.selected .handle::before{background-color:var(--md-switch-selected-handle-color, var(--md-sys-color-on-primary, #fff))}.selected:hover .handle::before{background-color:var(--md-switch-selected-hover-handle-color, var(--md-sys-color-primary-container, #eaddff))}.selected:focus-within .handle::before{background-color:var(--md-switch-selected-focus-handle-color, var(--md-sys-color-primary-container, #eaddff))}.selected:active .handle::before{background-color:var(--md-switch-selected-pressed-handle-color, var(--md-sys-color-primary-container, #eaddff))}.selected.disabled .handle::before{background-color:var(--md-switch-disabled-selected-handle-color, var(--md-sys-color-surface, #fef7ff));opacity:var(--md-switch-disabled-selected-handle-opacity, 1)}.unselected .handle::before{background-color:var(--md-switch-handle-color, var(--md-sys-color-outline, #79747e))}.unselected:hover .handle::before{background-color:var(--md-switch-hover-handle-color, var(--md-sys-color-on-surface-variant, #49454f))}.unselected:focus-within .handle::before{background-color:var(--md-switch-focus-handle-color, var(--md-sys-color-on-surface-variant, #49454f))}.unselected:active .handle::before{background-color:var(--md-switch-pressed-handle-color, var(--md-sys-color-on-surface-variant, #49454f))}.unselected.disabled .handle::before{background-color:var(--md-switch-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-switch-disabled-handle-opacity, 0.38)}md-ripple{border-radius:var(--md-switch-state-layer-shape, var(--md-sys-shape-corner-full, 9999px));height:var(--md-switch-state-layer-size, 40px);inset:unset;width:var(--md-switch-state-layer-size, 40px)}.selected md-ripple{--md-ripple-hover-color: var(--md-switch-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-color: var(--md-switch-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-switch-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-opacity: var(--md-switch-selected-pressed-state-layer-opacity, 0.12)}.unselected md-ripple{--md-ripple-hover-color: var(--md-switch-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-color: var(--md-switch-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-switch-hover-state-layer-opacity, 0.08);--md-ripple-pressed-opacity: var(--md-switch-pressed-state-layer-opacity, 0.12)}}@layer hcm{@media(forced-colors: active){.unselected .handle::before{background:ButtonText}.disabled .handle::before{opacity:1}.disabled.unselected .handle::before{background:GrayText}}}@layer styles{.icons{position:relative;height:100%;width:100%}.icon{position:absolute;inset:0;margin:auto;display:flex;align-items:center;justify-content:center;fill:currentColor;transition:fill 67ms linear,opacity 33ms linear,transform 167ms cubic-bezier(0.2, 0, 0, 1);opacity:0}.disabled .icon{transition:none}.selected .icon--on,.unselected .icon--off{opacity:1}.unselected .handle:not(.with-icon) .icon--on{transform:rotate(-45deg)}.icon--off{width:var(--md-switch-icon-size, 16px);height:var(--md-switch-icon-size, 16px);color:var(--md-switch-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}.unselected:hover .icon--off{color:var(--md-switch-hover-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}.unselected:focus-within .icon--off{color:var(--md-switch-focus-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}.unselected:active .icon--off{color:var(--md-switch-pressed-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9))}.unselected.disabled .icon--off{color:var(--md-switch-disabled-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9));opacity:var(--md-switch-disabled-icon-opacity, 0.38)}.icon--on{width:var(--md-switch-selected-icon-size, 16px);height:var(--md-switch-selected-icon-size, 16px);color:var(--md-switch-selected-icon-color, var(--md-sys-color-on-primary-container, #21005d))}.selected:hover .icon--on{color:var(--md-switch-selected-hover-icon-color, var(--md-sys-color-on-primary-container, #21005d))}.selected:focus-within .icon--on{color:var(--md-switch-selected-focus-icon-color, var(--md-sys-color-on-primary-container, #21005d))}.selected:active .icon--on{color:var(--md-switch-selected-pressed-icon-color, var(--md-sys-color-on-primary-container, #21005d))}.selected.disabled .icon--on{color:var(--md-switch-disabled-selected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-switch-disabled-selected-icon-opacity, 0.38)}}@layer hcm{@media(forced-colors: active){.icon--off{fill:Canvas}.icon--on{fill:ButtonText}.disabled.unselected .icon--off,.disabled.selected .icon--on{opacity:1}.disabled .icon--on{fill:GrayText}}}
46
- `,y=class extends h{};y.styles=[W];y=u([S("md-switch")],y);var d,g,i=(d=new WeakSet,g=class extends _{constructor(){super(),E(this,d),this._internals=null,this.label="",this.ariaLabel="",this.ariaControls=null,this.ariaExpanded=null,this.icons=!1,this.selected=!1,this.required=!1,this.error=!1,this.disabled=!1,this.supportingText="",this.errorText="",this.fullWidth=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.name="",this.value="on",this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialSelected=!1,this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this._initialSelected=this.selected,this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.selected=this._initialSelected,this.error=!1,this._hasValidationBeenReported=!1,this.__syncFormValue(),this.__syncValidity()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("reset",this._formResetHandler,!0),this._form.addEventListener("submit",this._formSubmitHandler,!0)),this.__syncFormValue()}disconnectedCallback(){this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),super.disconnectedCallback()}firstUpdated(){this.shadowRoot?.querySelector("md-switch")?.addEventListener("change",e=>{this.selected=e.target.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}),m(d,this,x).call(this)}updated(e){super.updated(e),B(this.renderRoot.querySelector("md-switch")),e.has("disabled")&&this.toggleAttribute("aria-disabled",this.disabled),(e.has("selected")||e.has("disabled")||e.has("value"))&&this.__syncFormValue(),(e.has("selected")||e.has("disabled")||e.has("required")||e.has("errorText"))&&this.__syncValidity(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&m(d,this,x).call(this)}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}__getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!this.selected?this.errorText||"Aktivera det här valet.":""}__syncValidity(){const e=this.shadowRoot?.querySelector("md-switch"),r=this.disabled?"":this.__getValidationMessage(),a=this.error,n=this._validationMessage;if(this._internals)if(r){const l=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(l,r,e??void 0)}else this._internals.setValidity({});this._validationMessage=r,this.error=this.disabled?!1:r?this._hasValidationBeenReported||a:a&&!this._hasValidationBeenReported&&!n,this.toggleAttribute("aria-invalid",this.error),(a!==this.error||n!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this.__syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){return this._hasValidationBeenReported=!0,this.__syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??""),this.__syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this.__getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}__syncFormValue(){if(!this._internals)return;const e=this.disabled||!this.selected?null:this.value;this._internals.setFormValue(e)}render(){const e=this.label?.trim(),r=e||this.ariaLabel?.trim()||p,a=this.__getVisibleSupportingText(),n=a?"switch-supporting-text":void 0,l=o`
46
+ `,y=class extends h{};y.styles=[W];y=u([S("md-switch")],y);var d,g,i=(d=new WeakSet,g=class extends _{constructor(){super(),B(this,d),this._internals=null,this.label="",this.ariaLabel="",this.ariaControls=null,this.ariaExpanded=null,this.icons=!1,this.selected=!1,this.required=!1,this.error=!1,this.disabled=!1,this.supportingText="",this.errorText="",this.fullWidth=!1,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.name="",this.value="on",this._form=null,this._formResetHandler=null,this._formSubmitHandler=null,this._initialSelected=!1,this._customValidationMessage="",this._validationMessage="",this._hasValidationBeenReported=!1,"attachInternals"in this&&(this._internals=this.attachInternals())}connectedCallback(){super.connectedCallback(),this._initialSelected=this.selected,this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.selected=this._initialSelected,this.error=!1,this._hasValidationBeenReported=!1,this.__syncFormValue(),this.__syncValidity()},this._formSubmitHandler=e=>{this.reportValidity()||(e.preventDefault(),e.stopPropagation())},this._form.addEventListener("reset",this._formResetHandler,!0),this._form.addEventListener("submit",this._formSubmitHandler,!0)),this.__syncFormValue()}disconnectedCallback(){this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),this._form&&this._formSubmitHandler&&this._form.removeEventListener("submit",this._formSubmitHandler,!0),super.disconnectedCallback()}firstUpdated(){this.shadowRoot?.querySelector("md-switch")?.addEventListener("change",e=>{this.selected=e.target.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:this.selected},bubbles:!0,composed:!0}))}),m(d,this,x).call(this)}updated(e){super.updated(e),E(this.renderRoot.querySelector("md-switch")),e.has("disabled")&&this.toggleAttribute("aria-disabled",this.disabled),(e.has("selected")||e.has("disabled")||e.has("value"))&&this.__syncFormValue(),(e.has("selected")||e.has("disabled")||e.has("required")||e.has("errorText"))&&this.__syncValidity(),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&m(d,this,x).call(this)}formDisabledCallback(e){this.disabled=e,e&&(this._hasValidationBeenReported=!1)}__getValidationMessage(){return this._customValidationMessage?this._customValidationMessage:this.required&&!this.selected?this.errorText||"Aktivera det här valet.":""}__syncValidity(){const e=this.shadowRoot?.querySelector("md-switch"),r=this.disabled?"":this.__getValidationMessage(),a=this.error,n=this._validationMessage;if(this._internals)if(r){const l=this._customValidationMessage?{customError:!0}:{valueMissing:!0};this._internals.setValidity(l,r,e??void 0)}else this._internals.setValidity({});this._validationMessage=r,this.error=this.disabled?!1:r?this._hasValidationBeenReported||a:a&&!this._hasValidationBeenReported&&!n,this.toggleAttribute("aria-invalid",this.error),(a!==this.error||n!==this._validationMessage)&&this.requestUpdate()}checkValidity(){return this.__syncValidity(),this._internals?this._internals.checkValidity():!this.error}reportValidity(){return this._hasValidationBeenReported=!0,this.__syncValidity(),this._internals?this._internals.reportValidity():this.checkValidity()}setCustomValidity(e){this._customValidationMessage=String(e??""),this.__syncValidity()}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??this.__getValidationMessage()}get willValidate(){return this._internals?.willValidate??!0}get labels(){return this._internals?.labels}__syncFormValue(){if(!this._internals)return;const e=this.disabled||!this.selected?null:this.value;this._internals.setFormValue(e)}render(){const e=this.label?.trim(),r=e||this.ariaLabel?.trim()||p,a=this.__getVisibleSupportingText(),n=a?"switch-supporting-text":void 0,l=o`
47
47
  <span class="switch-control">
48
48
  ${o`
49
49
  <md-switch
@@ -1,4 +1,4 @@
1
- import{h as _,m as x,p as f,v as w,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{componentSizeToken as y}from"../shared/component-size-token.js";import{t as g}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var m=typeof globalThis<"u"?globalThis:window;if(!m.__scb_ce_guard_installed__){m.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,t){try{customElements.get(s)||e(s,r,t)}catch(o){var l=String(o||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var p,S=96,A=32,h=(p=class extends _{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return w`
1
+ import{h as _,m as x,p as f,v as w,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as y}from"../../vendor/component-size-token.js";import{t as g}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";(function(){try{var m=typeof globalThis<"u"?globalThis:window;if(!m.__scb_ce_guard_installed__){m.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,r,t){try{customElements.get(s)||e(s,r,t)}catch(o){var l=String(o||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var p,S=96,A=32,h=(p=class extends _{constructor(...e){super(...e),this.dataSorting=!1,this.columnWidthMode="auto",this._sortedColumn=null,this._sortDirection="asc",this._columnWidthFrame=null,this._onSlotChange=()=>{this._attachThListeners()}}render(){return w`
2
2
  <div class="scb-table-scroll-wrapper">
3
3
  <slot @slotchange=${this._onSlotChange}></slot>
4
4
  </div>
@@ -1,4 +1,4 @@
1
- import{h as y,m as _,p as g,v as m,y as w}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{componentSizeToken as v}from"../shared/component-size-token.js";import{t as u}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-pagination/scb-pagination.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(a,s,r){try{customElements.get(a)||e(a,s,r)}catch(n){var l=String(n||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var f,h=(f=class extends y{constructor(...e){super(...e),this.searchTerm="",this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,this.disableSorting=[],this.currentPage=1,this.totalRows=0,this._sortedColumn=null,this._sortDirection="asc",this._filteredRows=null,this._tbodyObserver=null,this._observedTbody=null,this._pendingTableRefresh=!1,this._suppressTbodyObserver=!1,this._initialTableRefreshFrame=0,this._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=a=>{const s=a.detail;s&&typeof s.page=="number"&&this._changePage(s.page)}}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this._initialTableRefreshFrame),this._disconnectTbodyObserver()}attributeChangedCallback(e,a,s){if(super.attributeChangedCallback(e,a,s),a!==s){if(e==="searchterm"){queueMicrotask(()=>{this.isConnected&&this._filterTable()});return}if(e==="currentpage"){queueMicrotask(()=>{this.isConnected&&this._paginateTable()});return}(e==="page-size"||e==="with-filtering-search"||e==="with-pagination")&&this._scheduleTableRefresh()}}render(){const e=Math.ceil(this.totalRows/this.pageSize);return m`
1
+ import{h as y,m as _,p as g,v as m,y as w}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as v}from"../../vendor/component-size-token.js";import{t as u}from"../../vendor/decorate.js";import"../scb-icon-button/scb-icon-button.js";import"../scb-search/scb-search.js";import"../scb-pagination/scb-pagination.js";(function(){try{var p=typeof globalThis<"u"?globalThis:window;if(!p.__scb_ce_guard_installed__){p.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(a,s,r){try{customElements.get(a)||e(a,s,r)}catch(n){var l=String(n||"");if(l.indexOf("already been used")===-1&&l.indexOf("NotSupportedError")===-1)throw n}}}}catch{}})();var f,h=(f=class extends y{constructor(...e){super(...e),this.searchTerm="",this.pagination=!1,this.filteringSearch=!1,this.noScroll=!1,this.pageSize=10,this.disableSorting=[],this.currentPage=1,this.totalRows=0,this._sortedColumn=null,this._sortDirection="asc",this._filteredRows=null,this._tbodyObserver=null,this._observedTbody=null,this._pendingTableRefresh=!1,this._suppressTbodyObserver=!1,this._initialTableRefreshFrame=0,this._onSlotChange=()=>{this._attachTbodyObserver(),this._refreshFromTableContent()},this._onPaginationChange=a=>{const s=a.detail;s&&typeof s.page=="number"&&this._changePage(s.page)}}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this._initialTableRefreshFrame),this._disconnectTbodyObserver()}attributeChangedCallback(e,a,s){if(super.attributeChangedCallback(e,a,s),a!==s){if(e==="searchterm"){queueMicrotask(()=>{this.isConnected&&this._filterTable()});return}if(e==="currentpage"){queueMicrotask(()=>{this.isConnected&&this._paginateTable()});return}(e==="page-size"||e==="with-filtering-search"||e==="with-pagination")&&this._scheduleTableRefresh()}}render(){const e=Math.ceil(this.totalRows/this.pageSize);return m`
2
2
  ${this.filteringSearch?m`
3
3
  <div class="filtering-search">
4
4
  <scb-search