scb-wc 0.1.78 → 0.1.80

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 (180) hide show
  1. package/README.md +41 -22
  2. package/all.js +0 -2
  3. package/index.js +88 -90
  4. package/mvc/components/all.js +0 -2
  5. package/mvc/components/scb-accordion/scb-accordion-item.js +3 -173
  6. package/mvc/components/scb-accordion/scb-accordion.js +4 -33
  7. package/mvc/components/scb-app-bar/scb-app-bar.js +2 -110
  8. package/mvc/components/scb-avatar/scb-avatar.js +2 -94
  9. package/mvc/components/scb-badge/scb-badge.js +2 -72
  10. package/mvc/components/scb-breadcrumb/scb-breadcrumb-item.js +2 -12
  11. package/mvc/components/scb-breadcrumb/scb-breadcrumb.js +4 -91
  12. package/mvc/components/scb-button/scb-button.js +47 -309
  13. package/mvc/components/scb-calendar/scb-calendar-event.js +2 -6
  14. package/mvc/components/scb-calendar/scb-calendar.js +6 -120
  15. package/mvc/components/scb-calendar-card/scb-calendar-card.js +21 -350
  16. package/mvc/components/scb-card/scb-card.js +54 -819
  17. package/mvc/components/scb-checkbox/scb-checkbox-group.js +3 -31
  18. package/mvc/components/scb-checkbox/scb-checkbox.js +5 -127
  19. package/mvc/components/scb-chip/scb-chip.js +2 -76
  20. package/mvc/components/scb-collapse/scb-collapse.js +2 -44
  21. package/mvc/components/scb-cookies-consent/scb-cookies-consent.js +7 -73
  22. package/mvc/components/scb-dialog/scb-dialog.js +2 -213
  23. package/mvc/components/scb-divider/scb-divider.js +1 -69
  24. package/mvc/components/scb-drawer/scb-drawer.js +6 -102
  25. package/mvc/components/scb-drop-zone/scb-drop-zone.js +2 -410
  26. package/mvc/components/scb-dropdown/scb-dropdown.js +17 -222
  27. package/mvc/components/scb-fab/scb-fab.js +7 -95
  28. package/mvc/components/scb-fact-card/scb-fact-card-content.js +2 -69
  29. package/mvc/components/scb-fact-card/scb-fact-card.js +2 -214
  30. package/mvc/components/scb-footer/scb-footer-section.js +1 -3
  31. package/mvc/components/scb-footer/scb-footer.js +3 -172
  32. package/mvc/components/scb-gallery-grid/scb-gallery-grid.js +2 -112
  33. package/mvc/components/scb-grid/scb-grid-item.js +1 -32
  34. package/mvc/components/scb-grid/scb-grid.js +1 -99
  35. package/mvc/components/scb-grid/scb-stack.js +1 -33
  36. package/mvc/components/scb-header/scb-header-menu-item.js +1 -5
  37. package/mvc/components/scb-header/scb-header-tab.js +1 -5
  38. package/mvc/components/scb-header/scb-header.js +75 -888
  39. package/mvc/components/scb-horizontal-scroller/scb-horizontal-scroller.js +43 -168
  40. package/mvc/components/scb-icon-button/scb-icon-button.js +59 -171
  41. package/mvc/components/scb-keyfigure-card/scb-keyfigure-card.js +17 -218
  42. package/mvc/components/scb-link/scb-link.js +4 -55
  43. package/mvc/components/scb-list/scb-list-item.js +23 -126
  44. package/mvc/components/scb-list/scb-list.js +5 -26
  45. package/mvc/components/scb-menu/scb-menu-item.js +16 -190
  46. package/mvc/components/scb-menu/scb-menu-section.js +4 -36
  47. package/mvc/components/scb-menu/scb-menu.js +5 -69
  48. package/mvc/components/scb-menu/scb-sub-menu.js +2 -7
  49. package/mvc/components/scb-nav/scb-nav-item.js +1 -28
  50. package/mvc/components/scb-nav/scb-nav.js +5 -98
  51. package/mvc/components/scb-notification-card/scb-notification-card.js +7 -364
  52. package/mvc/components/scb-options-menu/scb-options-menu-item.js +3 -50
  53. package/mvc/components/scb-options-menu/scb-options-menu.js +2 -82
  54. package/mvc/components/scb-options-menu/scb-options-sub-menu.js +2 -31
  55. package/mvc/components/scb-overlay/scb-overlay.js +3 -43
  56. package/mvc/components/scb-pagination/scb-pagination.js +19 -221
  57. package/mvc/components/scb-progress-indicator/scb-progress-indicator.js +2 -67
  58. package/mvc/components/scb-progress-stepper/scb-progress-step.js +4 -121
  59. package/mvc/components/scb-progress-stepper/scb-progress-stepper.js +2 -56
  60. package/mvc/components/scb-radio-button/scb-radio-button.js +5 -116
  61. package/mvc/components/scb-radio-button/scb-radio-group.js +2 -32
  62. package/mvc/components/scb-scrollspy/scb-scrollspy.js +2 -61
  63. package/mvc/components/scb-search/scb-search.js +5 -249
  64. package/mvc/components/scb-segmented-button/scb-segmented-button.js +1 -32
  65. package/mvc/components/scb-segmented-button/scb-segmented-item.js +2 -70
  66. package/mvc/components/scb-select/scb-select-option.js +2 -54
  67. package/mvc/components/scb-select/scb-select.js +4 -244
  68. package/mvc/components/scb-skeleton/scb-skeleton.js +2 -35
  69. package/mvc/components/scb-slider/scb-slider.js +5 -9
  70. package/mvc/components/scb-snackbar/scb-snackbar.js +9 -84
  71. package/mvc/components/scb-status-pill/scb-status-pill.js +2 -43
  72. package/mvc/components/scb-stepper/scb-step.js +8 -186
  73. package/mvc/components/scb-stepper/scb-stepper.js +2 -130
  74. package/mvc/components/scb-switch/scb-switch.js +4 -49
  75. package/mvc/components/scb-table/scb-table.js +2 -48
  76. package/mvc/components/scb-table-advanced/scb-table-advanced.js +2 -53
  77. package/mvc/components/scb-tabs/scb-primary-tab.js +2 -7
  78. package/mvc/components/scb-tabs/scb-secondary-tab.js +2 -7
  79. package/mvc/components/scb-tabs/scb-tabs.js +4 -31
  80. package/mvc/components/scb-textfield/scb-textfield.js +142 -388
  81. package/mvc/components/scb-toc/scb-toc-item.js +3 -251
  82. package/mvc/components/scb-toc/scb-toc.js +2 -16
  83. package/mvc/components/scb-tooltip/scb-tooltip.js +8 -155
  84. package/mvc/components/scb-viz/scb-viz.js +4 -619
  85. package/mvc/scb-wc-core.css +1 -1
  86. package/mvc/scb-wc-selfhost.css +1 -1
  87. package/mvc/scb-wc.css +1 -1
  88. package/mvc/vendor/assist-chip.js +3 -3
  89. package/mvc/vendor/chip-set.js +1 -1
  90. package/mvc/vendor/chip.js +2 -2
  91. package/mvc/vendor/elevation.js +2 -2
  92. package/mvc/vendor/filter-chip.js +1 -1
  93. package/mvc/vendor/focusable.js +1 -1
  94. package/mvc/vendor/form-associated.js +1 -1
  95. package/mvc/vendor/icon.js +2 -2
  96. package/mvc/vendor/lazy-focus-ring.js +2 -0
  97. package/mvc/vendor/lazy-ripple.js +2 -0
  98. package/mvc/vendor/md-focus-ring.js +2 -2
  99. package/mvc/vendor/ripple.js +2 -2
  100. package/mvc/vendor/scb-card-variants.internal.js +284 -0
  101. package/mvc/vendor/scb-chevron.js +10 -0
  102. package/mvc/vendor/scb-header-drawer.internal.js +71 -0
  103. package/mvc/vendor/shared-styles.js +1 -1
  104. package/mvc/vendor/tab-styles.js +3 -3
  105. package/mvc/vendor/validator.js +1 -1
  106. package/mvc/vendor/vendor.js +3 -4
  107. package/package.json +2 -2
  108. package/scb-accordion/scb-accordion-item.js +33 -32
  109. package/scb-app-bar/scb-app-bar.js +1 -1
  110. package/scb-button/scb-button.js +287 -259
  111. package/scb-calendar/scb-calendar.js +49 -49
  112. package/scb-calendar-card/scb-calendar-card.js +105 -59
  113. package/scb-card/scb-card-variants.internal.js +230 -0
  114. package/scb-card/scb-card.js +387 -528
  115. package/scb-checkbox/scb-checkbox.js +0 -1
  116. package/scb-chevron/scb-chevron.js +0 -1
  117. package/scb-components/scb-button/scb-button.d.ts +14 -2
  118. package/scb-components/scb-calendar/scb-calendar.d.ts +1 -0
  119. package/scb-components/scb-calendar-card/scb-calendar-card.d.ts +16 -4
  120. package/scb-components/scb-card/scb-card-variants.internal.d.ts +15 -0
  121. package/scb-components/scb-card/scb-card.d.ts +26 -9
  122. package/scb-components/scb-cookies-consent/scb-cookies-consent.d.ts +3 -0
  123. package/scb-components/scb-header/scb-header-drawer.internal.d.ts +31 -0
  124. package/scb-components/scb-header/scb-header.d.ts +1 -2
  125. package/scb-components/scb-horizontal-scroller/scb-horizontal-scroller.d.ts +6 -1
  126. package/scb-components/scb-icon-button/scb-icon-button.d.ts +28 -29
  127. package/scb-components/scb-keyfigure-card/scb-keyfigure-card.d.ts +13 -4
  128. package/scb-components/scb-list/scb-list-item.d.ts +20 -2
  129. package/scb-components/scb-list/scb-list.d.ts +1 -2
  130. package/scb-components/scb-nav/scb-nav.d.ts +2 -0
  131. package/scb-components/scb-segmented-button/scb-segmented-item.d.ts +1 -0
  132. package/scb-components/scb-select/scb-select-option.d.ts +2 -0
  133. package/scb-components/scb-toc/scb-toc-item.d.ts +1 -0
  134. package/scb-components/scb-tooltip/scb-tooltip.d.ts +2 -0
  135. package/scb-cookies-consent/scb-cookies-consent.js +43 -31
  136. package/scb-datepicker/scb-datepicker.js +27 -25
  137. package/scb-dialog/scb-dialog.js +1 -1
  138. package/scb-dropdown/scb-dropdown.js +29 -28
  139. package/scb-header/scb-header-drawer.internal.js +78 -0
  140. package/scb-header/scb-header.js +41 -89
  141. package/scb-horizontal-scroller/scb-horizontal-scroller.js +181 -88
  142. package/scb-icon-button/scb-icon-button.js +293 -205
  143. package/scb-keyfigure-card/scb-keyfigure-card.js +96 -43
  144. package/scb-list/scb-list-item.js +117 -52
  145. package/scb-list/scb-list.js +9 -9
  146. package/scb-nav/scb-nav.js +26 -23
  147. package/scb-notification-card/scb-notification-card.js +0 -2
  148. package/scb-options-menu/scb-options-menu-item.js +20 -20
  149. package/scb-pagination/scb-pagination.js +0 -1
  150. package/scb-progress-stepper/scb-progress-step.js +19 -17
  151. package/scb-radio-button/scb-radio-button.js +0 -1
  152. package/scb-search/scb-search.js +29 -28
  153. package/scb-segmented-button/scb-segmented-item.js +22 -19
  154. package/scb-select/scb-select-option.js +20 -14
  155. package/scb-select/scb-select.js +26 -26
  156. package/scb-stepper/scb-step.js +34 -31
  157. package/scb-textfield/scb-textfield.js +39 -39
  158. package/scb-toc/scb-toc-item.js +26 -26
  159. package/scb-tooltip/scb-tooltip.js +5 -4
  160. package/scb-viz/scb-viz.js +1 -1
  161. package/scb-wc-core.css +1 -1
  162. package/scb-wc-public-entry/index.d.ts +97 -0
  163. package/scb-wc-selfhost.css +1 -1
  164. package/scb-wc.bundle.js +1873 -1476
  165. package/scb-wc.css +1 -1
  166. package/scb-wc.d.ts +194 -198
  167. package/mvc/components/scb-chevron/scb-chevron.js +0 -41
  168. package/mvc/components/scb-datepicker/scb-datepicker.js +0 -296
  169. package/mvc/vendor/element-internals.js +0 -1
  170. package/mvc/vendor/filled-icon-button.js +0 -2
  171. package/mvc/vendor/filled-tonal-icon-button.js +0 -2
  172. package/mvc/vendor/form-label-activation.js +0 -1
  173. package/mvc/vendor/form-submitter.js +0 -1
  174. package/mvc/vendor/icon-button.js +0 -2
  175. package/mvc/vendor/list.js +0 -8
  176. package/mvc/vendor/outlined-icon-button.js +0 -2
  177. package/mvc/vendor/shared-styles2.js +0 -30
  178. package/scb-components/index.d.ts +0 -99
  179. package/scb-components/scb-chevron/scb-chevron.d.ts +0 -11
  180. package/scb-components/scb-datepicker/scb-datepicker.d.ts +0 -39
@@ -1,62 +1,8 @@
1
- import{_ as d,b,g as m,h as p,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as i}from"../../vendor/decorate.js";import{ScbProgressStep as u}from"./scb-progress-step.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(s,n,a){try{customElements.get(s)||t(s,n,a)}catch(e){var o=String(e||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw e}}}}catch{}})();var c,r=(c=class extends d{constructor(...t){super(...t),this.progressWidth=23,this.height="normal",this.position="top",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}mapSpacingToken(t){if(!t)return;const s=String(t).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}applySpacing(){const t=this.mapSpacingToken(this.spacing),s=this.mapSpacingToken(this.spacingTop)??t,n=this.mapSpacingToken(this.spacingBottom)??t,a=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);s?this.style.setProperty("--scb-progress-stepper-spacing-block-start",s):this.style.removeProperty("--scb-progress-stepper-spacing-block-start"),n?this.style.setProperty("--scb-progress-stepper-spacing-block-end",n):this.style.removeProperty("--scb-progress-stepper-spacing-block-end"),a?this.style.setProperty("--scb-progress-stepper-spacing-inline-start",a):this.style.removeProperty("--scb-progress-stepper-spacing-inline-start"),o?this.style.setProperty("--scb-progress-stepper-spacing-inline-end",o):this.style.removeProperty("--scb-progress-stepper-spacing-inline-end")}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing();const s=this.shadowRoot?.querySelector("slot");if(!s)return;t.has("progressWidth")&&s.dispatchEvent(new Event("slotchange"));const n=s.assignedElements({flatten:!0}),a=this.progressWidth;let o=0;n.forEach((e,h)=>{if(e instanceof u){const l=typeof e.width=="string"?parseFloat(e.width.replace("%","")):Number(e.width);o+=l,this.position=="bottom"?e.setAttribute("position","bottom"):e.setAttribute("position","top"),o<=a+2?e.setAttribute("active","true"):e.removeAttribute("active"),h===n.length-1?e.classList.add("last-step"):e.classList.remove("last-step")}})}render(){return f`
1
+ import{h as d,m as b,p,v as m,y as f}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as i}from"../../vendor/decorate.js";import{ScbProgressStep as u}from"./scb-progress-step.js";(function(){try{var c=typeof globalThis<"u"?globalThis:window;if(!c.__scb_ce_guard_installed__){c.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(s,n,a){try{customElements.get(s)||t(s,n,a)}catch(e){var o=String(e||"");if(o.indexOf("already been used")===-1&&o.indexOf("NotSupportedError")===-1)throw e}}}}catch{}})();var g,r=(g=class extends d{constructor(...t){super(...t),this.progressWidth=23,this.height="normal",this.position="top",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}mapSpacingToken(t){if(!t)return;const s=String(t).trim();if(s)return/^\d+$/.test(s)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(s,10)))})`:s}applySpacing(){const t=this.mapSpacingToken(this.spacing),s=this.mapSpacingToken(this.spacingTop)??t,n=this.mapSpacingToken(this.spacingBottom)??t,a=this.mapSpacingToken(this.spacingLeft),o=this.mapSpacingToken(this.spacingRight);s?this.style.setProperty("--scb-progress-stepper-spacing-block-start",s):this.style.removeProperty("--scb-progress-stepper-spacing-block-start"),n?this.style.setProperty("--scb-progress-stepper-spacing-block-end",n):this.style.removeProperty("--scb-progress-stepper-spacing-block-end"),a?this.style.setProperty("--scb-progress-stepper-spacing-inline-start",a):this.style.removeProperty("--scb-progress-stepper-spacing-inline-start"),o?this.style.setProperty("--scb-progress-stepper-spacing-inline-end",o):this.style.removeProperty("--scb-progress-stepper-spacing-inline-end")}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing();const s=this.shadowRoot?.querySelector("slot");if(!s)return;t.has("progressWidth")&&s.dispatchEvent(new Event("slotchange"));const n=s.assignedElements({flatten:!0}),a=this.progressWidth;let o=0;n.forEach((e,h)=>{if(e instanceof u){const l=typeof e.width=="string"?parseFloat(e.width.replace("%","")):Number(e.width);o+=l,this.position=="bottom"?e.setAttribute("position","bottom"):e.setAttribute("position","top"),o<=a+2?e.setAttribute("active","true"):e.removeAttribute("active"),h===n.length-1?e.classList.add("last-step"):e.classList.remove("last-step")}})}render(){return m`
2
2
  <div class="progress-bar">
3
3
  <div class="progress-bar__fill" style="width: ${this.progressWidth}%;"></div>
4
4
  </div>
5
5
  <div class="progress-container">
6
6
  <slot></slot>
7
7
  </div>
8
- `}},c.styles=b`
9
- :host {
10
- display: block;
11
- width: 100%;
12
- font-family: var(--brand-font);
13
- position: absolute;
14
- top: 0;
15
- --progress-step-height: 8px;
16
-
17
- margin-block-start: var(--scb-progress-stepper-spacing-block-start, 0);
18
- margin-block-end: var(--scb-progress-stepper-spacing-block-end, 0);
19
- margin-inline-start: var(--scb-progress-stepper-spacing-inline-start, 0);
20
- margin-inline-end: var(--scb-progress-stepper-spacing-inline-end, 0);
21
- }
22
- :host([position="bottom"]) {
23
- top: auto;
24
- bottom: 0;
25
- }
26
-
27
- :host([height="normal"]) .progress-bar, :host([height="normal"]) .progress-container {
28
- height: var(--progress-step-height);
29
- }
30
- :host(:hover[height="normal"]) .progress-bar, :host(:hover[height="normal"]) .progress-container {
31
- --progress-step-height: 16px;
32
- height: var(--progress-step-height);
33
- }
34
- :host([height="high"]) .progress-bar, :host([height="high"]) .progress-container {
35
- --progress-step-height: 16px;
36
- height: var(--progress-step-height);
37
- }
38
- .progress-bar, .progress-container {
39
- transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
40
- }
41
- .progress-bar {
42
- width: 100%;
43
- background: var(--md-sys-color-secondary-container);
44
- overflow: hidden;
45
- position: absolute;
46
- }
47
- .progress-bar__fill {
48
- height: 100%;
49
- background: var(--md-sys-color-primary);
50
- transition: width 0.3s ease;
51
- position: absolute;
52
- z-index: 0;
53
- max-width: 100%;
54
- }
55
- .progress-container {
56
- display: flex;
57
- align-items: center;
58
- width: 100%;
59
- position: relative;
60
- gap: 0;
61
- }
62
- `,c);i([p({type:Number,reflect:!0,attribute:"progress-width"})],r.prototype,"progressWidth",void 0);i([p({type:String,reflect:!0})],r.prototype,"height",void 0);i([p({type:String,reflect:!0})],r.prototype,"position",void 0);i([p({type:String,reflect:!0})],r.prototype,"spacing",void 0);i([p({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",void 0);i([p({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",void 0);i([p({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",void 0);i([p({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",void 0);r=i([m("scb-progress-stepper")],r);
8
+ `}},g.styles=f`:host{display:block;width:100%;font-family:var(--brand-font);position:absolute;top:0;--progress-step-height:8px;margin-block-start:var(--scb-progress-stepper-spacing-block-start, 0);margin-block-end:var(--scb-progress-stepper-spacing-block-end, 0);margin-inline-start:var(--scb-progress-stepper-spacing-inline-start, 0);margin-inline-end:var(--scb-progress-stepper-spacing-inline-end, 0)}:host([position="bottom"]){top:auto;bottom:0}:host([height="normal"]) .progress-bar,:host([height="normal"]) .progress-container{height:var(--progress-step-height)}:host(:hover[height="normal"]) .progress-bar,:host(:hover[height="normal"]) .progress-container,:host([height="high"]) .progress-bar,:host([height="high"]) .progress-container{--progress-step-height:16px;height:var(--progress-step-height)}.progress-bar,.progress-container{transition:height .3s cubic-bezier(.4,0,.2,1)}.progress-bar{width:100%;background:var(--md-sys-color-secondary-container);overflow:hidden;position:absolute}.progress-bar__fill{height:100%;background:var(--md-sys-color-primary);transition:width .3s ease;position:absolute;z-index:0;max-width:100%}.progress-container{display:flex;align-items:center;width:100%;position:relative;gap:0}`,g);i([p({type:Number,reflect:!0,attribute:"progress-width"})],r.prototype,"progressWidth",void 0);i([p({type:String,reflect:!0})],r.prototype,"height",void 0);i([p({type:String,reflect:!0})],r.prototype,"position",void 0);i([p({type:String,reflect:!0})],r.prototype,"spacing",void 0);i([p({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",void 0);i([p({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",void 0);i([p({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",void 0);i([p({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",void 0);r=i([b("scb-progress-stepper")],r);
@@ -1,5 +1,5 @@
1
- import{_ as D,b as O,c as P,g as K,h as o,l as _,p as U,v as m,y as k}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/md-focus-ring.js";import"../../vendor/ripple.js";import{t as l}from"../../vendor/decorate.js";import{n as W,t as q}from"../../vendor/element-internals.js";import{n as G}from"../../vendor/form-label-activation.js";import{n as N,t as d}from"../../vendor/assertClassBrand.js";import{n as L,r as S,t as b}from"../../vendor/classPrivateFieldGet2.js";import{i as H,n as j,r as J,t as Q}from"../../vendor/validator.js";import{n as X,r as Y,t as Z}from"../../vendor/form-associated.js";import{t as ee}from"../../vendor/focusable.js";import"./scb-radio-group.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(t,s,r){try{customElements.get(t)||i(t,s,r)}catch(c){var h=String(c||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw c}}}}catch{}})();var te=class extends Q{computeValidity(e){this.radioElement||(this.radioElement=document.createElement("input"),this.radioElement.type="radio",this.radioElement.name="group");let i=!1,t=!1;for(const{checked:s,required:r}of e)r&&(i=!0),s&&(t=!0);return this.radioElement.checked=t,this.radioElement.required=i,{validity:{valueMissing:i&&!t},validationMessage:this.radioElement.validationMessage}}equals(e,i){if(e.length!==i.length)return!1;for(let t=0;t<e.length;t++){const s=e[t],r=i[t];if(s.checked!==r.checked||s.required!==r.required)return!1}return!0}copy(e){return e.map(({checked:i,required:t})=>({checked:i,required:t}))}},ie=class{get controls(){const e=this.host.getAttribute("name");return!e||!this.root||!this.host.isConnected?[this.host]:Array.from(this.root.querySelectorAll(`[name="${e}"]`))}constructor(e){this.host=e,this.focused=!1,this.root=null,this.handleFocusIn=()=>{this.focused=!0,this.updateTabIndices()},this.handleFocusOut=()=>{this.focused=!1,this.updateTabIndices()},this.handleKeyDown=i=>{const t=i.key==="ArrowDown",s=i.key==="ArrowUp",r=i.key==="ArrowLeft",h=i.key==="ArrowRight";if(!r&&!h&&!t&&!s)return;const c=this.controls;if(!c.length)return;i.preventDefault();const T=getComputedStyle(this.host).direction==="rtl"?r||t:h||t,I=c.indexOf(this.host);let u=T?I+1:I-1;for(;u!==I;){u>=c.length?u=0:u<0&&(u=c.length-1);const p=c[u];if(p.hasAttribute("disabled")){T?u++:u--;continue}for(const C of c)C!==p&&(C.checked=!1,C.tabIndex=-1,C.blur());p.checked=!0,p.tabIndex=0,p.focus(),p.dispatchEvent(new Event("change",{bubbles:!0}));break}}}hostConnected(){this.root=this.host.getRootNode(),this.host.addEventListener("keydown",this.handleKeyDown),this.host.addEventListener("focusin",this.handleFocusIn),this.host.addEventListener("focusout",this.handleFocusOut),this.host.checked&&this.uncheckSiblings(),this.updateTabIndices()}hostDisconnected(){this.host.removeEventListener("keydown",this.handleKeyDown),this.host.removeEventListener("focusin",this.handleFocusIn),this.host.removeEventListener("focusout",this.handleFocusOut),this.updateTabIndices(),this.root=null}handleCheckedChange(){this.host.checked&&(this.uncheckSiblings(),this.updateTabIndices())}uncheckSiblings(){for(const e of this.controls)e!==this.host&&(e.checked=!1)}updateTabIndices(){const e=this.controls,i=e.find(t=>t.checked);if(i||this.focused){const t=i||this.host;t.tabIndex=0;for(const s of e)s!==t&&(s.tabIndex=-1);return}for(const t of e)t.tabIndex=0}},V,$=Symbol("checked"),se=0,re=H(Y(W(ee(D)))),E=class extends re{get checked(){return this[$]}set checked(e){const i=this.checked;i!==e&&(this[$]=e,this.requestUpdate("checked",i),this.selectionController.handleCheckedChange())}constructor(){super(),this.maskId=`cutout${++se}`,this[V]=!1,this.required=!1,this.value="on",this.selectionController=new ie(this),this.addController(this.selectionController),this[q].role="radio",this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.handleKeydown.bind(this))}render(){return k`
2
- <div class="container ${P({checked:this.checked})}" aria-hidden="true">
1
+ import{d as P,g as m,h as D,m as O,o as U,p as o,s as _,v as k,y as K}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import"../../vendor/ripple.js";import{t as c}from"../../vendor/decorate.js";import{n as W,t as d}from"../../vendor/assertClassBrand.js";import{n as L,r as S,t as b}from"../../vendor/classPrivateFieldGet2.js";import"../../vendor/md-focus-ring.js";import{a as G,i as q,n as N,r as j,s as H,t as J}from"../../vendor/form-associated.js";import{i as Q,n as X,r as Y,t as Z}from"../../vendor/validator.js";import{t as ee}from"../../vendor/focusable.js";import"./scb-radio-group.js";(function(){try{var e=typeof globalThis<"u"?globalThis:window;if(!e.__scb_ce_guard_installed__){e.__scb_ce_guard_installed__=!0;var i=customElements.define.bind(customElements);customElements.define=function(t,s,r){try{customElements.get(t)||i(t,s,r)}catch(l){var h=String(l||"");if(h.indexOf("already been used")===-1&&h.indexOf("NotSupportedError")===-1)throw l}}}}catch{}})();var te=class extends Z{computeValidity(e){this.radioElement||(this.radioElement=document.createElement("input"),this.radioElement.type="radio",this.radioElement.name="group");let i=!1,t=!1;for(const{checked:s,required:r}of e)r&&(i=!0),s&&(t=!0);return this.radioElement.checked=t,this.radioElement.required=i,{validity:{valueMissing:i&&!t},validationMessage:this.radioElement.validationMessage}}equals(e,i){if(e.length!==i.length)return!1;for(let t=0;t<e.length;t++){const s=e[t],r=i[t];if(s.checked!==r.checked||s.required!==r.required)return!1}return!0}copy(e){return e.map(({checked:i,required:t})=>({checked:i,required:t}))}},ie=class{get controls(){const e=this.host.getAttribute("name");return!e||!this.root||!this.host.isConnected?[this.host]:Array.from(this.root.querySelectorAll(`[name="${e}"]`))}constructor(e){this.host=e,this.focused=!1,this.root=null,this.handleFocusIn=()=>{this.focused=!0,this.updateTabIndices()},this.handleFocusOut=()=>{this.focused=!1,this.updateTabIndices()},this.handleKeyDown=i=>{const t=i.key==="ArrowDown",s=i.key==="ArrowUp",r=i.key==="ArrowLeft",h=i.key==="ArrowRight";if(!r&&!h&&!t&&!s)return;const l=this.controls;if(!l.length)return;i.preventDefault();const T=getComputedStyle(this.host).direction==="rtl"?r||t:h||t,I=l.indexOf(this.host);let u=T?I+1:I-1;for(;u!==I;){u>=l.length?u=0:u<0&&(u=l.length-1);const p=l[u];if(p.hasAttribute("disabled")){T?u++:u--;continue}for(const C of l)C!==p&&(C.checked=!1,C.tabIndex=-1,C.blur());p.checked=!0,p.tabIndex=0,p.focus(),p.dispatchEvent(new Event("change",{bubbles:!0}));break}}}hostConnected(){this.root=this.host.getRootNode(),this.host.addEventListener("keydown",this.handleKeyDown),this.host.addEventListener("focusin",this.handleFocusIn),this.host.addEventListener("focusout",this.handleFocusOut),this.host.checked&&this.uncheckSiblings(),this.updateTabIndices()}hostDisconnected(){this.host.removeEventListener("keydown",this.handleKeyDown),this.host.removeEventListener("focusin",this.handleFocusIn),this.host.removeEventListener("focusout",this.handleFocusOut),this.updateTabIndices(),this.root=null}handleCheckedChange(){this.host.checked&&(this.uncheckSiblings(),this.updateTabIndices())}uncheckSiblings(){for(const e of this.controls)e!==this.host&&(e.checked=!1)}updateTabIndices(){const e=this.controls,i=e.find(t=>t.checked);if(i||this.focused){const t=i||this.host;t.tabIndex=0;for(const s of e)s!==t&&(s.tabIndex=-1);return}for(const t of e)t.tabIndex=0}},V,$=Symbol("checked"),se=0,re=Q(j(G(ee(D)))),E=class extends re{get checked(){return this[$]}set checked(e){const i=this.checked;i!==e&&(this[$]=e,this.requestUpdate("checked",i),this.selectionController.handleCheckedChange())}constructor(){super(),this.maskId=`cutout${++se}`,this[V]=!1,this.required=!1,this.value="on",this.selectionController=new ie(this),this.addController(this.selectionController),this[q].role="radio",this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.handleKeydown.bind(this))}render(){return k`
2
+ <div class="container ${U({checked:this.checked})}" aria-hidden="true">
3
3
  <md-ripple
4
4
  part="ripple"
5
5
  .control=${this}
@@ -27,8 +27,8 @@ import{_ as D,b as O,c as P,g as K,h as o,l as _,p as U,v as m,y as k}from"../..
27
27
  .value=${this.value}
28
28
  ?disabled=${this.disabled} />
29
29
  </div>
30
- `}updated(){this[q].ariaChecked=String(this.checked)}async handleClick(e){this.disabled||(await 0,!e.defaultPrevented&&(G(e)&&this.focus(),this.checked=!0,this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))))}async handleKeydown(e){await 0,!(e.key!==" "||e.defaultPrevented)&&this.click()}[(V=$,X)](){return this.checked?this.value:null}[Z](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(e){this.checked=e==="true"}[j](){return new te(()=>this.selectionController?this.selectionController.controls:[this])}[J](){return this.container}};_([o({type:Boolean})],E.prototype,"checked",null);_([o({type:Boolean})],E.prototype,"required",void 0);_([o()],E.prototype,"value",void 0);_([U(".container")],E.prototype,"container",void 0);var ae=O`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20px);outline:none;position:relative;vertical-align:top;width:var(--md-radio-icon-size, 20px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer;--md-ripple-hover-color: var(--md-radio-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-radio-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-radio-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-radio-pressed-state-layer-opacity, 0.12)}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-radio-icon-size, 20px))/2)}.container{display:flex;height:100%;place-content:center;place-items:center;width:100%}md-focus-ring{height:44px;inset:unset;width:44px}.checked{--md-ripple-hover-color: var(--md-radio-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-radio-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-radio-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-radio-selected-pressed-state-layer-opacity, 0.12)}input{appearance:none;height:48px;margin:0;position:absolute;width:48px;cursor:inherit}:host([touch-target=none]) input{width:100%;height:100%}md-ripple{border-radius:50%;height:var(--md-radio-state-layer-size, 40px);inset:unset;width:var(--md-radio-state-layer-size, 40px)}.icon{fill:var(--md-radio-icon-color, var(--md-sys-color-on-surface-variant, #49454f));inset:0;position:absolute}.outer.circle{transition:fill 50ms linear}.inner.circle{opacity:0;transform-origin:center;transition:opacity 50ms linear}.checked .icon{fill:var(--md-radio-selected-icon-color, var(--md-sys-color-primary, #6750a4))}.checked .inner.circle{animation:inner-circle-grow 300ms cubic-bezier(0.05, 0.7, 0.1, 1);opacity:1}@keyframes inner-circle-grow{from{transform:scale(0)}to{transform:scale(1)}}:host([disabled]) .circle{animation-duration:0s;transition-duration:0s}:host(:hover) .icon{fill:var(--md-radio-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host(:focus-within) .icon{fill:var(--md-radio-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host(:active) .icon{fill:var(--md-radio-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host([disabled]) .icon{fill:var(--md-radio-disabled-unselected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-radio-disabled-unselected-icon-opacity, 0.38)}:host(:hover) .checked .icon{fill:var(--md-radio-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4))}:host(:focus-within) .checked .icon{fill:var(--md-radio-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4))}:host(:active) .checked .icon{fill:var(--md-radio-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4))}:host([disabled]) .checked .icon{fill:var(--md-radio-disabled-selected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-radio-disabled-selected-icon-opacity, 0.38)}}@layer hcm{@media(forced-colors: active){.icon{fill:CanvasText}:host([disabled]) .icon{fill:GrayText;opacity:1}}}
31
- `,F=class extends E{};F.styles=[ae];F=_([K("md-radio")],F);var a,f,y,g,A,z=!1,x=0,M=e=>{e.metaKey||e.altKey||e.ctrlKey||(z=!0)},v=()=>{z=!1},oe=()=>{x===0&&(window.addEventListener("keydown",M,!0),window.addEventListener("pointerdown",v,!0),window.addEventListener("mousedown",v,!0),window.addEventListener("touchstart",v,!0)),x+=1},ne=()=>{x=Math.max(0,x-1),x===0&&(window.removeEventListener("keydown",M,!0),window.removeEventListener("pointerdown",v,!0),window.removeEventListener("mousedown",v,!0),window.removeEventListener("touchstart",v,!0))},n=(a=new WeakSet,f=new WeakMap,y=new WeakMap,g=new WeakMap,A=class extends D{constructor(...i){super(...i),N(this,a),S(this,f,void 0),S(this,y,void 0),S(this,g,void 0),this.disabled=!1,this.checked=!1,this.name="",this.value="",this.size="medium",this.deselectable=!1,this.label="",this.supportingText="",this.ariaLabel="",this._radioId="",this._showOuterFocusRing=!1,L(f,this,()=>{this.disabled||this.label?.trim()&&z&&d(a,this,w).call(this,!0)}),L(y,this,()=>{d(a,this,w).call(this,!1)}),L(g,this,()=>{d(a,this,w).call(this,!1)}),this._onClick=t=>{if(this.disabled)return;t.preventDefault(),t.stopPropagation();const s=this.deselectable?!this.checked:!0;s!==this.checked&&(this.checked=s,d(a,this,R).call(this),this.checked&&this.dispatchEvent(new CustomEvent("scb-radio-change",{detail:{name:this.name,source:this},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked,value:this.checked?this.value:""},bubbles:!0,composed:!0})))},this._onRadioChange=t=>{t.detail.name===this.name&&t.detail.source!==this&&(this.checked=!1)}}connectedCallback(){super.connectedCallback(),oe(),this._radioId=this.id||`scb-radio-${Math.random().toString(36).substr(2,9)}`,d(a,this,B).call(this),this.addEventListener("focusin",b(f,this)),this.addEventListener("focusout",b(y,this)),this.addEventListener("pointerdown",b(g,this),!0),document.addEventListener("scb-radio-change",this._onRadioChange)}disconnectedCallback(){super.disconnectedCallback(),ne(),this.removeEventListener("focusin",b(f,this)),this.removeEventListener("focusout",b(y,this)),this.removeEventListener("pointerdown",b(g,this),!0),document.removeEventListener("scb-radio-change",this._onRadioChange)}firstUpdated(){this.__syncInnerAria(),d(a,this,R).call(this)}updated(i){super.updated(i),i.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.disabled&&d(a,this,w).call(this,!1)),(i.has("label")||i.has("supportingText")||i.has("ariaLabel"))&&this.__syncInnerAria(),i.has("label")&&d(a,this,B).call(this),i.has("checked")&&d(a,this,R).call(this)}__syncInnerAria(){const i=this.shadowRoot?.querySelector("md-radio")?.shadowRoot;if(!i)return;const t=i.querySelector('[role="radio"]')||i.querySelector('input[type="radio"]');if(!t)return;const s=!!this.label?.trim(),r=s?`${this._radioId}-label`:"",h=this.supportingText?`${this._radioId}-supporting-text`:"";s&&r?(t.setAttribute("aria-labelledby",r),t.removeAttribute("aria-label")):(t.removeAttribute("aria-labelledby"),this.ariaLabel?.trim()?t.setAttribute("aria-label",this.ariaLabel.trim()):t.removeAttribute("aria-label")),h?t.setAttribute("aria-describedby",h):t.removeAttribute("aria-describedby")}render(){const i=this.supportingText?`${this._radioId}-supporting-text`:void 0,t=!!this.label?.trim(),s=t?m:this.ariaLabel||m;return k`
30
+ `}updated(){this[q].ariaChecked=String(this.checked)}async handleClick(e){this.disabled||(await 0,!e.defaultPrevented&&(H(e)&&this.focus(),this.checked=!0,this.dispatchEvent(new Event("change",{bubbles:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))))}async handleKeydown(e){await 0,!(e.key!==" "||e.defaultPrevented)&&this.click()}[(V=$,N)](){return this.checked?this.value:null}[J](){return String(this.checked)}formResetCallback(){this.checked=this.hasAttribute("checked")}formStateRestoreCallback(e){this.checked=e==="true"}[X](){return new te(()=>this.selectionController?this.selectionController.controls:[this])}[Y](){return this.container}};_([o({type:Boolean})],E.prototype,"checked",null);_([o({type:Boolean})],E.prototype,"required",void 0);_([o()],E.prototype,"value",void 0);_([P(".container")],E.prototype,"container",void 0);var ae=K`@layer{:host{display:inline-flex;height:var(--md-radio-icon-size, 20px);outline:none;position:relative;vertical-align:top;width:var(--md-radio-icon-size, 20px);-webkit-tap-highlight-color:rgba(0,0,0,0);cursor:pointer;--md-ripple-hover-color: var(--md-radio-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-hover-opacity: var(--md-radio-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-radio-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-pressed-opacity: var(--md-radio-pressed-state-layer-opacity, 0.12)}:host([disabled]){cursor:default}:host([touch-target=wrapper]){margin:max(0px,(48px - var(--md-radio-icon-size, 20px))/2)}.container{display:flex;height:100%;place-content:center;place-items:center;width:100%}md-focus-ring{height:44px;inset:unset;width:44px}.checked{--md-ripple-hover-color: var(--md-radio-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--md-ripple-hover-opacity: var(--md-radio-selected-hover-state-layer-opacity, 0.08);--md-ripple-pressed-color: var(--md-radio-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--md-ripple-pressed-opacity: var(--md-radio-selected-pressed-state-layer-opacity, 0.12)}input{appearance:none;height:48px;margin:0;position:absolute;width:48px;cursor:inherit}:host([touch-target=none]) input{width:100%;height:100%}md-ripple{border-radius:50%;height:var(--md-radio-state-layer-size, 40px);inset:unset;width:var(--md-radio-state-layer-size, 40px)}.icon{fill:var(--md-radio-icon-color, var(--md-sys-color-on-surface-variant, #49454f));inset:0;position:absolute}.outer.circle{transition:fill 50ms linear}.inner.circle{opacity:0;transform-origin:center;transition:opacity 50ms linear}.checked .icon{fill:var(--md-radio-selected-icon-color, var(--md-sys-color-primary, #6750a4))}.checked .inner.circle{animation:inner-circle-grow 300ms cubic-bezier(0.05, 0.7, 0.1, 1);opacity:1}@keyframes inner-circle-grow{from{transform:scale(0)}to{transform:scale(1)}}:host([disabled]) .circle{animation-duration:0s;transition-duration:0s}:host(:hover) .icon{fill:var(--md-radio-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host(:focus-within) .icon{fill:var(--md-radio-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host(:active) .icon{fill:var(--md-radio-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20))}:host([disabled]) .icon{fill:var(--md-radio-disabled-unselected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-radio-disabled-unselected-icon-opacity, 0.38)}:host(:hover) .checked .icon{fill:var(--md-radio-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4))}:host(:focus-within) .checked .icon{fill:var(--md-radio-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4))}:host(:active) .checked .icon{fill:var(--md-radio-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4))}:host([disabled]) .checked .icon{fill:var(--md-radio-disabled-selected-icon-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-radio-disabled-selected-icon-opacity, 0.38)}}@layer hcm{@media(forced-colors: active){.icon{fill:CanvasText}:host([disabled]) .icon{fill:GrayText;opacity:1}}}
31
+ `,F=class extends E{};F.styles=[ae];F=_([O("md-radio")],F);var a,f,y,g,A,z=!1,x=0,M=e=>{e.metaKey||e.altKey||e.ctrlKey||(z=!0)},v=()=>{z=!1},oe=()=>{x===0&&(window.addEventListener("keydown",M,!0),window.addEventListener("pointerdown",v,!0),window.addEventListener("mousedown",v,!0),window.addEventListener("touchstart",v,!0)),x+=1},ne=()=>{x=Math.max(0,x-1),x===0&&(window.removeEventListener("keydown",M,!0),window.removeEventListener("pointerdown",v,!0),window.removeEventListener("mousedown",v,!0),window.removeEventListener("touchstart",v,!0))},n=(a=new WeakSet,f=new WeakMap,y=new WeakMap,g=new WeakMap,A=class extends D{constructor(...i){super(...i),W(this,a),S(this,f,void 0),S(this,y,void 0),S(this,g,void 0),this.disabled=!1,this.checked=!1,this.name="",this.value="",this.size="medium",this.deselectable=!1,this.label="",this.supportingText="",this.ariaLabel="",this._radioId="",this._showOuterFocusRing=!1,L(f,this,()=>{this.disabled||this.label?.trim()&&z&&d(a,this,w).call(this,!0)}),L(y,this,()=>{d(a,this,w).call(this,!1)}),L(g,this,()=>{d(a,this,w).call(this,!1)}),this._onClick=t=>{if(this.disabled)return;t.preventDefault(),t.stopPropagation();const s=this.deselectable?!this.checked:!0;s!==this.checked&&(this.checked=s,d(a,this,R).call(this),this.checked&&this.dispatchEvent(new CustomEvent("scb-radio-change",{detail:{name:this.name,source:this},bubbles:!0,composed:!0})),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked,value:this.checked?this.value:""},bubbles:!0,composed:!0})))},this._onRadioChange=t=>{t.detail.name===this.name&&t.detail.source!==this&&(this.checked=!1)}}connectedCallback(){super.connectedCallback(),oe(),this._radioId=this.id||`scb-radio-${Math.random().toString(36).substr(2,9)}`,d(a,this,B).call(this),this.addEventListener("focusin",b(f,this)),this.addEventListener("focusout",b(y,this)),this.addEventListener("pointerdown",b(g,this),!0),document.addEventListener("scb-radio-change",this._onRadioChange)}disconnectedCallback(){super.disconnectedCallback(),ne(),this.removeEventListener("focusin",b(f,this)),this.removeEventListener("focusout",b(y,this)),this.removeEventListener("pointerdown",b(g,this),!0),document.removeEventListener("scb-radio-change",this._onRadioChange)}firstUpdated(){this.__syncInnerAria(),d(a,this,R).call(this)}updated(i){super.updated(i),i.has("disabled")&&(this.toggleAttribute("aria-disabled",this.disabled),this.disabled&&d(a,this,w).call(this,!1)),(i.has("label")||i.has("supportingText")||i.has("ariaLabel"))&&this.__syncInnerAria(),i.has("label")&&d(a,this,B).call(this),i.has("checked")&&d(a,this,R).call(this)}__syncInnerAria(){const i=this.shadowRoot?.querySelector("md-radio")?.shadowRoot;if(!i)return;const t=i.querySelector('[role="radio"]')||i.querySelector('input[type="radio"]');if(!t)return;const s=!!this.label?.trim(),r=s?`${this._radioId}-label`:"",h=this.supportingText?`${this._radioId}-supporting-text`:"";s&&r?(t.setAttribute("aria-labelledby",r),t.removeAttribute("aria-label")):(t.removeAttribute("aria-labelledby"),this.ariaLabel?.trim()?t.setAttribute("aria-label",this.ariaLabel.trim()):t.removeAttribute("aria-label")),h?t.setAttribute("aria-describedby",h):t.removeAttribute("aria-describedby")}render(){const i=this.supportingText?`${this._radioId}-supporting-text`:void 0,t=!!this.label?.trim(),s=t?m:this.ariaLabel||m;return k`
32
32
  <label class="wrap">
33
33
  ${t?k`<md-focus-ring class="outer-focus-ring" ?visible=${this._showOuterFocusRing}></md-focus-ring>`:m}
34
34
  <div class="radio-wrap">
@@ -49,115 +49,4 @@ import{_ as D,b as O,c as P,g as K,h as o,l as _,p as U,v as m,y as k}from"../..
49
49
  </div>`:m}
50
50
  </label>
51
51
  <slot></slot>
52
- `}},A.styles=O`
53
- /* layout med inline-grid */
54
- :host {
55
- display: inline-grid;
56
- grid-template-columns: auto;
57
- grid-template-rows: auto auto;
58
- row-gap: 0;
59
- font-family: var(--brand-font, 'Inter', sans-serif);
60
-
61
- --scb-radio-text-font: var(--md-sys-typescale-body-medium-font);
62
- --scb-radio-text-size: var(--md-sys-typescale-body-medium-size);
63
- --scb-radio-text-line-height: var(--md-sys-typescale-body-medium-line-height);
64
- --scb-radio-text-tracking: var(--md-sys-typescale-body-medium-tracking);
65
- --scb-radio-text-weight: var(--md-sys-typescale-body-medium-weight, var(--weight-regular, 400));
66
- }
67
-
68
- :host([size='small']) {
69
- --scb-radio-text-font: var(--md-sys-typescale-body-small-font);
70
- --scb-radio-text-size: var(--md-sys-typescale-body-small-size);
71
- --scb-radio-text-line-height: var(--md-sys-typescale-body-small-line-height);
72
- --scb-radio-text-tracking: var(--md-sys-typescale-body-small-tracking);
73
- --scb-radio-text-weight: var(--md-sys-typescale-body-small-weight, var(--weight-regular, 400));
74
- }
75
-
76
- :host([size='large']) {
77
- --scb-radio-text-font: var(--md-sys-typescale-body-large-font);
78
- --scb-radio-text-size: var(--md-sys-typescale-body-large-size);
79
- --scb-radio-text-line-height: var(--md-sys-typescale-body-large-line-height);
80
- --scb-radio-text-tracking: var(--md-sys-typescale-body-large-tracking);
81
- --scb-radio-text-weight: var(--md-sys-typescale-body-large-weight, var(--weight-regular, 400));
82
- }
83
-
84
- /* Styr horisontellt avstånd när den placeras i horisontell layout */
85
- :host([orientation="horizontal"]) {
86
- margin-inline-end: var(--scb-radio-gap, var(--spacing-7, 24px));
87
- }
88
-
89
- /* Wrapper för md-radio + label */
90
- .wrap {
91
- display: inline-grid;
92
- grid-template-columns: auto 1fr;
93
- align-items: center;
94
- column-gap: var(--spacing-5, 16px);
95
- row-gap: 0;
96
- cursor: pointer;
97
- overflow: visible;
98
- position: relative;
99
- }
100
- :host([disabled]) .wrap { cursor: default; }
101
-
102
- .outer-focus-ring {
103
- position: absolute;
104
- inset:
105
- calc(var(--spacing-2, 4px) * -1) /* topp */
106
- calc(var(--spacing-4, 12px) * -1) /* höger */
107
- calc(var(--spacing-2, 4px) * -1) /* botten */
108
- calc(var(--spacing-4, 12px) * -1); /* vänster */
109
- pointer-events: none;
110
- --md-focus-ring-shape-start-start: var(--radius-s, 8px);
111
- --md-focus-ring-shape-start-end: var(--radius-s, 8px);
112
- --md-focus-ring-shape-end-start: var(--radius-s, 8px);
113
- --md-focus-ring-shape-end-end: var(--radius-s, 8px);
114
- }
115
-
116
- :host([data-has-label]) md-radio::part(focus-ring) {
117
- display: none;
118
- }
119
-
120
- /* Hit-yta runt md-radio */
121
- .radio-wrap {
122
- height: var(--scb-radio-target, 40px);
123
- align-items: center;
124
- display: flex;
125
- justify-content: center;
126
- overflow: visible;
127
- }
128
-
129
- /* Nollställ md-radio marginal */
130
- md-radio { margin: 0; }
131
-
132
- /* Label-styling */
133
- .lbl {
134
- color: var(--md-sys-color-on-surface);
135
- font-family: var(--scb-radio-text-font, var(--brand-font));
136
- font-size: var(--scb-radio-text-size);
137
- line-height: var(--scb-radio-text-line-height);
138
- font-weight: var(--scb-radio-text-weight);
139
- letter-spacing: var(--scb-radio-text-tracking);
140
- margin-top: var(--spacing-1, 2px);
141
- }
142
- :host([disabled]) .lbl { color: var(--n-60); }
143
-
144
- /* Supporting text styling */
145
- .supporting-text {
146
- grid-column: 2;
147
- grid-row: 2;
148
- color: var(--md-sys-color-on-surface-variant);
149
- font-family: var(--scb-radio-text-font, var(--brand-font));
150
- font-size: var(--scb-radio-text-size);
151
- line-height: var(--scb-radio-text-line-height, 20px);
152
- font-weight: var(--scb-radio-text-weight);
153
- letter-spacing: var(--scb-radio-text-tracking);
154
- margin-bottom: var(--spacing-4, 8px);
155
- }
156
- :host([disabled]) .supporting-text { color: var(--n-60); }
157
-
158
- /* Anpassning för mörkt läge */
159
- @media (prefers-color-scheme: dark) {
160
- .lbl { color: var(--md-sys-color-on-surface); }
161
- .supporting-text { color: var(--md-sys-color-on-surface-variant); }
162
- }
163
- `,A);function w(e){this._showOuterFocusRing!==e&&(this._showOuterFocusRing=e,this.requestUpdate())}function B(){const e=!!this.label?.trim();this.toggleAttribute("data-has-label",e),e||d(a,this,w).call(this,!1)}function R(){const e=this.shadowRoot?.querySelector("md-radio");e&&(e.checked=this.checked,this.checked?e.setAttribute("checked",""):e.removeAttribute("checked"))}l([o({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);l([o({type:Boolean,reflect:!0})],n.prototype,"checked",void 0);l([o({type:String,reflect:!0})],n.prototype,"name",void 0);l([o({type:String,reflect:!0})],n.prototype,"value",void 0);l([o({type:String,reflect:!0})],n.prototype,"size",void 0);l([o({type:Boolean,reflect:!0})],n.prototype,"deselectable",void 0);l([o({type:String})],n.prototype,"label",void 0);l([o({type:String,attribute:"supporting-text"})],n.prototype,"supportingText",void 0);l([o({type:String,attribute:"aria-label"})],n.prototype,"ariaLabel",void 0);n=l([K("scb-radio-button")],n);
52
+ `}},A.styles=K`:host{display:inline-grid;grid-template-columns:auto;grid-template-rows:auto auto;row-gap:0;font-family:var(--brand-font, 'Inter', sans-serif);--scb-radio-text-font:var(--md-sys-typescale-body-medium-font);--scb-radio-text-size:var(--md-sys-typescale-body-medium-size);--scb-radio-text-line-height:var(--md-sys-typescale-body-medium-line-height);--scb-radio-text-tracking:var(--md-sys-typescale-body-medium-tracking);--scb-radio-text-weight:var(--md-sys-typescale-body-medium-weight, var(--weight-regular, 400))}:host([size='small']){--scb-radio-text-font:var(--md-sys-typescale-body-small-font);--scb-radio-text-size:var(--md-sys-typescale-body-small-size);--scb-radio-text-line-height:var(--md-sys-typescale-body-small-line-height);--scb-radio-text-tracking:var(--md-sys-typescale-body-small-tracking);--scb-radio-text-weight:var(--md-sys-typescale-body-small-weight, var(--weight-regular, 400))}:host([size='large']){--scb-radio-text-font:var(--md-sys-typescale-body-large-font);--scb-radio-text-size:var(--md-sys-typescale-body-large-size);--scb-radio-text-line-height:var(--md-sys-typescale-body-large-line-height);--scb-radio-text-tracking:var(--md-sys-typescale-body-large-tracking);--scb-radio-text-weight:var(--md-sys-typescale-body-large-weight, var(--weight-regular, 400))}:host([orientation="horizontal"]){margin-inline-end:var(--scb-radio-gap, var(--spacing-7, 24px))}.wrap{display:inline-grid;grid-template-columns:auto 1fr;align-items:center;column-gap:var(--spacing-5, 16px);row-gap:0;cursor:pointer;overflow:visible;position:relative}:host([disabled]) .wrap{cursor:default}.outer-focus-ring{position:absolute;inset:calc(var(--spacing-2, 4px)*-1) calc(var(--spacing-4, 12px)*-1) calc(var(--spacing-2, 4px)*-1) calc(var(--spacing-4, 12px)*-1);pointer-events:none;--md-focus-ring-shape-start-start:var(--radius-s, 8px);--md-focus-ring-shape-start-end:var(--radius-s, 8px);--md-focus-ring-shape-end-start:var(--radius-s, 8px);--md-focus-ring-shape-end-end:var(--radius-s, 8px)}:host([data-has-label]) md-radio::part(focus-ring){display:none}.radio-wrap{height:var(--scb-radio-target, 40px);align-items:center;display:flex;justify-content:center;overflow:visible}md-radio{margin:0}.lbl{color:var(--md-sys-color-on-surface);font-family:var(--scb-radio-text-font, var(--brand-font));font-size:var(--scb-radio-text-size);line-height:var(--scb-radio-text-line-height);font-weight:var(--scb-radio-text-weight);letter-spacing:var(--scb-radio-text-tracking);margin-top:var(--spacing-1, 2px)}:host([disabled]) .lbl,:host([disabled]) .supporting-text{color:var(--n-60)}.supporting-text{grid-column:2;grid-row:2;color:var(--md-sys-color-on-surface-variant);font-family:var(--scb-radio-text-font, var(--brand-font));font-size:var(--scb-radio-text-size);line-height:var(--scb-radio-text-line-height, 20px);font-weight:var(--scb-radio-text-weight);letter-spacing:var(--scb-radio-text-tracking);margin-bottom:var(--spacing-4, 8px)}@media (prefers-color-scheme:dark){.lbl{color:var(--md-sys-color-on-surface)}.supporting-text{color:var(--md-sys-color-on-surface-variant)}}`,A);function w(e){this._showOuterFocusRing!==e&&(this._showOuterFocusRing=e,this.requestUpdate())}function B(){const e=!!this.label?.trim();this.toggleAttribute("data-has-label",e),e||d(a,this,w).call(this,!1)}function R(){const e=this.shadowRoot?.querySelector("md-radio");e&&(e.checked=this.checked,this.checked?e.setAttribute("checked",""):e.removeAttribute("checked"))}c([o({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0);c([o({type:Boolean,reflect:!0})],n.prototype,"checked",void 0);c([o({type:String,reflect:!0})],n.prototype,"name",void 0);c([o({type:String,reflect:!0})],n.prototype,"value",void 0);c([o({type:String,reflect:!0})],n.prototype,"size",void 0);c([o({type:Boolean,reflect:!0})],n.prototype,"deselectable",void 0);c([o({type:String})],n.prototype,"label",void 0);c([o({type:String,attribute:"supporting-text"})],n.prototype,"supportingText",void 0);c([o({type:String,attribute:"aria-label"})],n.prototype,"ariaLabel",void 0);n=c([O("scb-radio-button")],n);
@@ -1,4 +1,4 @@
1
- import{_ as C,b as A,g as R,h as l,y as L}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as o}from"../../vendor/decorate.js";import{n as M,t as a}from"../../vendor/assertClassBrand.js";import{n as v,r as _,t as c}from"../../vendor/classPrivateFieldGet2.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,e,n){try{customElements.get(i)||t(i,e,n)}catch(u){var d=String(u||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var y,p,g,b,s,k,r=(y=new WeakMap,p=new WeakMap,g=new WeakMap,b=new WeakMap,s=new WeakSet,k=class extends C{constructor(){super(),M(this,s),_(this,y,void 0),_(this,p,void 0),_(this,g,void 0),_(this,b,void 0),this.name="",this.orientation="vertical",this.disabled=!1,this.required=!1,this.deselectable=!1,this.size="medium",this.ariaLabel=null,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.value="",this._internals=null,this._form=null,this._formResetHandler=null,this._initialValue="",this._customValidationMessage="",v(y,this,()=>{const t=this.shadowRoot?.querySelector("slot");return t?t.assignedElements({flatten:!0}).filter(i=>i.tagName.toLowerCase()==="scb-radio-button"):[]}),v(p,this,()=>{const t=c(y,this).call(this);if(!t.length)return;let i=null;for(const e of t){const n=e;this.name&&e.setAttribute("name",this.name),this.disabled?e.setAttribute("disabled",""):e.removeAttribute("disabled"),this.orientation==="horizontal"?e.setAttribute("orientation","horizontal"):e.removeAttribute("orientation");const d=e.hasAttribute("data-size-from-group");this.deselectable?e.setAttribute("deselectable",""):e.removeAttribute("deselectable"),this.size==="medium"?d&&(e.removeAttribute("size"),e.removeAttribute("data-size-from-group")):(!e.hasAttribute("size")||d)&&(e.setAttribute("size",this.size),e.setAttribute("data-size-from-group",""));const u=n.value??e.getAttribute("value")??"",S=typeof n.checked=="boolean"?n.checked:e.hasAttribute("checked");if(this.value){const w=String(u)===this.value;w&&!S?n.checked=!0:!w&&S&&(n.checked=!1)}else S&&i===null&&(i=String(u))}!this.value&&i!==null&&(this.value=i)}),v(g,this,t=>{t.target!==this&&t.composedPath().find(i=>i?.tagName?.toLowerCase()==="scb-radio-button")&&(t.stopImmediatePropagation(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))}),v(b,this,t=>{if(t.target===this)return;const i=t.composedPath().find(u=>u?.tagName?.toLowerCase()==="scb-radio-button");if(!i)return;t.stopImmediatePropagation();const e=i?.checked===!0,n=e?i?.value??i?.getAttribute?.("value")??t.target?.value??"":"";this.value=String(n??"");const d={value:String(n??""),checked:e,originalIsTrusted:t?.isTrusted===!0};this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scb-change",{detail:d,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbchange",{detail:d,bubbles:!0,composed:!0}))}),"attachInternals"in this&&(this._internals=this.attachInternals())}render(){const t=this.orientation==="horizontal"?"row":"column";return L`
1
+ import{h as A,m as C,p as l,v as R,y as L}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as o}from"../../vendor/decorate.js";import{n as M,t as a}from"../../vendor/assertClassBrand.js";import{n as v,r as _,t as c}from"../../vendor/classPrivateFieldGet2.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(i,e,n){try{customElements.get(i)||t(i,e,n)}catch(u){var d=String(u||"");if(d.indexOf("already been used")===-1&&d.indexOf("NotSupportedError")===-1)throw u}}}}catch{}})();var y,p,b,g,s,S,r=(y=new WeakMap,p=new WeakMap,b=new WeakMap,g=new WeakMap,s=new WeakSet,S=class extends A{constructor(){super(),M(this,s),_(this,y,void 0),_(this,p,void 0),_(this,b,void 0),_(this,g,void 0),this.name="",this.orientation="vertical",this.disabled=!1,this.required=!1,this.deselectable=!1,this.size="medium",this.ariaLabel=null,this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.value="",this._internals=null,this._form=null,this._formResetHandler=null,this._initialValue="",this._customValidationMessage="",v(y,this,()=>{const t=this.shadowRoot?.querySelector("slot");return t?t.assignedElements({flatten:!0}).filter(i=>i.tagName.toLowerCase()==="scb-radio-button"):[]}),v(p,this,()=>{const t=c(y,this).call(this);if(!t.length)return;let i=null;for(const e of t){const n=e;this.name&&e.setAttribute("name",this.name),this.disabled?e.setAttribute("disabled",""):e.removeAttribute("disabled"),this.orientation==="horizontal"?e.setAttribute("orientation","horizontal"):e.removeAttribute("orientation");const d=e.hasAttribute("data-size-from-group");this.deselectable?e.setAttribute("deselectable",""):e.removeAttribute("deselectable"),this.size==="medium"?d&&(e.removeAttribute("size"),e.removeAttribute("data-size-from-group")):(!e.hasAttribute("size")||d)&&(e.setAttribute("size",this.size),e.setAttribute("data-size-from-group",""));const u=n.value??e.getAttribute("value")??"",k=typeof n.checked=="boolean"?n.checked:e.hasAttribute("checked");if(this.value){const w=String(u)===this.value;w&&!k?n.checked=!0:!w&&k&&(n.checked=!1)}else k&&i===null&&(i=String(u))}!this.value&&i!==null&&(this.value=i)}),v(b,this,t=>{t.target!==this&&t.composedPath().find(i=>i?.tagName?.toLowerCase()==="scb-radio-button")&&(t.stopImmediatePropagation(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))}),v(g,this,t=>{if(t.target===this)return;const i=t.composedPath().find(u=>u?.tagName?.toLowerCase()==="scb-radio-button");if(!i)return;t.stopImmediatePropagation();const e=i?.checked===!0,n=e?i?.value??i?.getAttribute?.("value")??t.target?.value??"":"";this.value=String(n??"");const d={value:String(n??""),checked:e,originalIsTrusted:t?.isTrusted===!0};this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scb-change",{detail:d,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("scbchange",{detail:d,bubbles:!0,composed:!0}))}),"attachInternals"in this&&(this._internals=this.attachInternals())}render(){const t=this.orientation==="horizontal"?"row":"column";return R`
2
2
  <div
3
3
  class="g"
4
4
  role="radiogroup"
@@ -10,34 +10,4 @@ import{_ as C,b as A,g as R,h as l,y as L}from"../../vendor/vendor.js";import"..
10
10
  >
11
11
  <slot @slotchange=${c(p,this)}></slot>
12
12
  </div>
13
- `}firstUpdated(){a(s,this,E).call(this),c(p,this).call(this),this.addEventListener("input",c(g,this)),this.addEventListener("change",c(b,this)),this._initialValue=this.value,this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.requestUpdate(),c(p,this).call(this),this.__syncFormValue(),a(s,this,m).call(this)},this._form.addEventListener("reset",this._formResetHandler,!0)),this.__syncFormValue(),a(s,this,m).call(this)}disconnectedCallback(){this.removeEventListener("input",c(g,this)),this.removeEventListener("change",c(b,this)),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),super.disconnectedCallback()}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&a(s,this,E).call(this),(t.has("name")||t.has("disabled")||t.has("orientation")||t.has("size")||t.has("deselectable")||t.has("required")||t.has("value"))&&c(p,this).call(this),(t.has("value")||t.has("disabled")||t.has("name"))&&this.__syncFormValue(),(t.has("value")||t.has("disabled")||t.has("required"))&&a(s,this,m).call(this)}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??""}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}checkValidity(){return this._internals?.checkValidity()??!a(s,this,V).call(this)}reportValidity(){return this._internals?.reportValidity()??!a(s,this,V).call(this)}setCustomValidity(t){this._customValidationMessage=String(t??""),a(s,this,m).call(this)}formDisabledCallback(t){this.disabled=t,a(s,this,m).call(this)}__syncFormValue(){if(!this._internals)return;const t=typeof this.name=="string"&&this.name.trim()!=="",i=typeof this.value=="string"&&this.value.trim()!=="",e=this.disabled||!t||!i?null:this.value;this._internals.setFormValue(e)}},k.formAssociated=!0,k.styles=A`
14
- :host {
15
- display: block;
16
-
17
- /* Vertikal standard-spacing mellan items i gruppen */
18
- --scb-radio-gap: var(--spacing-4, 12px);
19
-
20
- /* Vertikalt avstånd mot omgivande innehåll, styrs via spacing/spacing-top/spacing-bottom */
21
- margin-block-start: var(--scb-radio-group-spacing-block-start, 0);
22
- margin-block-end: var(--scb-radio-group-spacing-block-end, 0);
23
- margin-inline-start: var(--scb-radio-group-spacing-inline-start, 0);
24
- margin-inline-end: var(--scb-radio-group-spacing-inline-end, 0);
25
- }
26
-
27
- /* Horisontell standard-spacing mellan items om gap inte overrideas via CSS-variabel */
28
- :host([orientation='horizontal']) {
29
- --scb-radio-gap: var(--spacing-8, 32px);
30
- }
31
-
32
- .g {
33
- display: flex;
34
- flex-direction: var(--_dir, column);
35
- align-items: flex-start;
36
- gap: var(--scb-radio-gap);
37
- }
38
-
39
- /* När radioknappar ligger i en grupp ska spacing ägas av gruppen, inte av enskilda items */
40
- ::slotted(scb-radio-button) {
41
- --scb-radio-gap: 0;
42
- }
43
- `,k);function V(){return this.disabled?!1:this._customValidationMessage?!0:this.required&&!this.value.trim()}function m(){if(!this._internals)return;const h=!this.disabled&&this.required&&!this.value.trim(),t=this._customValidationMessage||(h?"Välj ett alternativ.":"");this._internals.setValidity(h?{valueMissing:!0}:{},t,this.shadowRoot?.querySelector(".g")??void 0)}function E(){const h=a(s,this,f).call(this,this.spacing),t=a(s,this,f).call(this,this.spacingTop)??h,i=a(s,this,f).call(this,this.spacingBottom)??h,e=a(s,this,f).call(this,this.spacingLeft),n=a(s,this,f).call(this,this.spacingRight);t?this.style.setProperty("--scb-radio-group-spacing-block-start",t):this.style.removeProperty("--scb-radio-group-spacing-block-start"),i?this.style.setProperty("--scb-radio-group-spacing-block-end",i):this.style.removeProperty("--scb-radio-group-spacing-block-end"),e?this.style.setProperty("--scb-radio-group-spacing-inline-start",e):this.style.removeProperty("--scb-radio-group-spacing-inline-start"),n?this.style.setProperty("--scb-radio-group-spacing-inline-end",n):this.style.removeProperty("--scb-radio-group-spacing-inline-end")}function f(h){if(!h)return;const t=String(h).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}o([l({type:String})],r.prototype,"name",void 0);o([l({type:String,reflect:!0})],r.prototype,"orientation",void 0);o([l({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0);o([l({type:Boolean,reflect:!0})],r.prototype,"required",void 0);o([l({type:Boolean,reflect:!0})],r.prototype,"deselectable",void 0);o([l({type:String,reflect:!0})],r.prototype,"size",void 0);o([l({type:String,attribute:"aria-label"})],r.prototype,"ariaLabel",void 0);o([l({type:String,reflect:!0})],r.prototype,"spacing",void 0);o([l({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",void 0);o([l({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",void 0);o([l({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",void 0);o([l({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",void 0);o([l({type:String,reflect:!0})],r.prototype,"value",void 0);r=o([R("scb-radio-group")],r);
13
+ `}firstUpdated(){a(s,this,E).call(this),c(p,this).call(this),this.addEventListener("input",c(b,this)),this.addEventListener("change",c(g,this)),this._initialValue=this.value,this._form=this.closest("form"),this._form&&(this._formResetHandler=()=>{this.value=this._initialValue,this.requestUpdate(),c(p,this).call(this),this.__syncFormValue(),a(s,this,f).call(this)},this._form.addEventListener("reset",this._formResetHandler,!0)),this.__syncFormValue(),a(s,this,f).call(this)}disconnectedCallback(){this.removeEventListener("input",c(b,this)),this.removeEventListener("change",c(g,this)),this._form&&this._formResetHandler&&this._form.removeEventListener("reset",this._formResetHandler,!0),super.disconnectedCallback()}updated(t){(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&a(s,this,E).call(this),(t.has("name")||t.has("disabled")||t.has("orientation")||t.has("size")||t.has("deselectable")||t.has("required")||t.has("value"))&&c(p,this).call(this),(t.has("value")||t.has("disabled")||t.has("name"))&&this.__syncFormValue(),(t.has("value")||t.has("disabled")||t.has("required"))&&a(s,this,f).call(this)}get form(){return this._internals?.form??this._form}get validity(){return this._internals?.validity}get validationMessage(){return this._internals?.validationMessage??""}get willValidate(){return this._internals?.willValidate??!this.disabled}get labels(){return this._internals?.labels}checkValidity(){return this._internals?.checkValidity()??!a(s,this,V).call(this)}reportValidity(){return this._internals?.reportValidity()??!a(s,this,V).call(this)}setCustomValidity(t){this._customValidationMessage=String(t??""),a(s,this,f).call(this)}formDisabledCallback(t){this.disabled=t,a(s,this,f).call(this)}__syncFormValue(){if(!this._internals)return;const t=typeof this.name=="string"&&this.name.trim()!=="",i=typeof this.value=="string"&&this.value.trim()!=="",e=this.disabled||!t||!i?null:this.value;this._internals.setFormValue(e)}},S.formAssociated=!0,S.styles=L`:host{display:block;--scb-radio-gap:var(--spacing-4, 12px);margin-block-start:var(--scb-radio-group-spacing-block-start, 0);margin-block-end:var(--scb-radio-group-spacing-block-end, 0);margin-inline-start:var(--scb-radio-group-spacing-inline-start, 0);margin-inline-end:var(--scb-radio-group-spacing-inline-end, 0)}:host([orientation='horizontal']){--scb-radio-gap:var(--spacing-8, 32px)}.g{display:flex;flex-direction:var(--_dir, column);align-items:flex-start;gap:var(--scb-radio-gap)}::slotted(scb-radio-button){--scb-radio-gap:0}`,S);function V(){return this.disabled?!1:this._customValidationMessage?!0:this.required&&!this.value.trim()}function f(){if(!this._internals)return;const h=!this.disabled&&this.required&&!this.value.trim(),t=this._customValidationMessage||(h?"Välj ett alternativ.":"");this._internals.setValidity(h?{valueMissing:!0}:{},t,this.shadowRoot?.querySelector(".g")??void 0)}function E(){const h=a(s,this,m).call(this,this.spacing),t=a(s,this,m).call(this,this.spacingTop)??h,i=a(s,this,m).call(this,this.spacingBottom)??h,e=a(s,this,m).call(this,this.spacingLeft),n=a(s,this,m).call(this,this.spacingRight);t?this.style.setProperty("--scb-radio-group-spacing-block-start",t):this.style.removeProperty("--scb-radio-group-spacing-block-start"),i?this.style.setProperty("--scb-radio-group-spacing-block-end",i):this.style.removeProperty("--scb-radio-group-spacing-block-end"),e?this.style.setProperty("--scb-radio-group-spacing-inline-start",e):this.style.removeProperty("--scb-radio-group-spacing-inline-start"),n?this.style.setProperty("--scb-radio-group-spacing-inline-end",n):this.style.removeProperty("--scb-radio-group-spacing-inline-end")}function m(h){if(!h)return;const t=String(h).trim();if(t)return/^\d+$/.test(t)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(t,10)))})`:t}o([l({type:String})],r.prototype,"name",void 0);o([l({type:String,reflect:!0})],r.prototype,"orientation",void 0);o([l({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0);o([l({type:Boolean,reflect:!0})],r.prototype,"required",void 0);o([l({type:Boolean,reflect:!0})],r.prototype,"deselectable",void 0);o([l({type:String,reflect:!0})],r.prototype,"size",void 0);o([l({type:String,attribute:"aria-label"})],r.prototype,"ariaLabel",void 0);o([l({type:String,reflect:!0})],r.prototype,"spacing",void 0);o([l({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",void 0);o([l({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",void 0);o([l({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",void 0);o([l({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",void 0);o([l({type:String,reflect:!0})],r.prototype,"value",void 0);r=o([C("scb-radio-group")],r);
@@ -1,4 +1,4 @@
1
- import{_ as w,b as R,g as M,y as g}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as O}from"../../vendor/decorate.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,i){try{customElements.get(e)||t(e,s,i)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var b,E=(b=class extends w{constructor(...t){super(...t),this.navSelector="",this.offsetTop=0,this.offsetBottom=0,this.updateHash=!0,this.activeId="",this.layout="",this.sidebarNavWidth="320px",this.sidebarHeight="560px",this.stackHeight="",this.sidebarNavTop="0px",this.contentPadding="0px",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__navEl=null,this.__contentEl=null,this.__contentShellEl=null,this.__links=[],this.__observer=null,this.__fallbackScrollRoot=null,this.__entries=new Map,this.__rafId=null,this.__scrollRafId=null,this.__hashAllowUpdates=!1,this.__hashBaselineReady=!1,this.__hashBaselinePos=0,this.__hashBaselineRafId=null,this.__hashScrollRoot=null,this.__hashSuspend=!1,this.__hashInitialApplied=!1,this.__onHashScrollBound=()=>this.__onHashScroll(),this.__scrollAnimSeq=0,this.__syncingActiveId=!1,this.__slotsResolvedOnce=!1,this.__motionMeasureEl=null,this.__focusableRafId=null,this.__autoOffsetTop=0,this.__autoOffsetRafId=null,this.__navResizeObserver=null,this.__onNavClickBound=e=>this.__onNavClick(e),this.__onScrollFallbackBound=()=>this.__updateActiveFromRects(),this.__onResizeBound=()=>{this.__requestActiveRecalc(),this.__requestAutoOffsetMeasure()},this.__onSlotChange=()=>{const e=this.__navEl;this.__teardown(),this.__resolveSlots(),this.__requestEnsureContentFocusable(),this.__navEl&&this.__navEl.addEventListener("click",this.__onNavClickBound,!0),(e!==this.__navEl||!this.__links.length)&&this.__collectLinks(),this.__requestAutoOffsetMeasure(),this.__rebuildObserver(),this.__attachHashScrollRoot(),this.__applyInitialHashIfAny(),!this.__hashInitialApplied&&this.activeId&&this.__applyActiveId(this.activeId,{updateHash:!1,scrollToTarget:!1}),this.__slotsResolvedOnce=!0}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.__onResizeBound,{passive:!0})}firstUpdated(){this.__ensureMotionMeasureEl(),this.__resolveInternals(),this.__requestEnsureContentFocusable(),this.__requestAutoOffsetMeasure(),this.__applySpacing()}disconnectedCallback(){window.removeEventListener("resize",this.__onResizeBound),this.__teardown(),super.disconnectedCallback()}updated(t){if((t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing(),t.has("navSelector")){this.__onSlotChange();return}if(t.has("layout")){this.__onSlotChange();return}(t.has("offsetTop")||t.has("offsetBottom"))&&(this.__rebuildObserver(),this.__attachHashScrollRoot()),(t.has("sidebarNavWidth")||t.has("sidebarHeight")||t.has("stackHeight")||t.has("sidebarNavTop")||t.has("contentPadding"))&&(this.__resolveInternals(),this.__requestEnsureContentFocusable(),this.__rebuildObserver()),t.has("activeId")&&(this.__syncingActiveId?this.__syncingActiveId=!1:this.__applyExternalActiveId())}__mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}__applySpacing(){const t=this.__mapSpacingToken(this.spacing),e=this.__mapSpacingToken(this.spacingTop)??t,s=this.__mapSpacingToken(this.spacingBottom)??t,i=this.__mapSpacingToken(this.spacingLeft),n=this.__mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-scrollspy-spacing-block-start",e):this.style.removeProperty("--scb-scrollspy-spacing-block-start"),s?this.style.setProperty("--scb-scrollspy-spacing-block-end",s):this.style.removeProperty("--scb-scrollspy-spacing-block-end"),i?this.style.setProperty("--scb-scrollspy-spacing-inline-start",i):this.style.removeProperty("--scb-scrollspy-spacing-inline-start"),n?this.style.setProperty("--scb-scrollspy-spacing-inline-end",n):this.style.removeProperty("--scb-scrollspy-spacing-inline-end")}__teardown(){this.__cancelScrollAnimation(),this.__cancelEnsureContentFocusable(),this.__cancelAutoOffsetMeasure(),this.__disconnectAutoOffsetObserver(),this.__disconnectObserver(),this.__navEl&&this.__navEl.removeEventListener("click",this.__onNavClickBound,!0),this.__fallbackScrollRoot&&this.__fallbackScrollRoot.removeEventListener?.("scroll",this.__onScrollFallbackBound),this.__fallbackScrollRoot=null,this.__entries.clear(),this.__links=[],this.__detachHashScrollRoot(),this.__cancelHashBaseline()}__cancelScrollAnimation(){this.__scrollAnimSeq++,this.__scrollRafId!==null&&(window.cancelAnimationFrame(this.__scrollRafId),this.__scrollRafId=null)}__cancelEnsureContentFocusable(){this.__focusableRafId!==null&&(window.cancelAnimationFrame(this.__focusableRafId),this.__focusableRafId=null)}__requestEnsureContentFocusable(){typeof window>"u"||(this.__cancelEnsureContentFocusable(),this.__focusableRafId=window.requestAnimationFrame(()=>{this.__focusableRafId=null,this.__ensureScrollableContentFocusable()}))}__ensureScrollableContentFocusable(){const t=this.__getScrollContainerEl();t instanceof HTMLElement&&(t.hasAttribute("tabindex")||(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)&&(t.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"]), [contenteditable=""], [contenteditable="true"]')||t.setAttribute("tabindex","0")))}__ensureMotionMeasureEl(){if(this.__motionMeasureEl)return;const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.width="0",t.style.height="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.visibility="hidden",this.__motionMeasureEl=t,this.renderRoot.appendChild(t)}__disconnectObserver(){this.__observer&&(this.__observer.disconnect(),this.__observer=null)}__resolveInternals(){this.__contentShellEl=this.layout==="sidebar"?this.renderRoot.querySelector(".sidebar-content"):this.layout==="stack"?this.renderRoot.querySelector(".stack-shell"):null}__resolveSlots(){const t=this.renderRoot.querySelector('slot[name="nav"]'),e=this.renderRoot.querySelector('slot[name="content"]'),s=t?.assignedElements({flatten:!0})??[],i=e?.assignedElements({flatten:!0})??[],n=(this.navSelector||"").trim(),o=n?this.__queryExternalNav(n):s[0],r=i[0];this.__navEl=o instanceof HTMLElement?o:null,this.__contentEl=r instanceof HTMLElement?r:null,this.__resolveInternals()}__queryExternalNav(t){try{return this.getRootNode?.()?.querySelector?.(t)??document.querySelector(t)}catch{return null}}__getScrollContainerEl(){return this.layout==="sidebar"||this.layout==="stack"?this.__contentShellEl:this.__contentEl}__isOffsetTopExplicit(){return this.hasAttribute("offset-top")}__getEffectiveOffsetTop(){const t=this.__isOffsetTopExplicit()?this.offsetTop:this.__autoOffsetTop;return Math.max(0,t)}__cancelAutoOffsetMeasure(){this.__autoOffsetRafId!==null&&(window.cancelAnimationFrame(this.__autoOffsetRafId),this.__autoOffsetRafId=null)}__disconnectAutoOffsetObserver(){this.__navResizeObserver&&(this.__navResizeObserver.disconnect(),this.__navResizeObserver=null)}__requestAutoOffsetMeasure(){if(!(typeof window>"u")){if(this.__isOffsetTopExplicit()){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}this.__autoOffsetRafId===null&&(this.__autoOffsetRafId=window.requestAnimationFrame(()=>{this.__autoOffsetRafId=null,this.__measureAutoOffset()}))}}__measureAutoOffset(){const t=this.__navEl;if(this.__isOffsetTopExplicit()){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}if(!(t?.tagName==="SCB-NAV"&&(t.hasAttribute("sticky")||t.sticky===!0))){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}const e=Math.max(0,Math.round(t.getBoundingClientRect().height));this.__setAutoOffsetTop(e),!this.__navResizeObserver&&"ResizeObserver"in window&&(this.__navResizeObserver=new ResizeObserver(()=>{this.__requestAutoOffsetMeasure()}),this.__navResizeObserver.observe(t))}__setAutoOffsetTop(t){const e=Math.max(0,t);Math.abs(e-this.__autoOffsetTop)<1||(this.__autoOffsetTop=e,this.__rebuildObserver(),this.__requestActiveRecalc())}__rebuildObserver(){this.__disconnectObserver(),this.__entries.clear();const t=this.__getObserverRoot(),e=`-${Math.max(0,this.__getEffectiveOffsetTop())}px 0px -${Math.max(0,this.offsetBottom)}px 0px`;if(!(typeof window>"u")){if("IntersectionObserver"in window){this.__observer=new IntersectionObserver(s=>this.__onIntersect(s),{root:t,rootMargin:e,threshold:[0,.1,.25,.5,.75,1]});for(const s of this.__links)this.__observer.observe(s.targetEl);this.__requestActiveRecalc();return}this.__enableFallbackScrollSpy()}}__enableFallbackScrollSpy(){const t=this.__getObserverRoot()??window;this.__fallbackScrollRoot=t,t.addEventListener?.("scroll",this.__onScrollFallbackBound,{passive:!0}),this.__requestActiveRecalc()}__getObserverRoot(){const t=this.__getScrollContainerEl();return t instanceof HTMLElement&&(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)?t:null}__collectLinks(){const t=this.__navEl,e=this.__contentEl;if(!t||!e){this.__links=[];return}const s=Array.from(t.querySelectorAll('scb-menu-item[item-href^="#"], scb-nav-item[href^="#"], scb-nav-item[data-href^="#"], a[href^="#"], button[data-href^="#"]')),i=[];for(const n of s){const o=this.__getHref(n);if(!o||!o.startsWith("#"))continue;const r=o.slice(1);if(!r)continue;const a=e.querySelector(`#${CSS.escape(r)}`);a&&i.push({id:r,navEl:n,targetEl:a})}this.__links=i}__getHref(t){return t.tagName==="A"?t.getAttribute("href")??"":t.tagName==="SCB-MENU-ITEM"?t.itemHref??t.getAttribute("item-href")??"":t.tagName==="BUTTON"?t.getAttribute("data-href")??"":t.tagName==="SCB-NAV-ITEM"?t.href||t.dataHref||t.getAttribute("href")||t.getAttribute("data-href")||"":t.getAttribute("href")??""}__onIntersect(t){for(const e of t){const s=e.target.id;s&&this.__entries.set(s,{id:s,isIntersecting:e.isIntersecting,top:e.boundingClientRect.top,ratio:e.intersectionRatio})}this.__requestActiveRecalc()}__requestActiveRecalc(){this.__rafId===null&&(this.__rafId=window.requestAnimationFrame(()=>{this.__rafId=null,this.__updateActiveFromEntries()}))}__updateActiveFromEntries(){if(this.__scrollRafId!==null)return;if(this.__entries.size===0){this.__updateActiveFromRects();return}const t=Array.from(this.__entries.values()).filter(n=>n.isIntersecting);if(t.length===0)return;const e=this.__getObserverRoot(),s=((e?e.getBoundingClientRect():null)?.top??0)+Math.max(0,this.__getEffectiveOffsetTop()),i=t.filter(n=>n.top>=s).sort((n,o)=>n.top-o.top)[0]??t.sort((n,o)=>o.top-n.top)[0];i?.id&&this.__setActiveId(i.id,{updateHash:this.updateHash})}__updateActiveFromRects(){if(this.__scrollRafId!==null||!this.__contentEl)return;const t=this.__getObserverRoot(),e=((t?t.getBoundingClientRect():null)?.top??0)+Math.max(0,this.__getEffectiveOffsetTop()),s=this.__links.map(n=>{const o=n.targetEl.getBoundingClientRect();return{id:n.id,top:o.top-e}}).filter(n=>Number.isFinite(n.top));if(s.length===0)return;const i=s.filter(n=>n.top>=0).sort((n,o)=>n.top-o.top)[0]??s.sort((n,o)=>o.top-n.top)[0];i?.id&&this.__setActiveId(i.id,{updateHash:this.updateHash})}__applyActiveId(t,e){const s=this.__links.find(i=>i.id===t);if(this.__navEl?.tagName==="SCB-NAV"?this.__navEl.activeHref=`#${t}`:s&&(this.__applyActiveToNav(s.navEl),this.__expandAncestors(s.navEl)),e.scrollToTarget){let i=s?.targetEl??null;if(!i){const n=this.__contentEl??this;try{i=n.querySelector(`#${CSS.escape(t)}`)}catch{i=n.querySelector(`[id="${t}"]`)}!i&&typeof document<"u"&&(i=document.getElementById(t))}i&&this.__scrollToTarget(i)}if(e.updateHash&&this.__hashAllowUpdates&&typeof history<"u")try{history.replaceState(null,"",`#${encodeURIComponent(t)}`)}catch{}this.dispatchEvent(new CustomEvent("scb-scrollspy-active-changed",{bubbles:!0,composed:!0,detail:{id:t}})),this.dispatchEvent(new CustomEvent("scbscrollspyactivechanged",{bubbles:!0,composed:!0,detail:{id:t}}))}__applyExternalActiveId(){const t=(this.activeId||"").trim();t&&(this.__links.length||this.__collectLinks(),this.__applyActiveId(t,{updateHash:this.updateHash,scrollToTarget:this.__slotsResolvedOnce}))}__setActiveId(t,e){!t||t===this.activeId||(this.__syncingActiveId=!0,this.activeId=t,this.__applyActiveId(t,{updateHash:e.updateHash,scrollToTarget:!1}))}__applyActiveToNav(t){const e=this.__navEl;if(!e)return;const s=Array.from(e.querySelectorAll('scb-menu-item[item-href^="#"], scb-nav-item[href^="#"], scb-nav-item[data-href^="#"], a[href^="#"], button[data-href^="#"]'));for(const i of s){const n=i===t;if(i.tagName==="SCB-MENU-ITEM"){const o=i;typeof o.selected=="boolean"&&(o.selected=n),n&&i.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:i}}))}else i.tagName==="A"||i.tagName==="BUTTON"?n?i.setAttribute("aria-current","location"):i.removeAttribute("aria-current"):i.tagName==="SCB-NAV-ITEM"&&(n?(i.setAttribute("aria-current","location"),i.setAttribute("data-active","true")):(i.removeAttribute("aria-current"),i.removeAttribute("data-active")))}}__expandAncestors(t){let e=t;for(;e;){if(e.tagName==="SCB-MENU-ITEM"){const s=e;typeof s.expanded=="boolean"&&(s.expanded=!0)}e=e.parentElement}}__scrollToTarget(t){const e=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches,s=this.__getScrollContainerEl();if(s instanceof HTMLElement&&s.scrollHeight>s.clientHeight+1){const l=this.__getScrollTopInContainer(t,s)-this.__getEffectiveOffsetTop(),d=Math.max(0,s.scrollHeight-s.clientHeight),u=Math.min(d,Math.max(0,l));if(e){s.scrollTop=u;return}this.__animateScroll({get:()=>s.scrollTop,set:f=>{s.scrollTop=f},max:d,to:u});return}if(!(t instanceof HTMLElement))return;const i=t.getBoundingClientRect(),n=(window.scrollY||window.pageYOffset||0)+i.top-this.__getEffectiveOffsetTop(),o=document.documentElement,r=Math.max(0,o.scrollHeight-window.innerHeight),a=Math.min(r,Math.max(0,n));if(e){window.scrollTo(0,a);return}this.__animateScroll({get:()=>window.scrollY||window.pageYOffset||0,set:l=>window.scrollTo(0,l),max:r,to:a})}__getScrollTopInContainer(t,e){const s=e.getBoundingClientRect(),i=t.getBoundingClientRect();return e.scrollTop+(i.top-s.top)}__animateScroll(t){const e=t.get(),s=Math.min(t.max,Math.max(0,t.to));if(!Number.isFinite(e)||!Number.isFinite(s))return;if(Math.abs(s-e)<1){t.set(s);return}this.__cancelScrollAnimation(),this.__ensureMotionMeasureEl();const i=++this.__scrollAnimSeq,n=Math.abs(s-e),o=this.__getScrollDurationMs(n),r=this.__getScrollEasingFn(),a=performance.now(),l=d=>{if(i!==this.__scrollAnimSeq)return;const u=o<=0?1:Math.min(1,(d-a)/o),f=r(u);t.set(e+(s-e)*f),u<1?this.__scrollRafId=window.requestAnimationFrame(l):this.__scrollRafId=null};this.__scrollRafId=window.requestAnimationFrame(l)}__getScrollDurationMs(t){const e=this.__resolveTimeMs("var(--motion-duration-medium, 300ms)")??300,s=this.__resolveTimeMs("var(--motion-duration-long, 500ms)")??500,i=this.__resolveTimeMs("var(--motion-duration-extra-long, 700ms)")??700,n=Math.min(1,Math.max(0,t/1800)),o=e+(s-e)*n;return Math.min(i,Math.max(e,o))}__getScrollEasingFn(){const t=this.__resolveTimingFunction("var(--motion-easing-emphasized-decelerate, var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98)))")??"cubic-bezier(0.05, 0.7, 0.1, 1)";return this.__parseEasingFunction(t)??(e=>e)}__resolveTimeMs(t){const e=this.__motionMeasureEl;if(!e)return null;e.style.transitionDuration=t;const s=getComputedStyle(e).transitionDuration.split(",")[0]?.trim()??"";return this.__parseTimeToMs(s)}__resolveTimingFunction(t){const e=this.__motionMeasureEl;return e?(e.style.transitionTimingFunction=t,getComputedStyle(e).transitionTimingFunction.split(",")[0]?.trim()??null):null}__parseTimeToMs(t){const e=t.trim();if(!e)return null;const s=parseFloat(e);return Number.isFinite(s)?e.endsWith("ms")?s:e.endsWith("s")?s*1e3:null:null}__parseEasingFunction(t){const e=t.trim();if(!e)return null;if(e==="linear")return l=>l;const s=e.match(/cubic-bezier\(([^)]+)\)/i);if(!s)return null;const i=s[1].split(",").map(l=>parseFloat(l.trim())).filter(l=>Number.isFinite(l));if(i.length!==4)return null;const[n,o,r,a]=i;return this.__cubicBezier(n,o,r,a)}__cubicBezier(t,e,s,i){const n=3*t,o=3*(s-t)-n,r=1-n-o,a=3*e,l=3*(i-e)-a,d=1-a-l,u=c=>((r*c+o)*c+n)*c,f=c=>((d*c+l)*c+a)*c,A=c=>(3*r*c+2*o)*c+n,T=c=>{let _=c;for(let p=0;p<8;p++){const y=u(_)-c;if(Math.abs(y)<1e-6)return _;const S=A(_);if(Math.abs(S)<1e-6)break;_=_-y/S}let m=0,v=1;for(_=c;m<v;){const p=u(_)-c;if(Math.abs(p)<1e-6)return _;p>0?v=_:m=_,_=(v+m)/2}return _};return c=>f(T(Math.min(1,Math.max(0,c))))}__detachHashScrollRoot(){if(!this.__hashScrollRoot)return;const t=this.__hashScrollRoot;try{t instanceof Window?t.removeEventListener("scroll",this.__onHashScrollBound):t.removeEventListener("scroll",this.__onHashScrollBound)}catch{}this.__hashScrollRoot=null}__cancelHashBaseline(){this.__hashBaselineRafId!==null&&(window.cancelAnimationFrame(this.__hashBaselineRafId),this.__hashBaselineRafId=null),this.__hashBaselineReady=!1}__attachHashScrollRoot(){this.__detachHashScrollRoot();const t=this.__getObserverRoot()??window;this.__hashScrollRoot=t;try{t.addEventListener("scroll",this.__onHashScrollBound,{passive:!0})}catch{}this.__hashAllowUpdates=!1,this.__scheduleHashBaseline()}__scheduleHashBaseline(){this.__cancelHashBaseline();const t=()=>{this.__hashBaselinePos=this.__getHashScrollPos(),this.__hashBaselineReady=!0,this.__hashBaselineRafId=null};this.__hashBaselineRafId=window.requestAnimationFrame(()=>{this.__hashBaselineRafId=window.requestAnimationFrame(t)})}__getHashScrollPos(){const t=this.__hashScrollRoot;if(t instanceof Window)return t.scrollY||t.pageYOffset||0;if(t&&"scrollTop"in t){const e=t;return typeof e.scrollTop=="number"?e.scrollTop:0}return 0}__onHashScroll(){if(!this.updateHash||this.__hashSuspend||this.__hashAllowUpdates||!this.__hashBaselineReady)return;const t=this.__getHashScrollPos();Math.abs(t-this.__hashBaselinePos)>2&&(this.__hashAllowUpdates=!0)}__jumpToTarget(t){const e=this.__getScrollContainerEl();if(e instanceof HTMLElement&&e.scrollHeight>e.clientHeight+1){const a=this.__getScrollTopInContainer(t,e)-this.__getEffectiveOffsetTop(),l=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop=Math.min(l,Math.max(0,a));return}if(!(t instanceof HTMLElement))return;const s=t.getBoundingClientRect(),i=(window.scrollY||window.pageYOffset||0)+s.top-this.__getEffectiveOffsetTop(),n=document.documentElement,o=Math.max(0,n.scrollHeight-window.innerHeight),r=Math.min(o,Math.max(0,i));window.scrollTo(0,r)}__applyInitialHashIfAny(){if(this.__hashInitialApplied)return;const t=typeof window<"u"?window.location.hash:"";if(!t||t.length<2)return;let e="";try{e=decodeURIComponent(t.slice(1))}catch{e=t.slice(1)}if(!e)return;const s=this.__links.find(i=>i.id===e);if(s?.targetEl){this.__hashInitialApplied=!0,this.__hashSuspend=!0;try{this.__jumpToTarget(s.targetEl),this.__setActiveId(e,{updateHash:!1})}finally{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this.__hashSuspend=!1})})}}}__onNavClick(t){const e=this.__navEl,s=this.__contentEl;if(!e||!s)return;const i=t.composedPath().find(a=>a instanceof Element&&(a.tagName==="SCB-MENU-ITEM"||a.tagName==="SCB-NAV-ITEM"||a.tagName==="A"||a.tagName==="BUTTON"));if(!i)return;const n=this.__getHref(i);if(!n||!n.startsWith("#"))return;const o=n.slice(1);if(!o)return;const r=s.querySelector(`#${CSS.escape(o)}`);r&&(t.preventDefault(),this.__hashAllowUpdates=!0,this.__scrollToTarget(r),this.__setActiveId(o,{updateHash:this.updateHash}))}render(){if(this.layout==="sidebar")return g`
1
+ import{h as w,m as R,v as g,y as M}from"../../vendor/vendor.js";import"../../vendor/vendor-lit.js";import{t as O}from"../../vendor/decorate.js";(function(){try{var h=typeof globalThis<"u"?globalThis:window;if(!h.__scb_ce_guard_installed__){h.__scb_ce_guard_installed__=!0;var t=customElements.define.bind(customElements);customElements.define=function(e,s,i){try{customElements.get(e)||t(e,s,i)}catch(o){var n=String(o||"");if(n.indexOf("already been used")===-1&&n.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var m,E=(m=class extends w{constructor(...t){super(...t),this.navSelector="",this.offsetTop=0,this.offsetBottom=0,this.updateHash=!0,this.activeId="",this.layout="",this.sidebarNavWidth="320px",this.sidebarHeight="560px",this.stackHeight="",this.sidebarNavTop="0px",this.contentPadding="0px",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0,this.__navEl=null,this.__contentEl=null,this.__contentShellEl=null,this.__links=[],this.__observer=null,this.__fallbackScrollRoot=null,this.__entries=new Map,this.__rafId=null,this.__scrollRafId=null,this.__hashAllowUpdates=!1,this.__hashBaselineReady=!1,this.__hashBaselinePos=0,this.__hashBaselineRafId=null,this.__hashScrollRoot=null,this.__hashSuspend=!1,this.__hashInitialApplied=!1,this.__onHashScrollBound=()=>this.__onHashScroll(),this.__scrollAnimSeq=0,this.__syncingActiveId=!1,this.__slotsResolvedOnce=!1,this.__motionMeasureEl=null,this.__focusableRafId=null,this.__autoOffsetTop=0,this.__autoOffsetRafId=null,this.__navResizeObserver=null,this.__onNavClickBound=e=>this.__onNavClick(e),this.__onScrollFallbackBound=()=>this.__updateActiveFromRects(),this.__onResizeBound=()=>{this.__requestActiveRecalc(),this.__requestAutoOffsetMeasure()},this.__onSlotChange=()=>{const e=this.__navEl;this.__teardown(),this.__resolveSlots(),this.__requestEnsureContentFocusable(),this.__navEl&&this.__navEl.addEventListener("click",this.__onNavClickBound,!0),(e!==this.__navEl||!this.__links.length)&&this.__collectLinks(),this.__requestAutoOffsetMeasure(),this.__rebuildObserver(),this.__attachHashScrollRoot(),this.__applyInitialHashIfAny(),!this.__hashInitialApplied&&this.activeId&&this.__applyActiveId(this.activeId,{updateHash:!1,scrollToTarget:!1}),this.__slotsResolvedOnce=!0}}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.__onResizeBound,{passive:!0})}firstUpdated(){this.__ensureMotionMeasureEl(),this.__resolveInternals(),this.__requestEnsureContentFocusable(),this.__requestAutoOffsetMeasure(),this.__applySpacing()}disconnectedCallback(){window.removeEventListener("resize",this.__onResizeBound),this.__teardown(),super.disconnectedCallback()}updated(t){if((t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.__applySpacing(),t.has("navSelector")){this.__onSlotChange();return}if(t.has("layout")){this.__onSlotChange();return}(t.has("offsetTop")||t.has("offsetBottom"))&&(this.__rebuildObserver(),this.__attachHashScrollRoot()),(t.has("sidebarNavWidth")||t.has("sidebarHeight")||t.has("stackHeight")||t.has("sidebarNavTop")||t.has("contentPadding"))&&(this.__resolveInternals(),this.__requestEnsureContentFocusable(),this.__rebuildObserver()),t.has("activeId")&&(this.__syncingActiveId?this.__syncingActiveId=!1:this.__applyExternalActiveId())}__mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}__applySpacing(){const t=this.__mapSpacingToken(this.spacing),e=this.__mapSpacingToken(this.spacingTop)??t,s=this.__mapSpacingToken(this.spacingBottom)??t,i=this.__mapSpacingToken(this.spacingLeft),n=this.__mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-scrollspy-spacing-block-start",e):this.style.removeProperty("--scb-scrollspy-spacing-block-start"),s?this.style.setProperty("--scb-scrollspy-spacing-block-end",s):this.style.removeProperty("--scb-scrollspy-spacing-block-end"),i?this.style.setProperty("--scb-scrollspy-spacing-inline-start",i):this.style.removeProperty("--scb-scrollspy-spacing-inline-start"),n?this.style.setProperty("--scb-scrollspy-spacing-inline-end",n):this.style.removeProperty("--scb-scrollspy-spacing-inline-end")}__teardown(){this.__cancelScrollAnimation(),this.__cancelEnsureContentFocusable(),this.__cancelAutoOffsetMeasure(),this.__disconnectAutoOffsetObserver(),this.__disconnectObserver(),this.__navEl&&this.__navEl.removeEventListener("click",this.__onNavClickBound,!0),this.__fallbackScrollRoot&&this.__fallbackScrollRoot.removeEventListener?.("scroll",this.__onScrollFallbackBound),this.__fallbackScrollRoot=null,this.__entries.clear(),this.__links=[],this.__detachHashScrollRoot(),this.__cancelHashBaseline()}__cancelScrollAnimation(){this.__scrollAnimSeq++,this.__scrollRafId!==null&&(window.cancelAnimationFrame(this.__scrollRafId),this.__scrollRafId=null)}__cancelEnsureContentFocusable(){this.__focusableRafId!==null&&(window.cancelAnimationFrame(this.__focusableRafId),this.__focusableRafId=null)}__requestEnsureContentFocusable(){typeof window>"u"||(this.__cancelEnsureContentFocusable(),this.__focusableRafId=window.requestAnimationFrame(()=>{this.__focusableRafId=null,this.__ensureScrollableContentFocusable()}))}__ensureScrollableContentFocusable(){const t=this.__getScrollContainerEl();t instanceof HTMLElement&&(t.hasAttribute("tabindex")||(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)&&(t.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"]), [contenteditable=""], [contenteditable="true"]')||t.setAttribute("tabindex","0")))}__ensureMotionMeasureEl(){if(this.__motionMeasureEl)return;const t=document.createElement("span");t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.width="0",t.style.height="0",t.style.overflow="hidden",t.style.pointerEvents="none",t.style.visibility="hidden",this.__motionMeasureEl=t,this.renderRoot.appendChild(t)}__disconnectObserver(){this.__observer&&(this.__observer.disconnect(),this.__observer=null)}__resolveInternals(){this.__contentShellEl=this.layout==="sidebar"?this.renderRoot.querySelector(".sidebar-content"):this.layout==="stack"?this.renderRoot.querySelector(".stack-shell"):null}__resolveSlots(){const t=this.renderRoot.querySelector('slot[name="nav"]'),e=this.renderRoot.querySelector('slot[name="content"]'),s=t?.assignedElements({flatten:!0})??[],i=e?.assignedElements({flatten:!0})??[],n=(this.navSelector||"").trim(),o=n?this.__queryExternalNav(n):s[0],r=i[0];this.__navEl=o instanceof HTMLElement?o:null,this.__contentEl=r instanceof HTMLElement?r:null,this.__resolveInternals()}__queryExternalNav(t){try{return this.getRootNode?.()?.querySelector?.(t)??document.querySelector(t)}catch{return null}}__getScrollContainerEl(){return this.layout==="sidebar"||this.layout==="stack"?this.__contentShellEl:this.__contentEl}__isOffsetTopExplicit(){return this.hasAttribute("offset-top")}__getEffectiveOffsetTop(){const t=this.__isOffsetTopExplicit()?this.offsetTop:this.__autoOffsetTop;return Math.max(0,t)}__cancelAutoOffsetMeasure(){this.__autoOffsetRafId!==null&&(window.cancelAnimationFrame(this.__autoOffsetRafId),this.__autoOffsetRafId=null)}__disconnectAutoOffsetObserver(){this.__navResizeObserver&&(this.__navResizeObserver.disconnect(),this.__navResizeObserver=null)}__requestAutoOffsetMeasure(){if(!(typeof window>"u")){if(this.__isOffsetTopExplicit()){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}this.__autoOffsetRafId===null&&(this.__autoOffsetRafId=window.requestAnimationFrame(()=>{this.__autoOffsetRafId=null,this.__measureAutoOffset()}))}}__measureAutoOffset(){const t=this.__navEl;if(this.__isOffsetTopExplicit()){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}if(!(t?.tagName==="SCB-NAV"&&(t.hasAttribute("sticky")||t.sticky===!0))){this.__setAutoOffsetTop(0),this.__disconnectAutoOffsetObserver();return}const e=Math.max(0,Math.round(t.getBoundingClientRect().height));this.__setAutoOffsetTop(e),!this.__navResizeObserver&&"ResizeObserver"in window&&(this.__navResizeObserver=new ResizeObserver(()=>{this.__requestAutoOffsetMeasure()}),this.__navResizeObserver.observe(t))}__setAutoOffsetTop(t){const e=Math.max(0,t);Math.abs(e-this.__autoOffsetTop)<1||(this.__autoOffsetTop=e,this.__rebuildObserver(),this.__requestActiveRecalc())}__rebuildObserver(){this.__disconnectObserver(),this.__entries.clear();const t=this.__getObserverRoot(),e=`-${Math.max(0,this.__getEffectiveOffsetTop())}px 0px -${Math.max(0,this.offsetBottom)}px 0px`;if(!(typeof window>"u")){if("IntersectionObserver"in window){this.__observer=new IntersectionObserver(s=>this.__onIntersect(s),{root:t,rootMargin:e,threshold:[0,.1,.25,.5,.75,1]});for(const s of this.__links)this.__observer.observe(s.targetEl);this.__requestActiveRecalc();return}this.__enableFallbackScrollSpy()}}__enableFallbackScrollSpy(){const t=this.__getObserverRoot()??window;this.__fallbackScrollRoot=t,t.addEventListener?.("scroll",this.__onScrollFallbackBound,{passive:!0}),this.__requestActiveRecalc()}__getObserverRoot(){const t=this.__getScrollContainerEl();return t instanceof HTMLElement&&(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1)?t:null}__collectLinks(){const t=this.__navEl,e=this.__contentEl;if(!t||!e){this.__links=[];return}const s=Array.from(t.querySelectorAll('scb-menu-item[item-href^="#"], scb-nav-item[href^="#"], scb-nav-item[data-href^="#"], a[href^="#"], button[data-href^="#"]')),i=[];for(const n of s){const o=this.__getHref(n);if(!o||!o.startsWith("#"))continue;const r=o.slice(1);if(!r)continue;const a=e.querySelector(`#${CSS.escape(r)}`);a&&i.push({id:r,navEl:n,targetEl:a})}this.__links=i}__getHref(t){return t.tagName==="A"?t.getAttribute("href")??"":t.tagName==="SCB-MENU-ITEM"?t.itemHref??t.getAttribute("item-href")??"":t.tagName==="BUTTON"?t.getAttribute("data-href")??"":t.tagName==="SCB-NAV-ITEM"?t.href||t.dataHref||t.getAttribute("href")||t.getAttribute("data-href")||"":t.getAttribute("href")??""}__onIntersect(t){for(const e of t){const s=e.target.id;s&&this.__entries.set(s,{id:s,isIntersecting:e.isIntersecting,top:e.boundingClientRect.top,ratio:e.intersectionRatio})}this.__requestActiveRecalc()}__requestActiveRecalc(){this.__rafId===null&&(this.__rafId=window.requestAnimationFrame(()=>{this.__rafId=null,this.__updateActiveFromEntries()}))}__updateActiveFromEntries(){if(this.__scrollRafId!==null)return;if(this.__entries.size===0){this.__updateActiveFromRects();return}const t=Array.from(this.__entries.values()).filter(n=>n.isIntersecting);if(t.length===0)return;const e=this.__getObserverRoot(),s=((e?e.getBoundingClientRect():null)?.top??0)+Math.max(0,this.__getEffectiveOffsetTop()),i=t.filter(n=>n.top>=s).sort((n,o)=>n.top-o.top)[0]??t.sort((n,o)=>o.top-n.top)[0];i?.id&&this.__setActiveId(i.id,{updateHash:this.updateHash})}__updateActiveFromRects(){if(this.__scrollRafId!==null||!this.__contentEl)return;const t=this.__getObserverRoot(),e=((t?t.getBoundingClientRect():null)?.top??0)+Math.max(0,this.__getEffectiveOffsetTop()),s=this.__links.map(n=>{const o=n.targetEl.getBoundingClientRect();return{id:n.id,top:o.top-e}}).filter(n=>Number.isFinite(n.top));if(s.length===0)return;const i=s.filter(n=>n.top>=0).sort((n,o)=>n.top-o.top)[0]??s.sort((n,o)=>o.top-n.top)[0];i?.id&&this.__setActiveId(i.id,{updateHash:this.updateHash})}__applyActiveId(t,e){const s=this.__links.find(i=>i.id===t);if(this.__navEl?.tagName==="SCB-NAV"?this.__navEl.activeHref=`#${t}`:s&&(this.__applyActiveToNav(s.navEl),this.__expandAncestors(s.navEl)),e.scrollToTarget){let i=s?.targetEl??null;if(!i){const n=this.__contentEl??this;try{i=n.querySelector(`#${CSS.escape(t)}`)}catch{i=n.querySelector(`[id="${t}"]`)}!i&&typeof document<"u"&&(i=document.getElementById(t))}i&&this.__scrollToTarget(i)}if(e.updateHash&&this.__hashAllowUpdates&&typeof history<"u")try{history.replaceState(null,"",`#${encodeURIComponent(t)}`)}catch{}this.dispatchEvent(new CustomEvent("scb-scrollspy-active-changed",{bubbles:!0,composed:!0,detail:{id:t}})),this.dispatchEvent(new CustomEvent("scbscrollspyactivechanged",{bubbles:!0,composed:!0,detail:{id:t}}))}__applyExternalActiveId(){const t=(this.activeId||"").trim();t&&(this.__links.length||this.__collectLinks(),this.__applyActiveId(t,{updateHash:this.updateHash,scrollToTarget:this.__slotsResolvedOnce}))}__setActiveId(t,e){!t||t===this.activeId||(this.__syncingActiveId=!0,this.activeId=t,this.__applyActiveId(t,{updateHash:e.updateHash,scrollToTarget:!1}))}__applyActiveToNav(t){const e=this.__navEl;if(!e)return;const s=Array.from(e.querySelectorAll('scb-menu-item[item-href^="#"], scb-nav-item[href^="#"], scb-nav-item[data-href^="#"], a[href^="#"], button[data-href^="#"]'));for(const i of s){const n=i===t;if(i.tagName==="SCB-MENU-ITEM"){const o=i;typeof o.selected=="boolean"&&(o.selected=n),n&&i.dispatchEvent(new CustomEvent("scb-menu-select",{bubbles:!0,composed:!0,detail:{item:i}}))}else i.tagName==="A"||i.tagName==="BUTTON"?n?i.setAttribute("aria-current","location"):i.removeAttribute("aria-current"):i.tagName==="SCB-NAV-ITEM"&&(n?(i.setAttribute("aria-current","location"),i.setAttribute("data-active","true")):(i.removeAttribute("aria-current"),i.removeAttribute("data-active")))}}__expandAncestors(t){let e=t;for(;e;){if(e.tagName==="SCB-MENU-ITEM"){const s=e;typeof s.expanded=="boolean"&&(s.expanded=!0)}e=e.parentElement}}__scrollToTarget(t){const e=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches,s=this.__getScrollContainerEl();if(s instanceof HTMLElement&&s.scrollHeight>s.clientHeight+1){const l=this.__getScrollTopInContainer(t,s)-this.__getEffectiveOffsetTop(),d=Math.max(0,s.scrollHeight-s.clientHeight),u=Math.min(d,Math.max(0,l));if(e){s.scrollTop=u;return}this.__animateScroll({get:()=>s.scrollTop,set:f=>{s.scrollTop=f},max:d,to:u});return}if(!(t instanceof HTMLElement))return;const i=t.getBoundingClientRect(),n=(window.scrollY||window.pageYOffset||0)+i.top-this.__getEffectiveOffsetTop(),o=document.documentElement,r=Math.max(0,o.scrollHeight-window.innerHeight),a=Math.min(r,Math.max(0,n));if(e){window.scrollTo(0,a);return}this.__animateScroll({get:()=>window.scrollY||window.pageYOffset||0,set:l=>window.scrollTo(0,l),max:r,to:a})}__getScrollTopInContainer(t,e){const s=e.getBoundingClientRect(),i=t.getBoundingClientRect();return e.scrollTop+(i.top-s.top)}__animateScroll(t){const e=t.get(),s=Math.min(t.max,Math.max(0,t.to));if(!Number.isFinite(e)||!Number.isFinite(s))return;if(Math.abs(s-e)<1){t.set(s);return}this.__cancelScrollAnimation(),this.__ensureMotionMeasureEl();const i=++this.__scrollAnimSeq,n=Math.abs(s-e),o=this.__getScrollDurationMs(n),r=this.__getScrollEasingFn(),a=performance.now(),l=d=>{if(i!==this.__scrollAnimSeq)return;const u=o<=0?1:Math.min(1,(d-a)/o),f=r(u);t.set(e+(s-e)*f),u<1?this.__scrollRafId=window.requestAnimationFrame(l):this.__scrollRafId=null};this.__scrollRafId=window.requestAnimationFrame(l)}__getScrollDurationMs(t){const e=this.__resolveTimeMs("var(--motion-duration-medium, 300ms)")??300,s=this.__resolveTimeMs("var(--motion-duration-long, 500ms)")??500,i=this.__resolveTimeMs("var(--motion-duration-extra-long, 700ms)")??700,n=Math.min(1,Math.max(0,t/1800)),o=e+(s-e)*n;return Math.min(i,Math.max(e,o))}__getScrollEasingFn(){const t=this.__resolveTimingFunction("var(--motion-easing-emphasized-decelerate, var(--motion-easing-emphasized, cubic-bezier(.69,.16,.2,.98)))")??"cubic-bezier(0.05, 0.7, 0.1, 1)";return this.__parseEasingFunction(t)??(e=>e)}__resolveTimeMs(t){const e=this.__motionMeasureEl;if(!e)return null;e.style.transitionDuration=t;const s=getComputedStyle(e).transitionDuration.split(",")[0]?.trim()??"";return this.__parseTimeToMs(s)}__resolveTimingFunction(t){const e=this.__motionMeasureEl;return e?(e.style.transitionTimingFunction=t,getComputedStyle(e).transitionTimingFunction.split(",")[0]?.trim()??null):null}__parseTimeToMs(t){const e=t.trim();if(!e)return null;const s=parseFloat(e);return Number.isFinite(s)?e.endsWith("ms")?s:e.endsWith("s")?s*1e3:null:null}__parseEasingFunction(t){const e=t.trim();if(!e)return null;if(e==="linear")return l=>l;const s=e.match(/cubic-bezier\(([^)]+)\)/i);if(!s)return null;const i=s[1].split(",").map(l=>parseFloat(l.trim())).filter(l=>Number.isFinite(l));if(i.length!==4)return null;const[n,o,r,a]=i;return this.__cubicBezier(n,o,r,a)}__cubicBezier(t,e,s,i){const n=3*t,o=3*(s-t)-n,r=1-n-o,a=3*e,l=3*(i-e)-a,d=1-a-l,u=c=>((r*c+o)*c+n)*c,f=c=>((d*c+l)*c+a)*c,A=c=>(3*r*c+2*o)*c+n,T=c=>{let _=c;for(let p=0;p<8;p++){const y=u(_)-c;if(Math.abs(y)<1e-6)return _;const S=A(_);if(Math.abs(S)<1e-6)break;_=_-y/S}let b=0,v=1;for(_=c;b<v;){const p=u(_)-c;if(Math.abs(p)<1e-6)return _;p>0?v=_:b=_,_=(v+b)/2}return _};return c=>f(T(Math.min(1,Math.max(0,c))))}__detachHashScrollRoot(){if(!this.__hashScrollRoot)return;const t=this.__hashScrollRoot;try{t instanceof Window?t.removeEventListener("scroll",this.__onHashScrollBound):t.removeEventListener("scroll",this.__onHashScrollBound)}catch{}this.__hashScrollRoot=null}__cancelHashBaseline(){this.__hashBaselineRafId!==null&&(window.cancelAnimationFrame(this.__hashBaselineRafId),this.__hashBaselineRafId=null),this.__hashBaselineReady=!1}__attachHashScrollRoot(){this.__detachHashScrollRoot();const t=this.__getObserverRoot()??window;this.__hashScrollRoot=t;try{t.addEventListener("scroll",this.__onHashScrollBound,{passive:!0})}catch{}this.__hashAllowUpdates=!1,this.__scheduleHashBaseline()}__scheduleHashBaseline(){this.__cancelHashBaseline();const t=()=>{this.__hashBaselinePos=this.__getHashScrollPos(),this.__hashBaselineReady=!0,this.__hashBaselineRafId=null};this.__hashBaselineRafId=window.requestAnimationFrame(()=>{this.__hashBaselineRafId=window.requestAnimationFrame(t)})}__getHashScrollPos(){const t=this.__hashScrollRoot;if(t instanceof Window)return t.scrollY||t.pageYOffset||0;if(t&&"scrollTop"in t){const e=t;return typeof e.scrollTop=="number"?e.scrollTop:0}return 0}__onHashScroll(){if(!this.updateHash||this.__hashSuspend||this.__hashAllowUpdates||!this.__hashBaselineReady)return;const t=this.__getHashScrollPos();Math.abs(t-this.__hashBaselinePos)>2&&(this.__hashAllowUpdates=!0)}__jumpToTarget(t){const e=this.__getScrollContainerEl();if(e instanceof HTMLElement&&e.scrollHeight>e.clientHeight+1){const a=this.__getScrollTopInContainer(t,e)-this.__getEffectiveOffsetTop(),l=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop=Math.min(l,Math.max(0,a));return}if(!(t instanceof HTMLElement))return;const s=t.getBoundingClientRect(),i=(window.scrollY||window.pageYOffset||0)+s.top-this.__getEffectiveOffsetTop(),n=document.documentElement,o=Math.max(0,n.scrollHeight-window.innerHeight),r=Math.min(o,Math.max(0,i));window.scrollTo(0,r)}__applyInitialHashIfAny(){if(this.__hashInitialApplied)return;const t=typeof window<"u"?window.location.hash:"";if(!t||t.length<2)return;let e="";try{e=decodeURIComponent(t.slice(1))}catch{e=t.slice(1)}if(!e)return;const s=this.__links.find(i=>i.id===e);if(s?.targetEl){this.__hashInitialApplied=!0,this.__hashSuspend=!0;try{this.__jumpToTarget(s.targetEl),this.__setActiveId(e,{updateHash:!1})}finally{window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this.__hashSuspend=!1})})}}}__onNavClick(t){const e=this.__navEl,s=this.__contentEl;if(!e||!s)return;const i=t.composedPath().find(a=>a instanceof Element&&(a.tagName==="SCB-MENU-ITEM"||a.tagName==="SCB-NAV-ITEM"||a.tagName==="A"||a.tagName==="BUTTON"));if(!i)return;const n=this.__getHref(i);if(!n||!n.startsWith("#"))return;const o=n.slice(1);if(!o)return;const r=s.querySelector(`#${CSS.escape(o)}`);r&&(t.preventDefault(),this.__hashAllowUpdates=!0,this.__scrollToTarget(r),this.__setActiveId(o,{updateHash:this.updateHash}))}render(){if(this.layout==="sidebar")return g`
2
2
  <div class="sidebar-layout" style=${[`--_scb-scrollspy-sidebar-nav-width: ${this.sidebarNavWidth}`,`--_scb-scrollspy-sidebar-height: ${this.sidebarHeight}`,`--_scb-scrollspy-sidebar-nav-top: ${this.sidebarNavTop}`,`--_scb-scrollspy-content-padding: ${this.contentPadding}`].join("; ")}>
3
3
  <div class="sidebar-nav">
4
4
  <slot name="nav" @slotchange=${this.__onSlotChange}></slot>
@@ -17,63 +17,4 @@ import{_ as w,b as R,g as M,y as g}from"../../vendor/vendor.js";import"../../ven
17
17
  `}return g`
18
18
  <slot name="nav" @slotchange=${this.__onSlotChange}></slot>
19
19
  <slot name="content" @slotchange=${this.__onSlotChange}></slot>
20
- `}},b.properties={navSelector:{type:String,attribute:"nav-selector"},offsetTop:{type:Number,attribute:"offset-top"},offsetBottom:{type:Number,attribute:"offset-bottom"},updateHash:{type:Boolean,attribute:"update-hash",converter:{fromAttribute:h=>{if(h===null)return!0;const t=h.trim().toLowerCase();return!(t==="false"||t==="0"||t==="no")},toAttribute:h=>h?"":null}},activeId:{type:String,attribute:"active-id",reflect:!0},layout:{type:String,reflect:!0},sidebarNavWidth:{type:String,attribute:"sidebar-nav-width"},sidebarHeight:{type:String,attribute:"sidebar-height"},stackHeight:{type:String,attribute:"stack-height"},sidebarNavTop:{type:String,attribute:"sidebar-nav-top"},contentPadding:{type:String,attribute:"content-padding"},spacing:{type:String,reflect:!0},spacingTop:{type:String,attribute:"spacing-top",reflect:!0},spacingBottom:{type:String,attribute:"spacing-bottom",reflect:!0},spacingLeft:{type:String,attribute:"spacing-left",reflect:!0},spacingRight:{type:String,attribute:"spacing-right",reflect:!0}},b.styles=R`
21
- :host {
22
- display: contents;
23
- }
24
-
25
- :host([layout='sidebar']) {
26
- display: block;
27
- margin-block-start: var(--scb-scrollspy-spacing-block-start, 0);
28
- margin-block-end: var(--scb-scrollspy-spacing-block-end, 0);
29
- margin-inline-start: var(--scb-scrollspy-spacing-inline-start, 0);
30
- margin-inline-end: var(--scb-scrollspy-spacing-inline-end, 0);
31
- }
32
-
33
- :host([layout='stack']) {
34
- display: block;
35
- margin-block-start: var(--scb-scrollspy-spacing-block-start, 0);
36
- margin-block-end: var(--scb-scrollspy-spacing-block-end, 0);
37
- margin-inline-start: var(--scb-scrollspy-spacing-inline-start, 0);
38
- margin-inline-end: var(--scb-scrollspy-spacing-inline-end, 0);
39
- }
40
-
41
- .stack-shell {
42
- max-height: var(--_scb-scrollspy-stack-height, none);
43
- overflow: var(--_scb-scrollspy-stack-overflow, visible);
44
- border-radius: 16px;
45
- font-family: var(--brand-font);
46
- box-sizing: border-box;
47
- }
48
-
49
- .stack-content {
50
- padding: var(--_scb-scrollspy-content-padding, 0px);
51
- box-sizing: border-box;
52
- }
53
- .sidebar-layout {
54
- display: grid;
55
- grid-template-columns: var(--_scb-scrollspy-sidebar-nav-width, 320px) minmax(0, 1fr);
56
- gap: var(--spacing-6, 20px);
57
- align-items: start;
58
- }
59
-
60
- .sidebar-nav {
61
- height: var(--_scb-scrollspy-sidebar-height, 560px);
62
- overflow: auto;
63
- position: sticky;
64
- top: var(--_scb-scrollspy-sidebar-nav-top, 0px);
65
- }
66
-
67
- .sidebar-content {
68
- height: var(--_scb-scrollspy-sidebar-height, 560px);
69
- overflow: auto;
70
- border-radius: 16px;
71
- font-family: var(--brand-font);
72
- padding: var(--_scb-scrollspy-content-padding, 0px);
73
- box-sizing: border-box;
74
- }
75
-
76
- :host([layout='sidebar']) ::slotted(scb-menu) {
77
- border-radius: var(--scb-menu-surface-radius, 16px);
78
- }
79
- `,b);E=O([M("scb-scrollspy")],E);
20
+ `}},m.properties={navSelector:{type:String,attribute:"nav-selector"},offsetTop:{type:Number,attribute:"offset-top"},offsetBottom:{type:Number,attribute:"offset-bottom"},updateHash:{type:Boolean,attribute:"update-hash",converter:{fromAttribute:h=>{if(h===null)return!0;const t=h.trim().toLowerCase();return!(t==="false"||t==="0"||t==="no")},toAttribute:h=>h?"":null}},activeId:{type:String,attribute:"active-id",reflect:!0},layout:{type:String,reflect:!0},sidebarNavWidth:{type:String,attribute:"sidebar-nav-width"},sidebarHeight:{type:String,attribute:"sidebar-height"},stackHeight:{type:String,attribute:"stack-height"},sidebarNavTop:{type:String,attribute:"sidebar-nav-top"},contentPadding:{type:String,attribute:"content-padding"},spacing:{type:String,reflect:!0},spacingTop:{type:String,attribute:"spacing-top",reflect:!0},spacingBottom:{type:String,attribute:"spacing-bottom",reflect:!0},spacingLeft:{type:String,attribute:"spacing-left",reflect:!0},spacingRight:{type:String,attribute:"spacing-right",reflect:!0}},m.styles=M`:host{display:contents}:host([layout='sidebar']),:host([layout='stack']){display:block;margin-block-start:var(--scb-scrollspy-spacing-block-start, 0);margin-block-end:var(--scb-scrollspy-spacing-block-end, 0);margin-inline-start:var(--scb-scrollspy-spacing-inline-start, 0);margin-inline-end:var(--scb-scrollspy-spacing-inline-end, 0)}.stack-shell{max-height:var(--_scb-scrollspy-stack-height, none);overflow:var(--_scb-scrollspy-stack-overflow, visible);border-radius:16px;font-family:var(--brand-font);box-sizing:border-box}.stack-content{padding:var(--_scb-scrollspy-content-padding, 0px);box-sizing:border-box}.sidebar-layout{display:grid;grid-template-columns:var(--_scb-scrollspy-sidebar-nav-width, 320px) minmax(0,1fr);gap:var(--spacing-6, 20px);align-items:start}.sidebar-content,.sidebar-nav{height:var(--_scb-scrollspy-sidebar-height, 560px);overflow:auto}.sidebar-nav{position:sticky;top:var(--_scb-scrollspy-sidebar-nav-top, 0px)}.sidebar-content{border-radius:16px;font-family:var(--brand-font);padding:var(--_scb-scrollspy-content-padding, 0px);box-sizing:border-box}:host([layout='sidebar']) ::slotted(scb-menu){border-radius:var(--scb-menu-surface-radius, 16px)}`,m);E=O([R("scb-scrollspy")],E);