scb-wc 0.1.243 → 0.1.244

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 (78) 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-button/scb-button.js +3 -3
  10. package/mvc/components/scb-calendar/scb-calendar.js +1 -1
  11. package/mvc/components/scb-calendar-card/scb-calendar-card.js +2 -2
  12. package/mvc/components/scb-card/scb-card.js +2 -2
  13. package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +1 -1
  14. package/mvc/components/scb-dialog/scb-dialog.js +1 -1
  15. package/mvc/components/scb-drawer/scb-drawer.js +3 -3
  16. package/mvc/components/scb-drop-zone/scb-drop-zone.js +1 -1
  17. package/mvc/components/scb-dropdown/scb-dropdown.js +3 -3
  18. package/mvc/components/scb-fact-card/scb-fact-card.js +1 -1
  19. package/mvc/components/scb-header/scb-header.js +2 -2
  20. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +6 -6
  21. package/mvc/components/scb-icon-button/scb-icon-button.js +5 -5
  22. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +6 -6
  23. package/mvc/components/scb-link/scb-link.js +1 -1
  24. package/mvc/components/scb-link-button/scb-link-button.js +1 -1
  25. package/mvc/components/scb-list/scb-list-item.js +6 -6
  26. package/mvc/components/scb-menu/scb-menu-item.js +1 -1
  27. package/mvc/components/scb-nav/scb-nav.js +1 -1
  28. package/mvc/components/scb-notification-card/scb-notification-card.js +1 -1
  29. package/mvc/components/scb-options-menu/scb-options-menu-item.js +1 -1
  30. package/mvc/components/scb-options-menu/scb-options-menu.js +2 -2
  31. package/mvc/components/scb-options-menu/scb-options-sub-menu.js +1 -1
  32. package/mvc/components/scb-overlay/scb-overlay.js +3 -3
  33. package/mvc/components/scb-pagination/scb-pagination.js +1 -1
  34. package/mvc/components/scb-progress-stepper/scb-progress-step.js +1 -1
  35. package/mvc/components/scb-search/scb-search.js +3 -3
  36. package/mvc/components/scb-segmented-button/scb-segmented-item.js +1 -1
  37. package/mvc/components/scb-select/scb-select-option.js +1 -1
  38. package/mvc/components/scb-select/scb-select.js +1 -1
  39. package/mvc/components/scb-snackbar/scb-snackbar.js +1 -1
  40. package/mvc/components/scb-stepper/scb-step.js +1 -1
  41. package/mvc/components/scb-table/scb-table.js +1 -1
  42. package/mvc/components/scb-table-advanced/scb-table-advanced.js +1 -1
  43. package/mvc/components/scb-textfield/scb-textfield.js +176 -34
  44. package/mvc/components/scb-toc/scb-toc-item.js +1 -1
  45. package/mvc/components/scb-tooltip/scb-tooltip.js +1 -1
  46. package/mvc/{components/shared → vendor}/component-size-token.js +1 -1
  47. package/mvc/vendor/lazy-focus-ring.js +2 -0
  48. package/mvc/vendor/lazy-ripple.js +2 -0
  49. package/mvc/{components/shared → vendor}/manual-popover.js +1 -1
  50. package/mvc/{components/scb-chevron → vendor}/scb-chevron.js +1 -1
  51. package/mvc/vendor/scb-icon-svg.js +11 -0
  52. package/package.json +2 -12
  53. package/scb-viz/scb-viz-series-differentiation-registry.js +7 -10
  54. package/scb-viz/scb-viz.js +43 -43
  55. package/scb-wc.bundle.js +288 -409
  56. package/scb-wc.d.ts +0 -28
  57. package/shared/scb-icon-svg.js +2 -5
  58. package/mvc/components/scb-datepicker/scb-datepicker.js +0 -143
  59. package/mvc/components/scb-table-next/read-table.js +0 -1
  60. package/mvc/components/scb-table-next/scb-table-next.js +0 -6
  61. package/mvc/components/shared/lazy-focus-ring.js +0 -2
  62. package/mvc/components/shared/lazy-ripple.js +0 -2
  63. package/mvc/components/shared/scb-icon-svg.js +0 -11
  64. package/scb-components/index.d.ts +0 -108
  65. package/scb-components/scb-table-next/read-table.d.ts +0 -29
  66. package/scb-components/scb-table-next/scb-table-next.d.ts +0 -22
  67. package/scb-components/scb-viz/scb-viz-actions-runtime.d.ts +0 -26
  68. package/scb-components/scb-viz/scb-viz-print-runtime.d.ts +0 -36
  69. package/scb-components/scb-viz/scb-viz-series-differentiation-registry.d.ts +0 -21
  70. package/scb-components/scb-viz/scb-viz-series-differentiation-runtime.d.ts +0 -42
  71. package/scb-components/scb-viz/scb-viz-table-runtime.d.ts +0 -31
  72. package/scb-components/shared/component-size-token.d.ts +0 -1
  73. package/scb-components/shared/lazy-focus-ring.d.ts +0 -4
  74. package/scb-components/shared/lazy-ripple.d.ts +0 -9
  75. package/scb-components/shared/manual-popover.d.ts +0 -7
  76. package/scb-components/shared/scb-icon-svg.d.ts +0 -3
  77. package/scb-table-next/read-table.js +0 -87
  78. package/scb-table-next/scb-table-next.js +0 -226
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../shared/lazy-ripple.js"])))=>i.map(i=>d[i]);
2
- import{g as l,h as S,m as A,p as n,v as b,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as z}from"../../vendor/preload-helper.js";import{t as N}from"../../vendor/component-defaults.js";import{t as s}from"../../vendor/decorate.js";import{t as x}from"../../vendor/assertClassBrand.js";import{t as T}from"../../vendor/classPrivateMethodInitSpec.js";import{t as _}from"../../vendor/aria-references.internal.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,o){try{customElements.get(t)||e(t,i,o)}catch(u){var r=String(u||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var g,v,y;function P(){return v??(v=z(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),v}function k(){return y??(y=z(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),y}var a=(g=new WeakSet,class extends S{constructor(...e){super(...e),T(this,g),this.variant="filled",this.size=N["scb-button"].size,this.type="button",this.name="",this.value="",this.formId=null,this.formAction="",this.formEnctype="",this.formMethod="",this.formNoValidate=!1,this.formTarget="",this.label="Button",this.trailingIcon=!1,this.icon="",this.iconFilled=!1,this.disabled=!1,this.fullWidth=!1,this.href="",this.target="",this.rel="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__hasDefaultSlotContent=!1,this.__nativeFocusRingReady=!1,this.__nativeRippleReady=!1,this.__nativeRipplePendingClick=!1,this.__ensureNativeFocusRing=()=>{this.__nativeFocusRingReady||P().then(({ensureFocusRingReady:t})=>(t(),customElements.whenDefined("md-focus-ring"))).then(()=>{this.__nativeFocusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncNativeFocusRingControl())})},this.__onNativeFocusIn=t=>{const i=t.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureNativeFocusRing()},this.__ensureNativeRipple=t=>{this.__nativeRippleReady||this.disabled||(t&&(this.__nativeRipplePendingPointerEvent=t),k().then(({ensureRippleReady:i})=>i()).then(()=>{this.disabled||(this.__nativeRippleReady=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.__syncNativeFocusRingControl(),this.__replayNativeRippleState()}))}))},this.__onNativePointerWarmup=t=>{this.__ensureNativeRipple(t)},this.__onNativeClick=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}(!this.__nativeRippleReady||this.__nativeRipplePendingPointerEvent)&&(this.__nativeRipplePendingClick=!0,this.__ensureNativeRipple()),!this.href&&queueMicrotask(()=>{if(t.defaultPrevented||this.disabled||this.href)return;const i=this.__getAssociatedForm();if(!i)return;const o=this.__normalizedButtonType();o==="submit"&&this.__requestFormSubmit(i),o==="reset"&&i.reset()})}}__getNativeControl(){return this.renderRoot.querySelector(".native-button")}__handleDefaultSlotChange(e){const t=e.target.assignedNodes({flatten:!0}).some(i=>i.nodeType===Node.TEXT_NODE?!!i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE);this.__hasDefaultSlotContent!==t&&(this.__hasDefaultSlotContent=t,this.requestUpdate()),this.updateComplete.then(()=>this.__syncAriaToInner())}__syncAriaToInner(){const e=this.__getNativeControl();e&&this.__syncAriaToControl(e)}__syncAriaToControl(e){const t=(this.getAttribute("aria-label")||"").trim(),i=this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"",o=t||i;o?e.setAttribute("aria-label",o):e.removeAttribute("aria-label"),_(this,e);const r=this.getAttribute("aria-haspopup");r!==null?e.setAttribute("aria-haspopup",r):e.removeAttribute("aria-haspopup");const u=this.getAttribute("aria-expanded");u!==null?e.setAttribute("aria-expanded",u):e.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver(R=>{const p=this.__getNativeControl();if(p)for(const m of R){if(m.type!=="attributes"||!m.attributeName)continue;const c=m.attributeName,h=this.getAttribute(c);if(c==="aria-label"){const f=(h||(this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"")).trim();f?p.setAttribute("aria-label",f):p.removeAttribute("aria-label")}else c==="aria-controls"||c==="aria-describedby"?_(this,p):(c==="aria-expanded"||c==="aria-haspopup")&&(h===null?p.removeAttribute(c):p.setAttribute(c,h))}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-describedby","aria-expanded","aria-haspopup"]})}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.__syncAriaToInner()}focus(e){const t=this.__getNativeControl();if(t){t.focus(e);return}this.updateComplete.then(()=>this.__getNativeControl()?.focus(e))}blur(){this.__getNativeControl()?.blur()}firstUpdated(){x(g,this,w).call(this)}updated(e){(e.has("variant")||e.has("label")||e.has("icon")||e.has("href"))&&this.updateComplete.then(()=>this.__syncAriaToInner()),(this.__nativeFocusRingReady||this.__nativeRippleReady)&&this.updateComplete.then(()=>this.__syncNativeFocusRingControl()),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&x(g,this,w).call(this)}disconnectedCallback(){this.__ariaObserver?.disconnect(),super.disconnectedCallback()}__normalizedButtonType(){return this.type==="submit"||this.type==="reset"?this.type:"button"}__getAssociatedForm(){if(this.formId!==null||this.hasAttribute("form")){const e=(this.formId??this.getAttribute("form")??"").trim();if(!e)return null;const t=this.getRootNode(),i=t instanceof Document||t instanceof ShadowRoot?t.getElementById(e):null;return i instanceof HTMLFormElement?i:null}return this.closest("form")}get form(){return this.__getAssociatedForm()}__requestFormSubmit(e){const t=this.ownerDocument.createElement("button");t.type="submit",t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.setAttribute("data-scb-button-submitter","");const i=[["name",this.name,this.hasAttribute("name")],["value",this.value,this.hasAttribute("value")],["formaction",this.formAction,this.hasAttribute("formaction")],["formenctype",this.formEnctype,this.hasAttribute("formenctype")],["formmethod",this.formMethod,this.hasAttribute("formmethod")],["formtarget",this.formTarget,this.hasAttribute("formtarget")]];for(const[o,r,u]of i)(u||r!=="")&&t.setAttribute(o,r);this.formNoValidate&&t.setAttribute("formnovalidate",""),e.append(t);try{e.requestSubmit(t)}finally{t.remove()}}__syncNativeFocusRingControl(){const e=this.renderRoot.querySelector("md-focus-ring"),t=this.__getNativeControl();e&&t&&(e.control=t,e.visible=t.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&t&&(i.control=t)}async __replayNativeRippleState(){const e=this.renderRoot.querySelector("md-ripple"),t=this.__getNativeControl(),i=this.__nativeRipplePendingPointerEvent,o=this.__nativeRipplePendingClick;this.__nativeRipplePendingPointerEvent=void 0,this.__nativeRipplePendingClick=!1;const{syncRippleToControl:r}=await k();await r(e,t,i,o)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}static get styles(){return C`:host{display:inline-flex;block-size:var(--scb-button-block-size, auto);margin-block-start:var(--scb-button-spacing-block-start, 0);margin-block-end:var(--scb-button-spacing-block-end, 0);margin-inline-start:var(--scb-button-spacing-inline-start, 0);margin-inline-end:var(--scb-button-spacing-inline-end, 0);--scb-button-font-variation-settings:'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;--scb-button-container-height:var(--scb-button-design-height-medium);--scb-button-padding-block:var(--scb-button-design-padding-block-medium);--scb-button-padding-inline:var(--scb-button-design-padding-inline-medium);--scb-button-icon-edge-space:var(--scb-button-design-padding-inline-medium);--scb-button-icon-gap:var(--scb-button-design-gap-medium);--scb-button-icon-size:var(--scb-button-design-icon-medium);--scb-button-shape-radius:var(--scb-button-design-surface-radius-medium);--scb-button-label-text-font:var(--scb-button-design-text-medium-font);--scb-button-label-text-size:var(--scb-button-design-text-medium-size);--scb-button-label-text-weight:var(--scb-button-design-text-medium-weight);--scb-button-label-text-line-height:var(--scb-button-design-text-medium-line-height);--scb-button-label-text-tracking:var(--scb-button-design-text-medium-tracking)}:host([size='extra-small']){--scb-button-container-height:var(--scb-button-design-height-extra-small);--scb-button-padding-block:var(--scb-button-design-padding-block-extra-small);--scb-button-padding-inline:var(--scb-button-design-padding-inline-extra-small);--scb-button-icon-edge-space:var(--scb-button-design-padding-inline-extra-small);--scb-button-icon-gap:var(--scb-button-design-gap-extra-small);--scb-button-icon-size:var(--scb-button-design-icon-extra-small);--scb-button-shape-radius:var(--scb-button-design-surface-radius-extra-small);--scb-button-label-text-font:var(--scb-button-design-text-extra-small-font);--scb-button-label-text-size:var(--scb-button-design-text-extra-small-size);--scb-button-label-text-weight:var(--scb-button-design-text-extra-small-weight);--scb-button-label-text-line-height:var(--scb-button-design-text-extra-small-line-height);--scb-button-label-text-tracking:var(--scb-button-design-text-extra-small-tracking)}:host([size='small']){--scb-button-container-height:var(--scb-button-design-height-small);--scb-button-padding-block:var(--scb-button-design-padding-block-small);--scb-button-padding-inline:var(--scb-button-design-padding-inline-small);--scb-button-icon-edge-space:var(--scb-button-design-padding-inline-small);--scb-button-icon-gap:var(--scb-button-design-gap-small);--scb-button-icon-size:var(--scb-button-design-icon-small);--scb-button-shape-radius:var(--scb-button-design-surface-radius-small);--scb-button-label-text-font:var(--scb-button-design-text-small-font);--scb-button-label-text-size:var(--scb-button-design-text-small-size);--scb-button-label-text-weight:var(--scb-button-design-text-small-weight);--scb-button-label-text-line-height:var(--scb-button-design-text-small-line-height);--scb-button-label-text-tracking:var(--scb-button-design-text-small-tracking)}:host([size='large']){--scb-button-container-height:var(--scb-button-design-height-large);--scb-button-padding-block:var(--scb-button-design-padding-block-large);--scb-button-padding-inline:var(--scb-button-design-padding-inline-large);--scb-button-icon-edge-space:var(--scb-button-design-padding-inline-large);--scb-button-icon-gap:var(--scb-button-design-gap-large);--scb-button-icon-size:var(--scb-button-design-icon-large);--scb-button-shape-radius:var(--scb-button-design-surface-radius-large);--scb-button-label-text-font:var(--scb-button-design-text-large-font);--scb-button-label-text-size:var(--scb-button-design-text-large-size);--scb-button-label-text-weight:var(--scb-button-design-text-large-weight);--scb-button-label-text-line-height:var(--scb-button-design-text-large-line-height);--scb-button-label-text-tracking:var(--scb-button-design-text-large-tracking)}:host([icon-filled]){--scb-button-font-variation-settings:'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24}.native-button,.native-button-wrap{position:relative;display:inline-flex}.native-button-wrap{border-radius:var(--scb-button-shape-radius, var(--md-sys-shape-corner-full, 999px))}.native-button{z-index:0;box-sizing:border-box;align-items:center;justify-content:center;gap:var(--scb-button-icon-gap);min-block-size:var(--scb-button-block-size, var(--scb-button-container-height));block-size:var(--scb-button-block-size, var(--scb-button-container-height));min-inline-size:64px;inline-size:auto;padding-block:var(--scb-button-padding-block);padding-inline:var(--scb-button-padding-inline);overflow:hidden;border:0;border-radius:inherit;background:0 0;color:var(--scb-button-low-emphasis-content-color, var(--md-sys-color-primary));font-family:var(--scb-button-label-text-font);font-size:var(--scb-button-label-text-size);font-weight:var(--scb-button-label-text-weight);line-height:var(--scb-button-label-text-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));letter-spacing:var(--scb-button-label-text-tracking, normal);text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;appearance:none;-webkit-appearance:none;touch-action:manipulation}::slotted(*){display:inline!important;margin:0!important;color:inherit!important;font:inherit!important;letter-spacing:inherit!important;line-height:inherit!important}.native-button::before{content:"";position:absolute;inset:0;z-index:-1;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.native-button:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.native-button:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.native-button:focus{outline:0}:host(:not([data-native-focus-ring-ready])) .native-button:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary));outline-offset:var(--spacing-1, 2px)}.native-button:disabled,.native-button[aria-disabled=true]{color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));cursor:default;opacity:1;pointer-events:none}:host(:not([variant])) .native-button,:host([variant='filled']) .native-button{border-color:transparent;background:var(--scb-button-filled-container-color, var(--md-sys-color-primary));color:var(--scb-button-filled-content-color, var(--md-sys-color-on-primary))}:host([variant='outlined']) .native-button{background:0 0;color:var(--scb-button-low-emphasis-content-color, var(--md-sys-color-primary));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--scb-button-outline-color, var(--md-sys-color-outline))}:host([variant='outlined']) .native-button:disabled,:host([variant='outlined']) .native-button[aria-disabled=true]{color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--scb-color-compat-disabled-container)}:host([variant='filled-tonal']) .native-button{border-color:transparent;background:var(--scb-button-tonal-container-color, var(--md-sys-color-secondary-container));color:var(--scb-button-tonal-content-color, var(--md-sys-color-on-secondary-container))}:host(:not([variant])) .native-button:disabled,:host(:not([variant])) .native-button[aria-disabled=true],:host([variant='filled']) .native-button:disabled,:host([variant='filled']) .native-button[aria-disabled=true],:host([variant='filled-tonal']) .native-button:disabled,:host([variant='filled-tonal']) .native-button[aria-disabled=true]{background:var(--scb-button-disabled-container-color, var(--scb-color-compat-disabled-container));color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content))}:host([variant='text']) .native-button{min-inline-size:0;background:0 0;color:var(--scb-button-low-emphasis-content-color, var(--md-sys-color-primary))}:host([variant='text']) .native-button:disabled,:host([variant='text']) .native-button[aria-disabled=true]{color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content))}.native-icon{flex:0 0 auto;display:inline-block;inline-size:var(--scb-button-icon-size);block-size:var(--scb-button-icon-size);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--scb-button-icon-size);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:var(--scb-button-font-variation-settings);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.native-icon.scb-svg-icon{fill:currentColor;font:inherit}.native-button-wrap md-ripple{position:absolute;inset:0;border-radius:inherit;pointer-events:none}.native-button-wrap md-focus-ring{pointer-events:none}:host([full-width]){display:flex;inline-size:100%}:host([full-width]) .native-button,:host([full-width]) .native-button-wrap{inline-size:100%;flex:1 1 auto}:host{--scb-button-design-height-extra-small:var(--scb-buttons-control-size-extra-small, var(--scale-07, 28px));--scb-button-design-height-small:var(--scb-buttons-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)));--scb-button-design-height-medium:var(--scb-buttons-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-button-design-height-large:var(--scb-buttons-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)));--scb-button-design-text-extra-small-font:var(--scb-button-text-extra-small-font, var(--scb-typography-label-small-font, var(--md-sys-typescale-label-small-font, var(--brand))));--scb-button-design-text-extra-small-size:var(--scb-button-text-extra-small-size, var(--scb-typography-label-small-size, var(--md-sys-typescale-label-small-size, 14px)));--scb-button-design-text-extra-small-line-height:var(--scb-button-text-extra-small-line-height, var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px)));--scb-button-design-text-extra-small-tracking:var(--scb-button-text-extra-small-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px))));--scb-button-design-text-extra-small-weight:var(--scb-button-text-extra-small-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600))));--scb-button-design-text-extra-small-letter-spacing:var(--scb-button-text-extra-small-letter-spacing, var(--scb-button-text-extra-small-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px)))));--scb-button-design-text-extra-small-font-weight:var(--scb-button-text-extra-small-font-weight, var(--scb-button-text-extra-small-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600)))));--scb-button-design-text-small-font:var(--scb-button-text-small-font, var(--scb-typography-label-small-font, var(--md-sys-typescale-label-small-font, var(--brand))));--scb-button-design-text-small-size:var(--scb-button-text-small-size, var(--scb-typography-label-small-size, var(--md-sys-typescale-label-small-size, 14px)));--scb-button-design-text-small-line-height:var(--scb-button-text-small-line-height, var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px)));--scb-button-design-text-small-tracking:var(--scb-button-text-small-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px))));--scb-button-design-text-small-weight:var(--scb-button-text-small-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600))));--scb-button-design-text-small-letter-spacing:var(--scb-button-text-small-letter-spacing, var(--scb-button-text-small-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px)))));--scb-button-design-text-small-font-weight:var(--scb-button-text-small-font-weight, var(--scb-button-text-small-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600)))));--scb-button-design-text-medium-font:var(--scb-button-text-medium-font, var(--scb-typography-label-small-font, var(--md-sys-typescale-label-small-font, var(--brand))));--scb-button-design-text-medium-size:var(--scb-button-text-medium-size, var(--scb-typography-label-small-size, var(--md-sys-typescale-label-small-size, 14px)));--scb-button-design-text-medium-line-height:var(--scb-button-text-medium-line-height, var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px)));--scb-button-design-text-medium-tracking:var(--scb-button-text-medium-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px))));--scb-button-design-text-medium-weight:var(--scb-button-text-medium-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600))));--scb-button-design-text-medium-letter-spacing:var(--scb-button-text-medium-letter-spacing, var(--scb-button-text-medium-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px)))));--scb-button-design-text-medium-font-weight:var(--scb-button-text-medium-font-weight, var(--scb-button-text-medium-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600)))));--scb-button-design-text-large-font:var(--scb-button-text-large-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font, var(--brand))));--scb-button-design-text-large-size:var(--scb-button-text-large-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size, 16px)));--scb-button-design-text-large-line-height:var(--scb-button-text-large-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height, 24px)));--scb-button-design-text-large-tracking:var(--scb-button-text-large-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking, var(--tracking-03, -0.15px))));--scb-button-design-text-large-weight:var(--scb-button-text-large-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight, var(--weight-semibold, 600))));--scb-button-design-text-large-letter-spacing:var(--scb-button-text-large-letter-spacing, var(--scb-button-text-large-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking, var(--tracking-03, -0.15px)))));--scb-button-design-text-large-font-weight:var(--scb-button-text-large-font-weight, var(--scb-button-text-large-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight, var(--weight-semibold, 600)))));--scb-button-design-icon-extra-small:var(--scb-buttons-icon-size-extra-small, var(--icon-size-small, 20px));--scb-button-design-icon-small:var(--scb-buttons-icon-size-small, var(--icon-size-small, 20px));--scb-button-design-icon-medium:var(--scb-buttons-icon-size-medium, var(--icon-size-small, 20px));--scb-button-design-icon-large:var(--scb-buttons-icon-size-large, var(--icon-size-medium, 24px));--scb-button-design-padding-inline-extra-small:var(--scb-buttons-padding-inline-extra-small, var(--spacing-4, 12px));--scb-button-design-padding-inline-small:var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px));--scb-button-design-padding-inline-medium:var(--scb-buttons-padding-inline-medium, var(--spacing-5, 16px));--scb-button-design-padding-inline-large:var(--scb-buttons-padding-inline-large, var(--spacing-7, 20px));--scb-button-design-padding-block-extra-small:var(--scb-button-padding-block-extra-small, var(--spacing-2, 4px));--scb-button-design-padding-block-small:var(--scb-button-padding-block-small, 6px);--scb-button-design-padding-block-medium:var(--scb-button-padding-block-medium, 10px);--scb-button-design-padding-block-large:var(--scb-button-padding-block-large, var(--spacing-5, 16px));--scb-button-design-gap-extra-small:var(--scb-buttons-gap-extra-small, var(--spacing-2, 4px));--scb-button-design-gap-small:var(--scb-buttons-gap-small, var(--spacing-2, 4px));--scb-button-design-gap-medium:var(--scb-buttons-gap-medium, var(--spacing-3, 8px));--scb-button-design-gap-large:var(--scb-buttons-gap-large, var(--spacing-3, 8px));--scb-button-design-surface-radius-extra-small:var(--scb-buttons-shape-radius-extra-small, var(--radius-full, 1000px));--scb-button-design-surface-radius-small:var(--scb-buttons-shape-radius-small, var(--radius-full, 1000px));--scb-button-design-surface-radius-medium:var(--scb-buttons-shape-radius-medium, var(--radius-full, 1000px));--scb-button-design-surface-radius-large:var(--scb-buttons-shape-radius-large, var(--radius-full, 1000px))}`}render(){const e=!!this.icon?.trim(),t=e?b`<span class="native-icon" part="icon" aria-hidden="true">${this.icon}</span>`:l,i=this.label.trim()===""&&!this.__hasDefaultSlotContent?this.icon:void 0,o=b`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js"])))=>i.map(i=>d[i]);
2
+ import{g as l,h as S,m as A,p as n,v as b,y as C}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as z}from"../../vendor/preload-helper.js";import{t as N}from"../../vendor/component-defaults.js";import{t as s}from"../../vendor/decorate.js";import{t as x}from"../../vendor/assertClassBrand.js";import{t as T}from"../../vendor/classPrivateMethodInitSpec.js";import{t as _}from"../../vendor/aria-references.internal.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,o){try{customElements.get(t)||e(t,i,o)}catch(d){var r=String(d||"");if(r.indexOf("already been used")===-1&&r.indexOf("NotSupportedError")===-1)throw d}}}}catch{}})();var g,v,y;function P(){return v??(v=z(()=>import("../../vendor/lazy-focus-ring.js").then(c=>c.i),__vite__mapDeps([0,1,2]),import.meta.url)),v}function k(){return y??(y=z(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),y}var a=(g=new WeakSet,class extends S{constructor(...e){super(...e),T(this,g),this.variant="filled",this.size=N["scb-button"].size,this.type="button",this.name="",this.value="",this.formId=null,this.formAction="",this.formEnctype="",this.formMethod="",this.formNoValidate=!1,this.formTarget="",this.label="Button",this.trailingIcon=!1,this.icon="",this.iconFilled=!1,this.disabled=!1,this.fullWidth=!1,this.href="",this.target="",this.rel="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__hasDefaultSlotContent=!1,this.__nativeFocusRingReady=!1,this.__nativeRippleReady=!1,this.__nativeRipplePendingClick=!1,this.__ensureNativeFocusRing=()=>{this.__nativeFocusRingReady||P().then(({ensureFocusRingReady:t})=>(t(),customElements.whenDefined("md-focus-ring"))).then(()=>{this.__nativeFocusRingReady=!0,this.toggleAttribute("data-native-focus-ring-ready",!0),this.requestUpdate(),this.updateComplete.then(()=>this.__syncNativeFocusRingControl())})},this.__onNativeFocusIn=t=>{const i=t.composedPath()[0];i instanceof HTMLElement&&i.matches(":focus-visible")&&this.__ensureNativeFocusRing()},this.__ensureNativeRipple=t=>{this.__nativeRippleReady||this.disabled||(t&&(this.__nativeRipplePendingPointerEvent=t),k().then(({ensureRippleReady:i})=>i()).then(()=>{this.disabled||(this.__nativeRippleReady=!0,this.requestUpdate(),this.updateComplete.then(()=>{this.__syncNativeFocusRingControl(),this.__replayNativeRippleState()}))}))},this.__onNativePointerWarmup=t=>{this.__ensureNativeRipple(t)},this.__onNativeClick=t=>{if(this.disabled){t.preventDefault(),t.stopPropagation();return}(!this.__nativeRippleReady||this.__nativeRipplePendingPointerEvent)&&(this.__nativeRipplePendingClick=!0,this.__ensureNativeRipple()),!this.href&&queueMicrotask(()=>{if(t.defaultPrevented||this.disabled||this.href)return;const i=this.__getAssociatedForm();if(!i)return;const o=this.__normalizedButtonType();o==="submit"&&this.__requestFormSubmit(i),o==="reset"&&i.reset()})}}__getNativeControl(){return this.renderRoot.querySelector(".native-button")}__handleDefaultSlotChange(e){const t=e.target.assignedNodes({flatten:!0}).some(i=>i.nodeType===Node.TEXT_NODE?!!i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE);this.__hasDefaultSlotContent!==t&&(this.__hasDefaultSlotContent=t,this.requestUpdate()),this.updateComplete.then(()=>this.__syncAriaToInner())}__syncAriaToInner(){const e=this.__getNativeControl();e&&this.__syncAriaToControl(e)}__syncAriaToControl(e){const t=(this.getAttribute("aria-label")||"").trim(),i=this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"",o=t||i;o?e.setAttribute("aria-label",o):e.removeAttribute("aria-label"),_(this,e);const r=this.getAttribute("aria-haspopup");r!==null?e.setAttribute("aria-haspopup",r):e.removeAttribute("aria-haspopup");const d=this.getAttribute("aria-expanded");d!==null?e.setAttribute("aria-expanded",d):e.removeAttribute("aria-expanded"),this.__ariaObserver?.disconnect(),this.__ariaObserver=new MutationObserver(R=>{const p=this.__getNativeControl();if(p)for(const m of R){if(m.type!=="attributes"||!m.attributeName)continue;const u=m.attributeName,h=this.getAttribute(u);if(u==="aria-label"){const f=(h||(this.label.trim()===""&&!this.__hasDefaultSlotContent?(this.icon||"").trim():"")).trim();f?p.setAttribute("aria-label",f):p.removeAttribute("aria-label")}else u==="aria-controls"||u==="aria-describedby"?_(this,p):(u==="aria-expanded"||u==="aria-haspopup")&&(h===null?p.removeAttribute(u):p.setAttribute(u,h))}}),this.__ariaObserver.observe(this,{attributes:!0,attributeFilter:["aria-label","aria-controls","aria-describedby","aria-expanded","aria-haspopup"]})}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this.__syncAriaToInner()}focus(e){const t=this.__getNativeControl();if(t){t.focus(e);return}this.updateComplete.then(()=>this.__getNativeControl()?.focus(e))}blur(){this.__getNativeControl()?.blur()}firstUpdated(){x(g,this,w).call(this)}updated(e){(e.has("variant")||e.has("label")||e.has("icon")||e.has("href"))&&this.updateComplete.then(()=>this.__syncAriaToInner()),(this.__nativeFocusRingReady||this.__nativeRippleReady)&&this.updateComplete.then(()=>this.__syncNativeFocusRingControl()),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&x(g,this,w).call(this)}disconnectedCallback(){this.__ariaObserver?.disconnect(),super.disconnectedCallback()}__normalizedButtonType(){return this.type==="submit"||this.type==="reset"?this.type:"button"}__getAssociatedForm(){if(this.formId!==null||this.hasAttribute("form")){const e=(this.formId??this.getAttribute("form")??"").trim();if(!e)return null;const t=this.getRootNode(),i=t instanceof Document||t instanceof ShadowRoot?t.getElementById(e):null;return i instanceof HTMLFormElement?i:null}return this.closest("form")}get form(){return this.__getAssociatedForm()}__requestFormSubmit(e){const t=this.ownerDocument.createElement("button");t.type="submit",t.hidden=!0,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),t.setAttribute("data-scb-button-submitter","");const i=[["name",this.name,this.hasAttribute("name")],["value",this.value,this.hasAttribute("value")],["formaction",this.formAction,this.hasAttribute("formaction")],["formenctype",this.formEnctype,this.hasAttribute("formenctype")],["formmethod",this.formMethod,this.hasAttribute("formmethod")],["formtarget",this.formTarget,this.hasAttribute("formtarget")]];for(const[o,r,d]of i)(d||r!=="")&&t.setAttribute(o,r);this.formNoValidate&&t.setAttribute("formnovalidate",""),e.append(t);try{e.requestSubmit(t)}finally{t.remove()}}__syncNativeFocusRingControl(){const e=this.renderRoot.querySelector("md-focus-ring"),t=this.__getNativeControl();e&&t&&(e.control=t,e.visible=t.matches(":focus-visible"));const i=this.renderRoot.querySelector("md-ripple");i&&t&&(i.control=t)}async __replayNativeRippleState(){const e=this.renderRoot.querySelector("md-ripple"),t=this.__getNativeControl(),i=this.__nativeRipplePendingPointerEvent,o=this.__nativeRipplePendingClick;this.__nativeRipplePendingPointerEvent=void 0,this.__nativeRipplePendingClick=!1;const{syncRippleToControl:r}=await k();await r(e,t,i,o)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}static get styles(){return C`:host{display:inline-flex;block-size:var(--scb-button-block-size, auto);margin-block-start:var(--scb-button-spacing-block-start, 0);margin-block-end:var(--scb-button-spacing-block-end, 0);margin-inline-start:var(--scb-button-spacing-inline-start, 0);margin-inline-end:var(--scb-button-spacing-inline-end, 0);--scb-button-font-variation-settings:'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;--scb-button-container-height:var(--scb-button-design-height-medium);--scb-button-padding-block:var(--scb-button-design-padding-block-medium);--scb-button-padding-inline:var(--scb-button-design-padding-inline-medium);--scb-button-icon-edge-space:var(--scb-button-design-padding-inline-medium);--scb-button-icon-gap:var(--scb-button-design-gap-medium);--scb-button-icon-size:var(--scb-button-design-icon-medium);--scb-button-shape-radius:var(--scb-button-design-surface-radius-medium);--scb-button-label-text-font:var(--scb-button-design-text-medium-font);--scb-button-label-text-size:var(--scb-button-design-text-medium-size);--scb-button-label-text-weight:var(--scb-button-design-text-medium-weight);--scb-button-label-text-line-height:var(--scb-button-design-text-medium-line-height);--scb-button-label-text-tracking:var(--scb-button-design-text-medium-tracking)}:host([size='extra-small']){--scb-button-container-height:var(--scb-button-design-height-extra-small);--scb-button-padding-block:var(--scb-button-design-padding-block-extra-small);--scb-button-padding-inline:var(--scb-button-design-padding-inline-extra-small);--scb-button-icon-edge-space:var(--scb-button-design-padding-inline-extra-small);--scb-button-icon-gap:var(--scb-button-design-gap-extra-small);--scb-button-icon-size:var(--scb-button-design-icon-extra-small);--scb-button-shape-radius:var(--scb-button-design-surface-radius-extra-small);--scb-button-label-text-font:var(--scb-button-design-text-extra-small-font);--scb-button-label-text-size:var(--scb-button-design-text-extra-small-size);--scb-button-label-text-weight:var(--scb-button-design-text-extra-small-weight);--scb-button-label-text-line-height:var(--scb-button-design-text-extra-small-line-height);--scb-button-label-text-tracking:var(--scb-button-design-text-extra-small-tracking)}:host([size='small']){--scb-button-container-height:var(--scb-button-design-height-small);--scb-button-padding-block:var(--scb-button-design-padding-block-small);--scb-button-padding-inline:var(--scb-button-design-padding-inline-small);--scb-button-icon-edge-space:var(--scb-button-design-padding-inline-small);--scb-button-icon-gap:var(--scb-button-design-gap-small);--scb-button-icon-size:var(--scb-button-design-icon-small);--scb-button-shape-radius:var(--scb-button-design-surface-radius-small);--scb-button-label-text-font:var(--scb-button-design-text-small-font);--scb-button-label-text-size:var(--scb-button-design-text-small-size);--scb-button-label-text-weight:var(--scb-button-design-text-small-weight);--scb-button-label-text-line-height:var(--scb-button-design-text-small-line-height);--scb-button-label-text-tracking:var(--scb-button-design-text-small-tracking)}:host([size='large']){--scb-button-container-height:var(--scb-button-design-height-large);--scb-button-padding-block:var(--scb-button-design-padding-block-large);--scb-button-padding-inline:var(--scb-button-design-padding-inline-large);--scb-button-icon-edge-space:var(--scb-button-design-padding-inline-large);--scb-button-icon-gap:var(--scb-button-design-gap-large);--scb-button-icon-size:var(--scb-button-design-icon-large);--scb-button-shape-radius:var(--scb-button-design-surface-radius-large);--scb-button-label-text-font:var(--scb-button-design-text-large-font);--scb-button-label-text-size:var(--scb-button-design-text-large-size);--scb-button-label-text-weight:var(--scb-button-design-text-large-weight);--scb-button-label-text-line-height:var(--scb-button-design-text-large-line-height);--scb-button-label-text-tracking:var(--scb-button-design-text-large-tracking)}:host([icon-filled]){--scb-button-font-variation-settings:'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24}.native-button,.native-button-wrap{position:relative;display:inline-flex}.native-button-wrap{border-radius:var(--scb-button-shape-radius, var(--md-sys-shape-corner-full, 999px))}.native-button{z-index:0;box-sizing:border-box;align-items:center;justify-content:center;gap:var(--scb-button-icon-gap);min-block-size:var(--scb-button-block-size, var(--scb-button-container-height));block-size:var(--scb-button-block-size, var(--scb-button-container-height));min-inline-size:64px;inline-size:auto;padding-block:var(--scb-button-padding-block);padding-inline:var(--scb-button-padding-inline);overflow:hidden;border:0;border-radius:inherit;background:0 0;color:var(--scb-button-low-emphasis-content-color, var(--md-sys-color-primary));font-family:var(--scb-button-label-text-font);font-size:var(--scb-button-label-text-size);font-weight:var(--scb-button-label-text-weight);line-height:var(--scb-button-label-text-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height)));letter-spacing:var(--scb-button-label-text-tracking, normal);text-align:center;text-decoration:none;white-space:nowrap;cursor:pointer;appearance:none;-webkit-appearance:none;touch-action:manipulation}::slotted(*){display:inline!important;margin:0!important;color:inherit!important;font:inherit!important;letter-spacing:inherit!important;line-height:inherit!important}.native-button::before{content:"";position:absolute;inset:0;z-index:-1;background:currentColor;opacity:0;pointer-events:none;transition:opacity var(--motion-duration-short, 150ms) var(--motion-easing-standard, ease)}.native-button:hover::before{opacity:var(--md-sys-state-hover-state-layer-opacity, 0.08)}.native-button:active::before{opacity:var(--md-sys-state-pressed-state-layer-opacity, 0.12)}.native-button:focus{outline:0}:host(:not([data-native-focus-ring-ready])) .native-button:focus-visible{outline:var(--stroke-border-m, 2px) solid var(--md-focus-ring-color, var(--md-sys-color-primary));outline-offset:var(--spacing-1, 2px)}.native-button:disabled,.native-button[aria-disabled=true]{color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));cursor:default;opacity:1;pointer-events:none}:host(:not([variant])) .native-button,:host([variant='filled']) .native-button{border-color:transparent;background:var(--scb-button-filled-container-color, var(--md-sys-color-primary));color:var(--scb-button-filled-content-color, var(--md-sys-color-on-primary))}:host([variant='outlined']) .native-button{background:0 0;color:var(--scb-button-low-emphasis-content-color, var(--md-sys-color-primary));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--scb-button-outline-color, var(--md-sys-color-outline))}:host([variant='outlined']) .native-button:disabled,:host([variant='outlined']) .native-button[aria-disabled=true]{color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content));box-shadow:inset 0 0 0 var(--stroke-border, 1px) var(--scb-color-compat-disabled-container)}:host([variant='filled-tonal']) .native-button{border-color:transparent;background:var(--scb-button-tonal-container-color, var(--md-sys-color-secondary-container));color:var(--scb-button-tonal-content-color, var(--md-sys-color-on-secondary-container))}:host(:not([variant])) .native-button:disabled,:host(:not([variant])) .native-button[aria-disabled=true],:host([variant='filled']) .native-button:disabled,:host([variant='filled']) .native-button[aria-disabled=true],:host([variant='filled-tonal']) .native-button:disabled,:host([variant='filled-tonal']) .native-button[aria-disabled=true]{background:var(--scb-button-disabled-container-color, var(--scb-color-compat-disabled-container));color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content))}:host([variant='text']) .native-button{min-inline-size:0;background:0 0;color:var(--scb-button-low-emphasis-content-color, var(--md-sys-color-primary))}:host([variant='text']) .native-button:disabled,:host([variant='text']) .native-button[aria-disabled=true]{color:var(--scb-button-disabled-content-color, var(--scb-color-compat-disabled-content))}.native-icon{flex:0 0 auto;display:inline-block;inline-size:var(--scb-button-icon-size);block-size:var(--scb-button-icon-size);overflow:hidden;font-family:"Material Symbols Outlined";font-size:var(--scb-button-icon-size);line-height:1;text-align:center;white-space:nowrap;text-transform:none;word-wrap:normal;direction:ltr;font-feature-settings:"liga"1;font-variation-settings:var(--scb-button-font-variation-settings);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.native-icon.scb-svg-icon{fill:currentColor;font:inherit}.native-button-wrap md-ripple{position:absolute;inset:0;border-radius:inherit;pointer-events:none}.native-button-wrap md-focus-ring{pointer-events:none}:host([full-width]){display:flex;inline-size:100%}:host([full-width]) .native-button,:host([full-width]) .native-button-wrap{inline-size:100%;flex:1 1 auto}:host{--scb-button-design-height-extra-small:var(--scb-buttons-control-size-extra-small, var(--scale-07, 28px));--scb-button-design-height-small:var(--scb-buttons-control-size-small, var(--scb-control-size-small, var(--scale-08, 32px)));--scb-button-design-height-medium:var(--scb-buttons-control-size-medium, var(--scb-control-size-medium, var(--scale-10, 40px)));--scb-button-design-height-large:var(--scb-buttons-control-size-large, var(--scb-control-size-large, var(--scale-12, 56px)));--scb-button-design-text-extra-small-font:var(--scb-button-text-extra-small-font, var(--scb-typography-label-small-font, var(--md-sys-typescale-label-small-font, var(--brand))));--scb-button-design-text-extra-small-size:var(--scb-button-text-extra-small-size, var(--scb-typography-label-small-size, var(--md-sys-typescale-label-small-size, 14px)));--scb-button-design-text-extra-small-line-height:var(--scb-button-text-extra-small-line-height, var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px)));--scb-button-design-text-extra-small-tracking:var(--scb-button-text-extra-small-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px))));--scb-button-design-text-extra-small-weight:var(--scb-button-text-extra-small-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600))));--scb-button-design-text-extra-small-letter-spacing:var(--scb-button-text-extra-small-letter-spacing, var(--scb-button-text-extra-small-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px)))));--scb-button-design-text-extra-small-font-weight:var(--scb-button-text-extra-small-font-weight, var(--scb-button-text-extra-small-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600)))));--scb-button-design-text-small-font:var(--scb-button-text-small-font, var(--scb-typography-label-small-font, var(--md-sys-typescale-label-small-font, var(--brand))));--scb-button-design-text-small-size:var(--scb-button-text-small-size, var(--scb-typography-label-small-size, var(--md-sys-typescale-label-small-size, 14px)));--scb-button-design-text-small-line-height:var(--scb-button-text-small-line-height, var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px)));--scb-button-design-text-small-tracking:var(--scb-button-text-small-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px))));--scb-button-design-text-small-weight:var(--scb-button-text-small-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600))));--scb-button-design-text-small-letter-spacing:var(--scb-button-text-small-letter-spacing, var(--scb-button-text-small-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px)))));--scb-button-design-text-small-font-weight:var(--scb-button-text-small-font-weight, var(--scb-button-text-small-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600)))));--scb-button-design-text-medium-font:var(--scb-button-text-medium-font, var(--scb-typography-label-small-font, var(--md-sys-typescale-label-small-font, var(--brand))));--scb-button-design-text-medium-size:var(--scb-button-text-medium-size, var(--scb-typography-label-small-size, var(--md-sys-typescale-label-small-size, 14px)));--scb-button-design-text-medium-line-height:var(--scb-button-text-medium-line-height, var(--scb-typography-label-small-line-height, var(--md-sys-typescale-label-small-line-height, 20px)));--scb-button-design-text-medium-tracking:var(--scb-button-text-medium-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px))));--scb-button-design-text-medium-weight:var(--scb-button-text-medium-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600))));--scb-button-design-text-medium-letter-spacing:var(--scb-button-text-medium-letter-spacing, var(--scb-button-text-medium-tracking, var(--scb-typography-label-small-tracking, var(--md-sys-typescale-label-small-tracking, var(--tracking-02, -0.1px)))));--scb-button-design-text-medium-font-weight:var(--scb-button-text-medium-font-weight, var(--scb-button-text-medium-weight, var(--scb-typography-label-small-weight, var(--md-sys-typescale-label-small-weight, var(--weight-semibold, 600)))));--scb-button-design-text-large-font:var(--scb-button-text-large-font, var(--scb-typography-label-medium-font, var(--md-sys-typescale-label-medium-font, var(--brand))));--scb-button-design-text-large-size:var(--scb-button-text-large-size, var(--scb-typography-label-medium-size, var(--md-sys-typescale-label-medium-size, 16px)));--scb-button-design-text-large-line-height:var(--scb-button-text-large-line-height, var(--scb-typography-label-medium-line-height, var(--md-sys-typescale-label-medium-line-height, 24px)));--scb-button-design-text-large-tracking:var(--scb-button-text-large-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking, var(--tracking-03, -0.15px))));--scb-button-design-text-large-weight:var(--scb-button-text-large-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight, var(--weight-semibold, 600))));--scb-button-design-text-large-letter-spacing:var(--scb-button-text-large-letter-spacing, var(--scb-button-text-large-tracking, var(--scb-typography-label-medium-tracking, var(--md-sys-typescale-label-medium-tracking, var(--tracking-03, -0.15px)))));--scb-button-design-text-large-font-weight:var(--scb-button-text-large-font-weight, var(--scb-button-text-large-weight, var(--scb-typography-label-medium-weight, var(--md-sys-typescale-label-medium-weight, var(--weight-semibold, 600)))));--scb-button-design-icon-extra-small:var(--scb-buttons-icon-size-extra-small, var(--icon-size-small, 20px));--scb-button-design-icon-small:var(--scb-buttons-icon-size-small, var(--icon-size-small, 20px));--scb-button-design-icon-medium:var(--scb-buttons-icon-size-medium, var(--icon-size-small, 20px));--scb-button-design-icon-large:var(--scb-buttons-icon-size-large, var(--icon-size-medium, 24px));--scb-button-design-padding-inline-extra-small:var(--scb-buttons-padding-inline-extra-small, var(--spacing-4, 12px));--scb-button-design-padding-inline-small:var(--scb-buttons-padding-inline-small, var(--spacing-4, 12px));--scb-button-design-padding-inline-medium:var(--scb-buttons-padding-inline-medium, var(--spacing-5, 16px));--scb-button-design-padding-inline-large:var(--scb-buttons-padding-inline-large, var(--spacing-7, 20px));--scb-button-design-padding-block-extra-small:var(--scb-button-padding-block-extra-small, var(--spacing-2, 4px));--scb-button-design-padding-block-small:var(--scb-button-padding-block-small, 6px);--scb-button-design-padding-block-medium:var(--scb-button-padding-block-medium, 10px);--scb-button-design-padding-block-large:var(--scb-button-padding-block-large, var(--spacing-5, 16px));--scb-button-design-gap-extra-small:var(--scb-buttons-gap-extra-small, var(--spacing-2, 4px));--scb-button-design-gap-small:var(--scb-buttons-gap-small, var(--spacing-2, 4px));--scb-button-design-gap-medium:var(--scb-buttons-gap-medium, var(--spacing-3, 8px));--scb-button-design-gap-large:var(--scb-buttons-gap-large, var(--spacing-3, 8px));--scb-button-design-surface-radius-extra-small:var(--scb-buttons-shape-radius-extra-small, var(--radius-full, 1000px));--scb-button-design-surface-radius-small:var(--scb-buttons-shape-radius-small, var(--radius-full, 1000px));--scb-button-design-surface-radius-medium:var(--scb-buttons-shape-radius-medium, var(--radius-full, 1000px));--scb-button-design-surface-radius-large:var(--scb-buttons-shape-radius-large, var(--radius-full, 1000px))}`}render(){const e=!!this.icon?.trim(),t=e?b`<span class="native-icon" part="icon" aria-hidden="true">${this.icon}</span>`:l,i=this.label.trim()===""&&!this.__hasDefaultSlotContent?this.icon:void 0,o=b`
3
3
  <slot
4
4
  @slotchange=${this.__handleDefaultSlotChange}
5
5
  style=${this.__hasDefaultSlotContent?l:"display: none"}
@@ -46,4 +46,4 @@ import{g as l,h as S,m as A,p as n,v as b,y as C}from"../../vendor/vendor.js";im
46
46
  ${this.__nativeRippleReady?b`<md-ripple aria-hidden="true"></md-ripple>`:l}
47
47
  ${this.__nativeFocusRingReady?b`<md-focus-ring aria-hidden="true"></md-focus-ring>`:l}
48
48
  </span>
49
- `}});function w(){const d=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??d,t=this.mapSpacingToken(this.spacingBottom)??d,i=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-button-spacing-block-start",e):this.style.removeProperty("--scb-button-spacing-block-start"),t?this.style.setProperty("--scb-button-spacing-block-end",t):this.style.removeProperty("--scb-button-spacing-block-end"),i?this.style.setProperty("--scb-button-spacing-inline-start",i):this.style.removeProperty("--scb-button-spacing-inline-start"),o?this.style.setProperty("--scb-button-spacing-inline-end",o):this.style.removeProperty("--scb-button-spacing-inline-end")}s([n({type:String,reflect:!0})],a.prototype,"variant",void 0);s([n({type:String,reflect:!0})],a.prototype,"size",void 0);s([n({type:String,reflect:!0})],a.prototype,"type",void 0);s([n({type:String})],a.prototype,"name",void 0);s([n({type:String})],a.prototype,"value",void 0);s([n({type:String,attribute:"form"})],a.prototype,"formId",void 0);s([n({type:String,attribute:"formaction"})],a.prototype,"formAction",void 0);s([n({type:String,attribute:"formenctype"})],a.prototype,"formEnctype",void 0);s([n({type:String,attribute:"formmethod"})],a.prototype,"formMethod",void 0);s([n({type:Boolean,attribute:"formnovalidate"})],a.prototype,"formNoValidate",void 0);s([n({type:String,attribute:"formtarget"})],a.prototype,"formTarget",void 0);s([n({type:String})],a.prototype,"label",void 0);s([n({type:Boolean,attribute:"trailing-icon"})],a.prototype,"trailingIcon",void 0);s([n({type:String})],a.prototype,"icon",void 0);s([n({type:Boolean,attribute:"icon-filled",reflect:!0})],a.prototype,"iconFilled",void 0);s([n({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0);s([n({type:Boolean,attribute:"full-width",reflect:!0})],a.prototype,"fullWidth",void 0);s([n({type:String})],a.prototype,"href",void 0);s([n({type:String})],a.prototype,"target",void 0);s([n({type:String})],a.prototype,"rel",void 0);s([n({type:String,reflect:!0})],a.prototype,"spacing",void 0);s([n({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);s([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);s([n({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);s([n({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);a=s([A("scb-button")],a);export{a as ScbButton};
49
+ `}});function w(){const c=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??c,t=this.mapSpacingToken(this.spacingBottom)??c,i=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-button-spacing-block-start",e):this.style.removeProperty("--scb-button-spacing-block-start"),t?this.style.setProperty("--scb-button-spacing-block-end",t):this.style.removeProperty("--scb-button-spacing-block-end"),i?this.style.setProperty("--scb-button-spacing-inline-start",i):this.style.removeProperty("--scb-button-spacing-inline-start"),o?this.style.setProperty("--scb-button-spacing-inline-end",o):this.style.removeProperty("--scb-button-spacing-inline-end")}s([n({type:String,reflect:!0})],a.prototype,"variant",void 0);s([n({type:String,reflect:!0})],a.prototype,"size",void 0);s([n({type:String,reflect:!0})],a.prototype,"type",void 0);s([n({type:String})],a.prototype,"name",void 0);s([n({type:String})],a.prototype,"value",void 0);s([n({type:String,attribute:"form"})],a.prototype,"formId",void 0);s([n({type:String,attribute:"formaction"})],a.prototype,"formAction",void 0);s([n({type:String,attribute:"formenctype"})],a.prototype,"formEnctype",void 0);s([n({type:String,attribute:"formmethod"})],a.prototype,"formMethod",void 0);s([n({type:Boolean,attribute:"formnovalidate"})],a.prototype,"formNoValidate",void 0);s([n({type:String,attribute:"formtarget"})],a.prototype,"formTarget",void 0);s([n({type:String})],a.prototype,"label",void 0);s([n({type:Boolean,attribute:"trailing-icon"})],a.prototype,"trailingIcon",void 0);s([n({type:String})],a.prototype,"icon",void 0);s([n({type:Boolean,attribute:"icon-filled",reflect:!0})],a.prototype,"iconFilled",void 0);s([n({type:Boolean,reflect:!0})],a.prototype,"disabled",void 0);s([n({type:Boolean,attribute:"full-width",reflect:!0})],a.prototype,"fullWidth",void 0);s([n({type:String})],a.prototype,"href",void 0);s([n({type:String})],a.prototype,"target",void 0);s([n({type:String})],a.prototype,"rel",void 0);s([n({type:String,reflect:!0})],a.prototype,"spacing",void 0);s([n({type:String,attribute:"spacing-top",reflect:!0})],a.prototype,"spacingTop",void 0);s([n({type:String,attribute:"spacing-bottom",reflect:!0})],a.prototype,"spacingBottom",void 0);s([n({type:String,attribute:"spacing-left",reflect:!0})],a.prototype,"spacingLeft",void 0);s([n({type:String,attribute:"spacing-right",reflect:!0})],a.prototype,"spacingRight",void 0);a=s([A("scb-button")],a);export{a as ScbButton};
@@ -1,4 +1,4 @@
1
- import{g as J,h as X,m as Z,p as _,v as k,y as V}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{addLazyFocusRingListeners as ee}from"../shared/lazy-focus-ring.js";import{componentSizeToken as I}from"../shared/component-size-token.js";import{t as f}from"../../vendor/decorate.js";import{t as W}from"../../vendor/assertClassBrand.js";import{t as te}from"../../vendor/classPrivateMethodInitSpec.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";(function(){try{var E=typeof globalThis<"u"?globalThis:window;if(!E.__scb_ce_guard_installed__){E.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,a,s){try{customElements.get(t)||e(t,a,s)}catch(r){var n=String(r||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var z,O,P={fromAttribute(E){if(E===null)return!1;const e=E.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="no"}},y=(z=new WeakSet,O=class extends X{constructor(...e){super(...e),te(this,z),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=t=>{const a=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day[data-date]")??[]),s=this.shadowRoot?.activeElement,n=s&&a.includes(s)?s:document.activeElement,r=a.indexOf(n);if(r===-1)return;let l;switch(t.key){case"ArrowRight":l=a[r+1];break;case"ArrowLeft":l=a[r-1];break;case"ArrowDown":l=this.__dayOffsetFrom(n,7);break;case"ArrowUp":l=this.__dayOffsetFrom(n,-7);break;case"Home":l=Array.from(n.closest('[role="row"]')?.querySelectorAll(".calendar-day[data-date]")??[])[0];break;case"End":{const d=Array.from(n.closest('[role="row"]')?.querySelectorAll(".calendar-day[data-date]")??[]);l=d[d.length-1];break}case"PageUp":t.preventDefault(),this.__focusAdjacentMonth(n,-1);return;case"PageDown":t.preventDefault(),this.__focusAdjacentMonth(n,1);return;default:return}l&&l!==n&&(t.preventDefault(),this.__focusCalendarDay(l))},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._rovingDate="",this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(e){const t=(e??"")+"";t!==this.selectedDate&&(this.selectedDate=t)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e==="value"&&(this.value=a??"")}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=ee(this,this.renderRoot),W(z,this,H).call(this);const e=Number(this.displayYear),t=Number(this.displayMonth);!Number.isNaN(e)&&!Number.isNaN(t)&&t>=1&&t<=12&&(this._current=new Date(e,t-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),this._removeLazyFocusRingListeners?.(),this._removeLazyFocusRingListeners=void 0,super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}updated(e){if(super.updated?.(e),e.has("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&W(z,this,H).call(this),!this._syncingDisplay&&(e.has("displayYear")||e.has("displayMonth"))){const t=Number(this.displayYear),a=Number(this.displayMonth);if(!Number.isNaN(t)&&!Number.isNaN(a)&&a>=1&&a<=12){const s=this._current.getFullYear(),n=this._current.getMonth()+1;(s!==t||n!==a)&&(this._current=new Date(t,a-1,1),this._dispatchMonthChange(t,a),this.requestUpdate())}}}_ensureEventsFromJson(){const e=(this.eventsJson??"").trim();if(!e){this._eventsFromJson=null,this._eventsJsonLast=e;return}if(!(this._eventsJsonLast===e&&this._eventsFromJson!==null)){this._eventsJsonLast=e;try{const t=JSON.parse(e);Array.isArray(t)?this._eventsFromJson=t:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(e){const t=e.title??"",a=e.description??"",s=e.href??"",n=e.startDate??e["start-date"]??e.start??e.date??"",r=e.endDate??e["end-date"]??e.end??"";return{title:t+"",description:a?a+"":void 0,href:s?s+"":void 0,start:n?n+"":void 0,end:r?r+"":void 0}}_toLocalEventDate(e,t){const a=(e??"").trim();if(!a)return null;if(!a.includes("T")){const n=a.split("-").map(o=>Number(o));if(n.length!==3||n.some(o=>Number.isNaN(o)))return null;const[r,l,d]=n;return t?new Date(r,l-1,d,23,59,59,999):new Date(r,l-1,d,0,0,0,0)}const s=new Date(a);return Number.isNaN(s.getTime())?null:s}_toDateKey(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(e){const t=new Map;for(const a of e){const s=this._normalizeEventInput(a),n=s.start||"",r=s.end||"";if(!(!n||!s.title))if(n&&r){const l=this._toLocalEventDate(n,!1),d=this._toLocalEventDate(r,!0);if(!l||!d)continue;if(d<l){const o=n.split("T")[0],m=t.get(o)||[];m.push({title:s.title,description:s.description,href:s.href,start:n,end:r}),t.set(o,m);continue}for(let o=new Date(l);o<=d;o.setDate(o.getDate()+1)){const m=this._toDateKey(o),T=t.get(m)||[];T.push({title:s.title,description:s.description,href:s.href,start:n,end:r}),t.set(m,T)}}else{const l=n.split("T")[0],d=t.get(l)||[];d.push({title:s.title,description:s.description,href:s.href,start:n}),t.set(l,d)}}return t}_buildEventMapFromChildren(){const e=Array.from(this.querySelectorAll("scb-calendar-event")),t=new Map;for(const a of e){const s=a,n=(s.startDate??s.date??"")+""||a.getAttribute("start-date")||a.getAttribute("date")||"",r=(s.endDate??"")+""||a.getAttribute("end-date")||"";if(n&&r){const l=this._toLocalEventDate(n,!1),d=this._toLocalEventDate(r,!0);if(!l||!d)continue;if(d<l){const o=n.split("T")[0],m=t.get(o)||[];m.push({title:a.title??"",description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n,end:r}),t.set(o,m);continue}for(let o=new Date(l);o<=d;o.setDate(o.getDate()+1)){const m=this._toDateKey(o),T=t.get(m)||[];T.push({title:a.title??"",description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n,end:r}),t.set(m,T)}}else if(n&&a.title){const l=n.split("T")[0],d=t.get(l)||[];d.push({title:a.title,description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n}),t.set(l,d)}}return t}_syncDisplayFromCurrent(e=!0){const t=this._current.getFullYear(),a=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=t,this.displayMonth=a}finally{this._syncingDisplay=!1}e&&this._dispatchMonthChange(t,a)}_dispatchMonthChange(e,t){const a={displayYear:e,displayMonth:t};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:a})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:a}))}_dispatchSelect(e){const t={selectedDate:e};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:t})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:t}))}_formatDayLabel(e){return new Intl.DateTimeFormat(this.lang==="en"?"en-GB":"sv-SE",{day:"numeric",month:"long",year:"numeric"}).format(e)}_formatDayAriaLabel(e,t,a){const s=a.map(r=>`${r.prefix||""}${r.title}`.trim()).filter(Boolean),n=[this._formatDayLabel(e)];return t&&n.push(t),s.length===1?n.push(this.lang==="en"?`1 event: ${s[0]}`:`1 händelse: ${s[0]}`):s.length>1&&n.push(this.lang==="en"?`${s.length} events: ${s.join(", ")}`:`${s.length} händelser: ${s.join(", ")}`),n.join(". ")}__dayOffsetFrom(e,t){const a=e.dataset.date;if(!a)return;const s=new Date(`${a}T12:00:00`);s.setDate(s.getDate()+t);const n=this.__formatDateKey(s);return this.shadowRoot?.querySelector(`.calendar-day[data-date="${n}"]`)??void 0}__formatDateKey(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}__focusCalendarDay(e){this.shadowRoot?.querySelectorAll(".calendar-day[data-date]").forEach(t=>{t.tabIndex=t===e?0:-1}),this._rovingDate=e.dataset.date??"",e.focus()}__focusAdjacentMonth(e,t){const a=e.dataset.date;if(!a)return;const s=new Date(`${a}T12:00:00`),n=new Date(s.getFullYear(),s.getMonth()+t,1),r=Math.min(s.getDate(),this._daysInMonth(n.getFullYear(),n.getMonth())),l=new Date(n.getFullYear(),n.getMonth(),r);this._current=new Date(l.getFullYear(),l.getMonth(),1),this.selectedDate="",this._popupEvent=null,this._rovingDate=this.__formatDateKey(l),this._syncDisplayFromCurrent(),this.requestUpdate(),this.updateComplete.then(()=>{const d=this.shadowRoot?.querySelector(`.calendar-day[data-date="${this._rovingDate}"]`);d&&this.__focusCalendarDay(d)})}_daysInMonth(e,t){return new Date(e,t+1,0).getDate()}_firstDayOfWeek(e,t){const a=new Date(e,t,1).getDay();return a===0?6:a-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(e){this._popupEvent=e,this.selectedDate=e.date,this._dispatchSelect(e.date),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const t=this.shadowRoot?.querySelector("scb-dialog");t&&(document.activeElement&&(t.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.open=!0})}),t.addEventListener("close",this._handleDialogClose,{once:!0}))})}_addDays(e,t){const a=new Date(e.valueOf());return a.setDate(a.getDate()+t),a}_easterDay(e){if(typeof this._easterDateCalculated["Ar"+e]<"u")return new Date(this._easterDateCalculated["Ar"+e]);let t=e;t<100&&(t=t+1900),t<1950&&(t=t+100);const a=t%19,s=t%4,n=t%7,r=(19*a+24)%30,l=(2*s+4*n+6*r+5)%7;let d=22+r+l,o=0;d==57&&(d-=7),d==56&&r==28&&l==6&&a>10&&(d-=7),d>31?(d-=31,o=4):o=3;const m=new Date(t,o-1,d);return this._easterDateCalculated["Ar"+e]=m,new Date(this._easterDateCalculated["Ar"+e])}_swedishHolidayName(e){const t=e.getMonth();if(t===1||t===6||t===7||t===8)return null;const a=e.getMonth()+1,s=e.getDate(),n=e.getFullYear(),r=this._easterDay(n),l=this.lang==="en",d=[["Nyårsdagen","New Year's Day",a===1&&s===1],["Trettondedag jul","Epiphany",a===1&&s===6],["Långfredag","Good Friday",+e==+this._addDays(r,-2)],["Påskdagen","Easter Sunday",+e==+r],["Annandag påsk","Easter Monday",+e==+this._addDays(r,1)],["Kristi himmelsfärdsdag","Ascension Day",+e==+this._addDays(r,39)],["Pingstdagen","Pentecost",+e==+this._addDays(r,50)&&n<2005],["Första maj","May Day",a===5&&s===1],["Nationaldagen","National Day",a===6&&s===6&&n>=2005],["Midsommarafton","Midsummer's Eve",a===6&&s>=19&&s<=25&&e.getDay()===5],["Midsommardagen","Midsummer's Day",a===6&&s>=20&&s<=26&&e.getDay()===6],["Julafton","Christmas Eve",a===12&&s===24],["Juldagen","Christmas Day",a===12&&s===25],["Annandag jul","Boxing Day",a===12&&s===26],["Alla helgons dag","All Saints' Day",a===10&&s>=31&&e.getDay()===6||a===11&&s<=6&&e.getDay()===6]];for(const o of d){const[m,T,$]=o;if($)return l?T:m}return null}render(){const e=this._current.getFullYear(),t=this._current.getMonth(),a=this._daysInMonth(e,t),s=this._firstDayOfWeek(e,t),n=this._today,r=this.lang==="en",l=r?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let d=r?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(d=d.slice(0,5));const o=this._getEventInputs(),m=o?this._buildEventMapFromInputs(o):this._buildEventMapFromChildren(),T=`${e}-${String(t+1).padStart(2,"0")}-`,$=new Date(e,t,1);if(this.disableWeekend)for(;$.getDay()===0||$.getDay()===6;)$.setDate($.getDate()+1);const B=this.__formatDateKey(n),U=[...m.keys()].find(i=>{if(!i.startsWith(T))return!1;if(!this.disableWeekend)return!0;const h=new Date(`${i}T12:00:00`);return h.getDay()!==0&&h.getDay()!==6}),G=[this._rovingDate,this.selectedDate,B,U,this.__formatDateKey($)].find(i=>i?.startsWith(T))??this.__formatDateKey($),K=[];let L=1;for(let i=0;i<6;i++){const h=[],b=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let g=L;for(let D=0;D<b.length;D++){const w=b[D];if(i===0&&w<s){if(!this.disableWeekend||w<5){const x=t===0?11:t-1,C=t===0?e-1:e,p=this._daysInMonth(C,x)-(s-w-1),N=new Date(C,x,p);h.push(k`
1
+ import{g as J,h as X,m as Z,p as _,v as k,y as V}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as ee}from"../../vendor/lazy-focus-ring.js";import{t as I}from"../../vendor/component-size-token.js";import{t as f}from"../../vendor/decorate.js";import{t as W}from"../../vendor/assertClassBrand.js";import{t as te}from"../../vendor/classPrivateMethodInitSpec.js";import"../scb-icon-button/scb-icon-button.js";import"./scb-calendar-event.js";import"../scb-dialog/scb-dialog.js";import"../scb-list/scb-list.js";(function(){try{var E=typeof globalThis<"u"?globalThis:window;if(!E.__scb_ce_guard_installed__){E.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,a,s){try{customElements.get(t)||e(t,a,s)}catch(r){var n=String(r||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw r}}}}catch{}})();var z,O,P={fromAttribute(E){if(E===null)return!1;const e=E.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="no"}},y=(z=new WeakSet,O=class extends X{constructor(...e){super(...e),te(this,z),this._lastActiveDay=null,this.lang="sv",this.disableWeekend=!1,this.publicHolidays=!0,this.displayYear=new Date().getFullYear(),this.displayMonth=new Date().getMonth()+1,this.selectedDate="",this.eventsJson=void 0,this._eventsFromJson=null,this._eventsJsonLast=void 0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._mutationObserver=null,this._syncingDisplay=!1,this._onCalendarKeyDown=t=>{const a=Array.from(this.shadowRoot?.querySelectorAll(".calendar-day[data-date]")??[]),s=this.shadowRoot?.activeElement,n=s&&a.includes(s)?s:document.activeElement,r=a.indexOf(n);if(r===-1)return;let l;switch(t.key){case"ArrowRight":l=a[r+1];break;case"ArrowLeft":l=a[r-1];break;case"ArrowDown":l=this.__dayOffsetFrom(n,7);break;case"ArrowUp":l=this.__dayOffsetFrom(n,-7);break;case"Home":l=Array.from(n.closest('[role="row"]')?.querySelectorAll(".calendar-day[data-date]")??[])[0];break;case"End":{const d=Array.from(n.closest('[role="row"]')?.querySelectorAll(".calendar-day[data-date]")??[]);l=d[d.length-1];break}case"PageUp":t.preventDefault(),this.__focusAdjacentMonth(n,-1);return;case"PageDown":t.preventDefault(),this.__focusAdjacentMonth(n,1);return;default:return}l&&l!==n&&(t.preventDefault(),this.__focusCalendarDay(l))},this._onEventChanged=()=>{this.requestUpdate()},this._today=new Date,this._current=new Date,this._rovingDate="",this._popupEvent=null,this._handleDialogClose=()=>{this._popupEvent=null,this.requestUpdate(),this._restoreDayFocus()},this._restoreDayFocus=()=>{this._lastActiveDay&&setTimeout(()=>{this._lastActiveDay?.focus(),this._lastActiveDay=null},0)},this._easterDateCalculated={}}get value(){return this.selectedDate}set value(e){const t=(e??"")+"";t!==this.selectedDate&&(this.selectedDate=t)}static get observedAttributes(){return[...super.observedAttributes??[],"value"]}attributeChangedCallback(e,t,a){super.attributeChangedCallback(e,t,a),e==="value"&&(this.value=a??"")}connectedCallback(){super.connectedCallback(),this._removeLazyFocusRingListeners=ee(this,this.renderRoot),W(z,this,H).call(this);const e=Number(this.displayYear),t=Number(this.displayMonth);!Number.isNaN(e)&&!Number.isNaN(t)&&t>=1&&t<=12&&(this._current=new Date(e,t-1,1)),this._syncDisplayFromCurrent(!1),this.addEventListener("change",this._onEventChanged),this._mutationObserver=new MutationObserver(()=>{this.requestUpdate()}),this._mutationObserver.observe(this,{childList:!0}),this.addEventListener("keydown",this._onCalendarKeyDown)}disconnectedCallback(){this.removeEventListener("change",this._onEventChanged),this._removeLazyFocusRingListeners?.(),this._removeLazyFocusRingListeners=void 0,super.disconnectedCallback(),this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null),this.removeEventListener("keydown",this._onCalendarKeyDown)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}updated(e){if(super.updated?.(e),e.has("eventsJson")&&(this._eventsJsonLast=void 0,this._eventsFromJson=null),(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&W(z,this,H).call(this),!this._syncingDisplay&&(e.has("displayYear")||e.has("displayMonth"))){const t=Number(this.displayYear),a=Number(this.displayMonth);if(!Number.isNaN(t)&&!Number.isNaN(a)&&a>=1&&a<=12){const s=this._current.getFullYear(),n=this._current.getMonth()+1;(s!==t||n!==a)&&(this._current=new Date(t,a-1,1),this._dispatchMonthChange(t,a),this.requestUpdate())}}}_ensureEventsFromJson(){const e=(this.eventsJson??"").trim();if(!e){this._eventsFromJson=null,this._eventsJsonLast=e;return}if(!(this._eventsJsonLast===e&&this._eventsFromJson!==null)){this._eventsJsonLast=e;try{const t=JSON.parse(e);Array.isArray(t)?this._eventsFromJson=t:this._eventsFromJson=[]}catch{this._eventsFromJson=[]}}}_getEventInputs(){return Array.isArray(this.events)?this.events:(this._ensureEventsFromJson(),this._eventsFromJson!==null?this._eventsFromJson:null)}_normalizeEventInput(e){const t=e.title??"",a=e.description??"",s=e.href??"",n=e.startDate??e["start-date"]??e.start??e.date??"",r=e.endDate??e["end-date"]??e.end??"";return{title:t+"",description:a?a+"":void 0,href:s?s+"":void 0,start:n?n+"":void 0,end:r?r+"":void 0}}_toLocalEventDate(e,t){const a=(e??"").trim();if(!a)return null;if(!a.includes("T")){const n=a.split("-").map(o=>Number(o));if(n.length!==3||n.some(o=>Number.isNaN(o)))return null;const[r,l,d]=n;return t?new Date(r,l-1,d,23,59,59,999):new Date(r,l-1,d,0,0,0,0)}const s=new Date(a);return Number.isNaN(s.getTime())?null:s}_toDateKey(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}_buildEventMapFromInputs(e){const t=new Map;for(const a of e){const s=this._normalizeEventInput(a),n=s.start||"",r=s.end||"";if(!(!n||!s.title))if(n&&r){const l=this._toLocalEventDate(n,!1),d=this._toLocalEventDate(r,!0);if(!l||!d)continue;if(d<l){const o=n.split("T")[0],m=t.get(o)||[];m.push({title:s.title,description:s.description,href:s.href,start:n,end:r}),t.set(o,m);continue}for(let o=new Date(l);o<=d;o.setDate(o.getDate()+1)){const m=this._toDateKey(o),T=t.get(m)||[];T.push({title:s.title,description:s.description,href:s.href,start:n,end:r}),t.set(m,T)}}else{const l=n.split("T")[0],d=t.get(l)||[];d.push({title:s.title,description:s.description,href:s.href,start:n}),t.set(l,d)}}return t}_buildEventMapFromChildren(){const e=Array.from(this.querySelectorAll("scb-calendar-event")),t=new Map;for(const a of e){const s=a,n=(s.startDate??s.date??"")+""||a.getAttribute("start-date")||a.getAttribute("date")||"",r=(s.endDate??"")+""||a.getAttribute("end-date")||"";if(n&&r){const l=this._toLocalEventDate(n,!1),d=this._toLocalEventDate(r,!0);if(!l||!d)continue;if(d<l){const o=n.split("T")[0],m=t.get(o)||[];m.push({title:a.title??"",description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n,end:r}),t.set(o,m);continue}for(let o=new Date(l);o<=d;o.setDate(o.getDate()+1)){const m=this._toDateKey(o),T=t.get(m)||[];T.push({title:a.title??"",description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n,end:r}),t.set(m,T)}}else if(n&&a.title){const l=n.split("T")[0],d=t.get(l)||[];d.push({title:a.title,description:a.description,href:s.href||a.getAttribute("href")||void 0,start:n}),t.set(l,d)}}return t}_syncDisplayFromCurrent(e=!0){const t=this._current.getFullYear(),a=this._current.getMonth()+1;this._syncingDisplay=!0;try{this.displayYear=t,this.displayMonth=a}finally{this._syncingDisplay=!1}e&&this._dispatchMonthChange(t,a)}_dispatchMonthChange(e,t){const a={displayYear:e,displayMonth:t};this.dispatchEvent(new CustomEvent("scb-calendar-month-change",{bubbles:!0,composed:!0,detail:a})),this.dispatchEvent(new CustomEvent("scbcalendarmonthchange",{bubbles:!0,composed:!0,detail:a}))}_dispatchSelect(e){const t={selectedDate:e};this.dispatchEvent(new CustomEvent("scb-calendar-select",{bubbles:!0,composed:!0,detail:t})),this.dispatchEvent(new CustomEvent("scbcalendarselect",{bubbles:!0,composed:!0,detail:t}))}_formatDayLabel(e){return new Intl.DateTimeFormat(this.lang==="en"?"en-GB":"sv-SE",{day:"numeric",month:"long",year:"numeric"}).format(e)}_formatDayAriaLabel(e,t,a){const s=a.map(r=>`${r.prefix||""}${r.title}`.trim()).filter(Boolean),n=[this._formatDayLabel(e)];return t&&n.push(t),s.length===1?n.push(this.lang==="en"?`1 event: ${s[0]}`:`1 händelse: ${s[0]}`):s.length>1&&n.push(this.lang==="en"?`${s.length} events: ${s.join(", ")}`:`${s.length} händelser: ${s.join(", ")}`),n.join(". ")}__dayOffsetFrom(e,t){const a=e.dataset.date;if(!a)return;const s=new Date(`${a}T12:00:00`);s.setDate(s.getDate()+t);const n=this.__formatDateKey(s);return this.shadowRoot?.querySelector(`.calendar-day[data-date="${n}"]`)??void 0}__formatDateKey(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}__focusCalendarDay(e){this.shadowRoot?.querySelectorAll(".calendar-day[data-date]").forEach(t=>{t.tabIndex=t===e?0:-1}),this._rovingDate=e.dataset.date??"",e.focus()}__focusAdjacentMonth(e,t){const a=e.dataset.date;if(!a)return;const s=new Date(`${a}T12:00:00`),n=new Date(s.getFullYear(),s.getMonth()+t,1),r=Math.min(s.getDate(),this._daysInMonth(n.getFullYear(),n.getMonth())),l=new Date(n.getFullYear(),n.getMonth(),r);this._current=new Date(l.getFullYear(),l.getMonth(),1),this.selectedDate="",this._popupEvent=null,this._rovingDate=this.__formatDateKey(l),this._syncDisplayFromCurrent(),this.requestUpdate(),this.updateComplete.then(()=>{const d=this.shadowRoot?.querySelector(`.calendar-day[data-date="${this._rovingDate}"]`);d&&this.__focusCalendarDay(d)})}_daysInMonth(e,t){return new Date(e,t+1,0).getDate()}_firstDayOfWeek(e,t){const a=new Date(e,t,1).getDay();return a===0?6:a-1}_prevMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()-1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_nextMonth(){this._current=new Date(this._current.getFullYear(),this._current.getMonth()+1,1),this.selectedDate="",this._popupEvent=null,this._syncDisplayFromCurrent(),this.requestUpdate()}_showEventPopup(e){this._popupEvent=e,this.selectedDate=e.date,this._dispatchSelect(e.date),this._lastActiveDay=this.shadowRoot?.activeElement||document.activeElement,this.requestUpdate(),this.updateComplete.then(()=>{const t=this.shadowRoot?.querySelector("scb-dialog");t&&(document.activeElement&&(t.__lastTriggerEl=document.activeElement),requestAnimationFrame(()=>{requestAnimationFrame(()=>{t.open=!0})}),t.addEventListener("close",this._handleDialogClose,{once:!0}))})}_addDays(e,t){const a=new Date(e.valueOf());return a.setDate(a.getDate()+t),a}_easterDay(e){if(typeof this._easterDateCalculated["Ar"+e]<"u")return new Date(this._easterDateCalculated["Ar"+e]);let t=e;t<100&&(t=t+1900),t<1950&&(t=t+100);const a=t%19,s=t%4,n=t%7,r=(19*a+24)%30,l=(2*s+4*n+6*r+5)%7;let d=22+r+l,o=0;d==57&&(d-=7),d==56&&r==28&&l==6&&a>10&&(d-=7),d>31?(d-=31,o=4):o=3;const m=new Date(t,o-1,d);return this._easterDateCalculated["Ar"+e]=m,new Date(this._easterDateCalculated["Ar"+e])}_swedishHolidayName(e){const t=e.getMonth();if(t===1||t===6||t===7||t===8)return null;const a=e.getMonth()+1,s=e.getDate(),n=e.getFullYear(),r=this._easterDay(n),l=this.lang==="en",d=[["Nyårsdagen","New Year's Day",a===1&&s===1],["Trettondedag jul","Epiphany",a===1&&s===6],["Långfredag","Good Friday",+e==+this._addDays(r,-2)],["Påskdagen","Easter Sunday",+e==+r],["Annandag påsk","Easter Monday",+e==+this._addDays(r,1)],["Kristi himmelsfärdsdag","Ascension Day",+e==+this._addDays(r,39)],["Pingstdagen","Pentecost",+e==+this._addDays(r,50)&&n<2005],["Första maj","May Day",a===5&&s===1],["Nationaldagen","National Day",a===6&&s===6&&n>=2005],["Midsommarafton","Midsummer's Eve",a===6&&s>=19&&s<=25&&e.getDay()===5],["Midsommardagen","Midsummer's Day",a===6&&s>=20&&s<=26&&e.getDay()===6],["Julafton","Christmas Eve",a===12&&s===24],["Juldagen","Christmas Day",a===12&&s===25],["Annandag jul","Boxing Day",a===12&&s===26],["Alla helgons dag","All Saints' Day",a===10&&s>=31&&e.getDay()===6||a===11&&s<=6&&e.getDay()===6]];for(const o of d){const[m,T,$]=o;if($)return l?T:m}return null}render(){const e=this._current.getFullYear(),t=this._current.getMonth(),a=this._daysInMonth(e,t),s=this._firstDayOfWeek(e,t),n=this._today,r=this.lang==="en",l=r?["January","February","March","April","May","June","July","August","September","October","November","December"]:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"];let d=r?["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]:["Mån","Tis","Ons","Tor","Fre","Lör","Sön"];this.disableWeekend&&(d=d.slice(0,5));const o=this._getEventInputs(),m=o?this._buildEventMapFromInputs(o):this._buildEventMapFromChildren(),T=`${e}-${String(t+1).padStart(2,"0")}-`,$=new Date(e,t,1);if(this.disableWeekend)for(;$.getDay()===0||$.getDay()===6;)$.setDate($.getDate()+1);const B=this.__formatDateKey(n),U=[...m.keys()].find(i=>{if(!i.startsWith(T))return!1;if(!this.disableWeekend)return!0;const h=new Date(`${i}T12:00:00`);return h.getDay()!==0&&h.getDay()!==6}),G=[this._rovingDate,this.selectedDate,B,U,this.__formatDateKey($)].find(i=>i?.startsWith(T))??this.__formatDateKey($),K=[];let L=1;for(let i=0;i<6;i++){const h=[],b=this.disableWeekend?[0,1,2,3,4]:[0,1,2,3,4,5,6];let g=L;for(let D=0;D<b.length;D++){const w=b[D];if(i===0&&w<s){if(!this.disableWeekend||w<5){const x=t===0?11:t-1,C=t===0?e-1:e,p=this._daysInMonth(C,x)-(s-w-1),N=new Date(C,x,p);h.push(k`
2
2
  <div
3
3
  class="calendar-day calendar-day--other"
4
4
  role="gridcell"
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../shared/lazy-ripple.js"])))=>i.map(i=>d[i]);
2
- import{h as T,m as C,p as i,v as l,y as P}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as H}from"../../vendor/preload-helper.js";import{t}from"../../vendor/decorate.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,s,n){try{customElements.get(r)||e(r,s,n)}catch(o){var c=String(o||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var p,L=new Intl.DateTimeFormat("sv-SE",{month:"short"}),I=new Intl.DateTimeFormat("sv-SE",{month:"short",timeZone:"UTC"}),g={fromAttribute:d=>d??"",toAttribute:d=>typeof d!="string"||d.trim()===""?null:d},h,b;function E(){return h??(h=H(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),h}function S(){return b??(b=H(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),b}var a=(p=class extends T{constructor(...e){super(...e),this.variant="default",this.date=null,this.direction="horizontal",this.title="",this.calendarCardTitle="",this.subtitle="",this.supportingText="",this.cardHref="",this.cardHrefNav="",this.showMedia=null,this.dateLabelPrefix="Datum:",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.width="",this.maxWidth="",this.minWidth="",this.height="",this.maxHeight="",this.minHeight="",this.sizing="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__onPointerInteraction=r=>{this.__ensureRipple(r)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,E().then(({ensureFocusRingReady:r})=>r()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}}__hasSlottedContent(e){return!!this.querySelector(`[slot="${e}"]`)}__getSlottedText(e){return this.querySelector(`[slot="${e}"]`)?.textContent?.trim()??""}get __resolvedTitle(){return this.__getSlottedText("heading")||this.calendarCardTitle||this.title}get __resolvedSubtitle(){return this.__getSlottedText("subtitle")||this.subtitle}get __resolvedLabel(){return this.__resolvedTitle||this.__resolvedSubtitle||"Kalenderkort"}firstUpdated(){this.__applyInnerSizing(),this.__applySpacing()}__ensureRipple(e){if(this.cardHref){if(e&&(this.__pendingRippleEvent=e),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,S().then(({ensureRippleReady:r})=>r()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}}async __syncRipple(){const e=this.renderRoot.querySelector("md-ripple"),r=this.renderRoot.querySelector(".calendar-card"),s=this.__pendingRippleEvent,n=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await S();await c(e,r,s,n)}render(){const e=this.variant?`${this.variant.toLowerCase()}`:"",r=this.direction?`${this.direction.toLowerCase()}`:"",s=this.cardHref?"clickable":"",n=this.__hasSlottedContent("heading"),c=this.__hasSlottedContent("subtitle"),o=this.__hasSlottedContent("supporting-text"),v=this.calendarCardTitle||this.title,u=this.subtitle,m=this.supportingText,y=n||!!v,f=c||!!u,R=o||!!m,{day:w,month:_}=this.__getDateParts(),x=this.mediaWidth&&this.mediaWidth.trim()!==""?this.mediaWidth:"",z=this.mediaHeight&&this.mediaHeight.trim()!==""?this.mediaHeight:"",k=this.mediaAspect&&this.mediaAspect.trim()!==""?this.mediaAspect:"",$=`${x?`inline-size:${x};`:""}${z?`block-size:${z};`:""}${k?`aspect-ratio:${k};`:""}`;return l`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js"])))=>i.map(i=>d[i]);
2
+ import{h as T,m as C,p as i,v as l,y as P}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as H}from"../../vendor/preload-helper.js";import{t}from"../../vendor/decorate.js";(function(){try{var d=typeof globalThis<"u"?globalThis:window;if(!d.__scb_ce_guard_installed__){d.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(r,s,n){try{customElements.get(r)||e(r,s,n)}catch(o){var c=String(o||"");if(c.indexOf("already been used")===-1&&c.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var p,L=new Intl.DateTimeFormat("sv-SE",{month:"short"}),I=new Intl.DateTimeFormat("sv-SE",{month:"short",timeZone:"UTC"}),g={fromAttribute:d=>d??"",toAttribute:d=>typeof d!="string"||d.trim()===""?null:d},h,b;function E(){return h??(h=H(()=>import("../../vendor/lazy-focus-ring.js").then(d=>d.i),__vite__mapDeps([0,1,2]),import.meta.url)),h}function S(){return b??(b=H(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),b}var a=(p=class extends T{constructor(...e){super(...e),this.variant="default",this.date=null,this.direction="horizontal",this.title="",this.calendarCardTitle="",this.subtitle="",this.supportingText="",this.cardHref="",this.cardHrefNav="",this.showMedia=null,this.dateLabelPrefix="Datum:",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.width="",this.maxWidth="",this.minWidth="",this.height="",this.maxHeight="",this.minHeight="",this.sizing="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__onPointerInteraction=r=>{this.__ensureRipple(r)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,E().then(({ensureFocusRingReady:r})=>r()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))}}__hasSlottedContent(e){return!!this.querySelector(`[slot="${e}"]`)}__getSlottedText(e){return this.querySelector(`[slot="${e}"]`)?.textContent?.trim()??""}get __resolvedTitle(){return this.__getSlottedText("heading")||this.calendarCardTitle||this.title}get __resolvedSubtitle(){return this.__getSlottedText("subtitle")||this.subtitle}get __resolvedLabel(){return this.__resolvedTitle||this.__resolvedSubtitle||"Kalenderkort"}firstUpdated(){this.__applyInnerSizing(),this.__applySpacing()}__ensureRipple(e){if(this.cardHref){if(e&&(this.__pendingRippleEvent=e),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,S().then(({ensureRippleReady:r})=>r()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}}async __syncRipple(){const e=this.renderRoot.querySelector("md-ripple"),r=this.renderRoot.querySelector(".calendar-card"),s=this.__pendingRippleEvent,n=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:c}=await S();await c(e,r,s,n)}render(){const e=this.variant?`${this.variant.toLowerCase()}`:"",r=this.direction?`${this.direction.toLowerCase()}`:"",s=this.cardHref?"clickable":"",n=this.__hasSlottedContent("heading"),c=this.__hasSlottedContent("subtitle"),o=this.__hasSlottedContent("supporting-text"),v=this.calendarCardTitle||this.title,u=this.subtitle,m=this.supportingText,y=n||!!v,f=c||!!u,R=o||!!m,{day:w,month:_}=this.__getDateParts(),x=this.mediaWidth&&this.mediaWidth.trim()!==""?this.mediaWidth:"",z=this.mediaHeight&&this.mediaHeight.trim()!==""?this.mediaHeight:"",k=this.mediaAspect&&this.mediaAspect.trim()!==""?this.mediaAspect:"",$=`${x?`inline-size:${x};`:""}${z?`block-size:${z};`:""}${k?`aspect-ratio:${k};`:""}`;return l`
3
3
  <div
4
4
  class="calendar-card ${r} ${s} ${e}"
5
5
  role="${this.cardHref?"link":"group"}"
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../shared/lazy-focus-ring.js","../../vendor/preload-helper.js","../shared/lazy-ripple.js","../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","../shared/component-size-token.js","../scb-icon-button/scb-icon-button.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateMethodInitSpec.js","../../vendor/aria-references.internal.js","../scb-button/scb-button.js","../scb-link/scb-link.js","../../vendor/classPrivateFieldGet2.js","../scb-chip/scb-chip.js","../scb-avatar/scb-avatar.js","../scb-tooltip/scb-tooltip.js","../../vendor/icon.js","../../vendor/rolldown-runtime.js","../shared/manual-popover.js","../../vendor/scb-card-variants.internal.js"])))=>i.map(i=>d[i]);
2
- import{g as l,h as ye,m as y,p as r,v as o,y as fe}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as m}from"../../vendor/preload-helper.js";import{componentSizeToken as ze}from"../shared/component-size-token.js";import{t as xe}from"../../vendor/component-defaults.js";import{t as s}from"../../vendor/decorate.js";(function(){try{var g=typeof globalThis<"u"?globalThis:window;if(!g.__scb_ce_guard_installed__){g.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,c){try{customElements.get(e)||t(e,i,c)}catch(p){var d=String(p||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var C,ke=new Set(["social-comments-text","social-comments","social-comments-disabled","social-comments-href","social-comments-link-label","social-likes-text","social-like-label","social-likes","social-likes-disabled","social-likes-hover-content","social-has-liked","social-likes-interactive","social-author","social-author-text","social-author-href","social-reply-enabled","social-reply-label","social-edit-enabled","social-edit-label","social-delete-enabled","social-delete-label"]),z="data-scb-card-managed-list-size",x="data-scb-card-managed-action-button-size",R="data-scb-card-managed-avatar-size",we=new Set(["small","medium","large"]),_e=new Set(["small","medium","large","extra-large"]),$,P,E,B,D,I,H,O,V,N;function Se(){return O??(O=m(()=>import("../shared/lazy-focus-ring.js"),__vite__mapDeps([0,1]),import.meta.url)),O}function U(){return V??(V=m(()=>import("../shared/lazy-ripple.js"),__vite__mapDeps([2,1]),import.meta.url)),V}function Ae(){return $??($=m(()=>import("../scb-list/scb-list.js"),__vite__mapDeps([3,4,5,6,7,8,1,9]),import.meta.url)),$}function Te(){return P??(P=m(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([10,4,5,1,6,7,11,12,13]),import.meta.url)),P}function Le(){return E??(E=m(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([14,4,5,1,6,7,11,12,13]),import.meta.url)),E}function Ce(){return B??(B=m(()=>import("../scb-link/scb-link.js"),__vite__mapDeps([15,4,5,0,1,7,11,12,16]),import.meta.url)),B}function Re(){return D??(D=m(()=>import("../scb-chip/scb-chip.js"),__vite__mapDeps([17,4,5,1,7,11,12]),import.meta.url)),D}function $e(){return I??(I=m(()=>import("../scb-avatar/scb-avatar.js"),__vite__mapDeps([18,4,5,1,6,7,11,12]),import.meta.url)),I}function Pe(){return H??(H=m(()=>import("../scb-tooltip/scb-tooltip.js"),__vite__mapDeps([19,4,5,20,21,1,9,7,22]),import.meta.url)),H}function Ee(){return N??(N=m(()=>import("../../vendor/scb-card-variants.internal.js"),__vite__mapDeps([23,4,5]),import.meta.url)),N}var n={fromAttribute:g=>g??"",toAttribute:g=>typeof g!="string"||g.trim()===""?null:g},a=(C=class extends ye{constructor(...t){super(...t),this.__dependencyKey="",this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__isSyncingManagedSocialAttributes=!1,this.type="standard",this.variant="standard",this.direction="dynamic",this.size=xe["scb-card"].size,this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.href="",this.title="",this.cardTitle="",this.subtitle="",this.vignette="",this.vignetteVariant="filled",this.vignetteSpacing=void 0,this.vignetteSpacingTop=void 0,this.vignetteSpacingBottom=void 0,this.vignetteSpacingLeft=void 0,this.vignetteSpacingRight=void 0,this.supportingText="",this.commentsText="",this.commentsDisabled=!1,this.commentsHref="",this.commentsLinkLabel="Gå till kommentarer",this.likesText="",this.likeLabel="",this.likesDisabled=!1,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText="",this.authorHref="",this.replyEnabled=!1,this.replyLabel="Svara",this.editEnabled=!1,this.editLabel="Redigera",this.deleteEnabled=!1,this.deleteLabel="Ta bort",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.innerPadding=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.__onImgLoad=e=>{const i=e.currentTarget.closest(".media");i&&i.classList.add("is-loaded")},this.__ensureRippleOnInteraction=(e,i=!1)=>{if(this.__primaryHref()){if(e&&(this.__pendingRippleEvent=e),i&&(this.__pendingRippleClick=!0),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,U().then(({ensureRippleReady:c})=>c()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}},this.__syncRipple=async()=>{const e=this.renderRoot.querySelector("md-ripple"),i=this.renderRoot.querySelector(".scb-card"),c=this.__pendingRippleEvent,d=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:p}=await U();await p(e,i,c,d)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,Se().then(({ensureFocusRingReady:e})=>e()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))},this.__onKeyDown=e=>{if(e.target!==e.currentTarget)return;const i=this.__primaryHref();(e.key==="Enter"||e.key===" ")&&i&&(e.preventDefault(),this.__ensureRippleOnInteraction(void 0,!0),this.__navigate(i,e))},this.__handleHrefNavigation=e=>{const i=this.__primaryHref();i&&(e.target.closest("a")||this.__navigate(i,e))},this.__handleSlottedCardLinkClick=e=>{const i=e.composedPath().find(c=>c instanceof HTMLAnchorElement&&c.getAttribute("slot")==="card-link")?.getAttribute("href")||this.__primaryHref();i&&(this.__dispatchCardNavigate(i,e)||e.preventDefault())}}attributeChangedCallback(t,e,i){this.__isSyncingManagedSocialAttributes&&ke.has(t)||super.attributeChangedCallback(t,e,i)}get likeButton(){return this.cardType!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(t){const e=(t||"").trim();if(!e)return{w:600,h:400};const i=e.includes("/")?e.split("/"):e.includes(":")?e.split(":"):e.includes("x")?e.split("x"):null;if(i&&i.length===2){const d=Number(i[0]),p=Number(i[1]);if(d>0&&p>0)return{w:d,h:p}}const c=Number(e);return isFinite(c)&&c>0?{w:1e3,h:Math.round(1e3/c)}:{w:600,h:400}}__mediaReserveAspect(t=""){const e=(this.mediaAspect||"").trim();if(e)return e;const i=Number(this.mediaWidth)||0,c=Number(this.mediaHeight)||0;return i>0&&c>0?`${i} / ${c}`:t}__mediaReserveStyle(t=""){const e=this.__mediaReserveAspect(t);return e?`--scb-card-media-aspect:${e};`:""}__slottedMediaAspect(){const t=this.querySelector('[slot="media"]');if(!t)return"";const e=Number(t.getAttribute("width"))||0,i=Number(t.getAttribute("height"))||0;return e>0&&i>0?`${e} / ${i}`:""}__isAvatarMedia(){return(this.mediaType||"").toLowerCase()==="avatar"?!0:this.querySelector(':scope > [slot="media"]')?.localName==="scb-avatar"}get __resolvedTitle(){return this.cardTitle||this.title}get cardType(){const t=(this.type||"standard").toLowerCase();switch(t){case"standard":case"list":case"social":case"link":case"action":case"container":return t;default:return"standard"}}__ensureVariantRenderer(){return this.cardType==="standard"||this.__variantRenderer?Promise.resolve():Ee().then(t=>{this.__variantRenderer!==t&&(this.__variantRenderer=t,t.ensureScbCardVariantStyles(this.renderRoot),this.requestUpdate())})}__dispatchCardNavigate(t,e){const i={href:t,originalEvent:e},c=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:i});if(this.dispatchEvent(c),c.defaultPrevented)return!1;const d=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:i});return this.dispatchEvent(d),!d.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__slottedCardLink(){return this.querySelector(':scope > a[slot="card-link"]')}__primaryHref(){return this.__effectiveHref()||this.__slottedCardLink()?.getAttribute("href")||""}__navigate(t,e){t&&this.__dispatchCardNavigate(t,e)&&window.open(t,"_self")}__slotNames(){const t=new Set;for(const e of Array.from(this.children)){const i=e.getAttribute("slot");i&&t.add(i)}return t}__hasSlottedContent(t,e){return e?e.has(t):Array.from(this.children).some(i=>i.getAttribute("slot")===t)}__hasLightDomElement(t){return!!this.querySelector(t)}__syncListCardListSize(){const t=Array.from(this.querySelectorAll("scb-list"));if(this.cardType!=="list"){for(const i of t){const c=i.getAttribute(z);c!==null&&i.getAttribute("size")===c&&i.removeAttribute("size"),i.removeAttribute(z)}return}const e=this.size||"large";for(const i of t){const c=i.getAttribute(z);if(c!==null&&i.getAttribute("size")!==c){i.removeAttribute(z);continue}(!i.hasAttribute("size")||c!==null)&&(i.setAttribute("size",e),i.setAttribute(z,e))}}__actionCardButtonSize(){const t=getComputedStyle(this).getPropertyValue("--scb-card-size-actions-button-size").trim();return we.has(t)?t:"medium"}__cardAvatarSize(){const t=getComputedStyle(this).getPropertyValue("--scb-card-size-avatar-component-size").trim();return _e.has(t)?t:"medium"}__syncAvatarSizes(){const t=Array.from(this.querySelectorAll(':scope > scb-avatar[slot="media"]')),e=this.__cardAvatarSize();for(const i of t){const c=i.getAttribute(R);if(c!==null&&i.getAttribute("size")!==c){i.removeAttribute(R);continue}(!i.hasAttribute("size")||c!==null)&&(i.setAttribute("size",e),i.setAttribute(R,e))}}__socialIconButtonSize(){return ze(this,"--scb-card-size-social-icon-button-component-size",["tiny","extra-small","small","medium","large"],this.size==="small"?"small":"medium")}__syncActionCardButtonSizes(){const t=Array.from(this.querySelectorAll(':scope > [slot="actions"] scb-button, :scope > scb-button[slot="actions"]'));if(this.cardType!=="action"){for(const i of t){const c=i.getAttribute(x);c!==null&&i.getAttribute("size")===c&&i.removeAttribute("size"),i.removeAttribute(x)}return}const e=this.__actionCardButtonSize();for(const i of t){const c=i.getAttribute(x);if(c!==null&&i.getAttribute("size")!==c){i.removeAttribute(x);continue}(!i.hasAttribute("size")||c!==null)&&(i.setAttribute("size",e),i.setAttribute(x,e))}}__slottedText(t){return(this.querySelector(`:scope > [slot="${t}"]`)?.textContent??"").replace(/\s+/g," ").trim()}__ensureDependenciesReady(){const t=[],e=[],i=this.cardType,c=!!this.vignette?.trim(),d=(v,h)=>{e.push(v),t.push(h())};(i==="list"||this.__hasLightDomElement("scb-list, scb-list-item"))&&d("list",Ae),i!=="standard"&&d("card-variants",()=>this.__ensureVariantRenderer()),(i==="social"&&(!this.likesDisabled&&this.likesInteractive||!this.commentsDisabled&&this.commentsHref||this.replyEnabled||this.editEnabled||this.deleteEnabled)||this.__hasLightDomElement("scb-icon-button"))&&d("icon-button",Te),this.__hasLightDomElement("scb-button")&&d("button",Le),this.__hasLightDomElement("scb-link")&&d("link",Ce),(c||this.__hasLightDomElement("scb-chip"))&&d("chip",Re),((this.mediaType||"").toLowerCase()==="avatar"||this.__hasLightDomElement("scb-avatar"))&&d("avatar",$e),(i==="social"&&this.likesHoverContent||this.__hasLightDomElement("scb-tooltip"))&&d("tooltip",Pe);const p=e.sort().join("|");p!==this.__dependencyKey&&(this.__dependencyKey=p,t.length>0&&Promise.all(t).then(()=>this.requestUpdate()))}__mediaTemplate(t){const e=this.__isAvatarMedia();if(this.__hasSlottedContent("media",t)){const i=e?"":this.__mediaReserveStyle(this.__slottedMediaAspect());return o`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../../vendor/lazy-focus-ring.js","../../vendor/rolldown-runtime.js","../../vendor/preload-helper.js","../../vendor/lazy-ripple.js","../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/component-size-token.js","../scb-icon-button/scb-icon-button.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateMethodInitSpec.js","../../vendor/aria-references.internal.js","../scb-button/scb-button.js","../scb-link/scb-link.js","../../vendor/classPrivateFieldGet2.js","../scb-chip/scb-chip.js","../scb-avatar/scb-avatar.js","../scb-tooltip/scb-tooltip.js","../../vendor/icon.js","../../vendor/manual-popover.js","../../vendor/scb-card-variants.internal.js"])))=>i.map(i=>d[i]);
2
+ import{g as l,h as ye,m as y,p as r,v as o,y as fe}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as m}from"../../vendor/preload-helper.js";import{t as ze}from"../../vendor/component-size-token.js";import{t as xe}from"../../vendor/component-defaults.js";import{t as s}from"../../vendor/decorate.js";(function(){try{var g=typeof globalThis<"u"?globalThis:window;if(!g.__scb_ce_guard_installed__){g.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,i,c){try{customElements.get(e)||t(e,i,c)}catch(p){var d=String(p||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw p}}}}catch{}})();var C,ke=new Set(["social-comments-text","social-comments","social-comments-disabled","social-comments-href","social-comments-link-label","social-likes-text","social-like-label","social-likes","social-likes-disabled","social-likes-hover-content","social-has-liked","social-likes-interactive","social-author","social-author-text","social-author-href","social-reply-enabled","social-reply-label","social-edit-enabled","social-edit-label","social-delete-enabled","social-delete-label"]),z="data-scb-card-managed-list-size",x="data-scb-card-managed-action-button-size",R="data-scb-card-managed-avatar-size",we=new Set(["small","medium","large"]),_e=new Set(["small","medium","large","extra-large"]),$,P,E,B,D,I,H,O,V,N;function Se(){return O??(O=m(()=>import("../../vendor/lazy-focus-ring.js").then(g=>g.i),__vite__mapDeps([0,1,2]),import.meta.url)),O}function U(){return V??(V=m(()=>import("../../vendor/lazy-ripple.js"),__vite__mapDeps([3,2]),import.meta.url)),V}function Ae(){return $??($=m(()=>import("../scb-list/scb-list.js"),__vite__mapDeps([4,5,6,7,8,9,2,10]),import.meta.url)),$}function Te(){return P??(P=m(()=>import("../scb-icon-button/scb-icon-button.js"),__vite__mapDeps([11,5,6,2,7,8,12,13,14]),import.meta.url)),P}function Le(){return E??(E=m(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([15,5,6,2,7,8,12,13,14]),import.meta.url)),E}function Ce(){return B??(B=m(()=>import("../scb-link/scb-link.js"),__vite__mapDeps([16,5,6,0,1,2,8,12,13,17]),import.meta.url)),B}function Re(){return D??(D=m(()=>import("../scb-chip/scb-chip.js"),__vite__mapDeps([18,5,6,2,8,12,13]),import.meta.url)),D}function $e(){return I??(I=m(()=>import("../scb-avatar/scb-avatar.js"),__vite__mapDeps([19,5,6,2,7,8,12,13]),import.meta.url)),I}function Pe(){return H??(H=m(()=>import("../scb-tooltip/scb-tooltip.js"),__vite__mapDeps([20,5,6,21,1,2,10,8,22]),import.meta.url)),H}function Ee(){return N??(N=m(()=>import("../../vendor/scb-card-variants.internal.js"),__vite__mapDeps([23,5,6]),import.meta.url)),N}var n={fromAttribute:g=>g??"",toAttribute:g=>typeof g!="string"||g.trim()===""?null:g},a=(C=class extends ye{constructor(...t){super(...t),this.__dependencyKey="",this.__focusRingRequested=!1,this.__focusRingLoaded=!1,this.__rippleRequested=!1,this.__rippleLoaded=!1,this.__pendingRippleClick=!1,this.__isSyncingManagedSocialAttributes=!1,this.type="standard",this.variant="standard",this.direction="dynamic",this.size=xe["scb-card"].size,this.mediaType="",this.mediaHref="",this.mediaAlt="",this.mediaSrcset="",this.mediaSizes="",this.mediaLoading="auto",this.mediaDecoding="async",this.mediaFetchPriority="auto",this.mediaFit="cover",this.mediaPosition="center",this.mediaWidth="",this.mediaHeight="",this.mediaAspect="",this.mediaPlaceholder=!1,this.cardHref="",this.href="",this.title="",this.cardTitle="",this.subtitle="",this.vignette="",this.vignetteVariant="filled",this.vignetteSpacing=void 0,this.vignetteSpacingTop=void 0,this.vignetteSpacingBottom=void 0,this.vignetteSpacingLeft=void 0,this.vignetteSpacingRight=void 0,this.supportingText="",this.commentsText="",this.commentsDisabled=!1,this.commentsHref="",this.commentsLinkLabel="Gå till kommentarer",this.likesText="",this.likeLabel="",this.likesDisabled=!1,this.likesHoverContent="",this.hasLiked=!1,this.likesInteractive=!0,this.author=!1,this.authorText="",this.authorHref="",this.replyEnabled=!1,this.replyLabel="Svara",this.editEnabled=!1,this.editLabel="Redigera",this.deleteEnabled=!1,this.deleteLabel="Ta bort",this.width="",this.maxWidth="",this.height="",this.maxHeight="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.innerPadding=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.__onImgLoad=e=>{const i=e.currentTarget.closest(".media");i&&i.classList.add("is-loaded")},this.__ensureRippleOnInteraction=(e,i=!1)=>{if(this.__primaryHref()){if(e&&(this.__pendingRippleEvent=e),i&&(this.__pendingRippleClick=!0),this.__rippleLoaded){this.__syncRipple();return}this.__rippleRequested||(this.__rippleRequested=!0,U().then(({ensureRippleReady:c})=>c()).then(()=>{this.__rippleLoaded=!0,this.requestUpdate(),this.updateComplete.then(()=>this.__syncRipple())}))}},this.__syncRipple=async()=>{const e=this.renderRoot.querySelector("md-ripple"),i=this.renderRoot.querySelector(".scb-card"),c=this.__pendingRippleEvent,d=this.__pendingRippleClick;this.__pendingRippleEvent=void 0,this.__pendingRippleClick=!1;const{syncRippleToControl:p}=await U();await p(e,i,c,d)},this.__ensureFocusRingOnFocusVisible=()=>{this.__focusRingLoaded||this.__focusRingRequested||(this.__focusRingRequested=!0,Se().then(({ensureFocusRingReady:e})=>e()).then(()=>{this.__focusRingLoaded=!0,this.requestUpdate()}))},this.__onKeyDown=e=>{if(e.target!==e.currentTarget)return;const i=this.__primaryHref();(e.key==="Enter"||e.key===" ")&&i&&(e.preventDefault(),this.__ensureRippleOnInteraction(void 0,!0),this.__navigate(i,e))},this.__handleHrefNavigation=e=>{const i=this.__primaryHref();i&&(e.target.closest("a")||this.__navigate(i,e))},this.__handleSlottedCardLinkClick=e=>{const i=e.composedPath().find(c=>c instanceof HTMLAnchorElement&&c.getAttribute("slot")==="card-link")?.getAttribute("href")||this.__primaryHref();i&&(this.__dispatchCardNavigate(i,e)||e.preventDefault())}}attributeChangedCallback(t,e,i){this.__isSyncingManagedSocialAttributes&&ke.has(t)||super.attributeChangedCallback(t,e,i)}get likeButton(){return this.cardType!=="social"?null:this.renderRoot.querySelector(".likes scb-icon-button")}__calcAspectWH(t){const e=(t||"").trim();if(!e)return{w:600,h:400};const i=e.includes("/")?e.split("/"):e.includes(":")?e.split(":"):e.includes("x")?e.split("x"):null;if(i&&i.length===2){const d=Number(i[0]),p=Number(i[1]);if(d>0&&p>0)return{w:d,h:p}}const c=Number(e);return isFinite(c)&&c>0?{w:1e3,h:Math.round(1e3/c)}:{w:600,h:400}}__mediaReserveAspect(t=""){const e=(this.mediaAspect||"").trim();if(e)return e;const i=Number(this.mediaWidth)||0,c=Number(this.mediaHeight)||0;return i>0&&c>0?`${i} / ${c}`:t}__mediaReserveStyle(t=""){const e=this.__mediaReserveAspect(t);return e?`--scb-card-media-aspect:${e};`:""}__slottedMediaAspect(){const t=this.querySelector('[slot="media"]');if(!t)return"";const e=Number(t.getAttribute("width"))||0,i=Number(t.getAttribute("height"))||0;return e>0&&i>0?`${e} / ${i}`:""}__isAvatarMedia(){return(this.mediaType||"").toLowerCase()==="avatar"?!0:this.querySelector(':scope > [slot="media"]')?.localName==="scb-avatar"}get __resolvedTitle(){return this.cardTitle||this.title}get cardType(){const t=(this.type||"standard").toLowerCase();switch(t){case"standard":case"list":case"social":case"link":case"action":case"container":return t;default:return"standard"}}__ensureVariantRenderer(){return this.cardType==="standard"||this.__variantRenderer?Promise.resolve():Ee().then(t=>{this.__variantRenderer!==t&&(this.__variantRenderer=t,t.ensureScbCardVariantStyles(this.renderRoot),this.requestUpdate())})}__dispatchCardNavigate(t,e){const i={href:t,originalEvent:e},c=new CustomEvent("card-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:i});if(this.dispatchEvent(c),c.defaultPrevented)return!1;const d=new CustomEvent("cardnavigate",{bubbles:!0,composed:!0,cancelable:!0,detail:i});return this.dispatchEvent(d),!d.defaultPrevented}__effectiveHref(){return this.cardHref||this.href}__slottedCardLink(){return this.querySelector(':scope > a[slot="card-link"]')}__primaryHref(){return this.__effectiveHref()||this.__slottedCardLink()?.getAttribute("href")||""}__navigate(t,e){t&&this.__dispatchCardNavigate(t,e)&&window.open(t,"_self")}__slotNames(){const t=new Set;for(const e of Array.from(this.children)){const i=e.getAttribute("slot");i&&t.add(i)}return t}__hasSlottedContent(t,e){return e?e.has(t):Array.from(this.children).some(i=>i.getAttribute("slot")===t)}__hasLightDomElement(t){return!!this.querySelector(t)}__syncListCardListSize(){const t=Array.from(this.querySelectorAll("scb-list"));if(this.cardType!=="list"){for(const i of t){const c=i.getAttribute(z);c!==null&&i.getAttribute("size")===c&&i.removeAttribute("size"),i.removeAttribute(z)}return}const e=this.size||"large";for(const i of t){const c=i.getAttribute(z);if(c!==null&&i.getAttribute("size")!==c){i.removeAttribute(z);continue}(!i.hasAttribute("size")||c!==null)&&(i.setAttribute("size",e),i.setAttribute(z,e))}}__actionCardButtonSize(){const t=getComputedStyle(this).getPropertyValue("--scb-card-size-actions-button-size").trim();return we.has(t)?t:"medium"}__cardAvatarSize(){const t=getComputedStyle(this).getPropertyValue("--scb-card-size-avatar-component-size").trim();return _e.has(t)?t:"medium"}__syncAvatarSizes(){const t=Array.from(this.querySelectorAll(':scope > scb-avatar[slot="media"]')),e=this.__cardAvatarSize();for(const i of t){const c=i.getAttribute(R);if(c!==null&&i.getAttribute("size")!==c){i.removeAttribute(R);continue}(!i.hasAttribute("size")||c!==null)&&(i.setAttribute("size",e),i.setAttribute(R,e))}}__socialIconButtonSize(){return ze(this,"--scb-card-size-social-icon-button-component-size",["tiny","extra-small","small","medium","large"],this.size==="small"?"small":"medium")}__syncActionCardButtonSizes(){const t=Array.from(this.querySelectorAll(':scope > [slot="actions"] scb-button, :scope > scb-button[slot="actions"]'));if(this.cardType!=="action"){for(const i of t){const c=i.getAttribute(x);c!==null&&i.getAttribute("size")===c&&i.removeAttribute("size"),i.removeAttribute(x)}return}const e=this.__actionCardButtonSize();for(const i of t){const c=i.getAttribute(x);if(c!==null&&i.getAttribute("size")!==c){i.removeAttribute(x);continue}(!i.hasAttribute("size")||c!==null)&&(i.setAttribute("size",e),i.setAttribute(x,e))}}__slottedText(t){return(this.querySelector(`:scope > [slot="${t}"]`)?.textContent??"").replace(/\s+/g," ").trim()}__ensureDependenciesReady(){const t=[],e=[],i=this.cardType,c=!!this.vignette?.trim(),d=(v,h)=>{e.push(v),t.push(h())};(i==="list"||this.__hasLightDomElement("scb-list, scb-list-item"))&&d("list",Ae),i!=="standard"&&d("card-variants",()=>this.__ensureVariantRenderer()),(i==="social"&&(!this.likesDisabled&&this.likesInteractive||!this.commentsDisabled&&this.commentsHref||this.replyEnabled||this.editEnabled||this.deleteEnabled)||this.__hasLightDomElement("scb-icon-button"))&&d("icon-button",Te),this.__hasLightDomElement("scb-button")&&d("button",Le),this.__hasLightDomElement("scb-link")&&d("link",Ce),(c||this.__hasLightDomElement("scb-chip"))&&d("chip",Re),((this.mediaType||"").toLowerCase()==="avatar"||this.__hasLightDomElement("scb-avatar"))&&d("avatar",$e),(i==="social"&&this.likesHoverContent||this.__hasLightDomElement("scb-tooltip"))&&d("tooltip",Pe);const p=e.sort().join("|");p!==this.__dependencyKey&&(this.__dependencyKey=p,t.length>0&&Promise.all(t).then(()=>this.requestUpdate()))}__mediaTemplate(t){const e=this.__isAvatarMedia();if(this.__hasSlottedContent("media",t)){const i=e?"":this.__mediaReserveStyle(this.__slottedMediaAspect());return o`
3
3
  <div class="media ${e?"avatar-media":""} ${i?"has-reserved-space":""}" style=${i||l}>
4
4
  <slot name="media"></slot>
5
5
  </div>
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../scb-button/scb-button.js","../../vendor/vendor.js","../../vendor/vendor-lit.js","../../vendor/preload-helper.js","../../vendor/component-defaults.js","../../vendor/decorate.js","../../vendor/assertClassBrand.js","../../vendor/classPrivateMethodInitSpec.js","../../vendor/aria-references.internal.js"])))=>i.map(i=>d[i]);
2
- import{h as b,m as h,p as c,v,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as k}from"../../vendor/preload-helper.js";import{componentSizeToken as f}from"../shared/component-size-token.js";import{t as n}from"../../vendor/decorate.js";import{closeManualPopover as g,openManualPopover as _}from"../shared/manual-popover.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,e,o){try{customElements.get(i)||t(i,e,o)}catch(l){var a=String(l||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var d,p,u="data-scb-cookies-consent-managed-button-size";function w(){return!!document.querySelector('script[src*="/scb-button/scb-button.js"],script[src$="scb-button.js"]')}var m={fromAttribute(r){if(r===null)return!1;const t=r.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},s=(d=class extends b{constructor(...t){super(...t),this.open=!0,this.autoRemove=!0,this.title="",this.supportingText="",this.ariaLabel="Cookie-inställningar",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._updateButtonWidth=()=>{const i=window.innerWidth<=480,e=this.shadowRoot.querySelector('slot[name="buttons"]');e&&e.assignedElements().forEach(o=>{i?o.setAttribute("full-width",""):o.removeAttribute("full-width")})},this.__onButtonHydrationInteraction=i=>{const e=i.target;e instanceof Element&&e.closest('scb-button[slot="buttons"]')&&this.__ensureSlottedButtonsReady(!0)},this.__onButtonsSlotChange=()=>{this.__ensureSlottedButtonsReady(),this.__syncButtonSizes(),this._updateButtonWidth()}}__syncButtonSizes(){const t=f(this,"--scb-cookies-consent-design-actions-button-size-medium",["small","medium","large"],"medium"),i=Array.from(this.querySelectorAll(':scope > scb-button[slot="buttons"]'));for(const e of i){const o=e.getAttribute(u);if(o!==null&&e.getAttribute("size")!==o){e.removeAttribute(u);continue}(!e.hasAttribute("size")||o!==null)&&(e.setAttribute("size",t),e.setAttribute(u,t))}}__ensureSlottedButtonsReady(t=!1){if(!(!this.querySelector('scb-button[slot="buttons"]')||customElements.get("scb-button"))){if(w()){customElements.whenDefined("scb-button").then(()=>this.requestUpdate());return}t&&(p??(p=k(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url)),p.then(()=>this.requestUpdate()))}}mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}applySpacing(){const t=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??t,e=this.mapSpacingToken(this.spacingBottom)??t,o=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-cookies-consent-spacing-block-start",i):this.style.removeProperty("--scb-cookies-consent-spacing-block-start"),e?this.style.setProperty("--scb-cookies-consent-spacing-block-end",e):this.style.removeProperty("--scb-cookies-consent-spacing-block-end"),o?this.style.setProperty("--scb-cookies-consent-spacing-inline-start",o):this.style.removeProperty("--scb-cookies-consent-spacing-inline-start"),a?this.style.setProperty("--scb-cookies-consent-spacing-inline-end",a):this.style.removeProperty("--scb-cookies-consent-spacing-inline-end")}firstUpdated(t){this.__ensureSlottedButtonsReady(),this.__syncButtonSizes(),this._updateButtonWidth(),window.addEventListener("resize",this._updateButtonWidth),this.addEventListener("pointerover",this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener("focusin",this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener("pointerdown",this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener("keydown",this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener("click",i=>{const e=i.target;e.slot==="buttons"&&(e.id==="accept-btn"?this.closeAndRemove("cookies-accept"):e.id==="decline-btn"?this.closeAndRemove("cookies-decline"):e.id==="handle-btn"&&this.closeAndRemove("cookies-handle"))}),this.applySpacing(),this.__syncTopLayer()}__syncTopLayer(){this.open&&getComputedStyle(this).position==="fixed"?_(this):g(this)}updated(t){super.updated(t),this.__syncButtonSizes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing(),t.has("open")&&(this.__syncTopLayer(),t.get("open")!==void 0&&(this.open&&this._updateButtonWidth(),this.dispatchEvent(new CustomEvent("openchange",{bubbles:!0,composed:!0,detail:{open:this.open}}))))}connectedCallback(){super.connectedCallback(),this.id||(this.id="cookie-consent")}disconnectedCallback(){g(this),super.disconnectedCallback(),window.removeEventListener("resize",this._updateButtonWidth),this.removeEventListener("pointerover",this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener("focusin",this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener("pointerdown",this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener("keydown",this.__onButtonHydrationInteraction,{capture:!0})}closeAndRemove(t){const i={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent(t,i));const e=t.includes("-")?t.replace(/-/g,""):"";e&&e!==t&&this.dispatchEvent(new CustomEvent(e,i)),this.autoRemove?this.remove():this.open=!1}render(){return this.open?v`
2
+ import{h as b,m as h,p as c,v,y}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as k}from"../../vendor/preload-helper.js";import{t as f}from"../../vendor/component-size-token.js";import{t as n}from"../../vendor/decorate.js";import{a as _,t as g}from"../../vendor/manual-popover.js";(function(){try{var r=typeof globalThis<"u"?globalThis:window;if(!r.__scb_ce_guard_installed__){r.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,e,o){try{customElements.get(i)||t(i,e,o)}catch(l){var a=String(l||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var d,p,u="data-scb-cookies-consent-managed-button-size";function w(){return!!document.querySelector('script[src*="/scb-button/scb-button.js"],script[src$="scb-button.js"]')}var m={fromAttribute(r){if(r===null)return!1;const t=r.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="no"}},s=(d=class extends b{constructor(...t){super(...t),this.open=!0,this.autoRemove=!0,this.title="",this.supportingText="",this.ariaLabel="Cookie-inställningar",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this._updateButtonWidth=()=>{const i=window.innerWidth<=480,e=this.shadowRoot.querySelector('slot[name="buttons"]');e&&e.assignedElements().forEach(o=>{i?o.setAttribute("full-width",""):o.removeAttribute("full-width")})},this.__onButtonHydrationInteraction=i=>{const e=i.target;e instanceof Element&&e.closest('scb-button[slot="buttons"]')&&this.__ensureSlottedButtonsReady(!0)},this.__onButtonsSlotChange=()=>{this.__ensureSlottedButtonsReady(),this.__syncButtonSizes(),this._updateButtonWidth()}}__syncButtonSizes(){const t=f(this,"--scb-cookies-consent-design-actions-button-size-medium",["small","medium","large"],"medium"),i=Array.from(this.querySelectorAll(':scope > scb-button[slot="buttons"]'));for(const e of i){const o=e.getAttribute(u);if(o!==null&&e.getAttribute("size")!==o){e.removeAttribute(u);continue}(!e.hasAttribute("size")||o!==null)&&(e.setAttribute("size",t),e.setAttribute(u,t))}}__ensureSlottedButtonsReady(t=!1){if(!(!this.querySelector('scb-button[slot="buttons"]')||customElements.get("scb-button"))){if(w()){customElements.whenDefined("scb-button").then(()=>this.requestUpdate());return}t&&(p??(p=k(()=>import("../scb-button/scb-button.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url)),p.then(()=>this.requestUpdate()))}}mapSpacingToken(t){if(!t)return;const i=String(t).trim();if(i)return/^\d+$/.test(i)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(i,10)))})`:i}applySpacing(){const t=this.mapSpacingToken(this.spacing),i=this.mapSpacingToken(this.spacingTop)??t,e=this.mapSpacingToken(this.spacingBottom)??t,o=this.mapSpacingToken(this.spacingLeft),a=this.mapSpacingToken(this.spacingRight);i?this.style.setProperty("--scb-cookies-consent-spacing-block-start",i):this.style.removeProperty("--scb-cookies-consent-spacing-block-start"),e?this.style.setProperty("--scb-cookies-consent-spacing-block-end",e):this.style.removeProperty("--scb-cookies-consent-spacing-block-end"),o?this.style.setProperty("--scb-cookies-consent-spacing-inline-start",o):this.style.removeProperty("--scb-cookies-consent-spacing-inline-start"),a?this.style.setProperty("--scb-cookies-consent-spacing-inline-end",a):this.style.removeProperty("--scb-cookies-consent-spacing-inline-end")}firstUpdated(t){this.__ensureSlottedButtonsReady(),this.__syncButtonSizes(),this._updateButtonWidth(),window.addEventListener("resize",this._updateButtonWidth),this.addEventListener("pointerover",this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener("focusin",this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener("pointerdown",this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener("keydown",this.__onButtonHydrationInteraction,{capture:!0}),this.addEventListener("click",i=>{const e=i.target;e.slot==="buttons"&&(e.id==="accept-btn"?this.closeAndRemove("cookies-accept"):e.id==="decline-btn"?this.closeAndRemove("cookies-decline"):e.id==="handle-btn"&&this.closeAndRemove("cookies-handle"))}),this.applySpacing(),this.__syncTopLayer()}__syncTopLayer(){this.open&&getComputedStyle(this).position==="fixed"?_(this):g(this)}updated(t){super.updated(t),this.__syncButtonSizes(),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing(),t.has("open")&&(this.__syncTopLayer(),t.get("open")!==void 0&&(this.open&&this._updateButtonWidth(),this.dispatchEvent(new CustomEvent("openchange",{bubbles:!0,composed:!0,detail:{open:this.open}}))))}connectedCallback(){super.connectedCallback(),this.id||(this.id="cookie-consent")}disconnectedCallback(){g(this),super.disconnectedCallback(),window.removeEventListener("resize",this._updateButtonWidth),this.removeEventListener("pointerover",this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener("focusin",this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener("pointerdown",this.__onButtonHydrationInteraction,{capture:!0}),this.removeEventListener("keydown",this.__onButtonHydrationInteraction,{capture:!0})}closeAndRemove(t){const i={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent(t,i));const e=t.includes("-")?t.replace(/-/g,""):"";e&&e!==t&&this.dispatchEvent(new CustomEvent(e,i)),this.autoRemove?this.remove():this.open=!1}render(){return this.open?v`
3
3
  <div role="dialog" class="cookies-consent" aria-modal="true" aria-label=${this.ariaLabel}>
4
4
  <h2><slot name="title">${this.title}</slot></h2>
5
5
  <div class="supporting-text">
@@ -1,4 +1,4 @@
1
- import{g,h as x,m as w,p as c,v as d,y as E}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{componentSizeToken as _}from"../shared/component-size-token.js";import{t as l}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import{closeManualPopover as v,closeManualPopoverAfterAnimations as T,closeNestedPopupSurfaces as z,isManualPopoverOpen as C,openManualPopover as F}from"../shared/manual-popover.js";import"../scb-textfield/scb-textfield.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,s){try{customElements.get(t)||e(t,i,s)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var m,a,k={fromAttribute(h){if(h===null)return!1;const e=h.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="no"}},b=new Set,y="",S="",r=(m=class extends x{constructor(...e){super(...e),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.closeLabel="Stäng dialog",this.formId="",this.formAction="",this.formMethod="",this.formEnctype="",this.__lastTriggerEl=null,this.__focusBeforeOpen=null,this.__stackInactive=!1,this.__submitting=!1,this.__redirectingFocus=!1,this.__scrollLocked=!1,this.__initialControlStates=new Map,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{if(!this.open||t.key!=="Escape")return;const i=a.__getTopmostOpenDialog();i&&i!==this||this.__hasOpenNestedOverlay(t)||(t.preventDefault(),t.stopPropagation(),this.__fireCancelable("esc")&&this.__setOpen(!1))},this.__onDocumentFocusIn=t=>{this.__redirectingFocus||a.__getTopmostOpenDialog()!==this||t.composedPath().includes(this)||(this.__redirectingFocus=!0,queueMicrotask(()=>{this.__focusInitial(),this.__redirectingFocus=!1}))},this.__rememberInitialControlStates=()=>{for(const t of this.__getSlottedElements()){if(!(t instanceof HTMLElement)||this.__initialControlStates.has(t))continue;const i={},s=t;"value"in s&&(i.value=s.value),"checked"in s&&(i.checked=s.checked),"selected"in s&&(i.selected=s.selected),Object.keys(i).length>0&&this.__initialControlStates.set(t,i)}},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{const t=this.shadowRoot?.querySelector("form");t instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(t),t.reset()),this.__rememberInitialControlStates();for(const[i,s]of this.__initialControlStates){if(!i.isConnected)continue;if(i instanceof HTMLInputElement){i.type==="file"?i.value="":i.value=i.defaultValue,i.checked=i.defaultChecked;continue}if(i instanceof HTMLTextAreaElement){i.value=i.defaultValue;continue}if(i instanceof HTMLSelectElement){for(const o of Array.from(i.options))o.selected=o.defaultSelected;continue}const n=i;n.formResetCallback?.(),"value"in s&&(n.value=s.value),"checked"in s&&(n.checked=s.checked),"selected"in s&&(n.selected=s.selected),n.requestUpdate?.()}this.__fire("reset")},this.__onSubmit=()=>{if(this.__submitting)return;const t=this.shadowRoot?.querySelector("form");if(t instanceof HTMLFormElement){if(!this.__validateFormAndSlottedFields(t))return;t.requestSubmit()}},this.__onFormSubmit=async t=>{const i=t.currentTarget;if(!(i instanceof HTMLFormElement)||(t.preventDefault(),t.stopPropagation(),this.__submitting)||!this.__validateFormAndSlottedFields(i))return;const s=this.__createFormData(i),n=this.__getFormMethod(),o=i.action;if(this.__fireCancelable("submit",{form:i,formData:s,method:n,action:o})){if(this.formAction.trim()&&(n==="PUT"||n==="DELETE")){const p=new AbortController;this.__submitAbortController=p,this.__submitting=!0,this.setAttribute("aria-busy","true");try{const u=await fetch(o,{method:n,body:s,credentials:"same-origin",signal:p.signal}),f={form:i,formData:s,method:n,action:o,response:u,status:u.status};if(!u.ok){this.__fire("submit-error",f);return}this.__fire("submit-success",f),this.open&&this.__setOpen(!1)}catch(u){u instanceof DOMException&&u.name==="AbortError"&&!this.isConnected||this.__fire("submit-error",{form:i,formData:s,method:n,action:o,error:u})}finally{this.__submitAbortController===p&&(this.__submitAbortController=void 0,this.__submitting=!1,this.removeAttribute("aria-busy"))}return}if(this.formAction.trim()){const p=f=>{this.__appendSlottedFiles(i,f.formData)},u=i.getAttribute("enctype");Array.from(s.values()).some(f=>f instanceof File)&&!this.formEnctype.trim()&&(i.enctype="multipart/form-data"),i.addEventListener("formdata",p,{once:!0});try{this.__setOpen(!1),HTMLFormElement.prototype.submit.call(i)}finally{i.removeEventListener("formdata",p),u===null?i.removeAttribute("enctype"):i.setAttribute("enctype",u)}return}this.__setOpen(!1)}},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab"||a.__getTopmostOpenDialog()&&a.__getTopmostOpenDialog()!==this)return;const i=this.__collectFocusableElements();if(!i.length)return;const s=i[0],n=i[i.length-1],o=this.__currentFocusableFromEvent(t,i);!o||!i.includes(o)?((t.shiftKey?n:s).focus(),t.preventDefault()):t.shiftKey&&o===s?(n.focus(),t.preventDefault()):!t.shiftKey&&o===n&&(s.focus(),t.preventDefault())}}__getActionFromEvent(e){if(!this.id)return null;for(const t of e.composedPath())if(t instanceof Element){if(t.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=t,"toggle";if(t.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=t,"toggle"}return null}__hasOpenNestedOverlay(e){const t="scb-options-menu, scb-dropdown, scb-select",i=s=>s instanceof Element&&s!==this&&s.matches(t)&&!!s.open;return e.composedPath().some(i)?!0:Array.from(this.querySelectorAll(t)).some(s=>!!s.open)}__isModalOverlay(){return!this.inSb&&!this.__usesInPlaceLayout()}static __getTopmostOpenDialog(){return[...a.__openDialogs].reverse().find(e=>e.open&&e.isConnected&&e.__isModalOverlay())}static __restoreBackgroundInert(){for(const[e,t]of a.__backgroundInertSnapshot)e.inert=t;a.__backgroundInertSnapshot.clear()}static __setBackgroundInert(e){if(a.__restoreBackgroundInert(),!e)return;let t=e;for(;;){const i=t.parentNode;if(i instanceof Element||i instanceof ShadowRoot)for(const s of Array.from(i.children))s===t||!(s instanceof HTMLElement)||(a.__backgroundInertSnapshot.set(s,s.inert),s.inert=!0);if(i instanceof ShadowRoot){t=i.host;continue}if(i instanceof Element){t=i;continue}break}}__getRequestedZIndex(){if(typeof this.zIndex=="number"&&Number.isFinite(this.zIndex))return Math.trunc(this.zIndex);const e=Number.parseInt(getComputedStyle(this).getPropertyValue("--scb-layer-dialog-scrim"),10);return Number.isFinite(e)?e:1e3}__setStackLayer(e){this.style.setProperty("--z-dialog-scrim",String(e)),this.style.setProperty("--z-dialog",String(e+1))}__setStackInactive(e){this.__stackInactive!==e&&(this.__stackInactive=e,this.requestUpdate())}static __syncModalStack(){a.__openDialogs=a.__openDialogs.filter(s=>s.open&&s.isConnected&&s.__isModalOverlay());const e=a.__getTopmostOpenDialog(),t=a.__openDialogs.map(s=>s.__getRequestedZIndex()),i=t.length?Math.max(...t):1e3;a.__openDialogs.forEach((s,n)=>{s.__setStackInactive(s!==e),s.__setStackLayer(i+n*2)}),a.__setBackgroundInert(e)}__registerOpenDialog(){this.__isModalOverlay()&&(a.__openDialogs=a.__openDialogs.filter(e=>e!==this),a.__openDialogs.push(this),a.__syncModalStack())}__unregisterOpenDialog(){const e=[...a.__openDialogs].reverse().find(t=>t===this||t.open&&t.isConnected)===this;return a.__openDialogs=a.__openDialogs.filter(t=>t!==this),this.__setStackInactive(!1),a.__syncModalStack(),this.__applyZIndex(),e}__getDeepActiveElement(){let e=this.ownerDocument.activeElement;for(;e instanceof HTMLElement&&e.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e instanceof HTMLElement?e:null}__isInsideDialog(e){let t=e;for(;t;){if(t===this)return!0;t instanceof ShadowRoot?t=t.host:t=t.parentNode}return!1}__focusInitial(){if(!this.open||this.__stackInactive||a.__getTopmostOpenDialog()!==this)return;const e=this.__collectFocusableElements()[0];if(e){e.focus();return}this.shadowRoot?.querySelector(".container")?.focus()}__clearSavedFocus(){this.__lastTriggerEl=null,this.__focusBeforeOpen=null}async __restoreFocusAfterClose(){const e=this.__lastTriggerEl?.isConnected?this.__lastTriggerEl:this.__focusBeforeOpen?.isConnected?this.__focusBeforeOpen:null;this.__clearSavedFocus(),await Promise.resolve();const t=a.__getTopmostOpenDialog();if(t){await t.updateComplete,e&&t.__isInsideDialog(e)&&e.focus();const i=t.__getDeepActiveElement();(!i||!t.__isInsideDialog(i))&&t.__focusInitial();return}e?.focus()}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),document.addEventListener("focusin",this.__onDocumentFocusIn,!0),this.addEventListener("keydown",this.__onKeydownTrap),this.open&&this.hasUpdated&&(this.__focusBeforeOpen=this.__getDeepActiveElement(),this.__registerOpenDialog(),this.__toggleScrollLock(!0),this.__isModalOverlay()&&this.updateComplete.then(()=>this.__focusInitial()))}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),document.removeEventListener("focusin",this.__onDocumentFocusIn,!0),this.removeEventListener("keydown",this.__onKeydownTrap),this.__submitAbortController?.abort(),v(this.shadowRoot?.querySelector(".layer"));const e=this.__unregisterOpenDialog();this.__toggleScrollLock(!1),e?this.__restoreFocusAfterClose():this.__clearSavedFocus(),super.disconnectedCallback()}__applyZIndex(){const e=typeof this.zIndex=="number"&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(e===void 0){this.style.removeProperty("--z-dialog-scrim"),this.style.removeProperty("--z-dialog");return}this.style.setProperty("--z-dialog-scrim",String(e)),this.style.setProperty("--z-dialog",String(e+1))}__applyMaxSize(){const e=(this.maxW??"").trim(),t=(this.maxH??"").trim();e?(this.style.setProperty("--scb-dialog-max-w",e),this.style.setProperty("--scb-dialog-width",`min(${e}, 90vw)`)):(this.style.removeProperty("--scb-dialog-max-w"),this.style.removeProperty("--scb-dialog-width")),t?this.style.setProperty("--scb-dialog-max-h",t):this.style.removeProperty("--scb-dialog-max-h")}updated(e){if(e.has("zIndex")&&(this.open&&this.__isModalOverlay()?a.__syncModalStack():this.__applyZIndex()),(e.has("maxW")||e.has("maxH"))&&this.__applyMaxSize(),e.has("open")){const t=e.get("open");this.__updateTriggersExpanded(),this.open&&!t?(this.__focusBeforeOpen=this.__getDeepActiveElement(),this.__registerOpenDialog(),this.__isModalOverlay()&&this.updateComplete.then(()=>this.__focusInitial())):!this.open&&t&&(this.__unregisterOpenDialog()?this.__restoreFocusAfterClose():this.__clearSavedFocus()),this.__toggleScrollLock(this.open)}if(e.has("inSb")&&this.open&&(this.__unregisterOpenDialog(),this.__registerOpenDialog(),this.__toggleScrollLock(!1),this.__toggleScrollLock(!0)),e.has("open")||e.has("inSb")){const t=this.shadowRoot?.querySelector(".layer");if(this.open&&this.__isModalOverlay())F(t);else if(this.open||z(this),!this.open&&C(t)){const i=this.shadowRoot?.querySelector(".container");T(t,void 0,i??t??void 0)}else v(t)}(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(e=>{e.hasAttribute("aria-controls")&&e.setAttribute("aria-expanded",String(this.open))})}__usesInPlaceLayout(){const e=getComputedStyle(this);return e.getPropertyValue("--scb-dialog-scrim-position").trim()==="relative"||e.getPropertyValue("--scb-dialog-container-position").trim()==="absolute"}__toggleScrollLock(e){const t=document.documentElement,i=document.body;if(e){if(this.__scrollLocked||this.inSb||this.__usesInPlaceLayout())return;if(b.size===0){y=t.style.overflow,S=i.style.paddingRight;const s=window.innerWidth-t.clientWidth;if(t.style.overflow="hidden",s>0){const n=Number.parseFloat(getComputedStyle(i).paddingRight)||0;i.style.paddingRight=`${n+s}px`}}b.add(this),this.__scrollLocked=!0;return}this.__scrollLocked&&(b.delete(this),b.size===0&&(t.style.overflow=y,i.style.paddingRight=S),this.__scrollLocked=!1)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,s=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-dialog-spacing-block-start",t):this.style.removeProperty("--scb-dialog-spacing-block-start"),i?this.style.setProperty("--scb-dialog-spacing-block-end",i):this.style.removeProperty("--scb-dialog-spacing-block-end"),s?this.style.setProperty("--scb-dialog-spacing-inline-start",s):this.style.removeProperty("--scb-dialog-spacing-inline-start"),n?this.style.setProperty("--scb-dialog-spacing-inline-end",n):this.style.removeProperty("--scb-dialog-spacing-inline-end")}__setOpen(e){this.open=e,this.__fire(e?"open":"close")}__fire(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}__fireCancelable(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}__getFormMethod(){const e=String(this.formMethod||"GET").trim().toUpperCase();return e==="POST"||e==="PUT"||e==="DELETE"?e:"GET"}__getSlottedElements(){const e=this.shadowRoot?.querySelector("slot");if(!(e instanceof HTMLSlotElement))return[];const t=e.assignedElements({flatten:!0}),i=[];for(const s of t)i.push(s,...Array.from(s.querySelectorAll("*")));return i}__appendHiddenFormValue(e,t,i){const s=document.createElement("input");s.type="hidden",s.name=t,s.value=i,s.setAttribute("data-scb-dialog-generated","true"),e.append(s)}__clearGeneratedFormValues(e){e.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(t=>t.remove())}__syncSlottedFormValues(e){this.__clearGeneratedFormValues(e),this.__getSlottedElements().forEach(t=>{if(!(t instanceof HTMLElement))return;const i=(t.getAttribute("name")??"").trim();if(i&&!(t.disabled===!0||t.hasAttribute("disabled"))){if(t instanceof HTMLInputElement){if(t.form===e)return;const s=(t.type||"").toLowerCase();if(s==="file")return;if(s==="checkbox"||s==="radio"){t.checked&&this.__appendHiddenFormValue(e,i,t.value||"on");return}this.__appendHiddenFormValue(e,i,t.value??"");return}if(t instanceof HTMLTextAreaElement){if(t.form===e)return;this.__appendHiddenFormValue(e,i,t.value??"");return}if(t instanceof HTMLSelectElement){if(t.form===e)return;if(t.multiple){Array.from(t.selectedOptions).forEach(s=>{this.__appendHiddenFormValue(e,i,s.value)});return}this.__appendHiddenFormValue(e,i,t.value??"");return}switch(t.tagName){case"SCB-TEXTFIELD":if(String(t.type??"").toLowerCase()==="file")return;this.__appendHiddenFormValue(e,i,String(t.value??""));return;case"SCB-CHECKBOX":t.checked&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":t.checked&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-SWITCH":(t.selected||t.checked)&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-CHIP":t.selected&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;default:"value"in t&&this.__appendHiddenFormValue(e,i,String(t.value??""))}}})}__appendSlottedFiles(e,t){for(const i of this.__getSlottedElements()){if(!(i instanceof HTMLElement))continue;const s=(i.getAttribute("name")??"").trim();if(!(!s||i.disabled===!0||i.hasAttribute("disabled"))){if(i instanceof HTMLInputElement&&i.type==="file"){if(i.form===e)continue;for(const n of Array.from(i.files??[]))t.append(s,n);continue}if(i.tagName==="SCB-TEXTFIELD"&&String(i.type??"").toLowerCase()==="file"){const n=i.files;for(const o of Array.from(n??[]))t.append(s,o)}}}}__createFormData(e){this.__syncSlottedFormValues(e);const t=new FormData(e);return this.__appendSlottedFiles(e,t),t}__validateFormAndSlottedFields(e){const t=o=>o.disabled===!0||o.hasAttribute("disabled");let i=e.reportValidity(),s=null;const n=new Set;return this.__getSlottedElements().forEach(o=>{if(!(o instanceof HTMLElement)||n.has(o)||t(o))return;n.add(o);const p=o;if(o.tagName==="SCB-TEXTFIELD"&&p.error===!0){s||(s=o),i=!1;return}if(typeof p.reportValidity=="function"){const u=!!p.reportValidity();!u&&!s&&(s=o),i=i&&u}}),!i&&s&&s.focus(),i}__isFocusableElement(e){if(!(e instanceof HTMLElement)||!e.matches(a.__focusableSelector)||e.disabled||e.getAttribute("aria-hidden")==="true")return!1;const t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}__collectAssignedFocusableElements(e){const t=[];return this.__isFocusableElement(e)&&t.push(e),t.push(...Array.from(e.querySelectorAll(a.__focusableSelector)).filter(i=>this.__isFocusableElement(i))),t}__collectFocusableElements(){const e=this.shadowRoot;if(!e)return[];const t=[],i=new Set,s=o=>{i.has(o)||(i.add(o),t.push(o))},n=o=>{if(o instanceof HTMLSlotElement){o.assignedElements({flatten:!0}).flatMap(p=>this.__collectAssignedFocusableElements(p)).forEach(s);return}o instanceof HTMLElement&&this.__isFocusableElement(o)&&s(o),o.childNodes.forEach(n)};return e.childNodes.forEach(n),t}__currentFocusableFromEvent(e,t){const i=e.composedPath();return t.find(s=>i.includes(s))??(this.shadowRoot?.activeElement instanceof HTMLElement?this.shadowRoot.activeElement:null)??(document.activeElement instanceof HTMLElement?document.activeElement:null)}__slotIsEmpty(){const e=this.shadowRoot?.querySelector("slot");return e?e.assignedElements({flatten:!0}).length===0:!0}renderHeader(e){const t=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return d`
1
+ import{g,h as x,m as w,p as c,v as d,y as E}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/icon.js";import{t as _}from"../../vendor/component-size-token.js";import{t as l}from"../../vendor/decorate.js";import"../scb-button/scb-button.js";import"../scb-icon-button/scb-icon-button.js";import{a as T,i as z,n as C,r as F,t as v}from"../../vendor/manual-popover.js";import"../scb-textfield/scb-textfield.js";import"../scb-checkbox/scb-checkbox.js";import"../scb-radio-button/scb-radio-button.js";import"../scb-switch/scb-switch.js";import"../scb-chip/scb-chip.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,i,s){try{customElements.get(t)||e(t,i,s)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var m,a,k={fromAttribute(h){if(h===null)return!1;const e=h.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="no"}},b=new Set,y="",S="",r=(m=class extends x{constructor(...e){super(...e),this.open=!1,this.inSb=!1,this.scrimClose=!0,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.variant="basic",this.label="",this.icon="",this.supportingText="",this.okButton="OK",this.cancelButton="Avbryt",this.deleteButton="Delete",this.confirmButton="Ta bort",this.denyButton="Avbryt",this.resetButton="Återställ",this.submitButton="Spara",this.closeLabel="Stäng dialog",this.formId="",this.formAction="",this.formMethod="",this.formEnctype="",this.__lastTriggerEl=null,this.__focusBeforeOpen=null,this.__stackInactive=!1,this.__submitting=!1,this.__redirectingFocus=!1,this.__scrollLocked=!1,this.__initialControlStates=new Map,this.__onDocumentClick=t=>{this.__getActionFromEvent(t)==="toggle"&&(this.__setOpen(!this.open),t.stopPropagation())},this.__onDocumentKeydown=t=>{if(!this.open||t.key!=="Escape")return;const i=a.__getTopmostOpenDialog();i&&i!==this||this.__hasOpenNestedOverlay(t)||(t.preventDefault(),t.stopPropagation(),this.__fireCancelable("esc")&&this.__setOpen(!1))},this.__onDocumentFocusIn=t=>{this.__redirectingFocus||a.__getTopmostOpenDialog()!==this||t.composedPath().includes(this)||(this.__redirectingFocus=!0,queueMicrotask(()=>{this.__focusInitial(),this.__redirectingFocus=!1}))},this.__rememberInitialControlStates=()=>{for(const t of this.__getSlottedElements()){if(!(t instanceof HTMLElement)||this.__initialControlStates.has(t))continue;const i={},s=t;"value"in s&&(i.value=s.value),"checked"in s&&(i.checked=s.checked),"selected"in s&&(i.selected=s.selected),Object.keys(i).length>0&&this.__initialControlStates.set(t,i)}},this.__onScrimClick=()=>{this.scrimClose&&(this.__fire("scrim"),this.__setOpen(!1))},this.__onOk=()=>{this.__fire("ok"),this.__setOpen(!1)},this.__onCancel=()=>{this.__fire("cancel"),this.__setOpen(!1)},this.__onConfirm=()=>{this.__fire("confirm"),this.__setOpen(!1)},this.__onDeny=()=>{this.__fire("deny"),this.__setOpen(!1)},this.__onReset=()=>{const t=this.shadowRoot?.querySelector("form");t instanceof HTMLFormElement&&(this.__clearGeneratedFormValues(t),t.reset()),this.__rememberInitialControlStates();for(const[i,s]of this.__initialControlStates){if(!i.isConnected)continue;if(i instanceof HTMLInputElement){i.type==="file"?i.value="":i.value=i.defaultValue,i.checked=i.defaultChecked;continue}if(i instanceof HTMLTextAreaElement){i.value=i.defaultValue;continue}if(i instanceof HTMLSelectElement){for(const o of Array.from(i.options))o.selected=o.defaultSelected;continue}const n=i;n.formResetCallback?.(),"value"in s&&(n.value=s.value),"checked"in s&&(n.checked=s.checked),"selected"in s&&(n.selected=s.selected),n.requestUpdate?.()}this.__fire("reset")},this.__onSubmit=()=>{if(this.__submitting)return;const t=this.shadowRoot?.querySelector("form");if(t instanceof HTMLFormElement){if(!this.__validateFormAndSlottedFields(t))return;t.requestSubmit()}},this.__onFormSubmit=async t=>{const i=t.currentTarget;if(!(i instanceof HTMLFormElement)||(t.preventDefault(),t.stopPropagation(),this.__submitting)||!this.__validateFormAndSlottedFields(i))return;const s=this.__createFormData(i),n=this.__getFormMethod(),o=i.action;if(this.__fireCancelable("submit",{form:i,formData:s,method:n,action:o})){if(this.formAction.trim()&&(n==="PUT"||n==="DELETE")){const p=new AbortController;this.__submitAbortController=p,this.__submitting=!0,this.setAttribute("aria-busy","true");try{const u=await fetch(o,{method:n,body:s,credentials:"same-origin",signal:p.signal}),f={form:i,formData:s,method:n,action:o,response:u,status:u.status};if(!u.ok){this.__fire("submit-error",f);return}this.__fire("submit-success",f),this.open&&this.__setOpen(!1)}catch(u){u instanceof DOMException&&u.name==="AbortError"&&!this.isConnected||this.__fire("submit-error",{form:i,formData:s,method:n,action:o,error:u})}finally{this.__submitAbortController===p&&(this.__submitAbortController=void 0,this.__submitting=!1,this.removeAttribute("aria-busy"))}return}if(this.formAction.trim()){const p=f=>{this.__appendSlottedFiles(i,f.formData)},u=i.getAttribute("enctype");Array.from(s.values()).some(f=>f instanceof File)&&!this.formEnctype.trim()&&(i.enctype="multipart/form-data"),i.addEventListener("formdata",p,{once:!0});try{this.__setOpen(!1),HTMLFormElement.prototype.submit.call(i)}finally{i.removeEventListener("formdata",p),u===null?i.removeAttribute("enctype"):i.setAttribute("enctype",u)}return}this.__setOpen(!1)}},this.__onKeydownTrap=t=>{if(!this.open||t.key!=="Tab"||a.__getTopmostOpenDialog()&&a.__getTopmostOpenDialog()!==this)return;const i=this.__collectFocusableElements();if(!i.length)return;const s=i[0],n=i[i.length-1],o=this.__currentFocusableFromEvent(t,i);!o||!i.includes(o)?((t.shiftKey?n:s).focus(),t.preventDefault()):t.shiftKey&&o===s?(n.focus(),t.preventDefault()):!t.shiftKey&&o===n&&(s.focus(),t.preventDefault())}}__getActionFromEvent(e){if(!this.id)return null;for(const t of e.composedPath())if(t instanceof Element){if(t.getAttribute("data-dialog-toggle")===this.id)return this.__lastTriggerEl=t,"toggle";if(t.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=t,"toggle"}return null}__hasOpenNestedOverlay(e){const t="scb-options-menu, scb-dropdown, scb-select",i=s=>s instanceof Element&&s!==this&&s.matches(t)&&!!s.open;return e.composedPath().some(i)?!0:Array.from(this.querySelectorAll(t)).some(s=>!!s.open)}__isModalOverlay(){return!this.inSb&&!this.__usesInPlaceLayout()}static __getTopmostOpenDialog(){return[...a.__openDialogs].reverse().find(e=>e.open&&e.isConnected&&e.__isModalOverlay())}static __restoreBackgroundInert(){for(const[e,t]of a.__backgroundInertSnapshot)e.inert=t;a.__backgroundInertSnapshot.clear()}static __setBackgroundInert(e){if(a.__restoreBackgroundInert(),!e)return;let t=e;for(;;){const i=t.parentNode;if(i instanceof Element||i instanceof ShadowRoot)for(const s of Array.from(i.children))s===t||!(s instanceof HTMLElement)||(a.__backgroundInertSnapshot.set(s,s.inert),s.inert=!0);if(i instanceof ShadowRoot){t=i.host;continue}if(i instanceof Element){t=i;continue}break}}__getRequestedZIndex(){if(typeof this.zIndex=="number"&&Number.isFinite(this.zIndex))return Math.trunc(this.zIndex);const e=Number.parseInt(getComputedStyle(this).getPropertyValue("--scb-layer-dialog-scrim"),10);return Number.isFinite(e)?e:1e3}__setStackLayer(e){this.style.setProperty("--z-dialog-scrim",String(e)),this.style.setProperty("--z-dialog",String(e+1))}__setStackInactive(e){this.__stackInactive!==e&&(this.__stackInactive=e,this.requestUpdate())}static __syncModalStack(){a.__openDialogs=a.__openDialogs.filter(s=>s.open&&s.isConnected&&s.__isModalOverlay());const e=a.__getTopmostOpenDialog(),t=a.__openDialogs.map(s=>s.__getRequestedZIndex()),i=t.length?Math.max(...t):1e3;a.__openDialogs.forEach((s,n)=>{s.__setStackInactive(s!==e),s.__setStackLayer(i+n*2)}),a.__setBackgroundInert(e)}__registerOpenDialog(){this.__isModalOverlay()&&(a.__openDialogs=a.__openDialogs.filter(e=>e!==this),a.__openDialogs.push(this),a.__syncModalStack())}__unregisterOpenDialog(){const e=[...a.__openDialogs].reverse().find(t=>t===this||t.open&&t.isConnected)===this;return a.__openDialogs=a.__openDialogs.filter(t=>t!==this),this.__setStackInactive(!1),a.__syncModalStack(),this.__applyZIndex(),e}__getDeepActiveElement(){let e=this.ownerDocument.activeElement;for(;e instanceof HTMLElement&&e.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e instanceof HTMLElement?e:null}__isInsideDialog(e){let t=e;for(;t;){if(t===this)return!0;t instanceof ShadowRoot?t=t.host:t=t.parentNode}return!1}__focusInitial(){if(!this.open||this.__stackInactive||a.__getTopmostOpenDialog()!==this)return;const e=this.__collectFocusableElements()[0];if(e){e.focus();return}this.shadowRoot?.querySelector(".container")?.focus()}__clearSavedFocus(){this.__lastTriggerEl=null,this.__focusBeforeOpen=null}async __restoreFocusAfterClose(){const e=this.__lastTriggerEl?.isConnected?this.__lastTriggerEl:this.__focusBeforeOpen?.isConnected?this.__focusBeforeOpen:null;this.__clearSavedFocus(),await Promise.resolve();const t=a.__getTopmostOpenDialog();if(t){await t.updateComplete,e&&t.__isInsideDialog(e)&&e.focus();const i=t.__getDeepActiveElement();(!i||!t.__isInsideDialog(i))&&t.__focusInitial();return}e?.focus()}connectedCallback(){super.connectedCallback(),this.__applyZIndex(),this.__applyMaxSize(),document.addEventListener("click",this.__onDocumentClick,!1),document.addEventListener("keydown",this.__onDocumentKeydown,!0),document.addEventListener("focusin",this.__onDocumentFocusIn,!0),this.addEventListener("keydown",this.__onKeydownTrap),this.open&&this.hasUpdated&&(this.__focusBeforeOpen=this.__getDeepActiveElement(),this.__registerOpenDialog(),this.__toggleScrollLock(!0),this.__isModalOverlay()&&this.updateComplete.then(()=>this.__focusInitial()))}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),document.removeEventListener("focusin",this.__onDocumentFocusIn,!0),this.removeEventListener("keydown",this.__onKeydownTrap),this.__submitAbortController?.abort(),v(this.shadowRoot?.querySelector(".layer"));const e=this.__unregisterOpenDialog();this.__toggleScrollLock(!1),e?this.__restoreFocusAfterClose():this.__clearSavedFocus(),super.disconnectedCallback()}__applyZIndex(){const e=typeof this.zIndex=="number"&&Number.isFinite(this.zIndex)?this.zIndex:void 0;if(e===void 0){this.style.removeProperty("--z-dialog-scrim"),this.style.removeProperty("--z-dialog");return}this.style.setProperty("--z-dialog-scrim",String(e)),this.style.setProperty("--z-dialog",String(e+1))}__applyMaxSize(){const e=(this.maxW??"").trim(),t=(this.maxH??"").trim();e?(this.style.setProperty("--scb-dialog-max-w",e),this.style.setProperty("--scb-dialog-width",`min(${e}, 90vw)`)):(this.style.removeProperty("--scb-dialog-max-w"),this.style.removeProperty("--scb-dialog-width")),t?this.style.setProperty("--scb-dialog-max-h",t):this.style.removeProperty("--scb-dialog-max-h")}updated(e){if(e.has("zIndex")&&(this.open&&this.__isModalOverlay()?a.__syncModalStack():this.__applyZIndex()),(e.has("maxW")||e.has("maxH"))&&this.__applyMaxSize(),e.has("open")){const t=e.get("open");this.__updateTriggersExpanded(),this.open&&!t?(this.__focusBeforeOpen=this.__getDeepActiveElement(),this.__registerOpenDialog(),this.__isModalOverlay()&&this.updateComplete.then(()=>this.__focusInitial())):!this.open&&t&&(this.__unregisterOpenDialog()?this.__restoreFocusAfterClose():this.__clearSavedFocus()),this.__toggleScrollLock(this.open)}if(e.has("inSb")&&this.open&&(this.__unregisterOpenDialog(),this.__registerOpenDialog(),this.__toggleScrollLock(!1),this.__toggleScrollLock(!0)),e.has("open")||e.has("inSb")){const t=this.shadowRoot?.querySelector(".layer");if(this.open&&this.__isModalOverlay())T(t);else if(this.open||F(this),!this.open&&z(t)){const i=this.shadowRoot?.querySelector(".container");C(t,void 0,i??t??void 0)}else v(t)}(e.has("spacing")||e.has("spacingTop")||e.has("spacingBottom")||e.has("spacingLeft")||e.has("spacingRight"))&&this.__applySpacing()}__updateTriggersExpanded(){this.id&&document.querySelectorAll(`[aria-controls="${this.id}"], [data-dialog-toggle="${this.id}"]`).forEach(e=>{e.hasAttribute("aria-controls")&&e.setAttribute("aria-expanded",String(this.open))})}__usesInPlaceLayout(){const e=getComputedStyle(this);return e.getPropertyValue("--scb-dialog-scrim-position").trim()==="relative"||e.getPropertyValue("--scb-dialog-container-position").trim()==="absolute"}__toggleScrollLock(e){const t=document.documentElement,i=document.body;if(e){if(this.__scrollLocked||this.inSb||this.__usesInPlaceLayout())return;if(b.size===0){y=t.style.overflow,S=i.style.paddingRight;const s=window.innerWidth-t.clientWidth;if(t.style.overflow="hidden",s>0){const n=Number.parseFloat(getComputedStyle(i).paddingRight)||0;i.style.paddingRight=`${n+s}px`}}b.add(this),this.__scrollLocked=!0;return}this.__scrollLocked&&(b.delete(this),b.size===0&&(t.style.overflow=y,i.style.paddingRight=S),this.__scrollLocked=!1)}mapSpacingToken(e){if(!e)return;const t=String(e).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}__applySpacing(){const e=this.mapSpacingToken(this.spacing),t=this.mapSpacingToken(this.spacingTop)??e,i=this.mapSpacingToken(this.spacingBottom)??e,s=this.mapSpacingToken(this.spacingLeft),n=this.mapSpacingToken(this.spacingRight);t?this.style.setProperty("--scb-dialog-spacing-block-start",t):this.style.removeProperty("--scb-dialog-spacing-block-start"),i?this.style.setProperty("--scb-dialog-spacing-block-end",i):this.style.removeProperty("--scb-dialog-spacing-block-end"),s?this.style.setProperty("--scb-dialog-spacing-inline-start",s):this.style.removeProperty("--scb-dialog-spacing-inline-start"),n?this.style.setProperty("--scb-dialog-spacing-inline-end",n):this.style.removeProperty("--scb-dialog-spacing-inline-end")}__setOpen(e){this.open=e,this.__fire(e?"open":"close")}__fire(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}__fireCancelable(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}__getFormMethod(){const e=String(this.formMethod||"GET").trim().toUpperCase();return e==="POST"||e==="PUT"||e==="DELETE"?e:"GET"}__getSlottedElements(){const e=this.shadowRoot?.querySelector("slot");if(!(e instanceof HTMLSlotElement))return[];const t=e.assignedElements({flatten:!0}),i=[];for(const s of t)i.push(s,...Array.from(s.querySelectorAll("*")));return i}__appendHiddenFormValue(e,t,i){const s=document.createElement("input");s.type="hidden",s.name=t,s.value=i,s.setAttribute("data-scb-dialog-generated","true"),e.append(s)}__clearGeneratedFormValues(e){e.querySelectorAll('input[data-scb-dialog-generated="true"]').forEach(t=>t.remove())}__syncSlottedFormValues(e){this.__clearGeneratedFormValues(e),this.__getSlottedElements().forEach(t=>{if(!(t instanceof HTMLElement))return;const i=(t.getAttribute("name")??"").trim();if(i&&!(t.disabled===!0||t.hasAttribute("disabled"))){if(t instanceof HTMLInputElement){if(t.form===e)return;const s=(t.type||"").toLowerCase();if(s==="file")return;if(s==="checkbox"||s==="radio"){t.checked&&this.__appendHiddenFormValue(e,i,t.value||"on");return}this.__appendHiddenFormValue(e,i,t.value??"");return}if(t instanceof HTMLTextAreaElement){if(t.form===e)return;this.__appendHiddenFormValue(e,i,t.value??"");return}if(t instanceof HTMLSelectElement){if(t.form===e)return;if(t.multiple){Array.from(t.selectedOptions).forEach(s=>{this.__appendHiddenFormValue(e,i,s.value)});return}this.__appendHiddenFormValue(e,i,t.value??"");return}switch(t.tagName){case"SCB-TEXTFIELD":if(String(t.type??"").toLowerCase()==="file")return;this.__appendHiddenFormValue(e,i,String(t.value??""));return;case"SCB-CHECKBOX":t.checked&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-RADIO-BUTTON":t.checked&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-SWITCH":(t.selected||t.checked)&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;case"SCB-CHIP":t.selected&&this.__appendHiddenFormValue(e,i,String(t.value??t.getAttribute("value")??"on"));return;default:"value"in t&&this.__appendHiddenFormValue(e,i,String(t.value??""))}}})}__appendSlottedFiles(e,t){for(const i of this.__getSlottedElements()){if(!(i instanceof HTMLElement))continue;const s=(i.getAttribute("name")??"").trim();if(!(!s||i.disabled===!0||i.hasAttribute("disabled"))){if(i instanceof HTMLInputElement&&i.type==="file"){if(i.form===e)continue;for(const n of Array.from(i.files??[]))t.append(s,n);continue}if(i.tagName==="SCB-TEXTFIELD"&&String(i.type??"").toLowerCase()==="file"){const n=i.files;for(const o of Array.from(n??[]))t.append(s,o)}}}}__createFormData(e){this.__syncSlottedFormValues(e);const t=new FormData(e);return this.__appendSlottedFiles(e,t),t}__validateFormAndSlottedFields(e){const t=o=>o.disabled===!0||o.hasAttribute("disabled");let i=e.reportValidity(),s=null;const n=new Set;return this.__getSlottedElements().forEach(o=>{if(!(o instanceof HTMLElement)||n.has(o)||t(o))return;n.add(o);const p=o;if(o.tagName==="SCB-TEXTFIELD"&&p.error===!0){s||(s=o),i=!1;return}if(typeof p.reportValidity=="function"){const u=!!p.reportValidity();!u&&!s&&(s=o),i=i&&u}}),!i&&s&&s.focus(),i}__isFocusableElement(e){if(!(e instanceof HTMLElement)||!e.matches(a.__focusableSelector)||e.disabled||e.getAttribute("aria-hidden")==="true")return!1;const t=getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}__collectAssignedFocusableElements(e){const t=[];return this.__isFocusableElement(e)&&t.push(e),t.push(...Array.from(e.querySelectorAll(a.__focusableSelector)).filter(i=>this.__isFocusableElement(i))),t}__collectFocusableElements(){const e=this.shadowRoot;if(!e)return[];const t=[],i=new Set,s=o=>{i.has(o)||(i.add(o),t.push(o))},n=o=>{if(o instanceof HTMLSlotElement){o.assignedElements({flatten:!0}).flatMap(p=>this.__collectAssignedFocusableElements(p)).forEach(s);return}o instanceof HTMLElement&&this.__isFocusableElement(o)&&s(o),o.childNodes.forEach(n)};return e.childNodes.forEach(n),t}__currentFocusableFromEvent(e,t){const i=e.composedPath();return t.find(s=>i.includes(s))??(this.shadowRoot?.activeElement instanceof HTMLElement?this.shadowRoot.activeElement:null)??(document.activeElement instanceof HTMLElement?document.activeElement:null)}__slotIsEmpty(){const e=this.shadowRoot?.querySelector("slot");return e?e.assignedElements({flatten:!0}).length===0:!0}renderHeader(e){const t=this.variant==="form"||this.variant==="floating"||this.variant==="iframe";return d`
2
2
  <div class="header">
3
3
  <div class="title">
4
4
  ${this.icon?d`<md-icon class="dialog-icon">${this.icon}</md-icon>`:g}
@@ -1,4 +1,4 @@
1
- import{g as f,h as y,m as b,p as c,v as m,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as l}from"../../vendor/decorate.js";import{closeManualPopover as h,closeManualPopoverAfterAnimations as v,closeNestedPopupSurfaces as w,isManualPopoverOpen as E,openManualPopover as p}from"../shared/manual-popover.js";import"../scb-divider/scb-divider.js";(function(){try{var _=typeof globalThis<"u"?globalThis:window;if(!_.__scb_ce_guard_installed__){_.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,r,s){try{customElements.get(t)||e(t,r,s)}catch(a){var u=String(a||"");if(u.indexOf("already been used")===-1&&u.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var n,o,d={fromAttribute(_){if(_===null)return!1;const e=_.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="no"}},i=(n=class extends y{constructor(...e){super(...e),this.floating=!0,this.left=!0,this.right=!1,this.open=!1,this.overlay=!1,this.lockScroll=!1,this.closeOnOverlay=!0,this.modal=!1,this.ariaLabel="Sidopanel",this.__effectiveSide="left",this.__lastTriggerEl=null,this.__scrollLockHeld=!1,this.__lastTriggerWasAriaControls=!1,this.__onDocumentClick=t=>{const r=this.__getActionFromEvent(t);if(r){r==="open"&&this.__setOpen(!0),r==="close"&&this.__setOpen(!1),r==="toggle"&&this.__setOpen(!this.open),t.stopPropagation();return}this.floating&&this.open&&!this.overlay&&(t.composedPath().includes(this)||this.__setOpen(!1))},this.__onDocumentKeydown=t=>{if(this.open){if(t.key==="Escape"){if(this.__hasOpenNestedOverlay(t))return;t.preventDefault(),t.stopPropagation(),this.__setOpen(!1);return}if(this.overlay&&t.key==="Tab"){const r=this.__getFocusable();if(r.length===0)return;const s=r[0],u=r[r.length-1],a=this.__currentFocusableFromEvent(t,r);t.shiftKey?(a===s||!a)&&(t.preventDefault(),u.focus()):(a===u||!a)&&(t.preventDefault(),s.focus())}}}}static __ensureOverlayStyles(){if(typeof document>"u"||document.getElementById("scb-drawer-overlay-styles"))return;const e=document.createElement("style");e.id="scb-drawer-overlay-styles",e.textContent=`
1
+ import{g as f,h as y,m as b,p as c,v as m,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as l}from"../../vendor/decorate.js";import{a as h,i as w,n as v,r as E,t as p}from"../../vendor/manual-popover.js";import"../scb-divider/scb-divider.js";(function(){try{var _=typeof globalThis<"u"?globalThis:window;if(!_.__scb_ce_guard_installed__){_.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(t,r,s){try{customElements.get(t)||e(t,r,s)}catch(a){var u=String(a||"");if(u.indexOf("already been used")===-1&&u.indexOf("NotSupportedError")===-1)throw a}}}}catch{}})();var n,o,d={fromAttribute(_){if(_===null)return!1;const e=_.trim().toLowerCase();return e!=="false"&&e!=="0"&&e!=="no"}},i=(n=class extends y{constructor(...e){super(...e),this.floating=!0,this.left=!0,this.right=!1,this.open=!1,this.overlay=!1,this.lockScroll=!1,this.closeOnOverlay=!0,this.modal=!1,this.ariaLabel="Sidopanel",this.__effectiveSide="left",this.__lastTriggerEl=null,this.__scrollLockHeld=!1,this.__lastTriggerWasAriaControls=!1,this.__onDocumentClick=t=>{const r=this.__getActionFromEvent(t);if(r){r==="open"&&this.__setOpen(!0),r==="close"&&this.__setOpen(!1),r==="toggle"&&this.__setOpen(!this.open),t.stopPropagation();return}this.floating&&this.open&&!this.overlay&&(t.composedPath().includes(this)||this.__setOpen(!1))},this.__onDocumentKeydown=t=>{if(this.open){if(t.key==="Escape"){if(this.__hasOpenNestedOverlay(t))return;t.preventDefault(),t.stopPropagation(),this.__setOpen(!1);return}if(this.overlay&&t.key==="Tab"){const r=this.__getFocusable();if(r.length===0)return;const s=r[0],u=r[r.length-1],a=this.__currentFocusableFromEvent(t,r);t.shiftKey?(a===s||!a)&&(t.preventDefault(),u.focus()):(a===u||!a)&&(t.preventDefault(),s.focus())}}}}static __ensureOverlayStyles(){if(typeof document>"u"||document.getElementById("scb-drawer-overlay-styles"))return;const e=document.createElement("style");e.id="scb-drawer-overlay-styles",e.textContent=`
2
2
  .scb-drawer-global-overlay {
3
3
  position: fixed;
4
4
  inset: 0;
@@ -27,7 +27,7 @@ import{g as f,h as y,m as b,p as c,v as m,y as g}from"../../vendor/vendor.js";im
27
27
  @media (prefers-reduced-motion: reduce) {
28
28
  .scb-drawer-global-overlay { transition: none; }
29
29
  }
30
- `,document.head.appendChild(e)}static __ensureOverlay(){if(typeof document>"u"||o.__overlayEl)return;o.__ensureOverlayStyles();const e=document.createElement("div");e.className="scb-drawer-global-overlay",e.addEventListener("pointerdown",()=>{const t=o.__overlayStack[o.__overlayStack.length-1];t&&t.closeOnOverlay&&t.__setOpen(!1)},{passive:!0}),document.body.appendChild(e),o.__overlayEl=e}static __showOverlay(e){o.__ensureOverlay(),o.__overlayEl&&(o.__overlayStack.includes(e)||o.__overlayStack.push(e),o.__syncOverlayColors(e),p(o.__overlayEl),o.__overlayEl.classList.add("is-visible"))}static __hideOverlay(e){const t=o.__overlayStack.indexOf(e);t>=0&&o.__overlayStack.splice(t,1);const r=o.__overlayStack[o.__overlayStack.length-1];r&&o.__syncOverlayColors(r),o.__overlayStack.length===0&&o.__overlayEl&&(o.__overlayEl.classList.remove("is-visible"),v(o.__overlayEl),o.__overlayEl.style.removeProperty("--scb-drawer-overlay-color"),o.__overlayEl.style.removeProperty("--scb-drawer-scrim-color"))}static __syncOverlayColors(e){if(!o.__overlayEl||typeof getComputedStyle!="function")return;const t=getComputedStyle(e);for(const r of["--scb-drawer-overlay-color","--scb-drawer-scrim-color"]){const s=t.getPropertyValue(r).trim();s?o.__overlayEl.style.setProperty(r,s):o.__overlayEl.style.removeProperty(r)}}static __lockScrollEnable(){if(!(typeof document>"u")){if(o.__lockedCount===0){o.__prevDocOverflow=document.documentElement.style.overflow||"",o.__prevBodyOverflow=document.body.style.overflow||"",o.__prevBodyPaddingRight=document.body.style.paddingRight||"";const e=Math.max(0,window.innerWidth-document.documentElement.clientWidth);if(e>0){const t=Number.parseFloat(getComputedStyle(document.body).paddingRight||"0");document.body.style.paddingRight=`${t+e}px`}document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden"}o.__lockedCount++}}static __lockScrollDisable(){typeof document>"u"||(o.__lockedCount=Math.max(0,o.__lockedCount-1),o.__lockedCount===0&&(document.documentElement.style.overflow=o.__prevDocOverflow??"",document.body.style.overflow=o.__prevBodyOverflow??"",document.body.style.paddingRight=o.__prevBodyPaddingRight??""))}render(){const e=this.modal&&this.overlay&&this.floating;return m`
30
+ `,document.head.appendChild(e)}static __ensureOverlay(){if(typeof document>"u"||o.__overlayEl)return;o.__ensureOverlayStyles();const e=document.createElement("div");e.className="scb-drawer-global-overlay",e.addEventListener("pointerdown",()=>{const t=o.__overlayStack[o.__overlayStack.length-1];t&&t.closeOnOverlay&&t.__setOpen(!1)},{passive:!0}),document.body.appendChild(e),o.__overlayEl=e}static __showOverlay(e){o.__ensureOverlay(),o.__overlayEl&&(o.__overlayStack.includes(e)||o.__overlayStack.push(e),o.__syncOverlayColors(e),h(o.__overlayEl),o.__overlayEl.classList.add("is-visible"))}static __hideOverlay(e){const t=o.__overlayStack.indexOf(e);t>=0&&o.__overlayStack.splice(t,1);const r=o.__overlayStack[o.__overlayStack.length-1];r&&o.__syncOverlayColors(r),o.__overlayStack.length===0&&o.__overlayEl&&(o.__overlayEl.classList.remove("is-visible"),v(o.__overlayEl),o.__overlayEl.style.removeProperty("--scb-drawer-overlay-color"),o.__overlayEl.style.removeProperty("--scb-drawer-scrim-color"))}static __syncOverlayColors(e){if(!o.__overlayEl||typeof getComputedStyle!="function")return;const t=getComputedStyle(e);for(const r of["--scb-drawer-overlay-color","--scb-drawer-scrim-color"]){const s=t.getPropertyValue(r).trim();s?o.__overlayEl.style.setProperty(r,s):o.__overlayEl.style.removeProperty(r)}}static __lockScrollEnable(){if(!(typeof document>"u")){if(o.__lockedCount===0){o.__prevDocOverflow=document.documentElement.style.overflow||"",o.__prevBodyOverflow=document.body.style.overflow||"",o.__prevBodyPaddingRight=document.body.style.paddingRight||"";const e=Math.max(0,window.innerWidth-document.documentElement.clientWidth);if(e>0){const t=Number.parseFloat(getComputedStyle(document.body).paddingRight||"0");document.body.style.paddingRight=`${t+e}px`}document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden"}o.__lockedCount++}}static __lockScrollDisable(){typeof document>"u"||(o.__lockedCount=Math.max(0,o.__lockedCount-1),o.__lockedCount===0&&(document.documentElement.style.overflow=o.__prevDocOverflow??"",document.body.style.overflow=o.__prevBodyOverflow??"",document.body.style.paddingRight=o.__prevBodyPaddingRight??""))}render(){const e=this.modal&&this.overlay&&this.floating;return m`
31
31
  <div
32
32
  class="root"
33
33
  role=${e?"dialog":f}
@@ -36,6 +36,6 @@ import{g as f,h as y,m as b,p as c,v as m,y as g}from"../../vendor/vendor.js";im
36
36
  >
37
37
  <div class="panel"><slot></slot></div>
38
38
  </div>
39
- `}connectedCallback(){super.connectedCallback(),this.__syncEffectiveSide(new Map),document.addEventListener("click",this.__onDocumentClick,!1)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.overlay&&(o.__hideOverlay(this),this.__releaseScrollLock()),h(this),super.disconnectedCallback()}__getActionFromEvent(e){if(!this.id)return null;const t=e.composedPath();for(const r of t)if(r instanceof Element){if(r.getAttribute("data-drawer-open")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"open";if(r.getAttribute("data-drawer-close")===this.id)return this.contains(r)||(this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1),"close";if(r.getAttribute("data-drawer-toggle")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"toggle";if(r.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!0,"toggle"}return null}__hasOpenNestedOverlay(e){const t="scb-options-menu, scb-dropdown, scb-select",r=s=>s instanceof Element&&s!==this&&s.matches(t)&&!!s.open;return e.composedPath().some(r)?!0:Array.from(this.querySelectorAll(t)).some(s=>!!s.open)}__getFocusable(){const e=["button","[href]","input","select","textarea",'[tabindex]:not([tabindex="-1"])',"scb-button","scb-icon-button","scb-textfield","scb-checkbox","scb-radio-button","scb-switch","scb-chip","scb-menu-item"].join(", "),t=new Set,r=s=>{s.querySelectorAll(e).forEach(u=>{const a=this.__resolveFocusable(u);a&&t.add(a)})};return r(this),r(this.renderRoot),Array.from(t).filter(s=>!this.__isDisabledOrHidden(s))}__resolveFocusable(e){return this.__isDisabledOrHidden(e)?null:e.tagName==="SCB-BUTTON"||e.tagName==="SCB-ICON-BUTTON"?e.shadowRoot?.querySelector(".native-button, button, a")??e:e.tagName==="SCB-MENU-ITEM"?e.shadowRoot?.querySelector(".scb-menu-label-text")??e:e}__isDisabledOrHidden(e){if(e.disabled||e.getAttribute("aria-hidden")==="true")return!0;const t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}__currentFocusableFromEvent(e,t){const r=e.composedPath();return t.find(s=>r.includes(s))??(this.shadowRoot?.activeElement instanceof HTMLElement?this.shadowRoot.activeElement:null)??(document.activeElement instanceof HTMLElement?document.activeElement:null)}__setOpen(e){this.open=e}async __focusFirstControl(){await this.updateComplete;for(let e=0;e<4;e+=1){await new Promise(r=>requestAnimationFrame(()=>r()));const t=this.__getFocusable()[0];if(t?.focus?.({preventScroll:!0}),t&&this.__isFocused(t))return}}__isFocused(e){if(document.activeElement===e)return!0;const t=e.getRootNode();return t instanceof ShadowRoot&&t.activeElement===e}__syncLastTriggerExpanded(e){this.__lastTriggerEl&&this.__lastTriggerWasAriaControls&&this.__lastTriggerEl.getAttribute("aria-controls")===this.id&&this.__lastTriggerEl.setAttribute("aria-expanded",String(e))}__syncEffectiveSide(e){const t=this.left&&this.right;let r;t?e.has("left")&&this.left&&!e.has("right")?r="left":r="right":this.right?r="right":r="left",this.__effectiveSide!==r&&(this.__effectiveSide=r),this.getAttribute("data-side")!==r&&this.setAttribute("data-side",r)}willUpdate(e){this.__syncEffectiveSide(e)}updated(e){if(this.open&&this.floating&&this.overlay&&o.__syncOverlayColors(this),e.has("open")){const t=!!e.get("open");this.__applyOpenSideEffects(t,this.open)}(e.has("open")||e.has("floating"))&&(this.open&&this.floating?p(this):(this.open||w(this),!this.open&&(E(this)||this.__scrollLockHeld)?v(this,this.__scrollLockHeld?()=>this.__releaseScrollLock():void 0):h(this)))}__applyOpenSideEffects(e,t){if(t&&!e)this.__syncLastTriggerExpanded(!0),this.floating&&this.overlay&&(o.__showOverlay(this),this.lockScroll&&this.__acquireScrollLock()),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.__focusFirstControl(),this.dispatchEvent(new CustomEvent("scb-drawer-opened",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbdraweropened",{bubbles:!0,composed:!0}));else if(!t&&e){this.__syncLastTriggerExpanded(!1),this.floating&&this.overlay&&o.__hideOverlay(this),document.removeEventListener("keydown",this.__onDocumentKeydown,!0);const r=this.__lastTriggerEl;requestAnimationFrame(()=>{this.open||r?.focus?.({preventScroll:!0})}),this.dispatchEvent(new CustomEvent("scb-drawer-closed",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbdrawerclosed",{bubbles:!0,composed:!0}))}}__acquireScrollLock(){this.__scrollLockHeld||(o.__lockScrollEnable(),this.__scrollLockHeld=!0)}__releaseScrollLock(){this.__scrollLockHeld&&(this.__scrollLockHeld=!1,o.__lockScrollDisable())}},o=n,n.__overlayEl=null,n.__overlayStack=[],n.__lockedCount=0,n.__prevDocOverflow=null,n.__prevBodyOverflow=null,n.__prevBodyPaddingRight=null,n.styles=g`:host{display:block;color:var(--scb-drawer-content-color, var(--md-sys-color-on-surface));padding:var(--scb-drawer-design-surface-padding-medium);background:var(--scb-drawer-background,
39
+ `}connectedCallback(){super.connectedCallback(),this.__syncEffectiveSide(new Map),document.addEventListener("click",this.__onDocumentClick,!1)}disconnectedCallback(){document.removeEventListener("click",this.__onDocumentClick,!1),document.removeEventListener("keydown",this.__onDocumentKeydown,!0),this.overlay&&(o.__hideOverlay(this),this.__releaseScrollLock()),p(this),super.disconnectedCallback()}__getActionFromEvent(e){if(!this.id)return null;const t=e.composedPath();for(const r of t)if(r instanceof Element){if(r.getAttribute("data-drawer-open")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"open";if(r.getAttribute("data-drawer-close")===this.id)return this.contains(r)||(this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1),"close";if(r.getAttribute("data-drawer-toggle")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!1,"toggle";if(r.getAttribute("aria-controls")===this.id)return this.__lastTriggerEl=r,this.__lastTriggerWasAriaControls=!0,"toggle"}return null}__hasOpenNestedOverlay(e){const t="scb-options-menu, scb-dropdown, scb-select",r=s=>s instanceof Element&&s!==this&&s.matches(t)&&!!s.open;return e.composedPath().some(r)?!0:Array.from(this.querySelectorAll(t)).some(s=>!!s.open)}__getFocusable(){const e=["button","[href]","input","select","textarea",'[tabindex]:not([tabindex="-1"])',"scb-button","scb-icon-button","scb-textfield","scb-checkbox","scb-radio-button","scb-switch","scb-chip","scb-menu-item"].join(", "),t=new Set,r=s=>{s.querySelectorAll(e).forEach(u=>{const a=this.__resolveFocusable(u);a&&t.add(a)})};return r(this),r(this.renderRoot),Array.from(t).filter(s=>!this.__isDisabledOrHidden(s))}__resolveFocusable(e){return this.__isDisabledOrHidden(e)?null:e.tagName==="SCB-BUTTON"||e.tagName==="SCB-ICON-BUTTON"?e.shadowRoot?.querySelector(".native-button, button, a")??e:e.tagName==="SCB-MENU-ITEM"?e.shadowRoot?.querySelector(".scb-menu-label-text")??e:e}__isDisabledOrHidden(e){if(e.disabled||e.getAttribute("aria-hidden")==="true")return!0;const t=getComputedStyle(e);return t.display==="none"||t.visibility==="hidden"}__currentFocusableFromEvent(e,t){const r=e.composedPath();return t.find(s=>r.includes(s))??(this.shadowRoot?.activeElement instanceof HTMLElement?this.shadowRoot.activeElement:null)??(document.activeElement instanceof HTMLElement?document.activeElement:null)}__setOpen(e){this.open=e}async __focusFirstControl(){await this.updateComplete;for(let e=0;e<4;e+=1){await new Promise(r=>requestAnimationFrame(()=>r()));const t=this.__getFocusable()[0];if(t?.focus?.({preventScroll:!0}),t&&this.__isFocused(t))return}}__isFocused(e){if(document.activeElement===e)return!0;const t=e.getRootNode();return t instanceof ShadowRoot&&t.activeElement===e}__syncLastTriggerExpanded(e){this.__lastTriggerEl&&this.__lastTriggerWasAriaControls&&this.__lastTriggerEl.getAttribute("aria-controls")===this.id&&this.__lastTriggerEl.setAttribute("aria-expanded",String(e))}__syncEffectiveSide(e){const t=this.left&&this.right;let r;t?e.has("left")&&this.left&&!e.has("right")?r="left":r="right":this.right?r="right":r="left",this.__effectiveSide!==r&&(this.__effectiveSide=r),this.getAttribute("data-side")!==r&&this.setAttribute("data-side",r)}willUpdate(e){this.__syncEffectiveSide(e)}updated(e){if(this.open&&this.floating&&this.overlay&&o.__syncOverlayColors(this),e.has("open")){const t=!!e.get("open");this.__applyOpenSideEffects(t,this.open)}(e.has("open")||e.has("floating"))&&(this.open&&this.floating?h(this):(this.open||E(this),!this.open&&(w(this)||this.__scrollLockHeld)?v(this,this.__scrollLockHeld?()=>this.__releaseScrollLock():void 0):p(this)))}__applyOpenSideEffects(e,t){if(t&&!e)this.__syncLastTriggerExpanded(!0),this.floating&&this.overlay&&(o.__showOverlay(this),this.lockScroll&&this.__acquireScrollLock()),document.addEventListener("keydown",this.__onDocumentKeydown,!0),this.__focusFirstControl(),this.dispatchEvent(new CustomEvent("scb-drawer-opened",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbdraweropened",{bubbles:!0,composed:!0}));else if(!t&&e){this.__syncLastTriggerExpanded(!1),this.floating&&this.overlay&&o.__hideOverlay(this),document.removeEventListener("keydown",this.__onDocumentKeydown,!0);const r=this.__lastTriggerEl;requestAnimationFrame(()=>{this.open||r?.focus?.({preventScroll:!0})}),this.dispatchEvent(new CustomEvent("scb-drawer-closed",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbdrawerclosed",{bubbles:!0,composed:!0}))}}__acquireScrollLock(){this.__scrollLockHeld||(o.__lockScrollEnable(),this.__scrollLockHeld=!0)}__releaseScrollLock(){this.__scrollLockHeld&&(this.__scrollLockHeld=!1,o.__lockScrollDisable())}},o=n,n.__overlayEl=null,n.__overlayStack=[],n.__lockedCount=0,n.__prevDocOverflow=null,n.__prevBodyOverflow=null,n.__prevBodyPaddingRight=null,n.styles=g`:host{display:block;color:var(--scb-drawer-content-color, var(--md-sys-color-on-surface));padding:var(--scb-drawer-design-surface-padding-medium);background:var(--scb-drawer-background,
40
40
  var(--md-sys-color-surface-container)
41
41
  );font-family:var(--brand-font)}:host([popover]){inset:auto;margin:0;border:0}:host([floating]){box-sizing:border-box;position:fixed;top:0;height:100vh;height:100dvh;width:clamp(var(--scb-drawer-min-width, 280px),var(--scb-drawer-fluid-width, 70vw),var(--scb-drawer-max-width, 360px));--scb-drawer-background:var(--scb-drawer-surface-color, var(--md-sys-color-surface-container-lowest));box-shadow:var(--scb-drawer-elevation, var(--scb-shadow-drawer-start));border-radius:var(--scb-drawer-design-surface-radius-medium);z-index:var(--scb-drawer-z, var(--scb-layer-drawer, 1000));transition:transform .3s ease,opacity .3s ease,visibility .3s;opacity:0;visibility:hidden;pointer-events:none;will-change:transform;font-family:var(--brand-font);overflow:hidden}@media (prefers-reduced-motion:reduce){:host([floating]){transition:none}}:host([floating][data-side="left"]){left:0;transform:translateX(-100%)}:host([floating][data-side="left"][open]){transform:translateX(0);opacity:1;visibility:visible;pointer-events:auto}:host([floating][data-side="right"]){right:0;transform:translateX(100%);box-shadow:var(--scb-drawer-elevation, var(--scb-shadow-drawer-end))}:host([floating][data-side="right"][open]){transform:translateX(0);opacity:1;visibility:visible;pointer-events:auto}::slotted(scb-menu){background:var(--scb-drawer-surface-color, var(--md-sys-color-surface-container-lowest));--scb-menu-background:var(--scb-drawer-surface-color, var(--md-sys-color-surface-container-lowest))}.root{height:100%;display:flex;flex-direction:column;min-height:0}.panel{contain:layout paint style;flex:1 1 auto;min-height:0;overflow:auto;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch}:host([floating]:not([open])) .panel{content-visibility:auto;contain-intrinsic-size:0 600px}@supports not (scrollbar-gutter:stable){.panel{overflow-y:scroll}}:host{--scb-drawer-design-surface-padding-medium:var(--scb-drawer-padding, var(--spacing-4, 12px));--scb-drawer-design-surface-radius-medium:var(--scb-drawer-surface-radius, var(--radius-none, 0px))}`,n);l([c({type:Boolean,reflect:!0,converter:d})],i.prototype,"floating",void 0);l([c({type:Boolean,reflect:!0,converter:d})],i.prototype,"left",void 0);l([c({type:Boolean,reflect:!0,converter:d})],i.prototype,"right",void 0);l([c({type:Boolean,reflect:!0,converter:d})],i.prototype,"open",void 0);l([c({type:Boolean,reflect:!0,converter:d})],i.prototype,"overlay",void 0);l([c({type:Boolean,reflect:!0,attribute:"lock-scroll",converter:d})],i.prototype,"lockScroll",void 0);l([c({type:Boolean,reflect:!0,attribute:"close-on-overlay",converter:d})],i.prototype,"closeOnOverlay",void 0);l([c({type:Boolean,reflect:!0,converter:d})],i.prototype,"modal",void 0);l([c({type:String,reflect:!0,attribute:"aria-label"})],i.prototype,"ariaLabel",void 0);i=o=l([b("scb-drawer")],i);export{i as ScbDrawer};