@asymmetric-effort/specifyjs 0.2.97 → 0.2.100

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 (538) hide show
  1. package/dist/specifyjs-build.cjs.js +160 -1
  2. package/dist/specifyjs-build.cjs.js.map +7 -1
  3. package/dist/specifyjs-build.d.ts +1 -110
  4. package/dist/specifyjs-build.esm.js +160 -1
  5. package/dist/specifyjs-build.esm.js.map +7 -1
  6. package/dist/specifyjs-client.cjs.js +2 -1
  7. package/dist/specifyjs-client.cjs.js.map +7 -1
  8. package/dist/specifyjs-client.d.ts +1 -159
  9. package/dist/specifyjs-client.esm.js +2 -1
  10. package/dist/specifyjs-client.esm.js.map +7 -1
  11. package/dist/specifyjs-components.cjs.js +8 -1
  12. package/dist/specifyjs-components.cjs.js.map +7 -1
  13. package/dist/specifyjs-components.d.ts +1 -3334
  14. package/dist/specifyjs-components.esm.js +8 -1
  15. package/dist/specifyjs-components.esm.js.map +7 -1
  16. package/dist/specifyjs-dom.cjs.js +2 -1
  17. package/dist/specifyjs-dom.cjs.js.map +7 -1
  18. package/dist/specifyjs-dom.d.ts +1 -107
  19. package/dist/specifyjs-dom.esm.js +2 -1
  20. package/dist/specifyjs-dom.esm.js.map +7 -1
  21. package/dist/specifyjs-jsx-dev-runtime.cjs.js +2 -1
  22. package/dist/specifyjs-jsx-dev-runtime.cjs.js.map +7 -1
  23. package/dist/specifyjs-jsx-dev-runtime.esm.js +2 -1
  24. package/dist/specifyjs-jsx-dev-runtime.esm.js.map +7 -1
  25. package/dist/specifyjs-jsx-runtime.cjs.js +2 -1
  26. package/dist/specifyjs-jsx-runtime.cjs.js.map +7 -1
  27. package/dist/specifyjs-jsx-runtime.esm.js +2 -1
  28. package/dist/specifyjs-jsx-runtime.esm.js.map +7 -1
  29. package/dist/specifyjs-server.cjs.js +2 -1
  30. package/dist/specifyjs-server.cjs.js.map +7 -1
  31. package/dist/specifyjs-server.d.ts +1 -136
  32. package/dist/specifyjs-server.esm.js +2 -1
  33. package/dist/specifyjs-server.esm.js.map +7 -1
  34. package/dist/specifyjs-telemetry.cjs.js +2 -1
  35. package/dist/specifyjs-telemetry.cjs.js.map +7 -1
  36. package/dist/specifyjs-telemetry.d.ts +1 -165
  37. package/dist/specifyjs-telemetry.esm.js +2 -1
  38. package/dist/specifyjs-telemetry.esm.js.map +7 -1
  39. package/dist/specifyjs.cjs.js +2 -1
  40. package/dist/specifyjs.cjs.js.map +7 -1
  41. package/dist/specifyjs.d.ts +1 -581
  42. package/dist/specifyjs.esm.js +2 -1
  43. package/dist/specifyjs.esm.js.map +7 -1
  44. package/dist/types/build/index.d.ts +5 -0
  45. package/dist/types/build/index.d.ts.map +1 -0
  46. package/dist/types/build/noscript-plugin.d.ts +63 -0
  47. package/dist/types/build/noscript-plugin.d.ts.map +1 -0
  48. package/dist/types/build/seo-plugin.d.ts +43 -0
  49. package/dist/types/build/seo-plugin.d.ts.map +1 -0
  50. package/dist/types/client/graphql.d.ts +64 -0
  51. package/dist/types/client/graphql.d.ts.map +1 -0
  52. package/dist/types/client/index.d.ts +4 -0
  53. package/dist/types/client/index.d.ts.map +1 -0
  54. package/dist/types/client/protobuf.d.ts +40 -0
  55. package/dist/types/client/protobuf.d.ts.map +1 -0
  56. package/dist/types/client/rest.d.ts +61 -0
  57. package/dist/types/client/rest.d.ts.map +1 -0
  58. package/dist/types/components/ad/adsense/src/AdSense.d.ts +19 -0
  59. package/dist/types/components/ad/adsense/src/index.d.ts +2 -0
  60. package/dist/types/components/analytics/google-analytics/src/GoogleAnalytics.d.ts +13 -0
  61. package/dist/types/components/analytics/google-analytics/src/index.d.ts +2 -0
  62. package/dist/types/components/component.d.ts +39 -0
  63. package/dist/types/components/component.d.ts.map +1 -0
  64. package/dist/types/components/data/analog-clock/src/AnalogClock.d.ts +17 -0
  65. package/dist/types/components/data/analog-clock/src/index.d.ts +2 -0
  66. package/dist/types/components/data/avatar/src/Avatar.d.ts +19 -0
  67. package/dist/types/components/data/avatar/src/index.d.ts +2 -0
  68. package/dist/types/components/data/badge/src/Badge.d.ts +17 -0
  69. package/dist/types/components/data/badge/src/index.d.ts +2 -0
  70. package/dist/types/components/data/data-grid/src/DataGrid.d.ts +47 -0
  71. package/dist/types/components/data/data-grid/src/index.d.ts +2 -0
  72. package/dist/types/components/data/digital-clock/src/DigitalClock.d.ts +15 -0
  73. package/dist/types/components/data/digital-clock/src/index.d.ts +2 -0
  74. package/dist/types/components/data/list-view/src/ListView.d.ts +23 -0
  75. package/dist/types/components/data/list-view/src/index.d.ts +2 -0
  76. package/dist/types/components/data/tag/src/Tag.d.ts +21 -0
  77. package/dist/types/components/data/tag/src/index.d.ts +2 -0
  78. package/dist/types/components/data/virtual-scroll/src/VirtualScroll.d.ts +13 -0
  79. package/dist/types/components/data/virtual-scroll/src/index.d.ts +2 -0
  80. package/dist/types/components/error-boundary.d.ts +23 -0
  81. package/dist/types/components/error-boundary.d.ts.map +1 -0
  82. package/dist/types/components/errors/_shared/src/HttpErrorPage.d.ts +15 -0
  83. package/dist/types/components/errors/_shared/src/index.d.ts +2 -0
  84. package/dist/types/components/errors/http-400/src/Http400.d.ts +9 -0
  85. package/dist/types/components/errors/http-400/src/index.d.ts +2 -0
  86. package/dist/types/components/errors/http-401/src/Http401.d.ts +9 -0
  87. package/dist/types/components/errors/http-401/src/index.d.ts +2 -0
  88. package/dist/types/components/errors/http-403/src/Http403.d.ts +9 -0
  89. package/dist/types/components/errors/http-403/src/index.d.ts +2 -0
  90. package/dist/types/components/errors/http-404/src/Http404.d.ts +9 -0
  91. package/dist/types/components/errors/http-404/src/index.d.ts +2 -0
  92. package/dist/types/components/errors/http-405/src/Http405.d.ts +9 -0
  93. package/dist/types/components/errors/http-405/src/index.d.ts +2 -0
  94. package/dist/types/components/errors/http-408/src/Http408.d.ts +9 -0
  95. package/dist/types/components/errors/http-408/src/index.d.ts +2 -0
  96. package/dist/types/components/errors/http-429/src/Http429.d.ts +9 -0
  97. package/dist/types/components/errors/http-429/src/index.d.ts +2 -0
  98. package/dist/types/components/errors/http-500/src/Http500.d.ts +9 -0
  99. package/dist/types/components/errors/http-500/src/index.d.ts +2 -0
  100. package/dist/types/components/errors/http-502/src/Http502.d.ts +9 -0
  101. package/dist/types/components/errors/http-502/src/index.d.ts +2 -0
  102. package/dist/types/components/errors/http-503/src/Http503.d.ts +9 -0
  103. package/dist/types/components/errors/http-503/src/index.d.ts +2 -0
  104. package/dist/types/components/errors/http-504/src/Http504.d.ts +9 -0
  105. package/dist/types/components/errors/http-504/src/index.d.ts +2 -0
  106. package/dist/types/components/feedback/alert/src/Alert.d.ts +25 -0
  107. package/dist/types/components/feedback/alert/src/index.d.ts +2 -0
  108. package/dist/types/components/feedback/empty-state/src/EmptyState.d.ts +17 -0
  109. package/dist/types/components/feedback/empty-state/src/index.d.ts +2 -0
  110. package/dist/types/components/feedback/progress-bar/src/ProgressBar.d.ts +23 -0
  111. package/dist/types/components/feedback/progress-bar/src/index.d.ts +2 -0
  112. package/dist/types/components/feedback/skeleton/src/Skeleton.d.ts +15 -0
  113. package/dist/types/components/feedback/skeleton/src/index.d.ts +2 -0
  114. package/dist/types/components/feedback/spinner/src/Spinner.d.ts +13 -0
  115. package/dist/types/components/feedback/spinner/src/index.d.ts +2 -0
  116. package/dist/types/components/form/button/src/Button.d.ts +25 -0
  117. package/dist/types/components/form/button/src/index.d.ts +2 -0
  118. package/dist/types/components/form/checkbox/src/Checkbox.d.ts +19 -0
  119. package/dist/types/components/form/checkbox/src/index.d.ts +2 -0
  120. package/dist/types/components/form/color-picker/src/ColorPicker.d.ts +19 -0
  121. package/dist/types/components/form/color-picker/src/index.d.ts +2 -0
  122. package/dist/types/components/form/color-wheel/src/ColorWheel.d.ts +17 -0
  123. package/dist/types/components/form/color-wheel/src/index.d.ts +2 -0
  124. package/dist/types/components/form/datepicker/src/DatePicker.d.ts +23 -0
  125. package/dist/types/components/form/datepicker/src/index.d.ts +2 -0
  126. package/dist/types/components/form/file-upload/src/FileUpload.d.ts +19 -0
  127. package/dist/types/components/form/file-upload/src/index.d.ts +2 -0
  128. package/dist/types/components/form/multiline/src/MultilineField.d.ts +41 -0
  129. package/dist/types/components/form/multiline/src/index.d.ts +2 -0
  130. package/dist/types/components/form/number-spinner/src/NumberSpinner.d.ts +25 -0
  131. package/dist/types/components/form/number-spinner/src/index.d.ts +2 -0
  132. package/dist/types/components/form/radio/src/RadioGroup.d.ts +26 -0
  133. package/dist/types/components/form/radio/src/index.d.ts +2 -0
  134. package/dist/types/components/form/select/src/Select.d.ts +33 -0
  135. package/dist/types/components/form/select/src/index.d.ts +2 -0
  136. package/dist/types/components/form/slider/src/Slider.d.ts +33 -0
  137. package/dist/types/components/form/slider/src/index.d.ts +2 -0
  138. package/dist/types/components/form/texteditor/src/TextEditor.d.ts +46 -0
  139. package/dist/types/components/form/texteditor/src/index.d.ts +2 -0
  140. package/dist/types/components/form/textfield/src/TextField.d.ts +48 -0
  141. package/dist/types/components/form/textfield/src/index.d.ts +2 -0
  142. package/dist/types/components/form/timepicker/src/TimePicker.d.ts +29 -0
  143. package/dist/types/components/form/timepicker/src/index.d.ts +2 -0
  144. package/dist/types/components/form/toggle/src/Toggle.d.ts +19 -0
  145. package/dist/types/components/form/toggle/src/index.d.ts +2 -0
  146. package/dist/types/components/form/wrapper/src/FormFieldWrapper.d.ts +67 -0
  147. package/dist/types/components/form/wrapper/src/index.d.ts +2 -0
  148. package/dist/types/components/layout/card/src/Card.d.ts +31 -0
  149. package/dist/types/components/layout/card/src/index.d.ts +2 -0
  150. package/dist/types/components/layout/desktop-background/src/DesktopBackground.d.ts +23 -0
  151. package/dist/types/components/layout/desktop-background/src/index.d.ts +2 -0
  152. package/dist/types/components/layout/draggable-window/src/DraggableWindow.d.ts +59 -0
  153. package/dist/types/components/layout/draggable-window/src/index.d.ts +2 -0
  154. package/dist/types/components/layout/flex-container/src/FlexContainer.d.ts +42 -0
  155. package/dist/types/components/layout/flex-container/src/index.d.ts +2 -0
  156. package/dist/types/components/layout/footer/src/Footer.d.ts +25 -0
  157. package/dist/types/components/layout/footer/src/index.d.ts +2 -0
  158. package/dist/types/components/layout/grid/src/Grid.d.ts +54 -0
  159. package/dist/types/components/layout/grid/src/index.d.ts +2 -0
  160. package/dist/types/components/layout/panel/src/Panel.d.ts +23 -0
  161. package/dist/types/components/layout/panel/src/index.d.ts +2 -0
  162. package/dist/types/components/layout/scroll-container/src/ScrollContainer.d.ts +21 -0
  163. package/dist/types/components/layout/scroll-container/src/index.d.ts +2 -0
  164. package/dist/types/components/layout/splitter/src/Splitter.d.ts +19 -0
  165. package/dist/types/components/layout/splitter/src/index.d.ts +2 -0
  166. package/dist/types/components/layout/tabs/src/Tabs.d.ts +29 -0
  167. package/dist/types/components/layout/tabs/src/index.d.ts +2 -0
  168. package/dist/types/components/layout/window-manager/src/WindowManager.d.ts +106 -0
  169. package/dist/types/components/layout/window-manager/src/index.d.ts +2 -0
  170. package/dist/types/components/math/src/index.d.ts +5 -0
  171. package/dist/types/components/math/src/mat.d.ts +71 -0
  172. package/dist/types/components/math/src/mat4.d.ts +101 -0
  173. package/dist/types/components/math/src/quaternion.d.ts +62 -0
  174. package/dist/types/components/math/src/solver.d.ts +55 -0
  175. package/dist/types/components/math/src/vec.d.ts +54 -0
  176. package/dist/types/components/media/carousel/src/Carousel.d.ts +23 -0
  177. package/dist/types/components/media/carousel/src/index.d.ts +2 -0
  178. package/dist/types/components/media/image/src/Image.d.ts +23 -0
  179. package/dist/types/components/media/image/src/index.d.ts +2 -0
  180. package/dist/types/components/media/video-player/src/VideoPlayer.d.ts +27 -0
  181. package/dist/types/components/media/video-player/src/index.d.ts +2 -0
  182. package/dist/types/components/nav/accordion/src/Accordion.d.ts +52 -0
  183. package/dist/types/components/nav/accordion/src/index.d.ts +2 -0
  184. package/dist/types/components/nav/breadcrumb/src/Breadcrumb.d.ts +20 -0
  185. package/dist/types/components/nav/breadcrumb/src/index.d.ts +2 -0
  186. package/dist/types/components/nav/dock/src/Dock.d.ts +46 -0
  187. package/dist/types/components/nav/dock/src/index.d.ts +2 -0
  188. package/dist/types/components/nav/dropdown/src/Dropdown.d.ts +36 -0
  189. package/dist/types/components/nav/dropdown/src/index.d.ts +2 -0
  190. package/dist/types/components/nav/menubar/src/Menubar.d.ts +27 -0
  191. package/dist/types/components/nav/menubar/src/index.d.ts +2 -0
  192. package/dist/types/components/nav/pagination/src/Pagination.d.ts +19 -0
  193. package/dist/types/components/nav/pagination/src/index.d.ts +2 -0
  194. package/dist/types/components/nav/sidebar/src/Sidebar.d.ts +29 -0
  195. package/dist/types/components/nav/sidebar/src/index.d.ts +2 -0
  196. package/dist/types/components/nav/stepper/src/Stepper.d.ts +25 -0
  197. package/dist/types/components/nav/stepper/src/index.d.ts +2 -0
  198. package/dist/types/components/nav/system-tray/src/SystemTray.d.ts +47 -0
  199. package/dist/types/components/nav/system-tray/src/index.d.ts +2 -0
  200. package/dist/types/components/nav/toolbar/src/Toolbar.d.ts +27 -0
  201. package/dist/types/components/nav/toolbar/src/index.d.ts +2 -0
  202. package/dist/types/components/nav/treenav/src/TreeNav.d.ts +34 -0
  203. package/dist/types/components/nav/treenav/src/TreeNode.d.ts +74 -0
  204. package/dist/types/components/nav/treenav/src/index.d.ts +4 -0
  205. package/dist/types/components/nav/wrapper/src/NavWrapper.d.ts +73 -0
  206. package/dist/types/components/nav/wrapper/src/index.d.ts +2 -0
  207. package/dist/types/components/overlay/context-menu/src/ContextMenu.d.ts +21 -0
  208. package/dist/types/components/overlay/context-menu/src/index.d.ts +2 -0
  209. package/dist/types/components/overlay/drawer/src/Drawer.d.ts +22 -0
  210. package/dist/types/components/overlay/drawer/src/index.d.ts +2 -0
  211. package/dist/types/components/overlay/modal/src/Modal.d.ts +22 -0
  212. package/dist/types/components/overlay/modal/src/index.d.ts +2 -0
  213. package/dist/types/components/overlay/popover/src/Popover.d.ts +20 -0
  214. package/dist/types/components/overlay/popover/src/index.d.ts +2 -0
  215. package/dist/types/components/overlay/toast/src/Toast.d.ts +59 -0
  216. package/dist/types/components/overlay/toast/src/index.d.ts +2 -0
  217. package/dist/types/components/overlay/tooltip/src/Tooltip.d.ts +14 -0
  218. package/dist/types/components/overlay/tooltip/src/index.d.ts +2 -0
  219. package/dist/types/components/page/ide/src/IDE.d.ts +5 -0
  220. package/dist/types/components/page/ide/src/index.d.ts +2 -0
  221. package/dist/types/components/page/trading-dashboard/src/TradingDashboard.d.ts +5 -0
  222. package/dist/types/components/page/trading-dashboard/src/index.d.ts +2 -0
  223. package/dist/types/components/page/unity-desktop/src/UnityApp.d.ts +30 -0
  224. package/dist/types/components/page/unity-desktop/src/UnityDesktop.d.ts +30 -0
  225. package/dist/types/components/page/unity-desktop/src/index.d.ts +4 -0
  226. package/dist/types/components/page/word-processor/src/WordProcessor.d.ts +7 -0
  227. package/dist/types/components/page/word-processor/src/index.d.ts +2 -0
  228. package/dist/types/components/profiler.d.ts +6 -0
  229. package/dist/types/components/profiler.d.ts.map +1 -0
  230. package/dist/types/components/strict-mode.d.ts +6 -0
  231. package/dist/types/components/strict-mode.d.ts.map +1 -0
  232. package/dist/types/components/suspense.d.ts +6 -0
  233. package/dist/types/components/suspense.d.ts.map +1 -0
  234. package/dist/types/components/viz/2D-bar-graph/src/BarGraph.d.ts +61 -0
  235. package/dist/types/components/viz/2D-bar-graph/src/index.d.ts +2 -0
  236. package/dist/types/components/viz/2D-cartesian-raw/src/CartesianGraph2D.d.ts +40 -0
  237. package/dist/types/components/viz/2D-cartesian-raw/src/index.d.ts +2 -0
  238. package/dist/types/components/viz/2D-complex-graph/src/ComplexGraph2D.d.ts +33 -0
  239. package/dist/types/components/viz/2D-complex-graph/src/index.d.ts +2 -0
  240. package/dist/types/components/viz/2D-discrete-cartesian/src/DiscreteCartesian2D.d.ts +31 -0
  241. package/dist/types/components/viz/2D-discrete-cartesian/src/index.d.ts +2 -0
  242. package/dist/types/components/viz/2D-line-graph/src/LineGraph.d.ts +53 -0
  243. package/dist/types/components/viz/2D-line-graph/src/index.d.ts +2 -0
  244. package/dist/types/components/viz/2D-pie-graph/src/PieGraph.d.ts +49 -0
  245. package/dist/types/components/viz/2D-pie-graph/src/index.d.ts +3 -0
  246. package/dist/types/components/viz/2D-polar-graph/src/PolarGraph2D.d.ts +35 -0
  247. package/dist/types/components/viz/2D-polar-graph/src/index.d.ts +2 -0
  248. package/dist/types/components/viz/3d-layers/src/ThreeDLayers.d.ts +35 -0
  249. package/dist/types/components/viz/3d-layers/src/index.d.ts +2 -0
  250. package/dist/types/components/viz/3dSpace/src/Space3D.d.ts +63 -0
  251. package/dist/types/components/viz/3dSpace/src/animation.d.ts +75 -0
  252. package/dist/types/components/viz/3dSpace/src/bounds.d.ts +36 -0
  253. package/dist/types/components/viz/3dSpace/src/camera-controller.d.ts +59 -0
  254. package/dist/types/components/viz/3dSpace/src/camera.d.ts +43 -0
  255. package/dist/types/components/viz/3dSpace/src/collision.d.ts +54 -0
  256. package/dist/types/components/viz/3dSpace/src/cpu-pipeline.d.ts +47 -0
  257. package/dist/types/components/viz/3dSpace/src/index.d.ts +32 -0
  258. package/dist/types/components/viz/3dSpace/src/light.d.ts +23 -0
  259. package/dist/types/components/viz/3dSpace/src/lighting-model.d.ts +34 -0
  260. package/dist/types/components/viz/3dSpace/src/material.d.ts +12 -0
  261. package/dist/types/components/viz/3dSpace/src/mesh.d.ts +35 -0
  262. package/dist/types/components/viz/3dSpace/src/picking.d.ts +51 -0
  263. package/dist/types/components/viz/3dSpace/src/render-pipeline.d.ts +12 -0
  264. package/dist/types/components/viz/3dSpace/src/scene-graph.d.ts +20 -0
  265. package/dist/types/components/viz/3dSpace/src/scene-object.d.ts +31 -0
  266. package/dist/types/components/viz/3dSpace/src/terrain.d.ts +34 -0
  267. package/dist/types/components/viz/3dSpace/src/texture.d.ts +22 -0
  268. package/dist/types/components/viz/3dSpace/src/types.d.ts +42 -0
  269. package/dist/types/components/viz/3dSpace/src/viewport.d.ts +19 -0
  270. package/dist/types/components/viz/3dSpace/src/webgl-pipeline.d.ts +54 -0
  271. package/dist/types/components/viz/big-number/src/BigNumber.d.ts +29 -0
  272. package/dist/types/components/viz/big-number/src/index.d.ts +2 -0
  273. package/dist/types/components/viz/bloch-sphere/src/BlochSphere.d.ts +73 -0
  274. package/dist/types/components/viz/bloch-sphere/src/index.d.ts +2 -0
  275. package/dist/types/components/viz/box-plot/src/BoxPlot.d.ts +47 -0
  276. package/dist/types/components/viz/box-plot/src/index.d.ts +2 -0
  277. package/dist/types/components/viz/bubble-chart/src/BubbleChart.d.ts +38 -0
  278. package/dist/types/components/viz/bubble-chart/src/index.d.ts +2 -0
  279. package/dist/types/components/viz/calendar-heat-map/src/CalendarHeatMap.d.ts +29 -0
  280. package/dist/types/components/viz/calendar-heat-map/src/index.d.ts +2 -0
  281. package/dist/types/components/viz/chord/src/ChordDiagram.d.ts +25 -0
  282. package/dist/types/components/viz/chord/src/index.d.ts +2 -0
  283. package/dist/types/components/viz/decomposition-tree/src/DecompositionTree.d.ts +33 -0
  284. package/dist/types/components/viz/decomposition-tree/src/index.d.ts +2 -0
  285. package/dist/types/components/viz/earth-globe/src/EarthGlobe.d.ts +62 -0
  286. package/dist/types/components/viz/earth-globe/src/globe-data.d.ts +23 -0
  287. package/dist/types/components/viz/earth-globe/src/index.d.ts +5 -0
  288. package/dist/types/components/viz/force-graph/src/ForceGraph.d.ts +99 -0
  289. package/dist/types/components/viz/force-graph/src/index.d.ts +2 -0
  290. package/dist/types/components/viz/funnel/src/FunnelChart.d.ts +28 -0
  291. package/dist/types/components/viz/funnel/src/index.d.ts +2 -0
  292. package/dist/types/components/viz/gantt-chart/src/GanttChart.d.ts +33 -0
  293. package/dist/types/components/viz/gantt-chart/src/index.d.ts +2 -0
  294. package/dist/types/components/viz/gauge/src/Gauge.d.ts +37 -0
  295. package/dist/types/components/viz/gauge/src/index.d.ts +2 -0
  296. package/dist/types/components/viz/graph/src/HypercubeGraph.d.ts +43 -0
  297. package/dist/types/components/viz/graph/src/hypercube.d.ts +78 -0
  298. package/dist/types/components/viz/graph/src/index.d.ts +4 -0
  299. package/dist/types/components/viz/heat-map/src/HeatMap.d.ts +29 -0
  300. package/dist/types/components/viz/heat-map/src/index.d.ts +2 -0
  301. package/dist/types/components/viz/histogram/src/Histogram.d.ts +27 -0
  302. package/dist/types/components/viz/histogram/src/index.d.ts +2 -0
  303. package/dist/types/components/viz/lollipop/src/LollipopChart.d.ts +32 -0
  304. package/dist/types/components/viz/lollipop/src/index.d.ts +2 -0
  305. package/dist/types/components/viz/matrix/src/Matrix.d.ts +29 -0
  306. package/dist/types/components/viz/matrix/src/index.d.ts +2 -0
  307. package/dist/types/components/viz/partition/src/Partition.d.ts +31 -0
  308. package/dist/types/components/viz/partition/src/index.d.ts +2 -0
  309. package/dist/types/components/viz/pivot-table/src/PivotTable.d.ts +25 -0
  310. package/dist/types/components/viz/pivot-table/src/index.d.ts +2 -0
  311. package/dist/types/components/viz/radar-chart/src/RadarChart.d.ts +35 -0
  312. package/dist/types/components/viz/radar-chart/src/index.d.ts +2 -0
  313. package/dist/types/components/viz/sankey/src/SankeyDiagram.d.ts +38 -0
  314. package/dist/types/components/viz/sankey/src/index.d.ts +2 -0
  315. package/dist/types/components/viz/sunburst/src/Sunburst.d.ts +27 -0
  316. package/dist/types/components/viz/sunburst/src/index.d.ts +2 -0
  317. package/dist/types/components/viz/tree-map/src/TreeMap.d.ts +29 -0
  318. package/dist/types/components/viz/tree-map/src/index.d.ts +2 -0
  319. package/dist/types/components/viz/us-state-map/src/USStateMap.d.ts +23 -0
  320. package/dist/types/components/viz/us-state-map/src/index.d.ts +4 -0
  321. package/dist/types/components/viz/us-state-map/src/us-state-paths.d.ts +10 -0
  322. package/dist/types/components/viz/vector-field/src/VectorField.d.ts +61 -0
  323. package/dist/types/components/viz/vector-field/src/index.d.ts +2 -0
  324. package/dist/types/components/viz/waterfall/src/WaterfallChart.d.ts +32 -0
  325. package/dist/types/components/viz/waterfall/src/index.d.ts +2 -0
  326. package/dist/types/components/viz/word-cloud/src/WordCloud.d.ts +30 -0
  327. package/dist/types/components/viz/word-cloud/src/index.d.ts +2 -0
  328. package/dist/types/components/viz/wrapper/src/VizWrapper.d.ts +60 -0
  329. package/dist/types/components/viz/wrapper/src/index.d.ts +2 -0
  330. package/dist/types/compute/context.d.ts +20 -0
  331. package/dist/types/compute/context.d.ts.map +1 -0
  332. package/dist/types/compute/cpu-backend.d.ts +15 -0
  333. package/dist/types/compute/cpu-backend.d.ts.map +1 -0
  334. package/dist/types/compute/index.d.ts +3 -0
  335. package/dist/types/compute/index.d.ts.map +1 -0
  336. package/dist/types/compute/types.d.ts +57 -0
  337. package/dist/types/compute/types.d.ts.map +1 -0
  338. package/dist/types/compute/webgl-backend.d.ts +33 -0
  339. package/dist/types/compute/webgl-backend.d.ts.map +1 -0
  340. package/dist/types/compute/webgpu-backend.d.ts +50 -0
  341. package/dist/types/compute/webgpu-backend.d.ts.map +1 -0
  342. package/dist/types/context/create-context.d.ts +15 -0
  343. package/dist/types/context/create-context.d.ts.map +1 -0
  344. package/dist/types/core/children.d.ts +15 -0
  345. package/dist/types/core/children.d.ts.map +1 -0
  346. package/dist/types/core/clone-element.d.ts +10 -0
  347. package/dist/types/core/clone-element.d.ts.map +1 -0
  348. package/dist/types/core/create-element.d.ts +20 -0
  349. package/dist/types/core/create-element.d.ts.map +1 -0
  350. package/dist/types/core/create-ref.d.ts +7 -0
  351. package/dist/types/core/create-ref.d.ts.map +1 -0
  352. package/dist/types/core/fiber.d.ts +30 -0
  353. package/dist/types/core/fiber.d.ts.map +1 -0
  354. package/dist/types/core/forward-ref.d.ts +16 -0
  355. package/dist/types/core/forward-ref.d.ts.map +1 -0
  356. package/dist/types/core/fragment.d.ts +6 -0
  357. package/dist/types/core/fragment.d.ts.map +1 -0
  358. package/dist/types/core/is-valid-element.d.ts +7 -0
  359. package/dist/types/core/is-valid-element.d.ts.map +1 -0
  360. package/dist/types/core/lanes.d.ts +47 -0
  361. package/dist/types/core/lanes.d.ts.map +1 -0
  362. package/dist/types/core/lazy.d.ts +20 -0
  363. package/dist/types/core/lazy.d.ts.map +1 -0
  364. package/dist/types/core/memo.d.ts +13 -0
  365. package/dist/types/core/memo.d.ts.map +1 -0
  366. package/dist/types/core/reconciler.d.ts +12 -0
  367. package/dist/types/core/reconciler.d.ts.map +1 -0
  368. package/dist/types/core/scheduler-host-config.d.ts +37 -0
  369. package/dist/types/core/scheduler-host-config.d.ts.map +1 -0
  370. package/dist/types/core/scheduler.d.ts +29 -0
  371. package/dist/types/core/scheduler.d.ts.map +1 -0
  372. package/dist/types/core/src/build/index.d.ts +4 -0
  373. package/dist/types/core/src/build/noscript-plugin.d.ts +62 -0
  374. package/dist/types/core/src/build/seo-plugin.d.ts +42 -0
  375. package/dist/types/core/src/client/graphql.d.ts +63 -0
  376. package/dist/types/core/src/client/index.d.ts +3 -0
  377. package/dist/types/core/src/client/protobuf.d.ts +39 -0
  378. package/dist/types/core/src/client/rest.d.ts +60 -0
  379. package/dist/types/core/src/components/component.d.ts +38 -0
  380. package/dist/types/core/src/components/error-boundary.d.ts +22 -0
  381. package/dist/types/core/src/components/profiler.d.ts +5 -0
  382. package/dist/types/core/src/components/strict-mode.d.ts +5 -0
  383. package/dist/types/core/src/components/suspense.d.ts +5 -0
  384. package/dist/types/core/src/components-barrel.d.ts +100 -0
  385. package/dist/types/core/src/compute/context.d.ts +19 -0
  386. package/dist/types/core/src/compute/cpu-backend.d.ts +14 -0
  387. package/dist/types/core/src/compute/index.d.ts +2 -0
  388. package/dist/types/core/src/compute/types.d.ts +56 -0
  389. package/dist/types/core/src/compute/webgl-backend.d.ts +32 -0
  390. package/dist/types/core/src/compute/webgpu-backend.d.ts +49 -0
  391. package/dist/types/core/src/context/create-context.d.ts +14 -0
  392. package/dist/types/core/src/core/children.d.ts +14 -0
  393. package/dist/types/core/src/core/clone-element.d.ts +9 -0
  394. package/dist/types/core/src/core/create-element.d.ts +19 -0
  395. package/dist/types/core/src/core/create-ref.d.ts +6 -0
  396. package/dist/types/core/src/core/fiber.d.ts +29 -0
  397. package/dist/types/core/src/core/forward-ref.d.ts +15 -0
  398. package/dist/types/core/src/core/fragment.d.ts +5 -0
  399. package/dist/types/core/src/core/is-valid-element.d.ts +6 -0
  400. package/dist/types/core/src/core/lanes.d.ts +46 -0
  401. package/dist/types/core/src/core/lazy.d.ts +19 -0
  402. package/dist/types/core/src/core/memo.d.ts +12 -0
  403. package/dist/types/core/src/core/reconciler.d.ts +11 -0
  404. package/dist/types/core/src/core/scheduler-host-config.d.ts +36 -0
  405. package/dist/types/core/src/core/scheduler.d.ts +28 -0
  406. package/dist/types/core/src/core/transitions.d.ts +31 -0
  407. package/dist/types/core/src/devtools/index.d.ts +21 -0
  408. package/dist/types/core/src/dom/create-portal.d.ts +6 -0
  409. package/dist/types/core/src/dom/create-root.d.ts +23 -0
  410. package/dist/types/core/src/dom/flush-sync.d.ts +1 -0
  411. package/dist/types/core/src/dom/index.d.ts +4 -0
  412. package/dist/types/core/src/dom/legacy.d.ts +16 -0
  413. package/dist/types/core/src/dom/synthetic-event.d.ts +90 -0
  414. package/dist/types/core/src/dom/work-loop.d.ts +34 -0
  415. package/dist/types/core/src/features/feature-flags.d.ts +38 -0
  416. package/dist/types/core/src/features/index.d.ts +27 -0
  417. package/dist/types/core/src/hooks/dispatcher.d.ts +26 -0
  418. package/dist/types/core/src/hooks/hook-state.d.ts +46 -0
  419. package/dist/types/core/src/hooks/index.d.ts +47 -0
  420. package/dist/types/core/src/hooks/install-dispatcher.d.ts +2 -0
  421. package/dist/types/core/src/hooks/use-head.d.ts +54 -0
  422. package/dist/types/core/src/index.d.ts +23 -0
  423. package/dist/types/core/src/jsx-dev-runtime.d.ts +1 -0
  424. package/dist/types/core/src/jsx-runtime.d.ts +7 -0
  425. package/dist/types/core/src/router/index.d.ts +12 -0
  426. package/dist/types/core/src/router/link-component.d.ts +16 -0
  427. package/dist/types/core/src/router/match-path.d.ts +28 -0
  428. package/dist/types/core/src/router/route-component.d.ts +12 -0
  429. package/dist/types/core/src/router/router-component.d.ts +5 -0
  430. package/dist/types/core/src/router/router-context.d.ts +13 -0
  431. package/dist/types/core/src/router/router-store.d.ts +22 -0
  432. package/dist/types/core/src/router/use-navigate.d.ts +4 -0
  433. package/dist/types/core/src/router/use-params.d.ts +2 -0
  434. package/dist/types/core/src/router/use-router.d.ts +3 -0
  435. package/dist/types/core/src/server/index.d.ts +3 -0
  436. package/dist/types/core/src/server/render-to-pipeable-stream.d.ts +31 -0
  437. package/dist/types/core/src/server/render-to-readable-stream.d.ts +19 -0
  438. package/dist/types/core/src/server/render-to-string.d.ts +25 -0
  439. package/dist/types/core/src/shared/act.d.ts +1 -0
  440. package/dist/types/core/src/shared/aria-warnings.d.ts +1 -0
  441. package/dist/types/core/src/shared/async-compute.d.ts +63 -0
  442. package/dist/types/core/src/shared/component-registry.d.ts +53 -0
  443. package/dist/types/core/src/shared/render-guard.d.ts +47 -0
  444. package/dist/types/core/src/shared/secure-fetch.d.ts +21 -0
  445. package/dist/types/core/src/shared/types.d.ts +127 -0
  446. package/dist/types/core/src/shared/warnings.d.ts +19 -0
  447. package/dist/types/core/src/telemetry/index.d.ts +2 -0
  448. package/dist/types/core/src/telemetry/metrics.d.ts +67 -0
  449. package/dist/types/core/src/telemetry/tracing.d.ts +95 -0
  450. package/dist/types/core/transitions.d.ts +32 -0
  451. package/dist/types/core/transitions.d.ts.map +1 -0
  452. package/dist/types/devtools/index.d.ts +22 -0
  453. package/dist/types/devtools/index.d.ts.map +1 -0
  454. package/dist/types/dom/create-portal.d.ts +7 -0
  455. package/dist/types/dom/create-portal.d.ts.map +1 -0
  456. package/dist/types/dom/create-root.d.ts +24 -0
  457. package/dist/types/dom/create-root.d.ts.map +1 -0
  458. package/dist/types/dom/flush-sync.d.ts +2 -0
  459. package/dist/types/dom/flush-sync.d.ts.map +1 -0
  460. package/dist/types/dom/index.d.ts +5 -0
  461. package/dist/types/dom/index.d.ts.map +1 -0
  462. package/dist/types/dom/legacy.d.ts +17 -0
  463. package/dist/types/dom/legacy.d.ts.map +1 -0
  464. package/dist/types/dom/synthetic-event.d.ts +91 -0
  465. package/dist/types/dom/synthetic-event.d.ts.map +1 -0
  466. package/dist/types/dom/work-loop.d.ts +35 -0
  467. package/dist/types/dom/work-loop.d.ts.map +1 -0
  468. package/dist/types/features/feature-flags.d.ts +39 -0
  469. package/dist/types/features/feature-flags.d.ts.map +1 -0
  470. package/dist/types/features/index.d.ts +28 -0
  471. package/dist/types/features/index.d.ts.map +1 -0
  472. package/dist/types/hooks/dispatcher.d.ts +27 -0
  473. package/dist/types/hooks/dispatcher.d.ts.map +1 -0
  474. package/dist/types/hooks/hook-state.d.ts +47 -0
  475. package/dist/types/hooks/hook-state.d.ts.map +1 -0
  476. package/dist/types/hooks/index.d.ts +48 -0
  477. package/dist/types/hooks/index.d.ts.map +1 -0
  478. package/dist/types/hooks/install-dispatcher.d.ts +3 -0
  479. package/dist/types/hooks/install-dispatcher.d.ts.map +1 -0
  480. package/dist/types/hooks/use-head.d.ts +55 -0
  481. package/dist/types/hooks/use-head.d.ts.map +1 -0
  482. package/dist/types/index.d.ts +24 -0
  483. package/dist/types/index.d.ts.map +1 -0
  484. package/dist/types/jsx-dev-runtime.d.ts +2 -0
  485. package/dist/types/jsx-dev-runtime.d.ts.map +1 -0
  486. package/dist/types/jsx-runtime.d.ts +8 -0
  487. package/dist/types/jsx-runtime.d.ts.map +1 -0
  488. package/dist/types/router/index.d.ts +13 -0
  489. package/dist/types/router/index.d.ts.map +1 -0
  490. package/dist/types/router/link-component.d.ts +17 -0
  491. package/dist/types/router/link-component.d.ts.map +1 -0
  492. package/dist/types/router/match-path.d.ts +29 -0
  493. package/dist/types/router/match-path.d.ts.map +1 -0
  494. package/dist/types/router/route-component.d.ts +13 -0
  495. package/dist/types/router/route-component.d.ts.map +1 -0
  496. package/dist/types/router/router-component.d.ts +6 -0
  497. package/dist/types/router/router-component.d.ts.map +1 -0
  498. package/dist/types/router/router-context.d.ts +14 -0
  499. package/dist/types/router/router-context.d.ts.map +1 -0
  500. package/dist/types/router/router-store.d.ts +23 -0
  501. package/dist/types/router/router-store.d.ts.map +1 -0
  502. package/dist/types/router/use-navigate.d.ts +5 -0
  503. package/dist/types/router/use-navigate.d.ts.map +1 -0
  504. package/dist/types/router/use-params.d.ts +3 -0
  505. package/dist/types/router/use-params.d.ts.map +1 -0
  506. package/dist/types/router/use-router.d.ts +4 -0
  507. package/dist/types/router/use-router.d.ts.map +1 -0
  508. package/dist/types/server/index.d.ts +4 -0
  509. package/dist/types/server/index.d.ts.map +1 -0
  510. package/dist/types/server/render-to-pipeable-stream.d.ts +32 -0
  511. package/dist/types/server/render-to-pipeable-stream.d.ts.map +1 -0
  512. package/dist/types/server/render-to-readable-stream.d.ts +20 -0
  513. package/dist/types/server/render-to-readable-stream.d.ts.map +1 -0
  514. package/dist/types/server/render-to-string.d.ts +26 -0
  515. package/dist/types/server/render-to-string.d.ts.map +1 -0
  516. package/dist/types/shared/act.d.ts +2 -0
  517. package/dist/types/shared/act.d.ts.map +1 -0
  518. package/dist/types/shared/aria-warnings.d.ts +2 -0
  519. package/dist/types/shared/aria-warnings.d.ts.map +1 -0
  520. package/dist/types/shared/async-compute.d.ts +64 -0
  521. package/dist/types/shared/async-compute.d.ts.map +1 -0
  522. package/dist/types/shared/component-registry.d.ts +54 -0
  523. package/dist/types/shared/component-registry.d.ts.map +1 -0
  524. package/dist/types/shared/render-guard.d.ts +48 -0
  525. package/dist/types/shared/render-guard.d.ts.map +1 -0
  526. package/dist/types/shared/secure-fetch.d.ts +22 -0
  527. package/dist/types/shared/secure-fetch.d.ts.map +1 -0
  528. package/dist/types/shared/types.d.ts +128 -0
  529. package/dist/types/shared/types.d.ts.map +1 -0
  530. package/dist/types/shared/warnings.d.ts +20 -0
  531. package/dist/types/shared/warnings.d.ts.map +1 -0
  532. package/dist/types/telemetry/index.d.ts +3 -0
  533. package/dist/types/telemetry/index.d.ts.map +1 -0
  534. package/dist/types/telemetry/metrics.d.ts +68 -0
  535. package/dist/types/telemetry/metrics.d.ts.map +1 -0
  536. package/dist/types/telemetry/tracing.d.ts +96 -0
  537. package/dist/types/telemetry/tracing.d.ts.map +1 -0
  538. package/package.json +8 -17
@@ -1,2 +1,9 @@
1
- "use strict";const e=Symbol.for("spec.element"),t=Symbol.for("spec.provider"),n=Symbol.for("spec.consumer");function o(t,n,...o){let r=null,i=null;const l={};if(null!=n){void 0!==n.key&&(r=""+n.key),void 0!==n.ref&&(i=n.ref);for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&"key"!==e&&"ref"!==e&&"__proto__"!==e&&"constructor"!==e&&"prototype"!==e&&(l[e]=n[e])}if(1===o.length?l.children=o[0]:o.length>1&&(l.children=o),"function"==typeof t&&t.defaultProps){const e=t.defaultProps;for(const t of Object.keys(e))"__proto__"!==t&&"constructor"!==t&&void 0===l[t]&&(l[t]=e[t])}return{$$typeof:e,type:t,props:l,key:r,ref:i}}function r(e){const o={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},r={$$typeof:t,_context:o},i={$$typeof:n,_context:o};return o.Provider=r,o.Consumer=i,o}function i(){throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.")}function l(e){return i().useState(e)}function a(e,t){return i().useEffect(e,t)}function s(e,t){return i().useCallback(e,t)}function d(e,t){return i().useMemo(e,t)}function c(e){return i().useRef(e)}function u(){return i().useId()}function f(){const e=("undefined"!=typeof window?window.location.hash:"").replace(/^#\/?/,"/");return""===e?"/":e}r({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""}),f();const p=new Set;function h(e){if(!e)return new Date;const t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),n=e=>Number(t.find(t=>t.type===e)?.value??0);return new Date(n("year"),n("month")-1,n("day"),n("hour"),n("minute"),n("second"))}"undefined"!=typeof window&&window.addEventListener("hashchange",function(){f(),"undefined"!=typeof window&&window.location.hash;for(const e of p)e()}),r({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});const g="#334155",x="#1e293b",m="#374151",y={xs:24,sm:32,md:40,lg:56,xl:80},b=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"],v={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function w(e,t){const n=-t/4+"px";switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};default:return{top:n,right:n}}}const k={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},S={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}},$={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},M={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},z={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},C={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},I={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},A={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},F={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},D={...F,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},R={...F,opacity:"0.5",cursor:"default"},L={cursor:"pointer",width:"16px",height:"16px"};function W(e,t,n){return e!==t?"↕":"asc"===n?"↑":"↓"}function N(e){return e<10?`0${e}`:String(e)}const T={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},E={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},P={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},B={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"},_={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},H={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Y={borderBottom:"1px solid var(--color-border, #e5e7eb)"},j={cursor:"pointer",transition:"background-color 0.15s ease"},q={backgroundColor:"var(--color-bg-muted, #eff6ff)"},O={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},U={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function G(e,t){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec({red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e);return n?`rgba(${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)}, ${t})`:e}const X={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}},V={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"},K={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},Z={info:{icon:"ℹ️",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"✅",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"⚠️",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"❌",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function J(e){const t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}const Q={sm:16,md:24,lg:40},ee={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function te(e){const t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:"number"==typeof t.width?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},l={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:l,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:l},e.helpText):null)}function ne(e,t){const n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}const oe={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}},re=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function ie(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function le(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}const ae=["January","February","March","April","May","June","July","August","September","October","November","December"],se=["Su","Mo","Tu","We","Th","Fr","Sa"];function de(e){if(!e)return null;if(e instanceof Date)return e;const t=new Date(e);return isNaN(t.getTime())?null:t}function ce(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function ue(e){if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(0===t?0:1)} ${["B","KB","MB","GB"][t]}`}const fe=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],pe={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"•",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"“",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"🔗",command:"createLink"},unlink:{label:"Remove link",icon:"⛔",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"―",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"✘",command:"removeFormat"},undo:{label:"Undo",icon:"↩",command:"undo"},redo:{label:"Redo",icon:"↪",command:"redo"}},he=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function ge(e){return String(e).padStart(2,"0")}const xe={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}},me={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"},ye={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function be(e,t){return"both"===e?"auto":"horizontal"===e?"x"===t?"auto":"hidden":"y"===t?"auto":"hidden"}function ve(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":case"hover":return{scrollbarWidth:"thin"};default:return{scrollbarWidth:"auto"}}}function we(e){return!isFinite(e)||e<0?"0:00":`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,"0")}`}function ke(e){const t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},l=c(null),a={display:"flex",flexDirection:"horizontal"===t?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:"number"==typeof i.width?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:"number"==typeof i.maxHeight?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},d=s(e=>{if(!r)return;const n=e,o=l.current;if(!o)return;const i=Array.from(o.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),a=i.indexOf(document.activeElement);if(a<0)return;const s="vertical"===t,d=s?"ArrowDown":"ArrowRight",c=s?"ArrowUp":"ArrowLeft";if(n.key===d){n.preventDefault();const e=i[a+1];e&&e.focus()}else if(n.key===c){n.preventDefault();const e=i[a-1];e&&e.focus()}else"Home"===n.key?(n.preventDefault(),i[0]?.focus()):"End"===n.key&&(n.preventDefault(),i[i.length-1]?.focus())},[r,t]);return o("nav",{ref:l,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:a,onKeyDown:d},e.children)}function Se(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function $e(){const[e,t]=l(!1);return{hover:e,onMouseEnter:s(()=>t(!0),[]),onMouseLeave:s(()=>t(!1),[])}}function Me(e){const{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:l,collapseIcon:a,iconPosition:d}=e,{hover:c,onMouseEnter:u,onMouseLeave:f}=$e(),p=!0===t.disabled,h={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:p?"#f9fafb":c?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:p?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:p?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};"left"===d&&(h.flexDirection="row");const g=s(e=>{const t=e;p||"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),r())},[p,r]),x=s(()=>{p||r()},[p,r]),m=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:"right"===d?"auto":"0",marginRight:"left"===d?"8px":"0",paddingLeft:"right"===d?"8px":"0"}},n?a:l),y=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,b="left"===d?[m,y]:[y,m];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":p?"true":void 0,"data-section-id":t.id,tabIndex:p?-1:0,style:h,onClick:x,onKeyDown:g,onMouseEnter:u,onMouseLeave:f},...b)}function ze(e){const{section:t,expanded:n,contentStyle:r,animated:i}=e,l={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},a={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:l},o("div",{style:a},t.content))}const Ce={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function Ie(e){const{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:a,onMouseEnter:d,onMouseLeave:c}=$e(),[u,f]=l(!1),p=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const h=!0===t.disabled,g={...Se(n,{hover:!h&&a,active:!1}),position:"relative",justifyContent:"space-between",...h?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},x=s(()=>{h||(p?f(e=>!e):(t.onClick&&t.onClick(),r&&i()))},[h,p,t,r,i]),m=s(()=>{d(),p&&f(!0)},[p,d]),y=s(()=>{c(),p&&f(!1)},[p,c]),b=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),v=p?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"›"):null,w=p&&u?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(ke,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(e=>o(Ie,{key:e.id,item:e,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:m,onMouseLeave:y},o("button",{type:"button",role:"menuitem",style:g,onClick:x,disabled:h||void 0,tabIndex:h?-1:0,"aria-disabled":h?"true":void 0,"aria-haspopup":p||void 0,"aria-expanded":p?String(u):void 0},b,v),w)}function Ae(e){const{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=$e(),[c,u]=l(!1),f=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const p=!0===t.disabled,h=s(()=>{p||(f?u(e=>!e):(t.onClick&&t.onClick(),n()))},[p,f,t,n]),g=s(()=>{a(),f&&u(!0)},[f,a]),x=s(()=>{d(),f&&u(!1)},[f,d]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:p?"default":"pointer",backgroundColor:!p&&i?"#f3f4f6":"transparent",color:p?"#9ca3af":"#1f2937",opacity:p?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),b=f?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"▶"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,v=f&&c?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((e,t)=>o(Ae,{key:String(t),item:e,onClose:n,index:t})))):null;return o("div",{style:{position:"relative"},onMouseEnter:g,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:m,onClick:h,disabled:p||void 0,tabIndex:-1,"aria-disabled":p||void 0,"aria-haspopup":f||void 0,"aria-expanded":f?c:void 0},y,b),v)}function Fe(e){const{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:l,onClose:a}=e,{hover:d,onMouseEnter:u,onMouseLeave:f}=$e(),p=c(null),h=s(()=>{r?a():l(n)},[r,n,l,a]),g=s(()=>{u(),i&&!r&&l(n)},[i,r,n,l,u]),x={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":d?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},m=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((e,t)=>o(Ae,{key:String(t),item:e,onClose:a,index:t})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:g,onMouseLeave:f},o("button",{ref:p,type:"button",role:"menuitem",style:x,onClick:h,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),m)}function De(e,t){const n=[];for(let o=e;o<=t;o++)n.push(o);return n}const Re={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},Le={...Re,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},We={...Re,color:"#9ca3af",cursor:"default",opacity:"0.5"},Ne={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Te(e){const{item:t,collapsed:n,selectedId:r,onSelect:i,depth:a}=e,{hover:d,onMouseEnter:c,onMouseLeave:u}=$e(),[f,p]=l(!1),h=t.children&&t.children.length>0,g=t.id===r,x=s(()=>{h&&!n&&p(e=>!e),i&&i(t.id)},[h,n,i,t.id]),m={display:"flex",alignItems:"center",padding:n?"10px 0":"10px 12px 10px "+(n?"0":16+16*a+"px"),justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:g?"#eff6ff":d?"#f3f4f6":"transparent",color:g?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},y=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,b=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),v=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,w=!n&&h?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:f?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"▶"):null,k=n&&d?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,S=o("button",{type:"button",style:m,onClick:x,onMouseEnter:c,onMouseLeave:u,"aria-selected":g?"true":"false",title:n?t.label:void 0},y,b,v,w,k),$=!n&&h&&f?t.children.map(e=>o(Te,{key:e.id,item:e,collapsed:n,selectedId:r,onSelect:i,depth:a+1})):null;return o("div",{key:t.id,style:{position:"relative"}},S,$?o("div",{role:"group"},...$):null)}const Ee={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function Pe(e){const{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:a,onMouseLeave:d}=$e(),c=Ee[n],u=!0===t.disabled,f="toggle"===t.type,[p,h]=l(!1),g=f?!0===t.active:p,x=s(()=>{!u&&t.onClick&&t.onClick()},[u,t]),m=s(()=>{u||f||h(!0)},[u,f]),y=s(()=>{f||h(!1)},[f]),b=s(()=>{d(),f||h(!1)},[f,d]),v={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:c.height,padding:c.padding,fontSize:c.fontSize,fontFamily:"inherit",border:"raised"===r?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:g?"#e0e7ff":!u&&i?"#f3f4f6":"raised"===r?"#ffffff":"transparent",color:u?"#9ca3af":g?"#2563eb":"#374151",cursor:u?"default":"pointer",opacity:u?"0.5":"1",outline:"none",transition:"background-color 0.15s"},w=t.icon?o("span",{style:{fontSize:c.iconSize},"aria-hidden":"true"},t.icon):null,k=t.label?o("span",null,t.label):null,S="dropdown"===t.type?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"▼"):null;return o("button",{type:"button",style:v,onClick:x,onMouseDown:m,onMouseUp:y,onMouseEnter:a,onMouseLeave:b,disabled:u||void 0,"aria-pressed":f?g:void 0,"aria-label":t.label||t.id,title:t.label||t.id},w,k,S)}class Be{constructor(e,t){this.id=e.id,this.label=e.label,this.expanded=e.expanded??!1,this.icon=e.icon??null,this.metadata=e.metadata??{},this.parent=t??null,this.depth=t?t.depth+1:0,this.children=(e.children??[]).map(e=>new Be(e,this))}static fromData(e){return new Be(e)}isLeaf(){return 0===this.children.length}isRoot(){return null===this.parent}walk(e){e(this,this.depth);for(const t of this.children)t.walk(e)}find(e){if(this.id===e)return this;for(const t of this.children){const n=t.find(e);if(n)return n}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(e){const t=new Be(e,this);return this.children.push(t),t}removeChild(e){const t=this.children.findIndex(t=>t.id===e);return-1!==t&&(this.children.splice(t,1),!0)}}function _e(e){e.expanded=!0;for(const t of e.children)_e(t)}function He(e,t=[]){if(t.push(e),e.expanded)for(const n of e.children)He(n,t);return t}function Ye(e){if(!e.parent)return!0;const t=e.parent.children;return t[t.length-1]===e}function je(e){const{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:l,iconExpanded:s,iconCollapsed:d,nodeStyle:u,renderNode:f,onToggle:p,onClick:h,focusedId:g}=e,x=$e(),m=c(null),y=g===t.id;a(()=>{y&&m.current&&m.current.focus()},[y]);const b=t.isLeaf(),v=t.depth,w=[];for(let e=0;e<v;e++){let n=t;for(let t=0;t<v-e;t++)n=n?n.parent:null;const a=!!n&&!Ye(n);w.push(o("span",{key:`connector-${e}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...a?{borderLeft:`${l}px solid ${i}`}:{}}}))}const k=v>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${l}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,S=b?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:e=>{e.stopPropagation(),p(t)}},t.expanded?s:d),$=f?f(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),M=Se(u,{hover:x.hover,active:n});return o("div",{ref:m,role:"treeitem","aria-expanded":b?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":v+1,tabIndex:y?0:-1,style:{...M,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>h(t)},...w,k,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:u.padding??"6px 10px",minWidth:"0"}},S,$))}function qe(e){const{items:t,position:n,onClose:r,depth:i}=e,[s,d]=l(-1),[u,f]=l(null),p=c(null);a(()=>{if(!p.current)return;p.current.focus();const e=e=>{const n=e,o=t.map((e,t)=>({item:e,i:t})).filter(({item:e})=>!e.divider);if("ArrowDown"===n.key)n.preventDefault(),d(e=>{const t=(o.findIndex(({i:t})=>t===e)+1)%o.length;return o[t].i});else if("ArrowUp"===n.key)n.preventDefault(),d(e=>{const t=o.findIndex(({i:t})=>t===e),n=t<=0?o.length-1:t-1;return o[n].i});else if("ArrowRight"===n.key)s>=0&&t[s]?.children&&f(s);else if("ArrowLeft"===n.key)i>0&&r();else if("Enter"===n.key){if(n.preventDefault(),s>=0){const e=t[s];e.children?f(s):!e.disabled&&e.onClick&&(e.onClick(),r())}}else"Escape"===n.key&&r()};p.current.addEventListener("keydown",e);const n=p.current;return()=>n.removeEventListener("keydown",e)},[t,s,i,r]);const h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},g=t.map((e,t)=>{if(e.divider)return o("div",{key:`divider-${t}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});const l=s===t,a=!!e.disabled,c=!!(e.children&&e.children.length>0),p={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:a?"#9ca3af":"#1f2937",cursor:a?"default":"pointer",backgroundColor:l&&!a?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},h=[];e.icon&&h.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},e.icon)),h.push(o("span",{style:{flex:"1"}},e.label??"")),c&&h.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"▶"));const g=[o("div",{key:`item-${t}`,style:p,onMouseEnter:()=>{d(t),f(c?t:null)},onClick:()=>{a||(c?f(t):(e.onClick&&e.onClick(),r()))},role:"menuitem","aria-disabled":a?"true":void 0},...h)];return c&&u===t&&g.push(o(qe,{key:`submenu-${t}`,items:e.children,position:{x:n.x+178,y:n.y+36*t},onClose:()=>f(null),depth:i+1})),o("div",{key:`wrap-${t}`,style:{position:"relative"}},...g)});return o("div",{ref:p,style:h,tabIndex:-1,role:"menu"},...g)}function Oe(e){const{items:t,children:n}=e,[r,i]=l(null),d=s(e=>{e.preventDefault();const t=e;i({x:t.clientX,y:t.clientY})},[]),c=s(()=>{i(null)},[]);a(()=>{if(!r)return;const e=e=>{c()},t=setTimeout(()=>{document.addEventListener("mousedown",e)},0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[r,c]),a(()=>{if(!r)return;const e=e=>{"Escape"===e.key&&c()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[r,c]);const u=[o("div",{onContextMenu:d,style:{display:"contents"}},n)];return r&&u.push(o(qe,{items:t,position:r,onClose:c,depth:0})),o("div",null,...u)}function Ue(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function Ge(e,t){const n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}const Xe={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Ve(e,t){const n=t+8;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function Ke(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="8px",o="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} #fff ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} #fff ${o} ${o}`}}}let Ze=0;function Je(e={}){const t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3};let n=[];const o=new Set;function r(){o.forEach(e=>e())}return{toast:function(e,o={}){const i=`toast-${++Ze}-${Date.now()}`,l={id:i,message:e,type:o.type??"info",duration:o.duration??t.defaultDuration,action:o.action,createdAt:Date.now()};return n=[l,...n].slice(0,t.maxToasts),r(),i},dismiss:function(e){n=n.filter(t=>t.id!==e),r()},dismissAll:function(){n=[],r()},subscribe:e=>(o.add(e),()=>{o.delete(e)}),getToasts:()=>n,config:t}}const Qe={info:{bg:"#eff6ff",border:"#3b82f6",icon:"ℹ️"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"✅"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"⚠️"},error:{bg:"#fef2f2",border:"#ef4444",icon:"❌"}};function et(e){const{item:t,onDismiss:n}=e,r=Qe[t.type];a(()=>{if(t.duration<=0)return;const e=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(e)},[t.id,t.duration,n]);const i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},l={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},s=[o("span",null,r.icon),o("span",{style:{flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"}},t.message)];return t.action&&s.push(o("button",{type:"button",style:l,onClick:t.action.onClick},t.action.label)),s.push(o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"×")),o("div",{style:i,role:"alert"},...s)}function tt(e){const{toaster:t}=e,[,n]=l(0);a(()=>t.subscribe(()=>n(e=>e+1)),[t]);const r=t.getToasts();if(0===r.length)return null;const i=function(e){const t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),o=e.startsWith("bottom"),r=e.endsWith("left"),i=e.endsWith("right"),l=e.endsWith("center");return n&&(t.top="0"),o&&(t.bottom="0",t.flexDirection="column-reverse"),r&&(t.left="0"),i&&(t.right="0"),l&&(t.left="50%",t.transform="translateX(-50%)"),t}(t.config.position);a(()=>{const e="specifyjs-toast-keyframes";if(document.getElementById(e))return;const t=document.createElement("style");return t.id=e,t.textContent="\n @keyframes specifyjs-toast-slide-in {\n from { opacity: 0; transform: translateY(-12px); }\n to { opacity: 1; transform: translateY(0); }\n }\n ",document.head.appendChild(t),()=>{const t=document.getElementById(e);t&&t.remove()}},[]);const d=s(e=>t.dismiss(e),[t]),c=r.map(e=>o(et,{key:e.id,item:e,onDismiss:d}));return o("div",{style:i},...c)}function nt(e){const t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n="6px",o="transparent",r="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${r} ${o} ${o} ${o}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${o} ${o} ${r} ${o}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${o} ${o} ${o} ${r}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${o} ${r} ${o} ${o}`}}}function ot(e,t,n,o,r){return d(()=>{const i=Math.max(1,(o-r*(e+1))/e);return{valueScale:e=>0===t?0:e/t*n,categoryScale:e=>r+e*(i+r),barThickness:i,maxValue:t,valueAxisLength:n,categoryAxisLength:o}},[e,t,n,o,r])}const rt=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function it(e,t){return t||rt[e%rt.length]}function lt(e){const{start:t,end:n,step:o}=e;if(o<=0||!isFinite(o))return[];const r=Math.ceil((n-t)/o)+1;if(r>1e6)return[];const i=[];for(let e=0;e<r;e++){const r=t+e*o;if(r>n+.001*o)break;i.push(r)}return i}function at(e,t){const n=[];for(let o=0;o<t.length;o++){const r=t[o],i=e(r);isFinite(i)&&n.push({input:r,output:i})}return n}function st(e,t,n,o){let r=!1,i=0;const l=[],a=()=>{if(r)return;const s=Math.min(i+n,t.length);for(let n=i;n<s;n++){const o=t[n],r=e(o);isFinite(r)&&l.push({input:o,output:r})}i=s,i>=t.length?o(l,!0):(o(l,!1),dt(a))};return dt(a),()=>{r=!0}}function dt(e){"function"==typeof requestIdleCallback?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function ct(e,t){const n=t-e;if(n<=0)return[e];const o=function(e){const t=e/8,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return(o<1.5?1:o<3?2:o<7?5:10)*n}(n),r=[];for(let n=Math.ceil(e/o)*o;n<=t+.001*o;n+=o)r.push(Math.round(1e10*n)/1e10);return r}function ut(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}const ft=40,pt=1e6;function ht(e,t,n){let o=0,r=0;for(let i=0;i<n;i++){const n=o*o,l=r*r;if(n+l>4)return i;r=2*o*r+t,o=n-l+e}return n}function gt(e,t,n){if(e===t)return[0,0,0];const o=e/t;if("fire"===n)return[Math.floor(255*Math.min(1,3*o)),Math.floor(255*Math.max(0,3*o-1)),Math.floor(255*Math.max(0,3*o-2))];if("ocean"===n)return[Math.floor(255*o*.3),Math.floor(255*o*.6),Math.floor(255*(.4+.6*o))];const r=360*o%360,i=1*(1-Math.abs(0)),l=i*(1-Math.abs(r/60%2-1)),a=.5-i/2;let s=0,d=0,c=0;return r<60?(s=i,d=l):r<120?(s=l,d=i):r<180?(d=i,c=l):r<240?(d=l,c=i):r<300?(s=l,c=i):(s=i,c=l),[Math.floor(255*(s+a)),Math.floor(255*(d+a)),Math.floor(255*(c+a))]}function xt(e,t,n){if(e===t)return[e];const o=(t-e)/(n-1),r=[];for(let t=0;t<n;t++){const n=e+o*t;r.push(Math.round(1e10*n)/1e10)}return r}function mt(e,t,n,o){return d(()=>function(e,t,n,o){if(0===e.length)return{xScale:()=>o,yScale:()=>n-o,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let r=1/0,i=-1/0,l=1/0,a=-1/0;for(const t of e)t.x<r&&(r=t.x),t.x>i&&(i=t.x),t.y<l&&(l=t.y),t.y>a&&(a=t.y);r===i&&(r-=1,i+=1),l===a&&(l-=1,a+=1);const s=t-2*o,d=n-2*o;return{xScale:e=>o+(e-r)/(i-r)*s,yScale:e=>n-o-(e-l)/(a-l)*d,xTicks:xt(r,i,6),yTicks:xt(l,a,6),xMin:r,xMax:i,yMin:l,yMax:a}}(e,t,n,o),[e,t,n,o])}function yt(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function bt(e,t,n,r,i,l,a){const s={fill:i,key:l,...a};switch(e){case"square":return o("rect",{...s,x:t-r,y:n-r,width:2*r,height:2*r});case"diamond":{const e=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...s,points:e})}case"triangle":{const e=`${t},${n-1.15*r} ${t+r},${n+.6*r} ${t-r},${n+.6*r}`;return o("polygon",{...s,points:e})}case"triangle-down":{const e=`${t-r},${n-.6*r} ${t+r},${n-.6*r} ${t},${n+1.15*r}`;return o("polygon",{...s,points:e})}case"cross":{const e=.35*r;return o("path",{...s,fill:"none",stroke:i,"stroke-width":String(2*e),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{const e=.35*r;return o("path",{...s,fill:"none",stroke:i,"stroke-width":String(2*e),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}default:return o("circle",{...s,cx:t,cy:n,r:r})}}function vt(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}function wt(e,t,n,o,r,i){const l=r-Math.PI/2,a=i-Math.PI/2,s=vt(e,t,o,l),d=vt(e,t,o,a),c=i-r>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,"Z"].join(" ");const u=vt(e,t,n,a),f=vt(e,t,n,l);return[`M ${s.x} ${s.y}`,`A ${o} ${o} 0 ${c} 1 ${d.x} ${d.y}`,`L ${u.x} ${u.y}`,`A ${n} ${n} 0 ${c} 0 ${f.x} ${f.y}`,"Z"].join(" ")}function kt(e,t){const n=t?.padAngle??0,o=function(e,t){const n=t??function(e){const t=[];for(let n=0;n<e;n++){const o=Math.round(360*n/e);t.push(`hsl(${o}, 70%, 55%)`)}return t}(e.length);return e.map((e,t)=>e.color??n[t%n.length])}(e,t?.colors),r=e.reduce((e,t)=>e+t.value,0);if(r<=0)return[];const i=n*e.length,l=2*Math.PI-i,a=[];let s=0;for(let t=0;t<e.length;t++){const i=e[t],d=s+n/2,c=d+i.value/r*l;a.push({label:i.label,value:i.value,startAngle:d,endAngle:c,percentage:i.value/r*100,color:o[t]}),s=c+n/2}return a}function St(e,t,n,o,r){return{x:n+e*Math.cos(t)*r,y:o-e*Math.sin(t)*r}}function $t(e){const t=1<<e,n=[];for(let o=0;o<t;o++){const t=[];for(let n=0;n<e;n++)t.push(2*(o>>n&1)-1);n.push({coords:t})}return n}function Mt(e){const t=1<<e,n=[];for(let o=0;o<t;o++)for(let t=0;t<e;t++){const e=o^1<<t;e>o&&n.push({source:o,target:e})}return n}function zt(e,t){let n=Ct(e),o=0;for(let r=0;r<e;r++)for(let i=r+1;i<e;i++)o<t.length&&(n=At(n,It(e,r,i,t[o]))),o++;return n}function Ct(e){const t=[];for(let n=0;n<e;n++){const o=new Array(e).fill(0);o[n]=1,t.push(o)}return t}function It(e,t,n,o){const r=Ct(e),i=Math.cos(o),l=Math.sin(o);return r[t][t]=i,r[t][n]=-l,r[n][t]=l,r[n][n]=i,r}function At(e,t){const n=e.length,o=[];for(let r=0;r<n;r++){const i=new Array(n).fill(0);for(let o=0;o<n;o++)for(let l=0;l<n;l++)i[o]+=e[r][l]*t[l][o];o.push(i)}return o}function Ft(e,t){const n=e.length,o=new Array(n).fill(0);for(let r=0;r<n;r++)for(let i=0;i<n;i++)o[r]+=e[r][i]*t.coords[i];return o}function Dt(e,t=0){const n=e[0]??0,o=e[1]??0;let r=0;for(let t=2;t<e.length;t++)r+=e[t]??0;if(e.length>2&&(r/=e.length-2),t>0){const e=1/(1+t*(r+2));return{x:n*e,y:o*e,depth:r}}return{x:n,y:o,depth:r}}function Rt(e,t=[],n=.3,o=1){const r=$t(e),i=Mt(e),l=zt(e,t);return{vertices:r.map((e,t)=>{const r=Dt(Ft(l,e),n);return{id:t,position:e,x:r.x*o,y:r.y*o,depth:r.depth}}),edges:i,dimension:e}}function Lt(e){return e*(e-1)/2}function Wt(e,t=70,n=55){const o=[];for(let r=0;r<e;r++){const i=Math.round(360*r/e);o.push(`hsl(${i}, ${t}%, ${n}%)`)}return o}const Nt=r({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null}),Tt={width:600,height:400},Et={x:30,y:30},Pt={top:0,left:0,width:1920,height:1080},Bt=1e3;function _t(e,t,n,o){let r=n.left+e*t.x,i=n.top+e*t.y;const l=n.left+n.width-o.width,a=n.top+n.height-o.height;return l>n.left&&r>l&&(r=n.left+(r-n.left)%Math.max(1,l-n.left)),a>n.top&&i>a&&(i=n.top+(i-n.top)%Math.max(1,a-n.top)),{x:r,y:i}}function Ht(e){const t=[...e].sort((e,t)=>e.zIndex-t.zIndex),n=[];for(let e=0;e<t.length;e++)n.push({...t[e],zIndex:e+1});return n}function Yt(e,t){let n=null;for(let o=0;o<e.length;o++){const r=e[o];r.id!==t&&"minimized"!==r.windowState&&(null===n||r.zIndex>n.zIndex)&&(n=r)}return n}function jt(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function qt(e){const t=e.workspaceBounds??Pt,n=e.defaultWindowSize??Tt,r=e.cascadeOffset??Et,[i,a]=l([]),c=s((...o)=>{const i=o[0];a(o=>{if(o.find(e=>e.id===i.id)){const e=jt(o)+1;let t=o.map(t=>t.id===i.id?{...t,focused:!0,zIndex:e,windowState:"minimized"===t.windowState?"normal":t.windowState}:{...t,focused:!1});return e>Bt&&(t=Ht(t)),t}const l=i.size??n,a=i.position??_t(o.length,r,t,l),s=jt(o)+1,d={id:i.id,title:i.title,icon:i.icon,position:a,size:l,windowState:"normal",zIndex:s,focused:!0,appProps:i.appProps};let c=o.map(e=>({...e,focused:!1}));return c.push(d),s>Bt&&(c=Ht(c)),e.onWindowOpen&&e.onWindowOpen(i.id),e.onFocusChange&&e.onFocusChange(i.id),c})},[n,r,t,e.onWindowOpen,e.onFocusChange]),u=s((...t)=>{const n=t[0];a(t=>{const o=t.find(e=>e.id===n);if(!o)return t;const r=t.filter(e=>e.id!==n);if(o.focused&&r.length>0){const t=Yt(r,n);if(t){const o=r.map(e=>({...e,focused:e.id===t.id}));return e.onWindowClose&&e.onWindowClose(n),e.onFocusChange&&e.onFocusChange(t.id),o}}return e.onWindowClose&&e.onWindowClose(n),0===r.length&&e.onFocusChange&&e.onFocusChange(null),r})},[e.onWindowClose,e.onFocusChange]),f=s((...t)=>{const n=t[0];a(t=>{if(!t.find(e=>e.id===n))return t;const o=jt(t)+1;let r=t.map(e=>e.id===n?{...e,focused:!0,zIndex:o}:{...e,focused:!1});return o>Bt&&(r=Ht(r)),e.onFocusChange&&e.onFocusChange(n),r})},[e.onFocusChange]),p=s((...t)=>{const n=t[0];a(t=>{const o=t.find(e=>e.id===n);if(!o)return t;let r=t.map(e=>e.id===n?{...e,windowState:"minimized",focused:!1}:e);if(o.focused){const t=Yt(r,n);t?(r=r.map(e=>({...e,focused:e.id===t.id})),e.onFocusChange&&e.onFocusChange(t.id)):e.onFocusChange&&e.onFocusChange(null)}return r})},[e.onFocusChange]),h=s((...e)=>{const t=e[0];a(e=>e.map(e=>e.id===t?{...e,windowState:"maximized"}:e))},[]),g=s((...e)=>{const t=e[0];a(e=>e.map(e=>e.id===t?{...e,windowState:"normal"}:e))},[]),x=s((...e)=>{const t=e[0],n=e[1];a(e=>e.map(e=>e.id===t?{...e,position:n}:e))},[]),m=s((...e)=>{const t=e[0],n=e[1];a(e=>e.map(e=>e.id===t?{...e,size:n}:e))},[]),y=s((...e)=>{a(e=>{const n=e.filter(e=>"minimized"!==e.windowState);if(0===n.length)return e;const o=n.length,r=new Map;if(1===o)r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(2===o){const e=Math.floor(t.width/2);r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:e,height:t.height}}),r.set(n[1].id,{position:{x:t.left+e,y:t.top},size:{width:t.width-e,height:t.height}})}else if(3===o){const e=Math.floor(t.width/2),o=Math.floor(t.height/2);r.set(n[0].id,{position:{x:t.left,y:t.top},size:{width:e,height:t.height}}),r.set(n[1].id,{position:{x:t.left+e,y:t.top},size:{width:t.width-e,height:o}}),r.set(n[2].id,{position:{x:t.left+e,y:t.top+o},size:{width:t.width-e,height:t.height-o}})}else{const e=Math.ceil(Math.sqrt(o)),i=Math.ceil(o/e),l=Math.floor(t.width/e),a=Math.floor(t.height/i);for(let o=0;o<n.length;o++){const i=Math.floor(o/e),s=o%e;r.set(n[o].id,{position:{x:t.left+s*l,y:t.top+i*a},size:{width:l,height:a}})}}return e.map(e=>{const t=r.get(e.id);return t?{...e,position:t.position,size:t.size,windowState:"normal"}:e})})},[t]),b=s((...e)=>{a(e=>{const n=e.filter(e=>"minimized"!==e.windowState);if(0===n.length)return e;const o=[...n].sort((e,t)=>e.zIndex-t.zIndex),i=new Map;for(let e=0;e<o.length;e++){const n=_t(e,r,t,o[e].size);i.set(o[e].id,{position:n,zIndex:e+1})}return e.map(e=>{const t=i.get(e.id);return t?{...e,position:t.position,zIndex:t.zIndex,windowState:"normal"}:e})})},[r,t]),v=s((...t)=>{a(t=>{const n=t.map(e=>({...e,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),n})},[e.onFocusChange]),w=d(()=>{const e=i.find(e=>e.focused);return e?e.id:null},[i]),k=d(()=>({windows:i,openWindow:c,closeWindow:u,focusWindow:f,minimizeWindow:p,maximizeWindow:h,restoreWindow:g,moveWindow:x,resizeWindow:m,tileWindows:y,cascadeWindows:b,minimizeAll:v,focusedWindowId:w}),[i,c,u,f,p,h,g,x,m,y,b,v,w]);return o(Nt.Provider,{value:k},e.children)}const Ot=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ut=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Gt(e){return e<10?"0"+String(e):String(e)}function Xt(e){const{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:l}=$e();return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:s(()=>{n()},[n]),onKeyDown:s(e=>{const t=e;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),n())},[n]),onMouseEnter:i,onMouseLeave:l,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function Vt(e){const{format:t,showSeconds:n,showDate:r}=e,[i,s]=l(new Date);a(()=>{const e=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(e)}},[]);const c=d(()=>function(e,t,n){let o=e.getHours();const r=Gt(e.getMinutes()),i=Gt(e.getSeconds());if("12h"===t){const e=o>=12?"PM":"AM";return o%=12,0===o&&(o=12),`${n?`${String(o)}:${r}:${i}`:`${String(o)}:${r}`} ${e}`}const l=Gt(o);return n?`${l}:${r}:${i}`:`${l}:${r}`}(i,t,n),[i,t,n]),u=d(()=>function(e){const t=Ot[e.getDay()],n=Ut[e.getMonth()],o=e.getDate();return`${t}, ${n} ${String(o)}`}(i),[i]),f=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},u):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},f,o("span",{style:{fontSize:"13px",fontWeight:"500"}},c))}function Kt(e){const{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=$e(),l=s(()=>{t.onClick&&t.onClick()},[t]),a=s(e=>{const n=e;"Enter"!==n.key&&" "!==n.key||(n.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:l,onKeyDown:a,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function Zt(e){const{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:l}=$e();return t.divider?o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}}):o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:s(()=>{t.onClick(),n()},[t,n]),onKeyDown:s(e=>{const o=e;"Enter"!==o.key&&" "!==o.key||(o.preventDefault(),t.onClick(),n())},[t,n]),onMouseEnter:i,onMouseLeave:l,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function Jt(e){const{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:d}=$e(),[u,f]=l(!1),p=c(null),h=s(()=>{f(e=>!e)},[]),g=s(()=>{f(!1)},[]),x=s(e=>{const t=e;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),f(e=>!e)),"Escape"===t.key&&f(!1)},[]);a(()=>{if(!u)return;const e=e=>{const t=p.current;t&&!t.contains(e.target)&&f(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[u]);const m=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),y=o("span",{style:{width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},"aria-hidden":"true"},m),b=u&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((e,t)=>o(Zt,{key:String(t),item:e,onClose:g}))):null;return o("div",{ref:p,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(u),tabIndex:0,onClick:h,onKeyDown:x,onMouseEnter:i,onMouseLeave:d,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||u?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},y,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"▾")),b)}function Qt(e){const{activeAppName:t,activitiesButton:n,clockFormat:r="24h",showSeconds:i=!0,showDate:l=!0,indicators:a,user:s,userMenuItems:d,height:c=28,children:u}=e,f=String(c)+"px",p=[];n&&p.push(o(Xt,{key:"activities",label:n.label,onClick:n.onClick})),t&&p.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t));const h=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...p),g=[];g.push(o(Vt,{key:"clock",format:r,showSeconds:i,showDate:l})),u&&g.push(u);const x=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...g),m=[];if(a&&a.length>0){const e=a.map(e=>o(Kt,{key:e.id,indicator:e}));m.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...e))}s&&m.push(o(Jt,{key:"user",user:s,menuItems:d}));const y=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...m);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:f,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},h,x,y)}const en=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function tn(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return en[Math.abs(t)%en.length]}function nn(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function on(e){switch(e){case"left":default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"}}}function rn(e,t){return"vertical"===t?"right"===e?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:"bottom"===e?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function ln(e){const{item:t,iconSize:n,position:r,orientation:i,onItemClick:a,onItemContextMenu:d}=e,[c,u]=l(!1),f=t.disabled??!1,p=s(()=>{f||u(!0)},[f]),h=s(()=>{u(!1)},[]),g=s(()=>{!f&&a&&a(t.id)},[f,a,t.id]),x=s(e=>{if(!f&&d){const n=e;n.preventDefault(),d(t.id,{x:n.clientX,y:n.clientY})}},[f,d,t.id]),m=`${n}px`,y=(b=t.icon).startsWith("http")||b.startsWith("/")||b.startsWith(".")?o("img",{src:t.icon,alt:t.label,style:{width:m,height:m,objectFit:"contain",display:"block"}}):o("span",{style:{width:m,height:m,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(.6*n)}px`,fontWeight:"700",userSelect:"none",backgroundColor:tn(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon);var b;const v=null!=t.badge&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},(w=t.badge)>99?"99+":String(w)):null;var w;const k=t.active?o("span",{style:{...rn(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,S=c?o("div",{role:"tooltip",style:{position:"absolute",...on(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null;return o("button",{type:"button",role:"button",style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:f?"default":"pointer",opacity:f?"0.4":"1",pointerEvents:f?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...c&&!f?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{}},"aria-label":nn(t),"aria-pressed":t.active?"true":"false","aria-disabled":f?"true":void 0,tabIndex:f?-1:0,onClick:g,onContextMenu:x,onMouseEnter:p,onMouseLeave:h,"data-dock-item-id":t.id},y,v,k,S)}function an(e){const{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:a=!1,showTrailingSeparator:d=!1,onItemClick:u,onItemContextMenu:f,children:p}=e,[h,g]=l(!a),x=c(null),m=s(()=>{a&&(null!=x.current&&(clearTimeout(x.current),x.current=null),g(!0))},[a]),y=s(()=>{a&&(x.current=setTimeout(()=>{g(!1)},300))},[a]),b=s(e=>{const t=e,o=t.target,r=o.closest('[role="toolbar"]');if(!r)return;const i=Array.from(r.querySelectorAll("button[data-dock-item-id]")),l=i.indexOf(o);if(l<0)return;const a="vertical"===n,s=a?"ArrowDown":"ArrowRight",d=a?"ArrowUp":"ArrowLeft";if(t.key===s){t.preventDefault();const e=i[l+1];e&&e.focus()}else if(t.key===d){t.preventDefault();const e=i[l-1];e&&e.focus()}else"Home"===t.key?(t.preventDefault(),i[0]?.focus()):"End"===t.key?(t.preventDefault(),i[i.length-1]?.focus()):"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),o.click())},[n]),v="vertical"===n,w={display:"flex",flexDirection:v?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};a&&!h&&("left"===r?(w.transform="translateX(-100%)",w.opacity="0"):"right"===r?(w.transform="translateX(100%)",w.opacity="0"):"top"===r?(w.transform="translateY(-100%)",w.opacity="0"):"bottom"===r&&(w.transform="translateY(100%)",w.opacity="0"));const k=[];for(let e=0;e<t.length;e++){if(d&&e===t.length-1&&t.length>1){const t=v?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};k.push(o("div",{key:`sep-${e}`,style:t,"aria-hidden":"true",role:"separator"}))}k.push(o(ln,{key:t[e].id,item:t[e],iconSize:i,position:r,orientation:n,onItemClick:u,onItemContextMenu:f}))}const S=a&&!h?o("div",{style:{position:"absolute",..."left"===r?{left:"0",top:"0",width:"4px",height:"100%"}:{},..."right"===r?{right:"0",top:"0",width:"4px",height:"100%"}:{},..."top"===r?{top:"0",left:"0",height:"4px",width:"100%"}:{},..."bottom"===r?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:w,onMouseEnter:m,onMouseLeave:y,onKeyDown:b},S,...k,null!=p?p:null)}const sn="#2c001e";function dn(e){const{backgroundColor:t=sn,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:l,onClick:a,onDoubleClick:c,overflow:u="visible",children:f}=e,p=s(e=>{const t=e;t.target===t.currentTarget&&a&&a()},[a]),h=s(e=>{const t=e;t.target===t.currentTarget&&c&&c()},[c]),g=d(()=>{const e={position:"relative",width:"100%",height:"100%",overflow:u,cursor:"default",margin:"0",padding:"0"};return e.backgroundColor=t,n&&(e.background=n),r&&i>=1&&(e.backgroundImage=`url(${r})`,e.backgroundSize="cover",e.backgroundPosition="center"),e},[t,n,r,i]),x=d(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),m=[];x&&m.push(o("div",{className:"desktop-background__image-overlay",style:x,"aria-hidden":"true"})),m.push(o("div",{className:"desktop-background__content",style:{position:"relative",width:"100%",height:"100%",zIndex:"1"}},f));const y=o("div",{className:"desktop-background",style:g,onClick:p,onDblClick:h,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...m);return l&&l.length>0?o(Oe,{items:l},y):y}const cn={width:200,height:150},un={x:50,y:50},fn={width:400,height:300},pn={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function hn(e){const{id:t,title:n,icon:r,defaultPosition:i=un,defaultSize:u=fn,minSize:f=cn,maxSize:p,resizable:h=!0,draggable:g=!0,windowState:x="normal",focused:m=!0,zIndex:y,onClose:b,onMinimize:v,onMaximize:w,onFocus:k,onMove:S,onResize:$,children:M}=e,[z,C]=l(i.x),[I,A]=l(i.y),[F,D]=l(u.width),[R,L]=l(u.height),[W,N]=l(!1),[T,E]=l(!1),[P,B]=l(null),_=c(null),H=c(null),Y=c(null),j=s((e,t)=>{let n=Math.max(e,f.width),o=Math.max(t,f.height);return p&&(n=Math.min(n,p.width),o=Math.min(o,p.height)),{width:n,height:o}},[f,p]),q=s(()=>{const e=Y.current;return e&&e.parentElement?{width:e.parentElement.clientWidth,height:e.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]);s((e,t,n,o)=>{const r=q();return{x:Math.max(0,Math.min(e,r.width-n)),y:Math.max(0,Math.min(t,r.height-o))}},[q]);const O=s(e=>{if(!g||"maximized"===x)return;const t=e;t.target.closest("button")||(t.preventDefault(),_.current={startMouseX:t.clientX,startMouseY:t.clientY,startPosX:z,startPosY:I},N(!0))},[g,x,z,I]),U=s(e=>{e.target.closest("button")||w&&w()},[w]);a(()=>{if(!W)return;const e=e=>{const t=e,n=_.current;if(!n)return;const o=t.clientX-n.startMouseX,r=t.clientY-n.startMouseY;let i=n.startPosX+o,l=n.startPosY+r;const a=q();i=Math.max(0,Math.min(i,a.width-F)),l=Math.max(0,Math.min(l,a.height-R)),C(i),A(l),t.clientX<=20?B("left"):t.clientX>=a.width-20?B("right"):t.clientY<=20?B("top"):B(null)},t=e=>{const t=e;N(!1);const n=q();if("left"===P)return C(0),A(0),D(Math.floor(n.width/2)),L(n.height),B(null),S&&S({x:0,y:0}),void($&&$({width:Math.floor(n.width/2),height:n.height}));if("right"===P){const e=Math.floor(n.width/2);return C(e),A(0),D(e),L(n.height),B(null),S&&S({x:e,y:0}),void($&&$({width:e,height:n.height}))}if("top"===P)return B(null),void(w&&w());B(null);const o=_.current;if(o&&S){const e=t.clientX-o.startMouseX,r=t.clientY-o.startMouseY;let i=o.startPosX+e,l=o.startPosY+r;i=Math.max(0,Math.min(i,n.width-F)),l=Math.max(0,Math.min(l,n.height-R)),S({x:i,y:l})}_.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[W,P,F,R,q,S,$,w]);const G=s(e=>t=>{if(!h||"normal"!==x)return;const n=t;n.preventDefault(),n.stopPropagation(),H.current={direction:e,startMouseX:n.clientX,startMouseY:n.clientY,startPosX:z,startPosY:I,startWidth:F,startHeight:R},E(!0)},[h,x,z,I,F,R]);a(()=>{if(!T)return;const e=e=>{const t=e,n=H.current;if(!n)return;const o=t.clientX-n.startMouseX,r=t.clientY-n.startMouseY,i=n.direction;let l=n.startWidth,a=n.startHeight,s=n.startPosX,d=n.startPosY;i.includes("e")&&(l=n.startWidth+o),i.includes("w")&&(l=n.startWidth-o,s=n.startPosX+o),i.includes("s")&&(a=n.startHeight+r),i.includes("n")&&(a=n.startHeight-r,d=n.startPosY+r);const c=j(l,a);i.includes("w")&&(s=n.startPosX+(n.startWidth-c.width)),i.includes("n")&&(d=n.startPosY+(n.startHeight-c.height)),D(c.width),L(c.height),C(s),A(d)},t=()=>{E(!1),$&&$({width:F,height:R}),H.current=null};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[T,F,R,j,$]),a(()=>{if(!m||!b)return;const e=e=>{"Escape"===e.key&&b()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[m,b]);const X=s(e=>{k&&k()},[k]);if("minimized"===x)return null;const V="maximized"===x,K=d(()=>{const e={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:V?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:m?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:V?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return V?(e.top="0",e.left="0",e.width="100%",e.height="100%"):(e.top=`${I}px`,e.left=`${z}px`,e.width=`${F}px`,e.height=`${R}px`),void 0!==y&&(e.zIndex=String(y)),W&&(e.cursor="grabbing",e.userSelect="none"),e},[V,z,I,F,R,y,m,W]),Z=d(()=>{const e={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:g&&!V?"grab":"default",opacity:m?"1":"0.6"};return W&&(e.cursor="grabbing"),e},[m,g,V,W]),J={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));const ee=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...J,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:e=>{e.stopPropagation(),v&&v()}}),o("button",{type:"button","aria-label":V?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...J,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:e=>{e.stopPropagation(),w&&w()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...J,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:e=>{e.stopPropagation(),b&&b()}}));Q.push(ee);const te=[];if(h&&!V){const e=["n","s","e","w","ne","nw","se","sw"];for(let t=0;t<e.length;t++){const n=e[t],r={position:"absolute",zIndex:"1"};"n"===n?(r.top="0",r.left="8px",r.right="8px",r.height="8px"):"s"===n?(r.bottom="0",r.left="8px",r.right="8px",r.height="8px"):"e"===n?(r.top="8px",r.right="0",r.bottom="8px",r.width="8px"):"w"===n?(r.top="8px",r.left="0",r.bottom="8px",r.width="8px"):"ne"===n?(r.top="0",r.right="0",r.width="8px",r.height="8px"):"nw"===n?(r.top="0",r.left="0",r.width="8px",r.height="8px"):"se"===n?(r.bottom="0",r.right="0",r.width="8px",r.height="8px"):"sw"===n&&(r.bottom="0",r.left="0",r.width="8px",r.height="8px"),r.cursor=pn[n],te.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${n}`,style:r,onMouseDown:G(n)}))}}let ne=null;if(P){const e={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};"left"===P?(e.top="0",e.left="0",e.width="50%",e.height="100%"):"right"===P?(e.top="0",e.right="0",e.width="50%",e.height="100%"):"top"===P&&(e.top="0",e.left="0",e.width="100%",e.height="100%"),ne=o("div",{className:"draggable-window__snap-preview",style:e})}const oe=[];for(let e=0;e<te.length;e++)oe.push(te[e]);oe.push(o("div",{className:"draggable-window__title-bar",style:Z,onMouseDown:O,onDblClick:U,role:"toolbar","aria-label":`${n} window controls`},...Q)),oe.push(o("div",{className:"draggable-window__body",style:{flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"}},M));const re=[o("div",{ref:Y,id:`draggable-window-${t}`,className:`draggable-window ${m?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${x}`,style:K,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:X},...oe)];return ne&&re.push(ne),1===re.length?re[0]:o("div",{style:{display:"contents"}},...re)}const gn=["File","Edit","View","Insert","Format","Tools","Help"],xn={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},mn=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],yn=[{label:"Align left",text:"≡",command:"justifyLeft"},{label:"Align center",text:"≣",command:"justifyCenter"},{label:"Align right",text:"≢",command:"justifyRight"}],bn=["1","2","3","4","5","6","7"],vn={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function wn(e){return e.trim().split(/\s+/).filter(e=>e.length>0).length}function kn(e){const[t,n]=l(!1),[r,i]=l(!1),[a,u]=l(!1),[f,p]=l(-1),[h,g]=l(""),[x,m]=l(-1),[y,b]=l(0),[v,w]=l("3"),k=c(null),S={bold:s(()=>{document.execCommand("bold",!1),n(e=>!e),k.current&&k.current.focus()},[]),italic:s(()=>{document.execCommand("italic",!1),i(e=>!e),k.current&&k.current.focus()},[]),underline:s(()=>{document.execCommand("underline",!1),u(e=>!e),k.current&&k.current.focus()},[])},$={bold:t,italic:r,underline:a},M=s(e=>{document.execCommand(e,!1),k.current&&k.current.focus()},[]),z=s(e=>{document.execCommand("fontSize",!1,e),w(e),k.current&&k.current.focus()},[]),C=s(e=>{m(t=>t===e?-1:e)},[]),I=s(e=>{switch(e){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":"undefined"!=typeof window&&window.print&&window.print();break;case"new":k.current&&(k.current.innerHTML="",b(0))}m(-1),k.current&&k.current.focus()},[]),A=s(()=>{if(k.current){const e=k.current.textContent??"";b(wn(e))}},[]),F=s(()=>{m(-1)},[]),D=d(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),R=d(()=>function(){const e=[];for(let t=0;t<=20;t++){const n=t%2==0;e.push(o("div",{key:String(t),style:{position:"absolute",left:t/20*100+"%",bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:t/20*100+"%",top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}(),[]),L=e.content??"Start typing...",W=wn(L),N=y>0?y:W,T={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},E={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function P(e,t){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:$[e]?"rgba(0,0,0,0.12)":h===e?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...t??{}}}const B=gn.map((e,t)=>{const n=[e];return x===t&&xn[e]&&n.push(o("div",{key:"dropdown",style:T,className:"word-processor__menu-dropdown"},...xn[e].map((e,t)=>o("button",{key:String(t),style:E,onClick:t=>{t.stopPropagation(),I(e.action)},role:"menuitem"},e.label)))),o("button",{key:String(t),style:(r=t,{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:x===r?"rgba(0,0,0,0.12)":f===r?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}),role:"menuitem","aria-label":e,onClick:()=>C(t),onMouseEnter:()=>{p(t)},onMouseLeave:()=>p(-1)},...n);var r});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:D},o("div",{className:"word-processor__menu-bar",style:{display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},role:"menubar"},...B),o("div",{className:"word-processor__toolbar",style:{display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:{display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"▼")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...mn.map(e=>o("button",{key:e.id,style:P(e.id,e.style),title:e.shortcut?`${e.label} (${e.shortcut})`:e.label,"aria-label":e.label,"aria-pressed":String($[e.id]??!1),onClick:S[e.id],onMouseEnter:()=>g(e.id),onMouseLeave:()=>g("")},e.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:{padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},"aria-label":"Font size",value:v,onChange:e=>{const t=e.target;z(t.value)}},...bn.map(e=>o("option",{key:e,value:e},vn[e])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...yn.map((e,t)=>o("button",{key:String(t),style:P(`align-${t}`),title:e.label,"aria-label":e.label,onClick:()=>M(e.command),onMouseEnter:()=>g(`align-${t}`),onMouseLeave:()=>g("")},e.text)))),o("div",{className:"word-processor__ruler",style:{height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},"aria-hidden":"true"},...R),o("main",{className:"word-processor__document-area",style:{flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},onClick:F},o("div",{className:"word-processor__page",style:{width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},contentEditable:"true",ref:k,onInput:A,suppressContentEditableWarning:!0},L)),o("div",{className:"word-processor__status-bar",style:{height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"}},o("span",null,"Page 1 of 1"),o("span",null,`${N} words`),o("span",null,"100%")))}const Sn=["File","Edit","Selection","View","Go","Run","Terminal","Help"],$n={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},Mn=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],zn={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},Cn=zn["App.ts"],In=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),An=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Fn="#569cd6",Dn="#d4d4d4";function Rn(e){const[t,n]=l("App.ts"),[r,i]=l({src:!0,components:!0,hooks:!0}),[a,u]=l(-1),[f,p]=l(Cn.length),h=c(null),g=s(e=>{n(e);const t=zn[e];t&&p(t.length)},[]),x=s(e=>{i(t=>{const n={},o=Object.keys(t);for(let e=0;e<o.length;e++)n[o[e]]=t[o[e]];return n[e]=!t[e],n})},[]),m=s(e=>{u(t=>t===e?-1:e)},[]),y=s(e=>{switch(e){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":h.current&&(h.current.textContent="",p(1))}u(-1),h.current&&h.current.focus()},[]),b=s(()=>{if(h.current){const e=(h.current.textContent??"").split("\n");p(Math.max(e.length,1))}},[]),v=d(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),w={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},k={...w,backgroundColor:"rgba(255,255,255,0.1)"},S={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},$={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},M={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},z=zn[t]??Cn,C=z.map((e,t)=>{const n=function(e){if(!e.trim())return[{text:" ",color:Dn}];const t=[];let n=0;for(;n<e.length;){if("/"===e[n]&&"/"===e[n+1]){t.push({text:e.slice(n),color:"#6a9955"});break}if('"'===e[n]||"'"===e[n]||"`"===e[n]){const o=e[n];let r=n+1;for(;r<e.length&&e[r]!==o;)"\\"===e[r]&&r++,r++;r=Math.min(r+1,e.length),t.push({text:e.slice(n,r),color:"#ce9178"}),n=r;continue}if(/[0-9]/.test(e[n])&&(0===n||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let o=n;for(;o<e.length&&/[0-9.]/.test(e[o]);)o++;t.push({text:e.slice(n,o),color:"#b5cea8"}),n=o;continue}if(/[a-zA-Z_$]/.test(e[n])){let o=n;for(;o<e.length&&/[a-zA-Z0-9_$]/.test(e[o]);)o++;const r=e.slice(n,o);let i=o;for(;i<e.length&&" "===e[i];)i++;const l=i<e.length&&"("===e[i];let a=Dn;In.has(r)?a=Fn:An.has(r)?a="#4ec9b0":l?a="#dcdcaa":"true"!==r&&"false"!==r||(a=Fn),t.push({text:r,color:a}),n=o;continue}if(" "===e[n]||"\t"===e[n]){let o=n;for(;o<e.length&&(" "===e[o]||"\t"===e[o]);)o++;t.push({text:e.slice(n,o),color:Dn}),n=o;continue}t.push({text:e[n],color:"#d4d4d4"}),n++}return t}(e),r=[];let i=0;for(const e of n)r.push(o("span",{key:String(i++),style:{color:e.color}},e.text));return o("div",{key:String(t),style:{minHeight:"20px"}},...r)}),I=Math.max(f,z.length),A=[];for(let e=0;e<I;e++)A.push(o("div",{key:String(e)},String(e+1)));const F=e=>{if(!e.parent)return!0;if(!r[e.parent])return!1;const t=Mn.find(t=>t.name===e.parent&&t.isFolder);return!t||F(t)},D=Sn.map((e,t)=>{const n=[e],r=a===t;return r&&$n[e]&&n.push(o("div",{key:"dropdown",style:S,className:"ide__menu-dropdown"},...$n[e].map((e,t)=>o("button",{key:String(t),style:$,onClick:t=>{t.stopPropagation(),y(e.action)},role:"menuitem"},e.label)))),o("button",{key:String(t),style:r?k:w,role:"menuitem","aria-label":e,onClick:()=>m(t)},...n)}),R=Mn.map((e,n)=>{if(!F(e))return null;const i=!e.isFolder&&e.name===t,l=e.isFolder?r[e.name]?"📂 ":"📁 ":"📄 ";return o("div",{key:String(n),style:(a=e.indent,s=e.isFolder,d=i,{padding:"3px 8px",paddingLeft:12+16*a+"px",fontSize:"13px",cursor:"pointer",color:s?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:d?"rgba(255,255,255,0.08)":"transparent"}),onClick:e.isFolder?()=>x(e.name):()=>g(e.name)},l,e.name);var a,s,d}).filter(e=>null!==e);return o("div",{className:`ide ${e.className??""}`.trim(),style:v},o("div",{className:"ide__title-bar",style:{height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"}},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:{height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},role:"menubar"},...D),o("div",{style:{flex:"1",display:"flex",overflow:"hidden"}},o("nav",{className:"ide__sidebar",style:{width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},"aria-label":"File explorer"},o("div",{style:{padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"}},"Explorer"),...R),o("div",{style:{width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"}}),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"}},o("div",{style:{height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"}},o("button",{style:{padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},"aria-label":t},t)),o("div",{style:{flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"}},o("div",{style:{padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},"aria-hidden":"true"},...A),o("code",{style:{padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},contentEditable:"true",ref:h,onInput:b,suppressContentEditableWarning:!0},...C))),o("div",{className:"ide__minimap",style:{width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},"aria-hidden":"true"},o("div",{style:{position:"absolute",top:"8px",left:"0",right:"0",height:"30px",backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...z.map((e,t)=>o("div",{key:String(t),style:{height:"2px",backgroundColor:e.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,2*e.length)}%`}})))),o("div",{className:"ide__status-bar",style:{height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"}},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:M},"⎇ main"),o("span",{style:M},"0 errors"),o("span",{style:M},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:M},"Ln 1, Col 1"),o("span",{style:M},"UTF-8"),o("span",{style:M},"TypeScript"))))}const Ln=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],Wn=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],Nn=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],Tn=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],En=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],Pn=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],Bn=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],_n=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],Hn=["09:30","10:00","10:30","11:00","11:30","12:00"];function Yn(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function jn(e){return e.toFixed(2)}const qn={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},On={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},Un={width:"100%",borderCollapse:"collapse",fontSize:"12px"},Gn={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},Xn={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},Vn={cursor:"default",transition:"background-color 0.1s"};function Kn(e){const[t,n]=l(0),[r,i]=l("--:--:--"),[s,c]=l(!0);a(()=>{const e=setInterval(()=>{n(e=>{const t=.5*(Math.random()-.5);return Math.round(100*t)/100})},2e3);return()=>clearInterval(e)},[]),a(()=>{const e=()=>{const e=new Date,t=String(e.getHours()).padStart(2,"0"),n=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0");i(`${t}:${n}:${o}`)};e();const t=setInterval(e,1e3);return()=>clearInterval(t)},[]),a(()=>{const e=setInterval(()=>{c(e=>!e)},800);return()=>clearInterval(e)},[]);const u=d(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),f=189.42+t,p={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:u},o("header",{className:"trading-dashboard__header",style:{height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"}},o("span",{style:{fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"}},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:p}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:{flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"}},function(e,t){const n=120,r=Math.min(...e),i=Math.max(...e),l=i-r||1,a=310/(e.length-1),s=e.map((e,t)=>({x:40+t*a,y:15+(1-(e-r)/l)*n}));s.map(e=>`${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(" ");const d="M40,135 "+s.map(e=>`L${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(" ")+` L${s[s.length-1].x.toFixed(1)},135 Z`,c=[];for(let t=1;t<e.length;t++){const n=e[t]>=e[t-1]?"#00c853":"#ff1744";c.push(o("line",{key:String(t),x1:String(s[t-1].x.toFixed(1)),y1:String(s[t-1].y.toFixed(1)),x2:String(s[t].x.toFixed(1)),y2:String(s[t].y.toFixed(1)),stroke:n,strokeWidth:"2",strokeLinecap:"round"}))}const u=[];for(let e=0;e<5;e++){const t=15+e/4*n,r=i-e/4*l;u.push(o("line",{key:`g${e}`,x1:String(40),y1:String(t.toFixed(1)),x2:String(350),y2:String(t.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),u.push(o("text",{key:`yl${e}`,x:String(36),y:String((t+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},jn(r)))}const f=[],p=Math.min(Hn.length,e.length),h=(e.length-1)/(p-1);for(let e=0;e<p;e++){const t=40+Math.round(e*h)*a;f.push(o("text",{key:`tl${e}`,x:String(t.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},Hn[e]))}const g="chartGrad";return o("div",{style:qn},o("div",{style:On},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${jn(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:g,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:d,fill:`url(#${g})`}),...u,...f,...c,o("line",{x1:String(40),y1:String((15+(1-(t-r)/l)*n).toFixed(1)),x2:String(350),y2:String((15+(1-(t-r)/l)*n).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}(Pn,f),function(){const e=Math.max(...Wn.map(e=>e.qty),...Nn.map(e=>e.qty));return o("div",{style:qn},o("div",{style:On},"Order Book"),o("table",{style:Un},o("thead",null,o("tr",null,o("th",{style:Gn},"Bid Price"),o("th",{style:Gn},"Qty"),o("th",{style:Gn},"Ask Price"),o("th",{style:Gn},"Qty"))),o("tbody",null,...Wn.map((t,n)=>{const r=Nn[n],i=t.qty/e*.25,l=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:Vn},o("td",{style:{...Xn,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},jn(t.price)),o("td",{style:{...Xn,backgroundColor:`rgba(0,200,83,${(.5*i).toFixed(3)})`,fontFamily:"monospace"}},Yn(t.qty)),o("td",{style:{...Xn,color:"#ff1744",backgroundColor:`rgba(255,23,68,${l.toFixed(3)})`,fontFamily:"monospace"}},r?jn(r.price):""),o("td",{style:{...Xn,backgroundColor:`rgba(255,23,68,${(.5*l).toFixed(3)})`,fontFamily:"monospace"}},r?Yn(r.qty):""))}))))}(),function(e){return o("div",{style:qn},o("div",{style:On},"Watchlist"),o("table",{style:Un},o("thead",null,o("tr",null,o("th",{style:Gn},"Symbol"),o("th",{style:Gn},"Price"),o("th",{style:Gn},"Chg%"),o("th",{style:Gn},"Volume"))),o("tbody",null,...Ln.map((t,n)=>{const r=t.price+(0===n?e:0),i=t.change>=0;return o("tr",{key:String(n),style:Vn},o("td",{style:{...Xn,fontWeight:"600",color:"#ffffff"}},t.symbol,function(e,t){const n=Math.min(...e),r=Math.max(...e)-n||1;return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:e.map((t,o)=>{const i=o/(e.length-1)*40,l=14-(t-n)/r*14;return`${i.toFixed(1)},${l.toFixed(1)}`}).join(" "),fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}(t.spark,i)),o("td",{style:{...Xn,fontFamily:"monospace"}},jn(r)),o("td",{style:{...Xn,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${jn(t.change)}%`),o("td",{style:{...Xn,fontFamily:"monospace",color:"#8888aa"}},(l=t.volume)>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${(l/1e3).toFixed(1)}K`:String(l)));var l}))))}(t),function(){const e=Tn.reduce((e,t)=>e+t.pnl,0),t=e>=0;return o("div",{style:qn},o("div",{style:On},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${jn(e)}`)),o("table",{style:Un},o("thead",null,o("tr",null,o("th",{style:Gn},"Symbol"),o("th",{style:Gn},"Qty"),o("th",{style:Gn},"Avg"),o("th",{style:Gn},"P&L"))),o("tbody",null,...Tn.map((e,t)=>{const n=e.pnl>=0;return o("tr",{key:String(t),style:{...Vn,backgroundColor:n?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...Xn,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...Xn,fontFamily:"monospace"}},String(e.qty)),o("td",{style:{...Xn,fontFamily:"monospace"}},jn(e.avgPrice)),o("td",{style:{...Xn,color:n?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${n?"+":""}$${jn(e.pnl)}`))}))))}(),o("div",{style:qn},o("div",{style:On},"Recent Trades"),o("table",{style:Un},o("thead",null,o("tr",null,o("th",{style:Gn},"Time"),o("th",{style:Gn},"Sym"),o("th",{style:Gn},"Side"),o("th",{style:Gn},"Qty"),o("th",{style:Gn},"Price"))),o("tbody",null,...En.map((e,t)=>{const n="BUY"===e.side;return o("tr",{key:String(t),style:Vn},o("td",{style:{...Xn,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...Xn,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...Xn,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...Xn,fontFamily:"monospace"}},Yn(e.qty)),o("td",{style:{...Xn,fontFamily:"monospace"}},jn(e.price)))})))),function(){const e=Math.max(...Bn.map(e=>e.volume),..._n.map(e=>e.volume)),t="16px";return o("div",{style:qn},o("div",{style:On},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...Bn.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},jn(n.price)),o("div",{style:{height:t,width:n.volume/e*100+"%",backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Yn(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),..._n.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},jn(n.price)),o("div",{style:{height:t,width:n.volume/e*100+"%",backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Yn(n.volume))))))}()))}function Zn(e){const{toasts:t,onDismiss:n}=e;if(0===t.length)return null;const r=t.map(e=>{let t="rgba(50, 50, 50, 0.95)",r="#555";return"warning"===e.severity?(t="rgba(60, 40, 10, 0.95)",r="#f39c12"):"error"===e.severity&&(t="rgba(60, 10, 10, 0.95)",r="#e74c3c"),o("div",{key:String(e.id),className:`unity-desktop__toast unity-desktop__toast--${e.severity}`,style:{backgroundColor:t,border:`1px solid ${r}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(e.id),role:"alert","aria-live":"polite"},e.message)});return o("div",{className:"unity-desktop__toast-container",style:{position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},"aria-label":"Notifications"},...r)}function Jn(e){const{apps:t,user:n,onAppOpen:r,onLogout:i,theme:u="dark",children:f}=e,[p,h]=l([]),[g,x]=l([]),[m,y]=l(!1),[b,v]=l(!1),[w,k]=l(null),[S,$]=l({x:0,y:0}),[M,z]=l(null),C=s(()=>{y(e=>!e)},[]),I=s(e=>{x(t=>t.filter(t=>t.id!==e))},[]);a(()=>{if(0===g.length)return;const e=g[0],t=Date.now()-e.timestamp,n=Math.max(0,5e3-t),o=setTimeout(()=>{x(t=>t.filter(t=>t.id!==e.id))},n);return()=>clearTimeout(o)},[g]);const A=c(t);A.current=t;const F=c(r);F.current=r;const D=s(e=>{h(t=>{if(t.find(t=>t.id===e)){const n=Math.max(...t.map(e=>e.zIndex))+1;return t.map(t=>t.id===e?{...t,focused:!0,zIndex:n,windowState:"minimized"===t.windowState?"normal":t.windowState}:{...t,focused:!1})}const n=A.current.find(t=>t.id===e);if(!n)return t;const o=t.length>0?Math.max(...t.map(e=>e.zIndex))+1:1,r={id:n.id,title:n.label,icon:n.icon,x:60+30*t.length,y:40+30*t.length,width:600,height:400,zIndex:o,focused:!0,windowState:"normal"};return[...t.map(e=>({...e,focused:!1})),r]}),F.current&&F.current(e)},[]),R=t.map(e=>{const t=p.some(t=>t.id===e.id);return{id:e.id,icon:e.icon,label:e.label,active:t}}),L=p.find(e=>e.focused),W=L?L.title:void 0,N=s(()=>{v(!0)},[]),T=s(()=>{v(!1)},[]),E=s((e,t)=>{k(e),$(t)},[]),P=s(()=>{k(null)},[]),B=s(()=>{},[]),_=s(()=>{i&&i()},[i]),H=[];n&&(H.push({label:n.name,icon:void 0,onClick:B,divider:!1}),H.push({label:"",icon:void 0,onClick:B,divider:!0})),H.push({label:"Lock",icon:void 0,onClick:N,divider:!1}),H.push({label:"Logout",icon:void 0,onClick:_,divider:!1});const Y=d(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:"dark"===u?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[u]),j={display:"flex",flexDirection:"column",height:"100%",backgroundColor:"dark"===u?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:"dark"===u?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},q=o(Qt,{activeAppName:W,activitiesButton:{label:"Activities",onClick:C},clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:H.length>0?H:void 0,height:28}),O=o(an,{items:R,orientation:"vertical",position:"left",iconSize:36,onItemClick:D,onItemContextMenu:E}),U=o(Zn,{toasts:g,onDismiss:I}),G=p.filter(e=>"minimized"!==e.windowState).map(e=>o(hn,{key:e.id,id:e.id,title:e.title,icon:e.icon,defaultPosition:{x:e.x,y:e.y},defaultSize:{width:e.width,height:e.height},zIndex:e.zIndex,focused:e.focused,windowState:e.windowState,onClose:()=>{h(t=>t.filter(t=>t.id!==e.id))},onFocus:()=>{h(t=>{const n=Math.max(...t.map(e=>e.zIndex))+1;return t.map(t=>t.id===e.id?{...t,focused:!0,zIndex:n}:{...t,focused:!1})})},onMinimize:()=>{h(t=>t.map(t=>t.id===e.id?{...t,windowState:"minimized"}:t))},onMaximize:()=>{h(t=>t.map(t=>t.id===e.id?{...t,windowState:"maximized"===t.windowState?"normal":"maximized"}:t))}},function(e){const t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(e){case"Files":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["📁 Documents","📁 Downloads","📁 Music","📁 Pictures","📁 Videos","📄 readme.txt"].map(e=>o("span",{style:{cursor:"pointer"}},e))));case"Terminal":return o("div",{style:{...t,backgroundColor:"#1a1a2e",color:"#00ff41",fontFamily:"monospace",fontSize:"12px"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",null,"$ _"));case"Browser":return o("div",{style:t},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed — CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(e=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},e)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(e=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},e)));case"Word Processor":return o(kn,null);case"IDE":return o(Rn,null);case"Trading":return o(Kn,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}(e.title))),X=[];f&&X.push(f),X.push(...G),X.push(U);const V=o(dn,{backgroundColor:"dark"===u?"#2c001e":"#e8e0e4",backgroundGradient:"dark"===u?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:{width:"100%",height:"100%",position:"relative"}},...X)),K=m?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:C},...t.map(e=>o("button",{key:e.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:t=>{t.stopPropagation(),y(!1),D(e.id)}},o("span",{style:{fontSize:"32px",display:"block"}},e.icon),o("span",null,e.label)))):null,Z=b?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:T},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"🔒"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,J=w?o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:P},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${S.y}px`,left:`${S.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:e=>e.stopPropagation()},o("div",{style:{padding:"6px 14px",fontWeight:"600",borderBottom:"1px solid #444",marginBottom:"4px"}},t.find(e=>e.id===w)?.label||w),o("div",{style:{padding:"6px 14px",cursor:"pointer"},onClick:()=>{z(w),k(null)},role:"menuitem"},"About"))):null,Q=M?t.find(e=>e.id===M):null,ee=Q?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>z(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:e=>e.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},Q.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>z(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:Y,"data-theme":u},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},q),o("div",{style:{display:"flex",flex:"1",overflow:"hidden"}},o("div",{className:"unity-desktop__dock",style:j},O),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},V,K)),J,ee,Z)}const Qn={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},eo={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}},to=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],no=Math.PI/180;function oo(e,t){const n=e.replace("#","");let o,r,i;return 3===n.length?(o=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),i=parseInt(n[2]+n[2],16)):(o=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16)),o=isNaN(o)?0:o,r=isNaN(r)?0:r,i=isNaN(i)?0:i,`rgba(${o},${r},${i},${t})`}function ro(e,t){const n=e.replace("#","");let o,r,i;3===n.length?(o=parseInt(n[0]+n[0],16),r=parseInt(n[1]+n[1],16),i=parseInt(n[2]+n[2],16)):(o=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16)),o=isNaN(o)?0:o,r=isNaN(r)?0:r,i=isNaN(i)?0:i;const l=e=>(e=>Math.max(0,Math.min(255,Math.round(e*t))))(e).toString(16).padStart(2,"0");return"#"+l(o)+l(r)+l(i)}const io=Math.PI/180;function lo(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function ao(e,t,n){const o=Math.sqrt(e*e+t*t+n*n);if(o<1e-10)return{theta:0,phi:0};const r=e/o,i=t/o,l=n/o,a=Math.acos(Math.max(-1,Math.min(1,l))),s=Math.atan2(i,r);return{theta:a,phi:s<0?s+2*Math.PI:s}}function so(e,t,n){const{x:o,y:r,z:i}=lo(e),l=Math.cos(n),a=Math.sin(n);let s,d,c;return"x"===t?(s=o,d=r*l-i*a,c=r*a+i*l):"y"===t?(s=o*l+i*a,d=r,c=-o*a+i*l):(s=o*l-r*a,d=o*a+r*l,c=i),ao(s,d,c)}function co(e,t){const n=t.angle??Math.PI;switch(t.gate){case"X":return so(e,"x",Math.PI);case"Y":return so(e,"y",Math.PI);case"Z":return so(e,"z",Math.PI);case"H":{const{x:t,y:n,z:o}=lo(e);return ao(o,-n,t)}case"S":return so(e,"z",Math.PI/2);case"T":return so(e,"z",Math.PI/4);case"Rx":return so(e,"x",n);case"Ry":return so(e,"y",n);case"Rz":return so(e,"z",n)}}function uo(e,t){if(0===e.length)return 0;if(1===e.length)return e[0];const n=t/100*(e.length-1),o=Math.floor(n),r=Math.ceil(n);if(o===r)return e[o];const i=n-o;return e[o]+i*(e[r]-e[o])}function fo(e){const t=function(e){const t=[];for(let n=0;n<e.length;n++){const o=e[n];"number"==typeof o&&isFinite(o)&&!isNaN(o)&&t.push(o)}return t.sort((e,t)=>e-t),t}(e);if(0===t.length)return null;const n=uo(t,25),o=uo(t,50),r=uo(t,75),i=r-n,l=n-1.5*i,a=r+1.5*i;let s=t[0];for(const e of t)if(e>=l){s=e;break}let d=t[t.length-1];for(let e=t.length-1;e>=0;e--)if(t[e]<=a){d=t[e];break}let c=0;for(const e of t)c+=e;const u=c/t.length,f=[];for(const e of t)(e<l||e>a)&&f.push(e);return{q1:n,median:o,q3:r,iqr:i,whiskerLow:s,whiskerHigh:d,mean:u,outliers:f,min:t[0],max:t[t.length-1]}}function po(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}function ho(e,t,n){return e<t?t:e>n?n:e}function go(e){return"number"==typeof e&&isFinite(e)&&!isNaN(e)}const xo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mo=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function yo(e){const t=e.split("-");return 3!==t.length?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function bo(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function vo(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function wo(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=vo(t[r]),a=vo(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}const ko=["#9be9a8","#40c463","#30a14e","#216e39"],So=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function $o(e,t,n,o){const r=o-Math.PI/2;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Mo(e,t,n,o,r,i){const l=$o(e,t,n,r),a=$o(e,t,n,i),s=$o(e,t,o,r),d=$o(e,t,o,i),c=i-r>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${c} 1 ${a.x} ${a.y}`,`L ${d.x} ${d.y}`,`A ${o} ${o} 0 ${c} 0 ${s.x} ${s.y}`,"Z"].join(" ")}function zo(e,t,n,o,r,i,l){const a=$o(e,t,n,o),s=$o(e,t,n,r),d=$o(e,t,n,i),c=$o(e,t,n,l),u=l-i,f=r-o>Math.PI?1:0,p=u>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${f} 1 ${s.x} ${s.y}`,`Q ${e} ${t} ${d.x} ${d.y}`,`A ${n} ${n} 0 ${p} 1 ${c.x} ${c.y}`,`Q ${e} ${t} ${a.x} ${a.y}`,"Z"].join(" ")}const Co=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];const Io=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ao(e){return Io[e%Io.length]}function Fo(e,t,n){const o=t/2,r=n/2,i=.3*Math.min(t,n),l=e.length,a=[];for(let t=0;t<l;t++){const n=e[t],s=2*Math.PI*t/Math.max(l,1);a.push({id:n.id,label:n.label??n.id,color:n.color??Ao(t),x:n.x??o+i*Math.cos(s),y:n.y??r+i*Math.sin(s),vx:0,vy:0,fixed:n.fixed??!1,solid:n.solid??!0})}return a}function Do(e,t){const n=2*t;for(let t=0;t<e.length;t++){const o=e[t];if(o.solid)for(let r=t+1;r<e.length;r++){const t=e[r];if(!t.solid)continue;const i=t.x-o.x,l=t.y-o.y,a=i*i+l*l;if(a>=n*n||a<1e-4)continue;const s=Math.sqrt(a),d=i/s,c=l/s,u=n-s;if(o.fixed&&t.fixed)continue;o.fixed?(t.x+=d*u,t.y+=c*u):t.fixed?(o.x-=d*u,o.y-=c*u):(o.x-=d*u*.5,o.y-=c*u*.5,t.x+=d*u*.5,t.y+=c*u*.5);const f=(o.vx-t.vx)*d+(o.vy-t.vy)*c;f<=0||(o.fixed?(t.vx+=f*d,t.vy+=f*c):t.fixed?(o.vx-=f*d,o.vy-=f*c):(o.vx-=f*d,o.vy-=f*c,t.vx+=f*d,t.vy+=f*c))}}}const Ro=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"],Lo=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Wo(e){if(e<=0)return 1;const t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}function No(e,t){return t||Lo[e%Lo.length]}const To=Math.PI/180;function Eo(e,t,n,o){const r=o*To;return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Po(e,t,n,o,r){const i=Eo(e,t,n,r),l=Eo(e,t,n,o),a=r-o,s=Math.abs(a)>180?1:0,d=a>0?1:0;return`M ${i.x} ${i.y} A ${n} ${n} 0 ${s} ${1===d?0:1} ${l.x} ${l.y}`}function Bo(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}const _o={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1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6 -1.1,-4.5 -.2,-3 -2.2,-3 -2.8,-.7 -5.2,-3.6 -.6,-3.3 -6.3,-3.1 -.2,-1.3 h -3.3 l -2.2,-2.6 -2,-1.3 .7,-5.1 -.9,-1.6 .5,-5.4 1,-1.8 -.3,-2.7 -1.2,-1.3 -1.8,-.3 v -1.7 l 2.8,-5.8 5.9,-3.9 -.4,-13 .9,.4 .6,-.5 .1,-1.1 .9,-.6 1.4,1.2 .7,-.1 h 2.6 l 6.8,-2.6 .3,-1 h 1.2 l .7,-1.2 .4,.8 1.8,-.9 1.8,-1.7 .3,.5 1,-1 2.2,1.6 -.8,1.6 -1.2,1.4 .5,1.5 -1.4,1.6 .4,.9 2.3,-1.1 v -1.4 l 3.3,1.9 1.9,.7 1.9,.7 3,3.8 17,3.8 1.4,1 4,.8 .7,.5 2.8,-.2 4.9,.8 1.4,1.5 -1,1 .8,.8 3.8,.7 1.2,1.2 .1,4.4 -1.3,2.8 2,.1 1,-.8 .9,.8 -1.1,3.1 1,1.6 1.2,.3 z m -49.5,-37.3 -.5,.1 -1.5,1.6 .2,.5 1.5,-.6 v -.6 l .9,-.3 z m 1.6,-1.1 -1,.3 -.2,.7 .9,-.1 z m -1.3,-1.6 -.2,.9 h 1.7 l .6,-.4 .1,-1 z m 2.8,-3 -.3,1.9 1.2,-.5 .1,-1.4 z m 58.3,31.9 -2,.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function Ho(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function Yo(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=Ho(t[r]),a=Ho(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}function jo(e){const{r:t,g:n,b:o}=Ho(e);return(.299*t+.587*n+.114*o)/255}const qo=["#3b82f6","#fbbf24","#ef4444"];function Oo(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function Uo(e){const t=e.replace("#",""),n=3===t.length?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,o=parseInt(n,16);return{r:o>>16&255,g:o>>8&255,b:255&o}}function Go(e,t){if(0===t.length)return"#000000";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=Math.min(Math.floor(n*o),o-1),i=n*o-r,l=Uo(t[r]),a=Uo(t[r+1]);return function(e,t,n){const o=e=>{const t=Math.max(0,Math.min(255,Math.round(e))).toString(16);return 1===t.length?"0"+t:t};return`#${o(e)}${o(t)}${o(n)}`}(l.r+(a.r-l.r)*i,l.g+(a.g-l.g)*i,l.b+(a.b-l.b)*i)}function Xo(e){const{r:t,g:n,b:o}=Uo(e);return(.299*t+.587*n+.114*o)/255}const Vo=["#f0f9ff","#3b82f6","#1e3a8a"],Ko=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Zo(e){if(!e.children||0===e.children.length)return Math.max(0,e.value??0);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value??0)}return t}function Jo(e,t){const n=[];for(const o of t)n.push(String(e[o]??""));return n.join(" | ")}function Qo(e,t){const n=new Set;for(const o of e)n.add(Jo(o,t));const o=Array.from(n);return o.sort(),o}function er(e,t){if(0===e.length)return 0;switch(t){case"count":return e.length;case"sum":{let t=0;for(const n of e)t+=n;return t}case"avg":{let t=0;for(const n of e)t+=n;return t/e.length}case"min":{let t=e[0];for(let n=1;n<e.length;n++)e[n]<t&&(t=e[n]);return t}case"max":{let t=e[0];for(let n=1;n<e.length;n++)e[n]>t&&(t=e[n]);return t}}}function tr(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function nr(e,t){return 2*Math.PI*e/t-Math.PI/2}function or(e,t,n,o){return{x:e+n*Math.cos(o),y:t+n*Math.sin(o)}}const rr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];const ir=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],lr=2*Math.PI;function ar(e){if(!e.children||0===e.children.length)return Math.max(0,e.value??0);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value??0)}return t}function sr(e,t,n,o,r,i){const l=i-r,a=l>Math.PI?1:0,s=r-Math.PI/2,d=i-Math.PI/2,c=e+o*Math.cos(s),u=t+o*Math.sin(s),f=e+o*Math.cos(d),p=t+o*Math.sin(d),h=e+n*Math.cos(d),g=t+n*Math.sin(d),x=e+n*Math.cos(s),m=t+n*Math.sin(s);if(l>=lr-.001){const r=s+Math.PI;return[`M ${c} ${u}`,`A ${o} ${o} 0 1 1 ${e+o*Math.cos(r)} ${t+o*Math.sin(r)}`,`A ${o} ${o} 0 1 1 ${c} ${u}`,`L ${x} ${m}`,`A ${n} ${n} 0 1 0 ${e+n*Math.cos(r)} ${t+n*Math.sin(r)}`,`A ${n} ${n} 0 1 0 ${x} ${m}`,"Z"].join(" ")}return[`M ${c} ${u}`,`A ${o} ${o} 0 ${a} 1 ${f} ${p}`,`L ${h} ${g}`,`A ${n} ${n} 0 ${a} 0 ${x} ${m}`,"Z"].join(" ")}const dr=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function cr(e){if(!e.children||0===e.children.length)return Math.max(0,e.value);let t=0;const n=[e];for(;n.length>0;){const e=n.pop();if(e.children&&0!==e.children.length)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t]);else t+=Math.max(0,e.value)}return t}function ur(e,t){if(0===e.length||t<=0)return 1/0;let n=0;for(const t of e)n+=t;if(n<=0)return 1/0;const o=n/t;let r=0;for(const t of e){if(t<=0)continue;const e=t/o,n=Math.max(e/o,o/e);n>r&&(r=n)}return r}function fr(e){const t=e.replace("#","");let n,o,r;return 3===t.length?(n=parseInt(t[0]+t[0],16),o=parseInt(t[1]+t[1],16),r=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),r=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(o)?0:o,b:isNaN(r)?0:r}}function pr(e,t){if(0===t.length)return"#3b82f6";if(1===t.length)return t[0];const n=Math.max(0,Math.min(1,e)),o=t.length-1,r=n*o,i=Math.floor(r),l=Math.min(i+1,o),a=r-i,s=fr(t[i]),d=fr(t[l]);return function(e,t,n){const o=e=>(e=>Math.max(0,Math.min(255,Math.round(e))))(e).toString(16).padStart(2,"0");return"#"+o(e)+o(t)+o(n)}(s.r+(d.r-s.r)*a,s.g+(d.g-s.g)*a,s.b+(d.b-s.b)*a)}function hr(e,t){if(e<=0)return 1;const n=e/t,o=Math.pow(10,Math.floor(Math.log10(n))),r=n/o;return r<=1.5?o:r<=3.5?2*o:r<=7.5?5*o:10*o}const gr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],xr=[0,-45,45,90];function mr(e,t,n,o,r){const i=.6*t,l=e.length*i,a=t,s=n*Math.PI/180,d=Math.abs(Math.cos(s)),c=Math.abs(Math.sin(s)),u=l*d+a*c,f=l*c+a*d;return{x:o-u/2,y:r-f/2,w:u,h:f}}function yr(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function br(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function vr(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}const wr={0:"#1e293b",1:"#3b82f6"};exports.Accordion=function(e){const{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:a={},wrapperStyle:c,expandIcon:u="+",collapseIcon:f="−",iconPosition:p="right",animated:h=!0,onChange:g}=e,[x,m]=l(()=>n??[]),y=s(e=>{m(t=>{let n;return n=t.includes(e)?t.filter(t=>t!==e):r?[...t,e]:[e],g&&g(n),n})},[r,g]),b=d(()=>t.map(e=>{const t=x.includes(e.id),n=o(Me,{key:`header-${e.id}`,section:e,expanded:t,onToggle:()=>y(e.id),headerStyle:i,expandIcon:u,collapseIcon:f,iconPosition:p}),r=o(ze,{key:`content-${e.id}`,section:e,expanded:t,contentStyle:a,animated:h});return o("div",{key:e.id,"data-accordion-section":e.id,style:{width:"100%"}},n,r)}),[t,x,i,a,u,f,p,h,y]);return o(ke,{role:"region",ariaLabel:"Accordion",styling:c,keyboardNav:!0},...b)},exports.Alert=function(e){const[t,n]=l(!0),r=e.type??"info",i=e.variant??"subtle",a=Z[r]??Z.info,s=e.icon??a.icon,c=e.message??e.children,u=d(()=>{const e={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return"filled"===i?(e.backgroundColor=a.filledBg,e.color=a.filledText):"outline"===i?(e.backgroundColor="transparent",e.border=`1px solid ${a.border}`,e.color=a.text):(e.backgroundColor=a.bg,e.color=a.text),e},[i,a]);return t?o("div",{role:"alert",style:u},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},s),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:c?"4px":"0"}},e.title):null,c?o("div",null,c):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:"filled"===i?"1px solid currentColor":`1px solid ${a.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"×"):null):null},exports.AnalogClock=function(e){const{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:d,className:c}=e,[u,f]=l(h(d));a(()=>{const e=setInterval(()=>{f(h(d))},1e3);return()=>clearInterval(e)},[d]);const p=u.getHours(),y=u.getMinutes(),b=u.getSeconds(),v=p%12*30+.5*y,w=6*y+.1*b,k=6*b,S=n/2,$=n/2,M=n/2-10,z=M-4,C=M-22,I=[];I.push(o("circle",{cx:String(S),cy:String($),r:String(M),fill:"#f8fafc",stroke:g,"stroke-width":"3"}));for(let e=0;e<12;e++){const r=(30*e-90)*Math.PI/180,i=z-6;I.push(o("line",{x1:String(S+i*Math.cos(r)),y1:String($+i*Math.sin(r)),x2:String(S+z*Math.cos(r)),y2:String($+z*Math.sin(r)),stroke:g,"stroke-width":"2"}));const l=String(0===e?12:e);if(I.push(o("text",{x:String(S+C*Math.cos(r)),y:String($+C*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:m,"font-size":String(.08*n),"font-family":"sans-serif","font-weight":"600"},l)),"24h"===t){const t=M-38,i=String(0===e?0:e+12);I.push(o("text",{x:String(S+t*Math.cos(r)),y:String($+t*Math.sin(r)),"text-anchor":"middle","dominant-baseline":"central",fill:m,"font-size":String(.055*n),"font-family":"sans-serif",opacity:"0.6"},i))}}const A=(e,t,n,r)=>{const i=(e-90)*Math.PI/180;return o("line",{x1:String(S),y1:String($),x2:String(S+t*Math.cos(i)),y2:String($+t*Math.sin(i)),stroke:r,"stroke-width":n,"stroke-linecap":"round"})};I.push(A(v,.5*M,"4",x)),I.push(A(w,.75*M,"3",x)),s&&I.push(A(k,.85*M,"1.5","#ef4444")),I.push(o("circle",{cx:String(S),cy:String($),r:"4",fill:x}));const F=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...I)];return r&&F.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:m}},function(e,t){const n=e.getFullYear(),o=e.getMonth(),r=e.getDate();switch(t){case"short":return`${String(o+1).padStart(2,"0")}/${String(r).padStart(2,"0")}/${n}`;case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][o]} ${String(r).padStart(2,"0")}, ${n}`;case"iso":return`${n}-${String(o+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`}}(u,i))),o("div",{className:c,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...F)},exports.Avatar=function(e){const{src:t,alt:n,name:r,size:i,shape:a="circle",fallbackColor:s,status:d,statusPosition:c="bottom-right"}=e,[u,f]=l(!1),p=function(e){return null==e?y.md:"number"==typeof e?e:y[e]??y.md}(i),h="circle"===a?"50%":`${Math.round(.15*p)}px`,g=s??function(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return b[Math.abs(t)%b.length]}(r),x=`${Math.round(.4*p)}px`,m={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${p}px`,height:`${p}px`,borderRadius:h,overflow:"hidden",flexShrink:"0"};let k;if(t&&!u)k=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>f(!0)});else{const e=function(e){if(!e)return"?";const t=e.trim().split(/\s+/);return 1===t.length?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}(r);k=o("span",{style:{fontSize:x,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},e)}const S=o("div",{style:{...m,backgroundColor:t&&!u?"transparent":g},role:"img","aria-label":n??r??"avatar"},k);if(!d)return S;const $=Math.max(8,Math.round(.25*p));return o("div",{style:{position:"relative",display:"inline-flex",width:`${p}px`,height:`${p}px`,flexShrink:"0"}},S,o("span",{style:{position:"absolute",width:`${$}px`,height:`${$}px`,borderRadius:"50%",backgroundColor:v[d]??v.offline,border:"2px solid #fff",boxSizing:"border-box",...w(c,$)},"aria-label":d}))},exports.Badge=function(e){const{count:t,max:n,dot:r=!1,color:i="#ef4444",size:l="md",variant:a="solid",children:s}=e;let d=null;r||null==t||(d=null!=n&&t>n?`${n}+`:String(t));const c=r||null!=t&&t>0,u=r?{...S[l],borderRadius:"50%",..."solid"===a?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...k[l],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",..."solid"===a?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},f=c?o("span",{style:u,"aria-label":r?"notification":`count ${d}`},d):null;if(null==s)return f??o("span",null);const p={...u,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},s,c?o("span",{style:p,"aria-label":r?"notification":`count ${d}`},d):null)},exports.BarGraph=function(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:l="#3b82f6",barGap:a=8,barRadius:c=4,showValues:u=!0,showGrid:f=!0,gridColor:p="#e5e7eb",title:h,padding:g=50,animate:x=!1,stacked:m,grouped:y=!1}=e,b="vertical"===i,v=n-2*g,w=r-2*g,k=b?w:v,S=b?v:w,$=void 0!==m&&m.length>0,M=d(()=>$?function(e){const t=new Set;for(const n of e)for(const e of n.values)t.add(e.category);return Array.from(t)}(m):[],[$,m]),z=$?m.length:t.length,C=d(()=>function(e,t,n){if(t&&t.length>0){if(n){let e=0;for(const n of t)for(const t of n.values)t.value>e&&(e=t.value);return e}let e=0;for(const n of t){let t=0;for(const e of n.values)t+=e.value;t>e&&(e=t)}return e}let o=0;for(const t of e)t.value>o&&(o=t.value);return o}(t,m,y),[t,m,y]),I=C>0?C:1,A=ot(z,I,k,S,a),F=s(()=>{if(!f)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(I),t=[];for(let n=e;n<=I;n+=e){const e=A.valueScale(n);if(b){const r=g+w-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+v),y2:String(r),stroke:p,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-6),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}else{const r=g+e;t.push(o("line",{key:`grid-${n}`,x1:String(r),y1:String(g),x2:String(r),y2:String(g+w),stroke:p,"stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+w+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[f,I,A,b,g,v,w,p]),D=s(()=>{const e=[];return b?(e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+w),x2:String(g+v),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"}))):(e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+w),x2:String(g+v),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+w),stroke:"#374151","stroke-width":"1.5"}))),e},[b,g,v,w]),R=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=A.valueScale(r.value),a=A.categoryScale(n),s=r.color??l;let d,f,p=String(r.value);if(b){const e=g+a,t=g+w-i;d={x:String(e),y:String(t),width:String(A.barThickness),height:String(i),rx:String(c),ry:String(c),fill:s},f={x:String(e+A.barThickness/2),y:String(t-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{const e=g+a,t=g;d={x:String(t),y:String(e),width:String(i),height:String(A.barThickness),rx:String(c),ry:String(c),fill:s},f={x:String(t+i+6),y:String(e+A.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(x&&(d.style=`animation: barGrow 0.6s ease-out ${.05*n}s both`),e.push(o("rect",{key:`bar-${n}`,...d})),u&&e.push(o("text",{key:`val-${n}`,...f},p)),b){const t=g+a+A.barThickness/2,i=g+w+16;e.push(o("text",{key:`cat-${n}`,x:String(t),y:String(i),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${t}, ${i})`},r.label))}else e.push(o("text",{key:`cat-${n}`,x:String(g-6),y:String(g+a+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return e},[t,A,l,c,u,x,b,g,w]),L=s(()=>{if(!m)return[];const e=[];for(let t=0;t<m.length;t++){const n=m[t],r=A.categoryScale(t);let i=0;for(let l=0;l<n.values.length;l++){const a=n.values[l],s=A.valueScale(a.value),d=A.valueScale(i),f=it(l,a.color);if(b){const i=g+r,p=g+w-d-s;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(p),width:String(A.barThickness),height:String(s),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:f,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),u&&s>14&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+A.barThickness/2),y:String(p+s/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}else{const i=g+d,p=g+r;e.push(o("rect",{key:`sbar-${t}-${l}`,x:String(i),y:String(p),width:String(s),height:String(A.barThickness),rx:l===n.values.length-1?String(c):"0",ry:l===n.values.length-1?String(c):"0",fill:f,...x?{style:`animation: barGrow 0.6s ease-out ${.03*(t*n.values.length+l)}s both`}:{}})),u&&s>20&&e.push(o("text",{key:`sval-${t}-${l}`,x:String(i+s/2),y:String(p+A.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(a.value)))}i+=a.value}if(u){const n=A.valueScale(i);b?e.push(o("text",{key:`stotal-${t}`,x:String(g+r+A.barThickness/2),y:String(g+w-n-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i))):e.push(o("text",{key:`stotal-${t}`,x:String(g+n+6),y:String(g+r+A.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(i)))}if(b){const i=g+r+A.barThickness/2,l=g+w+16;e.push(o("text",{key:`scat-${t}`,x:String(i),y:String(l),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${i}, ${l})`},n.label))}else e.push(o("text",{key:`scat-${t}`,x:String(g-6),y:String(g+r+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[m,A,c,u,x,b,g,w]),W=s(()=>{if(!m)return[];const e=M.length,t=[];for(let n=0;n<m.length;n++){const r=m[n],i=A.categoryScale(n),l=2,a=Math.max(1,(A.barThickness-l*(e-1))/e);for(let s=0;s<r.values.length;s++){const d=r.values[s],f=M.indexOf(d.category),p=f*(a+l),h=A.valueScale(d.value),m=it(f>=0?f:s,d.color);if(b){const r=g+i+p,l=g+w-h;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(a),height:String(h),rx:String(c),ry:String(c),fill:m,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),u&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+a/2),y:String(l-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}else{const r=g,l=g+i+p;t.push(o("rect",{key:`gbar-${n}-${s}`,x:String(r),y:String(l),width:String(h),height:String(a),rx:String(c),ry:String(c),fill:m,...x?{style:`animation: barGrow 0.6s ease-out ${.04*(n*e+s)}s both`}:{}})),u&&t.push(o("text",{key:`gval-${n}-${s}`,x:String(r+h+4),y:String(l+a/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(d.value)))}}if(b){const e=g+i+A.barThickness/2,l=g+w+16;t.push(o("text",{key:`gcat-${n}`,x:String(e),y:String(l),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${e}, ${l})`},r.label))}else t.push(o("text",{key:`gcat-${n}`,x:String(g-6),y:String(g+i+A.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}return t},[m,M,A,c,u,x,b,g,w]),N=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),T=s(()=>x?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},b?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[x,b]),E=F(),P=D(),B=N(),_=T();let H;return H=$&&y?W():$?L():R(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},..._,...B,...E,...P,...H)},exports.BigNumber=function(e){const{value:t,label:n,prefix:r="",suffix:i="",trend:l,trendLabel:a,sparkline:c,width:u=280,height:f=160,valueColor:p="currentColor",trendUpColor:h="#22c55e",trendDownColor:g="#ef4444",backgroundColor:x="#ffffff"}=e,m=d(()=>function(e){if("string"==typeof e)return e;if(!isFinite(e)||isNaN(e))return"--";const t=e.toString().split("."),n=t[0],o=t.length>1?"."+t[1]:"",r=n.startsWith("-"),i=r?n.slice(1):n;let l="";for(let e=0;e<i.length;e++)e>0&&(i.length-e)%3==0&&(l+=","),l+=i[e];return(r?"-":"")+l+o}(t),[t]),y=null!=l&&isFinite(l)&&!isNaN(l),b=null!=c&&c.length>1,v=null!=n&&n.length>0,w=y&&l>=0?h:g,k=v?.38*f:.45*f,S=Math.min(.15*u,48),$=.55*S,M=k+.4*S+8,z=v?M+22:k+.4*S+22,C=b?Math.min(.22*f,36):0,I=f-20-C,A=u-40,F=s(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:x,stroke:"#e5e7eb","stroke-width":"1"})],[u,f,x]),D=s(()=>{const e=[],t=r+m+i;return e.push(o("text",{key:"value",x:String(u/2),y:String(k),"text-anchor":"middle","dominant-baseline":"central","font-size":String(S),"font-weight":"bold","font-family":"sans-serif",fill:p,"aria-label":`Value: ${t}`},r?o("tspan",{key:"prefix","font-size":String($),"font-weight":"normal"},r):null,m,i?o("tspan",{key:"suffix","font-size":String($),"font-weight":"normal"},i):null)),e},[u,k,S,$,m,r,i,p]),R=s(()=>v?[o("text",{key:"label",x:String(u/2),y:String(M),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[v,u,M,n]),L=s(()=>{if(!y)return[];const e=[],t=l>=0,n=function(e){if(!isFinite(e)||isNaN(e))return"--";const t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}(l),r=(t?"+":"-")+n+(a?" "+a:""),i=u/2-40,s=z;if(t){const t=`${i},${s} ${i-4},${s+8} ${i+4},${s+8}`;e.push(o("polygon",{key:"trend-arrow",points:t,fill:w}))}else{const t=`${i},${s+8} ${i-4},${s} ${i+4},${s}`;e.push(o("polygon",{key:"trend-arrow",points:t,fill:w}))}return e.push(o("text",{key:"trend-text",x:String(i+8+4),y:String(s+5.6),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:w,"aria-label":`Trend: ${r}`},r)),e},[y,l,a,w,u,z]),W=s(()=>{if(!b)return[];const e=[],t=c,n=[];for(const e of t)"number"==typeof e&&isFinite(e)&&!isNaN(e)&&n.push(e);if(n.length<2)return[];let r=1/0,i=-1/0;for(const e of n)e<r&&(r=e),e>i&&(i=e);r===i&&(r-=1,i+=1);const l=i-r,a=A/(n.length-1);let s="";for(let e=0;e<n.length;e++){const t=20+e*a,o=I+C-(n[e]-r)/l*C;s+=0===e?`M ${t} ${o}`:` L ${t} ${o}`}const d=s+` L ${20+(n.length-1)*a} ${I+C} L 20 ${I+C} Z`;return e.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),e.push(o("path",{key:"spark-fill",d:d,fill:"url(#sparkGrad)"})),e.push(o("path",{key:"spark-line",d:s,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),e},[b,c,A,I,C,20]),N=F(),T=D(),E=R(),P=L(),B=W();return o("svg",{width:"100%",viewBox:`0 0 ${u} ${f}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":`${r}${m}${i}${v?`, ${n}`:""}`,style:{fontFamily:"sans-serif"}},...N,...B,...T,...E,...P)},exports.BlochSphere=function(e){const{state:t,gates:n,width:r=400,height:i=400,rotateY:d=-25,rotateX:u=15,zoom:f=1,interactive:p=!0,zoomable:h=!0,showVector:g=!0,showLabels:x=!0,showWireframe:m=!0,showTrail:y=!0,trailMaxPoints:b=200,trailColor:v="#ef4444",wireframeColor:w="#cbd5e1",vectorColor:k="#3b82f6",backgroundColor:S,sphereRadius:$=130,title:M,onStateChange:z}=e,[C,I]=l(t??{theta:0,phi:0}),[A,F]=l(d),[D,R]=l(u),[L,W]=l(f),N=c([]),T=c(!1),E=c(null),P=c(null);a(()=>{t&&I(t)},[t?.theta,t?.phi]);const B=c(0);a(()=>{if(!n||0===n.length)return;B.current=0;let e=0;const t=()=>{B.current>=n.length||(I(e=>{const t=co(e,n[B.current]);return B.current++,z&&z(t),t}),e=requestAnimationFrame(t))};return e=requestAnimationFrame(t),()=>cancelAnimationFrame(e)},[n]),a(()=>{const e=lo(C);N.current.push(e),N.current.length>b&&N.current.splice(0,N.current.length-b)},[C.theta,C.phi]);const _=$*L,H=r/2,Y=i/2,j=s((e,t,n)=>function(e,t,n,o,r,i,l,a){const s=Math.cos(o*io),d=Math.sin(o*io),c=Math.cos(r*io),u=Math.sin(r*io),f=-e*u+n*c;return{sx:i+(e*c+n*u)*a,sy:l-(t*s-f*d)*a,depth:t*d+f*s}}(e,t,n,D,A,H,Y,_),[D,A,H,Y,_]),q=s(e=>{if(!p)return;const t=e;T.current=!0,E.current={mx:t.clientX,my:t.clientY,rx:D,ry:A}},[p,D,A]),O=s(e=>{if(!T.current||!E.current)return;const t=e,n=E.current;F(n.ry+.5*(t.clientX-n.mx)),R(n.rx-.5*(t.clientY-n.my))},[]),U=s(()=>{T.current=!1},[]),G=s(e=>{if(!h)return;const t=e;t.preventDefault(),W(e=>Math.max(.5,Math.min(3,e*(t.deltaY>0?.95:1.05))))},[h]),X=[];if(S&&X.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:S,rx:"6"})),M&&X.push(o("text",{key:"title",x:String(H),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},M)),m){const e=60,t=[];for(let n=0;n<=e;n++){const o=n/e*2*Math.PI,r=j(Math.cos(o),Math.sin(o),0);t.push(`${0===n?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}X.push(o("path",{key:"eq",d:t.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.5"}));const n=[];for(let t=0;t<=e;t++){const o=t/e*2*Math.PI,r=j(Math.cos(o),0,Math.sin(o));n.push(`${0===t?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}X.push(o("path",{key:"xz",d:n.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.4"}));const r=[];for(let t=0;t<=e;t++){const n=t/e*2*Math.PI,o=j(0,Math.cos(n),Math.sin(n));r.push(`${0===t?"M":"L"}${o.sx.toFixed(1)},${o.sy.toFixed(1)}`)}X.push(o("path",{key:"yz",d:r.join(" "),fill:"none",stroke:w,"stroke-width":"0.8",opacity:"0.4"}))}const V=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(const e of V){const t=j(1.15*e.dir[0],1.15*e.dir[1],1.15*e.dir[2]),n=j(1.15*-e.dir[0],1.15*-e.dir[1],1.15*-e.dir[2]);j(0,0,0),X.push(o("line",{key:`axis-${e.id}`,x1:String(n.sx),y1:String(n.sy),x2:String(t.sx),y2:String(t.sy),stroke:e.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(x){const e=[{text:"|0⟩",pos:[0,0,1.3]},{text:"|1⟩",pos:[0,0,-1.3]},{text:"|+⟩",pos:[1.3,0,0]},{text:"|-⟩",pos:[-1.3,0,0]},{text:"|+i⟩",pos:[0,1.3,0]},{text:"|-i⟩",pos:[0,-1.3,0]}];for(const t of e){const e=j(t.pos[0],t.pos[1],t.pos[2]);X.push(o("text",{key:`lbl-${t.text}`,x:String(e.sx),y:String(e.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},t.text))}}if(y&&N.current.length>1){const e=N.current,t=[];for(let n=0;n<e.length;n++){const o=e[n],r=j(o.x,o.y,o.z);t.push(`${0===n?"M":"L"}${r.sx.toFixed(1)},${r.sy.toFixed(1)}`)}X.push(o("path",{key:"trail",d:t.join(" "),fill:"none",stroke:v,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(g){const e=lo(C),t=j(0,0,0),n=j(e.x,e.y,e.z);X.push(o("line",{key:"vec-line",x1:String(t.sx),y1:String(t.sy),x2:String(n.sx),y2:String(n.sy),stroke:k,"stroke-width":"2.5","stroke-linecap":"round"})),X.push(o("circle",{key:"vec-point",cx:String(n.sx),cy:String(n.sy),r:"5",fill:k,stroke:"#fff","stroke-width":"1.5"}));const l=(180*C.theta/Math.PI).toFixed(0),a=(180*C.phi/Math.PI).toFixed(0);X.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`θ=${l}° φ=${a}°`))}return o("svg",{ref:P,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":M??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:p?T.current?"grabbing":"grab":"default"},onMouseDown:p?q:void 0,onMouseMove:p?O:void 0,onMouseUp:p?U:void 0,onMouseLeave:p?U:void 0,onWheel:h?G:void 0},...X)},exports.BoxPlot=function(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:l=!0,showMean:a=!1,whiskerColor:c="#374151",boxWidth:u=.6,showGrid:f=!0,title:p,padding:h=60}=e,g="vertical"===i,x=n-2*h,m=r-2*h,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],b=d(()=>{const e=[];for(const n of t)e.push(fo(n.values));return e},[t]),v=d(()=>{let e=1/0,t=-1/0;for(const n of b){if(null===n)continue;const o=l&&n.outliers.length>0?Math.min(n.whiskerLow,n.outliers[0]):n.whiskerLow,r=l&&n.outliers.length>0?Math.max(n.whiskerHigh,n.outliers[n.outliers.length-1]):n.whiskerHigh;o<e&&(e=o),r>t&&(t=r)}isFinite(e)||(e=0,t=1);const n=t-e,o=n>0?.05*n:.5;return{min:e-o,max:t+o}},[b,l]),w=g?m:x,k=(g?x:m)/(t.length>0?t.length:1),S=k*Math.min(Math.max(u,.1),.95),$=s(e=>{const t=v.max-v.min;return 0===t?w/2:(e-v.min)/t*w},[v,w]),M=s(()=>{if(!f)return[];const e=[],t=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(v.max-v.min);for(let n=Math.ceil(v.min/t)*t;n<=v.max;n+=t){const t=$(n),r=String(Math.round(1e3*n)/1e3);if(g){const i=h+m-t;e.push(o("line",{key:`grid-${n}`,x1:String(h),y1:String(i),x2:String(h+x),y2:String(i),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`glabel-${n}`,x:String(h-6),y:String(i+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},r))}else{const i=h+t;e.push(o("line",{key:`grid-${n}`,x1:String(i),y1:String(h),x2:String(i),y2:String(h+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`glabel-${n}`,x:String(i),y:String(h+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},r))}}return e},[f,v,$,g,h,x,m]),z=s(()=>{const e=[];return e.push(o("line",{key:"axis-value",x1:String(h),y1:String(g?h:h+m),x2:String(h),y2:String(h+m),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-category",x1:String(h),y1:String(h+m),x2:String(h+x),y2:String(h+m),stroke:"#374151","stroke-width":"1.5"})),e},[h,x,m,g]),C=s(()=>{const e=[];for(let n=0;n<t.length;n++){const r=b[n];if(null===r)continue;const i=t[n],s=i.color??y[n%y.length],d=k*n+k/2,u=S/2;if(g){const t=h+m-$(r.q1),f=h+m-$(r.q3),p=h+m-$(r.median),g=h+m-$(r.whiskerLow),x=h+m-$(r.whiskerHigh),y=h+d;e.push(o("line",{key:`wl-${n}`,x1:String(y),y1:String(t),x2:String(y),y2:String(g),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wlc-${n}`,x1:String(y-.4*u),y1:String(g),x2:String(y+.4*u),y2:String(g),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wh-${n}`,x1:String(y),y1:String(f),x2:String(y),y2:String(x),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`whc-${n}`,x1:String(y-.4*u),y1:String(x),x2:String(y+.4*u),y2:String(x),stroke:c,"stroke-width":"1.5"}));const b=Math.min(t,f),v=Math.abs(t-f);if(e.push(o("rect",{key:`box-${n}`,x:String(y-u),y:String(b),width:String(S),height:String(Math.max(v,1)),fill:s,stroke:c,"stroke-width":"1.5",opacity:"0.8","aria-label":`${i.label}: Q1=${r.q1.toFixed(1)}, median=${r.median.toFixed(1)}, Q3=${r.q3.toFixed(1)}`,role:"img"})),e.push(o("line",{key:`med-${n}`,x1:String(y-u),y1:String(p),x2:String(y+u),y2:String(p),stroke:"#fff","stroke-width":"2.5"})),a){const t=h+m-$(r.mean);e.push(o("circle",{key:`mean-${n}`,cx:String(y),cy:String(t),r:"3.5",fill:"#fff",stroke:c,"stroke-width":"1.5","aria-label":`Mean: ${r.mean.toFixed(1)}`}))}if(l)for(let t=0;t<r.outliers.length;t++){const i=h+m-$(r.outliers[t]);e.push(o("circle",{key:`out-${n}-${t}`,cx:String(y),cy:String(i),r:"3",fill:"none",stroke:c,"stroke-width":"1.5","aria-label":`Outlier: ${r.outliers[t]}`}))}e.push(o("text",{key:`cat-${n}`,x:String(y),y:String(h+m+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},i.label))}else{const t=h+$(r.q1),f=h+$(r.q3),p=h+$(r.median),g=h+$(r.whiskerLow),x=h+$(r.whiskerHigh),m=h+d;e.push(o("line",{key:`wl-${n}`,x1:String(t),y1:String(m),x2:String(g),y2:String(m),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wlc-${n}`,x1:String(g),y1:String(m-.4*u),x2:String(g),y2:String(m+.4*u),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`wh-${n}`,x1:String(f),y1:String(m),x2:String(x),y2:String(m),stroke:c,"stroke-width":"1.5"})),e.push(o("line",{key:`whc-${n}`,x1:String(x),y1:String(m-.4*u),x2:String(x),y2:String(m+.4*u),stroke:c,"stroke-width":"1.5"}));const y=Math.min(t,f),b=Math.abs(f-t);if(e.push(o("rect",{key:`box-${n}`,x:String(y),y:String(m-u),width:String(Math.max(b,1)),height:String(S),fill:s,stroke:c,"stroke-width":"1.5",opacity:"0.8","aria-label":`${i.label}: Q1=${r.q1.toFixed(1)}, median=${r.median.toFixed(1)}, Q3=${r.q3.toFixed(1)}`,role:"img"})),e.push(o("line",{key:`med-${n}`,x1:String(p),y1:String(m-u),x2:String(p),y2:String(m+u),stroke:"#fff","stroke-width":"2.5"})),a){const t=h+$(r.mean);e.push(o("circle",{key:`mean-${n}`,cx:String(t),cy:String(m),r:"3.5",fill:"#fff",stroke:c,"stroke-width":"1.5","aria-label":`Mean: ${r.mean.toFixed(1)}`}))}if(l)for(let t=0;t<r.outliers.length;t++){const i=h+$(r.outliers[t]);e.push(o("circle",{key:`out-${n}-${t}`,cx:String(i),cy:String(m),r:"3",fill:"none",stroke:c,"stroke-width":"1.5","aria-label":`Outlier: ${r.outliers[t]}`}))}e.push(o("text",{key:`cat-${n}`,x:String(h-6),y:String(m+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},i.label))}}return e},[t,b,$,g,h,x,m,k,S,c,l,a,y]),I=s(()=>p?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,h]),A=M(),F=z(),D=C(),R=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Box plot",style:{fontFamily:"sans-serif"}},...R,...A,...F,...D)},exports.Breadcrumb=function(e){const{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[a,d]=l(!1),c=Ce[i],u=s(()=>{d(!0)},[]);let f=t,p=!1;if(r&&r>1&&t.length>r&&!a){p=!0;const e=1,n=r-1;f=[...t.slice(0,e),{label:"..."},...t.slice(t.length-n)]}const h=f.map((e,t)=>((e,t,r)=>{const i=t===r.length-1,l=p&&"..."===e.label&&1===t,a=[];var s;return t>0&&a.push(o("span","string"==typeof(s=n)?{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}}:{"aria-hidden":"true",style:{margin:"0 8px"}},s)),l?a.push(o("button",{type:"button",onClick:u,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:c.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):i?a.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:c.fontSize}},e.label)):e.href?a.push(o("a",{href:e.href,onClick:e.onClick?t=>{t.preventDefault(),e.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:c.fontSize}},e.label)):e.onClick?a.push(o("button",{type:"button",onClick:e.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:c.fontSize,fontFamily:"inherit"}},e.label)):a.push(o("span",{style:{color:"#6b7280",fontSize:c.fontSize}},e.label)),o("li",{key:String(t),style:{display:"inline-flex",alignItems:"center"}},...a)})(e,t,f));return o(ke,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:c.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...h))},exports.BubbleChart=function(e){const{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:l,showGrid:a=!0,showAxes:c=!0,showLabels:u=!1,maxBubbleRadius:f=40,minBubbleRadius:p=4,defaultColor:h="#3b82f6",opacity:g=.7,title:x,padding:m=60}=e,y=d(()=>{const e=[];for(let n=0;n<t.length;n++){const o=t[n];go(o.x)&&go(o.y)&&go(o.r)&&e.push(o)}return e},[t]),b=n-2*m,v=r-2*m,w=d(()=>{if(0===y.length)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let e=1/0,t=-1/0,n=1/0,o=-1/0,r=1/0,i=-1/0;for(const l of y)l.x<e&&(e=l.x),l.x>t&&(t=l.x),l.y<n&&(n=l.y),l.y>o&&(o=l.y),l.r<r&&(r=l.r),l.r>i&&(i=l.r);return e===t&&(e-=1,t+=1),n===o&&(n-=1,o+=1),r===i&&(r=0,i=i>0?i:1),{xMin:e,xMax:t,yMin:n,yMax:o,rMin:r,rMax:i}},[y]),k=s(e=>{const t=w.xMax-w.xMin;return m+(e-w.xMin)/t*b},[w,m,b]),S=s(e=>{const t=w.yMax-w.yMin;return m+v-(e-w.yMin)/t*v},[w,m,v]),$=s(e=>{const t=w.rMax-w.rMin;if(0===t)return(p+f)/2;const n=(e-w.rMin)/t;return p+n*(f-p)},[w,p,f]),M=s(()=>{if(!a)return[];const e=[],t=po(w.xMax-w.xMin);for(let n=Math.ceil(w.xMin/t)*t;n<=w.xMax;n+=t){const t=k(n);e.push(o("line",{key:`grid-x-${n}`,x1:String(t),y1:String(m),x2:String(t),y2:String(m+v),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`grid-xlabel-${n}`,x:String(t),y:String(m+v+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(1e3*n)/1e3)))}const n=po(w.yMax-w.yMin);for(let t=Math.ceil(w.yMin/n)*n;t<=w.yMax;t+=n){const n=S(t);e.push(o("line",{key:`grid-y-${t}`,x1:String(m),y1:String(n),x2:String(m+b),y2:String(n),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),e.push(o("text",{key:`grid-ylabel-${t}`,x:String(m-6),y:String(n+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(1e3*t)/1e3)))}return e},[a,w,k,S,m,b,v]),z=s(()=>{if(!c)return[];const e=[];return e.push(o("line",{key:"axis-y",x1:String(m),y1:String(m),x2:String(m),y2:String(m+v),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(m),y1:String(m+v),x2:String(m+b),y2:String(m+v),stroke:"#374151","stroke-width":"1.5"})),i&&e.push(o("text",{key:"x-label",x:String(m+b/2),y:String(m+v+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),l&&e.push(o("text",{key:"y-label",x:String(m-40),y:String(m+v/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${m-40}, ${m+v/2})`},l)),e},[c,m,b,v,i,l]),C=s(()=>{const e=[];for(let t=0;t<y.length;t++){const n=y[t],r=k(n.x),i=S(n.y),l=ho($(n.r),p,f),a=n.color??h;e.push(o("circle",{key:`bubble-${t}`,cx:String(r),cy:String(i),r:String(l),fill:a,opacity:String(g),stroke:a,"stroke-width":"1","stroke-opacity":"0.8","aria-label":n.label??`Bubble at (${n.x}, ${n.y}) size ${n.r}`,role:"img"})),u&&n.label&&e.push(o("text",{key:`label-${t}`,x:String(r),y:String(i-l-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},n.label))}return e},[y,k,S,$,h,g,u,p,f]),I=s(()=>x?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n,m]),A=M(),F=z(),D=C(),R=I();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"Bubble chart",style:{fontFamily:"sans-serif"}},...R,...A,...F,...D)},exports.Button=function(e){const{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:l=!1,fullWidth:a=!1,type:s="button",className:c,style:u,ariaLabel:f,active:p=!1}=e,h=d(()=>{const e=Qn[i]??Qn.md,t=eo[r]??eo.secondary,n={padding:e.padding,fontSize:e.fontSize,borderRadius:e.borderRadius,border:`1px solid ${t.border}`,backgroundColor:p?"#3b82f6":t.bg,color:p?"white":t.color,cursor:l?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:l?"0.5":"1"};return a&&(n.width="100%"),u&&Object.assign(n,u),n},[r,i,l,a,p,u]);return o("button",{type:s,onClick:l?void 0:n,disabled:l,className:c,style:h,"aria-label":f,"aria-pressed":p?"true":void 0},t)},exports.CalendarHeatMap=function(e){const{data:t=[],width:n=800,height:r=160,colorScale:i=ko,cellSize:l=12,cellGap:a=2,showMonthLabels:c=!0,showDayLabels:u=!0,emptyColor:f="#ebedf0",title:p}=e,{dateMap:h,startDate:g,endDate:x,maxVal:m}=d(()=>{const e=new Map;let n=0,o=null,r=null;for(const i of t){const t=yo(i.date);if(isNaN(t.getTime()))continue;const l=bo(t);e.set(l,(e.get(l)??0)+i.value);const a=e.get(l);a>n&&(n=a),(null===o||t<o)&&(o=t),(null===r||t>r)&&(r=t)}if(null===o||null===r){const e=new Date;o=new Date(e.getFullYear(),0,1),r=new Date(e.getFullYear(),11,31)}const i=new Date(o);i.setDate(i.getDate()-i.getDay());const l=new Date(r);return l.setDate(l.getDate()+(6-l.getDay())),{dateMap:e,startDate:i,endDate:l,maxVal:n>0?n:1}},[t]),y=u?30:0,b=c?16:0,v=p?28:0,w=y+10,k=v+b+4,S=s(()=>{const e=[],t=new Date(g);let n=0;for(;t<=x;){const r=t.getDay();0===r&&t>g&&n++;const s=bo(t),d=h.get(s),c=void 0!==d&&d>0?wo(d/m,i):f,u=w+n*(l+a),p=k+r*(l+a);e.push(o("rect",{key:`day-${s}`,x:String(u),y:String(p),width:String(l),height:String(l),rx:"2",ry:"2",fill:c,"aria-label":`${s}: ${d??0}`})),t.setDate(t.getDate()+1)}return e},[g,x,h,m,i,f,l,a,w,k]),$=s(()=>{if(!c)return[];const e=[],t=new Date(g);let n=0,r=-1;for(;t<=x;){const i=t.getDay();0===i&&t>g&&n++;const s=t.getMonth();if(s!==r&&0===i){r=s;const t=w+n*(l+a);e.push(o("text",{key:`month-${n}`,x:String(t),y:String(v+b-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},xo[s]))}t.setDate(t.getDate()+1)}return e},[c,g,x,l,a,w,v,b]),M=s(()=>{if(!u)return[];const e=[],t=[1,3,5];for(const n of t){const t=k+n*(l+a)+l/2;e.push(o("text",{key:`day-label-${n}`,x:String(y),y:String(t),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},mo[n]))}return e},[u,l,a,k,y]),z=s(()=>p?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},p)]:[],[p,n]);if(0===t.length)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Calendar heat map — no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));const C=z(),I=$(),A=M(),F=S();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Calendar heat map",style:{fontFamily:"sans-serif"}},...C,...I,...A,...F)},exports.Card=function(e){const t=!1!==e.bordered,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",l=d(()=>{const o={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=me[n]??me.sm,e.hoverable&&(o.cursor="pointer"),{...o,...e.style??{}}},[t,n,i,e.hoverable,e.style]),a={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},s={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},c={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:l},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:a},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:s},e.children),e.footer?o("div",{className:"card__footer",style:c},e.footer):null)},exports.Carousel=function(e){const t=e.items??[],n=t.length,r=!1!==e.loop,i=!1!==e.showDots,f=!1!==e.showArrows,p=e.animation??"slide",h=e.interval??5e3,g=u().replace(/[^a-zA-Z0-9_-]/g,""),[x,m]=l(0),y=c(null),b=c(null),v=s(t=>{let o=t;o=r?(t%n+n)%n:Math.max(0,Math.min(t,n-1)),m(o),e.onChange&&e.onChange(o)},[n,r,e.onChange]),w=s(()=>v(x+1),[x,v]),k=s(()=>v(x-1),[x,v]);a(()=>{if(!e.autoPlay||n<=1)return;const t=setInterval(w,h);return()=>clearInterval(t)},[e.autoPlay,h,w,n]),a(()=>{const e=e=>{"ArrowLeft"===e.key?k():"ArrowRight"===e.key&&w()},t=b.current;if(t)return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)},[w,k]);const S="fade"===p?`@keyframes liq-fade-in-${g}{from{opacity:0}to{opacity:1}}`:"",$=d(()=>"fade"===p?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${100*x}%)`,width:"100%"},[x,p]),M={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},z=t.map((e,t)=>{const n="fade"===p?{position:t===x?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:t===x?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(t),style:n},e.content,e.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},e.caption):null)}),C=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((e,t)=>o("button",{key:String(t),"aria-label":`Go to slide ${t+1}`,onclick:()=>v(t),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:t===x?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:b,tabindex:"0",role:"region","aria-label":"Carousel",style:{position:"relative",overflow:"hidden",width:"100%",outline:"none"},onpointerdown:e=>{y.current=e.clientX},onpointerup:e=>{if(null==y.current)return;const t=e.clientX-y.current;t>50?k():t<-50&&w(),y.current=null}},S?o("style",null,S):null,o("div",{style:$},...z),f&&n>1?o("button",{"aria-label":"Previous slide",onclick:k,style:{...M,left:"8px"}},"‹"):null,f&&n>1?o("button",{"aria-label":"Next slide",onclick:w,style:{...M,right:"8px"}},"›"):null,C)},exports.CartesianGraph2D=function(e){const{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:u=200,xStep:f,sync:p=!1,xRange:h=[-5,5],yRange:g=[-5,5],showGrid:x=!0,showAxes:m=!0,pointRadius:y=3,pointColor:b="#3b82f6",curveColor:v="#3b82f6",gridColor:w="#e2e8f0",axisColor:k="#94a3b8",onPointClick:S,onPointDoubleClick:$,onPointContextMenu:M,onPointHover:z}=e,[C,I]=l(h[0]),[A,F]=l(h[1]),[D,R]=l(g[0]),[L,W]=l(g[1]),N=c(!1),T=c(null),E=s(e=>ft+(e-C)/(A-C)*(t-80),[C,A,t]),P=s(e=>n-ft-(e-D)/(L-D)*(n-80),[D,L,n]),B=s(e=>C+(e-ft)/(t-80)*(A-C),[C,A,t]),_=s(e=>D+(n-ft-e)/(n-80)*(L-D),[D,L,n]),H=s(e=>{const t=e;N.current=!0,T.current={mx:t.clientX,my:t.clientY,x0:C,x1:A,y0:D,y1:L}},[C,A,D,L]),Y=s(e=>{if(!N.current||!T.current)return;const o=e,r=T.current,i=o.clientX-r.mx,l=o.clientY-r.my,a=i/(t-80)*(r.x1-r.x0),s=l/(n-80)*(r.y1-r.y0);I(r.x0-a),F(r.x1-a),R(r.y0+s),W(r.y1+s)},[t,n]),j=s(()=>{N.current=!1,T.current=null},[]),q=s(e=>{const t=e;t.preventDefault();const n=t.currentTarget.getBoundingClientRect(),o=t.clientX-n.left,r=t.clientY-n.top,i=B(o),l=_(r),a=t.deltaY>0?1.1:1/1.1,s=(A-C)*a,d=(L-D)*a;if(s<.01||d<.01||s>pt||d>pt)return;const c=(i-C)/(A-C),u=(l-D)/(L-D);I(i-c*s),F(i+(1-c)*s),R(l-u*d),W(l+(1-u)*d)},[C,A,D,L,B,_]),O=[];if(O.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),x){const e=ct(C,A),r=ct(D,L);for(let t=0;t<e.length;t++){const r=E(e[t]);O.push(o("line",{x1:r,y1:ft,x2:r,y2:n-ft,stroke:w,"stroke-width":.5,key:`gx-${t}`})),O.push(o("text",{x:r,y:n-ft+14,"text-anchor":"end","font-size":10,fill:k,transform:`rotate(-45, ${r}, ${n-ft+14})`,key:`lx-${t}`},ut(e[t])))}for(let e=0;e<r.length;e++){const n=P(r[e]);O.push(o("line",{x1:ft,y1:n,x2:t-ft,y2:n,stroke:w,"stroke-width":.5,key:`gy-${e}`})),O.push(o("text",{x:34,y:n+3,"text-anchor":"end","font-size":10,fill:k,key:`ly-${e}`},ut(r[e])))}}if(m){const e=Math.max(ft,Math.min(t-ft,E(0))),r=Math.max(ft,Math.min(n-ft,P(0)));O.push(o("line",{x1:ft,y1:r,x2:t-ft,y2:r,stroke:k,"stroke-width":1,key:"x-axis"})),O.push(o("line",{x1:e,y1:ft,x2:e,y2:n-ft,stroke:k,"stroke-width":1,key:"y-axis"}))}const U=d(()=>{if(!i||!p)return[];const e=lt({start:C,end:A,step:f??(A-C)/u});return at(i,e)},[i,C,A,f,u,p]),[G,X]=l([]),V=c(null);a(()=>{if(!i||p)return void X([]);const e=lt({start:C,end:A,step:f??(A-C)/u});return V.current&&V.current(),V.current=st(i,e,200,e=>{X([...e])}),()=>{V.current&&V.current()}},[i,C,A,f,u,p]);const K=p?U:G;if(K.length>0){const e=[];for(let t=0;t<K.length;t++){const n=K[t],o=E(n.input),r=P(n.output);e.push(`${0===e.length?"M":"L"}${o},${r}`)}O.push(o("path",{d:e.join(" "),fill:"none",stroke:v,"stroke-width":1.5,key:"curve"}))}const Z=(e,t,n,o)=>{if(t)return e=>t({x:o.x,y:o.y,index:n,event:e})};for(let e=0;e<r.length;e++){const t=r[e],n={cx:E(t.x),cy:P(t.y),r:y,fill:b,cursor:"pointer",key:`pt-${e}`};S&&(n.onClick=Z(0,S,e,t)),$&&(n.onDblClick=Z(0,$,e,t)),M&&(n.onContextMenu=Z(0,M,e,t)),z&&(n.onMouseOver=Z(0,z,e,t)),O.push(o("circle",n))}const J=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:ft,y:ft,width:t-80,height:n-80})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:H,onMouseMove:Y,onMouseUp:j,onMouseLeave:j,onWheel:q},J,...O)},exports.Checkbox=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:l,indeterminate:d=!1,disabled:f=!1,error:p,size:h="md"}=e,g=c(null);a(()=>{g.current&&(g.current.indeterminate=d)},[d]);const x=s(()=>{f||i(!r)},[f,r,i]),m=s(e=>{f||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),i(!r))},[f,r,i]),y=oe[h],b=`${y.box}px`,v={width:b,height:b,minWidth:b,borderRadius:"4px",border:"2px solid "+(p?"#ef4444":r||d?"#3b82f6":"#d1d5db"),backgroundColor:r||d?"#3b82f6":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:f?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},w={color:"#ffffff",fontSize:`${y.icon}px`,lineHeight:"1",fontWeight:"700"},k=d?o("span",{style:w},"—"):r?o("span",{style:w},"✓"):null,S={display:"inline-flex",alignItems:"center",gap:"8px",cursor:f?"not-allowed":"pointer",opacity:f?"0.6":"1",userSelect:"none"},$=o("input",{ref:g,type:"checkbox",id:n,checked:r,disabled:f,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),M=o("div",{style:v},k),z=l?o("span",{style:{fontSize:y.fontSize,color:"#374151"}},l):null;return o(te,{error:p,htmlFor:n},o("div",{style:S,onClick:x,onKeyDown:m,tabIndex:f?-1:0,role:"checkbox","aria-checked":d?"mixed":r?"true":"false","aria-disabled":f?"true":void 0,"aria-label":l},$,M,z))},exports.ChordDiagram=function(e){const{matrix:t,labels:n,width:r=600,height:i=600,colors:l=So,padAngle:a=.05,showLabels:c=!0,showValues:u=!1,ribbonOpacity:f=.5,innerRadiusRatio:p=.9,title:h}=e;if(!t||0===t.length||!n||0===n.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));const g=r/2,x=i/2,m=Math.min(r,i)/2-40,y=m*Math.max(.5,Math.min(.99,p)),b=m+16,v=d(()=>function(e,t,n,o){const r=e.length;if(0===r)return{groups:[],chords:[]};const i=[];let l=0;for(let t=0;t<r;t++){let n=0;for(let o=0;o<r;o++){const r=e[t]?.[o]??0;n+=Math.max(0,r)}i.push(n),l+=n}if(0===l){const e=(2*Math.PI-r*o)/Math.max(r,1),i=[];let l=0;for(let a=0;a<r;a++)i.push({index:a,label:t[a]??`Group ${a}`,color:n[a%n.length],startAngle:l,endAngle:l+e,value:0}),l+=e+o;return{groups:i,chords:[]}}const a=2*Math.PI-r*o,s=[];let d=0;for(let e=0;e<r;e++){const r=i[e]/l*a;s.push({index:e,label:t[e]??`Group ${e}`,color:n[e%n.length],startAngle:d,endAngle:d+r,value:i[e]}),d+=r+o}const c=[];for(let e=0;e<r;e++)c.push(s[e].startAngle);const u=[];for(let t=0;t<r;t++)for(let n=t;n<r;n++){const o=Math.max(0,e[t]?.[n]??0),r=t===n?0:Math.max(0,e[n]?.[t]??0);if(0===o&&0===r)continue;const d=o+r,f=i[t]>0?o/l*a:0,p=c[t],h=p+f;c[t]=h;const g=i[n]>0?o/l*a:0,x=c[n],m=x+g;if(c[n]=m,t===n){o>0&&u.push({sourceIndex:t,targetIndex:n,sourceStartAngle:p,sourceEndAngle:h,targetStartAngle:x,targetEndAngle:m,value:o,color:s[t].color});continue}const y=i[n]>0?r/l*a:0,b=c[n]+y;c[n]=b;const v=i[t]>0?r/l*a:0,w=c[t]+v;c[t]=w,(o>0||r>0)&&u.push({sourceIndex:t,targetIndex:n,sourceStartAngle:p,sourceEndAngle:Math.max(h,p+.001),targetStartAngle:x,targetEndAngle:Math.max(m,x+.001),value:d,color:s[t].color})}return{groups:s,chords:u}}(t,n,l,a),[t,n,l,a]),w=s(()=>{const e=[];for(let t=0;t<v.groups.length;t++){const n=v.groups[t];if(n.endAngle-n.startAngle<.001)continue;const r=Mo(g,x,m,y,n.startAngle,n.endAngle);if(e.push(o("path",{key:`arc-${t}`,d:r,fill:n.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${n.label}: ${n.value}`})),c){const r=(n.startAngle+n.endAngle)/2,i=$o(g,x,b,r),l=((r-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,a=l?"start":"end";let s=180*r/Math.PI-90;l||(s+=180);const d=u?`${n.label} (${n.value})`:n.label;e.push(o("text",{key:`label-${t}`,x:String(i.x),y:String(i.y),"text-anchor":a,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${s}, ${i.x}, ${i.y})`,"dominant-baseline":"central","pointer-events":"none"},d))}}return e},[v,g,x,m,y,b,c,u]),k=s(()=>{const e=[];for(let t=0;t<v.chords.length;t++){const n=v.chords[t],r=zo(g,x,y,n.sourceStartAngle,n.sourceEndAngle,n.targetStartAngle,n.targetEndAngle);e.push(o("path",{key:`ribbon-${t}`,d:r,fill:n.color,"fill-opacity":String(f),stroke:n.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return e},[v,g,x,y,f]),S=s(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r]),$=k(),M=w(),z=S();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Chord diagram",style:{fontFamily:"sans-serif"}},...z,...$,...M)},exports.ColorPicker=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:d=re,showInput:f=!0,showAlpha:p=!1,disabled:h=!1,label:g}=e,[x,m]=l(!1),[y,b]=l(r),v=c(null);a(()=>{b(r)},[r]),a(()=>{const e=e=>{v.current&&!v.current.contains(e.target)&&m(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const w=s(e=>{h||i(le(e))},[h,i]),k=s(e=>{const t=e.target.value;b(t);const n=t.startsWith("#")?t:`#${t}`;ie(n)&&i(le(n))},[i]),S=s(()=>{ie(y.startsWith("#")?y:`#${y}`)||b(r)},[y,r]),$={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:h?"not-allowed":"pointer",flexShrink:"0"},M={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:f?"8px":"0"},z=d.map(e=>{const t=le(e)===le(r);return o("div",{key:e,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:e,cursor:h?"not-allowed":"pointer",border:t?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>w(e),onKeyDown:t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),w(e))},role:"button",tabIndex:h?-1:0,title:e,"aria-label":`Select color ${e}`})}),C=f?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:y,onInput:k,onBlur:S,disabled:h,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,I=x?o("div",{style:{position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"}},o("div",{style:M},...z),C):null;return o(te,{label:g,disabled:h,htmlFor:n},o("div",{ref:v,style:{position:"relative"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px"},onClick:h?void 0:()=>m(!x),onKeyDown:h?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),m(!x))},role:"button",tabIndex:h?-1:0,"aria-expanded":x?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:$}),f?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),I))},exports.ColorWheel=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:a=32,showLabel:d=!0,disabled:f=!1,label:p}=e,[h,g]=l(r);return o(te,{label:p,htmlFor:n},o("div",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"}},o("div",{style:{width:`${a}px`,height:`${a}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:h,cursor:f?"not-allowed":"pointer",position:"relative",overflow:"hidden"}},o("input",{id:n,ref:c(null),type:"color",value:h,onInput:s((...e)=>{const t=e[0].target.value;g(t),i?.(t)},[i]),disabled:f,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:f?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":p||"Color"})),d?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},h):null))},exports.ComplexGraph2D=function(e){const{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:d=100,colorScheme:u="classic",computeFunction:f=ht,data:p,resolution:h=2,onPointClick:g,onPointHover:x,onPointDoubleClick:m,onPointContextMenu:y}=e;if(p){const e=p.length,r=e>0?p[0].length:0,i=r>0?t/r:1,l=e>0?n/e:1,a=[];for(let t=0;t<e;t++){const e=p[t];for(let n=0;n<r;n++){const r=e[n]??0,[s,c,f]=gt(r,d,u);a.push(o("rect",{key:`${t}-${n}`,x:String(n*i),y:String(t*l),width:String(Math.ceil(i)),height:String(Math.ceil(l)),fill:`rgb(${s},${c},${f})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},...a)}const[b,v]=l(r[0]),[w,k]=l(r[1]),[S,$]=l(i[0]),[M,z]=l(i[1]),C=c(null),I=c(!1),A=c(null),F=s((e,o)=>({re:b+e/t*(w-b),im:M-o/n*(M-S)}),[b,w,S,M,t,n]);a(()=>{const e=C.current;if(!e)return;const o=e.getContext("2d");if(!o)return;const r=o.createImageData(t,n),i=r.data;for(let e=0;e<n;e++)for(let n=0;n<t;n++){const{re:o,im:r}=F(n,e),l=f(o,r,d),[a,s,c]=gt(l,d,u),p=4*(e*t+n);i[p]=a,i[p+1]=s,i[p+2]=c,i[p+3]=255}o.putImageData(r,0,0)},[b,w,S,M,t,n,d,u,f,F]);const D=s(e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,o=e.clientY-t.top,{re:r,im:i}=F(n,o);return{re:r,im:i,iterations:f(r,i,d),event:e}},[F,f,d]),R=s(e=>{I.current=!0,A.current={x:e.clientX,y:e.clientY,rMin:b,rMax:w,iMin:S,iMax:M}},[b,w,S,M]),L=s(e=>{if(x&&x(D(e)),!I.current||!A.current)return;const o=A.current,r=e.clientX-o.x,i=e.clientY-o.y,l=(o.rMax-o.rMin)/t,a=(o.iMax-o.iMin)/n;v(o.rMin-r*l),k(o.rMax-r*l),$(o.iMin+i*a),z(o.iMax+i*a)},[t,n,x,D]),W=s(()=>{I.current=!1},[]),N=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15,n=e.target.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,{re:i,im:l}=F(o,r);v(i+(b-i)*t),k(i+(w-i)*t),$(l+(S-l)*t),z(l+(M-l)*t)},[F,b,w,S,M]),T=s(e=>{g&&g(D(e))},[g,D]),E=s(e=>{m&&m(D(e))},[m,D]),P=s(e=>{e.preventDefault(),y&&y(D(e))},[y,D]);return o("canvas",{ref:C,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:R,onMouseMove:L,onMouseUp:W,onMouseLeave:W,onWheel:N,onClick:T,onDblClick:E,onContextMenu:P})},exports.ContextMenu=Oe,exports.DataGrid=function(e){const{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:a,sortBy:c,sortDir:u,onSort:f,selectable:p=!1,selectedRows:h,onSelectionChange:g,striped:x=!1,bordered:m=!1,compact:y=!1,stickyHeader:b=!1}=e,[v,w]=l(0),[k,S]=l(void 0),[N,T]=l("asc"),[E,P]=l([]),[B,_]=l({}),H=i??v,Y=c??k,j=u??N,q=h??E,O=d(()=>{const e=Object.entries(B).filter(([,e])=>e.length>0);return 0===e.length?n:n.filter(t=>e.every(([e,n])=>String(t[e]??"").toLowerCase().includes(n.toLowerCase())))},[n,B]),U=d(()=>{if(!Y)return O;const e=[...O];return e.sort((e,t)=>{const n=e[Y],o=t[Y];if(null==n&&null==o)return 0;if(null==n)return 1;if(null==o)return-1;if("number"==typeof n&&"number"==typeof o)return"asc"===j?n-o:o-n;const r=String(n),i=String(o),l=r.localeCompare(i);return"asc"===j?l:-l}),e},[O,Y,j]),G=U.length,X=r?Math.max(1,Math.ceil(G/r)):1,V=r?U.slice(H*r,(H+1)*r):U,K=s(e=>{a?a(e):w(e)},[a]),Z=s(e=>{const t=Y===e&&"asc"===j?"desc":"asc";f?f(e,t):(S(e),T(t))},[Y,j,f]),J=s(e=>{const t=q.includes(e)?q.filter(t=>t!==e):[...q,e];g?g(t):P(t)},[q,g]),Q=s(()=>{const e=V.map((e,t)=>r?H*r+t:t),t=e.every(e=>q.includes(e))?q.filter(t=>!e.includes(t)):[...new Set([...q,...e])];g?g(t):P(t)},[V,q,r,H,g]),ee=s((e,t)=>{_(n=>({...n,[e]:t})),K(0)},[K]),te=t.some(e=>e.filterable),ne=y?"6px 8px":z.padding,oe=[];if(p){const e=V.map((e,t)=>r?H*r+t:t),t=e.length>0&&e.every(e=>q.includes(e));oe.push(o("th",{key:"__select_all",style:{...M,padding:ne,width:"40px",textAlign:"center",...b?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:t,onChange:Q,style:L,"aria-label":"Select all rows"})))}for(const e of t){const t={...M,padding:ne,...e.width?{width:e.width}:{},...e.sortable?{cursor:"pointer"}:{},...m?{border:"1px solid #e5e7eb"}:{},...b?{position:"sticky",top:"0",zIndex:"2"}:{}},n=[e.header];e.sortable&&n.push(o("span",{style:C},W(e.key,Y,j))),oe.push(o("th",{key:e.key,style:t,onClick:e.sortable?()=>Z(e.key):void 0,onKeyDown:e.sortable?t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),Z(e.key))}:void 0,tabIndex:e.sortable?0:void 0,role:e.sortable?"columnheader":void 0,"aria-sort":Y===e.key?"asc"===j?"ascending":"descending":void 0},...n))}let re=null;if(te){const e=[];p&&e.push(o("th",{key:"__filter_spacer",style:{padding:ne}}));for(const n of t)e.push(o("th",{key:`filter_${n.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},n.filterable?o("input",{type:"text",placeholder:`Filter ${n.header}...`,style:I,value:B[n.key]??"",onInput:e=>ee(n.key,e.target.value),"aria-label":`Filter by ${n.header}`}):null));re=o("tr",{key:"__filter_row"},...e)}const ie=[];for(let e=0;e<V.length;e++){const n=V[e],i=r?H*r+e:e,l=q.includes(i),a={};x&&e%2==1&&(a.backgroundColor="#f9fafb"),l&&(a.backgroundColor="#eff6ff");const s=[];p&&s.push(o("td",{key:"__select",style:{padding:ne,textAlign:"center",...z,...m?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:l,onChange:()=>J(i),style:L,"aria-label":`Select row ${i+1}`})));for(const e of t){const t=n[e.key],r=e.render?e.render(t,n):String(t??"");s.push(o("td",{key:e.key,style:{...z,padding:ne,...m?{border:"1px solid #e5e7eb"}:{}}},r))}ie.push(o("tr",{key:String(i),style:a},...s))}let le=null;if(r){const e=0===G?0:H*r+1,t=Math.min((H+1)*r,G),n=[];n.push(o("button",{key:"prev",style:0===H?R:F,onClick:H>0?()=>K(H-1):void 0,disabled:0===H,"aria-label":"Previous page"},"← Prev"));const i=7;let l=Math.max(0,H-Math.floor(i/2));const a=Math.min(X,l+i);a-l<i&&(l=Math.max(0,a-i)),l>0&&(n.push(o("button",{key:"p0",style:F,onClick:()=>K(0)},"1")),l>1&&n.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let e=l;e<a;e++)n.push(o("button",{key:`p${e}`,style:e===H?D:F,onClick:e!==H?()=>K(e):void 0,"aria-current":e===H?"page":void 0},String(e+1)));a<X&&(a<X-1&&n.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),n.push(o("button",{key:"p"+(X-1),style:F,onClick:()=>K(X-1)},String(X)))),n.push(o("button",{key:"next",style:H>=X-1?R:F,onClick:H<X-1?()=>K(H+1):void 0,disabled:H>=X-1,"aria-label":"Next page"},"Next →")),le=o("div",{style:A},o("span",null,`Showing ${e}–${t} of ${G}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...n))}const ae={width:"100%",...b?{overflow:"auto",maxHeight:"600px"}:{}},se={...$,...m?{border:"1px solid #e5e7eb"}:{}},de=o("thead",null,o("tr",null,...oe),re),ce=o("tbody",null,...ie),ue=o("table",{style:se,role:"grid","aria-rowcount":String(G)},de,ce);return o("div",{style:ae},ue,le)},exports.DatePicker=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:f="YYYY-MM-DD",minDate:p,maxDate:h,disabled:g=!1,placeholder:x="Select date...",label:m,error:y}=e,b=d(()=>de(r),[r]),v=d(()=>de(p),[p]),w=d(()=>de(h),[h]),[k,S]=l(!1),[$,M]=l(()=>b?b.getFullYear():(new Date).getFullYear()),[z,C]=l(()=>b?b.getMonth():(new Date).getMonth()),I=c(null),A=d(()=>new Date,[]);a(()=>{const e=e=>{I.current&&!I.current.contains(e.target)&&S(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const F=s(()=>{C(e=>0===e?(M(e=>e-1),11):e-1)},[]),D=s(()=>{C(e=>11===e?(M(e=>e+1),0):e+1)},[]),R=s(e=>{const t=new Date($,z,e);v&&t<v||w&&t>w||(i(function(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}(t)),S(!1))},[$,z,i,v,w]),L=b?function(e,t){const n=e.getFullYear(),o=e.getMonth()+1,r=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(o).padStart(2,"0")).replace("DD",String(r).padStart(2,"0"))}(b,f):"",W=d(()=>{const e=new Date($,z,1).getDay(),t=new Date($,z+1,0).getDate(),n=[];let o=[];for(let t=0;t<e;t++)o.push(null);for(let e=1;e<=t;e++)o.push(e),7===o.length&&(n.push(o),o=[]);for(;o.length>0&&o.length<7;)o.push(null);return o.length&&n.push(o),n},[$,z]),N={...ne({},{focused:k,error:!!y}),cursor:g?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},T={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},E=se.map(e=>o("div",{key:e,style:{padding:"4px"}},e)),P=W.map((e,t)=>{const n=e.map((e,n)=>{if(null===e)return o("div",{key:`empty-${t}-${n}`,style:{padding:"4px"}});const r=new Date($,z,e),i=ce(r,A),l=!!b&&ce(r,b),a=v&&r<v||w&&r>w;return o("div",{key:`day-${e}`,style:{padding:"4px",textAlign:"center",cursor:a?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:i?"700":"400",backgroundColor:l?"#3b82f6":"transparent",color:l?"#ffffff":a?"#d1d5db":i?"#3b82f6":"#1f2937",border:i&&!l?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"},onClick:a?void 0:()=>R(e),onKeyDown:a?void 0:t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),R(e))},role:a?void 0:"button",tabIndex:a?void 0:0,"aria-label":`${ae[z]} ${e}, ${$}`,"aria-disabled":a?"true":void 0},String(e))});return o("div",{key:`row-${t}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...n)}),B=k?o("div",{style:{position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"}},o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}},o("button",{type:"button",style:T,onClick:F},"◀"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${ae[z]} ${$}`),o("button",{type:"button",style:T,onClick:D},"▶")),o("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"}},...E),...P):null;return o(te,{label:m,error:y,disabled:g,htmlFor:n},o("div",{ref:I,style:{position:"relative"}},o("div",{id:n,style:N,onClick:g?void 0:()=>S(!k),onKeyDown:g?void 0:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),S(!k))},tabIndex:g?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":k?"true":"false"},o("span",{style:{color:L?"#1f2937":"#9ca3af"}},L||x),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"📅")),B))},exports.DecompositionTree=function(e){const{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:l=120,nodeHeight:a=40,showValues:c=!0,showConnectors:u=!0,connectorColor:f="#94a3b8",colors:p=Co,title:h,padding:g=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));const x="horizontal"===i,m=d(()=>function(e,t,n,o,r,i,l,a){const{flatNodes:s,maxDepth:d}=function(e){const t=[];let n=0;const o=[];o.push([e,0,null]);let r=0;for(;o.length>0;){const[e,i,l]=o.shift(),a=n++;r=Math.max(r,i);const s=e.children??[],d=[];for(let e=0;e<s.length;e++)d.push(n+o.length+e);t.push({id:a,node:e,depth:i,parentId:l,childIndices:d});for(let e=0;e<s.length;e++)o.push([s[e],i+1,a])}return{flatNodes:t,maxDepth:r}}(e);if(0===s.length)return[];const c=function(e){const t=e.length,n=new Array(t).fill(0);for(let o=t-1;o>=0;o--){const r=e[o];if(0===r.childIndices.length)n[o]=1;else{let e=0;for(const o of r.childIndices)o<t&&(e+=n[o]);n[o]=Math.max(e,1)}}return n}(s),u=t-2*i,f=n-2*i,p="horizontal"===l,h=d+1,g=p?h>1?(u-o)/d:0:h>1?(f-r)/d:0,x=new Array(s.length),m=c[0],y=p?f:u,b=m>0?y/m:y,v=new Array(s.length);v[0]=[0,m];const w=[0];let k=0;for(;k<w.length;){const e=w[k];k++;const t=s[e],[n,o]=v[e],r=(n+o)/2,l=i+t.depth*g,d=i+(r-.5)*b,u=p?l:d,f=p?d:l,h=t.node.color??a[t.depth%a.length];x[e]={id:t.id,label:t.node.label,value:void 0!==t.node.value?String(t.node.value):"",color:h,depth:t.depth,x:u,y:f,parentId:t.parentId,childCount:t.childIndices.length,subtreeLeafCount:c[e]};let m=n;for(const e of t.childIndices)if(e<s.length){const t=m+c[e];v[e]=[m,t],m=t,w.push(e)}}return x}(t,n,r,l,a,g,i,p),[t,n,r,l,a,g,i,p]),y=d(()=>{const e=new Map;for(let t=0;t<m.length;t++){const n=m[t];e.set(n.id,n)}return e},[m]),b=s(()=>{if(!u)return[];const e=[];for(let t=0;t<m.length;t++){const n=m[t];if(null===n.parentId)continue;const r=y.get(n.parentId);if(!r)continue;let i,s,d,c;x?(i=r.x+l,s=r.y+a/2,d=n.x,c=n.y+a/2):(i=r.x+l/2,s=r.y+a,d=n.x+l/2,c=n.y);const u=(i+d)/2,p=(s+c)/2;let h;h=x?`M ${i} ${s} C ${u} ${s}, ${u} ${c}, ${d} ${c}`:`M ${i} ${s} C ${i} ${p}, ${d} ${p}, ${d} ${c}`,e.push(o("path",{key:`conn-${t}`,d:h,fill:"none",stroke:f,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return e},[m,y,x,l,a,u,f]),v=s(()=>{const e=[];for(let t=0;t<m.length;t++){const n=m[t];e.push(o("rect",{key:`node-rect-${n.id}`,x:String(n.x),y:String(n.y),width:String(l),height:String(a),rx:"4",ry:"4",fill:n.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":n.value?`${n.label}: ${n.value}`:n.label}));const r=c&&n.value?n.y+a/2-2:n.y+a/2+4;e.push(o("text",{key:`node-label-${n.id}`,x:String(n.x+l/2),y:String(r),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},n.label)),c&&n.value&&e.push(o("text",{key:`node-value-${n.id}`,x:String(n.x+l/2),y:String(n.y+a/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},n.value))}return e},[m,l,a,c]),w=s(()=>h?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),k=b(),S=v(),$=w();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Decomposition tree",style:{fontFamily:"sans-serif"}},...$,...k,...S)},exports.DigitalClock=function(e){const{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:d}=e,[c,u]=l(new Date);a(()=>{const e=setInterval(()=>{u(new Date)},1e3);return()=>clearInterval(e)},[]);const{hours:f,minutes:p,seconds:h}=function(e,t){if(t){const n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),o=e=>Number(n.find(t=>t.type===e)?.value??0);return{hours:o("hour"),minutes:o("minute"),seconds:o("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}(c,s);let g,x=null;"12h"===t?(x=f>=12?"PM":"AM",g=f%12||12):g=f;let m=`${N(g)}:${N(p)}`;i&&(m+=`:${N(h)}`);const y=[m];null!=x&&y.push(o("span",{style:P},x));const b=[o("span",{style:E},...y)];return n&&b.push(o("span",{style:B},function(e,t,n){if(n){const o={timeZone:n};if("short"===t)return Object.assign(o,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);if("long"===t)return Object.assign(o,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",o).format(e);Object.assign(o,{year:"numeric",month:"2-digit",day:"2-digit"});const r=new Intl.DateTimeFormat("en-CA",o).formatToParts(e),i=e=>r.find(t=>t.type===e)?.value??"";return`${i("year")}-${i("month")}-${i("day")}`}return"short"===t?`${N(e.getMonth()+1)}/${N(e.getDate())}/${e.getFullYear()}`:"long"===t?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${N(e.getMonth()+1)}-${N(e.getDate())}`}(c,r,s))),o("div",{style:T,...d?{class:d}:{}},...b)},exports.DiscreteCartesian2D=function(e){const{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:l=1,cellRadius:a=0,showGrid:c=!1,gridColor:u="#334155",showIndices:f=!1,backgroundColor:p="#0f172a",padding:h=10,onCellClick:g,onCellHover:x,title:m}=e,y=n??wr,b=t.length,v=d(()=>{let e=0;for(let n=0;n<t.length;n++){const o=t[n];void 0!==o&&o.length>e&&(e=o.length)}return e},[t]),w=f?20:0,k=m?24:0,S=d(()=>{const e=r-2*h-w,t=i-2*h-w-k;return 0===b||0===v?{cellWidth:0,cellHeight:0}:{cellWidth:Math.max(0,(e-l*(v-1))/v),cellHeight:Math.max(0,(t-l*(b-1))/b)}},[r,i,h,b,v,l,w,k]),$=s(e=>{const t=y[e];return void 0!==t?t:"#666"},[y]),M=s(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:p}),[r,i,p]),z=s(()=>m?[o("text",{key:"title",x:String(r/2),y:String(h+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},m)]:[],[m,r,h]),C=s(()=>{if(!c||0===b||0===v)return[];const{cellWidth:e,cellHeight:t}=S,n=h+w,r=h+w+k,i=v*e+(v-1)*l,a=b*t+(b-1)*l,s=[];for(let t=0;t<=v;t++){const i=n+t*(e+l)-l/2;s.push(o("line",{key:`vgrid-${t}`,x1:String(i),y1:String(r-l/2),x2:String(i),y2:String(r+a+l/2),stroke:u,"stroke-width":"0.5"}))}for(let e=0;e<=b;e++){const a=r+e*(t+l)-l/2;s.push(o("line",{key:`hgrid-${e}`,x1:String(n-l/2),y1:String(a),x2:String(n+i+l/2),y2:String(a),stroke:u,"stroke-width":"0.5"}))}return s},[c,b,v,S,h,w,k,l,u]),I=s(()=>{if(!f||0===b||0===v)return[];const{cellWidth:e,cellHeight:t}=S,n=h+w,r=h+w+k,i=[];for(let t=0;t<v;t++){const a=n+t*(e+l)+e/2,s=r-6;i.push(o("text",{key:`col-idx-${t}`,x:String(a),y:String(s),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(t)))}for(let e=0;e<b;e++){const a=n-6,s=r+e*(t+l)+t/2+3;i.push(o("text",{key:`row-idx-${e}`,x:String(a),y:String(s),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(e)))}return i},[f,b,v,S,h,w,k,l]),A=s(()=>{if(0===b||0===v)return[];const{cellWidth:e,cellHeight:n}=S,r=h+w,i=h+w+k,s=[];for(let d=0;d<b;d++){const c=t[d];if(void 0!==c)for(let t=0;t<v;t++){const u=t<c.length?c[t]:0,f=r+t*(e+l),p=i+d*(n+l),h=$(u),m={key:`cell-${d}-${t}`,x:String(f),y:String(p),width:String(e),height:String(n),fill:h,rx:String(a),ry:String(a)};if(g){const e=d,n=t,o=u;m.onClick=()=>g(e,n,o),m.role="button",m.tabIndex=0}if(x){const e=d,n=t,o=u;m.onMouseEnter=()=>x(e,n,o)}s.push(o("rect",m))}}return s},[b,v,t,S,h,w,k,l,a,$,g,x]),F=M(),D=z(),R=C(),L=I(),W=A();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m?`${m} — ${b}x${v} discrete grid`:`${b}x${v} discrete grid`},F,...D,...R,...L,...W)},exports.Drawer=function(e){const{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:d=!0,closeOnOverlay:u=!0,closeOnEscape:f=!0,children:p}=e,[h,g]=l(!1),[x,m]=l(!1),y=c(null),b=s?"drawer-title":void 0;if(a(()=>{if(!t){m(!1);const e=setTimeout(()=>g(!1),300);return()=>clearTimeout(e)}g(!0),requestAnimationFrame(()=>m(!0))},[t]),a(()=>{if(!t||!f)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,f,n]),a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{t&&y.current&&y.current.focus()},[t]),!h)return null;const v={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:x?"1":"0",transition:"opacity 0.3s ease"},w={...Ge(r,i),transform:Ue(r,x),transition:"transform 0.3s ease"},k=[];s&&k.push(o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},o("h3",{id:b,style:{margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"}},s),o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},onClick:n,"aria-label":"Close drawer"},"×"))),k.push(o("div",{style:{padding:"20px",overflow:"auto",flex:"1"}},p));const S=[];return d&&S.push(o("div",{style:v,onClick:()=>{u&&n()}})),S.push(o("div",{ref:y,style:w,role:"dialog","aria-modal":"true","aria-labelledby":b,tabIndex:-1},...k)),o("div",null,...S)},exports.Dropdown=function(e){const{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:d={},placement:u="bottom-start",closeOnSelect:f=!0,width:p="220px"}=e,[h,g]=l(!1),x=c(null),m=s(()=>{g(e=>!e)},[]),y=s(()=>{g(!1)},[]);a(()=>{if(!h)return;const e=e=>{const t=x.current;t&&!t.contains(e.target)&&g(!1)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[h]),a(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&g(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[h]);const b=o("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},onClick:m,"aria-haspopup":"true","aria-expanded":String(h)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:h?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"▼")),v={position:"absolute",top:"100%",..."bottom-end"===u?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},w={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:"number"==typeof p?`${p}px`:p,backgroundColor:"#ffffff",...i??{}},k=h?o("div",{style:v},o(ke,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:w},...n.map(e=>o(Ie,{key:e.id,item:e,itemStyle:d,closeOnSelect:f,onClose:y})))):null;return o("div",{ref:x,style:{position:"relative",display:"inline-block"}},b,k)},exports.EmptyState=function(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)},exports.FileUpload=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:a=!1,maxSize:d,disabled:f=!1,label:p,helpText:h}=e,[g,x]=l([]),[m,y]=l(!1),[b,v]=l(""),w=c(null),k=s(e=>{v("");const t=[];for(const n of e)d&&n.size>d?v(`File "${n.name}" exceeds maximum size of ${ue(d)}`):t.push(n);const n=a?[...g,...t]:t.slice(0,1);x(n),r(n)},[g,a,d,r]),S=s(e=>{if(e.preventDefault(),e.stopPropagation(),y(!1),f)return;const t=e.dataTransfer;if(!t)return;const n=Array.from(t.files);k(n)},[f,k]),$=s(e=>{e.preventDefault(),e.stopPropagation(),f||y(!0)},[f]),M=s(e=>{e.preventDefault(),e.stopPropagation(),y(!1)},[]),z=s(e=>{const t=e.target;t.files&&(k(Array.from(t.files)),t.value="")},[k]),C=s(e=>{const t=g.filter((t,n)=>n!==e);x(t),r(t)},[g,r]),I=s(()=>{f||w.current&&w.current.click()},[f]),A={border:"2px dashed "+(m?"#3b82f6":b?"#ef4444":"#d1d5db"),borderRadius:"8px",padding:"24px",textAlign:"center",cursor:f?"not-allowed":"pointer",backgroundColor:m?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:f?"0.6":"1"},F={fontSize:"12px",color:"#9ca3af"},D=o("input",{id:n,ref:w,type:"file",accept:i,multiple:a,onChange:z,disabled:f,style:{display:"none"},tabIndex:-1}),R=o("div",{style:A,onClick:I,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),I())},onDrop:S,onDragOver:$,onDragLeave:M,role:"button",tabIndex:f?-1:0,"aria-label":"Upload files"},o("div",{style:{fontSize:"28px",color:"#9ca3af",marginBottom:"8px"}},"↑"),o("div",{style:{fontSize:"14px",color:"#374151",marginBottom:"4px"}},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:F},i):null,d?o("div",{style:F},`Max size: ${ue(d)}`):null),L=g.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...g.map((e,t)=>o("div",{key:`file-${t}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"}},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},e.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},ue(e.size))),o("button",{type:"button",style:{background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"},onClick:e=>{e.stopPropagation(),C(t)},"aria-label":`Remove ${e.name}`},"✕")))):null;return o(te,{label:p,helpText:h,error:b||void 0,disabled:f,htmlFor:n},o("div",null,D,R,L))},exports.FlexContainer=function(e){const t=d(()=>{const t={display:e.inline?"inline-flex":"flex"};return e.direction&&(t.flexDirection=e.direction),e.wrap&&(t.flexWrap=e.wrap),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyContent&&(t.justifyContent=e.justifyContent),{...t,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)},exports.FlexItem=function(e){const t=d(()=>{const t={};return e.flex&&(t.flex=e.flex),void 0!==e.grow&&(t.flexGrow=String(e.grow)),void 0!==e.shrink&&(t.flexShrink=String(e.shrink)),e.basis&&(t.flexBasis=e.basis),e.alignSelf&&(t.alignSelf=e.alignSelf),void 0!==e.order&&(t.order=String(e.order)),{...t,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)},exports.Footer=function(e){const{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:l="var(--color-bg, transparent)",color:a="var(--color-text-muted, #64748b)",fontSize:s="13px",padding:d="24px",maxWidth:c="1200px",className:u,ariaLabel:f="Site footer"}=e;return o("footer",{className:u,role:"contentinfo","aria-label":f,style:{borderTop:i,background:l,color:a,fontSize:s,padding:d,marginTop:"48px"}},o("div",{style:{maxWidth:c,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))},exports.ForceGraph=function(e){const{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:u=12,nodeStrokeWidth:f=2,solidNodes:p=!0,showLabels:h=!0,showArrows:g=!1,repulsionForce:x=300,attractionForce:m=.01,damping:y=.9,edgeLength:b=100,edgeColor:v="#94a3b8",edgeWidth:w=1.5,title:k,customForce:S,trails:$}=e;if(!t||0===t.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":k??"Empty force-directed graph"},k?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},k):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));const M=c(Fo(t,r,i)),[z,C]=l(0),I=c(!0),A=c(!1),F=c(n);F.current=n;const D=c(S);D.current=S;const R=c(null),L=c({repulsionForce:x,attractionForce:m,damping:y,edgeLength:b,width:r,height:i,nodeRadius:u,solidNodes:p});L.current={repulsionForce:x,attractionForce:m,damping:y,edgeLength:b,width:r,height:i,nodeRadius:u,solidNodes:p};const W=c(new Map);a(()=>{M.current=Fo(t,r,i),A.current=!1,I.current=!0,W.current=new Map,C(e=>e+1)},[t.length]),a(()=>{let e=0;const t=()=>{if(!I.current)return;const n=L.current,o=D.current;let r;if(o?(r=o(M.current,F.current,n.width,n.height,R.current),n.solidNodes&&Do(r,n.nodeRadius)):r=function(e,t,n,o,r,i,l,a,s=12){const d=e.length;if(0===d)return e;const c=new Map;for(let t=0;t<d;t++)c.set(e[t].id,t);const u=new Float64Array(d),f=new Float64Array(d);for(let t=0;t<d;t++){const n=e[t];for(let o=t+1;o<d;o++){const i=e[o];let l=n.x-i.x,a=n.y-i.y,s=l*l+a*a;s<1&&(s=1);const d=Math.sqrt(s),c=r/s,p=l/d*c,h=a/d*c;u[t]+=p,f[t]+=h,u[o]-=p,f[o]-=h}}for(let n=0;n<t.length;n++){const o=t[n],r=c.get(o.source),l=c.get(o.target);if(void 0===r||void 0===l)continue;const s=e[r],d=e[l],p=d.x-s.x,h=d.y-s.y,g=Math.sqrt(p*p+h*h);if(g<.1)continue;const x=i*(g-a)*(o.weight??1),m=p/g*x,y=h/g*x;u[r]+=m,f[r]+=y,u[l]-=m,f[l]-=y}const p=n/2,h=o/2;for(let t=0;t<d;t++){const n=e[t];u[t]+=.001*(p-n.x),f[t]+=.001*(h-n.y)}const g=[];for(let t=0;t<d;t++){const r=e[t];if(r.fixed){g.push({...r,vx:0,vy:0});continue}let i=(r.vx+u[t])*l,a=(r.vy+f[t])*l;const s=Math.sqrt(i*i+a*a),d=10;s>d&&(i=i/s*d,a=a/s*d);let c=r.x+i,p=r.y+a;c=Math.max(20,Math.min(n-20,c)),p=Math.max(20,Math.min(o-20,p)),g.push({...r,x:c,y:p,vx:i,vy:a})}return Do(g,s),g}(M.current,F.current,n.width,n.height,n.repulsionForce,n.attractionForce,n.damping,n.edgeLength,n.nodeRadius),M.current=r,$)for(let e=0;e<$.length;e++){const t=$[e],n=r.find(e=>e.id===t.nodeId);if(!n)continue;let o=W.current.get(t.nodeId);o||(o=[],W.current.set(t.nodeId,o)),o.push({x:n.x,y:n.y});const i=t.maxPoints??200;o.length>i&&o.splice(0,o.length-i)}if(!o&&function(e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];t+=o.vx*o.vx+o.vy*o.vy}return t}(r)<.01)return A.current=!0,void C(e=>e+1);C(e=>e+1),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>{I.current=!1,cancelAnimationFrame(e)}},[]);const N=M.current,T=s(e=>{M.current=M.current.map(t=>t.id===e?{...t,fixed:!t.fixed,vx:0,vy:0}:t),A.current&&(A.current=!1,I.current=!0,C(e=>e+1))},[]),E=c(null),P=c(null),B=s(e=>{const t=e,n=P.current;if(!n)return{x:t.clientX,y:t.clientY};const o=n.getBoundingClientRect(),l=r/o.width,a=i/o.height;return{x:(t.clientX-o.left)*l,y:(t.clientY-o.top)*a}},[r,i]),_=c(!1),H=s((e,t)=>{t.stopPropagation(),E.current=e;const n=M.current.find(t=>t.id===e);_.current=n?.fixed??!1,M.current=M.current.map(t=>t.id===e?{...t,fixed:!0,vx:0,vy:0}:t)},[]),Y=s(e=>{const t=B(e);if(R.current={x:t.x,y:t.y},!E.current)return;const n=E.current;M.current=M.current.map(e=>e.id===n?{...e,x:Math.max(20,Math.min(r-20,t.x)),y:Math.max(20,Math.min(i-20,t.y))}:e),A.current&&(A.current=!1,I.current=!0),C(e=>e+1)},[r,i,B]),j=s(()=>{const e=E.current;e&&(M.current=M.current.map(t=>t.id===e?{...t,fixed:_.current}:t)),E.current=null},[]),q=s(()=>{E.current=null,R.current=null},[]),O=d(()=>{const e=new Map;for(let t=0;t<N.length;t++)e.set(N[t].id,N[t]);return e},[z]),U=s(()=>g?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+u),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:v})))]:[],[g,u,v]),G=s(()=>{const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=O.get(r.source),l=O.get(r.target);if(!i||!l)continue;if(void 0!==r.weight&&r.weight<=0)continue;const a=r.weight?Math.max(.5,Math.min(6,w*r.weight)):w,s={key:`edge-${t}`,x1:String(i.x),y1:String(i.y),x2:String(l.x),y2:String(l.y),stroke:r.color??v,"stroke-width":String(a),"stroke-opacity":"0.6"};g&&(s["marker-end"]="url(#arrowhead)"),e.push(o("line",s))}return e},[z,v,w,g]),X=s(()=>{const e=[];for(let t=0;t<N.length;t++){const n=N[t];e.push(o("circle",{key:`node-${n.id}`,cx:String(n.x),cy:String(n.y),r:String(u),fill:n.color,stroke:n.fixed?"#0f172a":"#fff","stroke-width":n.fixed?"3":String(f),style:{cursor:E.current===n.id?"grabbing":"grab"},onMouseDown:e=>H(n.id,e),onDblClick:()=>T(n.id),role:"button",tabIndex:0,"aria-label":`Node: ${n.label}${n.fixed?" (locked)":""} — drag to move, double-click to lock`})),h&&e.push(o("text",{key:`label-${n.id}`,x:String(n.x),y:String(n.y+u+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},n.label))}return e},[z,u,h,T]),V=s(()=>k?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},k)]:[],[k,r]),K=s(()=>{if(!$||0===$.length)return[];const e=[];for(let t=0;t<$.length;t++){const n=$[t],r=W.current.get(n.nodeId);if(!r||r.length<2)continue;const i=[];for(let e=0;e<r.length;e++){const t=r[e];i.push(`${0===e?"M":"L"}${t.x.toFixed(1)},${t.y.toFixed(1)}`)}e.push(o("path",{key:`trail-${n.nodeId}`,d:i.join(" "),fill:"none",stroke:n.color??"#3b82f6","stroke-width":String(n.width??1),opacity:String(n.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return e},[z,$]),Z=U(),J=K(),Q=G(),ee=X(),te=V();return o("svg",{ref:P,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":k??"Force-directed graph — drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:E.current?"grabbing":"default"},onMouseMove:Y,onMouseUp:j,onMouseLeave:q},...Z,...te,...J,...Q,...ee)},exports.FormFieldWrapper=te,exports.FunnelChart=function(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:l=!0,showValues:a=!0,showPercentage:c=!0,gapSize:u=2,colors:f=Ro,title:p}=e,h="vertical"===i,g=p?30:0,x=d(()=>{let e=0;for(let n=0;n<t.length;n++)t[n].value>e&&(e=t[n].value);return e>0?e:1},[t]),m=s(e=>0===x?0:Math.max(.05,e/x),[x]),y=s((e,t)=>t||(f[e%f.length]??Ro[0]),[f]),b=s(()=>{if(0===t.length)return[];const e=[],i=n-80-120,s=r-g-80,d=u*(t.length-1),f=Math.max(1,(s-d)/t.length),p=40+i/2;for(let n=0;n<t.length;n++){const r=t[n],s=n<t.length-1?t[n+1]:null,d=y(n,r.color),h=m(r.value),x=i/2*h,b=i/2*(null!==s?m(s.value):.6*h),v=g+40+n*(f+u),w=`${p-x},${v} ${p+x},${v} ${p+b},${v+f} ${p-b},${v+f}`;e.push(o("polygon",{key:`section-${n}`,points:w,fill:d,stroke:"#fff","stroke-width":"1"}));const k=40+i+12,S=v+f/2;if(l&&e.push(o("text",{key:`label-${n}`,x:String(k),y:String(S-(a||c?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},r.label)),a||c){let i="";if(a&&(i=String(r.value)),c&&t.length>0){const e=t[0].value,n=e>0?Math.round(r.value/e*100):0;i+=a?` (${n}%)`:`${n}%`}e.push(o("text",{key:`value-${n}`,x:String(k),y:String(S+(l?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},i))}}return e},[t,n,r,g,u,l,a,c,y,m,120]),v=s(()=>{if(0===t.length)return[];const e=[],i=n-80,s=r-g-80-40,d=u*(t.length-1),f=Math.max(1,(i-d)/t.length),p=g+40+s/2;for(let n=0;n<t.length;n++){const r=t[n],i=n<t.length-1?t[n+1]:null,d=y(n,r.color),h=m(r.value),x=s/2*h,b=s/2*(null!==i?m(i.value):.6*h),v=40+n*(f+u),w=`${v},${p-x} ${v+f},${p-b} ${v+f},${p+b} ${v},${p+x}`;e.push(o("polygon",{key:`section-${n}`,points:w,fill:d,stroke:"#fff","stroke-width":"1"}));const k=v+f/2,S=g+40+s+14;if(l&&e.push(o("text",{key:`label-${n}`,x:String(k),y:String(S),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},r.label)),a||c){let i="";if(a&&(i=String(r.value)),c&&t.length>0){const e=t[0].value,n=e>0?Math.round(r.value/e*100):0;i+=a?` (${n}%)`:`${n}%`}e.push(o("text",{key:`value-${n}`,x:String(k),y:String(S+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},i))}}return e},[t,n,r,g,u,l,a,c,y,m]),w=s(()=>p?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n]),k=s(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),S=w(),$=h?b():v(),M=k();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Funnel chart",style:{fontFamily:"sans-serif"}},...S,...$,...M)},exports.GanttChart=function(e){const{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:l=8,showGrid:a=!0,showLabels:c=!0,showProgress:u=!1,timeUnit:f="days",title:p,padding:h=50}=e;if(0===t.length)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));const g=c?120:0,x=d(()=>{let e=1/0,n=-1/0;for(const o of t){o.start<e&&(e=o.start);const t=o.start+o.duration;t>n&&(n=t)}return e===1/0&&(e=0,n=1),{min:e,max:n,range:n-e}},[t]),m=d(()=>{const e=t.slice();return e.sort((e,t)=>e.group!==t.group?(e.group??"").localeCompare(t.group??""):e.start-t.start),e},[t]),y=r??2*h+m.length*(i+l)+l+20,b=n-h-g-h,v=h+(p?20:0),w=s(e=>0===x.range?g+h:g+h+(e-x.min)/x.range*b,[x,b,g,h]),k=s(()=>{if(!a)return[];const e=[],t=Wo(x.range),n=Math.ceil(x.min/t)*t,r=v+m.length*(i+l)+l;for(let i=n;i<=x.max;i+=t){const t=w(i);e.push(o("line",{key:`grid-${i}`,x1:String(t),y1:String(v),x2:String(t),y2:String(r),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return e},[a,x,v,m.length,i,l,w]),S=s(()=>{const e=[],t=Wo(x.range),r=Math.ceil(x.min/t)*t,i=v-8;for(let n=r;n<=x.max;n+=t){const t=w(n);e.push(o("text",{key:`taxis-${n}`,x:String(t),y:String(i),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(n)))}return e.push(o("text",{key:"time-unit",x:String(n-h),y:String(i),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},f)),e},[x,v,w,f,n,h]),$=s(()=>{const e=[];let t="";for(let n=0;n<m.length;n++){const r=m[n],a=v+n*(i+l)+l,s=w(r.start),d=Math.max(2,w(r.start+r.duration)-s),f=No(n,r.color);r.group&&r.group!==t&&(t=r.group,c&&e.push(o("text",{key:`group-${n}`,x:String(h),y:String(a+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},r.group))),e.push(o("rect",{key:`bar-${r.id}`,x:String(s),y:String(a),width:String(d),height:String(i),rx:"4",ry:"4",fill:f,role:"graphics-symbol","aria-label":`${r.label}: start ${r.start}, duration ${r.duration}`})),c&&e.push(o("text",{key:`label-${r.id}`,x:String(g+h-8),y:String(a+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},r.label.length>16?r.label.substring(0,14)+"..":r.label)),u&&d>30&&e.push(o("text",{key:`prog-${r.id}`,x:String(s+d/2),y:String(a+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${r.start}-${r.start+r.duration}`))}return e},[m,v,i,l,w,c,u,g,h]),M=s(()=>p?[o("text",{key:"title",x:String(n/2),y:String(h/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},p)]:[],[p,n,h]),z=k(),C=S(),I=$(),A=M();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Gantt chart",style:{fontFamily:"sans-serif"}},...A,...z,...C,...I)},exports.Gauge=function(e){const{value:t,min:n=0,max:r=100,width:i=300,height:l=200,startAngle:a=-135,endAngle:d=135,arcWidth:c=20,showValue:u=!0,showMinMax:f=!0,showTicks:p=!0,tickCount:h=10,label:g,unit:x,colors:m=["#22c55e","#f59e0b","#ef4444"],needleColor:y="#374151",backgroundColor:b="#e5e7eb"}=e,v=isFinite(n)&&!isNaN(n)?n:0,w=isFinite(r)&&!isNaN(r)&&r>v?r:v+100,k=isFinite(t)&&!isNaN(t)?function(e,t,n){return e<t?t:e>n?n:e}(t,v,w):v,S=(u?24:0)+(g?18:0),$=i/2,M=.6*(l-S),z=Math.min(i/2,.55*(l-S))-c/2-10,C=z-c,I=z-c/2,A=d-a,F=s(e=>{const t=w-v;return 0===t?a:a+(e-v)/t*A},[v,w,a,A]),D=s(()=>[o("path",{key:"bg-arc",d:Po($,M,I,a,d),fill:"none",stroke:b,"stroke-width":String(c),"stroke-linecap":"round"})],[$,M,I,a,d,b,c]),R=s(()=>{if(0===m.length)return[];const e=[],t=A/m.length;for(let n=0;n<m.length;n++){const r=a+n*t,i=Po($,M,I,r,r+t);e.push(o("path",{key:`seg-${n}`,d:i,fill:"none",stroke:m[n],"stroke-width":String(c),"stroke-linecap":0===n||n===m.length-1?"round":"butt",opacity:"0.85"}))}return e},[m,A,a,$,M,I,c]),L=s(()=>{if(!p||h<=0)return[];const e=[],t=Math.max(1,Math.min(h,100));for(let n=0;n<=t;n++){const r=n/t,i=a+r*A,l=n%2==0,s=l?10:6,d=Eo($,M,z+4,i),c=Eo($,M,z+4+s,i);if(e.push(o("line",{key:`tick-${n}`,x1:String(d.x),y1:String(d.y),x2:String(c.x),y2:String(c.y),stroke:"currentColor",opacity:"0.4","stroke-width":l?"2":"1"})),l){const t=v+r*(w-v),l=Eo($,M,z+4+s+12,i);e.push(o("text",{key:`tick-label-${n}`,x:String(l.x),y:String(l.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Bo(t)))}}return e},[p,h,a,A,$,M,z,v,w]),W=s(()=>{const e=[],t=F(k),n=Eo($,M,C-8,t),r=t-90,i=Eo($,M,6,t+90),l=Eo($,M,6,r);return e.push(o("polygon",{key:"needle",points:`${n.x},${n.y} ${i.x},${i.y} ${l.x},${l.y}`,fill:y,stroke:"none"})),e.push(o("circle",{key:"needle-cap",cx:String($),cy:String(M),r:"8",fill:y,stroke:"#fff","stroke-width":"2"})),e},[k,F,$,M,C,y]),N=s(()=>{if(!u)return[];const e=[],t=Bo(k),n=t+(x?" "+x:""),r=M+I+20;return e.push(o("text",{key:"value-text",x:String($),y:String(r),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${n}`},t,x?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+x):null)),e},[u,k,x,$,M,I]),T=s(()=>{if(!g)return[];const e=M+I+(u?40:20);return[o("text",{key:"label",x:String($),y:String(e),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},g)]},[g,$,M,I,u]),E=s(()=>{if(!f)return[];const e=[],t=Eo($,M,I,a),n=Eo($,M,I,d);return e.push(o("text",{key:"min-label",x:String(t.x-4),y:String(t.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Bo(v))),e.push(o("text",{key:"max-label",x:String(n.x+4),y:String(n.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Bo(w))),e},[f,$,M,I,a,d,v,w]),P=D(),B=R(),_=L(),H=W(),Y=N(),j=T(),q=E(),O=`Gauge: ${Bo(k)}${x?" "+x:""}, range ${Bo(v)} to ${Bo(w)}${g?", "+g:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(k),"aria-valuemin":String(v),"aria-valuemax":String(w),"aria-label":O,style:{fontFamily:"sans-serif"}},...P,...B,..._,...H,...Y,...j,...q)},exports.GoogleAnalytics=function(e){const{measurementId:t,disabled:n=!1,debug:o=!1,anonymizeIp:r=!1,config:i}=e;return a(()=>{if(n||"undefined"==typeof window)return;!function(e){if("undefined"==typeof document)return;const t="specifyjs-gtag";if(document.getElementById(t))return;const n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}(t),"undefined"!=typeof window&&(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)));const e={...i};return r&&(e.anonymize_ip=!0),o&&(e.debug_mode=!0),window.gtag&&window.gtag("config",t,e),()=>{const e=document.getElementById("specifyjs-gtag");e&&e.remove()}},[t,n,o,r]),null},exports.Grid=function(e){const t=d(()=>{const t={display:"grid"};return e.minColWidth?t.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:void 0!==e.columns&&(t.gridTemplateColumns="number"==typeof e.columns?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(t.gridTemplateRows=e.rows),e.gap&&(t.gap=e.gap),e.alignItems&&(t.alignItems=e.alignItems),e.justifyItems&&(t.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(t.gridTemplateAreas=e.areas.map(e=>`"${e}"`).join(" ")),{...t,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)},exports.GridItem=function(e){const t=d(()=>{const t={};return e.gridColumn&&(t.gridColumn=e.gridColumn),e.gridRow&&(t.gridRow=e.gridRow),e.gridArea&&(t.gridArea=e.gridArea),e.alignSelf&&(t.alignSelf=e.alignSelf),e.justifySelf&&(t.justifySelf=e.justifySelf),{...t,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)},exports.HeatMap=function(e){const{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:l=400,colorScale:a=qo,minValue:c,maxValue:u,showValues:f=!1,cellBorderColor:p="#fff",cellBorderWidth:h=1,title:g,padding:x=60}=e,m=t.length,y=d(()=>{let e=0;for(const n of t)n.length>e&&(e=n.length);return e},[t]),{minVal:b,maxVal:v}=d(()=>{let e=c??1/0,n=u??-1/0;for(const o of t)for(const t of o)void 0===c&&t<e&&(e=t),void 0===u&&t>n&&(n=t);return e===1/0&&(e=0),n===-1/0&&(n=1),e===n&&(n=e+1),{minVal:e,maxVal:n}},[t,c,u]),w=g?30:0,k=n?x:20,S=y>0?(i-k-20)/y:0,$=m>0?(l-w-(r?x:20)-20)/m:0,M=s(()=>{const e=[];for(let n=0;n<m;n++){const r=t[n];for(let t=0;t<y;t++){const i=t<r.length?r[t]:0,l=Yo((i-b)/(v-b),a),s=k+t*S,d=w+20+n*$;if(e.push(o("rect",{key:`cell-${n}-${t}`,x:String(s),y:String(d),width:String(S),height:String($),fill:l,stroke:p,"stroke-width":String(h)})),f){const r=jo(l)>.5?"#111827":"#ffffff";e.push(o("text",{key:`val-${n}-${t}`,x:String(s+S/2),y:String(d+$/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,.3*S,.4*$)),"font-family":"sans-serif",fill:r},String(Math.round(100*i)/100)))}}}return e},[t,m,y,b,v,a,S,$,k,w,f,p,h]),z=s(()=>{const e=[];if(n)for(let t=0;t<m;t++){const r=t<n.length?n[t]:"",i=w+20+t*$+$/2;e.push(o("text",{key:`row-label-${t}`,x:String(k-8),y:String(i),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},r))}if(r)for(let t=0;t<y;t++){const n=t<r.length?r[t]:"",i=k+t*S+S/2,l=w+20+m*$+16;e.push(o("text",{key:`col-label-${t}`,x:String(i),y:String(l),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}return e},[n,r,m,y,S,$,k,w]),C=s(()=>g?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},g)]:[],[g,i]);if(0===m||0===y)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Heat map — no data"},o("text",{x:String(i/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));const I=C(),A=M(),F=z();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Heat map",style:{fontFamily:"sans-serif"}},...I,...A,...F)},exports.Histogram=function(e){const{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:l="#3b82f6",barGap:a=2,showGrid:c=!0,showValues:u=!0,title:f,xLabel:p,yLabel:h,padding:g=60}=e,x=Math.max(1,Math.round(n)),m=d(()=>function(e,t){if(0===e.length)return[];let n=e[0],o=e[0];for(let t=1;t<e.length;t++){const r=e[t];r<n&&(n=r),r>o&&(o=r)}if(n===o)return[{min:n,max:o+1,count:e.length}];const r=(o-n)/t,i=[];for(let e=0;e<t;e++)i.push({min:n+e*r,max:n+(e+1)*r,count:0});for(let o=0;o<e.length;o++){const l=e[o];let a=Math.floor((l-n)/r);a>=t&&(a=t-1),i[a].count++}return i}(t,x),[t,x]),y=d(()=>{let e=0;for(let t=0;t<m.length;t++)m[t].count>e&&(e=m[t].count);return e>0?e:1},[m]),b=r-2*g,v=i-2*g,w=s(()=>{if(!c)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(y),t=[];for(let n=e;n<=y;n+=e){const e=g+v-n/y*v;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(e),x2:String(g+b),y2:String(e),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(e+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}return t},[c,y,g,b,v]),k=s(()=>{const e=[];return e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+v),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+v),x2:String(g+b),y2:String(g+v),stroke:"#374151","stroke-width":"1.5"})),e},[g,b,v]),S=s(()=>{if(0===m.length)return[];const e=[],t=a*(m.length-1),n=Math.max(1,(b-t)/m.length);for(let t=0;t<m.length;t++){const r=m[t],i=r.count/y*v,s=g+t*(n+a),d=g+v-i;if(e.push(o("rect",{key:`bar-${t}`,x:String(s),y:String(d),width:String(n),height:String(i),fill:l})),u&&r.count>0&&e.push(o("text",{key:`val-${t}`,x:String(s+n/2),y:String(d-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(r.count))),m.length<=15||t%2==0||t===m.length-1){const i=(m.length,Oo(r.min));e.push(o("text",{key:`xlabel-${t}`,x:String(s+n/2),y:String(g+v+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},i))}}if(m.length>0){const t=m[m.length-1],n=g+b;e.push(o("text",{key:"xlabel-end",x:String(n),y:String(g+v+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},Oo(t.max)))}return e},[m,y,a,l,u,g,b,v]),$=s(()=>{const e=[];return f&&e.push(o("text",{key:"title",x:String(r/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f)),p&&e.push(o("text",{key:"x-label",x:String(g+b/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},p)),h&&e.push(o("text",{key:"y-label",x:String(14),y:String(g+v/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${g+v/2})`},h)),e},[f,p,h,r,i,g,b,v]),M=s(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),z=w(),C=k(),I=S(),A=$(),F=M();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Histogram",style:{fontFamily:"sans-serif"}},...A,...z,...C,...I,...F)},exports.HypercubeGraph=function(e){const t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,u=e.edgeWidth??3,f=e.edgeColor??"#111",p=e.perspective??.25,h=e.rotationSpeed??.008,g=e.showLabels??!1,x=e.backgroundColor??"transparent",m=e.scale??.3*Math.min(n,r),y=Lt(t),b=1<<t,v=d(()=>"auto"===e.vertexColors||void 0===e.vertexColors?Wt(b):e.vertexColors,[b,e.vertexColors]),[w,k]=l(()=>{const e=[];for(let t=0;t<y;t++)e.push(0);return e}),[S,$]=l(!1),M=c({x:0,y:0}),z=c([]),C=c(0);a(()=>{if(0===h)return;let e=!0;const t=()=>{e&&(k(e=>{const t=e.slice();for(let e=0;e<t.length;e++)t[e]=(t[e]??0)+h*(1+.3*e);return t}),C.current=requestAnimationFrame(t))};return C.current=requestAnimationFrame(t),()=>{e=!1,cancelAnimationFrame(C.current)}},[h]);const I=d(()=>Rt(t,w,p,m),[t,w,p,m]),A=n/2,F=r/2,D=d(()=>I.edges.map(e=>{const t=I.vertices[e.source],n=I.vertices[e.target],o=(t.depth+n.depth)/2;return{...e,avgDepth:o,sv:t,tv:n}}).sort((e,t)=>e.avgDepth-t.avgDepth),[I]),R=d(()=>I.vertices.slice().sort((e,t)=>e.depth-t.depth),[I]),L=s(e=>{const t=e;$(!0),M.current={x:t.clientX,y:t.clientY},z.current=w.slice()},[w]),W=s(e=>{if(!S)return;const t=e,n=.01*(t.clientX-M.current.x),o=.01*(t.clientY-M.current.y);k(()=>{const e=z.current.slice();return e.length>0&&(e[0]=(e[0]??0)+n),e.length>1&&(e[1]=(e[1]??0)+o),e})},[S]),N=s(()=>{$(!1)},[]),T=D.map((e,t)=>{const n=(e=>{const t=(e+2)/4;return.3+.7*Math.max(0,Math.min(1,t))})(e.avgDepth);return o("line",{key:`e-${e.source}-${e.target}`,x1:String(A+e.sv.x),y1:String(F+e.sv.y),x2:String(A+e.tv.x),y2:String(F+e.tv.y),stroke:f,"stroke-width":String(u),"stroke-opacity":String(n),"stroke-linecap":"round"})}),E=R.map(e=>{const n=i*(e=>{const t=(e+2)/4;return.6+.4*Math.max(0,Math.min(1,t))})(e.depth),r=v[e.id%v.length]??"#3b82f6",l=[o("circle",{key:`v-${e.id}-circle`,cx:String(A+e.x),cy:String(F+e.y),r:String(n),fill:r,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return g&&l.push(o("text",{key:`v-${e.id}-label`,x:String(A+e.x),y:String(F+e.y+n+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},e.id.toString(2).padStart(t,"0"))),l});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:x,cursor:S?"grabbing":"grab",userSelect:"none"},onMouseDown:L,onMouseMove:W,onMouseUp:N,onMouseLeave:N},...T,...E.flat())},exports.IDE=Rn,exports.Image=function(e){const[t,n]=l("loading"),r=c(null),i=u().replace(/[^a-zA-Z0-9_-]/g,""),s=!1!==e.lazy,f="number"==typeof e.width?`${e.width}px`:e.width,p="number"==typeof e.height?`${e.height}px`:e.height;a(()=>{n("loading")},[e.src]);const h=d(()=>{const t={display:"inline-block",position:"relative",overflow:"hidden"};return f&&(t.width=f),p&&(t.height=p),e.borderRadius&&(t.borderRadius=e.borderRadius),t},[f,p,e.borderRadius]),g=d(()=>{const n={display:"block",width:"100%",height:"100%"};return e.objectFit&&(n.objectFit=e.objectFit),"loading"===t&&(n.opacity="0",n.position="absolute"),"error"===t&&(n.display="none"),n},[e.objectFit,t]);let x=null;"loading"===t&&("skeleton"===e.placeholder?x=o("div",null,o("style",null,`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`),o("div",{style:{width:f??"100%",height:p??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}})):"blur"===e.placeholder?x=o("div",{style:{width:f??"100%",height:p??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):null!=e.placeholder&&!1!==e.placeholder&&(x=e.placeholder));let m=null;"error"===t&&null!=e.fallback&&(m="string"==typeof e.fallback?o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):e.fallback);const y=o("div",{style:h},x,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:g,onload:()=>n("loaded"),onerror:()=>n("error")}),m);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},y,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):y},exports.LineGraph=function(e){const{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:l=2,pointRadius:a=4,pointColor:s="#3b82f6",pointShape:c="circle",showPoints:u=!0,showGrid:f=!0,showArea:p=!1,areaColor:h="rgba(59,130,246,0.15)",xLabel:g,yLabel:x,title:m,padding:y=50,animate:b=!1,multiLine:v}=e,w=mt(d(()=>{const e=[...t];if(v)for(const t of v)e.push(...t.data);return e},[t,v]),n,r,y),{xScale:k,yScale:S,xTicks:$,yTicks:M}=w,z=[];if(z.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),f){for(let e=0;e<$.length;e++){const t=k($[e]);z.push(o("line",{x1:t,y1:y,x2:t,y2:r-y,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${e}`}))}for(let e=0;e<M.length;e++){const t=S(M[e]);z.push(o("line",{x1:y,y1:t,x2:n-y,y2:t,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${e}`}))}}z.push(o("line",{x1:y,y1:r-y,x2:n-y,y2:r-y,stroke:"#374151","stroke-width":1,key:"x-axis"})),z.push(o("line",{x1:y,y1:y,x2:y,y2:r-y,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let e=0;e<$.length;e++){const t=k($[e]);z.push(o("line",{x1:t,y1:r-y,x2:t,y2:r-y+5,stroke:"#374151",key:`xtick-${e}`})),z.push(o("text",{x:t,y:r-y+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${t}, ${r-y+18})`,key:`xlabel-${e}`},yt($[e])))}for(let e=0;e<M.length;e++){const t=S(M[e]);z.push(o("line",{x1:y-5,y1:t,x2:y,y2:t,stroke:"#374151",key:`ytick-${e}`})),z.push(o("text",{x:y-10,y:t+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${e}`},yt(M[e])))}function C(e,t,n,r,i,l,a,s,d,c){if(0===e.length)return;const u=[...e].sort((e,t)=>e.x-t.x);if(r){const e=S(w.yMin),t=u.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),n=`${k(u[0].x)},${e} ${t} ${k(u[u.length-1].x)},${e}`;z.push(o("polygon",{points:n,fill:i,key:`${c}-area`}))}const f={points:u.map(e=>`${k(e.x)},${S(e.y)}`).join(" "),fill:"none",stroke:t,"stroke-width":n,"stroke-linejoin":"round","stroke-linecap":"round",key:`${c}-line`};if(b?(f["stroke-dasharray"]="1000",f["stroke-dashoffset"]="1000",z.push(o("polyline",f,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):z.push(o("polyline",f)),l)for(let e=0;e<u.length;e++){const t=k(u[e].x),n=S(u[e].y),r=u[e].shape??d,i=u[e].radius??s,l=`${c}-pt-${e}`;if(b){const e=bt(r,t,n,i,a,l,{opacity:0});z.push(o("g",{key:`${l}-g`},e,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else z.push(bt(r,t,n,i,a,l))}}if(C(t,i,l,p,h,u,s,a,c,"primary"),v)for(let e=0;e<v.length;e++){const t=v[e];C(t.data,t.color,l,!1,"transparent",u,t.color,t.pointRadius??a,t.pointShape??c,`series-${e}`)}if(v&&v.length>0){const e=[],t=[{color:i,label:"Primary"},...v.map((e,t)=>({color:e.color,label:e.label??`Series ${t+1}`}))],r=y+10,l=16,a=22,s=7.2,d=14,c=6,u=n-2*y-20;let f=0,p=0;for(let n=0;n<t.length;n++){const i=d+c+t[n].label.length*s;f>0&&f+i>u&&(f=0,p+=a);const h=r+f,g=y-30-p;e.push(o("rect",{x:h,y:g,width:d,height:14,fill:t[n].color,rx:2,key:`legend-rect-${n}`})),e.push(o("text",{x:h+d+c,y:g+12,"font-size":12,fill:"#374151",key:`legend-text-${n}`},t[n].label)),f+=i+l}z.push(o("g",{key:"legend"},...e))}return g&&z.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},g)),x&&z.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},x)),m&&z.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},m)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...z)},exports.ListView=function(e){const{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:l=!1,selectedIndex:a,onSelect:s,emptyMessage:d="No items",header:c,footer:u}=e;if(0===t.length)return o("div",null,c?o("div",{style:U},c):null,o("div",{style:O},d),u?o("div",{style:{...U,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},u):null);const f=[];for(let e=0;e<t.length;e++){const d=t[e],c=r(d,e),u=a===e,p=e===t.length-1,h={...H,...l?j:{},...u?q:{},...i&&!p?Y:{}};f.push(o("li",{key:c,style:h,onClick:s?()=>s(e):void 0,onKeyDown:s?t=>{const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),s(e))}:void 0,role:s?"option":void 0,tabIndex:s?0:void 0,"aria-selected":s?String(u):void 0},n(d,e)))}return o("div",null,c?o("div",{style:U},c):null,o("ul",{style:_,role:s?"listbox":"list"},...f),u?o("div",{style:{...U,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},u):null)},exports.LollipopChart=function(e){const{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:l="#94a3b8",stemWidth:a=2,dotRadius:c=6,dotColor:u="#3b82f6",showGrid:f=!0,showValues:p=!0,title:h,padding:g=60}=e,x="vertical"===i,m=n-2*g,y=r-2*g-(x?30:0),b=x?y:m,v=x?m:y,w=d(()=>{let e=0;for(let n=0;n<t.length;n++)t[n].value>e&&(e=t[n].value);return e>0?e:1},[t]),k=d(()=>0===t.length?0:v/t.length,[t.length,v]),S=s(()=>{if(!f)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(w),t=[];for(let n=e;n<=w;n+=e){const e=n/w*b;if(x){const r=g+y-e;t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(r),x2:String(g+m),y2:String(r),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(r+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}else{const r=g+e;t.push(o("line",{key:`grid-${n}`,x1:String(r),y1:String(g),x2:String(r),y2:String(g+y),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(r),y:String(g+y+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}}return t},[f,w,x,g,m,y,b]),$=s(()=>{const e=[];return e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+y),stroke:"#374151","stroke-width":"1.5"})),e.push(o("line",{key:"axis-x",x1:String(g),y1:String(g+y),x2:String(g+m),y2:String(g+y),stroke:"#374151","stroke-width":"1.5"})),e},[x,g,m,y]),M=s(()=>{if(0===t.length)return[];const e=[];for(let n=0;n<t.length;n++){const r=t[n],i=r.value/w*b,s=k*n+k/2,d=r.color??u;if(x){const t=g+s,u=g+y,f=g+y-i;e.push(o("line",{key:`stem-${n}`,x1:String(t),y1:String(u),x2:String(t),y2:String(f),stroke:l,"stroke-width":String(a)})),e.push(o("circle",{key:`dot-${n}`,cx:String(t),cy:String(f),r:String(c),fill:d})),p&&e.push(o("text",{key:`val-${n}`,x:String(t),y:String(f-c-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(r.value)));const h=t,x=g+y+16;e.push(o("text",{key:`cat-${n}`,x:String(h),y:String(x),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${h}, ${x})`},r.label))}else{const t=g+s,u=g,f=g+i;e.push(o("line",{key:`stem-${n}`,x1:String(u),y1:String(t),x2:String(f),y2:String(t),stroke:l,"stroke-width":String(a)})),e.push(o("circle",{key:`dot-${n}`,cx:String(f),cy:String(t),r:String(c),fill:d})),p&&e.push(o("text",{key:`val-${n}`,x:String(f+c+4),y:String(t+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(r.value))),e.push(o("text",{key:`cat-${n}`,x:String(g-8),y:String(t+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},r.label))}}return e},[t,w,k,u,c,l,a,p,x,g,m,y,b]),z=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),C=s(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),I=S(),A=$(),F=M(),D=z(),R=C();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Lollipop chart",style:{fontFamily:"sans-serif"}},...D,...I,...A,...F,...R)},exports.Matrix=function(e){const{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:l=500,height:a=500,colorScale:c=Vo,showValues:u=!0,showDiagonal:f=!0,cellBorderColor:p="#e5e7eb",title:h,padding:g=70,symmetric:x=!1}=e,m=r??n,y=i??n,b=t.length,v=d(()=>{let e=0;for(const n of t)n.length>e&&(e=n.length);return e},[t]),w=d(()=>{if(!x||0===b)return t;const e=[],n=Math.max(b,v);for(let o=0;o<n;o++){const r=[];for(let e=0;e<n;e++){const n=t[o],i=n&&e<n.length?n[e]:0,l=t[e],a=l&&o<l.length?l[o]:0;0!==i?r.push(i):r.push(a)}e.push(r)}return e},[t,x,b,v]),k=w.length,S=d(()=>{let e=0;for(const t of w)t.length>e&&(e=t.length);return e},[w]),{minVal:$,maxVal:M}=d(()=>{let e=1/0,t=-1/0;for(const n of w)for(const o of n)o<e&&(e=o),o>t&&(t=o);return e===1/0&&(e=0),t===-1/0&&(t=1),e===t&&(t=e+1),{minVal:e,maxVal:t}},[w]),z=h?30:0,C=m?g:20,I=S>0?(l-C-20)/S:0,A=k>0?(a-z-(y?g:20)-20)/k:0,F=s(()=>{const e=[];for(let t=0;t<k;t++){const n=w[t];for(let r=0;r<S;r++){const i=r<n.length?n[r]:0,l=Go((i-$)/(M-$),c),a=C+r*I,s=z+20+t*A,d=t===r,h=d&&f?"currentColor":p,g=d&&f?"2":"1";if(e.push(o("rect",{key:`cell-${t}-${r}`,x:String(a),y:String(s),width:String(I),height:String(A),fill:l,stroke:h,"stroke-width":g})),u){const n=Xo(l)>.5?"#111827":"#ffffff",c=Math.min(12,.3*I,.35*A);e.push(o("text",{key:`val-${t}-${r}`,x:String(a+I/2),y:String(s+A/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,c)),"font-weight":d&&f?"bold":"normal","font-family":"sans-serif",fill:n},String(Math.round(100*i)/100)))}}}return e},[w,k,S,$,M,c,I,A,C,z,u,f,p]),D=s(()=>{const e=[];if(m)for(let t=0;t<k;t++){const n=t<m.length?m[t]:"",r=z+20+t*A+A/2;e.push(o("text",{key:`row-label-${t}`,x:String(C-8),y:String(r),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}if(y)for(let t=0;t<S;t++){const n=t<y.length?y[t]:"",r=C+t*I+I/2,i=z+20+k*A+12;e.push(o("text",{key:`col-label-${t}`,x:String(r),y:String(i),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},n))}return e},[m,y,k,S,I,A,C,z]),R=s(()=>h?[o("text",{key:"title",x:String(l/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,l]);if(0===k||0===S)return o("svg",{width:"100%",viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix — no data"},o("text",{x:String(l/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));const L=R(),W=F(),N=D();return o("svg",{width:"100%",viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Matrix visualization",style:{fontFamily:"sans-serif"}},...L,...W,...N)},exports.Menubar=function(e){const{menus:t}=e,[n,r]=l(null),i=c(null),d=s(e=>{r(e)},[]),u=s(()=>{r(null)},[]);a(()=>{if(null===n)return;const e=e=>{const t=i.current;t&&!t.contains(e.target)&&r(null)};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[n]),a(()=>{const e=i.current;if(!e)return;const o=o=>{const i=o;if("Escape"!==i.key){if("ArrowRight"===i.key)return i.preventDefault(),void r(e=>null===e?0:(e+1)%t.length);if("ArrowLeft"===i.key)return i.preventDefault(),void r(e=>null===e?t.length-1:(e-1+t.length)%t.length);if("ArrowDown"===i.key&&null!==n){i.preventDefault();const t=e.querySelector('[role="menu"]');if(t){const e=t.querySelector('[role="menuitem"]');e&&e.focus()}return}"Enter"!==i.key&&i.key}else r(null)};return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}},[n,t.length]);const f=t.map((e,t)=>o(Fe,{key:String(t),menu:e,index:t,isOpen:n===t,anyOpen:null!==n,onOpen:d,onClose:u}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...f)},exports.Modal=function(e){const{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:l=!0,closeOnEscape:s=!0,footer:d,showCloseButton:u=!0,children:f}=e,p=c(null);if(a(()=>{if(!t)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[t]),a(()=>{if(!t||!s)return;const e=e=>{"Escape"===e.key&&n()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,s,n]),a(()=>{t&&p.current&&p.current.focus()},[t]),!t)return null;const h={backgroundColor:"#fff",borderRadius:"full"===i?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:"full"===i?"100vh":"90vh",width:Xe[i],maxWidth:"full"===i?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},g=[],x=r?"modal-title":void 0;r?g.push(o("h2",{id:x,style:{margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"}},r)):g.push(o("span",null)),u&&g.push(o("button",{type:"button",style:{background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},onClick:n,"aria-label":"Close modal"},"×"));const m=[o("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"}},...g),o("div",{style:{padding:"24px",overflow:"auto",flex:"1"}},f)];return d&&m.push(o("div",{style:{padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"}},d)),o("div",{style:{position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},onClick:e=>{l&&e.target===e.currentTarget&&n()},"aria-modal":"true",role:"dialog","aria-labelledby":x},o("div",{ref:p,style:h,tabIndex:-1,role:"document"},...m))},exports.MultilineField=function(e){const[t,n]=l(!1),[r,i]=l((e.value??e.defaultValue??"").length),a=u().replace(/[^a-zA-Z0-9_-]/g,""),d=e.id??`ml-${a}`,c={...ne(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},f=s(t=>{const n=t.target,o=n.value;i(o.length),e.onChange&&e.onChange(o),e.autoResize&&(n.style.height="auto",n.style.height=`${n.scrollHeight}px`)},[e.onChange,e.autoResize]),p=o("textarea",{id:d,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:c,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:f}),h=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>.9*(e.maxLength??1/0)?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(te,{label:e.label,htmlFor:d,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},p,h)},exports.NavWrapper=ke,exports.NumberSpinner=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:a,max:d,step:c=1,disabled:f=!1,prefix:p,suffix:h,label:g,error:x}=e,[m,y]=l(!1),b=s(e=>{let t=e;return void 0!==a&&t<a&&(t=a),void 0!==d&&t>d&&(t=d),t},[a,d]),v=s(()=>{f||i(b(r+c))},[f,r,c,b,i]),w=s(()=>{f||i(b(r-c))},[f,r,c,b,i]),k=s(e=>{const t=e.target.value;if(""===t||"-"===t)return;const n=parseFloat(t);isNaN(n)||i(b(n))},[b,i]),S=s(e=>{f||("ArrowUp"===e.key?(e.preventDefault(),v()):"ArrowDown"===e.key&&(e.preventDefault(),w()))},[f,v,w]),$=void 0===d||r<d,M={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:"1px solid "+(x?"#ef4444":m?"#3b82f6":"var(--color-border, #d1d5db)"),transition:"border-color 0.15s",opacity:f?"0.6":"1",...m&&!x?{boxShadow:"0 0 0 3px #3b82f622"}:{}},z=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:f||!e?"not-allowed":"pointer",color:f||!e?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),C={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},I=o("button",{type:"button",style:z(void 0===a||r>a),onClick:w,disabled:f,"aria-label":"Decrement",tabIndex:-1},"−"),A=p?o("span",{style:C},p):null,F=o("input",{id:n,type:"text",value:String(r),onInput:k,onKeyDown:S,onFocus:()=>y(!0),onBlur:()=>y(!1),disabled:f,style:{flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},"aria-label":g||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":void 0!==a?String(a):void 0,"aria-valuemax":void 0!==d?String(d):void 0}),D=h?o("span",{style:C},h):null,R=o("button",{type:"button",style:z($),onClick:v,disabled:f,"aria-label":"Increment",tabIndex:-1},"+"),L=[I];return A&&L.push(A),L.push(F),D&&L.push(D),L.push(R),o(te,{label:g,error:x,disabled:f,htmlFor:n},o("div",{style:M},...L))},exports.Pagination=function(e){const{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:l=1,showFirstLast:a=!0,showPrevNext:d=!0,disabled:c=!1}=e,u=Math.max(1,Math.ceil(t/n)),f=Math.min(Math.max(1,r),u),p=s(e=>{!c&&e>=1&&e<=u&&e!==f&&i(e)},[c,u,f,i]),h=(e,t,n)=>{const r=c||t<1||t>u||t===f;return o("button",{type:"button",onClick:()=>p(t),disabled:r||void 0,"aria-label":n,style:r?We:Re},e)},g=function(e,t,n){if(e<=2*n+5)return De(1,e);const o=Math.max(t-n,1),r=Math.min(t+n,e),i=o>2,l=r<e-1;return!i&&l?[...De(1,2*n+3),"ellipsis",e]:i&&!l?[1,"ellipsis",...De(e-2*n-2,e)]:[1,"ellipsis",...De(o,r),"ellipsis",e]}(u,f,l);let x=0;const m=[];a&&m.push(h("«",1,"Go to first page")),d&&m.push(h("‹",f-1,"Go to previous page"));for(const e of g)if("ellipsis"===e)m.push(o("span",{key:"ellipsis-"+x++,style:Ne},"..."));else{const t=e===f;m.push(o("button",{key:String(e),type:"button",onClick:()=>p(e),disabled:c||void 0,"aria-label":`Page ${e}`,"aria-current":t?"page":void 0,style:c?We:t?Le:Re},String(e)))}return d&&m.push(h("›",f+1,"Go to next page")),a&&m.push(h("»",u,"Go to last page")),o(ke,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...m)},exports.Panel=function(e){const t=!1!==e.bordered,n=e.shadow??"none",[r,i]=l(!!e.defaultCollapsed),u=c(null),[f,p]=l("auto");a(()=>{if(!e.collapsible)return;const t=u.current;t&&p(`${t.scrollHeight}px`)},[e.children,e.collapsible]);const h=s(()=>{e.collapsible&&i(e=>!e)},[e.collapsible]),g=s(t=>{if(!e.collapsible)return;const n=t.key;"Enter"!==n&&" "!==n||(t.preventDefault(),h())},[e.collapsible,h]),x=d(()=>{const o={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(o.border="1px solid #e5e7eb"),o.boxShadow=ye[n]??ye.none,{...o,...e.style??{}}},[t,n,e.style]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},y={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},b={maxHeight:r?"0":f,overflow:"hidden",transition:"max-height 0.3s ease"};return o("div",{className:`panel ${e.className??""}`.trim(),style:x},o("div",{className:"panel__header",style:m,onClick:h,onKeyDown:g,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:y}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?b:{},ref:u},o("div",{className:"panel__body",style:{padding:"16px"}},e.children)))},exports.Partition=function(e){const{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:l=!0,showValues:a=!0,colors:s=Ko,borderColor:c="#ffffff",borderWidth:u=1,title:f,padding:p=10}=e,h=f?30:0,g=p,x=p+h,m=n-2*p,y=r-2*p-h;if(d(()=>Zo(t),[t])<=0||m<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));const b=d(()=>function(e,t,n,o,r,i,l){const a=[];if(Zo(e)<=0)return a;const s=function(e){let t=0;const n=[{node:e,depth:0}];for(;n.length>0;){const{node:e,depth:o}=n.pop();if(o>t&&(t=o),e.children)for(let t=e.children.length-1;t>=0;t--)n.push({node:e.children[t],depth:o+1})}return t}(e)+1,d="horizontal"===i,c=d?r/s:o/s,u=[];for(u.push({node:e,depth:0,spanStart:d?t:n,spanEnd:d?t+o:n+r,colorIndex:0});u.length>0;){const e=u.shift(),{node:o,depth:r,spanStart:i,spanEnd:s,colorIndex:f}=e,p=Zo(o);if(p<=0)continue;const h=s-i;let g,x,m,y;if(d?(g=i,x=n+r*c,m=h,y=c):(g=t+r*c,x=i,m=c,y=h),a.push({x:g,y:x,w:m,h:y,label:o.label,value:p,color:o.color??l[f%l.length],depth:r}),o.children&&o.children.length>0){let e=i;for(let t=0;t<o.children.length;t++){const n=o.children[t],i=Zo(n);if(i<=0)continue;const l=i/p*h;u.push({node:n,depth:r+1,spanStart:e,spanEnd:e+l,colorIndex:0===r?t:f}),e+=l}}}return a}(t,g,x,m,y,i,s),[t,g,x,m,y,i,s]),v=[];f&&v.push(o("text",{key:"title",x:String(n/2),y:String(p+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f));for(let e=0;e<b.length;e++){const t=b[e];if(v.push(o("rect",{key:`cell-${e}`,x:String(t.x),y:String(t.y),width:String(Math.max(0,t.w)),height:String(Math.max(0,t.h)),fill:t.color,stroke:c,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),l&&t.w>20&&t.h>14){const n=Math.floor(t.w/7),r=t.label.length>n?t.label.substring(0,Math.max(1,n-2))+"..":t.label;v.push(o("text",{key:`label-${e}`,x:String(t.x+t.w/2),y:String(t.y+t.h/2+(a?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},r))}a&&t.w>30&&t.h>28&&v.push(o("text",{key:`value-${e}`,x:String(t.x+t.w/2),y:String(t.y+t.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(t.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Partition diagram",style:{fontFamily:"sans-serif"}},...v)},exports.PieGraph=function(e){const{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:l=.02,showLabels:a=!0,showValues:s=!0,showLegend:c=!0,legendPosition:u="right",title:f,centerLabel:p,colors:h,strokeColor:g="#fff",strokeWidth:x=2,textColor:m="currentColor"}=e,y=c&&"right"===u?140:0,b=f?30:0,v=c&&"bottom"===u?22*Math.ceil(t.length/2)+10:0,w=n-y,k=r-b-v,S=w/2,$=b+k/2,M=Math.min(w,k)/2-10,z=e.outerRadius??M,C=d(()=>kt(t,{padAngle:l,colors:h}),[t,l,h]),I=[];f&&I.push(o("text",{key:"title",x:w/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:m},f));for(let e=0;e<C.length;e++){const t=C[e],n=wt(S,$,i,z,t.startAngle,t.endAngle);if(I.push(o("path",{key:`slice-${e}`,d:n,fill:t.color,stroke:g,strokeWidth:x})),a||s){const n=(t.startAngle+t.endAngle)/2,r=t.percentage<5,l=vt(S,$,r?z+14:i+.65*(z-i),n-Math.PI/2),d=r?m:"#fff",c=r?11:12,u=[];if(a&&u.push(t.label),s&&u.push(`${t.percentage.toFixed(1)}%`),r){const t=vt(S,$,z+2,n-Math.PI/2);I.push(o("line",{key:`connector-${e}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,stroke:"#999",strokeWidth:1}))}a&&I.push(o("text",{key:`label-${e}`,x:l.x,y:l.y-(s?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c,fill:d,pointerEvents:"none"},t.label)),s&&I.push(o("text",{key:`value-${e}`,x:l.x,y:l.y+(a?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:c-1,fill:d,pointerEvents:"none"},`${t.percentage.toFixed(1)}%`))}}if(p&&i>0&&I.push(o("text",{key:"center-label",x:S,y:$,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:m},p)),c){const e=[];if("right"===u){const t=w+10,n=b+20;for(let r=0;r<C.length;r++){const i=C[r],l=n+22*r;e.push(o("circle",{key:`legend-dot-${r}`,cx:t+6,cy:l,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:t+18,y:l,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:m},`${i.label} (${i.percentage.toFixed(1)}%)`))}}else{const t=r-v+10;for(let r=0;r<C.length;r++){const i=C[r],l=r%2*(n/2)+10,a=t+22*Math.floor(r/2);e.push(o("circle",{key:`legend-dot-${r}`,cx:l+6,cy:a,r:6,fill:i.color})),e.push(o("text",{key:`legend-text-${r}`,x:l+18,y:a,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:m},`${i.label} (${i.percentage.toFixed(1)}%)`))}}I.push(...e)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...I)},exports.PivotTable=function(e){const{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:l="sum",width:a=600,height:s=400,showTotals:c=!0,title:u,headerColor:f="#3b82f6",cellPadding:p=8}=e;if(0===t.length||0===n.length&&0===r.length||0===i.length)return o("svg",{width:"100%",viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(a/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));const h=d(()=>function(e,t,n,o,r){const i=Qo(e,t),l=Qo(e,n),a=new Map;for(const r of e){const e=`${Jo(r,t)}::${Jo(r,n)}`;a.has(e)||a.set(e,[]);const i=a.get(e);let l=0;for(const e of o){const t=r[e];if("number"==typeof t)l+=t;else if("string"==typeof t){const e=parseFloat(t);isNaN(e)||(l+=e)}}i.push(l)}const s=new Map;for(const[e,t]of a)s.set(e,er(t,r));const d=new Map;for(const e of i){const t=[];for(const n of l){const o=s.get(`${e}::${n}`);void 0!==o&&t.push(o)}d.set(e,er(t,"count"===r?"sum":r))}const c=new Map;for(const e of l){const t=[];for(const n of i){const o=s.get(`${n}::${e}`);void 0!==o&&t.push(o)}c.set(e,er(t,"count"===r?"sum":r))}const u=[];for(const e of d.values())u.push(e);return{rowKeys:i,colKeys:l,cells:s,rowTotals:d,colTotals:c,grandTotal:er(u,"count"===r?"sum":r)}}(t,n,r,i,l),[t,n,r,i,l]),{rowKeys:g,colKeys:x,cells:m,rowTotals:y,colTotals:b,grandTotal:v}=h,w=u?30:0,k=x.length+(c?1:0),S=g.length+(c?1:0),$=1+k,M=1+S,z=Math.max(40,(a-2*p)/$),C=Math.max(20,Math.min(36,(s-w-2*p)/M)),I=z*$,A=C*M,F=Math.max(0,(a-I)/2),D=w+Math.max(0,(s-w-A)/2),R=[];u&&R.push(o("text",{key:"title",x:String(a/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),R.push(o("rect",{key:"header-row-bg",x:String(F),y:String(D),width:String(I),height:String(C),fill:f})),R.push(o("rect",{key:"header-col-bg",x:String(F),y:String(D+C),width:String(z),height:String(C*S),fill:f,opacity:"0.85"})),R.push(o("text",{key:"corner",x:String(F+z/2),y:String(D+C/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},l.toUpperCase()));for(let e=0;e<x.length;e++){const t=F+(e+1)*z,n=Math.floor(z/7),r=x[e],i=r.length>n?r.substring(0,Math.max(1,n-2))+"..":r;R.push(o("text",{key:`ch-${e}`,x:String(t+z/2),y:String(D+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},i))}c&&R.push(o("text",{key:"ch-total",x:String(F+(x.length+1)*z+z/2),y:String(D+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let e=0;e<g.length;e++){const t=g[e],n=D+(e+1)*C;e%2==0&&R.push(o("rect",{key:`row-bg-${e}`,x:String(F+z),y:String(n),width:String(z*k),height:String(C),fill:"#f9fafb"}));const r=Math.floor(z/7),i=t.length>r?t.substring(0,Math.max(1,r-2))+"..":t;R.push(o("text",{key:`rh-${e}`,x:String(F+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},i));for(let r=0;r<x.length;r++){const i=`${t}::${x[r]}`,l=m.get(i),a=F+(r+1)*z;R.push(o("rect",{key:`border-${e}-${r}`,x:String(a),y:String(n),width:String(z),height:String(C),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),R.push(o("text",{key:`cell-${e}-${r}`,x:String(a+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},void 0!==l?tr(l):"-"))}if(c){const r=F+(x.length+1)*z,i=y.get(t)??0;R.push(o("rect",{key:`rt-bg-${e}`,x:String(r),y:String(n),width:String(z),height:String(C),fill:"#eff6ff"})),R.push(o("text",{key:`rt-${e}`,x:String(r+z/2),y:String(n+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},tr(i)))}}if(c){const e=D+(g.length+1)*C;R.push(o("rect",{key:"total-row-bg",x:String(F),y:String(e),width:String(I),height:String(C),fill:"#eff6ff"})),R.push(o("text",{key:"total-label",x:String(F+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let t=0;t<x.length;t++){const n=x[t],r=b.get(n)??0,i=F+(t+1)*z;R.push(o("text",{key:`ct-${t}`,x:String(i+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},tr(r)))}const t=F+(x.length+1)*z;R.push(o("text",{key:"grand-total",x:String(t+z/2),y:String(e+C/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},tr(v)))}return R.push(o("rect",{key:"outer-border",x:String(F),y:String(D),width:String(I),height:String(A),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${a} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...R)},exports.PolarGraph2D=function(e){const{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:u=360,thetaStep:f,sync:p=!1,points:h=[],showGrid:g=!0,pointRadius:x=3,pointColor:m="#3b82f6",curveColor:y="#3b82f6",onPointClick:b,onPointDoubleClick:v,onPointContextMenu:w,onPointHover:k}=e,[S,$]=l(r[1]),[M,z]=l(0),[C,I]=l(0),[A,F]=l(null),D=t/2+M,R=n/2+C,L=Math.min(t,n)/2-30,W=L/S,N=d(()=>{const e=Math.max(1,Math.ceil(S)),t=[],n=S/e;for(let o=1;o<=e;o++)t.push(n*o);return t},[S]),T=d(()=>{const e=[];for(let t=0;t<360;t+=30)e.push(t*Math.PI/180);return e},[]),E=d(()=>{if(!i||!p)return[];const e=f??2*Math.PI/u,t=lt({start:0,end:2*Math.PI,step:e});return at(i,t)},[i,u,f,p]),[P,B]=l([]),_=c(null);a(()=>{if(!i||p)return void B([]);const e=f??2*Math.PI/u,t=lt({start:0,end:2*Math.PI,step:e});return _.current&&_.current(),_.current=st(i,t,200,e=>{B([...e])}),()=>{_.current&&_.current()}},[i,u,f,p]);const H=p?E:P,Y=d(()=>{if(0===H.length)return"";const e=[];for(let t=0;t<H.length;t++){const n=H[t],o=n.output;if(o<0||!isFinite(o))continue;const{x:r,y:i}=St(o,n.input,D,R,W);e.push(`${0===e.length?"M":"L"}${r.toFixed(2)},${i.toFixed(2)}`)}return e.join(" ")},[H,D,R,W]),j=s(e=>{F({x:e.clientX,y:e.clientY,px:M,py:C})},[M,C]),q=s(e=>{A&&(z(A.px+(e.clientX-A.x)),I(A.py+(e.clientY-A.y)))},[A]),O=s(()=>{F(null)},[]),U=s(e=>{e.preventDefault();const t=e.deltaY>0?1.15:1/1.15;$(Math.max(.1,S*t))},[S]),G=s((e,t,n)=>{if(e)return o=>e({r:t.r,theta:t.theta,index:n,event:o})},[]),X=[];if(X.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),g){for(let e=0;e<N.length;e++){const t=N[e]*W;X.push(o("circle",{cx:D,cy:R,r:t,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${e}`})),X.push(o("text",{x:D+t+2,y:R-4,"font-size":10,fill:"#9ca3af",key:`gl-${e}`},N[e].toFixed(1)))}for(let e=0;e<T.length;e++){const t=T[e],n=N[N.length-1]*W,r=D+n*Math.cos(t),i=R-n*Math.sin(t);X.push(o("line",{x1:D,y1:R,x2:r,y2:i,stroke:"#e5e7eb","stroke-width":1,key:`al-${e}`}));const l=Math.round(180*t/Math.PI),a=D+(n+14)*Math.cos(t),s=R-(n+14)*Math.sin(t);X.push(o("text",{x:a,y:s+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${e}`},`${l}°`))}}X.push(o("line",{x1:D-L,y1:R,x2:D+L,y2:R,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),X.push(o("line",{x1:D,y1:R-L,x2:D,y2:R+L,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),Y&&X.push(o("path",{d:Y,fill:"none",stroke:y,"stroke-width":2,key:"curve"}));for(let e=0;e<h.length;e++){const t=h[e],{x:n,y:r}=St(t.r,t.theta,D,R,W);X.push(o("circle",{cx:n,cy:r,r:x,fill:m,key:`pt-${e}`,style:{cursor:"pointer"},onClick:G(b,t,e),onDblClick:G(v,t,e),onContextMenu:G(w,t,e),onMouseEnter:G(k,t,e)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:A?"grabbing":"grab"},onMouseDown:j,onMouseMove:q,onMouseUp:O,onMouseLeave:O,onWheel:U},...X)},exports.Popover=function(e){const{trigger:t,content:n,open:r,placement:i="bottom",offset:d=4,arrow:u=!1,closeOnClickOutside:f=!0,onOpenChange:p}=e,h=void 0!==r,[g,x]=l(!1),m=h?r:g,y=c(null),b=s(()=>{h?p&&p(!r):x(e=>!e)},[h,r,p]);a(()=>{if(!m||!f)return;const e=e=>{y.current&&!y.current.contains(e.target)&&(h?p&&p(!1):x(!1))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[m,f,h,p]);const v={...Ve(i,d),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},w=[n];u&&w.push(o("div",{style:Ke(i)}));const k=s(e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),b())},[b]),S=[o("div",{onClick:b,onKeyDown:k,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return m&&S.push(o("div",{style:v},...w)),o("div",{ref:y,style:{position:"relative",display:"inline-block"}},...S)},exports.ProgressBar=function(e){const t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",l=e.backgroundColor??"#e5e7eb",a=e.height??("string"==typeof e.size?e.size:"number"==typeof e.size?`${e.size}px`:"8px"),s=e.variant??"bar",c=u().replace(/[^a-zA-Z0-9_-]/g,"");if("circular"===s){const t="number"==typeof e.size?e.size:48,n=Math.max(2,Math.round(t/10)),a=(t-n)/2,s=2*Math.PI*a,d=e.indeterminate?.75*s:s-r/100*s,u=e.indeterminate?`@keyframes liq-spin-${c}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${c}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},u?o("style",null,u):null,o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:e.indeterminate?{animation:`liq-spin-${c} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${c} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:l,"stroke-width":String(n)}),o("circle",{cx:String(t/2),cy:String(t/2),r:String(a),fill:"none",stroke:i,"stroke-width":String(n),"stroke-dasharray":String(s),"stroke-dashoffset":String(d),"stroke-linecap":"round",transform:`rotate(-90 ${t/2} ${t/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}const f=e.animated||e.indeterminate?`@keyframes liq-shimmer-${c}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",p=e.indeterminate?`@keyframes liq-indeterminate-${c}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",h={width:"100%",height:a,backgroundColor:l,borderRadius:a,overflow:"hidden",position:"relative"},g=d(()=>{const t={height:"100%",borderRadius:a,transition:"width 0.3s ease"};return e.indeterminate?(t.position="absolute",t.animation=`liq-indeterminate-${c} 1.5s ease-in-out infinite`,t.backgroundColor=i):(t.width=`${r}%`,t.backgroundColor=i),e.animated&&!e.indeterminate&&(t.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${function(e){const t=e.replace("#","");if(6!==t.length)return e;const n=Math.min(255,parseInt(t.slice(0,2),16)+40),o=Math.min(255,parseInt(t.slice(2,4),16)+40),r=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}`}(i)} 50%, ${i} 100%)`,t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${c} 1.5s ease-in-out infinite`),t},[r,i,a,e.animated,e.indeterminate,c]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},f||p?o("style",null,f+p):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:h},o("div",{style:g})))},exports.RadarChart=function(e){const{axes:t=[],series:n=[],width:r=500,height:i=500,levels:l=5,showLabels:a=!0,showValues:c=!1,showLegend:u=!0,showDots:f=!0,gridColor:p="#d1d5db",title:h}=e,g=t.length,x=h?30:0,m=u&&n.length>0?30:0,y=Math.min((r-120)/2,(i-120-x-m)/2),b=r/2,v=60+x+y,w=d(()=>{const e=[];for(let o=0;o<g;o++){const r=t[o]?.max;if(void 0!==r&&r>0){e.push(r);continue}let i=0;for(const e of n){const t=e.values[o];void 0!==t&&t>i&&(i=t)}e.push(i>0?i:1)}return e},[t,n,g]),k=s(()=>{if(g<3)return[];const e=[];for(let t=1;t<=l;t++){const n=y*t/l,r=[];for(let e=0;e<g;e++){const t=nr(e,g),o=or(b,v,n,t);r.push(`${o.x},${o.y}`)}e.push(o("polygon",{key:`ring-${t}`,points:r.join(" "),fill:"none",stroke:p,"stroke-width":t===l?"1.5":"0.5","stroke-dasharray":t===l?"none":"3 2"}))}for(let t=0;t<g;t++){const n=nr(t,g),r=or(b,v,y,n);e.push(o("line",{key:`spoke-${t}`,x1:String(b),y1:String(v),x2:String(r.x),y2:String(r.y),stroke:p,"stroke-width":"0.75"}))}return e},[g,l,y,b,v,p]),S=s(()=>{if(!a||g<3)return[];const e=[];for(let n=0;n<g;n++){const r=nr(n,g),i=or(b,v,y+16,r);let l="middle";i.x<b-5?l="end":i.x>b+5&&(l="start");const a=Math.abs(i.y-v)<5?"0.35em":i.y<v?"0em":"0.7em";e.push(o("text",{key:`label-${n}`,x:String(i.x),y:String(i.y),"text-anchor":l,dy:a,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[n]?.label??`Axis ${n}`))}return e},[a,g,t,y,b,v]),$=s(()=>{if(g<3||0===n.length)return[];const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=[],l=[],a=[];for(let e=0;e<g;e++){const n=r.values[e]??0,s=w[e],d=Math.min(n/s,1),u=y*d,p=nr(e,g),h=or(b,v,u,p);i.push(`${h.x},${h.y}`),f&&l.push(o("circle",{key:`dot-${t}-${e}`,cx:String(h.x),cy:String(h.y),r:"3.5",fill:r.color,stroke:"#fff","stroke-width":"1.5"})),c&&a.push(o("text",{key:`val-${t}-${e}`,x:String(h.x),y:String(h.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:r.color},String(Math.round(100*n)/100)))}e.push(o("polygon",{key:`series-fill-${t}`,points:i.join(" "),fill:r.color,"fill-opacity":String(r.fillOpacity??.15),stroke:"none"})),e.push(o("polygon",{key:`series-line-${t}`,points:i.join(" "),fill:"none",stroke:r.color,"stroke-width":"2","stroke-linejoin":"round"}));for(const t of l)e.push(t);for(const t of a)e.push(t)}return e},[g,n,w,y,b,v,f,c]),M=s(()=>{if(!u||0===n.length)return[];const e=[],t=v+y+40,r=100*n.length,i=b-r/2;for(let r=0;r<n.length;r++){const l=n[r],a=i+100*r;e.push(o("rect",{key:`legend-swatch-${r}`,x:String(a),y:String(t),width:"12",height:"12",rx:"2",fill:l.color})),e.push(o("text",{key:`legend-text-${r}`,x:String(a+16),y:String(t+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},l.label))}return e},[u,n,b,v,y]),z=s(()=>h?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,r]);if(g<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart — insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));const C=k(),I=S(),A=$(),F=M(),D=z();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Radar chart",style:{fontFamily:"sans-serif"}},...D,...C,...I,...A,...F)},exports.RadioGroup=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:l,name:a,direction:d="vertical",disabled:c=!1,error:f,label:p}=e,h=s(e=>{c||l(e)},[c,l]),g=s(e=>{if(c)return;const t=r.filter(e=>!e.disabled);if(0===t.length)return;const n=t.findIndex(e=>e.value===i);let o=n;if("ArrowDown"===e.key||"ArrowRight"===e.key)e.preventDefault(),o=n<t.length-1?n+1:0;else{if("ArrowUp"!==e.key&&"ArrowLeft"!==e.key)return;e.preventDefault(),o=n>0?n-1:t.length-1}l(t[o].value)},[c,r,i,l]),x={display:"flex",flexDirection:"horizontal"===d?"row":"column",gap:"horizontal"===d?"16px":"8px"},m=r.map((e,t)=>{const r=e.value===i,l=c||!!e.disabled,s=`${n}-opt-${t}`,d={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:"2px solid "+(f?"#ef4444":r?"#3b82f6":"#d1d5db"),display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},u={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:r?"scale(1)":"scale(0)"},p={display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer",opacity:l?"0.5":"1",userSelect:"none"};return o("label",{key:e.value,htmlFor:s,style:p,onClick:l?void 0:t=>{t.preventDefault(),h(e.value)}},o("input",{type:"radio",id:s,name:a,value:e.value,checked:r,disabled:l,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:d},o("div",{style:u})),o("span",{style:{fontSize:"14px",color:"#374151"}},e.label))});return o(te,{label:p,error:f,htmlFor:`${n}-opt-0`},o("div",{id:n,style:x,role:"radiogroup","aria-label":p,onKeyDown:g,tabIndex:c?-1:0},...m))},exports.SankeyDiagram=function(e){const{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:l=20,nodePadding:a=10,showLabels:c=!0,showValues:u=!1,linkOpacity:f=.4,colors:p=rr,title:h,padding:g=40}=e;if(!t||0===t.length)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));const x=d(()=>function(e,t,n,o,r,i,l,a){if(0===e.length)return{layoutNodes:[],layoutLinks:[]};const s=n-2*l,d=o-2*l,c=t.filter(e=>e.value>0),u=e.map(e=>e.id),f=function(e,t){const n=new Map,o=new Map,r=new Map;for(const t of e)o.set(t,new Set),r.set(t,[]);for(const e of t){if(e.value<=0)continue;const t=o.get(e.target);t&&t.add(e.source);const n=r.get(e.source);n&&n.push(e.target)}const i=[];for(const t of e)0===o.get(t).size&&(n.set(t,0),i.push(t));if(0===i.length){for(const t of e)n.set(t,0);return n}let l=0;for(;l<i.length;){const e=i[l];l++;const t=n.get(e),o=r.get(e)??[];for(const e of o){const o=n.get(e),r=t+1;(void 0===o||r>o)&&n.set(e,r),i.includes(e)||i.push(e)}}for(const t of e)n.has(t)||n.set(t,0);return n}(u,c),p=new Map,h=new Map;for(const e of u)p.set(e,0),h.set(e,0);for(const e of c)h.set(e.source,(h.get(e.source)??0)+e.value),p.set(e.target,(p.get(e.target)??0)+e.value);let g=0;for(const e of f.values())e>g&&(g=e);const x=new Map;for(let e=0;e<=g;e++)x.set(e,[]);for(const[e,t]of f)x.get(t).push(e);const m=new Map,y=g>0?(s-r)/g:0;for(let e=0;e<=g;e++)m.set(e,l+e*y);const b=new Map;for(let t=0;t<e.length;t++)b.set(e[t].id,e[t]);const v=[],w=new Map;for(let t=0;t<=g;t++){const n=x.get(t);if(0===n.length)continue;let o=0;for(const e of n){const t=p.get(e)??0,n=h.get(e)??0;o+=Math.max(t,n,1)}const r=d-i*(n.length-1),s=o>0?r/o:1;let c=l;for(let o=0;o<n.length;o++){const r=n[o],l=b.get(r),d=p.get(r)??0,u=h.get(r)??0,f=Math.max(d,u,1),g=Math.max(4,f*s),x=e.findIndex(e=>e.id===r),y={id:r,label:l.label,color:l.color??a[x%a.length],column:t,x:m.get(t),y:c,height:g,totalIn:d,totalOut:u,totalValue:f};v.push(y),w.set(r,y),c+=g+i}}const k=new Map,S=new Map;for(const e of u)k.set(e,0),S.set(e,0);const $=[...c].sort((e,t)=>t.value-e.value),M=[];for(const e of $){const t=w.get(e.source),n=w.get(e.target);if(!t||!n)continue;const o=t.totalOut||1,r=n.totalIn||1,i=e.value/o*t.height,l=e.value/r*n.height,a=Math.max(1,(i+l)/2),s=k.get(e.source),d=S.get(e.target),c=t.y+s+i/2,u=n.y+d+l/2;k.set(e.source,s+i),S.set(e.target,d+l);const f=b.get(e.source);M.push({source:e.source,target:e.target,value:e.value,color:e.color??f?.color??t.color,sourceY:c,targetY:u,width:a})}return{layoutNodes:v,layoutLinks:M}}(t,n,r,i,l,a,g,p),[t,n,r,i,l,a,g,p]),m=s(()=>{const e=[];for(let t=0;t<x.layoutLinks.length;t++){const n=x.layoutLinks[t],r=x.layoutNodes.find(e=>e.id===n.source),i=x.layoutNodes.find(e=>e.id===n.target);if(!r||!i)continue;const a=r.x+l,s=i.x,d=(a+s)/2,c=`M ${a} ${n.sourceY} C ${d} ${n.sourceY}, ${d} ${n.targetY}, ${s} ${n.targetY}`;e.push(o("path",{key:`link-${t}`,d:c,fill:"none",stroke:n.color,"stroke-width":String(Math.max(1,n.width)),"stroke-opacity":String(f),"stroke-linecap":"butt"})),u&&n.value>0&&e.push(o("text",{key:`link-val-${t}`,x:String(d),y:String((n.sourceY+n.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(n.value)))}return e},[x,l,f,u]),y=s(()=>{const e=[];for(let t=0;t<x.layoutNodes.length;t++){const n=x.layoutNodes[t];if(e.push(o("rect",{key:`node-${n.id}`,x:String(n.x),y:String(n.y),width:String(l),height:String(n.height),fill:n.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${n.label}: ${n.totalValue}`})),c){const t=x.layoutNodes.reduce((e,t)=>Math.max(e,t.column),0),r=n.column===t,i=r?n.x+l+6:n.x-6,a=r?"start":"end",s=0===n.column,d=s?n.x-6:i,c=s?"end":a;e.push(o("text",{key:`label-${n.id}`,x:String(d),y:String(n.y+n.height/2+4),"text-anchor":c,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},n.label))}}return e},[x,l,c]),b=s(()=>h?[o("text",{key:"title",x:String(r/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,r,g]),v=m(),w=y(),k=b();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Sankey diagram",style:{fontFamily:"sans-serif"}},...k,...v,...w)},exports.ScrollContainer=function(e){const t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=c(null),[u,f]=l(!0),[p,h]=l(!1),[g,x]=l(!0),[m,y]=l(!1),b=s(()=>{const e=i.current;e&&(f(e.scrollTop<=2),h(e.scrollTop+e.clientHeight>=e.scrollHeight-2),x(e.scrollLeft<=2),y(e.scrollLeft+e.clientWidth>=e.scrollWidth-2))},[]);a(()=>{b()},[b]);const v=s(()=>{r&&b()},[r,b]),w=d(()=>{const o={position:"relative",overflowX:be(t,"x"),overflowY:be(t,"y"),...ve(n)};return e.maxHeight&&(o.maxHeight=e.maxHeight),e.maxWidth&&(o.maxWidth=e.maxWidth),e.padding&&(o.padding=e.padding),{...o,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),k=[];if(r){const e="vertical"===t||"both"===t,n="horizontal"===t||"both"===t;e&&!u&&k.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),e&&!p&&k.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),n&&!g&&k.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),n&&!m&&k.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}const S={...w};return k.length>0&&(S.boxShadow=k.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:S,ref:i,onScroll:v},e.children)},exports.Select=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:f,placeholder:p="Select...",searchable:h=!1,multiple:g=!1,clearable:x=!1,disabled:m=!1,error:y,label:b,helpText:v}=e,[w,k]=l(!1),[S,$]=l(""),[M,z]=l(-1),C=c(null),I=d(()=>Array.isArray(i)?i:i?[i]:[],[i]),A=d(()=>{if(!h||!S)return r;const e=S.toLowerCase();return r.filter(t=>t.label.toLowerCase().includes(e))},[r,S,h]),F=d(()=>{const e={},t=[];for(const n of A)n.group?(e[n.group]||(e[n.group]=[]),e[n.group].push(n)):t.push(n);return{groups:e,ungrouped:t}},[A]),D=d(()=>0===I.length?"":I.map(e=>r.find(t=>t.value===e)).filter(Boolean).map(e=>e.label).join(", "),[I,r]);a(()=>{const e=e=>{const t=e.target;C.current&&!C.current.contains(t)&&(k(!1),$(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const R=s(e=>{if(g){const t=I.includes(e)?I.filter(t=>t!==e):[...I,e];f(t)}else f(e),k(!1),$("")},[g,I,f]),L=s(e=>{e.stopPropagation(),f(g?[]:"")},[g,f]),W=s(e=>{if(m)return;const t=e.key;if(!w&&("Enter"===t||" "===t||"ArrowDown"===t))return e.preventDefault(),k(!0),void z(0);if(w){if("Escape"===t)return k(!1),void $("");if("ArrowDown"===t)e.preventDefault(),z(e=>Math.min(e+1,A.length-1));else if("ArrowUp"===t)e.preventDefault(),z(e=>Math.max(e-1,0));else if("Enter"===t&&M>=0&&M<A.length){e.preventDefault();const t=A[M];t.disabled||R(t.value)}}},[m,w,M,A,R]),N={...ne({},{focused:w,error:!!y}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:m?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},T=(e,t)=>{const n=I.includes(e.value),r=t===M,i={padding:"8px 12px",cursor:e.disabled?"not-allowed":"pointer",backgroundColor:r?"#f3f4f6":n?"#eff6ff":"transparent",color:e.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:e.value,style:i,onClick:e.disabled?void 0:()=>R(e.value),onMouseEnter:()=>z(t),role:"option","aria-selected":n?"true":"false","aria-disabled":e.disabled?"true":void 0},g&&n?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"✓"):null,e.label)},E=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:w?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"▼"),P=o("div",{style:N,id:n,onClick:m?void 0:()=>{k(!w),z(-1)},onKeyDown:W,tabIndex:m?-1:0,role:"combobox","aria-expanded":w?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:D?"#1f2937":"#9ca3af"}},D||p),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},x&&I.length>0?o("span",{onClick:L,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),e.stopPropagation(),L(e))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"✕"):null,E)),B=h&&w?o("input",{type:"text",value:S,onInput:e=>{$(e.target.value),z(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,_=w?o("div",{style:{position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},role:"listbox"},B,...(()=>{const e=[];let t=0;const{groups:n,ungrouped:r}=F;for(const n of r)e.push(T(n,t++));for(const r of Object.keys(n)){e.push(o("div",{key:`group-${r}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},r));for(const o of n[r])e.push(T(o,t++))}return 0===e.length&&e.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),e})()):null;return o(te,{label:b,error:y,helpText:v,disabled:m,htmlFor:n},o("div",{ref:C,style:{position:"relative"}},P,_))},exports.Sidebar=function(e){const{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:l,width:a="240px",collapsedWidth:s="56px"}=e,d=n?"number"==typeof s?`${s}px`:s:"number"==typeof a?`${a}px`:a,c=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"▶":"◀"):null,u=t.map(e=>o(Te,{key:e.id,item:e,collapsed:n,selectedId:i,onSelect:l,depth:0}));return o(ke,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},c,...u)},exports.Skeleton=function(e){const t=e.variant??"text",n=!1!==e.animated,r=u().replace(/[^a-zA-Z0-9_-]/g,""),i=d(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),l="number"==typeof e.width?`${e.width}px`:e.width,a="number"==typeof e.height?`${e.height}px`:e.height;if("text"===t){const t=e.lines??1,s=[];for(let i=0;i<t;i++){const d=i===t-1&&t>1;s.push(o("div",{key:String(i),style:J({width:d?"75%":l??"100%",height:a??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:i<t-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:l??"100%"}},i?o("style",null,i):null,...s)}if("circular"===t){const e=l??a??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:J({width:e,height:e,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:J({width:l??"100%",height:a??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))},exports.Slider=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:f=0,max:p=100,step:h=1,showValue:g=!1,showTicks:x=!1,disabled:m=!1,marks:y,range:b=!1,label:v,error:w}=e,k=c(null),S=c(i);S.current=i;const[$,M]=l(null),z=d(()=>{if(b&&Array.isArray(r))return r;const e="number"==typeof r?r:0;return[e,e]},[r,b]),C=c(z);C.current=z;const I=e=>{const t=Math.round((e-f)/h)*h+f;return Math.max(f,Math.min(p,t))},A=e=>(e-f)/(p-f)*100,F=s(e=>{if(!k.current)return f;const t=k.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width));return I(f+n*(p-f))},[f,p,h]),D=s(e=>t=>{m||(t.preventDefault(),M(e))},[m]),R=s(e=>{if(m)return;const t=F(e);if(b){const e=Math.abs(t-z[0]),n=Math.abs(t-z[1]);i(e<=n?[I(t),z[1]]:[z[0],I(t)])}else i(I(t))},[m,F,b,z,i,f,p,h]);a(()=>{if(!$)return;const e=e=>{const t=F(e),n=C.current,o=S.current;"single"===$?o(I(t)):"start"===$?o([Math.min(I(t),n[1]),n[1]]):"end"===$&&o([n[0],Math.max(n[0],I(t))])},t=()=>M(null);return document.addEventListener("mousemove",e),document.addEventListener("mouseup",t),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",t)}},[$,F,f,p,h]);const L=s(e=>{if(m)return;let t=0;if("ArrowRight"===e.key||"ArrowUp"===e.key)t=h;else{if("ArrowLeft"!==e.key&&"ArrowDown"!==e.key)return;t=-h}e.preventDefault(),b||i(I(("number"==typeof r?r:0)+t))},[m,h,b,r,i,f,p]),W={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:m?"not-allowed":"pointer"},N=b?A(z[0]):0,T={position:"absolute",top:"0",left:`${N}%`,width:A(b?z[1]:z[0])-N+"%",height:"100%",backgroundColor:m?"#9ca3af":"#3b82f6",borderRadius:"3px"},E=e=>v?"start"===e?`${v} minimum`:"end"===e?`${v} maximum`:v:"start"===e?"Minimum value":"end"===e?"Maximum value":"Value",P=(e,t,r)=>o("div",{id:"single"===t||"start"===t?n:void 0,style:{position:"absolute",top:"50%",left:`${e}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:"2px solid "+(m?"#9ca3af":"#3b82f6"),cursor:m?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},onMouseDown:D(t),role:"slider","aria-valuenow":String(r),"aria-valuemin":String(f),"aria-valuemax":String(p),"aria-label":E(t),tabIndex:m?-1:0,onKeyDown:L},g?o("div",{style:{position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"}},String(r)):null),B=[];if(x)for(let e=f;e<=p;e+=h)B.push(o("div",{key:`tick-${e}`,style:{position:"absolute",top:"10px",left:`${A(e)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));const _=[];if(y)for(const e of y)_.push(o("div",{key:`mark-${e.value}`,style:{position:"absolute",top:"18px",left:`${A(e.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},e.label));const H={paddingTop:g?"28px":"8px",paddingBottom:y||x?"28px":"8px",opacity:m?"0.6":"1"},Y=[];return b?(Y.push(P(A(z[0]),"start",z[0])),Y.push(P(A(z[1]),"end",z[1]))):Y.push(P(A(z[0]),"single",z[0])),o(te,{label:v,error:w,htmlFor:n},o("div",{style:H},o("div",{ref:k,style:W,role:"presentation",onClick:R},o("div",{style:T}),...Y,...B,..._)))},exports.Spinner=function(e){const t="number"==typeof e.size?e.size:Q[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=ee[e.speed??"normal"]??ee.normal,l=e.label??"Loading",a=u().replace(/[^a-zA-Z0-9_-]/g,""),s=(t-r)/2,c=2*Math.PI*s;return o("span",{role:"status","aria-label":l,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,d(()=>`@keyframes liq-rotate-${a}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[a])),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${a} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(s),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${.7*c} ${.3*c}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},l))},exports.Splitter=function(e){const t=e.direction??"horizontal",n="horizontal"===t,r=e.dividerSize??6,i=e.minSize??50,[u,f]=l(e.initialSplit??50),p=c(null),h=c(!1),g=s(e=>{e.preventDefault(),h.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);a(()=>{const t=t=>{if(!h.current||!p.current)return;const o=p.current.getBoundingClientRect(),r=n?o.width:o.height,l=n?t.clientX-o.left:t.clientY-o.top;if(r<=0)return;const a=i/r*100,s=e.maxSize?e.maxSize/r*100:100-a;let d=l/r*100;d=Math.max(a,Math.min(s,d)),f(d)},o=()=>{h.current&&(h.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",t),document.addEventListener("mouseup",o),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",o)}},[n,i,e.maxSize]);const x=d(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),m=n?{width:`calc(${u}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${u}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},y={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},b=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:x,ref:p},o("div",{className:"splitter__pane splitter__pane--first",style:m},b[0]??null),o("div",{className:"splitter__divider",style:y,onMouseDown:g,onKeyDown:e=>{const t=e.key;!n||"ArrowLeft"!==t&&"ArrowRight"!==t?n||"ArrowUp"!==t&&"ArrowDown"!==t||(e.preventDefault(),f(e=>{const n="ArrowDown"===t?2:-2;return Math.max(5,Math.min(95,e+n))})):(e.preventDefault(),f(e=>{const n="ArrowRight"===t?2:-2;return Math.max(5,Math.min(95,e+n))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(u)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:{flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"}},b[1]??null))},exports.Stepper=function(e){const{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:l=!1,variant:a="circle"}=e,d="horizontal"===r,c="circle"===a?32:12,u="dot"===a?12:32,f=s(e=>{l&&i&&i(e)},[l,i]),p=[];return t.forEach((e,r)=>{p.push(((e,t)=>{const r=(e=>e<n?"completed":e===n?"active":"pending")(t),i="active"===r,s="completed"===r,p=((e,t,n)=>{const r="dot"===a?u:c,i={width:`${r}px`,height:`${r}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"circle"===a?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return"completed"===n?o("div",{style:{...i,backgroundColor:"#2563eb",color:"#ffffff",border:"2px solid #2563eb"}},"circle"===a?t.icon||"✓":null):"active"===n?o("div",{style:{...i,backgroundColor:"#ffffff",color:"#2563eb",border:"2px solid #2563eb",boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},"circle"===a?t.icon||String(e+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#2563eb"}})):o("div",{style:{...i,backgroundColor:"#ffffff",color:"#9ca3af",border:"2px solid #d1d5db"}},"circle"===a?t.icon||String(e+1):null)})(t,e,r),h={fontSize:"11px",color:"#6b7280",marginTop:"2px",textAlign:d?"center":"left"},g=o("div",{style:d?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:{fontSize:"13px",fontWeight:i?"600":"400",color:i||s?"#1f2937":"#9ca3af",marginTop:d?"8px":"0",marginLeft:d?"0":"12px",textAlign:d?"center":"left",transition:"color 0.2s"}},e.label),e.description?o("span",{style:h},e.description):null),x=o("div",d?{style:{display:"flex",flexDirection:"column",alignItems:"center"}}:{style:{display:"flex",flexDirection:"row",alignItems:"center"}},p,g);return o(l?"button":"div",{key:String(t),onClick:l?()=>f(t):void 0,style:{display:"flex",flexDirection:d?"column":"row",alignItems:d?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:l?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":i?"step":void 0},x)})(e,r));const i=(e=>{if(e>=t.length-1)return null;const r=e<n?"#2563eb":"#d1d5db";return o("div",d?{style:{flex:"1",height:"2px",backgroundColor:r,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}:{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:r,marginLeft:("dot"===a?u:c)/2-1+"px",transition:"background-color 0.2s"}})})(r);i&&p.push(i)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:d?"row":"column",alignItems:d?"flex-start":"stretch",width:"100%"}},...p)},exports.Sunburst=function(e){const{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:l=!0,colors:a=ir,strokeColor:s="#ffffff",strokeWidth:c=1,title:u}=e,f=n/2,p=r/2,h=u?20:0,g=Math.min(f,p-h)-10;if(d(()=>ar(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(f),y:String(p),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));const x=d(()=>function(e,t,n,o){const r=[],i=ar(e);if(i<=0)return r;const l=function(e){let t=0;const n=[{node:e,depth:0}];for(;n.length>0;){const{node:e,depth:o}=n.pop();if(o>t&&(t=o),e.children)for(let t=e.children.length-1;t>=0;t--)n.push({node:e.children[t],depth:o+1})}return t}(e),a=l>0?(n-t)/(l+1):n-t,s=[];if(!(e.children&&e.children.length>0))return r.push({startAngle:0,endAngle:lr,innerR:t,outerR:t+a,label:e.label,value:i,color:e.color??o[0],depth:0}),r;{let t=0;for(let n=0;n<e.children.length;n++){const o=e.children[n],r=ar(o);if(r<=0)continue;const l=r/i*lr;s.push({node:o,startAngle:t,endAngle:t+l,depth:0,colorIndex:n}),t+=l}}for(;s.length>0;){const e=s.shift(),{node:n,startAngle:i,endAngle:l,depth:d,colorIndex:c}=e,u=ar(n);if(u<=0)continue;const f=t+d*a,p=f+a;if(r.push({startAngle:i,endAngle:l,innerR:f,outerR:p,label:n.label,value:u,color:n.color??o[c%o.length],depth:d}),n.children&&n.children.length>0){let e=i;const t=l-i;for(let o=0;o<n.children.length;o++){const r=n.children[o],i=ar(r);if(i<=0)continue;const l=i/u*t;s.push({node:r,startAngle:e,endAngle:e+l,depth:d+1,colorIndex:c}),e+=l}}}return r}(t,i,g,a),[t,i,g,a]),m=[];u&&m.push(o("text",{key:"title",x:String(f),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));const y=p+h/2;for(let e=0;e<x.length;e++){const t=x[e],n=sr(f,y,t.innerR,t.outerR,t.startAngle,t.endAngle);if(m.push(o("path",{key:`arc-${e}`,d:n,fill:t.color,stroke:s,"stroke-width":String(c),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),l){const n=t.endAngle-t.startAngle,r=t.startAngle+n/2-Math.PI/2,i=(t.innerR+t.outerR)/2,l=t.outerR-t.innerR,a=n*i;if(a>20&&l>14){const n=f+i*Math.cos(r),s=y+i*Math.sin(r),d=Math.floor(Math.min(a,l)/7),c=t.label.length>d?t.label.substring(0,Math.max(1,d-1))+"..":t.label;m.push(o("text",{key:`label-${e}`,x:String(n),y:String(s+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},c))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...m)},exports.Tabs=function(e){const t=e.position??"top",n=e.variant??"line",r=e.tabs.find(e=>!e.disabled)?.id??"",[i,a]=l(e.activeTab??r),u=e.activeTab??i,f=c(null),p=s(t=>{a(t),e.onChange&&e.onChange(t)},[e.onChange]),h=s(n=>{const o=e.tabs.filter(e=>!e.disabled),r=o.findIndex(e=>e.id===u);if(-1===r)return;const i="left"===t||"right"===t,l=i?"ArrowUp":"ArrowLeft",a=i?"ArrowDown":"ArrowRight";let s=-1;if(n.key===l?s=r>0?r-1:o.length-1:n.key===a?s=r<o.length-1?r+1:0:"Home"===n.key?s=0:"End"===n.key&&(s=o.length-1),s>=0){n.preventDefault(),p(o[s].id);const t=f.current;if(t){const n=t.querySelectorAll('[role="tab"]')[e.tabs.indexOf(o[s])];n&&n.focus()}}},[e.tabs,u,t,p]),g="left"===t||"right"===t,x="bottom"===t||"right"===t,m=d(()=>({display:"flex",flexDirection:g?x?"row-reverse":"row":x?"column-reverse":"column",width:"100%",...e.style??{}}),[g,x,e.style]),y={display:"flex",flexDirection:g?"column":"row",gap:"pill"===n?"4px":"0",..."line"!==n||g?{}:{borderBottom:"2px solid #e5e7eb"},..."line"===n&&g?{borderRight:"left"===t?"2px solid #e5e7eb":"none",borderLeft:"right"===t?"2px solid #e5e7eb":"none"}:{},..."card"===n?{backgroundColor:"#f9fafb"}:{},..."pill"===n?{padding:"4px"}:{},flexShrink:"0"},b=e.tabs.find(e=>e.id===u),v=e.tabs.map(e=>{const r=e.id===u,i={padding:"8px 16px",border:"none",background:"none",cursor:e.disabled?"not-allowed":"pointer",opacity:e.disabled?"0.5":"1",fontSize:"14px",fontWeight:r?"600":"400",color:r?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return"line"===n?g?"left"===t?(i.borderRight=r?"2px solid #3b82f6":"2px solid transparent",i.marginRight="-2px"):(i.borderLeft=r?"2px solid #3b82f6":"2px solid transparent",i.marginLeft="-2px"):(i.borderBottom=r?"2px solid #3b82f6":"2px solid transparent",i.marginBottom="-2px"):"card"===n?(i.backgroundColor=r?"#ffffff":"transparent",i.borderRadius="6px 6px 0 0",r&&(i.border="1px solid #e5e7eb",i.borderBottom="1px solid #ffffff")):"pill"===n&&(i.borderRadius="9999px",i.backgroundColor=r?"#3b82f6":"transparent",i.color=r?"#ffffff":"#6b7280"),o("button",{key:e.id,role:"tab","aria-selected":String(r),"aria-controls":`tabpanel-${e.id}`,"aria-disabled":e.disabled?"true":void 0,id:`tab-${e.id}`,tabIndex:r?"0":"-1",style:i,onClick:e.disabled?void 0:()=>p(e.id),onKeyDown:h},e.icon?o("span",{className:"tabs__tab-icon"},e.icon):null,e.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:m},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":g?"vertical":"horizontal",style:y,ref:f},...v),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${u}`,"aria-labelledby":`tab-${u}`,style:{flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},tabIndex:"0"},b?b.content:null))},exports.Tag=function(e){const{label:t,color:n,variant:r="subtle",size:i="md",removable:l=!1,onRemove:a,icon:s,onClick:d,disabled:c=!1}=e,u=function(e,t,n,o,r){const i=X[n],l={display:"inline-flex",alignItems:"center",gap:i.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:i.fontSize,fontWeight:"500",padding:i.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...o?{cursor:"pointer"}:{},...r?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...l,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...l,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...l,backgroundColor:G(e,.12),color:e,border:"none"};default:return l}}(function(e){return e??"#3b82f6"}(n),r,i,!!d,c),f=[];return s&&f.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},s)),f.push(o("span",{key:"label"},t)),l&&f.push(o("button",{key:"remove",type:"button",style:V,onClick:e=>{e.stopPropagation(),!c&&a&&a()},"aria-label":`Remove ${t}`,disabled:c},"×")),o("span",{style:u,role:d?"button":void 0,tabIndex:d&&!c?"0":void 0,onClick:!c&&d?d:void 0,onKeyDown:d&&!c?e=>{const t=e.key;"Enter"!==t&&" "!==t||(e.preventDefault(),d())}:void 0,"aria-disabled":c?"true":void 0},...f)},exports.TextEditor=function(e){const[t,n]=l(!1),r=c(null),i=u().replace(/[^a-zA-Z0-9_-]/g,""),d=e.id??i,f=e.toolbar??fe,p=e.toolbarStyle??{},h=e.editorStyle??{};a(()=>{r.current&&void 0!==e.value&&(r.current.innerHTML=e.value)},[]);const g=s((t,n)=>{if(!e.disabled&&!e.readOnly){if("createLink"===t){const e=prompt("Enter URL:");if(!e)return;document.execCommand(t,!1,e)}else n&&"formatBlock"===t?document.execCommand(t,!1,`<${n}>`):document.execCommand(t,!1,n);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),x=s(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),m=s(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),y=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:p.backgroundColor??"#f9fafb",borderBottom:p.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...f.map(t=>{const n=pe[t];return n?o("button",{key:t,type:"button",title:n.label,onClick:()=>g(n.command,n.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:p.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:p.buttonSize??"13px",fontWeight:"bold"===t?"700":"italic"===t?"400":"500",fontStyle:"italic"===t?"italic":"normal",textDecoration:"underline"===t?"underline":"strikethrough"===t?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},n.icon):null})),b=o("div",{ref:r,id:d,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:h.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:h.backgroundColor??"#ffffff",color:h.color??"#1f2937",fontFamily:h.fontFamily??"inherit",fontSize:h.fontSize??"14px",lineHeight:h.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:m,onInput:x});return o(te,{label:e.label,htmlFor:d,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},y,b))},exports.TextField=function(e){const[t,n]=l(!1),r=u().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,a=ne(e.inputStyle??{},{focused:t,error:!!e.error}),s=!(!e.prefix&&!e.suffix),d=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:s?{...a,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:a,onFocus:()=>n(!0),onBlur:t=>{n(!1),e.onBlur&&e.onBlur(t.target.value)},onInput:t=>{const n=t.target.value;e.onInput&&e.onInput(n),e.onChange&&e.onChange(n)},onKeyDown:t=>{"Enter"===t.key&&e.onEnter&&e.onEnter(t.target.value)}}),c=s?o("div",{style:{...a,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,d,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):d;return o(te,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},c)},exports.ThreeDLayers=function(e){const{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:l=35,rotateY:a=45,rotateZ:c=0,showLabels:u=!0,showAxes:f=!0,layerSpacing:p=2,colorScale:h=to,gridColor:g="#94a3b8",title:x}=e,m=d(()=>{let e=0,n=0,o=0;for(let r=0;r<t.length;r++){const i=t[r],l=i.data.length;l>e&&(e=l);for(let e=0;e<l;e++){const t=i.data[e].length;t>n&&(n=t);for(let n=0;n<t;n++){const t=Math.abs(i.data[e][n]??0);t>o&&(o=t)}}}return{maxRows:Math.max(e,1),maxCols:Math.max(n,1),maxHeight:o>0?o:1}},[t]),y=d(()=>{const e=m.maxHeight+(t.length-1)*p+m.maxHeight,o=Math.sqrt(m.maxCols*m.maxCols+m.maxRows*m.maxRows+e*e),i=.75*Math.min(n,r);return o>0?i/o:1},[m,t.length,p,n,r]),b=n/2,v=r/2,w=s((e,t,n)=>function(e,t,n,o,r,i,l,a,s,d){const c=Math.cos(o*no),u=Math.sin(o*no),f=Math.cos(r*no),p=Math.sin(r*no),h=Math.cos(i*no),g=Math.sin(i*no),x=e*h-t*g,m=e*g+t*h,y=x*p+m*f,b=y*u+n*c,v=1+.001*l*b;return{sx:a+(x*f-m*p)*d*v,sy:s-(y*c-n*u)*d*v,depth:b}}(e,t,n,l,a,c,i,b,v,y),[l,a,c,i,b,v,y]),k=s(()=>{if(!f)return[];const e=[];Math.max(m.maxCols,m.maxRows);const n=m.maxCols/2,r=m.maxRows/2,i=w(-n,-r,0),l=w(n,-r,0);e.push(o("line",{key:"axis-x",x1:String(i.sx),y1:String(i.sy),x2:String(l.sx),y2:String(l.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-x-label",x:String(l.sx+8),y:String(l.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));const a=w(-n,r,0);e.push(o("line",{key:"axis-y",x1:String(i.sx),y1:String(i.sy),x2:String(a.sx),y2:String(a.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-y-label",x:String(a.sx-12),y:String(a.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));const s=m.maxHeight+(t.length-1)*p,d=w(-n,-r,s);return e.push(o("line",{key:"axis-z",x1:String(i.sx),y1:String(i.sy),x2:String(d.sx),y2:String(d.sy),stroke:"#374151","stroke-width":"1.5"})),e.push(o("text",{key:"axis-z-label",x:String(d.sx-4),y:String(d.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),e},[f,m,t.length,p,w]),S=s(()=>{const e=[],n=m.maxCols/2,r=m.maxRows/2,i=[];for(let e=0;e<t.length;e++){const o=t[e],l=o.color??h[e%h.length],a=o.opacity??.7,s=e*p,d=o.data.length;for(let t=0;t<d-1;t++){const d=o.data[t],c=o.data[t+1],u=Math.min(d.length,c.length);for(let o=0;o<u-1;o++){const u=o-n,f=o+1-n,p=t-r,h=t+1-r,g=(d[o]??0)+s,x=(d[o+1]??0)+s,m=(c[o]??0)+s,y=(c[o+1]??0)+s,b=w(u,p,g),v=w(f,p,x),k=w(u,h,m),S=w(f,h,y),$=(b.depth+v.depth+k.depth+S.depth)/4,M=`${b.sx},${b.sy} ${v.sx},${v.sy} ${S.sx},${S.sy} ${k.sx},${k.sy}`;i.push({points:M,fill:oo(l,a),stroke:ro(l,.7),strokeWidth:"0.5",depth:$,key:`quad-${e}-${t}-${o}`})}}if(1===d||d>0&&1===o.data[0].length)for(let t=0;t<d;t++){const d=o.data[t];for(let o=0;o<d.length;o++){const c=o-n,u=t-r,f=(d[o]??0)+s,p=w(c,u,f),h=3,g=`${p.sx},${p.sy-h} ${p.sx+h},${p.sy} ${p.sx},${p.sy+h} ${p.sx-h},${p.sy}`;i.push({points:g,fill:oo(l,a),stroke:ro(l,.7),strokeWidth:"0.5",depth:p.depth,key:`point-${e}-${t}-${o}`})}}}i.sort((e,t)=>e.depth-t.depth);for(let t=0;t<i.length;t++){const n=i[t];e.push(o("polygon",{key:n.key,points:n.points,fill:n.fill,stroke:n.stroke,"stroke-width":n.strokeWidth,"stroke-linejoin":"round"}))}return e},[t,m,p,h,w]),$=s(()=>{const e=[],t=m.maxCols/2,n=m.maxRows/2;for(let r=0;r<=m.maxRows;r++){const i=r-n,l=w(-t,i,0),a=w(t,i,0);e.push(o("line",{key:`base-h-${r}`,x1:String(l.sx),y1:String(l.sy),x2:String(a.sx),y2:String(a.sy),stroke:g,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let r=0;r<=m.maxCols;r++){const i=r-t,l=w(i,-n,0),a=w(i,n,0);e.push(o("line",{key:`base-v-${r}`,x1:String(l.sx),y1:String(l.sy),x2:String(a.sx),y2:String(a.sy),stroke:g,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return e},[m,g,w]),M=s(()=>{if(!u)return[];const e=[],n=m.maxCols/2;m.maxRows;for(let r=0;r<t.length;r++){const i=t[r],l=r*p;let a=0,s=0;for(let e=0;e<i.data.length;e++){const t=i.data[e];for(let e=0;e<t.length;e++)a+=t[e]??0,s++}const d=w(n+1,0,(s>0?a/s:0)+l),c=i.color??h[r%h.length];e.push(o("text",{key:`layer-label-${r}`,x:String(d.sx+8),y:String(d.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:c},i.label))}return e},[u,t,m,p,h,w]),z=s(()=>x?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n])(),C=$(),I=k(),A=S(),F=M(),D=0===t.length?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...z,...D,...C,...I,...A,...F)},exports.TimePicker=function(e){const t=u().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:a="24h",minuteStep:c=1,disabled:f=!1,label:p,error:h,showSeconds:g=!1,timezone:x,showTimezone:m=!1,timezones:y=he,onTimezoneChange:b}=e,[v,w]=l(!1),k=d(()=>function(e){const t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}(r),[r]),S="12h"===a,$=k.hour>=12,M=S?k.hour%12||12:k.hour,z=s((e,t,n)=>{const o=Math.max(0,Math.min(23,e)),r=Math.max(0,Math.min(59,t)),l=Math.max(0,Math.min(59,n??0));i(g?`${ge(o)}:${ge(r)}:${ge(l)}`:`${ge(o)}:${ge(r)}`)},[i,g]),C=s(e=>{let t=parseInt(e.target.value,10)||0;S&&(t%=12,$&&(t+=12)),z(t,k.minute,k.second)},[S,$,k.minute,k.second,z]),I=s(e=>{const t=parseInt(e.target.value,10)||0;z(k.hour,t,k.second)},[k.hour,k.second,z]),A=s(e=>{const t=parseInt(e.target.value,10)||0;z(k.hour,k.minute,t)},[k.hour,k.minute,z]),F=s(()=>{if(f)return;const e=$?k.hour-12:k.hour+12;z(e,k.minute,k.second)},[f,$,k.hour,k.minute,k.second,z]),D=s(e=>{f||z(k.hour+e,k.minute,k.second)},[f,k.hour,k.minute,k.second,z]),R=s(e=>{f||z(k.hour,k.minute+e*c,k.second)},[f,k.hour,k.minute,k.second,c,z]),L=s(e=>{f||z(k.hour,k.minute,k.second+e)},[f,k.hour,k.minute,k.second,z]),W=s(e=>{const t=e.target.value;b&&b(t)},[b]),N={display:"inline-flex",alignItems:"center",gap:"4px",...ne({},{focused:v,error:!!h})},T={display:"flex",flexDirection:"column",alignItems:"center"},E={background:"none",border:"none",cursor:f?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},P={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},B={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:f?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},_=o("div",{style:T},o("button",{type:"button",style:E,onClick:()=>D(1),disabled:f},"▲"),o("input",{type:"text",value:ge(M),onChange:C,style:P,disabled:f,"aria-label":"Hour",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:E,onClick:()=>D(-1),disabled:f},"▼")),H=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),Y=o("div",{style:T},o("button",{type:"button",style:E,onClick:()=>R(1),disabled:f},"▲"),o("input",{type:"text",value:ge(k.minute),onChange:I,style:P,disabled:f,"aria-label":"Minute",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:E,onClick:()=>R(-1),disabled:f},"▼")),j=g?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,q=g?o("div",{style:T},o("button",{type:"button",style:E,onClick:()=>L(1),disabled:f},"▲"),o("input",{type:"text",value:ge(k.second),onChange:A,style:P,disabled:f,"aria-label":"Second",onFocus:()=>w(!0),onBlur:()=>w(!1)}),o("button",{type:"button",style:E,onClick:()=>L(-1),disabled:f},"▼")):null,O=S?o("button",{type:"button",style:B,onClick:F,disabled:f,"aria-label":"Toggle AM/PM"},$?"PM":"AM"):null,U={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:f?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},G=x&&!m?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},x):null,X=m?o("select",{style:U,value:x??y[0],onChange:W,disabled:f,"aria-label":"Timezone"},...y.map(e=>o("option",{key:e,value:e},e))):null,V=[_,H,Y];return j&&V.push(j),q&&V.push(q),O&&V.push(O),G&&V.push(G),X&&V.push(X),o(te,{label:p,error:h,disabled:f,htmlFor:n},o("div",{id:n,style:N},...V))},exports.ToastContainer=tt,exports.Toggle=function(e){const{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:l=!1,size:a="md",onColor:d="#3b82f6",offColor:c="#d1d5db"}=e,u=xe[a],f=s(()=>{l||n(!t)},[l,t,n]),p=s(e=>{l||" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n(!t))},[l,t,n]),h={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?d:c,position:"relative",cursor:l?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},g=t?u.trackW-u.thumbSize-u.offset:u.offset,x={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${g}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},m={display:"inline-flex",alignItems:"center",gap:"8px",opacity:l?"0.5":"1",userSelect:"none"},y=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,b=o("div",{style:h},o("div",{style:x}));return o("div",{style:m,onClick:f,onKeyDown:p,tabIndex:l?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":l?"true":void 0,"aria-label":r},...("left"===i?[y,b]:[b,y]).filter(Boolean))},exports.Toolbar=function(e){const{items:t,size:n="md",variant:r="flat"}=e,i=Ee[n],l=t.map(e=>"separator"===e.type?o("div",{key:e.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):"spacer"===e.type?o("div",{key:e.id,style:{flex:"1"},"aria-hidden":"true"}):o(Pe,{key:e.id,item:e,size:n,variant:r}));return o(ke,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:"raised"===r?"1px solid #e5e7eb":"none",borderRadius:"raised"===r?"8px":"0",padding:"4px",backgroundColor:"raised"===r?"#ffffff":"transparent",boxShadow:"raised"===r?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...l)},exports.Tooltip=function(e){const{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:d}=e,[u,f]=l(!1),[p,h]=l(null),g=c(null),x=c(null),m=`tooltip-${Math.random().toString(36).slice(2,9)}`,y=s(()=>{x.current=setTimeout(()=>{if(g.current){const e=g.current.getBoundingClientRect();h(function(e,t){switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:e.top-8+"px",transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+8}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:e.left-8+"px",top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+8}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}(e,n))}f(!0)},r)},[r,n]),b=s(()=>{x.current&&(clearTimeout(x.current),x.current=null),f(!1)},[]);a(()=>()=>{x.current&&clearTimeout(x.current)},[]);const v={...p??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},w=[o("div",{ref:g,style:{display:"inline-block"},onMouseEnter:y,onMouseLeave:b,onFocus:y,onBlur:b,"aria-describedby":u?m:void 0},d)];return u&&p&&w.push(o("div",{id:m,style:v,role:"tooltip"},t,o("div",{style:nt(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...w)},exports.TradingDashboard=Kn,exports.TreeMap=function(e){const{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:l=!0,colors:a=dr,borderColor:s="#ffffff",borderWidth:c=2,padding:u=2,title:f}=e,p=f?30:0,h=u,g=u+p,x=n-2*u,m=r-2*u-p;if(d(()=>cr(t),[t])<=0||x<=0||m<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));const y=d(()=>function(e,t,n,o,r,i){const l=[],a=[],s=cr(e);if(s<=0||o<=0||r<=0)return l;const d=e.children&&e.children.length>0?e.children:[e],c=o*r,u=[];for(let e=0;e<d.length;e++){const t=d[e],n=cr(t);n<=0||u.push({label:t.label,value:n,area:n/s*c,color:t.color??i[e%i.length],node:t})}for(u.sort((e,t)=>t.area-e.area),a.push({nodes:u,rect:{x:t,y:n,w:o,h:r},depth:0});a.length>0;){const e=a.shift(),{nodes:t,rect:n,depth:o}=e;if(0===t.length)continue;let r={...n},s=0;for(;s<t.length&&r.w>0&&r.h>0;){const e=r.w>=r.h,n=e?r.h:r.w,d=[],c=[];d.push(t[s]),c.push(t[s].area),s++;let u=ur(c,n);for(;s<t.length;){const e=ur([...c,t[s].area],n);if(e>u)break;d.push(t[s]),c.push(t[s].area),u=e,s++}let f=0;for(const e of c)f+=e;const p=n>0?f/n:0;let h=0;for(let t=0;t<d.length;t++){const n=d[t],s=p>0?n.area/p:0;let c,u,f,g;if(e?(c=r.x,u=r.y+h,f=p,g=s):(c=r.x+h,u=r.y,f=s,g=p),l.push({x:c,y:u,w:f,h:g,label:n.label,value:n.value,color:n.color,depth:o}),n.node.children&&n.node.children.length>0){const e=2,t=c+e,r=u+e+14,l=f-2*e,s=g-2*e-14;if(l>4&&s>4){const e=[],d=n.value,c=l*s;for(let t=0;t<n.node.children.length;t++){const r=n.node.children[t],l=cr(r);l<=0||e.push({label:r.label,value:l,area:l/d*c,color:r.color??i[(t+o+1)%i.length],node:r})}e.sort((e,t)=>t.area-e.area),a.push({nodes:e,rect:{x:t,y:r,w:l,h:s},depth:o+1})}}h+=s}r=e?{x:r.x+p,y:r.y,w:r.w-p,h:r.h}:{x:r.x,y:r.y+p,w:r.w,h:r.h-p}}}return l}(t,h,g,x,m,a),[t,h,g,x,m,a]),b=[];f&&b.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},f));for(let e=0;e<y.length;e++){const t=y[e];if(b.push(o("rect",{key:`cell-${e}`,x:String(t.x),y:String(t.y),width:String(Math.max(0,t.w)),height:String(Math.max(0,t.h)),fill:t.color,stroke:s,"stroke-width":String(c),role:"graphics-symbol","aria-label":`${t.label}: ${t.value}`})),i&&t.w>20&&t.h>14){const n=Math.floor(t.w/7),r=t.label.length>n?t.label.substring(0,Math.max(1,n-2))+"..":t.label;b.push(o("text",{key:`label-${e}`,x:String(t.x+4),y:String(t.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},r))}l&&t.w>30&&t.h>28&&b.push(o("text",{key:`value-${e}`,x:String(t.x+4),y:String(t.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(t.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":f??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)},exports.TreeNav=function(e){const{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:a,expandAll:c=!1,lineColor:u="#000",lineWidth:f=1,indentPx:p=20,iconExpanded:h="−",iconCollapsed:g="+",nodeStyle:x={},wrapperStyle:m,renderNode:y}=e,[b,v]=l(()=>{const e=Be.fromData(t);return c&&_e(e),e}),[w,k]=l(t.id),S=d(()=>He(b),[b]),$=s(()=>{v(e=>{const t=Object.create(Object.getPrototypeOf(e));return Object.assign(t,e),t})},[]),M=s(e=>{e.toggle(),e.expanded?r?.(e):i?.(e),$()},[r,i,$]),z=s(e=>{k(e.id),n?.(e)},[n]),C=s(e=>{const t=e;if(!w)return;const n=S.findIndex(e=>e.id===w);if(-1===n)return;const o=S[n];switch(t.key){case"ArrowDown":{t.preventDefault();const e=S[n+1];e&&k(e.id);break}case"ArrowUp":{t.preventDefault();const e=S[n-1];e&&k(e.id);break}case"ArrowRight":t.preventDefault(),o.isLeaf()||(o.expanded?o.children.length>0&&k(o.children[0].id):M(o));break;case"ArrowLeft":t.preventDefault(),!o.isLeaf()&&o.expanded?M(o):o.parent&&k(o.parent.id);break;case"Enter":t.preventDefault(),z(o);break;case" ":t.preventDefault(),o.isLeaf()||M(o);break;case"Home":t.preventDefault(),S.length>0&&k(S[0].id);break;case"End":t.preventDefault(),S.length>0&&k(S[S.length-1].id)}},[w,S,M,z]),I=S.map(e=>o(je,{key:e.id,node:e,isSelected:e.id===a,indentPx:p,lineColor:u,lineWidth:f,iconExpanded:h,iconCollapsed:g,nodeStyle:x,renderNode:y,onToggle:M,onClick:z,focusedId:w}));return o(ke,{role:"tree",ariaLabel:"Tree navigation",styling:m,keyboardNav:!1},o("div",{onKeyDown:C,style:{outline:"none"}},...I))},exports.TreeNode=Be,exports.USStateMap=function(e){const{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:l="#FFFFFF",strokeWidth:a=1,onStateClick:c,onStateHover:u,hoverColor:f="#FFD700",title:p="Map of the United States"}=e,h=d(()=>Object.keys(_o),[]),g=s(e=>{c&&c(e)},[c]),x=s((e,t)=>{const n=t.currentTarget;n&&n.setAttribute("fill",f),u&&u(e)},[u,f]),m=s((e,t)=>{const n=t.currentTarget;if(n){const t=r[e]??i;n.setAttribute("fill",t)}u&&u(null)},[u,r,i]),y=d(()=>{const e=[];for(let t=0;t<h.length;t++){const n=h[t],s=_o[n],d=r[n]??i,u={key:`state-${n}`,d:s.path,fill:d,stroke:l,"stroke-width":String(a),"stroke-linejoin":"round","data-state":n,role:"img","aria-label":s.name,style:{cursor:c?"pointer":"default"}};if(c){const e=n;u.onClick=()=>g(e),u.onKeyDown=t=>{"Enter"!==t.key&&" "!==t.key||g(e)},u.tabindex=0,u.role="button",u["aria-label"]=s.name}const f=n;u.onMouseOver=e=>x(f,e),u.onMouseOut=e=>m(f,e),e.push(o("path",u))}return e},[h,r,i,l,a,c,g,x,m]),b=o("title",{key:"map-title"},p);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p,style:{fontFamily:"sans-serif"}},b,...y)},exports.US_STATE_PATHS=_o,exports.UnityApp=function(e){const{id:t,title:n,icon:r,defaultPosition:l,defaultSize:a,minSize:c,resizable:u=!0,onClose:f,children:p}=e,h=(x=Nt,i().useContext(x)),g=d(()=>h.windows.find(e=>e.id===t),[h.windows,t]);var x;if(!g)return h.openWindow({id:t,title:n,icon:r,position:l,size:a}),null;const m=s(()=>{h.closeWindow(t),f&&f()},[h,t,f]),y=s(()=>{h.focusWindow(t)},[h,t]),b=s(e=>{h.moveWindow(t,e)},[h,t]),v=s(e=>{h.resizeWindow(t,e)},[h,t]),w=s(()=>{h.minimizeWindow(t)},[h,t]),k=s(()=>{g&&"maximized"===g.windowState?h.restoreWindow(t):h.maximizeWindow(t)},[h,t,g]);return o(hn,{id:t,title:n,icon:r,defaultPosition:g.position,defaultSize:g.size,minSize:c,resizable:u,windowState:g.windowState,focused:g.focused,zIndex:g.zIndex,onClose:m,onFocus:y,onMove:b,onResize:v,onMinimize:w,onMaximize:k,children:p})},exports.UnityDesktop=function(e){const{apps:t,user:n,onAppOpen:r,onLogout:i,theme:l="dark",children:a}=e;return o(qt,{onWindowOpen:r},o(Jn,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:l,children:a}))},exports.VectorField=function(e){const{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:l=15,xRange:u=[-5,5],yRange:f=[-5,5],arrowScale:p=1,arrowColor:h="#3b82f6",showGrid:g=!0,showAxes:x=!0,colorByMagnitude:m=!1,colorScale:y=["#3b82f6","#8b5cf6","#ef4444"],title:b,padding:v=50,tickFontSize:w=10,arrowWidth:k=1.5,renderer:S="svg",useGPU:$=!1,computeWorker:M}=e,z=Math.max(2,Math.min(50,l)),C=r-2*v,I=i-2*v,A=u[0],F=u[1],D=f[0],R=f[1],L=F-A,W=R-D,N=d(()=>e=>v+(e-A)/L*C,[v,A,L,C]),T=d(()=>e=>v+(R-e)/W*I,[v,R,W,I]),E=d(()=>function(e,t,n,o,r,i,l,a,s,d){if(e&&e.length>0)return e;const c=Math.max(2,Math.min(50,o)),u=s/(c-1),f=d/(c-1);if(n){const e=[];for(let t=0;t<c;t++)for(let n=0;n<c;n++)e.push({x:r+n*u,y:l+t*f});const t=n(e,{gridSize:c,xMin:r,xMax:i,yMin:l,yMax:a}),o=[];for(let n=0;n<e.length;n++){const r=e[n],i=t[n]??{dx:0,dy:0},l=Math.sqrt(i.dx*i.dx+i.dy*i.dy);o.push({x:r.x,y:r.y,dx:i.dx,dy:i.dy,magnitude:l})}return o}if(!t)return[];const p=[];for(let e=0;e<c;e++)for(let n=0;n<c;n++){const o=r+n*u,i=l+e*f,a=t(o,i),s=Math.sqrt(a.dx*a.dx+a.dy*a.dy);p.push({x:o,y:i,dx:a.dx,dy:a.dy,magnitude:s})}return p}(t,n,M,z,A,F,D,R,L,W),[t,n,M,z,A,F,D,R,L,W]),P=d(()=>{let e=0;for(let t=0;t<E.length;t++){const n=E[t],o=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);o>e&&(e=o)}return e>0?e:1},[E]),B=d(()=>Math.min(C,I)/Math.max(z,2)/(2*P)*p,[C,I,z,P,p]);if("canvas"===S){const e=c(null),t=c(0);return a(()=>{const n=e.current;if(!n)return;const o=n.getContext("2d");return o?(t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(()=>{!function(e,t,n,o,r){const{padding:i,chartWidth:l,chartHeight:a,xMin:s,xMax:d,yMin:c,yMax:u,xSpan:f,ySpan:p,showGrid:h,showAxes:g,colorByMagnitude:x,colorScale:m,arrowColor:y,arrowWidth:b,effectiveArrowScale:v,maxMagnitude:w,title:k,tickFontSize:S}=r,$=e=>i+(e-s)/f*l,M=e=>i+(u-e)/p*a;if(e.clearRect(0,0,t,n),k&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(k,t/2,i/2+4),e.restore()),h){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${S}px sans-serif`,e.fillStyle="#6b7280";const t=hr(f,10);for(let n=Math.ceil(s/t)*t;n<=d;n+=t){const t=$(n);e.beginPath(),e.moveTo(t,i),e.lineTo(t,i+a),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(100*n)/100),t,i+a+4)}const n=hr(p,10);for(let t=Math.ceil(c/n)*n;t<=u;t+=n){const n=M(t);e.beginPath(),e.moveTo(i,n),e.lineTo(i+l,n),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(100*t)/100),i-6,n)}e.restore()}if(g){if(e.save(),e.strokeStyle="#374151",e.lineWidth=b,c<=0&&u>=0){const t=M(0);e.beginPath(),e.moveTo(i,t),e.lineTo(i+l,t),e.stroke()}if(s<=0&&d>=0){const t=$(0);e.beginPath(),e.moveTo(t,i),e.lineTo(t,i+a),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(i,i,l,a),e.restore()}for(let t=0;t<o.length;t++){const n=o[t],r=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);if(r<1e-10)continue;const i=$(n.x),l=M(n.y),a=n.dx*v,s=-n.dy*v,d=i+a,c=l+s;let u;u=x?pr(r/w,m):y,e.save(),e.strokeStyle=u,e.lineWidth=b,e.lineCap="round",e.beginPath(),e.moveTo(i,l),e.lineTo(d,c),e.stroke();const f=Math.sqrt(a*a+s*s);if(f>2){const t=a/f,n=s/f,o=-n,r=t,i=Math.min(4,.4*f),l=d-t*i+o*i*.5,p=c-n*i+r*i*.5,h=d-t*i-o*i*.5,g=c-n*i-r*i*.5;e.fillStyle=u,e.beginPath(),e.moveTo(d,c),e.lineTo(l,p),e.lineTo(h,g),e.closePath(),e.fill()}e.restore()}}(o,r,i,E,{padding:v,chartWidth:C,chartHeight:I,xMin:A,xMax:F,yMin:D,yMax:R,xSpan:L,ySpan:W,showGrid:g,showAxes:x,colorByMagnitude:m,colorScale:y,arrowColor:h,arrowWidth:k,effectiveArrowScale:B,maxMagnitude:P,title:b,tickFontSize:w})}),()=>{t.current&&cancelAnimationFrame(t.current)}):void 0},[E,r,i,v,C,I,A,F,D,R,L,W,g,x,m,y,h,k,B,P,b,w]),o("canvas",{ref:e,width:r,height:i,role:"img","aria-label":b??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}const _=s(()=>{if(!g)return[];const e=[],t=hr(L,10);for(let n=Math.ceil(A/t)*t;n<=F;n+=t){const t=N(n);e.push(o("line",{key:`gridv-${n}`,x1:String(t),y1:String(v),x2:String(t),y2:String(v+I),stroke:"#e5e7eb","stroke-width":"0.5"})),e.push(o("text",{key:`xtick-${n}`,x:String(t),y:String(v+I+16),"text-anchor":"middle","font-size":String(w),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(100*n)/100)))}const n=hr(W,10);for(let t=Math.ceil(D/n)*n;t<=R;t+=n){const n=T(t);e.push(o("line",{key:`gridh-${t}`,x1:String(v),y1:String(n),x2:String(v+C),y2:String(n),stroke:"#e5e7eb","stroke-width":"0.5"})),e.push(o("text",{key:`ytick-${t}`,x:String(v-6),y:String(n+4),"text-anchor":"end","font-size":String(w),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(100*t)/100)))}return e},[g,A,F,D,R,L,W,N,T,v,C,I]),H=s(()=>{if(!x)return[];const e=[];if(D<=0&&R>=0){const t=T(0);e.push(o("line",{key:"axis-x",x1:String(v),y1:String(t),x2:String(v+C),y2:String(t),stroke:"#374151","stroke-width":String(k)}))}if(A<=0&&F>=0){const t=N(0);e.push(o("line",{key:"axis-y",x1:String(t),y1:String(v),x2:String(t),y2:String(v+I),stroke:"#374151","stroke-width":String(k)}))}return e.push(o("rect",{key:"chart-border",x:String(v),y:String(v),width:String(C),height:String(I),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),e},[x,A,F,D,R,N,T,v,C,I]),Y=s(()=>{const e=[];for(let t=0;t<E.length;t++){const n=E[t],r=n.magnitude??Math.sqrt(n.dx*n.dx+n.dy*n.dy);if(r<1e-10)continue;const i=N(n.x),l=T(n.y),a=n.dx*B,s=-n.dy*B,d=i+a,c=l+s;let u;u=m?pr(r/P,y):h,e.push(o("line",{key:`arrow-line-${t}`,x1:String(i),y1:String(l),x2:String(d),y2:String(c),stroke:u,"stroke-width":String(k),"stroke-linecap":"round"}));const f=Math.sqrt(a*a+s*s);if(f>2){const n=a/f,r=s/f,i=-r,l=n,p=Math.min(4,.4*f),h=d-n*p+i*p*.5,g=c-r*p+l*p*.5,x=d-n*p-i*p*.5,m=c-r*p-l*p*.5;e.push(o("polygon",{key:`arrow-head-${t}`,points:`${d},${c} ${h},${g} ${x},${m}`,fill:u}))}}return e},[E,N,T,B,m,P,y,h]),j=s(()=>b?[o("text",{key:"title",x:String(r/2),y:String(v/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},b)]:[],[b,r,v]),q=_(),O=H(),U=Y(),G=j();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":b??"Vector field plot",style:{fontFamily:"sans-serif"}},...G,...q,...O,...U)},exports.VideoPlayer=function(e){const t=!1!==e.controls,n=c(null);u().replace(/[^a-zA-Z0-9_-]/g,"");const[r,i]=l(!1),[d,f]=l(0),[p,h]=l(0),[g,x]=l(e.muted?0:1),[m,y]=l(!!e.muted),[b,v]=l(!0),w="number"==typeof e.width?`${e.width}px`:e.width??"100%",k="number"==typeof e.height?`${e.height}px`:e.height??"auto";a(()=>{const t=n.current;if(!t)return;const o=()=>{i(!0),e.onPlay&&e.onPlay()},r=()=>{i(!1),e.onPause&&e.onPause()},l=()=>{i(!1),e.onEnded&&e.onEnded()},a=()=>{f(t.currentTime),h(t.duration),e.onTimeUpdate&&e.onTimeUpdate(t.currentTime,t.duration)},s=()=>{h(t.duration)};return t.addEventListener("play",o),t.addEventListener("pause",r),t.addEventListener("ended",l),t.addEventListener("timeupdate",a),t.addEventListener("loadedmetadata",s),()=>{t.removeEventListener("play",o),t.removeEventListener("pause",r),t.removeEventListener("ended",l),t.removeEventListener("timeupdate",a),t.removeEventListener("loadedmetadata",s)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);const S=s(()=>{const e=n.current;e&&(e.paused?e.play():e.pause())},[]),$=s(e=>{const t=n.current;if(!t||!isFinite(t.duration))return;const o=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.min(1,(e.clientX-o.left)/o.width));t.currentTime=r*t.duration},[]),M=s(e=>{const t=n.current,o=parseFloat(e.target.value);t&&(t.volume=o,t.muted=0===o,x(o),y(0===o))},[]),z=s(()=>{const e=n.current;e&&e.requestFullscreen&&e.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,style:{width:w,height:k,display:"block"}});const C=p>0?d/p*100:0,I={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},A=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:b?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":r?"Pause":"Play",onclick:S,style:I},r?"⏸":"▶"),o("div",{onclick:$,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${C}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${we(d)} / ${we(p)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(m?0:g),oninput:M,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:z,style:I},"⛶"));return o("div",{style:{position:"relative",width:w,height:k,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>v(!0),onmouseleave:()=>{r&&v(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:!!e.autoPlay||void 0,loop:!!e.loop||void 0,muted:!!e.muted||void 0,playsinline:!0,onclick:S,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),A)},exports.VirtualScroll=function(e){const{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:a}=e,[d,u]=l(0),f=c(null),p=t.length*r,h=parseInt(a,10)||400,g=Math.ceil(h/r),x=Math.max(0,Math.floor(d/r)-i),m=Math.min(t.length,Math.floor(d/r)+g+i),y=s(e=>{const t=e.target;u(t.scrollTop)},[]),b=[];for(let e=x;e<m;e++)b.push(o("div",{key:String(e),style:{position:"absolute",top:e*r+"px",left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[e],e)));return o("div",{ref:f,style:{...K,height:a},onScroll:y},o("div",{style:{height:`${p}px`,position:"relative",width:"100%"}},...b))},exports.VizWrapper=function(e){const t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",l=e.gap??"12px",a=e.contain??"layout style paint",s={display:"flex",flexDirection:"column",gap:l,width:"number"==typeof e.width?`${e.width}px`:e.width??"auto",height:"number"==typeof e.height?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:a,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,c=e.legend&&e.legend.length>0?(u=e.legend,o("div",{className:"viz-legend",style:{display:"flex",flexDirection:(f={align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:"left"===n||"right"===n?"column":"row"}).direction,flexWrap:"wrap",gap:`${f.gap}px`,justifyContent:f.align,alignItems:"center",fontSize:f.fontSize,color:"#6b7280",flexShrink:"0"}},...u.map((e,t)=>o("div",{key:`legend-${t}`,style:{display:"flex",alignItems:"center",gap:"6px"}},function(e){const t=e.shape??"circle";return"line"===t?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):o("div","square"===t?{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}:{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}(e),o("span",null,e.label))))):null;var u,f;const p=function(e,t,n,r,i){const l=[];if("top"===r&&e&&l.push(e),"left"===i||"right"===i){const a=[];"left"===i&&n&&a.push(n),"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),"right"===i&&n&&a.push(n),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...a))}else if("left"===r||"right"===r){"top"===i&&n&&l.push(n);const a=[];"left"===r&&e&&a.push(e),a.push(t),"right"===r&&e&&a.push(e),l.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...a)),"bottom"===i&&n&&l.push(n)}else"top"===i&&n&&l.push(n),l.push(t),"bottom"===i&&n&&l.push(n);return"bottom"===r&&e&&l.push(e),l}(d,o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),c,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:s},...p)},exports.WaterfallChart=function(e){const{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:l="#ef4444",totalColor:a="#3b82f6",connectorColor:c="#94a3b8",showValues:u=!0,showGrid:f=!0,showConnectors:p=!0,title:h,padding:g=60}=e,x=n-2*g,m=r-2*g,y=d(()=>function(e){const t=[];let n=0;for(let o=0;o<e.length;o++){const r=e[o],i=r.type??(r.value>=0?"increase":"decrease");if("total"===i)t.push({label:r.label,value:n,type:"total",start:0,end:n});else{const e=n;n+=r.value,t.push({label:r.label,value:r.value,type:i,start:e,end:n})}}return t}(t),[t]),{minVal:b,maxVal:v}=d(()=>{let e=0,t=0;for(let n=0;n<y.length;n++){const o=y[n];o.start<e&&(e=o.start),o.end<e&&(e=o.end),o.start>t&&(t=o.start),o.end>t&&(t=o.end)}return e===t&&(t=e+1),{minVal:e,maxVal:t}},[y]),w=v-b,k=s(e=>g+m-(e-b)/w*m,[g,m,b,w]),S=d(()=>0===y.length?0:x/y.length,[y.length,x]),$=Math.max(1,S-6),M=s(()=>{if(!f)return[];const e=function(e){if(e<=0)return 1;const t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),o=t/n;return o<=1.5?n:o<=3.5?2*n:o<=7.5?5*n:10*n}(w),t=[];for(let n=Math.ceil(b/e)*e;n<=v;n+=e){const e=k(n);t.push(o("line",{key:`grid-${n}`,x1:String(g),y1:String(e),x2:String(g+x),y2:String(e),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),t.push(o("text",{key:`grid-label-${n}`,x:String(g-8),y:String(e+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(n)))}return t},[f,w,b,v,k,g,x]),z=s(()=>{const e=[];e.push(o("line",{key:"axis-y",x1:String(g),y1:String(g),x2:String(g),y2:String(g+m),stroke:"#374151","stroke-width":"1.5"}));const t=b<=0&&v>=0?k(0):g+m;return e.push(o("line",{key:"axis-x",x1:String(g),y1:String(t),x2:String(g+x),y2:String(t),stroke:"#374151","stroke-width":"1.5"})),e},[g,x,m,b,v,k]),C=s(()=>{if(0===y.length)return[];const e=[];for(let t=0;t<y.length;t++){const n=y[t],r=g+t*S+3,s=Math.max(n.start,n.end),d=Math.min(n.start,n.end),f=k(s),h=k(d),x=Math.max(0,h-f);let b;if(b="total"===n.type?a:"decrease"===n.type?l:i,e.push(o("rect",{key:`bar-${t}`,x:String(r),y:String(f),width:String($),height:String(x),fill:b,rx:"2",ry:"2"})),u){const i="decrease"===n.type||n.value<0?h+14:f-4,l="total"===n.type?String(n.value):(n.value>=0?"+":"")+String(n.value);e.push(o("text",{key:`val-${t}`,x:String(r+$/2),y:String(i),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},l))}if(e.push(o("text",{key:`cat-${t}`,x:String(r+$/2),y:String(g+m+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},n.label)),p&&t<y.length-1){const i=y[t+1],l=k(n.end),a=g+(t+1)*S+3;"total"!==i.type&&e.push(o("line",{key:`conn-${t}`,x1:String(r+$),y1:String(l),x2:String(a),y2:String(l),stroke:c,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return e},[y,S,$,k,i,l,a,c,u,p,g,m]),I=s(()=>h?[o("text",{key:"title",x:String(n/2),y:String(g/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,g]),A=s(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),F=M(),D=z(),R=C(),L=I(),W=A();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Waterfall chart",style:{fontFamily:"sans-serif"}},...L,...F,...D,...R,...W)},exports.WordCloud=function(e){const{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:l=64,fontFamily:a="sans-serif",colors:s=gr,rotations:c=xr,padding:u=4,spiral:f="archimedean",title:p}=e,h=d(()=>{if(0===t.length)return[];const e=t.map((e,t)=>({...e,originalIndex:t})).filter(e=>e.text.length>0&&e.weight>0).sort((e,t)=>t.weight-e.weight);if(0===e.length)return[];const o=e[e.length-1].weight,a=e[0].weight-o;function d(e){return 0===a?(i+l)/2:i+(e-o)/a*(l-i)}const p=[],h=n/2,g=r/2;for(let t=0;t<e.length;t++){const o=e[t],i=d(o.weight),l=c[vr(o.text)%c.length],a=o.color??s[t%s.length];let x=!1;const m=500,y="archimedean"===f?4:5;for(let e=0;e<m;e++){let t,s;if("archimedean"===f){const n=.1*e,o=y*n;t=o*Math.cos(n),s=o*Math.sin(n)}else{const n=Math.floor(e/4)+1,o=(e%4==0?0:e)*y;switch(e%4){case 0:t=n*y*4,s=o;break;case 1:t=-o,s=n*y*4;break;case 2:t=-n*y*4,s=-o;break;default:t=o,s=-n*y*4}}const d=h+t,c=g+s,m=mr(o.text,i,l,d,c),b={x:m.x-u,y:m.y-u,w:m.w+2*u,h:m.h+2*u};if(!br(b,n,r))continue;let v=!1;for(const e of p)if(yr(b,e.bbox)){v=!0;break}if(!v){p.push({text:o.text,x:d,y:c,fontSize:i,rotation:l,color:a,bbox:b}),x=!0;break}}}return p},[t,n,r,i,l,s,c,u,f]);if(0===t.length||0===h.length)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Word cloud — no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":a,fill:"currentColor",opacity:"0.6"},"No words to display."));const g=[];p&&g.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":a,fill:"currentColor"},p));for(let e=0;e<h.length;e++){const t=h[e],n=0!==t.rotation?`translate(${t.x},${t.y}) rotate(${t.rotation})`:`translate(${t.x},${t.y})`;g.push(o("text",{key:`word-${e}`,transform:n,"text-anchor":"middle","dominant-baseline":"central","font-size":String(t.fontSize),"font-family":a,fill:t.color,"aria-label":t.text},t.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Word cloud",style:{fontFamily:a}},...g)},exports.WordProcessor=kn,exports.applyGate=co,exports.blochToCartesian=lo,exports.buildInputStyle=ne,exports.buildNavItemStyle=Se,exports.buildRotationMatrix=zt,exports.cartesianToBloch=ao,exports.computeBoxStats=fo,exports.computeMandelbrotGrid=function(e,t,n=[-2.5,1],o=[-1.25,1.25],r=80,i=ht){const l=[];for(let a=0;a<t;a++){const s=[],d=o[1]-a/t*(o[1]-o[0]);for(let t=0;t<e;t++){const o=n[0]+t/e*(n[1]-n[0]);s.push(i(o,d,r))}l.push(s)}return l},exports.computeSlices=kt,exports.createToaster=Je,exports.describeArc=wt,exports.generateEdges=Mt,exports.generateHypercube=Rt,exports.generatePalette=Wt,exports.generateVertices=$t,exports.numRotationAngles=Lt,exports.projectTo2D=Dt,exports.transformVec=Ft,exports.useBarGraphScales=ot,exports.useHover=$e,exports.useHypercube=function(e={}){const t=e.dimension??4,n=e.rotationSpeed??.008,o=e.perspective??.25,r=e.scale??200,i=Lt(t),[s,c]=l(()=>new Array(i).fill(0));return a(()=>{if(0===n)return;let e=!0,t=0;const o=()=>{e&&(c(e=>e.map((e,t)=>e+n*(1+.3*t))),t=requestAnimationFrame(o))};return t=requestAnimationFrame(o),()=>{e=!1,cancelAnimationFrame(t)}},[n]),{data:d(()=>Rt(t,s,o,r),[t,s,o,r]),angles:s,setAngles:c}},exports.useLineGraphScales=mt,exports.useToast=function(e={}){const t=c(null);t.current||(t.current=Je(e));const n=t.current,r=s(()=>o(tt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}};
1
+ /* (c) 2025-2026 Asymmetric Effort, LLC. MIT LICENSE */
2
+ "use strict";var ot=Object.defineProperty;var $i=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var zi=Object.prototype.hasOwnProperty;var Ti=(e,t,n)=>t in e?ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ii=(e,t)=>{for(var n in t)ot(e,n,{get:t[n],enumerable:!0})},Di=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ri(t))!zi.call(e,i)&&i!==n&&ot(e,i,{get:()=>t[i],enumerable:!(r=$i(t,i))||r.enumerable});return e};var Ai=e=>Di(ot({},"__esModule",{value:!0}),e);var ze=(e,t,n)=>Ti(e,typeof t!="symbol"?t+"":t,n);var Uc={};Ii(Uc,{Accordion:()=>wo,Alert:()=>Fn,AnalogClock:()=>wn,Avatar:()=>Mn,Badge:()=>Pn,BarGraph:()=>jo,BigNumber:()=>Or,BlochSphere:()=>Vr,BoxPlot:()=>Yr,Breadcrumb:()=>ko,BubbleChart:()=>Ur,Button:()=>Nr,CalendarHeatMap:()=>qr,Card:()=>so,Carousel:()=>xo,CartesianGraph2D:()=>er,Checkbox:()=>On,ChordDiagram:()=>Kr,ColorPicker:()=>Yn,ColorWheel:()=>Gn,ComplexGraph2D:()=>rr,ContextMenu:()=>dt,DataGrid:()=>zn,DatePicker:()=>Xn,DecompositionTree:()=>Zr,DigitalClock:()=>Tn,DiscreteCartesian2D:()=>Ei,Drawer:()=>Bo,Dropdown:()=>Mo,EmptyState:()=>Wn,FileUpload:()=>qn,FlexContainer:()=>ao,FlexItem:()=>lo,Footer:()=>br,ForceGraph:()=>ti,FormFieldWrapper:()=>me,FunnelChart:()=>oi,GanttChart:()=>si,Gauge:()=>li,GoogleAnalytics:()=>hr,Grid:()=>co,GridItem:()=>uo,HeatMap:()=>di,Histogram:()=>ui,HypercubeGraph:()=>pr,IDE:()=>gt,Image:()=>yo,LineGraph:()=>lr,ListView:()=>In,LollipopChart:()=>fi,Matrix:()=>pi,Menubar:()=>Eo,Modal:()=>Ho,MultilineField:()=>Kn,NavWrapper:()=>xe,NumberSpinner:()=>Zn,Pagination:()=>Ro,Panel:()=>po,Partition:()=>mi,PieGraph:()=>cr,PivotTable:()=>hi,PolarGraph2D:()=>ur,Popover:()=>Oo,ProgressBar:()=>Nn,RadarChart:()=>bi,RadioGroup:()=>Jn,SankeyDiagram:()=>xi,ScrollContainer:()=>go,Select:()=>Qn,Sidebar:()=>To,Skeleton:()=>Bn,Slider:()=>eo,Spinner:()=>_n,Splitter:()=>ho,Stepper:()=>Io,Sunburst:()=>yi,Tabs:()=>bo,Tag:()=>Dn,TextEditor:()=>to,TextField:()=>no,ThreeDLayers:()=>_r,TimePicker:()=>oo,ToastContainer:()=>Wt,Toggle:()=>ro,Toolbar:()=>Ao,Tooltip:()=>Yo,TradingDashboard:()=>xt,TreeMap:()=>vi,TreeNav:()=>Wo,TreeNode:()=>Ve,USStateMap:()=>ci,US_STATE_PATHS:()=>et,UnityApp:()=>Lr,UnityDesktop:()=>Ar,VectorField:()=>Ci,VideoPlayer:()=>vo,VirtualScroll:()=>An,VizWrapper:()=>gr,WaterfallChart:()=>Mi,WordCloud:()=>Pi,WordProcessor:()=>mt,applyGate:()=>sn,blochToCartesian:()=>qe,buildInputStyle:()=>Pe,buildNavItemStyle:()=>Oe,buildRotationMatrix:()=>Yt,cartesianToBloch:()=>St,computeBoxStats:()=>ln,computeMandelbrotGrid:()=>or,computeSlices:()=>_t,createToaster:()=>Ft,describeArc:()=>Ht,generateEdges:()=>Vt,generateHypercube:()=>Ke,generatePalette:()=>pt,generateVertices:()=>Ot,numRotationAngles:()=>Ze,projectTo2D:()=>Ut,transformVec:()=>Gt,useBarGraphScales:()=>Nt,useHover:()=>he,useHypercube:()=>mr,useLineGraphScales:()=>Bt,useToast:()=>Vo});module.exports=Ai(Uc);var rt=Symbol.for("spec.element"),Li=Symbol.for("spec.fragment"),Xc=Symbol.for("spec.portal"),gn=Symbol.for("spec.provider"),hn=Symbol.for("spec.consumer"),Fi=Symbol.for("spec.forward_ref"),Wi=Symbol.for("spec.memo"),Ni=Symbol.for("spec.lazy"),Bi=Symbol.for("spec.suspense"),Hi=Symbol.for("spec.strict_mode"),_i=Symbol.for("spec.profiler");function o(e,t,...n){let r=null,i=null,s={};if(t!=null){t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(i=t.ref);for(let l in t)Object.prototype.hasOwnProperty.call(t,l)&&l!=="key"&&l!=="ref"&&l!=="__proto__"&&l!=="constructor"&&l!=="prototype"&&(s[l]=t[l])}if(n.length===1?s.children=n[0]:n.length>1&&(s.children=n),typeof e=="function"&&e.defaultProps){let l=e.defaultProps;for(let a of Object.keys(l))a!=="__proto__"&&a!=="constructor"&&s[a]===void 0&&(s[a]=l[a])}return{$$typeof:rt,type:e,props:s,key:r,ref:i}}function Le(e){let t={$$typeof:Symbol.for("spec.context"),Provider:null,Consumer:null,_currentValue:e,_defaultValue:e},n={$$typeof:gn,_context:t},r={$$typeof:hn,_context:t};return t.Provider=n,t.Consumer=r,t}var He=class{constructor(t){this._fiber=null;this._pendingState=[];this._forceUpdate=!1;this.props=t,this.state={},this.context=void 0}setState(t,n){this._pendingState.push(t),this._enqueueUpdate(n)}forceUpdate(t){this._forceUpdate=!0,this._enqueueUpdate(t)}render(){return null}_enqueueUpdate(t){}};He.prototype.isSpecComponent=!0;var it=class extends He{shouldComponentUpdate(t,n){return!xn(this.props,t)||!xn(this.state,n)}};it.prototype.isPureSpecComponent=!0;function xn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;let i=e,s=t;for(let l of n)if(!Object.prototype.hasOwnProperty.call(s,l)||!Object.is(i[l],s[l]))return!1;return!0}var yn=null;function Fe(){if(yn===null)throw new Error("Invalid hook call. Hooks can only be called inside the body of a function component.");return yn}function X(e){return Fe().useState(e)}function se(e,t){return Fe().useEffect(e,t)}function Te(e){return Fe().useContext(e)}function M(e,t){return Fe().useCallback(e,t)}function q(e,t){return Fe().useMemo(e,t)}function ie(e){return Fe().useRef(e)}function fe(){return Fe().useId()}var _e=Le({pathname:"/",params:{},navigate:()=>{throw new Error("useNavigate must be used inside a <Router> component.")},basePath:""});function Sn(){let t=(typeof window<"u"?window.location.hash:"").replace(/^#\/?/,"/");return t===""?"/":t}var Vi={pathname:Sn(),hash:typeof window<"u"?window.location.hash:""},Yi=new Set;function Gi(){Vi={pathname:Sn(),hash:typeof window<"u"?window.location.hash:""};for(let e of Yi)e()}typeof window<"u"&&window.addEventListener("hashchange",Gi);var zu=Le({flags:{},isEnabled:()=>!1,setFlag:()=>{},loading:!1});function vn(e){if(!e)return new Date;let n=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date),r=i=>Number(n.find(s=>s.type===i)?.value??0);return new Date(r("year"),r("month")-1,r("day"),r("hour"),r("minute"),r("second"))}function ns(e,t){let n=e.getFullYear(),r=e.getMonth(),i=e.getDate();switch(t){case"short":{let s=String(r+1).padStart(2,"0"),l=String(i).padStart(2,"0");return`${s}/${l}/${n}`}case"long":return`${["January","February","March","April","May","June","July","August","September","October","November","December"][r]} ${String(i).padStart(2,"0")}, ${n}`;case"iso":{let s=String(r+1).padStart(2,"0"),l=String(i).padStart(2,"0");return`${n}-${s}-${l}`}}}var $e={face:"#f8fafc",border:"#334155",hand:"#1e293b",second:"#ef4444",numbers:"#374151"};function wn(e){let{format:t="12h",size:n=200,showDate:r=!1,dateFormat:i="short",showSeconds:s=!0,timezone:l,className:a}=e,[d,u]=X(vn(l));se(()=>{let $=setInterval(()=>{u(vn(l))},1e3);return()=>clearInterval($)},[l]);let h=d.getHours(),p=d.getMinutes(),c=d.getSeconds(),x=h%12*30+p*.5,m=p*6+c*.1,y=c*6,g=n/2,f=n/2,b=n/2-10,S=b-4,E=b-22,k=[];k.push(o("circle",{cx:String(g),cy:String(f),r:String(b),fill:$e.face,stroke:$e.border,"stroke-width":"3"}));for(let $=0;$<12;$++){let W=($*30-90)*Math.PI/180,A=S-6;k.push(o("line",{x1:String(g+A*Math.cos(W)),y1:String(f+A*Math.sin(W)),x2:String(g+S*Math.cos(W)),y2:String(f+S*Math.sin(W)),stroke:$e.border,"stroke-width":"2"}));let H=String($===0?12:$);if(k.push(o("text",{x:String(g+E*Math.cos(W)),y:String(f+E*Math.sin(W)),"text-anchor":"middle","dominant-baseline":"central",fill:$e.numbers,"font-size":String(n*.08),"font-family":"sans-serif","font-weight":"600"},H)),t==="24h"){let L=b-38,T=String($===0?0:$+12);k.push(o("text",{x:String(g+L*Math.cos(W)),y:String(f+L*Math.sin(W)),"text-anchor":"middle","dominant-baseline":"central",fill:$e.numbers,"font-size":String(n*.055),"font-family":"sans-serif",opacity:"0.6"},T))}}let v=($,P,W,A)=>{let H=($-90)*Math.PI/180;return o("line",{x1:String(g),y1:String(f),x2:String(g+P*Math.cos(H)),y2:String(f+P*Math.sin(H)),stroke:A,"stroke-width":W,"stroke-linecap":"round"})};k.push(v(x,b*.5,"4",$e.hand)),k.push(v(m,b*.75,"3",$e.hand)),s&&k.push(v(y,b*.85,"1.5",$e.second)),k.push(o("circle",{cx:String(g),cy:String(f),r:"4",fill:$e.hand}));let C=[o("svg",{width:String(n),height:String(n),viewBox:`0 0 ${n} ${n}`,xmlns:"http://www.w3.org/2000/svg"},...k)];return r&&C.push(o("div",{style:{textAlign:"center",marginTop:"8px",fontFamily:"sans-serif",fontSize:"14px",color:$e.numbers}},ns(d,i))),o("div",{className:a,style:{display:"inline-flex",flexDirection:"column",alignItems:"center"}},...C)}var Tt={xs:24,sm:32,md:40,lg:56,xl:80};function os(e){return e==null?Tt.md:typeof e=="number"?e:Tt[e]??Tt.md}function rs(e){if(!e)return"?";let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}var kn=["#3b82f6","#ef4444","#22c55e","#a855f7","#f97316","#ec4899","#14b8a6","#6366f1","#eab308","#06b6d4"];function is(e){if(!e)return"#9ca3af";let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);return kn[Math.abs(t)%kn.length]}var Cn={online:"#22c55e",offline:"#9ca3af",busy:"#ef4444",away:"#eab308"};function ss(e,t){let n=`${-t/4}px`;switch(e){case"top-left":return{top:n,left:n};case"bottom-right":return{bottom:n,right:n};case"bottom-left":return{bottom:n,left:n};case"top-right":default:return{top:n,right:n}}}function Mn(e){let{src:t,alt:n,name:r,size:i,shape:s="circle",fallbackColor:l,status:a,statusPosition:d="bottom-right"}=e,[u,h]=X(!1),p=os(i),c=s==="circle"?"50%":`${Math.round(p*.15)}px`,x=l??is(r),m=`${Math.round(p*.4)}px`,y={position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:`${p}px`,height:`${p}px`,borderRadius:c,overflow:"hidden",flexShrink:"0"},g;if(t&&!u)g=o("img",{src:t,alt:n??r??"avatar",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"},onError:()=>h(!0)});else{let E=rs(r);g=o("span",{style:{fontSize:m,fontWeight:"600",color:"#fff",lineHeight:"1",userSelect:"none",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'},"aria-hidden":"true"},E)}let f=o("div",{style:{...y,backgroundColor:t&&!u?"transparent":x},role:"img","aria-label":n??r??"avatar"},g);if(!a)return f;let b=Math.max(8,Math.round(p*.25)),S={position:"absolute",width:`${b}px`,height:`${b}px`,borderRadius:"50%",backgroundColor:Cn[a]??Cn.offline,border:"2px solid #fff",boxSizing:"border-box",...ss(d,b)};return o("div",{style:{position:"relative",display:"inline-flex",width:`${p}px`,height:`${p}px`,flexShrink:"0"}},f,o("span",{style:S,"aria-label":a}))}var as={sm:{minWidth:"16px",height:"16px",fontSize:"10px",padding:"0 4px"},md:{minWidth:"20px",height:"20px",fontSize:"12px",padding:"0 6px"},lg:{minWidth:"24px",height:"24px",fontSize:"14px",padding:"0 8px"}},ls={sm:{width:"6px",height:"6px"},md:{width:"8px",height:"8px"},lg:{width:"10px",height:"10px"}};function Pn(e){let{count:t,max:n,dot:r=!1,color:i="#ef4444",size:s="md",variant:l="solid",children:a}=e,d=null;!r&&t!=null&&(d=n!=null&&t>n?`${n}+`:String(t));let u=r||t!=null&&t>0,h=r?{...ls[s],borderRadius:"50%",...l==="solid"?{backgroundColor:i}:{backgroundColor:"transparent",border:`2px solid ${i}`}}:{...as[s],borderRadius:"9999px",display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontWeight:"600",lineHeight:"1",boxSizing:"border-box",...l==="solid"?{backgroundColor:i,color:"#fff"}:{backgroundColor:"transparent",color:i,border:`2px solid ${i}`}},p=u?o("span",{style:h,"aria-label":r?"notification":`count ${d}`},d):null;if(a==null)return p??o("span",null);let c={...h,position:"absolute",top:"0",right:"0",transform:"translate(50%, -50%)",zIndex:"1"};return o("span",{style:{position:"relative",display:"inline-flex"}},a,u?o("span",{style:c,"aria-label":r?"notification":`count ${d}`},d):null)}var cs={width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",color:"#1f2937"},En={padding:"10px 12px",textAlign:"left",fontWeight:"600",backgroundColor:"#f9fafb",borderBottom:"2px solid #e5e7eb",userSelect:"none",whiteSpace:"nowrap"},It={padding:"10px 12px",borderBottom:"1px solid #e5e7eb"},ds="6px 8px",us={marginLeft:"4px",fontSize:"12px",color:"#6b7280"},fs={width:"100%",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"12px",boxSizing:"border-box"},ps={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 12px",fontSize:"13px",color:"#6b7280"},We={padding:"4px 10px",margin:"0 2px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"13px"},ms={...We,backgroundColor:"#3b82f6",color:"#fff",borderColor:"#3b82f6"},$n={...We,opacity:"0.5",cursor:"default"},Rn={cursor:"pointer",width:"16px",height:"16px"};function gs(e,t,n){return e!==t?"\u2195":n==="asc"?"\u2191":"\u2193"}function zn(e){let{columns:t,data:n,pageSize:r,currentPage:i,onPageChange:s,sortBy:l,sortDir:a,onSort:d,selectable:u=!1,selectedRows:h,onSelectionChange:p,striped:c=!1,bordered:x=!1,compact:m=!1,stickyHeader:y=!1}=e,[g,f]=X(0),[b,S]=X(void 0),[E,k]=X("asc"),[v,z]=X([]),[C,$]=X({}),P=i??g,W=l??b,A=a??E,H=h??v,L=q(()=>{let j=Object.entries(C).filter(([,te])=>te.length>0);return j.length===0?n:n.filter(te=>j.every(([re,le])=>String(te[re]??"").toLowerCase().includes(le.toLowerCase())))},[n,C]),T=q(()=>{if(!W)return L;let j=[...L];return j.sort((te,re)=>{let le=te[W],ne=re[W];if(le==null&&ne==null)return 0;if(le==null)return 1;if(ne==null)return-1;if(typeof le=="number"&&typeof ne=="number")return A==="asc"?le-ne:ne-le;let ce=String(le),de=String(ne),ae=ce.localeCompare(de);return A==="asc"?ae:-ae}),j},[L,W,A]),w=T.length,D=r?Math.max(1,Math.ceil(w/r)):1,R=r?T.slice(P*r,(P+1)*r):T,F=M(j=>{s?s(j):f(j)},[s]),I=M(j=>{let te=W===j&&A==="asc"?"desc":"asc";d?d(j,te):(S(j),k(te))},[W,A,d]),N=M(j=>{let te=H.includes(j)?H.filter(re=>re!==j):[...H,j];p?p(te):z(te)},[H,p]),B=M(()=>{let j=R.map((le,ne)=>r?P*r+ne:ne),re=j.every(le=>H.includes(le))?H.filter(le=>!j.includes(le)):[...new Set([...H,...j])];p?p(re):z(re)},[R,H,r,P,p]),V=M((j,te)=>{$(re=>({...re,[j]:te})),F(0)},[F]),G=t.some(j=>j.filterable),K=m?ds:It.padding,ee=[];if(u){let j=R.map((re,le)=>r?P*r+le:le),te=j.length>0&&j.every(re=>H.includes(re));ee.push(o("th",{key:"__select_all",style:{...En,padding:K,width:"40px",textAlign:"center",...y?{position:"sticky",top:"0",zIndex:"2"}:{}}},o("input",{type:"checkbox",checked:te,onChange:B,style:Rn,"aria-label":"Select all rows"})))}for(let j of t){let te={...En,padding:K,...j.width?{width:j.width}:{},...j.sortable?{cursor:"pointer"}:{},...x?{border:"1px solid #e5e7eb"}:{},...y?{position:"sticky",top:"0",zIndex:"2"}:{}},re=[j.header];j.sortable&&re.push(o("span",{style:us},gs(j.key,W,A))),ee.push(o("th",{key:j.key,style:te,onClick:j.sortable?()=>I(j.key):void 0,onKeyDown:j.sortable?le=>{let ne=le.key;(ne==="Enter"||ne===" ")&&(le.preventDefault(),I(j.key))}:void 0,tabIndex:j.sortable?0:void 0,role:j.sortable?"columnheader":void 0,"aria-sort":W===j.key?A==="asc"?"ascending":"descending":void 0},...re))}let J=null;if(G){let j=[];u&&j.push(o("th",{key:"__filter_spacer",style:{padding:K}}));for(let te of t)j.push(o("th",{key:`filter_${te.key}`,style:{padding:"4px 8px",backgroundColor:"#f9fafb"}},te.filterable?o("input",{type:"text",placeholder:`Filter ${te.header}...`,style:fs,value:C[te.key]??"",onInput:re=>V(te.key,re.target.value),"aria-label":`Filter by ${te.header}`}):null));J=o("tr",{key:"__filter_row"},...j)}let Y=[];for(let j=0;j<R.length;j++){let te=R[j],re=r?P*r+j:j,le=H.includes(re),ne={};c&&j%2===1&&(ne.backgroundColor="#f9fafb"),le&&(ne.backgroundColor="#eff6ff");let ce=[];u&&ce.push(o("td",{key:"__select",style:{padding:K,textAlign:"center",...It,...x?{border:"1px solid #e5e7eb"}:{}}},o("input",{type:"checkbox",checked:le,onChange:()=>N(re),style:Rn,"aria-label":`Select row ${re+1}`})));for(let de of t){let ae=te[de.key],ue=de.render?de.render(ae,te):String(ae??"");ce.push(o("td",{key:de.key,style:{...It,padding:K,...x?{border:"1px solid #e5e7eb"}:{}}},ue))}Y.push(o("tr",{key:String(re),style:ne},...ce))}let U=null;if(r){let j=w===0?0:P*r+1,te=Math.min((P+1)*r,w),re=[];re.push(o("button",{key:"prev",style:P===0?$n:We,onClick:P>0?()=>F(P-1):void 0,disabled:P===0,"aria-label":"Previous page"},"\u2190 Prev"));let le=7,ne=Math.max(0,P-Math.floor(le/2)),ce=Math.min(D,ne+le);ce-ne<le&&(ne=Math.max(0,ce-le)),ne>0&&(re.push(o("button",{key:"p0",style:We,onClick:()=>F(0)},"1")),ne>1&&re.push(o("span",{key:"e1",style:{margin:"0 4px"}},"...")));for(let de=ne;de<ce;de++)re.push(o("button",{key:`p${de}`,style:de===P?ms:We,onClick:de!==P?()=>F(de):void 0,"aria-current":de===P?"page":void 0},String(de+1)));ce<D&&(ce<D-1&&re.push(o("span",{key:"e2",style:{margin:"0 4px"}},"...")),re.push(o("button",{key:`p${D-1}`,style:We,onClick:()=>F(D-1)},String(D)))),re.push(o("button",{key:"next",style:P>=D-1?$n:We,onClick:P<D-1?()=>F(P+1):void 0,disabled:P>=D-1,"aria-label":"Next page"},"Next \u2192")),U=o("div",{style:ps},o("span",null,`Showing ${j}\u2013${te} of ${w}`),o("div",{style:{display:"flex",alignItems:"center",gap:"2px"}},...re))}let O={width:"100%",...y?{overflow:"auto",maxHeight:"600px"}:{}},_={...cs,...x?{border:"1px solid #e5e7eb"}:{}},Z=o("thead",null,o("tr",null,...ee),J),Q=o("tbody",null,...Y),oe=o("table",{style:_,role:"grid","aria-rowcount":String(w)},Z,Q);return o("div",{style:O},oe,U)}function Ne(e){return e<10?`0${e}`:String(e)}function hs(e,t){if(t){let r=new Intl.DateTimeFormat("en-US",{timeZone:t,hour:"numeric",minute:"numeric",second:"numeric",hour12:!1}).formatToParts(e),i=s=>Number(r.find(l=>l.type===s)?.value??0);return{hours:i("hour"),minutes:i("minute"),seconds:i("second")}}return{hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}}function bs(e,t,n){if(n){let r={timeZone:n};if(t==="short")return Object.assign(r,{month:"2-digit",day:"2-digit",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);if(t==="long")return Object.assign(r,{month:"long",day:"numeric",year:"numeric"}),new Intl.DateTimeFormat("en-US",r).format(e);Object.assign(r,{year:"numeric",month:"2-digit",day:"2-digit"});let i=new Intl.DateTimeFormat("en-CA",r).formatToParts(e),s=l=>i.find(a=>a.type===l)?.value??"";return`${s("year")}-${s("month")}-${s("day")}`}return t==="short"?`${Ne(e.getMonth()+1)}/${Ne(e.getDate())}/${e.getFullYear()}`:t==="long"?new Intl.DateTimeFormat("en-US",{month:"long",day:"numeric",year:"numeric"}).format(e):`${e.getFullYear()}-${Ne(e.getMonth()+1)}-${Ne(e.getDate())}`}var xs={fontFamily:'"SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", "Courier New", monospace',backgroundColor:"#1e293b",color:"#e2e8f0",padding:"16px 24px",borderRadius:"8px",display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},ys={fontSize:"2rem",fontWeight:"600",letterSpacing:"2px",lineHeight:"1"},Ss={fontSize:"0.875rem",fontWeight:"400",marginLeft:"4px",verticalAlign:"super"},vs={fontSize:"0.75rem",color:"#94a3b8",marginTop:"4px"};function Tn(e){let{format:t="12h",showDate:n=!1,dateFormat:r="short",showSeconds:i=!0,timezone:s,className:l}=e,[a,d]=X(new Date);se(()=>{let f=setInterval(()=>{d(new Date)},1e3);return()=>clearInterval(f)},[]);let{hours:u,minutes:h,seconds:p}=hs(a,s),c,x=null;t==="12h"?(x=u>=12?"PM":"AM",c=u%12||12):c=u;let m=`${Ne(c)}:${Ne(h)}`;i&&(m+=`:${Ne(p)}`);let y=[m];x!=null&&y.push(o("span",{style:Ss},x));let g=[o("span",{style:ys},...y)];return n&&g.push(o("span",{style:vs},bs(a,r,s))),o("div",{style:xs,...l?{class:l}:{}},...g)}var ws={listStyle:"none",margin:"0",padding:"0",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px"},ks={padding:"10px 14px",color:"var(--color-text, #1f2937)"},Cs={borderBottom:"1px solid var(--color-border, #e5e7eb)"},Ms={cursor:"pointer",transition:"background-color 0.15s ease"},Ps={backgroundColor:"var(--color-bg-muted, #eff6ff)"},Es={padding:"24px",textAlign:"center",color:"var(--color-text-muted, #9ca3af)",fontSize:"14px"},st={padding:"10px 14px",borderBottom:"1px solid var(--color-border, #e5e7eb)",backgroundColor:"var(--color-bg-subtle, #f9fafb)",fontWeight:"600",fontSize:"13px",color:"var(--color-text-muted, #6b7280)"};function In(e){let{items:t,renderItem:n,keyExtractor:r,divider:i=!1,hoverable:s=!1,selectedIndex:l,onSelect:a,emptyMessage:d="No items",header:u,footer:h}=e;if(t.length===0)return o("div",null,u?o("div",{style:st},u):null,o("div",{style:Es},d),h?o("div",{style:{...st,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null);let p=[];for(let c=0;c<t.length;c++){let x=t[c],m=r(x,c),y=l===c,g=c===t.length-1,f={...ks,...s?Ms:{},...y?Ps:{},...i&&!g?Cs:{}};p.push(o("li",{key:m,style:f,onClick:a?()=>a(c):void 0,onKeyDown:a?b=>{let S=b.key;(S==="Enter"||S===" ")&&(b.preventDefault(),a(c))}:void 0,role:a?"option":void 0,tabIndex:a?0:void 0,"aria-selected":a?String(y):void 0},n(x,c)))}return o("div",null,u?o("div",{style:st},u):null,o("ul",{style:ws,role:a?"listbox":"list"},...p),h?o("div",{style:{...st,borderBottom:"none",borderTop:"1px solid #e5e7eb"}},h):null)}function $s(e){return e??"#3b82f6"}function Rs(e,t){let r={red:"#ef4444",blue:"#3b82f6",green:"#22c55e",yellow:"#eab308",purple:"#a855f7",pink:"#ec4899",orange:"#f97316",gray:"#6b7280",indigo:"#6366f1",teal:"#14b8a6",cyan:"#06b6d4"}[e]??e,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);return i?`rgba(${parseInt(i[1],16)}, ${parseInt(i[2],16)}, ${parseInt(i[3],16)}, ${t})`:e}var zs={sm:{fontSize:"11px",padding:"2px 8px",gap:"4px"},md:{fontSize:"13px",padding:"4px 10px",gap:"6px"},lg:{fontSize:"15px",padding:"6px 14px",gap:"8px"}};function Ts(e,t,n,r,i){let s=zs[n],l={display:"inline-flex",alignItems:"center",gap:s.gap,borderRadius:"9999px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:s.fontSize,fontWeight:"500",padding:s.padding,lineHeight:"1.4",whiteSpace:"nowrap",border:"none",transition:"opacity 0.15s ease, filter 0.15s ease",...r?{cursor:"pointer"}:{},...i?{opacity:"0.5",cursor:"default",pointerEvents:"none"}:{}};switch(t){case"solid":return{...l,backgroundColor:e,color:"#fff",border:"none"};case"outline":return{...l,backgroundColor:"transparent",color:e,border:`1px solid ${e}`};case"subtle":return{...l,backgroundColor:Rs(e,.12),color:e,border:"none"};default:return l}}var Is={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:"0",marginLeft:"2px",cursor:"pointer",fontSize:"inherit",lineHeight:"1",opacity:"0.7",color:"inherit"};function Dn(e){let{label:t,color:n,variant:r="subtle",size:i="md",removable:s=!1,onRemove:l,icon:a,onClick:d,disabled:u=!1}=e,h=$s(n),p=Ts(h,r,i,!!d,u),c=[];return a&&c.push(o("span",{key:"icon",style:{display:"inline-flex",flexShrink:"0"}},a)),c.push(o("span",{key:"label"},t)),s&&c.push(o("button",{key:"remove",type:"button",style:Is,onClick:x=>{x.stopPropagation(),!u&&l&&l()},"aria-label":`Remove ${t}`,disabled:u},"\xD7")),o("span",{style:p,role:d?"button":void 0,tabIndex:d&&!u?"0":void 0,onClick:!u&&d?d:void 0,onKeyDown:d&&!u?x=>{let m=x.key;(m==="Enter"||m===" ")&&(x.preventDefault(),d())}:void 0,"aria-disabled":u?"true":void 0},...c)}var Ds={overflow:"auto",position:"relative",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};function An(e){let{items:t,renderItem:n,itemHeight:r,overscan:i=5,height:s}=e,[l,a]=X(0),d=ie(null),u=t.length*r,h=parseInt(s,10)||400,p=Math.ceil(h/r),c=Math.max(0,Math.floor(l/r)-i),x=Math.min(t.length,Math.floor(l/r)+p+i),m=M(g=>{let f=g.target;a(f.scrollTop)},[]),y=[];for(let g=c;g<x;g++)y.push(o("div",{key:String(g),style:{position:"absolute",top:`${g*r}px`,left:"0",right:"0",height:`${r}px`,overflow:"hidden"}},n(t[g],g)));return o("div",{ref:d,style:{...Ds,height:s},onScroll:m},o("div",{style:{height:`${u}px`,position:"relative",width:"100%"}},...y))}var Ln={info:{icon:"\u2139\uFE0F",bg:"#eff6ff",border:"#3b82f6",text:"#1e40af",filledBg:"#3b82f6",filledText:"#ffffff"},success:{icon:"\u2705",bg:"#f0fdf4",border:"#22c55e",text:"#166534",filledBg:"#22c55e",filledText:"#ffffff"},warning:{icon:"\u26A0\uFE0F",bg:"#fffbeb",border:"#f59e0b",text:"#92400e",filledBg:"#f59e0b",filledText:"#ffffff"},error:{icon:"\u274C",bg:"#fef2f2",border:"#ef4444",text:"#991b1b",filledBg:"#ef4444",filledText:"#ffffff"}};function Fn(e){let[t,n]=X(!0),r=e.type??"info",i=e.variant??"subtle",s=Ln[r]??Ln.info,l=e.icon??s.icon,a=e.message??e.children,d=q(()=>{let u={display:"flex",alignItems:"flex-start",gap:"12px",padding:"12px 16px",borderRadius:"8px",fontSize:"14px",lineHeight:"1.5"};return i==="filled"?(u.backgroundColor=s.filledBg,u.color=s.filledText):i==="outline"?(u.backgroundColor="transparent",u.border=`1px solid ${s.border}`,u.color=s.text):(u.backgroundColor=s.bg,u.color=s.text),u},[i,s]);return t?o("div",{role:"alert",style:d},o("span",{style:{flexShrink:"0",fontSize:"16px",lineHeight:"1.5"}},l),o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{style:{fontWeight:"600",marginBottom:a?"4px":"0"}},e.title):null,a?o("div",null,a):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"4px 12px",fontSize:"13px",fontWeight:"500",border:i==="filled"?"1px solid currentColor":`1px solid ${s.border}`,borderRadius:"4px",backgroundColor:"transparent",color:"inherit",cursor:"pointer"}},e.action.label):null),e.closable?o("button",{"aria-label":"Close",onclick:()=>{n(!1),e.onClose&&e.onClose()},style:{flexShrink:"0",background:"none",border:"none",cursor:"pointer",fontSize:"18px",lineHeight:"1",color:"inherit",opacity:"0.7",padding:"0"}},"\xD7"):null):null}function Wn(e){return o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",padding:"48px 24px",gap:"16px"}},e.image?o("img",{src:e.image,alt:"",style:{maxWidth:"200px",maxHeight:"160px",objectFit:"contain"}}):null,e.icon?o("div",{style:{fontSize:"48px",lineHeight:"1"}},e.icon):null,e.title?o("h3",{style:{margin:"0",fontSize:"20px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.description?o("p",{style:{margin:"0",fontSize:"14px",color:"#6b7280",maxWidth:"360px",lineHeight:"1.6"}},e.description):null,e.action?o("button",{onclick:e.action.onClick,style:{marginTop:"8px",padding:"10px 24px",fontSize:"14px",fontWeight:"500",color:"#ffffff",backgroundColor:"#3b82f6",border:"none",borderRadius:"6px",cursor:"pointer"}},e.action.label):null)}function Nn(e){let t=e.max??100,n=e.indeterminate?0:Math.min(Math.max(e.value??0,0),t),r=t>0?n/t*100:0,i=e.color??"#3b82f6",s=e.backgroundColor??"#e5e7eb",l=e.height??(typeof e.size=="string"?e.size:typeof e.size=="number"?`${e.size}px`:"8px"),a=e.variant??"bar",d=fe().replace(/[^a-zA-Z0-9_-]/g,"");if(a==="circular"){let x=typeof e.size=="number"?e.size:48,m=Math.max(2,Math.round(x/10)),y=(x-m)/2,g=2*Math.PI*y,f=e.indeterminate?g*.75:g-r/100*g,b=e.indeterminate?`@keyframes liq-spin-${d}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`:e.animated?`@keyframes liq-pulse-${d}{0%,100%{opacity:1}50%{opacity:0.6}}`:"";return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{display:"inline-flex",alignItems:"center",gap:"8px"}},b?o("style",null,b):null,o("svg",{width:String(x),height:String(x),viewBox:`0 0 ${x} ${x}`,style:e.indeterminate?{animation:`liq-spin-${d} 1s linear infinite`}:e.animated?{animation:`liq-pulse-${d} 1.5s ease-in-out infinite`}:{}},o("circle",{cx:String(x/2),cy:String(x/2),r:String(y),fill:"none",stroke:s,"stroke-width":String(m)}),o("circle",{cx:String(x/2),cy:String(x/2),r:String(y),fill:"none",stroke:i,"stroke-width":String(m),"stroke-dasharray":String(g),"stroke-dashoffset":String(f),"stroke-linecap":"round",transform:`rotate(-90 ${x/2} ${x/2})`,style:{transition:"stroke-dashoffset 0.3s ease"}})),e.showLabel&&!e.indeterminate?o("span",{style:{fontSize:"14px",color:"#374151"}},`${Math.round(r)}%`):null)}let u=e.animated||e.indeterminate?`@keyframes liq-shimmer-${d}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",h=e.indeterminate?`@keyframes liq-indeterminate-${d}{0%{left:-40%;width:40%}50%{left:20%;width:60%}100%{left:100%;width:40%}}`:"",p={width:"100%",height:l,backgroundColor:s,borderRadius:l,overflow:"hidden",position:"relative"},c=q(()=>{let x={height:"100%",borderRadius:l,transition:"width 0.3s ease"};return e.indeterminate?(x.position="absolute",x.animation=`liq-indeterminate-${d} 1.5s ease-in-out infinite`,x.backgroundColor=i):(x.width=`${r}%`,x.backgroundColor=i),e.animated&&!e.indeterminate&&(x.backgroundImage=`linear-gradient(90deg, ${i} 0%, ${As(i)} 50%, ${i} 100%)`,x.backgroundSize="200% 100%",x.animation=`liq-shimmer-${d} 1.5s ease-in-out infinite`),x},[r,i,l,e.animated,e.indeterminate,d]);return o("div",{role:"progressbar","aria-valuenow":e.indeterminate?void 0:String(Math.round(r)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Progress",style:{width:"100%"}},u||h?o("style",null,u+h):null,e.showLabel&&!e.indeterminate?o("div",{style:{marginBottom:"4px",fontSize:"12px",color:"#374151",textAlign:"right"}},`${Math.round(r)}%`):null,o("div",{style:p},o("div",{style:c})))}function As(e){let t=e.replace("#","");if(t.length!==6)return e;let n=Math.min(255,parseInt(t.slice(0,2),16)+40),r=Math.min(255,parseInt(t.slice(2,4),16)+40),i=Math.min(255,parseInt(t.slice(4,6),16)+40);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${i.toString(16).padStart(2,"0")}`}function Bn(e){let t=e.variant??"text",n=e.animated!==!1,r=fe().replace(/[^a-zA-Z0-9_-]/g,""),i=q(()=>n?`@keyframes liq-shimmer-${r}{0%{background-position:-200% 0}100%{background-position:200% 0}}`:"",[n,r]),s=typeof e.width=="number"?`${e.width}px`:e.width,l=typeof e.height=="number"?`${e.height}px`:e.height;if(t==="text"){let a=e.lines??1,d=[];for(let u=0;u<a;u++){let h=u===a-1&&a>1;d.push(o("div",{key:String(u),style:Dt({width:h?"75%":s??"100%",height:l??"1em",borderRadius:e.borderRadius??"4px",animated:n,animId:r,marginBottom:u<a-1?"8px":"0"})}))}return o("div",{"aria-hidden":"true",style:{width:s??"100%"}},i?o("style",null,i):null,...d)}if(t==="circular"){let a=s??l??"40px";return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:Dt({width:a,height:a,borderRadius:"50%",animated:n,animId:r})}))}return o("div",{"aria-hidden":"true"},i?o("style",null,i):null,o("div",{style:Dt({width:s??"100%",height:l??"100px",borderRadius:e.borderRadius??"4px",animated:n,animId:r})}))}function Dt(e){let t={width:e.width,height:e.height,borderRadius:e.borderRadius,backgroundColor:"#e5e7eb"};return e.animated&&(t.backgroundImage="linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",t.backgroundSize="200% 100%",t.animation=`liq-shimmer-${e.animId} 1.5s ease-in-out infinite`),e.marginBottom&&(t.marginBottom=e.marginBottom),t}var Ls={sm:16,md:24,lg:40},Hn={slow:"1.2s",normal:"0.75s",fast:"0.45s"};function _n(e){let t=typeof e.size=="number"?e.size:Ls[e.size??"md"]??24,n=e.color??"#3b82f6",r=e.thickness??Math.max(2,Math.round(t/8)),i=Hn[e.speed??"normal"]??Hn.normal,s=e.label??"Loading",a=fe().replace(/[^a-zA-Z0-9_-]/g,""),d=(t-r)/2,u=2*Math.PI*d,h=q(()=>`@keyframes liq-rotate-${a}{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}`,[a]);return o("span",{role:"status","aria-label":s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center"}},o("style",null,h),o("svg",{width:String(t),height:String(t),viewBox:`0 0 ${t} ${t}`,style:{animation:`liq-rotate-${a} ${i} linear infinite`}},o("circle",{cx:String(t/2),cy:String(t/2),r:String(d),fill:"none",stroke:n,"stroke-width":String(r),"stroke-dasharray":`${u*.7} ${u*.3}`,"stroke-linecap":"round"})),o("span",{style:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:"0"}},s))}function me(e){let t=e.styling??{},n=!!e.error,r={display:"flex",flexDirection:"column",gap:t.gap??"4px",width:typeof t.width=="number"?`${t.width}px`:t.width??"100%",fontFamily:t.fontFamily??"inherit",fontSize:t.fontSize??"14px",opacity:e.disabled?"0.6":"1",...t.custom??{}},i={color:t.labelColor??"#374151",fontWeight:t.labelFontWeight??"500",fontSize:t.labelFontSize??"14px"},s={fontSize:"12px",color:n?t.errorColor??"#ef4444":t.helpColor??"#6b7280",marginTop:"2px"};return o("div",{className:`form-field ${n?"form-field--error":""} ${e.className??""}`.trim(),style:r},e.label?o("label",{htmlFor:e.htmlFor,style:i},e.label,e.required?o("span",{style:{color:t.errorColor??"#ef4444",marginLeft:"2px"}},"*"):null):null,e.children,e.error?o("div",{className:"form-field__error",style:s,role:"alert"},e.error):e.helpText?o("div",{className:"form-field__help",style:s},e.helpText):null)}function Pe(e,t){let n=t.error?e.errorBorderColor??"#ef4444":t.focused?e.focusBorderColor??"#3b82f6":void 0;return{padding:e.padding??"8px 12px",border:n?`1px solid ${n}`:e.border??"1px solid #d1d5db",borderRadius:e.borderRadius??"6px",fontSize:e.fontSize??"14px",fontFamily:e.fontFamily??"inherit",backgroundColor:e.backgroundColor??"#ffffff",color:e.color??"#1f2937",outline:"none",transition:e.transition??"border-color 0.15s",width:"100%",boxSizing:"border-box",...t.focused&&n?{boxShadow:`0 0 0 3px ${n}22`}:{},...e.custom??{}}}var Fs={sm:{box:14,icon:10,fontSize:"12px"},md:{box:18,icon:12,fontSize:"14px"},lg:{box:22,icon:16,fontSize:"16px"}};function On(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{checked:r,onChange:i,label:s,indeterminate:l=!1,disabled:a=!1,error:d,size:u="md"}=e,h=ie(null);se(()=>{h.current&&(h.current.indeterminate=l)},[l]);let p=M(()=>{a||i(!r)},[a,r,i]),c=M(C=>{a||(C.key===" "||C.key==="Enter")&&(C.preventDefault(),i(!r))},[a,r,i]),x=Fs[u],m=`${x.box}px`,y=d?"#ef4444":r||l?"#3b82f6":"#d1d5db",g=r||l?"#3b82f6":"#ffffff",f={width:m,height:m,minWidth:m,borderRadius:"4px",border:`2px solid ${y}`,backgroundColor:g,display:"flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",transition:"all 0.15s",boxSizing:"border-box"},b={color:"#ffffff",fontSize:`${x.icon}px`,lineHeight:"1",fontWeight:"700"},S=l?o("span",{style:b},"\u2014"):r?o("span",{style:b},"\u2713"):null,E={display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer",opacity:a?"0.6":"1",userSelect:"none"},k=o("input",{ref:h,type:"checkbox",id:n,checked:r,disabled:a,onChange:()=>i(!r),style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},"aria-hidden":"true",tabIndex:-1}),v=o("div",{style:f},S),z=s?o("span",{style:{fontSize:x.fontSize,color:"#374151"}},s):null;return o(me,{error:d,htmlFor:n},o("div",{style:E,onClick:p,onKeyDown:c,tabIndex:a?-1:0,role:"checkbox","aria-checked":l?"mixed":r?"true":"false","aria-disabled":a?"true":void 0,"aria-label":s},k,v,z))}var Ws=["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"];function Vn(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(e)}function at(e){let t=e.startsWith("#")?e:`#${e}`;return/^#[0-9a-fA-F]{3}$/.test(t)&&(t=`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`),t.toLowerCase()}function Yn(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,presets:s=Ws,showInput:l=!0,showAlpha:a=!1,disabled:d=!1,label:u}=e,[h,p]=X(!1),[c,x]=X(r),m=ie(null);se(()=>{x(r)},[r]),se(()=>{let $=P=>{m.current&&!m.current.contains(P.target)&&p(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]);let y=M($=>{d||i(at($))},[d,i]),g=M($=>{let P=$.target.value;x(P);let W=P.startsWith("#")?P:`#${P}`;Vn(W)&&i(at(W))},[i]),f=M(()=>{Vn(c.startsWith("#")?c:`#${c}`)||x(r)},[c,r]),b={width:"36px",height:"36px",borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:r,cursor:d?"not-allowed":"pointer",flexShrink:"0"},S={display:"flex",alignItems:"center",gap:"8px"},E={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"240px"},k={display:"grid",gridTemplateColumns:"repeat(10, 1fr)",gap:"4px",marginBottom:l?"8px":"0"},v=s.map($=>{let P=at($)===at(r);return o("div",{key:$,style:{width:"20px",height:"20px",borderRadius:"3px",backgroundColor:$,cursor:d?"not-allowed":"pointer",border:P?"2px solid #1f2937":"1px solid #e5e7eb",boxSizing:"border-box"},onClick:()=>y($),onKeyDown:A=>{let H=A.key;(H==="Enter"||H===" ")&&(A.preventDefault(),y($))},role:"button",tabIndex:d?-1:0,title:$,"aria-label":`Select color ${$}`})}),z=l?o("div",{style:{display:"flex",alignItems:"center",gap:"4px"}},o("div",{style:{width:"24px",height:"24px",borderRadius:"4px",backgroundColor:r,border:"1px solid #d1d5db",flexShrink:"0"}}),o("input",{type:"text",value:c,onInput:g,onBlur:f,disabled:d,style:{flex:"1",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",fontSize:"13px",fontFamily:"monospace",outline:"none",color:"#1f2937"},placeholder:"#000000","aria-label":"Hex color value"})):null,C=h?o("div",{style:E},o("div",{style:k},...v),z):null;return o(me,{label:u,disabled:d,htmlFor:n},o("div",{ref:m,style:{position:"relative"}},o("div",{style:S,onClick:d?void 0:()=>p(!h),onKeyDown:d?void 0:$=>{let P=$.key;(P==="Enter"||P===" ")&&($.preventDefault(),p(!h))},role:"button",tabIndex:d?-1:0,"aria-expanded":h?"true":"false","aria-label":"Toggle color picker"},o("div",{id:n,style:b}),l?o("span",{style:{fontSize:"14px",fontFamily:"monospace",color:"#1f2937"}},r):null),C))}function Gn(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`cw-${t}`,{value:r="#000000",onChange:i,size:s=32,showLabel:l=!0,disabled:a=!1,label:d}=e,[u,h]=X(r),p=ie(null),c=M(((...g)=>{let b=g[0].target.value;h(b),i?.(b)}),[i]),x={display:"inline-flex",flexDirection:"column",alignItems:"center",gap:"4px"},m={width:`${s}px`,height:`${s}px`,borderRadius:"6px",border:"2px solid #d1d5db",backgroundColor:u,cursor:a?"not-allowed":"pointer",position:"relative",overflow:"hidden"};return o(me,{label:d,htmlFor:n},o("div",{style:x},o("div",{style:m},o("input",{id:n,ref:p,type:"color",value:u,onInput:c,disabled:a,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",cursor:a?"not-allowed":"pointer",border:"none",padding:"0"},"aria-label":d||"Color"})),l?o("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"#64748b"}},u):null))}var Un=["January","February","March","April","May","June","July","August","September","October","November","December"],Ns=["Su","Mo","Tu","We","Th","Fr","Sa"];function At(e){if(!e)return null;if(e instanceof Date)return e;let t=new Date(e);return isNaN(t.getTime())?null:t}function Bs(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate();return t.replace("YYYY",String(n)).replace("MM",String(r).padStart(2,"0")).replace("DD",String(i).padStart(2,"0"))}function jn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function Hs(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Xn(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="YYYY-MM-DD",minDate:l,maxDate:a,disabled:d=!1,placeholder:u="Select date...",label:h,error:p}=e,c=q(()=>At(r),[r]),x=q(()=>At(l),[l]),m=q(()=>At(a),[a]),[y,g]=X(!1),[f,b]=X(()=>c?c.getFullYear():new Date().getFullYear()),[S,E]=X(()=>c?c.getMonth():new Date().getMonth()),k=ie(null),v=q(()=>new Date,[]);se(()=>{let I=N=>{k.current&&!k.current.contains(N.target)&&g(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let z=M(()=>{E(I=>I===0?(b(N=>N-1),11):I-1)},[]),C=M(()=>{E(I=>I===11?(b(N=>N+1),0):I+1)},[]),$=M(I=>{let N=new Date(f,S,I);x&&N<x||m&&N>m||(i(Hs(N)),g(!1))},[f,S,i,x,m]),P=c?Bs(c,s):"",W=q(()=>{let I=new Date(f,S,1).getDay(),N=new Date(f,S+1,0).getDate(),B=[],V=[];for(let G=0;G<I;G++)V.push(null);for(let G=1;G<=N;G++)V.push(G),V.length===7&&(B.push(V),V=[]);for(;V.length>0&&V.length<7;)V.push(null);return V.length&&B.push(V),B},[f,S]),A={...Pe({},{focused:y,error:!!p}),cursor:d?"not-allowed":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",minHeight:"38px",userSelect:"none"},H={position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",padding:"12px",width:"280px"},L={display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"},T={background:"none",border:"none",cursor:"pointer",fontSize:"16px",padding:"4px 8px",color:"#374151",borderRadius:"4px"},w={display:"grid",gridTemplateColumns:"repeat(7, 1fr)",textAlign:"center",fontSize:"11px",fontWeight:"600",color:"#6b7280",marginBottom:"4px"},D=Ns.map(I=>o("div",{key:I,style:{padding:"4px"}},I)),R=W.map((I,N)=>{let B=I.map((V,G)=>{if(V===null)return o("div",{key:`empty-${N}-${G}`,style:{padding:"4px"}});let K=new Date(f,S,V),ee=jn(K,v),J=c?jn(K,c):!1,Y=x&&K<x||m&&K>m,U={padding:"4px",textAlign:"center",cursor:Y?"not-allowed":"pointer",borderRadius:"4px",fontSize:"13px",fontWeight:ee?"700":"400",backgroundColor:J?"#3b82f6":"transparent",color:J?"#ffffff":Y?"#d1d5db":ee?"#3b82f6":"#1f2937",border:ee&&!J?"1px solid #3b82f6":"1px solid transparent",lineHeight:"1.8"};return o("div",{key:`day-${V}`,style:U,onClick:Y?void 0:()=>$(V),onKeyDown:Y?void 0:O=>{let _=O.key;(_==="Enter"||_===" ")&&(O.preventDefault(),$(V))},role:Y?void 0:"button",tabIndex:Y?void 0:0,"aria-label":`${Un[S]} ${V}, ${f}`,"aria-disabled":Y?"true":void 0},String(V))});return o("div",{key:`row-${N}`,style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)"}},...B)}),F=y?o("div",{style:H},o("div",{style:L},o("button",{type:"button",style:T,onClick:z},"\u25C0"),o("span",{style:{fontWeight:"600",fontSize:"14px",color:"#1f2937"}},`${Un[S]} ${f}`),o("button",{type:"button",style:T,onClick:C},"\u25B6")),o("div",{style:w},...D),...R):null;return o(me,{label:h,error:p,disabled:d,htmlFor:n},o("div",{ref:k,style:{position:"relative"}},o("div",{id:n,style:A,onClick:d?void 0:()=>g(!y),onKeyDown:d?void 0:I=>{let N=I.key;(N==="Enter"||N===" ")&&(I.preventDefault(),g(!y))},tabIndex:d?-1:0,role:"button","aria-label":"Pick a date","aria-expanded":y?"true":"false"},o("span",{style:{color:P?"#1f2937":"#9ca3af"}},P||u),o("span",{style:{color:"#6b7280",fontSize:"14px"}},"\u{1F4C5}")),F))}function Lt(e){if(e===0)return"0 B";let t=["B","KB","MB","GB"],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,n)).toFixed(n===0?0:1)} ${t[n]}`}function qn(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`fu-${t}`,{onChange:r,accept:i,multiple:s=!1,maxSize:l,disabled:a=!1,label:d,helpText:u}=e,[h,p]=X([]),[c,x]=X(!1),[m,y]=X(""),g=ie(null),f=M(T=>{y("");let w=[];for(let R of T){if(l&&R.size>l){y(`File "${R.name}" exceeds maximum size of ${Lt(l)}`);continue}w.push(R)}let D=s?[...h,...w]:w.slice(0,1);p(D),r(D)},[h,s,l,r]),b=M(T=>{if(T.preventDefault(),T.stopPropagation(),x(!1),a)return;let w=T.dataTransfer;if(!w)return;let D=Array.from(w.files);f(D)},[a,f]),S=M(T=>{T.preventDefault(),T.stopPropagation(),a||x(!0)},[a]),E=M(T=>{T.preventDefault(),T.stopPropagation(),x(!1)},[]),k=M(T=>{let w=T.target;w.files&&(f(Array.from(w.files)),w.value="")},[f]),v=M(T=>{let w=h.filter((D,R)=>R!==T);p(w),r(w)},[h,r]),z=M(()=>{a||g.current&&g.current.click()},[a]),C={border:`2px dashed ${c?"#3b82f6":m?"#ef4444":"#d1d5db"}`,borderRadius:"8px",padding:"24px",textAlign:"center",cursor:a?"not-allowed":"pointer",backgroundColor:c?"#eff6ff":"#fafafa",transition:"all 0.15s",opacity:a?"0.6":"1"},$={fontSize:"28px",color:"#9ca3af",marginBottom:"8px"},P={fontSize:"14px",color:"#374151",marginBottom:"4px"},W={fontSize:"12px",color:"#9ca3af"},A=o("input",{id:n,ref:g,type:"file",accept:i,multiple:s,onChange:k,disabled:a,style:{display:"none"},tabIndex:-1}),H=o("div",{style:C,onClick:z,onKeyDown:T=>{let w=T.key;(w==="Enter"||w===" ")&&(T.preventDefault(),z())},onDrop:b,onDragOver:S,onDragLeave:E,role:"button",tabIndex:a?-1:0,"aria-label":"Upload files"},o("div",{style:$},"\u2191"),o("div",{style:P},o("span",{style:{color:"#3b82f6",fontWeight:"500"}},"Click to upload")," or drag and drop"),i?o("div",{style:W},i):null,l?o("div",{style:W},`Max size: ${Lt(l)}`):null),L=h.length>0?o("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"4px"}},...h.map((T,w)=>{let D={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",backgroundColor:"#f9fafb",borderRadius:"6px",border:"1px solid #e5e7eb",fontSize:"13px"},R={background:"none",border:"none",cursor:"pointer",color:"#ef4444",fontSize:"14px",padding:"2px 6px",borderRadius:"4px"};return o("div",{key:`file-${w}`,style:D},o("div",{style:{display:"flex",alignItems:"center",gap:"8px",overflow:"hidden"}},o("span",{style:{color:"#374151",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},T.name),o("span",{style:{color:"#9ca3af",fontSize:"11px",flexShrink:"0"}},Lt(T.size))),o("button",{type:"button",style:R,onClick:F=>{F.stopPropagation(),v(w)},"aria-label":`Remove ${T.name}`},"\u2715"))})):null;return o(me,{label:d,helpText:u,error:m||void 0,disabled:a,htmlFor:n},o("div",null,A,H,L))}function Kn(e){let[t,n]=X(!1),[r,i]=X((e.value??e.defaultValue??"").length),s=fe().replace(/[^a-zA-Z0-9_-]/g,""),l=e.id??`ml-${s}`,d={...Pe(e.inputStyle??{},{focused:t,error:!!e.error}),resize:e.autoResize?"none":"vertical",lineHeight:"1.5",...e.minHeight?{minHeight:e.minHeight}:{},...e.maxHeight?{maxHeight:e.maxHeight}:{}},u=M(c=>{let x=c.target,m=x.value;i(m.length),e.onChange&&e.onChange(m),e.autoResize&&(x.style.height="auto",x.style.height=`${x.scrollHeight}px`)},[e.onChange,e.autoResize]),h=o("textarea",{id:l,name:e.name,value:e.value,placeholder:e.placeholder,rows:String(e.rows??4),maxLength:e.maxLength?String(e.maxLength):void 0,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`multiline-input ${e.className??""}`.trim(),style:d,onFocus:()=>n(!0),onBlur:c=>{n(!1),e.onBlur&&e.onBlur(c.target.value)},onInput:u}),p=e.showCount&&e.maxLength?o("div",{style:{fontSize:"11px",color:r>(e.maxLength??1/0)*.9?"#ef4444":"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r}/${e.maxLength}`):e.showCount?o("div",{style:{fontSize:"11px",color:"#9ca3af",textAlign:"right",marginTop:"2px"}},`${r} characters`):null;return o(me,{label:e.label,htmlFor:l,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},h,p)}function Zn(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??`ns-${t}`,{value:r,onChange:i,min:s,max:l,step:a=1,disabled:d=!1,prefix:u,suffix:h,label:p,error:c}=e,[x,m]=X(!1),y=M(w=>{let D=w;return s!==void 0&&D<s&&(D=s),l!==void 0&&D>l&&(D=l),D},[s,l]),g=M(()=>{d||i(y(r+a))},[d,r,a,y,i]),f=M(()=>{d||i(y(r-a))},[d,r,a,y,i]),b=M(w=>{let D=w.target.value;if(D===""||D==="-")return;let R=parseFloat(D);isNaN(R)||i(y(R))},[y,i]),S=M(w=>{d||(w.key==="ArrowUp"?(w.preventDefault(),g()):w.key==="ArrowDown"&&(w.preventDefault(),f()))},[d,g,f]),E=s===void 0||r>s,k=l===void 0||r<l,v={display:"inline-flex",alignItems:"stretch",borderRadius:"6px",overflow:"hidden",border:`1px solid ${c?"#ef4444":x?"#3b82f6":"var(--color-border, #d1d5db)"}`,transition:"border-color 0.15s",opacity:d?"0.6":"1",...x&&!c?{boxShadow:"0 0 0 3px #3b82f622"}:{}},z=w=>({display:"flex",alignItems:"center",justifyContent:"center",width:"36px",backgroundColor:"var(--color-bg-subtle, #f9fafb)",border:"none",cursor:d||!w?"not-allowed":"pointer",color:d||!w?"#d1d5db":"var(--color-text, #374151)",fontSize:"inherit",fontWeight:"600",userSelect:"none",transition:"background-color 0.1s",borderRight:"none",borderLeft:"none"}),C={flex:"1",minWidth:"32px",textAlign:"center",border:"none",borderLeft:"1px solid var(--color-border, #e5e7eb)",borderRight:"1px solid var(--color-border, #e5e7eb)",outline:"none",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"var(--color-bg, #ffffff)",color:"var(--color-text, #1f2937)",padding:"4px 2px"},$={display:"flex",alignItems:"center",fontSize:"inherit",color:"var(--color-text-muted, #6b7280)",padding:"0 2px",backgroundColor:"var(--color-bg-subtle, #f9fafb)"},P=o("button",{type:"button",style:z(E),onClick:f,disabled:d,"aria-label":"Decrement",tabIndex:-1},"\u2212"),W=u?o("span",{style:$},u):null,A=o("input",{id:n,type:"text",value:String(r),onInput:b,onKeyDown:S,onFocus:()=>m(!0),onBlur:()=>m(!1),disabled:d,style:C,"aria-label":p||"Number",role:"spinbutton","aria-valuenow":String(r),"aria-valuemin":s!==void 0?String(s):void 0,"aria-valuemax":l!==void 0?String(l):void 0}),H=h?o("span",{style:$},h):null,L=o("button",{type:"button",style:z(k),onClick:g,disabled:d,"aria-label":"Increment",tabIndex:-1},"+"),T=[P];return W&&T.push(W),T.push(A),H&&T.push(H),T.push(L),o(me,{label:p,error:c,disabled:d,htmlFor:n},o("div",{style:v},...T))}function Jn(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,name:l,direction:a="vertical",disabled:d=!1,error:u,label:h}=e,p=M(y=>{d||s(y)},[d,s]),c=M(y=>{if(d)return;let g=r.filter(S=>!S.disabled);if(g.length===0)return;let f=g.findIndex(S=>S.value===i),b=f;if(y.key==="ArrowDown"||y.key==="ArrowRight")y.preventDefault(),b=f<g.length-1?f+1:0;else if(y.key==="ArrowUp"||y.key==="ArrowLeft")y.preventDefault(),b=f>0?f-1:g.length-1;else return;s(g[b].value)},[d,r,i,s]),x={display:"flex",flexDirection:a==="horizontal"?"row":"column",gap:a==="horizontal"?"16px":"8px"},m=r.map((y,g)=>{let f=y.value===i,b=d||!!y.disabled,S=`${n}-opt-${g}`,E={width:"18px",height:"18px",minWidth:"18px",borderRadius:"50%",border:`2px solid ${u?"#ef4444":f?"#3b82f6":"#d1d5db"}`,display:"flex",alignItems:"center",justifyContent:"center",transition:"border-color 0.15s",boxSizing:"border-box"},k={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#3b82f6",transition:"transform 0.15s",transform:f?"scale(1)":"scale(0)"},v={display:"inline-flex",alignItems:"center",gap:"8px",cursor:b?"not-allowed":"pointer",opacity:b?"0.5":"1",userSelect:"none"};return o("label",{key:y.value,htmlFor:S,style:v,onClick:b?void 0:z=>{z.preventDefault(),p(y.value)}},o("input",{type:"radio",id:S,name:l,value:y.value,checked:f,disabled:b,style:{position:"absolute",opacity:"0",width:"0",height:"0",pointerEvents:"none"},tabIndex:-1}),o("div",{style:E},o("div",{style:k})),o("span",{style:{fontSize:"14px",color:"#374151"}},y.label))});return o(me,{label:h,error:u,htmlFor:`${n}-opt-0`},o("div",{id:n,style:x,role:"radiogroup","aria-label":h,onKeyDown:c,tabIndex:d?-1:0},...m))}function Qn(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{options:r,value:i,onChange:s,placeholder:l="Select...",searchable:a=!1,multiple:d=!1,clearable:u=!1,disabled:h=!1,error:p,label:c,helpText:x}=e,[m,y]=X(!1),[g,f]=X(""),[b,S]=X(-1),E=ie(null),k=q(()=>Array.isArray(i)?i:i?[i]:[],[i]),v=q(()=>{if(!a||!g)return r;let I=g.toLowerCase();return r.filter(N=>N.label.toLowerCase().includes(I))},[r,g,a]),z=q(()=>{let I={},N=[];for(let B of v)B.group?(I[B.group]||(I[B.group]=[]),I[B.group].push(B)):N.push(B);return{groups:I,ungrouped:N}},[v]),C=q(()=>k.length===0?"":k.map(N=>r.find(B=>B.value===N)).filter(Boolean).map(N=>N.label).join(", "),[k,r]);se(()=>{let I=N=>{let B=N.target;E.current&&!E.current.contains(B)&&(y(!1),f(""))};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);let $=M(I=>{if(d){let N=k.includes(I)?k.filter(B=>B!==I):[...k,I];s(N)}else s(I),y(!1),f("")},[d,k,s]),P=M(I=>{I.stopPropagation(),s(d?[]:"")},[d,s]),W=M(I=>{if(h)return;let N=I.key;if(!m&&(N==="Enter"||N===" "||N==="ArrowDown")){I.preventDefault(),y(!0),S(0);return}if(m){if(N==="Escape"){y(!1),f("");return}if(N==="ArrowDown")I.preventDefault(),S(B=>Math.min(B+1,v.length-1));else if(N==="ArrowUp")I.preventDefault(),S(B=>Math.max(B-1,0));else if(N==="Enter"&&b>=0&&b<v.length){I.preventDefault();let B=v[b];B.disabled||$(B.value)}}},[h,m,b,v,$]),A={...Pe({},{focused:m,error:!!p}),display:"flex",alignItems:"center",justifyContent:"space-between",cursor:h?"not-allowed":"pointer",minHeight:"38px",userSelect:"none"},H={position:"absolute",top:"100%",left:"0",right:"0",marginTop:"4px",backgroundColor:"#ffffff",border:"1px solid #d1d5db",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.1)",zIndex:"1000",maxHeight:"240px",overflowY:"auto"},L=(I,N)=>{let B=k.includes(I.value),V=N===b,G={padding:"8px 12px",cursor:I.disabled?"not-allowed":"pointer",backgroundColor:V?"#f3f4f6":B?"#eff6ff":"transparent",color:I.disabled?"#9ca3af":"#1f2937",display:"flex",alignItems:"center",gap:"8px",fontSize:"14px"};return o("div",{key:I.value,style:G,onClick:I.disabled?void 0:()=>$(I.value),onMouseEnter:()=>S(N),role:"option","aria-selected":B?"true":"false","aria-disabled":I.disabled?"true":void 0},d&&B?o("span",{style:{color:"#3b82f6",fontWeight:"700"}},"\u2713"):null,I.label)},T=()=>{let I=[],N=0,{groups:B,ungrouped:V}=z;for(let G of V)I.push(L(G,N++));for(let G of Object.keys(B)){I.push(o("div",{key:`group-${G}`,style:{padding:"6px 12px",fontSize:"11px",fontWeight:"600",color:"#6b7280",textTransform:"uppercase",letterSpacing:"0.05em"}},G));for(let K of B[G])I.push(L(K,N++))}return I.length===0&&I.push(o("div",{style:{padding:"8px 12px",color:"#9ca3af",fontSize:"14px"}},"No options")),I},w=o("span",{style:{marginLeft:"8px",fontSize:"10px",transition:"transform 0.15s",transform:m?"rotate(180deg)":"rotate(0deg)",color:"#6b7280"}},"\u25BC"),D=o("div",{style:A,id:n,onClick:h?void 0:()=>{y(!m),S(-1)},onKeyDown:W,tabIndex:h?-1:0,role:"combobox","aria-expanded":m?"true":"false","aria-haspopup":"listbox"},o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:C?"#1f2937":"#9ca3af"}},C||l),o("span",{style:{display:"flex",alignItems:"center",gap:"4px"}},u&&k.length>0?o("span",{onClick:P,onKeyDown:I=>{let N=I.key;(N==="Enter"||N===" ")&&(I.preventDefault(),I.stopPropagation(),P(I))},style:{cursor:"pointer",color:"#9ca3af",fontSize:"14px",lineHeight:"1"},role:"button",tabIndex:0,"aria-label":"Clear selection"},"\u2715"):null,w)),R=a&&m?o("input",{type:"text",value:g,onInput:I=>{f(I.target.value),S(0)},placeholder:"Search...",style:{width:"100%",boxSizing:"border-box",padding:"8px 12px",border:"none",borderBottom:"1px solid #e5e7eb",outline:"none",fontSize:"14px"}}):null,F=m?o("div",{style:H,role:"listbox"},R,...T()):null;return o(me,{label:c,error:p,helpText:x,disabled:h,htmlFor:n},o("div",{ref:E,style:{position:"relative"}},D,F))}function eo(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,min:s=0,max:l=100,step:a=1,showValue:d=!1,showTicks:u=!1,disabled:h=!1,marks:p,range:c=!1,label:x,error:m}=e,y=ie(null),g=ie(i);g.current=i;let[f,b]=X(null),S=q(()=>{if(c&&Array.isArray(r))return r;let N=typeof r=="number"?r:0;return[N,N]},[r,c]),E=ie(S);E.current=S;let k=N=>{let B=Math.round((N-s)/a)*a+s;return Math.max(s,Math.min(l,B))},v=N=>(N-s)/(l-s)*100,z=M(N=>{if(!y.current)return s;let B=y.current.getBoundingClientRect(),V=Math.max(0,Math.min(1,(N.clientX-B.left)/B.width));return k(s+V*(l-s))},[s,l,a]),C=M(N=>B=>{h||(B.preventDefault(),b(N))},[h]),$=M(N=>{if(h)return;let B=z(N);if(c){let V=Math.abs(B-S[0]),G=Math.abs(B-S[1]);V<=G?i([k(B),S[1]]):i([S[0],k(B)])}else i(k(B))},[h,z,c,S,i,s,l,a]);se(()=>{if(!f)return;let N=V=>{let G=z(V),K=E.current,ee=g.current;f==="single"?ee(k(G)):f==="start"?ee([Math.min(k(G),K[1]),K[1]]):f==="end"&&ee([K[0],Math.max(K[0],k(G))])},B=()=>b(null);return document.addEventListener("mousemove",N),document.addEventListener("mouseup",B),()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",B)}},[f,z,s,l,a]);let P=M(N=>{if(h)return;let B=0;if(N.key==="ArrowRight"||N.key==="ArrowUp")B=a;else if(N.key==="ArrowLeft"||N.key==="ArrowDown")B=-a;else return;N.preventDefault(),c||i(k((typeof r=="number"?r:0)+B))},[h,a,c,r,i,s,l]),W={position:"relative",width:"100%",height:"6px",backgroundColor:"#e5e7eb",borderRadius:"3px",cursor:h?"not-allowed":"pointer"},A=c?v(S[0]):0,H=v(c?S[1]:S[0]),L={position:"absolute",top:"0",left:`${A}%`,width:`${H-A}%`,height:"100%",backgroundColor:h?"#9ca3af":"#3b82f6",borderRadius:"3px"},T=N=>x?N==="start"?`${x} minimum`:N==="end"?`${x} maximum`:x:N==="start"?"Minimum value":N==="end"?"Maximum value":"Value",w=(N,B,V)=>{let G={position:"absolute",top:"50%",left:`${N}%`,transform:"translate(-50%, -50%)",width:"18px",height:"18px",borderRadius:"50%",backgroundColor:"#ffffff",border:`2px solid ${h?"#9ca3af":"#3b82f6"}`,cursor:h?"not-allowed":"grab",boxShadow:"0 1px 3px rgba(0,0,0,0.15)",zIndex:"2"},K={position:"absolute",bottom:"24px",left:"50%",transform:"translateX(-50%)",backgroundColor:"#1f2937",color:"#ffffff",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",whiteSpace:"nowrap"};return o("div",{id:B==="single"||B==="start"?n:void 0,style:G,onMouseDown:C(B),role:"slider","aria-valuenow":String(V),"aria-valuemin":String(s),"aria-valuemax":String(l),"aria-label":T(B),tabIndex:h?-1:0,onKeyDown:P},d?o("div",{style:K},String(V)):null)},D=[];if(u)for(let N=s;N<=l;N+=a)D.push(o("div",{key:`tick-${N}`,style:{position:"absolute",top:"10px",left:`${v(N)}%`,width:"1px",height:"6px",backgroundColor:"#d1d5db",transform:"translateX(-50%)"}}));let R=[];if(p)for(let N of p)R.push(o("div",{key:`mark-${N.value}`,style:{position:"absolute",top:"18px",left:`${v(N.value)}%`,transform:"translateX(-50%)",fontSize:"11px",color:"#6b7280",whiteSpace:"nowrap"}},N.label));let F={paddingTop:d?"28px":"8px",paddingBottom:p||u?"28px":"8px",opacity:h?"0.6":"1"},I=[];return c?(I.push(w(v(S[0]),"start",S[0])),I.push(w(v(S[1]),"end",S[1]))):I.push(w(v(S[0]),"single",S[0])),o(me,{label:x,error:m,htmlFor:n},o("div",{style:F},o("div",{ref:y,style:W,role:"presentation",onClick:$},o("div",{style:L}),...I,...D,...R)))}var _s=["bold","italic","underline","strikethrough","heading1","heading2","bulletList","orderedList","blockquote","link","unlink","insertHR","removeFormat","undo","redo"],Os={bold:{label:"Bold",icon:"B",command:"bold"},italic:{label:"Italic",icon:"I",command:"italic"},underline:{label:"Underline",icon:"U",command:"underline"},strikethrough:{label:"Strikethrough",icon:"S",command:"strikethrough"},heading1:{label:"Heading 1",icon:"H1",command:"formatBlock",value:"h1"},heading2:{label:"Heading 2",icon:"H2",command:"formatBlock",value:"h2"},heading3:{label:"Heading 3",icon:"H3",command:"formatBlock",value:"h3"},bulletList:{label:"Bullet list",icon:"\u2022",command:"insertUnorderedList"},orderedList:{label:"Numbered list",icon:"1.",command:"insertOrderedList"},blockquote:{label:"Blockquote",icon:"\u201C",command:"formatBlock",value:"blockquote"},link:{label:"Insert link",icon:"\u{1F517}",command:"createLink"},unlink:{label:"Remove link",icon:"\u26D4",command:"unlink"},insertHR:{label:"Horizontal rule",icon:"\u2015",command:"insertHorizontalRule"},removeFormat:{label:"Clear format",icon:"\u2718",command:"removeFormat"},undo:{label:"Undo",icon:"\u21A9",command:"undo"},redo:{label:"Redo",icon:"\u21AA",command:"redo"}};function to(e){let[t,n]=X(!1),r=ie(null),i=fe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.id??i,l=e.toolbar??_s,a=e.toolbarStyle??{},d=e.editorStyle??{};se(()=>{r.current&&e.value!==void 0&&(r.current.innerHTML=e.value)},[]);let u=M((m,y)=>{if(!(e.disabled||e.readOnly)){if(m==="createLink"){let g=prompt("Enter URL:");if(!g)return;document.execCommand(m,!1,g)}else y&&m==="formatBlock"?document.execCommand(m,!1,`<${y}>`):document.execCommand(m,!1,y);r.current&&e.onChange&&e.onChange(r.current.innerHTML)}},[e.disabled,e.readOnly,e.onChange]),h=M(()=>{r.current&&e.onChange&&e.onChange(r.current.innerHTML)},[e.onChange]),p=M(()=>{n(!1),r.current&&e.onBlur&&e.onBlur(r.current.innerHTML)},[e.onBlur]),c=o("div",{className:"texteditor-toolbar",style:{display:"flex",flexWrap:"wrap",gap:"2px",padding:"6px 8px",backgroundColor:a.backgroundColor??"#f9fafb",borderBottom:a.borderBottom??"1px solid #e5e7eb",borderRadius:"6px 6px 0 0"}},...l.map(m=>{let y=Os[m];return y?o("button",{key:m,type:"button",title:y.label,onClick:()=>u(y.command,y.value),disabled:e.disabled||e.readOnly,style:{padding:"4px 8px",border:"none",borderRadius:"4px",backgroundColor:"transparent",color:a.buttonColor??"#374151",cursor:e.disabled?"not-allowed":"pointer",fontSize:a.buttonSize??"13px",fontWeight:m==="bold"?"700":m==="italic"?"400":"500",fontStyle:m==="italic"?"italic":"normal",textDecoration:m==="underline"?"underline":m==="strikethrough"?"line-through":"none",minWidth:"28px",textAlign:"center",lineHeight:"1.4"}},y.icon):null})),x=o("div",{ref:r,id:s,className:"texteditor-content",contentEditable:e.disabled?"false":"true",role:"textbox","aria-multiline":"true","aria-label":e.label??"Text editor","data-placeholder":e.placeholder??"",style:{padding:d.padding??"12px 14px",minHeight:e.minHeight??"200px",maxHeight:e.maxHeight??"none",overflow:"auto",backgroundColor:d.backgroundColor??"#ffffff",color:d.color??"#1f2937",fontFamily:d.fontFamily??"inherit",fontSize:d.fontSize??"14px",lineHeight:d.lineHeight??"1.6",outline:"none",borderRadius:"0 0 6px 6px",border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderTop:"none",transition:"border-color 0.15s"},onFocus:()=>n(!0),onBlur:p,onInput:h});return o(me,{label:e.label,htmlFor:s,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},o("div",{className:"texteditor",style:{border:t?"1px solid #3b82f6":e.error?"1px solid #ef4444":"1px solid #d1d5db",borderRadius:"6px",overflow:"hidden",transition:"border-color 0.15s"}},c,x))}function no(e){let[t,n]=X(!1),r=fe().replace(/[^a-zA-Z0-9_-]/g,""),i=e.id??`tf-${r}`,s=Pe(e.inputStyle??{},{focused:t,error:!!e.error}),l=!!(e.prefix||e.suffix),a=o("input",{type:e.type??"text",id:i,name:e.name,value:e.value,placeholder:e.placeholder,maxLength:e.maxLength?String(e.maxLength):void 0,pattern:e.pattern,autoComplete:e.autoComplete,autoFocus:e.autoFocus,readOnly:e.readOnly,disabled:e.disabled,"aria-invalid":e.error?"true":void 0,"aria-required":e.required?"true":void 0,className:`textfield-input ${e.className??""}`.trim(),style:l?{...s,border:"none",boxShadow:"none",flex:"1",minWidth:"0"}:s,onFocus:()=>n(!0),onBlur:u=>{n(!1),e.onBlur&&e.onBlur(u.target.value)},onInput:u=>{let h=u.target.value;e.onInput&&e.onInput(h),e.onChange&&e.onChange(h)},onKeyDown:u=>{u.key==="Enter"&&e.onEnter&&e.onEnter(u.target.value)}}),d=l?o("div",{style:{...s,display:"flex",alignItems:"center",gap:"8px",padding:"0"}},e.prefix?o("span",{style:{paddingLeft:"10px",color:"#9ca3af",flexShrink:"0"}},e.prefix):null,a,e.suffix?o("span",{style:{paddingRight:"10px",color:"#9ca3af",flexShrink:"0"}},e.suffix):null):a;return o(me,{label:e.label,htmlFor:i,helpText:e.helpText,error:e.error,required:e.required,disabled:e.disabled,styling:e.wrapperStyle},d)}var Vs=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo"];function De(e){return String(e).padStart(2,"0")}function Ys(e){let t=e.split(":");return{hour:parseInt(t[0],10)||0,minute:parseInt(t[1],10)||0,second:parseInt(t[2],10)||0}}function oo(e){let t=fe().replace(/[^a-zA-Z0-9_-]/g,""),n=e.id??t,{value:r,onChange:i,format:s="24h",minuteStep:l=1,disabled:a=!1,label:d,error:u,showSeconds:h=!1,timezone:p,showTimezone:c=!1,timezones:x=Vs,onTimezoneChange:m}=e,[y,g]=X(!1),f=q(()=>Ys(r),[r]),b=s==="12h",S=f.hour>=12,E=b?f.hour%12||12:f.hour,k=M((U,O,_)=>{let Z=Math.max(0,Math.min(23,U)),Q=Math.max(0,Math.min(59,O)),oe=Math.max(0,Math.min(59,_??0));i(h?`${De(Z)}:${De(Q)}:${De(oe)}`:`${De(Z)}:${De(Q)}`)},[i,h]),v=M(U=>{let O=parseInt(U.target.value,10)||0;b&&(O=O%12,S&&(O+=12)),k(O,f.minute,f.second)},[b,S,f.minute,f.second,k]),z=M(U=>{let O=parseInt(U.target.value,10)||0;k(f.hour,O,f.second)},[f.hour,f.second,k]),C=M(U=>{let O=parseInt(U.target.value,10)||0;k(f.hour,f.minute,O)},[f.hour,f.minute,k]),$=M(()=>{if(a)return;let U=S?f.hour-12:f.hour+12;k(U,f.minute,f.second)},[a,S,f.hour,f.minute,f.second,k]),P=M(U=>{a||k(f.hour+U,f.minute,f.second)},[a,f.hour,f.minute,f.second,k]),W=M(U=>{a||k(f.hour,f.minute+U*l,f.second)},[a,f.hour,f.minute,f.second,l,k]),A=M(U=>{a||k(f.hour,f.minute,f.second+U)},[a,f.hour,f.minute,f.second,k]),H=M(U=>{let O=U.target.value;m&&m(O)},[m]),L={display:"inline-flex",alignItems:"center",gap:"4px",...Pe({},{focused:y,error:!!u})},T={display:"flex",flexDirection:"column",alignItems:"center"},w={background:"none",border:"none",cursor:a?"not-allowed":"pointer",fontSize:"10px",padding:"0 4px",color:"#6b7280",lineHeight:"1"},D={width:"32px",textAlign:"center",border:"none",outline:"none",fontSize:"14px",fontFamily:"monospace",backgroundColor:"transparent",color:"#1f2937",padding:"0"},R={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},F=o("div",{style:T},o("button",{type:"button",style:w,onClick:()=>P(1),disabled:a},"\u25B2"),o("input",{type:"text",value:De(E),onChange:v,style:D,disabled:a,"aria-label":"Hour",onFocus:()=>g(!0),onBlur:()=>g(!1)}),o("button",{type:"button",style:w,onClick:()=>P(-1),disabled:a},"\u25BC")),I=o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"),N=o("div",{style:T},o("button",{type:"button",style:w,onClick:()=>W(1),disabled:a},"\u25B2"),o("input",{type:"text",value:De(f.minute),onChange:z,style:D,disabled:a,"aria-label":"Minute",onFocus:()=>g(!0),onBlur:()=>g(!1)}),o("button",{type:"button",style:w,onClick:()=>W(-1),disabled:a},"\u25BC")),B=h?o("span",{style:{fontSize:"16px",fontWeight:"700",color:"#374151",padding:"0 2px"}},":"):null,V=h?o("div",{style:T},o("button",{type:"button",style:w,onClick:()=>A(1),disabled:a},"\u25B2"),o("input",{type:"text",value:De(f.second),onChange:C,style:D,disabled:a,"aria-label":"Second",onFocus:()=>g(!0),onBlur:()=>g(!1)}),o("button",{type:"button",style:w,onClick:()=>A(-1),disabled:a},"\u25BC")):null,G=b?o("button",{type:"button",style:R,onClick:$,disabled:a,"aria-label":"Toggle AM/PM"},S?"PM":"AM"):null,K={marginLeft:"4px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"4px",backgroundColor:"#f9fafb",cursor:a?"not-allowed":"pointer",fontSize:"12px",fontWeight:"600",color:"#374151"},ee=p&&!c?o("span",{style:{marginLeft:"8px",fontSize:"12px",fontWeight:"600",color:"#6b7280"}},p):null,J=c?o("select",{style:K,value:p??x[0],onChange:H,disabled:a,"aria-label":"Timezone"},...x.map(U=>o("option",{key:U,value:U},U))):null,Y=[F,I,N];return B&&Y.push(B),V&&Y.push(V),G&&Y.push(G),ee&&Y.push(ee),J&&Y.push(J),o(me,{label:d,error:u,disabled:a,htmlFor:n},o("div",{id:n,style:L},...Y))}var Gs={sm:{trackW:32,trackH:18,thumbSize:14,offset:2},md:{trackW:44,trackH:24,thumbSize:20,offset:2},lg:{trackW:56,trackH:30,thumbSize:26,offset:2}};function ro(e){let{checked:t,onChange:n,label:r,labelPosition:i="right",disabled:s=!1,size:l="md",onColor:a="#3b82f6",offColor:d="#d1d5db"}=e,u=Gs[l],h=M(()=>{s||n(!t)},[s,t,n]),p=M(S=>{s||(S.key===" "||S.key==="Enter")&&(S.preventDefault(),n(!t))},[s,t,n]),c={width:`${u.trackW}px`,height:`${u.trackH}px`,borderRadius:`${u.trackH}px`,backgroundColor:t?a:d,position:"relative",cursor:s?"not-allowed":"pointer",transition:"background-color 0.2s",flexShrink:"0"},x=t?u.trackW-u.thumbSize-u.offset:u.offset,m={width:`${u.thumbSize}px`,height:`${u.thumbSize}px`,borderRadius:"50%",backgroundColor:"#ffffff",position:"absolute",top:`${u.offset}px`,left:`${x}px`,transition:"left 0.2s",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},y={display:"inline-flex",alignItems:"center",gap:"8px",opacity:s?"0.5":"1",userSelect:"none"},g=r?o("span",{style:{fontSize:"14px",color:"#374151"}},r):null,f=o("div",{style:c},o("div",{style:m}));return o("div",{style:y,onClick:h,onKeyDown:p,tabIndex:s?-1:0,role:"switch","aria-checked":t?"true":"false","aria-disabled":s?"true":void 0,"aria-label":r},...(i==="left"?[g,f]:[f,g]).filter(Boolean))}var io={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06)",md:"0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06)",lg:"0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05)"};function so(e){let t=e.bordered!==!1,n=e.shadow??"sm",r=e.padding??"16px",i=e.borderRadius??"8px",s=q(()=>{let h={display:"flex",flexDirection:"column",borderRadius:i,overflow:"hidden",backgroundColor:"#ffffff",transition:"box-shadow 0.2s, transform 0.2s"};return t&&(h.border="1px solid #e5e7eb"),h.boxShadow=io[n]??io.sm,e.hoverable&&(h.cursor="pointer"),{...h,...e.style??{}}},[t,n,i,e.hoverable,e.style]),l={display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:r,gap:"12px"},a={padding:r,paddingTop:e.title||e.subtitle?"0":r,flex:"1"},d={padding:r,paddingTop:"0",borderTop:"1px solid #f3f4f6",paddingBottom:r,marginTop:"auto"},u=e.title||e.subtitle||e.headerAction;return o("div",{className:`card ${e.hoverable?"card--hoverable":""} ${e.className??""}`.trim(),style:s},e.image?o("img",{src:e.image,alt:e.imageAlt??"",style:{width:"100%",height:"auto",display:"block",objectFit:"cover"}}):null,u?o("div",{className:"card__header",style:l},o("div",{style:{flex:"1",minWidth:"0"}},e.title?o("div",{className:"card__title",style:{fontSize:"16px",fontWeight:"600",color:"#111827",lineHeight:"1.4"}},e.title):null,e.subtitle?o("div",{className:"card__subtitle",style:{fontSize:"14px",color:"#6b7280",marginTop:"2px",lineHeight:"1.4"}},e.subtitle):null),e.headerAction?o("div",{className:"card__header-action"},e.headerAction):null):null,o("div",{className:"card__body",style:a},e.children),e.footer?o("div",{className:"card__footer",style:d},e.footer):null)}function ao(e){let t=q(()=>{let n={display:e.inline?"inline-flex":"flex"};return e.direction&&(n.flexDirection=e.direction),e.wrap&&(n.flexWrap=e.wrap),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyContent&&(n.justifyContent=e.justifyContent),{...n,...e.style??{}}},[e.direction,e.wrap,e.gap,e.alignItems,e.justifyContent,e.inline,e.style]);return o("div",{className:`flex-container ${e.className??""}`.trim(),style:t},e.children)}function lo(e){let t=q(()=>{let n={};return e.flex&&(n.flex=e.flex),e.grow!==void 0&&(n.flexGrow=String(e.grow)),e.shrink!==void 0&&(n.flexShrink=String(e.shrink)),e.basis&&(n.flexBasis=e.basis),e.alignSelf&&(n.alignSelf=e.alignSelf),e.order!==void 0&&(n.order=String(e.order)),{...n,...e.style??{}}},[e.flex,e.grow,e.shrink,e.basis,e.alignSelf,e.order,e.style]);return o("div",{className:`flex-item ${e.className??""}`.trim(),style:t},e.children)}function co(e){let t=q(()=>{let n={display:"grid"};return e.minColWidth?n.gridTemplateColumns=`repeat(auto-fit, minmax(${e.minColWidth}, 1fr))`:e.columns!==void 0&&(n.gridTemplateColumns=typeof e.columns=="number"?`repeat(${e.columns}, 1fr)`:e.columns),e.rows&&(n.gridTemplateRows=e.rows),e.gap&&(n.gap=e.gap),e.alignItems&&(n.alignItems=e.alignItems),e.justifyItems&&(n.justifyItems=e.justifyItems),e.areas&&e.areas.length>0&&(n.gridTemplateAreas=e.areas.map(r=>`"${r}"`).join(" ")),{...n,...e.style??{}}},[e.columns,e.rows,e.gap,e.alignItems,e.justifyItems,e.minColWidth,e.areas,e.style]);return o("div",{className:`grid ${e.className??""}`.trim(),style:t},e.children)}function uo(e){let t=q(()=>{let n={};return e.gridColumn&&(n.gridColumn=e.gridColumn),e.gridRow&&(n.gridRow=e.gridRow),e.gridArea&&(n.gridArea=e.gridArea),e.alignSelf&&(n.alignSelf=e.alignSelf),e.justifySelf&&(n.justifySelf=e.justifySelf),{...n,...e.style??{}}},[e.gridColumn,e.gridRow,e.gridArea,e.alignSelf,e.justifySelf,e.style]);return o("div",{className:`grid-item ${e.className??""}`.trim(),style:t},e.children)}var fo={none:"none",sm:"0 1px 3px rgba(0,0,0,0.12)",md:"0 4px 6px rgba(0,0,0,0.1)"};function po(e){let t=e.bordered!==!1,n=e.shadow??"none",[r,i]=X(!!e.defaultCollapsed),s=ie(null),[l,a]=X("auto");se(()=>{if(!e.collapsible)return;let y=s.current;y&&a(`${y.scrollHeight}px`)},[e.children,e.collapsible]);let d=M(()=>{e.collapsible&&i(y=>!y)},[e.collapsible]),u=M(y=>{if(!e.collapsible)return;let g=y.key;(g==="Enter"||g===" ")&&(y.preventDefault(),d())},[e.collapsible,d]),h=q(()=>{let y={borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff"};return t&&(y.border="1px solid #e5e7eb"),y.boxShadow=fo[n]??fo.none,{...y,...e.style??{}}},[t,n,e.style]),p={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",gap:"8px",backgroundColor:"#f9fafb",userSelect:"none",cursor:e.collapsible?"pointer":"default"},c={display:"inline-block",width:"0",height:"0",borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:"6px solid #6b7280",transition:"transform 0.2s",transform:r?"rotate(-90deg)":"rotate(0deg)",marginRight:"8px",flexShrink:"0"},x={maxHeight:r?"0":l,overflow:"hidden",transition:"max-height 0.3s ease"},m={padding:"16px"};return o("div",{className:`panel ${e.className??""}`.trim(),style:h},o("div",{className:"panel__header",style:p,onClick:d,onKeyDown:u,role:e.collapsible?"button":void 0,tabIndex:e.collapsible?0:void 0,"aria-expanded":e.collapsible?String(!r):void 0},o("div",{style:{display:"flex",alignItems:"center",flex:"1",minWidth:"0",gap:"8px"}},e.collapsible?o("span",{className:"panel__chevron",style:c}):null,e.icon?o("span",{className:"panel__icon"},e.icon):null,e.title?o("span",{className:"panel__title",style:{fontSize:"14px",fontWeight:"600",color:"#111827"}},e.title):null),e.headerRight?o("div",{className:"panel__header-right"},e.headerRight):null),o("div",{className:"panel__body-wrapper",style:e.collapsible?x:{},ref:s},o("div",{className:"panel__body",style:m},e.children)))}function mo(e,t){return e==="both"?"auto":e==="horizontal"?t==="x"?"auto":"hidden":t==="y"?"auto":"hidden"}function Us(e){switch(e){case"never":return{scrollbarWidth:"none"};case"always":return{scrollbarWidth:"thin"};case"hover":return{scrollbarWidth:"thin"};case"auto":default:return{scrollbarWidth:"auto"}}}function go(e){let t=e.direction??"vertical",n=e.showScrollbar??"auto",r=e.shadow??!1,i=ie(null),[s,l]=X(!0),[a,d]=X(!1),[u,h]=X(!0),[p,c]=X(!1),x=M(()=>{let b=i.current;if(!b)return;let S=2;l(b.scrollTop<=S),d(b.scrollTop+b.clientHeight>=b.scrollHeight-S),h(b.scrollLeft<=S),c(b.scrollLeft+b.clientWidth>=b.scrollWidth-S)},[]);se(()=>{x()},[x]);let m=M(()=>{r&&x()},[r,x]),y=q(()=>{let b={position:"relative",overflowX:mo(t,"x"),overflowY:mo(t,"y"),...Us(n)};return e.maxHeight&&(b.maxHeight=e.maxHeight),e.maxWidth&&(b.maxWidth=e.maxWidth),e.padding&&(b.padding=e.padding),{...b,...e.style??{}}},[t,n,e.maxHeight,e.maxWidth,e.padding,e.style]),g=[];if(r){let b=t==="vertical"||t==="both",S=t==="horizontal"||t==="both";b&&!s&&g.push("inset 0 8px 6px -6px rgba(0,0,0,0.15)"),b&&!a&&g.push("inset 0 -8px 6px -6px rgba(0,0,0,0.15)"),S&&!u&&g.push("inset 8px 0 6px -6px rgba(0,0,0,0.15)"),S&&!p&&g.push("inset -8px 0 6px -6px rgba(0,0,0,0.15)")}let f={...y};return g.length>0&&(f.boxShadow=g.join(", ")),o("div",{className:`scroll-container scroll-container--${t} ${e.className??""}`.trim(),style:f,ref:i,onScroll:m},e.children)}function ho(e){let t=e.direction??"horizontal",n=t==="horizontal",r=e.dividerSize??6,i=e.minSize??50,[s,l]=X(e.initialSplit??50),a=ie(null),d=ie(!1),u=M(y=>{y.preventDefault(),d.current=!0,document.body.style.cursor=n?"col-resize":"row-resize",document.body.style.userSelect="none"},[n]);se(()=>{let y=f=>{if(!d.current||!a.current)return;let b=a.current.getBoundingClientRect(),S=n?b.width:b.height,E=n?f.clientX-b.left:f.clientY-b.top;if(S<=0)return;let k=i/S*100,v=e.maxSize?e.maxSize/S*100:100-k,z=E/S*100;z=Math.max(k,Math.min(v,z)),l(z)},g=()=>{d.current&&(d.current=!1,document.body.style.cursor="",document.body.style.userSelect="")};return document.addEventListener("mousemove",y),document.addEventListener("mouseup",g),()=>{document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",g)}},[n,i,e.maxSize]);let h=q(()=>({display:"flex",flexDirection:n?"row":"column",width:"100%",height:"100%",overflow:"hidden",...e.style??{}}),[n,e.style]),p=n?{width:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"}:{height:`calc(${s}% - ${r/2}px)`,overflow:"auto",flexShrink:"0"},c={flex:"1",overflow:"auto",minWidth:"0",minHeight:"0"},x={flexShrink:"0",backgroundColor:"#e5e7eb",transition:"background-color 0.15s",...n?{width:`${r}px`,cursor:"col-resize",height:"100%"}:{height:`${r}px`,cursor:"row-resize",width:"100%"}},m=Array.isArray(e.children)?e.children:[];return o("div",{className:`splitter splitter--${t} ${e.className??""}`.trim(),style:h,ref:a},o("div",{className:"splitter__pane splitter__pane--first",style:p},m[0]??null),o("div",{className:"splitter__divider",style:x,onMouseDown:u,onKeyDown:y=>{let g=y.key,f=2;n&&(g==="ArrowLeft"||g==="ArrowRight")?(y.preventDefault(),l(b=>{let S=g==="ArrowRight"?f:-f;return Math.max(5,Math.min(95,b+S))})):!n&&(g==="ArrowUp"||g==="ArrowDown")&&(y.preventDefault(),l(b=>{let S=g==="ArrowDown"?f:-f;return Math.max(5,Math.min(95,b+S))}))},role:"separator",tabIndex:0,"aria-orientation":n?"vertical":"horizontal","aria-valuenow":String(Math.round(s)),"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Resize panels"}),o("div",{className:"splitter__pane splitter__pane--second",style:c},m[1]??null))}function bo(e){let t=e.position??"top",n=e.variant??"line",r=e.tabs.find(f=>!f.disabled)?.id??"",[i,s]=X(e.activeTab??r),l=e.activeTab??i,a=ie(null),d=M(f=>{s(f),e.onChange&&e.onChange(f)},[e.onChange]),u=M(f=>{let b=e.tabs.filter(C=>!C.disabled),S=b.findIndex(C=>C.id===l);if(S===-1)return;let E=t==="left"||t==="right",k=E?"ArrowUp":"ArrowLeft",v=E?"ArrowDown":"ArrowRight",z=-1;if(f.key===k?z=S>0?S-1:b.length-1:f.key===v?z=S<b.length-1?S+1:0:f.key==="Home"?z=0:f.key==="End"&&(z=b.length-1),z>=0){f.preventDefault(),d(b[z].id);let C=a.current;if(C){let P=C.querySelectorAll('[role="tab"]')[e.tabs.indexOf(b[z])];P&&P.focus()}}},[e.tabs,l,t,d]),h=t==="left"||t==="right",p=t==="bottom"||t==="right",c=q(()=>({display:"flex",flexDirection:h?p?"row-reverse":"row":p?"column-reverse":"column",width:"100%",...e.style??{}}),[h,p,e.style]),x={display:"flex",flexDirection:h?"column":"row",gap:n==="pill"?"4px":"0",...n==="line"&&!h?{borderBottom:"2px solid #e5e7eb"}:{},...n==="line"&&h?{borderRight:t==="left"?"2px solid #e5e7eb":"none",borderLeft:t==="right"?"2px solid #e5e7eb":"none"}:{},...n==="card"?{backgroundColor:"#f9fafb"}:{},...n==="pill"?{padding:"4px"}:{},flexShrink:"0"},m={flex:"1",padding:"16px",minWidth:"0",minHeight:"0"},y=e.tabs.find(f=>f.id===l),g=e.tabs.map(f=>{let b=f.id===l,S={padding:"8px 16px",border:"none",background:"none",cursor:f.disabled?"not-allowed":"pointer",opacity:f.disabled?"0.5":"1",fontSize:"14px",fontWeight:b?"600":"400",color:b?"#3b82f6":"#6b7280",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"6px",outline:"none",transition:"color 0.15s, background-color 0.15s"};return n==="line"?h?t==="left"?(S.borderRight=b?"2px solid #3b82f6":"2px solid transparent",S.marginRight="-2px"):(S.borderLeft=b?"2px solid #3b82f6":"2px solid transparent",S.marginLeft="-2px"):(S.borderBottom=b?"2px solid #3b82f6":"2px solid transparent",S.marginBottom="-2px"):n==="card"?(S.backgroundColor=b?"#ffffff":"transparent",S.borderRadius="6px 6px 0 0",b&&(S.border="1px solid #e5e7eb",S.borderBottom="1px solid #ffffff")):n==="pill"&&(S.borderRadius="9999px",S.backgroundColor=b?"#3b82f6":"transparent",S.color=b?"#ffffff":"#6b7280"),o("button",{key:f.id,role:"tab","aria-selected":String(b),"aria-controls":`tabpanel-${f.id}`,"aria-disabled":f.disabled?"true":void 0,id:`tab-${f.id}`,tabIndex:b?"0":"-1",style:S,onClick:f.disabled?void 0:()=>d(f.id),onKeyDown:u},f.icon?o("span",{className:"tabs__tab-icon"},f.icon):null,f.label)});return o("div",{className:`tabs tabs--${t} tabs--${n} ${e.className??""}`.trim(),style:c},o("div",{className:"tabs__list",role:"tablist","aria-label":"Tabs","aria-orientation":h?"vertical":"horizontal",style:x,ref:a},...g),o("div",{className:"tabs__panel",role:"tabpanel",id:`tabpanel-${l}`,"aria-labelledby":`tab-${l}`,style:m,tabIndex:"0"},y?y.content:null))}function xo(e){let t=e.items??[],n=t.length,r=e.loop!==!1,i=e.showDots!==!1,s=e.showArrows!==!1,l=e.animation??"slide",a=e.interval??5e3,d=fe().replace(/[^a-zA-Z0-9_-]/g,""),[u,h]=X(0),p=ie(null),c=ie(null),x=M(v=>{let z=v;r?z=(v%n+n)%n:z=Math.max(0,Math.min(v,n-1)),h(z),e.onChange&&e.onChange(z)},[n,r,e.onChange]),m=M(()=>x(u+1),[u,x]),y=M(()=>x(u-1),[u,x]);se(()=>{if(!e.autoPlay||n<=1)return;let v=setInterval(m,a);return()=>clearInterval(v)},[e.autoPlay,a,m,n]),se(()=>{let v=C=>{C.key==="ArrowLeft"?y():C.key==="ArrowRight"&&m()},z=c.current;if(z)return z.addEventListener("keydown",v),()=>z.removeEventListener("keydown",v)},[m,y]);let g=l==="fade"?`@keyframes liq-fade-in-${d}{from{opacity:0}to{opacity:1}}`:"",f={position:"relative",overflow:"hidden",width:"100%",outline:"none"},b=q(()=>l==="fade"?{position:"relative",width:"100%"}:{display:"flex",transition:"transform 0.4s ease",transform:`translateX(-${u*100}%)`,width:"100%"},[u,l]),S={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:"2",background:"rgba(255,255,255,0.8)",border:"none",borderRadius:"50%",width:"36px",height:"36px",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#111827",boxShadow:"0 1px 3px rgba(0,0,0,0.2)"},E=t.map((v,z)=>{let C=l==="fade"?{position:z===u?"relative":"absolute",top:"0",left:"0",width:"100%",opacity:z===u?"1":"0",transition:"opacity 0.4s ease"}:{flex:"0 0 100%",width:"100%"};return o("div",{key:String(z),style:C},v.content,v.caption?o("div",{style:{textAlign:"center",padding:"8px 12px",fontSize:"13px",color:"#6b7280"}},v.caption):null)}),k=i?o("div",{style:{display:"flex",justifyContent:"center",gap:"8px",padding:"12px 0"}},...t.map((v,z)=>o("button",{key:String(z),"aria-label":`Go to slide ${z+1}`,onclick:()=>x(z),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",backgroundColor:z===u?"#3b82f6":"#d1d5db",transition:"background-color 0.2s",padding:"0"}}))):null;return o("div",{ref:c,tabindex:"0",role:"region","aria-label":"Carousel",style:f,onpointerdown:v=>{p.current=v.clientX},onpointerup:v=>{if(p.current==null)return;let z=v.clientX-p.current;z>50?y():z<-50&&m(),p.current=null}},g?o("style",null,g):null,o("div",{style:b},...E),s&&n>1?o("button",{"aria-label":"Previous slide",onclick:y,style:{...S,left:"8px"}},"\u2039"):null,s&&n>1?o("button",{"aria-label":"Next slide",onclick:m,style:{...S,right:"8px"}},"\u203A"):null,k)}function yo(e){let[t,n]=X("loading"),r=ie(null),i=fe().replace(/[^a-zA-Z0-9_-]/g,""),s=e.lazy!==!1,l=typeof e.width=="number"?`${e.width}px`:e.width,a=typeof e.height=="number"?`${e.height}px`:e.height;se(()=>{n("loading")},[e.src]);let d=q(()=>{let x={display:"inline-block",position:"relative",overflow:"hidden"};return l&&(x.width=l),a&&(x.height=a),e.borderRadius&&(x.borderRadius=e.borderRadius),x},[l,a,e.borderRadius]),u=q(()=>{let x={display:"block",width:"100%",height:"100%"};return e.objectFit&&(x.objectFit=e.objectFit),t==="loading"&&(x.opacity="0",x.position="absolute"),t==="error"&&(x.display="none"),x},[e.objectFit,t]),h=null;if(t==="loading")if(e.placeholder==="skeleton"){let x=`@keyframes liq-img-shimmer-${i}{0%{background-position:-200% 0}100%{background-position:200% 0}}`;h=o("div",null,o("style",null,x),o("div",{style:{width:l??"100%",height:a??"200px",backgroundColor:"#e5e7eb",backgroundImage:"linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%)",backgroundSize:"200% 100%",animation:`liq-img-shimmer-${i} 1.5s ease-in-out infinite`}}))}else e.placeholder==="blur"?h=o("div",{style:{width:l??"100%",height:a??"200px",backgroundColor:"#d1d5db",filter:"blur(20px)"}}):e.placeholder!=null&&e.placeholder!==!1&&(h=e.placeholder);let p=null;t==="error"&&e.fallback!=null&&(typeof e.fallback=="string"?p=o("img",{src:e.fallback,alt:e.alt??"",style:{display:"block",width:"100%",height:"100%",objectFit:e.objectFit??"cover"}}):p=e.fallback);let c=o("div",{style:d},h,o("img",{ref:r,src:e.src,alt:e.alt??"",loading:s?"lazy":void 0,style:u,onload:()=>n("loaded"),onerror:()=>n("error")}),p);return e.caption?o("figure",{style:{margin:"0",display:"inline-block"}},c,o("figcaption",{style:{fontSize:"13px",color:"#6b7280",marginTop:"6px",textAlign:"center"}},e.caption)):c}function So(e){if(!isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n.toString().padStart(2,"0")}`}function vo(e){let t=e.controls!==!1,n=ie(null),r=fe().replace(/[^a-zA-Z0-9_-]/g,""),[i,s]=X(!1),[l,a]=X(0),[d,u]=X(0),[h,p]=X(e.muted?0:1),[c,x]=X(!!e.muted),[m,y]=X(!0),g=typeof e.width=="number"?`${e.width}px`:e.width??"100%",f=typeof e.height=="number"?`${e.height}px`:e.height??"auto";se(()=>{let $=n.current;if(!$)return;let P=()=>{s(!0),e.onPlay&&e.onPlay()},W=()=>{s(!1),e.onPause&&e.onPause()},A=()=>{s(!1),e.onEnded&&e.onEnded()},H=()=>{a($.currentTime),u($.duration),e.onTimeUpdate&&e.onTimeUpdate($.currentTime,$.duration)},L=()=>{u($.duration)};return $.addEventListener("play",P),$.addEventListener("pause",W),$.addEventListener("ended",A),$.addEventListener("timeupdate",H),$.addEventListener("loadedmetadata",L),()=>{$.removeEventListener("play",P),$.removeEventListener("pause",W),$.removeEventListener("ended",A),$.removeEventListener("timeupdate",H),$.removeEventListener("loadedmetadata",L)}},[e.onPlay,e.onPause,e.onEnded,e.onTimeUpdate]);let b=M(()=>{let $=n.current;$&&($.paused?$.play():$.pause())},[]),S=M($=>{let P=n.current;if(!P||!isFinite(P.duration))return;let W=$.currentTarget.getBoundingClientRect(),A=Math.max(0,Math.min(1,($.clientX-W.left)/W.width));P.currentTime=A*P.duration},[]),E=M($=>{let P=n.current,W=parseFloat($.target.value);P&&(P.volume=W,P.muted=W===0,p(W),x(W===0))},[]),k=M(()=>{let $=n.current;$&&$.requestFullscreen&&$.requestFullscreen()},[]);if(!t)return o("video",{ref:n,src:e.src,poster:e.poster,controls:!0,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,style:{width:g,height:f,display:"block"}});let v=d>0?l/d*100:0,z={background:"none",border:"none",color:"#ffffff",cursor:"pointer",fontSize:"16px",padding:"4px 8px",lineHeight:"1"},C=o("div",{style:{position:"absolute",bottom:"0",left:"0",right:"0",display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",background:"linear-gradient(transparent, rgba(0,0,0,0.7))",opacity:m?"1":"0",transition:"opacity 0.3s"}},o("button",{"aria-label":i?"Pause":"Play",onclick:b,style:z},i?"\u23F8":"\u25B6"),o("div",{onclick:S,style:{flex:"1",height:"4px",backgroundColor:"rgba(255,255,255,0.3)",borderRadius:"2px",cursor:"pointer",position:"relative"}},o("div",{style:{width:`${v}%`,height:"100%",backgroundColor:"#3b82f6",borderRadius:"2px",transition:"width 0.1s linear"}})),o("span",{style:{color:"#ffffff",fontSize:"12px",whiteSpace:"nowrap",fontFamily:"monospace"}},`${So(l)} / ${So(d)}`),o("input",{type:"range",min:"0",max:"1",step:"0.05",value:String(c?0:h),oninput:E,"aria-label":"Volume",style:{width:"60px",cursor:"pointer"}}),o("button",{"aria-label":"Fullscreen",onclick:k,style:z},"\u26F6"));return o("div",{style:{position:"relative",width:g,height:f,backgroundColor:"#000",overflow:"hidden"},onmouseenter:()=>y(!0),onmouseleave:()=>{i&&y(!1)}},o("video",{ref:n,src:e.src,poster:e.poster,autoplay:e.autoPlay?!0:void 0,loop:e.loop?!0:void 0,muted:e.muted?!0:void 0,playsinline:!0,onclick:b,style:{width:"100%",height:"100%",display:"block",objectFit:"contain"}}),C)}function xe(e){let t=e.orientation??"vertical",n=e.role??"navigation",r=e.keyboardNav??!0,i=e.styling??{},s=ie(null),l={display:"flex",flexDirection:t==="horizontal"?"row":"column",backgroundColor:i.backgroundColor??"#ffffff",color:i.color??"#1f2937",fontFamily:i.fontFamily??"inherit",fontSize:i.fontSize??"14px",border:i.border??"1px solid #e5e7eb",borderRadius:i.borderRadius??"8px",padding:i.padding??"0",width:typeof i.width=="number"?`${i.width}px`:i.width??"auto",overflow:"auto",boxSizing:"border-box",listStyle:"none",margin:"0",...i.boxShadow?{boxShadow:i.boxShadow}:{},...i.maxHeight?{maxHeight:typeof i.maxHeight=="number"?`${i.maxHeight}px`:i.maxHeight}:{},...i.custom??{}},a=M(d=>{if(!r)return;let u=d,h=s.current;if(!h)return;let p=Array.from(h.querySelectorAll('button, [tabindex]:not([tabindex="-1"]), a[href], [role="menuitem"], [role="treeitem"]')),c=p.indexOf(document.activeElement);if(c<0)return;let x=t==="vertical",m=x?"ArrowDown":"ArrowRight",y=x?"ArrowUp":"ArrowLeft";if(u.key===m){u.preventDefault();let g=p[c+1];g&&g.focus()}else if(u.key===y){u.preventDefault();let g=p[c-1];g&&g.focus()}else u.key==="Home"?(u.preventDefault(),p[0]?.focus()):u.key==="End"&&(u.preventDefault(),p[p.length-1]?.focus())},[r,t]);return o("nav",{ref:s,role:n,"aria-label":e.ariaLabel??void 0,"aria-orientation":t,className:`nav-wrapper ${e.className??""}`.trim(),style:l,onKeyDown:a},e.children)}function Oe(e,t){return{display:"flex",alignItems:"center",padding:e.padding??"10px 16px",cursor:e.cursor??"pointer",transition:e.transition??"background-color 0.15s",backgroundColor:t.active?e.activeBackground??"#eff6ff":t.hover?e.hoverBackground??"#f3f4f6":"transparent",color:t.active?e.activeColor??"#2563eb":"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",...e.separator?{borderBottom:e.separator}:{}}}function he(){let[e,t]=X(!1);return{hover:e,onMouseEnter:M(()=>t(!0),[]),onMouseLeave:M(()=>t(!1),[])}}function js(e){let{section:t,expanded:n,onToggle:r,headerStyle:i,expandIcon:s,collapseIcon:l,iconPosition:a}=e,{hover:d,onMouseEnter:u,onMouseLeave:h}=he(),p=t.disabled===!0,c={display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",boxSizing:"border-box",padding:i.padding??"12px 16px",backgroundColor:p?"#f9fafb":d?i.hoverBackground??"#f3f4f6":i.backgroundColor??"transparent",color:p?"#9ca3af":i.color??"inherit",fontWeight:i.fontWeight??"600",fontSize:i.fontSize??"inherit",border:"none",outline:"none",cursor:p?"not-allowed":"pointer",font:"inherit",textAlign:"left",transition:"background-color 0.15s",...i.borderBottom?{borderBottom:i.borderBottom}:{}};a==="left"&&(c.flexDirection="row");let x=M(S=>{let E=S;p||(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),r())},[p,r]),m=M(()=>{p||r()},[p,r]),g=o("span",{"aria-hidden":"true",style:{display:"inline-block",transition:"transform 0.2s ease",transform:n?"rotate(180deg)":"rotate(0deg)",flexShrink:"0",marginLeft:a==="right"?"auto":"0",marginRight:a==="left"?"8px":"0",paddingLeft:a==="right"?"8px":"0"}},n?l:s),f=t.icon?o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},o("span",{"aria-hidden":"true"},t.icon),t.header):t.header,b=a==="left"?[g,f]:[f,g];return o("button",{id:`accordion-header-${t.id}`,role:"button","aria-expanded":String(n),"aria-controls":`accordion-panel-${t.id}`,"aria-disabled":p?"true":void 0,"data-section-id":t.id,tabIndex:p?-1:0,style:c,onClick:m,onKeyDown:x,onMouseEnter:u,onMouseLeave:h},...b)}function Xs(e){let{section:t,expanded:n,contentStyle:r,animated:i}=e,s={overflow:"hidden",boxSizing:"border-box",...i?{maxHeight:n?"2000px":"0",transition:"max-height 0.3s ease"}:{display:n?"block":"none"}},l={padding:r.padding??"12px 16px",backgroundColor:r.backgroundColor??"transparent",...r.borderBottom?{borderBottom:r.borderBottom}:{}};return o("div",{id:`accordion-panel-${t.id}`,role:"region","aria-labelledby":`accordion-header-${t.id}`,"aria-hidden":String(!n),"data-section-content":t.id,style:s},o("div",{style:l},t.content))}function wo(e){let{sections:t,defaultExpanded:n,allowMultiple:r=!1,headerStyle:i={},contentStyle:s={},wrapperStyle:l,expandIcon:a="+",collapseIcon:d="\u2212",iconPosition:u="right",animated:h=!0,onChange:p}=e,[c,x]=X(()=>n??[]),m=M(g=>{x(f=>{let b=f.includes(g),S;return b?S=f.filter(E=>E!==g):r?S=[...f,g]:S=[g],p&&p(S),S})},[r,p]),y=q(()=>t.map(g=>{let f=c.includes(g.id),b=o(js,{key:`header-${g.id}`,section:g,expanded:f,onToggle:()=>m(g.id),headerStyle:i,expandIcon:a,collapseIcon:d,iconPosition:u}),S=o(Xs,{key:`content-${g.id}`,section:g,expanded:f,contentStyle:s,animated:h});return o("div",{key:g.id,"data-accordion-section":g.id,style:{width:"100%"}},b,S)}),[t,c,i,s,a,d,u,h,m]);return o(xe,{role:"region",ariaLabel:"Accordion",styling:l,keyboardNav:!0},...y)}var qs={sm:{fontSize:"12px",padding:"4px 0"},md:{fontSize:"14px",padding:"6px 0"},lg:{fontSize:"16px",padding:"8px 0"}};function ko(e){let{items:t,separator:n="/",maxItems:r,size:i="md"}=e,[s,l]=X(!1),a=qs[i],d=M(()=>{l(!0)},[]),u=t,h=!1;if(r&&r>1&&t.length>r&&!s){h=!0;let m=1,y=r-1;u=[...t.slice(0,m),{label:"..."},...t.slice(t.length-y)]}let p=m=>typeof m=="string"?o("span",{"aria-hidden":"true",style:{margin:"0 8px",color:"#9ca3af",userSelect:"none"}},m):o("span",{"aria-hidden":"true",style:{margin:"0 8px"}},m),c=(m,y,g)=>{let f=y===g.length-1,b=h&&m.label==="..."&&y===1,S=[];return y>0&&S.push(p(n)),b?S.push(o("button",{type:"button",onClick:d,style:{background:"none",border:"none",cursor:"pointer",padding:"2px 4px",fontSize:a.fontSize,color:"#6b7280",fontFamily:"inherit"},"aria-label":"Show all breadcrumb items"},"...")):f?S.push(o("span",{"aria-current":"page",style:{color:"#1f2937",fontWeight:"600",fontSize:a.fontSize}},m.label)):m.href?S.push(o("a",{href:m.href,onClick:m.onClick?E=>{E.preventDefault(),m.onClick()}:void 0,style:{color:"#2563eb",textDecoration:"none",fontSize:a.fontSize}},m.label)):m.onClick?S.push(o("button",{type:"button",onClick:m.onClick,style:{background:"none",border:"none",cursor:"pointer",color:"#2563eb",padding:"0",fontSize:a.fontSize,fontFamily:"inherit"}},m.label)):S.push(o("span",{style:{color:"#6b7280",fontSize:a.fontSize}},m.label)),o("li",{key:String(y),style:{display:"inline-flex",alignItems:"center"}},...S)},x=u.map((m,y)=>c(m,y,u));return o(xe,{orientation:"horizontal",role:"navigation",ariaLabel:"Breadcrumb",keyboardNav:!1,styling:{border:"none",borderRadius:"0",padding:a.padding,backgroundColor:"transparent"}},o("ol",{style:{display:"flex",alignItems:"center",listStyle:"none",margin:"0",padding:"0",flexWrap:"wrap"}},...x))}function Co(e){let{item:t,itemStyle:n,closeOnSelect:r,onClose:i}=e,{hover:s,onMouseEnter:l,onMouseLeave:a}=he(),[d,u]=X(!1),h=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let p=t.disabled===!0,x={...Oe(n,{hover:!p&&s,active:!1}),position:"relative",justifyContent:"space-between",...p?{color:"#9ca3af",cursor:"default",opacity:"0.6"}:{}},m=M(()=>{if(!p){if(h){u(E=>!E);return}t.onClick&&t.onClick(),r&&i()}},[p,h,t,r,i]),y=M(()=>{l(),h&&u(!0)},[h,l]),g=M(()=>{a(),h&&u(!1)},[h,a]),f=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{flexShrink:"0"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label)),b=h?o("span",{style:{marginLeft:"8px",fontSize:"10px",lineHeight:"1"},"aria-hidden":"true"},"\u203A"):null,S=h&&d?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1000"}},o(xe,{orientation:"vertical",role:"menu",styling:{boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",width:"200px",backgroundColor:"#ffffff"}},...t.children.map(E=>o(Co,{key:E.id,item:E,itemStyle:n,closeOnSelect:r,onClose:i})))):null;return o("div",{style:{position:"relative"},onMouseEnter:y,onMouseLeave:g},o("button",{type:"button",role:"menuitem",style:x,onClick:m,disabled:p||void 0,tabIndex:p?-1:0,"aria-disabled":p?"true":void 0,"aria-haspopup":h||void 0,"aria-expanded":h?String(d):void 0},f,b),S)}function Mo(e){let{label:t,items:n,triggerStyle:r,menuStyle:i,itemStyle:s={},placement:l="bottom-start",closeOnSelect:a=!0,width:d="220px"}=e,[u,h]=X(!1),p=ie(null),c=M(()=>{h(E=>!E)},[]),x=M(()=>{h(!1)},[]);se(()=>{if(!u)return;let E=k=>{let v=p.current;v&&!v.contains(k.target)&&h(!1)};return document.addEventListener("click",E,!0),()=>{document.removeEventListener("click",E,!0)}},[u]),se(()=>{if(!u)return;let E=k=>{k.key==="Escape"&&h(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[u]);let m={display:"inline-flex",alignItems:"center",gap:"4px",padding:"8px 16px",fontSize:"14px",fontFamily:"inherit",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#1f2937",cursor:"pointer",outline:"none",...r??{}},y=o("button",{type:"button",style:m,onClick:c,"aria-haspopup":"true","aria-expanded":String(u)},o("span",null,t),o("span",{style:{marginLeft:"4px",fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true"},"\u25BC")),g=typeof d=="number"?`${d}px`:d,f={position:"absolute",top:"100%",...l==="bottom-end"?{right:"0"}:{left:"0"},marginTop:"4px",zIndex:"999"},b={boxShadow:"0 4px 12px rgba(0,0,0,0.15)",border:"1px solid #e5e7eb",borderRadius:"6px",padding:"4px 0",width:g,backgroundColor:"#ffffff",...i??{}},S=u?o("div",{style:f},o(xe,{orientation:"vertical",role:"menu",ariaLabel:`${t} menu`,styling:b},...n.map(E=>o(Co,{key:E.id,item:E,itemStyle:s,closeOnSelect:a,onClose:x})))):null;return o("div",{ref:p,style:{position:"relative",display:"inline-block"}},y,S)}function Po(e){let{item:t,onClose:n,index:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:l}=he(),[a,d]=X(!1),u=t.children&&t.children.length>0;if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let h=t.disabled===!0,p=M(()=>{if(!h){if(u){d(b=>!b);return}t.onClick&&t.onClick(),n()}},[h,u,t,n]),c=M(()=>{s(),u&&d(!0)},[u,s]),x=M(()=>{l(),u&&d(!1)},[u,l]),m={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 16px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",width:"100%",textAlign:"left",cursor:h?"default":"pointer",backgroundColor:!h&&i?"#f3f4f6":"transparent",color:h?"#9ca3af":"#1f2937",opacity:h?"0.6":"1",transition:"background-color 0.1s",boxSizing:"border-box"},y=o("span",{style:{display:"flex",alignItems:"center",gap:"8px"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):o("span",{style:{width:"16px"}}),o("span",null,t.label)),g=u?o("span",{style:{fontSize:"10px",color:"#9ca3af"},"aria-hidden":"true"},"\u25B6"):t.shortcut?o("span",{style:{fontSize:"11px",color:"#9ca3af",marginLeft:"24px"}},t.shortcut):null,f=u&&a?o("div",{style:{position:"absolute",left:"100%",top:"0",zIndex:"1001"}},o("div",{role:"menu",style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"180px"}},...t.children.map((b,S)=>o(Po,{key:String(S),item:b,onClose:n,index:S})))):null;return o("div",{style:{position:"relative"},onMouseEnter:c,onMouseLeave:x},o("button",{type:"button",role:"menuitem",style:m,onClick:p,disabled:h||void 0,tabIndex:-1,"aria-disabled":h||void 0,"aria-haspopup":u||void 0,"aria-expanded":u?a:void 0},y,g),f)}function Ks(e){let{menu:t,index:n,isOpen:r,anyOpen:i,onOpen:s,onClose:l}=e,{hover:a,onMouseEnter:d,onMouseLeave:u}=he(),h=ie(null),p=M(()=>{r?l():s(n)},[r,n,s,l]),c=M(()=>{d(),i&&!r&&s(n)},[i,r,n,s,d]),x={display:"inline-flex",alignItems:"center",padding:"6px 12px",fontSize:"13px",fontFamily:"inherit",border:"none",outline:"none",cursor:"pointer",backgroundColor:r?"#e5e7eb":a?"#f3f4f6":"transparent",color:"#1f2937",borderRadius:"4px",transition:"background-color 0.1s"},m=r?o("div",{style:{position:"absolute",top:"100%",left:"0",zIndex:"1000",marginTop:"2px"}},o("div",{role:"menu","aria-label":`${t.label} menu`,style:{backgroundColor:"#ffffff",border:"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",minWidth:"200px"}},...t.items.map((y,g)=>o(Po,{key:String(g),item:y,onClose:l,index:g})))):null;return o("div",{style:{position:"relative",display:"inline-block"},onMouseEnter:c,onMouseLeave:u},o("button",{ref:h,type:"button",role:"menuitem",style:x,onClick:p,"aria-haspopup":"true","aria-expanded":String(r),tabIndex:0},t.label),m)}function Eo(e){let{menus:t}=e,[n,r]=X(null),i=ie(null),s=M(d=>{r(d)},[]),l=M(()=>{r(null)},[]);se(()=>{if(n===null)return;let d=u=>{let h=i.current;h&&!h.contains(u.target)&&r(null)};return document.addEventListener("click",d,!0),()=>{document.removeEventListener("click",d,!0)}},[n]),se(()=>{let d=i.current;if(!d)return;let u=h=>{let p=h;if(p.key==="Escape"){r(null);return}if(p.key==="ArrowRight"){p.preventDefault(),r(c=>c===null?0:(c+1)%t.length);return}if(p.key==="ArrowLeft"){p.preventDefault(),r(c=>c===null?t.length-1:(c-1+t.length)%t.length);return}if(p.key==="ArrowDown"&&n!==null){p.preventDefault();let c=d.querySelector('[role="menu"]');if(c){let x=c.querySelector('[role="menuitem"]');x&&x.focus()}return}p.key==="Enter"||p.key};return d.addEventListener("keydown",u),()=>{d.removeEventListener("keydown",u)}},[n,t.length]);let a=t.map((d,u)=>o(Ks,{key:String(u),menu:d,index:u,isOpen:n===u,anyOpen:n!==null,onOpen:s,onClose:l}));return o("div",{ref:i,role:"menubar","aria-label":"Menu bar",style:{display:"flex",alignItems:"center",backgroundColor:"#ffffff",borderBottom:"1px solid #e5e7eb",padding:"2px 4px",fontFamily:"inherit",fontSize:"13px",gap:"2px"}},...a)}function lt(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Zs(e,t,n){let r=n*2+5;if(e<=r)return lt(1,e);let i=Math.max(t-n,1),s=Math.min(t+n,e),l=i>2,a=s<e-1;return!l&&a?[...lt(1,n*2+3),"ellipsis",e]:l&&!a?[1,"ellipsis",...lt(e-n*2-2,e)]:[1,"ellipsis",...lt(i,s),"ellipsis",e]}var ct={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",padding:"4px 8px",border:"1px solid #d1d5db",borderRadius:"6px",backgroundColor:"#ffffff",color:"#374151",fontSize:"14px",fontFamily:"inherit",cursor:"pointer",transition:"background-color 0.15s, color 0.15s",outline:"none",userSelect:"none"},Js={...ct,backgroundColor:"#2563eb",color:"#ffffff",borderColor:"#2563eb",fontWeight:"600"},$o={...ct,color:"#9ca3af",cursor:"default",opacity:"0.5"},Qs={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"36px",height:"36px",color:"#6b7280",fontSize:"14px",userSelect:"none"};function Ro(e){let{total:t,pageSize:n,currentPage:r,onChange:i,siblingCount:s=1,showFirstLast:l=!0,showPrevNext:a=!0,disabled:d=!1}=e,u=Math.max(1,Math.ceil(t/n)),h=Math.min(Math.max(1,r),u),p=M(g=>{!d&&g>=1&&g<=u&&g!==h&&i(g)},[d,u,h,i]),c=(g,f,b)=>{let S=d||f<1||f>u||f===h;return o("button",{type:"button",onClick:()=>p(f),disabled:S||void 0,"aria-label":b,style:S?$o:ct},g)},x=Zs(u,h,s),m=0,y=[];l&&y.push(c("\xAB",1,"Go to first page")),a&&y.push(c("\u2039",h-1,"Go to previous page"));for(let g of x)if(g==="ellipsis")y.push(o("span",{key:`ellipsis-${m++}`,style:Qs},"..."));else{let f=g===h;y.push(o("button",{key:String(g),type:"button",onClick:()=>p(g),disabled:d||void 0,"aria-label":`Page ${g}`,"aria-current":f?"page":void 0,style:d?$o:f?Js:ct},String(g)))}return a&&y.push(c("\u203A",h+1,"Go to next page")),l&&y.push(c("\xBB",u,"Go to last page")),o(xe,{orientation:"horizontal",role:"navigation",ariaLabel:"Pagination",keyboardNav:!0,styling:{border:"none",borderRadius:"0",backgroundColor:"transparent",padding:"0",custom:{gap:"4px"}}},...y)}function zo(e){let{item:t,collapsed:n,selectedId:r,onSelect:i,depth:s}=e,{hover:l,onMouseEnter:a,onMouseLeave:d}=he(),[u,h]=X(!1),p=t.children&&t.children.length>0,c=t.id===r,x=M(()=>{p&&!n&&h(z=>!z),i&&i(t.id)},[p,n,i,t.id]),m=n?"0":`${16+s*16}px`,y={display:"flex",alignItems:"center",padding:n?"10px 0":`10px 12px 10px ${m}`,justifyContent:n?"center":"flex-start",cursor:"pointer",backgroundColor:c?"#eff6ff":l?"#f3f4f6":"transparent",color:c?"#2563eb":"#1f2937",border:"none",outline:"none",width:"100%",textAlign:"left",font:"inherit",fontSize:"14px",transition:"background-color 0.15s",position:"relative",gap:"10px",boxSizing:"border-box"},g=t.icon?o("span",{style:{flexShrink:"0",fontSize:"16px"},"aria-hidden":"true"},t.icon):null,f=n?null:o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.label),b=!n&&t.badge?o("span",{style:{backgroundColor:"#ef4444",color:"#ffffff",fontSize:"11px",fontWeight:"600",padding:"1px 6px",borderRadius:"10px",marginLeft:"4px",flexShrink:"0"}},t.badge):null,S=!n&&p?o("span",{style:{fontSize:"10px",transition:"transform 0.15s",transform:u?"rotate(90deg)":"rotate(0deg)",marginLeft:"4px"},"aria-hidden":"true"},"\u25B6"):null,E=n&&l?o("div",{style:{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px",padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"},role:"tooltip"},t.label):null,k=o("button",{type:"button",style:y,onClick:x,onMouseEnter:a,onMouseLeave:d,"aria-selected":c?"true":"false",title:n?t.label:void 0},g,f,b,S,E),v=!n&&p&&u?t.children.map(z=>o(zo,{key:z.id,item:z,collapsed:n,selectedId:r,onSelect:i,depth:s+1})):null;return o("div",{key:t.id,style:{position:"relative"}},k,v?o("div",{role:"group"},...v):null)}function To(e){let{items:t,collapsed:n=!1,onToggleCollapse:r,selectedId:i,onSelect:s,width:l="240px",collapsedWidth:a="56px"}=e,d=n?typeof a=="number"?`${a}px`:a:typeof l=="number"?`${l}px`:l,u=r?o("button",{type:"button",onClick:r,"aria-label":n?"Expand sidebar":"Collapse sidebar",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",padding:"10px 0",border:"none",borderBottom:"1px solid #e5e7eb",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"#6b7280",fontFamily:"inherit"}},n?"\u25B6":"\u25C0"):null,h=t.map(p=>o(zo,{key:p.id,item:p,collapsed:n,selectedId:i,onSelect:s,depth:0}));return o(xe,{orientation:"vertical",role:"navigation",ariaLabel:"Sidebar",keyboardNav:!0,styling:{width:d,border:"1px solid #e5e7eb",borderRadius:"0",padding:"0",backgroundColor:"#ffffff",custom:{height:"100%",transition:"width 0.2s",overflow:"hidden"}}},u,...h)}var Me={completed:"#2563eb",completedBg:"#2563eb",completedText:"#ffffff",active:"#2563eb",activeBorder:"#2563eb",activeText:"#2563eb",pending:"#d1d5db",pendingText:"#9ca3af",line:"#d1d5db",lineCompleted:"#2563eb",labelActive:"#1f2937",labelPending:"#9ca3af",descriptionColor:"#6b7280"};function Io(e){let{steps:t,currentStep:n,orientation:r="horizontal",onChange:i,clickable:s=!1,variant:l="circle"}=e,a=r==="horizontal",d=l==="circle"?32:12,u=l==="dot"?12:32,h=M(g=>{s&&i&&i(g)},[s,i]),p=g=>g<n?"completed":g===n?"active":"pending",c=(g,f,b)=>{let S=l==="dot"?u:d,E={width:`${S}px`,height:`${S}px`,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:l==="circle"?"14px":"0",fontWeight:"600",flexShrink:"0",transition:"background-color 0.2s, border-color 0.2s"};return b==="completed"?o("div",{style:{...E,backgroundColor:Me.completedBg,color:Me.completedText,border:`2px solid ${Me.completed}`}},l==="circle"?f.icon||"\u2713":null):b==="active"?o("div",{style:{...E,backgroundColor:"#ffffff",color:Me.activeText,border:`2px solid ${Me.activeBorder}`,boxShadow:"0 0 0 3px rgba(37, 99, 235, 0.2)"}},l==="circle"?f.icon||String(g+1):o("div",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:Me.active}})):o("div",{style:{...E,backgroundColor:"#ffffff",color:Me.pendingText,border:`2px solid ${Me.pending}`}},l==="circle"?f.icon||String(g+1):null)},x=g=>{if(g>=t.length-1)return null;let b=g<n?Me.lineCompleted:Me.line;return a?o("div",{style:{flex:"1",height:"2px",backgroundColor:b,margin:"0 8px",alignSelf:"center",transition:"background-color 0.2s"}}):o("div",{style:{width:"2px",flex:"1",minHeight:"24px",backgroundColor:b,marginLeft:`${(l==="dot"?u:d)/2-1}px`,transition:"background-color 0.2s"}})},m=(g,f)=>{let b=p(f),S=b==="active",E=b==="completed",k=c(f,g,b),v={fontSize:"13px",fontWeight:S?"600":"400",color:S||E?Me.labelActive:Me.labelPending,marginTop:a?"8px":"0",marginLeft:a?"0":"12px",textAlign:a?"center":"left",transition:"color 0.2s"},z={fontSize:"11px",color:Me.descriptionColor,marginTop:"2px",textAlign:a?"center":"left"},C=o("div",{style:a?{display:"flex",flexDirection:"column",alignItems:"center"}:{display:"flex",flexDirection:"column"}},o("span",{style:v},g.label),g.description?o("span",{style:z},g.description):null),$=a?o("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"}},k,C):o("div",{style:{display:"flex",flexDirection:"row",alignItems:"center"}},k,C);return o(s?"button":"div",{key:String(f),onClick:s?()=>h(f):void 0,style:{display:"flex",flexDirection:a?"column":"row",alignItems:a?"center":"flex-start",background:"none",border:"none",padding:"0",cursor:s?"pointer":"default",fontFamily:"inherit",outline:"none"},"aria-current":S?"step":void 0},$)},y=[];return t.forEach((g,f)=>{y.push(m(g,f));let b=x(f);b&&y.push(b)}),o("div",{role:"navigation","aria-label":"Progress steps",style:{display:"flex",flexDirection:a?"row":"column",alignItems:a?"flex-start":"stretch",width:"100%"}},...y)}var Do={sm:{height:"28px",padding:"4px 8px",fontSize:"12px",iconSize:"14px"},md:{height:"36px",padding:"6px 12px",fontSize:"14px",iconSize:"16px"},lg:{height:"44px",padding:"8px 16px",fontSize:"16px",iconSize:"18px"}};function ea(e){let{item:t,size:n,variant:r}=e,{hover:i,onMouseEnter:s,onMouseLeave:l}=he(),a=Do[n],d=t.disabled===!0,u=t.type==="toggle",[h,p]=X(!1),c=u?t.active===!0:h,x=M(()=>{!d&&t.onClick&&t.onClick()},[d,t]),m=M(()=>{!d&&!u&&p(!0)},[d,u]),y=M(()=>{u||p(!1)},[u]),g=M(()=>{l(),u||p(!1)},[u,l]),f={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"6px",height:a.height,padding:a.padding,fontSize:a.fontSize,fontFamily:"inherit",border:r==="raised"?"1px solid #d1d5db":"1px solid transparent",borderRadius:"4px",backgroundColor:c?"#e0e7ff":!d&&i?"#f3f4f6":r==="raised"?"#ffffff":"transparent",color:d?"#9ca3af":c?"#2563eb":"#374151",cursor:d?"default":"pointer",opacity:d?"0.5":"1",outline:"none",transition:"background-color 0.15s"},b=t.icon?o("span",{style:{fontSize:a.iconSize},"aria-hidden":"true"},t.icon):null,S=t.label?o("span",null,t.label):null,E=t.type==="dropdown"?o("span",{style:{fontSize:"10px",marginLeft:"2px"},"aria-hidden":"true"},"\u25BC"):null;return o("button",{type:"button",style:f,onClick:x,onMouseDown:m,onMouseUp:y,onMouseEnter:s,onMouseLeave:g,disabled:d||void 0,"aria-pressed":u?c:void 0,"aria-label":t.label||t.id,title:t.label||t.id},b,S,E)}function Ao(e){let{items:t,size:n="md",variant:r="flat"}=e,i=Do[n],s=t.map(l=>l.type==="separator"?o("div",{key:l.id,role:"separator","aria-orientation":"vertical",style:{width:"1px",height:i.height,backgroundColor:"#d1d5db",margin:"0 4px",flexShrink:"0"}}):l.type==="spacer"?o("div",{key:l.id,style:{flex:"1"},"aria-hidden":"true"}):o(ea,{key:l.id,item:l,size:n,variant:r}));return o(xe,{orientation:"horizontal",role:"toolbar",ariaLabel:"Toolbar",keyboardNav:!0,styling:{border:r==="raised"?"1px solid #e5e7eb":"none",borderRadius:r==="raised"?"8px":"0",padding:"4px",backgroundColor:r==="raised"?"#ffffff":"transparent",boxShadow:r==="raised"?"0 1px 3px rgba(0,0,0,0.1)":void 0,custom:{gap:"2px",alignItems:"center"}}},...s)}var Ve=class e{constructor(t,n){ze(this,"id");ze(this,"label");ze(this,"children");ze(this,"expanded");ze(this,"icon");ze(this,"metadata");ze(this,"parent");ze(this,"depth");this.id=t.id,this.label=t.label,this.expanded=t.expanded??!1,this.icon=t.icon??null,this.metadata=t.metadata??{},this.parent=n??null,this.depth=n?n.depth+1:0,this.children=(t.children??[]).map(r=>new e(r,this))}static fromData(t){return new e(t)}isLeaf(){return this.children.length===0}isRoot(){return this.parent===null}walk(t){t(this,this.depth);for(let n of this.children)n.walk(t)}find(t){if(this.id===t)return this;for(let n of this.children){let r=n.find(t);if(r)return r}return null}toggle(){this.expanded=!this.expanded}expand(){this.expanded=!0}collapse(){this.expanded=!1}addChild(t){let n=new e(t,this);return this.children.push(n),n}removeChild(t){let n=this.children.findIndex(r=>r.id===t);return n===-1?!1:(this.children.splice(n,1),!0)}};function Lo(e){e.expanded=!0;for(let t of e.children)Lo(t)}function Fo(e,t=[]){if(t.push(e),e.expanded)for(let n of e.children)Fo(n,t);return t}function ta(e){if(!e.parent)return!0;let t=e.parent.children;return t[t.length-1]===e}function na(e){let{node:t,isSelected:n,indentPx:r,lineColor:i,lineWidth:s,iconExpanded:l,iconCollapsed:a,nodeStyle:d,renderNode:u,onToggle:h,onClick:p,focusedId:c}=e,x=he(),m=ie(null),y=c===t.id;se(()=>{y&&m.current&&m.current.focus()},[y]);let g=t.isLeaf(),f=t.depth,b=[];for(let z=0;z<f;z++){let C=t;for(let P=0;P<f-z;P++)C=C?C.parent:null;let $=C?!ta(C):!1;b.push(o("span",{key:`connector-${z}`,"aria-hidden":"true",style:{display:"inline-block",width:`${r}px`,height:"100%",position:"relative",flexShrink:"0",...$?{borderLeft:`${s}px solid ${i}`}:{}}}))}let S=f>0?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:`${Math.floor(r/2)}px`,height:"0",borderTop:`${s}px solid ${i}`,flexShrink:"0",alignSelf:"center",marginLeft:`-${r}px`}}):null,E=g?o("span",{"aria-hidden":"true",style:{display:"inline-block",width:"18px",flexShrink:"0",marginRight:"4px"}}):o("span",{"aria-hidden":"true",role:"button",tabIndex:0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px",fontSize:"14px",lineHeight:"1",cursor:"pointer",userSelect:"none",flexShrink:"0",marginRight:"4px",fontFamily:"monospace"},onClick:z=>{z.stopPropagation(),h(t)}},t.expanded?l:a),k=u?u(t,n):o("span",{style:{flex:"1",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.icon?o("span",{style:{marginRight:"6px"}},t.icon):null,t.label),v=Oe(d,{hover:x.hover,active:n});return o("div",{ref:m,role:"treeitem","aria-expanded":g?void 0:String(t.expanded),"aria-selected":n?"true":"false","aria-level":f+1,tabIndex:y?0:-1,style:{...v,display:"flex",alignItems:"stretch",padding:"0"},onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onClick:()=>p(t)},...b,S,o("span",{style:{display:"flex",alignItems:"center",flex:"1",padding:d.padding??"6px 10px",minWidth:"0"}},E,k))}function Wo(e){let{root:t,onNodeClick:n,onNodeExpand:r,onNodeCollapse:i,selectedId:s,expandAll:l=!1,lineColor:a="#000",lineWidth:d=1,indentPx:u=20,iconExpanded:h="\u2212",iconCollapsed:p="+",nodeStyle:c={},wrapperStyle:x,renderNode:m}=e,[y,g]=X(()=>{let $=Ve.fromData(t);return l&&Lo($),$}),[f,b]=X(t.id),S=q(()=>Fo(y),[y]),E=M(()=>{g($=>{let P=Object.create(Object.getPrototypeOf($));return Object.assign(P,$),P})},[]),k=M($=>{$.toggle(),$.expanded?r?.($):i?.($),E()},[r,i,E]),v=M($=>{b($.id),n?.($)},[n]),z=M($=>{let P=$;if(!f)return;let W=S.findIndex(H=>H.id===f);if(W===-1)return;let A=S[W];switch(P.key){case"ArrowDown":{P.preventDefault();let H=S[W+1];H&&b(H.id);break}case"ArrowUp":{P.preventDefault();let H=S[W-1];H&&b(H.id);break}case"ArrowRight":{P.preventDefault(),A.isLeaf()||(A.expanded?A.children.length>0&&b(A.children[0].id):k(A));break}case"ArrowLeft":{P.preventDefault(),!A.isLeaf()&&A.expanded?k(A):A.parent&&b(A.parent.id);break}case"Enter":{P.preventDefault(),v(A);break}case" ":{P.preventDefault(),A.isLeaf()||k(A);break}case"Home":{P.preventDefault(),S.length>0&&b(S[0].id);break}case"End":{P.preventDefault(),S.length>0&&b(S[S.length-1].id);break}}},[f,S,k,v]),C=S.map($=>o(na,{key:$.id,node:$,isSelected:$.id===s,indentPx:u,lineColor:a,lineWidth:d,iconExpanded:h,iconCollapsed:p,nodeStyle:c,renderNode:m,onToggle:k,onClick:v,focusedId:f}));return o(xe,{role:"tree",ariaLabel:"Tree navigation",styling:x,keyboardNav:!1},o("div",{onKeyDown:z,style:{outline:"none"}},...C))}function No(e){let{items:t,position:n,onClose:r,depth:i}=e,[s,l]=X(-1),[a,d]=X(null),u=ie(null);se(()=>{if(!u.current)return;u.current.focus();let c=m=>{let y=m,g=t.map((f,b)=>({item:f,i:b})).filter(({item:f})=>!f.divider);if(y.key==="ArrowDown")y.preventDefault(),l(f=>{let S=(g.findIndex(({i:E})=>E===f)+1)%g.length;return g[S].i});else if(y.key==="ArrowUp")y.preventDefault(),l(f=>{let b=g.findIndex(({i:E})=>E===f),S=b<=0?g.length-1:b-1;return g[S].i});else if(y.key==="ArrowRight")s>=0&&t[s]?.children&&d(s);else if(y.key==="ArrowLeft")i>0&&r();else if(y.key==="Enter"){if(y.preventDefault(),s>=0){let f=t[s];f.children?d(s):!f.disabled&&f.onClick&&(f.onClick(),r())}}else y.key==="Escape"&&r()};u.current.addEventListener("keydown",c);let x=u.current;return()=>x.removeEventListener("keydown",c)},[t,s,i,r]);let h={position:"fixed",left:`${n.x}px`,top:`${n.y}px`,backgroundColor:"#fff",border:"1px solid #e5e7eb",borderRadius:"8px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.15)",padding:"4px 0",minWidth:"180px",zIndex:`${10200+i}`,outline:"none",overflow:"visible"},p=t.map((c,x)=>{if(c.divider)return o("div",{key:`divider-${x}`,style:{height:"1px",backgroundColor:"#e5e7eb",margin:"4px 0"}});let m=s===x,y=!!c.disabled,g=!!(c.children&&c.children.length>0),f={display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",fontSize:"14px",color:y?"#9ca3af":"#1f2937",cursor:y?"default":"pointer",backgroundColor:m&&!y?"#f3f4f6":"transparent",userSelect:"none",position:"relative"},b=()=>{l(x),d(g?x:null)},S=()=>{if(!y){if(g){d(x);return}c.onClick&&c.onClick(),r()}},E=[];c.icon&&E.push(o("span",{style:{width:"20px",textAlign:"center",flexShrink:"0"}},c.icon)),E.push(o("span",{style:{flex:"1"}},c.label??"")),g&&E.push(o("span",{style:{fontSize:"10px",color:"#9ca3af",marginLeft:"8px"}},"\u25B6"));let k=[o("div",{key:`item-${x}`,style:f,onMouseEnter:b,onClick:S,role:"menuitem","aria-disabled":y?"true":void 0},...E)];return g&&a===x&&k.push(o(No,{key:`submenu-${x}`,items:c.children,position:{x:n.x+178,y:n.y+x*36},onClose:()=>d(null),depth:i+1})),o("div",{key:`wrap-${x}`,style:{position:"relative"}},...k)});return o("div",{ref:u,style:h,tabIndex:-1,role:"menu"},...p)}function dt(e){let{items:t,children:n}=e,[r,i]=X(null),s=M(u=>{u.preventDefault();let h=u;i({x:h.clientX,y:h.clientY})},[]),l=M(()=>{i(null)},[]);se(()=>{if(!r)return;let u=p=>{l()},h=setTimeout(()=>{document.addEventListener("mousedown",u)},0);return()=>{clearTimeout(h),document.removeEventListener("mousedown",u)}},[r,l]),se(()=>{if(!r)return;let u=h=>{h.key==="Escape"&&l()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[r,l]);let d=[o("div",{onContextMenu:s,style:{display:"contents"}},n)];return r&&d.push(o(No,{items:t,position:r,onClose:l,depth:0})),o("div",null,...d)}function oa(e,t){if(t)return"translate3d(0, 0, 0)";switch(e){case"left":return"translate3d(-100%, 0, 0)";case"right":return"translate3d(100%, 0, 0)";case"top":return"translate3d(0, -100%, 0)";case"bottom":return"translate3d(0, 100%, 0)"}}function ra(e,t){let n={position:"fixed",zIndex:"10001",backgroundColor:"#fff",boxShadow:"0 0 24px rgba(0, 0, 0, 0.15)",display:"flex",flexDirection:"column",overflow:"hidden"};switch(e){case"left":return{...n,top:"0",left:"0",bottom:"0",width:t};case"right":return{...n,top:"0",right:"0",bottom:"0",width:t};case"top":return{...n,top:"0",left:"0",right:"0",height:t};case"bottom":return{...n,bottom:"0",left:"0",right:"0",height:t}}}function Bo(e){let{open:t,onClose:n,position:r="right",size:i="320px",title:s,overlay:l=!0,closeOnOverlay:a=!0,closeOnEscape:d=!0,children:u}=e,[h,p]=X(!1),[c,x]=X(!1),m=ie(null),y=s?"drawer-title":void 0;if(se(()=>{if(t)p(!0),requestAnimationFrame(()=>x(!0));else{x(!1);let $=setTimeout(()=>p(!1),300);return()=>clearTimeout($)}},[t]),se(()=>{if(!t||!d)return;let $=P=>{P.key==="Escape"&&n()};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[t,d,n]),se(()=>{if(!t)return;let $=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=$}},[t]),se(()=>{t&&m.current&&m.current.focus()},[t]),!h)return null;let g={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:"10000",opacity:c?"1":"0",transition:"opacity 0.3s ease"},f={...ra(r,i),transform:oa(r,c),transition:"transform 0.3s ease"},b={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},S={margin:"0",fontSize:"16px",fontWeight:"600",color:"#111827"},E={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",lineHeight:"1"},k={padding:"20px",overflow:"auto",flex:"1"},v=()=>{a&&n()},z=[];s&&z.push(o("div",{style:b},o("h3",{id:y,style:S},s),o("button",{type:"button",style:E,onClick:n,"aria-label":"Close drawer"},"\xD7"))),z.push(o("div",{style:k},u));let C=[];return l&&C.push(o("div",{style:g,onClick:v})),C.push(o("div",{ref:m,style:f,role:"dialog","aria-modal":"true","aria-labelledby":y,tabIndex:-1},...z)),o("div",null,...C)}var ia={sm:"400px",md:"600px",lg:"800px",full:"100vw"};function Ho(e){let{open:t,onClose:n,title:r,size:i="md",closeOnOverlay:s=!0,closeOnEscape:l=!0,footer:a,showCloseButton:d=!0,children:u}=e,h=ie(null);if(se(()=>{if(!t)return;let v=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=v}},[t]),se(()=>{if(!t||!l)return;let v=z=>{z.key==="Escape"&&n()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[t,l,n]),se(()=>{t&&h.current&&h.current.focus()},[t]),!t)return null;let p={position:"fixed",top:"0",left:"0",right:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:"10000"},c={backgroundColor:"#fff",borderRadius:i==="full"?"0":"8px",boxShadow:"0 20px 60px rgba(0, 0, 0, 0.3)",maxHeight:i==="full"?"100vh":"90vh",width:ia[i],maxWidth:i==="full"?"100vw":"90vw",display:"flex",flexDirection:"column",outline:"none",overflow:"hidden"},x={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 24px",borderBottom:"1px solid #e5e7eb",flexShrink:"0"},m={margin:"0",fontSize:"18px",fontWeight:"600",color:"#111827"},y={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"#6b7280",padding:"4px 8px",borderRadius:"4px",lineHeight:"1"},g={padding:"24px",overflow:"auto",flex:"1"},f={padding:"16px 24px",borderTop:"1px solid #e5e7eb",flexShrink:"0"},b=v=>{s&&v.target===v.currentTarget&&n()},S=[],E=r?"modal-title":void 0;r?S.push(o("h2",{id:E,style:m},r)):S.push(o("span",null)),d&&S.push(o("button",{type:"button",style:y,onClick:n,"aria-label":"Close modal"},"\xD7"));let k=[o("div",{style:x},...S),o("div",{style:g},u)];return a&&k.push(o("div",{style:f},a)),o("div",{style:p,onClick:b,"aria-modal":"true",role:"dialog","aria-labelledby":E},o("div",{ref:h,style:c,tabIndex:-1,role:"document"},...k))}var _o=8;function sa(e,t){let n=t+_o;switch(e){case"top":return{position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:`${n}px`};case"bottom":return{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:`${n}px`};case"left":return{position:"absolute",right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:`${n}px`};case"right":return{position:"absolute",left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:`${n}px`}}}function aa(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${_o}px`,r="transparent";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`#fff ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} #fff ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} #fff`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} #fff ${r} ${r}`}}}function Oo(e){let{trigger:t,content:n,open:r,placement:i="bottom",offset:s=4,arrow:l=!1,closeOnClickOutside:a=!0,onOpenChange:d}=e,u=r!==void 0,[h,p]=X(!1),c=u?r:h,x=ie(null),m=M(()=>{u?d&&d(!r):p(E=>!E)},[u,r,d]);se(()=>{if(!c||!a)return;let E=k=>{x.current&&!x.current.contains(k.target)&&(u?d&&d(!1):p(!1))};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[c,a,u,d]);let y={position:"relative",display:"inline-block"},g={...sa(i,s),backgroundColor:"#fff",borderRadius:"8px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",border:"1px solid #e5e7eb",padding:"12px 16px",zIndex:"10000",whiteSpace:"nowrap"},f=[n];l&&f.push(o("div",{style:aa(i)}));let b=M(E=>{let k=E.key;(k==="Enter"||k===" ")&&(E.preventDefault(),m())},[m]),S=[o("div",{onClick:m,onKeyDown:b,role:"button",tabIndex:0,style:{display:"inline-block"}},t)];return c&&S.push(o("div",{style:g},...f)),o("div",{ref:x,style:y},...S)}var la=0;function ca(){return`toast-${++la}-${Date.now()}`}function Ft(e={}){let t={position:e.position??"top-right",maxToasts:e.maxToasts??5,defaultDuration:e.defaultDuration??4e3},n=[],r=new Set;function i(){r.forEach(d=>d())}function s(d,u={}){let h=ca();return n=[{id:h,message:d,type:u.type??"info",duration:u.duration??t.defaultDuration,action:u.action,createdAt:Date.now()},...n].slice(0,t.maxToasts),i(),h}function l(d){n=n.filter(u=>u.id!==d),i()}function a(){n=[],i()}return{toast:s,dismiss:l,dismissAll:a,subscribe:d=>(r.add(d),()=>{r.delete(d)}),getToasts:()=>n,config:t}}var da={info:{bg:"#eff6ff",border:"#3b82f6",icon:"\u2139\uFE0F"},success:{bg:"#f0fdf4",border:"#22c55e",icon:"\u2705"},warning:{bg:"#fffbeb",border:"#f59e0b",icon:"\u26A0\uFE0F"},error:{bg:"#fef2f2",border:"#ef4444",icon:"\u274C"}};function ua(e){let t={position:"fixed",zIndex:"10100",display:"flex",flexDirection:"column",gap:"8px",padding:"16px",pointerEvents:"none"},n=e.startsWith("top"),r=e.startsWith("bottom"),i=e.endsWith("left"),s=e.endsWith("right"),l=e.endsWith("center");return n&&(t.top="0"),r&&(t.bottom="0",t.flexDirection="column-reverse"),i&&(t.left="0"),s&&(t.right="0"),l&&(t.left="50%",t.transform="translateX(-50%)"),t}function fa(e){let{item:t,onDismiss:n}=e,r=da[t.type];se(()=>{if(t.duration<=0)return;let u=setTimeout(()=>n(t.id),t.duration);return()=>clearTimeout(u)},[t.id,t.duration,n]);let i={backgroundColor:r.bg,borderLeft:`4px solid ${r.border}`,borderRadius:"6px",padding:"12px 16px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.1)",display:"flex",alignItems:"center",gap:"10px",pointerEvents:"auto",minWidth:"280px",maxWidth:"420px",animation:"specifyjs-toast-slide-in 0.3s ease forwards"},s={flex:"1",fontSize:"14px",color:"#1f2937",lineHeight:"1.4"},l={background:"none",border:"none",cursor:"pointer",fontSize:"16px",color:"#9ca3af",padding:"2px 6px",lineHeight:"1",flexShrink:"0"},a={background:"none",border:`1px solid ${r.border}`,borderRadius:"4px",cursor:"pointer",fontSize:"12px",fontWeight:"600",color:r.border,padding:"4px 10px",flexShrink:"0"},d=[o("span",null,r.icon),o("span",{style:s},t.message)];return t.action&&d.push(o("button",{type:"button",style:a,onClick:t.action.onClick},t.action.label)),d.push(o("button",{type:"button",style:l,onClick:()=>n(t.id),"aria-label":"Dismiss toast"},"\xD7")),o("div",{style:i,role:"alert"},...d)}function Wt(e){let{toaster:t}=e,[,n]=X(0);se(()=>t.subscribe(()=>n(a=>a+1)),[t]);let r=t.getToasts();if(r.length===0)return null;let i=ua(t.config.position);se(()=>{let a="specifyjs-toast-keyframes";if(document.getElementById(a))return;let d=document.createElement("style");return d.id=a,d.textContent=`
3
+ @keyframes specifyjs-toast-slide-in {
4
+ from { opacity: 0; transform: translateY(-12px); }
5
+ to { opacity: 1; transform: translateY(0); }
6
+ }
7
+ `,document.head.appendChild(d),()=>{let u=document.getElementById(a);u&&u.remove()}},[]);let s=M(a=>t.dismiss(a),[t]),l=r.map(a=>o(fa,{key:a.id,item:a,onDismiss:s}));return o("div",{style:i},...l)}function Vo(e={}){let t=ie(null);t.current||(t.current=Ft(e));let n=t.current,r=M(()=>o(Wt,{toaster:n}),[n]);return{toast:n.toast,dismiss:n.dismiss,dismissAll:n.dismissAll,ToastContainer:r}}var pa=6,ma=8;function ga(e,t){let n=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=ma;switch(t){case"top":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.top-i}px`,transform:"translate(-50%, -100%)"};case"bottom":return{position:"fixed",left:`${e.left+e.width/2}px`,top:`${e.bottom+i}px`,transform:"translateX(-50%)"};case"left":return{position:"fixed",left:`${e.left-i}px`,top:`${e.top+e.height/2}px`,transform:"translate(-100%, -50%)"};case"right":return{position:"fixed",left:`${e.right+i}px`,top:`${e.top+e.height/2}px`,transform:"translateY(-50%)"}}}function ha(e){let t={position:"absolute",width:"0",height:"0",borderStyle:"solid"},n=`${pa}px`,r="transparent",i="#1f2937";switch(e){case"top":return{...t,bottom:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`${n} ${n} 0 ${n}`,borderColor:`${i} ${r} ${r} ${r}`};case"bottom":return{...t,top:`-${n}`,left:"50%",transform:"translateX(-50%)",borderWidth:`0 ${n} ${n} ${n}`,borderColor:`${r} ${r} ${i} ${r}`};case"left":return{...t,right:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} 0 ${n} ${n}`,borderColor:`${r} ${r} ${r} ${i}`};case"right":return{...t,left:`-${n}`,top:"50%",transform:"translateY(-50%)",borderWidth:`${n} ${n} ${n} 0`,borderColor:`${r} ${i} ${r} ${r}`}}}function Yo(e){let{text:t,placement:n="top",delay:r=200,maxWidth:i="250px",children:s}=e,[l,a]=X(!1),[d,u]=X(null),h=ie(null),p=ie(null),c=`tooltip-${Math.random().toString(36).slice(2,9)}`,x=M(()=>{p.current=setTimeout(()=>{if(h.current){let b=h.current.getBoundingClientRect();u(ga(b,n))}a(!0)},r)},[r,n]),m=M(()=>{p.current&&(clearTimeout(p.current),p.current=null),a(!1)},[]);se(()=>()=>{p.current&&clearTimeout(p.current)},[]);let y={display:"inline-block"},g={...d??{},backgroundColor:"#1f2937",color:"#fff",fontSize:"13px",lineHeight:"1.4",padding:"6px 10px",borderRadius:"6px",maxWidth:i,zIndex:"10002",pointerEvents:"none",whiteSpace:"normal",wordWrap:"break-word"},f=[o("div",{ref:h,style:y,onMouseEnter:x,onMouseLeave:m,onFocus:x,onBlur:m,"aria-describedby":l?c:void 0},s)];return l&&d&&f.push(o("div",{id:c,style:g,role:"tooltip"},t,o("div",{style:ha(n)}))),o("div",{style:{display:"inline-block",position:"relative"}},...f)}function Nt(e,t,n,r,i){return q(()=>{let s=Math.max(1,(r-i*(e+1))/e);return{valueScale:d=>t===0?0:d/t*n,categoryScale:d=>i+d*(s+i),barThickness:s,maxValue:t,valueAxisLength:n,categoryAxisLength:r}},[e,t,n,r,i])}function ba(e,t,n){if(t&&t.length>0){if(n){let s=0;for(let l of t)for(let a of l.values)a.value>s&&(s=a.value);return s}let i=0;for(let s of t){let l=0;for(let a of s.values)l+=a.value;l>i&&(i=l)}return i}let r=0;for(let i of e)i.value>r&&(r=i.value);return r}function xa(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ya(e){let t=new Set;for(let n of e)for(let r of n.values)t.add(r.category);return Array.from(t)}var Go=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Uo(e,t){return t||Go[e%Go.length]}function jo(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",barColor:s="#3b82f6",barGap:l=8,barRadius:a=4,showValues:d=!0,showGrid:u=!0,gridColor:h="#e5e7eb",title:p,padding:c=50,animate:x=!1,stacked:m,grouped:y=!1}=e,g=i==="vertical",f=n-c*2,b=r-c*2,S=g?b:f,E=g?f:b,k=m!==void 0&&m.length>0,v=q(()=>k?ya(m):[],[k,m]),z=k?m.length:t.length,C=q(()=>ba(t,m,y),[t,m,y]),$=C>0?C:1,P=Nt(z,$,S,E,l),W=M(()=>{if(!u)return[];let V=xa($),G=[];for(let K=V;K<=$;K+=V){let ee=P.valueScale(K);if(g){let J=c+b-ee;G.push(o("line",{key:`grid-${K}`,x1:String(c),y1:String(J),x2:String(c+f),y2:String(J),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),G.push(o("text",{key:`grid-label-${K}`,x:String(c-6),y:String(J+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}else{let J=c+ee;G.push(o("line",{key:`grid-${K}`,x1:String(J),y1:String(c),x2:String(J),y2:String(c+b),stroke:h,"stroke-width":"1","stroke-dasharray":"4 2"})),G.push(o("text",{key:`grid-label-${K}`,x:String(J),y:String(c+b+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(K)))}}return G},[u,$,P,g,c,f,b,h]),A=M(()=>{let V=[];return g?(V.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),V.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+f),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))):(V.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+b),x2:String(c+f),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"})),V.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+b),stroke:"#374151","stroke-width":"1.5"}))),V},[g,c,f,b]),H=M(()=>{let V=[];for(let G=0;G<t.length;G++){let K=t[G],ee=P.valueScale(K.value),J=P.categoryScale(G),Y=K.color??s,U,O,_=String(K.value);if(g){let Z=c+J,Q=c+b-ee;U={x:String(Z),y:String(Q),width:String(P.barThickness),height:String(ee),rx:String(a),ry:String(a),fill:Y},O={x:String(Z+P.barThickness/2),y:String(Q-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"}}else{let Z=c+J,Q=c;U={x:String(Q),y:String(Z),width:String(ee),height:String(P.barThickness),rx:String(a),ry:String(a),fill:Y},O={x:String(Q+ee+6),y:String(Z+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"}}if(x&&(U.style=g?`animation: barGrow 0.6s ease-out ${G*.05}s both`:`animation: barGrow 0.6s ease-out ${G*.05}s both`),V.push(o("rect",{key:`bar-${G}`,...U})),d&&V.push(o("text",{key:`val-${G}`,...O},_)),g){let Z=c+J+P.barThickness/2,Q=c+b+16;V.push(o("text",{key:`cat-${G}`,x:String(Z),y:String(Q),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Z}, ${Q})`},K.label))}else V.push(o("text",{key:`cat-${G}`,x:String(c-6),y:String(c+J+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return V},[t,P,s,a,d,x,g,c,b]),L=M(()=>{if(!m)return[];let V=[];for(let G=0;G<m.length;G++){let K=m[G],ee=P.categoryScale(G),J=0;for(let Y=0;Y<K.values.length;Y++){let U=K.values[Y],O=P.valueScale(U.value),_=P.valueScale(J),Z=Uo(Y,U.color);if(g){let Q=c+ee,oe=c+b-_-O;V.push(o("rect",{key:`sbar-${G}-${Y}`,x:String(Q),y:String(oe),width:String(P.barThickness),height:String(O),rx:Y===K.values.length-1?String(a):"0",ry:Y===K.values.length-1?String(a):"0",fill:Z,...x?{style:`animation: barGrow 0.6s ease-out ${(G*K.values.length+Y)*.03}s both`}:{}})),d&&O>14&&V.push(o("text",{key:`sval-${G}-${Y}`,x:String(Q+P.barThickness/2),y:String(oe+O/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(U.value)))}else{let Q=c+_,oe=c+ee;V.push(o("rect",{key:`sbar-${G}-${Y}`,x:String(Q),y:String(oe),width:String(O),height:String(P.barThickness),rx:Y===K.values.length-1?String(a):"0",ry:Y===K.values.length-1?String(a):"0",fill:Z,...x?{style:`animation: barGrow 0.6s ease-out ${(G*K.values.length+Y)*.03}s both`}:{}})),d&&O>20&&V.push(o("text",{key:`sval-${G}-${Y}`,x:String(Q+O/2),y:String(oe+P.barThickness/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#fff"},String(U.value)))}J+=U.value}if(d){let Y=P.valueScale(J);g?V.push(o("text",{key:`stotal-${G}`,x:String(c+ee+P.barThickness/2),y:String(c+b-Y-6),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(J))):V.push(o("text",{key:`stotal-${G}`,x:String(c+Y+6),y:String(c+ee+P.barThickness/2+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(J)))}if(g){let Y=c+ee+P.barThickness/2,U=c+b+16;V.push(o("text",{key:`scat-${G}`,x:String(Y),y:String(U),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${Y}, ${U})`},K.label))}else V.push(o("text",{key:`scat-${G}`,x:String(c-6),y:String(c+ee+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},K.label))}return V},[m,P,a,d,x,g,c,b]),T=M(()=>{if(!m)return[];let V=v.length,G=[];for(let K=0;K<m.length;K++){let ee=m[K],J=P.categoryScale(K),Y=2,U=Math.max(1,(P.barThickness-Y*(V-1))/V);for(let O=0;O<ee.values.length;O++){let _=ee.values[O],Z=v.indexOf(_.category),Q=Z*(U+Y),oe=P.valueScale(_.value),j=Uo(Z>=0?Z:O,_.color);if(g){let te=c+J+Q,re=c+b-oe;G.push(o("rect",{key:`gbar-${K}-${O}`,x:String(te),y:String(re),width:String(U),height:String(oe),rx:String(a),ry:String(a),fill:j,...x?{style:`animation: barGrow 0.6s ease-out ${(K*V+O)*.04}s both`}:{}})),d&&G.push(o("text",{key:`gval-${K}-${O}`,x:String(te+U/2),y:String(re-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(_.value)))}else{let te=c,re=c+J+Q;G.push(o("rect",{key:`gbar-${K}-${O}`,x:String(te),y:String(re),width:String(oe),height:String(U),rx:String(a),ry:String(a),fill:j,...x?{style:`animation: barGrow 0.6s ease-out ${(K*V+O)*.04}s both`}:{}})),d&&G.push(o("text",{key:`gval-${K}-${O}`,x:String(te+oe+4),y:String(re+U/2+3),"text-anchor":"start","font-size":"9","font-family":"sans-serif",fill:"#374151"},String(_.value)))}}if(g){let O=c+J+P.barThickness/2,_=c+b+16;G.push(o("text",{key:`gcat-${K}`,x:String(O),y:String(_),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${O}, ${_})`},ee.label))}else G.push(o("text",{key:`gcat-${K}`,x:String(c-6),y:String(c+J+P.barThickness/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},ee.label))}return G},[m,v,P,a,d,x,g,c,b]),w=M(()=>p?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,c]),D=M(()=>x?[o("defs",{key:"anim-defs"},o("style",{key:"anim-style"},g?"@keyframes barGrow { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }":"@keyframes barGrow { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(1); transform-origin: left; } }"))]:[],[x,g]),R=W(),F=A(),I=w(),N=D(),B;return k&&y?B=T():k?B=L():B=H(),o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",style:{fontFamily:"sans-serif"}},...N,...I,...R,...F,...B)}function Ye(e){let{start:t,end:n,step:r}=e;if(r<=0||!isFinite(r))return[];let i=Math.ceil((n-t)/r)+1;if(i>1e6)return[];let s=[];for(let l=0;l<i;l++){let a=t+l*r;if(a>n+r*.001)break;s.push(a)}return s}function ut(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e(i);isFinite(s)&&n.push({input:i,output:s})}return n}function ft(e,t,n,r){let i=!1,s=0,l=[],a=()=>{if(i)return;let d=Math.min(s+n,t.length);for(let u=s;u<d;u++){let h=t[u],p=e(h);isFinite(p)&&l.push({input:h,output:p})}if(s=d,s>=t.length){r(l,!0);return}r(l,!1),Xo(a)};return Xo(a),()=>{i=!0}}function Xo(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e(),{timeout:16}):setTimeout(e,0)}function Sa(e,t){let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return(i<1.5?1:i<3?2:i<7?5:10)*r}function qo(e,t){let n=t-e;if(n<=0)return[e];let r=Sa(n,8),i=Math.ceil(e/r)*r,s=[];for(let l=i;l<=t+r*.001;l+=r)s.push(Math.round(l*1e10)/1e10);return s}function Ko(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}var pe=40,Zo=1.1,Jo=.01,Qo=1e6;function er(e){let{width:t=400,height:n=300,points:r=[],plotFunction:i,plotResolution:s=200,xStep:l,sync:a=!1,xRange:d=[-5,5],yRange:u=[-5,5],showGrid:h=!0,showAxes:p=!0,pointRadius:c=3,pointColor:x="#3b82f6",curveColor:m="#3b82f6",gridColor:y="#e2e8f0",axisColor:g="#94a3b8",onPointClick:f,onPointDoubleClick:b,onPointContextMenu:S,onPointHover:E}=e,[k,v]=X(d[0]),[z,C]=X(d[1]),[$,P]=X(u[0]),[W,A]=X(u[1]),H=ie(!1),L=ie(null),T=M(_=>pe+(_-k)/(z-k)*(t-2*pe),[k,z,t]),w=M(_=>n-pe-(_-$)/(W-$)*(n-2*pe),[$,W,n]),D=M(_=>k+(_-pe)/(t-2*pe)*(z-k),[k,z,t]),R=M(_=>$+(n-pe-_)/(n-2*pe)*(W-$),[$,W,n]),F=M(_=>{let Z=_;H.current=!0,L.current={mx:Z.clientX,my:Z.clientY,x0:k,x1:z,y0:$,y1:W}},[k,z,$,W]),I=M(_=>{if(!H.current||!L.current)return;let Z=_,Q=L.current,oe=Z.clientX-Q.mx,j=Z.clientY-Q.my,te=oe/(t-2*pe)*(Q.x1-Q.x0),re=j/(n-2*pe)*(Q.y1-Q.y0);v(Q.x0-te),C(Q.x1-te),P(Q.y0+re),A(Q.y1+re)},[t,n]),N=M(()=>{H.current=!1,L.current=null},[]),B=M(_=>{let Z=_;Z.preventDefault();let Q=Z.currentTarget.getBoundingClientRect(),oe=Z.clientX-Q.left,j=Z.clientY-Q.top,te=D(oe),re=R(j),le=Z.deltaY>0?Zo:1/Zo,ne=(z-k)*le,ce=(W-$)*le;if(ne<Jo||ce<Jo||ne>Qo||ce>Qo)return;let de=(te-k)/(z-k),ae=(re-$)/(W-$);v(te-de*ne),C(te+(1-de)*ne),P(re-ae*ce),A(re+(1-ae)*ce)},[k,z,$,W,D,R]),V=[];if(V.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),h){let _=qo(k,z),Z=qo($,W);for(let Q=0;Q<_.length;Q++){let oe=T(_[Q]);V.push(o("line",{x1:oe,y1:pe,x2:oe,y2:n-pe,stroke:y,"stroke-width":.5,key:`gx-${Q}`})),V.push(o("text",{x:oe,y:n-pe+14,"text-anchor":"end","font-size":10,fill:g,transform:`rotate(-45, ${oe}, ${n-pe+14})`,key:`lx-${Q}`},Ko(_[Q])))}for(let Q=0;Q<Z.length;Q++){let oe=w(Z[Q]);V.push(o("line",{x1:pe,y1:oe,x2:t-pe,y2:oe,stroke:y,"stroke-width":.5,key:`gy-${Q}`})),V.push(o("text",{x:pe-6,y:oe+3,"text-anchor":"end","font-size":10,fill:g,key:`ly-${Q}`},Ko(Z[Q])))}}if(p){let _=Math.max(pe,Math.min(t-pe,T(0))),Z=Math.max(pe,Math.min(n-pe,w(0)));V.push(o("line",{x1:pe,y1:Z,x2:t-pe,y2:Z,stroke:g,"stroke-width":1,key:"x-axis"})),V.push(o("line",{x1:_,y1:pe,x2:_,y2:n-pe,stroke:g,"stroke-width":1,key:"y-axis"}))}let G=q(()=>{if(!i||!a)return[];let _=l??(z-k)/s,Z=Ye({start:k,end:z,step:_});return ut(i,Z)},[i,k,z,l,s,a]),[K,ee]=X([]),J=ie(null);se(()=>{if(!i||a){ee([]);return}let _=l??(z-k)/s,Z=Ye({start:k,end:z,step:_});return J.current&&J.current(),J.current=ft(i,Z,200,Q=>{ee([...Q])}),()=>{J.current&&J.current()}},[i,k,z,l,s,a]);let Y=a?G:K;if(Y.length>0){let _=[];for(let Z=0;Z<Y.length;Z++){let Q=Y[Z],oe=T(Q.input),j=w(Q.output);_.push(`${_.length===0?"M":"L"}${oe},${j}`)}V.push(o("path",{d:_.join(" "),fill:"none",stroke:m,"stroke-width":1.5,key:"curve"}))}let U=(_,Z,Q,oe)=>{if(Z)return j=>Z({x:oe.x,y:oe.y,index:Q,event:j})};for(let _=0;_<r.length;_++){let Z=r[_],Q=T(Z.x),oe=w(Z.y),j={cx:Q,cy:oe,r:c,fill:x,cursor:"pointer",key:`pt-${_}`};f&&(j.onClick=U("click",f,_,Z)),b&&(j.onDblClick=U("dblclick",b,_,Z)),S&&(j.onContextMenu=U("contextmenu",S,_,Z)),E&&(j.onMouseOver=U("mouseover",E,_,Z)),V.push(o("circle",j))}let O=o("defs",{key:"defs"},o("clipPath",{id:"plot-clip"},o("rect",{x:pe,y:pe,width:t-2*pe,height:n-2*pe})));return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:"user-select: none; touch-action: none;",onMouseDown:F,onMouseMove:I,onMouseUp:N,onMouseLeave:N,onWheel:B},O,...V)}function nr(e,t,n){let r=0,i=0;for(let s=0;s<n;s++){let l=r*r,a=i*i;if(l+a>4)return s;i=2*r*i+t,r=l-a+e}return n}function tr(e,t,n){if(e===t)return[0,0,0];let r=e/t;if(n==="fire")return[Math.floor(255*Math.min(1,r*3)),Math.floor(255*Math.max(0,r*3-1)),Math.floor(255*Math.max(0,r*3-2))];if(n==="ocean")return[Math.floor(255*r*.3),Math.floor(255*r*.6),Math.floor(255*(.4+r*.6))];let i=r*360%360,s=1,l=.5,a=(1-Math.abs(2*l-1))*s,d=a*(1-Math.abs(i/60%2-1)),u=l-a/2,h=0,p=0,c=0;return i<60?(h=a,p=d):i<120?(h=d,p=a):i<180?(p=a,c=d):i<240?(p=d,c=a):i<300?(h=d,c=a):(h=a,c=d),[Math.floor((h+u)*255),Math.floor((p+u)*255),Math.floor((c+u)*255)]}function or(e,t,n=[-2.5,1],r=[-1.25,1.25],i=80,s=nr){let l=[];for(let a=0;a<t;a++){let d=[],u=r[1]-a/t*(r[1]-r[0]);for(let h=0;h<e;h++){let p=n[0]+h/e*(n[1]-n[0]);d.push(s(p,u,i))}l.push(d)}return l}function rr(e){let{width:t=400,height:n=300,realRange:r=[-2.5,1],imagRange:i=[-1.25,1.25],maxIterations:s=100,colorScheme:l="classic",computeFunction:a=nr,data:d,resolution:u=2,onPointClick:h,onPointHover:p,onPointDoubleClick:c,onPointContextMenu:x}=e;if(d){let R=d.length,F=R>0?d[0].length:0,I=F>0?t/F:1,N=R>0?n/R:1,B=[];for(let V=0;V<R;V++){let G=d[V];for(let K=0;K<F;K++){let ee=G[K]??0,[J,Y,U]=tr(ee,s,l);B.push(o("rect",{key:`${V}-${K}`,x:String(K*I),y:String(V*N),width:String(Math.ceil(I)),height:String(Math.ceil(N)),fill:`rgb(${J},${Y},${U})`}))}}return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Complex plane visualization",style:{cursor:"crosshair",borderRadius:"6px",maxWidth:"100%"}},...B)}let[m,y]=X(r[0]),[g,f]=X(r[1]),[b,S]=X(i[0]),[E,k]=X(i[1]),v=ie(null),z=ie(!1),C=ie(null),$=M((R,F)=>{let I=m+R/t*(g-m),N=E-F/n*(E-b);return{re:I,im:N}},[m,g,b,E,t,n]);se(()=>{let R=v.current;if(!R)return;let F=R.getContext("2d");if(!F)return;let I=F.createImageData(t,n),N=I.data;for(let B=0;B<n;B++)for(let V=0;V<t;V++){let{re:G,im:K}=$(V,B),ee=a(G,K,s),[J,Y,U]=tr(ee,s,l),O=(B*t+V)*4;N[O]=J,N[O+1]=Y,N[O+2]=U,N[O+3]=255}F.putImageData(I,0,0)},[m,g,b,E,t,n,s,l,a,$]);let P=M(R=>{let F=R.target.getBoundingClientRect(),I=R.clientX-F.left,N=R.clientY-F.top,{re:B,im:V}=$(I,N),G=a(B,V,s);return{re:B,im:V,iterations:G,event:R}},[$,a,s]),W=M(R=>{z.current=!0,C.current={x:R.clientX,y:R.clientY,rMin:m,rMax:g,iMin:b,iMax:E}},[m,g,b,E]),A=M(R=>{if(p&&p(P(R)),!z.current||!C.current)return;let F=C.current,I=R.clientX-F.x,N=R.clientY-F.y,B=(F.rMax-F.rMin)/t,V=(F.iMax-F.iMin)/n;y(F.rMin-I*B),f(F.rMax-I*B),S(F.iMin+N*V),k(F.iMax+N*V)},[t,n,p,P]),H=M(()=>{z.current=!1},[]),L=M(R=>{R.preventDefault();let F=R.deltaY>0?1.15:1/1.15,I=R.target.getBoundingClientRect(),N=R.clientX-I.left,B=R.clientY-I.top,{re:V,im:G}=$(N,B);y(V+(m-V)*F),f(V+(g-V)*F),S(G+(b-G)*F),k(G+(E-G)*F)},[$,m,g,b,E]),T=M(R=>{h&&h(P(R))},[h,P]),w=M(R=>{c&&c(P(R))},[c,P]),D=M(R=>{R.preventDefault(),x&&x(P(R))},[x,P]);return o("canvas",{ref:v,width:t,height:n,style:{cursor:"crosshair"},onMouseDown:W,onMouseMove:A,onMouseUp:H,onMouseLeave:H,onWheel:L,onClick:T,onDblClick:w,onContextMenu:D})}function ir(e,t,n){if(e===t)return[e];let r=(t-e)/(n-1),i=[];for(let s=0;s<n;s++){let l=e+r*s;i.push(Math.round(l*1e10)/1e10)}return i}function va(e,t,n,r){if(e.length===0)return{xScale:()=>r,yScale:()=>n-r,xTicks:[],yTicks:[],xMin:0,xMax:0,yMin:0,yMax:0};let i=1/0,s=-1/0,l=1/0,a=-1/0;for(let y of e)y.x<i&&(i=y.x),y.x>s&&(s=y.x),y.y<l&&(l=y.y),y.y>a&&(a=y.y);i===s&&(i-=1,s+=1),l===a&&(l-=1,a+=1);let d=t-r*2,u=n-r*2,h=y=>r+(y-i)/(s-i)*d,p=y=>n-r-(y-l)/(a-l)*u,c=6,x=ir(i,s,c),m=ir(l,a,c);return{xScale:h,yScale:p,xTicks:x,yTicks:m,xMin:i,xMax:s,yMin:l,yMax:a}}function Bt(e,t,n,r){return q(()=>va(e,t,n,r),[e,t,n,r])}function sr(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ar(e,t,n,r,i,s,l){let a={fill:i,key:s,...l};switch(e){case"square":return o("rect",{...a,x:t-r,y:n-r,width:r*2,height:r*2});case"diamond":{let d=`${t},${n-r} ${t+r},${n} ${t},${n+r} ${t-r},${n}`;return o("polygon",{...a,points:d})}case"triangle":{let d=r*1.15,u=`${t},${n-d} ${t+r},${n+r*.6} ${t-r},${n+r*.6}`;return o("polygon",{...a,points:u})}case"triangle-down":{let d=r*1.15,u=`${t-r},${n-r*.6} ${t+r},${n-r*.6} ${t},${n+d}`;return o("polygon",{...a,points:u})}case"cross":{let d=r*.35;return o("path",{...a,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t-r},${n-r}L${t+r},${n+r}M${t+r},${n-r}L${t-r},${n+r}`})}case"plus":{let d=r*.35;return o("path",{...a,fill:"none",stroke:i,"stroke-width":String(d*2),"stroke-linecap":"round",d:`M${t},${n-r}L${t},${n+r}M${t-r},${n}L${t+r},${n}`})}case"circle":default:return o("circle",{...a,cx:t,cy:n,r})}}function lr(e){let{data:t,width:n=600,height:r=400,lineColor:i="#3b82f6",lineWidth:s=2,pointRadius:l=4,pointColor:a="#3b82f6",pointShape:d="circle",showPoints:u=!0,showGrid:h=!0,showArea:p=!1,areaColor:c="rgba(59,130,246,0.15)",xLabel:x,yLabel:m,title:y,padding:g=50,animate:f=!1,multiLine:b}=e,S=q(()=>{let W=[...t];if(b)for(let A of b)W.push(...A.data);return W},[t,b]),E=Bt(S,n,r,g),{xScale:k,yScale:v,xTicks:z,yTicks:C}=E,$=[];if($.push(o("rect",{x:0,y:0,width:"100%",fill:"white",key:"bg"})),h){for(let W=0;W<z.length;W++){let A=k(z[W]);$.push(o("line",{x1:A,y1:g,x2:A,y2:r-g,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-x-${W}`}))}for(let W=0;W<C.length;W++){let A=v(C[W]);$.push(o("line",{x1:g,y1:A,x2:n-g,y2:A,stroke:"#e5e7eb","stroke-dasharray":"4,4",key:`grid-y-${W}`}))}}$.push(o("line",{x1:g,y1:r-g,x2:n-g,y2:r-g,stroke:"#374151","stroke-width":1,key:"x-axis"})),$.push(o("line",{x1:g,y1:g,x2:g,y2:r-g,stroke:"#374151","stroke-width":1,key:"y-axis"}));for(let W=0;W<z.length;W++){let A=k(z[W]);$.push(o("line",{x1:A,y1:r-g,x2:A,y2:r-g+5,stroke:"#374151",key:`xtick-${W}`})),$.push(o("text",{x:A,y:r-g+18,"text-anchor":"end","font-size":11,fill:"#6b7280",transform:`rotate(-45, ${A}, ${r-g+18})`,key:`xlabel-${W}`},sr(z[W])))}for(let W=0;W<C.length;W++){let A=v(C[W]);$.push(o("line",{x1:g-5,y1:A,x2:g,y2:A,stroke:"#374151",key:`ytick-${W}`})),$.push(o("text",{x:g-10,y:A+4,"text-anchor":"end","font-size":11,fill:"#6b7280",key:`ylabel-${W}`},sr(C[W])))}function P(W,A,H,L,T,w,D,R,F,I){if(W.length===0)return;let N=[...W].sort((G,K)=>G.x-K.x);if(L){let G=v(E.yMin),K=N.map(U=>`${k(U.x)},${v(U.y)}`).join(" "),ee=k(N[0].x),J=k(N[N.length-1].x),Y=`${ee},${G} ${K} ${J},${G}`;$.push(o("polygon",{points:Y,fill:T,key:`${I}-area`}))}let V={points:N.map(G=>`${k(G.x)},${v(G.y)}`).join(" "),fill:"none",stroke:A,"stroke-width":H,"stroke-linejoin":"round","stroke-linecap":"round",key:`${I}-line`};if(f?(V["stroke-dasharray"]="1000",V["stroke-dashoffset"]="1000",$.push(o("polyline",V,o("animate",{attributeName:"stroke-dashoffset",from:1e3,to:0,dur:"1.5s",fill:"freeze"})))):$.push(o("polyline",V)),w)for(let G=0;G<N.length;G++){let K=k(N[G].x),ee=v(N[G].y),J=N[G].shape??F,Y=N[G].radius??R,U=`${I}-pt-${G}`;if(f){let O=ar(J,K,ee,Y,D,U,{opacity:0});$.push(o("g",{key:`${U}-g`},O,o("animate",{attributeName:"opacity",from:0,to:1,dur:"0.3s",begin:"1.2s",fill:"freeze"})))}else $.push(ar(J,K,ee,Y,D,U))}}if(P(t,i,s,p,c,u,a,l,d,"primary"),b)for(let W=0;W<b.length;W++){let A=b[W];P(A.data,A.color,s,!1,"transparent",u,A.color,A.pointRadius??l,A.pointShape??d,`series-${W}`)}if(b&&b.length>0){let W=[],A=[{color:i,label:"Primary"},...b.map((B,V)=>({color:B.color,label:B.label??`Series ${V+1}`}))],H=g+10,L=16,T=22,w=7.2,D=14,R=6,F=n-g*2-20,I=0,N=0;for(let B=0;B<A.length;B++){let V=A[B].label.length*w,G=D+R+V;I>0&&I+G>F&&(I=0,N+=T);let K=H+I,ee=g-30-N;W.push(o("rect",{x:K,y:ee,width:D,height:14,fill:A[B].color,rx:2,key:`legend-rect-${B}`})),W.push(o("text",{x:K+D+R,y:ee+12,"font-size":12,fill:"#374151",key:`legend-text-${B}`},A[B].label)),I+=G+L}$.push(o("g",{key:"legend"},...W))}return x&&$.push(o("text",{x:n/2,y:r-8,"text-anchor":"middle","font-size":13,fill:"#374151",key:"x-axis-label"},x)),m&&$.push(o("text",{x:14,y:r/2,"text-anchor":"middle","font-size":13,fill:"#374151",transform:`rotate(-90, 14, ${r/2})`,key:"y-axis-label"},m)),y&&$.push(o("text",{x:n/2,y:20,"text-anchor":"middle","font-size":16,"font-weight":"bold",fill:"#111827",key:"title"},y)),o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...$)}function wa(e){let t=[];for(let n=0;n<e;n++){let r=Math.round(360*n/e);t.push(`hsl(${r}, 70%, 55%)`)}return t}function ka(e,t){let n=t??wa(e.length);return e.map((r,i)=>r.color??n[i%n.length])}function Ge(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function Ht(e,t,n,r,i,s){let l=i-Math.PI/2,a=s-Math.PI/2,d=Ge(e,t,r,l),u=Ge(e,t,r,a),h=s-i>Math.PI?1:0;if(n<=0)return[`M ${e} ${t}`,`L ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,"Z"].join(" ");let p=Ge(e,t,n,a),c=Ge(e,t,n,l);return[`M ${d.x} ${d.y}`,`A ${r} ${r} 0 ${h} 1 ${u.x} ${u.y}`,`L ${p.x} ${p.y}`,`A ${n} ${n} 0 ${h} 0 ${c.x} ${c.y}`,"Z"].join(" ")}function _t(e,t){let n=t?.padAngle??0,r=ka(e,t?.colors),i=e.reduce((u,h)=>u+h.value,0);if(i<=0)return[];let s=n*e.length,l=Math.PI*2-s,a=[],d=0;for(let u=0;u<e.length;u++){let h=e[u],p=h.value/i*l,c=d+n/2,x=c+p;a.push({label:h.label,value:h.value,startAngle:c,endAngle:x,percentage:h.value/i*100,color:r[u]}),d=x+n/2}return a}function cr(e){let{data:t,width:n=400,height:r=400,innerRadius:i=0,padAngle:s=.02,showLabels:l=!0,showValues:a=!0,showLegend:d=!0,legendPosition:u="right",title:h,centerLabel:p,colors:c,strokeColor:x="#fff",strokeWidth:m=2,textColor:y="currentColor"}=e,g=d&&u==="right"?140:0,f=h?30:0,b=d&&u==="bottom"?Math.ceil(t.length/2)*22+10:0,S=n-g,E=r-f-b,k=S/2,v=f+E/2,z=Math.min(S,E)/2-10,C=e.outerRadius??z,$=q(()=>_t(t,{padAngle:s,colors:c}),[t,s,c]),P=[];h&&P.push(o("text",{key:"title",x:S/2,y:20,textAnchor:"middle",fontFamily:"sans-serif",fontSize:16,fontWeight:"bold",fill:y},h));for(let W=0;W<$.length;W++){let A=$[W],H=Ht(k,v,i,C,A.startAngle,A.endAngle);if(P.push(o("path",{key:`slice-${W}`,d:H,fill:A.color,stroke:x,strokeWidth:m})),l||a){let L=(A.startAngle+A.endAngle)/2,T=A.percentage<5,w=T?C+14:i+(C-i)*.65,D=Ge(k,v,w,L-Math.PI/2),R=T?y:"#fff",F=T?11:12,I=[];if(l&&I.push(A.label),a&&I.push(`${A.percentage.toFixed(1)}%`),T){let N=Ge(k,v,C+2,L-Math.PI/2);P.push(o("line",{key:`connector-${W}`,x1:N.x,y1:N.y,x2:D.x,y2:D.y,stroke:"#999",strokeWidth:1}))}l&&P.push(o("text",{key:`label-${W}`,x:D.x,y:D.y-(a?6:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F,fill:R,pointerEvents:"none"},A.label)),a&&P.push(o("text",{key:`value-${W}`,x:D.x,y:D.y+(l?10:0),textAnchor:"middle",fontFamily:"sans-serif",fontSize:F-1,fill:R,pointerEvents:"none"},`${A.percentage.toFixed(1)}%`))}}if(p&&i>0&&P.push(o("text",{key:"center-label",x:k,y:v,textAnchor:"middle",dominantBaseline:"central",fontFamily:"sans-serif",fontSize:14,fontWeight:"bold",fill:y},p)),d){let W=[];if(u==="right"){let A=S+10,H=f+20;for(let L=0;L<$.length;L++){let T=$[L],w=H+L*22;W.push(o("circle",{key:`legend-dot-${L}`,cx:A+6,cy:w,r:6,fill:T.color})),W.push(o("text",{key:`legend-text-${L}`,x:A+18,y:w,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${T.label} (${T.percentage.toFixed(1)}%)`))}}else{let A=r-b+10;for(let H=0;H<$.length;H++){let L=$[H],T=H%2,w=Math.floor(H/2),D=T*(n/2)+10,R=A+w*22;W.push(o("circle",{key:`legend-dot-${H}`,cx:D+6,cy:R,r:6,fill:L.color})),W.push(o("text",{key:`legend-text-${H}`,x:D+18,y:R,dominantBaseline:"central",fontFamily:"sans-serif",fontSize:12,fill:y},`${L.label} (${L.percentage.toFixed(1)}%)`))}}P.push(...W)}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet"},...P)}function dr(e,t,n,r,i){return{x:n+e*Math.cos(t)*i,y:r-e*Math.sin(t)*i}}function ur(e){let{width:t=400,height:n=400,rRange:r=[0,2],plotFunction:i,plotResolution:s=360,thetaStep:l,sync:a=!1,points:d=[],showGrid:u=!0,pointRadius:h=3,pointColor:p="#3b82f6",curveColor:c="#3b82f6",onPointClick:x,onPointDoubleClick:m,onPointContextMenu:y,onPointHover:g}=e,[f,b]=X(r[1]),[S,E]=X(0),[k,v]=X(0),[z,C]=X(null),$=t/2+S,P=n/2+k,A=Math.min(t,n)/2-30,H=A/f,L=q(()=>{let Y=Math.max(1,Math.ceil(f)),U=[],O=f/Y;for(let _=1;_<=Y;_++)U.push(O*_);return U},[f]),T=q(()=>{let Y=[];for(let U=0;U<360;U+=30)Y.push(U*Math.PI/180);return Y},[]),w=q(()=>{if(!i||!a)return[];let Y=l??2*Math.PI/s,U=Ye({start:0,end:2*Math.PI,step:Y});return ut(i,U)},[i,s,l,a]),[D,R]=X([]),F=ie(null);se(()=>{if(!i||a){R([]);return}let Y=l??2*Math.PI/s,U=Ye({start:0,end:2*Math.PI,step:Y});return F.current&&F.current(),F.current=ft(i,U,200,O=>{R([...O])}),()=>{F.current&&F.current()}},[i,s,l,a]);let I=a?w:D,N=q(()=>{if(I.length===0)return"";let Y=[];for(let U=0;U<I.length;U++){let O=I[U],_=O.output;if(_<0||!isFinite(_))continue;let{x:Z,y:Q}=dr(_,O.input,$,P,H);Y.push(`${Y.length===0?"M":"L"}${Z.toFixed(2)},${Q.toFixed(2)}`)}return Y.join(" ")},[I,$,P,H]),B=M(Y=>{C({x:Y.clientX,y:Y.clientY,px:S,py:k})},[S,k]),V=M(Y=>{z&&(E(z.px+(Y.clientX-z.x)),v(z.py+(Y.clientY-z.y)))},[z]),G=M(()=>{C(null)},[]),K=M(Y=>{Y.preventDefault();let U=Y.deltaY>0?1.15:1/1.15;b(Math.max(.1,f*U))},[f]),ee=M((Y,U,O)=>{if(Y)return _=>Y({r:U.r,theta:U.theta,index:O,event:_})},[]),J=[];if(J.push(o("rect",{x:0,y:0,width:t,height:n,fill:"white",key:"bg"})),u){for(let Y=0;Y<L.length;Y++){let U=L[Y]*H;J.push(o("circle",{cx:$,cy:P,r:U,fill:"none",stroke:"#e5e7eb","stroke-width":1,key:`gc-${Y}`})),J.push(o("text",{x:$+U+2,y:P-4,"font-size":10,fill:"#9ca3af",key:`gl-${Y}`},L[Y].toFixed(1)))}for(let Y=0;Y<T.length;Y++){let U=T[Y],O=L[L.length-1]*H,_=$+O*Math.cos(U),Z=P-O*Math.sin(U);J.push(o("line",{x1:$,y1:P,x2:_,y2:Z,stroke:"#e5e7eb","stroke-width":1,key:`al-${Y}`}));let Q=Math.round(U*180/Math.PI),oe=$+(O+14)*Math.cos(U),j=P-(O+14)*Math.sin(U);J.push(o("text",{x:oe,y:j+4,"text-anchor":"middle","font-size":10,fill:"#9ca3af",key:`at-${Y}`},`${Q}\xB0`))}}J.push(o("line",{x1:$-A,y1:P,x2:$+A,y2:P,stroke:"#d1d5db","stroke-width":1,key:"x-axis"})),J.push(o("line",{x1:$,y1:P-A,x2:$,y2:P+A,stroke:"#d1d5db","stroke-width":1,key:"y-axis"})),N&&J.push(o("path",{d:N,fill:"none",stroke:c,"stroke-width":2,key:"curve"}));for(let Y=0;Y<d.length;Y++){let U=d[Y],{x:O,y:_}=dr(U.r,U.theta,$,P,H);J.push(o("circle",{cx:O,cy:_,r:h,fill:p,key:`pt-${Y}`,style:{cursor:"pointer"},onClick:ee(x,U,Y),onDblClick:ee(m,U,Y),onContextMenu:ee(y,U,Y),onMouseEnter:ee(g,U,Y)}))}return o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",style:{cursor:z?"grabbing":"grab"},onMouseDown:B,onMouseMove:V,onMouseUp:G,onMouseLeave:G,onWheel:K},...J)}function Ot(e){let t=1<<e,n=[];for(let r=0;r<t;r++){let i=[];for(let s=0;s<e;s++)i.push((r>>s&1)*2-1);n.push({coords:i})}return n}function Vt(e){let t=1<<e,n=[];for(let r=0;r<t;r++)for(let i=0;i<e;i++){let s=r^1<<i;s>r&&n.push({source:r,target:s})}return n}function Yt(e,t){let n=fr(e),r=0;for(let i=0;i<e;i++)for(let s=i+1;s<e;s++){if(r<t.length){let l=t[r];n=Ma(n,Ca(e,i,s,l))}r++}return n}function fr(e){let t=[];for(let n=0;n<e;n++){let r=new Array(e).fill(0);r[n]=1,t.push(r)}return t}function Ca(e,t,n,r){let i=fr(e),s=Math.cos(r),l=Math.sin(r);return i[t][t]=s,i[t][n]=-l,i[n][t]=l,i[n][n]=s,i}function Ma(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let s=new Array(n).fill(0);for(let l=0;l<n;l++)for(let a=0;a<n;a++)s[l]+=e[i][a]*t[a][l];r.push(s)}return r}function Gt(e,t){let n=e.length,r=new Array(n).fill(0);for(let i=0;i<n;i++)for(let s=0;s<n;s++)r[i]+=e[i][s]*t.coords[s];return r}function Ut(e,t=0){let n=e[0]??0,r=e[1]??0,i=0;for(let s=2;s<e.length;s++)i+=e[s]??0;if(e.length>2&&(i/=e.length-2),t>0){let s=1/(1+t*(i+2));return{x:n*s,y:r*s,depth:i}}return{x:n,y:r,depth:i}}function Ke(e,t=[],n=.3,r=1){let i=Ot(e),s=Vt(e),l=Yt(e,t);return{vertices:i.map((d,u)=>{let h=Gt(l,d),p=Ut(h,n);return{id:u,position:d,x:p.x*r,y:p.y*r,depth:p.depth}}),edges:s,dimension:e}}function Ze(e){return e*(e-1)/2}function pt(e,t=70,n=55){let r=[];for(let i=0;i<e;i++){let s=Math.round(360*i/e);r.push(`hsl(${s}, ${t}%, ${n}%)`)}return r}function pr(e){let t=e.dimension??4,n=e.width??600,r=e.height??600,i=e.vertexRadius??10,s=e.edgeWidth??3,l=e.edgeColor??"#111",a=e.perspective??.25,d=e.rotationSpeed??.008,u=e.showLabels??!1,h=e.backgroundColor??"transparent",p=e.scale??Math.min(n,r)*.3,c=Ze(t),x=1<<t,m=q(()=>e.vertexColors==="auto"||e.vertexColors===void 0?pt(x):e.vertexColors,[x,e.vertexColors]),[y,g]=X(()=>{let R=[];for(let F=0;F<c;F++)R.push(0);return R}),[f,b]=X(!1),S=ie({x:0,y:0}),E=ie([]),k=ie(0);se(()=>{if(d===0)return;let R=!0,F=()=>{R&&(g(I=>{let N=I.slice();for(let B=0;B<N.length;B++)N[B]=(N[B]??0)+d*(1+B*.3);return N}),k.current=requestAnimationFrame(F))};return k.current=requestAnimationFrame(F),()=>{R=!1,cancelAnimationFrame(k.current)}},[d]);let v=q(()=>Ke(t,y,a,p),[t,y,a,p]),z=n/2,C=r/2,$=q(()=>v.edges.map(R=>{let F=v.vertices[R.source],I=v.vertices[R.target],N=(F.depth+I.depth)/2;return{...R,avgDepth:N,sv:F,tv:I}}).sort((R,F)=>R.avgDepth-F.avgDepth),[v]),P=q(()=>v.vertices.slice().sort((R,F)=>R.depth-F.depth),[v]),W=M(R=>{let F=R;b(!0),S.current={x:F.clientX,y:F.clientY},E.current=y.slice()},[y]),A=M(R=>{if(!f)return;let F=R,I=(F.clientX-S.current.x)*.01,N=(F.clientY-S.current.y)*.01;g(()=>{let B=E.current.slice();return B.length>0&&(B[0]=(B[0]??0)+I),B.length>1&&(B[1]=(B[1]??0)+N),B})},[f]),H=M(()=>{b(!1)},[]),L=R=>{let F=(R+2)/4;return .3+.7*Math.max(0,Math.min(1,F))},T=R=>{let F=(R+2)/4;return .6+.4*Math.max(0,Math.min(1,F))},w=$.map((R,F)=>{let I=L(R.avgDepth);return o("line",{key:`e-${R.source}-${R.target}`,x1:String(z+R.sv.x),y1:String(C+R.sv.y),x2:String(z+R.tv.x),y2:String(C+R.tv.y),stroke:l,"stroke-width":String(s),"stroke-opacity":String(I),"stroke-linecap":"round"})}),D=P.map(R=>{let F=i*T(R.depth),I=m[R.id%m.length]??"#3b82f6",N=[o("circle",{key:`v-${R.id}-circle`,cx:String(z+R.x),cy:String(C+R.y),r:String(F),fill:I,stroke:"#000","stroke-width":"1.5",style:{filter:"drop-shadow(0 1px 2px rgba(0,0,0,0.3))"}})];return u&&N.push(o("text",{key:`v-${R.id}-label`,x:String(z+R.x),y:String(C+R.y+F+14),"text-anchor":"middle","font-size":"11","font-family":"monospace",fill:"#555"},R.id.toString(2).padStart(t,"0"))),N});return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",style:{backgroundColor:h,cursor:f?"grabbing":"grab",userSelect:"none"},onMouseDown:W,onMouseMove:A,onMouseUp:H,onMouseLeave:H},...w,...D.flat())}function mr(e={}){let t=e.dimension??4,n=e.rotationSpeed??.008,r=e.perspective??.25,i=e.scale??200,s=Ze(t),[l,a]=X(()=>new Array(s).fill(0));return se(()=>{if(n===0)return;let u=!0,h=0,p=()=>{u&&(a(c=>c.map((x,m)=>x+n*(1+m*.3))),h=requestAnimationFrame(p))};return h=requestAnimationFrame(p),()=>{u=!1,cancelAnimationFrame(h)}},[n]),{data:q(()=>Ke(t,l,r,i),[t,l,r,i]),angles:l,setAngles:a}}function gr(e){let t=e.titlePosition??"top",n=e.legendPosition??"bottom",r=e.titleAlign??"center",i=e.legendAlign??"center",s=e.gap??"12px",l=e.contain??"layout style paint",a={display:"flex",flexDirection:Pa(t,n),gap:s,width:typeof e.width=="number"?`${e.width}px`:e.width??"auto",height:typeof e.height=="number"?`${e.height}px`:e.height??"auto",backgroundColor:e.backgroundColor??"#ffffff",border:e.border??"1px solid #e5e7eb",borderRadius:e.borderRadius??"8px",padding:e.padding??"16px",fontFamily:e.fontFamily??"inherit",contain:l,overflow:"hidden",position:"relative",boxSizing:"border-box",...e.boxShadow?{boxShadow:e.boxShadow}:{},...e.style??{}},d=e.title?o("div",{className:"viz-title",style:{fontSize:e.titleFontSize??"16px",fontWeight:e.titleFontWeight??"600",color:e.titleColor??"#1f2937",textAlign:r,flexShrink:"0"}},e.title):null,u=e.legend&&e.legend.length>0?$a(e.legend,{align:i,fontSize:e.legendFontSize??"12px",gap:e.legendGap??16,direction:n==="left"||n==="right"?"column":"row"}):null,h=o("div",{className:"viz-content",style:{flex:"1",minWidth:"0",minHeight:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}},e.children),p=Ea(d,h,u,t,n);return o("div",{className:`viz-wrapper ${e.className??""}`.trim(),style:a},...p)}function Pa(e,t){return"column"}function Ea(e,t,n,r,i){let s=[];if(r==="top"&&e&&s.push(e),i==="left"||i==="right"){let l=[];i==="left"&&n&&l.push(n),r==="left"&&e&&l.push(e),l.push(t),r==="right"&&e&&l.push(e),i==="right"&&n&&l.push(n),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"stretch"}},...l))}else if(r==="left"||r==="right"){i==="top"&&n&&s.push(n);let l=[];r==="left"&&e&&l.push(e),l.push(t),r==="right"&&e&&l.push(e),s.push(o("div",{style:{display:"flex",flexDirection:"row",flex:"1",gap:"12px",minHeight:"0",alignItems:"center"}},...l)),i==="bottom"&&n&&s.push(n)}else i==="top"&&n&&s.push(n),s.push(t),i==="bottom"&&n&&s.push(n);return r==="bottom"&&e&&s.push(e),s}function $a(e,t){return o("div",{className:"viz-legend",style:{display:"flex",flexDirection:t.direction,flexWrap:"wrap",gap:`${t.gap}px`,justifyContent:t.align,alignItems:"center",fontSize:t.fontSize,color:"#6b7280",flexShrink:"0"}},...e.map((n,r)=>o("div",{key:`legend-${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},Ra(n),o("span",null,n.label))))}function Ra(e){let t=e.shape??"circle";return t==="line"?o("svg",{width:"20",height:"12",viewBox:"0 0 20 12"},o("line",{x1:"0",y1:"6",x2:"20",y2:"6",stroke:e.color,"stroke-width":"2","stroke-dasharray":e.dash??""})):t==="square"?o("div",{style:{width:"12px",height:"12px",backgroundColor:e.color,borderRadius:"2px",flexShrink:"0"}}):o("div",{style:{width:"10px",height:"10px",backgroundColor:e.color,borderRadius:"50%",flexShrink:"0"}})}function za(e){if(typeof document>"u")return;let t="specifyjs-gtag";if(document.getElementById(t))return;let n=document.createElement("script");n.id=t,n.async=!0,n.src=`https://www.googletagmanager.com/gtag/js?id=${encodeURIComponent(e)}`,document.head.appendChild(n)}function Ta(){typeof window>"u"||(window.dataLayer=window.dataLayer||[],window.gtag||(window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date)))}function hr(e){let{measurementId:t,disabled:n=!1,debug:r=!1,anonymizeIp:i=!1,config:s}=e;return se(()=>{if(n||typeof window>"u")return;za(t),Ta();let l={...s};return i&&(l.anonymize_ip=!0),r&&(l.debug_mode=!0),window.gtag&&window.gtag("config",t,l),()=>{let a=document.getElementById("specifyjs-gtag");a&&a.remove()}},[t,n,r,i]),null}function br(e){let{left:t,center:n,right:r,borderTop:i="1px solid var(--color-border, #e2e8f0)",background:s="var(--color-bg, transparent)",color:l="var(--color-text-muted, #64748b)",fontSize:a="13px",padding:d="24px",maxWidth:u="1200px",className:h,ariaLabel:p="Site footer"}=e;return o("footer",{className:h,role:"contentinfo","aria-label":p,style:{borderTop:i,background:s,color:l,fontSize:a,padding:d,marginTop:"48px"}},o("div",{style:{maxWidth:u,margin:"0 auto",display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"12px"}},o("div",{style:{flex:"1",textAlign:"left",minWidth:"150px"}},t??null),o("div",{style:{flex:"1",textAlign:"center",minWidth:"150px"}},n??null),o("div",{style:{flex:"1",textAlign:"right",minWidth:"150px"}},r??null)))}var Sr=Le({windows:[],openWindow:()=>{},closeWindow:()=>{},focusWindow:()=>{},minimizeWindow:()=>{},maximizeWindow:()=>{},restoreWindow:()=>{},moveWindow:()=>{},resizeWindow:()=>{},tileWindows:()=>{},cascadeWindows:()=>{},minimizeAll:()=>{},focusedWindowId:null}),Ia={width:600,height:400},Da={x:30,y:30},Aa={top:0,left:0,width:1920,height:1080},jt=1e3;function xr(e,t,n,r){let i=n.left+e*t.x,s=n.top+e*t.y,l=n.left+n.width-r.width,a=n.top+n.height-r.height;return l>n.left&&i>l&&(i=n.left+(i-n.left)%Math.max(1,l-n.left)),a>n.top&&s>a&&(s=n.top+(s-n.top)%Math.max(1,a-n.top)),{x:i,y:s}}function Xt(e){let t=[...e].sort((r,i)=>r.zIndex-i.zIndex),n=[];for(let r=0;r<t.length;r++)n.push({...t[r],zIndex:r+1});return n}function yr(e,t){let n=null;for(let r=0;r<e.length;r++){let i=e[r];i.id!==t&&i.windowState!=="minimized"&&(n===null||i.zIndex>n.zIndex)&&(n=i)}return n}function qt(e){let t=0;for(let n=0;n<e.length;n++)e[n].zIndex>t&&(t=e[n].zIndex);return t}function Kt(e){let t=e.workspaceBounds??Aa,n=e.defaultWindowSize??Ia,r=e.cascadeOffset??Da,[i,s]=X([]),l=M(((...S)=>{let E=S[0];s(k=>{if(k.find(H=>H.id===E.id)){let L=qt(k)+1,T=k.map(w=>w.id===E.id?{...w,focused:!0,zIndex:L,windowState:w.windowState==="minimized"?"normal":w.windowState}:{...w,focused:!1});return L>jt&&(T=Xt(T)),T}let z=E.size??n,C=E.position??xr(k.length,r,t,z),P=qt(k)+1,W={id:E.id,title:E.title,icon:E.icon,position:C,size:z,windowState:"normal",zIndex:P,focused:!0,appProps:E.appProps},A=k.map(H=>({...H,focused:!1}));return A.push(W),P>jt&&(A=Xt(A)),e.onWindowOpen&&e.onWindowOpen(E.id),e.onFocusChange&&e.onFocusChange(E.id),A})}),[n,r,t,e.onWindowOpen,e.onFocusChange]),a=M(((...S)=>{let E=S[0];s(k=>{let v=k.find(C=>C.id===E);if(!v)return k;let z=k.filter(C=>C.id!==E);if(v.focused&&z.length>0){let C=yr(z,E);if(C){let $=z.map(P=>({...P,focused:P.id===C.id}));return e.onWindowClose&&e.onWindowClose(E),e.onFocusChange&&e.onFocusChange(C.id),$}}return e.onWindowClose&&e.onWindowClose(E),z.length===0&&e.onFocusChange&&e.onFocusChange(null),z})}),[e.onWindowClose,e.onFocusChange]),d=M(((...S)=>{let E=S[0];s(k=>{if(!k.find(P=>P.id===E))return k;let C=qt(k)+1,$=k.map(P=>P.id===E?{...P,focused:!0,zIndex:C}:{...P,focused:!1});return C>jt&&($=Xt($)),e.onFocusChange&&e.onFocusChange(E),$})}),[e.onFocusChange]),u=M(((...S)=>{let E=S[0];s(k=>{let v=k.find(C=>C.id===E);if(!v)return k;let z=k.map(C=>C.id===E?{...C,windowState:"minimized",focused:!1}:C);if(v.focused){let C=yr(z,E);C?(z=z.map($=>({...$,focused:$.id===C.id})),e.onFocusChange&&e.onFocusChange(C.id)):e.onFocusChange&&e.onFocusChange(null)}return z})}),[e.onFocusChange]),h=M(((...S)=>{let E=S[0];s(k=>k.map(v=>v.id===E?{...v,windowState:"maximized"}:v))}),[]),p=M(((...S)=>{let E=S[0];s(k=>k.map(v=>v.id===E?{...v,windowState:"normal"}:v))}),[]),c=M(((...S)=>{let E=S[0],k=S[1];s(v=>v.map(z=>z.id===E?{...z,position:k}:z))}),[]),x=M(((...S)=>{let E=S[0],k=S[1];s(v=>v.map(z=>z.id===E?{...z,size:k}:z))}),[]),m=M(((...S)=>{s(E=>{let k=E.filter(C=>C.windowState!=="minimized");if(k.length===0)return E;let v=k.length,z=new Map;if(v===1)z.set(k[0].id,{position:{x:t.left,y:t.top},size:{width:t.width,height:t.height}});else if(v===2){let C=Math.floor(t.width/2);z.set(k[0].id,{position:{x:t.left,y:t.top},size:{width:C,height:t.height}}),z.set(k[1].id,{position:{x:t.left+C,y:t.top},size:{width:t.width-C,height:t.height}})}else if(v===3){let C=Math.floor(t.width/2),$=Math.floor(t.height/2);z.set(k[0].id,{position:{x:t.left,y:t.top},size:{width:C,height:t.height}}),z.set(k[1].id,{position:{x:t.left+C,y:t.top},size:{width:t.width-C,height:$}}),z.set(k[2].id,{position:{x:t.left+C,y:t.top+$},size:{width:t.width-C,height:t.height-$}})}else{let C=Math.ceil(Math.sqrt(v)),$=Math.ceil(v/C),P=Math.floor(t.width/C),W=Math.floor(t.height/$);for(let A=0;A<k.length;A++){let H=Math.floor(A/C),L=A%C;z.set(k[A].id,{position:{x:t.left+L*P,y:t.top+H*W},size:{width:P,height:W}})}}return E.map(C=>{let $=z.get(C.id);return $?{...C,position:$.position,size:$.size,windowState:"normal"}:C})})}),[t]),y=M(((...S)=>{s(E=>{let k=E.filter(C=>C.windowState!=="minimized");if(k.length===0)return E;let v=[...k].sort((C,$)=>C.zIndex-$.zIndex),z=new Map;for(let C=0;C<v.length;C++){let $=xr(C,r,t,v[C].size);z.set(v[C].id,{position:$,zIndex:C+1})}return E.map(C=>{let $=z.get(C.id);return $?{...C,position:$.position,zIndex:$.zIndex,windowState:"normal"}:C})})}),[r,t]),g=M(((...S)=>{s(E=>{let k=E.map(v=>({...v,windowState:"minimized",focused:!1}));return e.onFocusChange&&e.onFocusChange(null),k})}),[e.onFocusChange]),f=q(()=>{let S=i.find(E=>E.focused);return S?S.id:null},[i]),b=q(()=>({windows:i,openWindow:l,closeWindow:a,focusWindow:d,minimizeWindow:u,maximizeWindow:h,restoreWindow:p,moveWindow:c,resizeWindow:x,tileWindows:m,cascadeWindows:y,minimizeAll:g,focusedWindowId:f}),[i,l,a,d,u,h,p,c,x,m,y,g,f]);return o(Sr.Provider,{value:b},e.children)}function Zt(){return Te(Sr)}var La=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Fa=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Jt(e){return e<10?"0"+String(e):String(e)}function Wa(e,t,n){let r=e.getHours(),i=Jt(e.getMinutes()),s=Jt(e.getSeconds());if(t==="12h"){let a=r>=12?"PM":"AM";return r=r%12,r===0&&(r=12),`${n?`${String(r)}:${i}:${s}`:`${String(r)}:${i}`} ${a}`}let l=Jt(r);return n?`${l}:${i}:${s}`:`${l}:${i}`}function Na(e){let t=La[e.getDay()],n=Fa[e.getMonth()],r=e.getDate();return`${t}, ${n} ${String(r)}`}function Ba(e){let{label:t,onClick:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=he(),l=M(()=>{n()},[n]),a=M(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),n())},[n]);return o("button",{type:"button",role:"button","aria-label":t,tabIndex:0,onClick:l,onKeyDown:a,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",padding:"0 12px",height:"100%",border:"none",outline:"none",backgroundColor:r?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",fontWeight:"700",cursor:"pointer",transition:"background-color 0.15s"}},t)}function Ha(e){let{format:t,showSeconds:n,showDate:r}=e,[i,s]=X(new Date);se(()=>{let u=setInterval(()=>{s(new Date)},1e3);return()=>{clearInterval(u)}},[]);let l=q(()=>Wa(i,t,n),[i,t,n]),a=q(()=>Na(i),[i]),d=r?o("span",{style:{fontSize:"11px",opacity:"0.85"}},a):null;return o("div",{role:"timer","aria-live":"polite","aria-label":"System clock",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"6px",lineHeight:"1",padding:"0 8px"}},d,o("span",{style:{fontSize:"13px",fontWeight:"500"}},l))}function _a(e){let{indicator:t}=e,{hover:n,onMouseEnter:r,onMouseLeave:i}=he(),s=M(()=>{t.onClick&&t.onClick()},[t]),l=M(a=>{let d=a;(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t.onClick&&t.onClick())},[t]);return o("button",{type:"button",role:"button","aria-label":t.label||t.icon,tabIndex:0,onClick:s,onKeyDown:l,onMouseEnter:r,onMouseLeave:i,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"0 4px",height:"100%",border:"none",outline:"none",backgroundColor:n?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:t.onClick?"pointer":"default",transition:"background-color 0.15s"}},o("span",{"aria-hidden":"true"},t.icon),t.label?o("span",null,t.label):null)}function Oa(e){let{item:t,onClose:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=he();if(t.divider)return o("div",{role:"separator",style:{height:"1px",backgroundColor:"var(--panel-divider, #555555)",margin:"4px 0"}});let l=M(()=>{t.onClick(),n()},[t,n]),a=M(d=>{let u=d;(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t.onClick(),n())},[t,n]);return o("button",{type:"button",role:"menuitem",tabIndex:-1,onClick:l,onKeyDown:a,onMouseEnter:i,onMouseLeave:s,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"6px 16px",border:"none",outline:"none",backgroundColor:r?"var(--panel-hover, rgba(255,255,255,0.15))":"transparent",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",textAlign:"left",cursor:"pointer",boxSizing:"border-box",transition:"background-color 0.1s"}},t.icon?o("span",{style:{width:"16px",textAlign:"center"},"aria-hidden":"true"},t.icon):null,o("span",null,t.label))}function Va(e){let{user:t,menuItems:n}=e,{hover:r,onMouseEnter:i,onMouseLeave:s}=he(),[l,a]=X(!1),d=ie(null),u=M(()=>{a(g=>!g)},[]),h=M(()=>{a(!1)},[]),p=M(g=>{let f=g;(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),a(b=>!b)),f.key==="Escape"&&a(!1)},[]);se(()=>{if(!l)return;let g=f=>{let b=d.current;b&&!b.contains(f.target)&&a(!1)};return document.addEventListener("click",g,!0),()=>{document.removeEventListener("click",g,!0)}},[l]);let c={width:"24px",height:"24px",borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"700",backgroundColor:"rgba(255,255,255,0.2)",color:"inherit",overflow:"hidden",flexShrink:"0"},x=t.avatar?o("img",{src:t.avatar,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"}}):t.name.charAt(0).toUpperCase(),m=o("span",{style:c,"aria-hidden":"true"},x),y=l&&n&&n.length>0?o("div",{role:"menu","aria-label":"User menu",style:{position:"absolute",top:"100%",right:"0",marginTop:"2px",backgroundColor:"var(--panel-bg, #2c2c2c)",border:"1px solid var(--panel-divider, #555555)",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",padding:"4px 0",minWidth:"180px",zIndex:"1000"}},...n.map((g,f)=>o(Oa,{key:String(f),item:g,onClose:h}))):null;return o("div",{ref:d,style:{position:"relative",display:"inline-flex",height:"100%"}},o("button",{type:"button","aria-haspopup":"true","aria-expanded":String(l),tabIndex:0,onClick:u,onKeyDown:p,onMouseEnter:i,onMouseLeave:s,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"0 8px",height:"100%",border:"none",outline:"none",backgroundColor:r||l?"rgba(255,255,255,0.15)":"transparent",color:"inherit",fontFamily:"inherit",fontSize:"13px",cursor:"pointer",transition:"background-color 0.15s"}},m,o("span",null,t.name),o("span",{"aria-hidden":"true",style:{fontSize:"10px"}},"\u25BE")),y)}function Qt(e){let{activeAppName:t,activitiesButton:n,clockFormat:r="24h",showSeconds:i=!0,showDate:s=!0,indicators:l,user:a,userMenuItems:d,height:u=28,children:h}=e,p=String(u)+"px",c=[];n&&c.push(o(Ba,{key:"activities",label:n.label,onClick:n.onClick})),t&&c.push(o("span",{key:"appname",style:{padding:"0 12px",fontSize:"13px",fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"}},t));let x=o("div",{style:{display:"flex",alignItems:"center",height:"100%",flex:"1",minWidth:"0"}},...c),m=[];m.push(o(Ha,{key:"clock",format:r,showSeconds:i,showDate:s})),h&&m.push(h);let y=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"}},...m),g=[];if(l&&l.length>0){let b=l.map(S=>o(_a,{key:S.id,indicator:S}));g.push(o("div",{key:"indicators",style:{display:"flex",alignItems:"center",gap:"8px",height:"100%"}},...b))}a&&g.push(o(Va,{key:"user",user:a,menuItems:d}));let f=o("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",height:"100%",flex:"1",gap:"4px"}},...g);return o("div",{role:"menubar","aria-label":"System panel","data-theme":"dark",style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:p,backgroundColor:"var(--panel-bg, #2c2c2c)",color:"var(--panel-text, #ffffff)",fontFamily:"inherit",fontSize:"13px",boxSizing:"border-box",position:"relative"}},x,y,f)}function Ya(e){return e.startsWith("http")||e.startsWith("/")||e.startsWith(".")}var vr=["#3465a4","#e67e22","#2ecc71","#3498db","#e74c3c","#9b59b6","#f39c12","#1abc9c","#e91e63","#00bcd4"];function Ga(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return vr[Math.abs(t)%vr.length]}function Ua(e){return e>99?"99+":String(e)}function ja(e){return e.badge&&e.badge>0?`${e.label}, ${e.badge} unread`:e.label}function Xa(e){switch(e){case"left":return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"};case"right":return{right:"100%",top:"50%",transform:"translateY(-50%)",marginRight:"8px"};case"top":return{top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"8px"};case"bottom":return{bottom:"100%",left:"50%",transform:"translateX(-50%)",marginBottom:"8px"};default:return{left:"100%",top:"50%",transform:"translateY(-50%)",marginLeft:"8px"}}}function qa(e,t){return t==="vertical"?e==="right"?{position:"absolute",right:"0",top:"50%",transform:"translateY(-50%)"}:{position:"absolute",left:"0",top:"50%",transform:"translateY(-50%)"}:e==="bottom"?{position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}:{position:"absolute",bottom:"0",left:"50%",transform:"translateX(-50%)"}}function Ka(e){let{item:t,iconSize:n,position:r,orientation:i,onItemClick:s,onItemContextMenu:l}=e,[a,d]=X(!1),u=t.disabled??!1,h=M(()=>{u||d(!0)},[u]),p=M(()=>{d(!1)},[]),c=M(()=>{!u&&s&&s(t.id)},[u,s,t.id]),x=M(E=>{if(!u&&l){let k=E;k.preventDefault(),l(t.id,{x:k.clientX,y:k.clientY})}},[u,l,t.id]),m=`${n}px`,y=Ya(t.icon)?o("img",{src:t.icon,alt:t.label,style:{width:m,height:m,objectFit:"contain",display:"block"}}):o("span",{style:{width:m,height:m,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.round(n*.6)}px`,fontWeight:"700",userSelect:"none",backgroundColor:Ga(t.icon),color:"#ffffff",borderRadius:"8px"},"aria-hidden":"true"},t.icon),g=t.badge!=null&&t.badge>0?o("span",{style:{position:"absolute",top:"0",right:"0",backgroundColor:"var(--dock-badge-bg, #e74c3c)",color:"#ffffff",fontSize:"9px",fontWeight:"700",lineHeight:"1",minWidth:"14px",height:"14px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"7px",padding:"0 3px",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"},Ua(t.badge)):null,f=t.active?o("span",{style:{...qa(r,i),width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"var(--dock-active-color, #ffffff)",pointerEvents:"none",zIndex:"2"},"aria-hidden":"true"}):null,b=a?o("div",{role:"tooltip",style:{position:"absolute",...Xa(r),padding:"4px 10px",backgroundColor:"#1f2937",color:"#ffffff",fontSize:"12px",borderRadius:"4px",whiteSpace:"nowrap",zIndex:"1000",pointerEvents:"none"}},t.label):null,S={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",padding:"6px",border:"none",backgroundColor:"transparent",cursor:u?"default":"pointer",opacity:u?"0.4":"1",pointerEvents:u?"none":"auto",transition:"transform 100ms, background-color 100ms",borderRadius:"8px",outline:"none",...a&&!u?{transform:"scale(1.1)",backgroundColor:"rgba(255,255,255,0.15)"}:{}};return o("button",{type:"button",role:"button",style:S,"aria-label":ja(t),"aria-pressed":t.active?"true":"false","aria-disabled":u?"true":void 0,tabIndex:u?-1:0,onClick:c,onContextMenu:x,onMouseEnter:h,onMouseLeave:p,"data-dock-item-id":t.id},y,g,f,b)}function en(e){let{items:t,orientation:n="vertical",position:r="left",iconSize:i=36,autoHide:s=!1,showTrailingSeparator:l=!1,onItemClick:a,onItemContextMenu:d,children:u}=e,[h,p]=X(!s),c=ie(null),x=M(()=>{s&&(c.current!=null&&(clearTimeout(c.current),c.current=null),p(!0))},[s]),m=M(()=>{s&&(c.current=setTimeout(()=>{p(!1)},300))},[s]),y=M(E=>{let k=E,v=k.target,z=v.closest('[role="toolbar"]');if(!z)return;let C=Array.from(z.querySelectorAll("button[data-dock-item-id]")),$=C.indexOf(v);if($<0)return;let P=n==="vertical",W=P?"ArrowDown":"ArrowRight",A=P?"ArrowUp":"ArrowLeft";if(k.key===W){k.preventDefault();let H=C[$+1];H&&H.focus()}else if(k.key===A){k.preventDefault();let H=C[$-1];H&&H.focus()}else k.key==="Home"?(k.preventDefault(),C[0]?.focus()):k.key==="End"?(k.preventDefault(),C[C.length-1]?.focus()):(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),v.click())},[n]),g=n==="vertical",f={display:"flex",flexDirection:g?"column":"row",alignItems:"center",gap:"2px",padding:"4px",backgroundColor:"var(--dock-bg, rgba(0, 0, 0, 0.7))",color:"#ffffff",border:"1px solid var(--dock-border, rgba(255, 255, 255, 0.1))",borderRadius:"8px",boxSizing:"border-box",position:"relative",transition:"transform 200ms ease, opacity 200ms ease"};s&&!h&&(r==="left"?(f.transform="translateX(-100%)",f.opacity="0"):r==="right"?(f.transform="translateX(100%)",f.opacity="0"):r==="top"?(f.transform="translateY(-100%)",f.opacity="0"):r==="bottom"&&(f.transform="translateY(100%)",f.opacity="0"));let b=[];for(let E=0;E<t.length;E++){if(l&&E===t.length-1&&t.length>1){let k=g?{width:"60%",height:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"4px auto",flexShrink:"0"}:{height:"60%",width:"1px",backgroundColor:"rgba(255,255,255,0.2)",margin:"auto 4px",flexShrink:"0"};b.push(o("div",{key:`sep-${E}`,style:k,"aria-hidden":"true",role:"separator"}))}b.push(o(Ka,{key:t[E].id,item:t[E],iconSize:i,position:r,orientation:n,onItemClick:a,onItemContextMenu:d}))}let S=s&&!h?o("div",{style:{position:"absolute",...r==="left"?{left:"0",top:"0",width:"4px",height:"100%"}:{},...r==="right"?{right:"0",top:"0",width:"4px",height:"100%"}:{},...r==="top"?{top:"0",left:"0",height:"4px",width:"100%"}:{},...r==="bottom"?{bottom:"0",left:"0",height:"4px",width:"100%"}:{},zIndex:"10"},"aria-hidden":"true"}):null;return o("div",{role:"toolbar","aria-label":"Application launcher","aria-orientation":n,style:f,onMouseEnter:x,onMouseLeave:m,onKeyDown:y},S,...b,u??null)}var Za="#2c001e";function tn(e){let{backgroundColor:t=Za,backgroundGradient:n,backgroundImage:r,backgroundImageOpacity:i=1,contextMenuItems:s,onClick:l,onDoubleClick:a,overflow:d="visible",children:u}=e,h=M(f=>{let b=f;b.target===b.currentTarget&&l&&l()},[l]),p=M(f=>{let b=f;b.target===b.currentTarget&&a&&a()},[a]),c=q(()=>{let f={position:"relative",width:"100%",height:"100%",overflow:d,cursor:"default",margin:"0",padding:"0"};return f.backgroundColor=t,n&&(f.background=n),r&&i>=1&&(f.backgroundImage=`url(${r})`,f.backgroundSize="cover",f.backgroundPosition="center"),f},[t,n,r,i]),x=q(()=>!r||i>=1?null:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",backgroundImage:`url(${r})`,backgroundSize:"cover",backgroundPosition:"center",opacity:String(i),pointerEvents:"none",zIndex:"0"},[r,i]),m={position:"relative",width:"100%",height:"100%",zIndex:"1"},y=[];x&&y.push(o("div",{className:"desktop-background__image-overlay",style:x,"aria-hidden":"true"})),y.push(o("div",{className:"desktop-background__content",style:m},u));let g=o("div",{className:"desktop-background",style:c,onClick:h,onDblClick:p,role:"application","aria-label":"Desktop workspace","data-theme":"dark"},...y);return s&&s.length>0?o(dt,{items:s},g):g}var Ja={width:200,height:150},Qa={x:50,y:50},el={width:400,height:300},be=8,nn=20,tl={n:"n-resize",s:"s-resize",e:"e-resize",w:"w-resize",ne:"ne-resize",nw:"nw-resize",se:"se-resize",sw:"sw-resize"};function Je(e){let{id:t,title:n,icon:r,defaultPosition:i=Qa,defaultSize:s=el,minSize:l=Ja,maxSize:a,resizable:d=!0,draggable:u=!0,windowState:h="normal",focused:p=!0,zIndex:c,onClose:x,onMinimize:m,onMaximize:y,onFocus:g,onMove:f,onResize:b,children:S}=e,[E,k]=X(i.x),[v,z]=X(i.y),[C,$]=X(s.width),[P,W]=X(s.height),[A,H]=X(!1),[L,T]=X(!1),[w,D]=X(null),R=ie(null),F=ie(null),I=ie(null),N=M((ne,ce)=>{let de=Math.max(ne,l.width),ae=Math.max(ce,l.height);return a&&(de=Math.min(de,a.width),ae=Math.min(ae,a.height)),{width:de,height:ae}},[l,a]),B=M(()=>{let ne=I.current;return ne&&ne.parentElement?{width:ne.parentElement.clientWidth,height:ne.parentElement.clientHeight}:{width:window.innerWidth,height:window.innerHeight}},[]),V=M((ne,ce,de,ae)=>{let ue=B(),ge=Math.max(0,Math.min(ne,ue.width-de)),ve=Math.max(0,Math.min(ce,ue.height-ae));return{x:ge,y:ve}},[B]),G=M(ne=>{if(!u||h==="maximized")return;let ce=ne;ce.target.closest("button")||(ce.preventDefault(),R.current={startMouseX:ce.clientX,startMouseY:ce.clientY,startPosX:E,startPosY:v},H(!0))},[u,h,E,v]),K=M(ne=>{ne.target.closest("button")||y&&y()},[y]);se(()=>{if(!A)return;let ne=de=>{let ae=de,ue=R.current;if(!ue)return;let ge=ae.clientX-ue.startMouseX,ve=ae.clientY-ue.startMouseY,we=ue.startPosX+ge,ke=ue.startPosY+ve,Ce=B();we=Math.max(0,Math.min(we,Ce.width-C)),ke=Math.max(0,Math.min(ke,Ce.height-P)),k(we),z(ke),ae.clientX<=nn?D("left"):ae.clientX>=Ce.width-nn?D("right"):ae.clientY<=nn?D("top"):D(null)},ce=de=>{let ae=de;H(!1);let ue=B();if(w==="left"){k(0),z(0),$(Math.floor(ue.width/2)),W(ue.height),D(null),f&&f({x:0,y:0}),b&&b({width:Math.floor(ue.width/2),height:ue.height});return}if(w==="right"){let ve=Math.floor(ue.width/2);k(ve),z(0),$(ve),W(ue.height),D(null),f&&f({x:ve,y:0}),b&&b({width:ve,height:ue.height});return}if(w==="top"){D(null),y&&y();return}D(null);let ge=R.current;if(ge&&f){let ve=ae.clientX-ge.startMouseX,we=ae.clientY-ge.startMouseY,ke=ge.startPosX+ve,Ce=ge.startPosY+we;ke=Math.max(0,Math.min(ke,ue.width-C)),Ce=Math.max(0,Math.min(Ce,ue.height-P)),f({x:ke,y:Ce})}R.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",ce),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",ce)}},[A,w,C,P,B,f,b,y]);let ee=M(ne=>ce=>{if(!d||h!=="normal")return;let de=ce;de.preventDefault(),de.stopPropagation(),F.current={direction:ne,startMouseX:de.clientX,startMouseY:de.clientY,startPosX:E,startPosY:v,startWidth:C,startHeight:P},T(!0)},[d,h,E,v,C,P]);se(()=>{if(!L)return;let ne=de=>{let ae=de,ue=F.current;if(!ue)return;let ge=ae.clientX-ue.startMouseX,ve=ae.clientY-ue.startMouseY,we=ue.direction,ke=ue.startWidth,Ce=ue.startHeight,$t=ue.startPosX,Rt=ue.startPosY;we.includes("e")&&(ke=ue.startWidth+ge),we.includes("w")&&(ke=ue.startWidth-ge,$t=ue.startPosX+ge),we.includes("s")&&(Ce=ue.startHeight+ve),we.includes("n")&&(Ce=ue.startHeight-ve,Rt=ue.startPosY+ve);let nt=N(ke,Ce);we.includes("w")&&($t=ue.startPosX+(ue.startWidth-nt.width)),we.includes("n")&&(Rt=ue.startPosY+(ue.startHeight-nt.height)),$(nt.width),W(nt.height),k($t),z(Rt)},ce=()=>{T(!1),b&&b({width:C,height:P}),F.current=null};return document.addEventListener("mousemove",ne),document.addEventListener("mouseup",ce),()=>{document.removeEventListener("mousemove",ne),document.removeEventListener("mouseup",ce)}},[L,C,P,N,b]),se(()=>{if(!p||!x)return;let ne=ce=>{ce.key==="Escape"&&x()};return document.addEventListener("keydown",ne),()=>document.removeEventListener("keydown",ne)},[p,x]);let J=M(ne=>{g&&g()},[g]);if(h==="minimized")return null;let Y=h==="maximized",U=q(()=>{let ne={position:"absolute",display:"flex",flexDirection:"column",border:"1px solid var(--window-border, #555555)",borderRadius:Y?"0":"6px",overflow:"hidden",backgroundColor:"var(--window-body-bg, #1e1e1e)",boxShadow:p?"0 8px 32px rgba(0, 0, 0, 0.4)":"0 4px 16px rgba(0, 0, 0, 0.2)",transition:Y?"all 200ms ease":"box-shadow 200ms ease",outline:"none"};return Y?(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"):(ne.top=`${v}px`,ne.left=`${E}px`,ne.width=`${C}px`,ne.height=`${P}px`),c!==void 0&&(ne.zIndex=String(c)),A&&(ne.cursor="grabbing",ne.userSelect="none"),ne},[Y,E,v,C,P,c,p,A]),O=q(()=>{let ne={display:"flex",alignItems:"center",padding:"0 8px",height:"32px",backgroundColor:"var(--window-title-bg, #2c2c2c)",color:"var(--window-title-text, #ffffff)",userSelect:"none",flexShrink:"0",cursor:u&&!Y?"grab":"default",opacity:p?"1":"0.6"};return A&&(ne.cursor="grabbing"),ne},[p,u,Y,A]),_={flex:"1",overflow:"auto",backgroundColor:"var(--window-body-bg, #1e1e1e)"},Z={width:"14px",height:"14px",borderRadius:"50%",border:"none",cursor:"pointer",padding:"0",marginLeft:"6px",fontSize:"0",lineHeight:"0",display:"inline-flex",alignItems:"center",justifyContent:"center"},Q=[];r&&(r.startsWith("http")||r.startsWith("/")||r.startsWith("data:")?Q.push(o("img",{src:r,alt:"",style:{width:"16px",height:"16px",marginRight:"6px",flexShrink:"0"},className:"draggable-window__icon"})):Q.push(o("span",{style:{marginRight:"6px",fontSize:"14px",flexShrink:"0"},className:"draggable-window__icon"},r))),Q.push(o("span",{className:"draggable-window__title-text",style:{flex:"1",fontSize:"13px",fontWeight:"500",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},n));let oe=o("div",{style:{display:"flex",alignItems:"center",flexShrink:"0"},className:"draggable-window__controls"},o("button",{type:"button","aria-label":"Minimize",className:"draggable-window__btn-minimize",style:{...Z,backgroundColor:"var(--window-button-minimize, #f39c12)"},onClick:ne=>{ne.stopPropagation(),m&&m()}}),o("button",{type:"button","aria-label":Y?"Restore":"Maximize",className:"draggable-window__btn-maximize",style:{...Z,backgroundColor:"var(--window-button-maximize, #2ecc71)"},onClick:ne=>{ne.stopPropagation(),y&&y()}}),o("button",{type:"button","aria-label":"Close",className:"draggable-window__btn-close",style:{...Z,backgroundColor:"var(--window-button-close, #e74c3c)"},onClick:ne=>{ne.stopPropagation(),x&&x()}}));Q.push(oe);let j=[];if(d&&!Y){let ne=["n","s","e","w","ne","nw","se","sw"];for(let ce=0;ce<ne.length;ce++){let de=ne[ce],ae={position:"absolute",zIndex:"1"};de==="n"?(ae.top="0",ae.left=`${be}px`,ae.right=`${be}px`,ae.height=`${be}px`):de==="s"?(ae.bottom="0",ae.left=`${be}px`,ae.right=`${be}px`,ae.height=`${be}px`):de==="e"?(ae.top=`${be}px`,ae.right="0",ae.bottom=`${be}px`,ae.width=`${be}px`):de==="w"?(ae.top=`${be}px`,ae.left="0",ae.bottom=`${be}px`,ae.width=`${be}px`):de==="ne"?(ae.top="0",ae.right="0",ae.width=`${be}px`,ae.height=`${be}px`):de==="nw"?(ae.top="0",ae.left="0",ae.width=`${be}px`,ae.height=`${be}px`):de==="se"?(ae.bottom="0",ae.right="0",ae.width=`${be}px`,ae.height=`${be}px`):de==="sw"&&(ae.bottom="0",ae.left="0",ae.width=`${be}px`,ae.height=`${be}px`),ae.cursor=tl[de],j.push(o("div",{className:`draggable-window__resize-handle draggable-window__resize-${de}`,style:ae,onMouseDown:ee(de)}))}}let te=null;if(w){let ne={position:"fixed",backgroundColor:"rgba(66, 133, 244, 0.2)",border:"2px solid rgba(66, 133, 244, 0.5)",borderRadius:"4px",zIndex:"999999",pointerEvents:"none",transition:"all 150ms ease"};w==="left"?(ne.top="0",ne.left="0",ne.width="50%",ne.height="100%"):w==="right"?(ne.top="0",ne.right="0",ne.width="50%",ne.height="100%"):w==="top"&&(ne.top="0",ne.left="0",ne.width="100%",ne.height="100%"),te=o("div",{className:"draggable-window__snap-preview",style:ne})}let re=[];for(let ne=0;ne<j.length;ne++)re.push(j[ne]);re.push(o("div",{className:"draggable-window__title-bar",style:O,onMouseDown:G,onDblClick:K,role:"toolbar","aria-label":`${n} window controls`},...Q)),re.push(o("div",{className:"draggable-window__body",style:_},S));let le=[o("div",{ref:I,id:`draggable-window-${t}`,className:`draggable-window ${p?"draggable-window--focused":"draggable-window--unfocused"} draggable-window--${h}`,style:U,role:"dialog","aria-label":n,tabIndex:-1,onMouseDown:J},...re)];return te&&le.push(te),le.length===1?le[0]:o("div",{style:{display:"contents"}},...le)}var nl=["File","Edit","View","Insert","Format","Tools","Help"],wr={File:[{label:"New",action:"new"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Print",action:"print"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Zoom In",action:"zoomIn"},{label:"Zoom Out",action:"zoomOut"},{label:"Full Screen",action:"fullScreen"}],Insert:[{label:"Image",action:"insertImage"},{label:"Table",action:"insertTable"},{label:"Link",action:"insertLink"}],Format:[{label:"Bold",action:"bold"},{label:"Italic",action:"italic"},{label:"Underline",action:"underline"}],Tools:[{label:"Word Count",action:"wordCount"},{label:"Spell Check",action:"spellCheck"}],Help:[{label:"About",action:"about"},{label:"Keyboard Shortcuts",action:"shortcuts"}]},ol=[{id:"bold",label:"Bold",text:"B",shortcut:"Ctrl+B",style:{fontWeight:"700"}},{id:"italic",label:"Italic",text:"I",shortcut:"Ctrl+I",style:{fontStyle:"italic"}},{id:"underline",label:"Underline",text:"U",shortcut:"Ctrl+U",style:{textDecoration:"underline"}}],rl=[{label:"Align left",text:"\u2261",command:"justifyLeft"},{label:"Align center",text:"\u2263",command:"justifyCenter"},{label:"Align right",text:"\u2262",command:"justifyRight"}],il=["1","2","3","4","5","6","7"],sl={1:"8",2:"10",3:"12",4:"14",5:"18",6:"24",7:"36"};function al(){let e=[];for(let t=0;t<=20;t++){let n=t%2===0;e.push(o("div",{key:String(t),style:{position:"absolute",left:`${t/20*100}%`,bottom:"0",width:"1px",height:n?"10px":"5px",backgroundColor:"#999"}})),n&&e.push(o("span",{key:`l${t}`,style:{position:"absolute",left:`${t/20*100}%`,top:"1px",fontSize:"8px",color:"#666",transform:"translateX(-50%)"}},String(t/2)))}return e}function kr(e){return e.trim().split(/\s+/).filter(t=>t.length>0).length}function mt(e){let[t,n]=X(!1),[r,i]=X(!1),[s,l]=X(!1),[a,d]=X(-1),[u,h]=X(""),[p,c]=X(-1),[x,m]=X(0),[y,g]=X("3"),f=ie(null),b=M(()=>{document.execCommand("bold",!1),n(_=>!_),f.current&&f.current.focus()},[]),S=M(()=>{document.execCommand("italic",!1),i(_=>!_),f.current&&f.current.focus()},[]),E=M(()=>{document.execCommand("underline",!1),l(_=>!_),f.current&&f.current.focus()},[]),k={bold:b,italic:S,underline:E},v={bold:t,italic:r,underline:s},z=M(_=>{document.execCommand(_,!1),f.current&&f.current.focus()},[]),C=M(_=>{document.execCommand("fontSize",!1,_),g(_),f.current&&f.current.focus()},[]),$=M(_=>{c(Z=>Z===_?-1:_)},[]),P=M(_=>{switch(_){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"bold":document.execCommand("bold",!1);break;case"italic":document.execCommand("italic",!1);break;case"underline":document.execCommand("underline",!1);break;case"print":typeof window<"u"&&window.print&&window.print();break;case"new":f.current&&(f.current.innerHTML="",m(0));break;default:break}c(-1),f.current&&f.current.focus()},[]),W=M(()=>{if(f.current){let _=f.current.textContent??"";m(kr(_))}},[]),A=M(()=>{c(-1)},[]),H=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:"#f0f0f0",overflow:"hidden"}),[]),L={display:"flex",alignItems:"center",height:"30px",backgroundColor:"var(--color-bg-subtle, #ffffff)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},T={display:"flex",alignItems:"center",height:"36px",backgroundColor:"var(--color-bg-subtle, #f8f9fa)",borderBottom:"1px solid var(--color-border, #d0d0d0)",padding:"0 12px",gap:"12px",flexShrink:"0"},w={height:"20px",backgroundColor:"#e8e8e8",borderBottom:"1px solid #ccc",position:"relative",flexShrink:"0",margin:"0 60px"},D={flex:"1",display:"flex",justifyContent:"center",alignItems:"flex-start",padding:"30px 40px",overflow:"auto",backgroundColor:"#e0e0e0",cursor:"text"},R={width:"680px",minHeight:"880px",backgroundColor:"#ffffff",boxShadow:"0 2px 12px rgba(0,0,0,0.18), 0 0 1px rgba(0,0,0,0.1)",padding:"72px 72px 96px 72px",boxSizing:"border-box",fontSize:"14px",lineHeight:"1.6",color:"#222",fontFamily:'"Times New Roman", Georgia, serif',cursor:"text",outline:"none"},F={height:"24px",backgroundColor:"var(--color-bg-subtle, #f0f0f0)",borderTop:"1px solid var(--color-border, #ccc)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",fontSize:"11px",color:"#666",flexShrink:"0"},I=q(()=>al(),[]),N=e.content??"Start typing...",B=kr(N),V=x>0?x:B;function G(_){return{padding:"4px 10px",cursor:"pointer",borderRadius:"3px",fontSize:"13px",color:"var(--color-text, #333)",backgroundColor:p===_?"rgba(0,0,0,0.12)":a===_?"rgba(0,0,0,0.08)":"transparent",border:"none",lineHeight:"1",transition:"background 0.15s",position:"relative"}}let K={position:"absolute",top:"100%",left:"0",minWidth:"160px",backgroundColor:"#ffffff",border:"1px solid #d0d0d0",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",padding:"4px 0",zIndex:"1000"},ee={display:"block",width:"100%",padding:"6px 16px",fontSize:"13px",color:"#333",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"};function J(_,Z){return{width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid transparent",borderRadius:"3px",cursor:"pointer",fontSize:"13px",backgroundColor:v[_]??!1?"rgba(0,0,0,0.12)":u===_?"rgba(0,0,0,0.06)":"transparent",color:"var(--color-text, #444)",transition:"background 0.15s",...Z??{}}}let Y={display:"flex",alignItems:"center",padding:"2px 8px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"default",height:"24px",gap:"4px"},U={padding:"2px 4px",border:"1px solid var(--color-border, #ccc)",borderRadius:"3px",fontSize:"12px",color:"var(--color-text, #444)",backgroundColor:"transparent",cursor:"pointer",height:"24px",outline:"none"},O=nl.map((_,Z)=>{let Q=[_];return p===Z&&wr[_]&&Q.push(o("div",{key:"dropdown",style:K,className:"word-processor__menu-dropdown"},...wr[_].map((oe,j)=>o("button",{key:String(j),style:ee,onClick:te=>{te.stopPropagation(),P(oe.action)},role:"menuitem"},oe.label)))),o("button",{key:String(Z),style:G(Z),role:"menuitem","aria-label":_,onClick:()=>$(Z),onMouseEnter:()=>{d(Z)},onMouseLeave:()=>d(-1)},...Q)});return o("div",{className:`word-processor ${e.className??""}`.trim(),style:H},o("div",{className:"word-processor__menu-bar",style:L,role:"menubar"},...O),o("div",{className:"word-processor__toolbar",style:T,role:"toolbar","aria-label":"Formatting toolbar"},o("div",{style:Y,"aria-label":"Font family"},o("span",null,"Arial"),o("span",{style:{fontSize:"10px",color:"#999"}},"\u25BC")),o("div",{key:"0",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...ol.map(_=>o("button",{key:_.id,style:J(_.id,_.style),title:_.shortcut?`${_.label} (${_.shortcut})`:_.label,"aria-label":_.label,"aria-pressed":String(v[_.id]??!1),onClick:k[_.id],onMouseEnter:()=>h(_.id),onMouseLeave:()=>h("")},_.text))),o("div",{key:"1",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px",alignItems:"center"}},o("select",{style:U,"aria-label":"Font size",value:y,onChange:_=>{let Z=_.target;C(Z.value)}},...il.map(_=>o("option",{key:_,value:_},sl[_])))),o("div",{key:"2",style:{display:"flex",gap:"2px",borderLeft:"1px solid var(--color-border, #ccc)",paddingLeft:"10px"}},...rl.map((_,Z)=>o("button",{key:String(Z),style:J(`align-${Z}`),title:_.label,"aria-label":_.label,onClick:()=>z(_.command),onMouseEnter:()=>h(`align-${Z}`),onMouseLeave:()=>h("")},_.text)))),o("div",{className:"word-processor__ruler",style:w,"aria-hidden":"true"},...I),o("main",{className:"word-processor__document-area",style:D,onClick:A},o("div",{className:"word-processor__page",style:R,contentEditable:"true",ref:f,onInput:W,suppressContentEditableWarning:!0},N)),o("div",{className:"word-processor__status-bar",style:F},o("span",null,"Page 1 of 1"),o("span",null,`${V} words`),o("span",null,"100%")))}var ll=["File","Edit","Selection","View","Go","Run","Terminal","Help"],Cr={File:[{label:"New File",action:"newFile"},{label:"Open",action:"open"},{label:"Save",action:"save"},{label:"Save As",action:"saveAs"}],Edit:[{label:"Undo",action:"undo"},{label:"Redo",action:"redo"},{label:"Cut",action:"cut"},{label:"Copy",action:"copy"},{label:"Paste",action:"paste"}],View:[{label:"Command Palette",action:"commandPalette"},{label:"Explorer",action:"explorer"},{label:"Search",action:"search"}]},Mr=[{name:"src",indent:0,isFolder:!0},{name:"components",indent:1,isFolder:!0,parent:"src"},{name:"App.ts",indent:2,isFolder:!1,parent:"components"},{name:"Header.ts",indent:2,isFolder:!1,parent:"components"},{name:"hooks",indent:1,isFolder:!0,parent:"src"},{name:"useAuth.ts",indent:2,isFolder:!1,parent:"hooks"},{name:"index.ts",indent:1,isFolder:!1,parent:"src"},{name:"main.ts",indent:1,isFolder:!1,parent:"src"},{name:"types.ts",indent:1,isFolder:!1,parent:"src"},{name:"package.json",indent:0,isFolder:!1},{name:"tsconfig.json",indent:0,isFolder:!1}],rn={"App.ts":['import { createElement, useState } from "specifyjs";',"","interface AppProps {"," title: string;"," version?: number;","}","","export function App(props: AppProps) {"," const [count, setCount] = useState(0);",""," const increment = () => {"," setCount((prev: number) => prev + 1);"," };",""," return createElement(",' "div",',' { className: "app" },',' createElement("h1", null, props.title),',' createElement("p", null, `Count: ${count}`),'," createElement(",' "button",'," { onClick: increment },",' "Increment",'," ),"," );","}"],"Header.ts":['import { createElement } from "specifyjs";',"","interface HeaderProps {"," title: string;"," subtitle?: string;","}","","export function Header(props: HeaderProps) {"," return createElement(",' "header",',' { className: "header" },',' createElement("h1", null, props.title),'," props.subtitle",' ? createElement("p", null, props.subtitle)'," : null,"," );","}"],"useAuth.ts":['import { useState, useCallback } from "specifyjs";',"","interface AuthState {"," user: string | null;"," isLoggedIn: boolean;","}","","export function useAuth() {"," const [auth, setAuth] = useState<AuthState>({"," user: null,"," isLoggedIn: false,"," });",""," const login = useCallback((username: string) => {"," setAuth({ user: username, isLoggedIn: true });"," }, []);",""," const logout = useCallback(() => {"," setAuth({ user: null, isLoggedIn: false });"," }, []);",""," return { ...auth, login, logout };","}"],"index.ts":['export { App } from "./components/App";','export { Header } from "./components/Header";','export { useAuth } from "./hooks/useAuth";'],"main.ts":['import { createElement, createRoot } from "specifyjs";','import { App } from "./components/App";',"","const root = createRoot(",' document.getElementById("root")!',");","","root.render("," createElement(App, {",' title: "My SpecifyJS App",'," version: 1,"," }),",");"],"types.ts":["export interface User {"," id: string;"," name: string;"," email: string;",' role: "admin" | "user" | "guest";',"}","","export interface Config {"," apiUrl: string;"," debug: boolean;"," maxRetries: number;","}","","export type EventHandler<T = void> = (event: T) => void;"],"package.json":["{",' "name": "specifyjs-app",',' "version": "1.0.0",',' "scripts": {',' "dev": "vite",',' "build": "tsc && vite build",',' "preview": "vite preview"'," }","}"],"tsconfig.json":["{",' "compilerOptions": {',' "target": "ES2020",',' "module": "ESNext",',' "strict": true,',' "jsx": "preserve"'," },",' "include": ["src"]',"}"]},Pr=rn["App.ts"],cl=new Set(["import","export","from","const","let","var","function","return","if","else","for","while","class","new","throw","try","catch","finally","typeof","instanceof","in","of","default","switch","case","break","continue","do","void","delete","yield","async","await"]),dl=new Set(["string","number","boolean","void","null","undefined","any","never","unknown","object","interface","type","enum"]),Er="#569cd6",ul="#ce9178",fl="#4ec9b0",pl="#6a9955",ml="#dcdcaa",on="#d4d4d4",gl="#d4d4d4",hl="#b5cea8";function bl(e){if(!e.trim())return[{text:"\xA0",color:on}];let t=[],n=0;for(;n<e.length;){if(e[n]==="/"&&e[n+1]==="/"){t.push({text:e.slice(n),color:pl});break}if(e[n]==='"'||e[n]==="'"||e[n]==="`"){let r=e[n],i=n+1;for(;i<e.length&&e[i]!==r;)e[i]==="\\"&&i++,i++;i=Math.min(i+1,e.length),t.push({text:e.slice(n,i),color:ul}),n=i;continue}if(/[0-9]/.test(e[n])&&(n===0||/[\s(,=:[\]{}+\-*/]/.test(e[n-1]))){let r=n;for(;r<e.length&&/[0-9.]/.test(e[r]);)r++;t.push({text:e.slice(n,r),color:hl}),n=r;continue}if(/[a-zA-Z_$]/.test(e[n])){let r=n;for(;r<e.length&&/[a-zA-Z0-9_$]/.test(e[r]);)r++;let i=e.slice(n,r),s=r;for(;s<e.length&&e[s]===" ";)s++;let l=s<e.length&&e[s]==="(",a=on;cl.has(i)?a=Er:dl.has(i)?a=fl:l?a=ml:(i==="true"||i==="false")&&(a=Er),t.push({text:i,color:a}),n=r;continue}if(e[n]===" "||e[n]===" "){let r=n;for(;r<e.length&&(e[r]===" "||e[r]===" ");)r++;t.push({text:e.slice(n,r),color:on}),n=r;continue}t.push({text:e[n],color:gl}),n++}return t}function gt(e){let[t,n]=X("App.ts"),[r,i]=X({src:!0,components:!0,hooks:!0}),[s,l]=X(-1),[a,d]=X(Pr.length),u=ie(null),h=M(O=>{n(O);let _=rn[O];_&&d(_.length)},[]),p=M(O=>{i(_=>{let Z={},Q=Object.keys(_);for(let oe=0;oe<Q.length;oe++)Z[Q[oe]]=_[Q[oe]];return Z[O]=!_[O],Z})},[]),c=M(O=>{l(_=>_===O?-1:O)},[]),x=M(O=>{switch(O){case"undo":document.execCommand("undo",!1);break;case"redo":document.execCommand("redo",!1);break;case"cut":document.execCommand("cut",!1);break;case"copy":document.execCommand("copy",!1);break;case"paste":document.execCommand("paste",!1);break;case"newFile":u.current&&(u.current.textContent="",d(1));break;default:break}l(-1),u.current&&u.current.focus()},[]),m=M(()=>{if(u.current){let _=(u.current.textContent??"").split(`
8
+ `);d(Math.max(_.length,1))}},[]),y=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Segoe UI", Roboto, Arial, sans-serif',fontSize:"13px",color:"#cccccc",backgroundColor:"#1e1e1e",overflow:"hidden"}),[]),g={height:"30px",backgroundColor:"#323233",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",color:"#999",flexShrink:"0",borderBottom:"1px solid var(--color-border, #252526)"},f={height:"28px",backgroundColor:"#3c3c3c",display:"flex",alignItems:"center",padding:"0 8px",gap:"2px",flexShrink:"0",position:"relative"},b={padding:"3px 8px",fontSize:"12px",color:"#cccccc",cursor:"pointer",borderRadius:"3px",backgroundColor:"transparent",border:"none",position:"relative"},S={...b,backgroundColor:"rgba(255,255,255,0.1)"},E={position:"absolute",top:"100%",left:"0",minWidth:"180px",backgroundColor:"#2d2d2d",border:"1px solid #454545",borderRadius:"4px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",padding:"4px 0",zIndex:"1000"},k={display:"block",width:"100%",padding:"6px 16px",fontSize:"12px",color:"#cccccc",backgroundColor:"transparent",border:"none",textAlign:"left",cursor:"pointer",transition:"background 0.1s"},v={flex:"1",display:"flex",overflow:"hidden"},z={width:"220px",backgroundColor:"#252526",borderRight:"none",display:"flex",flexDirection:"column",flexShrink:"0",overflowY:"auto"},C={width:"1px",backgroundColor:"#007acc",cursor:"col-resize",flexShrink:"0",opacity:"0.4",transition:"opacity 0.2s"},$={padding:"8px 12px",fontSize:"11px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#bbbbbb"},P=(O,_,Z)=>({padding:"3px 8px",paddingLeft:`${12+O*16}px`,fontSize:"13px",cursor:"pointer",color:_?"#cccccc":"#d4d4d4",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",borderRadius:"3px",margin:"0 4px",transition:"background-color 0.1s",backgroundColor:Z?"rgba(255,255,255,0.08)":"transparent"}),W={flex:"1",display:"flex",flexDirection:"column",overflow:"hidden"},A={height:"35px",backgroundColor:"#252526",display:"flex",alignItems:"center",flexShrink:"0"},H={padding:"0 16px",height:"35px",lineHeight:"35px",backgroundColor:"#1e1e1e",color:"#ffffff",fontSize:"13px",cursor:"pointer",border:"none",borderBottom:"2px solid #007acc",boxSizing:"border-box"},L={flex:"1",display:"flex",overflow:"auto",backgroundColor:"#1e1e1e",fontFamily:'"Cascadia Code", "Fira Code", "Consolas", monospace',fontSize:"13px",lineHeight:"20px"},T={padding:"8px 0",textAlign:"right",color:"#858585",userSelect:"none",minWidth:"48px",paddingRight:"12px",paddingLeft:"12px",flexShrink:"0"},w={padding:"8px 0",flex:"1",whiteSpace:"pre",overflowX:"auto",outline:"none",color:"#d4d4d4"},D={width:"60px",backgroundColor:"#1e1e1e",borderLeft:"1px solid var(--color-border, #252526)",flexShrink:"0",padding:"8px 4px",display:"flex",flexDirection:"column",gap:"2px",position:"relative"},R={height:"22px",backgroundColor:"#007acc",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 12px",fontSize:"12px",color:"#ffffff",flexShrink:"0"},F={cursor:"pointer",padding:"0 6px",borderRadius:"3px",transition:"background-color 0.15s"},I=8,N=30,B=rn[t]??Pr,V=B.map((O,_)=>{let Z=bl(O),Q=[],oe=0;for(let j of Z)Q.push(o("span",{key:String(oe++),style:{color:j.color}},j.text));return o("div",{key:String(_),style:{minHeight:"20px"}},...Q)}),G=Math.max(a,B.length),K=[];for(let O=0;O<G;O++)K.push(o("div",{key:String(O)},String(O+1)));let ee=O=>{if(!O.parent)return!0;if(!r[O.parent])return!1;let _=Mr.find(Z=>Z.name===O.parent&&Z.isFolder);return _?ee(_):!0},J=ll.map((O,_)=>{let Z=[O],Q=s===_;return Q&&Cr[O]&&Z.push(o("div",{key:"dropdown",style:E,className:"ide__menu-dropdown"},...Cr[O].map((oe,j)=>o("button",{key:String(j),style:k,onClick:te=>{te.stopPropagation(),x(oe.action)},role:"menuitem"},oe.label)))),o("button",{key:String(_),style:Q?S:b,role:"menuitem","aria-label":O,onClick:()=>c(_)},...Z)}),U=Mr.map((O,_)=>{if(!ee(O))return null;let Z=!O.isFolder&&O.name===t,Q=O.isFolder?r[O.name]?"\u{1F4C2} ":"\u{1F4C1} ":"\u{1F4C4} ";return o("div",{key:String(_),style:P(O.indent,O.isFolder,Z),onClick:O.isFolder?()=>p(O.name):()=>h(O.name)},Q,O.name)}).filter(O=>O!==null);return o("div",{className:`ide ${e.className??""}`.trim(),style:y},o("div",{className:"ide__title-bar",style:g},"SpecifyJS IDE"),o("div",{className:"ide__menu-bar",style:f,role:"menubar"},...J),o("div",{style:v},o("nav",{className:"ide__sidebar",style:z,"aria-label":"File explorer"},o("div",{style:$},"Explorer"),...U),o("div",{style:C}),o("div",{style:W},o("div",{style:A},o("button",{style:H,"aria-label":t},t)),o("div",{style:L},o("div",{style:T,"aria-hidden":"true"},...K),o("code",{style:w,contentEditable:"true",ref:u,onInput:m,suppressContentEditableWarning:!0},...V))),o("div",{className:"ide__minimap",style:D,"aria-hidden":"true"},o("div",{style:{position:"absolute",top:`${I}px`,left:"0",right:"0",height:`${N}px`,backgroundColor:"rgba(100, 100, 200, 0.15)",border:"1px solid rgba(100, 100, 200, 0.3)",borderRadius:"2px",pointerEvents:"none"}}),...B.map((O,_)=>o("div",{key:String(_),style:{height:"2px",backgroundColor:O.trim()?"#555555":"transparent",borderRadius:"1px",width:`${Math.min(100,O.length*2)}%`}})))),o("div",{className:"ide__status-bar",style:R},o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:F},"\u2387 main"),o("span",{style:F},"0 errors"),o("span",{style:F},"0 warnings")),o("div",{style:{display:"flex",gap:"16px"}},o("span",{style:F},"Ln 1, Col 1"),o("span",{style:F},"UTF-8"),o("span",{style:F},"TypeScript"))))}var xl=[{symbol:"AAPL",price:189.42,change:1.23,volume:523e5,spark:[186,187,188,187,189]},{symbol:"GOOGL",price:141.8,change:-.87,volume:231e5,spark:[143,142,141,142,141]},{symbol:"MSFT",price:378.91,change:2.45,volume:187e5,spark:[375,376,378,377,379]},{symbol:"AMZN",price:185.63,change:-1.12,volume:314e5,spark:[187,186,186,185,185]},{symbol:"TSLA",price:248.5,change:3.78,volume:672e5,spark:[244,245,247,246,249]},{symbol:"NVDA",price:875.3,change:12.5,volume:418e5,spark:[860,865,870,868,876]}],$r=[{price:189.4,qty:1200},{price:189.38,qty:3400},{price:189.35,qty:800},{price:189.32,qty:5600},{price:189.3,qty:2100},{price:189.28,qty:4300}],Rr=[{price:189.44,qty:900},{price:189.47,qty:2200},{price:189.5,qty:1500},{price:189.53,qty:3800},{price:189.55,qty:1100},{price:189.58,qty:2700}],zr=[{symbol:"AAPL",qty:100,avgPrice:185.2,currentPrice:189.42,pnl:422},{symbol:"MSFT",qty:50,avgPrice:382.1,currentPrice:378.91,pnl:-159.5},{symbol:"NVDA",qty:25,avgPrice:850,currentPrice:875.3,pnl:632.5}],yl=[{time:"14:32:01",symbol:"AAPL",side:"BUY",qty:50,price:189.42},{time:"14:31:45",symbol:"MSFT",side:"SELL",qty:25,price:378.95},{time:"14:30:22",symbol:"TSLA",side:"BUY",qty:100,price:247.8},{time:"14:29:58",symbol:"NVDA",side:"BUY",qty:10,price:874.5},{time:"14:28:33",symbol:"GOOGL",side:"SELL",qty:75,price:142.1}],Sl=[185.2,186.1,185.8,187.5,188.2,187.9,186.5,187.8,188.4,189.1,188.6,187.2,188.5,189.8,189.2,188.9,189.5,190.1,189.4,188.8,189.6,190.3,189.9,189.42],Tr=[{price:189.4,volume:1200},{price:189.35,volume:3400},{price:189.3,volume:2800},{price:189.25,volume:5100},{price:189.2,volume:4200}],Ir=[{price:189.45,volume:900},{price:189.5,volume:2600},{price:189.55,volume:1800},{price:189.6,volume:4400},{price:189.65,volume:3100}],Dr=["09:30","10:00","10:30","11:00","11:30","12:00"];function vl(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Qe(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function Ee(e){return e.toFixed(2)}var Ue={backgroundColor:"#1a1a2e",borderRadius:"4px",padding:"12px",border:"1px solid #2a2a4a",overflow:"auto",display:"flex",flexDirection:"column"},je={fontSize:"12px",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.5px",color:"#8888aa",marginBottom:"8px",flexShrink:"0"},ht={width:"100%",borderCollapse:"collapse",fontSize:"12px"},ye={textAlign:"left",padding:"4px 6px",borderBottom:"1px solid #2a2a4a",color:"#8888aa",fontWeight:"600",fontSize:"11px"},Se={padding:"3px 6px",borderBottom:"1px solid #16162a",color:"#ccccdd",fontSize:"12px"},bt={cursor:"default",transition:"background-color 0.1s"};function wl(e,t){let i=Math.min(...e),l=Math.max(...e)-i||1,a=e.map((u,h)=>{let p=h/(e.length-1)*40,c=14-(u-i)/l*14;return`${p.toFixed(1)},${c.toFixed(1)}`}).join(" ");return o("svg",{viewBox:"0 0 40 14",style:{width:"40px",height:"14px",display:"inline-block",verticalAlign:"middle",marginLeft:"4px"},"aria-hidden":"true"},o("polyline",{points:a,fill:"none",stroke:t?"#00c853":"#ff1744",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))}function kl(e,t){let u=Math.min(...e),h=Math.max(...e),p=h-u||1,c=310/(e.length-1),x=e.map((v,z)=>{let C=40+z*c,$=15+(1-(v-u)/p)*120;return{x:C,y:$}}),m=x.map(v=>`${v.x.toFixed(1)},${v.y.toFixed(1)}`).join(" "),y="M40,135 "+x.map(v=>`L${v.x.toFixed(1)},${v.y.toFixed(1)}`).join(" ")+` L${x[x.length-1].x.toFixed(1)},135 Z`,g=[];for(let v=1;v<e.length;v++){let z=e[v]>=e[v-1]?"#00c853":"#ff1744";g.push(o("line",{key:String(v),x1:String(x[v-1].x.toFixed(1)),y1:String(x[v-1].y.toFixed(1)),x2:String(x[v].x.toFixed(1)),y2:String(x[v].y.toFixed(1)),stroke:z,strokeWidth:"2",strokeLinecap:"round"}))}let f=[];for(let v=0;v<5;v++){let z=15+v/4*120,C=h-v/4*p;f.push(o("line",{key:`g${v}`,x1:String(40),y1:String(z.toFixed(1)),x2:String(350),y2:String(z.toFixed(1)),stroke:"#2a2a4a",strokeWidth:"0.5",strokeDasharray:"3,3"})),f.push(o("text",{key:`yl${v}`,x:String(36),y:String((z+3).toFixed(1)),fill:"#6666aa",fontSize:"8",textAnchor:"end",fontFamily:"monospace"},Ee(C)))}let b=[],S=Math.min(Dr.length,e.length),E=(e.length-1)/(S-1);for(let v=0;v<S;v++){let C=40+Math.round(v*E)*c;b.push(o("text",{key:`tl${v}`,x:String(C.toFixed(1)),y:String(156),fill:"#6666aa",fontSize:"8",textAnchor:"middle",fontFamily:"monospace"},Dr[v]))}let k="chartGrad";return o("div",{style:Ue},o("div",{style:je},"AAPL ",o("span",{style:{color:"#00c853",fontSize:"14px",fontWeight:"700"}},`$${Ee(t)}`),o("span",{style:{color:"#00c853",fontSize:"11px",marginLeft:"8px"}},"+1.23%")),o("svg",{viewBox:"0 0 360 160",style:{width:"100%",flex:"1",minHeight:"0"},"aria-label":"Price chart",role:"img"},o("defs",null,o("linearGradient",{id:k,x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{offset:"0%",stopColor:"#00c853",stopOpacity:"0.3"}),o("stop",{offset:"100%",stopColor:"#00c853",stopOpacity:"0.02"}))),o("path",{d:y,fill:`url(#${k})`}),...f,...b,...g,o("line",{x1:String(40),y1:String((15+(1-(t-u)/p)*120).toFixed(1)),x2:String(350),y2:String((15+(1-(t-u)/p)*120).toFixed(1)),stroke:"#00c853",strokeWidth:"0.5",strokeDasharray:"4,2",opacity:"0.6"})))}function Cl(){let e=Math.max(...$r.map(t=>t.qty),...Rr.map(t=>t.qty));return o("div",{style:Ue},o("div",{style:je},"Order Book"),o("table",{style:ht},o("thead",null,o("tr",null,o("th",{style:ye},"Bid Price"),o("th",{style:ye},"Qty"),o("th",{style:ye},"Ask Price"),o("th",{style:ye},"Qty"))),o("tbody",null,...$r.map((t,n)=>{let r=Rr[n],i=t.qty/e*.25,s=(r?.qty??0)/e*.25;return o("tr",{key:String(n),style:bt},o("td",{style:{...Se,color:"#00c853",backgroundColor:`rgba(0,200,83,${i.toFixed(3)})`,fontFamily:"monospace"}},Ee(t.price)),o("td",{style:{...Se,backgroundColor:`rgba(0,200,83,${(i*.5).toFixed(3)})`,fontFamily:"monospace"}},Qe(t.qty)),o("td",{style:{...Se,color:"#ff1744",backgroundColor:`rgba(255,23,68,${s.toFixed(3)})`,fontFamily:"monospace"}},r?Ee(r.price):""),o("td",{style:{...Se,backgroundColor:`rgba(255,23,68,${(s*.5).toFixed(3)})`,fontFamily:"monospace"}},r?Qe(r.qty):""))}))))}function Ml(e){return o("div",{style:Ue},o("div",{style:je},"Watchlist"),o("table",{style:ht},o("thead",null,o("tr",null,o("th",{style:ye},"Symbol"),o("th",{style:ye},"Price"),o("th",{style:ye},"Chg%"),o("th",{style:ye},"Volume"))),o("tbody",null,...xl.map((t,n)=>{let r=t.price+(n===0?e:0),i=t.change>=0;return o("tr",{key:String(n),style:bt},o("td",{style:{...Se,fontWeight:"600",color:"#ffffff"}},t.symbol,wl(t.spark,i)),o("td",{style:{...Se,fontFamily:"monospace"}},Ee(r)),o("td",{style:{...Se,color:i?"#00c853":"#ff1744",fontWeight:"600"}},`${i?"+":""}${Ee(t.change)}%`),o("td",{style:{...Se,fontFamily:"monospace",color:"#8888aa"}},vl(t.volume)))}))))}function Pl(){let e=zr.reduce((n,r)=>n+r.pnl,0),t=e>=0;return o("div",{style:Ue},o("div",{style:je},"Positions",o("span",{style:{marginLeft:"12px",color:t?"#00c853":"#ff1744",fontWeight:"700",fontSize:"12px"}},`${t?"+":""}$${Ee(e)}`)),o("table",{style:ht},o("thead",null,o("tr",null,o("th",{style:ye},"Symbol"),o("th",{style:ye},"Qty"),o("th",{style:ye},"Avg"),o("th",{style:ye},"P&L"))),o("tbody",null,...zr.map((n,r)=>{let i=n.pnl>=0;return o("tr",{key:String(r),style:{...bt,backgroundColor:i?"rgba(0,200,83,0.04)":"rgba(255,23,68,0.04)"}},o("td",{style:{...Se,fontWeight:"600",color:"#ffffff"}},n.symbol),o("td",{style:{...Se,fontFamily:"monospace"}},String(n.qty)),o("td",{style:{...Se,fontFamily:"monospace"}},Ee(n.avgPrice)),o("td",{style:{...Se,color:i?"#00c853":"#ff1744",fontWeight:"700",fontFamily:"monospace"}},`${i?"+":""}$${Ee(n.pnl)}`))}))))}function El(){return o("div",{style:Ue},o("div",{style:je},"Recent Trades"),o("table",{style:ht},o("thead",null,o("tr",null,o("th",{style:ye},"Time"),o("th",{style:ye},"Sym"),o("th",{style:ye},"Side"),o("th",{style:ye},"Qty"),o("th",{style:ye},"Price"))),o("tbody",null,...yl.map((e,t)=>{let n=e.side==="BUY";return o("tr",{key:String(t),style:bt},o("td",{style:{...Se,color:"#8888aa",fontFamily:"monospace"}},e.time),o("td",{style:{...Se,fontWeight:"600",color:"#ffffff"}},e.symbol),o("td",{style:{...Se,color:n?"#00c853":"#ff1744",fontWeight:"600"}},e.side),o("td",{style:{...Se,fontFamily:"monospace"}},Qe(e.qty)),o("td",{style:{...Se,fontFamily:"monospace"}},Ee(e.price)))}))))}function $l(){let e=Math.max(...Tr.map(n=>n.volume),...Ir.map(n=>n.volume)),t="16px";return o("div",{style:Ue},o("div",{style:je},"Market Depth"),o("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"2px",justifyContent:"center"}},...Tr.map((n,r)=>o("div",{key:`b${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Ee(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#00c853",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Qe(n.volume)))),o("div",{style:{height:"1px",backgroundColor:"#2a2a4a",margin:"4px 0"}}),...Ir.map((n,r)=>o("div",{key:`a${r}`,style:{display:"flex",alignItems:"center",gap:"6px"}},o("span",{style:{width:"52px",fontSize:"11px",color:"#8888aa",textAlign:"right",fontFamily:"monospace"}},Ee(n.price)),o("div",{style:{height:t,width:`${n.volume/e*100}%`,backgroundColor:"#ff1744",opacity:"0.6",borderRadius:"2px",maxWidth:"60%",transition:"width 0.3s"}}),o("span",{style:{fontSize:"11px",color:"#ccccdd",fontFamily:"monospace"}},Qe(n.volume))))))}function xt(e){let[t,n]=X(0),[r,i]=X("--:--:--"),[s,l]=X(!0);se(()=>{let x=setInterval(()=>{n(m=>{let y=(Math.random()-.5)*.5;return Math.round(y*100)/100})},2e3);return()=>clearInterval(x)},[]),se(()=>{let x=()=>{let y=new Date,g=String(y.getHours()).padStart(2,"0"),f=String(y.getMinutes()).padStart(2,"0"),b=String(y.getSeconds()).padStart(2,"0");i(`${g}:${f}:${b}`)};x();let m=setInterval(x,1e3);return()=>clearInterval(m)},[]),se(()=>{let x=setInterval(()=>{l(m=>!m)},800);return()=>clearInterval(x)},[]);let a=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'"Inter", "Segoe UI", Roboto, sans-serif',fontSize:"13px",color:"#ccccdd",backgroundColor:"#0d0d1a",overflow:"hidden"}),[]),d={height:"40px",backgroundColor:"#12122a",borderBottom:"1px solid #2a2a4a",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",flexShrink:"0"},u={fontSize:"14px",fontWeight:"700",color:"#ffffff",letterSpacing:"0.5px",display:"flex",alignItems:"center",gap:"8px"},h={flex:"1",display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridTemplateRows:"1fr 1fr",gap:"8px",padding:"8px",overflow:"hidden"},p=189.42+t,c={width:"8px",height:"8px",borderRadius:"50%",backgroundColor:"#00c853",display:"inline-block",marginRight:"4px",opacity:s?"1":"0.3",transition:"opacity 0.3s"};return o("div",{className:`trading-dashboard ${e.className??""}`.trim(),style:a},o("header",{className:"trading-dashboard__header",style:d},o("span",{style:u},"SpecifyJS Trading Platform",o("span",{style:{display:"flex",alignItems:"center",fontSize:"11px",color:"#00c853",fontWeight:"600",marginLeft:"8px"}},o("span",{style:c}),"LIVE")),o("div",{style:{display:"flex",alignItems:"center",gap:"16px",fontSize:"12px"}},o("span",{style:{color:"#ffffff",fontFamily:"monospace",fontWeight:"600",fontSize:"13px"}},r),o("span",{style:{color:"#8888aa"}},"Account: SJS-28401"),o("span",{style:{color:"#00c853"}},"Balance: $124,582.30"),o("span",{style:{color:"#8888aa"}},"Status: Connected"))),o("div",{className:"trading-dashboard__grid",style:h},kl(Sl,p),Cl(),Ml(t),Pl(),El(),$l()))}var Rl=28,zl=5e3;function Tl(e){let{toasts:t,onDismiss:n}=e;if(t.length===0)return null;let r={position:"absolute",top:"8px",right:"8px",zIndex:"9999",display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none",maxWidth:"320px"},i=t.map(s=>{let l="rgba(50, 50, 50, 0.95)",a="#555";return s.severity==="warning"?(l="rgba(60, 40, 10, 0.95)",a="#f39c12"):s.severity==="error"&&(l="rgba(60, 10, 10, 0.95)",a="#e74c3c"),o("div",{key:String(s.id),className:`unity-desktop__toast unity-desktop__toast--${s.severity}`,style:{backgroundColor:l,border:`1px solid ${a}`,borderRadius:"6px",padding:"10px 14px",color:"#ffffff",fontSize:"13px",boxShadow:"0 4px 12px rgba(0,0,0,0.3)",pointerEvents:"auto",cursor:"pointer",transition:"opacity 200ms ease"},onClick:()=>n(s.id),role:"alert","aria-live":"polite"},s.message)});return o("div",{className:"unity-desktop__toast-container",style:r,"aria-label":"Notifications"},...i)}function Il(e){let t={padding:"16px",fontSize:"13px",color:"var(--color-text, #333)",height:"100%",overflow:"auto"};switch(e){case"Files":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"Home"),o("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},...["\u{1F4C1} Documents","\u{1F4C1} Downloads","\u{1F4C1} Music","\u{1F4C1} Pictures","\u{1F4C1} Videos","\u{1F4C4} readme.txt"].map(n=>o("span",{style:{cursor:"pointer"}},n))));case"Terminal":return o("div",{style:{...t,backgroundColor:"#1a1a2e",color:"#00ff41",fontFamily:"monospace",fontSize:"12px"}},o("div",null,"$ whoami"),o("div",null,"operator"),o("div",null,"$ uname -a"),o("div",null,"Linux specifyjs 6.1.0 #1 SMP x86_64 GNU/Linux"),o("div",null,"$ _"));case"Browser":return o("div",{style:t},o("div",{style:{padding:"6px 10px",backgroundColor:"#f1f5f9",borderRadius:"4px",marginBottom:"12px",fontSize:"12px",color:"#64748b"}},"https://specifyjs.asymmetric-effort.com"),o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},"Web page content area"));case"Mail":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"8px"}},"Inbox (3)"),...["Build passed \u2014 CI/CD Pipeline","PR Review: feat/unity-desktop","Weekly sync notes"].map(n=>o("div",{style:{padding:"8px",borderBottom:"1px solid #e2e8f0",cursor:"pointer"}},n)));case"Settings":return o("div",{style:t},o("div",{style:{fontWeight:"600",marginBottom:"12px"}},"System Settings"),...["Appearance","Network","Sound","Power","Users","About"].map(n=>o("div",{style:{padding:"8px 0",borderBottom:"1px solid #e2e8f0"}},n)));case"Word Processor":return o(mt,null);case"IDE":return o(gt,null);case"Trading":return o(xt,null);default:return o("div",{style:t},o("div",{style:{textAlign:"center",padding:"32px",color:"#94a3b8"}},`${e} application content`))}}function Dl(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:l}=e,[a,d]=X([]),[u,h]=X([]),[p,c]=X(!1),[x,m]=X(!1),[y,g]=X(null),[f,b]=X({x:0,y:0}),[S,E]=X(null),k=M(()=>{c(j=>!j)},[]),v=M(j=>{h(te=>te.filter(re=>re.id!==j))},[]);se(()=>{if(u.length===0)return;let j=u[0],te=Date.now()-j.timestamp,re=Math.max(0,zl-te),le=setTimeout(()=>{h(ne=>ne.filter(ce=>ce.id!==j.id))},re);return()=>clearTimeout(le)},[u]);let z=ie(t);z.current=t;let C=ie(r);C.current=r;let $=M(j=>{d(te=>{if(te.find(ae=>ae.id===j)){let ae=Math.max(...te.map(ue=>ue.zIndex))+1;return te.map(ue=>ue.id===j?{...ue,focused:!0,zIndex:ae,windowState:ue.windowState==="minimized"?"normal":ue.windowState}:{...ue,focused:!1})}let ne=z.current.find(ae=>ae.id===j);if(!ne)return te;let ce=te.length>0?Math.max(...te.map(ae=>ae.zIndex))+1:1,de={id:ne.id,title:ne.label,icon:ne.icon,x:60+te.length*30,y:40+te.length*30,width:600,height:400,zIndex:ce,focused:!0,windowState:"normal"};return[...te.map(ae=>({...ae,focused:!1})),de]}),C.current&&C.current(j)},[]),P=t.map(j=>{let te=a.some(re=>re.id===j.id);return{id:j.id,icon:j.icon,label:j.label,active:te}}),W=a.find(j=>j.focused),A=W?W.title:void 0,H=M(()=>{m(!0)},[]),L=M(()=>{m(!1)},[]),T=M((j,te)=>{g(j),b(te)},[]),w=M(()=>{g(null)},[]),D=M(()=>{},[]),R=M(()=>{i&&i()},[i]),F=[];n&&(F.push({label:n.name,icon:void 0,onClick:D,divider:!1}),F.push({label:"",icon:void 0,onClick:D,divider:!0})),F.push({label:"Lock",icon:void 0,onClick:H,divider:!1}),F.push({label:"Logout",icon:void 0,onClick:R,divider:!1});let I=q(()=>({width:"100%",height:"100%",minHeight:"500px",display:"flex",flexDirection:"column",fontFamily:'Ubuntu, "Segoe UI", sans-serif',fontSize:"13px",color:s==="dark"?"#ffffff":"#1a1a1a",overflow:"hidden",position:"relative"}),[s]),N={display:"flex",flex:"1",overflow:"hidden"},B={display:"flex",flexDirection:"column",height:"100%",backgroundColor:s==="dark"?"var(--dock-bg, rgba(0, 0, 0, 0.7))":"var(--dock-bg, rgba(200, 200, 200, 0.9))",borderRight:s==="dark"?"1px solid rgba(255, 255, 255, 0.1)":"1px solid rgba(0, 0, 0, 0.1)",flexShrink:"0"},V={width:"100%",height:"100%",position:"relative"},G=o(Qt,{activeAppName:A,activitiesButton:{label:"Activities",onClick:k},clockFormat:"24h",showSeconds:!0,showDate:!0,user:n?{name:n.name,avatar:n.avatar}:void 0,userMenuItems:F.length>0?F:void 0,height:Rl}),K=o(en,{items:P,orientation:"vertical",position:"left",iconSize:36,onItemClick:$,onItemContextMenu:T}),ee=o(Tl,{toasts:u,onDismiss:v}),J=a.filter(j=>j.windowState!=="minimized").map(j=>o(Je,{key:j.id,id:j.id,title:j.title,icon:j.icon,defaultPosition:{x:j.x,y:j.y},defaultSize:{width:j.width,height:j.height},zIndex:j.zIndex,focused:j.focused,windowState:j.windowState,onClose:()=>{d(te=>te.filter(re=>re.id!==j.id))},onFocus:()=>{d(te=>{let re=Math.max(...te.map(le=>le.zIndex))+1;return te.map(le=>le.id===j.id?{...le,focused:!0,zIndex:re}:{...le,focused:!1})})},onMinimize:()=>{d(te=>te.map(re=>re.id===j.id?{...re,windowState:"minimized"}:re))},onMaximize:()=>{d(te=>te.map(re=>re.id===j.id?{...re,windowState:re.windowState==="maximized"?"normal":"maximized"}:re))}},Il(j.title))),Y=[];l&&Y.push(l),Y.push(...J),Y.push(ee);let U=o(tn,{backgroundColor:s==="dark"?"#2c001e":"#e8e0e4",backgroundGradient:s==="dark"?"linear-gradient(135deg, #2c001e 0%, #5e2750 50%, #2c001e 100%)":"linear-gradient(135deg, #e8e0e4 0%, #d4c4d0 50%, #e8e0e4 100%)"},o("div",{className:"unity-desktop__workspace",style:V},...Y)),O=p?o("div",{style:{position:"absolute",inset:"0",zIndex:"100",backgroundColor:"rgba(0, 0, 0, 0.85)",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:"24px",padding:"48px",alignContent:"start",overflowY:"auto"},onClick:k},...t.map(j=>o("button",{key:j.id,style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",color:"#ffffff",cursor:"pointer",padding:"12px",borderRadius:"8px",fontSize:"12px"},onClick:te=>{te.stopPropagation(),c(!1),$(j.id)}},o("span",{style:{fontSize:"32px",display:"block"}},j.icon),o("span",null,j.label)))):null,_=x?o("div",{className:"unity-desktop__lock-overlay",style:{position:"absolute",inset:"0",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#ffffff"},onClick:L},o("div",{style:{fontSize:"64px",marginBottom:"16px"}},"\u{1F512}"),o("div",{style:{fontSize:"24px",fontWeight:"600",marginBottom:"8px"}},"Locked"),o("div",{style:{fontSize:"14px",opacity:"0.7"}},"Click to unlock")):null,Z=y?o("div",{className:"unity-desktop__context-menu-backdrop",style:{position:"absolute",inset:"0",zIndex:"9000"},onClick:w},o("div",{className:"unity-desktop__context-menu",style:{position:"absolute",top:`${f.y}px`,left:`${f.x}px`,backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"6px",padding:"4px 0",minWidth:"160px",boxShadow:"0 4px 12px rgba(0,0,0,0.4)",zIndex:"9001",color:"#ffffff",fontSize:"13px"},onClick:j=>j.stopPropagation()},o("div",{style:{padding:"6px 14px",fontWeight:"600",borderBottom:"1px solid #444",marginBottom:"4px"}},t.find(j=>j.id===y)?.label||y),o("div",{style:{padding:"6px 14px",cursor:"pointer"},onClick:()=>{E(y),g(null)},role:"menuitem"},"About"))):null,Q=S?t.find(j=>j.id===S):null,oe=Q?o("div",{className:"unity-desktop__about-backdrop",style:{position:"absolute",inset:"0",zIndex:"9500",backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center"},onClick:()=>E(null)},o("div",{style:{backgroundColor:"#2d2d2d",border:"1px solid #555",borderRadius:"8px",padding:"24px",minWidth:"280px",color:"#ffffff",textAlign:"center"},onClick:j=>j.stopPropagation()},o("div",{style:{fontSize:"18px",fontWeight:"600",marginBottom:"8px"}},Q.label),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"SpecifyJS Demo App"),o("div",{style:{fontSize:"13px",marginBottom:"4px",color:"#aaa"}},"MIT License"),o("div",{style:{fontSize:"13px",color:"#aaa"}},"v0.2.47"),o("button",{style:{marginTop:"16px",padding:"6px 16px",border:"1px solid #555",borderRadius:"4px",backgroundColor:"#444",color:"#fff",cursor:"pointer"},onClick:()=>E(null)},"Close"))):null;return o("div",{className:"unity-desktop",style:I,"data-theme":s},o("div",{className:"unity-desktop__top-panel",style:{flexShrink:"0",zIndex:"10"}},G),o("div",{style:N},o("div",{className:"unity-desktop__dock",style:B},K),o("main",{className:"unity-desktop__desktop",style:{flex:"1",position:"relative"}},U,O)),Z,oe,_)}function Ar(e){let{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s="dark",children:l}=e;return o(Kt,{onWindowOpen:r},o(Dl,{apps:t,user:n,onAppOpen:r,onLogout:i,theme:s,children:l}))}function Lr(e){let{id:t,title:n,icon:r,defaultPosition:i,defaultSize:s,minSize:l,resizable:a=!0,onClose:d,children:u}=e,h=Zt(),p=q(()=>h.windows.find(b=>b.id===t),[h.windows,t]);if(!p)return h.openWindow({id:t,title:n,icon:r,position:i,size:s}),null;let c=M(()=>{h.closeWindow(t),d&&d()},[h,t,d]),x=M(()=>{h.focusWindow(t)},[h,t]),m=M(b=>{h.moveWindow(t,b)},[h,t]),y=M(b=>{h.resizeWindow(t,b)},[h,t]),g=M(()=>{h.minimizeWindow(t)},[h,t]),f=M(()=>{p&&p.windowState==="maximized"?h.restoreWindow(t):h.maximizeWindow(t)},[h,t,p]);return o(Je,{id:t,title:n,icon:r,defaultPosition:p.position,defaultSize:p.size,minSize:l,resizable:a,windowState:p.windowState,focused:p.focused,zIndex:p.zIndex,onClose:c,onFocus:x,onMove:m,onResize:y,onMinimize:g,onMaximize:f,children:u})}var Fr={sm:{padding:"3px 10px",fontSize:"12px",borderRadius:"4px"},md:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px"},lg:{padding:"8px 20px",fontSize:"15px",borderRadius:"6px"}},Wr={primary:{bg:"#3b82f6",color:"white",border:"#3b82f6"},secondary:{bg:"#f8fafc",color:"#0f172a",border:"#d1d5db"},outline:{bg:"transparent",color:"#0f172a",border:"#d1d5db"},ghost:{bg:"transparent",color:"#0f172a",border:"transparent"},danger:{bg:"#ef4444",color:"white",border:"#ef4444"}};function Nr(e){let{children:t,onClick:n,variant:r="secondary",size:i="md",disabled:s=!1,fullWidth:l=!1,type:a="button",className:d,style:u,ariaLabel:h,active:p=!1}=e,c=q(()=>{let x=Fr[i]??Fr.md,m=Wr[r]??Wr.secondary,y={padding:x.padding,fontSize:x.fontSize,borderRadius:x.borderRadius,border:`1px solid ${m.border}`,backgroundColor:p?"#3b82f6":m.bg,color:p?"white":m.color,cursor:s?"default":"pointer",fontFamily:"inherit",lineHeight:"1.4",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"4px",transition:"background-color 0.15s, opacity 0.15s",opacity:s?"0.5":"1"};return l&&(y.width="100%"),u&&Object.assign(y,u),y},[r,i,s,l,p,u]);return o("button",{type:a,onClick:s?void 0:n,disabled:s,className:d,style:c,"aria-label":h,"aria-pressed":p?"true":void 0},t)}var Al=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Xe=Math.PI/180;function Ll(e,t,n,r,i,s,l,a,d,u){let h=Math.cos(r*Xe),p=Math.sin(r*Xe),c=Math.cos(i*Xe),x=Math.sin(i*Xe),m=Math.cos(s*Xe),y=Math.sin(s*Xe),g=e*m-t*y,f=e*y+t*m,b=g*c-f*x,S=g*x+f*c,E=n,k=b,v=S*h-E*p,z=S*p+E*h,C=1+l*.001*z,$=a+k*u*C,P=d-v*u*C;return{sx:$,sy:P,depth:z}}function Br(e,t){let n=e.replace("#",""),r,i,s;return n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s,`rgba(${r},${i},${s},${t})`}function Hr(e,t){let n=e.replace("#",""),r,i,s;n.length===3?(r=parseInt(n[0]+n[0],16),i=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16)):(r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16)),r=isNaN(r)?0:r,i=isNaN(i)?0:i,s=isNaN(s)?0:s;let l=d=>Math.max(0,Math.min(255,Math.round(d*t))),a=d=>l(d).toString(16).padStart(2,"0");return"#"+a(r)+a(i)+a(s)}function _r(e){let{layers:t,width:n=700,height:r=500,perspective:i=.5,rotateX:s=35,rotateY:l=45,rotateZ:a=0,showLabels:d=!0,showAxes:u=!0,layerSpacing:h=2,colorScale:p=Al,gridColor:c="#94a3b8",title:x}=e,m=q(()=>{let L=0,T=0,w=0;for(let D=0;D<t.length;D++){let R=t[D],F=R.data.length;F>L&&(L=F);for(let I=0;I<F;I++){let N=R.data[I].length;N>T&&(T=N);for(let B=0;B<N;B++){let V=Math.abs(R.data[I][B]??0);V>w&&(w=V)}}}return{maxRows:Math.max(L,1),maxCols:Math.max(T,1),maxHeight:w>0?w:1}},[t]),y=q(()=>{let L=m.maxHeight+(t.length-1)*h+m.maxHeight,T=Math.sqrt(m.maxCols*m.maxCols+m.maxRows*m.maxRows+L*L),w=Math.min(n,r)*.75;return T>0?w/T:1},[m,t.length,h,n,r]),g=n/2,f=r/2,b=M((L,T,w)=>Ll(L,T,w,s,l,a,i,g,f,y),[s,l,a,i,g,f,y]),S=M(()=>{if(!u)return[];let L=[],T=Math.max(m.maxCols,m.maxRows),w=m.maxCols/2,D=m.maxRows/2,R=b(-w,-D,0),F=b(w,-D,0);L.push(o("line",{key:"axis-x",x1:String(R.sx),y1:String(R.sy),x2:String(F.sx),y2:String(F.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-x-label",x:String(F.sx+8),y:String(F.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"X"));let I=b(-w,D,0);L.push(o("line",{key:"axis-y",x1:String(R.sx),y1:String(R.sy),x2:String(I.sx),y2:String(I.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-y-label",x:String(I.sx-12),y:String(I.sy+4),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Y"));let N=m.maxHeight+(t.length-1)*h,B=b(-w,-D,N);return L.push(o("line",{key:"axis-z",x1:String(R.sx),y1:String(R.sy),x2:String(B.sx),y2:String(B.sy),stroke:"#374151","stroke-width":"1.5"})),L.push(o("text",{key:"axis-z-label",x:String(B.sx-4),y:String(B.sy-8),"font-size":"11","font-family":"sans-serif",fill:"#374151"},"Z")),L},[u,m,t.length,h,b]),E=M(()=>{let L=[],T=m.maxCols/2,w=m.maxRows/2,D=[];for(let R=0;R<t.length;R++){let F=t[R],I=F.color??p[R%p.length],N=F.opacity??.7,B=R*h,V=F.data.length;for(let G=0;G<V-1;G++){let K=F.data[G],ee=F.data[G+1],J=Math.min(K.length,ee.length);for(let Y=0;Y<J-1;Y++){let U=Y-T,O=Y+1-T,_=G-w,Z=G+1-w,Q=(K[Y]??0)+B,oe=(K[Y+1]??0)+B,j=(ee[Y]??0)+B,te=(ee[Y+1]??0)+B,re=b(U,_,Q),le=b(O,_,oe),ne=b(U,Z,j),ce=b(O,Z,te),de=(re.depth+le.depth+ne.depth+ce.depth)/4,ae=`${re.sx},${re.sy} ${le.sx},${le.sy} ${ce.sx},${ce.sy} ${ne.sx},${ne.sy}`;D.push({points:ae,fill:Br(I,N),stroke:Hr(I,.7),strokeWidth:"0.5",depth:de,key:`quad-${R}-${G}-${Y}`})}}if(V===1||V>0&&F.data[0].length===1)for(let G=0;G<V;G++){let K=F.data[G];for(let ee=0;ee<K.length;ee++){let J=ee-T,Y=G-w,U=(K[ee]??0)+B,O=b(J,Y,U),_=3,Z=`${O.sx},${O.sy-_} ${O.sx+_},${O.sy} ${O.sx},${O.sy+_} ${O.sx-_},${O.sy}`;D.push({points:Z,fill:Br(I,N),stroke:Hr(I,.7),strokeWidth:"0.5",depth:O.depth,key:`point-${R}-${G}-${ee}`})}}}D.sort((R,F)=>R.depth-F.depth);for(let R=0;R<D.length;R++){let F=D[R];L.push(o("polygon",{key:F.key,points:F.points,fill:F.fill,stroke:F.stroke,"stroke-width":F.strokeWidth,"stroke-linejoin":"round"}))}return L},[t,m,h,p,b]),k=M(()=>{let L=[],T=m.maxCols/2,w=m.maxRows/2;for(let D=0;D<=m.maxRows;D++){let R=D-w,F=b(-T,R,0),I=b(T,R,0);L.push(o("line",{key:`base-h-${D}`,x1:String(F.sx),y1:String(F.sy),x2:String(I.sx),y2:String(I.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}for(let D=0;D<=m.maxCols;D++){let R=D-T,F=b(R,-w,0),I=b(R,w,0);L.push(o("line",{key:`base-v-${D}`,x1:String(F.sx),y1:String(F.sy),x2:String(I.sx),y2:String(I.sy),stroke:c,"stroke-width":"0.3","stroke-dasharray":"2 2",opacity:"0.5"}))}return L},[m,c,b]),v=M(()=>{if(!d)return[];let L=[],T=m.maxCols/2,w=m.maxRows/2;for(let D=0;D<t.length;D++){let R=t[D],F=D*h,I=0,N=0;for(let K=0;K<R.data.length;K++){let ee=R.data[K];for(let J=0;J<ee.length;J++)I+=ee[J]??0,N++}let B=N>0?I/N:0,V=b(T+1,0,B+F),G=R.color??p[D%p.length];L.push(o("text",{key:`layer-label-${D}`,x:String(V.sx+8),y:String(V.sy+4),"font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:G},R.label))}return L},[d,t,m,h,p,b]),C=M(()=>x?[o("text",{key:"title",x:String(n/2),y:String(24),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n])(),$=k(),P=S(),W=E(),A=v(),H=t.length===0?[o("text",{key:"empty-msg",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No layer data")]:[];return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"3D layer visualization",style:{fontFamily:"sans-serif",maxWidth:"100%"}},...C,...H,...$,...P,...W,...A)}function Fl(e){if(typeof e=="string")return e;if(!isFinite(e)||isNaN(e))return"--";let t=e.toString().split("."),n=t[0],r=t.length>1?"."+t[1]:"",i=n.startsWith("-"),s=i?n.slice(1):n,l="";for(let a=0;a<s.length;a++)a>0&&(s.length-a)%3===0&&(l+=","),l+=s[a];return(i?"-":"")+l+r}function Wl(e){if(!isFinite(e)||isNaN(e))return"--";let t=Math.abs(e);return t<100&&t!==Math.floor(t)?t.toFixed(1):String(Math.round(t))}function Or(e){let{value:t,label:n,prefix:r="",suffix:i="",trend:s,trendLabel:l,sparkline:a,width:d=280,height:u=160,valueColor:h="currentColor",trendUpColor:p="#22c55e",trendDownColor:c="#ef4444",backgroundColor:x="#ffffff"}=e,m=q(()=>Fl(t),[t]),y=s!=null&&isFinite(s)&&!isNaN(s),g=a!=null&&a.length>1,f=n!=null&&n.length>0,b=y&&s>=0?p:c,S=20,E=f?u*.38:u*.45,k=Math.min(d*.15,48),v=k*.55,z=E+k*.4+8,C=f?z+22:E+k*.4+22,$=g?Math.min(u*.22,36):0,P=u-S-$,W=d-S*2,A=M(()=>[o("rect",{key:"bg",x:"0",y:"0",width:"100%",rx:"8",ry:"8",fill:x,stroke:"#e5e7eb","stroke-width":"1"})],[d,u,x]),H=M(()=>{let V=[],G=r+m+i;return V.push(o("text",{key:"value",x:String(d/2),y:String(E),"text-anchor":"middle","dominant-baseline":"central","font-size":String(k),"font-weight":"bold","font-family":"sans-serif",fill:h,"aria-label":`Value: ${G}`},r?o("tspan",{key:"prefix","font-size":String(v),"font-weight":"normal"},r):null,m,i?o("tspan",{key:"suffix","font-size":String(v),"font-weight":"normal"},i):null)),V},[d,E,k,v,m,r,i,h]),L=M(()=>f?[o("text",{key:"label",x:String(d/2),y:String(z),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},n)]:[],[f,d,z,n]),T=M(()=>{if(!y)return[];let V=[],G=s,K=G>=0,ee=8,J=Wl(G),Y=(K?"+":"-")+J+(l?" "+l:""),U=d/2-40,O=C;if(K){let _=`${U},${O} ${U-ee/2},${O+ee} ${U+ee/2},${O+ee}`;V.push(o("polygon",{key:"trend-arrow",points:_,fill:b}))}else{let _=`${U},${O+ee} ${U-ee/2},${O} ${U+ee/2},${O}`;V.push(o("polygon",{key:"trend-arrow",points:_,fill:b}))}return V.push(o("text",{key:"trend-text",x:String(U+ee+4),y:String(O+ee*.7),"text-anchor":"start","font-size":"12","font-family":"sans-serif",fill:b,"aria-label":`Trend: ${Y}`},Y)),V},[y,s,l,b,d,C]),w=M(()=>{if(!g)return[];let V=[],G=a,K=[];for(let Q of G)typeof Q=="number"&&isFinite(Q)&&!isNaN(Q)&&K.push(Q);if(K.length<2)return[];let ee=1/0,J=-1/0;for(let Q of K)Q<ee&&(ee=Q),Q>J&&(J=Q);ee===J&&(ee-=1,J+=1);let Y=J-ee,U=W/(K.length-1),O="";for(let Q=0;Q<K.length;Q++){let oe=S+Q*U,j=P+$-(K[Q]-ee)/Y*$;Q===0?O+=`M ${oe} ${j}`:O+=` L ${oe} ${j}`}let _=S+(K.length-1)*U,Z=O+` L ${_} ${P+$} L ${S} ${P+$} Z`;return V.push(o("defs",{key:"spark-defs"},o("linearGradient",{key:"spark-grad",id:"sparkGrad",x1:"0",y1:"0",x2:"0",y2:"1"},o("stop",{key:"stop1",offset:"0%","stop-color":"#3b82f6","stop-opacity":"0.3"}),o("stop",{key:"stop2",offset:"100%","stop-color":"#3b82f6","stop-opacity":"0.05"})))),V.push(o("path",{key:"spark-fill",d:Z,fill:"url(#sparkGrad)"})),V.push(o("path",{key:"spark-line",d:O,fill:"none",stroke:"#3b82f6","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})),V},[g,a,W,P,$,S]),D=A(),R=H(),F=L(),I=T(),N=w(),B=`${r}${m}${i}${f?`, ${n}`:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${d} ${u}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":B,style:{fontFamily:"sans-serif"}},...D,...N,...R,...F,...I)}var yt=Math.PI/180;function Nl(e,t,n,r,i,s,l,a){let d=Math.cos(r*yt),u=Math.sin(r*yt),h=Math.cos(i*yt),p=Math.sin(i*yt),c=e*h+n*p,x=-e*p+n*h,m=t*d-x*u,y=t*u+x*d;return{sx:s+c*a,sy:l-m*a,depth:y}}function qe(e){return{x:Math.sin(e.theta)*Math.cos(e.phi),y:Math.sin(e.theta)*Math.sin(e.phi),z:Math.cos(e.theta)}}function St(e,t,n){let r=Math.sqrt(e*e+t*t+n*n);if(r<1e-10)return{theta:0,phi:0};let i=e/r,s=t/r,l=n/r,a=Math.acos(Math.max(-1,Math.min(1,l))),d=Math.atan2(s,i);return{theta:a,phi:d<0?d+2*Math.PI:d}}function Ae(e,t,n){let{x:r,y:i,z:s}=qe(e),l=Math.cos(n),a=Math.sin(n),d,u,h;return t==="x"?(d=r,u=i*l-s*a,h=i*a+s*l):t==="y"?(d=r*l+s*a,u=i,h=-r*a+s*l):(d=r*l-i*a,u=r*a+i*l,h=s),St(d,u,h)}function sn(e,t){let n=t.angle??Math.PI;switch(t.gate){case"X":return Ae(e,"x",Math.PI);case"Y":return Ae(e,"y",Math.PI);case"Z":return Ae(e,"z",Math.PI);case"H":{let{x:r,y:i,z:s}=qe(e);return St(s,-i,r)}case"S":return Ae(e,"z",Math.PI/2);case"T":return Ae(e,"z",Math.PI/4);case"Rx":return Ae(e,"x",n);case"Ry":return Ae(e,"y",n);case"Rz":return Ae(e,"z",n)}}function Vr(e){let{state:t,gates:n,width:r=400,height:i=400,rotateY:s=-25,rotateX:l=15,zoom:a=1,interactive:d=!0,zoomable:u=!0,showVector:h=!0,showLabels:p=!0,showWireframe:c=!0,showTrail:x=!0,trailMaxPoints:m=200,trailColor:y="#ef4444",wireframeColor:g="#cbd5e1",vectorColor:f="#3b82f6",backgroundColor:b,sphereRadius:S=130,title:E,onStateChange:k}=e,[v,z]=X(t??{theta:0,phi:0}),[C,$]=X(s),[P,W]=X(l),[A,H]=X(a),L=ie([]),T=ie(!1),w=ie(null),D=ie(null);se(()=>{t&&z(t)},[t?.theta,t?.phi]);let R=ie(0);se(()=>{if(!n||n.length===0)return;R.current=0;let U=0,O=()=>{R.current>=n.length||(z(_=>{let Z=sn(_,n[R.current]);return R.current++,k&&k(Z),Z}),U=requestAnimationFrame(O))};return U=requestAnimationFrame(O),()=>cancelAnimationFrame(U)},[n]),se(()=>{let U=qe(v);L.current.push(U),L.current.length>m&&L.current.splice(0,L.current.length-m)},[v.theta,v.phi]);let F=S*A,I=r/2,N=i/2,B=M((U,O,_)=>Nl(U,O,_,P,C,I,N,F),[P,C,I,N,F]),V=M(U=>{if(!d)return;let O=U;T.current=!0,w.current={mx:O.clientX,my:O.clientY,rx:P,ry:C}},[d,P,C]),G=M(U=>{if(!T.current||!w.current)return;let O=U,_=w.current;$(_.ry+(O.clientX-_.mx)*.5),W(_.rx-(O.clientY-_.my)*.5)},[]),K=M(()=>{T.current=!1},[]),ee=M(U=>{if(!u)return;let O=U;O.preventDefault(),H(_=>Math.max(.5,Math.min(3,_*(O.deltaY>0?.95:1.05))))},[u]),J=[];if(b&&J.push(o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:b,rx:"6"})),E&&J.push(o("text",{key:"title",x:String(I),y:"24","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},E)),c){let O=[];for(let Q=0;Q<=60;Q++){let oe=Q/60*2*Math.PI,j=B(Math.cos(oe),Math.sin(oe),0);O.push(`${Q===0?"M":"L"}${j.sx.toFixed(1)},${j.sy.toFixed(1)}`)}J.push(o("path",{key:"eq",d:O.join(" "),fill:"none",stroke:g,"stroke-width":"0.8",opacity:"0.5"}));let _=[];for(let Q=0;Q<=60;Q++){let oe=Q/60*2*Math.PI,j=B(Math.cos(oe),0,Math.sin(oe));_.push(`${Q===0?"M":"L"}${j.sx.toFixed(1)},${j.sy.toFixed(1)}`)}J.push(o("path",{key:"xz",d:_.join(" "),fill:"none",stroke:g,"stroke-width":"0.8",opacity:"0.4"}));let Z=[];for(let Q=0;Q<=60;Q++){let oe=Q/60*2*Math.PI,j=B(0,Math.cos(oe),Math.sin(oe));Z.push(`${Q===0?"M":"L"}${j.sx.toFixed(1)},${j.sy.toFixed(1)}`)}J.push(o("path",{key:"yz",d:Z.join(" "),fill:"none",stroke:g,"stroke-width":"0.8",opacity:"0.4"}))}let Y=[{id:"x",dir:[1,0,0],color:"#ef4444"},{id:"y",dir:[0,1,0],color:"#22c55e"},{id:"z",dir:[0,0,1],color:"#3b82f6"}];for(let U of Y){let O=B(U.dir[0]*1.15,U.dir[1]*1.15,U.dir[2]*1.15),_=B(-U.dir[0]*1.15,-U.dir[1]*1.15,-U.dir[2]*1.15),Z=B(0,0,0);J.push(o("line",{key:`axis-${U.id}`,x1:String(_.sx),y1:String(_.sy),x2:String(O.sx),y2:String(O.sy),stroke:U.color,"stroke-width":"0.8",opacity:"0.4","stroke-dasharray":"3 3"}))}if(p){let U=[{text:"|0\u27E9",pos:[0,0,1.3]},{text:"|1\u27E9",pos:[0,0,-1.3]},{text:"|+\u27E9",pos:[1.3,0,0]},{text:"|-\u27E9",pos:[-1.3,0,0]},{text:"|+i\u27E9",pos:[0,1.3,0]},{text:"|-i\u27E9",pos:[0,-1.3,0]}];for(let O of U){let _=B(O.pos[0],O.pos[1],O.pos[2]);J.push(o("text",{key:`lbl-${O.text}`,x:String(_.sx),y:String(_.sy),"text-anchor":"middle","dominant-baseline":"central","font-size":"11","font-family":"serif",fill:"#475569",style:{pointerEvents:"none"}},O.text))}}if(x&&L.current.length>1){let U=L.current,O=[];for(let _=0;_<U.length;_++){let Z=U[_],Q=B(Z.x,Z.y,Z.z);O.push(`${_===0?"M":"L"}${Q.sx.toFixed(1)},${Q.sy.toFixed(1)}`)}J.push(o("path",{key:"trail",d:O.join(" "),fill:"none",stroke:y,"stroke-width":"1.5",opacity:"0.5","stroke-linecap":"round","stroke-linejoin":"round"}))}if(h){let U=qe(v),O=B(0,0,0),_=B(U.x,U.y,U.z);J.push(o("line",{key:"vec-line",x1:String(O.sx),y1:String(O.sy),x2:String(_.sx),y2:String(_.sy),stroke:f,"stroke-width":"2.5","stroke-linecap":"round"})),J.push(o("circle",{key:"vec-point",cx:String(_.sx),cy:String(_.sy),r:"5",fill:f,stroke:"#fff","stroke-width":"1.5"}));let Z=(v.theta*180/Math.PI).toFixed(0),Q=(v.phi*180/Math.PI).toFixed(0);J.push(o("text",{key:"state-label",x:String(r-10),y:String(i-10),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#64748b"},`\u03B8=${Z}\xB0 \u03C6=${Q}\xB0`))}return o("svg",{ref:D,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":E??"Bloch sphere quantum state visualization",style:{fontFamily:"sans-serif",cursor:d?T.current?"grabbing":"grab":"default"},onMouseDown:d?V:void 0,onMouseMove:d?G:void 0,onMouseUp:d?K:void 0,onMouseLeave:d?K:void 0,onWheel:u?ee:void 0},...J)}function Bl(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];typeof r=="number"&&isFinite(r)&&!isNaN(r)&&t.push(r)}return t.sort((n,r)=>n-r),t}function an(e,t){if(e.length===0)return 0;if(e.length===1)return e[0];let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);if(r===i)return e[r];let s=n-r;return e[r]+s*(e[i]-e[r])}function ln(e){let t=Bl(e);if(t.length===0)return null;let n=an(t,25),r=an(t,50),i=an(t,75),s=i-n,l=n-1.5*s,a=i+1.5*s,d=t[0];for(let x of t)if(x>=l){d=x;break}let u=t[t.length-1];for(let x=t.length-1;x>=0;x--)if(t[x]<=a){u=t[x];break}let h=0;for(let x of t)h+=x;let p=h/t.length,c=[];for(let x of t)(x<l||x>a)&&c.push(x);return{q1:n,median:r,q3:i,iqr:s,whiskerLow:d,whiskerHigh:u,mean:p,outliers:c,min:t[0],max:t[t.length-1]}}function Hl(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Yr(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showOutliers:s=!0,showMean:l=!1,whiskerColor:a="#374151",boxWidth:d=.6,showGrid:u=!0,title:h,padding:p=60}=e,c=i==="vertical",x=n-p*2,m=r-p*2,y=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],g=q(()=>{let w=[];for(let D of t)w.push(ln(D.values));return w},[t]),f=q(()=>{let w=1/0,D=-1/0;for(let I of g){if(I===null)continue;let N=s&&I.outliers.length>0?Math.min(I.whiskerLow,I.outliers[0]):I.whiskerLow,B=s&&I.outliers.length>0?Math.max(I.whiskerHigh,I.outliers[I.outliers.length-1]):I.whiskerHigh;N<w&&(w=N),B>D&&(D=B)}isFinite(w)||(w=0,D=1);let R=D-w,F=R>0?R*.05:.5;return{min:w-F,max:D+F}},[g,s]),b=c?m:x,S=c?x:m,E=t.length>0?t.length:1,k=S/E,v=k*Math.min(Math.max(d,.1),.95),z=M(w=>{let D=f.max-f.min;return D===0?b/2:(w-f.min)/D*b},[f,b]),C=M(()=>{if(!u)return[];let w=[],D=f.max-f.min,R=Hl(D),F=Math.ceil(f.min/R)*R;for(let I=F;I<=f.max;I+=R){let N=z(I),B=String(Math.round(I*1e3)/1e3);if(c){let V=p+m-N;w.push(o("line",{key:`grid-${I}`,x1:String(p),y1:String(V),x2:String(p+x),y2:String(V),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${I}`,x:String(p-6),y:String(V+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},B))}else{let V=p+N;w.push(o("line",{key:`grid-${I}`,x1:String(V),y1:String(p),x2:String(V),y2:String(p+m),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`glabel-${I}`,x:String(V),y:String(p+m+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},B))}}return w},[u,f,z,c,p,x,m]),$=M(()=>{let w=[];return w.push(o("line",{key:"axis-value",x1:String(p),y1:String(c?p:p+m),x2:String(p),y2:String(p+m),stroke:"#374151","stroke-width":"1.5"})),w.push(o("line",{key:"axis-category",x1:String(p),y1:String(p+m),x2:String(p+x),y2:String(p+m),stroke:"#374151","stroke-width":"1.5"})),w},[p,x,m,c]),P=M(()=>{let w=[];for(let D=0;D<t.length;D++){let R=g[D];if(R===null)continue;let F=t[D],I=F.color??y[D%y.length],N=k*D+k/2,B=v/2;if(c){let V=p+m-z(R.q1),G=p+m-z(R.q3),K=p+m-z(R.median),ee=p+m-z(R.whiskerLow),J=p+m-z(R.whiskerHigh),Y=p+N;w.push(o("line",{key:`wl-${D}`,x1:String(Y),y1:String(V),x2:String(Y),y2:String(ee),stroke:a,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${D}`,x1:String(Y-B*.4),y1:String(ee),x2:String(Y+B*.4),y2:String(ee),stroke:a,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${D}`,x1:String(Y),y1:String(G),x2:String(Y),y2:String(J),stroke:a,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${D}`,x1:String(Y-B*.4),y1:String(J),x2:String(Y+B*.4),y2:String(J),stroke:a,"stroke-width":"1.5"}));let U=Math.min(V,G),O=Math.abs(V-G);if(w.push(o("rect",{key:`box-${D}`,x:String(Y-B),y:String(U),width:String(v),height:String(Math.max(O,1)),fill:I,stroke:a,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${R.q1.toFixed(1)}, median=${R.median.toFixed(1)}, Q3=${R.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${D}`,x1:String(Y-B),y1:String(K),x2:String(Y+B),y2:String(K),stroke:"#fff","stroke-width":"2.5"})),l){let _=p+m-z(R.mean);w.push(o("circle",{key:`mean-${D}`,cx:String(Y),cy:String(_),r:"3.5",fill:"#fff",stroke:a,"stroke-width":"1.5","aria-label":`Mean: ${R.mean.toFixed(1)}`}))}if(s)for(let _=0;_<R.outliers.length;_++){let Z=p+m-z(R.outliers[_]);w.push(o("circle",{key:`out-${D}-${_}`,cx:String(Y),cy:String(Z),r:"3",fill:"none",stroke:a,"stroke-width":"1.5","aria-label":`Outlier: ${R.outliers[_]}`}))}w.push(o("text",{key:`cat-${D}`,x:String(Y),y:String(p+m+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}else{let V=p+z(R.q1),G=p+z(R.q3),K=p+z(R.median),ee=p+z(R.whiskerLow),J=p+z(R.whiskerHigh),Y=p+N;w.push(o("line",{key:`wl-${D}`,x1:String(V),y1:String(Y),x2:String(ee),y2:String(Y),stroke:a,"stroke-width":"1.5"})),w.push(o("line",{key:`wlc-${D}`,x1:String(ee),y1:String(Y-B*.4),x2:String(ee),y2:String(Y+B*.4),stroke:a,"stroke-width":"1.5"})),w.push(o("line",{key:`wh-${D}`,x1:String(G),y1:String(Y),x2:String(J),y2:String(Y),stroke:a,"stroke-width":"1.5"})),w.push(o("line",{key:`whc-${D}`,x1:String(J),y1:String(Y-B*.4),x2:String(J),y2:String(Y+B*.4),stroke:a,"stroke-width":"1.5"}));let U=Math.min(V,G),O=Math.abs(G-V);if(w.push(o("rect",{key:`box-${D}`,x:String(U),y:String(Y-B),width:String(Math.max(O,1)),height:String(v),fill:I,stroke:a,"stroke-width":"1.5",opacity:"0.8","aria-label":`${F.label}: Q1=${R.q1.toFixed(1)}, median=${R.median.toFixed(1)}, Q3=${R.q3.toFixed(1)}`,role:"img"})),w.push(o("line",{key:`med-${D}`,x1:String(K),y1:String(Y-B),x2:String(K),y2:String(Y+B),stroke:"#fff","stroke-width":"2.5"})),l){let _=p+z(R.mean);w.push(o("circle",{key:`mean-${D}`,cx:String(_),cy:String(Y),r:"3.5",fill:"#fff",stroke:a,"stroke-width":"1.5","aria-label":`Mean: ${R.mean.toFixed(1)}`}))}if(s)for(let _=0;_<R.outliers.length;_++){let Z=p+z(R.outliers[_]);w.push(o("circle",{key:`out-${D}-${_}`,cx:String(Z),cy:String(Y),r:"3",fill:"none",stroke:a,"stroke-width":"1.5","aria-label":`Outlier: ${R.outliers[_]}`}))}w.push(o("text",{key:`cat-${D}`,x:String(p-6),y:String(Y+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},F.label))}}return w},[t,g,z,c,p,x,m,k,v,a,s,l,y]),W=M(()=>h?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n,p]),A=C(),H=$(),L=P(),T=W();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Box plot",style:{fontFamily:"sans-serif"}},...T,...A,...H,...L)}function Gr(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function _l(e,t,n){return e<t?t:e>n?n:e}function cn(e){return typeof e=="number"&&isFinite(e)&&!isNaN(e)}function Ur(e){let{data:t=[],width:n=600,height:r=400,xLabel:i,yLabel:s,showGrid:l=!0,showAxes:a=!0,showLabels:d=!1,maxBubbleRadius:u=40,minBubbleRadius:h=4,defaultColor:p="#3b82f6",opacity:c=.7,title:x,padding:m=60}=e,y=q(()=>{let L=[];for(let T=0;T<t.length;T++){let w=t[T];cn(w.x)&&cn(w.y)&&cn(w.r)&&L.push(w)}return L},[t]),g=n-m*2,f=r-m*2,b=q(()=>{if(y.length===0)return{xMin:0,xMax:1,yMin:0,yMax:1,rMin:0,rMax:1};let L=1/0,T=-1/0,w=1/0,D=-1/0,R=1/0,F=-1/0;for(let I of y)I.x<L&&(L=I.x),I.x>T&&(T=I.x),I.y<w&&(w=I.y),I.y>D&&(D=I.y),I.r<R&&(R=I.r),I.r>F&&(F=I.r);return L===T&&(L-=1,T+=1),w===D&&(w-=1,D+=1),R===F&&(R=0,F=F>0?F:1),{xMin:L,xMax:T,yMin:w,yMax:D,rMin:R,rMax:F}},[y]),S=M(L=>{let T=b.xMax-b.xMin;return m+(L-b.xMin)/T*g},[b,m,g]),E=M(L=>{let T=b.yMax-b.yMin;return m+f-(L-b.yMin)/T*f},[b,m,f]),k=M(L=>{let T=b.rMax-b.rMin;if(T===0)return(h+u)/2;let w=(L-b.rMin)/T;return h+w*(u-h)},[b,h,u]),v=M(()=>{if(!l)return[];let L=[],T=Gr(b.xMax-b.xMin),w=Math.ceil(b.xMin/T)*T;for(let F=w;F<=b.xMax;F+=T){let I=S(F);L.push(o("line",{key:`grid-x-${F}`,x1:String(I),y1:String(m),x2:String(I),y2:String(m+f),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),L.push(o("text",{key:`grid-xlabel-${F}`,x:String(I),y:String(m+f+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}let D=Gr(b.yMax-b.yMin),R=Math.ceil(b.yMin/D)*D;for(let F=R;F<=b.yMax;F+=D){let I=E(F);L.push(o("line",{key:`grid-y-${F}`,x1:String(m),y1:String(I),x2:String(m+g),y2:String(I),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),L.push(o("text",{key:`grid-ylabel-${F}`,x:String(m-6),y:String(I+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(Math.round(F*1e3)/1e3)))}return L},[l,b,S,E,m,g,f]),z=M(()=>{if(!a)return[];let L=[];return L.push(o("line",{key:"axis-y",x1:String(m),y1:String(m),x2:String(m),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),L.push(o("line",{key:"axis-x",x1:String(m),y1:String(m+f),x2:String(m+g),y2:String(m+f),stroke:"#374151","stroke-width":"1.5"})),i&&L.push(o("text",{key:"x-label",x:String(m+g/2),y:String(m+f+40),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151"},i)),s&&L.push(o("text",{key:"y-label",x:String(m-40),y:String(m+f/2),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90, ${m-40}, ${m+f/2})`},s)),L},[a,m,g,f,i,s]),C=M(()=>{let L=[];for(let T=0;T<y.length;T++){let w=y[T],D=S(w.x),R=E(w.y),F=_l(k(w.r),h,u),I=w.color??p;L.push(o("circle",{key:`bubble-${T}`,cx:String(D),cy:String(R),r:String(F),fill:I,opacity:String(c),stroke:I,"stroke-width":"1","stroke-opacity":"0.8","aria-label":w.label??`Bubble at (${w.x}, ${w.y}) size ${w.r}`,role:"img"})),d&&w.label&&L.push(o("text",{key:`label-${T}`,x:String(D),y:String(R-F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},w.label))}return L},[y,S,E,k,p,c,d,h,u]),$=M(()=>x?[o("text",{key:"title",x:String(n/2),y:String(m/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},x)]:[],[x,n,m]),P=v(),W=z(),A=C(),H=$();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":x??"Bubble chart",style:{fontFamily:"sans-serif"}},...H,...P,...W,...A)}var Ol=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Vl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function Yl(e){let t=e.split("-");return t.length!==3?new Date(NaN):new Date(parseInt(t[0],10),parseInt(t[1],10)-1,parseInt(t[2],10))}function jr(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${r}`}function Xr(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function Gl(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function Ul(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,l=Xr(t[i]),a=Xr(t[i+1]);return Gl(l.r+(a.r-l.r)*s,l.g+(a.g-l.g)*s,l.b+(a.b-l.b)*s)}var jl=["#9be9a8","#40c463","#30a14e","#216e39"];function qr(e){let{data:t=[],width:n=800,height:r=160,colorScale:i=jl,cellSize:s=12,cellGap:l=2,showMonthLabels:a=!0,showDayLabels:d=!0,emptyColor:u="#ebedf0",title:h}=e,{dateMap:p,startDate:c,endDate:x,maxVal:m}=q(()=>{let A=new Map,H=0,L=null,T=null;for(let R of t){let F=Yl(R.date);if(isNaN(F.getTime()))continue;let I=jr(F);A.set(I,(A.get(I)??0)+R.value);let N=A.get(I);N>H&&(H=N),(L===null||F<L)&&(L=F),(T===null||F>T)&&(T=F)}if(L===null||T===null){let R=new Date;L=new Date(R.getFullYear(),0,1),T=new Date(R.getFullYear(),11,31)}let w=new Date(L);w.setDate(w.getDate()-w.getDay());let D=new Date(T);return D.setDate(D.getDate()+(6-D.getDay())),{dateMap:A,startDate:w,endDate:D,maxVal:H>0?H:1}},[t]),y=d?30:0,g=a?16:0,f=h?28:0,b=y+10,S=f+g+4,E=M(()=>{let A=[],H=new Date(c),L=0;for(;H<=x;){let T=H.getDay();T===0&&H>c&&L++;let w=jr(H),D=p.get(w),R=D!==void 0&&D>0?Ul(D/m,i):u,F=b+L*(s+l),I=S+T*(s+l);A.push(o("rect",{key:`day-${w}`,x:String(F),y:String(I),width:String(s),height:String(s),rx:"2",ry:"2",fill:R,"aria-label":`${w}: ${D??0}`})),H.setDate(H.getDate()+1)}return A},[c,x,p,m,i,u,s,l,b,S]),k=M(()=>{if(!a)return[];let A=[],H=new Date(c),L=0,T=-1;for(;H<=x;){let w=H.getDay();w===0&&H>c&&L++;let D=H.getMonth();if(D!==T&&w===0){T=D;let R=b+L*(s+l);A.push(o("text",{key:`month-${L}`,x:String(R),y:String(f+g-2),"font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Ol[D]))}H.setDate(H.getDate()+1)}return A},[a,c,x,s,l,b,f,g]),v=M(()=>{if(!d)return[];let A=[],H=[1,3,5];for(let L of H){let T=S+L*(s+l)+s/2;A.push(o("text",{key:`day-label-${L}`,x:String(y),y:String(T),"text-anchor":"end","dominant-baseline":"central","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},Vl[L]))}return A},[d,s,l,S,y]),z=M(()=>h?[o("text",{key:"title",x:String(n/2),y:"18","text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n]);if(t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let C=z(),$=k(),P=v(),W=E();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Calendar heat map",style:{fontFamily:"sans-serif"}},...C,...$,...P,...W)}var Xl=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ie(e,t,n,r){let i=r-Math.PI/2;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function ql(e,t,n,r,i,s){let l=Ie(e,t,n,i),a=Ie(e,t,n,s),d=Ie(e,t,r,i),u=Ie(e,t,r,s),p=s-i>Math.PI?1:0;return[`M ${l.x} ${l.y}`,`A ${n} ${n} 0 ${p} 1 ${a.x} ${a.y}`,`L ${u.x} ${u.y}`,`A ${r} ${r} 0 ${p} 0 ${d.x} ${d.y}`,"Z"].join(" ")}function Kl(e,t,n,r,i,s,l){let a=Ie(e,t,n,r),d=Ie(e,t,n,i),u=Ie(e,t,n,s),h=Ie(e,t,n,l),p=i-r,c=l-s,x=p>Math.PI?1:0,m=c>Math.PI?1:0;return[`M ${a.x} ${a.y}`,`A ${n} ${n} 0 ${x} 1 ${d.x} ${d.y}`,`Q ${e} ${t} ${u.x} ${u.y}`,`A ${n} ${n} 0 ${m} 1 ${h.x} ${h.y}`,`Q ${e} ${t} ${a.x} ${a.y}`,"Z"].join(" ")}function Zl(e,t,n,r){let i=e.length;if(i===0)return{groups:[],chords:[]};let s=[],l=0;for(let c=0;c<i;c++){let x=0;for(let m=0;m<i;m++){let y=e[c]?.[m]??0;x+=Math.max(0,y)}s.push(x),l+=x}if(l===0){let c=(2*Math.PI-i*r)/Math.max(i,1),x=[],m=0;for(let y=0;y<i;y++)x.push({index:y,label:t[y]??`Group ${y}`,color:n[y%n.length],startAngle:m,endAngle:m+c,value:0}),m+=c+r;return{groups:x,chords:[]}}let a=2*Math.PI-i*r,d=[],u=0;for(let c=0;c<i;c++){let x=s[c]/l*a;d.push({index:c,label:t[c]??`Group ${c}`,color:n[c%n.length],startAngle:u,endAngle:u+x,value:s[c]}),u+=x+r}let h=[];for(let c=0;c<i;c++)h.push(d[c].startAngle);let p=[];for(let c=0;c<i;c++)for(let x=c;x<i;x++){let m=Math.max(0,e[c]?.[x]??0),y=c===x?0:Math.max(0,e[x]?.[c]??0);if(m===0&&y===0)continue;let g=m+y,f=s[c]>0?m/l*a:0,b=h[c],S=b+f;h[c]=S;let E=s[x]>0?m/l*a:0,k=h[x],v=k+E;if(h[x]=v,c===x){m>0&&p.push({sourceIndex:c,targetIndex:x,sourceStartAngle:b,sourceEndAngle:S,targetStartAngle:k,targetEndAngle:v,value:m,color:d[c].color});continue}let z=s[x]>0?y/l*a:0,$=h[x]+z;h[x]=$;let P=s[c]>0?y/l*a:0,A=h[c]+P;h[c]=A,(m>0||y>0)&&p.push({sourceIndex:c,targetIndex:x,sourceStartAngle:b,sourceEndAngle:Math.max(S,b+.001),targetStartAngle:k,targetEndAngle:Math.max(v,k+.001),value:g,color:d[c].color})}return{groups:d,chords:p}}function Kr(e){let{matrix:t,labels:n,width:r=600,height:i=600,colors:s=Xl,padAngle:l=.05,showLabels:a=!0,showValues:d=!1,ribbonOpacity:u=.5,innerRadiusRatio:h=.9,title:p}=e;if(!t||t.length===0||!n||n.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Empty chord diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let c=r/2,x=i/2,m=Math.min(r,i)/2-40,y=m*Math.max(.5,Math.min(.99,h)),g=m+16,f=q(()=>Zl(t,n,s,l),[t,n,s,l]),b=M(()=>{let C=[];for(let $=0;$<f.groups.length;$++){let P=f.groups[$];if(P.endAngle-P.startAngle<.001)continue;let A=ql(c,x,m,y,P.startAngle,P.endAngle);if(C.push(o("path",{key:`arc-${$}`,d:A,fill:P.color,stroke:"#fff","stroke-width":"1",role:"img","aria-label":`${P.label}: ${P.value}`})),a){let H=(P.startAngle+P.endAngle)/2,L=Ie(c,x,g,H),D=((H-Math.PI/2)%(2*Math.PI)+2*Math.PI)%(2*Math.PI)<Math.PI,R=D?"start":"end",F=H*180/Math.PI-90;D||(F+=180);let I=d?`${P.label} (${P.value})`:P.label;C.push(o("text",{key:`label-${$}`,x:String(L.x),y:String(L.y),"text-anchor":R,"font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(${F}, ${L.x}, ${L.y})`,"dominant-baseline":"central","pointer-events":"none"},I))}}return C},[f,c,x,m,y,g,a,d]),S=M(()=>{let C=[];for(let $=0;$<f.chords.length;$++){let P=f.chords[$],W=Kl(c,x,y,P.sourceStartAngle,P.sourceEndAngle,P.targetStartAngle,P.targetEndAngle);C.push(o("path",{key:`ribbon-${$}`,d:W,fill:P.color,"fill-opacity":String(u),stroke:P.color,"stroke-width":"0.5","stroke-opacity":"0.3"}))}return C},[f,c,x,y,u]),E=M(()=>p?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,r]),k=S(),v=b(),z=E();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Chord diagram",style:{fontFamily:"sans-serif"}},...z,...k,...v)}var Jl=["#3b82f6","#22c55e","#f59e0b","#8b5cf6","#ef4444","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Ql(e){let t=[],n=0,r=[];r.push([e,0,null]);let i=0;for(;r.length>0;){let[s,l,a]=r.shift(),d=n++;i=Math.max(i,l);let u=s.children??[],h=[];for(let p=0;p<u.length;p++)h.push(n+r.length+p);t.push({id:d,node:s,depth:l,parentId:a,childIndices:h});for(let p=0;p<u.length;p++)r.push([u[p],l+1,d])}return{flatNodes:t,maxDepth:i}}function ec(e){let t=e.length,n=new Array(t).fill(0);for(let r=t-1;r>=0;r--){let i=e[r];if(i.childIndices.length===0)n[r]=1;else{let s=0;for(let l of i.childIndices)l<t&&(s+=n[l]);n[r]=Math.max(s,1)}}return n}function tc(e,t,n,r,i,s,l,a){let{flatNodes:d,maxDepth:u}=Ql(e);if(d.length===0)return[];let h=ec(d),p=t-s*2,c=n-s*2,x=l==="horizontal",m=u+1,y=x?m>1?(p-r)/u:0:m>1?(c-i)/u:0,g=new Array(d.length),f=h[0],b=x?c:p,S=f>0?b/f:b,E=new Array(d.length);E[0]=[0,f];let k=[0],v=0;for(;v<k.length;){let z=k[v];v++;let C=d[z],[$,P]=E[z],W=($+P)/2,A=s+C.depth*y,H=s+(W-.5)*S,L=x?A:H,T=x?H:A,w=C.node.color??a[C.depth%a.length];g[z]={id:C.id,label:C.node.label,value:C.node.value!==void 0?String(C.node.value):"",color:w,depth:C.depth,x:L,y:T,parentId:C.parentId,childCount:C.childIndices.length,subtreeLeafCount:h[z]};let D=$;for(let R of C.childIndices)if(R<d.length){let F=h[R],I=D+F;E[R]=[D,I],D=I,k.push(R)}}return g}function Zr(e){let{data:t,width:n=800,height:r=500,orientation:i="horizontal",nodeWidth:s=120,nodeHeight:l=40,showValues:a=!0,showConnectors:d=!0,connectorColor:u="#94a3b8",colors:h=Jl,title:p,padding:c=40}=e;if(!t)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Empty decomposition tree"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let x=i==="horizontal",m=q(()=>tc(t,n,r,s,l,c,i,h),[t,n,r,s,l,c,i,h]),y=q(()=>{let v=new Map;for(let z=0;z<m.length;z++){let C=m[z];v.set(C.id,C)}return v},[m]),g=M(()=>{if(!d)return[];let v=[];for(let z=0;z<m.length;z++){let C=m[z];if(C.parentId===null)continue;let $=y.get(C.parentId);if(!$)continue;let P,W,A,H;x?(P=$.x+s,W=$.y+l/2,A=C.x,H=C.y+l/2):(P=$.x+s/2,W=$.y+l,A=C.x+s/2,H=C.y);let L=(P+A)/2,T=(W+H)/2,w;x?w=`M ${P} ${W} C ${L} ${W}, ${L} ${H}, ${A} ${H}`:w=`M ${P} ${W} C ${P} ${T}, ${A} ${T}, ${A} ${H}`,v.push(o("path",{key:`conn-${z}`,d:w,fill:"none",stroke:u,"stroke-width":"1.5","stroke-opacity":"0.7"}))}return v},[m,y,x,s,l,d,u]),f=M(()=>{let v=[];for(let z=0;z<m.length;z++){let C=m[z];v.push(o("rect",{key:`node-rect-${C.id}`,x:String(C.x),y:String(C.y),width:String(s),height:String(l),rx:"4",ry:"4",fill:C.color,stroke:"#374151","stroke-width":"1",role:"img","aria-label":C.value?`${C.label}: ${C.value}`:C.label}));let $=a&&C.value?C.y+l/2-2:C.y+l/2+4;v.push(o("text",{key:`node-label-${C.id}`,x:String(C.x+s/2),y:String($),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#fff","pointer-events":"none"},C.label)),a&&C.value&&v.push(o("text",{key:`node-value-${C.id}`,x:String(C.x+s/2),y:String(C.y+l/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.85)","pointer-events":"none"},C.value))}return v},[m,s,l,a]),b=M(()=>p?[o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n]),S=g(),E=f(),k=b();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Decomposition tree",style:{fontFamily:"sans-serif"}},...k,...S,...E)}var Jr=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function nc(e){return Jr[e%Jr.length]}function Qr(e,t,n){let r=t/2,i=n/2,s=Math.min(t,n)*.3,l=e.length,a=[];for(let d=0;d<l;d++){let u=e[d],h=2*Math.PI*d/Math.max(l,1);a.push({id:u.id,label:u.label??u.id,color:u.color??nc(d),x:u.x??r+s*Math.cos(h),y:u.y??i+s*Math.sin(h),vx:0,vy:0,fixed:u.fixed??!1,solid:u.solid??!0})}return a}function ei(e,t){let n=t*2;for(let r=0;r<e.length;r++){let i=e[r];if(i.solid)for(let s=r+1;s<e.length;s++){let l=e[s];if(!l.solid)continue;let a=l.x-i.x,d=l.y-i.y,u=a*a+d*d;if(u>=n*n||u<1e-4)continue;let h=Math.sqrt(u),p=a/h,c=d/h,x=n-h;if(i.fixed&&l.fixed)continue;i.fixed?(l.x+=p*x,l.y+=c*x):l.fixed?(i.x-=p*x,i.y-=c*x):(i.x-=p*x*.5,i.y-=c*x*.5,l.x+=p*x*.5,l.y+=c*x*.5);let m=i.vx-l.vx,y=i.vy-l.vy,g=m*p+y*c;g<=0||(i.fixed?(l.vx+=g*p,l.vy+=g*c):l.fixed?(i.vx-=g*p,i.vy-=g*c):(i.vx-=g*p,i.vy-=g*c,l.vx+=g*p,l.vy+=g*c))}}}function oc(e,t,n,r,i,s,l,a,d=12){let u=e.length;if(u===0)return e;let h=new Map;for(let b=0;b<u;b++)h.set(e[b].id,b);let p=new Float64Array(u),c=new Float64Array(u);for(let b=0;b<u;b++){let S=e[b];for(let E=b+1;E<u;E++){let k=e[E],v=S.x-k.x,z=S.y-k.y,C=v*v+z*z;C<1&&(C=1);let $=Math.sqrt(C),P=i/C,W=v/$*P,A=z/$*P;p[b]+=W,c[b]+=A,p[E]-=W,c[E]-=A}}for(let b=0;b<t.length;b++){let S=t[b],E=h.get(S.source),k=h.get(S.target);if(E===void 0||k===void 0)continue;let v=e[E],z=e[k],C=z.x-v.x,$=z.y-v.y,P=Math.sqrt(C*C+$*$);if(P<.1)continue;let W=S.weight??1,A=P-a,H=s*A*W,L=C/P*H,T=$/P*H;p[E]+=L,c[E]+=T,p[k]-=L,c[k]-=T}let x=n/2,m=r/2,y=.001;for(let b=0;b<u;b++){let S=e[b];p[b]+=(x-S.x)*y,c[b]+=(m-S.y)*y}let g=20,f=[];for(let b=0;b<u;b++){let S=e[b];if(S.fixed){f.push({...S,vx:0,vy:0});continue}let E=(S.vx+p[b])*l,k=(S.vy+c[b])*l,v=Math.sqrt(E*E+k*k),z=10;v>z&&(E=E/v*z,k=k/v*z);let C=S.x+E,$=S.y+k;C=Math.max(g,Math.min(n-g,C)),$=Math.max(g,Math.min(r-g,$)),f.push({...S,x:C,y:$,vx:E,vy:k})}return ei(f,d),f}function rc(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];t+=r.vx*r.vx+r.vy*r.vy}return t}function ti(e){let{nodes:t,edges:n,width:r=600,height:i=400,nodeRadius:s=12,nodeStrokeWidth:l=2,solidNodes:a=!0,showLabels:d=!0,showArrows:u=!1,repulsionForce:h=300,attractionForce:p=.01,damping:c=.9,edgeLength:x=100,edgeColor:m="#94a3b8",edgeWidth:y=1.5,title:g,customForce:f,trails:b}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Empty force-directed graph"},g?o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g):o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let S=ie(Qr(t,r,i)),[E,k]=X(0),v=ie(!0),z=ie(!1),C=ie(n);C.current=n;let $=ie(f);$.current=f;let P=ie(null),W=ie({repulsionForce:h,attractionForce:p,damping:c,edgeLength:x,width:r,height:i,nodeRadius:s,solidNodes:a});W.current={repulsionForce:h,attractionForce:p,damping:c,edgeLength:x,width:r,height:i,nodeRadius:s,solidNodes:a};let A=ie(new Map);se(()=>{S.current=Qr(t,r,i),z.current=!1,v.current=!0,A.current=new Map,k(oe=>oe+1)},[t.length]),se(()=>{let oe=0,j=()=>{if(!v.current)return;let te=W.current,re=$.current,le;if(re?(le=re(S.current,C.current,te.width,te.height,P.current),te.solidNodes&&ei(le,te.nodeRadius)):le=oc(S.current,C.current,te.width,te.height,te.repulsionForce,te.attractionForce,te.damping,te.edgeLength,te.nodeRadius),S.current=le,b)for(let ne=0;ne<b.length;ne++){let ce=b[ne],de=le.find(ge=>ge.id===ce.nodeId);if(!de)continue;let ae=A.current.get(ce.nodeId);ae||(ae=[],A.current.set(ce.nodeId,ae)),ae.push({x:de.x,y:de.y});let ue=ce.maxPoints??200;ae.length>ue&&ae.splice(0,ae.length-ue)}if(!re&&rc(le)<.01){z.current=!0,k(ne=>ne+1);return}k(ne=>ne+1),oe=requestAnimationFrame(j)};return oe=requestAnimationFrame(j),()=>{v.current=!1,cancelAnimationFrame(oe)}},[]);let H=S.current,L=M(oe=>{S.current=S.current.map(j=>j.id===oe?{...j,fixed:!j.fixed,vx:0,vy:0}:j),z.current&&(z.current=!1,v.current=!0,k(j=>j+1))},[]),T=ie(null),w=ie(null),D=M(oe=>{let j=oe,te=w.current;if(!te)return{x:j.clientX,y:j.clientY};let re=te.getBoundingClientRect(),le=r/re.width,ne=i/re.height;return{x:(j.clientX-re.left)*le,y:(j.clientY-re.top)*ne}},[r,i]),R=ie(!1),F=M((oe,j)=>{j.stopPropagation(),T.current=oe;let te=S.current.find(re=>re.id===oe);R.current=te?.fixed??!1,S.current=S.current.map(re=>re.id===oe?{...re,fixed:!0,vx:0,vy:0}:re)},[]),I=M(oe=>{let j=D(oe);if(P.current={x:j.x,y:j.y},!T.current)return;let te=T.current,re=20;S.current=S.current.map(le=>le.id===te?{...le,x:Math.max(re,Math.min(r-re,j.x)),y:Math.max(re,Math.min(i-re,j.y))}:le),z.current&&(z.current=!1,v.current=!0),k(le=>le+1)},[r,i,D]),N=M(()=>{let oe=T.current;oe&&(S.current=S.current.map(j=>j.id===oe?{...j,fixed:R.current}:j)),T.current=null},[]),B=M(()=>{T.current=null,P.current=null},[]),V=q(()=>{let oe=new Map;for(let j=0;j<H.length;j++)oe.set(H[j].id,H[j]);return oe},[E]),G=M(()=>u?[o("defs",{key:"arrow-defs"},o("marker",{key:"arrowhead",id:"arrowhead",markerWidth:"10",markerHeight:"7",refX:String(10+s),refY:"3.5",orient:"auto",markerUnits:"userSpaceOnUse"},o("polygon",{key:"arrow-poly",points:"0 0, 10 3.5, 0 7",fill:m})))]:[],[u,s,m]),K=M(()=>{let oe=[];for(let j=0;j<n.length;j++){let te=n[j],re=V.get(te.source),le=V.get(te.target);if(!re||!le||te.weight!==void 0&&te.weight<=0)continue;let ne=te.weight?Math.max(.5,Math.min(6,y*te.weight)):y,ce={key:`edge-${j}`,x1:String(re.x),y1:String(re.y),x2:String(le.x),y2:String(le.y),stroke:te.color??m,"stroke-width":String(ne),"stroke-opacity":"0.6"};u&&(ce["marker-end"]="url(#arrowhead)"),oe.push(o("line",ce))}return oe},[E,m,y,u]),ee=M(()=>{let oe=[];for(let j=0;j<H.length;j++){let te=H[j];oe.push(o("circle",{key:`node-${te.id}`,cx:String(te.x),cy:String(te.y),r:String(s),fill:te.color,stroke:te.fixed?"#0f172a":"#fff","stroke-width":te.fixed?"3":String(l),style:{cursor:T.current===te.id?"grabbing":"grab"},onMouseDown:re=>F(te.id,re),onDblClick:()=>L(te.id),role:"button",tabIndex:0,"aria-label":`Node: ${te.label}${te.fixed?" (locked)":""} \u2014 drag to move, double-click to lock`})),d&&oe.push(o("text",{key:`label-${te.id}`,x:String(te.x),y:String(te.y+s+14),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},te.label))}return oe},[E,s,d,L]),J=M(()=>g?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},g)]:[],[g,r]),Y=M(()=>{if(!b||b.length===0)return[];let oe=[];for(let j=0;j<b.length;j++){let te=b[j],re=A.current.get(te.nodeId);if(!re||re.length<2)continue;let le=[];for(let ne=0;ne<re.length;ne++){let ce=re[ne];le.push(`${ne===0?"M":"L"}${ce.x.toFixed(1)},${ce.y.toFixed(1)}`)}oe.push(o("path",{key:`trail-${te.nodeId}`,d:le.join(" "),fill:"none",stroke:te.color??"#3b82f6","stroke-width":String(te.width??1),opacity:String(te.opacity??.5),"stroke-linecap":"round","stroke-linejoin":"round"}))}return oe},[E,b]),U=G(),O=Y(),_=K(),Z=ee(),Q=J();return o("svg",{ref:w,width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":g??"Force-directed graph \u2014 drag nodes to move, double-click to lock",style:{fontFamily:"sans-serif",cursor:T.current?"grabbing":"default"},onMouseMove:I,onMouseUp:N,onMouseLeave:B},...U,...Q,...O,..._,...Z)}var ni=["#3b82f6","#6366f1","#8b5cf6","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#f3e8ff"];function oi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",showLabels:s=!0,showValues:l=!0,showPercentage:a=!0,gapSize:d=2,colors:u=ni,title:h}=e,p=i==="vertical",c=h?30:0,x=120,m=q(()=>{let C=0;for(let $=0;$<t.length;$++)t[$].value>C&&(C=t[$].value);return C>0?C:1},[t]),y=M(C=>m===0?0:Math.max(.05,C/m),[m]),g=M((C,$)=>$||(u[C%u.length]??ni[0]),[u]),f=M(()=>{if(t.length===0)return[];let C=[],$=40,P=n-$*2-x,W=r-c-$*2,A=d*(t.length-1),H=Math.max(1,(W-A)/t.length),L=$+P/2;for(let T=0;T<t.length;T++){let w=t[T],D=T<t.length-1?t[T+1]:null,R=g(T,w.color),F=y(w.value),I=D!==null?y(D.value):F*.6,N=P/2*F,B=P/2*I,V=c+$+T*(H+d),G=L-N,K=L+N,ee=L+B,J=L-B,Y=`${G},${V} ${K},${V} ${ee},${V+H} ${J},${V+H}`;C.push(o("polygon",{key:`section-${T}`,points:Y,fill:R,stroke:"#fff","stroke-width":"1"}));let U=$+P+12,O=V+H/2;if(s&&C.push(o("text",{key:`label-${T}`,x:String(U),y:String(O-(l||a?6:0)),"text-anchor":"start","font-size":"12","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},w.label)),l||a){let _="";if(l&&(_=String(w.value)),a&&t.length>0){let Z=t[0].value,Q=Z>0?Math.round(w.value/Z*100):0;_+=l?` (${Q}%)`:`${Q}%`}C.push(o("text",{key:`value-${T}`,x:String(U),y:String(O+(s?10:4)),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},_))}}return C},[t,n,r,c,d,s,l,a,g,y,x]),b=M(()=>{if(t.length===0)return[];let C=[],$=40,P=n-$*2,A=r-c-$*2-40,H=d*(t.length-1),L=Math.max(1,(P-H)/t.length),T=c+$+A/2;for(let w=0;w<t.length;w++){let D=t[w],R=w<t.length-1?t[w+1]:null,F=g(w,D.color),I=y(D.value),N=R!==null?y(R.value):I*.6,B=A/2*I,V=A/2*N,G=$+w*(L+d),K=T-B,ee=T-V,J=T+V,Y=T+B,U=`${G},${K} ${G+L},${ee} ${G+L},${J} ${G},${Y}`;C.push(o("polygon",{key:`section-${w}`,points:U,fill:F,stroke:"#fff","stroke-width":"1"}));let O=G+L/2,_=c+$+A+14;if(s&&C.push(o("text",{key:`label-${w}`,x:String(O),y:String(_),"text-anchor":"middle","font-size":"11","font-weight":"bold","font-family":"sans-serif",fill:"#374151"},D.label)),l||a){let Z="";if(l&&(Z=String(D.value)),a&&t.length>0){let Q=t[0].value,oe=Q>0?Math.round(D.value/Q*100):0;Z+=l?` (${oe}%)`:`${oe}%`}C.push(o("text",{key:`value-${w}`,x:String(O),y:String(_+14),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#6b7280"},Z))}}return C},[t,n,r,c,d,s,l,a,g,y]),S=M(()=>h?[o("text",{key:"title",x:String(n/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h)]:[],[h,n]),E=M(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),k=S(),v=p?f():b(),z=E();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Funnel chart",style:{fontFamily:"sans-serif"}},...k,...v,...z)}var ri=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function ii(e){if(e<=0)return 1;let t=e/6,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function ic(e,t){return t||ri[e%ri.length]}function si(e){let{tasks:t=[],width:n=800,height:r,barHeight:i=24,barGap:s=8,showGrid:l=!0,showLabels:a=!0,showProgress:d=!1,timeUnit:u="days",title:h,padding:p=50}=e;if(t.length===0)return o("svg",{width:"100%",height:String(r??100),viewBox:`0 0 ${n} ${r??100}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty Gantt chart"},o("text",{x:String(n/2),y:String((r??100)/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No tasks to display"));let c=a?120:0,x=q(()=>{let W=1/0,A=-1/0;for(let H of t){H.start<W&&(W=H.start);let L=H.start+H.duration;L>A&&(A=L)}return W===1/0&&(W=0,A=1),{min:W,max:A,range:A-W}},[t]),m=q(()=>{let W=t.slice();return W.sort((A,H)=>A.group!==H.group?(A.group??"").localeCompare(H.group??""):A.start-H.start),W},[t]),y=r??p*2+m.length*(i+s)+s+20,g=n-p-c-p,f=p+(h?20:0),b=M(W=>x.range===0?c+p:c+p+(W-x.min)/x.range*g,[x,g,c,p]),S=M(()=>{if(!l)return[];let W=[],A=ii(x.range),H=Math.ceil(x.min/A)*A,L=f+m.length*(i+s)+s;for(let T=H;T<=x.max;T+=A){let w=b(T);W.push(o("line",{key:`grid-${T}`,x1:String(w),y1:String(f),x2:String(w),y2:String(L),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"}))}return W},[l,x,f,m.length,i,s,b]),E=M(()=>{let W=[],A=ii(x.range),H=Math.ceil(x.min/A)*A,L=f-8;for(let T=H;T<=x.max;T+=A){let w=b(T);W.push(o("text",{key:`taxis-${T}`,x:String(w),y:String(L),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},String(T)))}return W.push(o("text",{key:"time-unit",x:String(n-p),y:String(L),"text-anchor":"end","font-size":"10","font-family":"sans-serif",fill:"currentColor",opacity:"0.4","font-style":"italic"},u)),W},[x,f,b,u,n,p]),k=M(()=>{let W=[],A="";for(let H=0;H<m.length;H++){let L=m[H],T=f+H*(i+s)+s,w=b(L.start),D=Math.max(2,b(L.start+L.duration)-w),R=ic(H,L.color);L.group&&L.group!==A&&(A=L.group,a&&W.push(o("text",{key:`group-${H}`,x:String(p),y:String(T+i/2-12),"font-size":"9","font-family":"sans-serif","font-weight":"bold",fill:"currentColor",opacity:"0.4","text-transform":"uppercase"},L.group))),W.push(o("rect",{key:`bar-${L.id}`,x:String(w),y:String(T),width:String(D),height:String(i),rx:"4",ry:"4",fill:R,role:"graphics-symbol","aria-label":`${L.label}: start ${L.start}, duration ${L.duration}`})),a&&W.push(o("text",{key:`label-${L.id}`,x:String(c+p-8),y:String(T+i/2+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"currentColor"},L.label.length>16?L.label.substring(0,14)+"..":L.label)),d&&D>30&&W.push(o("text",{key:`prog-${L.id}`,x:String(w+D/2),y:String(T+i/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff"},`${L.start}-${L.start+L.duration}`))}return W},[m,f,i,s,b,a,d,c,p]),v=M(()=>h?[o("text",{key:"title",x:String(n/2),y:String(p/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},h)]:[],[h,n,p]),z=S(),C=E(),$=k(),P=v();return o("svg",{width:"100%",height:String(y),viewBox:`0 0 ${n} ${y}`,xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Gantt chart",style:{fontFamily:"sans-serif"}},...P,...z,...C,...$)}var sc=Math.PI/180;function ac(e){return e*sc}function Re(e,t,n,r){let i=ac(r);return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function ai(e,t,n,r,i){let s=Re(e,t,n,i),l=Re(e,t,n,r),a=i-r,d=Math.abs(a)>180?1:0,u=a>0?1:0;return`M ${s.x} ${s.y} A ${n} ${n} 0 ${d} ${u===1?0:1} ${l.x} ${l.y}`}function lc(e,t,n){return e<t?t:e>n?n:e}function Be(e){return!isFinite(e)||isNaN(e)?"--":Math.abs(e)>=1e3?Math.round(e).toString():e===Math.floor(e)?e.toString():e.toFixed(1)}function li(e){let{value:t,min:n=0,max:r=100,width:i=300,height:s=200,startAngle:l=-135,endAngle:a=135,arcWidth:d=20,showValue:u=!0,showMinMax:h=!0,showTicks:p=!0,tickCount:c=10,label:x,unit:m,colors:y=["#22c55e","#f59e0b","#ef4444"],needleColor:g="#374151",backgroundColor:f="#e5e7eb"}=e,b=isFinite(n)&&!isNaN(n)?n:0,S=isFinite(r)&&!isNaN(r)&&r>b?r:b+100,E=isFinite(t)&&!isNaN(t)?lc(t,b,S):b,k=(u?24:0)+(x?18:0),v=i/2,z=(s-k)*.6,C=Math.min(i/2,(s-k)*.55)-d/2-10,$=C-d,P=C-d/2,W=a-l,A=M(Y=>{let U=S-b;if(U===0)return l;let O=(Y-b)/U;return l+O*W},[b,S,l,W]),H=M(()=>{let Y=ai(v,z,P,l,a);return[o("path",{key:"bg-arc",d:Y,fill:"none",stroke:f,"stroke-width":String(d),"stroke-linecap":"round"})]},[v,z,P,l,a,f,d]),L=M(()=>{if(y.length===0)return[];let Y=[],U=W/y.length;for(let O=0;O<y.length;O++){let _=l+O*U,Z=_+U,Q=ai(v,z,P,_,Z);Y.push(o("path",{key:`seg-${O}`,d:Q,fill:"none",stroke:y[O],"stroke-width":String(d),"stroke-linecap":O===0||O===y.length-1?"round":"butt",opacity:"0.85"}))}return Y},[y,W,l,v,z,P,d]),T=M(()=>{if(!p||c<=0)return[];let Y=[],U=Math.max(1,Math.min(c,100));for(let O=0;O<=U;O++){let _=O/U,Z=l+_*W,Q=O%2===0,oe=Q?10:6,j=Re(v,z,C+4,Z),te=Re(v,z,C+4+oe,Z);if(Y.push(o("line",{key:`tick-${O}`,x1:String(j.x),y1:String(j.y),x2:String(te.x),y2:String(te.y),stroke:"currentColor",opacity:"0.4","stroke-width":Q?"2":"1"})),Q){let re=b+_*(S-b),le=Re(v,z,C+4+oe+12,Z);Y.push(o("text",{key:`tick-label-${O}`,x:String(le.x),y:String(le.y+3),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Be(re)))}}return Y},[p,c,l,W,v,z,C,b,S]),w=M(()=>{let Y=[],U=A(E),O=$-8,_=Re(v,z,O,U),Z=6,Q=U+90,oe=U-90,j=Re(v,z,Z,Q),te=Re(v,z,Z,oe);return Y.push(o("polygon",{key:"needle",points:`${_.x},${_.y} ${j.x},${j.y} ${te.x},${te.y}`,fill:g,stroke:"none"})),Y.push(o("circle",{key:"needle-cap",cx:String(v),cy:String(z),r:"8",fill:g,stroke:"#fff","stroke-width":"2"})),Y},[E,A,v,z,$,g]),D=M(()=>{if(!u)return[];let Y=[],U=Be(E),O=U+(m?" "+m:""),_=z+P+20;return Y.push(o("text",{key:"value-text",x:String(v),y:String(_),"text-anchor":"middle","font-size":"22","font-weight":"bold","font-family":"sans-serif",fill:"currentColor","aria-label":`Value: ${O}`},U,m?o("tspan",{key:"unit","font-size":"14","font-weight":"normal",opacity:"0.6",fill:"currentColor"}," "+m):null)),Y},[u,E,m,v,z,P]),R=M(()=>{if(!x)return[];let Y=z+P+(u?40:20);return[o("text",{key:"label",x:String(v),y:String(Y),"text-anchor":"middle","font-size":"13","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},x)]},[x,v,z,P,u]),F=M(()=>{if(!h)return[];let Y=[],U=Re(v,z,P,l),O=Re(v,z,P,a);return Y.push(o("text",{key:"min-label",x:String(U.x-4),y:String(U.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Be(b))),Y.push(o("text",{key:"max-label",x:String(O.x+4),y:String(O.y+18),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor",opacity:"0.55"},Be(S))),Y},[h,v,z,P,l,a,b,S]),I=H(),N=L(),B=T(),V=w(),G=D(),K=R(),ee=F(),J=`Gauge: ${Be(E)}${m?" "+m:""}, range ${Be(b)} to ${Be(S)}${x?", "+x:""}`;return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"meter","aria-valuenow":String(E),"aria-valuemin":String(b),"aria-valuemax":String(S),"aria-label":J,style:{fontFamily:"sans-serif"}},...I,...N,...B,...V,...G,...K,...ee)}var et={AL:{name:"Alabama",path:"m 643,467.4 .4,-7.3 -.9,-1.2 -1.7,-.7 -2.5,-2.8 .5,-2.9 48.8,-5.1 -.7,-2.2 -1.5,-1.5 -.5,-1.4 .6,-6.3 -2.4,-5.7 .5,-2.6 .3,-3.7 2.2,-3.8 -.2,-1.1 -1.7,-1 v -3.2 l -1.8,-1.9 -2.9,-6.1 -12.9,-45.8 -45.7,4 1.3,2 -1.3,67 4.4,33.2 .9,-.5 1.3,.1 .6,.4 .8,-.1 2,-3.8 v -2.3 l 1.1,-1.1 1.4,.5 3.4,6.4 v .9 l -3.3,2.2 3.5,-.4 4.9,-1.6 z"},AK:{name:"Alaska",path:"m 15.8,572 h 2.4 l .7,.7 -1,1.2 -1.9,.2 -2.5,1.3 -3.7,-.1 2.2,-.9 .3,-1.1 2.5,-.3 z m 8.3,-1.7 1.3,.5 h .9 l .5,1.2 .3,-.6 .9,.2 1.1,1.5 0,.5 -4.2,1.9 -2.4,-.1 -1,-.5 -1.1,.7 -2,0 -1.1,-1.4 4.7,-.5 z m 5.4,-.1 1,.1 .7,.7 v 1 l -1.3,.1 -.9,-1.1 z m 2.5,.3 1.3,-.1 -.1,1 -1.1,.6 z m .3,2.2 3.4,-.1 .2,1.1 -1.3,.1 -.3,-.5 -.8,.6 -.4,-.6 -.9,-.2 z m 166.3,7.6 2.1,.1 -1,1.9 -1.1,-.1 -.4,-.8 .5,-1.3 m -1.1,-2.9 .6,-1.3 -.2,-2.3 2.4,-.5 4.5,4.4 1.3,3.4 1.9,1.6 .3,5.1 -1.4,0 -1.3,-2.3 -3.1,-2.4 h -.6 l 1.1,2.8 1.7,.2 .2,2.1 -.9,.1 -4.1,-4.4 -.1,-.9 1.9,-1 0,-1 -.5,-.8 -1.6,-.6 -1.7,-1.3 1.4,.1 .5,-.4 -.6,-.9 -.6,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.3 -.4,1.3 1.3,1.7 z"},WY:{name:"Wyoming",path:"m 355.3,143.7 -51,-5.3 -57.3,-7.9 -2,10.7 -8.5,54.8 -3.3,21.9 32.1,4.8 44.9,5.7 37.5,3.4 3.7,-44.2 z"},DC:{name:"District of Columbia",path:"m 803.5,252 -2.6,-1.8 -1,1.7 .5,.4 .4,.1 .6,.5 .3,.7 -.1,.5 .2,.5 z"}};function ci(e){let{width:t=959,height:n=593,stateColors:r={},defaultColor:i="#D0D0D0",strokeColor:s="#FFFFFF",strokeWidth:l=1,onStateClick:a,onStateHover:d,hoverColor:u="#FFD700",title:h="Map of the United States"}=e,p=q(()=>Object.keys(et),[]),c=M(f=>{a&&a(f)},[a]),x=M((f,b)=>{let S=b.currentTarget;S&&S.setAttribute("fill",u),d&&d(f)},[d,u]),m=M((f,b)=>{let S=b.currentTarget;if(S){let E=r[f]??i;S.setAttribute("fill",E)}d&&d(null)},[d,r,i]),y=q(()=>{let f=[];for(let b=0;b<p.length;b++){let S=p[b],E=et[S],k=r[S]??i,v={key:`state-${S}`,d:E.path,fill:k,stroke:s,"stroke-width":String(l),"stroke-linejoin":"round","data-state":S,role:"img","aria-label":E.name,style:{cursor:a?"pointer":"default"}};if(a){let C=S;v.onClick=()=>c(C),v.onKeyDown=$=>{($.key==="Enter"||$.key===" ")&&c(C)},v.tabindex=0,v.role="button",v["aria-label"]=E.name}let z=S;v.onMouseOver=C=>x(z,C),v.onMouseOut=C=>m(z,C),f.push(o("path",v))}return f},[p,r,i,s,l,a,c,x,m]),g=o("title",{key:"map-title"},h);return o("svg",{width:"100%",viewBox:`0 0 ${t} ${n}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h,style:{fontFamily:"sans-serif"}},g,...y)}function dn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function cc(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function dc(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,l=dn(t[i]),a=dn(t[i+1]);return cc(l.r+(a.r-l.r)*s,l.g+(a.g-l.g)*s,l.b+(a.b-l.b)*s)}function uc(e){let{r:t,g:n,b:r}=dn(e);return(.299*t+.587*n+.114*r)/255}var fc=["#3b82f6","#fbbf24","#ef4444"];function di(e){let{data:t=[],rowLabels:n,columnLabels:r,width:i=600,height:s=400,colorScale:l=fc,minValue:a,maxValue:d,showValues:u=!1,cellBorderColor:h="#fff",cellBorderWidth:p=1,title:c,padding:x=60}=e,m=t.length,y=q(()=>{let T=0;for(let w of t)w.length>T&&(T=w.length);return T},[t]),{minVal:g,maxVal:f}=q(()=>{let T=a??1/0,w=d??-1/0;for(let D of t)for(let R of D)a===void 0&&R<T&&(T=R),d===void 0&&R>w&&(w=R);return T===1/0&&(T=0),w===-1/0&&(w=1),T===w&&(w=T+1),{minVal:T,maxVal:w}},[t,a,d]),b=c?30:0,S=n?x:20,E=r?x:20,k=i-S-20,v=s-b-E-20,z=y>0?k/y:0,C=m>0?v/m:0,$=M(()=>{let T=[];for(let w=0;w<m;w++){let D=t[w];for(let R=0;R<y;R++){let F=R<D.length?D[R]:0,I=(F-g)/(f-g),N=dc(I,l),B=S+R*z,V=b+20+w*C;if(T.push(o("rect",{key:`cell-${w}-${R}`,x:String(B),y:String(V),width:String(z),height:String(C),fill:N,stroke:h,"stroke-width":String(p)})),u){let G=uc(N)>.5?"#111827":"#ffffff";T.push(o("text",{key:`val-${w}-${R}`,x:String(B+z/2),y:String(V+C/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.min(11,z*.3,C*.4)),"font-family":"sans-serif",fill:G},String(Math.round(F*100)/100)))}}}return T},[t,m,y,g,f,l,z,C,S,b,u,h,p]),P=M(()=>{let T=[];if(n)for(let w=0;w<m;w++){let D=w<n.length?n[w]:"",R=b+20+w*C+C/2;T.push(o("text",{key:`row-label-${w}`,x:String(S-8),y:String(R),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},D))}if(r)for(let w=0;w<y;w++){let D=w<r.length?r[w]:"",R=S+w*z+z/2,F=b+20+m*C+16;T.push(o("text",{key:`col-label-${w}`,x:String(R),y:String(F),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},D))}return T},[n,r,m,y,z,C,S,b]),W=M(()=>c?[o("text",{key:"title",x:String(i/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},c)]:[],[c,i]);if(m===0||y===0)return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map \u2014 no data"},o("text",{x:String(i/2),y:String(s/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let A=W(),H=$(),L=P();return o("svg",{width:"100%",viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":c??"Heat map",style:{fontFamily:"sans-serif"}},...A,...H,...L)}function pc(e,t){if(e.length===0)return[];let n=e[0],r=e[0];for(let l=1;l<e.length;l++){let a=e[l];a<n&&(n=a),a>r&&(r=a)}if(n===r)return[{min:n,max:r+1,count:e.length}];let i=(r-n)/t,s=[];for(let l=0;l<t;l++)s.push({min:n+l*i,max:n+(l+1)*i,count:0});for(let l=0;l<e.length;l++){let a=e[l],d=Math.floor((a-n)/i);d>=t&&(d=t-1),s[d].count++}return s}function mc(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function un(e){return Number.isInteger(e)?String(e):e.toFixed(1)}function ui(e){let{data:t=[],bins:n=10,width:r=600,height:i=400,barColor:s="#3b82f6",barGap:l=2,showGrid:a=!0,showValues:d=!0,title:u,xLabel:h,yLabel:p,padding:c=60}=e,x=Math.max(1,Math.round(n)),m=q(()=>pc(t,x),[t,x]),y=q(()=>{let A=0;for(let H=0;H<m.length;H++)m[H].count>A&&(A=m[H].count);return A>0?A:1},[m]),g=r-c*2,f=i-c*2,b=M(()=>{if(!a)return[];let A=mc(y),H=[];for(let L=A;L<=y;L+=A){let T=c+f-L/y*f;H.push(o("line",{key:`grid-${L}`,x1:String(c),y1:String(T),x2:String(c+g),y2:String(T),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),H.push(o("text",{key:`grid-label-${L}`,x:String(c-8),y:String(T+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(L)))}return H},[a,y,c,g,f]),S=M(()=>{let A=[];return A.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+f),stroke:"#374151","stroke-width":"1.5"})),A.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+f),x2:String(c+g),y2:String(c+f),stroke:"#374151","stroke-width":"1.5"})),A},[c,g,f]),E=M(()=>{if(m.length===0)return[];let A=[],H=l*(m.length-1),L=Math.max(1,(g-H)/m.length);for(let T=0;T<m.length;T++){let w=m[T],D=w.count/y*f,R=c+T*(L+l),F=c+f-D;if(A.push(o("rect",{key:`bar-${T}`,x:String(R),y:String(F),width:String(L),height:String(D),fill:s})),d&&w.count>0&&A.push(o("text",{key:`val-${T}`,x:String(R+L/2),y:String(F-4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},String(w.count))),m.length<=15||T%2===0||T===m.length-1){let N=(m.length===1,un(w.min));A.push(o("text",{key:`xlabel-${T}`,x:String(R+L/2),y:String(c+f+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},N))}}if(m.length>0){let T=m[m.length-1],w=c+g;A.push(o("text",{key:"xlabel-end",x:String(w),y:String(c+f+14),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280"},un(T.max)))}return A},[m,y,l,s,d,c,g,f]),k=M(()=>{let A=[];return u&&A.push(o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u)),h&&A.push(o("text",{key:"x-label",x:String(c+g/2),y:String(i-8),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151"},h)),p&&A.push(o("text",{key:"y-label",x:String(14),y:String(c+f/2),"text-anchor":"middle","font-size":"12","font-family":"sans-serif",fill:"#374151",transform:`rotate(-90 14 ${c+f/2})`},p)),A},[u,h,p,r,i,c,g,f]),v=M(()=>t.length>0?[]:[o("text",{key:"empty",x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,r,i]),z=b(),C=S(),$=E(),P=k(),W=v();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Histogram",style:{fontFamily:"sans-serif"}},...P,...z,...C,...$,...W)}function gc(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function fi(e){let{data:t=[],width:n=600,height:r=400,orientation:i="vertical",stemColor:s="#94a3b8",stemWidth:l=2,dotRadius:a=6,dotColor:d="#3b82f6",showGrid:u=!0,showValues:h=!0,title:p,padding:c=60}=e,x=i==="vertical",m=x?30:0,y=n-c*2,g=r-c*2-m,f=x?g:y,b=x?y:g,S=q(()=>{let T=0;for(let w=0;w<t.length;w++)t[w].value>T&&(T=t[w].value);return T>0?T:1},[t]),E=q(()=>t.length===0?0:b/t.length,[t.length,b]),k=M(()=>{if(!u)return[];let T=gc(S),w=[];for(let D=T;D<=S;D+=T){let R=D/S*f;if(x){let F=c+g-R;w.push(o("line",{key:`grid-${D}`,x1:String(c),y1:String(F),x2:String(c+y),y2:String(F),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${D}`,x:String(c-8),y:String(F+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}else{let F=c+R;w.push(o("line",{key:`grid-${D}`,x1:String(F),y1:String(c),x2:String(F),y2:String(c+g),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),w.push(o("text",{key:`grid-label-${D}`,x:String(F),y:String(c+g+16),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(D)))}}return w},[u,S,x,c,y,g,f]),v=M(()=>{let T=[];return x?T.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})):T.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),T.push(o("line",{key:"axis-x",x1:String(c),y1:String(c+g),x2:String(c+y),y2:String(c+g),stroke:"#374151","stroke-width":"1.5"})),T},[x,c,y,g]),z=M(()=>{if(t.length===0)return[];let T=[];for(let w=0;w<t.length;w++){let D=t[w],R=D.value/S*f,F=E*w+E/2,I=D.color??d;if(x){let N=c+F,B=c+g,V=c+g-R;T.push(o("line",{key:`stem-${w}`,x1:String(N),y1:String(B),x2:String(N),y2:String(V),stroke:s,"stroke-width":String(l)})),T.push(o("circle",{key:`dot-${w}`,cx:String(N),cy:String(V),r:String(a),fill:I})),h&&T.push(o("text",{key:`val-${w}`,x:String(N),y:String(V-a-4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value)));let G=N,K=c+g+16;T.push(o("text",{key:`cat-${w}`,x:String(G),y:String(K),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151",transform:`rotate(-45, ${G}, ${K})`},D.label))}else{let N=c+F,B=c,V=c+R;T.push(o("line",{key:`stem-${w}`,x1:String(B),y1:String(N),x2:String(V),y2:String(N),stroke:s,"stroke-width":String(l)})),T.push(o("circle",{key:`dot-${w}`,cx:String(V),cy:String(N),r:String(a),fill:I})),h&&T.push(o("text",{key:`val-${w}`,x:String(V+a+4),y:String(N+4),"text-anchor":"start","font-size":"11","font-family":"sans-serif",fill:"#374151"},String(D.value))),T.push(o("text",{key:`cat-${w}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#374151"},D.label))}}return T},[t,S,E,d,a,s,l,h,x,c,y,g,f]),C=M(()=>p?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,c]),$=M(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),P=k(),W=v(),A=z(),H=C(),L=$();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Lollipop chart",style:{fontFamily:"sans-serif"}},...H,...P,...W,...A,...L)}function fn(e){let t=e.replace("#",""),n=t.length===3?t[0]+t[0]+t[1]+t[1]+t[2]+t[2]:t,r=parseInt(n,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function hc(e,t,n){let r=i=>{let s=Math.max(0,Math.min(255,Math.round(i))).toString(16);return s.length===1?"0"+s:s};return`#${r(e)}${r(t)}${r(n)}`}function bc(e,t){if(t.length===0)return"#000000";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=Math.min(Math.floor(n*r),r-1),s=n*r-i,l=fn(t[i]),a=fn(t[i+1]);return hc(l.r+(a.r-l.r)*s,l.g+(a.g-l.g)*s,l.b+(a.b-l.b)*s)}function xc(e){let{r:t,g:n,b:r}=fn(e);return(.299*t+.587*n+.114*r)/255}var yc=["#f0f9ff","#3b82f6","#1e3a8a"];function pi(e){let{data:t=[],labels:n,rowLabels:r,columnLabels:i,width:s=500,height:l=500,colorScale:a=yc,showValues:d=!0,showDiagonal:u=!0,cellBorderColor:h="#e5e7eb",title:p,padding:c=70,symmetric:x=!1}=e,m=r??n,y=i??n,g=t.length,f=q(()=>{let I=0;for(let N of t)N.length>I&&(I=N.length);return I},[t]),b=q(()=>{if(!x||g===0)return t;let I=[],N=Math.max(g,f);for(let B=0;B<N;B++){let V=[];for(let G=0;G<N;G++){let K=t[B],ee=K&&G<K.length?K[G]:0,J=t[G],Y=J&&B<J.length?J[B]:0;ee!==0?V.push(ee):V.push(Y)}I.push(V)}return I},[t,x,g,f]),S=b.length,E=q(()=>{let I=0;for(let N of b)N.length>I&&(I=N.length);return I},[b]),{minVal:k,maxVal:v}=q(()=>{let I=1/0,N=-1/0;for(let B of b)for(let V of B)V<I&&(I=V),V>N&&(N=V);return I===1/0&&(I=0),N===-1/0&&(N=1),I===N&&(N=I+1),{minVal:I,maxVal:N}},[b]),z=p?30:0,C=m?c:20,$=y?c:20,P=s-C-20,W=l-z-$-20,A=E>0?P/E:0,H=S>0?W/S:0,L=M(()=>{let I=[];for(let N=0;N<S;N++){let B=b[N];for(let V=0;V<E;V++){let G=V<B.length?B[V]:0,K=(G-k)/(v-k),ee=bc(K,a),J=C+V*A,Y=z+20+N*H,U=N===V,O=U&&u?"currentColor":h,_=U&&u?"2":"1";if(I.push(o("rect",{key:`cell-${N}-${V}`,x:String(J),y:String(Y),width:String(A),height:String(H),fill:ee,stroke:O,"stroke-width":_})),d){let Z=xc(ee)>.5?"#111827":"#ffffff",Q=Math.min(12,A*.3,H*.35);I.push(o("text",{key:`val-${N}-${V}`,x:String(J+A/2),y:String(Y+H/2),"text-anchor":"middle","dominant-baseline":"central","font-size":String(Math.max(8,Q)),"font-weight":U&&u?"bold":"normal","font-family":"sans-serif",fill:Z},String(Math.round(G*100)/100)))}}}return I},[b,S,E,k,v,a,A,H,C,z,d,u,h]),T=M(()=>{let I=[];if(m)for(let N=0;N<S;N++){let B=N<m.length?m[N]:"",V=z+20+N*H+H/2;I.push(o("text",{key:`row-label-${N}`,x:String(C-8),y:String(V),"text-anchor":"end","dominant-baseline":"central","font-size":"11","font-family":"sans-serif",fill:"currentColor"},B))}if(y)for(let N=0;N<E;N++){let B=N<y.length?y[N]:"",V=C+N*A+A/2,G=z+20+S*H+12;I.push(o("text",{key:`col-label-${N}`,x:String(V),y:String(G),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},B))}return I},[m,y,S,E,A,H,C,z]),w=M(()=>p?[o("text",{key:"title",x:String(s/2),y:"22","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},p)]:[],[p,s]);if(S===0||E===0)return o("svg",{width:"100%",viewBox:`0 0 ${s} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Matrix \u2014 no data"},o("text",{x:String(s/2),y:String(l/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"No data to display."));let D=w(),R=L(),F=T();return o("svg",{width:"100%",viewBox:`0 0 ${s} ${l}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Matrix visualization",style:{fontFamily:"sans-serif"}},...D,...R,...F)}var Sc=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function vt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function vc(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function wc(e,t,n,r,i,s,l){let a=[];if(vt(e)<=0)return a;let h=vc(e)+1,p=s==="horizontal",c=p?i/h:r/h,x=[];for(x.push({node:e,depth:0,spanStart:p?t:n,spanEnd:p?t+r:n+i,colorIndex:0});x.length>0;){let m=x.shift(),{node:y,depth:g,spanStart:f,spanEnd:b,colorIndex:S}=m,E=vt(y);if(E<=0)continue;let k=b-f,v,z,C,$;if(p?(v=f,z=n+g*c,C=k,$=c):(v=t+g*c,z=f,C=c,$=k),a.push({x:v,y:z,w:C,h:$,label:y.label,value:E,color:y.color??l[S%l.length],depth:g}),y.children&&y.children.length>0){let P=f;for(let W=0;W<y.children.length;W++){let A=y.children[W],H=vt(A);if(H<=0)continue;let L=H/E*k;x.push({node:A,depth:g+1,spanStart:P,spanEnd:P+L,colorIndex:g===0?W:S}),P+=L}}}return a}function mi(e){let{data:t,width:n=600,height:r=400,orientation:i="horizontal",showLabels:s=!0,showValues:l=!0,colors:a=Sc,borderColor:d="#ffffff",borderWidth:u=1,title:h,padding:p=10}=e,c=h?30:0,x=p,m=p+c,y=n-p*2,g=r-p*2-c;if(q(()=>vt(t),[t])<=0||y<=0||g<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty partition diagram"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let b=q(()=>wc(t,x,m,y,g,i,a),[t,x,m,y,g,i,a]),S=[];h&&S.push(o("text",{key:"title",x:String(n/2),y:String(p+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let E=0;E<b.length;E++){let k=b[E];if(S.push(o("rect",{key:`cell-${E}`,x:String(k.x),y:String(k.y),width:String(Math.max(0,k.w)),height:String(Math.max(0,k.h)),fill:k.color,stroke:d,"stroke-width":String(u),role:"graphics-symbol","aria-label":`${k.label}: ${k.value}`})),s&&k.w>20&&k.h>14){let v=Math.floor(k.w/7),z=k.label.length>v?k.label.substring(0,Math.max(1,v-2))+"..":k.label;S.push(o("text",{key:`label-${E}`,x:String(k.x+k.w/2),y:String(k.y+k.h/2+(l?-2:4)),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},z))}l&&k.w>30&&k.h>28&&S.push(o("text",{key:`value-${E}`,x:String(k.x+k.w/2),y:String(k.y+k.h/2+12),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(k.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Partition diagram",style:{fontFamily:"sans-serif"}},...S)}function pn(e,t){let n=[];for(let r of t)n.push(String(e[r]??""));return n.join(" | ")}function gi(e,t){let n=new Set;for(let i of e)n.add(pn(i,t));let r=Array.from(n);return r.sort(),r}function wt(e,t){if(e.length===0)return 0;switch(t){case"count":return e.length;case"sum":{let n=0;for(let r of e)n+=r;return n}case"avg":{let n=0;for(let r of e)n+=r;return n/e.length}case"min":{let n=e[0];for(let r=1;r<e.length;r++)e[r]<n&&(n=e[r]);return n}case"max":{let n=e[0];for(let r=1;r<e.length;r++)e[r]>n&&(n=e[r]);return n}}}function kt(e){return Number.isInteger(e)?String(e):e.toFixed(2)}function kc(e,t,n,r,i){let s=gi(e,t),l=gi(e,n),a=new Map;for(let x of e){let m=pn(x,t),y=pn(x,n),g=`${m}::${y}`;a.has(g)||a.set(g,[]);let f=a.get(g),b=0;for(let S of r){let E=x[S];if(typeof E=="number")b+=E;else if(typeof E=="string"){let k=parseFloat(E);isNaN(k)||(b+=k)}}f.push(b)}let d=new Map;for(let[x,m]of a)d.set(x,wt(m,i));let u=new Map;for(let x of s){let m=[];for(let y of l){let g=d.get(`${x}::${y}`);g!==void 0&&m.push(g)}u.set(x,wt(m,i==="count"?"sum":i))}let h=new Map;for(let x of l){let m=[];for(let y of s){let g=d.get(`${y}::${x}`);g!==void 0&&m.push(g)}h.set(x,wt(m,i==="count"?"sum":i))}let p=[];for(let x of u.values())p.push(x);let c=wt(p,i==="count"?"sum":i);return{rowKeys:s,colKeys:l,cells:d,rowTotals:u,colTotals:h,grandTotal:c}}function hi(e){let{data:t=[],rows:n=[],columns:r=[],values:i=[],aggregation:s="sum",width:l=600,height:a=400,showTotals:d=!0,title:u,headerColor:h="#3b82f6",cellPadding:p=8}=e;if(t.length===0||n.length===0&&r.length===0||i.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Empty pivot table"},o("text",{x:String(l/2),y:String(a/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.4"},"No data to display"));let c=q(()=>kc(t,n,r,i,s),[t,n,r,i,s]),{rowKeys:x,colKeys:m,cells:y,rowTotals:g,colTotals:f,grandTotal:b}=c,S=u?30:0,E=m.length+(d?1:0),k=x.length+(d?1:0),v=1+E,z=1+k,C=Math.max(40,(l-p*2)/v),$=Math.max(20,Math.min(36,(a-S-p*2)/z)),P=C*v,W=$*z,A=Math.max(0,(l-P)/2),H=S+Math.max(0,(a-S-W)/2),L=[];u&&L.push(o("text",{key:"title",x:String(l/2),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},u)),L.push(o("rect",{key:"header-row-bg",x:String(A),y:String(H),width:String(P),height:String($),fill:h})),L.push(o("rect",{key:"header-col-bg",x:String(A),y:String(H+$),width:String(C),height:String($*k),fill:h,opacity:"0.85"})),L.push(o("text",{key:"corner",x:String(A+C/2),y:String(H+$/2+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},s.toUpperCase()));for(let T=0;T<m.length;T++){let w=A+(T+1)*C,D=Math.floor(C/7),R=m[T],F=R.length>D?R.substring(0,Math.max(1,D-2))+"..":R;L.push(o("text",{key:`ch-${T}`,x:String(w+C/2),y:String(H+$/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F))}d&&L.push(o("text",{key:"ch-total",x:String(A+(m.length+1)*C+C/2),y:String(H+$/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},"Total"));for(let T=0;T<x.length;T++){let w=x[T],D=H+(T+1)*$;T%2===0&&L.push(o("rect",{key:`row-bg-${T}`,x:String(A+C),y:String(D),width:String(C*E),height:String($),fill:"#f9fafb"}));let R=Math.floor(C/7),F=w.length>R?w.substring(0,Math.max(1,R-2))+"..":w;L.push(o("text",{key:`rh-${T}`,x:String(A+C/2),y:String(D+$/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#ffffff"},F));for(let I=0;I<m.length;I++){let N=m[I],B=`${w}::${N}`,V=y.get(B),G=A+(I+1)*C;L.push(o("rect",{key:`border-${T}-${I}`,x:String(G),y:String(D),width:String(C),height:String($),fill:"none",stroke:"#e5e7eb","stroke-width":"0.5"})),L.push(o("text",{key:`cell-${T}-${I}`,x:String(G+C/2),y:String(D+$/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif",fill:"currentColor"},V!==void 0?kt(V):"-"))}if(d){let I=A+(m.length+1)*C,N=g.get(w)??0;L.push(o("rect",{key:`rt-bg-${T}`,x:String(I),y:String(D),width:String(C),height:String($),fill:"#eff6ff"})),L.push(o("text",{key:`rt-${T}`,x:String(I+C/2),y:String(D+$/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},kt(N)))}}if(d){let T=H+(x.length+1)*$;L.push(o("rect",{key:"total-row-bg",x:String(A),y:String(T),width:String(P),height:String($),fill:"#eff6ff"})),L.push(o("text",{key:"total-label",x:String(A+C/2),y:String(T+$/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},"Total"));for(let D=0;D<m.length;D++){let R=m[D],F=f.get(R)??0,I=A+(D+1)*C;L.push(o("text",{key:`ct-${D}`,x:String(I+C/2),y:String(T+$/2+4),"text-anchor":"middle","font-size":"11","font-family":"sans-serif","font-weight":"bold",fill:"#1e40af"},kt(F)))}let w=A+(m.length+1)*C;L.push(o("text",{key:"grand-total",x:String(w+C/2),y:String(T+$/2+4),"text-anchor":"middle","font-size":"12","font-family":"sans-serif","font-weight":"bold",fill:"#1e3a8a"},kt(b)))}return L.push(o("rect",{key:"outer-border",x:String(A),y:String(H),width:String(P),height:String(W),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),o("svg",{width:"100%",viewBox:`0 0 ${l} ${a}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"table","aria-label":u??"Pivot table",style:{fontFamily:"sans-serif"}},...L)}function Ct(e,t){return Math.PI*2*e/t-Math.PI/2}function Mt(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function bi(e){let{axes:t=[],series:n=[],width:r=500,height:i=500,levels:s=5,showLabels:l=!0,showValues:a=!1,showLegend:d=!0,showDots:u=!0,gridColor:h="#d1d5db",title:p}=e,c=t.length,x=p?30:0,m=d&&n.length>0?30:0,y=60,g=Math.min((r-y*2)/2,(i-y*2-x-m)/2),f=r/2,b=y+x+g,S=q(()=>{let L=[];for(let T=0;T<c;T++){let w=t[T]?.max;if(w!==void 0&&w>0){L.push(w);continue}let D=0;for(let R of n){let F=R.values[T];F!==void 0&&F>D&&(D=F)}L.push(D>0?D:1)}return L},[t,n,c]),E=M(()=>{if(c<3)return[];let L=[];for(let T=1;T<=s;T++){let w=g*T/s,D=[];for(let R=0;R<c;R++){let F=Ct(R,c),I=Mt(f,b,w,F);D.push(`${I.x},${I.y}`)}L.push(o("polygon",{key:`ring-${T}`,points:D.join(" "),fill:"none",stroke:h,"stroke-width":T===s?"1.5":"0.5","stroke-dasharray":T===s?"none":"3 2"}))}for(let T=0;T<c;T++){let w=Ct(T,c),D=Mt(f,b,g,w);L.push(o("line",{key:`spoke-${T}`,x1:String(f),y1:String(b),x2:String(D.x),y2:String(D.y),stroke:h,"stroke-width":"0.75"}))}return L},[c,s,g,f,b,h]),k=M(()=>{if(!l||c<3)return[];let L=[],T=16;for(let w=0;w<c;w++){let D=Ct(w,c),R=Mt(f,b,g+T,D),F="middle";R.x<f-5?F="end":R.x>f+5&&(F="start");let I=Math.abs(R.y-b)<5?"0.35em":R.y<b?"0em":"0.7em";L.push(o("text",{key:`label-${w}`,x:String(R.x),y:String(R.y),"text-anchor":F,dy:I,"font-size":"12","font-family":"sans-serif",fill:"currentColor"},t[w]?.label??`Axis ${w}`))}return L},[l,c,t,g,f,b]),v=M(()=>{if(c<3||n.length===0)return[];let L=[];for(let T=0;T<n.length;T++){let w=n[T],D=[],R=[],F=[];for(let I=0;I<c;I++){let N=w.values[I]??0,B=S[I],V=Math.min(N/B,1),G=g*V,K=Ct(I,c),ee=Mt(f,b,G,K);D.push(`${ee.x},${ee.y}`),u&&R.push(o("circle",{key:`dot-${T}-${I}`,cx:String(ee.x),cy:String(ee.y),r:"3.5",fill:w.color,stroke:"#fff","stroke-width":"1.5"})),a&&F.push(o("text",{key:`val-${T}-${I}`,x:String(ee.x),y:String(ee.y-8),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:w.color},String(Math.round(N*100)/100)))}L.push(o("polygon",{key:`series-fill-${T}`,points:D.join(" "),fill:w.color,"fill-opacity":String(w.fillOpacity??.15),stroke:"none"})),L.push(o("polygon",{key:`series-line-${T}`,points:D.join(" "),fill:"none",stroke:w.color,"stroke-width":"2","stroke-linejoin":"round"}));for(let I of R)L.push(I);for(let I of F)L.push(I)}return L},[c,n,S,g,f,b,u,a]),z=M(()=>{if(!d||n.length===0)return[];let L=[],T=b+g+40,w=100,D=n.length*w,R=f-D/2;for(let F=0;F<n.length;F++){let I=n[F],N=R+F*w;L.push(o("rect",{key:`legend-swatch-${F}`,x:String(N),y:String(T),width:"12",height:"12",rx:"2",fill:I.color})),L.push(o("text",{key:`legend-text-${F}`,x:String(N+16),y:String(T+10),"font-size":"12","font-family":"sans-serif",fill:"currentColor"},I.label))}return L},[d,n,f,b,g]),C=M(()=>p?[o("text",{key:"title",x:String(r/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"currentColor"},p)]:[],[p,r]);if(c<3)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Radar chart \u2014 insufficient axes"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"currentColor",opacity:"0.6"},"Radar chart requires at least 3 axes."));let $=E(),P=k(),W=v(),A=z(),H=C();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Radar chart",style:{fontFamily:"sans-serif"}},...H,...$,...P,...W,...A)}var Cc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Mc(e,t){let n=new Map,r=new Map,i=new Map;for(let a of e)r.set(a,new Set),i.set(a,[]);for(let a of t){if(a.value<=0)continue;let d=r.get(a.target);d&&d.add(a.source);let u=i.get(a.source);u&&u.push(a.target)}let s=[];for(let a of e)r.get(a).size===0&&(n.set(a,0),s.push(a));if(s.length===0){for(let a of e)n.set(a,0);return n}let l=0;for(;l<s.length;){let a=s[l];l++;let d=n.get(a),u=i.get(a)??[];for(let h of u){let p=n.get(h),c=d+1;(p===void 0||c>p)&&n.set(h,c),s.includes(h)||s.push(h)}}for(let a of e)n.has(a)||n.set(a,0);return n}function Pc(e,t,n,r,i,s,l,a){if(e.length===0)return{layoutNodes:[],layoutLinks:[]};let d=n-l*2,u=r-l*2,h=t.filter(P=>P.value>0),p=e.map(P=>P.id),c=Mc(p,h),x=new Map,m=new Map;for(let P of p)x.set(P,0),m.set(P,0);for(let P of h)m.set(P.source,(m.get(P.source)??0)+P.value),x.set(P.target,(x.get(P.target)??0)+P.value);let y=0;for(let P of c.values())P>y&&(y=P);let g=new Map;for(let P=0;P<=y;P++)g.set(P,[]);for(let[P,W]of c)g.get(W).push(P);let f=new Map,b=y>0?(d-i)/y:0;for(let P=0;P<=y;P++)f.set(P,l+P*b);let S=new Map;for(let P=0;P<e.length;P++)S.set(e[P].id,e[P]);let E=[],k=new Map;for(let P=0;P<=y;P++){let W=g.get(P);if(W.length===0)continue;let A=0;for(let w of W){let D=x.get(w)??0,R=m.get(w)??0;A+=Math.max(D,R,1)}let H=u-s*(W.length-1),L=A>0?H/A:1,T=l;for(let w=0;w<W.length;w++){let D=W[w],R=S.get(D),F=x.get(D)??0,I=m.get(D)??0,N=Math.max(F,I,1),B=Math.max(4,N*L),V=e.findIndex(K=>K.id===D),G={id:D,label:R.label,color:R.color??a[V%a.length],column:P,x:f.get(P),y:T,height:B,totalIn:F,totalOut:I,totalValue:N};E.push(G),k.set(D,G),T+=B+s}}let v=new Map,z=new Map;for(let P of p)v.set(P,0),z.set(P,0);let C=[...h].sort((P,W)=>W.value-P.value),$=[];for(let P of C){let W=k.get(P.source),A=k.get(P.target);if(!W||!A)continue;let H=W.totalOut||1,L=A.totalIn||1,T=P.value/H*W.height,w=P.value/L*A.height,D=Math.max(1,(T+w)/2),R=v.get(P.source),F=z.get(P.target),I=W.y+R+T/2,N=A.y+F+w/2;v.set(P.source,R+T),z.set(P.target,F+w);let B=S.get(P.source);$.push({source:P.source,target:P.target,value:P.value,color:P.color??B?.color??W.color,sourceY:I,targetY:N,width:D})}return{layoutNodes:E,layoutLinks:$}}function xi(e){let{nodes:t,links:n,width:r=800,height:i=500,nodeWidth:s=20,nodePadding:l=10,showLabels:a=!0,showValues:d=!1,linkOpacity:u=.4,colors:h=Cc,title:p,padding:c=40}=e;if(!t||t.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Empty Sankey diagram"},o("text",{x:String(r/2),y:String(i/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#6b7280"},"No data"));let x=q(()=>Pc(t,n,r,i,s,l,c,h),[t,n,r,i,s,l,c,h]),m=M(()=>{let E=[];for(let k=0;k<x.layoutLinks.length;k++){let v=x.layoutLinks[k],z=x.layoutNodes.find(H=>H.id===v.source),C=x.layoutNodes.find(H=>H.id===v.target);if(!z||!C)continue;let $=z.x+s,P=C.x,W=($+P)/2,A=`M ${$} ${v.sourceY} C ${W} ${v.sourceY}, ${W} ${v.targetY}, ${P} ${v.targetY}`;E.push(o("path",{key:`link-${k}`,d:A,fill:"none",stroke:v.color,"stroke-width":String(Math.max(1,v.width)),"stroke-opacity":String(u),"stroke-linecap":"butt"})),d&&v.value>0&&E.push(o("text",{key:`link-val-${k}`,x:String(W),y:String((v.sourceY+v.targetY)/2-4),"text-anchor":"middle","font-size":"9","font-family":"sans-serif",fill:"#6b7280","pointer-events":"none"},String(v.value)))}return E},[x,s,u,d]),y=M(()=>{let E=[];for(let k=0;k<x.layoutNodes.length;k++){let v=x.layoutNodes[k];if(E.push(o("rect",{key:`node-${v.id}`,x:String(v.x),y:String(v.y),width:String(s),height:String(v.height),fill:v.color,stroke:"#374151","stroke-width":"0.5",role:"img","aria-label":`${v.label}: ${v.totalValue}`})),a){let z=x.layoutNodes.reduce((L,T)=>Math.max(L,T.column),0),C=v.column===z,$=C?v.x+s+6:v.x-6,P=C?"start":"end",W=v.column===0,A=W?v.x-6:$,H=W?"end":P;E.push(o("text",{key:`label-${v.id}`,x:String(A),y:String(v.y+v.height/2+4),"text-anchor":H,"font-size":"11","font-family":"sans-serif",fill:"#374151","pointer-events":"none"},v.label))}}return E},[x,s,a]),g=M(()=>p?[o("text",{key:"title",x:String(r/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,r,c]),f=m(),b=y(),S=g();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Sankey diagram",style:{fontFamily:"sans-serif"}},...S,...f,...b)}var Ec=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],mn=2*Math.PI;function tt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value??0);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value??0);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function $c(e){let t=0,n=[{node:e,depth:0}];for(;n.length>0;){let{node:r,depth:i}=n.pop();if(i>t&&(t=i),r.children)for(let s=r.children.length-1;s>=0;s--)n.push({node:r.children[s],depth:i+1})}return t}function Rc(e,t,n,r,i,s){let l=s-i,a=l>Math.PI?1:0,d=i-Math.PI/2,u=s-Math.PI/2,h=e+r*Math.cos(d),p=t+r*Math.sin(d),c=e+r*Math.cos(u),x=t+r*Math.sin(u),m=e+n*Math.cos(u),y=t+n*Math.sin(u),g=e+n*Math.cos(d),f=t+n*Math.sin(d);if(l>=mn-.001){let b=d+Math.PI,S=e+r*Math.cos(b),E=t+r*Math.sin(b),k=e+n*Math.cos(b),v=t+n*Math.sin(b);return[`M ${h} ${p}`,`A ${r} ${r} 0 1 1 ${S} ${E}`,`A ${r} ${r} 0 1 1 ${h} ${p}`,`L ${g} ${f}`,`A ${n} ${n} 0 1 0 ${k} ${v}`,`A ${n} ${n} 0 1 0 ${g} ${f}`,"Z"].join(" ")}return[`M ${h} ${p}`,`A ${r} ${r} 0 ${a} 1 ${c} ${x}`,`L ${m} ${y}`,`A ${n} ${n} 0 ${a} 0 ${g} ${f}`,"Z"].join(" ")}function zc(e,t,n,r){let i=[],s=tt(e);if(s<=0)return i;let l=$c(e),a=l>0?(n-t)/(l+1):n-t,d=[];if(e.children&&e.children.length>0){let u=0;for(let h=0;h<e.children.length;h++){let p=e.children[h],c=tt(p);if(c<=0)continue;let x=c/s*mn;d.push({node:p,startAngle:u,endAngle:u+x,depth:0,colorIndex:h}),u+=x}}else return i.push({startAngle:0,endAngle:mn,innerR:t,outerR:t+a,label:e.label,value:s,color:e.color??r[0],depth:0}),i;for(;d.length>0;){let u=d.shift(),{node:h,startAngle:p,endAngle:c,depth:x,colorIndex:m}=u,y=tt(h);if(y<=0)continue;let g=t+x*a,f=g+a;if(i.push({startAngle:p,endAngle:c,innerR:g,outerR:f,label:h.label,value:y,color:h.color??r[m%r.length],depth:x}),h.children&&h.children.length>0){let b=p,S=c-p;for(let E=0;E<h.children.length;E++){let k=h.children[E],v=tt(k);if(v<=0)continue;let z=v/y*S;d.push({node:k,startAngle:b,endAngle:b+z,depth:x+1,colorIndex:m}),b+=z}}}return i}function yi(e){let{data:t,width:n=500,height:r=500,innerRadius:i=40,showLabels:s=!0,colors:l=Ec,strokeColor:a="#ffffff",strokeWidth:d=1,title:u}=e,h=n/2,p=r/2,c=u?20:0,x=Math.min(h,p-c)-10;if(q(()=>tt(t),[t])<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Empty sunburst chart"},o("text",{x:String(h),y:String(p),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let y=q(()=>zc(t,i,x,l),[t,i,x,l]),g=[];u&&g.push(o("text",{key:"title",x:String(h),y:String(20),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},u));let f=p+c/2;for(let b=0;b<y.length;b++){let S=y[b],E=Rc(h,f,S.innerR,S.outerR,S.startAngle,S.endAngle);if(g.push(o("path",{key:`arc-${b}`,d:E,fill:S.color,stroke:a,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${S.label}: ${S.value}`})),s){let k=S.endAngle-S.startAngle,v=S.startAngle+k/2-Math.PI/2,z=(S.innerR+S.outerR)/2,C=S.outerR-S.innerR,$=k*z;if($>20&&C>14){let P=h+z*Math.cos(v),W=f+z*Math.sin(v),A=Math.floor(Math.min($,C)/7),H=S.label.length>A?S.label.substring(0,Math.max(1,A-1))+"..":S.label;g.push(o("text",{key:`label-${b}`,x:String(P),y:String(W+4),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},H))}}}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":u??"Sunburst chart",style:{fontFamily:"sans-serif"}},...g)}var Tc=["#3b82f6","#22c55e","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"];function Pt(e){if(!e.children||e.children.length===0)return Math.max(0,e.value);let t=0,n=[e];for(;n.length>0;){let r=n.pop();if(!r.children||r.children.length===0)t+=Math.max(0,r.value);else for(let i=r.children.length-1;i>=0;i--)n.push(r.children[i])}return t}function Si(e,t){if(e.length===0||t<=0)return 1/0;let n=0;for(let s of e)n+=s;if(n<=0)return 1/0;let r=n/t,i=0;for(let s of e){if(s<=0)continue;let l=s/r,a=Math.max(l/r,r/l);a>i&&(i=a)}return i}function Ic(e,t,n,r,i,s){let l=[],a=[],d=Pt(e);if(d<=0||r<=0||i<=0)return l;let u=e.children&&e.children.length>0?e.children:[e],h=r*i,p=[];for(let c=0;c<u.length;c++){let x=u[c],m=Pt(x);m<=0||p.push({label:x.label,value:m,area:m/d*h,color:x.color??s[c%s.length],node:x})}for(p.sort((c,x)=>x.area-c.area),a.push({nodes:p,rect:{x:t,y:n,w:r,h:i},depth:0});a.length>0;){let c=a.shift(),{nodes:x,rect:m,depth:y}=c;if(x.length===0)continue;let g={...m},f=0;for(;f<x.length&&g.w>0&&g.h>0;){let b=g.w>=g.h,S=b?g.h:g.w,E=[],k=[];E.push(x[f]),k.push(x[f].area),f++;let v=Si(k,S);for(;f<x.length;){let P=[...k,x[f].area],W=Si(P,S);if(W>v)break;E.push(x[f]),k.push(x[f].area),v=W,f++}let z=0;for(let P of k)z+=P;let C=S>0?z/S:0,$=0;for(let P=0;P<E.length;P++){let W=E[P],A=C>0?W.area/C:0,H,L,T,w;if(b?(H=g.x,L=g.y+$,T=C,w=A):(H=g.x+$,L=g.y,T=A,w=C),l.push({x:H,y:L,w:T,h:w,label:W.label,value:W.value,color:W.color,depth:y}),W.node.children&&W.node.children.length>0){let R=H+2,F=L+2+14,I=T-4,N=w-4-14;if(I>4&&N>4){let B=[],V=W.value,G=I*N;for(let K=0;K<W.node.children.length;K++){let ee=W.node.children[K],J=Pt(ee);J<=0||B.push({label:ee.label,value:J,area:J/V*G,color:ee.color??s[(K+y+1)%s.length],node:ee})}B.sort((K,ee)=>ee.area-K.area),a.push({nodes:B,rect:{x:R,y:F,w:I,h:N},depth:y+1})}}$+=A}b?g={x:g.x+C,y:g.y,w:g.w-C,h:g.h}:g={x:g.x,y:g.y+C,w:g.w,h:g.h-C}}}return l}function vi(e){let{data:t,width:n=600,height:r=400,showLabels:i=!0,showValues:s=!0,colors:l=Tc,borderColor:a="#ffffff",borderWidth:d=2,padding:u=2,title:h}=e,p=h?30:0,c=u,x=u+p,m=n-u*2,y=r-u*2-p;if(q(()=>Pt(t),[t])<=0||m<=0||y<=0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Empty treemap"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data to display"));let f=q(()=>Ic(t,c,x,m,y,l),[t,c,x,m,y,l]),b=[];h&&b.push(o("text",{key:"title",x:String(n/2),y:String(u+16),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},h));for(let S=0;S<f.length;S++){let E=f[S];if(b.push(o("rect",{key:`cell-${S}`,x:String(E.x),y:String(E.y),width:String(Math.max(0,E.w)),height:String(Math.max(0,E.h)),fill:E.color,stroke:a,"stroke-width":String(d),role:"graphics-symbol","aria-label":`${E.label}: ${E.value}`})),i&&E.w>20&&E.h>14){let k=Math.floor(E.w/7),v=E.label.length>k?E.label.substring(0,Math.max(1,k-2))+"..":E.label;b.push(o("text",{key:`label-${S}`,x:String(E.x+4),y:String(E.y+12),"font-size":"11","font-family":"sans-serif",fill:"#ffffff","pointer-events":"none"},v))}s&&E.w>30&&E.h>28&&b.push(o("text",{key:`value-${S}`,x:String(E.x+4),y:String(E.y+24),"font-size":"10","font-family":"sans-serif",fill:"rgba(255,255,255,0.8)","pointer-events":"none"},String(E.value)))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":h??"Treemap chart",style:{fontFamily:"sans-serif"}},...b)}function wi(e){let t=e.replace("#",""),n,r,i;return t.length===3?(n=parseInt(t[0]+t[0],16),r=parseInt(t[1]+t[1],16),i=parseInt(t[2]+t[2],16)):(n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16)),{r:isNaN(n)?0:n,g:isNaN(r)?0:r,b:isNaN(i)?0:i}}function Dc(e,t,n){let r=s=>Math.max(0,Math.min(255,Math.round(s))),i=s=>r(s).toString(16).padStart(2,"0");return"#"+i(e)+i(t)+i(n)}function ki(e,t){if(t.length===0)return"#3b82f6";if(t.length===1)return t[0];let n=Math.max(0,Math.min(1,e)),r=t.length-1,i=n*r,s=Math.floor(i),l=Math.min(s+1,r),a=i-s,d=wi(t[s]),u=wi(t[l]);return Dc(d.r+(u.r-d.r)*a,d.g+(u.g-d.g)*a,d.b+(u.b-d.b)*a)}function Et(e,t){if(e<=0)return 1;let n=e/t,r=Math.pow(10,Math.floor(Math.log10(n))),i=n/r;return i<=1.5?r:i<=3.5?2*r:i<=7.5?5*r:10*r}function Ac(e,t,n,r,i,s,l,a,d,u){if(e&&e.length>0)return e;let h=Math.max(2,Math.min(50,r)),p=d/(h-1),c=u/(h-1);if(n){let m=[];for(let b=0;b<h;b++)for(let S=0;S<h;S++)m.push({x:i+S*p,y:l+b*c});let g=n(m,{gridSize:h,xMin:i,xMax:s,yMin:l,yMax:a}),f=[];for(let b=0;b<m.length;b++){let S=m[b],E=g[b]??{dx:0,dy:0},k=Math.sqrt(E.dx*E.dx+E.dy*E.dy);f.push({x:S.x,y:S.y,dx:E.dx,dy:E.dy,magnitude:k})}return f}if(!t)return[];let x=[];for(let m=0;m<h;m++)for(let y=0;y<h;y++){let g=i+y*p,f=l+m*c,b=t(g,f),S=Math.sqrt(b.dx*b.dx+b.dy*b.dy);x.push({x:g,y:f,dx:b.dx,dy:b.dy,magnitude:S})}return x}function Lc(e,t,n,r,i){let{padding:s,chartWidth:l,chartHeight:a,xMin:d,xMax:u,yMin:h,yMax:p,xSpan:c,ySpan:x,showGrid:m,showAxes:y,colorByMagnitude:g,colorScale:f,arrowColor:b,arrowWidth:S,effectiveArrowScale:E,maxMagnitude:k,title:v,tickFontSize:z}=i,C=W=>s+(W-d)/c*l,$=W=>s+(p-W)/x*a;if(e.clearRect(0,0,t,n),v&&(e.save(),e.font="bold 16px sans-serif",e.fillStyle="#111827",e.textAlign="center",e.textBaseline="middle",e.fillText(v,t/2,s/2+4),e.restore()),m){e.save(),e.strokeStyle="#e5e7eb",e.lineWidth=.5,e.font=`${z}px sans-serif`,e.fillStyle="#6b7280";let W=Et(c,10),A=Math.ceil(d/W)*W;for(let T=A;T<=u;T+=W){let w=C(T);e.beginPath(),e.moveTo(w,s),e.lineTo(w,s+a),e.stroke(),e.textAlign="center",e.textBaseline="top",e.fillText(String(Math.round(T*100)/100),w,s+a+4)}let H=Et(x,10),L=Math.ceil(h/H)*H;for(let T=L;T<=p;T+=H){let w=$(T);e.beginPath(),e.moveTo(s,w),e.lineTo(s+l,w),e.stroke(),e.textAlign="right",e.textBaseline="middle",e.fillText(String(Math.round(T*100)/100),s-6,w)}e.restore()}if(y){if(e.save(),e.strokeStyle="#374151",e.lineWidth=S,h<=0&&p>=0){let W=$(0);e.beginPath(),e.moveTo(s,W),e.lineTo(s+l,W),e.stroke()}if(d<=0&&u>=0){let W=C(0);e.beginPath(),e.moveTo(W,s),e.lineTo(W,s+a),e.stroke()}e.strokeStyle="#d1d5db",e.lineWidth=1,e.strokeRect(s,s,l,a),e.restore()}let P=4;for(let W=0;W<r.length;W++){let A=r[W],H=A.magnitude??Math.sqrt(A.dx*A.dx+A.dy*A.dy);if(H<1e-10)continue;let L=C(A.x),T=$(A.y),w=A.dx*E,D=-A.dy*E,R=L+w,F=T+D,I;if(g){let B=H/k;I=ki(B,f)}else I=b;e.save(),e.strokeStyle=I,e.lineWidth=S,e.lineCap="round",e.beginPath(),e.moveTo(L,T),e.lineTo(R,F),e.stroke();let N=Math.sqrt(w*w+D*D);if(N>2){let B=w/N,V=D/N,G=-V,K=B,ee=Math.min(P,N*.4),J=R-B*ee+G*ee*.5,Y=F-V*ee+K*ee*.5,U=R-B*ee-G*ee*.5,O=F-V*ee-K*ee*.5;e.fillStyle=I,e.beginPath(),e.moveTo(R,F),e.lineTo(J,Y),e.lineTo(U,O),e.closePath(),e.fill()}e.restore()}}function Ci(e){let{data:t,vectorFunction:n,width:r=600,height:i=600,gridSize:s=15,xRange:l=[-5,5],yRange:a=[-5,5],arrowScale:d=1,arrowColor:u="#3b82f6",showGrid:h=!0,showAxes:p=!0,colorByMagnitude:c=!1,colorScale:x=["#3b82f6","#8b5cf6","#ef4444"],title:m,padding:y=50,tickFontSize:g=10,arrowWidth:f=1.5,renderer:b="svg",useGPU:S=!1,computeWorker:E}=e,k=Math.max(2,Math.min(50,s)),v=r-y*2,z=i-y*2,C=l[0],$=l[1],P=a[0],W=a[1],A=$-C,H=W-P,L=q(()=>J=>y+(J-C)/A*v,[y,C,A,v]),T=q(()=>J=>y+(W-J)/H*z,[y,W,H,z]),w=q(()=>Ac(t,n,E,k,C,$,P,W,A,H),[t,n,E,k,C,$,P,W,A,H]),D=q(()=>{let J=0;for(let Y=0;Y<w.length;Y++){let U=w[Y],O=U.magnitude??Math.sqrt(U.dx*U.dx+U.dy*U.dy);O>J&&(J=O)}return J>0?J:1},[w]),R=q(()=>Math.min(v,z)/Math.max(k,2)/(2*D)*d,[v,z,k,D,d]);if(b==="canvas"){let J=ie(null),Y=ie(0);return se(()=>{let U=J.current;if(!U)return;let O=U.getContext("2d");if(O)return Y.current&&cancelAnimationFrame(Y.current),Y.current=requestAnimationFrame(()=>{Lc(O,r,i,w,{padding:y,chartWidth:v,chartHeight:z,xMin:C,xMax:$,yMin:P,yMax:W,xSpan:A,ySpan:H,showGrid:h,showAxes:p,colorByMagnitude:c,colorScale:x,arrowColor:u,arrowWidth:f,effectiveArrowScale:R,maxMagnitude:D,title:m,tickFontSize:g})}),()=>{Y.current&&cancelAnimationFrame(Y.current)}},[w,r,i,y,v,z,C,$,P,W,A,H,h,p,c,x,u,f,R,D,m,g]),o("canvas",{ref:J,width:r,height:i,role:"img","aria-label":m??"Vector field plot",style:{fontFamily:"sans-serif",maxWidth:"100%"}})}let F=M(()=>{if(!h)return[];let J=[],Y=Et(A,10),U=Math.ceil(C/Y)*Y;for(let Z=U;Z<=$;Z+=Y){let Q=L(Z);J.push(o("line",{key:`gridv-${Z}`,x1:String(Q),y1:String(y),x2:String(Q),y2:String(y+z),stroke:"#e5e7eb","stroke-width":"0.5"})),J.push(o("text",{key:`xtick-${Z}`,x:String(Q),y:String(y+z+16),"text-anchor":"middle","font-size":String(g),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}let O=Et(H,10),_=Math.ceil(P/O)*O;for(let Z=_;Z<=W;Z+=O){let Q=T(Z);J.push(o("line",{key:`gridh-${Z}`,x1:String(y),y1:String(Q),x2:String(y+v),y2:String(Q),stroke:"#e5e7eb","stroke-width":"0.5"})),J.push(o("text",{key:`ytick-${Z}`,x:String(y-6),y:String(Q+4),"text-anchor":"end","font-size":String(g),"font-family":"sans-serif",fill:"#6b7280"},String(Math.round(Z*100)/100)))}return J},[h,C,$,P,W,A,H,L,T,y,v,z]),I=M(()=>{if(!p)return[];let J=[];if(P<=0&&W>=0){let Y=T(0);J.push(o("line",{key:"axis-x",x1:String(y),y1:String(Y),x2:String(y+v),y2:String(Y),stroke:"#374151","stroke-width":String(f)}))}if(C<=0&&$>=0){let Y=L(0);J.push(o("line",{key:"axis-y",x1:String(Y),y1:String(y),x2:String(Y),y2:String(y+z),stroke:"#374151","stroke-width":String(f)}))}return J.push(o("rect",{key:"chart-border",x:String(y),y:String(y),width:String(v),height:String(z),fill:"none",stroke:"#d1d5db","stroke-width":"1"})),J},[p,C,$,P,W,L,T,y,v,z]),N=M(()=>{let J=[];for(let U=0;U<w.length;U++){let O=w[U],_=O.magnitude??Math.sqrt(O.dx*O.dx+O.dy*O.dy);if(_<1e-10)continue;let Z=L(O.x),Q=T(O.y),oe=O.dx*R,j=-O.dy*R,te=Z+oe,re=Q+j,le;if(c){let ce=_/D;le=ki(ce,x)}else le=u;J.push(o("line",{key:`arrow-line-${U}`,x1:String(Z),y1:String(Q),x2:String(te),y2:String(re),stroke:le,"stroke-width":String(f),"stroke-linecap":"round"}));let ne=Math.sqrt(oe*oe+j*j);if(ne>2){let ce=oe/ne,de=j/ne,ae=-de,ue=ce,ge=Math.min(4,ne*.4),ve=te-ce*ge+ae*ge*.5,we=re-de*ge+ue*ge*.5,ke=te-ce*ge-ae*ge*.5,Ce=re-de*ge-ue*ge*.5;J.push(o("polygon",{key:`arrow-head-${U}`,points:`${te},${re} ${ve},${we} ${ke},${Ce}`,fill:le}))}}return J},[w,L,T,R,c,D,x,u]),B=M(()=>m?[o("text",{key:"title",x:String(r/2),y:String(y/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},m)]:[],[m,r,y]),V=F(),G=I(),K=N(),ee=B();return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":m??"Vector field plot",style:{fontFamily:"sans-serif"}},...ee,...V,...G,...K)}function Fc(e){let t=[],n=0;for(let r=0;r<e.length;r++){let i=e[r],s=i.type??(i.value>=0?"increase":"decrease");if(s==="total")t.push({label:i.label,value:n,type:"total",start:0,end:n});else{let l=n;n+=i.value,t.push({label:i.label,value:i.value,type:s,start:l,end:n})}}return t}function Wc(e){if(e<=0)return 1;let t=e/5,n=Math.pow(10,Math.floor(Math.log10(t))),r=t/n;return r<=1.5?n:r<=3.5?2*n:r<=7.5?5*n:10*n}function Mi(e){let{data:t=[],width:n=600,height:r=400,increaseColor:i="#10b981",decreaseColor:s="#ef4444",totalColor:l="#3b82f6",connectorColor:a="#94a3b8",showValues:d=!0,showGrid:u=!0,showConnectors:h=!0,title:p,padding:c=60}=e,x=n-c*2,m=r-c*2,y=q(()=>Fc(t),[t]),{minVal:g,maxVal:f}=q(()=>{let D=0,R=0;for(let F=0;F<y.length;F++){let I=y[F];I.start<D&&(D=I.start),I.end<D&&(D=I.end),I.start>R&&(R=I.start),I.end>R&&(R=I.end)}return D===R&&(R=D+1),{minVal:D,maxVal:R}},[y]),b=f-g,S=M(D=>c+m-(D-g)/b*m,[c,m,g,b]),E=q(()=>y.length===0?0:x/y.length,[y.length,x]),k=6,v=Math.max(1,E-k),z=M(()=>{if(!u)return[];let D=Wc(b),R=[],F=Math.ceil(g/D)*D;for(let I=F;I<=f;I+=D){let N=S(I);R.push(o("line",{key:`grid-${I}`,x1:String(c),y1:String(N),x2:String(c+x),y2:String(N),stroke:"#e5e7eb","stroke-width":"1","stroke-dasharray":"4 2"})),R.push(o("text",{key:`grid-label-${I}`,x:String(c-8),y:String(N+4),"text-anchor":"end","font-size":"11","font-family":"sans-serif",fill:"#6b7280"},String(I)))}return R},[u,b,g,f,S,c,x]),C=M(()=>{let D=[];D.push(o("line",{key:"axis-y",x1:String(c),y1:String(c),x2:String(c),y2:String(c+m),stroke:"#374151","stroke-width":"1.5"}));let R=g<=0&&f>=0?S(0):c+m;return D.push(o("line",{key:"axis-x",x1:String(c),y1:String(R),x2:String(c+x),y2:String(R),stroke:"#374151","stroke-width":"1.5"})),D},[c,x,m,g,f,S]),$=M(()=>{if(y.length===0)return[];let D=[];for(let R=0;R<y.length;R++){let F=y[R],I=c+R*E+k/2,N=Math.max(F.start,F.end),B=Math.min(F.start,F.end),V=S(N),G=S(B),K=Math.max(0,G-V),ee;if(F.type==="total"?ee=l:F.type==="decrease"?ee=s:ee=i,D.push(o("rect",{key:`bar-${R}`,x:String(I),y:String(V),width:String(v),height:String(K),fill:ee,rx:"2",ry:"2"})),d){let J=F.type==="decrease"||F.value<0?G+14:V-4,Y=F.type==="total"?String(F.value):(F.value>=0?"+":"")+String(F.value);D.push(o("text",{key:`val-${R}`,x:String(I+v/2),y:String(J),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},Y))}if(D.push(o("text",{key:`cat-${R}`,x:String(I+v/2),y:String(c+m+16),"text-anchor":"middle","font-size":"10","font-family":"sans-serif",fill:"#374151"},F.label)),h&&R<y.length-1){let J=y[R+1],Y=S(F.end),U=c+(R+1)*E+k/2;J.type!=="total"&&D.push(o("line",{key:`conn-${R}`,x1:String(I+v),y1:String(Y),x2:String(U),y2:String(Y),stroke:a,"stroke-width":"1","stroke-dasharray":"3 2"}))}}return D},[y,E,v,S,i,s,l,a,d,h,c,m]),P=M(()=>p?[o("text",{key:"title",x:String(n/2),y:String(c/2+4),"text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":"sans-serif",fill:"#111827"},p)]:[],[p,n,c]),W=M(()=>t.length>0?[]:[o("text",{key:"empty",x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":"sans-serif",fill:"#9ca3af"},"No data")],[t.length,n,r]),A=z(),H=C(),L=$(),T=P(),w=W();return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Waterfall chart",style:{fontFamily:"sans-serif"}},...T,...A,...H,...L,...w)}var Nc=["#3b82f6","#ef4444","#22c55e","#f59e0b","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1","#84cc16"],Bc=[0,-45,45,90];function Hc(e,t,n,r,i){let s=t*.6,l=e.length*s,a=t,d=n*Math.PI/180,u=Math.abs(Math.cos(d)),h=Math.abs(Math.sin(d)),p=l*u+a*h,c=l*h+a*u;return{x:r-p/2,y:i-c/2,w:p,h:c}}function _c(e,t){return!(e.x+e.w<t.x||t.x+t.w<e.x||e.y+e.h<t.y||t.y+t.h<e.y)}function Oc(e,t,n){return e.x>=0&&e.y>=0&&e.x+e.w<=t&&e.y+e.h<=n}function Vc(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}function Pi(e){let{words:t=[],width:n=600,height:r=400,minFontSize:i=10,maxFontSize:s=64,fontFamily:l="sans-serif",colors:a=Nc,rotations:d=Bc,padding:u=4,spiral:h="archimedean",title:p}=e,c=q(()=>{if(t.length===0)return[];let m=t.map((v,z)=>({...v,originalIndex:z})).filter(v=>v.text.length>0&&v.weight>0).sort((v,z)=>z.weight-v.weight);if(m.length===0)return[];let y=m[m.length-1].weight,f=m[0].weight-y;function b(v){if(f===0)return(i+s)/2;let z=(v-y)/f;return i+z*(s-i)}let S=[],E=n/2,k=r/2;for(let v=0;v<m.length;v++){let z=m[v],C=b(z.weight),$=d[Vc(z.text)%d.length],P=z.color??a[v%a.length],W=!1,A=500,H=h==="archimedean"?4:5;for(let L=0;L<A;L++){let T,w;if(h==="archimedean"){let B=L*.1,V=H*B;T=V*Math.cos(B),w=V*Math.sin(B)}else{let B=Math.floor(L/4)+1,V=L%4,G=(L%4===0?0:L)*H;switch(V){case 0:T=B*H*4,w=G;break;case 1:T=-G,w=B*H*4;break;case 2:T=-B*H*4,w=-G;break;default:T=G,w=-B*H*4;break}}let D=E+T,R=k+w,F=Hc(z.text,C,$,D,R),I={x:F.x-u,y:F.y-u,w:F.w+u*2,h:F.h+u*2};if(!Oc(I,n,r))continue;let N=!1;for(let B of S)if(_c(I,B.bbox)){N=!0;break}if(!N){S.push({text:z.text,x:D,y:R,fontSize:C,rotation:$,color:P,bbox:I}),W=!0;break}}}return S},[t,n,r,i,s,a,d,u,h]);if(t.length===0||c.length===0)return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Word cloud \u2014 no data"},o("text",{x:String(n/2),y:String(r/2),"text-anchor":"middle","font-size":"14","font-family":l,fill:"currentColor",opacity:"0.6"},"No words to display."));let x=[];p&&x.push(o("text",{key:"title",x:String(n/2),y:"24","text-anchor":"middle","font-size":"16","font-weight":"bold","font-family":l,fill:"currentColor"},p));for(let m=0;m<c.length;m++){let y=c[m],g=y.rotation!==0?`translate(${y.x},${y.y}) rotate(${y.rotation})`:`translate(${y.x},${y.y})`;x.push(o("text",{key:`word-${m}`,transform:g,"text-anchor":"middle","dominant-baseline":"central","font-size":String(y.fontSize),"font-family":l,fill:y.color,"aria-label":y.text},y.text))}return o("svg",{width:"100%",viewBox:`0 0 ${n} ${r}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":p??"Word cloud",style:{fontFamily:l}},...x)}var Yc={0:"#1e293b",1:"#3b82f6"},Gc="#666";function Ei(e){let{data:t=[],colorMap:n,width:r=600,height:i=600,cellGap:s=1,cellRadius:l=0,showGrid:a=!1,gridColor:d="#334155",showIndices:u=!1,backgroundColor:h="#0f172a",padding:p=10,onCellClick:c,onCellHover:x,title:m}=e,y=n??Yc,g=t.length,f=q(()=>{let D=0;for(let R=0;R<t.length;R++){let F=t[R];F!==void 0&&F.length>D&&(D=F.length)}return D},[t]),b=u?20:0,S=m?24:0,E=q(()=>{let D=r-p*2-b,R=i-p*2-b-S;if(g===0||f===0)return{cellWidth:0,cellHeight:0};let F=Math.max(0,(D-s*(f-1))/f),I=Math.max(0,(R-s*(g-1))/g);return{cellWidth:F,cellHeight:I}},[r,i,p,g,f,s,b,S]),k=M(D=>{let R=y[D];return R!==void 0?R:Gc},[y]),v=M(()=>o("rect",{key:"bg",x:"0",y:"0",width:String(r),height:String(i),fill:h}),[r,i,h]),z=M(()=>m?[o("text",{key:"title",x:String(r/2),y:String(p+14),"text-anchor":"middle","font-size":"14","font-weight":"bold","font-family":"sans-serif",fill:"#e2e8f0"},m)]:[],[m,r,p]),C=M(()=>{if(!a||g===0||f===0)return[];let{cellWidth:D,cellHeight:R}=E,F=p+b,I=p+b+S,N=f*D+(f-1)*s,B=g*R+(g-1)*s,V=[];for(let G=0;G<=f;G++){let K=F+G*(D+s)-s/2;V.push(o("line",{key:`vgrid-${G}`,x1:String(K),y1:String(I-s/2),x2:String(K),y2:String(I+B+s/2),stroke:d,"stroke-width":"0.5"}))}for(let G=0;G<=g;G++){let K=I+G*(R+s)-s/2;V.push(o("line",{key:`hgrid-${G}`,x1:String(F-s/2),y1:String(K),x2:String(F+N+s/2),y2:String(K),stroke:d,"stroke-width":"0.5"}))}return V},[a,g,f,E,p,b,S,s,d]),$=M(()=>{if(!u||g===0||f===0)return[];let{cellWidth:D,cellHeight:R}=E,F=p+b,I=p+b+S,N=[];for(let B=0;B<f;B++){let V=F+B*(D+s)+D/2,G=I-6;N.push(o("text",{key:`col-idx-${B}`,x:String(V),y:String(G),"text-anchor":"middle","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(B)))}for(let B=0;B<g;B++){let V=F-6,G=I+B*(R+s)+R/2+3;N.push(o("text",{key:`row-idx-${B}`,x:String(V),y:String(G),"text-anchor":"end","font-size":"10","font-family":"monospace",fill:"#94a3b8"},String(B)))}return N},[u,g,f,E,p,b,S,s]),P=M(()=>{if(g===0||f===0)return[];let{cellWidth:D,cellHeight:R}=E,F=p+b,I=p+b+S,N=[];for(let B=0;B<g;B++){let V=t[B];if(V!==void 0)for(let G=0;G<f;G++){let K=G<V.length?V[G]:0,ee=F+G*(D+s),J=I+B*(R+s),Y=k(K),U={key:`cell-${B}-${G}`,x:String(ee),y:String(J),width:String(D),height:String(R),fill:Y,rx:String(l),ry:String(l)};if(c){let O=B,_=G,Z=K;U.onClick=()=>c(O,_,Z),U.role="button",U.tabIndex=0}if(x){let O=B,_=G,Z=K;U.onMouseEnter=()=>x(O,_,Z)}N.push(o("rect",U))}}return N},[g,f,t,E,p,b,S,s,l,k,c,x]),W=v(),A=z(),H=C(),L=$(),T=P(),w=m?`${m} \u2014 ${g}x${f} discrete grid`:`${g}x${f} discrete grid`;return o("svg",{width:"100%",viewBox:`0 0 ${r} ${i}`,preserveAspectRatio:"xMidYMid meet",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":w},W,...A,...H,...L,...T)}
2
9
  //# sourceMappingURL=specifyjs-components.cjs.js.map