@jimka/typescript-ui 0.1.0 → 0.2.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 (216) hide show
  1. package/README.md +5 -18
  2. package/dist/lib/{AbstractBooleanInput-C3rj7sje.js → AbstractBooleanInput-BGesvIZy.js} +2 -2
  3. package/dist/lib/{AbstractBooleanInput-C3rj7sje.js.map → AbstractBooleanInput-BGesvIZy.js.map} +1 -1
  4. package/dist/lib/{AbstractInput-DD-NpicS.js → AbstractInput-BxOtFrER.js} +2 -2
  5. package/dist/lib/{AbstractInput-DD-NpicS.js.map → AbstractInput-BxOtFrER.js.map} +1 -1
  6. package/dist/lib/AnimatedDropdown-CZQEqQi-.js +2 -0
  7. package/dist/lib/AnimatedDropdown-CZQEqQi-.js.map +1 -0
  8. package/dist/lib/Border-BgaZkc1R.js +2 -0
  9. package/dist/lib/Border-BgaZkc1R.js.map +1 -0
  10. package/dist/lib/{BoxLayout-DgZukB5_.js → BoxLayout-DrKGfsup.js} +2 -2
  11. package/dist/lib/{BoxLayout-DgZukB5_.js.map → BoxLayout-DrKGfsup.js.map} +1 -1
  12. package/dist/lib/Button-U1rsP4v8.js +2 -0
  13. package/dist/lib/Button-U1rsP4v8.js.map +1 -0
  14. package/dist/lib/{Card-UF0fq8cQ.js → Card-BVwOS8AG.js} +2 -2
  15. package/dist/lib/{Card-UF0fq8cQ.js.map → Card-BVwOS8AG.js.map} +1 -1
  16. package/dist/lib/ComboBox-B9EDPu6T.js +2 -0
  17. package/dist/lib/ComboBox-B9EDPu6T.js.map +1 -0
  18. package/dist/lib/Component-DXf5a3g0.js +2 -0
  19. package/dist/lib/Component-DXf5a3g0.js.map +1 -0
  20. package/dist/lib/Container-D5H8VxJK.js +2 -0
  21. package/dist/lib/{Container-3KsvsJ6S.js.map → Container-D5H8VxJK.js.map} +1 -1
  22. package/dist/lib/DOM-CGn7xyTw.js +2 -0
  23. package/dist/lib/DOM-CGn7xyTw.js.map +1 -0
  24. package/dist/lib/DragManager-CI4mZQFy.js +2 -0
  25. package/dist/lib/{DragManager-tPMnbjeO.js.map → DragManager-CI4mZQFy.js.map} +1 -1
  26. package/dist/lib/FieldDecorator-CJs9gwqH.js +2 -0
  27. package/dist/lib/{FieldDecorator-E7WzutjO.js.map → FieldDecorator-CJs9gwqH.js.map} +1 -1
  28. package/dist/lib/{Fit-CFIr4P9R.js → Fit-DjRsiwlg.js} +2 -2
  29. package/dist/lib/{Fit-CFIr4P9R.js.map → Fit-DjRsiwlg.js.map} +1 -1
  30. package/dist/lib/Glyph-KEf4nIv2.js +2 -0
  31. package/dist/lib/Glyph-KEf4nIv2.js.map +1 -0
  32. package/dist/lib/{Grid-Czux--Mr.js → Grid-DdL9TVeJ.js} +2 -2
  33. package/dist/lib/{Grid-Czux--Mr.js.map → Grid-DdL9TVeJ.js.map} +1 -1
  34. package/dist/lib/GridConstraints-DkLueyrf.js +2 -0
  35. package/dist/lib/GridConstraints-DkLueyrf.js.map +1 -0
  36. package/dist/lib/{HBox-Q8y1PHlk.js → HBox-Ce0GTCJP.js} +2 -2
  37. package/dist/lib/{HBox-Q8y1PHlk.js.map → HBox-Ce0GTCJP.js.map} +1 -1
  38. package/dist/lib/{Header-zPdvC2AX.js → Header-BQIVpBte.js} +2 -2
  39. package/dist/lib/{Header-zPdvC2AX.js.map → Header-BQIVpBte.js.map} +1 -1
  40. package/dist/lib/{IconText-BvGfu7eq.js → IconText-Bo4Qcnot.js} +2 -2
  41. package/dist/lib/{IconText-BvGfu7eq.js.map → IconText-Bo4Qcnot.js.map} +1 -1
  42. package/dist/lib/LayoutConstraints-DkctJZXB.js +2 -0
  43. package/dist/lib/LayoutConstraints-DkctJZXB.js.map +1 -0
  44. package/dist/lib/LayoutSerialization-BT66TY83.js +2 -0
  45. package/dist/lib/LayoutSerialization-BT66TY83.js.map +1 -0
  46. package/dist/lib/LayoutSizes-DU3qSq0w.js +2 -0
  47. package/dist/lib/LayoutSizes-DU3qSq0w.js.map +1 -0
  48. package/dist/lib/List-DtTVTyWW.js +2 -0
  49. package/dist/lib/List-DtTVTyWW.js.map +1 -0
  50. package/dist/lib/Menu-Dz4L7EKJ.js +2 -0
  51. package/dist/lib/Menu-Dz4L7EKJ.js.map +1 -0
  52. package/dist/lib/MenuButton-VJ5uC3c1.js +2 -0
  53. package/dist/lib/{MenuButton-JQQaKThJ.js.map → MenuButton-VJ5uC3c1.js.map} +1 -1
  54. package/dist/lib/Panel-DzWdYwq1.js +2 -0
  55. package/dist/lib/Panel-DzWdYwq1.js.map +1 -0
  56. package/dist/lib/Position-A39T7-_1.js +2 -0
  57. package/dist/lib/Position-A39T7-_1.js.map +1 -0
  58. package/dist/lib/ProgressSpinner-zJKtGyNJ.js +2 -0
  59. package/dist/lib/ProgressSpinner-zJKtGyNJ.js.map +1 -0
  60. package/dist/lib/RadioButton-CYSSv4nV.js +2 -0
  61. package/dist/lib/RadioButton-CYSSv4nV.js.map +1 -0
  62. package/dist/lib/{RovingTabIndex-CFIzIjjU.js → RovingTabIndex-BSZ31Vp5.js} +2 -2
  63. package/dist/lib/{RovingTabIndex-CFIzIjjU.js.map → RovingTabIndex-BSZ31Vp5.js.map} +1 -1
  64. package/dist/lib/Scrollbar-BhtOjqkG.js +2 -0
  65. package/dist/lib/Scrollbar-BhtOjqkG.js.map +1 -0
  66. package/dist/lib/Slider-CdXm7E64.js +2 -0
  67. package/dist/lib/Slider-CdXm7E64.js.map +1 -0
  68. package/dist/lib/{Spacer-BVQncB5B.js → Spacer-D9NGW4QG.js} +2 -2
  69. package/dist/lib/{Spacer-BVQncB5B.js.map → Spacer-D9NGW4QG.js.map} +1 -1
  70. package/dist/lib/TabButton-CThevdY_.js +2 -0
  71. package/dist/lib/{TabButton-pZKFYg7b.js.map → TabButton-CThevdY_.js.map} +1 -1
  72. package/dist/lib/Text-gz6qjFfP.js +2 -0
  73. package/dist/lib/Text-gz6qjFfP.js.map +1 -0
  74. package/dist/lib/Tooltip-tkXDk5Bo.js +3 -0
  75. package/dist/lib/Tooltip-tkXDk5Bo.js.map +1 -0
  76. package/dist/lib/{VBox-D5B9ecw0.js → VBox-EIqw85Rh.js} +2 -2
  77. package/dist/lib/{VBox-D5B9ecw0.js.map → VBox-EIqw85Rh.js.map} +1 -1
  78. package/dist/lib/VirtualRowView-BxpHQ_u8.js +2 -0
  79. package/dist/lib/{VirtualRowView-Con9SWiU.js.map → VirtualRowView-BxpHQ_u8.js.map} +1 -1
  80. package/dist/lib/VirtualScroller-DwEEJE1_.js +2 -0
  81. package/dist/lib/{VirtualScroller-BPDmO1ir.js.map → VirtualScroller-DwEEJE1_.js.map} +1 -1
  82. package/dist/lib/component/button.es.js +1 -1
  83. package/dist/lib/component/button.es.js.map +1 -1
  84. package/dist/lib/component/chart.es.js +1 -1
  85. package/dist/lib/component/chart.es.js.map +1 -1
  86. package/dist/lib/component/container.es.js +1 -1
  87. package/dist/lib/component/container.es.js.map +1 -1
  88. package/dist/lib/component/diagram.es.js +1 -1
  89. package/dist/lib/component/diagram.es.js.map +1 -1
  90. package/dist/lib/component/display.es.js +1 -1
  91. package/dist/lib/component/display.es.js.map +1 -1
  92. package/dist/lib/component/editor.es.js +3 -1
  93. package/dist/lib/component/editor.es.js.map +1 -1
  94. package/dist/lib/component/input.es.js +1 -1
  95. package/dist/lib/component/input.es.js.map +1 -1
  96. package/dist/lib/component/list.es.js +1 -1
  97. package/dist/lib/component/list.es.js.map +1 -1
  98. package/dist/lib/component/menubar.es.js +1 -1
  99. package/dist/lib/component/menubar.es.js.map +1 -1
  100. package/dist/lib/component/table.es.js +2 -2
  101. package/dist/lib/component/table.es.js.map +1 -1
  102. package/dist/lib/component/tree.es.js +1 -1
  103. package/dist/lib/component/tree.es.js.map +1 -1
  104. package/dist/lib/core.es.js +1 -1
  105. package/dist/lib/core.es.js.map +1 -1
  106. package/dist/lib/layout.es.js +1 -1
  107. package/dist/lib/overlay.es.js +1 -1
  108. package/dist/lib/overlay.es.js.map +1 -1
  109. package/dist/lib/primitive.es.js +1 -1
  110. package/dist/lib/router.es.js +2 -0
  111. package/dist/lib/router.es.js.map +1 -0
  112. package/dist/lib/types/component/button/Button.d.ts +4 -3
  113. package/dist/lib/types/component/chart/AbstractChart.d.ts +1 -1
  114. package/dist/lib/types/component/chart/ChartLegend.d.ts +1 -1
  115. package/dist/lib/types/component/container/DialogBackdrop.d.ts +2 -1
  116. package/dist/lib/types/component/container/MenuItem.d.ts +1 -1
  117. package/dist/lib/types/component/container/ScrollStrip.d.ts +1 -0
  118. package/dist/lib/types/component/container/SplitGutter.d.ts +3 -2
  119. package/dist/lib/types/component/container/TabBar.d.ts +1 -2
  120. package/dist/lib/types/component/container/TabPanel.d.ts +6 -3
  121. package/dist/lib/types/component/container/WindowBorder.d.ts +2 -1
  122. package/dist/lib/types/component/container/WindowHeader.d.ts +2 -1
  123. package/dist/lib/types/component/display/Glyph.d.ts +2 -1
  124. package/dist/lib/types/component/display/Markdown.d.ts +11 -1
  125. package/dist/lib/types/component/display/PaginationBar.d.ts +1 -1
  126. package/dist/lib/types/component/display/SpinnerWrap.d.ts +2 -0
  127. package/dist/lib/types/component/display/Video.d.ts +1 -1
  128. package/dist/lib/types/component/display/VideoPlayer.d.ts +1 -1
  129. package/dist/lib/types/component/display/index.d.ts +1 -1
  130. package/dist/lib/types/component/editor/CodeEditor.d.ts +2 -1
  131. package/dist/lib/types/component/editor/MarkdownEditor.d.ts +7 -1
  132. package/dist/lib/types/component/editor/markdownTableTransformer.d.ts +2 -0
  133. package/dist/lib/types/component/input/Checkbox.d.ts +2 -1
  134. package/dist/lib/types/component/input/Link.d.ts +1 -1
  135. package/dist/lib/types/component/input/RadioButton.d.ts +2 -1
  136. package/dist/lib/types/component/input/Slider.d.ts +2 -1
  137. package/dist/lib/types/component/input/Text.d.ts +1 -3
  138. package/dist/lib/types/component/input/TextInput.d.ts +3 -2
  139. package/dist/lib/types/component/list/AbstractSelectableList.d.ts +2 -1
  140. package/dist/lib/types/component/menubar/MenuBarButton.d.ts +1 -1
  141. package/dist/lib/types/core/AnimatedDropdown.d.ts +6 -2
  142. package/dist/lib/types/core/Animation.d.ts +9 -6
  143. package/dist/lib/types/core/Component.d.ts +16 -11
  144. package/dist/lib/types/core/DOM.d.ts +14 -0
  145. package/dist/lib/types/core/Event.d.ts +12 -6
  146. package/dist/lib/types/core/index.d.ts +2 -2
  147. package/dist/lib/types/layout/Accordion.d.ts +2 -0
  148. package/dist/lib/types/layout/Border.d.ts +1 -0
  149. package/dist/lib/types/layout/CollapseSupport.d.ts +5 -1
  150. package/dist/lib/types/layout/LayoutConstraints.d.ts +1 -0
  151. package/dist/lib/types/layout/LayoutManager.d.ts +2 -0
  152. package/dist/lib/types/layout/Split.d.ts +1 -0
  153. package/dist/lib/types/layout/Tab.d.ts +10 -3
  154. package/dist/lib/types/overlay/AbstractWindow.d.ts +9 -2
  155. package/dist/lib/types/overlay/Dialog.d.ts +6 -0
  156. package/dist/lib/types/overlay/Dock.d.ts +12 -2
  157. package/dist/lib/types/overlay/Drawer.d.ts +5 -0
  158. package/dist/lib/types/overlay/Menu.d.ts +3 -1
  159. package/dist/lib/types/overlay/Notification.d.ts +3 -0
  160. package/dist/lib/types/overlay/Popover.d.ts +3 -1
  161. package/dist/lib/types/overlay/Rail.d.ts +7 -0
  162. package/dist/lib/types/overlay/Tooltip.d.ts +3 -0
  163. package/dist/lib/types/overlay/index.d.ts +1 -1
  164. package/dist/lib/types/router/RoutePattern.d.ts +18 -0
  165. package/dist/lib/types/router/Router.d.ts +36 -0
  166. package/dist/lib/types/router/index.d.ts +2 -0
  167. package/dist/lib/validation.es.js +1 -1
  168. package/llms.txt +9 -5
  169. package/package.json +6 -1
  170. package/dist/lib/AnimatedDropdown-BbGCs70E.js +0 -2
  171. package/dist/lib/AnimatedDropdown-BbGCs70E.js.map +0 -1
  172. package/dist/lib/Border-oZC_SDy8.js +0 -2
  173. package/dist/lib/Border-oZC_SDy8.js.map +0 -1
  174. package/dist/lib/Button-DEUtBqK4.js +0 -2
  175. package/dist/lib/Button-DEUtBqK4.js.map +0 -1
  176. package/dist/lib/ComboBox-GOBOAJ1N.js +0 -2
  177. package/dist/lib/ComboBox-GOBOAJ1N.js.map +0 -1
  178. package/dist/lib/Component-BR2f0Itb.js +0 -2
  179. package/dist/lib/Component-BR2f0Itb.js.map +0 -1
  180. package/dist/lib/Container-3KsvsJ6S.js +0 -2
  181. package/dist/lib/DragManager-tPMnbjeO.js +0 -2
  182. package/dist/lib/FieldDecorator-E7WzutjO.js +0 -2
  183. package/dist/lib/Glyph-WUqTF_Z9.js +0 -2
  184. package/dist/lib/Glyph-WUqTF_Z9.js.map +0 -1
  185. package/dist/lib/GridConstraints-Q3wvuovN.js +0 -2
  186. package/dist/lib/GridConstraints-Q3wvuovN.js.map +0 -1
  187. package/dist/lib/LayoutConstraints-CHI2lhPd.js +0 -2
  188. package/dist/lib/LayoutConstraints-CHI2lhPd.js.map +0 -1
  189. package/dist/lib/LayoutSerialization-CWU0iEuV.js +0 -2
  190. package/dist/lib/LayoutSerialization-CWU0iEuV.js.map +0 -1
  191. package/dist/lib/LayoutSizes-BW4wyGDI.js +0 -2
  192. package/dist/lib/LayoutSizes-BW4wyGDI.js.map +0 -1
  193. package/dist/lib/List-D-GhoVgB.js +0 -2
  194. package/dist/lib/List-D-GhoVgB.js.map +0 -1
  195. package/dist/lib/Menu-Wz4MK6sA.js +0 -2
  196. package/dist/lib/Menu-Wz4MK6sA.js.map +0 -1
  197. package/dist/lib/MenuButton-JQQaKThJ.js +0 -2
  198. package/dist/lib/Panel-DIsdaqc2.js +0 -2
  199. package/dist/lib/Panel-DIsdaqc2.js.map +0 -1
  200. package/dist/lib/Position-B-WfZYAJ.js +0 -2
  201. package/dist/lib/Position-B-WfZYAJ.js.map +0 -1
  202. package/dist/lib/ProgressSpinner-Dzaka7_c.js +0 -2
  203. package/dist/lib/ProgressSpinner-Dzaka7_c.js.map +0 -1
  204. package/dist/lib/RadioButton-eI3-vXn3.js +0 -2
  205. package/dist/lib/RadioButton-eI3-vXn3.js.map +0 -1
  206. package/dist/lib/Scrollbar-DchfiFKC.js +0 -2
  207. package/dist/lib/Scrollbar-DchfiFKC.js.map +0 -1
  208. package/dist/lib/Slider-xRxNSjFN.js +0 -2
  209. package/dist/lib/Slider-xRxNSjFN.js.map +0 -1
  210. package/dist/lib/TabButton-pZKFYg7b.js +0 -2
  211. package/dist/lib/Text-D1RrBY52.js +0 -2
  212. package/dist/lib/Text-D1RrBY52.js.map +0 -1
  213. package/dist/lib/Tooltip-4lU_tf6r.js +0 -3
  214. package/dist/lib/Tooltip-4lU_tf6r.js.map +0 -1
  215. package/dist/lib/VirtualRowView-Con9SWiU.js +0 -2
  216. package/dist/lib/VirtualScroller-BPDmO1ir.js +0 -2
@@ -1,2 +0,0 @@
1
- import{f as e,t}from"./Component-BR2f0Itb.js";var Container=class extends t{clampsToContentSize(){return!1}},n=e(Container);export{n as t};
2
- //# sourceMappingURL=Container-3KsvsJ6S.js.map
@@ -1,2 +0,0 @@
1
- import{t as e,u as t}from"./Position-B-WfZYAJ.js";import{f as n,t as r,y as i}from"./Component-BR2f0Itb.js";import{a}from"./Tooltip-4lU_tf6r.js";import{t as o}from"./Text-D1RrBY52.js";var s=a.Band.Window-1,DragFeedback=class extends r{_valid=!0;constructor(){super(),this.setPosition(e.ABSOLUTE),this.setZIndex(s),this.setPointerEvents(`none`),this.applyTintForValidity()}isValid(){return this._valid}setValid(e){this._valid!==e&&(this._valid=e,this.applyTintForValidity())}attachTo(e,n){let r=this.getElement(!0);if(n&&n!==e){this.setX(e.getX()),this.setY(e.getY()),this.setWidth(e.getWidth()),this.setHeight(e.getHeight());let i=n.getElement(!0);t.source.getParentElement(r)!==i&&t.sink.appendChild(i,r);return}this.setX(0),this.setY(0),this.setWidth(e.getWidth()),this.setHeight(e.getHeight());let i=e.getElement(!0);t.source.getParentElement(r)!==i&&t.sink.appendChild(i,r)}detach(){this.removeElement()}applyTintForValidity(){let e=this._valid?`valid`:`invalid`;this.setBackgroundColor(`var(--ts-ui-drag-feedback-${e}-bg)`),this.setBorder({border:`2px solid var(--ts-ui-drag-feedback-${e}-border)`})}},c=n(DragFeedback),l=10200,u=160,d=28,f=6,DragGhost=class extends r{_label=null;constructor(t,n,r){super(),this.setPosition(e.FIXED),this.setZIndex(l),this.setPointerEvents(`none`),this.setWidth(n??u),this.setHeight(r??d),this.setBackgroundColor(`var(--ts-ui-drag-ghost-bg)`),this.setBorder({border:`1px solid var(--ts-ui-drag-ghost-border)`}),this.setShadow(`var(--ts-ui-drag-ghost-shadow)`),this.setBorderRadius(`var(--ts-ui-border-radius, 4px)`),this.setOpacity(.85),t!==void 0&&(this._label=new o(t),this._label.setPointerEvents(`none`),this.addComponent(this._label))}moveTo(e,t){this.setX(e),this.setY(t)}show(){let e=this.getElement(!0);this.scheduleLayout(),t.sink.appendChild(t.source.getDocumentElement(),e)}hide(){this.removeElement()}doLayout(){if(super.doLayout(),this._label){let e=this.getWidth(),t=this.getHeight();this._label.setX(f),this._label.setY(f),this._label.setWidth(e-f*2),this._label.setHeight(t-f*2)}return this}},p=n(DragGhost),m=a.Band.Window-1,h=2,g=1,ReorderIndicator=class extends r{constructor(){super(),this.setPosition(e.ABSOLUTE),this.setZIndex(m),this.setPointerEvents(`none`),this.setHeight(h),this.setBackgroundColor(`var(--ts-ui-drag-reorder-color)`)}setInsertionY(e){this.setY(e-g)}attachTo(e){let n=e.getElement(!0),r=this.getElement(!0);this.setX(0),this.setWidth(e.getWidth()),t.source.getParentElement(r)!==n&&t.sink.appendChild(n,r)}detach(){this.removeElement()}},_=n(ReorderIndicator),v=new Map,y=1e3,b=4,x=12,S=12,C=new Map,w=new Map,T=null,E;(function(e){function makeDragSource(e,t){return C.set(e.getId(),{component:e,options:t}),e.addMouseDownSubtreeListener(onSourceMouseDown),tearDownDragSource.bind(null,e)}e.makeDragSource=makeDragSource;function makeDropTarget(e,t){return w.set(e.getId(),{component:e,options:t}),tearDownDropTarget.bind(null,e)}e.makeDropTarget=makeDropTarget;function isDragging(){return T!==null&&T.committed}e.isDragging=isDragging;function cancel(){T!==null&&endSession(!1,0,0)}e.cancel=cancel})(E||={});function resolveDragData(e){return typeof e.dragData==`function`?e.dragData():e.dragData}function tearDownDragSource(e){e.removeMouseDownSubtreeListener(onSourceMouseDown),C.delete(e.getId())}function tearDownDropTarget(e){w.delete(e.getId())}function onSourceMouseDown(e){if(T!==null||e.button!==0)return;let n=C.get(this.getId());if(!n)return;let r=n.component,a=n.options;T={source:r,sourceOptions:a,dragData:resolveDragData(a),startX:e.clientX,startY:e.clientY,committed:!1,ghost:null,feedback:null,indicator:null,currentTarget:null,previousBodyCursor:t.source.getInlineStyle(t.source.getBody(),`cursor`)},i.addViewportListener(r,`mousemove`,onMouseMove),i.addViewportListener(r,`mouseup`,onMouseUp)}function commitSession(e){e.committed=!0;let n=e.sourceOptions.ghostFactory?e.sourceOptions.ghostFactory(e.source,e.dragData):new p;if(e.ghost=n,e.feedback=new c,e.indicator=new _,typeof n.show==`function`)n.show();else{let e=n.getElement(!0);t.sink.appendChild(t.source.getDocumentElement(),e)}e.sourceOptions.cursor&&t.sink.apply(t.source.getBody(),{style:{cursor:e.sourceOptions.cursor}})}function buildDetail(e,t,n){return{dragData:e.dragData,sourceId:e.source.getId(),clientX:t,clientY:n}}function pickDropTarget(e,n){let r=t.source.elementsFromPoint(e,n);for(let e of r){let n=w.get(t.source.getId(e));if(n)return n}return null}function leaveCurrentTarget(e,t){if(e.currentTarget===null)return;let n=w.get(e.currentTarget.getId());n&&n.options.onDragLeave&&n.options.onDragLeave(t),e.feedback&&e.feedback.detach(),e.indicator&&e.indicator.detach(),e.currentTarget=null}function enterNewTarget(e,t,n){let r=t.options.accepts(n);if(e.feedback&&!t.options.suppressValidityTint&&(e.feedback.setValid(r),e.feedback.attachTo(t.component,t.options.feedbackHost)),!r){e.currentTarget=t.component;return}let i=t.options.onDragOver?.(n);typeof i==`number`&&e.indicator?(e.indicator.attachTo(t.component),e.indicator.setInsertionY(i)):e.indicator&&e.indicator.detach(),e.currentTarget=t.component}function onMouseMove(e){if(T===null)return;let t=T;if(!t.committed){let n=e.clientX-t.startX,r=e.clientY-t.startY;if(n*n+r*r<b*b)return;let a=buildDetail(t,e.clientX,e.clientY);if(t.sourceOptions.onDragStart?.(a)===!1){endSession(!1,e.clientX,e.clientY);return}commitSession(t),i.fireEvent(t.source,`dragstart`,{detail:a})}if(t.ghost){let n=t.ghost;typeof n.moveTo==`function`?n.moveTo(e.clientX+x,e.clientY+S):(t.ghost.setX(e.clientX+x),t.ghost.setY(e.clientY+S))}let n=buildDetail(t,e.clientX,e.clientY),r=pickDropTarget(e.clientX,e.clientY);if(r===null){leaveCurrentTarget(t,n);return}if(t.currentTarget!==r.component){leaveCurrentTarget(t,n),enterNewTarget(t,r,n);return}let a=r.options.accepts(n);if(t.feedback&&!r.options.suppressValidityTint&&t.feedback.setValid(a),!a){t.indicator&&t.indicator.detach();return}let o=r.options.onDragOver?.(n);typeof o==`number`&&t.indicator?(t.indicator.attachTo(r.component),t.indicator.setInsertionY(o)):t.indicator&&t.indicator.detach()}function onMouseUp(e){if(T===null)return;let t=T,n=buildDetail(t,e.clientX,e.clientY),r=!1;if(t.committed&&t.currentTarget!==null){let e=w.get(t.currentTarget.getId());e&&(e.options.accepts(n)&&e.options.onDrop?.(n)!==!1&&i.fireEvent(t.source,`drop`,{detail:n}),r=!0)}endSession(r,e.clientX,e.clientY)}function endSession(e,n,r){if(T===null)return;let a=T;if(i.removeViewportListener(a.source,`mousemove`,onMouseMove),i.removeViewportListener(a.source,`mouseup`,onMouseUp),a.feedback&&a.feedback.detach(),a.indicator&&a.indicator.detach(),a.ghost){let e=a.ghost;typeof e.hide==`function`?e.hide():a.ghost.removeElement()}if(a.sourceOptions.cursor&&t.sink.apply(t.source.getBody(),{style:{cursor:a.previousBodyCursor}}),a.committed){let t=buildDetail(a,n,r);i.fireEvent(a.source,`dragend`,{detail:t}),a.sourceOptions.onDragEnd?.(t,e)}T=null}export{p as a,_ as i,y as n,c as o,v as r,E as t};
2
- //# sourceMappingURL=DragManager-tPMnbjeO.js.map
@@ -1,2 +0,0 @@
1
- import{f as e,t}from"./Component-BR2f0Itb.js";import{t as n}from"./Tooltip-4lU_tf6r.js";import{t as r}from"./Fit-CFIr4P9R.js";var FieldDecorator=class extends t{constructor(e,t){super(),this.setLayoutManager(new r),this.clearInsets(),this.setBorderRadius(`var(--ts-ui-border-radius)`);let n=e.getPreferredSize();n?this.setPreferredSize(n.width,n.height):this.setPreferredSize(e.getWidth(),e.getHeight()),t.removeComponent(e),t.addComponent(this),this.addComponent(e)}showError(e){return this.setOutline(`2px solid var(--ts-ui-validation-error-border)`),n.attach(this,e,{background:`var(--ts-ui-validation-error-tooltip-bg)`,color:`var(--ts-ui-validation-error-tooltip-color)`,border:`var(--ts-ui-validation-error-tooltip-border)`}),this}clearError(){return this.clearOutline(),n.detach(this),this}},i=e(FieldDecorator);export{i as t};
2
- //# sourceMappingURL=FieldDecorator-E7WzutjO.js.map
@@ -1,2 +0,0 @@
1
- import{u as e}from"./Position-B-WfZYAJ.js";import{_ as t,f as n,h as r,t as i}from"./Component-BR2f0Itb.js";var a=new Map;a.set(`unicode-arrow-up`,{kind:`char`,char:`▲`}),a.set(`unicode-arrow-down`,{kind:`char`,char:`▼`}),a.set(`unicode-arrow-left`,{kind:`char`,char:`◀`}),a.set(`unicode-arrow-right`,{kind:`char`,char:`▶`});var o=`http://www.w3.org/2000/svg`,s=`ts-glyph-`,c=!1,l=null;function registerGlyph(e){a.set(e.name,e),e.kind===`svg`&&c&&_addSymbolToSprite(e.name,e)}function unregisterGlyph(e){let t=a.get(e);a.delete(e),t&&t.kind===`svg`&&c&&_removeSymbolFromSprite(e)}function lookupGlyph(e){return a.get(e)}function ensureGlyphSprite(){if(c)return;let t=e.sink.createElementNS(o,`svg`);e.sink.apply(t,{setAttr:{"aria-hidden":`true`,focusable:`false`},style:{position:`absolute`,width:`0`,height:`0`,overflow:`hidden`}}),e.sink.appendChild(e.source.getBody(),t),l=t,c=!0}function ensureGlyphSymbolMounted(e){if(!c)return;let t=a.get(e);t&&t.kind===`svg`&&_addSymbolToSprite(e,t)}function _addSymbolToSprite(t,n){if(!l||n.kind!==`svg`)return;let r=s+t;if(e.source.querySelector(l,`#${e.source.escapeSelector(r)}`))return;let i=e.sink.createElementNS(o,`symbol`);e.sink.apply(i,{setAttr:{id:r,viewBox:n.viewBox}});let a=e.sink.createElementNS(o,`path`);e.sink.apply(a,{setAttr:{d:n.path}}),e.sink.appendChild(i,a),e.sink.appendChild(l,i)}function _removeSymbolFromSprite(t){if(!l)return;let n=s+t,r=e.source.querySelector(l,`#${e.source.escapeSelector(n)}`);if(r){let t=e.source.querySelector(r,`path`);e.sink.removeChild(l,r),e.sink.release(r),t&&e.sink.release(t)}}var u=`ts-ui-glyph-`,d=new Set,f=!1;function ensureGlyphKeyframes(){f||(f=!0,t.ensureKeyframes(`ts-ui-glyph-spin`,`from { transform: rotate(0deg); } to { transform: rotate(360deg); }`),t.ensureKeyframes(`ts-ui-glyph-pulse`,`0%, 12.5% { transform: rotate(0deg); } 12.5%, 25% { transform: rotate(45deg); } 25%, 37.5% { transform: rotate(90deg); } 37.5%, 50% { transform: rotate(135deg); } 50%, 62.5% { transform: rotate(180deg); } 62.5%, 75% { transform: rotate(225deg); } 75%, 87.5% { transform: rotate(270deg); } 87.5%, 100% { transform: rotate(315deg); }`),t.ensureKeyframes(`ts-ui-glyph-beat`,`0%, 90% { transform: scale(1); } 45% { transform: scale(1.25); }`),new t({scope:`class`,name:`ts-ui-glyph-spin`,styles:{animation:`ts-ui-glyph-spin var(--ts-ui-glyph-spin-duration, 2000ms) linear infinite`}}),new t({scope:`class`,name:`ts-ui-glyph-pulse`,styles:{animation:`ts-ui-glyph-pulse var(--ts-ui-glyph-pulse-duration, 1000ms) steps(8) infinite`}}),new t({scope:`class`,name:`ts-ui-glyph-beat`,styles:{animation:`ts-ui-glyph-beat var(--ts-ui-glyph-beat-duration, 1000ms) ease-in-out infinite`}}))}function _onReducedMotionChange(){for(let e of Array.from(d)){let t=e.deref();if(!t){d.delete(e);continue}t._syncReducedMotion()}}e.source.matchMedia(`(prefers-reduced-motion: reduce)`).addChangeListener(_onReducedMotionChange);var p={preferredSize:{width:16,height:16}},Glyph=class extends i{_name;_def;static register(...e){for(let t of e)registerGlyph(t)}static unregister(e){unregisterGlyph(e)}constructor(e,t){let n=lookupGlyph(e);if(!n)throw Error(`Unknown glyph: `+e);super(t,{...p,tag:n.kind===`svg`?`svg`:`span`}),this._name=e,this._def=n,n.kind===`char`&&(this._options.lineHeight===void 0&&this.setLineHeight(`1`),this._options.textAlign===void 0&&this.setTextAlign(`center`))}setPreferredSize(e,t){return super.setPreferredSize(e,t),super.setMinSize(e,t),super.setMaxSize(e,t),this}getBaseline(){let e=this.getPreferredSize();return e?e.height-3:null}getGlyphName(){return this._name}getFontSize(){return this._options.fontSize??null}setFontSize(e){return this._options.fontSize=e,this.setElementCSSRule(`fontSize`,e+`px`),this}getLineHeight(){let e=this._options.lineHeight;return e===void 0?null:typeof e==`number`?e+`px`:e}setLineHeight(e){return this._options.lineHeight=e,this.setElementCSSRule(`lineHeight`,typeof e==`number`?e+`px`:e),this}getTextAlign(){return this._options.textAlign??null}setTextAlign(e){return this._options.textAlign=e,this.setElementCSSRule(`textAlign`,e),this}getAnimated(){return this._glyphAnimation}setAnimated(t){if(this._glyphAnimation===t)return this;let n=this._glyphAnimation;this._glyphAnimation=t;let i=this.getElement();return i&&n&&e.sink.apply(i,{removeClass:[u+n]}),t===null?(this.setElementStyle(`animationDuration`,null),this.setWillChange(null),this._animatedRef&&=(d.delete(this._animatedRef),null),this):(ensureGlyphKeyframes(),this._animatedRef||(this._animatedRef=new WeakRef(this),d.add(this._animatedRef)),r.isReducedMotion()||(i&&e.sink.apply(i,{addClass:[u+t]}),this.setWillChange(`transform`)),this._glyphAnimationDuration>0&&this.setElementStyle(`animationDuration`,this._glyphAnimationDuration+`ms`),this)}clearAnimated(){return this.setAnimated(null)}getAnimationDuration(){return this._glyphAnimationDuration}setAnimationDuration(e){return this._glyphAnimationDuration=e,this._glyphAnimation!==null&&!r.isReducedMotion()&&this.setElementStyle(`animationDuration`,e>0?e+`ms`:null),this}_syncReducedMotion(){let t=this._glyphAnimation;if(!t)return;let n=this.getElement(!0),i=u+t;r.isReducedMotion()?(e.sink.apply(n,{removeClass:[i]}),this.setWillChange(null),this.setElementStyle(`animationDuration`,null)):(e.sink.apply(n,{addClass:[i]}),this.setWillChange(`transform`),this._glyphAnimationDuration>0&&this.setElementStyle(`animationDuration`,this._glyphAnimationDuration+`ms`))}applyOptions(e){super.applyOptions(e),e.fontSize!==void 0&&this.setFontSize(e.fontSize),e.lineHeight!==void 0&&this.setLineHeight(e.lineHeight),e.textAlign!==void 0&&this.setTextAlign(e.textAlign),e.animationDuration!==void 0&&this.setAnimationDuration(e.animationDuration);let t=this.getPreferredSizeConstraint();return t&&(e.minSize===void 0&&this.setMinSize(t.width,t.height),e.maxSize===void 0&&this.setMaxSize(t.width,t.height)),e.animation!==void 0&&this.setAnimated(e.animation),this}createRootElement(){if(this._def.kind===`svg`){ensureGlyphSprite(),ensureGlyphSymbolMounted(this._name);let t=`http://www.w3.org/2000/svg`,n=e.sink.createElementNS(t,`svg`);e.sink.apply(n,{setAttr:{fill:`currentColor`,"aria-hidden":`true`,focusable:`false`}});let r=e.sink.createElementNS(t,`use`);return e.sink.apply(r,{setAttr:{href:`#`+s+this._name}}),e.sink.appendChild(n,r),this.trackHandle(r),n}return super.createRootElement()}render(){let t=super.render();this._def.kind===`char`&&e.sink.apply(t,{text:this._def.char}),this._glyphAnimation&&!r.isReducedMotion()&&e.sink.apply(t,{addClass:[u+this._glyphAnimation]});let n=this._options.preferredSize;return n&&(this.setElementStyle(`width`,n.width+`px`),this.setElementStyle(`height`,n.height+`px`)),t}},m=n(Glyph);export{m as t};
2
- //# sourceMappingURL=Glyph-WUqTF_Z9.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Glyph-WUqTF_Z9.js","names":[],"sources":["../../src/typescript/lib/component/display/Glyphs.ts","../../src/typescript/lib/component/display/Glyph.ts"],"sourcesContent":["// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle } from \"~/core/DOM.js\";\n\n/**\n * Tagged union describing how a glyph is rendered.\n *\n * @remarks\n * - `kind: \"svg\"` entries supply a `viewBox` and an SVG `<path>` `d` attribute.\n * The path data is mounted once into a shared hidden `<svg>` sprite and each\n * Glyph instance references it via `<svg><use href=\"#...\"/></svg>` so the\n * path string is not duplicated in the DOM.\n * - `kind: \"char\"` entries carry a single Unicode character rendered inside a\n * `<span>`; the character follows the inherited text colour.\n */\nexport type GlyphDef =\n | { kind: \"svg\", viewBox: string; path: string }\n | { kind: \"char\", char: string };\n\n/**\n * A {@link GlyphDef} carrying its own registry name. Glyph modules generated\n * from third-party icon sets export values of this shape so they can be\n * registered in a single call to `Glyph.register(...)`.\n */\nexport type NamedGlyphDef = GlyphDef & { name: string };\n\n/**\n * Mutable registry of named glyphs, populated via `registerGlyph` /\n * `Glyph.register`. Starts empty — consumers register the glyphs they need.\n *\n * @internal\n */\nconst _glyphs: Map<string, GlyphDef> = new Map();\n\n// Built-in Unicode-triangle glyphs registered eagerly. Prefixed `unicode-` so\n// user code can register its own `arrow-up` / `arrow-down` SVG glyphs without\n// overwriting these — built-in chrome like Scrollbar's end-cap buttons\n// references the prefixed names directly and stays immune to user overrides.\n// Char-mode entries are tiny (no sprite, no path data) so the always-on cost\n// is negligible; the triangles inherit the surrounding text colour via\n// `currentColor`, so a single foreground-colour write themes them.\n_glyphs.set(\"unicode-arrow-up\", { kind: \"char\", char: \"▲\" });\n_glyphs.set(\"unicode-arrow-down\", { kind: \"char\", char: \"▼\" });\n_glyphs.set(\"unicode-arrow-left\", { kind: \"char\", char: \"◀\" });\n_glyphs.set(\"unicode-arrow-right\", { kind: \"char\", char: \"▶\" });\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\n/**\n * Prefix applied to every `<symbol>` id inside the sprite. A consumer-supplied\n * registry name `\"xmark\"` becomes the id `\"ts-glyph-xmark\"`, which is what\n * `<use href=\"#ts-glyph-xmark\"/>` references.\n */\nexport const GLYPH_SYMBOL_ID_PREFIX = \"ts-glyph-\";\n\nlet _spriteMounted: boolean = false;\nlet _spriteElement: Handle | null = null;\n\n/**\n * Registers a glyph by name. If the glyph is SVG-mode and the sprite is\n * already mounted, the corresponding `<symbol>` is appended immediately so\n * Glyphs constructed after this call can reference it.\n *\n * @internal\n */\nexport function registerGlyph(def: NamedGlyphDef): void {\n _glyphs.set(def.name, def);\n\n if (def.kind === \"svg\" && _spriteMounted) {\n _addSymbolToSprite(def.name, def);\n }\n}\n\n/**\n * Removes a glyph from the registry by name. If the glyph was SVG-mode and\n * the sprite is mounted, its `<symbol>` is removed from the DOM as well.\n *\n * @internal\n */\nexport function unregisterGlyph(name: string): void {\n const def = _glyphs.get(name);\n _glyphs.delete(name);\n\n if (def && def.kind === \"svg\" && _spriteMounted) {\n _removeSymbolFromSprite(name);\n }\n}\n\n/**\n * Looks up a glyph definition by registry name.\n *\n * @returns The registered {@link GlyphDef}, or `undefined` if not registered.\n *\n * @internal\n */\nexport function lookupGlyph(name: string): GlyphDef | undefined {\n return _glyphs.get(name);\n}\n\n/**\n * Ensures the document carries a single hidden `<svg>` sprite that hosts the\n * `<symbol>` elements for every SVG-mode glyph. Idempotent — subsequent calls\n * are no-ops. The sprite starts empty; entries are appended incrementally\n * either by {@link registerGlyph} (after the sprite is mounted) or by\n * {@link ensureGlyphSymbolMounted} (when a Glyph instance is constructed).\n *\n * @internal\n */\nexport function ensureGlyphSprite(): void {\n if (_spriteMounted) {\n return;\n }\n\n const sprite = DOM.sink.createElementNS(SVG_NS, \"svg\");\n // `sprite` is a raw off-screen SVG element mounted directly on document.body,\n // not a Component, so the Component style setters don't apply here.\n DOM.sink.apply(sprite, {\n setAttr: { \"aria-hidden\": \"true\", focusable: \"false\" },\n style: { position: \"absolute\", width: \"0\", height: \"0\", overflow: \"hidden\" },\n });\n\n DOM.sink.appendChild(DOM.source.getBody(), sprite);\n\n _spriteElement = sprite;\n _spriteMounted = true;\n}\n\n/**\n * Ensures the sprite carries a `<symbol>` for the named SVG-mode glyph,\n * appending it on demand for glyphs registered before the sprite was mounted.\n * Idempotent.\n *\n * @internal\n */\nexport function ensureGlyphSymbolMounted(name: string): void {\n if (!_spriteMounted) {\n return;\n }\n\n const def = _glyphs.get(name);\n if (def && def.kind === \"svg\") {\n _addSymbolToSprite(name, def);\n }\n}\n\n/**\n * Appends a `<symbol>` for the given SVG-mode glyph to the sprite. Idempotent:\n * a no-op when a `<symbol>` with the same id already exists.\n *\n * @internal\n */\nfunction _addSymbolToSprite(name: string, def: GlyphDef): void {\n if (!_spriteElement || def.kind !== \"svg\") {\n return;\n }\n\n const id = GLYPH_SYMBOL_ID_PREFIX + name;\n if (DOM.source.querySelector(_spriteElement, `#${DOM.source.escapeSelector(id)}`)) {\n return;\n }\n\n const symbol = DOM.sink.createElementNS(SVG_NS, \"symbol\");\n DOM.sink.apply(symbol, { setAttr: { id: id, viewBox: def.viewBox } });\n\n const path = DOM.sink.createElementNS(SVG_NS, \"path\");\n DOM.sink.apply(path, { setAttr: { d: def.path } });\n DOM.sink.appendChild(symbol, path);\n\n DOM.sink.appendChild(_spriteElement, symbol);\n}\n\n/**\n * Removes the `<symbol>` for the given glyph name from the sprite, if present.\n *\n * @internal\n */\nfunction _removeSymbolFromSprite(name: string): void {\n if (!_spriteElement) {\n return;\n }\n\n const id = GLYPH_SYMBOL_ID_PREFIX + name;\n const symbol = DOM.source.querySelector(_spriteElement, `#${DOM.source.escapeSelector(id)}`);\n if (symbol) {\n // Release the symbol's retained `<path>` child too — releasing only the\n // symbol would pin the detached path handle in the registry. Queried\n // before removal so it resolves to its canonical retained handle.\n const path = DOM.source.querySelector(symbol, \"path\");\n\n DOM.sink.removeChild(_spriteElement, symbol);\n DOM.sink.release(symbol);\n\n if (path) {\n DOM.sink.release(path);\n }\n }\n}\n","// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0\n\nimport { Animation } from \"~/core/Animation.js\";\nimport { Component, ComponentOptions } from \"~/core/Component.js\";\nimport { DOM } from \"~/core/DOM.js\";\nimport type { Handle } from \"~/core/DOM.js\";\nimport { StyleRule } from \"~/core/StyleTarget.js\";\nimport { callable } from \"~/core/Callable.js\";\nimport {\n ensureGlyphSprite,\n ensureGlyphSymbolMounted,\n GLYPH_SYMBOL_ID_PREFIX,\n GlyphDef,\n lookupGlyph,\n NamedGlyphDef,\n registerGlyph,\n unregisterGlyph,\n} from \"~/component/display/Glyphs.js\";\n\n/**\n * Named animation kinds supported by {@link Glyph.setAnimated}.\n *\n * - `spin` — continuous 360 degree rotate. Loading and refresh affordances.\n * - `pulse` — 8-step rotate. Mechanical, faux-loading tick.\n * - `beat` — transform-scale pulse. Notification dots and attention nudges.\n *\n * Mirrors FontAwesome's `fa-spin` / `fa-pulse` / `fa-beat` vocabulary.\n *\n * @category Components\n */\nexport type GlyphAnimation = \"spin\" | \"pulse\" | \"beat\";\n\n/**\n * CSS class prefix shared by all three animation rules. The full class name\n * is `ts-ui-glyph-<kind>` (e.g. `ts-ui-glyph-spin`).\n */\nconst CLASS_PREFIX = \"ts-ui-glyph-\";\n\n/**\n * Registry of `WeakRef<Glyph>` for currently-animated instances. A single\n * module-level `matchMedia` listener walks this set on OS preference changes\n * and re-applies the class to match. `WeakRef` lets the GC collect unrooted\n * glyphs without an explicit deregister-on-disposal step.\n */\nconst _animatedRefs: Set<WeakRef<Glyph>> = new Set();\n\nlet _keyframesInjected = false;\n\n/**\n * Injects the three `@keyframes` blocks and matching class rules on first\n * use. Idempotent — guarded by the module-level `_keyframesInjected` flag.\n */\nfunction ensureGlyphKeyframes(): void {\n if (_keyframesInjected) {\n return;\n }\n\n _keyframesInjected = true;\n\n StyleRule.ensureKeyframes(\"ts-ui-glyph-spin\",\n \"from { transform: rotate(0deg); } to { transform: rotate(360deg); }\");\n\n StyleRule.ensureKeyframes(\"ts-ui-glyph-pulse\",\n \"0%, 12.5% { transform: rotate(0deg); } \" +\n \"12.5%, 25% { transform: rotate(45deg); } \" +\n \"25%, 37.5% { transform: rotate(90deg); } \" +\n \"37.5%, 50% { transform: rotate(135deg); } \" +\n \"50%, 62.5% { transform: rotate(180deg); } \" +\n \"62.5%, 75% { transform: rotate(225deg); } \" +\n \"75%, 87.5% { transform: rotate(270deg); } \" +\n \"87.5%, 100% { transform: rotate(315deg); }\");\n\n StyleRule.ensureKeyframes(\"ts-ui-glyph-beat\",\n \"0%, 90% { transform: scale(1); } 45% { transform: scale(1.25); }\");\n\n new StyleRule({\n scope: \"class\",\n name: CLASS_PREFIX + \"spin\",\n styles: {\n animation: \"ts-ui-glyph-spin var(--ts-ui-glyph-spin-duration, 2000ms) linear infinite\",\n },\n });\n\n new StyleRule({\n scope: \"class\",\n name: CLASS_PREFIX + \"pulse\",\n styles: {\n animation: \"ts-ui-glyph-pulse var(--ts-ui-glyph-pulse-duration, 1000ms) steps(8) infinite\",\n },\n });\n\n new StyleRule({\n scope: \"class\",\n name: CLASS_PREFIX + \"beat\",\n styles: {\n animation: \"ts-ui-glyph-beat var(--ts-ui-glyph-beat-duration, 1000ms) ease-in-out infinite\",\n },\n });\n}\n\n/**\n * Module-level listener that re-evaluates every animated glyph when the OS\n * `prefers-reduced-motion` preference flips. Dead `WeakRef`s are pruned.\n */\nfunction _onReducedMotionChange(): void {\n for (const ref of Array.from(_animatedRefs)) {\n const glyph = ref.deref();\n if (!glyph) {\n _animatedRefs.delete(ref);\n continue;\n }\n\n glyph._syncReducedMotion();\n }\n}\n\n// The seam's `matchMedia` degrades to an inert result off-browser, so this\n// module-level registration needs no environment guard of its own.\nDOM.source.matchMedia(\"(prefers-reduced-motion: reduce)\").addChangeListener(_onReducedMotionChange);\n\n/**\n * Construction-time options for {@link Glyph}.\n *\n * @category Components\n */\nexport interface GlyphOptions extends ComponentOptions {\n\n /**\n * CSS `font-size` override in pixels. Only meaningful for char-mode\n * glyphs (SVG glyphs paint via `<use>` and ignore font-size). Useful when\n * the inherited font-size produces a line-box taller than the glyph's\n * element box and the Unicode character overflows or gets clipped.\n */\n fontSize?: number;\n\n /**\n * CSS `line-height` override. A number is interpreted as pixels (e.g.\n * `24` → `\"24px\"`); a string is used verbatim (e.g. `\"1\"` for the\n * unitless font-size multiplier used by char-mode glyphs).\n */\n lineHeight?: number | string;\n\n /**\n * CSS `text-align` keyword (e.g. `\"left\"`, `\"center\"`, `\"right\"`).\n * Char-mode glyphs default to `\"center\"`; SVG-mode glyphs leave this\n * unset.\n */\n textAlign?: string;\n\n /**\n * Optional animation kind to play on this glyph from construction.\n */\n animation?: GlyphAnimation;\n\n /**\n * Optional override (ms) for the active animation's duration. Wins over\n * the theme-token default while non-zero. Ignored when `animation` is\n * unset.\n */\n animationDuration?: number;\n}\n\n/**\n * User-overridable defaults forwarded to `super` via the options bag. The\n * cascade dispatches each present setter once with the final value. Only\n * defaults that apply unconditionally for every Glyph kind live here — the\n * char-only `lineHeight`/`textAlign` defaults stay in the constructor body\n * because they depend on the per-instance `def.kind`.\n */\nconst _defaultGlyphOptions: Partial<GlyphOptions> = {\n preferredSize: { width: 16, height: 16 } as GlyphOptions[\"preferredSize\"],\n};\n\n/**\n * A small icon rendered from the internal `Glyphs` registry.\n *\n * @remarks\n * Each registry entry is either an SVG or a single Unicode character. SVG\n * entries are rendered as `<svg><use href=\"#…\"/></svg>` against a hidden\n * sprite mounted once into `document.body`, so the path data lives in the\n * DOM exactly once regardless of how many Glyph instances reference it.\n * Unicode entries render as `<span>`. Both forms render with `currentColor`,\n * so a `Glyph` inherits the surrounding text colour for free. The underlying\n * root tag is decided once at construction from the entry's `kind` and\n * cannot be changed afterwards — to swap glyph, discard the instance and\n * create a new one.\n *\n * Pass any registry name to the constructor; unknown names throw at\n * construction. The default preferred size is 16×16.\n *\n * @example\n * ```typescript\n * import { xmark } from \"~/glyphs/solid/xmark.js\";\n * import { arrow_right } from \"~/glyphs/solid/arrow_right.js\";\n *\n * Glyph.register(xmark, arrow_right);\n *\n * panel.addComponent(new Glyph(\"xmark\"));\n * panel.addComponent(new Glyph(\"arrow-right\"));\n * ```\n *\n * @category Components\n */\nclass Glyph extends Component<GlyphOptions> {\n\n private _name: string;\n private _def: GlyphDef;\n declare private _glyphAnimation: GlyphAnimation | null;\n declare private _glyphAnimationDuration: number;\n declare private _animatedRef: WeakRef<Glyph> | null;\n\n /**\n * Registers one or more glyph definitions so they can be instantiated by\n * name. Pass the named exports from `~/glyphs/<style>/<name>.js` modules.\n *\n * @param defs - One or more {@link NamedGlyphDef} values to register.\n */\n static register(...defs: NamedGlyphDef[]): void {\n for (const def of defs) {\n registerGlyph(def);\n }\n }\n\n /**\n * Removes a previously registered glyph by name.\n *\n * @param name - Registry key to unregister.\n */\n static unregister(name: string): void {\n unregisterGlyph(name);\n }\n\n /**\n * Constructs a Glyph for the registry entry with the given name.\n *\n * @param name - Registry key. Must have been registered via {@link Glyph.register}.\n * @param options - Optional component options bag.\n */\n constructor(name: string, options?: GlyphOptions) {\n const def = lookupGlyph(name);\n if (!def) {\n throw new Error(\"Unknown glyph: \" + name);\n }\n\n // Hand defaults plus the per-instance tag (chosen from the registry\n // entry's `kind`) to Component via the subclass-defaults arg so they\n // land in `_defaultOptions`. Component's super-time cascade applies\n // them; user `options` win because `applyOptions` merges\n // `{...defaults, ...options}` at dispatch time.\n super(options, {\n ..._defaultGlyphOptions,\n tag: def.kind === \"svg\" ? \"svg\" : \"span\",\n });\n\n this._name = name;\n this._def = def;\n\n // Char-mode glyphs need a line-height and text-align that SVG glyphs\n // should not get. Keep these guards in the constructor body since they\n // depend on per-instance `def.kind` rather than a static default.\n if (def.kind === \"char\") {\n if (this._options.lineHeight === undefined) {\n this.setLineHeight(\"1\");\n }\n\n if (this._options.textAlign === undefined) {\n this.setTextAlign(\"center\");\n }\n }\n }\n\n /**\n * Sets the preferred size and pins minSize/maxSize to the same value so\n * the glyph stays rigid in flexible layouts — HBox's shrink-on-overflow\n * logic and any grow path see equal min/pref/max and leave the glyph at\n * its configured size. Callers can still override the lock by calling\n * `setMinSize` / `setMaxSize` explicitly after this method.\n *\n * @param width - The preferred width in pixels.\n * @param height - The preferred height in pixels.\n *\n * @returns This component, for method chaining.\n */\n setPreferredSize(width: number, height: number): this {\n super.setPreferredSize(width, height);\n super.setMinSize(width, height);\n super.setMaxSize(width, height);\n\n return this;\n }\n\n /**\n * Returns a baseline near the bottom edge so the glyph participates in\n * baseline alignment — sitting with its ink roughly on the surrounding text\n * baseline when placed next to labels — instead of being vertically centred\n * in the row. The anchor is 4px above the bottom edge (vs 2px on the\n * bar-shaped controls), which drops a square icon slightly lower so its ink\n * lands on the text baseline rather than floating above it.\n *\n * @returns The preferred height minus 4, or `null` before a size is set.\n */\n getBaseline(): number | null {\n const size = this.getPreferredSize();\n\n return size ? size.height - 3 : null;\n }\n\n /**\n * Returns the registry name this Glyph was constructed with. Named\n * `getGlyphName` rather than `getName` so it does not shadow\n * [`Component.getName`](/api/core/classes/Component#getname), whose\n * intrinsic `name` is a display label with a different meaning.\n *\n * @returns The registry key supplied to the constructor.\n */\n getGlyphName(): string {\n return this._name;\n }\n\n /**\n * Returns the explicit CSS `font-size` override (in pixels) written by\n * this Glyph, or `null` when no override has been written (the element\n * inherits the parent's font-size).\n *\n * @returns The cached font-size in pixels, or null.\n */\n getFontSize(): number | null {\n return this._options.fontSize ?? null;\n }\n\n /**\n * Overrides the CSS `font-size` of this Glyph's root element. Useful when\n * the ambient inherited font-size produces a line-box taller than the\n * glyph's `preferredSize`, causing the Unicode character to overflow or\n * get clipped by the element's `overflow: hidden`. No-op visually for\n * SVG glyphs (which size via `viewBox`), but the rule is written regardless.\n *\n * @param value - The new font-size in pixels.\n * @returns This Glyph, for method chaining.\n */\n setFontSize(value: number): this {\n this._options.fontSize = value;\n this.setElementCSSRule(\"fontSize\", value + \"px\");\n\n return this;\n }\n\n /**\n * Returns the current CSS `line-height` value written by this Glyph, or\n * `null` if no rule has been written (the element inherits the parent's\n * line-height).\n *\n * @returns The cached line-height CSS value (e.g. `\"1\"`, `\"24px\"`), or null.\n *\n * @remarks\n * Char-mode glyphs construct with `\"1\"`; SVG-mode glyphs default to null.\n * Use this getter rather than reading `element.style.lineHeight` to avoid\n * a forced style read.\n */\n getLineHeight(): string | null {\n const value = this._options.lineHeight;\n if (value === undefined) {\n return null;\n }\n\n return typeof value === \"number\" ? value + \"px\" : value;\n }\n\n /**\n * Overrides the CSS `line-height` of this Glyph's root element.\n *\n * @param value - Pixel number (e.g. `24` → `\"24px\"`) or a raw CSS\n * line-height value (e.g. `\"1\"` for the unitless\n * font-size multiplier used by char-mode glyphs).\n * @returns This Glyph, for method chaining.\n *\n * @remarks\n * Char-mode glyphs construct with `line-height: 1`, which keeps Unicode\n * characters like `▲` / `▼` snug against the top of their box. When a\n * Glyph is sized larger than its natural char height and needs to\n * vertically centre within that box, callers can match the line-height to\n * the element height to push the line-box to the middle. No-op visually\n * for SVG glyphs (which size via `viewBox`), but the rule is written\n * regardless.\n */\n setLineHeight(value: number | string): this {\n this._options.lineHeight = value;\n this.setElementCSSRule(\"lineHeight\", typeof value === \"number\" ? value + \"px\" : value);\n\n return this;\n }\n\n /**\n * Returns the current CSS `text-align` value written by this Glyph, or\n * `null` if no rule has been written (the element inherits the parent's\n * text-align).\n *\n * @returns The cached text-align CSS value (e.g. `\"center\"`), or null.\n *\n * @remarks\n * Char-mode glyphs construct with `\"center\"` to keep the Unicode\n * character horizontally centred within its element box; SVG-mode glyphs\n * default to null. Use this getter rather than reading\n * `element.style.textAlign` to avoid a forced style read.\n */\n getTextAlign(): string | null {\n return this._options.textAlign ?? null;\n }\n\n /**\n * Overrides the CSS `text-align` of this Glyph's root element.\n *\n * @param value - A CSS `text-align` keyword such as `\"left\"`, `\"center\"`,\n * `\"right\"`, `\"start\"`, or `\"end\"`.\n * @returns This Glyph, for method chaining.\n */\n setTextAlign(value: string): this {\n this._options.textAlign = value;\n this.setElementCSSRule(\"textAlign\", value);\n\n return this;\n }\n\n /**\n * Returns the currently-playing animation kind, or `null` when none is\n * active.\n *\n * @returns The active {@link GlyphAnimation}, or `null`.\n */\n getAnimated(): GlyphAnimation | null {\n return this._glyphAnimation;\n }\n\n /**\n * Starts the named animation, or stops the current one when `kind` is\n * `null`. No-op when the requested kind already matches the current one.\n *\n * @param kind - A {@link GlyphAnimation} value or `null` to stop.\n * @returns This Glyph, for method chaining.\n *\n * @remarks\n * Adds the corresponding `ts-ui-glyph-<kind>` class to the root element.\n * Honours [`Animation.isReducedMotion`](/api/core/namespaces/Animation/functions/isReducedMotion):\n * when reduced-motion is on, the class is not mounted but the requested\n * kind is cached and a module-level listener re-applies it should the OS\n * preference flip back. While motion is active, `will-change: transform`\n * is set via [`Component.setWillChange`](/api/core/classes/Component#setwillchange);\n * cleared when motion stops.\n *\n * Differs from the inherited `Component.setAnimation(value: string)`:\n * this is a typed-enum surface that toggles a pre-registered class rule;\n * the inherited setter accepts a raw CSS shorthand and writes a\n * per-component `#id { animation: … }` rule.\n *\n * @example\n * ```typescript\n * const g = new Glyph(\"xmark\");\n * g.setAnimated(\"spin\");\n * g.setAnimated(null); // stop\n * ```\n */\n setAnimated(kind: GlyphAnimation | null): this {\n if (this._glyphAnimation === kind) {\n return this;\n }\n\n const prev = this._glyphAnimation;\n this._glyphAnimation = kind;\n\n const el = this.getElement();\n\n if (el && prev) {\n DOM.sink.apply(el, { removeClass: [CLASS_PREFIX + prev] });\n }\n\n if (kind === null) {\n this.setElementStyle(\"animationDuration\", null);\n this.setWillChange(null);\n\n if (this._animatedRef) {\n _animatedRefs.delete(this._animatedRef);\n this._animatedRef = null;\n }\n\n return this;\n }\n\n ensureGlyphKeyframes();\n\n if (!this._animatedRef) {\n this._animatedRef = new WeakRef(this);\n _animatedRefs.add(this._animatedRef);\n }\n\n if (!Animation.isReducedMotion()) {\n if (el) {\n DOM.sink.apply(el, { addClass: [CLASS_PREFIX + kind] });\n }\n\n this.setWillChange(\"transform\");\n }\n\n if (this._glyphAnimationDuration > 0) {\n this.setElementStyle(\"animationDuration\", this._glyphAnimationDuration + \"ms\");\n }\n\n return this;\n }\n\n /**\n * Stops the current animation. Equivalent to `setAnimated(null)`.\n *\n * @returns This Glyph, for method chaining.\n */\n clearAnimated(): this {\n return this.setAnimated(null);\n }\n\n /**\n * Returns the override duration (ms) set via {@link setAnimationDuration},\n * or `0` when no override is active. Read the active CSS custom property\n * (`--ts-ui-glyph-<kind>-duration`) for the live value when no override\n * is set.\n *\n * @returns The override duration in ms, or `0`.\n */\n getAnimationDuration(): number {\n return this._glyphAnimationDuration;\n }\n\n /**\n * Overrides the active animation's duration. Pass `0` to clear the\n * override and fall back to the theme-token default. No visible effect\n * when no animation is currently set, but the override is cached and\n * will apply on the next {@link setAnimated} call.\n *\n * @param ms - Duration in milliseconds, or `0` to clear.\n * @returns This Glyph, for method chaining.\n */\n setAnimationDuration(ms: number): this {\n this._glyphAnimationDuration = ms;\n\n if (this._glyphAnimation !== null && !Animation.isReducedMotion()) {\n this.setElementStyle(\"animationDuration\", ms > 0 ? ms + \"ms\" : null);\n }\n\n return this;\n }\n\n /**\n * Re-applies (or removes) the animation class to match the current\n * `prefers-reduced-motion` state. Called by the module-level listener\n * when the OS preference flips. Internal; not part of the public API.\n */\n _syncReducedMotion(): void {\n const kind = this._glyphAnimation;\n if (!kind) {\n return;\n }\n\n const element = this.getElement(true)!;\n const className = CLASS_PREFIX + kind;\n\n if (Animation.isReducedMotion()) {\n DOM.sink.apply(element, { removeClass: [className] });\n this.setWillChange(null);\n this.setElementStyle(\"animationDuration\", null);\n } else {\n DOM.sink.apply(element, { addClass: [className] });\n this.setWillChange(\"transform\");\n\n if (this._glyphAnimationDuration > 0) {\n this.setElementStyle(\"animationDuration\", this._glyphAnimationDuration + \"ms\");\n }\n }\n }\n\n /**\n * Applies a {@link GlyphOptions} bag by dispatching each present field to\n * its corresponding setter.\n *\n * @param options - The options bag carrying the values to apply.\n * @returns This Glyph, for method chaining.\n */\n protected applyOptions(options: GlyphOptions): this {\n super.applyOptions(options);\n\n if (options.fontSize !== undefined) {\n this.setFontSize(options.fontSize);\n }\n\n if (options.lineHeight !== undefined) {\n this.setLineHeight(options.lineHeight);\n }\n\n if (options.textAlign !== undefined) {\n this.setTextAlign(options.textAlign);\n }\n\n if (options.animationDuration !== undefined) {\n this.setAnimationDuration(options.animationDuration);\n }\n\n // Re-pin minSize / maxSize to the current preferred size so the glyph\n // stays rigid in flexible layouts. The inherited cascade has just\n // overwritten the pin from `setPreferredSize` with Component's `{0,0}`\n // minSize / `{MAX,MAX}` maxSize defaults; restore it here, but honour\n // an explicit `options.minSize` / `options.maxSize` from the caller.\n const pref = this.getPreferredSizeConstraint();\n if (pref) {\n if (options.minSize === undefined) {\n this.setMinSize(pref.width, pref.height);\n }\n\n if (options.maxSize === undefined) {\n this.setMaxSize(pref.width, pref.height);\n }\n }\n\n if (options.animation !== undefined) {\n this.setAnimated(options.animation);\n }\n\n return this;\n }\n\n /**\n * Creates the root element, using the SVG namespace when the registry\n * entry is an SVG definition. SVG instances reference a shared sprite\n * symbol rather than inlining the path data.\n *\n * @returns The root element for this Glyph (HTML `<span>` or SVG `<svg>`).\n */\n protected createRootElement(): Handle {\n if (this._def.kind === \"svg\") {\n ensureGlyphSprite();\n ensureGlyphSymbolMounted(this._name);\n\n const svgNs = \"http://www.w3.org/2000/svg\";\n const svg = DOM.sink.createElementNS(svgNs, \"svg\");\n DOM.sink.apply(svg, { setAttr: { fill: \"currentColor\", \"aria-hidden\": \"true\", focusable: \"false\" } });\n\n const use = DOM.sink.createElementNS(svgNs, \"use\");\n DOM.sink.apply(use, { setAttr: { href: \"#\" + GLYPH_SYMBOL_ID_PREFIX + this._name } });\n DOM.sink.appendChild(svg, use);\n\n // Track the `<use>` child so it is released with the glyph (the root\n // `svg` is tracked by Component.render). Released on destructor or GC.\n this.trackHandle(use);\n\n return svg;\n }\n\n return super.createRootElement();\n }\n\n /**\n * Populates the rendered element. For char-mode glyphs the character is\n * written into the span's text content; SVG-mode element children are\n * created by `createRootElement`.\n *\n * Applies `preferredSize` as inline width/height so SVG glyphs appended\n * raw via `glyph.getElement(true)` outside a framework layout don't fall\n * back to the user-agent's 300×150 default replaced-element size.\n *\n * @returns The rendered root element.\n */\n protected render(): Handle {\n const element = super.render();\n\n if (this._def.kind === \"char\") {\n DOM.sink.apply(element, { text: this._def.char });\n }\n\n if (this._glyphAnimation && !Animation.isReducedMotion()) {\n DOM.sink.apply(element, { addClass: [CLASS_PREFIX + this._glyphAnimation] });\n }\n\n const preferredSize = this._options.preferredSize;\n if (preferredSize) {\n this.setElementStyle(\"width\", preferredSize.width + \"px\");\n this.setElementStyle(\"height\", preferredSize.height + \"px\");\n }\n\n return element;\n }\n}\n\nconst GlyphCallable = callable(Glyph);\ntype GlyphCallable = Glyph;\nexport {\n Glyph as _Glyph,\n GlyphCallable as Glyph\n};\n"],"mappings":"4GAiCA,IAAM,EAAiC,IAAI,IAS3C,EAAQ,IAAI,mBAAuB,CAAE,KAAM,OAAQ,KAAM,GAAI,CAAC,EAC9D,EAAQ,IAAI,qBAAuB,CAAE,KAAM,OAAQ,KAAM,GAAI,CAAC,EAC9D,EAAQ,IAAI,qBAAuB,CAAE,KAAM,OAAQ,KAAM,GAAI,CAAC,EAC9D,EAAQ,IAAI,sBAAuB,CAAE,KAAM,OAAQ,KAAM,GAAI,CAAC,EAE9D,IAAM,EAAS,6BAOF,EAAyB,YAElC,EAAiC,GACjC,EAAgC,KASpC,SAAgB,cAAc,EAA0B,CACpD,EAAQ,IAAI,EAAI,KAAM,CAAG,EAErB,EAAI,OAAS,OAAS,GACtB,mBAAmB,EAAI,KAAM,CAAG,CAExC,CAQA,SAAgB,gBAAgB,EAAoB,CAChD,IAAM,EAAM,EAAQ,IAAI,CAAI,EAC5B,EAAQ,OAAO,CAAI,EAEf,GAAO,EAAI,OAAS,OAAS,GAC7B,wBAAw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AAC,EAGhD,KAAK,iBAAmB,CAAC,EAAU,gBAAgB,GACnD,EAAI,KAAK,MAAM,EAAS,CAAE,SAAU,CAAC,EAAe,KAAK,eAAe,CAAE,CAAC,EAG/E,IAAM,EAAgB,KAAK,SAAS,cAMpC,OALI,IACA,KAAK,gBAAgB,QAAU,EAAc,MAAS,IAAI,EAC1D,KAAK,gBAAgB,SAAU,EAAc,OAAS,IAAI,GAGvD,CACX,CACJ,EAEM,EAAgB,EAAS,KAAK"}
@@ -1,2 +0,0 @@
1
- import{a as e,l as t,n,u as r}from"./Position-B-WfZYAJ.js";import{_ as i,f as a,h as o,l as s,t as c,u as l,y as u}from"./Component-BR2f0Itb.js";import{t as d}from"./ListenerBag-WPdKuuds.js";import{t as f}from"./HBox-Q8y1PHlk.js";import{i as p,n as m,t as h}from"./LayoutSizes-BW4wyGDI.js";import{n as g}from"./Border-oZC_SDy8.js";import{t as _}from"./LayoutConstraints-CHI2lhPd.js";import{t as v}from"./Button-DEUtBqK4.js";var y=14,b=`▶`,x=null;function ensureAccordionIndicatorClassRule(){x||=new i({scope:`class`,name:`AccordionIndicator`,styles:{textAlign:`center`,pointerEvents:`none`,fontSize:`10px`,color:`var(--ts-ui-accordion-indicator-color, rgb(100,100,100))`,transition:`transform 200ms ease`}})}var AccordionIndicator=class extends c{_lineHeight=null;constructor(e){ensureAccordionIndicatorClassRule(),super({tag:`span`,preferredSize:{width:y,height:y},...e??{}}),this._expanded??=!1,this._character??=b,this.createStyleRule(`.expanded`).set(`transform`,`rotate(90deg)`)}setLineHeight(e){return this._lineHeight===e?this:(this._lineHeight=e,this.setElementCSSRule(`lineHeight`,e+`px`),this)}setHeight(e){return super.setHeight(e),this.setLineHeight(e),this}applyOptions(e){return super.applyOptions(e),e.expanded!==void 0&&this.setExpanded(e.expanded),e.character!==void 0&&this.setCharacter(e.character),this}getCharacter(){return this._character??b}setCharacter(e){this._character=e;let t=this.getElement();return t&&r.sink.apply(t,{text:e}),this}render(){let e=super.render();return r.sink.apply(e,{text:this._character??b}),this._expanded&&r.sink.apply(e,{addClass:[`expanded`]}),e}getExpanded(){return this._expanded}setExpanded(e){this._expanded=e;let t=this.getElement();return t&&r.sink.apply(t,{toggleClass:{expanded:e}}),this}clearExpanded(){return this.setExpanded(!1)}setAnimationTiming(e,t){return this.setTransition(`transform ${e}ms ${t}`),this}},S=a(AccordionIndicator),C=8,w=10,T=4,E=6,D=6,O=2,AccordionHeader=class extends c{_tools=[];_chevronSide=`end`;constructor(e,t){super({tag:`div`,...t}),this._indicator=new S({character:t?.chevronGlyph}),this._title=new v(e,{chromeless:!0,anchor:l.WEST,glyph:t?.glyph}),this._toolGroup=new c,this._toolGroup.setLayoutManager(new f({spacing:T,stretching:!0})),this._toolGroup.setBackgroundColor(`transparent`),this.setLayoutManager(new f({spacing:T,stretching:!0}));let n=new _;n.weight=1,this.addComponent(this._title,n),this.addComponent(this._toolGroup),this._chevronSide=t?.chevronSide??`end`,this.placeIndicator(),this.setExpanded(t?.expanded??!1),this.setCompact(t?.compact??!1)}setCompact(e){let t=e?E:C,r=e?D:w;return this.setInsets(new n(0,r,0,t)),this.getLayoutManager().setComponentSpacing(e?O:T),this._title?.setCompact(e),this.scheduleLayout(),this}placeIndicator(){this.getComponents().includes(this._indicator)&&this.removeComponent(this._indicator),this._chevronSide===`start`?this.insertComponent(this._indicator,0):this.addComponent(this._indicator)}getTitleButton(){return this._title}setExpanded(e){return this._indicator?.setExpanded(e),this._title?.getAria().setExpanded(e),this}isExpanded(){return this._indicator?.getExpanded()??!1}setChevronSide(e){return this._chevronSide===e?this:(this._chevronSide=e,this.placeIndicator(),this.scheduleLayout(),this)}getChevronSide(){return this._chevronSide}setChevronGlyph(e){return this._indicator?.setCharacter(e),this}addTool(e){return e instanceof v&&e.setFlat(!0),this._tools.includes(e)?this:(this._tools.push(e),this._toolGroup.addComponent(e),this.scheduleLayout(),this)}removeTool(e){let t=this._tools.indexOf(e);return t===-1?this:(this._tools.splice(t,1),this._toolGroup.removeComponent(e),this.scheduleLayout(),this)}setToolsRevealed(e){return this._toolGroup.setDisplayed(e),this}setAnimationTiming(e,t){return this._indicator?.setAnimationTiming(e,t),this}},k=a(AccordionHeader),A=`cubic-bezier(0.4, 0, 0.6, 1)`,j=22,M=6,N=1e-6,P=`var(--ts-ui-accordion-header-bg, rgb(243,244,246))`,F=`var(--ts-ui-accordion-header-border, 1px solid rgb(214,217,222))`,I=`var(--ts-ui-accordion-header-color, inherit)`,L=`var(--ts-ui-accordion-border, 1px solid rgb(214,217,222))`,Accordion=class extends s{_headers=[];_panelWrappers=[];_openState=[];_singleOpen=!1;_headerHeight=28;_headerHeightExplicit=!1;_compact=!1;_animationDuration=200;_chevronSide=`end`;_chevronGlyph=null;_spacing=0;_themed=!0;_fillHeight=!1;_tools=[];_toolsVisibility=`hover`;_hoveredHeader=-1;_listeners=new d;_resizable=!1;_resizeSizes=new Map;_pendingSectionSizes=null;_resizeFactor=1;_resizePinned=new Set;_resizeGutters=[];_gutterPairs=[];_dragUpper=null;_dragLower=null;_dragLastPointer=0;_dragOpenIndices=[];_dragGutterUpperPos=0;_toggleAnimations=0;_boundOnGutterDragEnd=()=>this.onGutterDragEnd();constructor(e){super(),e&&this.applyOptions(e)}applyOptions(e){if(super.applyOptions(e),e.headerHeight!==void 0&&this.setHeaderHeight(e.headerHeight),e.animationDuration!==void 0&&this.setAnimationDuration(e.animationDuration),e.chevronSide!==void 0&&this.setChevronSide(e.chevronSide),e.toolsVisibility!==void 0&&this.setToolsVisibility(e.toolsVisibility),e.compact!==void 0&&this.setCompact(e.compact),e.chevronGlyph!==void 0&&this.setChevronGlyph(e.chevronGlyph),e.spacing!==void 0&&this.setSpacing(e.spacing),e.themed!==void 0&&this.setThemed(e.themed),e.fillHeight!==void 0&&this.setFillHeight(e.fillHeight),e.resizable!==void 0&&this.setResizable(e.resizable),e.sectionSizes!==void 0&&(this._pendingSectionSizes=e.sectionSizes.map(e=>({...e}))),e.listeners!==void 0){let t=e.listeners;for(let e of Object.keys(t)){let n=t[e];n!==void 0&&this.on(e,n)}}e.singleOpen!==void 0&&this.setSingleOpen(e.singleOpen)}isSingleOpen(){return this._singleOpen}setSingleOpen(e){if(this._singleOpen=e,!e)return this;let t=!1;for(let e=0;e<this._openState.length;e++)this._openState[e]&&(t?(this.primeWrapper(e),this._openState[e]=!1,this._headers[e].setExpanded(!1),this.emit(`sectiontoggle`,e,!1)):t=!0);return this.relayoutHost(),this}getHeaderHeight(){return this._headerHeight}setHeaderHeight(e){return this._headerHeight=e,this._headerHeightExplicit=!0,this}effectiveHeaderHeight(){return this._compact&&!this._headerHeightExplicit?j:this._headerHeight}isCompact(){return this._compact}setCompact(e){this._compact=e;for(let t of this._headers)t.setCompact(e);return this.relayoutHost(),this}getAnimationDuration(){return this._animationDuration}setAnimationDuration(e){return this._animationDuration=e,this}getChevronSide(){return this._chevronSide}setChevronSide(e){this._chevronSide=e;for(let t of this._headers)t.setChevronSide(e);return this.getContainer()?.scheduleLayout(),this}getChevronGlyph(){return this._chevronGlyph}setChevronGlyph(e){this._chevronGlyph=e;for(let t of this._headers)t.setChevronGlyph(e);return this.getContainer()?.scheduleLayout(),this}getSpacing(){return this._spacing}setSpacing(e){return this._spacing=e,this.relayoutHost(),this}isFillHeight(){return this._fillHeight}setFillHeight(e){return this._fillHeight=e,this.getContainer()?.scheduleLayout(),this}isResizable(){return this._resizable}setResizable(e){return this._resizable=e,this.getContainer()?.scheduleLayout(),this}isThemed(){return this._themed}setThemed(e){this._themed=e,this.applyContainerTheming();for(let e=0;e<this._headers.length;e++)this.applySectionTheming(e);return this.getContainer()?.scheduleLayout(),this}applyContainerTheming(){let e=this.getContainer();e&&(this._themed?e.setBorder({border:L}):e.clearBorder())}applySectionTheming(e){let t=this._headers[e];if(t){if(!this._themed){t.clearBackground(),t.clearForegroundColor(),t.clearBorder();return}t.setBackground(P),t.setForegroundColor(I),t.setBorder({border:`none`,borderBottom:F})}}getToolsVisibility(){return this._toolsVisibility}setToolsVisibility(e){this._toolsVisibility=e;for(let t of this._headers)t.setToolsRevealed(e===`always`);return this}addTool(e){return this._tools.includes(e)?this:(this._tools.push(e),this._hoveredHeader!==-1&&this._headers[this._hoveredHeader]?.addTool(e),this.getContainer()?.scheduleLayout(),this)}removeTool(e){let t=this._tools.indexOf(e);return t===-1?this:(this._tools.splice(t,1),this._hoveredHeader!==-1&&this._headers[this._hoveredHeader]?.removeTool(e),this.getContainer()?.scheduleLayout(),this)}revealHeaderTools(e){let t=this._headers[e];if(t){for(let e of this._tools)t.addTool(e);this._toolsVisibility===`hover`&&t.setToolsRevealed(!0)}}hideHeaderTools(e){let t=this._headers[e];if(t){for(let e of this._tools)t.removeTool(e);this._toolsVisibility===`hover`&&t.setToolsRevealed(!1)}}onHeaderHoverEnter(e,t){let n=this._headers[e]?.getElement();n&&r.source.isNode(t.relatedTarget)&&r.source.contains(n,r.source.intern(t.relatedTarget))||this._hoveredHeader!==e&&(this._hoveredHeader!==-1&&this.hideHeaderTools(this._hoveredHeader),this._hoveredHeader=e,this.revealHeaderTools(e))}onHeaderHoverLeave(e,t){let n=this._headers[e]?.getElement();n&&r.source.isNode(t.relatedTarget)&&r.source.contains(n,r.source.intern(t.relatedTarget))||this._hoveredHeader===e&&(this.hideHeaderTools(e),this._hoveredHeader=-1)}relayoutHost(){let e=this.getContainer();e?.scheduleLayout(),e?.notifyIntrinsicSizeChanged()}openSection(e){if(e<0||e>=this._openState.length)return this;if(this._singleOpen)for(let t=0;t<this._openState.length;t++)t!==e&&this._openState[t]&&(this.primeWrapper(t),this._openState[t]=!1,this._headers[t].setExpanded(!1),this.emit(`sectiontoggle`,t,!1));return this.primeWrapper(e),this._openState[e]=!0,this._headers[e].setExpanded(!0),this.emit(`sectiontoggle`,e,!0),this.relayoutHost(),this}closeSection(e){return e<0||e>=this._openState.length?this:(this.primeWrapper(e),this._openState[e]=!1,this._headers[e].setExpanded(!1),this.emit(`sectiontoggle`,e,!1),this.relayoutHost(),this)}expandAll(){if(this._singleOpen)return this.openSection(0),this;for(let e=0;e<this._openState.length;e++)this.openSection(e);return this}collapseAll(){for(let e=0;e<this._openState.length;e++)this.closeSection(e);return this}isSectionOpen(e){return this._openState[e]??!1}sectionSizeUnits(e){return e.map(e=>this.effectiveWeight(e)===0?`px`:`ratio`)}getSectionSizes(){let e=this.getContainer();if(!e)return[];let t=e.getComponents();if(t.length===0)return[];let n=this.sectionSizeUnits(t);return this._pendingSectionSizes!==null&&m(this._pendingSectionSizes,n)?this._pendingSectionSizes.map(e=>({...e})):p(n,t.map(e=>this._resizeSizes.get(e)??0))}applySectionSizes(e){return this._pendingSectionSizes=e.map(e=>({...e})),this.getContainer()?.scheduleLayout(),this}on(e,t){return this._listeners.add(e,t),this}off(e,t){return this._listeners.remove(e,t),this}emit(e,...t){this._listeners.fire(e,...t)}attach(e){return super.attach(e),this}detach(){let e=this.getContainer();this._dragUpper&&this.onGutterDragEnd();for(let t=0;t<this._headers.length;t++){let n=(e?e.getComponents():[])[t];n&&e&&r.sink.appendChild(e.getElement(),n.getElement()),r.sink.removeElement(this._headers[t].getElement()),r.sink.removeElement(this._panelWrappers[t].getElement())}this._headers=[],this._panelWrappers=[],this._openState=[];for(let e of this._resizeGutters)r.sink.removeElement(e.getElement()),e.destroy();return this._resizeGutters=[],this._resizeSizes.clear(),this._gutterPairs=[],super.detach(),this}getPreferredSize(){let e=this.getContainer();if(!e)return null;let t=e.getPerimeterSize(),n=e.getComponents(),r=t.top+t.bottom,i=0,a=0;for(let e=0;e<n.length;e++)if(n[e].isDisplayed()&&(a>0&&(r+=this._spacing),a+=1,r+=this.effectiveHeaderHeight(),e<this._openState.length?this._openState[e]:this.getLayoutConstraints(n[e])?.initiallyOpen??!1)){let t=n[e].getPreferredSize();t&&(r+=t.height,t.width>i&&(i=t.width))}return{width:i+t.left+t.right,height:r}}getMinSize(){let e=this.getContainer();if(!e)return null;let t=e.getPerimeterSize(),n=e.getComponents(),r=t.top+t.bottom,i=0,a=0;for(let e=0;e<n.length;e++)if(n[e].isDisplayed()&&(a>0&&(r+=this._spacing),a+=1,r+=this.effectiveHeaderHeight(),e<this._openState.length?this._openState[e]:this.getLayoutConstraints(n[e])?.initiallyOpen??!1)){let t=n[e].getMinSize();t&&(r+=t.height,t.width>i&&(i=t.width))}return{width:i+t.left+t.right,height:r}}getMaxSize(){return{width:e,height:e}}createSection(e,t){let n=this.getContainer(),i=this.getLayoutConstraints(e),a=i?.label??e.getId(),o=i?.initiallyOpen??!1,s=new k(a,{chevronSide:this._chevronSide,glyph:i?.glyph??void 0,compact:this._compact,chevronGlyph:this._chevronGlyph??void 0});s.setAnimationTiming(this._animationDuration,A),s.setTransition(`none`);let l=s.getTitleButton();l.on(`action`,()=>this.onHeaderClicked(t)),u.addListener(s,`click`,()=>this.onHeaderClicked(t)),u.addListener(l,`keydown`,e=>this.onHeaderKeyDown(e,t)),u.addSubtreeListener(s,`mouseover`,e=>this.onHeaderHoverEnter(t,e)),u.addSubtreeListener(s,`mouseout`,e=>this.onHeaderHoverLeave(t,e));let d=new c;d.setOverflow(`hidden`),d.setContain(`layout paint`),d.setTransition(`none`),r.sink.appendChild(n.getElement(),s.getElement(!0)),r.sink.appendChild(n.getElement(),d.getElement(!0)),r.sink.appendChild(d.getElement(),e.getElement()),e.setTransition(`none`),this._openState.push(o),this._headers.push(s),this._panelWrappers.push(d),s.setExpanded(o),l.getAria().setControls(d.getId()),d.getAria().setRole(`region`),d.getAria().setLabelledBy(l.getId());for(let e of i?.tools??[])s.addTool(e);this._toolsVisibility===`hover`&&s.setToolsRevealed(!1),this.applySectionTheming(t)}computeTotalMinSize(){let e=this.getContainer();if(!e)return{width:0,height:0};let t=0;for(let n of e.getComponents()){if(!n.isDisplayed())continue;let e=n.getMinSize();e&&(t=Math.max(t,e.width))}return{width:t,height:0}}placeSection(e,t,n,r,i,a,o){let s=this._headers[e],c=this._panelWrappers[e],l=this.effectiveHeaderHeight();s.setX(o),s.setY(n),s.setWidth(a),s.setHeight(l),s.doLayout();let u=n+l;return c.setX(o),c.setY(u),c.setWidth(a),c.setHeight(r),t.setX(0),t.setY(0),t.setWidth(a),t.setHeight(i),u+r}doLayout(){let e=this.getContainer();if(!e)return;let t=e.getComponents();for(let e=this._headers.length;e<t.length;e++)this.createSection(t[e],e);this.applyContainerTheming();let n=e.getInnerSize(),r=e.getContentInsets(),i=n?n.width:0;if(this.isOverflowingX()){let e=this.computeTotalMinSize();i=Math.max(i,e.width)}let a=this.computeShrinkRatio(t,n),o=this.computeFill(t,n,a),s=this.computeResizableHeights(t,n,a,o);this.layoutSections(t,i,r.getLeft(),r.getTop(),s!==null,(e,n)=>{if(n)return s?.get(e)??this.openContentHeight(t[e],a)+(o.get(e)??0);let r=t[e].getPreferredSize();return r?r.height:100},!0,!0)}layoutSections(e,t,n,r,i,a,s,c){let l=r,u=0,d=null,f=0,p=0;for(let r=0;r<e.length;r++){let m=e[r],h=this._headers[r],g=this._panelWrappers[r],_=this._openState[r];if(!m.isDisplayed()){h.setDisplayed(!1),g.setDisplayed(!1);continue}h.setDisplayed(!0),g.setDisplayed(!0),u>0&&(l+=this._spacing),u+=1;let v=a(r,_),y=_?v:0;_&&i&&d!==null&&(this.placeGutter(p,f,t,n),this._gutterPairs[p]={upper:d,lower:m},p+=1);let b=m.getHeight(),x=_&&s&&!o.isReducedMotion()&&v<b,S=this.placeSection(r,m,l,y,v,t,n);(c||v!==b)&&(x?o.afterTransition({component:g,property:`height`,durationMs:this._animationDuration,fallbackBufferMs:40,onComplete:()=>m.doLayout()}):m.doLayout()),_&&i&&(d=m,f=S),l=S}this._gutterPairs.length=p;for(let e=p;e<this._resizeGutters.length;e++)this._resizeGutters[e].setVisible(!1)}getOrCreateResizeGutter(e){let t=this._resizeGutters[e];if(t)return t;let n=this.getContainer(),i=new g(`vertical`,{collapsible:!1,expandedBackground:`transparent`});return i.setTransition(`none`),i.on(`dragstart`,t=>this.onGutterDragStart(e,t)),i.on(`drag`,t=>this.onGutterDrag(e,t)),r.sink.appendChild(n.getElement(),i.getElement(!0)),this._resizeGutters.push(i),i}placeGutter(e,t,n,r){let i=this.getOrCreateResizeGutter(e);i.setX(r),i.setY(t-M),i.setWidth(n),i.setHeight(M),i.setVisible(!0)}onGutterDragStart(e,t){let n=this._gutterPairs[e];if(!n)return;let r=this.getContainer()?.getComponents()??[];this._dragOpenIndices=[];for(let e=0;e<r.length;e++)r[e].isDisplayed()&&this._openState[e]&&this._dragOpenIndices.push(e);if(this._dragGutterUpperPos=this._dragOpenIndices.indexOf(r.indexOf(n.upper)),this._dragGutterUpperPos===-1)return;this._dragUpper=n.upper,this._dragLower=n.lower,this._dragLastPointer=t;let i=this.getContainer();i&&(u.addViewportListener(i,`mouseup`,this._boundOnGutterDragEnd),u.addViewportListener(i,`touchend`,this._boundOnGutterDragEnd),u.addViewportListener(i,`touchcancel`,this._boundOnGutterDragEnd))}onGutterDrag(e,t){let n=this._gutterPairs[e],r=this.getContainer();if(!n||n.upper!==this._dragUpper||n.lower!==this._dragLower||!r)return;let i=r.getComponents(),a=this._dragOpenIndices,o=this._dragGutterUpperPos,s=t-this._dragLastPointer,c=a.map(e=>i[e].getHeight()),l=a.map(e=>{let t=i[e].getMinSize();return t?t.height:0}),u=a.map(e=>{let t=i[e].getMaxSize();return t?t.height:1/0}),d=[],f=[];for(let e=o;e>=0;e--)d.push(e);for(let e=o+1;e<a.length;e++)f.push(e);let p=s>=0?d:f,m=s>=0?f:d,h=0,g=0;for(let e of p)h+=Math.max(0,u[e]-c[e]);for(let e of m)g+=Math.max(0,c[e]-l[e]);let _=Math.max(0,Math.min(Math.abs(s),h,g));this._dragLastPointer+=Math.sign(s)*_;let v=c.slice();this.distributeDragChain(p,c,_,1,l,u,v),this.distributeDragChain(m,c,_,-1,l,u,v);let y=new Map;for(let e=0;e<a.length;e++){let t=i[a[e]],n=this._resizePinned.has(t)?1:this._resizeFactor;y.set(a[e],v[e]),this._resizeSizes.set(t,v[e]/n)}let b=r.getContentInsets(),x=this._panelWrappers[a[0]].getWidth();this.layoutSections(i,x,b.getLeft(),b.getTop(),!0,(e,t)=>t?y.get(e)??i[e].getHeight():i[e].getHeight(),!1,!1)}distributeDragChain(e,t,n,r,i,a,o){let room=e=>r>0?Math.max(0,a[e]-t[e]):Math.max(0,t[e]-i[e]),s=n;for(let t of e){if(s<=N)return;let e=Math.min(s,room(t));o[t]+=r*e,s-=e}}onGutterDragEnd(){let e=this._dragUpper!==null,t=this.getContainer();t&&(u.removeViewportListener(t,`mouseup`,this._boundOnGutterDragEnd),u.removeViewportListener(t,`touchend`,this._boundOnGutterDragEnd),u.removeViewportListener(t,`touchcancel`,this._boundOnGutterDragEnd)),this._dragUpper=null,this._dragLower=null,e&&this.emit(`sectionresize`,this.getSectionSizes())}computeShrinkRatio(e,t){if(!t)return 0;let n=0,r=0,i=0,a=0;for(let t=0;t<e.length;t++){if(!e[t].isDisplayed()||(a>0&&(n+=this._spacing),a+=1,n+=this.effectiveHeaderHeight(),!this._openState[t]))continue;let o=e[t].getPreferredSize(),s=e[t].getMinSize();r+=o?o.height:100,i+=s?s.height:0}let o=n+r,s=n+i,c=t.height;if(o<=c||s>c)return 0;let l=o-s;return l>0?(o-c)/l:0}openContentHeight(e,t){let n=e.getPreferredSize(),r=n?n.height:100,i=e.getMinSize(),a=i?i.height:0,o=r-t*(r-a),s=e.getMaxSize(),c=s?Math.min(o,s.height):o;return Math.max(c,a)}computeFill(e,t,n){let r=new Map;if(!t)return r;let i=0,a=0,o=[],s=0;for(let t=0;t<e.length;t++)if(e[t].isDisplayed()&&(a>0&&(i+=this._spacing),a+=1,i+=this.effectiveHeaderHeight(),this._openState[t])){let r=this.openContentHeight(e[t],n);i+=r;let a=this.effectiveWeight(e[t]);a>0&&(o.push({index:t,weight:a,headroom:this.fillHeadroom(e[t],r)}),s+=a)}let c=t.height-i;return c<=0||s<=0?r:this.distributeFillWithinMax(o,c)}effectiveWeight(e){let t=this.getLayoutConstraints(e)?.weight??0;return t>0?t:+!!this._fillHeight}resizePinnedSections(e,t,n){let r=[],i=0,a=0;for(let n of t)this.effectiveWeight(e[n])>0?i+=1:(r.push(n),a+=this.clampSectionHeight(e[n],this._resizeSizes.get(e[n])??0));return i===0||a>n?[]:r}clampSectionHeight(e,n){let r=e.getMinSize(),i=e.getMaxSize();return t.clamp(n,r?r.height:0,i?i.height:1/0)}fillHeadroom(e,t){let n=e.getMaxSize();return n?Math.max(0,n.height-t):1/0}distributeFillWithinMax(e,t){let n=new Map,r=new Set(e),i=t;for(;;){let e=0;for(let t of r)e+=t.weight;if(e<=0)break;let t=i/e,a=!1;for(let e of r)if(e.weight*t>e.headroom){n.set(e.index,e.headroom),i-=e.headroom,r.delete(e),a=!0;break}if(!a){for(let e of r)n.set(e.index,e.weight*t);break}if(r.size===0)break}return n}computeResizableHeights(e,t,n,r){if(!this._resizable||!t)return null;for(let t of[...this._resizeSizes.keys()])e.includes(t)||this._resizeSizes.delete(t);let i=0,a=0,o=[];for(let t=0;t<e.length;t++)e[t].isDisplayed()&&(a>0&&(i+=this._spacing),a+=1,i+=this.effectiveHeaderHeight(),this._openState[t]&&o.push(t));if(o.length===0)return null;let s=t.height-i;this.applyPendingSectionSizes(e,s);for(let t of o){let i=e[t];this._resizeSizes.has(i)||this._resizeSizes.set(i,this.openContentHeight(i,n)+(r.get(t)??0))}return this.distributeWithinConstraints(e,o,s)}applyPendingSectionSizes(e,t){let n=this._pendingSectionSizes;if(n===null||(this._pendingSectionSizes=null,!m(n,this.sectionSizeUnits(e))))return;let r=h(n,t);for(let t=0;t<e.length;t+=1)r[t]>0?this._resizeSizes.set(e[t],r[t]):this._resizeSizes.delete(e[t])}distributeWithinConstraints(e,t,n){let r=new Map,i=new Set(t),a=n,o=1;this._resizePinned.clear();for(let o of this.resizePinnedSections(e,t,n)){let t=this.clampSectionHeight(e[o],this._resizeSizes.get(e[o])??0);r.set(o,t),a-=t,i.delete(o),this._resizePinned.add(e[o])}for(;;){let t=0;for(let n of i)t+=this._resizeSizes.get(e[n])??0;o=t>0?a/t:0;let n=!1;for(let t of i){let s=e[t],c=(this._resizeSizes.get(s)??0)*o,l=s.getMinSize(),u=s.getMaxSize(),d=l?l.height:0,f=u?u.height:1/0;if(c<d){r.set(t,d),a-=d,i.delete(t),n=!0;break}if(c>f){r.set(t,f),a-=f,i.delete(t),n=!0;break}}if(!n){for(let t of i)r.set(t,(this._resizeSizes.get(e[t])??0)*o);break}if(i.size===0)break}return this._resizeFactor=o>0?o:1,r}onHeaderKeyDown(e,t){let n=this._headers.length;if(n===0)return;let r;switch(e.key){case`ArrowDown`:r=(t+1)%n;break;case`ArrowUp`:r=(t-1+n)%n;break;case`Home`:r=0;break;case`End`:r=n-1;break;default:return}e.preventDefault(),this._headers[r].getTitleButton().focus()}onHeaderClicked(e){let t=this._openState[e];if(this._singleOpen&&!t)for(let t=0;t<this._openState.length;t++)t!==e&&this._openState[t]&&(this.primeWrapper(t),this._openState[t]=!1,this._headers[t].setExpanded(!1),this.emit(`sectiontoggle`,t,!1));let n=!t;this.primeWrapper(e),this._openState[e]=n,this._headers[e].setExpanded(n),this.emit(`sectiontoggle`,e,n),this.relayoutHost()}primeWrapper(e){if(o.isReducedMotion())return;let t=this._panelWrappers[e],n=this.getContainer();this.setSectionTransitions(!0),n?.setTransition(`height ${this._animationDuration}ms ${A}`),t.setWillChange(`height`);let i=n?.getElement();i&&r.source.getElementRect(i),this._toggleAnimations+=1,o.afterTransition({component:t,property:`height`,durationMs:this._animationDuration,fallbackBufferMs:40,onComplete:()=>{t.setWillChange(null),--this._toggleAnimations,this._toggleAnimations<=0&&(this._toggleAnimations=0,this.setSectionTransitions(!1),n?.setTransition(null),this.relayoutHost())}})}setSectionTransitions(e){let t=this.getContainer()?.getComponents()??[];for(let n=0;n<this._headers.length;n++)this._headers[n].setTransition(e?this.buildHeaderTransition():`none`),this._panelWrappers[n].setTransition(e?this.buildWrapperTransition():`none`),t[n]?.setTransition(e?this.buildContentTransition():`none`);for(let t of this._resizeGutters)t.setTransition(e?this.buildHeaderTransition():`none`)}buildHeaderTransition(){return`top ${this._animationDuration}ms ${A}`}buildWrapperTransition(){return`height ${this._animationDuration}ms ${A}, top ${this._animationDuration}ms ${A}`}buildContentTransition(){return`height ${this._animationDuration}ms ${A}`}},R=a(Accordion),AccordionConstraints=class extends _{label;initiallyOpen;tools;constructor(e,t,n,r){super(),this.label=e,this.initiallyOpen=t,this.glyph=n??null,this.tools=r}},GridConstraints=class extends _{col;row;rowSpan;colSpan;constructor(){super()}};export{S as a,k as i,AccordionConstraints as n,R as r,GridConstraints as t};
2
- //# sourceMappingURL=GridConstraints-Q3wvuovN.js.map