@ds-mo/ui 15.10.1 → 15.11.0

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 (155) hide show
  1. package/dist/.package-ready.json +1 -1
  2. package/dist/agent-patterns.json +1 -1
  3. package/dist/agent.json +13 -11
  4. package/dist/angular/ds-shell-app.d.ts +3 -8
  5. package/dist/angular/ds-shell-tools.d.ts +3 -8
  6. package/dist/components/ds-agent-questionnaire.js +1 -1
  7. package/dist/components/ds-agent-response.js +1 -1
  8. package/dist/components/ds-banner.js +1 -1
  9. package/dist/components/ds-bar-nav.js +1 -1
  10. package/dist/components/ds-bar-page-title.js +1 -1
  11. package/dist/components/ds-bar-title.js +1 -1
  12. package/dist/components/ds-bar-workflow.js +1 -1
  13. package/dist/components/ds-button-unfilled.js +1 -1
  14. package/dist/components/ds-calendar.js +1 -1
  15. package/dist/components/ds-card-chart.js +1 -1
  16. package/dist/components/ds-card-overview.js +1 -1
  17. package/dist/components/ds-card-overview.js.map +1 -1
  18. package/dist/components/ds-card-setting.js +1 -1
  19. package/dist/components/ds-chart.js +1 -1
  20. package/dist/components/ds-chart.js.map +1 -1
  21. package/dist/components/ds-code-block.js +1 -1
  22. package/dist/components/ds-data-customize.js +1 -1
  23. package/dist/components/ds-data-filter.js +1 -1
  24. package/dist/components/ds-data-group.js +1 -1
  25. package/dist/components/ds-data-preferences.js +1 -1
  26. package/dist/components/ds-data-saved-views.js +1 -1
  27. package/dist/components/ds-data-search.js +1 -1
  28. package/dist/components/ds-data-sort.js +1 -1
  29. package/dist/components/ds-filter-menu.js +1 -1
  30. package/dist/components/ds-input-date.js +1 -1
  31. package/dist/components/ds-input-time.js +1 -1
  32. package/dist/components/ds-input.js +1 -1
  33. package/dist/components/ds-markdown.js +1 -1
  34. package/dist/components/ds-menu.js +1 -1
  35. package/dist/components/ds-message-actions.js +1 -1
  36. package/dist/components/ds-message-composer.js +1 -1
  37. package/dist/components/ds-message-scroller.js +1 -1
  38. package/dist/components/ds-mobile-bar-nav.js +1 -1
  39. package/dist/components/ds-mobile-header.js +1 -1
  40. package/dist/components/ds-mobile-section-switcher.js +1 -1
  41. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  42. package/dist/components/ds-modal.js +1 -1
  43. package/dist/components/ds-pagination.js +1 -1
  44. package/dist/components/ds-panel-nav.js +1 -1
  45. package/dist/components/ds-panel-tool-header.js +1 -1
  46. package/dist/components/ds-panel-tool-search.js +1 -1
  47. package/dist/components/ds-panel-tools.js +1 -1
  48. package/dist/components/ds-scroll-overlay.js +1 -1
  49. package/dist/components/ds-select.js +1 -1
  50. package/dist/components/ds-shell-app.js +1 -1
  51. package/dist/components/ds-shell-app.js.map +1 -1
  52. package/dist/components/ds-shell-page.js +1 -1
  53. package/dist/components/ds-shell-tools.js +1 -1
  54. package/dist/components/ds-table.js +1 -1
  55. package/dist/components/ds-table.js.map +1 -1
  56. package/dist/components/ds-toast.js +1 -1
  57. package/dist/components/ds-toast.js.map +1 -1
  58. package/dist/components/ds-tooltip.js +1 -1
  59. package/dist/components/{p-PNY7auMh.js → p-B5rN3slq.js} +2 -2
  60. package/dist/components/{p-kQ6wvk-r.js → p-B9Q7fXxW.js} +2 -2
  61. package/dist/components/p-BNnw_O4e.js +2 -0
  62. package/dist/components/p-BNnw_O4e.js.map +1 -0
  63. package/dist/components/{p-BgpzSEWv.js → p-BT6xQogY.js} +2 -2
  64. package/dist/components/{p-YmJYwnhW.js → p-Ba-dSshd.js} +2 -2
  65. package/dist/components/{p-YmJYwnhW.js.map → p-Ba-dSshd.js.map} +1 -1
  66. package/dist/components/p-BkajUPiA.js +2 -0
  67. package/dist/components/p-BkajUPiA.js.map +1 -0
  68. package/dist/components/{p-lJeAJKa5.js → p-BqIRExej.js} +2 -2
  69. package/dist/components/{p-BtSEQ-FW.js → p-C8D853vs.js} +2 -2
  70. package/dist/components/{p-CHYYRdRJ.js → p-CEB8RFih.js} +2 -2
  71. package/dist/components/{p-DuCCuJKI.js → p-CGKjjJZm.js} +2 -2
  72. package/dist/components/{p-2ZV8JA88.js → p-CMrHRjjH.js} +2 -2
  73. package/dist/components/{p-DwuqJhR5.js → p-CPNA8raE.js} +2 -2
  74. package/dist/components/{p-ioGH5SoA.js → p-CVYjLzYI.js} +2 -2
  75. package/dist/components/p-CVYjLzYI.js.map +1 -0
  76. package/dist/components/p-CW-7vLUB.js +2 -0
  77. package/dist/components/p-CW-7vLUB.js.map +1 -0
  78. package/dist/components/{p-BrB05_X8.js → p-CaNMVLhm.js} +2 -2
  79. package/dist/components/{p-hmvu1lmP.js → p-Cxk1A7Sx.js} +2 -2
  80. package/dist/components/p-Cxk1A7Sx.js.map +1 -0
  81. package/dist/components/{p-BjLGayCj.js → p-D-cZ6cRI.js} +2 -2
  82. package/dist/components/{p-DQeUT9o2.js → p-D4r6oWyQ.js} +2 -2
  83. package/dist/components/{p-DoRgzvup.js → p-DGDF4NMV.js} +2 -2
  84. package/dist/components/{p-DSpKpoSG.js → p-DKG26pp5.js} +2 -2
  85. package/dist/components/p-DfphSI9S.js +2 -0
  86. package/dist/components/p-DfphSI9S.js.map +1 -0
  87. package/dist/components/p-DfwvHxYi.js +2 -0
  88. package/dist/components/p-DfwvHxYi.js.map +1 -0
  89. package/dist/components/{p-BQE2Uj4p.js → p-DfzXyVoM.js} +2 -2
  90. package/dist/components/{p-BQE2Uj4p.js.map → p-DfzXyVoM.js.map} +1 -1
  91. package/dist/components/{p-z_8aZHHo.js → p-DixX2_Bd.js} +2 -2
  92. package/dist/components/{p-CipTqNIr.js → p-Djkk338n.js} +2 -2
  93. package/dist/components/{p-Dx7wJaLv.js → p-DvMCOJwc.js} +2 -2
  94. package/dist/components/{p-ChsBscqZ.js → p-DwFnt0W0.js} +2 -2
  95. package/dist/components/{p-uAtciSyr.js → p-OFJpWJcN.js} +2 -2
  96. package/dist/components/{p-Bx_72ylJ.js → p-S5QCVAdH.js} +2 -2
  97. package/dist/docs/components.json +13 -13
  98. package/dist/lib/utils/index.js +3 -1
  99. package/dist/lib/utils/index.js.map +2 -2
  100. package/dist/lib/utils/resolve-css-length-px.d.ts +1 -1
  101. package/dist/mcp-data/registry/card-overview.json +1 -1
  102. package/dist/mcp-data/registry/chart.json +3 -3
  103. package/dist/mcp-data/registry/code-block.json +3 -2
  104. package/dist/mcp-data/registry/mobile-bar-nav.json +3 -3
  105. package/dist/mcp-data/registry/mobile-header.json +3 -3
  106. package/dist/mcp-data/registry/mobile-section-switcher.json +3 -2
  107. package/dist/mcp-data/registry/mobile-sheet-nav.json +6 -6
  108. package/dist/mcp-data/registry/modal.json +1 -1
  109. package/dist/mcp-data/registry/panel-tools.json +1 -1
  110. package/dist/mcp-data/registry/registry.json +12 -10
  111. package/dist/mcp-data/registry/shell-app.json +3 -3
  112. package/dist/mcp-data/registry/shell-tools.json +4 -4
  113. package/dist/mcp-data/registry/table.json +2 -2
  114. package/dist/mcp-data/registry/toast.json +1 -1
  115. package/dist/react/ds-shell-app.d.ts +2 -5
  116. package/dist/react/ds-shell-tools.d.ts +2 -5
  117. package/dist/styles/responsive.css +293 -0
  118. package/dist/types/components/CodeBlock/CodeBlock.d.ts +8 -0
  119. package/dist/types/components/ShellApp/ShellApp.d.ts +2 -5
  120. package/dist/types/components/ShellTools/ShellTools.d.ts +2 -5
  121. package/dist/types/components.d.ts +4 -10
  122. package/dist/types/utils/resolve-css-length-px.d.ts +1 -1
  123. package/package.json +2 -1
  124. package/dist/components/p-BE9ladwu.js +0 -2
  125. package/dist/components/p-BE9ladwu.js.map +0 -1
  126. package/dist/components/p-BfdYb8L4.js +0 -2
  127. package/dist/components/p-BfdYb8L4.js.map +0 -1
  128. package/dist/components/p-BuwYiPCW.js +0 -2
  129. package/dist/components/p-BuwYiPCW.js.map +0 -1
  130. package/dist/components/p-cktJHlYv.js +0 -2
  131. package/dist/components/p-cktJHlYv.js.map +0 -1
  132. package/dist/components/p-hmvu1lmP.js.map +0 -1
  133. package/dist/components/p-iEhBF5Oi.js +0 -2
  134. package/dist/components/p-iEhBF5Oi.js.map +0 -1
  135. package/dist/components/p-ioGH5SoA.js.map +0 -1
  136. /package/dist/components/{p-PNY7auMh.js.map → p-B5rN3slq.js.map} +0 -0
  137. /package/dist/components/{p-kQ6wvk-r.js.map → p-B9Q7fXxW.js.map} +0 -0
  138. /package/dist/components/{p-BgpzSEWv.js.map → p-BT6xQogY.js.map} +0 -0
  139. /package/dist/components/{p-lJeAJKa5.js.map → p-BqIRExej.js.map} +0 -0
  140. /package/dist/components/{p-BtSEQ-FW.js.map → p-C8D853vs.js.map} +0 -0
  141. /package/dist/components/{p-CHYYRdRJ.js.map → p-CEB8RFih.js.map} +0 -0
  142. /package/dist/components/{p-DuCCuJKI.js.map → p-CGKjjJZm.js.map} +0 -0
  143. /package/dist/components/{p-2ZV8JA88.js.map → p-CMrHRjjH.js.map} +0 -0
  144. /package/dist/components/{p-DwuqJhR5.js.map → p-CPNA8raE.js.map} +0 -0
  145. /package/dist/components/{p-BrB05_X8.js.map → p-CaNMVLhm.js.map} +0 -0
  146. /package/dist/components/{p-BjLGayCj.js.map → p-D-cZ6cRI.js.map} +0 -0
  147. /package/dist/components/{p-DQeUT9o2.js.map → p-D4r6oWyQ.js.map} +0 -0
  148. /package/dist/components/{p-DoRgzvup.js.map → p-DGDF4NMV.js.map} +0 -0
  149. /package/dist/components/{p-DSpKpoSG.js.map → p-DKG26pp5.js.map} +0 -0
  150. /package/dist/components/{p-z_8aZHHo.js.map → p-DixX2_Bd.js.map} +0 -0
  151. /package/dist/components/{p-CipTqNIr.js.map → p-Djkk338n.js.map} +0 -0
  152. /package/dist/components/{p-Dx7wJaLv.js.map → p-DvMCOJwc.js.map} +0 -0
  153. /package/dist/components/{p-ChsBscqZ.js.map → p-DwFnt0W0.js.map} +0 -0
  154. /package/dist/components/{p-uAtciSyr.js.map → p-OFJpWJcN.js.map} +0 -0
  155. /package/dist/components/{p-Bx_72ylJ.js.map → p-S5QCVAdH.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{p as t,H as i,c as e,h as s,a as n,t as d}from"./index.js";import{A as o,r,d as a}from"./p-PNY7auMh.js";import{A as c}from"./p-CwUXroLs.js";import{d as l}from"./p-CzTJAO2J.js";import{d as p}from"./p-BrB05_X8.js";import{i as u,f as h,b as f,d as v}from"./p-BtSEQ-FW.js";import{d as g}from"./p-BVsVUnAw.js";import{d as m}from"./p-0XTyQNRG.js";import{d as b}from"./p-CTAF7SkL.js";import{D as y}from"./p-DOUk4KoT.js";import{r as x}from"./p-ioGH5SoA.js";import{r as w}from"./p-DhKvqh5G.js";import{s as k,r as z}from"./p-DGVZhrMd.js";import{b as C,T as F}from"./p-CeXf9-X3.js";import{C as I}from"./p-CuwopElg.js";import{c as T}from"./p-DuFm-ieS.js";const _=()=>`@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-interaction-fill.sc-ds-input-date-h,.ds-interaction-fill.sc-ds-input-date{position:var(--ds-interaction-position, relative);z-index:var(--ds-interaction-z-index, 0);cursor:default;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent;--ds-interaction-divider-width:0px;--ds-interaction-divider-color:transparent;--ds-interaction-divider-inline-start-width:0px;--ds-interaction-divider-inline-start-color:transparent;--ds-interaction-divider-inline-end-width:0px;--ds-interaction-divider-inline-end-color:transparent}.ds-interaction-fill.sc-ds-input-date-h::before,.ds-interaction-fill.sc-ds-input-date::before,.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-input-date-h::before,.ds-interaction-fill.sc-ds-input-date::before{z-index:1}.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::after{z-index:3;box-shadow:inset 0 calc(-1 * var(--ds-interaction-divider-width)) 0 var(--ds-interaction-divider-color), inset var(--ds-interaction-divider-inline-start-width) 0 0 var(--ds-interaction-divider-inline-start-color), inset calc(-1 * var(--ds-interaction-divider-inline-end-width)) 0 0 var(--ds-interaction-divider-inline-end-color), inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-input-date-h,.ds-interaction-fill--bordered.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-input-date-h::before,.ds-interaction-fill--selected.sc-ds-input-date::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-input-date-h,.ds-interaction-fill--selected.sc-ds-input-date{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-input-date-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-input-date:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-input-date-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-input-date:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-input-date-h::after,.ds-interaction-fill--grouped.sc-ds-input-date::after,.ds-interaction-fill--grouped.sc-ds-input-date-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-input-date:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-input-date-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-input-date:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-input-date-h,.ds-interaction-fill--grouped.sc-ds-input-date{--ds-interaction-divider-width:var(--ds-interaction-group-divider-width, 0px);--ds-interaction-divider-color:var(--ds-interaction-group-divider-color, transparent);--ds-interaction-divider-inline-start-width:var( --ds-interaction-group-divider-inline-start-width, 0px );--ds-interaction-divider-inline-start-color:var( --ds-interaction-group-divider-inline-start-color, transparent );--ds-interaction-divider-inline-end-width:var( --ds-interaction-group-divider-inline-end-width, 0px );--ds-interaction-divider-inline-end-color:var( --ds-interaction-group-divider-inline-end-color, transparent )}.ds-interaction-fill.sc-ds-input-date-h>.ds-interaction-fill__content.sc-ds-input-date,.ds-interaction-fill.sc-ds-input-date>.ds-interaction-fill__content.sc-ds-input-date,.ds-interaction-fill__content.sc-ds-input-date{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-input-date-h,.ds-interaction-fill--on-faint.sc-ds-input-date{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-input-date-h,.ds-interaction-fill--on-medium.sc-ds-input-date{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-input-date-h,.ds-interaction-fill--on-bold.sc-ds-input-date{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-input-date-h,.ds-interaction-fill--on-strong.sc-ds-input-date{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-input-date-h,.ds-interaction-fill--on-translucent.sc-ds-input-date{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active-brand);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-input-date-h,.ds-interaction-fill--on-inverted.sc-ds-input-date{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active-brand);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-input-date-h,.ds-interaction-fill--on-media.sc-ds-input-date{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-input-date-h,.ds-interaction-fill--on-always-dark.sc-ds-input-date{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active-brand);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-chrome.sc-ds-input-date-h,.ds-interaction-fill--on-chrome.sc-ds-input-date{--ds-interaction-hover:var(--color-chrome-interaction-hover);--ds-interaction-pressed:var(--color-chrome-interaction-pressed);--ds-interaction-active:var(--color-chrome-interaction-active);--ds-focus-ring-color:var(--color-chrome-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-input-date-h,.ds-interaction-fill--on-navigation.sc-ds-input-date{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-input-date-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-input-date:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::after{box-shadow:none;outline:var(--ds-interaction-border-width) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--ds-interaction-border-width))}.ds-interaction-fill--surface-open.sc-ds-input-date-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-input-date:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}.ds-interaction-fill--selected.sc-ds-input-date-h::before,.ds-interaction-fill--selected.sc-ds-input-date::before{background:transparent;outline:var(--dimension-stroke-width-025) solid var(--ds-forced-color-selected);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}}@media (forced-colors: active) and (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-input-date-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-input-date:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline-color:var(--ds-forced-color-selected);outline-width:var(--dimension-stroke-width-012)}}@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-input-date-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-input-date-h,.ds-focus-ring.sc-ds-input-date,.ds-focus-ring-inset.sc-ds-input-date-h,.ds-focus-ring-inset.sc-ds-input-date{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-input-date-h:focus-visible,.ds-focus-ring.sc-ds-input-date:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-input-date-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-input-date{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-input-date-h:focus-visible,.ds-focus-ring-inset.sc-ds-input-date:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-input-date-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-input-date:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-input-date-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-control-inactive.sc-ds-input-date-h,.ds-control-inactive.sc-ds-input-date{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-input-date-h,.ds-control-inactive.sc-ds-input-date{color:var(--ds-forced-color-disabled);opacity:1}}.sc-ds-input-date-h,.sc-ds-input-date:where(.ds-table),.sc-ds-input-date:where(.tooltip-popup),.sc-ds-input-date:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.ds-control--lg.sc-ds-input-date,.ds-control--lg.sc-ds-input-date-h,.ds-control--md.sc-ds-input-date-h,.ds-control--md.sc-ds-input-date,.ds-control--sm.sc-ds-input-date-h,.ds-control--sm.sc-ds-input-date,.ds-control--xs.sc-ds-input-date-h,.ds-control--xs.sc-ds-input-date{--ds-control-radius:var(--ds-radius-control)}.ds-control--lg.sc-ds-input-date-h,.ds-control--lg.sc-ds-input-date{--ds-control-height:var(--dimension-size-500);--ds-control-icon:var(--dimension-iconography-lg);--ds-control-padding-inline:var(--dimension-space-100);--ds-control-label-inset:var(--dimension-space-050);--ds-control-gap:var(--dimension-space-050)}.ds-control--md.sc-ds-input-date-h,.ds-control--md.sc-ds-input-date{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-input-date-h,.ds-control--sm.sc-ds-input-date{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-input-date-h,.ds-control--xs.sc-ds-input-date{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.ds-control-frame.sc-ds-input-date{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.ds-control-section-heading.sc-ds-input-date{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-control-icon-box.sc-ds-input-date{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md))}.ds-control-label-box.sc-ds-input-date{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-input-date{position:relative;padding-inline-end:calc( var(--ds-control-label-inset, var(--dimension-space-025)) + var(--ds-control-gap, var(--dimension-space-050)) )}.ds-control-label-dot__badge.sc-ds-input-date{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}.ds-control-width--hug.sc-ds-input-date-h,.ds-control-width--hug.sc-ds-input-date{width:fit-content;max-width:100%;flex:0 0 auto}.ds-control-width--fill.sc-ds-input-date-h,.ds-control-width--fill.sc-ds-input-date{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.ds-field-stack.sc-ds-input-date-h,.ds-field-stack.sc-ds-input-date{display:flex;flex-direction:column;gap:var(--dimension-space-050)}.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date-h .error-text.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .error-text.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .field__description.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .field__error.sc-ds-input-date{padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-text--display-medium.sc-ds-input-date-h,.ds-text--display-medium.sc-ds-input-date{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-input-date-h,.ds-text--display-small.sc-ds-input-date{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-input-date-h,.ds-text--title-large.sc-ds-input-date{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-input-date-h,.ds-text--title-medium.sc-ds-input-date{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-input-date-h,.ds-text--title-small.sc-ds-input-date{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-input-date-h,.ds-text--body-large.sc-ds-input-date{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-input-date-h,.ds-text--body-medium.sc-ds-input-date{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-input-date-h,.ds-text--body-small.sc-ds-input-date{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-input-date-h,.ds-text--caption.sc-ds-input-date{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--display-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-input-date,.ds-text--display-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--display-small.ds-text--regular.sc-ds-input-date-h,.ds-text--display-medium.ds-text--regular.sc-ds-input-date,.ds-text--display-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-large.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-input-date-h,.ds-text--title-large.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-input-date,.ds-text--title-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--title-small.ds-text--regular.sc-ds-input-date-h,.ds-text--title-medium.ds-text--regular.sc-ds-input-date,.ds-text--title-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-large.ds-text--emphasis.sc-ds-input-date,.ds-text--body-medium.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-input-date-h,.ds-text--body-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--body-large.ds-text--regular.sc-ds-input-date,.ds-text--body-medium.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-input-date-h,.ds-text--body-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-input-date-h,.ds-text--caption.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-input-date-h,.ds-text--caption.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.input-host.sc-ds-input-date-h{display:inline-flex;--ds-input-fg:var(--color-foreground-primary);--ds-input-placeholder:var(--color-foreground-secondary);--ds-input-placeholder-active:var(--color-foreground-quaternary);--ds-input-adornment-fg:var(--color-foreground-secondary);--ds-input-border:var(--color-border-secondary)}.ds-control-width--fill.sc-ds-input-date-h,.ds-control-width--fill.sc-ds-input-date-h .input-control.sc-ds-input-date{width:100%}.input-control.sc-ds-input-date{overflow:hidden;background:transparent;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));color:var(--ds-input-fg)}.input-control--bordered.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--ds-input-border)}.input-control--error.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-negative)}.input-control--bordered.sc-ds-input-date:focus-within:not(.input-control--error){--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-brand)}.ds-control-inactive.sc-ds-input-date-h .input-control.sc-ds-input-date::after{background:transparent}.native-input.sc-ds-input-date{position:relative;z-index:2;flex:1 1 auto;min-width:0;height:100%;background:transparent;border:none;border-radius:inherit;outline:none;color:var(--ds-input-fg);font-family:inherit;letter-spacing:inherit;text-overflow:ellipsis;-webkit-appearance:none;appearance:none;color-scheme:inherit}.native-input--align-start.sc-ds-input-date{text-align:start}.native-input.sc-ds-input-date:disabled{cursor:not-allowed}.native-input.sc-ds-input-date:read-only:not(:disabled){cursor:default}.native-input.sc-ds-input-date::-webkit-calendar-picker-indicator{display:none}.native-input.sc-ds-input-date::-webkit-inner-spin-button,.native-input.sc-ds-input-date::-webkit-clear-button{display:none}.native-input.sc-ds-input-date::-webkit-datetime-edit,.native-input.sc-ds-input-date::-webkit-datetime-edit-fields-wrapper,.native-input.sc-ds-input-date::-webkit-datetime-edit-text,.native-input.sc-ds-input-date::-webkit-datetime-edit-month-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-day-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-year-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-hour-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-minute-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-second-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-ampm-field{padding:0;color:inherit;font:inherit;letter-spacing:inherit}.input-control__prefix.sc-ds-input-date{position:relative;z-index:2;color:var(--ds-input-adornment-fg)}.input-control.sc-ds-input-date>.input-control__datetime-action.sc-ds-input-date{position:relative;z-index:2;flex-shrink:0;align-self:center}.ds-control-inactive.sc-ds-input-date-h .input-control.sc-ds-input-date>.input-control__datetime-action.sc-ds-input-date{--effect-opacity-medium:1}.input-control.sc-ds-input-date:has(.input-control__datetime-action){padding-inline-end:var(--dimension-space-025)}.error-text.sc-ds-input-date{width:100%}@media (forced-colors: active){.input-control--bordered.sc-ds-input-date:focus-within:not(.input-control--error)::after{outline-color:var(--ds-forced-color-selected)}.input-control--error.sc-ds-input-date::after{outline-style:dashed}}.ds-choice-popup.sc-ds-input-date{box-sizing:border-box;display:flex;flex-direction:column;min-width:var(--ds-choice-popup-min-inline-size, var(--dimension-menu-width-xs));max-width:min(var(--dimension-panel-width-lg), calc(100vw - var(--dimension-space-200)));max-height:calc(100vh - var(--dimension-space-200));overflow:hidden;inset:auto;margin:0;padding:0;border:0;background-color:var(--color-background-primary);border-radius:var(--ds-radius-menu);box-shadow:var(--effect-shadow-elevated-floating);color:var(--color-foreground-secondary);animation:dsChoiceFadeIn var(--effect-motion-short-2) forwards;backface-visibility:hidden;will-change:transform;text-align:start}.ds-choice-popup.sc-ds-input-date::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:var(--effect-highlight-elevated-floating)}.ds-choice-popup--closing.sc-ds-input-date{animation:dsChoiceFadeOut var(--effect-motion-short-2) forwards}@keyframes dsChoiceFadeIn{from{opacity:0;transform:inherit scale(0.97)}to{opacity:1}}@keyframes dsChoiceFadeOut{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.ds-choice-popup.sc-ds-input-date{animation:none;opacity:1}.ds-choice-popup--closing.sc-ds-input-date{opacity:0}}@media (forced-colors: active){.ds-choice-popup.sc-ds-input-date{outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}.ds-choice-popup.sc-ds-input-date::after{box-shadow:none}}.ds-chrome-space--sm.sc-ds-input-date-h,.ds-chrome-space--sm.sc-ds-input-date{--ds-chrome-padding:var(--ds-chrome-space-sm-padding, var(--dimension-space-050));--ds-chrome-gap:var(--dimension-space-050)}.ds-chrome-space--md.sc-ds-input-date-h,.ds-chrome-space--md.sc-ds-input-date{--ds-chrome-padding:var(--dimension-space-100);--ds-chrome-gap:var(--dimension-space-100)}.ds-chrome-space--lg.sc-ds-input-date-h,.ds-chrome-space--lg.sc-ds-input-date{--ds-chrome-padding:var(--dimension-space-200);--ds-chrome-gap:var(--dimension-space-200)}.ds-chrome-row.sc-ds-input-date-h,.ds-chrome-row.sc-ds-input-date,.ds-chrome-column.sc-ds-input-date-h,.ds-chrome-column.sc-ds-input-date,.ds-chrome-grid.sc-ds-input-date-h,.ds-chrome-grid.sc-ds-input-date{display:flex;box-sizing:border-box;gap:var(--ds-chrome-gap, var(--dimension-space-100));padding:var(--ds-chrome-padding, var(--dimension-space-100))}.ds-chrome-row.sc-ds-input-date-h,.ds-chrome-row.sc-ds-input-date{flex-direction:row;align-items:center}.ds-chrome-column.sc-ds-input-date-h,.ds-chrome-column.sc-ds-input-date{flex-direction:column}.ds-chrome-grid.sc-ds-input-date-h,.ds-chrome-grid.sc-ds-input-date{display:grid;align-items:center}.input-date-popup.ds-choice-popup.sc-ds-input-date{--ds-calendar-padding:0;padding:var(--dimension-space-050)}`;let j=0;const D="Enter a valid date.";const E="Date is before the minimum allowed date.";const O="Date is after the maximum allowed date.";const V=t(class t extends i{constructor(t){super();if(t!==false){this.__registerHost()}this.dsChange=e(this,"dsChange",7);this.internals=this.attachInternals();this.generatedId=`ds-input-date-${++j}`;this.errorId=`${this.generatedId}-error`;this.popupId=`${this.generatedId}-popup`;this.value="";this.disabled=false;this.readOnly=false;this.required=false;this.requiredMessage=y;this.size="md";this.width="fill";this.hasBorder=true;this.hasInteractionFill=true;this.isInactive=false;this.autoFocus=false;this.error=false;this.ariaLabel=null;this.initialValue="";this.closeTimer=null;this.formDisabled=false;this.focused=false;this.touched=false;this.draftText="";this.open=false;this.shouldRender=false;this.closing=false;this.positionReady=false;this.pos={x:0,y:0};this.position=new o({getAnchor:()=>this.controlEl??null,getPopup:()=>this.el.querySelector(".input-date-popup"),getOwnerDocument:()=>this.el.ownerDocument,measure:(t,i)=>{if(!this.open)return null;const e=x(F.space050,F.space050);return{anchorRect:t.getBoundingClientRect(),popupWidth:i.offsetWidth||this.popupFallbackWidth,popupHeight:i.offsetHeight||this.popupFallbackHeight,side:"bottom",align:"end",sideOffsetPx:x(F.space050,F.space050),alignOffsetPx:w({align:"end",alignOffsetPx:0,sectionInsetPx:e,anchorAlignment:"popup-frame"}),viewportPadPx:x(F.space050,F.space050),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(t)}},apply:({x:t,y:i})=>{this.pos={x:t,y:i}},onReady:()=>{this.positionReady=true},liveUpdate:"double-frame",observeResize:true,topLayer:true});this.interaction=new c({getAnchor:()=>this.controlEl??null,getPopup:()=>this.el.querySelector(".input-date-popup"),getOwnerDocument:()=>this.el.ownerDocument,onOutsideActivation:()=>this.closePicker(false)});this.togglePicker=()=>{if(this.isInactive||this.disabled||this.formDisabled||this.readOnly)return;if(this.open)this.closePicker("button");else this.openPicker()};this.handleInput=t=>{if(this.pickerInactive)return;this.draftText=t.target.value;const i=this.parseDraft(this.draftText);if(i===null)return;this.commitIso(i)};this.handleFocus=()=>{this.draftText=this.displayValue||this.value;this.focused=true};this.handleBlur=()=>{this.focused=false;this.touched=true;if(this.pickerInactive){this.draftText=this.displayValue;return}const t=this.parseDraft(this.draftText);if(t===null){this.draftText=this.displayValue;return}this.commitIso(t)};this.handleCalendarChange=t=>{t.stopPropagation();if(this.pickerInactive)return;const i=this.parseDraft(t.detail);if(i===null)return;this.commitIso(i);this.closePicker("input")}}get popupFallbackWidth(){return x(F.menuWidthXs,F.menuWidthXs)}get popupFallbackHeight(){return x(F.menuFallbackHeight,F.menuFallbackHeight)}get formInactive(){return this.isInactive||this.disabled||this.formDisabled}get pickerInactive(){return this.formInactive||this.readOnly}get hasConstraintError(){if(!this.value)return false;if(!u(this.value))return true;if(this.min&&u(this.min)&&this.value<this.min)return true;if(this.max&&u(this.max)&&this.value>this.max)return true;return false}get isInvalid(){return this.error||!this.formInactive&&(this.required&&this.value.length===0||this.hasConstraintError)}componentWillLoad(){this.initialValue=this.value;this.syncFormValue()}disconnectedCallback(){this.teardownListeners();this.open=false;this.shouldRender=false;this.closing=false;this.positionReady=false;this.focused=false}syncFormValue(){const t=this.formInactive;k(this.internals,this.value,{inactive:t});const i={};let e="";if(!t){if(this.required&&this.value.length===0){i.valueMissing=true;e=this.requiredMessage}else if(this.value&&!u(this.value)){i.badInput=true;e=D}else if(this.value&&this.min&&u(this.min)&&this.value<this.min){i.rangeUnderflow=true;e=E}else if(this.value&&this.max&&u(this.max)&&this.value>this.max){i.rangeOverflow=true;e=O}}this.internals.setValidity(i,e)}onInteractionStateChange(){this.syncFormValue();if(this.pickerInactive&&this.shouldRender)this.closePicker(false)}formDisabledCallback(t){this.formDisabled=t;this.onInteractionStateChange()}formResetCallback(){this.value=this.initialValue;this.draftText=this.displayValue}formStateRestoreCallback(t){this.value=z(t);this.draftText=this.displayValue}async setFocus(){this.inputEl?.focus()}handleHostKeyDown(t){if(!this.shouldRender||this.closing)return;if(t.key==="Escape"){t.preventDefault();this.closePicker("button");return}if(t.key!=="Tab")return;const i=this.el.querySelector(".input-date-popup");if(!i||!t.composedPath().includes(i))return;if(!this.interaction.tabLeavesPopup(t))return;t.preventDefault();this.closePicker(false);this.interaction.moveFocusAfterTab(t.shiftKey)}get displayValue(){return h(this.value)}parseDraft(t){const i=t.trim();if(!i)return"";const e=f(i);if(!e)return null;if(this.min&&u(this.min)&&e<this.min)return null;if(this.max&&u(this.max)&&e>this.max)return null;return e}commitIso(t,i=true){if(this.value!==t){this.value=t;if(i)this.dsChange.emit(t)}this.draftText=h(t)}teardownListeners(){this.position.unobserve();this.interaction.disconnect();if(this.closeTimer){clearTimeout(this.closeTimer);this.closeTimer=null}}openPicker(){const t=this.isInactive||this.disabled||this.formDisabled||this.readOnly;if(t||this.open||!this.el.isConnected)return;this.shouldRender=true;this.closing=false;this.positionReady=false;this.open=true;this.teardownListeners();this.interaction.connect();this.position.observe();this.position.schedule()}closePicker(t){if(!this.shouldRender||this.closing)return;this.open=false;this.position.cancel();this.closing=true;this.interaction.disconnect();this.position.unobserve();if(t==="input")this.inputEl?.focus();if(t==="button")void this.calendarButton?.setFocus();const i=C(F.motionShort2,F.animationDurationShort3);if(i<=0){this.finishClose();return}this.closeTimer=setTimeout((()=>this.finishClose()),i)}finishClose(){const t=this.el.querySelector(".input-date-popup");if(t?.matches(":popover-open"))t.hidePopover();this.shouldRender=false;this.closing=false;this.closeTimer=null}render(){const t=this.inputId??this.generatedId;const i=this.formInactive;const e=this.pickerInactive;const d=this.value.length>0;const o=this.value!==this.initialValue;const r=this.error&&Boolean(this.errorMessage);const a=I[this.size];const c=`ds-text--${a.replace("text-","")}`;const l=[this.ariaDescribedby,r?this.errorId:undefined].filter(Boolean).join(" ")||undefined;const p={position:"fixed",left:"0",top:"0",transform:`translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,zIndex:"var(--dimension-z-index-floating)",visibility:this.positionReady?"visible":"hidden"};return s(n,{key:"ac8e4290fedd83cb179be3f213537de046d9e5b0",class:{"input-host":true,"ds-field-stack":true,"ds-field-stack--supporting-inset":!this.hasBorder,"ds-control-inactive":i,[`ds-control--${this.size}`]:true,...T(this.width)},"data-disabled":i?"":undefined,"data-readonly":this.readOnly?"":undefined,"data-required":this.required?"":undefined,"data-invalid":this.isInvalid?"":undefined,"data-filled":d?"":undefined,"data-focused":this.focused?"":undefined,"data-dirty":o?"":undefined,"data-touched":this.touched?"":undefined},s("div",{key:"2fa530c300aa0d43e3944ca3bfd3049e85e35a71",ref:t=>{this.controlEl=t},class:{"input-control":true,"ds-control-frame":true,"input-control--bordered":this.hasBorder,"input-control--error":this.hasBorder&&this.error,"ds-interaction-fill":this.hasInteractionFill,[`ds-control--${this.size}`]:true}},s("input",{key:"5395306010f31d64c9f1f2d15fce6e5e0918b400",ref:t=>{this.inputEl=t},type:"text",id:t,value:this.focused?this.draftText:this.displayValue,disabled:i,readOnly:this.readOnly,required:this.required,autoFocus:this.autoFocus,autoComplete:"off",spellcheck:false,class:{"native-input":true,"native-input--align-start":true,"ds-control-label-box":true,[c]:true,"ds-text--regular":true},"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-describedby":l,"aria-invalid":this.isInvalid?"true":undefined,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),s("ds-button-unfilled",{key:"69968fcade07b16bb789b7f76b2866f29961a846",ref:t=>{this.calendarButton=t},class:"input-control__datetime-action",variant:"icon",size:this.size,icon:"Calendar",hasBorder:false,isInset:true,isInactive:e,ariaLabel:"Choose date",haspopup:"dialog",expanded:this.open,surfaceOpen:this.open||this.closing,controls:this.open?this.popupId:undefined,onDsClick:this.togglePicker})),this.shouldRender?s("div",{id:this.popupId,popover:"manual",class:{"input-date-popup":true,"ds-choice-popup":true,"ds-choice-popup--closing":this.closing,"ds-chrome-column":true,"ds-chrome-space--sm":true},style:p,role:"dialog","aria-label":"Choose date"},s("ds-calendar",{selectionMode:"single",value:this.value,min:this.min,max:this.max,isInactive:e,autoFocus:true,onDsChange:this.handleCalendarChange})):null,r&&s("ds-text",{key:"aedd6c998da63bb1dc73db4b8045fac5bfbb220c",class:"error-text",as:"div",variant:"text-body-small",color:"negative",textId:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{value:[{syncFormValue:0}],required:[{syncFormValue:0}],requiredMessage:[{syncFormValue:0}],min:[{syncFormValue:0}],max:[{syncFormValue:0}],disabled:[{onInteractionStateChange:0}],isInactive:[{onInteractionStateChange:0}],readOnly:[{onInteractionStateChange:0}]}}static get style(){return _()}},[66,"ds-input-date",{value:[1025],name:[513],form:[513],disabled:[516],readOnly:[516,"read-only"],required:[516],requiredMessage:[1,"required-message"],min:[1],max:[1],size:[1],width:[1],hasBorder:[4,"has-border"],hasInteractionFill:[4,"has-interaction-fill"],isInactive:[4,"is-inactive"],autoFocus:[4,"auto-focus"],error:[4],errorMessage:[1,"error-message"],inputId:[1,"input-id"],ariaLabel:[1,"aria-label"],ariaLabelledby:[1,"aria-labelledby"],ariaDescribedby:[1,"aria-describedby"],formDisabled:[32],focused:[32],touched:[32],draftText:[32],open:[32],shouldRender:[32],closing:[32],positionReady:[32],pos:[32],setFocus:[64]},[[0,"keydown","handleHostKeyDown"]],{value:[{syncFormValue:0}],required:[{syncFormValue:0}],requiredMessage:[{syncFormValue:0}],min:[{syncFormValue:0}],max:[{syncFormValue:0}],disabled:[{onInteractionStateChange:0}],isInactive:[{onInteractionStateChange:0}],readOnly:[{onInteractionStateChange:0}]}]);function H(){if(typeof customElements==="undefined"){return}const t=["ds-input-date","ds-badge","ds-button-unfilled","ds-calendar","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-input-date":if(!customElements.get(d(t))){customElements.define(d(t),V)}break;case"ds-badge":if(!customElements.get(d(t))){l()}break;case"ds-button-unfilled":if(!customElements.get(d(t))){p()}break;case"ds-calendar":if(!customElements.get(d(t))){v()}break;case"ds-icon":if(!customElements.get(d(t))){g()}break;case"ds-loader":if(!customElements.get(d(t))){m()}break;case"ds-text":if(!customElements.get(d(t))){b()}break;case"ds-tooltip":if(!customElements.get(d(t))){a()}break}}))}H();export{V as I,H as d};
2
- //# sourceMappingURL=p-BgpzSEWv.js.map
1
+ import{p as t,H as i,c as e,h as s,a as n,t as d}from"./index.js";import{A as o,r,d as a}from"./p-B5rN3slq.js";import{A as c}from"./p-CwUXroLs.js";import{d as l}from"./p-CzTJAO2J.js";import{d as p}from"./p-CaNMVLhm.js";import{i as u,f as h,b as f,d as v}from"./p-C8D853vs.js";import{d as g}from"./p-BVsVUnAw.js";import{d as m}from"./p-0XTyQNRG.js";import{d as b}from"./p-CTAF7SkL.js";import{D as y}from"./p-DOUk4KoT.js";import{r as x}from"./p-CVYjLzYI.js";import{r as w}from"./p-DhKvqh5G.js";import{s as k,r as z}from"./p-DGVZhrMd.js";import{b as C,T as I}from"./p-CeXf9-X3.js";import{C as F}from"./p-CuwopElg.js";import{c as T}from"./p-DuFm-ieS.js";const _=()=>`@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-interaction-fill.sc-ds-input-date-h,.ds-interaction-fill.sc-ds-input-date{position:var(--ds-interaction-position, relative);z-index:var(--ds-interaction-z-index, 0);cursor:default;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent;--ds-interaction-divider-width:0px;--ds-interaction-divider-color:transparent;--ds-interaction-divider-inline-start-width:0px;--ds-interaction-divider-inline-start-color:transparent;--ds-interaction-divider-inline-end-width:0px;--ds-interaction-divider-inline-end-color:transparent}.ds-interaction-fill.sc-ds-input-date-h::before,.ds-interaction-fill.sc-ds-input-date::before,.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-input-date-h::before,.ds-interaction-fill.sc-ds-input-date::before{z-index:1}.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::after{z-index:3;box-shadow:inset 0 calc(-1 * var(--ds-interaction-divider-width)) 0 var(--ds-interaction-divider-color), inset var(--ds-interaction-divider-inline-start-width) 0 0 var(--ds-interaction-divider-inline-start-color), inset calc(-1 * var(--ds-interaction-divider-inline-end-width)) 0 0 var(--ds-interaction-divider-inline-end-color), inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-input-date-h,.ds-interaction-fill--bordered.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-input-date-h::before,.ds-interaction-fill--selected.sc-ds-input-date::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-input-date-h,.ds-interaction-fill--selected.sc-ds-input-date{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-input-date-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-input-date:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-input-date-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-input-date:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-input-date-h::after,.ds-interaction-fill--grouped.sc-ds-input-date::after,.ds-interaction-fill--grouped.sc-ds-input-date-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-input-date:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-input-date-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-input-date:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-input-date-h,.ds-interaction-fill--grouped.sc-ds-input-date{--ds-interaction-divider-width:var(--ds-interaction-group-divider-width, 0px);--ds-interaction-divider-color:var(--ds-interaction-group-divider-color, transparent);--ds-interaction-divider-inline-start-width:var( --ds-interaction-group-divider-inline-start-width, 0px );--ds-interaction-divider-inline-start-color:var( --ds-interaction-group-divider-inline-start-color, transparent );--ds-interaction-divider-inline-end-width:var( --ds-interaction-group-divider-inline-end-width, 0px );--ds-interaction-divider-inline-end-color:var( --ds-interaction-group-divider-inline-end-color, transparent )}.ds-interaction-fill.sc-ds-input-date-h>.ds-interaction-fill__content.sc-ds-input-date,.ds-interaction-fill.sc-ds-input-date>.ds-interaction-fill__content.sc-ds-input-date,.ds-interaction-fill__content.sc-ds-input-date{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-input-date-h,.ds-interaction-fill--on-faint.sc-ds-input-date{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-input-date-h,.ds-interaction-fill--on-medium.sc-ds-input-date{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-input-date-h,.ds-interaction-fill--on-bold.sc-ds-input-date{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-input-date-h,.ds-interaction-fill--on-strong.sc-ds-input-date{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-input-date-h,.ds-interaction-fill--on-translucent.sc-ds-input-date{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active-brand);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-input-date-h,.ds-interaction-fill--on-inverted.sc-ds-input-date{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active-brand);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-input-date-h,.ds-interaction-fill--on-media.sc-ds-input-date{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-input-date-h,.ds-interaction-fill--on-always-dark.sc-ds-input-date{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active-brand);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-chrome.sc-ds-input-date-h,.ds-interaction-fill--on-chrome.sc-ds-input-date{--ds-interaction-hover:var(--color-chrome-interaction-hover);--ds-interaction-pressed:var(--color-chrome-interaction-pressed);--ds-interaction-active:var(--color-chrome-interaction-active);--ds-focus-ring-color:var(--color-chrome-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-input-date-h,.ds-interaction-fill--on-navigation.sc-ds-input-date{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-input-date-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-input-date:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-input-date-h::after,.ds-interaction-fill.sc-ds-input-date::after{box-shadow:none;outline:var(--ds-interaction-border-width) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--ds-interaction-border-width))}.ds-interaction-fill--surface-open.sc-ds-input-date-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-input-date:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}.ds-interaction-fill--selected.sc-ds-input-date-h::before,.ds-interaction-fill--selected.sc-ds-input-date::before{background:transparent;outline:var(--dimension-stroke-width-025) solid var(--ds-forced-color-selected);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}}@media (forced-colors: active) and (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-input-date-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-input-date:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline-color:var(--ds-forced-color-selected);outline-width:var(--dimension-stroke-width-012)}}@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-input-date-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-input-date-h,.ds-focus-ring.sc-ds-input-date,.ds-focus-ring-inset.sc-ds-input-date-h,.ds-focus-ring-inset.sc-ds-input-date{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-input-date-h:focus-visible,.ds-focus-ring.sc-ds-input-date:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-input-date-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-input-date{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-input-date-h:focus-visible,.ds-focus-ring-inset.sc-ds-input-date:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-input-date-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-input-date:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-input-date::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-input-date-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-control-inactive.sc-ds-input-date-h,.ds-control-inactive.sc-ds-input-date{opacity:var(--effect-opacity-medium);pointer-events:none;cursor:not-allowed}@media (forced-colors: active){.ds-control-inactive.sc-ds-input-date-h,.ds-control-inactive.sc-ds-input-date{color:var(--ds-forced-color-disabled);opacity:1}}.sc-ds-input-date-h,.sc-ds-input-date:where(.ds-table),.sc-ds-input-date:where(.tooltip-popup),.sc-ds-input-date:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.ds-control--lg.sc-ds-input-date,.ds-control--lg.sc-ds-input-date-h,.ds-control--md.sc-ds-input-date-h,.ds-control--md.sc-ds-input-date,.ds-control--sm.sc-ds-input-date-h,.ds-control--sm.sc-ds-input-date,.ds-control--xs.sc-ds-input-date-h,.ds-control--xs.sc-ds-input-date{--ds-control-radius:var(--ds-radius-control)}.ds-control--lg.sc-ds-input-date-h,.ds-control--lg.sc-ds-input-date{--ds-control-height:var(--dimension-size-500);--ds-control-icon:var(--dimension-iconography-lg);--ds-control-padding-inline:var(--dimension-space-100);--ds-control-label-inset:var(--dimension-space-050);--ds-control-gap:var(--dimension-space-050)}.ds-control--md.sc-ds-input-date-h,.ds-control--md.sc-ds-input-date{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-input-date-h,.ds-control--sm.sc-ds-input-date{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-input-date-h,.ds-control--xs.sc-ds-input-date{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.ds-control-frame.sc-ds-input-date{display:inline-flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:var(--ds-control-padding-inline, var(--dimension-space-075));gap:var(--ds-control-gap, var(--dimension-space-050));border-radius:var(--ds-control-radius, var(--dimension-radius-025))}.ds-control-section-heading.sc-ds-input-date{display:flex;align-items:center;box-sizing:border-box;height:var(--ds-control-height, var(--dimension-size-400));padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-control-icon-box.sc-ds-input-date{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:var(--ds-control-icon, var(--dimension-iconography-md));height:var(--ds-control-icon, var(--dimension-iconography-md))}.ds-control-label-box.sc-ds-input-date{min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025))}.ds-control-label-dot.sc-ds-input-date{position:relative;padding-inline-end:calc( var(--ds-control-label-inset, var(--dimension-space-025)) + var(--ds-control-gap, var(--dimension-space-050)) )}.ds-control-label-dot__badge.sc-ds-input-date{position:absolute;inset-block-start:0;inset-inline-end:0;pointer-events:none}.ds-control-width--hug.sc-ds-input-date-h,.ds-control-width--hug.sc-ds-input-date{width:fit-content;max-width:100%;flex:0 0 auto}.ds-control-width--fill.sc-ds-input-date-h,.ds-control-width--fill.sc-ds-input-date{width:100%;min-width:0;flex:1 1 auto;align-self:stretch}.ds-field-stack.sc-ds-input-date-h,.ds-field-stack.sc-ds-input-date{display:flex;flex-direction:column;gap:var(--dimension-space-050)}.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date-h .error-text.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .error-text.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .field__description.sc-ds-input-date,.ds-field-stack.ds-field-stack--supporting-inset.sc-ds-input-date .field__error.sc-ds-input-date{padding-inline:calc( var(--ds-control-padding-inline, var(--dimension-space-075)) + var(--ds-control-label-inset, var(--dimension-space-025)) )}.ds-text--display-medium.sc-ds-input-date-h,.ds-text--display-medium.sc-ds-input-date{font-size:var(--typography-fontsize-3xl);line-height:var(--typography-lineheight-3xl)}.ds-text--display-small.sc-ds-input-date-h,.ds-text--display-small.sc-ds-input-date{font-size:var(--typography-fontsize-2xl);line-height:var(--typography-lineheight-2xl)}.ds-text--title-large.sc-ds-input-date-h,.ds-text--title-large.sc-ds-input-date{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl)}.ds-text--title-medium.sc-ds-input-date-h,.ds-text--title-medium.sc-ds-input-date{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--title-small.sc-ds-input-date-h,.ds-text--title-small.sc-ds-input-date{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-large.sc-ds-input-date-h,.ds-text--body-large.sc-ds-input-date{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg)}.ds-text--body-medium.sc-ds-input-date-h,.ds-text--body-medium.sc-ds-input-date{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md)}.ds-text--body-small.sc-ds-input-date-h,.ds-text--body-small.sc-ds-input-date{font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm)}.ds-text--caption.sc-ds-input-date-h,.ds-text--caption.sc-ds-input-date{font-size:var(--typography-fontsize-xs);line-height:var(--typography-lineheight-xs);text-transform:uppercase}.ds-text--display-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--display-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--display-medium.ds-text--emphasis.sc-ds-input-date,.ds-text--display-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-bold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--display-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--display-small.ds-text--regular.sc-ds-input-date-h,.ds-text--display-medium.ds-text--regular.sc-ds-input-date,.ds-text--display-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-large.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-large.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative-double)}.ds-text--title-large.ds-text--regular.sc-ds-input-date-h,.ds-text--title-large.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--title-medium.ds-text--emphasis.sc-ds-input-date,.ds-text--title-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--title-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--title-small.ds-text--regular.sc-ds-input-date-h,.ds-text--title-medium.ds-text--regular.sc-ds-input-date,.ds-text--title-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-large.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-medium.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-large.ds-text--emphasis.sc-ds-input-date,.ds-text--body-medium.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative)}.ds-text--body-large.ds-text--regular.sc-ds-input-date-h,.ds-text--body-medium.ds-text--regular.sc-ds-input-date-h,.ds-text--body-large.ds-text--regular.sc-ds-input-date,.ds-text--body-medium.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--emphasis.sc-ds-input-date-h,.ds-text--body-small.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-negative-half)}.ds-text--body-small.ds-text--regular.sc-ds-input-date-h,.ds-text--body-small.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-regular);letter-spacing:var(--typography-letterspacing-none)}.ds-text--caption.ds-text--emphasis.sc-ds-input-date-h,.ds-text--caption.ds-text--emphasis.sc-ds-input-date{font-weight:var(--typography-weight-semibold);letter-spacing:var(--typography-letterspacing-positive)}.ds-text--caption.ds-text--regular.sc-ds-input-date-h,.ds-text--caption.ds-text--regular.sc-ds-input-date{font-weight:var(--typography-weight-medium);letter-spacing:var(--typography-letterspacing-positive)}@media (forced-colors: active){.sc-ds-input-date:root,.sc-ds-input-date-h,.ds-forced-colors-scope.sc-ds-input-date{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.input-host.sc-ds-input-date-h{display:inline-flex;--ds-input-fg:var(--color-foreground-primary);--ds-input-placeholder:var(--color-foreground-secondary);--ds-input-placeholder-active:var(--color-foreground-quaternary);--ds-input-adornment-fg:var(--color-foreground-secondary);--ds-input-border:var(--color-border-secondary)}.ds-control-width--fill.sc-ds-input-date-h,.ds-control-width--fill.sc-ds-input-date-h .input-control.sc-ds-input-date{width:100%}.input-control.sc-ds-input-date{overflow:hidden;background:transparent;border:none;border-radius:var(--ds-control-radius, var(--dimension-radius-025));color:var(--ds-input-fg)}.input-control--bordered.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--ds-input-border)}.input-control--error.sc-ds-input-date{--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-negative)}.input-control--bordered.sc-ds-input-date:focus-within:not(.input-control--error){--ds-interaction-border-width:var(--dimension-stroke-width-018);--ds-interaction-border-color:var(--color-border-bold-brand)}.ds-control-inactive.sc-ds-input-date-h .input-control.sc-ds-input-date::after{background:transparent}.native-input.sc-ds-input-date{position:relative;z-index:2;flex:1 1 auto;min-width:0;height:100%;background:transparent;border:none;border-radius:inherit;outline:none;color:var(--ds-input-fg);font-family:inherit;letter-spacing:inherit;text-overflow:ellipsis;-webkit-appearance:none;appearance:none;color-scheme:inherit}.native-input--align-start.sc-ds-input-date{text-align:start}.native-input.sc-ds-input-date:disabled{cursor:not-allowed}.native-input.sc-ds-input-date:read-only:not(:disabled){cursor:default}.native-input.sc-ds-input-date::-webkit-calendar-picker-indicator{display:none}.native-input.sc-ds-input-date::-webkit-inner-spin-button,.native-input.sc-ds-input-date::-webkit-clear-button{display:none}.native-input.sc-ds-input-date::-webkit-datetime-edit,.native-input.sc-ds-input-date::-webkit-datetime-edit-fields-wrapper,.native-input.sc-ds-input-date::-webkit-datetime-edit-text,.native-input.sc-ds-input-date::-webkit-datetime-edit-month-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-day-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-year-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-hour-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-minute-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-second-field,.native-input.sc-ds-input-date::-webkit-datetime-edit-ampm-field{padding:0;color:inherit;font:inherit;letter-spacing:inherit}.input-control__prefix.sc-ds-input-date{position:relative;z-index:2;color:var(--ds-input-adornment-fg)}.input-control.sc-ds-input-date>.input-control__datetime-action.sc-ds-input-date{position:relative;z-index:2;flex-shrink:0;align-self:center}.ds-control-inactive.sc-ds-input-date-h .input-control.sc-ds-input-date>.input-control__datetime-action.sc-ds-input-date{--effect-opacity-medium:1}.input-control.sc-ds-input-date:has(.input-control__datetime-action){padding-inline-end:var(--dimension-space-025)}.error-text.sc-ds-input-date{width:100%}@media (forced-colors: active){.input-control--bordered.sc-ds-input-date:focus-within:not(.input-control--error)::after{outline-color:var(--ds-forced-color-selected)}.input-control--error.sc-ds-input-date::after{outline-style:dashed}}.ds-choice-popup.sc-ds-input-date{box-sizing:border-box;display:flex;flex-direction:column;min-width:var(--ds-choice-popup-min-inline-size, var(--dimension-menu-width-xs));max-width:min(var(--dimension-panel-width-lg), calc(100vw - var(--dimension-space-200)));max-height:calc(100vh - var(--dimension-space-200));overflow:hidden;inset:auto;margin:0;padding:0;border:0;background-color:var(--color-background-primary);border-radius:var(--ds-radius-menu);box-shadow:var(--effect-shadow-elevated-floating);color:var(--color-foreground-secondary);animation:dsChoiceFadeIn var(--effect-motion-short-2) forwards;backface-visibility:hidden;will-change:transform;text-align:start}.ds-choice-popup.sc-ds-input-date::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:var(--effect-highlight-elevated-floating)}.ds-choice-popup--closing.sc-ds-input-date{animation:dsChoiceFadeOut var(--effect-motion-short-2) forwards}@keyframes dsChoiceFadeIn{from{opacity:0;transform:inherit scale(0.97)}to{opacity:1}}@keyframes dsChoiceFadeOut{from{opacity:1}to{opacity:0}}@media (prefers-reduced-motion: reduce){.ds-choice-popup.sc-ds-input-date{animation:none;opacity:1}.ds-choice-popup--closing.sc-ds-input-date{opacity:0}}@media (forced-colors: active){.ds-choice-popup.sc-ds-input-date{outline:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);outline-offset:calc(-1 * var(--dimension-stroke-width-012))}.ds-choice-popup.sc-ds-input-date::after{box-shadow:none}}.ds-chrome-space--sm.sc-ds-input-date-h,.ds-chrome-space--sm.sc-ds-input-date{--ds-chrome-padding:var(--ds-chrome-space-sm-padding, var(--dimension-space-050));--ds-chrome-gap:var(--dimension-space-050)}.ds-chrome-space--md.sc-ds-input-date-h,.ds-chrome-space--md.sc-ds-input-date{--ds-chrome-padding:var(--dimension-space-100);--ds-chrome-gap:var(--dimension-space-100)}.ds-chrome-space--lg.sc-ds-input-date-h,.ds-chrome-space--lg.sc-ds-input-date{--ds-chrome-padding:var(--dimension-space-200);--ds-chrome-gap:var(--dimension-space-200)}.ds-chrome-row.sc-ds-input-date-h,.ds-chrome-row.sc-ds-input-date,.ds-chrome-column.sc-ds-input-date-h,.ds-chrome-column.sc-ds-input-date,.ds-chrome-grid.sc-ds-input-date-h,.ds-chrome-grid.sc-ds-input-date{display:flex;box-sizing:border-box;gap:var(--ds-chrome-gap, var(--dimension-space-100));padding:var(--ds-chrome-padding, var(--dimension-space-100))}.ds-chrome-row.sc-ds-input-date-h,.ds-chrome-row.sc-ds-input-date{flex-direction:row;align-items:center}.ds-chrome-column.sc-ds-input-date-h,.ds-chrome-column.sc-ds-input-date{flex-direction:column}.ds-chrome-grid.sc-ds-input-date-h,.ds-chrome-grid.sc-ds-input-date{display:grid;align-items:center}.input-date-popup.ds-choice-popup.sc-ds-input-date{--ds-calendar-padding:0;padding:var(--dimension-space-050)}`;let j=0;const D="Enter a valid date.";const V="Date is before the minimum allowed date.";const O="Date is after the maximum allowed date.";const E=t(class t extends i{constructor(t){super();if(t!==false){this.__registerHost()}this.dsChange=e(this,"dsChange",7);this.internals=this.attachInternals();this.generatedId=`ds-input-date-${++j}`;this.errorId=`${this.generatedId}-error`;this.popupId=`${this.generatedId}-popup`;this.value="";this.disabled=false;this.readOnly=false;this.required=false;this.requiredMessage=y;this.size="md";this.width="fill";this.hasBorder=true;this.hasInteractionFill=true;this.isInactive=false;this.autoFocus=false;this.error=false;this.ariaLabel=null;this.initialValue="";this.closeTimer=null;this.formDisabled=false;this.focused=false;this.touched=false;this.draftText="";this.open=false;this.shouldRender=false;this.closing=false;this.positionReady=false;this.pos={x:0,y:0};this.position=new o({getAnchor:()=>this.controlEl??null,getPopup:()=>this.el.querySelector(".input-date-popup"),getOwnerDocument:()=>this.el.ownerDocument,measure:(t,i)=>{if(!this.open)return null;const e=x(I.space050,I.space050);return{anchorRect:t.getBoundingClientRect(),popupWidth:i.offsetWidth||this.popupFallbackWidth,popupHeight:i.offsetHeight||this.popupFallbackHeight,side:"bottom",align:"end",sideOffsetPx:x(I.space050,I.space050),alignOffsetPx:w({align:"end",alignOffsetPx:0,sectionInsetPx:e,anchorAlignment:"popup-frame"}),viewportPadPx:x(I.space050,I.space050),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,collisionRect:r(t)}},apply:({x:t,y:i})=>{this.pos={x:t,y:i}},onReady:()=>{this.positionReady=true},liveUpdate:"double-frame",observeResize:true,topLayer:true});this.interaction=new c({getAnchor:()=>this.controlEl??null,getPopup:()=>this.el.querySelector(".input-date-popup"),getOwnerDocument:()=>this.el.ownerDocument,onOutsideActivation:()=>this.closePicker(false)});this.togglePicker=()=>{if(this.isInactive||this.disabled||this.formDisabled||this.readOnly)return;if(this.open)this.closePicker("button");else this.openPicker()};this.handleInput=t=>{if(this.pickerInactive)return;this.draftText=t.target.value;const i=this.parseDraft(this.draftText);if(i===null)return;this.commitIso(i)};this.handleFocus=()=>{this.draftText=this.displayValue||this.value;this.focused=true};this.handleBlur=()=>{this.focused=false;this.touched=true;if(this.pickerInactive){this.draftText=this.displayValue;return}const t=this.parseDraft(this.draftText);if(t===null){this.draftText=this.displayValue;return}this.commitIso(t)};this.handleCalendarChange=t=>{t.stopPropagation();if(this.pickerInactive)return;const i=this.parseDraft(t.detail);if(i===null)return;this.commitIso(i);this.closePicker("input")}}get popupFallbackWidth(){return x(I.menuWidthXs,I.menuWidthXs)}get popupFallbackHeight(){return x(I.menuFallbackHeight,I.menuFallbackHeight)}get formInactive(){return this.isInactive||this.disabled||this.formDisabled}get pickerInactive(){return this.formInactive||this.readOnly}get hasConstraintError(){if(!this.value)return false;if(!u(this.value))return true;if(this.min&&u(this.min)&&this.value<this.min)return true;if(this.max&&u(this.max)&&this.value>this.max)return true;return false}get isInvalid(){return this.error||!this.formInactive&&(this.required&&this.value.length===0||this.hasConstraintError)}componentWillLoad(){this.initialValue=this.value;this.syncFormValue()}disconnectedCallback(){this.teardownListeners();this.open=false;this.shouldRender=false;this.closing=false;this.positionReady=false;this.focused=false}syncFormValue(){const t=this.formInactive;k(this.internals,this.value,{inactive:t});const i={};let e="";if(!t){if(this.required&&this.value.length===0){i.valueMissing=true;e=this.requiredMessage}else if(this.value&&!u(this.value)){i.badInput=true;e=D}else if(this.value&&this.min&&u(this.min)&&this.value<this.min){i.rangeUnderflow=true;e=V}else if(this.value&&this.max&&u(this.max)&&this.value>this.max){i.rangeOverflow=true;e=O}}this.internals.setValidity(i,e)}onInteractionStateChange(){this.syncFormValue();if(this.pickerInactive&&this.shouldRender)this.closePicker(false)}formDisabledCallback(t){this.formDisabled=t;this.onInteractionStateChange()}formResetCallback(){this.value=this.initialValue;this.draftText=this.displayValue}formStateRestoreCallback(t){this.value=z(t);this.draftText=this.displayValue}async setFocus(){this.inputEl?.focus()}handleHostKeyDown(t){if(!this.shouldRender||this.closing)return;if(t.key==="Escape"){t.preventDefault();this.closePicker("button");return}if(t.key!=="Tab")return;const i=this.el.querySelector(".input-date-popup");if(!i||!t.composedPath().includes(i))return;if(!this.interaction.tabLeavesPopup(t))return;t.preventDefault();this.closePicker(false);this.interaction.moveFocusAfterTab(t.shiftKey)}get displayValue(){return h(this.value)}parseDraft(t){const i=t.trim();if(!i)return"";const e=f(i);if(!e)return null;if(this.min&&u(this.min)&&e<this.min)return null;if(this.max&&u(this.max)&&e>this.max)return null;return e}commitIso(t,i=true){if(this.value!==t){this.value=t;if(i)this.dsChange.emit(t)}this.draftText=h(t)}teardownListeners(){this.position.unobserve();this.interaction.disconnect();if(this.closeTimer){clearTimeout(this.closeTimer);this.closeTimer=null}}openPicker(){const t=this.isInactive||this.disabled||this.formDisabled||this.readOnly;if(t||this.open||!this.el.isConnected)return;this.shouldRender=true;this.closing=false;this.positionReady=false;this.open=true;this.teardownListeners();this.interaction.connect();this.position.observe();this.position.schedule()}closePicker(t){if(!this.shouldRender||this.closing)return;this.open=false;this.position.cancel();this.closing=true;this.interaction.disconnect();this.position.unobserve();if(t==="input")this.inputEl?.focus();if(t==="button")void this.calendarButton?.setFocus();const i=C(I.motionShort2,I.animationDurationShort3);if(i<=0){this.finishClose();return}this.closeTimer=setTimeout((()=>this.finishClose()),i)}finishClose(){const t=this.el.querySelector(".input-date-popup");if(t?.matches(":popover-open"))t.hidePopover();this.shouldRender=false;this.closing=false;this.closeTimer=null}render(){const t=this.inputId??this.generatedId;const i=this.formInactive;const e=this.pickerInactive;const d=this.value.length>0;const o=this.value!==this.initialValue;const r=this.error&&Boolean(this.errorMessage);const a=F[this.size];const c=`ds-text--${a.replace("text-","")}`;const l=[this.ariaDescribedby,r?this.errorId:undefined].filter(Boolean).join(" ")||undefined;const p={position:"fixed",left:"0",top:"0",transform:`translate(${Math.round(this.pos.x)}px, ${Math.round(this.pos.y)}px)`,zIndex:"var(--dimension-z-index-floating)",visibility:this.positionReady?"visible":"hidden"};return s(n,{key:"ac8e4290fedd83cb179be3f213537de046d9e5b0",class:{"input-host":true,"ds-field-stack":true,"ds-field-stack--supporting-inset":!this.hasBorder,"ds-control-inactive":i,[`ds-control--${this.size}`]:true,...T(this.width)},"data-disabled":i?"":undefined,"data-readonly":this.readOnly?"":undefined,"data-required":this.required?"":undefined,"data-invalid":this.isInvalid?"":undefined,"data-filled":d?"":undefined,"data-focused":this.focused?"":undefined,"data-dirty":o?"":undefined,"data-touched":this.touched?"":undefined},s("div",{key:"2fa530c300aa0d43e3944ca3bfd3049e85e35a71",ref:t=>{this.controlEl=t},class:{"input-control":true,"ds-control-frame":true,"input-control--bordered":this.hasBorder,"input-control--error":this.hasBorder&&this.error,"ds-interaction-fill":this.hasInteractionFill,[`ds-control--${this.size}`]:true}},s("input",{key:"5395306010f31d64c9f1f2d15fce6e5e0918b400",ref:t=>{this.inputEl=t},type:"text",id:t,value:this.focused?this.draftText:this.displayValue,disabled:i,readOnly:this.readOnly,required:this.required,autoFocus:this.autoFocus,autoComplete:"off",spellcheck:false,class:{"native-input":true,"native-input--align-start":true,"ds-control-label-box":true,[c]:true,"ds-text--regular":true},"aria-label":this.ariaLabel,"aria-labelledby":this.ariaLabelledby,"aria-describedby":l,"aria-invalid":this.isInvalid?"true":undefined,onInput:this.handleInput,onFocus:this.handleFocus,onBlur:this.handleBlur}),s("ds-button-unfilled",{key:"69968fcade07b16bb789b7f76b2866f29961a846",ref:t=>{this.calendarButton=t},class:"input-control__datetime-action",variant:"icon",size:this.size,icon:"Calendar",hasBorder:false,isInset:true,isInactive:e,ariaLabel:"Choose date",haspopup:"dialog",expanded:this.open,surfaceOpen:this.open||this.closing,controls:this.open?this.popupId:undefined,onDsClick:this.togglePicker})),this.shouldRender?s("div",{id:this.popupId,popover:"manual",class:{"input-date-popup":true,"ds-choice-popup":true,"ds-choice-popup--closing":this.closing,"ds-chrome-column":true,"ds-chrome-space--sm":true},style:p,role:"dialog","aria-label":"Choose date"},s("ds-calendar",{selectionMode:"single",value:this.value,min:this.min,max:this.max,isInactive:e,autoFocus:true,onDsChange:this.handleCalendarChange})):null,r&&s("ds-text",{key:"aedd6c998da63bb1dc73db4b8045fac5bfbb220c",class:"error-text",as:"div",variant:"text-body-small",color:"negative",textId:this.errorId,role:"alert"},this.errorMessage))}static get formAssociated(){return true}get el(){return this}static get watchers(){return{value:[{syncFormValue:0}],required:[{syncFormValue:0}],requiredMessage:[{syncFormValue:0}],min:[{syncFormValue:0}],max:[{syncFormValue:0}],disabled:[{onInteractionStateChange:0}],isInactive:[{onInteractionStateChange:0}],readOnly:[{onInteractionStateChange:0}]}}static get style(){return _()}},[66,"ds-input-date",{value:[1025],name:[513],form:[513],disabled:[516],readOnly:[516,"read-only"],required:[516],requiredMessage:[1,"required-message"],min:[1],max:[1],size:[1],width:[1],hasBorder:[4,"has-border"],hasInteractionFill:[4,"has-interaction-fill"],isInactive:[4,"is-inactive"],autoFocus:[4,"auto-focus"],error:[4],errorMessage:[1,"error-message"],inputId:[1,"input-id"],ariaLabel:[1,"aria-label"],ariaLabelledby:[1,"aria-labelledby"],ariaDescribedby:[1,"aria-describedby"],formDisabled:[32],focused:[32],touched:[32],draftText:[32],open:[32],shouldRender:[32],closing:[32],positionReady:[32],pos:[32],setFocus:[64]},[[0,"keydown","handleHostKeyDown"]],{value:[{syncFormValue:0}],required:[{syncFormValue:0}],requiredMessage:[{syncFormValue:0}],min:[{syncFormValue:0}],max:[{syncFormValue:0}],disabled:[{onInteractionStateChange:0}],isInactive:[{onInteractionStateChange:0}],readOnly:[{onInteractionStateChange:0}]}]);function H(){if(typeof customElements==="undefined"){return}const t=["ds-input-date","ds-badge","ds-button-unfilled","ds-calendar","ds-icon","ds-loader","ds-text","ds-tooltip"];t.forEach((t=>{switch(t){case"ds-input-date":if(!customElements.get(d(t))){customElements.define(d(t),E)}break;case"ds-badge":if(!customElements.get(d(t))){l()}break;case"ds-button-unfilled":if(!customElements.get(d(t))){p()}break;case"ds-calendar":if(!customElements.get(d(t))){v()}break;case"ds-icon":if(!customElements.get(d(t))){g()}break;case"ds-loader":if(!customElements.get(d(t))){m()}break;case"ds-text":if(!customElements.get(d(t))){b()}break;case"ds-tooltip":if(!customElements.get(d(t))){a()}break}}))}H();export{E as I,H as d};
2
+ //# sourceMappingURL=p-BT6xQogY.js.map
@@ -1,2 +1,2 @@
1
- import{p as i,H as e,c as s,h as t,a as o,t as n}from"./index.js";import{g as r,i as c}from"./p-BQq26pt9.js";import{C as a}from"./p-DlsjHRU3.js";import{d}from"./p-CzTJAO2J.js";import{d as l}from"./p-BrB05_X8.js";import{d as h}from"./p-BVsVUnAw.js";import{d as m}from"./p-0XTyQNRG.js";import{d as b}from"./p-z_8aZHHo.js";import{d as f}from"./p-Ch00yccW.js";import{d as u}from"./p-CAARHqjE.js";import{d as v}from"./p-M9pOLcyK.js";import{d as g}from"./p-CTAF7SkL.js";import{d as w}from"./p-PNY7auMh.js";import{b as p,T as x}from"./p-CeXf9-X3.js";function k(i,e){const s=r(i);const t=s.findIndex((i=>i.id===e));const o=t>=0?t:0;return{selectedIndex:o,selected:s[o],hasPrevious:o>0,hasNext:o<s.length-1}}const _=()=>`@media (forced-colors: active){.sc-ds-mobile-section-switcher:root,.sc-ds-mobile-section-switcher-h,.ds-forced-colors-scope.sc-ds-mobile-section-switcher{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-mobile-section-switcher-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-mobile-section-switcher-h,.ds-focus-ring.sc-ds-mobile-section-switcher,.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h,.ds-focus-ring-inset.sc-ds-mobile-section-switcher{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-mobile-section-switcher-h:focus-visible,.ds-focus-ring.sc-ds-mobile-section-switcher:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-mobile-section-switcher-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-mobile-section-switcher{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h:focus-visible,.ds-focus-ring-inset.sc-ds-mobile-section-switcher:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-mobile-section-switcher:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-mobile-section-switcher-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-mobile-section-switcher:root,.sc-ds-mobile-section-switcher-h,.ds-forced-colors-scope.sc-ds-mobile-section-switcher{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-interaction-fill.sc-ds-mobile-section-switcher-h,.ds-interaction-fill.sc-ds-mobile-section-switcher{position:var(--ds-interaction-position, relative);z-index:var(--ds-interaction-z-index, 0);cursor:default;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent;--ds-interaction-divider-width:0px;--ds-interaction-divider-color:transparent;--ds-interaction-divider-inline-start-width:0px;--ds-interaction-divider-inline-start-color:transparent;--ds-interaction-divider-inline-end-width:0px;--ds-interaction-divider-inline-end-color:transparent}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill.sc-ds-mobile-section-switcher::before,.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill.sc-ds-mobile-section-switcher::before{z-index:1}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::after{z-index:3;box-shadow:inset 0 calc(-1 * var(--ds-interaction-divider-width)) 0 var(--ds-interaction-divider-color), inset var(--ds-interaction-divider-inline-start-width) 0 0 var(--ds-interaction-divider-inline-start-color), inset calc(-1 * var(--ds-interaction-divider-inline-end-width)) 0 0 var(--ds-interaction-divider-inline-end-color), inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--bordered.sc-ds-mobile-section-switcher{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-mobile-section-switcher-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-mobile-section-switcher-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher{--ds-interaction-divider-width:var(--ds-interaction-group-divider-width, 0px);--ds-interaction-divider-color:var(--ds-interaction-group-divider-color, transparent);--ds-interaction-divider-inline-start-width:var( --ds-interaction-group-divider-inline-start-width, 0px );--ds-interaction-divider-inline-start-color:var( --ds-interaction-group-divider-inline-start-color, transparent );--ds-interaction-divider-inline-end-width:var( --ds-interaction-group-divider-inline-end-width, 0px );--ds-interaction-divider-inline-end-color:var( --ds-interaction-group-divider-inline-end-color, transparent )}.ds-interaction-fill.sc-ds-mobile-section-switcher-h>.ds-interaction-fill__content.sc-ds-mobile-section-switcher,.ds-interaction-fill.sc-ds-mobile-section-switcher>.ds-interaction-fill__content.sc-ds-mobile-section-switcher,.ds-interaction-fill__content.sc-ds-mobile-section-switcher{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-faint.sc-ds-mobile-section-switcher{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-medium.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-bold.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-strong.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-translucent.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active-brand);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-inverted.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active-brand);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-media.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-always-dark.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active-brand);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-chrome.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-chrome.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-chrome-interaction-hover);--ds-interaction-pressed:var(--color-chrome-interaction-pressed);--ds-interaction-active:var(--color-chrome-interaction-active);--ds-focus-ring-color:var(--color-chrome-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-navigation.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::after{box-shadow:none;outline:var(--ds-interaction-border-width) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--ds-interaction-border-width))}.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher::before{background:transparent;outline:var(--dimension-stroke-width-025) solid var(--ds-forced-color-selected);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}}@media (forced-colors: active) and (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-mobile-section-switcher-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline-color:var(--ds-forced-color-selected);outline-width:var(--dimension-stroke-width-012)}}.sc-ds-mobile-section-switcher-h,.sc-ds-mobile-section-switcher:where(.ds-table),.sc-ds-mobile-section-switcher:where(.tooltip-popup),.sc-ds-mobile-section-switcher:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.ds-control--lg.sc-ds-mobile-section-switcher,.ds-control--lg.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher,.ds-control--sm.sc-ds-mobile-section-switcher-h,.ds-control--sm.sc-ds-mobile-section-switcher,.ds-control--xs.sc-ds-mobile-section-switcher-h,.ds-control--xs.sc-ds-mobile-section-switcher{--ds-control-radius:var(--ds-radius-control)}.ds-control--lg.sc-ds-mobile-section-switcher-h,.ds-control--lg.sc-ds-mobile-section-switcher{--ds-control-height:var(--dimension-size-500);--ds-control-icon:var(--dimension-iconography-lg);--ds-control-padding-inline:var(--dimension-space-100);--ds-control-label-inset:var(--dimension-space-050);--ds-control-gap:var(--dimension-space-050)}.ds-control--md.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-mobile-section-switcher-h,.ds-control--sm.sc-ds-mobile-section-switcher{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-mobile-section-switcher-h,.ds-control--xs.sc-ds-mobile-section-switcher{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.sc-ds-mobile-section-switcher-h{display:block;min-width:0;max-width:100%;color:var(--color-foreground-primary)}.mobile-section-switcher.sc-ds-mobile-section-switcher{appearance:none;display:grid;grid-template-columns:var(--dimension-size-100) minmax(0, auto) var(--dimension-size-100);align-items:center;justify-content:center;gap:var(--dimension-space-050);max-width:100%;min-height:var(--dimension-size-400);padding-inline:var(--dimension-space-100);border:0;border-radius:var(--dimension-radius-100);background:var(--color-background-secondary);color:inherit;box-sizing:border-box;cursor:default}.mobile-section-switcher__label.sc-ds-mobile-section-switcher{min-width:0;max-width:100%;text-align:center}.mobile-section-switcher__position.sc-ds-mobile-section-switcher{width:var(--dimension-size-050);height:var(--dimension-size-050);border-radius:var(--dimension-radius-half);background:currentColor;opacity:0}.mobile-section-switcher__position--visible.sc-ds-mobile-section-switcher{opacity:1}.mobile-section-switcher--sheet.sc-ds-mobile-section-switcher{grid-template-columns:minmax(0, auto);min-height:var(--dimension-size-500);padding-inline:var(--dimension-space-150);border-radius:var(--dimension-radius-half);background:transparent;--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-tertiary)}.mobile-section-switcher--combined.sc-ds-mobile-section-switcher{display:flex}.mobile-section-switcher__page-label.sc-ds-mobile-section-switcher{flex:0 1 auto;min-width:0}.mobile-section-switcher__separator.sc-ds-mobile-section-switcher{flex:0 0 auto}.mobile-section-switcher--combined.sc-ds-mobile-section-switcher .mobile-section-switcher__label.sc-ds-mobile-section-switcher{flex:0 0 auto;max-width:50%}.mobile-section-sheet.sc-ds-mobile-section-switcher{position:fixed;inset:0 0 auto;width:100%;max-width:none;max-height:calc(100dvh - var(--dimension-size-500) - var(--dimension-space-200));margin:0;padding:0;border:0;border-radius:0;box-sizing:border-box;overflow:visible;background:transparent;color:var(--color-foreground-secondary);outline:none}.mobile-section-sheet[open].sc-ds-mobile-section-switcher{display:flex;flex-direction:column}.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher{animation:mobileSectionSheetIn var(--effect-motion-short-2) both}.mobile-section-sheet.sc-ds-mobile-section-switcher::backdrop{background:var(--color-background-shade);animation:mobileSectionShadeIn var(--effect-motion-short-2) both}.mobile-section-sheet--closing[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher{animation-name:mobileSectionSheetOut}.mobile-section-sheet--closing.sc-ds-mobile-section-switcher::backdrop{animation-name:mobileSectionShadeOut}.mobile-section-sheet__items.sc-ds-mobile-section-switcher{display:flex;flex-direction:column;gap:var(--dimension-space-100);min-height:0;max-height:inherit;box-sizing:border-box;background:var(--color-background-primary);box-shadow:var(--effect-elevation-elevated-floating);padding:var(--dimension-space-100);padding-block-start:max(var(--dimension-space-100), env(safe-area-inset-top, 0px));overflow-y:auto;overscroll-behavior:contain}.mobile-section-sheet__item.sc-ds-mobile-section-switcher{appearance:none;flex:0 0 auto;display:flex;align-items:center;height:var(--ds-control-height);width:100%;min-width:0;padding:0 var(--ds-control-padding-inline);box-sizing:border-box;border:0;border-radius:var(--ds-control-radius);background:transparent;color:inherit;text-align:start}.mobile-section-sheet__item[aria-current='page'].sc-ds-mobile-section-switcher{color:var(--color-foreground-primary)}.mobile-section-sheet__item.sc-ds-mobile-section-switcher:disabled{color:var(--color-foreground-tertiary)}.mobile-section-sheet__label.sc-ds-mobile-section-switcher{min-width:0;padding-inline:var(--ds-control-label-inset)}.mobile-section-sheet__divider.sc-ds-mobile-section-switcher{flex:0 0 auto;height:var(--dimension-stroke-width-012);margin-inline:var(--dimension-space-100);background:var(--color-border-tertiary)}@keyframes mobileSectionSheetIn{from{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes mobileSectionSheetOut{from{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes mobileSectionShadeIn{from{opacity:0}to{opacity:1}}@keyframes mobileSectionShadeOut{from{opacity:1}to{opacity:0}}.mobile-section-switcher--pointer-focus.sc-ds-mobile-section-switcher-h .ds-focus-ring-inset.sc-ds-mobile-section-switcher::after{outline:none}.mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{position:fixed;inset:auto 0 0;height:max(var(--dimension-space-200), env(safe-area-inset-bottom, 0px));pointer-events:none;color:var(--color-background-primary);background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{animation:mobileSectionEdgeIn var(--effect-motion-short-2) both}.mobile-section-sheet--closing[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{animation-name:mobileSectionEdgeOut}@keyframes mobileSectionEdgeIn{from{background-color:var(--color-background-primary)}to{background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}}@keyframes mobileSectionEdgeOut{from{background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}to{background-color:var(--color-background-primary)}}@media (prefers-reduced-motion: reduce){.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher,.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher,.mobile-section-sheet.sc-ds-mobile-section-switcher::backdrop{animation:none}}`;let y=0;const C=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.dsChange=s(this,"dsChange",7);this.sections=[];this.value="";this.navigationLabel="Change page section";this.presentation="menu";this.pageLabel="";this.menuOpen=false;this.menuSurfaceOpen=false;this.initialFocusVisible=false;this.pointerFocus=false;this.sheetClosing=false;this.focusedSection="";this.instanceId=y++;this.triggerId=`ds-mobile-section-switcher-trigger-${this.instanceId}`;this.menuId=`ds-mobile-section-switcher-menu-${this.instanceId}`;this.triggerEl=null;this.dialogEl=null;this.browserEdgeEl=null;this.browserEdgeColors="";this.closeTimer=null;this.loaded=false;this.tasks=new a((()=>this.el.isConnected));this.handleDocumentKeyDown=i=>{if(["Shift","Control","Alt","Meta"].includes(i.key))return;this.pointerFocus=false};this.updateBrowserEdgeColor=()=>{if(!this.el.isConnected||!this.browserEdgeEl||!this.dialogEl)return;const i=getComputedStyle(this.browserEdgeEl).color;const e=getComputedStyle(this.dialogEl,"::backdrop").backgroundColor;const s=`${i}|${e}`;if(s===this.browserEdgeColors)return;const t=this.el.ownerDocument.createElement("canvas");t.width=t.height=1;const o=t.getContext("2d");if(!o)return;o.fillStyle=i;o.fillRect(0,0,1,1);o.fillStyle=e;o.fillRect(0,0,1,1);const[n,r,c]=o.getImageData(0,0,1,1).data;this.browserEdgeEl.style.setProperty("--_mobile-section-edge-color",`rgb(${n}, ${r}, ${c})`);this.browserEdgeColors=s};this.handleSheetKeyDown=i=>{if(i.key==="Escape"){i.preventDefault();i.stopPropagation();this.closeMenu();return}const e=this.selectableSections.filter((i=>!i.isInactive));if(!e.length)return;const s=Math.max(0,e.findIndex((i=>i.id===this.focusedSection)));let t;if(i.key==="ArrowDown")t=(s+1)%e.length;else if(i.key==="ArrowUp")t=(s+e.length-1)%e.length;else if(i.key==="Home")t=0;else if(i.key==="End")t=e.length-1;else if(i.key==="Tab")t=s;else if(i.key.length===1&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&i.key!==" "){const o=e.findIndex(((t,o)=>e[(s+o+1)%e.length].label.toLowerCase().startsWith(i.key.toLowerCase())));if(o<0)return;t=(s+o+1)%e.length}else return;i.preventDefault();this.initialFocusVisible=true;this.focusSheetItem(e[t].id)};this.toggleMenu=i=>{if(this.selectableSections.length<=1)return;this.initialFocusVisible=i.detail===0;if(this.presentation==="sheet"){if(this.menuOpen)this.closeMenu();else{this.focusedSection=this.selectedSection?.id??"";this.menuOpen=true}return}this.menuOpen=!this.menuOpen;if(this.menuOpen)this.menuSurfaceOpen=true};this.closeMenu=()=>{this.menuOpen=false;if(this.dialogEl?.open)this.sheetClosing=true};this.handleSelect=i=>{const e=String(i.detail.value??"");const s=this.selectableSections.find((i=>i.id===e));if(!s||s.isInactive)return;this.closeMenu();if(e!==this.selectedSection?.id)this.dsChange.emit(e);this.tasks.frame((()=>this.triggerEl?.focus()))}}componentDidLoad(){this.loaded=true;this.connectResources()}connectedCallback(){if(this.loaded)this.connectResources()}connectResources(){if(!this.el.isConnected||this.boundDocument)return;this.boundDocument=this.el.ownerDocument;this.boundDocument.addEventListener("keydown",this.handleDocumentKeyDown,true);this.visibilityObserver=new ResizeObserver(this.tasks.guard((()=>{if(this.dialogEl?.open&&!this.triggerEl?.getClientRects().length){this.finishSheetClose(false)}})));this.visibilityObserver.observe(this.el)}componentDidRender(){if(!this.el.isConnected||!this.dialogEl)return;if(this.presentation==="sheet"&&this.menuOpen&&!this.dialogEl.open){const i=this.focusedSection;this.updateBrowserEdgeColor();this.observeBrowserEdgeTheme();this.dialogEl.showModal();this.focusSheetItem(i)}if(this.sheetClosing&&this.dialogEl.open&&!this.closeTimer){const i=p(x.motionShort2,x.animationDurationShort3);if(!i)this.finishSheetClose();else this.closeTimer=setTimeout((()=>this.finishSheetClose()),i)}}disconnectedCallback(){this.tasks.cancel();this.boundDocument?.removeEventListener("keydown",this.handleDocumentKeyDown,true);this.boundDocument=undefined;this.visibilityObserver?.disconnect();this.visibilityObserver=undefined;this.pointerFocus=false;this.menuSurfaceOpen=false;this.finishSheetClose(false)}handlePresentationChange(){this.menuSurfaceOpen=false;this.closeMenu()}handleContextChange(){this.closeMenu()}finishSheetClose(i=true){if(this.closeTimer)clearTimeout(this.closeTimer);this.closeTimer=null;const e=this.dialogEl?.open;this.dialogEl?.close();this.themeObserver?.disconnect();this.menuOpen=false;this.sheetClosing=false;if(e&&i&&this.triggerEl?.getClientRects().length)this.triggerEl.focus()}observeBrowserEdgeTheme(){this.themeObserver??(this.themeObserver=new MutationObserver(this.updateBrowserEdgeColor));for(let i=this.el;i;i=i.parentElement){this.themeObserver.observe(i,{attributes:true,attributeFilter:["class","style","data-theme"]})}}focusSheetItem(i){const e=Array.from(this.dialogEl?.querySelectorAll("button")??[]);const s=e.find((e=>e.value===i&&!e.disabled))??e.find((i=>!i.disabled));if(s){this.focusedSection=s.value;s.focus()}else this.dialogEl?.focus()}get resolvedSections(){return this.sections??[]}get selectableSections(){return r(this.resolvedSections)}get selectedIndex(){return k(this.resolvedSections,this.value).selectedIndex}get selectedSection(){return this.selectableSections[this.selectedIndex]}get hasPrevious(){return k(this.resolvedSections,this.value).hasPrevious}get hasNext(){return k(this.resolvedSections,this.value).hasNext}get triggerAriaLabel(){return`${this.presentation==="sheet"&&this.pageLabel?`${this.pageLabel}. `:""}${this.navigationLabel}. Current section: ${this.selectedSection?.label??""}`}get menuSections(){const i=[];let e=[];const s=()=>{if(e.length)i.push({items:e});e=[]};for(const i of this.resolvedSections){if(c(i)){s();continue}e.push({label:i.label,value:i.id,dot:i.dot,isSelected:i.id===this.selectedSection?.id,isInactive:i.isInactive})}s();return i}handleSectionsChange(){if(this.selectableSections.length<=1){this.closeMenu();this.menuSurfaceOpen=false}else if(this.dialogEl?.open&&!this.sheetClosing){this.tasks.frame((()=>{if(this.dialogEl?.open&&!this.sheetClosing)this.focusSheetItem(this.focusedSection)}))}}renderSheet(){return t("dialog",{id:this.menuId,ref:i=>{this.dialogEl=i??null},class:{"mobile-section-sheet":true,"mobile-section-sheet--closing":this.sheetClosing},"aria-label":this.navigationLabel,tabIndex:-1,onCancel:i=>{i.preventDefault();this.closeMenu()},onKeyDown:this.handleSheetKeyDown,onClick:i=>{if(!this.dialogEl||i.target!==this.dialogEl)return;const e=this.dialogEl.getBoundingClientRect();if(i.clientY<e.top||i.clientY>e.bottom||i.clientX<e.left||i.clientX>e.right)this.closeMenu()}},t("div",{class:"mobile-section-sheet__items",role:"menu","aria-label":this.navigationLabel},this.resolvedSections.map((i=>c(i)?t("div",{class:"mobile-section-sheet__divider",role:"separator"}):t("button",{type:"button",role:"menuitem",value:i.id,disabled:i.isInactive,"aria-current":i.id===this.selectedSection?.id?"page":undefined,tabIndex:i.id===this.focusedSection?0:-1,class:{"mobile-section-sheet__item":true,"ds-control--lg":true,"ds-interaction-fill":true,"ds-focus-ring-inset":true,"ds-focus-ring--visible":this.initialFocusVisible&&i.id===this.focusedSection},onFocus:()=>{this.focusedSection=i.id},onClick:()=>{if(this.sheetClosing||i.isInactive)return;this.closeMenu();if(i.id!==this.selectedSection?.id)this.dsChange.emit(i.id)}},t("ds-text",{class:"mobile-section-sheet__label ds-interaction-fill__content",as:"span",variant:"text-body-large",color:"inherit",emphasis:i.id===this.selectedSection?.id,lineTruncation:1},i.label))))),t("div",{ref:i=>{if(this.browserEdgeEl!==i)this.browserEdgeColors="";this.browserEdgeEl=i??null},class:"mobile-section-sheet__browser-edge","aria-hidden":"true"}))}render(){const i=this.selectedSection;if(!i)return t(o,null);const e=this.presentation==="sheet"&&!!this.pageLabel;return t(o,{class:{"mobile-section-switcher--pointer-focus":this.pointerFocus},onPointerDown:()=>{this.pointerFocus=true;this.initialFocusVisible=false}},t("button",{ref:i=>{this.triggerEl=i??null},id:this.triggerId,class:{"mobile-section-switcher":true,"mobile-section-switcher--expanded":this.menuOpen,"ds-interaction-fill--surface-open":this.menuSurfaceOpen||this.menuOpen||this.sheetClosing,"mobile-section-switcher--sheet":this.presentation==="sheet","mobile-section-switcher--combined":e,"ds-focus-ring-inset":true,"ds-interaction-fill":true},type:"button","aria-haspopup":this.presentation==="sheet"?"dialog":"menu","aria-controls":this.menuId,"aria-expanded":String(this.menuOpen),"aria-label":this.triggerAriaLabel,onClick:this.toggleMenu},this.presentation==="menu"?t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasPrevious,"ds-interaction-fill__content":true},"aria-hidden":"true"}):null,e?[t("ds-text",{class:"mobile-section-switcher__page-label ds-interaction-fill__content",as:"span",variant:"text-body-large",emphasis:true,color:"inherit",lineTruncation:1},this.pageLabel),t("ds-text",{class:"mobile-section-switcher__separator ds-interaction-fill__content",as:"span",variant:"text-body-large",color:"inherit","aria-hidden":"true"},"·")]:null,t("ds-text",{class:"mobile-section-switcher__label ds-interaction-fill__content",as:"span",variant:this.presentation==="sheet"?"text-body-large":"text-body-medium",emphasis:true,color:"inherit",lineTruncation:1},i.label),this.presentation==="menu"?t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasNext,"ds-interaction-fill__content":true},"aria-hidden":"true"}):null),this.presentation==="sheet"||this.sheetClosing?this.renderSheet():this.selectableSections.length>1?t("ds-menu",{id:this.menuId,anchorId:this.triggerId,align:"center",menuLabel:this.navigationLabel,open:this.menuOpen,initialFocusVisible:this.initialFocusVisible,sections:this.menuSections,onDsClose:this.closeMenu,onDsAfterClose:()=>{if(!this.menuOpen)this.menuSurfaceOpen=false},onDsSelect:this.handleSelect}):null)}get el(){return this}static get watchers(){return{presentation:[{handlePresentationChange:0}],value:[{handleContextChange:0}],pageLabel:[{handleContextChange:0}],sections:[{handleSectionsChange:0}]}}static get style(){return _()}},[2,"ds-mobile-section-switcher",{sections:[16],value:[1],navigationLabel:[1,"navigation-label"],presentation:[1],pageLabel:[1,"page-label"],menuOpen:[32],menuSurfaceOpen:[32],initialFocusVisible:[32],pointerFocus:[32],sheetClosing:[32],focusedSection:[32]},undefined,{presentation:[{handlePresentationChange:0}],value:[{handleContextChange:0}],pageLabel:[{handleContextChange:0}],sections:[{handleSectionsChange:0}]}]);function S(){if(typeof customElements==="undefined"){return}const i=["ds-mobile-section-switcher","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-menu","ds-swatch-picker","ds-switch","ds-tag","ds-text","ds-tooltip"];i.forEach((i=>{switch(i){case"ds-mobile-section-switcher":if(!customElements.get(n(i))){customElements.define(n(i),C)}break;case"ds-badge":if(!customElements.get(n(i))){d()}break;case"ds-button-unfilled":if(!customElements.get(n(i))){l()}break;case"ds-icon":if(!customElements.get(n(i))){h()}break;case"ds-loader":if(!customElements.get(n(i))){m()}break;case"ds-menu":if(!customElements.get(n(i))){b()}break;case"ds-swatch-picker":if(!customElements.get(n(i))){f()}break;case"ds-switch":if(!customElements.get(n(i))){u()}break;case"ds-tag":if(!customElements.get(n(i))){v()}break;case"ds-text":if(!customElements.get(n(i))){g()}break;case"ds-tooltip":if(!customElements.get(n(i))){w()}break}}))}S();export{C as M,S as d};
2
- //# sourceMappingURL=p-YmJYwnhW.js.map
1
+ import{p as i,H as e,c as s,h as t,a as o,t as n}from"./index.js";import{g as r,i as c}from"./p-BQq26pt9.js";import{C as a}from"./p-DlsjHRU3.js";import{d}from"./p-CzTJAO2J.js";import{d as l}from"./p-CaNMVLhm.js";import{d as h}from"./p-BVsVUnAw.js";import{d as m}from"./p-0XTyQNRG.js";import{d as b}from"./p-DixX2_Bd.js";import{d as f}from"./p-Ch00yccW.js";import{d as u}from"./p-CAARHqjE.js";import{d as v}from"./p-M9pOLcyK.js";import{d as g}from"./p-CTAF7SkL.js";import{d as w}from"./p-B5rN3slq.js";import{b as p,T as x}from"./p-CeXf9-X3.js";function k(i,e){const s=r(i);const t=s.findIndex((i=>i.id===e));const o=t>=0?t:0;return{selectedIndex:o,selected:s[o],hasPrevious:o>0,hasNext:o<s.length-1}}const _=()=>`@media (forced-colors: active){.sc-ds-mobile-section-switcher:root,.sc-ds-mobile-section-switcher-h,.ds-forced-colors-scope.sc-ds-mobile-section-switcher{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-mobile-section-switcher-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-mobile-section-switcher-h,.ds-focus-ring.sc-ds-mobile-section-switcher,.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h,.ds-focus-ring-inset.sc-ds-mobile-section-switcher{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-mobile-section-switcher-h:focus-visible,.ds-focus-ring.sc-ds-mobile-section-switcher:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-mobile-section-switcher-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-mobile-section-switcher{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h:focus-visible,.ds-focus-ring-inset.sc-ds-mobile-section-switcher:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-mobile-section-switcher-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-mobile-section-switcher:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-section-switcher::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-mobile-section-switcher-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-mobile-section-switcher:root,.sc-ds-mobile-section-switcher-h,.ds-forced-colors-scope.sc-ds-mobile-section-switcher{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.ds-interaction-fill.sc-ds-mobile-section-switcher-h,.ds-interaction-fill.sc-ds-mobile-section-switcher{position:var(--ds-interaction-position, relative);z-index:var(--ds-interaction-z-index, 0);cursor:default;--ds-interaction-hover:var(--color-interaction-hover);--ds-interaction-pressed:var(--color-interaction-pressed);--ds-interaction-active:var(--color-interaction-active-brand);--ds-interaction-border-width:0px;--ds-interaction-border-color:transparent;--ds-interaction-divider-width:0px;--ds-interaction-divider-color:transparent;--ds-interaction-divider-inline-start-width:0px;--ds-interaction-divider-inline-start-color:transparent;--ds-interaction-divider-inline-end-width:0px;--ds-interaction-divider-inline-end-color:transparent}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill.sc-ds-mobile-section-switcher::before,.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill.sc-ds-mobile-section-switcher::before{z-index:1}.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::after{z-index:3;box-shadow:inset 0 calc(-1 * var(--ds-interaction-divider-width)) 0 var(--ds-interaction-divider-color), inset var(--ds-interaction-divider-inline-start-width) 0 0 var(--ds-interaction-divider-inline-start-color), inset calc(-1 * var(--ds-interaction-divider-inline-end-width)) 0 0 var(--ds-interaction-divider-inline-end-color), inset 0 0 0 var(--ds-interaction-border-width) var(--ds-interaction-border-color)}.ds-interaction-fill--bordered.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--bordered.sc-ds-mobile-section-switcher{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-mobile-section-switcher-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-mobile-section-switcher-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--grouped.sc-ds-mobile-section-switcher{--ds-interaction-divider-width:var(--ds-interaction-group-divider-width, 0px);--ds-interaction-divider-color:var(--ds-interaction-group-divider-color, transparent);--ds-interaction-divider-inline-start-width:var( --ds-interaction-group-divider-inline-start-width, 0px );--ds-interaction-divider-inline-start-color:var( --ds-interaction-group-divider-inline-start-color, transparent );--ds-interaction-divider-inline-end-width:var( --ds-interaction-group-divider-inline-end-width, 0px );--ds-interaction-divider-inline-end-color:var( --ds-interaction-group-divider-inline-end-color, transparent )}.ds-interaction-fill.sc-ds-mobile-section-switcher-h>.ds-interaction-fill__content.sc-ds-mobile-section-switcher,.ds-interaction-fill.sc-ds-mobile-section-switcher>.ds-interaction-fill__content.sc-ds-mobile-section-switcher,.ds-interaction-fill__content.sc-ds-mobile-section-switcher{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-faint.sc-ds-mobile-section-switcher{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-medium.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-interaction-on-medium-background-hover);--ds-interaction-pressed:var(--color-interaction-on-medium-background-pressed);--ds-interaction-active:var(--color-interaction-on-medium-background-active);--ds-focus-ring-color:var(--color-interaction-on-medium-background-focus)}.ds-interaction-fill--on-bold.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-bold.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-interaction-on-bold-background-hover);--ds-interaction-pressed:var(--color-interaction-on-bold-background-pressed);--ds-interaction-active:var(--color-interaction-on-bold-background-active);--ds-focus-ring-color:var(--color-interaction-on-bold-background-focus)}.ds-interaction-fill--on-strong.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-strong.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-interaction-on-strong-background-hover);--ds-interaction-pressed:var(--color-interaction-on-strong-background-pressed);--ds-interaction-active:var(--color-interaction-on-strong-background-active);--ds-focus-ring-color:var(--color-interaction-on-strong-background-focus)}.ds-interaction-fill--on-translucent.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-translucent.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-translucent-interaction-hover);--ds-interaction-pressed:var(--color-translucent-interaction-pressed);--ds-interaction-active:var(--color-translucent-interaction-active-brand);--ds-focus-ring-color:var(--color-translucent-interaction-focus)}.ds-interaction-fill--on-inverted.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-inverted.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-inverted-interaction-hover);--ds-interaction-pressed:var(--color-inverted-interaction-pressed);--ds-interaction-active:var(--color-inverted-interaction-active-brand);--ds-focus-ring-color:var(--color-inverted-interaction-focus)}.ds-interaction-fill--on-media.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-media.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-media-interaction-hover);--ds-interaction-pressed:var(--color-media-interaction-pressed);--ds-interaction-active:var(--color-media-interaction-active);--ds-focus-ring-color:var(--color-media-interaction-focus)}.ds-interaction-fill--on-always-dark.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-always-dark.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-always-dark-interaction-hover);--ds-interaction-pressed:var(--color-always-dark-interaction-pressed);--ds-interaction-active:var(--color-always-dark-interaction-active-brand);--ds-focus-ring-color:var(--color-always-dark-interaction-focus)}.ds-interaction-fill--on-chrome.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-chrome.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-chrome-interaction-hover);--ds-interaction-pressed:var(--color-chrome-interaction-pressed);--ds-interaction-active:var(--color-chrome-interaction-active);--ds-focus-ring-color:var(--color-chrome-interaction-focus)}.ds-interaction-fill--on-navigation.sc-ds-mobile-section-switcher-h,.ds-interaction-fill--on-navigation.sc-ds-mobile-section-switcher{--ds-interaction-hover:var(--color-navigation-interaction-hover);--ds-interaction-pressed:var(--color-navigation-interaction-pressed);--ds-interaction-active:var(--color-navigation-interaction-active);--ds-focus-ring-color:var(--color-navigation-interaction-focus)}.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher-h:not(:disabled)::after,.ds-interaction-fill.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher:not(:disabled)::after{background:var(--ds-interaction-pressed)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-mobile-section-switcher-h::after,.ds-interaction-fill.sc-ds-mobile-section-switcher::after{box-shadow:none;outline:var(--ds-interaction-border-width) solid var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--ds-interaction-border-width))}.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher-h:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill--surface-open.sc-ds-mobile-section-switcher:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-control-boundary);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}.ds-interaction-fill--selected.sc-ds-mobile-section-switcher-h::before,.ds-interaction-fill--selected.sc-ds-mobile-section-switcher::before{background:transparent;outline:var(--dimension-stroke-width-025) solid var(--ds-forced-color-selected);outline-offset:calc(-1 * var(--dimension-stroke-width-025))}}@media (forced-colors: active) and (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-mobile-section-switcher-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-mobile-section-switcher:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after{outline-color:var(--ds-forced-color-selected);outline-width:var(--dimension-stroke-width-012)}}.sc-ds-mobile-section-switcher-h,.sc-ds-mobile-section-switcher:where(.ds-table),.sc-ds-mobile-section-switcher:where(.tooltip-popup),.sc-ds-mobile-section-switcher:where(.ds-radius){--ds-radius-control:var(--dimension-radius-025);--ds-radius-card:var(--dimension-radius-050);--ds-radius-modal:var(--dimension-radius-050);--ds-radius-menu:var(--dimension-radius-075);--ds-radius-tooltip-control:var(--dimension-radius-025);--ds-radius-tooltip-menu:var(--dimension-radius-075);--ds-radius-table:var(--dimension-radius-050)}.ds-control--lg.sc-ds-mobile-section-switcher,.ds-control--lg.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher,.ds-control--sm.sc-ds-mobile-section-switcher-h,.ds-control--sm.sc-ds-mobile-section-switcher,.ds-control--xs.sc-ds-mobile-section-switcher-h,.ds-control--xs.sc-ds-mobile-section-switcher{--ds-control-radius:var(--ds-radius-control)}.ds-control--lg.sc-ds-mobile-section-switcher-h,.ds-control--lg.sc-ds-mobile-section-switcher{--ds-control-height:var(--dimension-size-500);--ds-control-icon:var(--dimension-iconography-lg);--ds-control-padding-inline:var(--dimension-space-100);--ds-control-label-inset:var(--dimension-space-050);--ds-control-gap:var(--dimension-space-050)}.ds-control--md.sc-ds-mobile-section-switcher-h,.ds-control--md.sc-ds-mobile-section-switcher{--ds-control-height:var(--dimension-size-400);--ds-control-icon:var(--dimension-iconography-md);--ds-control-padding-inline:var(--dimension-space-075);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-050)}.ds-control--sm.sc-ds-mobile-section-switcher-h,.ds-control--sm.sc-ds-mobile-section-switcher{--ds-control-height:var(--dimension-size-300);--ds-control-icon:var(--dimension-iconography-sm);--ds-control-padding-inline:var(--dimension-space-050);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:var(--dimension-space-025)}.ds-control--xs.sc-ds-mobile-section-switcher-h,.ds-control--xs.sc-ds-mobile-section-switcher{--ds-control-height:var(--dimension-size-200);--ds-control-icon:var(--dimension-iconography-xs);--ds-control-padding-inline:var(--dimension-space-025);--ds-control-label-inset:var(--dimension-space-025);--ds-control-gap:0}.sc-ds-mobile-section-switcher-h{display:block;min-width:0;max-width:100%;color:var(--color-foreground-primary)}.mobile-section-switcher.sc-ds-mobile-section-switcher{appearance:none;display:grid;grid-template-columns:var(--dimension-size-100) minmax(0, auto) var(--dimension-size-100);align-items:center;justify-content:center;gap:var(--dimension-space-050);max-width:100%;min-height:var(--dimension-size-400);padding-inline:var(--dimension-space-100);border:0;border-radius:var(--dimension-radius-100);background:var(--color-background-secondary);color:inherit;box-sizing:border-box;cursor:default}.mobile-section-switcher__label.sc-ds-mobile-section-switcher{min-width:0;max-width:100%;text-align:center}.mobile-section-switcher__position.sc-ds-mobile-section-switcher{width:var(--dimension-size-050);height:var(--dimension-size-050);border-radius:var(--dimension-radius-half);background:currentColor;opacity:0}.mobile-section-switcher__position--visible.sc-ds-mobile-section-switcher{opacity:1}.mobile-section-switcher--sheet.sc-ds-mobile-section-switcher{grid-template-columns:minmax(0, auto);min-height:var(--dimension-size-400);padding-inline:var(--dimension-space-100);border-radius:var(--dimension-radius-half);background:transparent;--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-tertiary)}.mobile-section-switcher--combined.sc-ds-mobile-section-switcher{display:flex}.mobile-section-switcher__page-label.sc-ds-mobile-section-switcher{flex:0 1 auto;min-width:0}.mobile-section-switcher__separator.sc-ds-mobile-section-switcher{flex:0 0 auto}.mobile-section-switcher--combined.sc-ds-mobile-section-switcher .mobile-section-switcher__label.sc-ds-mobile-section-switcher{flex:0 0 auto;max-width:50%}.mobile-section-sheet.sc-ds-mobile-section-switcher{position:fixed;inset:0 0 auto;width:100%;max-width:none;max-height:calc(100dvh - var(--dimension-size-400) - var(--dimension-space-200));margin:0;padding:0;border:0;border-radius:0;box-sizing:border-box;overflow:visible;background:transparent;color:var(--color-foreground-secondary);outline:none}.mobile-section-sheet[open].sc-ds-mobile-section-switcher{display:flex;flex-direction:column}.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher{animation:mobileSectionSheetIn var(--effect-motion-short-2) both}.mobile-section-sheet.sc-ds-mobile-section-switcher::backdrop{background:var(--color-background-shade);animation:mobileSectionShadeIn var(--effect-motion-short-2) both}.mobile-section-sheet--closing[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher{animation-name:mobileSectionSheetOut}.mobile-section-sheet--closing.sc-ds-mobile-section-switcher::backdrop{animation-name:mobileSectionShadeOut}.mobile-section-sheet__items.sc-ds-mobile-section-switcher{display:flex;flex-direction:column;gap:var(--dimension-space-100);min-height:0;max-height:inherit;box-sizing:border-box;background:var(--color-background-primary);box-shadow:var(--effect-elevation-elevated-floating);padding:var(--dimension-space-100);padding-block-start:max(var(--dimension-space-100), env(safe-area-inset-top, 0px));overflow-y:auto;overscroll-behavior:contain}.mobile-section-sheet__item.sc-ds-mobile-section-switcher{appearance:none;flex:0 0 auto;display:flex;align-items:center;height:var(--ds-control-height);width:100%;min-width:0;padding:0 var(--ds-control-padding-inline);box-sizing:border-box;border:0;border-radius:var(--ds-control-radius);background:transparent;color:inherit;text-align:start}.mobile-section-sheet__item[aria-current='page'].sc-ds-mobile-section-switcher{color:var(--color-foreground-primary)}.mobile-section-sheet__item.sc-ds-mobile-section-switcher:disabled{color:var(--color-foreground-tertiary)}.mobile-section-sheet__label.sc-ds-mobile-section-switcher{min-width:0;padding-inline:var(--ds-control-label-inset)}.mobile-section-sheet__divider.sc-ds-mobile-section-switcher{flex:0 0 auto;height:var(--dimension-stroke-width-012);margin-inline:var(--dimension-space-100);background:var(--color-border-tertiary)}@keyframes mobileSectionSheetIn{from{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes mobileSectionSheetOut{from{transform:translateY(0)}to{transform:translateY(-100%)}}@keyframes mobileSectionShadeIn{from{opacity:0}to{opacity:1}}@keyframes mobileSectionShadeOut{from{opacity:1}to{opacity:0}}.mobile-section-switcher--pointer-focus.sc-ds-mobile-section-switcher-h .ds-focus-ring-inset.sc-ds-mobile-section-switcher::after{outline:none}.mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{position:fixed;inset:auto 0 0;height:max(var(--dimension-space-200), env(safe-area-inset-bottom, 0px));pointer-events:none;color:var(--color-background-primary);background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{animation:mobileSectionEdgeIn var(--effect-motion-short-2) both}.mobile-section-sheet--closing[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher{animation-name:mobileSectionEdgeOut}@keyframes mobileSectionEdgeIn{from{background-color:var(--color-background-primary)}to{background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}}@keyframes mobileSectionEdgeOut{from{background-color:var(--_mobile-section-edge-color, var(--color-background-primary))}to{background-color:var(--color-background-primary)}}@media (prefers-reduced-motion: reduce){.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__items.sc-ds-mobile-section-switcher,.mobile-section-sheet[open].sc-ds-mobile-section-switcher .mobile-section-sheet__browser-edge.sc-ds-mobile-section-switcher,.mobile-section-sheet.sc-ds-mobile-section-switcher::backdrop{animation:none}}`;let y=0;const C=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.dsChange=s(this,"dsChange",7);this.sections=[];this.value="";this.navigationLabel="Change page section";this.presentation="menu";this.pageLabel="";this.menuOpen=false;this.menuSurfaceOpen=false;this.initialFocusVisible=false;this.pointerFocus=false;this.sheetClosing=false;this.focusedSection="";this.instanceId=y++;this.triggerId=`ds-mobile-section-switcher-trigger-${this.instanceId}`;this.menuId=`ds-mobile-section-switcher-menu-${this.instanceId}`;this.triggerEl=null;this.dialogEl=null;this.browserEdgeEl=null;this.browserEdgeColors="";this.closeTimer=null;this.loaded=false;this.tasks=new a((()=>this.el.isConnected));this.handleDocumentKeyDown=i=>{if(["Shift","Control","Alt","Meta"].includes(i.key))return;this.pointerFocus=false};this.updateBrowserEdgeColor=()=>{if(!this.el.isConnected||!this.browserEdgeEl||!this.dialogEl)return;const i=getComputedStyle(this.browserEdgeEl).color;const e=getComputedStyle(this.dialogEl,"::backdrop").backgroundColor;const s=`${i}|${e}`;if(s===this.browserEdgeColors)return;const t=this.el.ownerDocument.createElement("canvas");t.width=t.height=1;const o=t.getContext("2d");if(!o)return;o.fillStyle=i;o.fillRect(0,0,1,1);o.fillStyle=e;o.fillRect(0,0,1,1);const[n,r,c]=o.getImageData(0,0,1,1).data;this.browserEdgeEl.style.setProperty("--_mobile-section-edge-color",`rgb(${n}, ${r}, ${c})`);this.browserEdgeColors=s};this.handleSheetKeyDown=i=>{if(i.key==="Escape"){i.preventDefault();i.stopPropagation();this.closeMenu();return}const e=this.selectableSections.filter((i=>!i.isInactive));if(!e.length)return;const s=Math.max(0,e.findIndex((i=>i.id===this.focusedSection)));let t;if(i.key==="ArrowDown")t=(s+1)%e.length;else if(i.key==="ArrowUp")t=(s+e.length-1)%e.length;else if(i.key==="Home")t=0;else if(i.key==="End")t=e.length-1;else if(i.key==="Tab")t=s;else if(i.key.length===1&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&i.key!==" "){const o=e.findIndex(((t,o)=>e[(s+o+1)%e.length].label.toLowerCase().startsWith(i.key.toLowerCase())));if(o<0)return;t=(s+o+1)%e.length}else return;i.preventDefault();this.initialFocusVisible=true;this.focusSheetItem(e[t].id)};this.toggleMenu=i=>{if(this.selectableSections.length<=1)return;this.initialFocusVisible=i.detail===0;if(this.presentation==="sheet"){if(this.menuOpen)this.closeMenu();else{this.focusedSection=this.selectedSection?.id??"";this.menuOpen=true}return}this.menuOpen=!this.menuOpen;if(this.menuOpen)this.menuSurfaceOpen=true};this.closeMenu=()=>{this.menuOpen=false;if(this.dialogEl?.open)this.sheetClosing=true};this.handleSelect=i=>{const e=String(i.detail.value??"");const s=this.selectableSections.find((i=>i.id===e));if(!s||s.isInactive)return;this.closeMenu();if(e!==this.selectedSection?.id)this.dsChange.emit(e);this.tasks.frame((()=>this.triggerEl?.focus()))}}componentDidLoad(){this.loaded=true;this.connectResources()}connectedCallback(){if(this.loaded)this.connectResources()}connectResources(){if(!this.el.isConnected||this.boundDocument)return;this.boundDocument=this.el.ownerDocument;this.boundDocument.addEventListener("keydown",this.handleDocumentKeyDown,true);this.visibilityObserver=new ResizeObserver(this.tasks.guard((()=>{if(this.dialogEl?.open&&!this.triggerEl?.getClientRects().length){this.finishSheetClose(false)}})));this.visibilityObserver.observe(this.el)}componentDidRender(){if(!this.el.isConnected||!this.dialogEl)return;if(this.presentation==="sheet"&&this.menuOpen&&!this.dialogEl.open){const i=this.focusedSection;this.updateBrowserEdgeColor();this.observeBrowserEdgeTheme();this.dialogEl.showModal();this.focusSheetItem(i)}if(this.sheetClosing&&this.dialogEl.open&&!this.closeTimer){const i=p(x.motionShort2,x.animationDurationShort3);if(!i)this.finishSheetClose();else this.closeTimer=setTimeout((()=>this.finishSheetClose()),i)}}disconnectedCallback(){this.tasks.cancel();this.boundDocument?.removeEventListener("keydown",this.handleDocumentKeyDown,true);this.boundDocument=undefined;this.visibilityObserver?.disconnect();this.visibilityObserver=undefined;this.pointerFocus=false;this.menuSurfaceOpen=false;this.finishSheetClose(false)}handlePresentationChange(){this.menuSurfaceOpen=false;this.closeMenu()}handleContextChange(){this.closeMenu()}finishSheetClose(i=true){if(this.closeTimer)clearTimeout(this.closeTimer);this.closeTimer=null;const e=this.dialogEl?.open;this.dialogEl?.close();this.themeObserver?.disconnect();this.menuOpen=false;this.sheetClosing=false;if(e&&i&&this.triggerEl?.getClientRects().length)this.triggerEl.focus()}observeBrowserEdgeTheme(){this.themeObserver??(this.themeObserver=new MutationObserver(this.updateBrowserEdgeColor));for(let i=this.el;i;i=i.parentElement){this.themeObserver.observe(i,{attributes:true,attributeFilter:["class","style","data-theme"]})}}focusSheetItem(i){const e=Array.from(this.dialogEl?.querySelectorAll("button")??[]);const s=e.find((e=>e.value===i&&!e.disabled))??e.find((i=>!i.disabled));if(s){this.focusedSection=s.value;s.focus()}else this.dialogEl?.focus()}get resolvedSections(){return this.sections??[]}get selectableSections(){return r(this.resolvedSections)}get selectedIndex(){return k(this.resolvedSections,this.value).selectedIndex}get selectedSection(){return this.selectableSections[this.selectedIndex]}get hasPrevious(){return k(this.resolvedSections,this.value).hasPrevious}get hasNext(){return k(this.resolvedSections,this.value).hasNext}get triggerAriaLabel(){return`${this.presentation==="sheet"&&this.pageLabel?`${this.pageLabel}. `:""}${this.navigationLabel}. Current section: ${this.selectedSection?.label??""}`}get menuSections(){const i=[];let e=[];const s=()=>{if(e.length)i.push({items:e});e=[]};for(const i of this.resolvedSections){if(c(i)){s();continue}e.push({label:i.label,value:i.id,dot:i.dot,isSelected:i.id===this.selectedSection?.id,isInactive:i.isInactive})}s();return i}handleSectionsChange(){if(this.selectableSections.length<=1){this.closeMenu();this.menuSurfaceOpen=false}else if(this.dialogEl?.open&&!this.sheetClosing){this.tasks.frame((()=>{if(this.dialogEl?.open&&!this.sheetClosing)this.focusSheetItem(this.focusedSection)}))}}renderSheet(){return t("dialog",{id:this.menuId,ref:i=>{this.dialogEl=i??null},class:{"mobile-section-sheet":true,"mobile-section-sheet--closing":this.sheetClosing},"aria-label":this.navigationLabel,tabIndex:-1,onCancel:i=>{i.preventDefault();this.closeMenu()},onKeyDown:this.handleSheetKeyDown,onClick:i=>{if(!this.dialogEl||i.target!==this.dialogEl)return;const e=this.dialogEl.getBoundingClientRect();if(i.clientY<e.top||i.clientY>e.bottom||i.clientX<e.left||i.clientX>e.right)this.closeMenu()}},t("div",{class:"mobile-section-sheet__items",role:"menu","aria-label":this.navigationLabel},this.resolvedSections.map((i=>c(i)?t("div",{class:"mobile-section-sheet__divider",role:"separator"}):t("button",{type:"button",role:"menuitem",value:i.id,disabled:i.isInactive,"aria-current":i.id===this.selectedSection?.id?"page":undefined,tabIndex:i.id===this.focusedSection?0:-1,class:{"mobile-section-sheet__item":true,"ds-control--md":true,"ds-interaction-fill":true,"ds-focus-ring-inset":true,"ds-focus-ring--visible":this.initialFocusVisible&&i.id===this.focusedSection},onFocus:()=>{this.focusedSection=i.id},onClick:()=>{if(this.sheetClosing||i.isInactive)return;this.closeMenu();if(i.id!==this.selectedSection?.id)this.dsChange.emit(i.id)}},t("ds-text",{class:"mobile-section-sheet__label ds-interaction-fill__content",as:"span",variant:"text-body-medium",color:"inherit",emphasis:i.id===this.selectedSection?.id,lineTruncation:1},i.label))))),t("div",{ref:i=>{if(this.browserEdgeEl!==i)this.browserEdgeColors="";this.browserEdgeEl=i??null},class:"mobile-section-sheet__browser-edge","aria-hidden":"true"}))}render(){const i=this.selectedSection;if(!i)return t(o,null);const e=this.presentation==="sheet"&&!!this.pageLabel;return t(o,{class:{"mobile-section-switcher--pointer-focus":this.pointerFocus},onPointerDown:()=>{this.pointerFocus=true;this.initialFocusVisible=false}},t("button",{ref:i=>{this.triggerEl=i??null},id:this.triggerId,class:{"mobile-section-switcher":true,"mobile-section-switcher--expanded":this.menuOpen,"ds-interaction-fill--surface-open":this.menuSurfaceOpen||this.menuOpen||this.sheetClosing,"mobile-section-switcher--sheet":this.presentation==="sheet","mobile-section-switcher--combined":e,"ds-focus-ring-inset":true,"ds-interaction-fill":true},type:"button","aria-haspopup":this.presentation==="sheet"?"dialog":"menu","aria-controls":this.menuId,"aria-expanded":String(this.menuOpen),"aria-label":this.triggerAriaLabel,onClick:this.toggleMenu},this.presentation==="menu"?t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasPrevious,"ds-interaction-fill__content":true},"aria-hidden":"true"}):null,e?[t("ds-text",{class:"mobile-section-switcher__page-label ds-interaction-fill__content",as:"span",variant:"text-body-medium",emphasis:true,color:"inherit",lineTruncation:1},this.pageLabel),t("ds-text",{class:"mobile-section-switcher__separator ds-interaction-fill__content",as:"span",variant:"text-body-medium",color:"inherit","aria-hidden":"true"},"·")]:null,t("ds-text",{class:"mobile-section-switcher__label ds-interaction-fill__content",as:"span",variant:"text-body-medium",emphasis:true,color:"inherit",lineTruncation:1},i.label),this.presentation==="menu"?t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasNext,"ds-interaction-fill__content":true},"aria-hidden":"true"}):null),this.presentation==="sheet"||this.sheetClosing?this.renderSheet():this.selectableSections.length>1?t("ds-menu",{id:this.menuId,anchorId:this.triggerId,align:"center",menuLabel:this.navigationLabel,open:this.menuOpen,initialFocusVisible:this.initialFocusVisible,sections:this.menuSections,onDsClose:this.closeMenu,onDsAfterClose:()=>{if(!this.menuOpen)this.menuSurfaceOpen=false},onDsSelect:this.handleSelect}):null)}get el(){return this}static get watchers(){return{presentation:[{handlePresentationChange:0}],value:[{handleContextChange:0}],pageLabel:[{handleContextChange:0}],sections:[{handleSectionsChange:0}]}}static get style(){return _()}},[2,"ds-mobile-section-switcher",{sections:[16],value:[1],navigationLabel:[1,"navigation-label"],presentation:[1],pageLabel:[1,"page-label"],menuOpen:[32],menuSurfaceOpen:[32],initialFocusVisible:[32],pointerFocus:[32],sheetClosing:[32],focusedSection:[32]},undefined,{presentation:[{handlePresentationChange:0}],value:[{handleContextChange:0}],pageLabel:[{handleContextChange:0}],sections:[{handleSectionsChange:0}]}]);function S(){if(typeof customElements==="undefined"){return}const i=["ds-mobile-section-switcher","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-menu","ds-swatch-picker","ds-switch","ds-tag","ds-text","ds-tooltip"];i.forEach((i=>{switch(i){case"ds-mobile-section-switcher":if(!customElements.get(n(i))){customElements.define(n(i),C)}break;case"ds-badge":if(!customElements.get(n(i))){d()}break;case"ds-button-unfilled":if(!customElements.get(n(i))){l()}break;case"ds-icon":if(!customElements.get(n(i))){h()}break;case"ds-loader":if(!customElements.get(n(i))){m()}break;case"ds-menu":if(!customElements.get(n(i))){b()}break;case"ds-swatch-picker":if(!customElements.get(n(i))){f()}break;case"ds-switch":if(!customElements.get(n(i))){u()}break;case"ds-tag":if(!customElements.get(n(i))){v()}break;case"ds-text":if(!customElements.get(n(i))){g()}break;case"ds-tooltip":if(!customElements.get(n(i))){w()}break}}))}S();export{C as M,S as d};
2
+ //# sourceMappingURL=p-Ba-dSshd.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["resolveMobileSectionPosition","sections","value","selectable","getSelectableTabs","matchedIndex","findIndex","section","id","selectedIndex","selected","hasPrevious","hasNext","length","mobileSectionSwitcherCss","nextMobileSectionSwitcherId","MobileSectionSwitcher","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","navigationLabel","presentation","pageLabel","menuOpen","menuSurfaceOpen","initialFocusVisible","pointerFocus","sheetClosing","focusedSection","instanceId","triggerId","menuId","triggerEl","dialogEl","browserEdgeEl","browserEdgeColors","closeTimer","loaded","tasks","ConnectionTasks","el","isConnected","handleDocumentKeyDown","event","includes","key","updateBrowserEdgeColor","base","getComputedStyle","color","shade","backgroundColor","colors","canvas","ownerDocument","createElement","width","height","context","getContext","fillStyle","fillRect","red","green","blue","getImageData","data","style","setProperty","handleSheetKeyDown","preventDefault","stopPropagation","closeMenu","selectableSections","filter","isInactive","index","Math","max","next","ctrlKey","metaKey","altKey","match","_","offset","label","toLowerCase","startsWith","focusSheetItem","toggleMenu","detail","selectedSection","open","handleSelect","String","find","candidate","dsChange","emit","frame","focus","componentDidLoad","connectResources","connectedCallback","boundDocument","addEventListener","visibilityObserver","ResizeObserver","guard","getClientRects","finishSheetClose","observe","componentDidRender","initialSection","observeBrowserEdgeTheme","showModal","duration","resolveMotionTimeMs","TOKEN_DEFAULTS","motionShort2","animationDurationShort3","setTimeout","disconnectedCallback","cancel","removeEventListener","undefined","disconnect","handlePresentationChange","handleContextChange","restoreFocus","clearTimeout","wasOpen","close","themeObserver","MutationObserver","ancestor","parentElement","attributes","attributeFilter","buttons","Array","from","querySelectorAll","button","item","disabled","resolvedSections","triggerAriaLabel","menuSections","groups","items","commit","push","isTabDivider","dot","isSelected","handleSectionsChange","renderSheet","h","ref","element","class","tabIndex","onCancel","onKeyDown","onClick","target","rect","getBoundingClientRect","clientY","top","bottom","clientX","left","right","role","map","type","onFocus","as","variant","emphasis","lineTruncation","render","Host","combined","onPointerDown","anchorId","align","menuLabel","onDsClose","onDsAfterClose","onDsSelect"],"sources":["src/wc/components/MobileSectionSwitcher/mobile-section-switcher-utils.ts","src/wc/components/MobileSectionSwitcher/MobileSectionSwitcher.css?tag=ds-mobile-section-switcher&encapsulation=scoped","src/wc/components/MobileSectionSwitcher/MobileSectionSwitcher.tsx"],"sourcesContent":["import { getSelectableTabs, type TabItem, type TabItemTab } from '../TabGroup/tab-item-utils';\n\nexport interface MobileSectionPosition {\n selectedIndex: number;\n selected?: TabItemTab;\n hasPrevious: boolean;\n hasNext: boolean;\n}\n\n/** Resolve ordered selectable neighbors while ignoring visual divider entries. */\nexport function resolveMobileSectionPosition(\n sections: TabItem[],\n value: string\n): MobileSectionPosition {\n const selectable = getSelectableTabs(sections);\n const matchedIndex = selectable.findIndex(section => section.id === value);\n const selectedIndex = matchedIndex >= 0 ? matchedIndex : 0;\n return {\n selectedIndex,\n selected: selectable[selectedIndex],\n hasPrevious: selectedIndex > 0,\n hasNext: selectedIndex < selectable.length - 1,\n };\n}\n","@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n@import '../../utils/radius.css';\n@import '../../utils/control-density.css';\n\n:host {\n display: block;\n min-width: 0;\n max-width: 100%;\n color: var(--color-foreground-primary);\n}\n\n.mobile-section-switcher {\n appearance: none;\n display: grid;\n grid-template-columns: var(--dimension-size-100) minmax(0, auto) var(--dimension-size-100);\n align-items: center;\n justify-content: center;\n gap: var(--dimension-space-050);\n max-width: 100%;\n min-height: var(--dimension-size-400);\n padding-inline: var(--dimension-space-100);\n border: 0;\n border-radius: var(--dimension-radius-100);\n background: var(--color-background-secondary);\n color: inherit;\n box-sizing: border-box;\n cursor: default;\n}\n\n.mobile-section-switcher__label {\n min-width: 0;\n max-width: 100%;\n text-align: center;\n}\n\n.mobile-section-switcher__position {\n width: var(--dimension-size-050);\n height: var(--dimension-size-050);\n border-radius: var(--dimension-radius-half);\n background: currentColor;\n opacity: 0;\n}\n\n.mobile-section-switcher__position--visible {\n opacity: 1;\n}\n\n.mobile-section-switcher--sheet {\n grid-template-columns: minmax(0, auto);\n min-height: var(--dimension-size-500);\n padding-inline: var(--dimension-space-150);\n border-radius: var(--dimension-radius-half);\n background: transparent;\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--color-border-tertiary);\n}\n\n.mobile-section-switcher--combined {\n display: flex;\n}\n\n.mobile-section-switcher__page-label {\n flex: 0 1 auto;\n min-width: 0;\n}\n\n.mobile-section-switcher__separator {\n flex: 0 0 auto;\n}\n\n.mobile-section-switcher--combined .mobile-section-switcher__label {\n flex: 0 0 auto;\n max-width: 50%;\n}\n\n.mobile-section-sheet {\n position: fixed;\n inset: 0 0 auto;\n width: 100%;\n max-width: none;\n max-height: calc(100dvh - var(--dimension-size-500) - var(--dimension-space-200));\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 0;\n box-sizing: border-box;\n overflow: visible;\n background: transparent;\n color: var(--color-foreground-secondary);\n outline: none;\n}\n\n.mobile-section-sheet[open] {\n display: flex;\n flex-direction: column;\n}\n\n.mobile-section-sheet[open] .mobile-section-sheet__items {\n animation: mobileSectionSheetIn var(--effect-motion-short-2) both;\n}\n\n.mobile-section-sheet::backdrop {\n background: var(--color-background-shade);\n animation: mobileSectionShadeIn var(--effect-motion-short-2) both;\n}\n\n.mobile-section-sheet--closing[open] .mobile-section-sheet__items {\n animation-name: mobileSectionSheetOut;\n}\n\n.mobile-section-sheet--closing::backdrop {\n animation-name: mobileSectionShadeOut;\n}\n\n.mobile-section-sheet__items {\n display: flex;\n flex-direction: column;\n gap: var(--dimension-space-100);\n min-height: 0;\n max-height: inherit;\n box-sizing: border-box;\n background: var(--color-background-primary);\n box-shadow: var(--effect-elevation-elevated-floating);\n padding: var(--dimension-space-100);\n padding-block-start: max(var(--dimension-space-100), env(safe-area-inset-top, 0px));\n overflow-y: auto;\n overscroll-behavior: contain;\n}\n\n.mobile-section-sheet__item {\n appearance: none;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n height: var(--ds-control-height);\n width: 100%;\n min-width: 0;\n padding: 0 var(--ds-control-padding-inline);\n box-sizing: border-box;\n border: 0;\n border-radius: var(--ds-control-radius);\n background: transparent;\n color: inherit;\n text-align: start;\n}\n\n.mobile-section-sheet__item[aria-current='page'] {\n color: var(--color-foreground-primary);\n}\n\n.mobile-section-sheet__item:disabled {\n color: var(--color-foreground-tertiary);\n}\n\n.mobile-section-sheet__label {\n min-width: 0;\n padding-inline: var(--ds-control-label-inset);\n}\n\n.mobile-section-sheet__divider {\n flex: 0 0 auto;\n height: var(--dimension-stroke-width-012);\n margin-inline: var(--dimension-space-100);\n background: var(--color-border-tertiary);\n}\n\n@keyframes mobileSectionSheetIn {\n from {\n transform: translateY(-100%);\n }\n to {\n transform: translateY(0);\n }\n}\n\n@keyframes mobileSectionSheetOut {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-100%);\n }\n}\n\n@keyframes mobileSectionShadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes mobileSectionShadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n/* Safari can preserve :focus-visible across modal entry and focus return after\n * a tap. Track the actual input, while leaving focus and keyboard access intact. */\n:host(.mobile-section-switcher--pointer-focus) .ds-focus-ring-inset::after {\n outline: none;\n}\n\n/* Keep this opaque strip in the modal top layer, outside the moving sheet.\n * Safari samples fixed edge backgrounds to tint its browser controls. */\n.mobile-section-sheet__browser-edge {\n position: fixed;\n inset: auto 0 0;\n height: max(var(--dimension-space-200), env(safe-area-inset-bottom, 0px));\n pointer-events: none;\n color: var(--color-background-primary);\n background-color: var(--_mobile-section-edge-color, var(--color-background-primary));\n}\n\n.mobile-section-sheet[open] .mobile-section-sheet__browser-edge {\n animation: mobileSectionEdgeIn var(--effect-motion-short-2) both;\n}\n\n.mobile-section-sheet--closing[open] .mobile-section-sheet__browser-edge {\n animation-name: mobileSectionEdgeOut;\n}\n\n/* Animate the opaque color, not opacity: the backdrop is already fading below. */\n@keyframes mobileSectionEdgeIn {\n from {\n background-color: var(--color-background-primary);\n }\n to {\n background-color: var(--_mobile-section-edge-color, var(--color-background-primary));\n }\n}\n\n@keyframes mobileSectionEdgeOut {\n from {\n background-color: var(--_mobile-section-edge-color, var(--color-background-primary));\n }\n to {\n background-color: var(--color-background-primary);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .mobile-section-sheet[open] .mobile-section-sheet__items,\n .mobile-section-sheet[open] .mobile-section-sheet__browser-edge,\n .mobile-section-sheet::backdrop {\n animation: none;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type { MenuItemData, MenuSection } from '../Menu/menu-types';\nimport {\n getSelectableTabs,\n isTabDivider,\n type TabItem,\n type TabItemTab,\n} from '../TabGroup/tab-item-utils';\nimport { resolveMobileSectionPosition } from './mobile-section-switcher-utils';\nimport { resolveMotionTimeMs, TOKEN_DEFAULTS } from '../../utils';\nimport { ConnectionTasks } from '../../utils/connection-tasks';\n\nlet nextMobileSectionSwitcherId = 0;\n\n@Component({\n tag: 'ds-mobile-section-switcher',\n styleUrl: 'MobileSectionSwitcher.css',\n scoped: true,\n})\nexport class MobileSectionSwitcher {\n @Element() el!: HTMLElement;\n\n /** Ordered controlled sections. Divider entries group the popup menu. */\n @Prop() sections: TabItem[] = [];\n /** Controlled selected section id. */\n @Prop() value: string = '';\n /** Accessible name for the section chooser. */\n @Prop() navigationLabel: string = 'Change page section';\n /** Anchored local-view menu or viewport-edge sheet for primary page sections. */\n @Prop() presentation: 'menu' | 'sheet' = 'menu';\n /** Stable page identity shown before the selected section in a sheet trigger. */\n @Prop() pageLabel: string = '';\n\n /** Selection intent. The route, tool, or workflow owner updates `value`. */\n @Event() dsChange!: EventEmitter<string>;\n\n @State() private menuOpen = false;\n @State() private menuSurfaceOpen = false;\n @State() private initialFocusVisible = false;\n @State() private pointerFocus = false;\n @State() private sheetClosing = false;\n @State() private focusedSection = '';\n\n private readonly instanceId = nextMobileSectionSwitcherId++;\n private readonly triggerId = `ds-mobile-section-switcher-trigger-${this.instanceId}`;\n private readonly menuId = `ds-mobile-section-switcher-menu-${this.instanceId}`;\n private triggerEl: HTMLButtonElement | null = null;\n private dialogEl: HTMLDialogElement | null = null;\n private browserEdgeEl: HTMLDivElement | null = null;\n private browserEdgeColors = '';\n private themeObserver?: MutationObserver;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private visibilityObserver?: ResizeObserver;\n private loaded = false;\n private boundDocument?: Document;\n private readonly tasks = new ConnectionTasks(() => this.el.isConnected);\n\n private readonly handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (['Shift', 'Control', 'Alt', 'Meta'].includes(event.key)) return;\n this.pointerFocus = false;\n };\n\n componentDidLoad() {\n this.loaded = true;\n this.connectResources();\n }\n\n connectedCallback() {\n if (this.loaded) this.connectResources();\n }\n\n private connectResources() {\n if (!this.el.isConnected || this.boundDocument) return;\n this.boundDocument = this.el.ownerDocument;\n this.boundDocument.addEventListener('keydown', this.handleDocumentKeyDown, true);\n this.visibilityObserver = new ResizeObserver(\n this.tasks.guard(() => {\n if (this.dialogEl?.open && !this.triggerEl?.getClientRects().length) {\n this.finishSheetClose(false);\n }\n })\n );\n this.visibilityObserver.observe(this.el);\n }\n\n componentDidRender() {\n if (!this.el.isConnected || !this.dialogEl) return;\n if (this.presentation === 'sheet' && this.menuOpen && !this.dialogEl.open) {\n const initialSection = this.focusedSection;\n this.updateBrowserEdgeColor();\n this.observeBrowserEdgeTheme();\n this.dialogEl.showModal();\n this.focusSheetItem(initialSection);\n }\n if (this.sheetClosing && this.dialogEl.open && !this.closeTimer) {\n const duration = resolveMotionTimeMs(\n TOKEN_DEFAULTS.motionShort2,\n TOKEN_DEFAULTS.animationDurationShort3\n );\n if (!duration) this.finishSheetClose();\n else this.closeTimer = setTimeout(() => this.finishSheetClose(), duration);\n }\n }\n\n disconnectedCallback() {\n this.tasks.cancel();\n this.boundDocument?.removeEventListener('keydown', this.handleDocumentKeyDown, true);\n this.boundDocument = undefined;\n this.visibilityObserver?.disconnect();\n this.visibilityObserver = undefined;\n this.pointerFocus = false;\n this.menuSurfaceOpen = false;\n this.finishSheetClose(false);\n }\n\n @Watch('presentation')\n handlePresentationChange() {\n this.menuSurfaceOpen = false;\n this.closeMenu();\n }\n\n @Watch('value')\n @Watch('pageLabel')\n handleContextChange() {\n this.closeMenu();\n }\n\n private finishSheetClose(restoreFocus = true) {\n if (this.closeTimer) clearTimeout(this.closeTimer);\n this.closeTimer = null;\n const wasOpen = this.dialogEl?.open;\n this.dialogEl?.close();\n this.themeObserver?.disconnect();\n this.menuOpen = false;\n this.sheetClosing = false;\n if (wasOpen && restoreFocus && this.triggerEl?.getClientRects().length) this.triggerEl.focus();\n }\n\n private updateBrowserEdgeColor = () => {\n if (!this.el.isConnected || !this.browserEdgeEl || !this.dialogEl) return;\n const base = getComputedStyle(this.browserEdgeEl).color;\n const shade = getComputedStyle(this.dialogEl, '::backdrop').backgroundColor;\n const colors = `${base}|${shade}`;\n if (colors === this.browserEdgeColors) return;\n // Let the browser resolve token colors, including alpha and non-sRGB syntax,\n // then flatten the shade over the bar into the opaque color Safari samples.\n const canvas = this.el.ownerDocument.createElement('canvas');\n canvas.width = canvas.height = 1;\n const context = canvas.getContext('2d');\n if (!context) return;\n context.fillStyle = base;\n context.fillRect(0, 0, 1, 1);\n context.fillStyle = shade;\n context.fillRect(0, 0, 1, 1);\n const [red, green, blue] = context.getImageData(0, 0, 1, 1).data;\n this.browserEdgeEl.style.setProperty(\n '--_mobile-section-edge-color',\n `rgb(${red}, ${green}, ${blue})`\n );\n this.browserEdgeColors = colors;\n };\n\n private observeBrowserEdgeTheme() {\n this.themeObserver ??= new MutationObserver(this.updateBrowserEdgeColor);\n // Token themes are inherited from the page or a containing theme scope.\n for (let ancestor: HTMLElement | null = this.el; ancestor; ancestor = ancestor.parentElement) {\n this.themeObserver.observe(ancestor, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-theme'],\n });\n }\n }\n\n private focusSheetItem(id: string) {\n const buttons = Array.from(this.dialogEl?.querySelectorAll<HTMLButtonElement>('button') ?? []);\n const button =\n buttons.find(item => item.value === id && !item.disabled) ??\n buttons.find(item => !item.disabled);\n if (button) {\n this.focusedSection = button.value;\n button.focus();\n } else this.dialogEl?.focus();\n }\n\n private handleSheetKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n this.closeMenu();\n return;\n }\n const sections = this.selectableSections.filter(section => !section.isInactive);\n if (!sections.length) return;\n const index = Math.max(\n 0,\n sections.findIndex(section => section.id === this.focusedSection)\n );\n let next: number;\n if (event.key === 'ArrowDown') next = (index + 1) % sections.length;\n else if (event.key === 'ArrowUp') next = (index + sections.length - 1) % sections.length;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = sections.length - 1;\n else if (event.key === 'Tab') next = index;\n else if (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey &&\n event.key !== ' '\n ) {\n const match = sections.findIndex((_, offset) =>\n sections[(index + offset + 1) % sections.length].label\n .toLowerCase()\n .startsWith(event.key.toLowerCase())\n );\n if (match < 0) return;\n next = (index + match + 1) % sections.length;\n } else return;\n event.preventDefault();\n this.initialFocusVisible = true;\n this.focusSheetItem(sections[next].id);\n };\n\n private get resolvedSections(): TabItem[] {\n return this.sections ?? [];\n }\n\n private get selectableSections(): TabItemTab[] {\n return getSelectableTabs(this.resolvedSections);\n }\n\n private get selectedIndex(): number {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).selectedIndex;\n }\n\n private get selectedSection(): TabItemTab | undefined {\n return this.selectableSections[this.selectedIndex];\n }\n\n private get hasPrevious(): boolean {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).hasPrevious;\n }\n\n private get hasNext(): boolean {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).hasNext;\n }\n\n private get triggerAriaLabel(): string {\n return `${this.presentation === 'sheet' && this.pageLabel ? `${this.pageLabel}. ` : ''}${this.navigationLabel}. Current section: ${this.selectedSection?.label ?? ''}`;\n }\n\n private get menuSections(): MenuSection[] {\n const groups: MenuSection[] = [];\n let items: MenuItemData[] = [];\n const commit = () => {\n if (items.length) groups.push({ items });\n items = [];\n };\n\n for (const section of this.resolvedSections) {\n if (isTabDivider(section)) {\n commit();\n continue;\n }\n items.push({\n label: section.label,\n value: section.id,\n dot: section.dot,\n isSelected: section.id === this.selectedSection?.id,\n isInactive: section.isInactive,\n });\n }\n commit();\n return groups;\n }\n\n @Watch('sections')\n handleSectionsChange() {\n if (this.selectableSections.length <= 1) {\n this.closeMenu();\n this.menuSurfaceOpen = false;\n } else if (this.dialogEl?.open && !this.sheetClosing) {\n this.tasks.frame(() => {\n if (this.dialogEl?.open && !this.sheetClosing) this.focusSheetItem(this.focusedSection);\n });\n }\n }\n\n private toggleMenu = (event: MouseEvent) => {\n if (this.selectableSections.length <= 1) return;\n this.initialFocusVisible = event.detail === 0;\n if (this.presentation === 'sheet') {\n if (this.menuOpen) this.closeMenu();\n else {\n this.focusedSection = this.selectedSection?.id ?? '';\n this.menuOpen = true;\n }\n return;\n }\n this.menuOpen = !this.menuOpen;\n if (this.menuOpen) this.menuSurfaceOpen = true;\n };\n\n private closeMenu = () => {\n this.menuOpen = false;\n if (this.dialogEl?.open) this.sheetClosing = true;\n };\n\n private renderSheet() {\n return (\n <dialog\n id={this.menuId}\n ref={element => {\n this.dialogEl = element ?? null;\n }}\n class={{ 'mobile-section-sheet': true, 'mobile-section-sheet--closing': this.sheetClosing }}\n aria-label={this.navigationLabel}\n tabIndex={-1}\n onCancel={event => {\n event.preventDefault();\n this.closeMenu();\n }}\n onKeyDown={this.handleSheetKeyDown}\n onClick={event => {\n if (!this.dialogEl || event.target !== this.dialogEl) return;\n const rect = this.dialogEl.getBoundingClientRect();\n if (\n event.clientY < rect.top ||\n event.clientY > rect.bottom ||\n event.clientX < rect.left ||\n event.clientX > rect.right\n )\n this.closeMenu();\n }}\n >\n <div class=\"mobile-section-sheet__items\" role=\"menu\" aria-label={this.navigationLabel}>\n {this.resolvedSections.map(section =>\n isTabDivider(section) ? (\n <div class=\"mobile-section-sheet__divider\" role=\"separator\" />\n ) : (\n <button\n type=\"button\"\n role=\"menuitem\"\n value={section.id}\n disabled={section.isInactive}\n aria-current={section.id === this.selectedSection?.id ? 'page' : undefined}\n tabIndex={section.id === this.focusedSection ? 0 : -1}\n class={{\n 'mobile-section-sheet__item': true,\n 'ds-control--lg': true,\n 'ds-interaction-fill': true,\n 'ds-focus-ring-inset': true,\n 'ds-focus-ring--visible':\n this.initialFocusVisible && section.id === this.focusedSection,\n }}\n onFocus={() => {\n this.focusedSection = section.id;\n }}\n onClick={() => {\n if (this.sheetClosing || section.isInactive) return;\n this.closeMenu();\n if (section.id !== this.selectedSection?.id) this.dsChange.emit(section.id);\n }}\n >\n <ds-text\n class=\"mobile-section-sheet__label ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-large\"\n color=\"inherit\"\n emphasis={section.id === this.selectedSection?.id}\n lineTruncation={1}\n >\n {section.label}\n </ds-text>\n </button>\n )\n )}\n </div>\n <div\n ref={element => {\n if (this.browserEdgeEl !== element) this.browserEdgeColors = '';\n this.browserEdgeEl = element ?? null;\n }}\n class=\"mobile-section-sheet__browser-edge\"\n aria-hidden=\"true\"\n />\n </dialog>\n );\n }\n\n private handleSelect = (event: CustomEvent<MenuItemData>) => {\n const id = String(event.detail.value ?? '');\n const section = this.selectableSections.find(candidate => candidate.id === id);\n if (!section || section.isInactive) return;\n this.closeMenu();\n if (id !== this.selectedSection?.id) this.dsChange.emit(id);\n this.tasks.frame(() => this.triggerEl?.focus());\n };\n\n render() {\n const selected = this.selectedSection;\n if (!selected) return <Host />;\n const combined = this.presentation === 'sheet' && !!this.pageLabel;\n\n return (\n <Host\n class={{ 'mobile-section-switcher--pointer-focus': this.pointerFocus }}\n onPointerDown={() => {\n this.pointerFocus = true;\n this.initialFocusVisible = false;\n }}\n >\n <button\n ref={element => {\n this.triggerEl = element ?? null;\n }}\n id={this.triggerId}\n class={{\n 'mobile-section-switcher': true,\n 'mobile-section-switcher--expanded': this.menuOpen,\n 'ds-interaction-fill--surface-open':\n this.menuSurfaceOpen || this.menuOpen || this.sheetClosing,\n 'mobile-section-switcher--sheet': this.presentation === 'sheet',\n 'mobile-section-switcher--combined': combined,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n type=\"button\"\n aria-haspopup={this.presentation === 'sheet' ? 'dialog' : 'menu'}\n aria-controls={this.menuId}\n aria-expanded={String(this.menuOpen)}\n aria-label={this.triggerAriaLabel}\n onClick={this.toggleMenu}\n >\n {this.presentation === 'menu' ? (\n <span\n class={{\n 'mobile-section-switcher__position': true,\n 'mobile-section-switcher__position--visible': this.hasPrevious,\n 'ds-interaction-fill__content': true,\n }}\n aria-hidden=\"true\"\n />\n ) : null}\n {combined\n ? [\n <ds-text\n class=\"mobile-section-switcher__page-label ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-large\"\n emphasis\n color=\"inherit\"\n lineTruncation={1}\n >\n {this.pageLabel}\n </ds-text>,\n <ds-text\n class=\"mobile-section-switcher__separator ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-large\"\n color=\"inherit\"\n aria-hidden=\"true\"\n >\n ·\n </ds-text>,\n ]\n : null}\n <ds-text\n class=\"mobile-section-switcher__label ds-interaction-fill__content\"\n as=\"span\"\n variant={this.presentation === 'sheet' ? 'text-body-large' : 'text-body-medium'}\n emphasis\n color=\"inherit\"\n lineTruncation={1}\n >\n {selected.label}\n </ds-text>\n {this.presentation === 'menu' ? (\n <span\n class={{\n 'mobile-section-switcher__position': true,\n 'mobile-section-switcher__position--visible': this.hasNext,\n 'ds-interaction-fill__content': true,\n }}\n aria-hidden=\"true\"\n />\n ) : null}\n </button>\n\n {this.presentation === 'sheet' || this.sheetClosing ? (\n this.renderSheet()\n ) : this.selectableSections.length > 1 ? (\n <ds-menu\n id={this.menuId}\n anchorId={this.triggerId}\n align=\"center\"\n menuLabel={this.navigationLabel}\n open={this.menuOpen}\n initialFocusVisible={this.initialFocusVisible}\n sections={this.menuSections}\n onDsClose={this.closeMenu}\n onDsAfterClose={() => {\n if (!this.menuOpen) this.menuSurfaceOpen = false;\n }}\n onDsSelect={this.handleSelect}\n />\n ) : null}\n </Host>\n );\n }\n}\n"],"mappings":"+hBAUM,SAAUA,EACdC,EACAC,GAEA,MAAMC,EAAaC,EAAkBH,GACrC,MAAMI,EAAeF,EAAWG,WAAUC,GAAWA,EAAQC,KAAON,IACpE,MAAMO,EAAgBJ,GAAgB,EAAIA,EAAe,EACzD,MAAO,CACLI,gBACAC,SAAUP,EAAWM,GACrBE,YAAaF,EAAgB,EAC7BG,QAASH,EAAgBN,EAAWU,OAAS,EAEjD,CCvBA,MAAMC,EAA2B,IAAM,ispBCsBvC,IAAIC,EAA8B,E,MAOrBC,EAAqBC,EAAA,MAAAD,UAAAE,EALlC,WAAAC,CAAAC,G,+EASUC,KAAApB,SAAsB,GAEtBoB,KAAAnB,MAAgB,GAEhBmB,KAAAC,gBAA0B,sBAE1BD,KAAAE,aAAiC,OAEjCF,KAAAG,UAAoB,GAKXH,KAAAI,SAAW,MACXJ,KAAAK,gBAAkB,MAClBL,KAAAM,oBAAsB,MACtBN,KAAAO,aAAe,MACfP,KAAAQ,aAAe,MACfR,KAAAS,eAAiB,GAEjBT,KAAAU,WAAahB,IACbM,KAAAW,UAAY,sCAAsCX,KAAKU,aACvDV,KAAAY,OAAS,mCAAmCZ,KAAKU,aAC1DV,KAAAa,UAAsC,KACtCb,KAAAc,SAAqC,KACrCd,KAAAe,cAAuC,KACvCf,KAAAgB,kBAAoB,GAEpBhB,KAAAiB,WAAmD,KAEnDjB,KAAAkB,OAAS,MAEA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EG,MAAM,kEACNkB,GAAG,OACHC,QAAQ,kBACRpI,MAAM,UAAS,cACH,QAAM,MAKtB,KACJ8G,EAAA,WACEG,MAAM,8DACNkB,GAAG,OACHC,QAASlK,KAAKE,eAAiB,QAAU,kBAAoB,mBAC7DiK,SAAQ,KACRrI,MAAM,UACNsI,eAAgB,GAEf/K,EAAS8E,OAEXnE,KAAKE,eAAiB,OACrB0I,EAAA,QACEG,MAAO,CACL,oCAAqC,KACrC,6CAA8C/I,KAAKT,QACnD,+BAAgC,MACjC,cACW,SAEZ,MAGLS,KAAKE,eAAiB,SAAWF,KAAKQ,aACrCR,KAAK2I,cACH3I,KAAKsD,mBAAmB9D,OAAS,EACnCoJ,EAAA,WACEzJ,GAAIa,KAAKY,OACT6J,SAAUzK,KAAKW,UACf+J,MAAM,SACNC,UAAW3K,KAAKC,gBAChByE,KAAM1E,KAAKI,SACXE,oBAAqBN,KAAKM,oBAC1B1B,SAAUoB,KAAKkI,aACf0C,UAAW5K,KAAKqD,UAChBwH,eAAgB,KACd,IAAK7K,KAAKI,SAAUJ,KAAKK,gBAAkB,KAAK,EAElDyK,WAAY9K,KAAK2E,eAEjB,K","ignoreList":[]}
1
+ {"version":3,"names":["resolveMobileSectionPosition","sections","value","selectable","getSelectableTabs","matchedIndex","findIndex","section","id","selectedIndex","selected","hasPrevious","hasNext","length","mobileSectionSwitcherCss","nextMobileSectionSwitcherId","MobileSectionSwitcher","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","navigationLabel","presentation","pageLabel","menuOpen","menuSurfaceOpen","initialFocusVisible","pointerFocus","sheetClosing","focusedSection","instanceId","triggerId","menuId","triggerEl","dialogEl","browserEdgeEl","browserEdgeColors","closeTimer","loaded","tasks","ConnectionTasks","el","isConnected","handleDocumentKeyDown","event","includes","key","updateBrowserEdgeColor","base","getComputedStyle","color","shade","backgroundColor","colors","canvas","ownerDocument","createElement","width","height","context","getContext","fillStyle","fillRect","red","green","blue","getImageData","data","style","setProperty","handleSheetKeyDown","preventDefault","stopPropagation","closeMenu","selectableSections","filter","isInactive","index","Math","max","next","ctrlKey","metaKey","altKey","match","_","offset","label","toLowerCase","startsWith","focusSheetItem","toggleMenu","detail","selectedSection","open","handleSelect","String","find","candidate","dsChange","emit","frame","focus","componentDidLoad","connectResources","connectedCallback","boundDocument","addEventListener","visibilityObserver","ResizeObserver","guard","getClientRects","finishSheetClose","observe","componentDidRender","initialSection","observeBrowserEdgeTheme","showModal","duration","resolveMotionTimeMs","TOKEN_DEFAULTS","motionShort2","animationDurationShort3","setTimeout","disconnectedCallback","cancel","removeEventListener","undefined","disconnect","handlePresentationChange","handleContextChange","restoreFocus","clearTimeout","wasOpen","close","themeObserver","MutationObserver","ancestor","parentElement","attributes","attributeFilter","buttons","Array","from","querySelectorAll","button","item","disabled","resolvedSections","triggerAriaLabel","menuSections","groups","items","commit","push","isTabDivider","dot","isSelected","handleSectionsChange","renderSheet","h","ref","element","class","tabIndex","onCancel","onKeyDown","onClick","target","rect","getBoundingClientRect","clientY","top","bottom","clientX","left","right","role","map","type","onFocus","as","variant","emphasis","lineTruncation","render","Host","combined","onPointerDown","anchorId","align","menuLabel","onDsClose","onDsAfterClose","onDsSelect"],"sources":["src/wc/components/MobileSectionSwitcher/mobile-section-switcher-utils.ts","src/wc/components/MobileSectionSwitcher/MobileSectionSwitcher.css?tag=ds-mobile-section-switcher&encapsulation=scoped","src/wc/components/MobileSectionSwitcher/MobileSectionSwitcher.tsx"],"sourcesContent":["import { getSelectableTabs, type TabItem, type TabItemTab } from '../TabGroup/tab-item-utils';\n\nexport interface MobileSectionPosition {\n selectedIndex: number;\n selected?: TabItemTab;\n hasPrevious: boolean;\n hasNext: boolean;\n}\n\n/** Resolve ordered selectable neighbors while ignoring visual divider entries. */\nexport function resolveMobileSectionPosition(\n sections: TabItem[],\n value: string\n): MobileSectionPosition {\n const selectable = getSelectableTabs(sections);\n const matchedIndex = selectable.findIndex(section => section.id === value);\n const selectedIndex = matchedIndex >= 0 ? matchedIndex : 0;\n return {\n selectedIndex,\n selected: selectable[selectedIndex],\n hasPrevious: selectedIndex > 0,\n hasNext: selectedIndex < selectable.length - 1,\n };\n}\n","@import '../../utils/focus-ring.css';\n@import '../../utils/interaction-fill.css';\n@import '../../utils/radius.css';\n@import '../../utils/control-density.css';\n\n:host {\n display: block;\n min-width: 0;\n max-width: 100%;\n color: var(--color-foreground-primary);\n}\n\n.mobile-section-switcher {\n appearance: none;\n display: grid;\n grid-template-columns: var(--dimension-size-100) minmax(0, auto) var(--dimension-size-100);\n align-items: center;\n justify-content: center;\n gap: var(--dimension-space-050);\n max-width: 100%;\n min-height: var(--dimension-size-400);\n padding-inline: var(--dimension-space-100);\n border: 0;\n border-radius: var(--dimension-radius-100);\n background: var(--color-background-secondary);\n color: inherit;\n box-sizing: border-box;\n cursor: default;\n}\n\n.mobile-section-switcher__label {\n min-width: 0;\n max-width: 100%;\n text-align: center;\n}\n\n.mobile-section-switcher__position {\n width: var(--dimension-size-050);\n height: var(--dimension-size-050);\n border-radius: var(--dimension-radius-half);\n background: currentColor;\n opacity: 0;\n}\n\n.mobile-section-switcher__position--visible {\n opacity: 1;\n}\n\n.mobile-section-switcher--sheet {\n grid-template-columns: minmax(0, auto);\n min-height: var(--dimension-size-400);\n padding-inline: var(--dimension-space-100);\n border-radius: var(--dimension-radius-half);\n background: transparent;\n --ds-interaction-border-width: var(--dimension-stroke-width-012);\n --ds-interaction-border-color: var(--color-border-tertiary);\n}\n\n.mobile-section-switcher--combined {\n display: flex;\n}\n\n.mobile-section-switcher__page-label {\n flex: 0 1 auto;\n min-width: 0;\n}\n\n.mobile-section-switcher__separator {\n flex: 0 0 auto;\n}\n\n.mobile-section-switcher--combined .mobile-section-switcher__label {\n flex: 0 0 auto;\n max-width: 50%;\n}\n\n.mobile-section-sheet {\n position: fixed;\n inset: 0 0 auto;\n width: 100%;\n max-width: none;\n max-height: calc(100dvh - var(--dimension-size-400) - var(--dimension-space-200));\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: 0;\n box-sizing: border-box;\n overflow: visible;\n background: transparent;\n color: var(--color-foreground-secondary);\n outline: none;\n}\n\n.mobile-section-sheet[open] {\n display: flex;\n flex-direction: column;\n}\n\n.mobile-section-sheet[open] .mobile-section-sheet__items {\n animation: mobileSectionSheetIn var(--effect-motion-short-2) both;\n}\n\n.mobile-section-sheet::backdrop {\n background: var(--color-background-shade);\n animation: mobileSectionShadeIn var(--effect-motion-short-2) both;\n}\n\n.mobile-section-sheet--closing[open] .mobile-section-sheet__items {\n animation-name: mobileSectionSheetOut;\n}\n\n.mobile-section-sheet--closing::backdrop {\n animation-name: mobileSectionShadeOut;\n}\n\n.mobile-section-sheet__items {\n display: flex;\n flex-direction: column;\n gap: var(--dimension-space-100);\n min-height: 0;\n max-height: inherit;\n box-sizing: border-box;\n background: var(--color-background-primary);\n box-shadow: var(--effect-elevation-elevated-floating);\n padding: var(--dimension-space-100);\n padding-block-start: max(var(--dimension-space-100), env(safe-area-inset-top, 0px));\n overflow-y: auto;\n overscroll-behavior: contain;\n}\n\n.mobile-section-sheet__item {\n appearance: none;\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n height: var(--ds-control-height);\n width: 100%;\n min-width: 0;\n padding: 0 var(--ds-control-padding-inline);\n box-sizing: border-box;\n border: 0;\n border-radius: var(--ds-control-radius);\n background: transparent;\n color: inherit;\n text-align: start;\n}\n\n.mobile-section-sheet__item[aria-current='page'] {\n color: var(--color-foreground-primary);\n}\n\n.mobile-section-sheet__item:disabled {\n color: var(--color-foreground-tertiary);\n}\n\n.mobile-section-sheet__label {\n min-width: 0;\n padding-inline: var(--ds-control-label-inset);\n}\n\n.mobile-section-sheet__divider {\n flex: 0 0 auto;\n height: var(--dimension-stroke-width-012);\n margin-inline: var(--dimension-space-100);\n background: var(--color-border-tertiary);\n}\n\n@keyframes mobileSectionSheetIn {\n from {\n transform: translateY(-100%);\n }\n to {\n transform: translateY(0);\n }\n}\n\n@keyframes mobileSectionSheetOut {\n from {\n transform: translateY(0);\n }\n to {\n transform: translateY(-100%);\n }\n}\n\n@keyframes mobileSectionShadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n@keyframes mobileSectionShadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n/* Safari can preserve :focus-visible across modal entry and focus return after\n * a tap. Track the actual input, while leaving focus and keyboard access intact. */\n:host(.mobile-section-switcher--pointer-focus) .ds-focus-ring-inset::after {\n outline: none;\n}\n\n/* Keep this opaque strip in the modal top layer, outside the moving sheet.\n * Safari samples fixed edge backgrounds to tint its browser controls. */\n.mobile-section-sheet__browser-edge {\n position: fixed;\n inset: auto 0 0;\n height: max(var(--dimension-space-200), env(safe-area-inset-bottom, 0px));\n pointer-events: none;\n color: var(--color-background-primary);\n background-color: var(--_mobile-section-edge-color, var(--color-background-primary));\n}\n\n.mobile-section-sheet[open] .mobile-section-sheet__browser-edge {\n animation: mobileSectionEdgeIn var(--effect-motion-short-2) both;\n}\n\n.mobile-section-sheet--closing[open] .mobile-section-sheet__browser-edge {\n animation-name: mobileSectionEdgeOut;\n}\n\n/* Animate the opaque color, not opacity: the backdrop is already fading below. */\n@keyframes mobileSectionEdgeIn {\n from {\n background-color: var(--color-background-primary);\n }\n to {\n background-color: var(--_mobile-section-edge-color, var(--color-background-primary));\n }\n}\n\n@keyframes mobileSectionEdgeOut {\n from {\n background-color: var(--_mobile-section-edge-color, var(--color-background-primary));\n }\n to {\n background-color: var(--color-background-primary);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .mobile-section-sheet[open] .mobile-section-sheet__items,\n .mobile-section-sheet[open] .mobile-section-sheet__browser-edge,\n .mobile-section-sheet::backdrop {\n animation: none;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type { MenuItemData, MenuSection } from '../Menu/menu-types';\nimport {\n getSelectableTabs,\n isTabDivider,\n type TabItem,\n type TabItemTab,\n} from '../TabGroup/tab-item-utils';\nimport { resolveMobileSectionPosition } from './mobile-section-switcher-utils';\nimport { resolveMotionTimeMs, TOKEN_DEFAULTS } from '../../utils';\nimport { ConnectionTasks } from '../../utils/connection-tasks';\n\nlet nextMobileSectionSwitcherId = 0;\n\n@Component({\n tag: 'ds-mobile-section-switcher',\n styleUrl: 'MobileSectionSwitcher.css',\n scoped: true,\n})\nexport class MobileSectionSwitcher {\n @Element() el!: HTMLElement;\n\n /** Ordered controlled sections. Divider entries group the popup menu. */\n @Prop() sections: TabItem[] = [];\n /** Controlled selected section id. */\n @Prop() value: string = '';\n /** Accessible name for the section chooser. */\n @Prop() navigationLabel: string = 'Change page section';\n /** Anchored local-view menu or viewport-edge sheet for primary page sections. */\n @Prop() presentation: 'menu' | 'sheet' = 'menu';\n /** Stable page identity shown before the selected section in a sheet trigger. */\n @Prop() pageLabel: string = '';\n\n /** Selection intent. The route, tool, or workflow owner updates `value`. */\n @Event() dsChange!: EventEmitter<string>;\n\n @State() private menuOpen = false;\n @State() private menuSurfaceOpen = false;\n @State() private initialFocusVisible = false;\n @State() private pointerFocus = false;\n @State() private sheetClosing = false;\n @State() private focusedSection = '';\n\n private readonly instanceId = nextMobileSectionSwitcherId++;\n private readonly triggerId = `ds-mobile-section-switcher-trigger-${this.instanceId}`;\n private readonly menuId = `ds-mobile-section-switcher-menu-${this.instanceId}`;\n private triggerEl: HTMLButtonElement | null = null;\n private dialogEl: HTMLDialogElement | null = null;\n private browserEdgeEl: HTMLDivElement | null = null;\n private browserEdgeColors = '';\n private themeObserver?: MutationObserver;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private visibilityObserver?: ResizeObserver;\n private loaded = false;\n private boundDocument?: Document;\n private readonly tasks = new ConnectionTasks(() => this.el.isConnected);\n\n private readonly handleDocumentKeyDown = (event: KeyboardEvent) => {\n if (['Shift', 'Control', 'Alt', 'Meta'].includes(event.key)) return;\n this.pointerFocus = false;\n };\n\n componentDidLoad() {\n this.loaded = true;\n this.connectResources();\n }\n\n connectedCallback() {\n if (this.loaded) this.connectResources();\n }\n\n private connectResources() {\n if (!this.el.isConnected || this.boundDocument) return;\n this.boundDocument = this.el.ownerDocument;\n this.boundDocument.addEventListener('keydown', this.handleDocumentKeyDown, true);\n this.visibilityObserver = new ResizeObserver(\n this.tasks.guard(() => {\n if (this.dialogEl?.open && !this.triggerEl?.getClientRects().length) {\n this.finishSheetClose(false);\n }\n })\n );\n this.visibilityObserver.observe(this.el);\n }\n\n componentDidRender() {\n if (!this.el.isConnected || !this.dialogEl) return;\n if (this.presentation === 'sheet' && this.menuOpen && !this.dialogEl.open) {\n const initialSection = this.focusedSection;\n this.updateBrowserEdgeColor();\n this.observeBrowserEdgeTheme();\n this.dialogEl.showModal();\n this.focusSheetItem(initialSection);\n }\n if (this.sheetClosing && this.dialogEl.open && !this.closeTimer) {\n const duration = resolveMotionTimeMs(\n TOKEN_DEFAULTS.motionShort2,\n TOKEN_DEFAULTS.animationDurationShort3\n );\n if (!duration) this.finishSheetClose();\n else this.closeTimer = setTimeout(() => this.finishSheetClose(), duration);\n }\n }\n\n disconnectedCallback() {\n this.tasks.cancel();\n this.boundDocument?.removeEventListener('keydown', this.handleDocumentKeyDown, true);\n this.boundDocument = undefined;\n this.visibilityObserver?.disconnect();\n this.visibilityObserver = undefined;\n this.pointerFocus = false;\n this.menuSurfaceOpen = false;\n this.finishSheetClose(false);\n }\n\n @Watch('presentation')\n handlePresentationChange() {\n this.menuSurfaceOpen = false;\n this.closeMenu();\n }\n\n @Watch('value')\n @Watch('pageLabel')\n handleContextChange() {\n this.closeMenu();\n }\n\n private finishSheetClose(restoreFocus = true) {\n if (this.closeTimer) clearTimeout(this.closeTimer);\n this.closeTimer = null;\n const wasOpen = this.dialogEl?.open;\n this.dialogEl?.close();\n this.themeObserver?.disconnect();\n this.menuOpen = false;\n this.sheetClosing = false;\n if (wasOpen && restoreFocus && this.triggerEl?.getClientRects().length) this.triggerEl.focus();\n }\n\n private updateBrowserEdgeColor = () => {\n if (!this.el.isConnected || !this.browserEdgeEl || !this.dialogEl) return;\n const base = getComputedStyle(this.browserEdgeEl).color;\n const shade = getComputedStyle(this.dialogEl, '::backdrop').backgroundColor;\n const colors = `${base}|${shade}`;\n if (colors === this.browserEdgeColors) return;\n // Let the browser resolve token colors, including alpha and non-sRGB syntax,\n // then flatten the shade over the bar into the opaque color Safari samples.\n const canvas = this.el.ownerDocument.createElement('canvas');\n canvas.width = canvas.height = 1;\n const context = canvas.getContext('2d');\n if (!context) return;\n context.fillStyle = base;\n context.fillRect(0, 0, 1, 1);\n context.fillStyle = shade;\n context.fillRect(0, 0, 1, 1);\n const [red, green, blue] = context.getImageData(0, 0, 1, 1).data;\n this.browserEdgeEl.style.setProperty(\n '--_mobile-section-edge-color',\n `rgb(${red}, ${green}, ${blue})`\n );\n this.browserEdgeColors = colors;\n };\n\n private observeBrowserEdgeTheme() {\n this.themeObserver ??= new MutationObserver(this.updateBrowserEdgeColor);\n // Token themes are inherited from the page or a containing theme scope.\n for (let ancestor: HTMLElement | null = this.el; ancestor; ancestor = ancestor.parentElement) {\n this.themeObserver.observe(ancestor, {\n attributes: true,\n attributeFilter: ['class', 'style', 'data-theme'],\n });\n }\n }\n\n private focusSheetItem(id: string) {\n const buttons = Array.from(this.dialogEl?.querySelectorAll<HTMLButtonElement>('button') ?? []);\n const button =\n buttons.find(item => item.value === id && !item.disabled) ??\n buttons.find(item => !item.disabled);\n if (button) {\n this.focusedSection = button.value;\n button.focus();\n } else this.dialogEl?.focus();\n }\n\n private handleSheetKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n this.closeMenu();\n return;\n }\n const sections = this.selectableSections.filter(section => !section.isInactive);\n if (!sections.length) return;\n const index = Math.max(\n 0,\n sections.findIndex(section => section.id === this.focusedSection)\n );\n let next: number;\n if (event.key === 'ArrowDown') next = (index + 1) % sections.length;\n else if (event.key === 'ArrowUp') next = (index + sections.length - 1) % sections.length;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = sections.length - 1;\n else if (event.key === 'Tab') next = index;\n else if (\n event.key.length === 1 &&\n !event.ctrlKey &&\n !event.metaKey &&\n !event.altKey &&\n event.key !== ' '\n ) {\n const match = sections.findIndex((_, offset) =>\n sections[(index + offset + 1) % sections.length].label\n .toLowerCase()\n .startsWith(event.key.toLowerCase())\n );\n if (match < 0) return;\n next = (index + match + 1) % sections.length;\n } else return;\n event.preventDefault();\n this.initialFocusVisible = true;\n this.focusSheetItem(sections[next].id);\n };\n\n private get resolvedSections(): TabItem[] {\n return this.sections ?? [];\n }\n\n private get selectableSections(): TabItemTab[] {\n return getSelectableTabs(this.resolvedSections);\n }\n\n private get selectedIndex(): number {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).selectedIndex;\n }\n\n private get selectedSection(): TabItemTab | undefined {\n return this.selectableSections[this.selectedIndex];\n }\n\n private get hasPrevious(): boolean {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).hasPrevious;\n }\n\n private get hasNext(): boolean {\n return resolveMobileSectionPosition(this.resolvedSections, this.value).hasNext;\n }\n\n private get triggerAriaLabel(): string {\n return `${this.presentation === 'sheet' && this.pageLabel ? `${this.pageLabel}. ` : ''}${this.navigationLabel}. Current section: ${this.selectedSection?.label ?? ''}`;\n }\n\n private get menuSections(): MenuSection[] {\n const groups: MenuSection[] = [];\n let items: MenuItemData[] = [];\n const commit = () => {\n if (items.length) groups.push({ items });\n items = [];\n };\n\n for (const section of this.resolvedSections) {\n if (isTabDivider(section)) {\n commit();\n continue;\n }\n items.push({\n label: section.label,\n value: section.id,\n dot: section.dot,\n isSelected: section.id === this.selectedSection?.id,\n isInactive: section.isInactive,\n });\n }\n commit();\n return groups;\n }\n\n @Watch('sections')\n handleSectionsChange() {\n if (this.selectableSections.length <= 1) {\n this.closeMenu();\n this.menuSurfaceOpen = false;\n } else if (this.dialogEl?.open && !this.sheetClosing) {\n this.tasks.frame(() => {\n if (this.dialogEl?.open && !this.sheetClosing) this.focusSheetItem(this.focusedSection);\n });\n }\n }\n\n private toggleMenu = (event: MouseEvent) => {\n if (this.selectableSections.length <= 1) return;\n this.initialFocusVisible = event.detail === 0;\n if (this.presentation === 'sheet') {\n if (this.menuOpen) this.closeMenu();\n else {\n this.focusedSection = this.selectedSection?.id ?? '';\n this.menuOpen = true;\n }\n return;\n }\n this.menuOpen = !this.menuOpen;\n if (this.menuOpen) this.menuSurfaceOpen = true;\n };\n\n private closeMenu = () => {\n this.menuOpen = false;\n if (this.dialogEl?.open) this.sheetClosing = true;\n };\n\n private renderSheet() {\n return (\n <dialog\n id={this.menuId}\n ref={element => {\n this.dialogEl = element ?? null;\n }}\n class={{ 'mobile-section-sheet': true, 'mobile-section-sheet--closing': this.sheetClosing }}\n aria-label={this.navigationLabel}\n tabIndex={-1}\n onCancel={event => {\n event.preventDefault();\n this.closeMenu();\n }}\n onKeyDown={this.handleSheetKeyDown}\n onClick={event => {\n if (!this.dialogEl || event.target !== this.dialogEl) return;\n const rect = this.dialogEl.getBoundingClientRect();\n if (\n event.clientY < rect.top ||\n event.clientY > rect.bottom ||\n event.clientX < rect.left ||\n event.clientX > rect.right\n )\n this.closeMenu();\n }}\n >\n <div class=\"mobile-section-sheet__items\" role=\"menu\" aria-label={this.navigationLabel}>\n {this.resolvedSections.map(section =>\n isTabDivider(section) ? (\n <div class=\"mobile-section-sheet__divider\" role=\"separator\" />\n ) : (\n <button\n type=\"button\"\n role=\"menuitem\"\n value={section.id}\n disabled={section.isInactive}\n aria-current={section.id === this.selectedSection?.id ? 'page' : undefined}\n tabIndex={section.id === this.focusedSection ? 0 : -1}\n class={{\n 'mobile-section-sheet__item': true,\n 'ds-control--md': true,\n 'ds-interaction-fill': true,\n 'ds-focus-ring-inset': true,\n 'ds-focus-ring--visible':\n this.initialFocusVisible && section.id === this.focusedSection,\n }}\n onFocus={() => {\n this.focusedSection = section.id;\n }}\n onClick={() => {\n if (this.sheetClosing || section.isInactive) return;\n this.closeMenu();\n if (section.id !== this.selectedSection?.id) this.dsChange.emit(section.id);\n }}\n >\n <ds-text\n class=\"mobile-section-sheet__label ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"inherit\"\n emphasis={section.id === this.selectedSection?.id}\n lineTruncation={1}\n >\n {section.label}\n </ds-text>\n </button>\n )\n )}\n </div>\n <div\n ref={element => {\n if (this.browserEdgeEl !== element) this.browserEdgeColors = '';\n this.browserEdgeEl = element ?? null;\n }}\n class=\"mobile-section-sheet__browser-edge\"\n aria-hidden=\"true\"\n />\n </dialog>\n );\n }\n\n private handleSelect = (event: CustomEvent<MenuItemData>) => {\n const id = String(event.detail.value ?? '');\n const section = this.selectableSections.find(candidate => candidate.id === id);\n if (!section || section.isInactive) return;\n this.closeMenu();\n if (id !== this.selectedSection?.id) this.dsChange.emit(id);\n this.tasks.frame(() => this.triggerEl?.focus());\n };\n\n render() {\n const selected = this.selectedSection;\n if (!selected) return <Host />;\n const combined = this.presentation === 'sheet' && !!this.pageLabel;\n\n return (\n <Host\n class={{ 'mobile-section-switcher--pointer-focus': this.pointerFocus }}\n onPointerDown={() => {\n this.pointerFocus = true;\n this.initialFocusVisible = false;\n }}\n >\n <button\n ref={element => {\n this.triggerEl = element ?? null;\n }}\n id={this.triggerId}\n class={{\n 'mobile-section-switcher': true,\n 'mobile-section-switcher--expanded': this.menuOpen,\n 'ds-interaction-fill--surface-open':\n this.menuSurfaceOpen || this.menuOpen || this.sheetClosing,\n 'mobile-section-switcher--sheet': this.presentation === 'sheet',\n 'mobile-section-switcher--combined': combined,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n type=\"button\"\n aria-haspopup={this.presentation === 'sheet' ? 'dialog' : 'menu'}\n aria-controls={this.menuId}\n aria-expanded={String(this.menuOpen)}\n aria-label={this.triggerAriaLabel}\n onClick={this.toggleMenu}\n >\n {this.presentation === 'menu' ? (\n <span\n class={{\n 'mobile-section-switcher__position': true,\n 'mobile-section-switcher__position--visible': this.hasPrevious,\n 'ds-interaction-fill__content': true,\n }}\n aria-hidden=\"true\"\n />\n ) : null}\n {combined\n ? [\n <ds-text\n class=\"mobile-section-switcher__page-label ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis\n color=\"inherit\"\n lineTruncation={1}\n >\n {this.pageLabel}\n </ds-text>,\n <ds-text\n class=\"mobile-section-switcher__separator ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n color=\"inherit\"\n aria-hidden=\"true\"\n >\n ·\n </ds-text>,\n ]\n : null}\n <ds-text\n class=\"mobile-section-switcher__label ds-interaction-fill__content\"\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis\n color=\"inherit\"\n lineTruncation={1}\n >\n {selected.label}\n </ds-text>\n {this.presentation === 'menu' ? (\n <span\n class={{\n 'mobile-section-switcher__position': true,\n 'mobile-section-switcher__position--visible': this.hasNext,\n 'ds-interaction-fill__content': true,\n }}\n aria-hidden=\"true\"\n />\n ) : null}\n </button>\n\n {this.presentation === 'sheet' || this.sheetClosing ? (\n this.renderSheet()\n ) : this.selectableSections.length > 1 ? (\n <ds-menu\n id={this.menuId}\n anchorId={this.triggerId}\n align=\"center\"\n menuLabel={this.navigationLabel}\n open={this.menuOpen}\n initialFocusVisible={this.initialFocusVisible}\n sections={this.menuSections}\n onDsClose={this.closeMenu}\n onDsAfterClose={() => {\n if (!this.menuOpen) this.menuSurfaceOpen = false;\n }}\n onDsSelect={this.handleSelect}\n />\n ) : null}\n </Host>\n );\n }\n}\n"],"mappings":"+hBAUM,SAAUA,EACdC,EACAC,GAEA,MAAMC,EAAaC,EAAkBH,GACrC,MAAMI,EAAeF,EAAWG,WAAUC,GAAWA,EAAQC,KAAON,IACpE,MAAMO,EAAgBJ,GAAgB,EAAIA,EAAe,EACzD,MAAO,CACLI,gBACAC,SAAUP,EAAWM,GACrBE,YAAaF,EAAgB,EAC7BG,QAASH,EAAgBN,EAAWU,OAAS,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KI,SAAUJ,KAAKK,gBAAkB,KAAK,EAElDyK,WAAY9K,KAAK2E,eAEjB,K","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{p as s,H as o,h as e,a as c,t as i}from"./index.js";import{C as d}from"./p-BnhGV__o.js";import{d as t}from"./p-CzTJAO2J.js";import{d as n}from"./p-CaNMVLhm.js";import{d as r}from"./p-BVsVUnAw.js";import{d as a}from"./p-0XTyQNRG.js";import{d as l}from"./p-CTAF7SkL.js";import{d as f}from"./p-B5rN3slq.js";const u=()=>`@media (forced-colors: active){.sc-ds-code-block:root,.sc-ds-code-block-h,.ds-forced-colors-scope.sc-ds-code-block{--ds-forced-color-surface:Canvas;--ds-forced-color-content:CanvasText;--ds-forced-color-control-boundary:ButtonText;--ds-forced-color-selected:Highlight;--ds-forced-color-on-selected:HighlightText;--ds-forced-color-disabled:GrayText}}.sc-ds-code-block-h{--ds-focus-ring-width:var(--dimension-stroke-width-025, 2px);--ds-focus-ring-offset:var(--dimension-space-025, 2px);--ds-focus-ring-color:var(--color-interaction-focus)}.ds-focus-ring.sc-ds-code-block-h,.ds-focus-ring.sc-ds-code-block,.ds-focus-ring-inset.sc-ds-code-block-h,.ds-focus-ring-inset.sc-ds-code-block{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-code-block-h:focus-visible,.ds-focus-ring.sc-ds-code-block:focus-visible{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring.ds-focus-ring--visible.sc-ds-code-block-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-code-block{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:var(--ds-focus-ring-offset)}.ds-focus-ring-inset.sc-ds-code-block-h:focus-visible,.ds-focus-ring-inset.sc-ds-code-block:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-code-block-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-code-block:focus-visible::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-code-block-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-code-block{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-code-block-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-code-block::after{outline:var(--ds-focus-ring-width) solid var(--ds-focus-ring-color);outline-offset:calc(-1 * var(--ds-focus-ring-width))}@media (forced-colors: active){.sc-ds-code-block-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}`;const b=()=>`.sc-ds-code-block-h{display:block;width:100%;min-width:0;box-sizing:border-box;-webkit-user-select:none;user-select:none}.code-block.sc-ds-code-block{width:100%;min-width:0;margin:0;overflow:hidden;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);box-sizing:border-box}.code-block__header.sc-ds-code-block{display:flex;align-items:center;justify-content:space-between;gap:var(--dimension-space-100);min-height:var(--dimension-size-400);padding:var(--dimension-space-050) var(--dimension-space-100);background:var(--color-background-strong-neutral);box-sizing:border-box}pre.sc-ds-code-block{--ds-focus-ring-offset:calc(-1 * var(--ds-focus-ring-width));margin:0;padding:var(--dimension-space-150);overflow:auto;font-family:var( --typography-font-family-code, 'Fira Code', ui-monospace, 'SFMono-Regular', 'Cascadia Code', 'Roboto Mono', Menlo, Monaco, Consolas, 'Liberation Mono', monospace );font-size:var(--typography-fontsize-sm);font-variant-ligatures:var(--ds-code-font-variant-ligatures, normal);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none);tab-size:2;-webkit-user-select:text;user-select:text}code.sc-ds-code-block{display:block;inline-size:max-content;font:inherit;white-space:pre}`;const h=s(class s extends o{constructor(s){super();if(s!==false){this.__registerHost()}this.code="";this.language="";this.filename="";this.copied=false;this.scrollable=false;this.copyFeedback=new d((s=>{this.copied=s}));this.syncOverflow=()=>{const s=this.viewport;if(!s?.isConnected)return;this.scrollable=s.scrollWidth>s.clientWidth||s.scrollHeight>s.clientHeight};this.copy=async()=>{await this.copyFeedback.copy(this.code)}}connectedCallback(){this.copyFeedback.connect();this.observeOverflow()}componentDidLoad(){this.observeOverflow()}componentDidRender(){this.syncOverflow()}observeOverflow(){if(!this.viewport?.isConnected||!this.content)return;this.resizeObserver??(this.resizeObserver=new ResizeObserver(this.syncOverflow));this.resizeObserver.observe(this.viewport);this.resizeObserver.observe(this.content);this.syncOverflow()}handleCodeChange(){this.copyFeedback.reset()}disconnectedCallback(){this.copyFeedback.disconnect();this.resizeObserver?.disconnect();this.resizeObserver=undefined}render(){const s=this.filename||this.language||"Code";return e(c,{key:"a52748baf4d3e9de97cdc43185d5dcf0897a5fb6"},e("figure",{key:"9b51d0550699ea1633097e571f08690c6b5c557f",class:"code-block"},e("figcaption",{key:"ee73c1f0c7f128746636580b4ec6f58b71ca9429",class:"code-block__header"},e("ds-text",{key:"d122455a1452531a2eadde214efc22054e485417",as:"span",variant:"text-caption",emphasis:true,color:"on-strong"},s),e("ds-tooltip",{key:"605707b242f782d48cc1986160ed82b7d3ccb682",label:this.copied?"Copied":"Copy code",side:"bottom",size:"sm"},e("ds-button-unfilled",{key:"c5c7d4ea37f65d76d940b638e867754cb0ca7868",variant:"icon",icon:this.copied?"Check":"Copy",size:"xs","aria-label":this.copied?"Copied":"Copy code",hasBorder:false,onDsClick:this.copy}))),e("pre",{key:"48d1a4adb2285e14b4e31c76ce2700d9b61b8cce",class:"ds-focus-ring",ref:s=>{this.viewport=s},tabIndex:this.scrollable?0:undefined,role:this.scrollable?"region":undefined,"aria-label":this.scrollable?s:undefined},e("code",{key:"c76d913c3cab144d7ef881f5641234c310ca767a",ref:s=>{this.content=s}},this.code))))}static get watchers(){return{code:[{handleCodeChange:0}]}}static get style(){return u()+b()}},[2,"ds-code-block",{code:[1],language:[1],filename:[1],copied:[32],scrollable:[32]},undefined,{code:[{handleCodeChange:0}]}]);function g(){if(typeof customElements==="undefined"){return}const s=["ds-code-block","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];s.forEach((s=>{switch(s){case"ds-code-block":if(!customElements.get(i(s))){customElements.define(i(s),h)}break;case"ds-badge":if(!customElements.get(i(s))){t()}break;case"ds-button-unfilled":if(!customElements.get(i(s))){n()}break;case"ds-icon":if(!customElements.get(i(s))){r()}break;case"ds-loader":if(!customElements.get(i(s))){a()}break;case"ds-text":if(!customElements.get(i(s))){l()}break;case"ds-tooltip":if(!customElements.get(i(s))){f()}break}}))}g();export{h as C,g as d};
2
+ //# sourceMappingURL=p-BkajUPiA.js.map