@ds-mo/ui 14.6.0 → 14.8.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 (154) hide show
  1. package/dist/.package-ready.json +1 -1
  2. package/dist/agent-patterns.json +6 -6
  3. package/dist/agent.json +316 -21
  4. package/dist/angular/ds-menu.d.ts +7 -1
  5. package/dist/angular/ds-menu.js +5 -2
  6. package/dist/angular/ds-select.d.ts +7 -1
  7. package/dist/angular/ds-select.js +5 -2
  8. package/dist/angular/ds-table-saved-views.d.ts +49 -0
  9. package/dist/angular/ds-table-saved-views.js +57 -0
  10. package/dist/angular/ds-table-toolbar.d.ts +12 -0
  11. package/dist/angular/ds-table-toolbar.js +38 -0
  12. package/dist/angular/ds-table.d.ts +7 -1
  13. package/dist/angular/ds-table.js +10 -4
  14. package/dist/angular/index.d.ts +1 -1
  15. package/dist/angular/index.js +2 -0
  16. package/dist/angular/proxies.d.ts +2 -0
  17. package/dist/angular/proxies.js +2 -0
  18. package/dist/components/ds-agent-questionnaire.js +1 -1
  19. package/dist/components/ds-agent-response.js +1 -1
  20. package/dist/components/ds-banner.js +1 -1
  21. package/dist/components/ds-bar-nav.js +1 -1
  22. package/dist/components/ds-bar-title.js +1 -1
  23. package/dist/components/ds-bar-workflow.js +1 -1
  24. package/dist/components/ds-button-unfilled.js +1 -1
  25. package/dist/components/ds-card-chart.js +1 -1
  26. package/dist/components/ds-card-setting.js +1 -1
  27. package/dist/components/ds-code-block.js +1 -1
  28. package/dist/components/ds-conversation-list-item.js +1 -1
  29. package/dist/components/ds-conversation-list-item.js.map +1 -1
  30. package/dist/components/ds-field.js +1 -1
  31. package/dist/components/ds-field.js.map +1 -1
  32. package/dist/components/ds-filter-menu.js +1 -1
  33. package/dist/components/ds-filter-menu.js.map +1 -1
  34. package/dist/components/ds-input.js +1 -1
  35. package/dist/components/ds-input.js.map +1 -1
  36. package/dist/components/ds-markdown.js +1 -1
  37. package/dist/components/ds-menu.js +1 -1
  38. package/dist/components/ds-message-actions.js +1 -1
  39. package/dist/components/ds-message-composer.js +1 -1
  40. package/dist/components/ds-message-scroller.js +1 -1
  41. package/dist/components/ds-mobile-header.js +1 -1
  42. package/dist/components/ds-mobile-section-switcher.js +1 -1
  43. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  44. package/dist/components/ds-modal.js +1 -1
  45. package/dist/components/ds-modal.js.map +1 -1
  46. package/dist/components/ds-pagination.js +1 -1
  47. package/dist/components/ds-panel-nav.js +1 -1
  48. package/dist/components/ds-panel-tool-header.js +1 -1
  49. package/dist/components/ds-panel-tool-search.js +1 -1
  50. package/dist/components/ds-panel-tools.js +1 -1
  51. package/dist/components/ds-select.js +1 -1
  52. package/dist/components/ds-shell-app.js +1 -1
  53. package/dist/components/ds-shell-tools.js +1 -1
  54. package/dist/components/ds-table-saved-views.d.ts +11 -0
  55. package/dist/components/ds-table-saved-views.js +2 -0
  56. package/dist/components/ds-table-saved-views.js.map +1 -0
  57. package/dist/components/ds-table-toolbar.d.ts +11 -0
  58. package/dist/components/ds-table-toolbar.js +2 -0
  59. package/dist/components/ds-table-toolbar.js.map +1 -0
  60. package/dist/components/ds-table.js +1 -1
  61. package/dist/components/ds-table.js.map +1 -1
  62. package/dist/components/ds-toast.js +1 -1
  63. package/dist/components/ds-typing-indicator.js +1 -1
  64. package/dist/components/{p-C7-ylLcB.js → p-BCg_6ErW.js} +2 -2
  65. package/dist/components/p-BFSnIEsC.js +2 -0
  66. package/dist/components/p-BFSnIEsC.js.map +1 -0
  67. package/dist/components/p-BPnmiiIS.js +2 -0
  68. package/dist/components/p-BPnmiiIS.js.map +1 -0
  69. package/dist/components/p-BVmKcpyP.js +2 -0
  70. package/dist/components/p-BVmKcpyP.js.map +1 -0
  71. package/dist/components/p-BiTwXttN.js +2 -0
  72. package/dist/components/p-BiTwXttN.js.map +1 -0
  73. package/dist/components/{p-C5230yJY.js → p-BmWWU20X.js} +2 -2
  74. package/dist/components/{p-K_vg9Eng.js → p-BuGGwWmt.js} +2 -2
  75. package/dist/components/{p-DL12lNtv.js → p-Bv1CFHgD.js} +2 -2
  76. package/dist/components/{p-CDEME0Uc.js → p-C-L4InQ0.js} +2 -2
  77. package/dist/components/{p-BGQUiJuJ.js → p-C-Zgq_Fx.js} +2 -2
  78. package/dist/components/{p-BykcjUd6.js → p-C1jsgfeh.js} +2 -2
  79. package/dist/components/p-C1q-tq3U.js +2 -0
  80. package/dist/components/p-C1q-tq3U.js.map +1 -0
  81. package/dist/components/p-C6DNhlES.js +2 -0
  82. package/dist/components/p-C6DNhlES.js.map +1 -0
  83. package/dist/components/{p-BFDKKBYh.js → p-CoQSB3tl.js} +2 -2
  84. package/dist/components/{p-CCpJcSTE.js → p-CqbMoVDQ.js} +2 -2
  85. package/dist/components/{p-DJ-n-gyr.js → p-CvwtYbmh.js} +2 -2
  86. package/dist/components/{p-BAgjMUt3.js → p-Cxr0IQjC.js} +1 -1
  87. package/dist/components/p-Cxr0IQjC.js.map +1 -0
  88. package/dist/components/{p-os90t2-f.js → p-D5VglrfF.js} +2 -2
  89. package/dist/components/{p-BX-R5EhL.js → p-D5bPuNiF.js} +2 -2
  90. package/dist/components/{p-DTf90AyI.js → p-bQm3gfr1.js} +2 -2
  91. package/dist/components/{p-CTTDiW33.js → p-c_5SXjwx.js} +2 -2
  92. package/dist/components/p-c_5SXjwx.js.map +1 -0
  93. package/dist/docs/components.json +951 -20
  94. package/dist/lib/utils/choice-list.d.ts +8 -1
  95. package/dist/mcp-data/registry/button-unfilled.json +6 -6
  96. package/dist/mcp-data/registry/menu.json +40 -12
  97. package/dist/mcp-data/registry/registry.json +321 -20
  98. package/dist/mcp-data/registry/select.json +20 -3
  99. package/dist/mcp-data/registry/table-saved-views.json +383 -0
  100. package/dist/mcp-data/registry/table-toolbar.json +146 -0
  101. package/dist/mcp-data/registry/table.json +188 -11
  102. package/dist/react/components.d.ts +2 -0
  103. package/dist/react/components.js +2 -0
  104. package/dist/react/ds-menu.d.ts +2 -1
  105. package/dist/react/ds-menu.js +2 -1
  106. package/dist/react/ds-select.d.ts +2 -1
  107. package/dist/react/ds-select.js +2 -1
  108. package/dist/react/ds-table-saved-views.d.ts +17 -0
  109. package/dist/react/ds-table-saved-views.js +19 -0
  110. package/dist/react/ds-table-toolbar.d.ts +9 -0
  111. package/dist/react/ds-table-toolbar.js +12 -0
  112. package/dist/react/ds-table.d.ts +3 -1
  113. package/dist/react/ds-table.js +3 -1
  114. package/dist/styles/table.css +34 -1
  115. package/dist/types/components/ButtonUnfilled/ButtonUnfilled.d.ts +4 -2
  116. package/dist/types/components/Menu/Menu.d.ts +18 -1
  117. package/dist/types/components/Menu/menu-reorder.d.ts +21 -0
  118. package/dist/types/components/Menu/menu-types.d.ts +12 -0
  119. package/dist/types/components/Select/Select.d.ts +7 -0
  120. package/dist/types/components/Select/index.d.ts +1 -1
  121. package/dist/types/components/Table/Table.d.ts +46 -1
  122. package/dist/types/components/Table/index.d.ts +1 -1
  123. package/dist/types/components/Table/table-column-customizer.d.ts +33 -0
  124. package/dist/types/components/Table/table-data-mode-switcher.d.ts +9 -0
  125. package/dist/types/components/Table/table-types.d.ts +10 -0
  126. package/dist/types/components/TableSavedViews/TableSavedViews.d.ts +61 -0
  127. package/dist/types/components/TableSavedViews/index.d.ts +2 -0
  128. package/dist/types/components/TableSavedViews/table-saved-views-types.d.ts +24 -0
  129. package/dist/types/components/TableToolbar/TableToolbar.d.ts +6 -0
  130. package/dist/types/components.d.ts +274 -8
  131. package/dist/types/utils/choice-list-parts.d.ts +1 -0
  132. package/dist/types/utils/choice-list.d.ts +8 -1
  133. package/package.json +1 -1
  134. package/dist/components/p-3r4TfcZX.js +0 -2
  135. package/dist/components/p-3r4TfcZX.js.map +0 -1
  136. package/dist/components/p-BAgjMUt3.js.map +0 -1
  137. package/dist/components/p-CRi7P5gQ.js +0 -2
  138. package/dist/components/p-CRi7P5gQ.js.map +0 -1
  139. package/dist/components/p-CTTDiW33.js.map +0 -1
  140. package/dist/components/p-tR8INOIN.js +0 -2
  141. package/dist/components/p-tR8INOIN.js.map +0 -1
  142. /package/dist/components/{p-C7-ylLcB.js.map → p-BCg_6ErW.js.map} +0 -0
  143. /package/dist/components/{p-C5230yJY.js.map → p-BmWWU20X.js.map} +0 -0
  144. /package/dist/components/{p-K_vg9Eng.js.map → p-BuGGwWmt.js.map} +0 -0
  145. /package/dist/components/{p-DL12lNtv.js.map → p-Bv1CFHgD.js.map} +0 -0
  146. /package/dist/components/{p-CDEME0Uc.js.map → p-C-L4InQ0.js.map} +0 -0
  147. /package/dist/components/{p-BGQUiJuJ.js.map → p-C-Zgq_Fx.js.map} +0 -0
  148. /package/dist/components/{p-BykcjUd6.js.map → p-C1jsgfeh.js.map} +0 -0
  149. /package/dist/components/{p-BFDKKBYh.js.map → p-CoQSB3tl.js.map} +0 -0
  150. /package/dist/components/{p-CCpJcSTE.js.map → p-CqbMoVDQ.js.map} +0 -0
  151. /package/dist/components/{p-DJ-n-gyr.js.map → p-CvwtYbmh.js.map} +0 -0
  152. /package/dist/components/{p-os90t2-f.js.map → p-D5VglrfF.js.map} +0 -0
  153. /package/dist/components/{p-BX-R5EhL.js.map → p-D5bPuNiF.js.map} +0 -0
  154. /package/dist/components/{p-DTf90AyI.js.map → p-bQm3gfr1.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{p as e,H as s,h as r,a as o,t as a}from"./index.js";import{d}from"./p-D8nnhQNJ.js";import{d as n}from"./p-CTTDiW33.js";import{d as t}from"./p-DTf90AyI.js";import{d as i}from"./p-BFfLvMZd.js";import{d as c}from"./p-Ca-I2UnB.js";import{d as h}from"./p-DZFilC--.js";import{d as m}from"./p-BXPQmp7q.js";import{r as l}from"./p-C-vRkDyn.js";const w=()=>`.sc-ds-markdown:where(.ds-prose){display:block;box-sizing:border-box;max-inline-size:100%;min-inline-size:0;color:inherit;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6.sc-ds-markdown,p.sc-ds-markdown,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:var(--ds-prose-text-max-inline-size, 100%)}.sc-ds-markdown:where(.ds-prose) :where(p,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote.sc-ds-markdown,figure.sc-ds-markdown,figcaption.sc-ds-markdown,table).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:inherit;font-family:var(--typography-font-family-ui);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:var(--color-foreground-primary);font-family:var(--typography-font-family-ui);font-weight:var(--typography-weight-semibold)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl);letter-spacing:var(--typography-letterspacing-negative-double)}.sc-ds-markdown:where(.ds-prose) :where(h3,h4).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose) :where(h5,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose)>.sc-ds-markdown:where(*+*){margin-block-start:var(--dimension-space-150)}.sc-ds-markdown:where(.ds-prose)>:where(*)+:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-200)}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown+.sc-ds-markdown:where(*){margin-block-start:var(--dimension-space-100)}.sc-ds-markdown:where(.ds-prose) :where(blockquote,li.sc-ds-markdown,dd)>.sc-ds-markdown:where(*+*):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li+li.sc-ds-markdown,dt+dd).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(ul,ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-300)}.sc-ds-markdown:where(.ds-prose) :where(li>ul.sc-ds-markdown,li>ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li>input[type='checkbox']):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-inline-end:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(blockquote):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-150);border-inline-start:var(--dimension-stroke-width-025) solid var(--color-border-secondary);color:var(--color-foreground-secondary)}.sc-ds-markdown:where(.ds-prose) :where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6) .sc-ds-markdown:where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:inherit}.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-bold-brand);text-decoration-line:none;text-decoration-color:currentcolor;text-decoration-thickness:var(--ds-text-decoration-thickness, var(--dimension-stroke-width-012));text-underline-offset:var(--ds-text-decoration-offset, var(--dimension-space-025))}@media (hover: hover) and (pointer: fine){.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown:hover{text-decoration-line:underline}}@media (forced-colors: active){.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{text-decoration-line:underline}}.sc-ds-markdown:where(.ds-prose) :where(code):not(:where(pre code.sc-ds-markdown,[data-ds-prose='off'].sc-ds-markdown,[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-012) var(--dimension-space-025);border-radius:var(--dimension-radius-025);background:var(--color-background-secondary);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)}.sc-ds-markdown:where(.ds-prose) :where(pre):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{box-sizing:border-box;max-inline-size:100%;min-inline-size:0;margin:0;padding:var(--dimension-space-150);overflow:auto;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);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}.sc-ds-markdown:where(.ds-prose) :where(pre code):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;white-space:pre}.sc-ds-markdown:where(.ds-prose) :where(hr):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;border:0;border-block-start:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.sc-ds-markdown:where(.ds-prose__table-scroll){box-sizing:border-box;max-inline-size:100%;min-inline-size:0;overflow-x:auto}.sc-ds-markdown:where(.ds-prose) :where(table):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{inline-size:100%;border-collapse:collapse}.sc-ds-markdown:where(.ds-prose) :where(th,td).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-075);border:var(--dimension-stroke-width-012) solid var(--color-border-tertiary);text-align:start;vertical-align:top;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose) :where(th):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-primary);font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(img,video.sc-ds-markdown,svg).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:100%;block-size:auto}.sc-ds-markdown:where(.ds-prose) :where(figcaption):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050);color:var(--color-foreground-secondary);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown-h{display:block;min-width:0;color:inherit;box-sizing:border-box;-webkit-user-select:text;user-select:text}`;let p;function f(){p??(p=Promise.all([import("./p-BjtXYFhw.js"),import("./p-DVsje4AY.js"),import("./p-gidVv1FX.js")]).then((([e,s,r])=>({fromMarkdown:e.fromMarkdown,gfmFromMarkdown:s.gfmFromMarkdown,gfm:r.gfm}))));return p}const k=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.content="";this.streaming=false;this.tree=null;this.parseRevision=0}componentWillLoad(){if(typeof document!=="undefined")return this.parse()}disconnectedCallback(){this.parseRevision+=1;if(this.parseFrame&&typeof cancelAnimationFrame==="function"){cancelAnimationFrame(this.parseFrame)}}scheduleParse(){if(typeof requestAnimationFrame!=="function")return;if(this.parseFrame)cancelAnimationFrame(this.parseFrame);this.parseFrame=requestAnimationFrame((()=>{this.parseFrame=undefined;void this.parse()}))}async parse(){const e=++this.parseRevision;try{const{fromMarkdown:s,gfmFromMarkdown:r,gfm:o}=await f();const a=s(this.content,{extensions:[o()],mdastExtensions:[r()]});if(e===this.parseRevision)this.tree=a}catch{if(e===this.parseRevision)this.tree=null}}children(e){if(!("children"in e))return[];return e.children.map((e=>this.renderNode(e)))}renderNode(e){switch(e.type){case"root":return this.children(e);case"text":return r("span",{class:"markdown__text"},e.value);case"paragraph":return r("p",{class:"markdown__paragraph"},this.children(e));case"heading":{const s=`h${e.depth}`;return r(s,{class:"markdown__heading"},this.children(e))}case"strong":return r("strong",{class:"markdown__strong"},this.children(e));case"emphasis":return r("em",{class:"markdown__emphasis"},this.children(e));case"delete":return r("del",{class:"markdown__delete"},this.children(e));case"blockquote":return r("blockquote",{class:"markdown__blockquote"},this.children(e));case"break":return r("br",{class:"markdown__break"});case"thematicBreak":return r("hr",{class:"markdown__thematic-break"});case"inlineCode":return r("code",{class:"markdown__inline-code"},e.value);case"code":return r("ds-code-block",{class:"markdown__code-block","data-ds-prose":"off",code:e.value,language:e.lang??"",filename:e.meta??""});case"link":{const s=l(e.url,{protocols:["http:","https:","mailto:"]});return s?r("a",{class:"markdown__link",href:s,target:"_blank",rel:"noopener noreferrer"},this.children(e)):this.children(e)}case"list":{const s=e.ordered?"ol":"ul";return r(s,{class:"markdown__list",start:e.ordered&&e.start?e.start:undefined},this.children(e))}case"listItem":return r("li",{class:"markdown__list-item"},typeof e.checked==="boolean"?r("input",{class:"markdown__task-indicator",type:"checkbox",checked:e.checked,disabled:true,"aria-hidden":"true",tabIndex:-1}):null,this.children(e));case"table":{const[s,...o]=e.children;return r("div",{class:"markdown__table-wrap ds-prose__table-scroll",tabIndex:0},r("table",{class:"markdown__table"},s?r("thead",{class:"markdown__table-head"},r("tr",{class:"markdown__table-row"},s.children.map((e=>r("th",{class:"markdown__table-heading",scope:"col"},this.children(e)))))):null,r("tbody",{class:"markdown__table-body"},o.map((e=>this.renderNode(e))))))}case"tableRow":return r("tr",{class:"markdown__table-row"},this.children(e));case"tableCell":return r("td",{class:"markdown__table-cell"},this.children(e));case"image":{const s=l(e.url,{protocols:["http:","https:","mailto:"]});return s?r("a",{class:"markdown__image-link",href:s,target:"_blank",rel:"noopener noreferrer"},e.alt||"View image"):e.alt||null}case"html":case"definition":case"footnoteDefinition":return null;case"footnoteReference":return r("sup",{class:"markdown__footnote"},e.label);default:return this.children(e)}}render(){return r(o,{key:"4ab797718d8fbf26cfc08018b1cbaa4c5842350d","aria-busy":this.streaming?"true":undefined},r("div",{key:"71848a0b6e787f90d39e64e5a67d37918fa15074",class:"markdown ds-prose"},this.tree?this.renderNode(this.tree):r("p",{class:"markdown__paragraph"},r("span",{class:"markdown__text"},this.content))))}static get watchers(){return{content:[{scheduleParse:0}]}}static get style(){return w()}},[2,"ds-markdown",{content:[1],streaming:[4],tree:[32]},undefined,{content:[{scheduleParse:0}]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-markdown","ds-badge","ds-button-unfilled","ds-code-block","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-markdown":if(!customElements.get(a(e))){customElements.define(a(e),k)}break;case"ds-badge":if(!customElements.get(a(e))){d()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){n()}break;case"ds-code-block":if(!customElements.get(a(e))){t()}break;case"ds-icon":if(!customElements.get(a(e))){i()}break;case"ds-loader":if(!customElements.get(a(e))){c()}break;case"ds-text":if(!customElements.get(a(e))){h()}break;case"ds-tooltip":if(!customElements.get(a(e))){m()}break}}))}g();export{k as M,g as d};
2
- //# sourceMappingURL=p-BFDKKBYh.js.map
1
+ import{p as e,H as s,h as r,a as o,t as a}from"./index.js";import{d}from"./p-D8nnhQNJ.js";import{d as n}from"./p-c_5SXjwx.js";import{d as t}from"./p-bQm3gfr1.js";import{d as i}from"./p-BFfLvMZd.js";import{d as c}from"./p-Ca-I2UnB.js";import{d as h}from"./p-DZFilC--.js";import{d as m}from"./p-BXPQmp7q.js";import{r as l}from"./p-C-vRkDyn.js";const w=()=>`.sc-ds-markdown:where(.ds-prose){display:block;box-sizing:border-box;max-inline-size:100%;min-inline-size:0;color:inherit;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6.sc-ds-markdown,p.sc-ds-markdown,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:var(--ds-prose-text-max-inline-size, 100%)}.sc-ds-markdown:where(.ds-prose) :where(p,ul.sc-ds-markdown,ol.sc-ds-markdown,dl.sc-ds-markdown,blockquote.sc-ds-markdown,figure.sc-ds-markdown,figcaption.sc-ds-markdown,table).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:inherit;font-family:var(--typography-font-family-ui);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;color:var(--color-foreground-primary);font-family:var(--typography-font-family-ui);font-weight:var(--typography-weight-semibold)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-xl);line-height:var(--typography-lineheight-xl);letter-spacing:var(--typography-letterspacing-negative-double)}.sc-ds-markdown:where(.ds-prose) :where(h3,h4).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-lg);line-height:var(--typography-lineheight-lg);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose) :where(h5,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-size:var(--typography-fontsize-md);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative)}.sc-ds-markdown:where(.ds-prose)>.sc-ds-markdown:where(*+*){margin-block-start:var(--dimension-space-150)}.sc-ds-markdown:where(.ds-prose)>:where(*)+:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-200)}.sc-ds-markdown:where(.ds-prose)>:where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown+.sc-ds-markdown:where(*){margin-block-start:var(--dimension-space-100)}.sc-ds-markdown:where(.ds-prose) :where(blockquote,li.sc-ds-markdown,dd)>.sc-ds-markdown:where(*+*):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li+li.sc-ds-markdown,dt+dd).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(ul,ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-300)}.sc-ds-markdown:where(.ds-prose) :where(li>ul.sc-ds-markdown,li>ol).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(li>input[type='checkbox']):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-inline-end:var(--dimension-space-050)}.sc-ds-markdown:where(.ds-prose) :where(blockquote):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding-inline-start:var(--dimension-space-150);border-inline-start:var(--dimension-stroke-width-025) solid var(--color-border-secondary);color:var(--color-foreground-secondary)}.sc-ds-markdown:where(.ds-prose) :where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(h1,h2.sc-ds-markdown,h3.sc-ds-markdown,h4.sc-ds-markdown,h5.sc-ds-markdown,h6) .sc-ds-markdown:where(strong,b).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{font-weight:inherit}.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-bold-brand);text-decoration-line:none;text-decoration-color:currentcolor;text-decoration-thickness:var(--ds-text-decoration-thickness, var(--dimension-stroke-width-012));text-underline-offset:var(--ds-text-decoration-offset, var(--dimension-space-025))}@media (hover: hover) and (pointer: fine){.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown:hover{text-decoration-line:underline}}@media (forced-colors: active){.sc-ds-markdown:where(.ds-prose) :where(a):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{text-decoration-line:underline}}.sc-ds-markdown:where(.ds-prose) :where(code):not(:where(pre code.sc-ds-markdown,[data-ds-prose='off'].sc-ds-markdown,[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-012) var(--dimension-space-025);border-radius:var(--dimension-radius-025);background:var(--color-background-secondary);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)}.sc-ds-markdown:where(.ds-prose) :where(pre):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{box-sizing:border-box;max-inline-size:100%;min-inline-size:0;margin:0;padding:var(--dimension-space-150);overflow:auto;border-radius:var(--dimension-radius-050);background:var(--color-background-strong-neutral);color:var(--color-foreground-faint-neutral);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}.sc-ds-markdown:where(.ds-prose) :where(pre code):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:0;background:transparent;color:inherit;font:inherit;letter-spacing:inherit;white-space:pre}.sc-ds-markdown:where(.ds-prose) :where(hr):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin:0;border:0;border-block-start:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.sc-ds-markdown:where(.ds-prose__table-scroll){box-sizing:border-box;max-inline-size:100%;min-inline-size:0;overflow-x:auto}.sc-ds-markdown:where(.ds-prose) :where(table):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{inline-size:100%;border-collapse:collapse}.sc-ds-markdown:where(.ds-prose) :where(th,td).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{padding:var(--dimension-space-075);border:var(--dimension-stroke-width-012) solid var(--color-border-tertiary);text-align:start;vertical-align:top;overflow-wrap:anywhere}.sc-ds-markdown:where(.ds-prose) :where(th):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{color:var(--color-foreground-primary);font-weight:var(--typography-weight-medium)}.sc-ds-markdown:where(.ds-prose) :where(img,video.sc-ds-markdown,svg).sc-ds-markdown:not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{max-inline-size:100%;block-size:auto}.sc-ds-markdown:where(.ds-prose) :where(figcaption):not(:where([data-ds-prose='off'],[data-ds-prose='off'] *)).sc-ds-markdown{margin-block-start:var(--dimension-space-050);color:var(--color-foreground-secondary);font-size:var(--typography-fontsize-sm);line-height:var(--typography-lineheight-sm);letter-spacing:var(--typography-letterspacing-none)}.sc-ds-markdown-h{display:block;min-width:0;color:inherit;box-sizing:border-box;-webkit-user-select:text;user-select:text}`;let p;function f(){p??(p=Promise.all([import("./p-BjtXYFhw.js"),import("./p-DVsje4AY.js"),import("./p-gidVv1FX.js")]).then((([e,s,r])=>({fromMarkdown:e.fromMarkdown,gfmFromMarkdown:s.gfmFromMarkdown,gfm:r.gfm}))));return p}const k=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.content="";this.streaming=false;this.tree=null;this.parseRevision=0}componentWillLoad(){if(typeof document!=="undefined")return this.parse()}disconnectedCallback(){this.parseRevision+=1;if(this.parseFrame&&typeof cancelAnimationFrame==="function"){cancelAnimationFrame(this.parseFrame)}}scheduleParse(){if(typeof requestAnimationFrame!=="function")return;if(this.parseFrame)cancelAnimationFrame(this.parseFrame);this.parseFrame=requestAnimationFrame((()=>{this.parseFrame=undefined;void this.parse()}))}async parse(){const e=++this.parseRevision;try{const{fromMarkdown:s,gfmFromMarkdown:r,gfm:o}=await f();const a=s(this.content,{extensions:[o()],mdastExtensions:[r()]});if(e===this.parseRevision)this.tree=a}catch{if(e===this.parseRevision)this.tree=null}}children(e){if(!("children"in e))return[];return e.children.map((e=>this.renderNode(e)))}renderNode(e){switch(e.type){case"root":return this.children(e);case"text":return r("span",{class:"markdown__text"},e.value);case"paragraph":return r("p",{class:"markdown__paragraph"},this.children(e));case"heading":{const s=`h${e.depth}`;return r(s,{class:"markdown__heading"},this.children(e))}case"strong":return r("strong",{class:"markdown__strong"},this.children(e));case"emphasis":return r("em",{class:"markdown__emphasis"},this.children(e));case"delete":return r("del",{class:"markdown__delete"},this.children(e));case"blockquote":return r("blockquote",{class:"markdown__blockquote"},this.children(e));case"break":return r("br",{class:"markdown__break"});case"thematicBreak":return r("hr",{class:"markdown__thematic-break"});case"inlineCode":return r("code",{class:"markdown__inline-code"},e.value);case"code":return r("ds-code-block",{class:"markdown__code-block","data-ds-prose":"off",code:e.value,language:e.lang??"",filename:e.meta??""});case"link":{const s=l(e.url,{protocols:["http:","https:","mailto:"]});return s?r("a",{class:"markdown__link",href:s,target:"_blank",rel:"noopener noreferrer"},this.children(e)):this.children(e)}case"list":{const s=e.ordered?"ol":"ul";return r(s,{class:"markdown__list",start:e.ordered&&e.start?e.start:undefined},this.children(e))}case"listItem":return r("li",{class:"markdown__list-item"},typeof e.checked==="boolean"?r("input",{class:"markdown__task-indicator",type:"checkbox",checked:e.checked,disabled:true,"aria-hidden":"true",tabIndex:-1}):null,this.children(e));case"table":{const[s,...o]=e.children;return r("div",{class:"markdown__table-wrap ds-prose__table-scroll",tabIndex:0},r("table",{class:"markdown__table"},s?r("thead",{class:"markdown__table-head"},r("tr",{class:"markdown__table-row"},s.children.map((e=>r("th",{class:"markdown__table-heading",scope:"col"},this.children(e)))))):null,r("tbody",{class:"markdown__table-body"},o.map((e=>this.renderNode(e))))))}case"tableRow":return r("tr",{class:"markdown__table-row"},this.children(e));case"tableCell":return r("td",{class:"markdown__table-cell"},this.children(e));case"image":{const s=l(e.url,{protocols:["http:","https:","mailto:"]});return s?r("a",{class:"markdown__image-link",href:s,target:"_blank",rel:"noopener noreferrer"},e.alt||"View image"):e.alt||null}case"html":case"definition":case"footnoteDefinition":return null;case"footnoteReference":return r("sup",{class:"markdown__footnote"},e.label);default:return this.children(e)}}render(){return r(o,{key:"4ab797718d8fbf26cfc08018b1cbaa4c5842350d","aria-busy":this.streaming?"true":undefined},r("div",{key:"71848a0b6e787f90d39e64e5a67d37918fa15074",class:"markdown ds-prose"},this.tree?this.renderNode(this.tree):r("p",{class:"markdown__paragraph"},r("span",{class:"markdown__text"},this.content))))}static get watchers(){return{content:[{scheduleParse:0}]}}static get style(){return w()}},[2,"ds-markdown",{content:[1],streaming:[4],tree:[32]},undefined,{content:[{scheduleParse:0}]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-markdown","ds-badge","ds-button-unfilled","ds-code-block","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-markdown":if(!customElements.get(a(e))){customElements.define(a(e),k)}break;case"ds-badge":if(!customElements.get(a(e))){d()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){n()}break;case"ds-code-block":if(!customElements.get(a(e))){t()}break;case"ds-icon":if(!customElements.get(a(e))){i()}break;case"ds-loader":if(!customElements.get(a(e))){c()}break;case"ds-text":if(!customElements.get(a(e))){h()}break;case"ds-tooltip":if(!customElements.get(a(e))){m()}break}}))}g();export{k as M,g as d};
2
+ //# sourceMappingURL=p-CoQSB3tl.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{d}from"./p-D8nnhQNJ.js";import{d as a}from"./p-BFfLvMZd.js";import{d as l}from"./p-CRi7P5gQ.js";import{d as h}from"./p-DgWGfscR.js";import{d as f}from"./p-Btxwp4lJ.js";import{d as u}from"./p-jMCRaxQW.js";import{d as v}from"./p-DZFilC--.js";function b(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 m=()=>`@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-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)}@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--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{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--expanded.sc-ds-mobile-section-switcher{background:var(--color-background-tertiary)}.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}`;let w=0;const g=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.dsChange=s(this,"dsChange");this.sections=[];this.value="";this.navigationLabel="Change page section";this.menuOpen=false;this.initialFocusVisible=false;this.instanceId=w++;this.triggerId=`ds-mobile-section-switcher-trigger-${this.instanceId}`;this.menuId=`ds-mobile-section-switcher-menu-${this.instanceId}`;this.triggerEl=null;this.toggleMenu=i=>{if(this.selectableSections.length<=1)return;this.initialFocusVisible=i.detail===0;this.menuOpen=!this.menuOpen};this.closeMenu=()=>{this.menuOpen=false};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);requestAnimationFrame((()=>this.triggerEl?.focus()))}}get resolvedSections(){return this.sections??[]}get selectableSections(){return r(this.resolvedSections)}get selectedIndex(){return b(this.resolvedSections,this.value).selectedIndex}get selectedSection(){return this.selectableSections[this.selectedIndex]}get hasPrevious(){return b(this.resolvedSections,this.value).hasPrevious}get hasNext(){return b(this.resolvedSections,this.value).hasNext}get triggerAriaLabel(){return`${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()}render(){const i=this.selectedSection;if(!i)return t(o,null);return t(o,null,t("button",{ref:i=>{this.triggerEl=i??null},id:this.triggerId,class:{"mobile-section-switcher":true,"mobile-section-switcher--expanded":this.menuOpen,"ds-focus-ring-inset":true,"ds-interaction-fill":true},type:"button","aria-haspopup":"menu","aria-controls":this.menuId,"aria-expanded":String(this.menuOpen),"aria-label":this.triggerAriaLabel,onClick:this.toggleMenu},t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasPrevious,"ds-interaction-fill__content":true},"aria-hidden":"true"}),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),t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasNext,"ds-interaction-fill__content":true},"aria-hidden":"true"})),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,onDsSelect:this.handleSelect}):null)}get el(){return this}static get watchers(){return{sections:[{handleSectionsChange:0}]}}static get style(){return m()}},[2,"ds-mobile-section-switcher",{sections:[16],value:[1],navigationLabel:[1,"navigation-label"],menuOpen:[32],initialFocusVisible:[32]},undefined,{sections:[{handleSectionsChange:0}]}]);function p(){if(typeof customElements==="undefined"){return}const i=["ds-mobile-section-switcher","ds-badge","ds-icon","ds-menu","ds-swatch-picker","ds-switch","ds-tag","ds-text"];i.forEach((i=>{switch(i){case"ds-mobile-section-switcher":if(!customElements.get(n(i))){customElements.define(n(i),g)}break;case"ds-badge":if(!customElements.get(n(i))){d()}break;case"ds-icon":if(!customElements.get(n(i))){a()}break;case"ds-menu":if(!customElements.get(n(i))){l()}break;case"ds-swatch-picker":if(!customElements.get(n(i))){h()}break;case"ds-switch":if(!customElements.get(n(i))){f()}break;case"ds-tag":if(!customElements.get(n(i))){u()}break;case"ds-text":if(!customElements.get(n(i))){v()}break}}))}p();export{g as M,p as d};
2
- //# sourceMappingURL=p-CCpJcSTE.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{d}from"./p-D8nnhQNJ.js";import{d as a}from"./p-BFfLvMZd.js";import{d as l}from"./p-BiTwXttN.js";import{d as h}from"./p-DgWGfscR.js";import{d as f}from"./p-Btxwp4lJ.js";import{d as u}from"./p-jMCRaxQW.js";import{d as v}from"./p-DZFilC--.js";function b(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 m=()=>`@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-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)}@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--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{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--expanded.sc-ds-mobile-section-switcher{background:var(--color-background-tertiary)}.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}`;let w=0;const g=i(class i extends e{constructor(i){super();if(i!==false){this.__registerHost()}this.dsChange=s(this,"dsChange");this.sections=[];this.value="";this.navigationLabel="Change page section";this.menuOpen=false;this.initialFocusVisible=false;this.instanceId=w++;this.triggerId=`ds-mobile-section-switcher-trigger-${this.instanceId}`;this.menuId=`ds-mobile-section-switcher-menu-${this.instanceId}`;this.triggerEl=null;this.toggleMenu=i=>{if(this.selectableSections.length<=1)return;this.initialFocusVisible=i.detail===0;this.menuOpen=!this.menuOpen};this.closeMenu=()=>{this.menuOpen=false};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);requestAnimationFrame((()=>this.triggerEl?.focus()))}}get resolvedSections(){return this.sections??[]}get selectableSections(){return r(this.resolvedSections)}get selectedIndex(){return b(this.resolvedSections,this.value).selectedIndex}get selectedSection(){return this.selectableSections[this.selectedIndex]}get hasPrevious(){return b(this.resolvedSections,this.value).hasPrevious}get hasNext(){return b(this.resolvedSections,this.value).hasNext}get triggerAriaLabel(){return`${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()}render(){const i=this.selectedSection;if(!i)return t(o,null);return t(o,null,t("button",{ref:i=>{this.triggerEl=i??null},id:this.triggerId,class:{"mobile-section-switcher":true,"mobile-section-switcher--expanded":this.menuOpen,"ds-focus-ring-inset":true,"ds-interaction-fill":true},type:"button","aria-haspopup":"menu","aria-controls":this.menuId,"aria-expanded":String(this.menuOpen),"aria-label":this.triggerAriaLabel,onClick:this.toggleMenu},t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasPrevious,"ds-interaction-fill__content":true},"aria-hidden":"true"}),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),t("span",{class:{"mobile-section-switcher__position":true,"mobile-section-switcher__position--visible":this.hasNext,"ds-interaction-fill__content":true},"aria-hidden":"true"})),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,onDsSelect:this.handleSelect}):null)}get el(){return this}static get watchers(){return{sections:[{handleSectionsChange:0}]}}static get style(){return m()}},[2,"ds-mobile-section-switcher",{sections:[16],value:[1],navigationLabel:[1,"navigation-label"],menuOpen:[32],initialFocusVisible:[32]},undefined,{sections:[{handleSectionsChange:0}]}]);function p(){if(typeof customElements==="undefined"){return}const i=["ds-mobile-section-switcher","ds-badge","ds-icon","ds-menu","ds-swatch-picker","ds-switch","ds-tag","ds-text"];i.forEach((i=>{switch(i){case"ds-mobile-section-switcher":if(!customElements.get(n(i))){customElements.define(n(i),g)}break;case"ds-badge":if(!customElements.get(n(i))){d()}break;case"ds-icon":if(!customElements.get(n(i))){a()}break;case"ds-menu":if(!customElements.get(n(i))){l()}break;case"ds-swatch-picker":if(!customElements.get(n(i))){h()}break;case"ds-switch":if(!customElements.get(n(i))){f()}break;case"ds-tag":if(!customElements.get(n(i))){u()}break;case"ds-text":if(!customElements.get(n(i))){v()}break}}))}p();export{g as M,p as d};
2
+ //# sourceMappingURL=p-CqbMoVDQ.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as o,c as s,h as n,a as d,t as a}from"./index.js";import{d as i}from"./p-D8nnhQNJ.js";import{d as l}from"./p-CTTDiW33.js";import{d as r}from"./p-BFfLvMZd.js";import{d as t}from"./p-Ca-I2UnB.js";import{d as c}from"./p-DZFilC--.js";import{d as h}from"./p-BXPQmp7q.js";const p=()=>`.ds-control--lg.sc-ds-panel-tool-header,.ds-control--lg.sc-ds-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header,.ds-control--sm.sc-ds-panel-tool-header-h,.ds-control--sm.sc-ds-panel-tool-header,.ds-control--xs.sc-ds-panel-tool-header-h,.ds-control--xs.sc-ds-panel-tool-header{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-panel-tool-header-h,.ds-control--lg.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--sm.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--xs.sc-ds-panel-tool-header{--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--lg.sc-ds-panel-tool-header,.ds-control--lg.sc-ds-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header,.ds-control--sm.sc-ds-panel-tool-header-h,.ds-control--sm.sc-ds-panel-tool-header,.ds-control--xs.sc-ds-panel-tool-header-h,.ds-control--xs.sc-ds-panel-tool-header{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-panel-tool-header-h,.ds-control--lg.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--sm.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--xs.sc-ds-panel-tool-header{--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-chrome-header.sc-ds-panel-tool-header{display:flex;align-items:center;box-sizing:border-box;min-width:0;min-block-size:var(--dimension-size-600);padding:var(--dimension-space-100);gap:var(--dimension-space-100)}.ds-chrome-header--wrapping.sc-ds-panel-tool-header{flex-wrap:wrap}.ds-chrome-header--bounded.sc-ds-panel-tool-header{border-block-end:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.ds-chrome-header__leading.sc-ds-panel-tool-header,.ds-chrome-header__trailing.sc-ds-panel-tool-header{display:flex;align-items:center;flex:0 0 auto;min-width:0}.ds-chrome-header__trailing.sc-ds-panel-tool-header{margin-inline-start:auto;gap:var(--dimension-space-100)}.ds-chrome-header__copy.sc-ds-panel-tool-header{display:flex;flex:1 1 0;min-width:0;padding:var(--ds-control-padding-inline, var(--dimension-space-075));box-sizing:border-box}.ds-chrome-header__copy--wrapping.sc-ds-panel-tool-header{align-items:baseline;flex-wrap:wrap;column-gap:var(--dimension-space-100);row-gap:var(--dimension-space-050)}.ds-chrome-header__copy--stacked.sc-ds-panel-tool-header{align-items:stretch;flex-direction:column;gap:var(--dimension-space-050)}.ds-chrome-header__heading.sc-ds-panel-tool-header,.ds-chrome-header__description.sc-ds-panel-tool-header{width:auto;min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025));box-sizing:border-box}.ds-chrome-header__heading.sc-ds-panel-tool-header{flex:0 1 auto}.ds-chrome-header__copy--wrapping.sc-ds-panel-tool-header .ds-chrome-header__description.sc-ds-panel-tool-header{flex:1 1 var(--dimension-card-width-xs)}.sc-ds-panel-tool-header-h{display:block;flex:0 0 auto;box-sizing:border-box}.panel-tool-header.sc-ds-panel-tool-header{height:var(--dimension-size-600);color:var(--color-foreground-primary);-webkit-user-select:none;user-select:none}.panel-tool-header__leading.sc-ds-panel-tool-header:empty,.panel-tool-header__trailing.sc-ds-panel-tool-header:empty{display:none}.panel-tool-header__trailing.sc-ds-panel-tool-header{gap:var(--dimension-space-050);justify-content:flex-end}ds-text.panel-tool-header__heading.sc-ds-panel-tool-header{display:inline-flex;flex:1 1 0;align-items:center;width:auto;min-width:0;height:var(--ds-control-height);padding-inline:calc(var(--ds-control-padding-inline) + var(--ds-control-label-inset));box-sizing:border-box;text-align:left;-webkit-user-select:none;user-select:none}`;const m=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.dsBack=s(this,"dsBack");this.dsMenuToggle=s(this,"dsMenuToggle");this.dsAction=s(this,"dsAction");this.heading="";this.showBack=false;this.backIcon="ChevronLeft";this.backAriaLabel="Back";this.showMenu=true;this.menuAriaLabel="More options";this.menuTriggerId="";this.menuExpanded=false;this.actions=[]}async focusMenuTrigger(){const e=this.el.querySelector('ds-button-unfilled.panel-tool-header__menu, ds-button-unfilled[data-header-action-id="menu"]');await(e?.setFocus?.())}render(){const e=this.actions.length>0;const o=e?this.actions:this.showMenu?[{id:"menu",icon:"Ellipses",ariaLabel:this.menuAriaLabel,triggerId:this.menuTriggerId,controls:this.menuControls,expanded:this.menuExpanded,haspopup:"menu"}]:[];return n(d,{key:"9c128beb4998803a9089246589cfa1abab8072e7"},n("header",{key:"022b77b0e3b5b6361efadcf5d7acc91b5519df7b",class:"panel-tool-header ds-chrome-header ds-chrome-header--bounded"},n("div",{key:"1fe38e1c98880514d80351ec132a7f272d3606f3",class:"panel-tool-header__leading ds-chrome-header__leading"},this.showBack?n("ds-tooltip",{label:this.backAriaLabel,side:"bottom",size:"sm"},n("ds-button-unfilled",{class:"panel-tool-header__back",variant:"icon",icon:this.backIcon,size:"md","aria-label":this.backAriaLabel,activeFill:false,hasBorder:false,onDsClick:e=>this.dsBack.emit(e.detail)})):null),n("ds-text",{key:"8a96d1bf07bda02a09b8f74301597b4f00c6a2cb",class:"panel-tool-header__heading ds-chrome-header__heading ds-control--md",as:"h2",variant:"text-body-medium",emphasis:true,color:"primary",lineTruncation:1},this.heading),n("div",{key:"ac1ddd269b5ccc1739b0df3fdd665398a727d985",class:"panel-tool-header__trailing ds-chrome-header__trailing"},o.map((o=>n("ds-tooltip",{key:o.id,label:o.ariaLabel,side:"bottom",size:"sm"},n("ds-button-unfilled",{id:o.triggerId||undefined,"data-header-action-id":o.id,class:{"panel-tool-header__action":true,"panel-tool-header__menu":o.id==="menu"},variant:"icon",icon:o.icon,size:"md","aria-label":o.ariaLabel,haspopup:o.haspopup,controls:o.controls,expanded:o.expanded,pressed:o.pressed,isInactive:o.isInactive,activeFill:false,hasBorder:false,onDsClick:s=>{if(!e&&o.id==="menu")this.dsMenuToggle.emit(s.detail);this.dsAction.emit({id:o.id,originalEvent:s.detail})}})))))))}get el(){return this}static get style(){return p()}},[2,"ds-panel-tool-header",{heading:[1],showBack:[4,"show-back"],backIcon:[1,"back-icon"],backAriaLabel:[1,"back-aria-label"],showMenu:[4,"show-menu"],menuAriaLabel:[1,"menu-aria-label"],menuTriggerId:[1,"menu-trigger-id"],menuControls:[1,"menu-controls"],menuExpanded:[4,"menu-expanded"],actions:[16],focusMenuTrigger:[64]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-panel-tool-header","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-panel-tool-header":if(!customElements.get(a(e))){customElements.define(a(e),m)}break;case"ds-badge":if(!customElements.get(a(e))){i()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){l()}break;case"ds-icon":if(!customElements.get(a(e))){r()}break;case"ds-loader":if(!customElements.get(a(e))){t()}break;case"ds-text":if(!customElements.get(a(e))){c()}break;case"ds-tooltip":if(!customElements.get(a(e))){h()}break}}))}g();export{m as P,g as d};
2
- //# sourceMappingURL=p-DJ-n-gyr.js.map
1
+ import{p as e,H as o,c as s,h as n,a as d,t as a}from"./index.js";import{d as i}from"./p-D8nnhQNJ.js";import{d as l}from"./p-c_5SXjwx.js";import{d as r}from"./p-BFfLvMZd.js";import{d as t}from"./p-Ca-I2UnB.js";import{d as c}from"./p-DZFilC--.js";import{d as h}from"./p-BXPQmp7q.js";const p=()=>`.ds-control--lg.sc-ds-panel-tool-header,.ds-control--lg.sc-ds-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header,.ds-control--sm.sc-ds-panel-tool-header-h,.ds-control--sm.sc-ds-panel-tool-header,.ds-control--xs.sc-ds-panel-tool-header-h,.ds-control--xs.sc-ds-panel-tool-header{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-panel-tool-header-h,.ds-control--lg.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--sm.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--xs.sc-ds-panel-tool-header{--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--lg.sc-ds-panel-tool-header,.ds-control--lg.sc-ds-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header,.ds-control--sm.sc-ds-panel-tool-header-h,.ds-control--sm.sc-ds-panel-tool-header,.ds-control--xs.sc-ds-panel-tool-header-h,.ds-control--xs.sc-ds-panel-tool-header{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-panel-tool-header-h,.ds-control--lg.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--md.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--sm.sc-ds-panel-tool-header{--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-panel-tool-header-h,.ds-control--xs.sc-ds-panel-tool-header{--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-chrome-header.sc-ds-panel-tool-header{display:flex;align-items:center;box-sizing:border-box;min-width:0;min-block-size:var(--dimension-size-600);padding:var(--dimension-space-100);gap:var(--dimension-space-100)}.ds-chrome-header--wrapping.sc-ds-panel-tool-header{flex-wrap:wrap}.ds-chrome-header--bounded.sc-ds-panel-tool-header{border-block-end:var(--dimension-stroke-width-012) solid var(--color-border-tertiary)}.ds-chrome-header__leading.sc-ds-panel-tool-header,.ds-chrome-header__trailing.sc-ds-panel-tool-header{display:flex;align-items:center;flex:0 0 auto;min-width:0}.ds-chrome-header__trailing.sc-ds-panel-tool-header{margin-inline-start:auto;gap:var(--dimension-space-100)}.ds-chrome-header__copy.sc-ds-panel-tool-header{display:flex;flex:1 1 0;min-width:0;padding:var(--ds-control-padding-inline, var(--dimension-space-075));box-sizing:border-box}.ds-chrome-header__copy--wrapping.sc-ds-panel-tool-header{align-items:baseline;flex-wrap:wrap;column-gap:var(--dimension-space-100);row-gap:var(--dimension-space-050)}.ds-chrome-header__copy--stacked.sc-ds-panel-tool-header{align-items:stretch;flex-direction:column;gap:var(--dimension-space-050)}.ds-chrome-header__heading.sc-ds-panel-tool-header,.ds-chrome-header__description.sc-ds-panel-tool-header{width:auto;min-width:0;padding-inline:var(--ds-control-label-inset, var(--dimension-space-025));box-sizing:border-box}.ds-chrome-header__heading.sc-ds-panel-tool-header{flex:0 1 auto}.ds-chrome-header__copy--wrapping.sc-ds-panel-tool-header .ds-chrome-header__description.sc-ds-panel-tool-header{flex:1 1 var(--dimension-card-width-xs)}.sc-ds-panel-tool-header-h{display:block;flex:0 0 auto;box-sizing:border-box}.panel-tool-header.sc-ds-panel-tool-header{height:var(--dimension-size-600);color:var(--color-foreground-primary);-webkit-user-select:none;user-select:none}.panel-tool-header__leading.sc-ds-panel-tool-header:empty,.panel-tool-header__trailing.sc-ds-panel-tool-header:empty{display:none}.panel-tool-header__trailing.sc-ds-panel-tool-header{gap:var(--dimension-space-050);justify-content:flex-end}ds-text.panel-tool-header__heading.sc-ds-panel-tool-header{display:inline-flex;flex:1 1 0;align-items:center;width:auto;min-width:0;height:var(--ds-control-height);padding-inline:calc(var(--ds-control-padding-inline) + var(--ds-control-label-inset));box-sizing:border-box;text-align:left;-webkit-user-select:none;user-select:none}`;const m=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.dsBack=s(this,"dsBack");this.dsMenuToggle=s(this,"dsMenuToggle");this.dsAction=s(this,"dsAction");this.heading="";this.showBack=false;this.backIcon="ChevronLeft";this.backAriaLabel="Back";this.showMenu=true;this.menuAriaLabel="More options";this.menuTriggerId="";this.menuExpanded=false;this.actions=[]}async focusMenuTrigger(){const e=this.el.querySelector('ds-button-unfilled.panel-tool-header__menu, ds-button-unfilled[data-header-action-id="menu"]');await(e?.setFocus?.())}render(){const e=this.actions.length>0;const o=e?this.actions:this.showMenu?[{id:"menu",icon:"Ellipses",ariaLabel:this.menuAriaLabel,triggerId:this.menuTriggerId,controls:this.menuControls,expanded:this.menuExpanded,haspopup:"menu"}]:[];return n(d,{key:"9c128beb4998803a9089246589cfa1abab8072e7"},n("header",{key:"022b77b0e3b5b6361efadcf5d7acc91b5519df7b",class:"panel-tool-header ds-chrome-header ds-chrome-header--bounded"},n("div",{key:"1fe38e1c98880514d80351ec132a7f272d3606f3",class:"panel-tool-header__leading ds-chrome-header__leading"},this.showBack?n("ds-tooltip",{label:this.backAriaLabel,side:"bottom",size:"sm"},n("ds-button-unfilled",{class:"panel-tool-header__back",variant:"icon",icon:this.backIcon,size:"md","aria-label":this.backAriaLabel,activeFill:false,hasBorder:false,onDsClick:e=>this.dsBack.emit(e.detail)})):null),n("ds-text",{key:"8a96d1bf07bda02a09b8f74301597b4f00c6a2cb",class:"panel-tool-header__heading ds-chrome-header__heading ds-control--md",as:"h2",variant:"text-body-medium",emphasis:true,color:"primary",lineTruncation:1},this.heading),n("div",{key:"ac1ddd269b5ccc1739b0df3fdd665398a727d985",class:"panel-tool-header__trailing ds-chrome-header__trailing"},o.map((o=>n("ds-tooltip",{key:o.id,label:o.ariaLabel,side:"bottom",size:"sm"},n("ds-button-unfilled",{id:o.triggerId||undefined,"data-header-action-id":o.id,class:{"panel-tool-header__action":true,"panel-tool-header__menu":o.id==="menu"},variant:"icon",icon:o.icon,size:"md","aria-label":o.ariaLabel,haspopup:o.haspopup,controls:o.controls,expanded:o.expanded,pressed:o.pressed,isInactive:o.isInactive,activeFill:false,hasBorder:false,onDsClick:s=>{if(!e&&o.id==="menu")this.dsMenuToggle.emit(s.detail);this.dsAction.emit({id:o.id,originalEvent:s.detail})}})))))))}get el(){return this}static get style(){return p()}},[2,"ds-panel-tool-header",{heading:[1],showBack:[4,"show-back"],backIcon:[1,"back-icon"],backAriaLabel:[1,"back-aria-label"],showMenu:[4,"show-menu"],menuAriaLabel:[1,"menu-aria-label"],menuTriggerId:[1,"menu-trigger-id"],menuControls:[1,"menu-controls"],menuExpanded:[4,"menu-expanded"],actions:[16],focusMenuTrigger:[64]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-panel-tool-header","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-panel-tool-header":if(!customElements.get(a(e))){customElements.define(a(e),m)}break;case"ds-badge":if(!customElements.get(a(e))){i()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){l()}break;case"ds-icon":if(!customElements.get(a(e))){r()}break;case"ds-loader":if(!customElements.get(a(e))){t()}break;case"ds-text":if(!customElements.get(a(e))){c()}break;case"ds-tooltip":if(!customElements.get(a(e))){h()}break}}))}g();export{m as P,g as d};
2
+ //# sourceMappingURL=p-CvwtYbmh.js.map
@@ -1,2 +1,2 @@
1
1
  function n(n,t){return t.length>0?t:[{options:n}]}function t(n){return n.flatMap((n=>n.options))}function i(n){return n.length>0&&n.every((n=>Boolean(n.icon)))}function o(n){return n.some((n=>Boolean(n.subtext?.trim())))}function r(n,t){const i=t.trim().toLocaleLowerCase();if(!i)return n;return n.map((n=>{const t=n.header?.toLocaleLowerCase().includes(i);return{...n,options:t?n.options:n.options.filter((n=>`${n.label} ${n.subtext??""}`.toLocaleLowerCase().includes(i)))}})).filter((n=>n.options.length>0))}function e(n){return n.map(((n,t)=>({option:n,index:t}))).filter((({option:n})=>!n.isInactive)).map((({index:n})=>n))}function a(n,t,i){const o=e(n);if(!o.length)return-1;const r=o.indexOf(t);const a=r>=0?r:i===1?-1:0;return o[(a+i+o.length)%o.length]}function s(n,t,i){const o=t.toLocaleLowerCase();if(!o)return-1;for(let t=1;t<=n.length;t+=1){const r=(Math.max(i,-1)+t)%n.length;const e=n[r];if(!e.isInactive&&e.label.toLocaleLowerCase().startsWith(o))return r}return-1}function c(n){return{"ds-interaction-fill--on-faint":n==="faint","ds-interaction-fill--on-medium":n==="medium","ds-interaction-fill--on-bold":n==="bold","ds-interaction-fill--on-strong":n==="strong","ds-interaction-fill--on-translucent":n==="translucent","ds-interaction-fill--on-inverted":n==="inverted","ds-interaction-fill--on-media":n==="media","ds-interaction-fill--on-always-dark":n==="always-dark"}}export{t as a,r as b,o as c,i as d,e,s as f,c as g,a as m,n as r};
2
- //# sourceMappingURL=p-BAgjMUt3.js.map
2
+ //# sourceMappingURL=p-Cxr0IQjC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["resolveChoiceSections","options","sections","length","flattenChoiceSections","flatMap","section","choiceListUsesIcons","every","option","Boolean","icon","choiceListUsesSubtext","some","subtext","trim","filterChoiceSections","searchTerm","normalized","toLocaleLowerCase","map","sectionMatches","header","includes","filter","label","enabledChoiceIndexes","index","isInactive","moveChoiceIndex","currentIndex","direction","enabled","currentEnabledIndex","indexOf","start","findChoiceTypeaheadMatch","query","offset","Math","max","startsWith","choiceBackgroundClassMap","background"],"sources":["src/wc/utils/choice-list.ts"],"sourcesContent":["export interface ChoiceOption {\n label: string;\n value: string;\n subtext?: string;\n /** Rendered only when every option in the complete list supplies an icon. */\n icon?: string;\n isInactive?: boolean;\n /** Optional contextual action shown at the trailing edge of this option. */\n action?: ChoiceOptionAction;\n /** Optional compact actions rendered as supporting content beneath the option label. */\n subtextActions?: ChoiceOptionSubtextAction[];\n}\n\nexport interface ChoiceOptionSubtextAction {\n label: string;\n value: string;\n tone?: 'action' | 'negative';\n}\n\nexport interface ChoiceOptionAction {\n /** Accessible name for the fixed ellipsis action. */\n label: string;\n /** ID of the popup controlled by the action. */\n controls?: string;\n /** Keep the action visible and expose its controlled popup state. */\n expanded?: boolean;\n}\n\nexport interface ChoiceSection {\n header?: string;\n options: ChoiceOption[];\n divider?: boolean;\n}\n\nexport type ChoiceBackground =\n | 'faint'\n | 'medium'\n | 'bold'\n | 'strong'\n | 'translucent'\n | 'inverted'\n | 'media'\n | 'always-dark';\n\nexport function resolveChoiceSections(\n options: ChoiceOption[],\n sections: ChoiceSection[],\n): ChoiceSection[] {\n return sections.length > 0 ? sections : [{ options }];\n}\n\nexport function flattenChoiceSections(sections: ChoiceSection[]): ChoiceOption[] {\n return sections.flatMap(section => section.options);\n}\n\n/** A choice list has one stable row layout: every option has an icon, or none do. */\nexport function choiceListUsesIcons(options: ChoiceOption[]): boolean {\n return options.length > 0 && options.every(option => Boolean(option.icon));\n}\n\n/** Descriptive subtext gives the complete list one stable two-line row layout. */\nexport function choiceListUsesSubtext(options: ChoiceOption[]): boolean {\n return options.some(option => Boolean(option.subtext?.trim()));\n}\n\nexport function filterChoiceSections(\n sections: ChoiceSection[],\n searchTerm: string,\n): ChoiceSection[] {\n const normalized = searchTerm.trim().toLocaleLowerCase();\n if (!normalized) return sections;\n\n return sections\n .map(section => {\n const sectionMatches = section.header?.toLocaleLowerCase().includes(normalized);\n return {\n ...section,\n options: sectionMatches\n ? section.options\n : section.options.filter(option =>\n `${option.label} ${option.subtext ?? ''}`.toLocaleLowerCase().includes(normalized),\n ),\n };\n })\n .filter(section => section.options.length > 0);\n}\n\nexport function enabledChoiceIndexes(options: ChoiceOption[]): number[] {\n return options\n .map((option, index) => ({ option, index }))\n .filter(({ option }) => !option.isInactive)\n .map(({ index }) => index);\n}\n\nexport function moveChoiceIndex(\n options: ChoiceOption[],\n currentIndex: number,\n direction: 1 | -1,\n): number {\n const enabled = enabledChoiceIndexes(options);\n if (!enabled.length) return -1;\n\n const currentEnabledIndex = enabled.indexOf(currentIndex);\n const start = currentEnabledIndex >= 0 ? currentEnabledIndex : direction === 1 ? -1 : 0;\n return enabled[(start + direction + enabled.length) % enabled.length];\n}\n\nexport function findChoiceTypeaheadMatch(\n options: ChoiceOption[],\n query: string,\n currentIndex: number,\n): number {\n const normalized = query.toLocaleLowerCase();\n if (!normalized) return -1;\n\n for (let offset = 1; offset <= options.length; offset += 1) {\n const index = (Math.max(currentIndex, -1) + offset) % options.length;\n const option = options[index];\n if (!option.isInactive && option.label.toLocaleLowerCase().startsWith(normalized)) return index;\n }\n return -1;\n}\n\nexport function choiceBackgroundClassMap(\n background: ChoiceBackground | undefined,\n): Record<string, boolean> {\n return {\n 'ds-interaction-fill--on-faint': background === 'faint',\n 'ds-interaction-fill--on-medium': background === 'medium',\n 'ds-interaction-fill--on-bold': background === 'bold',\n 'ds-interaction-fill--on-strong': background === 'strong',\n 'ds-interaction-fill--on-translucent': background === 'translucent',\n 'ds-interaction-fill--on-inverted': background === 'inverted',\n 'ds-interaction-fill--on-media': background === 'media',\n 'ds-interaction-fill--on-always-dark': background === 'always-dark',\n };\n}\n"],"mappings":"AA4CM,SAAUA,EACdC,EACAC,GAEA,OAAOA,EAASC,OAAS,EAAID,EAAW,CAAC,CAAED,WAC7C,CAEM,SAAUG,EAAsBF,GACpC,OAAOA,EAASG,SAAQC,GAAWA,EAAQL,SAC7C,CAGM,SAAUM,EAAoBN,GAClC,OAAOA,EAAQE,OAAS,GAAKF,EAAQO,OAAMC,GAAUC,QAAQD,EAAOE,OACtE,CAGM,SAAUC,EAAsBX,GACpC,OAAOA,EAAQY,MAAKJ,GAAUC,QAAQD,EAAOK,SAASC,SACxD,CAEM,SAAUC,EACdd,EACAe,GAEA,MAAMC,EAAaD,EAAWF,OAAOI,oBACrC,IAAKD,EAAY,OAAOhB,EAExB,OAAOA,EACJkB,KAAId,IACH,MAAMe,EAAiBf,EAAQgB,QAAQH,oBAAoBI,SAASL,GACpE,MAAO,IACFZ,EACHL,QAASoB,EACLf,EAAQL,QACRK,EAAQL,QAAQuB,QAAOf,GACvB,GAAGA,EAAOgB,SAAShB,EAAOK,SAAW,KAAKK,oBAAoBI,SAASL,KAE5E,IAEFM,QAAOlB,GAAWA,EAAQL,QAAQE,OAAS,GAChD,CAEM,SAAUuB,EAAqBzB,GACnC,OAAOA,EACJmB,KAAI,CAACX,EAAQkB,KAAK,CAAQlB,SAAQkB,YAClCH,QAAO,EAAGf,aAAcA,EAAOmB,aAC/BR,KAAI,EAAGO,WAAYA,GACxB,C,SAEgBE,EACd5B,EACA6B,EACAC,GAEA,MAAMC,EAAUN,EAAqBzB,GACrC,IAAK+B,EAAQ7B,OAAQ,OAAO,EAE5B,MAAM8B,EAAsBD,EAAQE,QAAQJ,GAC5C,MAAMK,EAAQF,GAAuB,EAAIA,EAAsBF,IAAc,GAAI,EAAK,EACtF,OAAOC,GAASG,EAAQJ,EAAYC,EAAQ7B,QAAU6B,EAAQ7B,OAChE,C,SAEgBiC,EACdnC,EACAoC,EACAP,GAEA,MAAMZ,EAAamB,EAAMlB,oBACzB,IAAKD,EAAY,OAAO,EAExB,IAAK,IAAIoB,EAAS,EAAGA,GAAUrC,EAAQE,OAAQmC,GAAU,EAAG,CAC1D,MAAMX,GAASY,KAAKC,IAAIV,GAAc,GAAMQ,GAAUrC,EAAQE,OAC9D,MAAMM,EAASR,EAAQ0B,GACvB,IAAKlB,EAAOmB,YAAcnB,EAAOgB,MAAMN,oBAAoBsB,WAAWvB,GAAa,OAAOS,C,CAE5F,OAAO,CACT,CAEM,SAAUe,EACdC,GAEA,MAAO,CACL,gCAAiCA,IAAe,QAChD,iCAAkCA,IAAe,SACjD,+BAAgCA,IAAe,OAC/C,iCAAkCA,IAAe,SACjD,sCAAuCA,IAAe,cACtD,mCAAoCA,IAAe,WACnD,gCAAiCA,IAAe,QAChD,sCAAuCA,IAAe,cAE1D,Q","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{p as e,H as i,c as s,h as o,a as n,t}from"./index.js";import{d as r}from"./p-Dcnd5ZX5.js";import{d as a}from"./p-D8nnhQNJ.js";import{d}from"./p-CTTDiW33.js";import{d as c}from"./p-BFfLvMZd.js";import{d as l}from"./p-Ca-I2UnB.js";import{d as h}from"./p-CbfmzgdW.js";import{d as v}from"./p-DZFilC--.js";import{d as m}from"./p-BXPQmp7q.js";const b=()=>`.ds-control--lg.sc-ds-mobile-sheet-nav,.ds-control--lg.sc-ds-mobile-sheet-nav-h,.ds-control--md.sc-ds-mobile-sheet-nav-h,.ds-control--md.sc-ds-mobile-sheet-nav,.ds-control--sm.sc-ds-mobile-sheet-nav-h,.ds-control--sm.sc-ds-mobile-sheet-nav,.ds-control--xs.sc-ds-mobile-sheet-nav-h,.ds-control--xs.sc-ds-mobile-sheet-nav{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-mobile-sheet-nav-h,.ds-control--lg.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-control--md.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-control--sm.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-control--xs.sc-ds-mobile-sheet-nav{--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-chrome-space--sm.sc-ds-mobile-sheet-nav-h,.ds-chrome-space--sm.sc-ds-mobile-sheet-nav{--ds-chrome-padding:var(--dimension-space-050);--ds-chrome-gap:var(--dimension-space-050)}.ds-chrome-space--md.sc-ds-mobile-sheet-nav-h,.ds-chrome-space--md.sc-ds-mobile-sheet-nav{--ds-chrome-padding:var(--dimension-space-100);--ds-chrome-gap:var(--dimension-space-100)}.ds-chrome-space--lg.sc-ds-mobile-sheet-nav-h,.ds-chrome-space--lg.sc-ds-mobile-sheet-nav{--ds-chrome-padding:var(--dimension-space-200);--ds-chrome-gap:var(--dimension-space-200)}.ds-chrome-row.sc-ds-mobile-sheet-nav-h,.ds-chrome-row.sc-ds-mobile-sheet-nav,.ds-chrome-column.sc-ds-mobile-sheet-nav-h,.ds-chrome-column.sc-ds-mobile-sheet-nav,.ds-chrome-grid.sc-ds-mobile-sheet-nav-h,.ds-chrome-grid.sc-ds-mobile-sheet-nav{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-mobile-sheet-nav-h,.ds-chrome-row.sc-ds-mobile-sheet-nav{flex-direction:row;align-items:center}.ds-chrome-column.sc-ds-mobile-sheet-nav-h,.ds-chrome-column.sc-ds-mobile-sheet-nav{flex-direction:column}.ds-chrome-grid.sc-ds-mobile-sheet-nav-h,.ds-chrome-grid.sc-ds-mobile-sheet-nav{display:grid;align-items:center}@media (forced-colors: active){.sc-ds-mobile-sheet-nav:root,.sc-ds-mobile-sheet-nav-h,.ds-forced-colors-scope.sc-ds-mobile-sheet-nav{--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-sheet-nav-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-sheet-nav-h,.ds-focus-ring.sc-ds-mobile-sheet-nav,.ds-focus-ring-inset.sc-ds-mobile-sheet-nav-h,.ds-focus-ring-inset.sc-ds-mobile-sheet-nav{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-mobile-sheet-nav-h:focus-visible,.ds-focus-ring.sc-ds-mobile-sheet-nav: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-sheet-nav-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-mobile-sheet-nav{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-sheet-nav-h:focus-visible,.ds-focus-ring-inset.sc-ds-mobile-sheet-nav:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-mobile-sheet-nav-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-mobile-sheet-nav: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-sheet-nav-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-sheet-nav{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-sheet-nav-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-sheet-nav::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-sheet-nav-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-mobile-sheet-nav:root,.sc-ds-mobile-sheet-nav-h,.ds-forced-colors-scope.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill.sc-ds-mobile-sheet-nav{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-sheet-nav-h::before,.ds-interaction-fill.sc-ds-mobile-sheet-nav::before,.ds-interaction-fill.sc-ds-mobile-sheet-nav-h::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-mobile-sheet-nav-h::before,.ds-interaction-fill.sc-ds-mobile-sheet-nav::before{z-index:1}.ds-interaction-fill.sc-ds-mobile-sheet-nav-h::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav::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-sheet-nav-h,.ds-interaction-fill--bordered.sc-ds-mobile-sheet-nav{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav-h::before,.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-mobile-sheet-nav-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-mobile-sheet-nav-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav-h::after,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav::after,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav{--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-sheet-nav-h>.ds-interaction-fill__content.sc-ds-mobile-sheet-nav,.ds-interaction-fill.sc-ds-mobile-sheet-nav>.ds-interaction-fill__content.sc-ds-mobile-sheet-nav,.ds-interaction-fill__content.sc-ds-mobile-sheet-nav{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--on-faint.sc-ds-mobile-sheet-nav{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--on-medium.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-bold.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-strong.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-translucent.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-inverted.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-media.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-always-dark.sc-ds-mobile-sheet-nav{--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-navigation.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--on-navigation.sc-ds-mobile-sheet-nav{--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)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-mobile-sheet-nav-h::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav::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--selected.sc-ds-mobile-sheet-nav-h::before,.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav::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-sheet-nav-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav: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-sheet-nav-h{display:block;min-width:0;min-height:0;height:100%;background:var(--color-background-primary)}.sc-ds-mobile-sheet-nav-h:not([open]){display:none}.mobile-sheet-nav.sc-ds-mobile-sheet-nav{display:grid;grid-template-rows:auto minmax(0, 1fr);height:100%;min-height:0;background:var(--color-background-primary)}.mobile-sheet-nav__header.sc-ds-mobile-sheet-nav{position:relative;grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr)}.mobile-sheet-nav__header--expanded-context.sc-ds-mobile-sheet-nav{grid-template-columns:minmax(var(--dimension-size-500), 1fr) minmax(0, 4fr) minmax(var(--dimension-size-500), 1fr)}.mobile-sheet-nav__header--expanded-context.sc-ds-mobile-sheet-nav .mobile-sheet-nav__context.sc-ds-mobile-sheet-nav{width:100%}.mobile-sheet-nav__header.sc-ds-mobile-sheet-nav::after{content:'';position:absolute;inset-inline:0;inset-block-end:0;height:var(--dimension-stroke-width-012);background:var(--color-border-tertiary);pointer-events:none}.mobile-sheet-nav__brand.sc-ds-mobile-sheet-nav{display:flex;align-items:center;justify-content:flex-start;min-width:0}.mobile-sheet-nav__logo.sc-ds-mobile-sheet-nav{display:inline-flex;align-items:center;justify-content:center;width:var(--dimension-size-500);height:var(--dimension-size-500);padding:var(--dimension-space-100);box-sizing:border-box;color:var(--color-foreground-primary)}.mobile-sheet-nav__logo-mark.sc-ds-mobile-sheet-nav{width:var(--dimension-iconography-lg);height:var(--dimension-iconography-lg);flex:0 0 auto}.mobile-sheet-nav__context.sc-ds-mobile-sheet-nav{justify-self:center}.mobile-sheet-nav__actions.sc-ds-mobile-sheet-nav{display:flex;align-items:center;justify-content:flex-end;gap:var(--dimension-space-050);min-width:0}.mobile-sheet-nav__body.sc-ds-mobile-sheet-nav{min-height:0;overflow:auto;overscroll-behavior:contain}.mobile-sheet-nav__sections.sc-ds-mobile-sheet-nav{display:grid;gap:var(--dimension-space-400)}.mobile-sheet-nav__items.sc-ds-mobile-sheet-nav{display:grid;gap:var(--dimension-space-100)}.mobile-sheet-nav__item.sc-ds-mobile-sheet-nav{appearance:none;width:100%;height:var(--ds-control-height);min-height:var(--ds-control-height);padding-inline:var(--ds-control-padding-inline);border:0;border-radius:var(--ds-control-radius);background:transparent;color:var(--color-foreground-secondary);display:flex;align-items:center;justify-content:flex-start;gap:var(--ds-control-gap);cursor:default;text-align:start;box-sizing:border-box}.mobile-sheet-nav__item--selected.sc-ds-mobile-sheet-nav{color:var(--color-foreground-primary)}.mobile-sheet-nav__item-label.sc-ds-mobile-sheet-nav{min-width:0;padding-inline:var(--ds-control-label-inset)}.mobile-sheet-nav__dot.sc-ds-mobile-sheet-nav{margin-inline-start:auto}`;const f=[{id:"dashboard",label:"Dashboard",icon:"Dashboard",variant:"icon"},{id:"settings",label:"Settings",icon:"Gear",variant:"icon"}];const u=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.dsAreaSelect=s(this,"dsAreaSelect");this.dsBrowseContextChange=s(this,"dsBrowseContextChange");this.dsClose=s(this,"dsClose");this.open=false;this.browseContext="dashboard";this.dashboardGroups=[];this.settingsGroups=[];this.currentUrl="";this.routeSelectionActive=true;this.navigationLabel="Application navigation";this.dashboardLabel="Dashboard";this.settingsLabel="Settings";this.accountLabel="Account";this.helpLabel="Help & Support";this.showAccount=true;this.handleContextChange=e=>{const i=e.detail==="settings"?"settings":"dashboard";if(i===this.browseContext)return;this.dsBrowseContextChange.emit(i)}}get groups(){return this.browseContext==="settings"?this.settingsGroups:this.dashboardGroups}get activeId(){if(!this.routeSelectionActive)return"";return r(this.currentUrl,[...this.dashboardGroups.flatMap((e=>e.items)),...this.settingsGroups.flatMap((e=>e.items))])}handleOpenChange(e){if(!e)return;requestAnimationFrame((()=>{const e=this.el.querySelector('[aria-current="page"]');const i=this.el.querySelector(".mobile-sheet-nav__item");(e??i)?.focus({preventScroll:true})}))}handleKeyDown(e){if(!this.open||e.key!=="Escape")return;e.preventDefault();this.dsClose.emit()}renderItem(e){const i=e.id===this.activeId;return o("button",{type:"button",class:{"mobile-sheet-nav__item":true,"mobile-sheet-nav__item--selected":i,"ds-control--lg":true,"ds-focus-ring-inset":true,"ds-interaction-fill":true},"aria-current":i?"page":undefined,onClick:()=>this.dsAreaSelect.emit(e.id)},o("ds-icon",{class:"ds-interaction-fill__content",name:e.icon,size:"lg",color:"inherit"}),o("ds-text",{class:"mobile-sheet-nav__item-label ds-interaction-fill__content",as:"span",variant:"text-body-large",emphasis:i,color:"inherit"},e.label),e.dot&&o("ds-badge",{class:"mobile-sheet-nav__dot ds-interaction-fill__content",variant:"dot",hasRing:false,label:"","aria-hidden":"true"}))}renderLogo(){return o("span",{class:"mobile-sheet-nav__logo","aria-hidden":"true"},o("svg",{class:"mobile-sheet-nav__logo-mark",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:"false","aria-hidden":"true"},o("path",{d:"M11.1159 4.31537H7.67021L2.53401 13.0703H0V15.6875H4.02716L8.24319 8.49978V15.6846H11.6342L15.8289 8.47829V15.6846H18.7122V4.3125H15.2559L11.1159 11.3648V4.31537Z",fill:"currentColor"})))}renderHeaderDestination(e,i,s){return o("ds-tooltip",{label:s,side:"bottom",size:"sm"},o("ds-button-unfilled",{variant:"icon",size:"lg",icon:i,"aria-label":s,activeFill:false,hasBorder:false,onDsClick:()=>this.dsAreaSelect.emit(e)}))}render(){const e=[{...f[0],label:this.dashboardLabel},{...f[1],label:this.settingsLabel}];return o(n,{key:"35bb8efe0364f654e9edd586a11ee3a7ec517d6e","aria-hidden":this.open?undefined:"true",inert:this.open?undefined:true},o("section",{key:"af4800989e44147c51e9fb368c80e8f6caa6bd7e",id:"ds-mobile-sheet-nav",class:"mobile-sheet-nav"},o("header",{key:"c3e26df965910f0667885ac596b31696bf19f1fb",class:{"mobile-sheet-nav__header":true,"mobile-sheet-nav__header--expanded-context":!this.showAccount,"ds-chrome-grid":true,"ds-chrome-space--md":true}},o("div",{key:"f8abb135539176a1ac7ee9edd208f65b5cabf792",class:"mobile-sheet-nav__brand"},this.renderLogo()),o("ds-tab-group",{key:"0381af9adcfbe2ad3865e477f98bb5b5b0e3d609",class:"mobile-sheet-nav__context",tabs:e,value:this.browseContext,size:"lg",width:this.showAccount?"hug":"fill","aria-label":"Browse context",onDsChange:this.handleContextChange}),o("div",{key:"96bf864d11147855cb593d278e20050ffd081a00",class:"mobile-sheet-nav__actions"},this.renderHeaderDestination("help","CircleQuestion",this.helpLabel),this.showAccount?this.renderHeaderDestination("account","Avatar",this.accountLabel):null)),o("nav",{key:"4ffede30ab932ca9da08b00837f71824c326f12b",class:"mobile-sheet-nav__body ds-chrome-column ds-chrome-space--md","aria-label":this.navigationLabel},o("div",{key:"d921ad26f98070889669197d8285fb12c3fa864f",class:"mobile-sheet-nav__sections"},this.groups.filter((e=>e.items.length>0)).map((e=>o("div",{class:"mobile-sheet-nav__items"},e.items.map((e=>this.renderItem(e))))))))))}get el(){return this}static get watchers(){return{open:[{handleOpenChange:0}]}}static get style(){return b()}},[2,"ds-mobile-sheet-nav",{open:[516],browseContext:[1,"browse-context"],dashboardGroups:[16],settingsGroups:[16],currentUrl:[1,"current-url"],routeSelectionActive:[4,"route-selection-active"],navigationLabel:[1,"navigation-label"],dashboardLabel:[1,"dashboard-label"],settingsLabel:[1,"settings-label"],accountLabel:[1,"account-label"],helpLabel:[1,"help-label"],showAccount:[4,"show-account"]},[[0,"keydown","handleKeyDown"]],{open:[{handleOpenChange:0}]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-mobile-sheet-nav","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-tab-group","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-mobile-sheet-nav":if(!customElements.get(t(e))){customElements.define(t(e),u)}break;case"ds-badge":if(!customElements.get(t(e))){a()}break;case"ds-button-unfilled":if(!customElements.get(t(e))){d()}break;case"ds-icon":if(!customElements.get(t(e))){c()}break;case"ds-loader":if(!customElements.get(t(e))){l()}break;case"ds-tab-group":if(!customElements.get(t(e))){h()}break;case"ds-text":if(!customElements.get(t(e))){v()}break;case"ds-tooltip":if(!customElements.get(t(e))){m()}break}}))}g();export{u as M,g as d};
2
- //# sourceMappingURL=p-os90t2-f.js.map
1
+ import{p as e,H as i,c as s,h as o,a as n,t}from"./index.js";import{d as r}from"./p-Dcnd5ZX5.js";import{d as a}from"./p-D8nnhQNJ.js";import{d}from"./p-c_5SXjwx.js";import{d as c}from"./p-BFfLvMZd.js";import{d as l}from"./p-Ca-I2UnB.js";import{d as h}from"./p-CbfmzgdW.js";import{d as v}from"./p-DZFilC--.js";import{d as m}from"./p-BXPQmp7q.js";const b=()=>`.ds-control--lg.sc-ds-mobile-sheet-nav,.ds-control--lg.sc-ds-mobile-sheet-nav-h,.ds-control--md.sc-ds-mobile-sheet-nav-h,.ds-control--md.sc-ds-mobile-sheet-nav,.ds-control--sm.sc-ds-mobile-sheet-nav-h,.ds-control--sm.sc-ds-mobile-sheet-nav,.ds-control--xs.sc-ds-mobile-sheet-nav-h,.ds-control--xs.sc-ds-mobile-sheet-nav{--ds-control-radius:var(--dimension-radius-025)}.ds-control--lg.sc-ds-mobile-sheet-nav-h,.ds-control--lg.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-control--md.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-control--sm.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-control--xs.sc-ds-mobile-sheet-nav{--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-chrome-space--sm.sc-ds-mobile-sheet-nav-h,.ds-chrome-space--sm.sc-ds-mobile-sheet-nav{--ds-chrome-padding:var(--dimension-space-050);--ds-chrome-gap:var(--dimension-space-050)}.ds-chrome-space--md.sc-ds-mobile-sheet-nav-h,.ds-chrome-space--md.sc-ds-mobile-sheet-nav{--ds-chrome-padding:var(--dimension-space-100);--ds-chrome-gap:var(--dimension-space-100)}.ds-chrome-space--lg.sc-ds-mobile-sheet-nav-h,.ds-chrome-space--lg.sc-ds-mobile-sheet-nav{--ds-chrome-padding:var(--dimension-space-200);--ds-chrome-gap:var(--dimension-space-200)}.ds-chrome-row.sc-ds-mobile-sheet-nav-h,.ds-chrome-row.sc-ds-mobile-sheet-nav,.ds-chrome-column.sc-ds-mobile-sheet-nav-h,.ds-chrome-column.sc-ds-mobile-sheet-nav,.ds-chrome-grid.sc-ds-mobile-sheet-nav-h,.ds-chrome-grid.sc-ds-mobile-sheet-nav{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-mobile-sheet-nav-h,.ds-chrome-row.sc-ds-mobile-sheet-nav{flex-direction:row;align-items:center}.ds-chrome-column.sc-ds-mobile-sheet-nav-h,.ds-chrome-column.sc-ds-mobile-sheet-nav{flex-direction:column}.ds-chrome-grid.sc-ds-mobile-sheet-nav-h,.ds-chrome-grid.sc-ds-mobile-sheet-nav{display:grid;align-items:center}@media (forced-colors: active){.sc-ds-mobile-sheet-nav:root,.sc-ds-mobile-sheet-nav-h,.ds-forced-colors-scope.sc-ds-mobile-sheet-nav{--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-sheet-nav-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-sheet-nav-h,.ds-focus-ring.sc-ds-mobile-sheet-nav,.ds-focus-ring-inset.sc-ds-mobile-sheet-nav-h,.ds-focus-ring-inset.sc-ds-mobile-sheet-nav{outline:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.ds-focus-ring.sc-ds-mobile-sheet-nav-h:focus-visible,.ds-focus-ring.sc-ds-mobile-sheet-nav: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-sheet-nav-h,.ds-focus-ring.ds-focus-ring--visible.sc-ds-mobile-sheet-nav{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-sheet-nav-h:focus-visible,.ds-focus-ring-inset.sc-ds-mobile-sheet-nav:focus-visible{outline:none}.ds-focus-ring-inset.sc-ds-mobile-sheet-nav-h:focus-visible::after,.ds-focus-ring-inset.sc-ds-mobile-sheet-nav: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-sheet-nav-h,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-sheet-nav{outline:none}.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-sheet-nav-h::after,.ds-focus-ring-inset.ds-focus-ring--visible.sc-ds-mobile-sheet-nav::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-sheet-nav-h{--ds-focus-ring-color:var(--ds-forced-color-selected)}}@media (forced-colors: active){.sc-ds-mobile-sheet-nav:root,.sc-ds-mobile-sheet-nav-h,.ds-forced-colors-scope.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill.sc-ds-mobile-sheet-nav{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-sheet-nav-h::before,.ds-interaction-fill.sc-ds-mobile-sheet-nav::before,.ds-interaction-fill.sc-ds-mobile-sheet-nav-h::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav::after{content:'';position:absolute;inset:0;border-radius:inherit;background:transparent;pointer-events:none;cursor:inherit;transition:none}.ds-interaction-fill.sc-ds-mobile-sheet-nav-h::before,.ds-interaction-fill.sc-ds-mobile-sheet-nav::before{z-index:1}.ds-interaction-fill.sc-ds-mobile-sheet-nav-h::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav::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-sheet-nav-h,.ds-interaction-fill--bordered.sc-ds-mobile-sheet-nav{--ds-interaction-border-width:var(--dimension-stroke-width-012);--ds-interaction-border-color:var(--color-border-secondary)}.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav-h::before,.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav::before{background:var(--ds-interaction-active)}.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav{--ds-interaction-dot-ring:var(--ds-interaction-active)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill.sc-ds-mobile-sheet-nav-h:hover:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav:hover:not(:disabled)::after{background:var(--ds-interaction-hover)}}.ds-interaction-fill.sc-ds-mobile-sheet-nav-h:active:not(:disabled)::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav:active:not(:disabled)::after{background:var(--ds-interaction-pressed)}.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav-h::after,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav::after,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav-h:active:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav:active:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}@media (hover: hover) and (pointer: fine){.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav-h:hover:not(:disabled)::after,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav:hover:not(:disabled)::after{background:var(--ds-interaction-group-fill, transparent)}}.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--grouped.sc-ds-mobile-sheet-nav{--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-sheet-nav-h>.ds-interaction-fill__content.sc-ds-mobile-sheet-nav,.ds-interaction-fill.sc-ds-mobile-sheet-nav>.ds-interaction-fill__content.sc-ds-mobile-sheet-nav,.ds-interaction-fill__content.sc-ds-mobile-sheet-nav{position:relative;z-index:2;cursor:inherit}.ds-interaction-fill--on-faint.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--on-faint.sc-ds-mobile-sheet-nav{--ds-interaction-active:var(--color-interaction-active)}.ds-interaction-fill--on-medium.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--on-medium.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-bold.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-strong.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-translucent.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-inverted.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-media.sc-ds-mobile-sheet-nav{--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-sheet-nav-h,.ds-interaction-fill--on-always-dark.sc-ds-mobile-sheet-nav{--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-navigation.sc-ds-mobile-sheet-nav-h,.ds-interaction-fill--on-navigation.sc-ds-mobile-sheet-nav{--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)}@media (forced-colors: active){.ds-interaction-fill.sc-ds-mobile-sheet-nav-h::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav::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--selected.sc-ds-mobile-sheet-nav-h::before,.ds-interaction-fill--selected.sc-ds-mobile-sheet-nav::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-sheet-nav-h:hover:not(:disabled):not(:focus-visible):not(:focus-within):not(.ds-focus-ring--visible)::after,.ds-interaction-fill.sc-ds-mobile-sheet-nav: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-sheet-nav-h{display:block;min-width:0;min-height:0;height:100%;background:var(--color-background-primary)}.sc-ds-mobile-sheet-nav-h:not([open]){display:none}.mobile-sheet-nav.sc-ds-mobile-sheet-nav{display:grid;grid-template-rows:auto minmax(0, 1fr);height:100%;min-height:0;background:var(--color-background-primary)}.mobile-sheet-nav__header.sc-ds-mobile-sheet-nav{position:relative;grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr)}.mobile-sheet-nav__header--expanded-context.sc-ds-mobile-sheet-nav{grid-template-columns:minmax(var(--dimension-size-500), 1fr) minmax(0, 4fr) minmax(var(--dimension-size-500), 1fr)}.mobile-sheet-nav__header--expanded-context.sc-ds-mobile-sheet-nav .mobile-sheet-nav__context.sc-ds-mobile-sheet-nav{width:100%}.mobile-sheet-nav__header.sc-ds-mobile-sheet-nav::after{content:'';position:absolute;inset-inline:0;inset-block-end:0;height:var(--dimension-stroke-width-012);background:var(--color-border-tertiary);pointer-events:none}.mobile-sheet-nav__brand.sc-ds-mobile-sheet-nav{display:flex;align-items:center;justify-content:flex-start;min-width:0}.mobile-sheet-nav__logo.sc-ds-mobile-sheet-nav{display:inline-flex;align-items:center;justify-content:center;width:var(--dimension-size-500);height:var(--dimension-size-500);padding:var(--dimension-space-100);box-sizing:border-box;color:var(--color-foreground-primary)}.mobile-sheet-nav__logo-mark.sc-ds-mobile-sheet-nav{width:var(--dimension-iconography-lg);height:var(--dimension-iconography-lg);flex:0 0 auto}.mobile-sheet-nav__context.sc-ds-mobile-sheet-nav{justify-self:center}.mobile-sheet-nav__actions.sc-ds-mobile-sheet-nav{display:flex;align-items:center;justify-content:flex-end;gap:var(--dimension-space-050);min-width:0}.mobile-sheet-nav__body.sc-ds-mobile-sheet-nav{min-height:0;overflow:auto;overscroll-behavior:contain}.mobile-sheet-nav__sections.sc-ds-mobile-sheet-nav{display:grid;gap:var(--dimension-space-400)}.mobile-sheet-nav__items.sc-ds-mobile-sheet-nav{display:grid;gap:var(--dimension-space-100)}.mobile-sheet-nav__item.sc-ds-mobile-sheet-nav{appearance:none;width:100%;height:var(--ds-control-height);min-height:var(--ds-control-height);padding-inline:var(--ds-control-padding-inline);border:0;border-radius:var(--ds-control-radius);background:transparent;color:var(--color-foreground-secondary);display:flex;align-items:center;justify-content:flex-start;gap:var(--ds-control-gap);cursor:default;text-align:start;box-sizing:border-box}.mobile-sheet-nav__item--selected.sc-ds-mobile-sheet-nav{color:var(--color-foreground-primary)}.mobile-sheet-nav__item-label.sc-ds-mobile-sheet-nav{min-width:0;padding-inline:var(--ds-control-label-inset)}.mobile-sheet-nav__dot.sc-ds-mobile-sheet-nav{margin-inline-start:auto}`;const f=[{id:"dashboard",label:"Dashboard",icon:"Dashboard",variant:"icon"},{id:"settings",label:"Settings",icon:"Gear",variant:"icon"}];const u=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.dsAreaSelect=s(this,"dsAreaSelect");this.dsBrowseContextChange=s(this,"dsBrowseContextChange");this.dsClose=s(this,"dsClose");this.open=false;this.browseContext="dashboard";this.dashboardGroups=[];this.settingsGroups=[];this.currentUrl="";this.routeSelectionActive=true;this.navigationLabel="Application navigation";this.dashboardLabel="Dashboard";this.settingsLabel="Settings";this.accountLabel="Account";this.helpLabel="Help & Support";this.showAccount=true;this.handleContextChange=e=>{const i=e.detail==="settings"?"settings":"dashboard";if(i===this.browseContext)return;this.dsBrowseContextChange.emit(i)}}get groups(){return this.browseContext==="settings"?this.settingsGroups:this.dashboardGroups}get activeId(){if(!this.routeSelectionActive)return"";return r(this.currentUrl,[...this.dashboardGroups.flatMap((e=>e.items)),...this.settingsGroups.flatMap((e=>e.items))])}handleOpenChange(e){if(!e)return;requestAnimationFrame((()=>{const e=this.el.querySelector('[aria-current="page"]');const i=this.el.querySelector(".mobile-sheet-nav__item");(e??i)?.focus({preventScroll:true})}))}handleKeyDown(e){if(!this.open||e.key!=="Escape")return;e.preventDefault();this.dsClose.emit()}renderItem(e){const i=e.id===this.activeId;return o("button",{type:"button",class:{"mobile-sheet-nav__item":true,"mobile-sheet-nav__item--selected":i,"ds-control--lg":true,"ds-focus-ring-inset":true,"ds-interaction-fill":true},"aria-current":i?"page":undefined,onClick:()=>this.dsAreaSelect.emit(e.id)},o("ds-icon",{class:"ds-interaction-fill__content",name:e.icon,size:"lg",color:"inherit"}),o("ds-text",{class:"mobile-sheet-nav__item-label ds-interaction-fill__content",as:"span",variant:"text-body-large",emphasis:i,color:"inherit"},e.label),e.dot&&o("ds-badge",{class:"mobile-sheet-nav__dot ds-interaction-fill__content",variant:"dot",hasRing:false,label:"","aria-hidden":"true"}))}renderLogo(){return o("span",{class:"mobile-sheet-nav__logo","aria-hidden":"true"},o("svg",{class:"mobile-sheet-nav__logo-mark",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:"false","aria-hidden":"true"},o("path",{d:"M11.1159 4.31537H7.67021L2.53401 13.0703H0V15.6875H4.02716L8.24319 8.49978V15.6846H11.6342L15.8289 8.47829V15.6846H18.7122V4.3125H15.2559L11.1159 11.3648V4.31537Z",fill:"currentColor"})))}renderHeaderDestination(e,i,s){return o("ds-tooltip",{label:s,side:"bottom",size:"sm"},o("ds-button-unfilled",{variant:"icon",size:"lg",icon:i,"aria-label":s,activeFill:false,hasBorder:false,onDsClick:()=>this.dsAreaSelect.emit(e)}))}render(){const e=[{...f[0],label:this.dashboardLabel},{...f[1],label:this.settingsLabel}];return o(n,{key:"35bb8efe0364f654e9edd586a11ee3a7ec517d6e","aria-hidden":this.open?undefined:"true",inert:this.open?undefined:true},o("section",{key:"af4800989e44147c51e9fb368c80e8f6caa6bd7e",id:"ds-mobile-sheet-nav",class:"mobile-sheet-nav"},o("header",{key:"c3e26df965910f0667885ac596b31696bf19f1fb",class:{"mobile-sheet-nav__header":true,"mobile-sheet-nav__header--expanded-context":!this.showAccount,"ds-chrome-grid":true,"ds-chrome-space--md":true}},o("div",{key:"f8abb135539176a1ac7ee9edd208f65b5cabf792",class:"mobile-sheet-nav__brand"},this.renderLogo()),o("ds-tab-group",{key:"0381af9adcfbe2ad3865e477f98bb5b5b0e3d609",class:"mobile-sheet-nav__context",tabs:e,value:this.browseContext,size:"lg",width:this.showAccount?"hug":"fill","aria-label":"Browse context",onDsChange:this.handleContextChange}),o("div",{key:"96bf864d11147855cb593d278e20050ffd081a00",class:"mobile-sheet-nav__actions"},this.renderHeaderDestination("help","CircleQuestion",this.helpLabel),this.showAccount?this.renderHeaderDestination("account","Avatar",this.accountLabel):null)),o("nav",{key:"4ffede30ab932ca9da08b00837f71824c326f12b",class:"mobile-sheet-nav__body ds-chrome-column ds-chrome-space--md","aria-label":this.navigationLabel},o("div",{key:"d921ad26f98070889669197d8285fb12c3fa864f",class:"mobile-sheet-nav__sections"},this.groups.filter((e=>e.items.length>0)).map((e=>o("div",{class:"mobile-sheet-nav__items"},e.items.map((e=>this.renderItem(e))))))))))}get el(){return this}static get watchers(){return{open:[{handleOpenChange:0}]}}static get style(){return b()}},[2,"ds-mobile-sheet-nav",{open:[516],browseContext:[1,"browse-context"],dashboardGroups:[16],settingsGroups:[16],currentUrl:[1,"current-url"],routeSelectionActive:[4,"route-selection-active"],navigationLabel:[1,"navigation-label"],dashboardLabel:[1,"dashboard-label"],settingsLabel:[1,"settings-label"],accountLabel:[1,"account-label"],helpLabel:[1,"help-label"],showAccount:[4,"show-account"]},[[0,"keydown","handleKeyDown"]],{open:[{handleOpenChange:0}]}]);function g(){if(typeof customElements==="undefined"){return}const e=["ds-mobile-sheet-nav","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-tab-group","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-mobile-sheet-nav":if(!customElements.get(t(e))){customElements.define(t(e),u)}break;case"ds-badge":if(!customElements.get(t(e))){a()}break;case"ds-button-unfilled":if(!customElements.get(t(e))){d()}break;case"ds-icon":if(!customElements.get(t(e))){c()}break;case"ds-loader":if(!customElements.get(t(e))){l()}break;case"ds-tab-group":if(!customElements.get(t(e))){h()}break;case"ds-text":if(!customElements.get(t(e))){v()}break;case"ds-tooltip":if(!customElements.get(t(e))){m()}break}}))}g();export{u as M,g as d};
2
+ //# sourceMappingURL=p-D5VglrfF.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as i,c as t,h as s,a as n,t as a}from"./index.js";import{d as r}from"./p-D8nnhQNJ.js";import{d as o}from"./p-DvJkkdIO.js";import{d}from"./p-CTTDiW33.js";import{d as u}from"./p-C5TrNd31.js";import{d as c}from"./p-BFfLvMZd.js";import{d as l}from"./p-Ca-I2UnB.js";import{d as h}from"./p-BHjw0x3L.js";import{d as g}from"./p-DZFilC--.js";import{d as q}from"./p-BXPQmp7q.js";function p(e,i){return e.find((e=>e.questionId===i))}function m(e,i){return Object.fromEntries(e.map((e=>{const t=p(i,e.id);const s=new Set(e.choices?.map((e=>e.value))??[]);if(e.type==="multiple"){const i=Array.isArray(t?.value)?t.value:[];const n=i.filter((e=>s.has(e)));const a=i.find((e=>!s.has(e)))??"";return[e.id,{value:n,otherSelected:Boolean(e.allowOther&&a),otherText:e.allowOther?a:"",skipped:t?.value===null}]}const n=typeof t?.value==="string"?t.value:"";const a=e.type==="single"&&s.has(n);return[e.id,{value:e.type==="single"&&!a?"":n,otherSelected:Boolean(e.type==="single"&&e.allowOther&&n&&!a),otherText:e.type==="single"&&e.allowOther&&n&&!a?n:"",skipped:t?.value===null}]})))}function f(e,i){if(i.skipped)return{questionId:e.id,value:null};if(e.type==="multiple"){const t=Array.isArray(i.value)?[...i.value]:[];if(i.otherSelected&&i.otherText.trim())t.push(i.otherText.trim());return{questionId:e.id,value:t.length||e.required?t:null}}if(i.otherSelected){const t=i.otherText.trim();return{questionId:e.id,value:t||null}}const t=typeof i.value==="string"?i.value.trim():"";return{questionId:e.id,value:t||null}}function b(e,i){if((e.type==="single"||e.type==="multiple")&&!e.choices?.length){return"This question has no available choices."}if(i.otherSelected&&!i.otherText.trim()){return"Enter a response for Other."}if(!e.required||i.skipped)return undefined;const t=f(e,i).value;const s=t===null||Array.isArray(t)&&t.length===0;if(!s)return undefined;return e.type==="text"?"Enter an answer before continuing.":"Choose an answer before continuing."}function _(e,i){if(!i||i.value===null)return"Skipped";const t=Array.isArray(i.value)?i.value:[i.value];const s=new Map(e.choices?.map((e=>[e.value,e.label]))??[]);return t.map((e=>s.get(e)??e)).join(", ")}const v=()=>`@media (forced-colors: active){.sc-ds-agent-questionnaire:root,.sc-ds-agent-questionnaire-h,.ds-forced-colors-scope.sc-ds-agent-questionnaire{--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-visually-hidden.sc-ds-agent-questionnaire-h,.ds-visually-hidden.sc-ds-agent-questionnaire{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.sc-ds-agent-questionnaire-h{display:block;width:100%;min-width:0;box-sizing:border-box;-webkit-user-select:none;user-select:none}.questionnaire.sc-ds-agent-questionnaire{display:grid;gap:var(--dimension-space-150);width:100%;padding:var(--dimension-space-200);border-radius:var(--dimension-radius-125);background:var(--color-background-primary);box-shadow:var(--effect-elevation-elevated-md);box-sizing:border-box}.questionnaire--answered.sc-ds-agent-questionnaire{gap:var(--dimension-space-100);padding:var(--dimension-space-150);background:var(--color-background-secondary);box-shadow:none}.questionnaire--preparing.sc-ds-agent-questionnaire{align-items:center;grid-template-columns:auto minmax(0, 1fr)}.questionnaire__header.sc-ds-agent-questionnaire,.questionnaire__actions.sc-ds-agent-questionnaire,.questionnaire__actions-leading.sc-ds-agent-questionnaire,.questionnaire__error.sc-ds-agent-questionnaire,.questionnaire__submission-error.sc-ds-agent-questionnaire{display:flex;align-items:center}.questionnaire__header.sc-ds-agent-questionnaire,.questionnaire__actions.sc-ds-agent-questionnaire{justify-content:space-between;gap:var(--dimension-space-100)}.questionnaire__body.sc-ds-agent-questionnaire,.questionnaire__prompt.sc-ds-agent-questionnaire,.questionnaire__choices.sc-ds-agent-questionnaire,.questionnaire__single-choice.sc-ds-agent-questionnaire,.questionnaire__multiple-choice.sc-ds-agent-questionnaire,.questionnaire__other-choice.sc-ds-agent-questionnaire,.questionnaire__summary.sc-ds-agent-questionnaire,.questionnaire__summary.sc-ds-agent-questionnaire li.sc-ds-agent-questionnaire{display:grid}.questionnaire__body.sc-ds-agent-questionnaire,.questionnaire__prompt.sc-ds-agent-questionnaire,.questionnaire__choices.sc-ds-agent-questionnaire,.questionnaire__single-choice.sc-ds-agent-questionnaire,.questionnaire__multiple-choice.sc-ds-agent-questionnaire,.questionnaire__other-choice.sc-ds-agent-questionnaire{gap:var(--dimension-space-100)}.questionnaire__choices.sc-ds-agent-questionnaire{min-width:0;margin:0;padding:0;border:0}ds-radio.sc-ds-agent-questionnaire,ds-checkbox.sc-ds-agent-questionnaire{width:100%;min-width:0}.questionnaire__other-input.sc-ds-agent-questionnaire,.questionnaire__text-input.sc-ds-agent-questionnaire{width:100%;padding:var(--dimension-space-100);border:var(--dimension-stroke-width-012) solid var(--color-border-secondary);border-radius:var(--dimension-radius-050);outline:none;background:var(--color-background-primary);color:var(--color-foreground-primary);font-family:var(--typography-font-family-ui);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half);box-sizing:border-box;-webkit-user-select:text;user-select:text}.questionnaire__other-input.sc-ds-agent-questionnaire{width:calc(100% - var(--dimension-size-500));margin-inline-start:var(--dimension-size-500)}.questionnaire__text-input.sc-ds-agent-questionnaire{min-height:calc(var(--typography-lineheight-md) * 4 + var(--dimension-space-200));resize:vertical}.questionnaire__other-input.sc-ds-agent-questionnaire:focus,.questionnaire__text-input.sc-ds-agent-questionnaire:focus{border-color:var(--color-border-bold-brand);box-shadow:inset 0 0 0 var(--dimension-stroke-width-018) var(--color-border-bold-brand)}.questionnaire__other-input[aria-invalid='true'].sc-ds-agent-questionnaire,.questionnaire__text-input[aria-invalid='true'].sc-ds-agent-questionnaire{border-color:var(--color-border-bold-negative)}.questionnaire__error.sc-ds-agent-questionnaire,.questionnaire__submission-error.sc-ds-agent-questionnaire{gap:var(--dimension-space-050);color:var(--color-foreground-bold-negative)}.questionnaire__submission-error.sc-ds-agent-questionnaire{padding:var(--dimension-space-075);border-radius:var(--dimension-radius-050);background:var(--color-background-faint-negative)}.questionnaire__actions-leading.sc-ds-agent-questionnaire{flex-wrap:wrap;gap:var(--dimension-space-075)}.questionnaire__action-item.sc-ds-agent-questionnaire{width:fit-content;max-width:100%}.questionnaire.sc-ds-agent-questionnaire textarea.sc-ds-agent-questionnaire:disabled{color:var(--color-foreground-tertiary);cursor:default;opacity:1}.questionnaire__summary.sc-ds-agent-questionnaire{gap:var(--dimension-space-100);margin:0;padding:0;list-style:none}.questionnaire__summary.sc-ds-agent-questionnaire li.sc-ds-agent-questionnaire{gap:var(--dimension-space-025)}@media (max-width: 480px){.questionnaire.sc-ds-agent-questionnaire{padding:var(--dimension-space-150)}.questionnaire__actions.sc-ds-agent-questionnaire{align-items:stretch;flex-direction:column}.questionnaire__actions-leading.sc-ds-agent-questionnaire{display:grid;grid-template-columns:minmax(0, 1fr);width:100%}.questionnaire__action-item.sc-ds-agent-questionnaire,.questionnaire__action-item--primary.sc-ds-agent-questionnaire{width:100%}}@media (forced-colors: active){.questionnaire.sc-ds-agent-questionnaire{border:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);box-shadow:none}.questionnaire__other-input[aria-invalid='true'].sc-ds-agent-questionnaire,.questionnaire__text-input[aria-invalid='true'].sc-ds-agent-questionnaire{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-content)}.questionnaire__submission-error.sc-ds-agent-questionnaire{border:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);background:var(--ds-forced-color-surface)}.questionnaire.sc-ds-agent-questionnaire input.sc-ds-agent-questionnaire:disabled,.questionnaire.sc-ds-agent-questionnaire textarea.sc-ds-agent-questionnaire:disabled{color:var(--ds-forced-color-disabled)}}`;const x={progress:"Question {current} of {total}",previous:"Previous",next:"Next",answer:"Answer",skip:"Skip",cancel:"Cancel",other:"Other",otherPlaceholder:"Enter another answer",preparing:"Preparing questions…"};let y=0;const w=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.dsAnswer=t(this,"dsAnswer");this.dsCancel=t(this,"dsCancel");this.answers=[];this.status="ready";this.allowCancel=false;this.currentStep=0;this.drafts={};this.validation={};this.instanceId=++y;this.otherValue=`__ds-agent-questionnaire-other-${this.instanceId}`;this.answerPending=false;this.resetScheduled=false;this.answersSnapshot=[];this.waitingForRequestAnswers=false}componentWillLoad(){this.draftRequestId=this.requestId;this.answersSnapshot=this.answers;this.resetDraft()}handleQuestionnaireInputChange(){this.scheduleDraftReset()}handleStatusChange(e){if(e!=="submitting")this.answerPending=false}async setFocus(){this.focusCurrentControl()}get copy(){return{...x,...this.labels}}get disabled(){return this.status==="submitting"}resetDraft(e=this.answers){this.currentStep=0;this.drafts=m(this.questions??[],e??[]);this.validation={};this.answerPending=false}scheduleDraftReset(){if(this.resetScheduled)return;this.resetScheduled=true;queueMicrotask((()=>{this.resetScheduled=false;const e=this.requestId!==this.draftRequestId;const i=this.answers!==this.answersSnapshot;if(e&&!i){this.waitingForRequestAnswers=true}else if(i){this.waitingForRequestAnswers=false}this.resetDraft(this.waitingForRequestAnswers?[]:this.answers);this.draftRequestId=this.requestId;this.answersSnapshot=this.answers}))}focusCurrentControl(e=false){const i=()=>{const i=e?this.el.querySelector('[data-question-control][aria-invalid="true"]:not([disabled])'):null;const t=i??this.el.querySelector("[data-question-control]:not([disabled]):not([is-inactive])");const s=this.el.querySelector("[data-question-action]:not([is-inactive]):not([is-loading])");const n=t??s;if(n?.setFocus)void n.setFocus();else n?.focus()};i();requestAnimationFrame(i);setTimeout(i,0)}updateDraft(e,i){const t=this.drafts[e]??{value:"",otherSelected:false,otherText:"",skipped:false};this.drafts={...this.drafts,[e]:{...t,...i,skipped:false}};if(this.validation[e]){const{[e]:i,...t}=this.validation;this.validation=t}}validate(e){const i=b(e,this.drafts[e.id]);if(!i)return true;this.validation={...this.validation,[e.id]:i};this.focusCurrentControl(true);return false}move(e){this.currentStep=Math.min(Math.max(e,0),this.questions.length-1);this.focusCurrentControl()}next(e){if(!this.validate(e))return;this.move(this.currentStep+1)}skip(e){if(e.required)return;this.drafts={...this.drafts,[e.id]:{...this.drafts[e.id]??{value:"",otherSelected:false,otherText:""},skipped:true}};if(this.currentStep<this.questions.length-1)this.move(this.currentStep+1);else this.submit()}submit(){if(this.disabled||this.answerPending)return;const e=this.questions.findIndex((e=>!this.validateWithoutFocus(e)));if(e>=0){this.currentStep=e;this.focusCurrentControl(true);return}this.answerPending=true;this.dsAnswer.emit({requestId:this.requestId,answers:this.questions.map((e=>f(e,this.drafts[e.id])))})}validateWithoutFocus(e){const i=b(e,this.drafts[e.id]);if(!i)return true;this.validation={...this.validation,[e.id]:i};return false}progressLabel(){return this.copy.progress.split("{current}").join(String(this.currentStep+1)).split("{total}").join(String(this.questions.length))}selectSingle(e,i){const t=i===this.otherValue;this.updateDraft(e.id,{value:t?"":i,otherSelected:t});if(t){requestAnimationFrame((()=>this.el.querySelector("[data-question-other-input]")?.focus()))}}renderSingleChoice(e,i,t){const n=this.drafts[e.id];const a=n.otherSelected?this.otherValue:typeof n.value==="string"?n.value:"";const r=[...e.choices??[],...e.allowOther?[{value:this.otherValue,label:this.copy.other}]:[]];return s("div",{class:"questionnaire__single-choice"},s("ds-radio",{"data-question-control":true,size:"lg",options:r,value:a,disabled:this.disabled,form:`ds-agent-questionnaire-detached-${this.instanceId}`,ariaLabelledby:i,"aria-describedby":this.validation[e.id]?t:undefined,onDsChange:i=>this.selectSingle(e,i.detail)}),n.otherSelected?this.renderOtherInput(e,t):null)}renderMultipleChoice(e,i){const t=this.drafts[e.id];const n=Array.isArray(t.value)?t.value:[];const a=`ds-agent-questionnaire-detached-${this.instanceId}`;return s("div",{class:"questionnaire__multiple-choice"},e.choices?.map((i=>s("ds-checkbox",{key:i.value,"data-question-control":true,size:"lg",label:i.label,description:i.description,value:i.value,checked:n.includes(i.value),disabled:this.disabled,form:a,onDsChange:t=>{this.updateDraft(e.id,{value:t.detail?[...n,i.value]:n.filter((e=>e!==i.value))})}}))),e.allowOther?s("div",{class:"questionnaire__other-choice"},s("ds-checkbox",{"data-question-control":true,size:"lg",label:this.copy.other,checked:t.otherSelected,disabled:this.disabled,form:a,onDsChange:i=>{this.updateDraft(e.id,{otherSelected:i.detail});if(i.detail){requestAnimationFrame((()=>this.el.querySelector("[data-question-other-input]")?.focus()))}}}),t.otherSelected?this.renderOtherInput(e,i):null):null)}renderOtherInput(e,i){const t=this.drafts[e.id];return s("input",{class:"questionnaire__other-input","data-question-control":true,"data-question-other-input":true,type:"text",form:`ds-agent-questionnaire-detached-${this.instanceId}`,value:t.otherText,placeholder:this.copy.otherPlaceholder,"aria-label":this.copy.other,"aria-invalid":this.validation[e.id]?"true":undefined,"aria-describedby":this.validation[e.id]?i:undefined,disabled:this.disabled,onInput:i=>this.updateDraft(e.id,{otherText:i.target.value})})}renderQuestion(e){const i=this.drafts[e.id];const t=`ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-error`;const n=`ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-prompt`;return s("div",{class:"questionnaire__body"},s("div",{class:"questionnaire__prompt"},s("ds-text",{as:"h2",variant:"text-title-small",textId:n},e.question),e.description?s("ds-text",{variant:"text-body-small",color:"secondary"},e.description):null),e.type==="text"?s("textarea",{class:"questionnaire__text-input","data-question-control":true,value:typeof i.value==="string"?i.value:"",form:`ds-agent-questionnaire-detached-${this.instanceId}`,placeholder:e.placeholder,"aria-label":e.question,"aria-invalid":this.validation[e.id]?"true":undefined,"aria-describedby":this.validation[e.id]?t:undefined,disabled:this.disabled,rows:4,onInput:i=>this.updateDraft(e.id,{value:i.target.value})}):s("fieldset",{class:"questionnaire__choices","aria-describedby":this.validation[e.id]?t:undefined},s("legend",{class:"ds-visually-hidden"},e.question),e.type==="single"?this.renderSingleChoice(e,n,t):this.renderMultipleChoice(e,t)),this.validation[e.id]?s("div",{id:t,class:"questionnaire__error",role:"alert"},s("ds-icon",{name:"ErrorTriangle",size:"xs",color:"inherit"}),s("ds-text",{variant:"text-body-small",color:"negative"},this.validation[e.id])):null)}renderAnswered(){return s("div",{class:"questionnaire questionnaire--answered"},s("ol",{class:"questionnaire__summary"},this.questions.map((e=>s("li",null,s("ds-text",{variant:"text-body-small",emphasis:true},e.question),s("ds-text",{variant:"text-body-small",color:"secondary"},_(e,this.answers.find((i=>i.questionId===e.id)))))))))}render(){if(this.status==="preparing"){return s(n,null,s("div",{class:"questionnaire questionnaire--preparing",role:"status"},s("ds-loader",{size:"sm"}),s("ds-text",{variant:"text-body-medium"},this.copy.preparing)))}if(!this.questions?.length)return null;if(this.status==="answered")return s(n,null,this.renderAnswered());const e=this.questions[this.currentStep];const i=this.currentStep===this.questions.length-1;const t=Boolean(e.skippable&&!e.required);return s(n,null,s("section",{class:{questionnaire:true,"questionnaire--submitting":this.disabled,"questionnaire--error":this.status==="error"},"aria-busy":this.disabled?"true":undefined,"aria-label":e.question},s("header",{class:"questionnaire__header"},s("ds-text",{variant:"text-caption",color:"secondary"},this.progressLabel()),this.allowCancel?s("ds-tooltip",{label:this.copy.cancel,side:"top",size:"sm"},s("ds-button-unfilled",{"data-question-action":true,variant:"icon",icon:"Cross",size:"sm","aria-label":this.copy.cancel,hasBorder:false,isInactive:this.disabled,onDsClick:()=>this.dsCancel.emit({requestId:this.requestId})})):null),this.renderQuestion(e),this.status==="error"&&this.errorMessage?s("div",{class:"questionnaire__submission-error",role:"alert"},s("ds-icon",{name:"ErrorTriangle",size:"xs",color:"inherit"}),s("ds-text",{variant:"text-body-small",color:"negative"},this.errorMessage)):null,s("footer",{class:"questionnaire__actions"},s("div",{class:"questionnaire__actions-leading"},this.currentStep>0?s("div",{class:"questionnaire__action-item"},s("ds-button-unfilled",{"data-question-action":true,label:this.copy.previous,size:"sm",width:"fill",isInactive:this.disabled,onDsClick:()=>this.move(this.currentStep-1)})):null,t?s("div",{class:"questionnaire__action-item"},s("ds-button-unfilled",{"data-question-action":true,label:this.copy.skip,size:"sm",width:"fill",hasBorder:false,isInactive:this.disabled,onDsClick:()=>this.skip(e)})):null),s("div",{class:"questionnaire__action-item questionnaire__action-item--primary"},s("ds-button-filled",{"data-question-action":true,label:i?this.copy.answer:this.copy.next,size:"sm",width:"fill",isLoading:this.disabled,onDsClick:()=>i?this.submit():this.next(e)})))))}get el(){return this}static get watchers(){return{requestId:[{handleQuestionnaireInputChange:0}],questions:[{handleQuestionnaireInputChange:0}],answers:[{handleQuestionnaireInputChange:0}],status:[{handleStatusChange:0}]}}static get style(){return v()}},[2,"ds-agent-questionnaire",{requestId:[1,"request-id"],questions:[16],answers:[16],status:[1],errorMessage:[1,"error-message"],allowCancel:[4,"allow-cancel"],labels:[16],currentStep:[32],drafts:[32],validation:[32],setFocus:[64]},undefined,{requestId:[{handleQuestionnaireInputChange:0}],questions:[{handleQuestionnaireInputChange:0}],answers:[{handleQuestionnaireInputChange:0}],status:[{handleStatusChange:0}]}]);function k(){if(typeof customElements==="undefined"){return}const e=["ds-agent-questionnaire","ds-badge","ds-button-filled","ds-button-unfilled","ds-checkbox","ds-icon","ds-loader","ds-radio","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-agent-questionnaire":if(!customElements.get(a(e))){customElements.define(a(e),w)}break;case"ds-badge":if(!customElements.get(a(e))){r()}break;case"ds-button-filled":if(!customElements.get(a(e))){o()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){d()}break;case"ds-checkbox":if(!customElements.get(a(e))){u()}break;case"ds-icon":if(!customElements.get(a(e))){c()}break;case"ds-loader":if(!customElements.get(a(e))){l()}break;case"ds-radio":if(!customElements.get(a(e))){h()}break;case"ds-text":if(!customElements.get(a(e))){g()}break;case"ds-tooltip":if(!customElements.get(a(e))){q()}break}}))}k();export{w as A,k as d};
2
- //# sourceMappingURL=p-BX-R5EhL.js.map
1
+ import{p as e,H as i,c as t,h as s,a as n,t as a}from"./index.js";import{d as r}from"./p-D8nnhQNJ.js";import{d as o}from"./p-DvJkkdIO.js";import{d}from"./p-c_5SXjwx.js";import{d as u}from"./p-C5TrNd31.js";import{d as c}from"./p-BFfLvMZd.js";import{d as l}from"./p-Ca-I2UnB.js";import{d as h}from"./p-BHjw0x3L.js";import{d as g}from"./p-DZFilC--.js";import{d as q}from"./p-BXPQmp7q.js";function p(e,i){return e.find((e=>e.questionId===i))}function m(e,i){return Object.fromEntries(e.map((e=>{const t=p(i,e.id);const s=new Set(e.choices?.map((e=>e.value))??[]);if(e.type==="multiple"){const i=Array.isArray(t?.value)?t.value:[];const n=i.filter((e=>s.has(e)));const a=i.find((e=>!s.has(e)))??"";return[e.id,{value:n,otherSelected:Boolean(e.allowOther&&a),otherText:e.allowOther?a:"",skipped:t?.value===null}]}const n=typeof t?.value==="string"?t.value:"";const a=e.type==="single"&&s.has(n);return[e.id,{value:e.type==="single"&&!a?"":n,otherSelected:Boolean(e.type==="single"&&e.allowOther&&n&&!a),otherText:e.type==="single"&&e.allowOther&&n&&!a?n:"",skipped:t?.value===null}]})))}function f(e,i){if(i.skipped)return{questionId:e.id,value:null};if(e.type==="multiple"){const t=Array.isArray(i.value)?[...i.value]:[];if(i.otherSelected&&i.otherText.trim())t.push(i.otherText.trim());return{questionId:e.id,value:t.length||e.required?t:null}}if(i.otherSelected){const t=i.otherText.trim();return{questionId:e.id,value:t||null}}const t=typeof i.value==="string"?i.value.trim():"";return{questionId:e.id,value:t||null}}function b(e,i){if((e.type==="single"||e.type==="multiple")&&!e.choices?.length){return"This question has no available choices."}if(i.otherSelected&&!i.otherText.trim()){return"Enter a response for Other."}if(!e.required||i.skipped)return undefined;const t=f(e,i).value;const s=t===null||Array.isArray(t)&&t.length===0;if(!s)return undefined;return e.type==="text"?"Enter an answer before continuing.":"Choose an answer before continuing."}function _(e,i){if(!i||i.value===null)return"Skipped";const t=Array.isArray(i.value)?i.value:[i.value];const s=new Map(e.choices?.map((e=>[e.value,e.label]))??[]);return t.map((e=>s.get(e)??e)).join(", ")}const v=()=>`@media (forced-colors: active){.sc-ds-agent-questionnaire:root,.sc-ds-agent-questionnaire-h,.ds-forced-colors-scope.sc-ds-agent-questionnaire{--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-visually-hidden.sc-ds-agent-questionnaire-h,.ds-visually-hidden.sc-ds-agent-questionnaire{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.sc-ds-agent-questionnaire-h{display:block;width:100%;min-width:0;box-sizing:border-box;-webkit-user-select:none;user-select:none}.questionnaire.sc-ds-agent-questionnaire{display:grid;gap:var(--dimension-space-150);width:100%;padding:var(--dimension-space-200);border-radius:var(--dimension-radius-125);background:var(--color-background-primary);box-shadow:var(--effect-elevation-elevated-md);box-sizing:border-box}.questionnaire--answered.sc-ds-agent-questionnaire{gap:var(--dimension-space-100);padding:var(--dimension-space-150);background:var(--color-background-secondary);box-shadow:none}.questionnaire--preparing.sc-ds-agent-questionnaire{align-items:center;grid-template-columns:auto minmax(0, 1fr)}.questionnaire__header.sc-ds-agent-questionnaire,.questionnaire__actions.sc-ds-agent-questionnaire,.questionnaire__actions-leading.sc-ds-agent-questionnaire,.questionnaire__error.sc-ds-agent-questionnaire,.questionnaire__submission-error.sc-ds-agent-questionnaire{display:flex;align-items:center}.questionnaire__header.sc-ds-agent-questionnaire,.questionnaire__actions.sc-ds-agent-questionnaire{justify-content:space-between;gap:var(--dimension-space-100)}.questionnaire__body.sc-ds-agent-questionnaire,.questionnaire__prompt.sc-ds-agent-questionnaire,.questionnaire__choices.sc-ds-agent-questionnaire,.questionnaire__single-choice.sc-ds-agent-questionnaire,.questionnaire__multiple-choice.sc-ds-agent-questionnaire,.questionnaire__other-choice.sc-ds-agent-questionnaire,.questionnaire__summary.sc-ds-agent-questionnaire,.questionnaire__summary.sc-ds-agent-questionnaire li.sc-ds-agent-questionnaire{display:grid}.questionnaire__body.sc-ds-agent-questionnaire,.questionnaire__prompt.sc-ds-agent-questionnaire,.questionnaire__choices.sc-ds-agent-questionnaire,.questionnaire__single-choice.sc-ds-agent-questionnaire,.questionnaire__multiple-choice.sc-ds-agent-questionnaire,.questionnaire__other-choice.sc-ds-agent-questionnaire{gap:var(--dimension-space-100)}.questionnaire__choices.sc-ds-agent-questionnaire{min-width:0;margin:0;padding:0;border:0}ds-radio.sc-ds-agent-questionnaire,ds-checkbox.sc-ds-agent-questionnaire{width:100%;min-width:0}.questionnaire__other-input.sc-ds-agent-questionnaire,.questionnaire__text-input.sc-ds-agent-questionnaire{width:100%;padding:var(--dimension-space-100);border:var(--dimension-stroke-width-012) solid var(--color-border-secondary);border-radius:var(--dimension-radius-050);outline:none;background:var(--color-background-primary);color:var(--color-foreground-primary);font-family:var(--typography-font-family-ui);font-size:var(--typography-fontsize-md);font-weight:var(--typography-weight-regular);line-height:var(--typography-lineheight-md);letter-spacing:var(--typography-letterspacing-negative-half);box-sizing:border-box;-webkit-user-select:text;user-select:text}.questionnaire__other-input.sc-ds-agent-questionnaire{width:calc(100% - var(--dimension-size-500));margin-inline-start:var(--dimension-size-500)}.questionnaire__text-input.sc-ds-agent-questionnaire{min-height:calc(var(--typography-lineheight-md) * 4 + var(--dimension-space-200));resize:vertical}.questionnaire__other-input.sc-ds-agent-questionnaire:focus,.questionnaire__text-input.sc-ds-agent-questionnaire:focus{border-color:var(--color-border-bold-brand);box-shadow:inset 0 0 0 var(--dimension-stroke-width-018) var(--color-border-bold-brand)}.questionnaire__other-input[aria-invalid='true'].sc-ds-agent-questionnaire,.questionnaire__text-input[aria-invalid='true'].sc-ds-agent-questionnaire{border-color:var(--color-border-bold-negative)}.questionnaire__error.sc-ds-agent-questionnaire,.questionnaire__submission-error.sc-ds-agent-questionnaire{gap:var(--dimension-space-050);color:var(--color-foreground-bold-negative)}.questionnaire__submission-error.sc-ds-agent-questionnaire{padding:var(--dimension-space-075);border-radius:var(--dimension-radius-050);background:var(--color-background-faint-negative)}.questionnaire__actions-leading.sc-ds-agent-questionnaire{flex-wrap:wrap;gap:var(--dimension-space-075)}.questionnaire__action-item.sc-ds-agent-questionnaire{width:fit-content;max-width:100%}.questionnaire.sc-ds-agent-questionnaire textarea.sc-ds-agent-questionnaire:disabled{color:var(--color-foreground-tertiary);cursor:default;opacity:1}.questionnaire__summary.sc-ds-agent-questionnaire{gap:var(--dimension-space-100);margin:0;padding:0;list-style:none}.questionnaire__summary.sc-ds-agent-questionnaire li.sc-ds-agent-questionnaire{gap:var(--dimension-space-025)}@media (max-width: 480px){.questionnaire.sc-ds-agent-questionnaire{padding:var(--dimension-space-150)}.questionnaire__actions.sc-ds-agent-questionnaire{align-items:stretch;flex-direction:column}.questionnaire__actions-leading.sc-ds-agent-questionnaire{display:grid;grid-template-columns:minmax(0, 1fr);width:100%}.questionnaire__action-item.sc-ds-agent-questionnaire,.questionnaire__action-item--primary.sc-ds-agent-questionnaire{width:100%}}@media (forced-colors: active){.questionnaire.sc-ds-agent-questionnaire{border:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);box-shadow:none}.questionnaire__other-input[aria-invalid='true'].sc-ds-agent-questionnaire,.questionnaire__text-input[aria-invalid='true'].sc-ds-agent-questionnaire{outline:var(--dimension-stroke-width-025) dashed var(--ds-forced-color-content)}.questionnaire__submission-error.sc-ds-agent-questionnaire{border:var(--dimension-stroke-width-012) solid var(--ds-forced-color-content);background:var(--ds-forced-color-surface)}.questionnaire.sc-ds-agent-questionnaire input.sc-ds-agent-questionnaire:disabled,.questionnaire.sc-ds-agent-questionnaire textarea.sc-ds-agent-questionnaire:disabled{color:var(--ds-forced-color-disabled)}}`;const x={progress:"Question {current} of {total}",previous:"Previous",next:"Next",answer:"Answer",skip:"Skip",cancel:"Cancel",other:"Other",otherPlaceholder:"Enter another answer",preparing:"Preparing questions…"};let y=0;const w=e(class e extends i{constructor(e){super();if(e!==false){this.__registerHost()}this.dsAnswer=t(this,"dsAnswer");this.dsCancel=t(this,"dsCancel");this.answers=[];this.status="ready";this.allowCancel=false;this.currentStep=0;this.drafts={};this.validation={};this.instanceId=++y;this.otherValue=`__ds-agent-questionnaire-other-${this.instanceId}`;this.answerPending=false;this.resetScheduled=false;this.answersSnapshot=[];this.waitingForRequestAnswers=false}componentWillLoad(){this.draftRequestId=this.requestId;this.answersSnapshot=this.answers;this.resetDraft()}handleQuestionnaireInputChange(){this.scheduleDraftReset()}handleStatusChange(e){if(e!=="submitting")this.answerPending=false}async setFocus(){this.focusCurrentControl()}get copy(){return{...x,...this.labels}}get disabled(){return this.status==="submitting"}resetDraft(e=this.answers){this.currentStep=0;this.drafts=m(this.questions??[],e??[]);this.validation={};this.answerPending=false}scheduleDraftReset(){if(this.resetScheduled)return;this.resetScheduled=true;queueMicrotask((()=>{this.resetScheduled=false;const e=this.requestId!==this.draftRequestId;const i=this.answers!==this.answersSnapshot;if(e&&!i){this.waitingForRequestAnswers=true}else if(i){this.waitingForRequestAnswers=false}this.resetDraft(this.waitingForRequestAnswers?[]:this.answers);this.draftRequestId=this.requestId;this.answersSnapshot=this.answers}))}focusCurrentControl(e=false){const i=()=>{const i=e?this.el.querySelector('[data-question-control][aria-invalid="true"]:not([disabled])'):null;const t=i??this.el.querySelector("[data-question-control]:not([disabled]):not([is-inactive])");const s=this.el.querySelector("[data-question-action]:not([is-inactive]):not([is-loading])");const n=t??s;if(n?.setFocus)void n.setFocus();else n?.focus()};i();requestAnimationFrame(i);setTimeout(i,0)}updateDraft(e,i){const t=this.drafts[e]??{value:"",otherSelected:false,otherText:"",skipped:false};this.drafts={...this.drafts,[e]:{...t,...i,skipped:false}};if(this.validation[e]){const{[e]:i,...t}=this.validation;this.validation=t}}validate(e){const i=b(e,this.drafts[e.id]);if(!i)return true;this.validation={...this.validation,[e.id]:i};this.focusCurrentControl(true);return false}move(e){this.currentStep=Math.min(Math.max(e,0),this.questions.length-1);this.focusCurrentControl()}next(e){if(!this.validate(e))return;this.move(this.currentStep+1)}skip(e){if(e.required)return;this.drafts={...this.drafts,[e.id]:{...this.drafts[e.id]??{value:"",otherSelected:false,otherText:""},skipped:true}};if(this.currentStep<this.questions.length-1)this.move(this.currentStep+1);else this.submit()}submit(){if(this.disabled||this.answerPending)return;const e=this.questions.findIndex((e=>!this.validateWithoutFocus(e)));if(e>=0){this.currentStep=e;this.focusCurrentControl(true);return}this.answerPending=true;this.dsAnswer.emit({requestId:this.requestId,answers:this.questions.map((e=>f(e,this.drafts[e.id])))})}validateWithoutFocus(e){const i=b(e,this.drafts[e.id]);if(!i)return true;this.validation={...this.validation,[e.id]:i};return false}progressLabel(){return this.copy.progress.split("{current}").join(String(this.currentStep+1)).split("{total}").join(String(this.questions.length))}selectSingle(e,i){const t=i===this.otherValue;this.updateDraft(e.id,{value:t?"":i,otherSelected:t});if(t){requestAnimationFrame((()=>this.el.querySelector("[data-question-other-input]")?.focus()))}}renderSingleChoice(e,i,t){const n=this.drafts[e.id];const a=n.otherSelected?this.otherValue:typeof n.value==="string"?n.value:"";const r=[...e.choices??[],...e.allowOther?[{value:this.otherValue,label:this.copy.other}]:[]];return s("div",{class:"questionnaire__single-choice"},s("ds-radio",{"data-question-control":true,size:"lg",options:r,value:a,disabled:this.disabled,form:`ds-agent-questionnaire-detached-${this.instanceId}`,ariaLabelledby:i,"aria-describedby":this.validation[e.id]?t:undefined,onDsChange:i=>this.selectSingle(e,i.detail)}),n.otherSelected?this.renderOtherInput(e,t):null)}renderMultipleChoice(e,i){const t=this.drafts[e.id];const n=Array.isArray(t.value)?t.value:[];const a=`ds-agent-questionnaire-detached-${this.instanceId}`;return s("div",{class:"questionnaire__multiple-choice"},e.choices?.map((i=>s("ds-checkbox",{key:i.value,"data-question-control":true,size:"lg",label:i.label,description:i.description,value:i.value,checked:n.includes(i.value),disabled:this.disabled,form:a,onDsChange:t=>{this.updateDraft(e.id,{value:t.detail?[...n,i.value]:n.filter((e=>e!==i.value))})}}))),e.allowOther?s("div",{class:"questionnaire__other-choice"},s("ds-checkbox",{"data-question-control":true,size:"lg",label:this.copy.other,checked:t.otherSelected,disabled:this.disabled,form:a,onDsChange:i=>{this.updateDraft(e.id,{otherSelected:i.detail});if(i.detail){requestAnimationFrame((()=>this.el.querySelector("[data-question-other-input]")?.focus()))}}}),t.otherSelected?this.renderOtherInput(e,i):null):null)}renderOtherInput(e,i){const t=this.drafts[e.id];return s("input",{class:"questionnaire__other-input","data-question-control":true,"data-question-other-input":true,type:"text",form:`ds-agent-questionnaire-detached-${this.instanceId}`,value:t.otherText,placeholder:this.copy.otherPlaceholder,"aria-label":this.copy.other,"aria-invalid":this.validation[e.id]?"true":undefined,"aria-describedby":this.validation[e.id]?i:undefined,disabled:this.disabled,onInput:i=>this.updateDraft(e.id,{otherText:i.target.value})})}renderQuestion(e){const i=this.drafts[e.id];const t=`ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-error`;const n=`ds-agent-questionnaire-${this.instanceId}-${this.currentStep}-prompt`;return s("div",{class:"questionnaire__body"},s("div",{class:"questionnaire__prompt"},s("ds-text",{as:"h2",variant:"text-title-small",textId:n},e.question),e.description?s("ds-text",{variant:"text-body-small",color:"secondary"},e.description):null),e.type==="text"?s("textarea",{class:"questionnaire__text-input","data-question-control":true,value:typeof i.value==="string"?i.value:"",form:`ds-agent-questionnaire-detached-${this.instanceId}`,placeholder:e.placeholder,"aria-label":e.question,"aria-invalid":this.validation[e.id]?"true":undefined,"aria-describedby":this.validation[e.id]?t:undefined,disabled:this.disabled,rows:4,onInput:i=>this.updateDraft(e.id,{value:i.target.value})}):s("fieldset",{class:"questionnaire__choices","aria-describedby":this.validation[e.id]?t:undefined},s("legend",{class:"ds-visually-hidden"},e.question),e.type==="single"?this.renderSingleChoice(e,n,t):this.renderMultipleChoice(e,t)),this.validation[e.id]?s("div",{id:t,class:"questionnaire__error",role:"alert"},s("ds-icon",{name:"ErrorTriangle",size:"xs",color:"inherit"}),s("ds-text",{variant:"text-body-small",color:"negative"},this.validation[e.id])):null)}renderAnswered(){return s("div",{class:"questionnaire questionnaire--answered"},s("ol",{class:"questionnaire__summary"},this.questions.map((e=>s("li",null,s("ds-text",{variant:"text-body-small",emphasis:true},e.question),s("ds-text",{variant:"text-body-small",color:"secondary"},_(e,this.answers.find((i=>i.questionId===e.id)))))))))}render(){if(this.status==="preparing"){return s(n,null,s("div",{class:"questionnaire questionnaire--preparing",role:"status"},s("ds-loader",{size:"sm"}),s("ds-text",{variant:"text-body-medium"},this.copy.preparing)))}if(!this.questions?.length)return null;if(this.status==="answered")return s(n,null,this.renderAnswered());const e=this.questions[this.currentStep];const i=this.currentStep===this.questions.length-1;const t=Boolean(e.skippable&&!e.required);return s(n,null,s("section",{class:{questionnaire:true,"questionnaire--submitting":this.disabled,"questionnaire--error":this.status==="error"},"aria-busy":this.disabled?"true":undefined,"aria-label":e.question},s("header",{class:"questionnaire__header"},s("ds-text",{variant:"text-caption",color:"secondary"},this.progressLabel()),this.allowCancel?s("ds-tooltip",{label:this.copy.cancel,side:"top",size:"sm"},s("ds-button-unfilled",{"data-question-action":true,variant:"icon",icon:"Cross",size:"sm","aria-label":this.copy.cancel,hasBorder:false,isInactive:this.disabled,onDsClick:()=>this.dsCancel.emit({requestId:this.requestId})})):null),this.renderQuestion(e),this.status==="error"&&this.errorMessage?s("div",{class:"questionnaire__submission-error",role:"alert"},s("ds-icon",{name:"ErrorTriangle",size:"xs",color:"inherit"}),s("ds-text",{variant:"text-body-small",color:"negative"},this.errorMessage)):null,s("footer",{class:"questionnaire__actions"},s("div",{class:"questionnaire__actions-leading"},this.currentStep>0?s("div",{class:"questionnaire__action-item"},s("ds-button-unfilled",{"data-question-action":true,label:this.copy.previous,size:"sm",width:"fill",isInactive:this.disabled,onDsClick:()=>this.move(this.currentStep-1)})):null,t?s("div",{class:"questionnaire__action-item"},s("ds-button-unfilled",{"data-question-action":true,label:this.copy.skip,size:"sm",width:"fill",hasBorder:false,isInactive:this.disabled,onDsClick:()=>this.skip(e)})):null),s("div",{class:"questionnaire__action-item questionnaire__action-item--primary"},s("ds-button-filled",{"data-question-action":true,label:i?this.copy.answer:this.copy.next,size:"sm",width:"fill",isLoading:this.disabled,onDsClick:()=>i?this.submit():this.next(e)})))))}get el(){return this}static get watchers(){return{requestId:[{handleQuestionnaireInputChange:0}],questions:[{handleQuestionnaireInputChange:0}],answers:[{handleQuestionnaireInputChange:0}],status:[{handleStatusChange:0}]}}static get style(){return v()}},[2,"ds-agent-questionnaire",{requestId:[1,"request-id"],questions:[16],answers:[16],status:[1],errorMessage:[1,"error-message"],allowCancel:[4,"allow-cancel"],labels:[16],currentStep:[32],drafts:[32],validation:[32],setFocus:[64]},undefined,{requestId:[{handleQuestionnaireInputChange:0}],questions:[{handleQuestionnaireInputChange:0}],answers:[{handleQuestionnaireInputChange:0}],status:[{handleStatusChange:0}]}]);function k(){if(typeof customElements==="undefined"){return}const e=["ds-agent-questionnaire","ds-badge","ds-button-filled","ds-button-unfilled","ds-checkbox","ds-icon","ds-loader","ds-radio","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-agent-questionnaire":if(!customElements.get(a(e))){customElements.define(a(e),w)}break;case"ds-badge":if(!customElements.get(a(e))){r()}break;case"ds-button-filled":if(!customElements.get(a(e))){o()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){d()}break;case"ds-checkbox":if(!customElements.get(a(e))){u()}break;case"ds-icon":if(!customElements.get(a(e))){c()}break;case"ds-loader":if(!customElements.get(a(e))){l()}break;case"ds-radio":if(!customElements.get(a(e))){h()}break;case"ds-text":if(!customElements.get(a(e))){g()}break;case"ds-tooltip":if(!customElements.get(a(e))){q()}break}}))}k();export{w as A,k as d};
2
+ //# sourceMappingURL=p-D5bPuNiF.js.map
@@ -1,2 +1,2 @@
1
- import{p as e,H as o,h as s,a as t,t as a}from"./index.js";import{C as i}from"./p-BnhGV__o.js";import{d as c}from"./p-D8nnhQNJ.js";import{d}from"./p-CTTDiW33.js";import{d as n}from"./p-BFfLvMZd.js";import{d as r}from"./p-Ca-I2UnB.js";import{d as l}from"./p-DZFilC--.js";import{d as f}from"./p-BXPQmp7q.js";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{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{font:inherit;white-space:pre}`;const p=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.code="";this.language="";this.filename="";this.copied=false;this.copyFeedback=new i((e=>{this.copied=e}));this.copy=async()=>{await this.copyFeedback.copy(this.code)}}connectedCallback(){this.copyFeedback.connect()}handleCodeChange(){this.copyFeedback.reset()}disconnectedCallback(){this.copyFeedback.disconnect()}render(){const e=this.filename||this.language||"Code";return s(t,{key:"6d20caf96fceb733c44fe7cc669df42b7033aab9"},s("figure",{key:"7c55036013f4c3de0f90a3a1f90eb87e0b2778c2",class:"code-block"},s("figcaption",{key:"061e43ca1f0ad5760d61648a4f8be3faba409f2b",class:"code-block__header"},s("ds-text",{key:"4f726dfeb9c9e3de71cf8ca0177e0570f1742d65",as:"span",variant:"text-caption",emphasis:true,color:"on-strong"},e),s("ds-tooltip",{key:"6bb56e6104e5c882eeedeef7b1b493d93d625182",label:this.copied?"Copied":"Copy code",side:"bottom",size:"sm"},s("ds-button-unfilled",{key:"c9c6677443721145038d5dbdb981829421f03444",variant:"icon",icon:this.copied?"Check":"Copy",size:"xs","aria-label":this.copied?"Copied":"Copy code",hasBorder:false,onDsClick:this.copy}))),s("pre",{key:"547fc22eac923e932757f6ec70262a8fc0c90b28"},s("code",{key:"9da4dba3b52a76f823462e3d023fc17c77c670f9"},this.code))))}static get watchers(){return{code:[{handleCodeChange:0}]}}static get style(){return b()}},[2,"ds-code-block",{code:[1],language:[1],filename:[1],copied:[32]},undefined,{code:[{handleCodeChange:0}]}]);function m(){if(typeof customElements==="undefined"){return}const e=["ds-code-block","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-code-block":if(!customElements.get(a(e))){customElements.define(a(e),p)}break;case"ds-badge":if(!customElements.get(a(e))){c()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){d()}break;case"ds-icon":if(!customElements.get(a(e))){n()}break;case"ds-loader":if(!customElements.get(a(e))){r()}break;case"ds-text":if(!customElements.get(a(e))){l()}break;case"ds-tooltip":if(!customElements.get(a(e))){f()}break}}))}m();export{p as C,m as d};
2
- //# sourceMappingURL=p-DTf90AyI.js.map
1
+ import{p as e,H as o,h as s,a as t,t as a}from"./index.js";import{C as i}from"./p-BnhGV__o.js";import{d as c}from"./p-D8nnhQNJ.js";import{d}from"./p-c_5SXjwx.js";import{d as n}from"./p-BFfLvMZd.js";import{d as r}from"./p-Ca-I2UnB.js";import{d as l}from"./p-DZFilC--.js";import{d as f}from"./p-BXPQmp7q.js";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{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{font:inherit;white-space:pre}`;const p=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.code="";this.language="";this.filename="";this.copied=false;this.copyFeedback=new i((e=>{this.copied=e}));this.copy=async()=>{await this.copyFeedback.copy(this.code)}}connectedCallback(){this.copyFeedback.connect()}handleCodeChange(){this.copyFeedback.reset()}disconnectedCallback(){this.copyFeedback.disconnect()}render(){const e=this.filename||this.language||"Code";return s(t,{key:"6d20caf96fceb733c44fe7cc669df42b7033aab9"},s("figure",{key:"7c55036013f4c3de0f90a3a1f90eb87e0b2778c2",class:"code-block"},s("figcaption",{key:"061e43ca1f0ad5760d61648a4f8be3faba409f2b",class:"code-block__header"},s("ds-text",{key:"4f726dfeb9c9e3de71cf8ca0177e0570f1742d65",as:"span",variant:"text-caption",emphasis:true,color:"on-strong"},e),s("ds-tooltip",{key:"6bb56e6104e5c882eeedeef7b1b493d93d625182",label:this.copied?"Copied":"Copy code",side:"bottom",size:"sm"},s("ds-button-unfilled",{key:"c9c6677443721145038d5dbdb981829421f03444",variant:"icon",icon:this.copied?"Check":"Copy",size:"xs","aria-label":this.copied?"Copied":"Copy code",hasBorder:false,onDsClick:this.copy}))),s("pre",{key:"547fc22eac923e932757f6ec70262a8fc0c90b28"},s("code",{key:"9da4dba3b52a76f823462e3d023fc17c77c670f9"},this.code))))}static get watchers(){return{code:[{handleCodeChange:0}]}}static get style(){return b()}},[2,"ds-code-block",{code:[1],language:[1],filename:[1],copied:[32]},undefined,{code:[{handleCodeChange:0}]}]);function m(){if(typeof customElements==="undefined"){return}const e=["ds-code-block","ds-badge","ds-button-unfilled","ds-icon","ds-loader","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-code-block":if(!customElements.get(a(e))){customElements.define(a(e),p)}break;case"ds-badge":if(!customElements.get(a(e))){c()}break;case"ds-button-unfilled":if(!customElements.get(a(e))){d()}break;case"ds-icon":if(!customElements.get(a(e))){n()}break;case"ds-loader":if(!customElements.get(a(e))){r()}break;case"ds-text":if(!customElements.get(a(e))){l()}break;case"ds-tooltip":if(!customElements.get(a(e))){f()}break}}))}m();export{p as C,m as d};
2
+ //# sourceMappingURL=p-bQm3gfr1.js.map