@synnaxlabs/pluto 0.49.0 → 0.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (500) hide show
  1. package/dist/{Animated-Dsn1pmhz.cjs → Animated-Bm-WM4BW.cjs} +1 -1
  2. package/dist/Animated-DpzwlYqX.cjs +1 -0
  3. package/dist/{Animated-38tdmPR0.js → Animated-DxBr38YY.js} +50 -50
  4. package/dist/{Animated-Bp6IK3ct.js → Animated-eavjaVoD.js} +3 -3
  5. package/dist/{Box-4l6DWG-3.cjs → Box-D27bV7QJ.cjs} +1 -1
  6. package/dist/{Box-BVyAHr2f.js → Box-DLO7l9hM.js} +9 -9
  7. package/dist/Button-Cj2hR9EM.cjs +1 -0
  8. package/dist/{Button-CoOYEk1J.js → Button-DulIBpNI.js} +98 -98
  9. package/dist/{Dialog-puVY-0Mt.js → Dialog-CwTHvHHD.js} +3 -3
  10. package/dist/{Dialog-JwJQD3xZ.cjs → Dialog-DJJQBUgw.cjs} +1 -1
  11. package/dist/{Editable-DI0-D1K5.cjs → Editable-C-z-stcD.cjs} +1 -1
  12. package/dist/{Editable-DEbVpi5i.js → Editable-DjQORuR1.js} +3 -3
  13. package/dist/{Haul-Db9j45Fu.js → Haul-CofQrOeX.js} +24 -24
  14. package/dist/Haul-gTF4QDh3.cjs +1 -0
  15. package/dist/{Items-BVKW0udb.js → Items-B5aeU-Pt.js} +22 -22
  16. package/dist/{Items-BCG7kyaR.cjs → Items-DjAwxhhi.cjs} +2 -2
  17. package/dist/Menu-Bjfeoaln.js +135 -0
  18. package/dist/Menu-BqfIul2o.cjs +1 -0
  19. package/dist/{Provider-DQM7IBoi.js → Provider-BoQtgQtU.js} +394 -318
  20. package/dist/Provider-CKROy_xK.cjs +1 -0
  21. package/dist/{Tags-CQFa3kY-.cjs → Tags-B3m_Kzbp.cjs} +1 -1
  22. package/dist/{Tags-B8l5Dvw-.js → Tags-C38F7I5z.js} +173 -173
  23. package/dist/Text-IFQH97iK.cjs +1 -0
  24. package/dist/{Text-90J6p5Uj.js → Text-TzKJ38En.js} +611 -591
  25. package/dist/{Video-CLpcYcKf.js → Video-C56z7qvH.js} +1 -1
  26. package/dist/{Video-Bmg4gwom.cjs → Video-CBPTBLTB.cjs} +1 -1
  27. package/dist/button.cjs +1 -1
  28. package/dist/button.js +1 -1
  29. package/dist/color.cjs +1 -1
  30. package/dist/color.js +1 -1
  31. package/dist/{css-bahPRiQI.js → css-BkBrZtKZ.js} +562 -569
  32. package/dist/{css-BVgFAmaj.cjs → css-D3NdC2sx.cjs} +4 -4
  33. package/dist/css.cjs +1 -1
  34. package/dist/css.js +2 -2
  35. package/dist/dialog.cjs +1 -1
  36. package/dist/dialog.js +1 -1
  37. package/dist/{dimensions-SDA3fM2T.cjs → dimensions-C7b02rFi.cjs} +1 -1
  38. package/dist/{dimensions-qcyzaTKI.js → dimensions-qj2CkPTy.js} +6 -6
  39. package/dist/{eraser-Dz6nZuPp.js → eraser-Bd14L_5k.js} +38 -38
  40. package/dist/{eraser-Cbfc1frM.cjs → eraser-DZxY0pWe.cjs} +3 -3
  41. package/dist/ether.cjs +1 -1
  42. package/dist/ether.js +54 -55
  43. package/dist/{external-m-0q-0os.js → external-6HkYP0wd.js} +5 -5
  44. package/dist/external-B0R_yw6F.cjs +84 -0
  45. package/dist/{external-CwYoEhB2.cjs → external-B3o5P8Yw.cjs} +1 -1
  46. package/dist/{external-Bixqkw5N.cjs → external-BIW55htp.cjs} +1 -1
  47. package/dist/{external-TI-6Umwm.js → external-BKkDVUP_.js} +6 -6
  48. package/dist/{external-D2tzyCDs.cjs → external-BU5fnKG8.cjs} +1 -1
  49. package/dist/{external-PA6ulZR9.cjs → external-BWI-FZRf.cjs} +1 -1
  50. package/dist/{external-04ve_X21.js → external-Bl8zTvKt.js} +14 -14
  51. package/dist/{external-xJ67ivgR.js → external-BoAcV4dI.js} +3 -3
  52. package/dist/{external-CrXS1qj_.js → external-BsdKmL37.js} +13386 -12955
  53. package/dist/{external-B3b7kdID.cjs → external-CUHCzUJE.cjs} +1 -1
  54. package/dist/{external-DJWZ43k0.js → external-CVzhqlPH.js} +1 -1
  55. package/dist/{external-kwuGKgyL.cjs → external-CkwpcNCW.cjs} +1 -1
  56. package/dist/{external-CMs_BCc5.cjs → external-D4rp1QBE.cjs} +2 -2
  57. package/dist/external-D7qXEQQM.cjs +1 -0
  58. package/dist/{external-DUVDOJfj.cjs → external-DAmwuDsu.cjs} +1 -1
  59. package/dist/{external-D2deiHyL.js → external-DCZMzNZX.js} +10 -9
  60. package/dist/{external-CB3VxPJp.js → external-DKc3PiyN.js} +24 -24
  61. package/dist/external-DPow1FDR.cjs +1 -0
  62. package/dist/external-DlHNhR1y.cjs +1 -0
  63. package/dist/{external-CnWQzZlQ.js → external-DqaHmzvp.js} +69 -68
  64. package/dist/{external-Hhx8JoAS.js → external-DrcMI5oa.js} +12 -12
  65. package/dist/{external-DP9FiRHq.js → external-MvcifV4O.js} +3 -3
  66. package/dist/{external-Cxojc4yT.js → external-gDa9Z0SY.js} +11 -11
  67. package/dist/flex.cjs +1 -1
  68. package/dist/flex.js +1 -1
  69. package/dist/{fontString-qfWSw62X.js → fontString-BtjO8Met.js} +3 -3
  70. package/dist/{fontString-62eEvw4b.cjs → fontString-CeR_vHX_.cjs} +1 -1
  71. package/dist/header.cjs +1 -1
  72. package/dist/header.js +1 -1
  73. package/dist/{hooks-Dh0v1QWQ.js → hooks-Ddqh5NVY.js} +25 -25
  74. package/dist/hooks-Dxvxse16.cjs +1 -0
  75. package/dist/index.cjs +23 -15
  76. package/dist/index.js +11132 -10768
  77. package/dist/input.cjs +1 -1
  78. package/dist/input.js +1 -1
  79. package/dist/list.cjs +1 -1
  80. package/dist/list.js +1 -1
  81. package/dist/menu.cjs +1 -1
  82. package/dist/menu.js +1 -1
  83. package/dist/pluto.css +1 -1
  84. package/dist/provider-BmDwHwF4.cjs +78 -0
  85. package/dist/{provider-ClhgBr_F.js → provider-CfFukcDe.js} +3984 -3662
  86. package/dist/src/access/policy/Select.d.ts.map +1 -1
  87. package/dist/src/access/policy/aether/queries.d.ts.map +1 -1
  88. package/dist/src/access/policy/queries.d.ts +8 -6
  89. package/dist/src/access/policy/queries.d.ts.map +1 -1
  90. package/dist/src/access/role/Select.d.ts +2 -2
  91. package/dist/src/access/role/Select.d.ts.map +1 -1
  92. package/dist/src/access/role/queries.d.ts +2 -2
  93. package/dist/src/access/role/queries.d.ts.map +1 -1
  94. package/dist/src/aether/aether/aether.d.ts +86 -10
  95. package/dist/src/aether/aether/aether.d.ts.map +1 -1
  96. package/dist/src/aether/aether/aether.spec.d.ts.map +1 -1
  97. package/dist/src/aether/main.d.ts +34 -11
  98. package/dist/src/aether/main.d.ts.map +1 -1
  99. package/dist/src/aether/message.d.ts +31 -6
  100. package/dist/src/aether/message.d.ts.map +1 -1
  101. package/dist/src/aether/test/index.d.ts +2 -0
  102. package/dist/src/aether/test/index.d.ts.map +1 -0
  103. package/dist/src/aether/test/provider.d.ts +4 -0
  104. package/dist/src/aether/test/provider.d.ts.map +1 -0
  105. package/dist/src/aether/test/provider.spec.d.ts +2 -0
  106. package/dist/src/aether/test/provider.spec.d.ts.map +1 -0
  107. package/dist/src/arc/handle/Base.d.ts +8 -0
  108. package/dist/src/arc/handle/{Core.d.ts.map → Base.d.ts.map} +1 -1
  109. package/dist/src/arc/handle/Sink.d.ts +2 -2
  110. package/dist/src/arc/handle/Source.d.ts +2 -2
  111. package/dist/src/arc/queries.d.ts +33 -10
  112. package/dist/src/arc/queries.d.ts.map +1 -1
  113. package/dist/src/button/Button.d.ts +2 -2
  114. package/dist/src/button/Button.d.ts.map +1 -1
  115. package/dist/src/button/Toggle.d.ts.map +1 -1
  116. package/dist/src/channel/LinePlot.d.ts +7 -6
  117. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  118. package/dist/src/channel/Select.d.ts.map +1 -1
  119. package/dist/src/channel/queries.d.ts +6 -5
  120. package/dist/src/channel/queries.d.ts.map +1 -1
  121. package/dist/src/color/BaseSwatch.d.ts.map +1 -1
  122. package/dist/src/color/Picker.d.ts.map +1 -1
  123. package/dist/src/color/Swatch.d.ts.map +1 -1
  124. package/dist/src/component/SelectSize.d.ts.map +1 -1
  125. package/dist/src/css/bem.d.ts +2 -2
  126. package/dist/src/css/css.d.ts +1 -1
  127. package/dist/src/device/Select.d.ts.map +1 -1
  128. package/dist/src/device/queries.d.ts +8 -8
  129. package/dist/src/device/queries.d.ts.map +1 -1
  130. package/dist/src/dialog/Frame.d.ts.map +1 -1
  131. package/dist/src/direction/Select.d.ts +2 -2
  132. package/dist/src/direction/Select.d.ts.map +1 -1
  133. package/dist/src/errors/Boundary.d.ts +29 -0
  134. package/dist/src/errors/Boundary.d.ts.map +1 -0
  135. package/dist/src/errors/Fallback.d.ts +32 -0
  136. package/dist/src/errors/Fallback.d.ts.map +1 -0
  137. package/dist/src/errors/errors.spec.d.ts +2 -0
  138. package/dist/src/errors/errors.spec.d.ts.map +1 -0
  139. package/dist/src/errors/external.d.ts +3 -0
  140. package/dist/src/errors/external.d.ts.map +1 -0
  141. package/dist/src/errors/index.d.ts +2 -0
  142. package/dist/src/errors/index.d.ts.map +1 -0
  143. package/dist/src/flux/Provider.d.ts +2 -2
  144. package/dist/src/flux/aether/external.d.ts +4 -4
  145. package/dist/src/flux/aether/provider.d.ts +7 -7
  146. package/dist/src/flux/{core → base}/client.d.ts.map +1 -1
  147. package/dist/src/flux/{core → base}/external.d.ts.map +1 -1
  148. package/dist/src/flux/base/index.d.ts +2 -0
  149. package/dist/src/flux/base/index.d.ts.map +1 -0
  150. package/dist/src/flux/{core → base}/store.d.ts.map +1 -1
  151. package/dist/src/flux/base/store.spec.d.ts.map +1 -0
  152. package/dist/src/flux/{core → base}/streamer.d.ts +1 -1
  153. package/dist/src/flux/{core → base}/streamer.d.ts.map +1 -1
  154. package/dist/src/flux/base/streamer.spec.d.ts.map +1 -0
  155. package/dist/src/flux/{core → base}/types.d.ts.map +1 -1
  156. package/dist/src/flux/external.d.ts +3 -3
  157. package/dist/src/flux/form.d.ts +13 -13
  158. package/dist/src/flux/form.d.ts.map +1 -1
  159. package/dist/src/flux/list.d.ts +11 -11
  160. package/dist/src/flux/list.d.ts.map +1 -1
  161. package/dist/src/flux/retrieve.d.ts +20 -20
  162. package/dist/src/flux/retrieve.d.ts.map +1 -1
  163. package/dist/src/flux/update.d.ts +23 -22
  164. package/dist/src/flux/update.d.ts.map +1 -1
  165. package/dist/src/form/Field.d.ts.map +1 -1
  166. package/dist/src/form/external.d.ts +0 -1
  167. package/dist/src/form/external.d.ts.map +1 -1
  168. package/dist/src/form/useField.d.ts.map +1 -1
  169. package/dist/src/group/queries.d.ts +5 -5
  170. package/dist/src/group/queries.d.ts.map +1 -1
  171. package/dist/src/haul/Haul.d.ts +3 -3
  172. package/dist/src/haul/Haul.d.ts.map +1 -1
  173. package/dist/src/header/ButtonTitle.d.ts.map +1 -1
  174. package/dist/src/icon/Icon.d.ts +1 -1
  175. package/dist/src/icon/Icon.d.ts.map +1 -1
  176. package/dist/src/icon/registry.d.ts +4 -0
  177. package/dist/src/icon/registry.d.ts.map +1 -1
  178. package/dist/src/index.d.ts +2 -1
  179. package/dist/src/index.d.ts.map +1 -1
  180. package/dist/src/input/Boolean.d.ts.map +1 -1
  181. package/dist/src/input/Date.d.ts.map +1 -1
  182. package/dist/src/input/DateTime.d.ts.map +1 -1
  183. package/dist/src/input/DragButton.d.ts.map +1 -1
  184. package/dist/src/input/HelpText.d.ts.map +1 -1
  185. package/dist/src/input/Label.d.ts.map +1 -1
  186. package/dist/src/input/Numeric.d.ts.map +1 -1
  187. package/dist/src/input/Text.d.ts.map +1 -1
  188. package/dist/src/input/Time.d.ts.map +1 -1
  189. package/dist/src/label/Select.d.ts.map +1 -1
  190. package/dist/src/label/queries.d.ts +3 -3
  191. package/dist/src/label/queries.d.ts.map +1 -1
  192. package/dist/src/lineplot/Axis.d.ts.map +1 -1
  193. package/dist/src/lineplot/Legend.d.ts +2 -2
  194. package/dist/src/lineplot/Line.d.ts +2 -2
  195. package/dist/src/lineplot/LinePlot.d.ts +9 -3
  196. package/dist/src/lineplot/LinePlot.d.ts.map +1 -1
  197. package/dist/src/lineplot/Viewport.d.ts +2 -2
  198. package/dist/src/lineplot/aether/LinePlot.d.ts +17 -5
  199. package/dist/src/lineplot/aether/LinePlot.d.ts.map +1 -1
  200. package/dist/src/lineplot/aether/XAxis.d.ts +2 -2
  201. package/dist/src/lineplot/aether/YAxis.d.ts +2 -2
  202. package/dist/src/lineplot/aether/axis.d.ts +4 -4
  203. package/dist/src/lineplot/aether/external.d.ts +0 -1
  204. package/dist/src/lineplot/aether/external.d.ts.map +1 -1
  205. package/dist/src/lineplot/external.d.ts +0 -1
  206. package/dist/src/lineplot/external.d.ts.map +1 -1
  207. package/dist/src/lineplot/queries.d.ts +3 -3
  208. package/dist/src/lineplot/queries.d.ts.map +1 -1
  209. package/dist/src/lineplot/range/Annotation.d.ts.map +1 -1
  210. package/dist/src/lineplot/tooltip/Tooltip.d.ts.map +1 -1
  211. package/dist/src/list/Frame.d.ts +2 -2
  212. package/dist/src/list/Frame.d.ts.map +1 -1
  213. package/dist/src/list/Items.d.ts.map +1 -1
  214. package/dist/src/list/useKeysData.d.ts.map +1 -1
  215. package/dist/src/log/Log.d.ts.map +1 -1
  216. package/dist/src/log/queries.d.ts +3 -3
  217. package/dist/src/log/queries.d.ts.map +1 -1
  218. package/dist/src/menu/ContextMenu.d.ts +3 -2
  219. package/dist/src/menu/ContextMenu.d.ts.map +1 -1
  220. package/dist/src/menu/Menu.d.ts.map +1 -1
  221. package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
  222. package/dist/src/nav/Bar.d.ts +3 -3
  223. package/dist/src/nav/Drawer.d.ts.map +1 -1
  224. package/dist/src/notation/Select.d.ts +2 -2
  225. package/dist/src/notation/Select.d.ts.map +1 -1
  226. package/dist/src/ontology/aether/queries.d.ts.map +1 -1
  227. package/dist/src/ontology/queries.d.ts +3 -3
  228. package/dist/src/ontology/queries.d.ts.map +1 -1
  229. package/dist/src/pluto/Pluto.d.ts +2 -0
  230. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  231. package/dist/src/rack/Select.d.ts.map +1 -1
  232. package/dist/src/rack/queries.d.ts +2 -2
  233. package/dist/src/rack/queries.d.ts.map +1 -1
  234. package/dist/src/ranger/Breadcrumb.d.ts +2 -2
  235. package/dist/src/ranger/Select.d.ts +2 -2
  236. package/dist/src/ranger/Select.d.ts.map +1 -1
  237. package/dist/src/ranger/SelectStage.d.ts.map +1 -1
  238. package/dist/src/ranger/queries.d.ts +5 -5
  239. package/dist/src/ranger/queries.d.ts.map +1 -1
  240. package/dist/src/resize/{Core.d.ts → Base.d.ts} +3 -3
  241. package/dist/src/resize/{Core.d.ts.map → Base.d.ts.map} +1 -1
  242. package/dist/src/resize/Single.d.ts +2 -2
  243. package/dist/src/resize/Single.d.ts.map +1 -1
  244. package/dist/src/resize/external.d.ts +1 -1
  245. package/dist/src/schematic/Schematic.d.ts.map +1 -1
  246. package/dist/src/schematic/edge/paths.d.ts.map +1 -1
  247. package/dist/src/schematic/queries.d.ts +5 -5
  248. package/dist/src/schematic/queries.d.ts.map +1 -1
  249. package/dist/src/schematic/symbol/Primitives.d.ts +5 -5
  250. package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -1
  251. package/dist/src/schematic/symbol/SelectOrientation.d.ts +2 -2
  252. package/dist/src/schematic/symbol/SelectOrientation.d.ts.map +1 -1
  253. package/dist/src/schematic/symbol/Symbols.d.ts +13 -13
  254. package/dist/src/schematic/symbol/Symbols.d.ts.map +1 -1
  255. package/dist/src/schematic/symbol/external.d.ts +1 -0
  256. package/dist/src/schematic/symbol/external.d.ts.map +1 -1
  257. package/dist/src/schematic/symbol/queries.d.ts +8 -6
  258. package/dist/src/schematic/symbol/queries.d.ts.map +1 -1
  259. package/dist/src/schematic/symbol/registry.d.ts +1 -1
  260. package/dist/src/select/Button.d.ts +3 -3
  261. package/dist/src/select/Button.d.ts.map +1 -1
  262. package/dist/src/select/Dialog.d.ts +3 -3
  263. package/dist/src/select/Dialog.d.ts.map +1 -1
  264. package/dist/src/select/Frame.d.ts +1 -1
  265. package/dist/src/select/Frame.d.ts.map +1 -1
  266. package/dist/src/select/Multiple.d.ts +3 -3
  267. package/dist/src/select/Multiple.d.ts.map +1 -1
  268. package/dist/src/select/MultipleTrigger.d.ts.map +1 -1
  269. package/dist/src/select/Single.d.ts.map +1 -1
  270. package/dist/src/select/Static.d.ts.map +1 -1
  271. package/dist/src/select/flex/Alignment.d.ts.map +1 -1
  272. package/dist/src/select/text/Level.d.ts +1 -1
  273. package/dist/src/select/text/Weight.d.ts +1 -1
  274. package/dist/src/select/use.d.ts.map +1 -1
  275. package/dist/src/showcase/InputShowcase.d.ts.map +1 -1
  276. package/dist/src/state/state.d.ts.map +1 -1
  277. package/dist/src/status/Select.d.ts +2 -2
  278. package/dist/src/status/Select.d.ts.map +1 -1
  279. package/dist/src/status/SelectVariant.d.ts +2 -2
  280. package/dist/src/status/SelectVariant.d.ts.map +1 -1
  281. package/dist/src/status/aether/aggregator.d.ts +1 -1
  282. package/dist/src/status/{core → base}/Aggregator.d.ts.map +1 -1
  283. package/dist/src/status/base/Aggregator.spec.d.ts.map +1 -0
  284. package/dist/src/status/{core → base}/CreateIcon.d.ts.map +1 -1
  285. package/dist/src/status/{core → base}/Indicator.d.ts.map +1 -1
  286. package/dist/src/status/{core → base}/Notification.d.ts.map +1 -1
  287. package/dist/src/status/base/Notification.spec.d.ts.map +1 -0
  288. package/dist/src/status/{core → base}/Summary.d.ts.map +1 -1
  289. package/dist/src/status/{core → base}/colors.d.ts.map +1 -1
  290. package/dist/src/status/{core → base}/external.d.ts.map +1 -1
  291. package/dist/src/status/base/index.d.ts.map +1 -0
  292. package/dist/src/status/external.d.ts +1 -1
  293. package/dist/src/status/queries.d.ts +3 -3
  294. package/dist/src/status/queries.d.ts.map +1 -1
  295. package/dist/src/steps/Steps.d.ts.map +1 -1
  296. package/dist/src/table/Table.d.ts.map +1 -1
  297. package/dist/src/table/cells/Forms.d.ts.map +1 -1
  298. package/dist/src/table/queries.d.ts +3 -3
  299. package/dist/src/table/queries.d.ts.map +1 -1
  300. package/dist/src/tabs/Selector.d.ts.map +1 -1
  301. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  302. package/dist/src/tag/Tag.d.ts.map +1 -1
  303. package/dist/src/task/queries.d.ts +7 -6
  304. package/dist/src/task/queries.d.ts.map +1 -1
  305. package/dist/src/telem/SelectDataType.d.ts.map +1 -1
  306. package/dist/src/telem/aether/context.d.ts +2 -2
  307. package/dist/src/telem/aether/context.d.ts.map +1 -1
  308. package/dist/src/telem/aether/factory.d.ts +2 -2
  309. package/dist/src/telem/aether/factory.d.ts.map +1 -1
  310. package/dist/src/telem/aether/provider.d.ts +4 -14
  311. package/dist/src/telem/aether/provider.d.ts.map +1 -1
  312. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  313. package/dist/src/telem/aether/test/external.d.ts +4 -0
  314. package/dist/src/telem/aether/test/external.d.ts.map +1 -0
  315. package/dist/src/telem/aether/test/factory.d.ts +11 -0
  316. package/dist/src/telem/aether/test/factory.d.ts.map +1 -0
  317. package/dist/src/telem/aether/test/factory.spec.d.ts +2 -0
  318. package/dist/src/telem/aether/test/factory.spec.d.ts.map +1 -0
  319. package/dist/src/telem/aether/test/index.d.ts +2 -0
  320. package/dist/src/telem/aether/test/index.d.ts.map +1 -0
  321. package/dist/src/telem/aether/test/sink.d.ts +18 -0
  322. package/dist/src/telem/aether/test/sink.d.ts.map +1 -0
  323. package/dist/src/telem/aether/test/sink.spec.d.ts +2 -0
  324. package/dist/src/telem/aether/test/sink.spec.d.ts.map +1 -0
  325. package/dist/src/telem/aether/test/source.d.ts +17 -0
  326. package/dist/src/telem/aether/test/source.d.ts.map +1 -0
  327. package/dist/src/telem/aether/test/source.spec.d.ts +2 -0
  328. package/dist/src/telem/aether/test/source.spec.d.ts.map +1 -0
  329. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  330. package/dist/src/telem/control/Chip.d.ts.map +1 -1
  331. package/dist/src/telem/control/Controller.d.ts +2 -0
  332. package/dist/src/telem/control/Controller.d.ts.map +1 -1
  333. package/dist/src/telem/control/Indicator.d.ts.map +1 -1
  334. package/dist/src/telem/control/Legend.d.ts +2 -2
  335. package/dist/src/telem/control/aether/controller.d.ts +17 -6
  336. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  337. package/dist/src/telem/test/external.d.ts +2 -0
  338. package/dist/src/telem/test/external.d.ts.map +1 -0
  339. package/dist/src/telem/test/index.d.ts +2 -0
  340. package/dist/src/telem/test/index.d.ts.map +1 -0
  341. package/dist/src/telem/test/wrapper.d.ts +9 -0
  342. package/dist/src/telem/test/wrapper.d.ts.map +1 -0
  343. package/dist/src/telem/text/TimeRange.d.ts.map +1 -1
  344. package/dist/src/text/Text.d.ts +1 -1
  345. package/dist/src/text/Text.d.ts.map +1 -1
  346. package/dist/src/text/{core → base}/dimensions.d.ts +5 -5
  347. package/dist/src/text/{core → base}/dimensions.d.ts.map +1 -1
  348. package/dist/src/text/base/dimensions.spec.d.ts.map +1 -0
  349. package/dist/src/text/base/external.d.ts.map +1 -0
  350. package/dist/src/text/base/index.d.ts.map +1 -0
  351. package/dist/src/text/{core → base}/types.d.ts.map +1 -1
  352. package/dist/src/text/external.d.ts +2 -2
  353. package/dist/src/theming/aether/external.d.ts +2 -2
  354. package/dist/src/theming/aether/provider.d.ts +1 -1
  355. package/dist/src/theming/{core → base}/fontString.d.ts +1 -1
  356. package/dist/src/theming/{core → base}/fontString.d.ts.map +1 -1
  357. package/dist/src/theming/{core → base}/theme.d.ts.map +1 -1
  358. package/dist/src/theming/css.d.ts +1 -1
  359. package/dist/src/theming/external.d.ts +1 -1
  360. package/dist/src/tooltip/Config.d.ts.map +1 -1
  361. package/dist/src/tree/Context.d.ts +1 -1
  362. package/dist/src/tree/Tree.d.ts +1 -1
  363. package/dist/src/tree/Tree.d.ts.map +1 -1
  364. package/dist/src/tree/{core.d.ts → base.d.ts} +1 -1
  365. package/dist/src/tree/{core.d.ts.map → base.d.ts.map} +1 -1
  366. package/dist/src/tree/base.spec.d.ts +2 -0
  367. package/dist/src/tree/base.spec.d.ts.map +1 -0
  368. package/dist/src/tree/external.d.ts +1 -1
  369. package/dist/src/triggers/Text.d.ts +2 -2
  370. package/dist/src/user/queries.d.ts +4 -4
  371. package/dist/src/user/queries.d.ts.map +1 -1
  372. package/dist/src/view/index.d.ts +2 -0
  373. package/dist/src/view/index.d.ts.map +1 -0
  374. package/dist/src/view/queries.d.ts +35 -0
  375. package/dist/src/view/queries.d.ts.map +1 -0
  376. package/dist/src/view/queries.spec.d.ts +2 -0
  377. package/dist/src/view/queries.spec.d.ts.map +1 -0
  378. package/dist/src/viewport/Mask.d.ts.map +1 -1
  379. package/dist/src/viewport/SelectMode.d.ts.map +1 -1
  380. package/dist/src/vis/button/aether/button.d.ts +15 -6
  381. package/dist/src/vis/button/aether/button.d.ts.map +1 -1
  382. package/dist/src/vis/button/aether/button.spec.d.ts +2 -0
  383. package/dist/src/vis/button/aether/button.spec.d.ts.map +1 -0
  384. package/dist/src/vis/button/use.d.ts +1 -1
  385. package/dist/src/vis/button/use.d.ts.map +1 -1
  386. package/dist/src/vis/diagram/Diagram.d.ts +6 -6
  387. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  388. package/dist/src/vis/diagram/aether/types.d.ts +2 -2
  389. package/dist/src/vis/diagram/align.d.ts.map +1 -1
  390. package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
  391. package/dist/src/vis/draw2d/index.d.ts +1 -1
  392. package/dist/src/vis/draw2d/index.d.ts.map +1 -1
  393. package/dist/src/vis/gauge/aether/gauge.d.ts +1 -1
  394. package/dist/src/vis/gauge/use.d.ts +2 -2
  395. package/dist/src/vis/input/aether/input.d.ts +11 -6
  396. package/dist/src/vis/input/aether/input.d.ts.map +1 -1
  397. package/dist/src/vis/input/use.d.ts.map +1 -1
  398. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  399. package/dist/src/vis/legend/Grouped.d.ts.map +1 -1
  400. package/dist/src/vis/legend/Simple.d.ts.map +1 -1
  401. package/dist/src/vis/line/Line.d.ts.map +1 -1
  402. package/dist/src/vis/measure/aether/measure.d.ts +1 -1
  403. package/dist/src/vis/render/loop.d.ts +1 -1
  404. package/dist/src/vis/rule/Rule.d.ts.map +1 -1
  405. package/dist/src/vis/setpoint/aether/setpoint.d.ts +11 -6
  406. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  407. package/dist/src/vis/setpoint/use.d.ts.map +1 -1
  408. package/dist/src/vis/text/atlas.d.ts.map +1 -1
  409. package/dist/src/vis/toggle/aether/toggle.d.ts +12 -3
  410. package/dist/src/vis/toggle/aether/toggle.d.ts.map +1 -1
  411. package/dist/src/vis/toggle/aether/toggle.spec.d.ts +2 -0
  412. package/dist/src/vis/toggle/aether/toggle.spec.d.ts.map +1 -0
  413. package/dist/src/vis/toggle/use.d.ts +1 -1
  414. package/dist/src/vis/toggle/use.d.ts.map +1 -1
  415. package/dist/src/vis/value/use.d.ts +2 -2
  416. package/dist/src/workspace/queries.d.ts +7 -7
  417. package/dist/src/workspace/queries.d.ts.map +1 -1
  418. package/dist/tabs.cjs +1 -1
  419. package/dist/tabs.js +1 -1
  420. package/dist/text.cjs +1 -1
  421. package/dist/text.js +2 -2
  422. package/dist/theme.css +1 -1
  423. package/dist/theming.cjs +1 -1
  424. package/dist/theming.js +2 -2
  425. package/dist/tree.cjs +1 -1
  426. package/dist/tree.js +1 -1
  427. package/dist/triggers.cjs +1 -1
  428. package/dist/triggers.js +1 -1
  429. package/dist/types-B5-Tni3G.js +82 -0
  430. package/dist/types-C0tUDfsz.cjs +1 -0
  431. package/dist/units-Bd_mf9Ye.cjs +1 -0
  432. package/dist/{units-CgMHbHoA.js → units-CEfK1L7C.js} +1 -1
  433. package/dist/value-0g5Cxim9.cjs +53 -0
  434. package/dist/{value-CzFrd9p6.js → value-C-e017qO.js} +2278 -2285
  435. package/dist/video.cjs +1 -1
  436. package/dist/video.js +1 -1
  437. package/package.json +23 -21
  438. package/dist/Animated-D-pQ3CYh.cjs +0 -1
  439. package/dist/Button-D5aoG3sV.cjs +0 -1
  440. package/dist/Haul-9RVCn3cI.cjs +0 -1
  441. package/dist/Menu-BYca9tGe.cjs +0 -1
  442. package/dist/Menu-CQsrN_mP.js +0 -134
  443. package/dist/Provider-DBg-Li_7.cjs +0 -5
  444. package/dist/Text-DeWvfrdF.cjs +0 -1
  445. package/dist/external-DDHknds-.cjs +0 -1
  446. package/dist/external-DcMOF1Je.cjs +0 -1
  447. package/dist/external-JpvbclD8.cjs +0 -79
  448. package/dist/external-RkrrZXG5.cjs +0 -1
  449. package/dist/hooks-CRSphXSb.cjs +0 -1
  450. package/dist/provider-DHDqgF1B.cjs +0 -76
  451. package/dist/src/arc/handle/Core.d.ts +0 -8
  452. package/dist/src/flux/core/index.d.ts +0 -2
  453. package/dist/src/flux/core/index.d.ts.map +0 -1
  454. package/dist/src/flux/core/store.spec.d.ts.map +0 -1
  455. package/dist/src/flux/core/streamer.spec.d.ts.map +0 -1
  456. package/dist/src/form/synced.d.ts +0 -26
  457. package/dist/src/form/synced.d.ts.map +0 -1
  458. package/dist/src/lineplot/aether/BoundQuerier.d.ts +0 -35
  459. package/dist/src/lineplot/aether/BoundQuerier.d.ts.map +0 -1
  460. package/dist/src/lineplot/useBoundQuerier.d.ts +0 -11
  461. package/dist/src/lineplot/useBoundQuerier.d.ts.map +0 -1
  462. package/dist/src/observe/index.d.ts +0 -2
  463. package/dist/src/observe/index.d.ts.map +0 -1
  464. package/dist/src/observe/use.d.ts +0 -8
  465. package/dist/src/observe/use.d.ts.map +0 -1
  466. package/dist/src/status/core/Aggregator.spec.d.ts.map +0 -1
  467. package/dist/src/status/core/Notification.spec.d.ts.map +0 -1
  468. package/dist/src/status/core/index.d.ts.map +0 -1
  469. package/dist/src/testutil/Aether.d.ts +0 -4
  470. package/dist/src/testutil/Aether.d.ts.map +0 -1
  471. package/dist/src/text/core/dimensions.spec.d.ts.map +0 -1
  472. package/dist/src/text/core/external.d.ts.map +0 -1
  473. package/dist/src/text/core/index.d.ts.map +0 -1
  474. package/dist/src/tree/core.spec.d.ts +0 -2
  475. package/dist/src/tree/core.spec.d.ts.map +0 -1
  476. package/dist/types-8-Mr79SF.cjs +0 -1
  477. package/dist/types-DGaZ_JZb.js +0 -82
  478. package/dist/units-InoNiVrK.cjs +0 -1
  479. package/dist/value-QHhF9WPA.cjs +0 -53
  480. /package/dist/src/flux/{core → base}/client.d.ts +0 -0
  481. /package/dist/src/flux/{core → base}/external.d.ts +0 -0
  482. /package/dist/src/flux/{core → base}/store.d.ts +0 -0
  483. /package/dist/src/flux/{core → base}/store.spec.d.ts +0 -0
  484. /package/dist/src/flux/{core → base}/streamer.spec.d.ts +0 -0
  485. /package/dist/src/flux/{core → base}/types.d.ts +0 -0
  486. /package/dist/src/status/{core → base}/Aggregator.d.ts +0 -0
  487. /package/dist/src/status/{core → base}/Aggregator.spec.d.ts +0 -0
  488. /package/dist/src/status/{core → base}/CreateIcon.d.ts +0 -0
  489. /package/dist/src/status/{core → base}/Indicator.d.ts +0 -0
  490. /package/dist/src/status/{core → base}/Notification.d.ts +0 -0
  491. /package/dist/src/status/{core → base}/Notification.spec.d.ts +0 -0
  492. /package/dist/src/status/{core → base}/Summary.d.ts +0 -0
  493. /package/dist/src/status/{core → base}/colors.d.ts +0 -0
  494. /package/dist/src/status/{core → base}/external.d.ts +0 -0
  495. /package/dist/src/status/{core → base}/index.d.ts +0 -0
  496. /package/dist/src/text/{core → base}/dimensions.spec.d.ts +0 -0
  497. /package/dist/src/text/{core → base}/external.d.ts +0 -0
  498. /package/dist/src/text/{core → base}/index.d.ts +0 -0
  499. /package/dist/src/text/{core → base}/types.d.ts +0 -0
  500. /package/dist/src/theming/{core → base}/theme.d.ts +0 -0
@@ -1,8 +1,8 @@
1
- "use strict";const a=require("zod"),cr=t=>a.union([a.union([a.null(),a.undefined()]).transform(()=>[]),t.array()]),kn=t=>Array.isArray(t)?t:t==null?[]:[t],hr=(t,e)=>{if(Array.isArray(e))return e.reduce((s,i)=>hr(s,i),t??[]);if(t==null)return[e];const r=t.findIndex(s=>s==e),n=[...t];return r===-1?n.push(e):n[r]=e,n},Dn=((t,e)=>{if(t!=null)return Array.isArray(e)?t.filter(r=>!e.includes(r)):t.filter(r=>r!=e)}),fr=(t,e)=>{if(Array.isArray(e))return e.reduce((s,i)=>fr(s,i),t??[]);if(t==null)return[e];const r=t.findIndex(s=>s.key===e.key),n=[...t];return r===-1?n.push(e):n[r]=e,n},Pn=((t,e)=>{if(t!=null)return Array.isArray(e)?t.filter(r=>!e.includes(r.key)):t.filter(r=>r.key!==e)}),qn=Object.freeze(Object.defineProperty({__proto__:null,nullableZ:cr,remove:Dn,removeKeyed:Pn,toArray:kn,upsert:hr,upsertKeyed:fr},Symbol.toStringTag,{value:"Module"})),Zn=t=>{const e=t.replace(/_[a-z]/g,r=>r[1].toUpperCase());return e.length>1&&e[0]===e[0].toUpperCase()&&e[1]===e[1].toUpperCase()||e.length===0?e:e[0].toLowerCase()+e.slice(1)},Fe=t=>{const e=(r,n=it)=>{if(typeof r=="string")return t(r);if(Array.isArray(r))return r.map(o=>e(o,n));if(!_e(r))return r;n=Vn(n);const s={},i=r;return"toJSON"in i&&typeof i.toJSON=="function"?e(i.toJSON(),n):(Object.keys(i).forEach(o=>{let u=i[o];const l=t(o);n.recursive&&(_e(u)?er(u)||(u=e(u,n)):n.recursiveInArray&&_t(u)&&(u=[...u].map(h=>{let d=h;return _e(h)?er(d)||(d=e(h,n)):_t(h)&&(d=e({key:h},n).key),d}))),s[l]=u}),s)};return e},St=Fe(Zn),Fn=t=>t.replace(/([a-z0-9])([A-Z])/g,(e,r,n)=>`${r}_${n.toLowerCase()}`),dr=Fe(Fn),gr=t=>t.length===0?t:t[0].toUpperCase()+t.slice(1),Yn=[Number,String,Uint8Array],it={recursive:!0,recursiveInArray:!0},Vn=(t=it)=>(t.recursive==null?t=it:t.recursiveInArray??=!1,t),_t=t=>t!=null&&Array.isArray(t),_e=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),er=t=>Yn.some(e=>t instanceof e),Wn=t=>t.replace(/[\s_]+/g,"-").replace(/([a-z0-9])([A-Z])/g,(e,r,n)=>`${r}-${n.toLowerCase()}`).toLowerCase(),Gn=Fe(Wn),Hn=t=>{if(t.length===0)return t;let e=t.replace(/[_-]/g," ");return e=e.replace(/([a-z0-9])([A-Z])/g,(r,n,s)=>`${n} ${s}`),e=e.replace(/([A-Z]+)([A-Z][a-z])/g,(r,n,s)=>`${n} ${s}`),e=e.replace(/\s+/g," ").trim(),e=e.replace(/\b\w/g,r=>r.toUpperCase()),e},Xn=Fe(Hn),Jn=Object.freeze(Object.defineProperty({__proto__:null,camelToSnake:dr,capitalize:gr,snakeToCamel:St,toKebab:Gn,toProperNoun:Xn},Symbol.toStringTag,{value:"Module"})),Ue=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),Kn=Object.freeze(Object.defineProperty({__proto__:null,isObject:Ue},Symbol.toStringTag,{value:"Module"}));class Qn{contentType="application/json";decoder;encoder;constructor(){this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,r){return this.decodeString(this.decoder.decode(e),r)}decodeString(e,r){const n=JSON.parse(e),s=St(n);return r!=null?r.parse(s):s}encodeString(e){const r=dr(e);return JSON.stringify(r,(n,s)=>ArrayBuffer.isView(s)?Array.from(s):typeof s=="bigint"?s.toString():s)}}const ot=new Qn,B=t=>t!=null&&typeof t=="object"&&"value"in t;class re{value;constructor(e){this.value=e}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}}const Nt=t=>t!=null&&typeof t=="object"&&"toString"in t,pr=t=>{if(Nt(t))return t?.toString().length===0;switch(typeof t){case"string":return t.length===0;case"number":return t===0;case"bigint":return t===0n;case"boolean":return!t;case"undefined":return!0;case"object":return t==null;default:return!1}},_n=t=>!pr(t),es=Object.freeze(Object.defineProperty({__proto__:null,ValueExtension:re,isCrudeValueExtension:B,isNonZero:_n,isStringer:Nt,isZero:pr},Symbol.toStringTag,{value:"Module"})),at=t=>[...new Set(t)],ts=(t,e,r=!0)=>{const n=new Map;return t.forEach(s=>{const i=e(s);if(n.has(i)){if(r)return;n.delete(i)}n.set(i,s)}),Array.from(n.values())},rs=Object.freeze(Object.defineProperty({__proto__:null,by:ts,unique:at},Symbol.toStringTag,{value:"Module"})),Se=(t,e=!1)=>{const r=Nt(t)?"stringer":typeof t;let n;switch(r){case"string":n=(s,i)=>s.localeCompare(i);break;case"stringer":n=(s,i)=>s.toString().localeCompare(i.toString());break;case"number":n=(s,i)=>Number(s)-Number(i);break;case"bigint":n=(s,i)=>BigInt(s)-BigInt(i)>0n?1:-1;break;case"boolean":n=(s,i)=>Number(s)-Number(i);break;case"undefined":n=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return e?mr(n):n},ns=(t,e,r)=>{const n=Se(e[t],r);return(s,i)=>n(s[t],i[t])},ss=(t,e)=>t.length!==e.length?t.length-e.length:t.every((r,n)=>r===e[n])?0:-1,yr=(t,e)=>{if(t.length!==e.length)return t.length-e.length;if(t.length===0)return 0;const r=Se(t[0]),n=[...t].sort(r),s=[...e].sort(r);return n.every((i,o)=>i===s[o])?0:-1},is=(t,e)=>{const r=at(t),n=at(e);return yr(r,n)},os=(t,e)=>t===e?0:t==="first"&&e==="last"?1:-1,mr=t=>(e,r)=>t(r,e),ne=0,Y=-1,V=1,br=t=>t<ne,wr=t=>t>ne,as=t=>t>=ne,Or=t=>t===ne,us=(t,e)=>{const r=/([a-zA-Z]+)|(\d+)/g,n=t.replace(/[\s_.-]+/g,"").match(r),s=e.replace(/[\s_.-]+/g,"").match(r);if(!n||!s)return 0;for(let i=0;i<Math.min(n.length,s.length);i++){const o=n[i],u=s[i];if(isNaN(Number(o))&&isNaN(Number(u))){const l=o.localeCompare(u);if(l!==0)return l}else if(!isNaN(Number(o))&&!isNaN(Number(u))){const l=Number(o)-Number(u);if(l!==0)return l}else return isNaN(Number(o))?-1:1}return n.length-s.length},vr=(t,e,r)=>{let n=0,s=t.length;const i=r??Se(e);for(;n<s;){const o=Math.floor((n+s)/2),u=i(t[o],e);if(u===0)return o;u<0?n=o+1:s=o}return n},ls=(t,e,r)=>{const n=vr(t,e,r);t.splice(n,0,e)},cs=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:ne,GREATER_THAN:V,LESS_THAN:Y,insert:ls,isEqualTo:Or,isGreaterThan:wr,isGreaterThanEqual:as,isLessThan:br,newF:Se,newFieldF:ns,order:os,primitiveArrays:ss,reverseF:mr,search:vr,stringsWithNumbers:us,uniqueUnorderedPrimitiveArrays:is,unorderedPrimitiveArrays:yr},Symbol.toStringTag,{value:"Module"}));let Tr=(t,e=21)=>(r=e)=>{let n="",s=r|0;for(;s--;)n+=t[Math.random()*t.length|0];return n};const xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",hs=`0123456789${xr}`,Sr=11,fs=Tr(xr,1),ds=Tr(hs,Sr-1),It=()=>`${fs()}${ds()}`,gs=Object.freeze(Object.defineProperty({__proto__:null,LENGTH:Sr,create:It},Symbol.toStringTag,{value:"Module"})),ps=(t,e)=>r=>r instanceof e||typeof r=="object"&&r!==null&&"discriminator"in r&&r.discriminator===t,ys=2**8-1,Nr=2**12-1,ms=2**16-1,bs=2**32-1,ws=2n**64n-1n,Os=2**64-1,vs=-128,Ts=2**7-1,xs=-32768,Ss=2**15-1,Ns=-2147483648,Is=2**31-1,Ms=-(2n**63n),ke=2n**63n-1n,As=-9223372036854776e3,Ir=2**63-1,ue=t=>(e,r)=>{if(typeof e=="bigint"){if(De(r))return t(e,BigInt(r));const n=t(Number(e),Number(r));return typeof n=="number"?BigInt(Math.round(n)):n}return t(Number(e),Number(r))},q=ue((t,e)=>t-e),W=ue((t,e)=>t+e),zs=(t,e,r=1e-4)=>Math.abs(t-e)<r,ut=(t,e)=>{const r=typeof t=="bigint",n=typeof e=="bigint";return r&&n?t===e:r&&De(e)?t===BigInt(e):n&&De(t)?e===BigInt(t):t===e},Es=t=>{const e=10**Math.floor(Math.log10(t));return Math.round(t/e)*e},Mr=ue((t,e)=>t<=e?t:e),De=t=>typeof t=="bigint"?!0:Number.isInteger(t),js=ue((t,e)=>t>=e?t:e),Ar=t=>typeof t=="bigint"?t<0n?-t:t:t<0?-t:t,R=ue((t,e)=>t*e),Ne=ue((t,e)=>t/e),zr=a.z.tuple([a.z.number(),a.z.number()]),Mt=a.z.object({width:a.z.number(),height:a.z.number()}),Us=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),Bs=["start","center","end"],ae=a.z.object({x:a.z.number(),y:a.z.number()}),Er=a.z.object({clientX:a.z.number(),clientY:a.z.number()}),Ye=["x","y"],At=a.z.enum(Ye),zt=["top","right","bottom","left"],$s=a.z.enum(zt),Ve=["left","right"],Et=a.z.enum(Ve),We=["top","bottom"],jt=a.z.enum(We),Ut=["center"],lt=a.z.enum(Ut),Cs=[...zt,...Ut],Bt=a.z.enum(Cs);a.z.enum(Bs);const Rs=["first","last"];a.z.enum(Rs);const Ls=a.z.object({lower:a.z.number(),upper:a.z.number()}),ks=a.z.enum([...At.options,...Bt.options]),Ds=a.z.union([At,Bt,a.z.instanceof(String)]),w=(t,e,r)=>{const n={};if(typeof e=="object"&&(r=e,e=void 0),r={makeValid:!0,...r},typeof t=="number"||typeof t=="bigint")e!=null?(n.lower=t,n.upper=e):(n.lower=typeof t=="bigint"?0n:0,n.upper=t);else if(Array.isArray(t)){if(t.length!==2)throw new Error("bounds: expected array of length 2");[n.lower,n.upper]=t}else n.lower=t.lower,n.upper=t.upper;return r?.makeValid?jr(n):n},Ps=Object.freeze({lower:0,upper:0}),qs=Object.freeze({lower:-1/0,upper:1/0}),Zs=Object.freeze({lower:0,upper:1}),Fs=Object.freeze({lower:-1,upper:1}),Ys=(t,e)=>{if(t==null&&e==null)return!0;if(t==null||e==null)return!1;const r=w(t),n=w(e);return r?.lower===n?.lower&&r?.upper===n?.upper},jr=t=>t.lower>t.upper?{lower:t.upper,upper:t.lower}:t,ct=(t,e)=>{const r=w(t);return e<r.lower?r.lower:e>=r.upper?r.upper-(typeof r.upper=="number"?1:1n):e},k=(t,e)=>{const r=w(t);if(typeof e=="number"||typeof e=="bigint")return e>=r.lower&&e<r.upper;const n=w(e);return n.lower>=r.lower&&n.upper<=r.upper},Vs=(t,e)=>{const r=w(t),n=w(e);return r.lower===n.lower?!0:n.upper===r.lower||n.lower===r.upper?!1:k(r,n.upper)||k(r,n.lower)||k(n,r.upper)||k(n,r.lower)},le=t=>{const e=w(t);return e.upper-e.lower},Ws=t=>{const e=w(t);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},Gs=t=>{const e=le(t);return typeof e=="number"?e===0:e===0n},Hs=t=>{const e=w(t);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},Xs=t=>{const e=w(t);return(e.upper+e.lower)/2},Ur=t=>({lower:Math.min(...t.map(e=>w(e).lower)),upper:Math.max(...t.map(e=>w(e).upper))}),Js=t=>({lower:Math.max(...t.map(e=>w(e).lower)),upper:Math.min(...t.map(e=>w(e).upper))}),Ks=t=>{const e=w(t),r=typeof e.lower=="bigint";return Array.from({length:Number(le(t))},(n,s)=>r?e.lower+BigInt(s):e.lower+s)},ht=(t,e)=>{const r=t.map(i=>w(i)),n=r.findIndex(i=>k(i,e)||e<i.lower);if(n===-1)return{index:t.length,position:0};const s=r[n];return k(s,e)?{index:n,position:Number(e-s.lower)}:{index:n,position:0}},et={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},Qs=(t,e)=>{const r=t.map(h=>w(h)),n=w(e);if(r.length===0)return et;const s=ht(r,n.lower),i=ht(r,n.upper);if(s.index===t.length)return{...et,insertInto:t.length};if(i.index===0)return{...et,removeAfter:i.position};if(s.index===i.index)return s.position!==0&&i.position!==0?null:{removeAfter:i.position,removeBefore:s.position,insertInto:s.index,deleteInBetween:0};let o=i.index-s.index,u=s.index,l=q(Number(le(r[s.index])),s.position);return s.position!==0?(o-=1,u+=1):l=0,{removeBefore:l,removeAfter:i.position,insertInto:u,deleteInBetween:o}},Br=(t,e,r)=>{const n=t.map(u=>w(u)),s=r>0?1:r<0?-1:0;if(s===0)return e;let i=r,o=e;for(;ut(i,0)===!1;){const u=n.findIndex(l=>s>0?o>=l.lower&&o<l.upper:o>l.lower&&o<=l.upper);if(u!==-1){const l=n[u];let h;if(s>0?h=q(l.upper,o):h=q(o,l.lower),h>0){const d=Mr(Ar(i),h);if(o=W(o,s>0?d:-d),i=q(i,s>0?d:-d),ut(i,0))return o;continue}}if(s>0){const l=n.filter(h=>h.lower>o);if(l.length>0)o=l[0].lower;else return o}else{const l=n.filter(h=>h.upper<o);if(l.length>0)o=l[l.length-1].upper;else return o}}return o},$r=(t,e,r)=>{const n=t.map(o=>w(o));if(e===r)return typeof e=="bigint"?0n:0;const s=e<r?w([e,r]):w([r,e]);let i=typeof e=="bigint"?0n:0;for(const o of n){const u=o.lower>s.lower?o.lower:s.lower,l=o.upper<s.upper?o.upper:s.upper;if(u<l){const h=l-u;i=i+h}}return i},_s=Object.freeze(Object.defineProperty({__proto__:null,CLIP:Fs,DECIMAL:Zs,INFINITE:qs,ZERO:Ps,bounds:Ls,buildInsertionPlan:Qs,clamp:ct,construct:w,contains:k,distance:$r,equals:Ys,findInsertPosition:ht,isFinite:Hs,isZero:Ws,linspace:Ks,makeValid:jr,max:Ur,mean:Xs,min:Js,overlapsWith:Vs,span:le,spanIsZero:Gs,traverse:Br},Symbol.toStringTag,{value:"Module"})),ft=2,dt=3,Cr=2,ei=(t,e)=>{if(Number.isNaN(t)||!Number.isFinite(t))return t;const r=le(e);if(r==0)return t;let n;r>=1e3?n=ft:r>=1?n=dt:n=Math.ceil(-Math.log10(r))+Cr;const s=10**n;return Math.round(t*s)/s},ti=5,ri=1e-10,ni=(t,e)=>{if(Number.isNaN(t)||!Number.isFinite(t))return t;const r=Math.abs(t);if(r===0)return 0;let n=!1,s=0;if(e!=null){s=le(e);const u=s/r;n=s>0&&u>ri}if(n){let u;s>=1e3?u=ft:s>=1?u=dt:u=Math.ceil(-Math.log10(s))+Cr;const l=10**u;return Math.round(t*l)/l}if(r>=1e3){const u=10**ft;return Math.round(t*u)/u}if(r>=1){const u=10**dt;return Math.round(t*u)/u}const i=Math.floor(Math.log10(r)),o=10**(ti-i-1);return Math.round(t*o)/o},si=Object.freeze(Object.defineProperty({__proto__:null,MAX_INT16:Ss,MAX_INT32:Is,MAX_INT64:ke,MAX_INT64_NUMBER:Ir,MAX_INT8:Ts,MAX_UINT12:Nr,MAX_UINT16:ms,MAX_UINT32:bs,MAX_UINT64:ws,MAX_UINT64_NUMBER:Os,MAX_UINT8:ys,MIN_INT16:xs,MIN_INT32:Ns,MIN_INT64:Ms,MIN_INT64_NUMBER:As,MIN_INT8:vs,abs:Ar,add:W,closeTo:zs,div:Ne,equal:ut,isInteger:De,max:js,min:Mr,mult:R,roundBySpan:ei,roundToNearestMagnitude:Es,smartRound:ni,sub:q},Symbol.toStringTag,{value:"Module"})),Rr=ks,P=t=>Ye.includes(t)?t:We.includes(t)?"y":"x",ii=t=>P(t)==="x"?"y":"x",oi=t=>P(t)==="x"?"width":"height",ai=t=>P(t)==="x"?"left":"top",ui=t=>Rr.safeParse(t).success,li=t=>P(t)==="x"?"signedWidth":"signedHeight",ci=t=>t==="center"?!1:P(t)==="x",hi=t=>P(t)==="y",Lr=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:Ye,construct:P,crude:Rr,dimension:oi,direction:At,isDirection:ui,isX:ci,isY:hi,location:ai,signedDimension:li,swap:ii},Symbol.toStringTag,{value:"Module"})),fi=Et,di=jt,gi=lt,pi={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},yi={top:{clockwise:"left",counterclockwise:"right"},right:{clockwise:"top",counterclockwise:"bottom"},bottom:{clockwise:"right",counterclockwise:"left"},left:{clockwise:"bottom",counterclockwise:"top"}},mi=Ds,ee=t=>t instanceof String||!Ye.includes(t)?t:t==="x"?"left":"top",bi=t=>pi[ee(t)],wi=(t,e)=>yi[t][e],Oe=t=>{const e=ee(t);return e==="top"||e==="bottom"?"y":"x"},Oi=a.z.object({x:Et.or(lt),y:jt.or(lt)}),$t=a.z.object({x:Et,y:jt}),ce=Object.freeze({x:"left",y:"top"}),Ct=Object.freeze({x:"right",y:"top"}),Ge=Object.freeze({x:"left",y:"bottom"}),Rt=Object.freeze({x:"right",y:"bottom"}),Lt=Object.freeze({x:"center",y:"center"}),kt=Object.freeze({x:"center",y:"top"}),Dt=Object.freeze({x:"center",y:"bottom"}),Pt=Object.freeze({x:"right",y:"center"}),qt=Object.freeze({x:"left",y:"center"}),vi=Object.freeze([qt,Pt,kt,Dt,ce,Ct,Ge,Rt,Lt]),Zt=(t,e)=>t.x===e.x&&t.y===e.y,Ti=(t,e)=>{if(typeof e=="object"){let r=!0;return"x"in e&&(t.x===e.x||(r=!1)),"y"in e&&(t.y===e.y||(r=!1)),r}return t.x===e||t.y===e},kr=t=>[t.x,t.y],Be=t=>Oe(ee(t))==="x",xi=t=>Oe(ee(t))==="y",Si=t=>`${t.x}${gr(t.y)}`,Ni=(t,e)=>{let r,n;if(typeof t=="object"&&"x"in t?(r=t.x,n=t.y):(r=ee(t),n=ee(e??t)),Oe(r)===Oe(n)&&r!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`);const s={...Lt};return r==="center"?Be(n)?[s.x,s.y]=[n,r]:[s.x,s.y]=[r,n]:n==="center"?Be(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r]:Be(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r],s},Dr=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:Dt,BOTTOM_LEFT:Ge,BOTTOM_RIGHT:Rt,CENTER:Lt,CENTER_LEFT:qt,CENTER_LOCATIONS:Ut,CENTER_RIGHT:Pt,OUTER_LOCATIONS:zt,TOP_CENTER:kt,TOP_LEFT:ce,TOP_RIGHT:Ct,XY_LOCATIONS:vi,X_LOCATIONS:Ve,Y_LOCATIONS:We,center:gi,construct:ee,constructXY:Ni,corner:$t,crude:mi,direction:Oe,isX:Be,isY:xi,location:Bt,outer:$s,rotate:wi,swap:bi,x:fi,xy:Oi,xyCouple:kr,xyEquals:Zt,xyMatches:Ti,xyToString:Si,y:di},Symbol.toStringTag,{value:"Module"})),gt=a.z.union([a.z.number(),ae,zr,Mt,Us,Er]),v=(t,e)=>{if(typeof t=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:e,y:0}:{x:0,y:e}}return typeof t=="number"?{x:t,y:e??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},Z=Object.freeze({x:0,y:0}),Pr=Object.freeze({x:1,y:1}),Ii=Object.freeze({x:1/0,y:1/0}),Mi=Object.freeze({x:NaN,y:NaN}),Pe=(t,e,r=0)=>{const n=v(t),s=v(e);return r===0?n.x===s.x&&n.y===s.y:Math.abs(n.x-s.x)<=r&&Math.abs(n.y-s.y)<=r},Ai=t=>Pe(t,Z),Ft=(t,e,r)=>{const n=v(t),s=v(e,r);return{x:n.x*s.x,y:n.y*s.y}},qr=(t,e)=>{const r=v(t);return{x:r.x+e,y:r.y}},Zr=(t,e)=>{const r=v(t);return{x:r.x,y:r.y+e}},ve=(t,e,r,...n)=>{if(typeof e=="string"){if(typeof r!="number")throw new Error("The value must be a number.");return e==="x"?qr(t,r):Zr(t,r)}if(typeof e=="object"&&"x"in e&&typeof e.x=="string"){const s=v(r),i=v(t);return e.x==="left"?s.x=-s.x:e.x==="center"&&(s.x=0),e.y==="top"?s.y=-s.y:e.y==="center"&&(s.y=0),{x:i.x+s.x,y:i.y+s.y}}return[t,e,r??Z,...n].reduce((s,i)=>{const o=v(i);return{x:s.x+o.x,y:s.y+o.y}},Z)},zi=(t,e,r)=>{const n=v(t);return P(e)==="x"?{x:r,y:n.y}:{x:n.x,y:r}},Ei=(t,e)=>{const r=v(t),n=v(e);return Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)},ji=(t,e)=>{const r=v(t),n=v(e);return{x:n.x-r.x,y:n.y-r.y}},Ui=t=>{const e=v(t);return Number.isNaN(e.x)||Number.isNaN(e.y)},Bi=t=>{const e=v(t);return Number.isFinite(e.x)&&Number.isFinite(e.y)},$i=t=>{const e=v(t);return[e.x,e.y]},Ci=t=>{const e=v(t);return{left:e.x,top:e.y}},qe=(t,e=0)=>{const r=v(t);return{x:Number(r.x.toFixed(e)),y:Number(r.y.toFixed(e))}},de=(t,e)=>{const r=v(t),n=v(e);return{x:r.x-n.x,y:r.y-n.y}},ge=t=>{const e=v(t),r=Math.hypot(e.x,e.y);return r===0?{x:0,y:0}:{x:-e.y/r,y:e.x/r}},Fr=t=>{const e=v(t),r=Math.hypot(e.x,e.y);return r===0?{x:0,y:0}:{x:e.x/r,y:e.y/r}},Yr=(...t)=>{const e=t.reduce((r,n)=>ve(r,n),Z);return Ft(e,1/t.length)},Ri=(t,e)=>{const r=[];for(let n=0;n<t.length;n++){const s=t[n];let i,o,u,l;if(n===0){const h=t[n+1],d=de(h,s);o=ge(d),u=o,l=e}else if(n===t.length-1){const h=t[n-1],d=de(s,h);i=ge(d),u=i,l=e}else{const h=t[n-1],d=t[n+1],y=de(s,h),p=de(d,s);i=ge(y),o=ge(p);const N=Math.acos((y.x*p.x+y.y*p.y)/(Math.hypot(y.x,y.y)*Math.hypot(p.x,p.y))),A=Math.sin(N/2);A===0?l=e:l=e/A,u=Fr(Yr(i,o))}r.push(Ft(u,l))}return r},Li=t=>{const e=v(t);return{x:e.y,y:e.x}},pt=t=>{const e=v(t);return{x:Math.round(e.x),y:Math.round(e.y)}},ki=t=>{const e=v(t);return{x:1/e.x,y:1/e.y}},Di=(t,e,r)=>{const n=v(t),s=v(e),i=r==="clockwise"?Math.PI/2:-Math.PI/2,o=n.x-s.x,u=n.y-s.y,l=o*Math.cos(i)-u*Math.sin(i),h=o*Math.sin(i)+u*Math.cos(i);return{x:l+s.x,y:h+s.y}},Pi=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:Ii,NAN:Mi,ONE:Pr,ZERO:Z,average:Yr,calculateMiters:Ri,clientXY:Er,construct:v,couple:$i,crudeZ:gt,css:Ci,distance:Ei,equals:Pe,isFinite:Bi,isNan:Ui,isZero:Ai,normal:ge,normalize:Fr,reciprocal:ki,rotate:Di,round:pt,scale:Ft,set:zi,sub:de,swap:Li,translate:ve,translateX:qr,translateY:Zr,translation:ji,truncate:qe,xy:ae},Symbol.toStringTag,{value:"Module"})),Me=a.z.union([a.z.number(),a.z.string()]),qi=a.z.object({top:Me,left:Me,width:Me,height:Me}),Zi=a.z.object({left:a.z.number(),top:a.z.number(),right:a.z.number(),bottom:a.z.number()}),Fi=a.z.object({one:ae,two:ae,root:$t}),Vr={one:Z,two:Z,root:ce},Yi={one:Z,two:Pr,root:Ge},Wr=(t,e)=>({one:t.one,two:t.two,root:e??t.root}),x=(t,e,r=0,n=0,s)=>{const i={one:{...Z},two:{...Z},root:s??ce};if(typeof t=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return i.one={x:t,y:e},i.two={x:i.one.x+r,y:i.one.y+n},i}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(i.one={x:t.left,y:t.top},i.two={x:t.right,y:t.bottom},i):(i.one=t,e==null?i.two={x:i.one.x+r,y:i.one.y+n}:typeof e=="number"?i.two={x:i.one.x+e,y:i.one.y+r}:"width"in e?i.two={x:i.one.x+e.width,y:i.one.y+e.height}:"signedWidth"in e?i.two={x:i.one.x+e.signedWidth,y:i.one.y+e.signedHeight}:i.two=e,i))},Vi=(t,e,r)=>{const n=x(t);if(typeof e=="string"){if(r==null)throw new Error("Invalid arguments for resize");const s=P(e);return x(n.one,void 0,s==="x"?r:E(n),s==="y"?r:j(n),n.root)}return x(n.one,e,void 0,void 0,n.root)},Wi=(t,e,r=!0)=>{const n=x(t);let s=(i,o)=>i<o;return r&&(s=(i,o)=>i<=o),"one"in e?s(X(n),X(e))&&s(Q(e),Q(n))&&s(J(n),J(e))&&s(_(e),_(n)):s(X(n),e.x)&&s(e.x,Q(n))&&s(J(n),e.y)&&s(e.y,_(n))},Gi=(t,e)=>Pe(t.one,e.one)&&Pe(t.two,e.two)&&Zt(t.root,e.root),Gr=t=>({width:E(t),height:j(t)}),Hi=t=>({signedWidth:He(t),signedHeight:Xe(t)}),Xi=t=>({top:J(t),left:X(t),width:E(t),height:j(t)}),Yt=(t,e,r=!1)=>{const n=P(e)==="y"?Xe(t):He(t);return r?n:Math.abs(n)},G=(t,e)=>{const r=x(t);return{x:e.x==="center"?yt(r).x:te(r,e.x),y:e.y==="center"?yt(r).y:te(r,e.y)}},te=(t,e)=>{const r=x(t),n=kr(r.root).includes(e)?Math.min:Math.max;return Ve.includes(e)?n(r.one.x,r.two.x):n(r.one.y,r.two.y)},Ji=t=>Jr(t)===0,E=t=>Yt(t,"x"),j=t=>Yt(t,"y"),He=t=>{const e=x(t);return e.two.x-e.one.x},Xe=t=>{const e=x(t);return e.two.y-e.one.y},Hr=t=>G(t,ce),Ki=t=>G(t,kt),Qi=t=>G(t,Ct),_i=t=>G(t,Ge),eo=t=>G(t,Dt),to=t=>G(t,Rt),ro=t=>G(t,qt),no=t=>G(t,Pt),Q=t=>te(t,"right"),_=t=>te(t,"bottom"),X=t=>te(t,"left"),J=t=>te(t,"top"),yt=t=>ve(Hr(t),{x:He(t)/2,y:Xe(t)/2}),Vt=t=>{const e=x(t);return e.root.x==="left"?X(e):Q(e)},Wt=t=>{const e=x(t);return e.root.y==="top"?J(e):_(e)},so=t=>({x:Vt(t),y:Wt(t)}),$e=t=>{const e=x(t);return{lower:e.one.x,upper:e.two.x}},Ce=t=>{const e=x(t);return{lower:e.one.y,upper:e.two.y}},io=(t,e)=>Wr(t,e),oo=(t,e)=>{const r=x(t),n=Ve.includes(e)?"x":We.includes(e)?"y":null;if(n===null)throw new Error(`Invalid location: ${e}`);const s=e==="top"||e==="left"?Math.min:Math.max,i={...r.one},o={...r.two};return i[n]=s(r.one[n],r.two[n]),o[n]=s(r.one[n],r.two[n]),[i,o]},ao=(t,e)=>{const r=x(t),n=x(e),s=Vt(n)+(E(n)-E(r))/2,i=Wt(n)+(j(n)-j(r))/2;return x({x:s,y:i},Gr(r))},Xr=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,uo=t=>E(t)/j(t),lo=(t,e,r)=>{if(typeof e=="string"){if(r==null)throw new Error("Undefined amount passed into box.translate");const s=P(e);e=v(s,r)}const n=x(t);return x(ve(n.one,e),ve(n.two,e),void 0,void 0,n.root)},co=(t,e)=>{const r=Math.max(X(t),X(e)),n=Math.max(J(t),J(e)),s=Math.min(Q(t),Q(e)),i=Math.min(_(t),_(e));return r>s||n>i?Vr:x({x:r,y:n},{x:s,y:i},void 0,void 0,t.root)},Jr=t=>E(t)*j(t),ho=(t,e)=>{const r=x(t);return x(qe(r.one,e),qe(r.two,e),void 0,void 0,r.root)},fo=(t,e,r,n,s,i)=>{const o={x:t,y:e},u={x:t+r,y:e+n};return s.x!==i.x&&(s.x==="center"?(o.x-=r/2,u.x-=r/2):(o.x-=r,u.x-=r)),s.y!==i.y&&(s.y==="center"?(o.y-=n/2,u.y-=n/2):(o.y-=n,u.y-=n)),x(o,u,void 0,void 0,i)},go=t=>{const e=x(t);return x(pt(e.one),pt(e.two),void 0,void 0,e.root)},po=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:Yi,ZERO:Vr,area:Jr,areaIsZero:Ji,aspect:uo,bottom:_,bottomCenter:eo,bottomLeft:_i,bottomRight:to,box:Fi,center:yt,centerLeft:ro,centerRight:no,construct:x,constructWithAlternateRoot:fo,contains:Wi,copy:Wr,css:Xi,cssBox:qi,dim:Yt,dims:Gr,domRect:Zi,edgePoints:oo,equals:Gi,height:j,intersection:co,isBox:Xr,left:X,loc:te,positionInCenter:ao,reRoot:io,resize:Vi,right:Q,root:so,round:go,signedDims:Hi,signedHeight:Xe,signedWidth:He,top:J,topCenter:Ki,topLeft:Hr,topRight:Qi,translate:lo,truncate:ho,width:E,x:Vt,xBounds:$e,xyLoc:G,y:Wt,yBounds:Ce},Symbol.toStringTag,{value:"Module"})),Kr=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),yo=a.z.union([Mt,Kr,ae,zr]),mo={width:0,height:0},bo={width:1,height:1},D=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},wo=(t,e)=>{if(e==null)return!1;const r=D(t),n=D(e);return r.width===n.width&&r.height===n.height},Oo=t=>{const e=D(t);return{width:e.height,height:e.width}},vo=t=>{const e=D(t);return`0 0 ${e.width} ${e.height}`},To=t=>{const e=D(t);return[e.width,e.height]},xo=t=>({width:Math.max(...t.map(e=>D(e).width)),height:Math.max(...t.map(e=>D(e).height))}),So=t=>({width:Math.min(...t.map(e=>D(e).width)),height:Math.min(...t.map(e=>D(e).height))}),No=(t,e)=>{const r=D(t);return{width:r.width*e,height:r.height*e}},Io=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:bo,ZERO:mo,construct:D,couple:To,crude:yo,dimensions:Mt,equals:wo,max:xo,min:So,scale:No,signed:Kr,svgViewBox:vo,swap:Oo},Symbol.toStringTag,{value:"Module"})),Qr=(t,e,r)=>e!==void 0&&t<e?e:r!==void 0&&t>r?r:t,Mo=a.z.object({offset:gt,scale:gt}),Ao=a.z.object({offset:a.z.number(),scale:a.z.number()}),zo=t=>(e,r,n,s)=>r==="dimension"?[e,n]:[e,s?n-t:n+t],Eo=t=>(e,r,n,s)=>[e,s?n/t:n*t],jo=t=>(e,r,n)=>{if(e===null)return[t,n];const{lower:s,upper:i}=e,{lower:o,upper:u}=t,l=i-s,h=u-o;if(r==="dimension")return[t,n*(h/l)];const d=(n-s)*(h/l)+o;return[t,d]},Uo=t=>(e,r,n)=>[t,n],Bo=()=>(t,e,r)=>{if(t===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[t,r];const{lower:n,upper:s}=t;return[t,s-(r-n)]},$o=t=>(e,r,n)=>{const{lower:s,upper:i}=t;return n=Qr(n,s,i),[e,n]};class F{ops=[];currBounds=null;currType=null;reversed=!1;constructor(){this.ops=[]}static translate(e){return new F().translate(e)}static magnify(e){return new F().magnify(e)}static scale(e,r){return new F().scale(e,r)}translate(e){const r=this.new(),n=zo(e);return n.type="translate",r.ops.push(n),r}magnify(e){const r=this.new(),n=Eo(e);return n.type="magnify",r.ops.push(n),r}scale(e,r){const n=w(e,r),s=this.new(),i=jo(n);return i.type="scale",s.ops.push(i),s}clamp(e,r){const n=w(e,r),s=this.new(),i=$o(n);return i.type="clamp",s.ops.push(i),s}reBound(e,r){const n=w(e,r),s=this.new(),i=Uo(n);return i.type="re-bound",s.ops.push(i),s}invert(){const e=Bo();e.type="invert";const r=this.new();return r.ops.push(e),r}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new F;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,r){return this.currBounds=null,this.ops.reduce(([n,s],i)=>i(n,e,s,this.reversed),[null,r])[1]}reverse(){const e=this.new();e.ops.reverse();const r=[];return e.ops.forEach((n,s)=>{if(n.type==="scale"||r.some(([o,u])=>s>=o&&s<=u))return;const i=e.ops.findIndex((o,u)=>o.type==="scale"&&u>s);i!==-1&&r.push([s,i])}),r.forEach(([n,s])=>{const i=e.ops.slice(n,s);i.unshift(e.ops[s]),e.ops.splice(n,s-n+1,...i)}),e.reversed=!e.reversed,e}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}static IDENTITY=new F}class C{x;y;currRoot;constructor(e=new F,r=new F,n=null){this.x=e,this.y=r,this.currRoot=n}static translate(e,r){return new C().translate(e,r)}static translateX(e){return new C().translateX(e)}static translateY(e){return new C().translateY(e)}static clamp(e){return new C().clamp(e)}static magnify(e){return new C().magnify(e)}static scale(e){return new C().scale(e)}static reBound(e){return new C().reBound(e)}translate(e,r){const n=v(e,r),s=this.copy();return s.x=this.x.translate(n.x),s.y=this.y.translate(n.y),s}translateX(e){const r=this.copy();return r.x=this.x.translate(e),r}translateY(e){const r=this.copy();return r.y=this.y.translate(e),r}magnify(e){const r=this.copy();return r.x=this.x.magnify(e.x),r.y=this.y.magnify(e.y),r}scale(e){const r=this.copy();if(Xr(e)){const n=this.currRoot;return r.currRoot=e.root,n!=null&&!Zt(n,e.root)&&(n.x!==e.root.x&&(r.x=r.x.invert()),n.y!==e.root.y&&(r.y=r.y.invert())),r.x=r.x.scale($e(e)),r.y=r.y.scale(Ce(e)),r}return r.x=r.x.scale(e.width),r.y=r.y.scale(e.height),r}reBound(e){const r=this.copy();return r.x=this.x.reBound($e(e)),r.y=this.y.reBound(Ce(e)),r}clamp(e){const r=this.copy();return r.x=this.x.clamp($e(e)),r.y=this.y.clamp(Ce(e)),r}copy(){const e=new C;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}dim(e){return{x:this.x.dim(e.x),y:this.y.dim(e.y)}}box(e){return x(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}static IDENTITY=new C}const Co=Object.freeze(Object.defineProperty({__proto__:null,Scale:F,XY:C,crudeXYTransform:Mo,transform:Ao},Symbol.toStringTag,{value:"Module"})),_r=ae.extend({root:$t,units:a.object({x:a.enum(["px","decimal"]),y:a.enum(["px","decimal"])})}),Ro=_r.partial({root:!0,units:!0}),Lo=t=>{const e={};return e[t.root?.x??"left"]=t?.units?.x==="px"?`${t.x}px`:`${t.x*100}%`,e[t.root?.y??"top"]=t?.units?.y==="px"?`${t.y}px`:`${t.y*100}%`,e},ko=({position:t,element:e,container:r})=>{const n={x:t.x,y:t.y};return t.units?.x==="decimal"?t.root?.x==="right"&&(n.x=1-t.x):t.root?.x==="right"?n.x=1-(t.x+E(e))/E(r):n.x/=E(r),t.units?.y==="decimal"?t.root?.y==="bottom"&&(n.y=1-t.y):t.root?.y==="bottom"?n.y=1-(t.y+j(e))/j(r):n.y/=j(r),n},Do=({position:t,element:e,container:r,lowerThreshold:n=.2,upperThreshold:s=.8})=>{const i={x:t.x,y:t.y,root:{...ce},units:{x:"px",y:"px"}};return t.x>s?(i.x=(1-t.x)*E(r)-E(e),i.root.x="right"):t.x<n?i.x=t.x*E(r):i.units.x="decimal",t.y>s?(i.y=(1-t.y)*j(r)-j(e),i.root.y="bottom"):t.y<n?i.y=t.y*j(r):i.units.y="decimal",i.x=Math.round(i.x*100)/100,{...i,...qe(i,3)}},Po=Object.freeze(Object.defineProperty({__proto__:null,calculate:Do,completeXY:_r,toCSS:Lo,toDecimal:ko,xy:Ro},Symbol.toStringTag,{value:"Module"})),qo=a.z.enum(["static","dynamic"]),tr=365,Ae=30,Zo=a.z.union([a.z.tuple([a.z.int()]),a.z.tuple([a.z.int(),a.z.int().min(1).max(12)]),a.z.tuple([a.z.int(),a.z.int().min(1).max(12),a.z.int().min(1).max(31)])]),en=(t,e)=>{const r=new f(e);if(![g.DAY,g.HOUR,g.MINUTE,g.SECOND,g.MILLISECOND,g.MICROSECOND,g.NANOSECOND].some(s=>s.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=t.valueOf()%r.valueOf();return t instanceof f?new f(n):new g(n)};class f extends re{constructor(e,r="UTC"){if(e==null)super(f.now().valueOf());else if(e instanceof Date)super(BigInt(e.getTime())*f.MILLISECOND.valueOf());else if(typeof e=="string")super(f.parseDateTimeString(e,r).valueOf());else if(Array.isArray(e))super(f.parseDate(e));else{let n=0n;e instanceof Number&&(e=e.valueOf()),r==="local"&&(n=f.utcOffset.valueOf()),typeof e=="number"&&(isFinite(e)?e===Ir?e=ke:e=Math.trunc(e):(isNaN(e)&&(e=0),e===1/0?e=f.MAX:e=f.MIN)),B(e)&&(e=e.value),super(BigInt(e.valueOf())+n)}}static parseDate([e=1970,r=1,n=1]){const s=new Date(e,r-1,n,0,0,0,0);return new f(BigInt(s.getTime())*f.MILLISECOND.valueOf()).truncate(f.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(e,r="UTC"){const[n,s,i]=e.split(":");let o="00",u="00";i!=null&&([o,u]=i.split("."));let l=f.hours(parseInt(n??"00")).add(f.minutes(parseInt(s??"00"))).add(f.seconds(parseInt(o??"00"))).add(f.milliseconds(parseInt(u??"00")));return r==="local"&&(l=l.add(f.utcOffset)),l.valueOf()}static parseDateTimeString(e,r="UTC"){if(!e.includes("/")&&!e.includes("-"))return f.parseTimeString(e,r);if(e.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?$/)!=null){let s=e,i=0;if(e.includes(".")){const h=e.split(".");s=h[0];const d=h[1]||"0";i=parseInt(d.padEnd(3,"0").slice(0,3))}const o=r==="local"?new Date(s.replace("T"," ")):new Date(`${s}Z`),u=BigInt(o.getTime())*f.MILLISECOND.valueOf(),l=BigInt(i)*f.MILLISECOND.valueOf();return u+l}const n=new Date(e);return e.includes(":")||n.setUTCHours(0,0,0,0),new f(BigInt(n.getTime())*f.MILLISECOND.valueOf(),r).valueOf()}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(f.utcOffset).date().toISOString()}timeString(e=!1,r="UTC"){const n=this.toISOString(r);return e?n.slice(11,23):n.slice(11,19)}dateString(){const e=this.date(),r=e.toLocaleString("default",{month:"short"}),n=e.toLocaleString("default",{day:"numeric"});return`${r} ${n}`}static get utcOffset(){return new g(BigInt(new Date().getTimezoneOffset())*f.MINUTE.valueOf())}static since(e){return new f().span(e)}date(){return new Date(this.milliseconds)}equals(e){return this.valueOf()===new f(e).valueOf()}span(e){return this.range(e).span}range(e){return new I(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===0n}after(e){return this.valueOf()>new f(e).valueOf()}afterEq(e){return this.valueOf()>=new f(e).valueOf()}before(e){return this.valueOf()<new f(e).valueOf()}beforeEq(e){return this.valueOf()<=new f(e).valueOf()}add(e){return new f(W(this.valueOf(),new g(e).valueOf()))}sub(e){return new f(q(this.valueOf(),new g(e).valueOf()))}get hours(){return Number(this.valueOf())/Number(g.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(g.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(g.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(g.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(f.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(f.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(e){const r=this.date();return r.setUTCFullYear(e),new f(r)}get month(){return this.date().getUTCMonth()}setMonth(e){const r=this.date();return r.setUTCMonth(e),new f(r)}get day(){return this.date().getUTCDate()}setDay(e){const r=this.date();return r.setUTCDate(e),new f(r)}get hour(){return this.date().getUTCHours()}get localHour(){return this.date().getHours()}setLocalHour(e){const r=this.date();return r.setHours(e),new f(r)}setHour(e){const r=this.date();return r.setUTCHours(e),new f(r)}get minute(){return this.date().getUTCMinutes()}setMinute(e){const r=this.date();return r.setUTCMinutes(e),new f(r)}get second(){return this.date().getUTCSeconds()}setSecond(e){const r=this.date();return r.setUTCSeconds(e),new f(r)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(e){const r=this.date();return r.setUTCMilliseconds(e),new f(r)}toString(e="ISO",r="UTC"){switch(e){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}remainder(e){return en(this,e)}get isToday(){return this.truncate(g.DAY).equals(f.now().truncate(g.DAY))}truncate(e){return this.sub(this.remainder(e))}formatBySpan(e){return e.greaterThanOrEqual(g.days(30))?"shortDate":e.greaterThanOrEqual(g.DAY)?"dateTime":e.greaterThanOrEqual(g.HOUR)?"time":e.greaterThanOrEqual(g.SECOND)?"preciseTime":"ISOTime"}static now(){return new f(new Date)}static max(...e){let r=f.MIN;for(const n of e){const s=new f(n);s.after(r)&&(r=s)}return r}static min(...e){let r=f.MAX;for(const n of e){const s=new f(n);s.before(r)&&(r=s)}return r}static nanoseconds(e,r="UTC"){return new f(e,r)}static NANOSECOND=f.nanoseconds(1);static microseconds(e,r="UTC"){return f.nanoseconds(e*1e3,r)}static MICROSECOND=f.microseconds(1);static milliseconds(e,r="UTC"){return f.microseconds(e*1e3,r)}static MILLISECOND=f.milliseconds(1);static seconds(e,r="UTC"){return f.milliseconds(e*1e3,r)}static SECOND=f.seconds(1);static minutes(e,r="UTC"){return f.seconds(e*60,r)}static MINUTE=f.minutes(1);static hours(e,r="UTC"){return f.minutes(e*60,r)}static HOUR=f.hours(1);static days(e,r="UTC"){return f.hours(e*24,r)}static DAY=f.days(1);static MAX=new f(ke);static MIN=new f(0);static ZERO=new f(0);static z=a.z.union([a.z.instanceof(f),a.z.object({value:a.z.bigint()}).transform(e=>new f(e.value)),a.z.string().transform(e=>new f(BigInt(e))),a.z.number().transform(e=>new f(e)),a.z.bigint().transform(e=>new f(e)),a.z.date().transform(e=>new f(e)),a.z.custom(e=>e instanceof g).transform(e=>new f(e)),Zo.transform(e=>new f(e))]);static sort(e,r){return Number(e.valueOf()-r.valueOf())}}class g extends re{constructor(e){typeof e=="number"&&(e=Math.trunc(e.valueOf())),B(e)&&(e=e.value),super(BigInt(e.valueOf()))}static fromSeconds(e){return e instanceof g?e:e instanceof z?e.period:e instanceof f?new g(e):(B(e)&&(e=e.value),["number","bigint"].includes(typeof e)?g.seconds(e):new g(e))}static fromMilliseconds(e){return e instanceof g?e:e instanceof z?e.period:e instanceof f?new g(e):(B(e)&&(e=e.value),["number","bigint"].includes(typeof e)?g.milliseconds(e):new g(e))}valueOf(){return this.value}lessThan(e){return this.valueOf()<new g(e).valueOf()}greaterThan(e){return this.valueOf()>new g(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new g(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new g(e).valueOf()}remainder(e){return en(this,e)}truncate(e){return new g(BigInt(Math.trunc(Number(this.valueOf()/e.valueOf())))*e.valueOf())}toString(e="full"){if(e==="semantic")return this.toSemanticString();const r=this.truncate(g.DAY),n=this.truncate(g.HOUR),s=this.truncate(g.MINUTE),i=this.truncate(g.SECOND),o=this.truncate(g.MILLISECOND),u=this.truncate(g.MICROSECOND),l=this.truncate(g.NANOSECOND),h=r,d=n.sub(r),y=s.sub(n),p=i.sub(s),N=o.sub(i),A=u.sub(o),$=l.sub(u);let O="";return h.isZero||(O+=`${h.days}d `),d.isZero||(O+=`${d.hours}h `),y.isZero||(O+=`${y.minutes}m `),p.isZero||(O+=`${p.seconds}s `),N.isZero||(O+=`${N.milliseconds}ms `),A.isZero||(O+=`${A.microseconds}µs `),$.isZero||(O+=`${$.nanoseconds}ns`),O.trim()}toSemanticString(){const e=this.valueOf()<0n?-this.valueOf():this.valueOf(),r=new g(e),n=this.valueOf()<0n;if(r.valueOf()===0n)return"0s";if(r.lessThan(g.SECOND))return"< 1s";const s=r.days,i=r.hours,o=r.minutes,u=r.seconds,l=Math.floor(s/tr),h=Math.floor(s/Ae),d=Math.floor(s/7),y=Math.floor(s),p=Math.floor(i),N=Math.floor(o),A=Math.floor(u),$=n?"-":"";if(l>=1){let O=`${l}y`;if(l<2){const S=Math.floor(s%tr/Ae);S>0&&(O+=` ${S}mo`)}return $+O}if(d>=1&&s<Ae&&s%7===0){let O=`${d}w`;const S=Math.floor(s%7),K=Math.floor(i-d*7*24);return d<2&&(S>0?O+=` ${S}d`:K>0&&K<24&&(O+=` ${K}h`)),$+O}if(h>=1){let O=`${h}mo`;if(h<3){const S=Math.floor(s%Ae);S>0&&(O+=` ${S}d`)}return $+O}if(d>=1){let O=`${d}w`;const S=Math.floor(s%7),K=Math.floor(i-d*7*24);return d<2&&(S>0?O+=` ${S}d`:K>0&&K<24&&(O+=` ${K}h`)),$+O}if(y>=1){let O=`${y}d`;const S=Math.floor(i-y*24);return y<2&&S>0&&(O+=` ${S}h`),$+O}if(p>=1){let O=`${p}h`;if(p<3){const S=Math.floor(o-p*60);S>0&&(O+=` ${S}m`)}return $+O}if(N>=1){let O=`${N}m`;if(N<5){const S=Math.floor(u-N*60);S>0&&(O+=` ${S}s`)}return $+O}return`${$}${A}s`}mult(e){return new g(R(this.valueOf(),e))}div(e){return new g(Ne(this.valueOf(),e))}get days(){return Number(this.valueOf())/Number(g.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(g.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(g.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(g.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(g.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(g.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===0n}equals(e){return this.valueOf()===new g(e).valueOf()}add(e){return new g(this.valueOf()+new g(e).valueOf())}sub(e){return new g(this.valueOf()-new g(e).valueOf())}static nanoseconds(e=1){return new g(e)}static NANOSECOND=g.nanoseconds(1);static microseconds(e=1){return g.nanoseconds(R(e,1e3))}static MICROSECOND=g.microseconds(1);static milliseconds(e=1){return g.microseconds(R(e,1e3))}static MILLISECOND=g.milliseconds(1);static seconds(e=1){return g.milliseconds(R(e,1e3))}static SECOND=g.seconds(1);static minutes(e=1){return g.seconds(R(e,60))}static MINUTE=g.minutes(1);static hours(e){return g.minutes(R(e,60))}static HOUR=g.hours(1);static days(e){return g.hours(R(e,24))}static DAY=g.days(1);static MAX=new g(ke);static MIN=new g(0);static ZERO=new g(0);static z=a.z.union([a.z.object({value:a.z.bigint()}).transform(e=>new g(e.value)),a.z.string().transform(e=>new g(BigInt(e))),a.z.number().transform(e=>new g(e)),a.z.bigint().transform(e=>new g(e)),a.z.instanceof(g),a.z.instanceof(f).transform(e=>new g(e)),a.z.custom(e=>e instanceof z).transform(e=>new g(e))])}class z extends re{constructor(e){B(e)&&(e=e.value),super(e.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new z(e).valueOf()}get period(){return g.seconds(1/this.valueOf())}sampleCount(e){return new g(e).seconds*this.valueOf()}byteCount(e,r){return this.sampleCount(e)*new b(r).valueOf()}span(e){return g.seconds(e/this.valueOf())}byteSpan(e,r){return this.span(e.valueOf()/new b(r).valueOf())}add(e){return new z(W(this.valueOf(),new z(e).valueOf()))}sub(e){return new z(q(this.valueOf(),new z(e).valueOf()))}mult(e){return new z(R(this.valueOf(),e))}div(e){return new z(Ne(this.valueOf(),e))}static hz(e){return new z(e)}static khz(e){return z.hz(e*1e3)}static z=a.z.union([a.z.number().transform(e=>new z(e)),a.z.instanceof(z)])}class b extends re{constructor(e){B(e)&&(e=e.value),super(e.valueOf())}length(e){return e.valueOf()/this.valueOf()}size(e){return new m(e*this.valueOf())}add(e){return new b(W(this.valueOf(),new b(e).valueOf()))}sub(e){return new b(q(this.valueOf(),new b(e).valueOf()))}mult(e){return new b(R(this.valueOf(),e))}div(e){return new b(Ne(this.valueOf(),e))}static UNKNOWN=new b(0);static BIT128=new b(16);static BIT64=new b(8);static BIT32=new b(4);static BIT16=new b(2);static BIT8=new b(1);static z=a.z.union([a.z.number().transform(e=>new b(e)),a.z.instanceof(b)])}class I{start;end;constructor(e,r){typeof e=="object"&&"start"in e?(this.start=new f(e.start),this.end=new f(e.end)):(this.start=new f(e),this.end=new f(r))}get span(){return new g(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.start.isZero&&this.end.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new I(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(e,r=g.ZERO){if(r.isZero)return this.start.equals(e.start)&&this.end.equals(e.end);let n=this.start.sub(e.start).valueOf(),s=this.end.sub(e.end).valueOf();return n<0&&(n=-n),s<0&&(s=-s),n<=r.valueOf()&&s<=r.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.toString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e,r=g.ZERO){e=e.makeValid();const n=this.makeValid();if(this.equals(e))return!0;if(e.end.equals(n.start)||n.end.equals(e.start))return!1;const s=f.max(n.start,e.start),i=f.min(n.end,e.end);return i.before(s)?!1:new g(i.sub(s)).greaterThanOrEqual(r)}contains(e){return e instanceof I?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const r=new I(this.start,this.end);return e.start.after(this.start)&&(r.start=e.start),e.start.after(this.end)&&(r.end=e.start),e.end.before(this.end)&&(r.end=e.end),e.end.before(this.start)&&(r.start=e.end),r}static max(...e){return new I(f.min(...e.map(r=>r.start)),f.max(...e.map(r=>r.end)))}static MAX=new I(f.MIN,f.MAX);static ZERO=new I(f.ZERO,f.ZERO);static z=a.z.union([a.z.object({start:f.z,end:f.z}).transform(e=>new I(e.start,e.end)),a.z.instanceof(I)]);static sort(e,r){return f.sort(e.start,r.start)||f.sort(e.end,r.end)}static simplify(e){return e.map(r=>r.makeValid()).sort((r,n)=>I.sort(r,n)).reduce((r,n)=>{if(n.span.isZero)return r;if(r.length===0)return r.push(n),r;const s=r[r.length-1];return s.overlapsWith(n)||s.end.equals(n.start)?s.end=f.max(s.end,n.end):r.push(n),r},[])}}class c extends re{constructor(e){if(B(e)&&(e=e.value),e instanceof c||typeof e=="string"||typeof e.valueOf()=="string")super(e.valueOf());else{const r=c.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(r==null)throw new Error(`unable to find data type for ${e.toString()}`);super(r.valueOf())}}get Array(){const e=c.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}matches(...e){return e.some(r=>this.equals(r))}toString(e=!1){return e?c.SHORT_STRINGS.get(this.valueOf())??this.valueOf():this.valueOf()}get isVariable(){return this.equals(c.JSON)||this.equals(c.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(c.UUID)}get isInteger(){const e=this.toString();return e.startsWith("int")||e.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const e=c.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}get isUnsignedInteger(){return this.equals(c.UINT8)||this.equals(c.UINT16)||this.equals(c.UINT32)||this.equals(c.UINT64)}get isSignedInteger(){return this.equals(c.INT8)||this.equals(c.INT16)||this.equals(c.INT32)||this.equals(c.INT64)}canSafelyCastTo(e){return this.equals(e)?!0:!this.isNumeric||!e.isNumeric||this.isVariable||e.isVariable||this.isUnsignedInteger&&e.isSignedInteger?!1:this.isFloat?e.isFloat&&this.density.valueOf()<=e.density.valueOf():this.equals(c.INT32)&&e.equals(c.FLOAT64)||this.equals(c.INT8)&&e.equals(c.FLOAT32)?!0:this.isInteger&&e.isInteger?this.density.valueOf()<=e.density.valueOf()&&this.isUnsignedInteger===e.isUnsignedInteger:!1}canCastTo(e){return this.isNumeric&&e.isNumeric?!0:this.equals(e)}checkArray(e){return e.constructor===this.Array}get usesBigInt(){return c.BIG_INT_TYPES.some(e=>e.equals(this))}static UNKNOWN=new c("unknown");static FLOAT64=new c("float64");static FLOAT32=new c("float32");static INT64=new c("int64");static INT32=new c("int32");static INT16=new c("int16");static INT8=new c("int8");static UINT64=new c("uint64");static UINT32=new c("uint32");static UINT16=new c("uint16");static UINT8=new c("uint8");static BOOLEAN=new c("boolean");static TIMESTAMP=new c("timestamp");static UUID=new c("uuid");static STRING=new c("string");static JSON=new c("json");static ARRAY_CONSTRUCTORS=new Map([[c.UINT8.toString(),Uint8Array],[c.UINT16.toString(),Uint16Array],[c.UINT32.toString(),Uint32Array],[c.UINT64.toString(),BigUint64Array],[c.FLOAT32.toString(),Float32Array],[c.FLOAT64.toString(),Float64Array],[c.INT8.toString(),Int8Array],[c.INT16.toString(),Int16Array],[c.INT32.toString(),Int32Array],[c.INT64.toString(),BigInt64Array],[c.TIMESTAMP.toString(),BigInt64Array],[c.STRING.toString(),Uint8Array],[c.JSON.toString(),Uint8Array],[c.UUID.toString(),Uint8Array]]);static ARRAY_CONSTRUCTOR_DATA_TYPES=new Map([[Uint8Array.name,c.UINT8],[Uint16Array.name,c.UINT16],[Uint32Array.name,c.UINT32],[BigUint64Array.name,c.UINT64],[Float32Array.name,c.FLOAT32],[Float64Array.name,c.FLOAT64],[Int8Array.name,c.INT8],[Int16Array.name,c.INT16],[Int32Array.name,c.INT32],[BigInt64Array.name,c.INT64]]);static DENSITIES=new Map([[c.UINT8.toString(),b.BIT8],[c.UINT16.toString(),b.BIT16],[c.UINT32.toString(),b.BIT32],[c.UINT64.toString(),b.BIT64],[c.FLOAT32.toString(),b.BIT32],[c.FLOAT64.toString(),b.BIT64],[c.INT8.toString(),b.BIT8],[c.INT16.toString(),b.BIT16],[c.INT32.toString(),b.BIT32],[c.INT64.toString(),b.BIT64],[c.TIMESTAMP.toString(),b.BIT64],[c.STRING.toString(),b.UNKNOWN],[c.JSON.toString(),b.UNKNOWN],[c.UUID.toString(),b.BIT128]]);static ALL=[c.UNKNOWN,c.FLOAT64,c.FLOAT32,c.INT64,c.INT32,c.INT16,c.INT8,c.UINT64,c.UINT32,c.UINT16,c.UINT8,c.TIMESTAMP,c.UUID,c.STRING,c.JSON];static SHORT_STRINGS=new Map([[c.UINT8.toString(),"u8"],[c.UINT16.toString(),"u16"],[c.UINT32.toString(),"u32"],[c.UINT64.toString(),"u64"],[c.INT8.toString(),"i8"],[c.INT16.toString(),"i16"],[c.INT32.toString(),"i32"],[c.INT64.toString(),"i64"],[c.FLOAT32.toString(),"f32"],[c.FLOAT64.toString(),"f64"],[c.BOOLEAN.toString(),"bool"],[c.TIMESTAMP.toString(),"ts"],[c.UUID.toString(),"uuid"],[c.STRING.toString(),"str"],[c.JSON.toString(),"json"]]);static BIG_INT_TYPES=[c.INT64,c.UINT64,c.TIMESTAMP];static z=a.z.union([a.z.string().transform(e=>new c(e)),a.z.instanceof(c)])}class m extends re{constructor(e){B(e)&&(e=e.value),super(e.valueOf())}largerThan(e){return B(e)&&(e=e.value),this.valueOf()>e.valueOf()}smallerThan(e){return B(e)&&(e=e.value),this.valueOf()<e.valueOf()}add(e){return B(e)&&(e=e.value),new m(W(this.valueOf(),e.valueOf()))}sub(e){return B(e)&&(e=e.value),new m(q(this.valueOf(),e.valueOf()))}mult(e){return new m(R(this.valueOf(),e))}div(e){return new m(Ne(this.valueOf(),e))}truncate(e){return new m(Math.trunc(this.valueOf()/new m(e).valueOf())*new m(e).valueOf())}remainder(e){return m.bytes(this.valueOf()%new m(e).valueOf())}get gigabytes(){return this.valueOf()/m.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/m.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/m.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/m.TERABYTE.valueOf()}toString(){const e=this.truncate(m.TERABYTE),r=this.truncate(m.GIGABYTE),n=this.truncate(m.MEGABYTE),s=this.truncate(m.KILOBYTE),i=this.truncate(m.BYTE),o=e,u=r.sub(e),l=n.sub(r),h=s.sub(n),d=i.sub(s);let y="";return o.isZero||(y+=`${o.terabytes}TB `),u.isZero||(y+=`${u.gigabytes}GB `),l.isZero||(y+=`${l.megabytes}MB `),h.isZero||(y+=`${h.kilobytes}KB `),(!d.isZero||y==="")&&(y+=`${d.valueOf()}B`),y.trim()}static bytes(e=1){return new m(e)}static BYTE=new m(1);static kilobytes(e=1){return m.bytes(new m(e).valueOf()*1e3)}static KILOBYTE=m.kilobytes(1);static megabytes(e=1){return m.kilobytes(new m(e).valueOf()*1e3)}static MEGABYTE=m.megabytes(1);static gigabytes(e=1){return m.megabytes(new m(e).valueOf()*1e3)}static GIGABYTE=m.gigabytes(1);static terabytes(e){return m.gigabytes(new m(e).valueOf()*1e3)}static TERABYTE=m.terabytes(1);static ZERO=new m(0);static z=a.z.union([a.z.number().transform(e=>new m(e)),a.z.instanceof(m)]);get isZero(){return this.valueOf()===0}}a.z.object({start:a.z.number(),end:a.z.number()});const Fo=a.z.union([a.z.instanceof(Uint8Array),a.z.instanceof(Uint16Array),a.z.instanceof(Uint32Array),a.z.instanceof(BigUint64Array),a.z.instanceof(Float32Array),a.z.instanceof(Float64Array),a.z.instanceof(Int8Array),a.z.instanceof(Int16Array),a.z.instanceof(Int32Array),a.z.instanceof(BigInt64Array)]),tn=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"||t instanceof f||t instanceof g||t instanceof Date},Yo=(t,e,r,n=0)=>t.usesBigInt&&!e.usesBigInt?Number(r)-Number(n):!t.usesBigInt&&e.usesBigInt?BigInt(r.valueOf())-BigInt(n.valueOf()):q(r,n),Vo="00000000-0000-0000-0000-000000000000",Wo=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Go(t){return typeof t=="string"&&Wo.test(t)}const M=[];for(let t=0;t<256;++t)M.push((t+256).toString(16).slice(1));function rn(t,e=0){return(M[t[e+0]]+M[t[e+1]]+M[t[e+2]]+M[t[e+3]]+"-"+M[t[e+4]]+M[t[e+5]]+"-"+M[t[e+6]]+M[t[e+7]]+"-"+M[t[e+8]]+M[t[e+9]]+"-"+M[t[e+10]]+M[t[e+11]]+M[t[e+12]]+M[t[e+13]]+M[t[e+14]]+M[t[e+15]]).toLowerCase()}function Ho(t,e=0){const r=rn(t,e);if(!Go(r))throw TypeError("Stringified UUID is invalid");return r}let tt;const Xo=new Uint8Array(16);function Jo(){if(!tt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tt=crypto.getRandomValues.bind(crypto)}return tt(Xo)}const Ko=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rr={randomUUID:Ko};function Qo(t,e,r){t=t||{};const n=t.random??t.rng?.()??Jo();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,rn(n)}function _o(t,e,r){return rr.randomUUID&&!t?rr.randomUUID():Qo(t)}const ea=()=>_o(),Gt=(t,e)=>Ho(t,e),ta=Vo,ra=Object.freeze(Object.defineProperty({__proto__:null,ZERO:ta,create:ea,parse:Gt},Symbol.toStringTag,{value:"Module"})),H=-1,mt={[Symbol.iterator]:()=>mt,next:()=>({done:!0,value:void 0})},na=a.z.string().transform(t=>new Uint8Array(atob(t).split("").map(e=>e.charCodeAt(0))).buffer),sa=a.z.union([a.z.null(),a.z.undefined()]).transform(()=>new Uint8Array().buffer),bt=10,nn=(t,e)=>{if(t==="number"&&!e.isNumeric)throw new Error(`cannot convert series of type ${e.toString()} to number`);if(t==="bigint"&&!e.usesBigInt)throw new Error(`cannot convert series of type ${e.toString()} to bigint`)},sn="sy_x_telem_series";class L{key;discriminator=sn;dataType;sampleOffset;gl;_data;timeRange=I.ZERO;alignment=0n;alignmentMultiple=1n;cachedMin;cachedMax;writePos=H;_refCount=0;cachedLength;_cachedIndexes;static crudeZ=a.z.object({timeRange:I.z.optional(),dataType:c.z,alignment:a.z.coerce.bigint().optional(),data:a.z.union([na,sa,a.z.instanceof(ArrayBuffer),a.z.instanceof(Uint8Array)]),glBufferUsage:qo.default("static").optional()});static z=L.crudeZ.transform(e=>new L(e));constructor(e){ia(e)&&(e={data:e}),e.data??=[];const{dataType:r,timeRange:n,sampleOffset:s=0,glBufferUsage:i="static",alignment:o=0n,alignmentMultiple:u=1n,key:l=It(),data:h}=e;if(on(h)){const p=h;this.key=p.key,this.dataType=p.dataType,this.sampleOffset=p.sampleOffset,this.gl=p.gl,this._data=p._data,this.timeRange=p.timeRange,this.alignment=p.alignment,this.alignmentMultiple=p.alignmentMultiple,this.cachedMin=p.cachedMin,this.cachedMax=p.cachedMax,this.writePos=p.writePos,this._refCount=p._refCount,this.cachedLength=p.cachedLength;return}const d=tn(h),y=Array.isArray(h);if(r!=null)this.dataType=new c(r);else{if(h instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(y||d){let p=h;if(!d){if(h.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");p=h[0]}if(typeof p=="string")this.dataType=c.STRING;else if(typeof p=="number")this.dataType=c.FLOAT64;else if(typeof p=="bigint")this.dataType=c.INT64;else if(typeof p=="boolean")this.dataType=c.BOOLEAN;else if(p instanceof f||p instanceof Date||p instanceof f)this.dataType=c.TIMESTAMP;else if(typeof p=="object")this.dataType=c.JSON;else throw new Error(`cannot infer data type of ${typeof p} when constructing a Series from a JS array`)}else this.dataType=new c(h)}if(!y&&!d)this._data=h;else if(y&&h.length===0)this._data=new this.dataType.Array([]).buffer;else{let p=d?[h]:h;const N=p[0];(N instanceof f||N instanceof Date||N instanceof g)&&(p=p.map(A=>new f(A).valueOf())),this.dataType.equals(c.STRING)?(this.cachedLength=p.length,this._data=new TextEncoder().encode(`${p.join(`
1
+ "use strict";const a=require("zod"),cr=t=>a.union([a.union([a.null(),a.undefined()]).transform(()=>[]),t.array()]),Dn=t=>Array.isArray(t)?t:t==null?[]:[t],hr=(t,e)=>{if(Array.isArray(e))return e.reduce((s,i)=>hr(s,i),t??[]);if(t==null)return[e];const r=t.findIndex(s=>s==e),n=[...t];return r===-1?n.push(e):n[r]=e,n},Pn=((t,e)=>{if(t!=null)return Array.isArray(e)?t.filter(r=>!e.includes(r)):t.filter(r=>r!=e)}),fr=(t,e)=>{if(Array.isArray(e))return e.reduce((s,i)=>fr(s,i),t??[]);if(t==null)return[e];const r=t.findIndex(s=>s.key===e.key),n=[...t];return r===-1?n.push(e):n[r]=e,n},qn=((t,e)=>{if(t!=null)return Array.isArray(e)?t.filter(r=>!e.includes(r.key)):t.filter(r=>r.key!==e)}),Zn=Object.freeze(Object.defineProperty({__proto__:null,nullableZ:cr,remove:Pn,removeKeyed:qn,toArray:Dn,upsert:hr,upsertKeyed:fr},Symbol.toStringTag,{value:"Module"})),Fn=t=>{const e=t.replace(/_[a-z]/g,r=>r[1].toUpperCase());return e.length>1&&e[0]===e[0].toUpperCase()&&e[1]===e[1].toUpperCase()||e.length===0?e:e[0].toLowerCase()+e.slice(1)},Fe=t=>{const e=(r,n=it)=>{if(typeof r=="string")return t(r);if(Array.isArray(r))return r.map(o=>e(o,n));if(!_e(r))return r;n=Wn(n);const s={},i=r;return"toJSON"in i&&typeof i.toJSON=="function"?e(i.toJSON(),n):(Object.keys(i).forEach(o=>{let u=i[o];const l=t(o);n.recursive&&(_e(u)?er(u)||(u=e(u,n)):n.recursiveInArray&&_t(u)&&(u=[...u].map(h=>{let f=h;return _e(h)?er(f)||(f=e(h,n)):_t(h)&&(f=e({key:h},n).key),f}))),s[l]=u}),s)};return e},St=Fe(Fn),Yn=t=>t.replace(/([a-z0-9])([A-Z])/g,(e,r,n)=>`${r}_${n.toLowerCase()}`),dr=Fe(Yn),gr=t=>t.length===0?t:t[0].toUpperCase()+t.slice(1),Vn=[Number,String,Uint8Array],it={recursive:!0,recursiveInArray:!0},Wn=(t=it)=>(t.recursive==null?t=it:t.recursiveInArray??=!1,t),_t=t=>t!=null&&Array.isArray(t),_e=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),er=t=>Vn.some(e=>t instanceof e),Gn=t=>t.replace(/[\s_]+/g,"-").replace(/([a-z0-9])([A-Z])/g,(e,r,n)=>`${r}-${n.toLowerCase()}`).toLowerCase(),Hn=Fe(Gn),Xn=t=>{if(t.length===0)return t;let e=t.replace(/[_-]/g," ");return e=e.replace(/([a-z0-9])([A-Z])/g,(r,n,s)=>`${n} ${s}`),e=e.replace(/([A-Z]+)([A-Z][a-z])/g,(r,n,s)=>`${n} ${s}`),e=e.replace(/\s+/g," ").trim(),e=e.replace(/\b\w/g,r=>r.toUpperCase()),e},Jn=Fe(Xn),Kn=Object.freeze(Object.defineProperty({__proto__:null,camelToSnake:dr,capitalize:gr,snakeToCamel:St,toKebab:Hn,toProperNoun:Jn},Symbol.toStringTag,{value:"Module"})),Ue=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),Qn=Object.freeze(Object.defineProperty({__proto__:null,isObject:Ue},Symbol.toStringTag,{value:"Module"}));class _n{contentType="application/json";decoder;encoder;constructor(){this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,r){return this.decodeString(this.decoder.decode(e),r)}decodeString(e,r){const n=JSON.parse(e),s=St(n);return r!=null?r.parse(s):s}encodeString(e){const r=dr(e);return JSON.stringify(r,(n,s)=>ArrayBuffer.isView(s)?Array.from(s):typeof s=="bigint"?s.toString():s)}}const ot=new _n,B=t=>t!=null&&typeof t=="object"&&"value"in t;class re{value;constructor(e){this.value=e}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}}const Nt=t=>t!=null&&typeof t=="object"&&"toString"in t,pr=t=>{if(Nt(t))return t?.toString().length===0;switch(typeof t){case"string":return t.length===0;case"number":return t===0;case"bigint":return t===0n;case"boolean":return!t;case"undefined":return!0;case"object":return t==null;default:return!1}},es=t=>!pr(t),ts=Object.freeze(Object.defineProperty({__proto__:null,ValueExtension:re,isCrudeValueExtension:B,isNonZero:es,isStringer:Nt,isZero:pr},Symbol.toStringTag,{value:"Module"})),at=t=>[...new Set(t)],rs=(t,e,r=!0)=>{const n=new Map;return t.forEach(s=>{const i=e(s);if(n.has(i)){if(r)return;n.delete(i)}n.set(i,s)}),Array.from(n.values())},ns=Object.freeze(Object.defineProperty({__proto__:null,by:rs,unique:at},Symbol.toStringTag,{value:"Module"})),Se=(t,e=!1)=>{const r=Nt(t)?"stringer":typeof t;let n;switch(r){case"string":n=(s,i)=>s.localeCompare(i);break;case"stringer":n=(s,i)=>s.toString().localeCompare(i.toString());break;case"number":n=(s,i)=>Number(s)-Number(i);break;case"bigint":n=(s,i)=>BigInt(s)-BigInt(i)>0n?1:-1;break;case"boolean":n=(s,i)=>Number(s)-Number(i);break;case"undefined":n=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return e?mr(n):n},ss=(t,e,r)=>{const n=Se(e[t],r);return(s,i)=>n(s[t],i[t])},is=(t,e)=>t.length!==e.length?t.length-e.length:t.every((r,n)=>r===e[n])?0:-1,yr=(t,e)=>{if(t.length!==e.length)return t.length-e.length;if(t.length===0)return 0;const r=Se(t[0]),n=[...t].sort(r),s=[...e].sort(r);return n.every((i,o)=>i===s[o])?0:-1},os=(t,e)=>{const r=at(t),n=at(e);return yr(r,n)},as=(t,e)=>t===e?0:t==="first"&&e==="last"?1:-1,mr=t=>(e,r)=>t(r,e),ne=0,Y=-1,V=1,br=t=>t<ne,wr=t=>t>ne,us=t=>t>=ne,Or=t=>t===ne,ls=(t,e)=>{const r=/([a-zA-Z]+)|(\d+)/g,n=t.replace(/[\s_.-]+/g,"").match(r),s=e.replace(/[\s_.-]+/g,"").match(r);if(!n||!s)return 0;for(let i=0;i<Math.min(n.length,s.length);i++){const o=n[i],u=s[i];if(isNaN(Number(o))&&isNaN(Number(u))){const l=o.localeCompare(u);if(l!==0)return l}else if(!isNaN(Number(o))&&!isNaN(Number(u))){const l=Number(o)-Number(u);if(l!==0)return l}else return isNaN(Number(o))?-1:1}return n.length-s.length},vr=(t,e,r)=>{let n=0,s=t.length;const i=r??Se(e);for(;n<s;){const o=Math.floor((n+s)/2),u=i(t[o],e);if(u===0)return o;u<0?n=o+1:s=o}return n},cs=(t,e,r)=>{const n=vr(t,e,r);t.splice(n,0,e)},hs=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:ne,GREATER_THAN:V,LESS_THAN:Y,insert:cs,isEqualTo:Or,isGreaterThan:wr,isGreaterThanEqual:us,isLessThan:br,newF:Se,newFieldF:ss,order:as,primitiveArrays:is,reverseF:mr,search:vr,stringsWithNumbers:ls,uniqueUnorderedPrimitiveArrays:os,unorderedPrimitiveArrays:yr},Symbol.toStringTag,{value:"Module"}));let Tr=(t,e=21)=>(r=e)=>{let n="",s=r|0;for(;s--;)n+=t[Math.random()*t.length|0];return n};const xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",fs=`0123456789${xr}`,Sr=11,ds=Tr(xr,1),gs=Tr(fs,Sr-1),It=()=>`${ds()}${gs()}`,ps=Object.freeze(Object.defineProperty({__proto__:null,LENGTH:Sr,create:It},Symbol.toStringTag,{value:"Module"})),ys=(t,e)=>r=>r instanceof e||typeof r=="object"&&r!==null&&"discriminator"in r&&r.discriminator===t,ms=2**8-1,Nr=2**12-1,bs=2**16-1,ws=2**32-1,Os=2n**64n-1n,vs=2**64-1,Ts=-128,xs=2**7-1,Ss=-32768,Ns=2**15-1,Is=-2147483648,Ms=2**31-1,As=-(2n**63n),ke=2n**63n-1n,zs=-9223372036854776e3,Ir=2**63-1,ue=t=>(e,r)=>{if(typeof e=="bigint"){if(De(r))return t(e,BigInt(r));const n=t(Number(e),Number(r));return typeof n=="number"?BigInt(Math.round(n)):n}return t(Number(e),Number(r))},q=ue((t,e)=>t-e),W=ue((t,e)=>t+e),Es=(t,e,r=1e-4)=>Math.abs(t-e)<r,ut=(t,e)=>{const r=typeof t=="bigint",n=typeof e=="bigint";return r&&n?t===e:r&&De(e)?t===BigInt(e):n&&De(t)?e===BigInt(t):t===e},js=t=>{const e=10**Math.floor(Math.log10(t));return Math.round(t/e)*e},Mr=ue((t,e)=>t<=e?t:e),De=t=>typeof t=="bigint"?!0:Number.isInteger(t),Us=ue((t,e)=>t>=e?t:e),Ar=t=>typeof t=="bigint"?t<0n?-t:t:t<0?-t:t,R=ue((t,e)=>t*e),Ne=ue((t,e)=>t/e),zr=a.z.tuple([a.z.number(),a.z.number()]),Mt=a.z.object({width:a.z.number(),height:a.z.number()}),Bs=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),$s=["start","center","end"],ae=a.z.object({x:a.z.number(),y:a.z.number()}),Er=a.z.object({clientX:a.z.number(),clientY:a.z.number()}),Ye=["x","y"],At=a.z.enum(Ye),zt=["top","right","bottom","left"],Cs=a.z.enum(zt),Ve=["left","right"],Et=a.z.enum(Ve),We=["top","bottom"],jt=a.z.enum(We),Ut=["center"],lt=a.z.enum(Ut),Rs=[...zt,...Ut],Bt=a.z.enum(Rs);a.z.enum($s);const Ls=["first","last"];a.z.enum(Ls);const ks=a.z.object({lower:a.z.number(),upper:a.z.number()}),Ds=a.z.enum([...At.options,...Bt.options]),Ps=a.z.union([At,Bt,a.z.instanceof(String)]),w=(t,e,r)=>{const n={};if(typeof e=="object"&&(r=e,e=void 0),r={makeValid:!0,...r},typeof t=="number"||typeof t=="bigint")e!=null?(n.lower=t,n.upper=e):(n.lower=typeof t=="bigint"?0n:0,n.upper=t);else if(Array.isArray(t)){if(t.length!==2)throw new Error("bounds: expected array of length 2");[n.lower,n.upper]=t}else n.lower=t.lower,n.upper=t.upper;return r?.makeValid?jr(n):n},qs=Object.freeze({lower:0,upper:0}),Zs=Object.freeze({lower:-1/0,upper:1/0}),Fs=Object.freeze({lower:0,upper:1}),Ys=Object.freeze({lower:-1,upper:1}),Vs=(t,e)=>{if(t==null&&e==null)return!0;if(t==null||e==null)return!1;const r=w(t),n=w(e);return r?.lower===n?.lower&&r?.upper===n?.upper},jr=t=>t.lower>t.upper?{lower:t.upper,upper:t.lower}:t,ct=(t,e)=>{const r=w(t);return e<r.lower?r.lower:e>=r.upper?r.upper-(typeof r.upper=="number"?1:1n):e},k=(t,e)=>{const r=w(t);if(typeof e=="number"||typeof e=="bigint")return e>=r.lower&&e<r.upper;const n=w(e);return n.lower>=r.lower&&n.upper<=r.upper},Ws=(t,e)=>{const r=w(t),n=w(e);return r.lower===n.lower?!0:n.upper===r.lower||n.lower===r.upper?!1:k(r,n.upper)||k(r,n.lower)||k(n,r.upper)||k(n,r.lower)},le=t=>{const e=w(t);return e.upper-e.lower},Gs=t=>{const e=w(t);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},Hs=t=>{const e=le(t);return typeof e=="number"?e===0:e===0n},Xs=t=>{const e=w(t);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},Js=t=>{const e=w(t);return(e.upper+e.lower)/2},Ur=t=>({lower:Math.min(...t.map(e=>w(e).lower)),upper:Math.max(...t.map(e=>w(e).upper))}),Ks=t=>({lower:Math.max(...t.map(e=>w(e).lower)),upper:Math.min(...t.map(e=>w(e).upper))}),Qs=t=>{const e=w(t),r=typeof e.lower=="bigint";return Array.from({length:Number(le(t))},(n,s)=>r?e.lower+BigInt(s):e.lower+s)},ht=(t,e)=>{const r=t.map(i=>w(i)),n=r.findIndex(i=>k(i,e)||e<i.lower);if(n===-1)return{index:t.length,position:0};const s=r[n];return k(s,e)?{index:n,position:Number(e-s.lower)}:{index:n,position:0}},et={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},_s=(t,e)=>{const r=t.map(h=>w(h)),n=w(e);if(r.length===0)return et;const s=ht(r,n.lower),i=ht(r,n.upper);if(s.index===t.length)return{...et,insertInto:t.length};if(i.index===0)return{...et,removeAfter:i.position};if(s.index===i.index)return s.position!==0&&i.position!==0?null:{removeAfter:i.position,removeBefore:s.position,insertInto:s.index,deleteInBetween:0};let o=i.index-s.index,u=s.index,l=q(Number(le(r[s.index])),s.position);return s.position!==0?(o-=1,u+=1):l=0,{removeBefore:l,removeAfter:i.position,insertInto:u,deleteInBetween:o}},Br=(t,e,r)=>{const n=t.map(u=>w(u)),s=r>0?1:r<0?-1:0;if(s===0)return e;let i=r,o=e;for(;ut(i,0)===!1;){const u=n.findIndex(l=>s>0?o>=l.lower&&o<l.upper:o>l.lower&&o<=l.upper);if(u!==-1){const l=n[u];let h;if(s>0?h=q(l.upper,o):h=q(o,l.lower),h>0){const f=Mr(Ar(i),h);if(o=W(o,s>0?f:-f),i=q(i,s>0?f:-f),ut(i,0))return o;continue}}if(s>0){const l=n.filter(h=>h.lower>o);if(l.length>0)o=l[0].lower;else return o}else{const l=n.filter(h=>h.upper<o);if(l.length>0)o=l[l.length-1].upper;else return o}}return o},$r=(t,e,r)=>{const n=t.map(o=>w(o));if(e===r)return typeof e=="bigint"?0n:0;const s=e<r?w([e,r]):w([r,e]);let i=typeof e=="bigint"?0n:0;for(const o of n){const u=o.lower>s.lower?o.lower:s.lower,l=o.upper<s.upper?o.upper:s.upper;if(u<l){const h=l-u;i=i+h}}return i},ei=Object.freeze(Object.defineProperty({__proto__:null,CLIP:Ys,DECIMAL:Fs,INFINITE:Zs,ZERO:qs,bounds:ks,buildInsertionPlan:_s,clamp:ct,construct:w,contains:k,distance:$r,equals:Vs,findInsertPosition:ht,isFinite:Xs,isZero:Gs,linspace:Qs,makeValid:jr,max:Ur,mean:Js,min:Ks,overlapsWith:Ws,span:le,spanIsZero:Hs,traverse:Br},Symbol.toStringTag,{value:"Module"})),ft=2,dt=3,Cr=2,ti=(t,e)=>{if(Number.isNaN(t)||!Number.isFinite(t))return t;const r=le(e);if(r==0)return t;let n;r>=1e3?n=ft:r>=1?n=dt:n=Math.ceil(-Math.log10(r))+Cr;const s=10**n;return Math.round(t*s)/s},ri=5,ni=1e-10,si=(t,e)=>{if(Number.isNaN(t)||!Number.isFinite(t))return t;const r=Math.abs(t);if(r===0)return 0;let n=!1,s=0;if(e!=null){s=le(e);const u=s/r;n=s>0&&u>ni}if(n){let u;s>=1e3?u=ft:s>=1?u=dt:u=Math.ceil(-Math.log10(s))+Cr;const l=10**u;return Math.round(t*l)/l}if(r>=1e3){const u=10**ft;return Math.round(t*u)/u}if(r>=1){const u=10**dt;return Math.round(t*u)/u}const i=Math.floor(Math.log10(r)),o=10**(ri-i-1);return Math.round(t*o)/o},ii=Object.freeze(Object.defineProperty({__proto__:null,MAX_INT16:Ns,MAX_INT32:Ms,MAX_INT64:ke,MAX_INT64_NUMBER:Ir,MAX_INT8:xs,MAX_UINT12:Nr,MAX_UINT16:bs,MAX_UINT32:ws,MAX_UINT64:Os,MAX_UINT64_NUMBER:vs,MAX_UINT8:ms,MIN_INT16:Ss,MIN_INT32:Is,MIN_INT64:As,MIN_INT64_NUMBER:zs,MIN_INT8:Ts,abs:Ar,add:W,closeTo:Es,div:Ne,equal:ut,isInteger:De,max:Us,min:Mr,mult:R,roundBySpan:ti,roundToNearestMagnitude:js,smartRound:si,sub:q},Symbol.toStringTag,{value:"Module"})),Rr=Ds,P=t=>Ye.includes(t)?t:We.includes(t)?"y":"x",oi=t=>P(t)==="x"?"y":"x",ai=t=>P(t)==="x"?"width":"height",ui=t=>P(t)==="x"?"left":"top",li=t=>Rr.safeParse(t).success,ci=t=>P(t)==="x"?"signedWidth":"signedHeight",hi=t=>t==="center"?!1:P(t)==="x",fi=t=>P(t)==="y",Lr=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:Ye,construct:P,crude:Rr,dimension:ai,direction:At,isDirection:li,isX:hi,isY:fi,location:ui,signedDimension:ci,swap:oi},Symbol.toStringTag,{value:"Module"})),di=Et,gi=jt,pi=lt,yi={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},mi={top:{clockwise:"left",counterclockwise:"right"},right:{clockwise:"top",counterclockwise:"bottom"},bottom:{clockwise:"right",counterclockwise:"left"},left:{clockwise:"bottom",counterclockwise:"top"}},bi=Ps,ee=t=>t instanceof String||!Ye.includes(t)?t:t==="x"?"left":"top",wi=t=>yi[ee(t)],Oi=(t,e)=>mi[t][e],Oe=t=>{const e=ee(t);return e==="top"||e==="bottom"?"y":"x"},vi=a.z.object({x:Et.or(lt),y:jt.or(lt)}),$t=a.z.object({x:Et,y:jt}),ce=Object.freeze({x:"left",y:"top"}),Ct=Object.freeze({x:"right",y:"top"}),Ge=Object.freeze({x:"left",y:"bottom"}),Rt=Object.freeze({x:"right",y:"bottom"}),Lt=Object.freeze({x:"center",y:"center"}),kt=Object.freeze({x:"center",y:"top"}),Dt=Object.freeze({x:"center",y:"bottom"}),Pt=Object.freeze({x:"right",y:"center"}),qt=Object.freeze({x:"left",y:"center"}),Ti=Object.freeze([qt,Pt,kt,Dt,ce,Ct,Ge,Rt,Lt]),Zt=(t,e)=>t.x===e.x&&t.y===e.y,xi=(t,e)=>{if(typeof e=="object"){let r=!0;return"x"in e&&(t.x===e.x||(r=!1)),"y"in e&&(t.y===e.y||(r=!1)),r}return t.x===e||t.y===e},kr=t=>[t.x,t.y],Be=t=>Oe(ee(t))==="x",Si=t=>Oe(ee(t))==="y",Ni=t=>`${t.x}${gr(t.y)}`,Ii=(t,e)=>{let r,n;if(typeof t=="object"&&"x"in t?(r=t.x,n=t.y):(r=ee(t),n=ee(e??t)),Oe(r)===Oe(n)&&r!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`);const s={...Lt};return r==="center"?Be(n)?[s.x,s.y]=[n,r]:[s.x,s.y]=[r,n]:n==="center"?Be(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r]:Be(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r],s},Dr=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:Dt,BOTTOM_LEFT:Ge,BOTTOM_RIGHT:Rt,CENTER:Lt,CENTER_LEFT:qt,CENTER_LOCATIONS:Ut,CENTER_RIGHT:Pt,OUTER_LOCATIONS:zt,TOP_CENTER:kt,TOP_LEFT:ce,TOP_RIGHT:Ct,XY_LOCATIONS:Ti,X_LOCATIONS:Ve,Y_LOCATIONS:We,center:pi,construct:ee,constructXY:Ii,corner:$t,crude:bi,direction:Oe,isX:Be,isY:Si,location:Bt,outer:Cs,rotate:Oi,swap:wi,x:di,xy:vi,xyCouple:kr,xyEquals:Zt,xyMatches:xi,xyToString:Ni,y:gi},Symbol.toStringTag,{value:"Module"})),gt=a.z.union([a.z.number(),ae,zr,Mt,Bs,Er]),v=(t,e)=>{if(typeof t=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:e,y:0}:{x:0,y:e}}return typeof t=="number"?{x:t,y:e??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},Z=Object.freeze({x:0,y:0}),Pr=Object.freeze({x:1,y:1}),Mi=Object.freeze({x:1/0,y:1/0}),Ai=Object.freeze({x:NaN,y:NaN}),Pe=(t,e,r=0)=>{const n=v(t),s=v(e);return r===0?n.x===s.x&&n.y===s.y:Math.abs(n.x-s.x)<=r&&Math.abs(n.y-s.y)<=r},zi=t=>Pe(t,Z),Ft=(t,e,r)=>{const n=v(t),s=v(e,r);return{x:n.x*s.x,y:n.y*s.y}},qr=(t,e)=>{const r=v(t);return{x:r.x+e,y:r.y}},Zr=(t,e)=>{const r=v(t);return{x:r.x,y:r.y+e}},ve=(t,e,r,...n)=>{if(typeof e=="string"){if(typeof r!="number")throw new Error("The value must be a number.");return e==="x"?qr(t,r):Zr(t,r)}if(typeof e=="object"&&"x"in e&&typeof e.x=="string"){const s=v(r),i=v(t);return e.x==="left"?s.x=-s.x:e.x==="center"&&(s.x=0),e.y==="top"?s.y=-s.y:e.y==="center"&&(s.y=0),{x:i.x+s.x,y:i.y+s.y}}return[t,e,r??Z,...n].reduce((s,i)=>{const o=v(i);return{x:s.x+o.x,y:s.y+o.y}},Z)},Ei=(t,e,r)=>{const n=v(t);return P(e)==="x"?{x:r,y:n.y}:{x:n.x,y:r}},ji=(t,e)=>{const r=v(t),n=v(e);return Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)},Ui=(t,e)=>{const r=v(t),n=v(e);return{x:n.x-r.x,y:n.y-r.y}},Bi=t=>{const e=v(t);return Number.isNaN(e.x)||Number.isNaN(e.y)},$i=t=>{const e=v(t);return Number.isFinite(e.x)&&Number.isFinite(e.y)},Ci=t=>{const e=v(t);return[e.x,e.y]},Ri=t=>{const e=v(t);return{left:e.x,top:e.y}},qe=(t,e=0)=>{const r=v(t);return{x:Number(r.x.toFixed(e)),y:Number(r.y.toFixed(e))}},de=(t,e)=>{const r=v(t),n=v(e);return{x:r.x-n.x,y:r.y-n.y}},ge=t=>{const e=v(t),r=Math.hypot(e.x,e.y);return r===0?{x:0,y:0}:{x:-e.y/r,y:e.x/r}},Fr=t=>{const e=v(t),r=Math.hypot(e.x,e.y);return r===0?{x:0,y:0}:{x:e.x/r,y:e.y/r}},Yr=(...t)=>{const e=t.reduce((r,n)=>ve(r,n),Z);return Ft(e,1/t.length)},Li=(t,e)=>{const r=[];for(let n=0;n<t.length;n++){const s=t[n];let i,o,u,l;if(n===0){const h=t[n+1],f=de(h,s);o=ge(f),u=o,l=e}else if(n===t.length-1){const h=t[n-1],f=de(s,h);i=ge(f),u=i,l=e}else{const h=t[n-1],f=t[n+1],y=de(s,h),p=de(f,s);i=ge(y),o=ge(p);const I=Math.acos((y.x*p.x+y.y*p.y)/(Math.hypot(y.x,y.y)*Math.hypot(p.x,p.y))),A=Math.sin(I/2);A===0?l=e:l=e/A,u=Fr(Yr(i,o))}r.push(Ft(u,l))}return r},ki=t=>{const e=v(t);return{x:e.y,y:e.x}},pt=t=>{const e=v(t);return{x:Math.round(e.x),y:Math.round(e.y)}},Di=t=>{const e=v(t);return{x:1/e.x,y:1/e.y}},Pi=(t,e,r)=>{const n=v(t),s=v(e),i=r==="clockwise"?Math.PI/2:-Math.PI/2,o=n.x-s.x,u=n.y-s.y,l=o*Math.cos(i)-u*Math.sin(i),h=o*Math.sin(i)+u*Math.cos(i);return{x:l+s.x,y:h+s.y}},qi=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:Mi,NAN:Ai,ONE:Pr,ZERO:Z,average:Yr,calculateMiters:Li,clientXY:Er,construct:v,couple:Ci,crudeZ:gt,css:Ri,distance:ji,equals:Pe,isFinite:$i,isNan:Bi,isZero:zi,normal:ge,normalize:Fr,reciprocal:Di,rotate:Pi,round:pt,scale:Ft,set:Ei,sub:de,swap:ki,translate:ve,translateX:qr,translateY:Zr,translation:Ui,truncate:qe,xy:ae},Symbol.toStringTag,{value:"Module"})),Me=a.z.union([a.z.number(),a.z.string()]),Zi=a.z.object({top:Me,left:Me,width:Me,height:Me}),Fi=a.z.object({left:a.z.number(),top:a.z.number(),right:a.z.number(),bottom:a.z.number()}),Yi=a.z.object({one:ae,two:ae,root:$t}),Vr={one:Z,two:Z,root:ce},Vi={one:Z,two:Pr,root:Ge},Wr=(t,e)=>({one:t.one,two:t.two,root:e??t.root}),x=(t,e,r=0,n=0,s)=>{const i={one:{...Z},two:{...Z},root:s??ce};if(typeof t=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return i.one={x:t,y:e},i.two={x:i.one.x+r,y:i.one.y+n},i}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(i.one={x:t.left,y:t.top},i.two={x:t.right,y:t.bottom},i):(i.one=t,e==null?i.two={x:i.one.x+r,y:i.one.y+n}:typeof e=="number"?i.two={x:i.one.x+e,y:i.one.y+r}:"width"in e?i.two={x:i.one.x+e.width,y:i.one.y+e.height}:"signedWidth"in e?i.two={x:i.one.x+e.signedWidth,y:i.one.y+e.signedHeight}:i.two=e,i))},Wi=(t,e,r)=>{const n=x(t);if(typeof e=="string"){if(r==null)throw new Error("Invalid arguments for resize");const s=P(e);return x(n.one,void 0,s==="x"?r:E(n),s==="y"?r:j(n),n.root)}return x(n.one,e,void 0,void 0,n.root)},Gi=(t,e,r=!0)=>{const n=x(t);let s=(i,o)=>i<o;return r&&(s=(i,o)=>i<=o),"one"in e?s(X(n),X(e))&&s(Q(e),Q(n))&&s(J(n),J(e))&&s(_(e),_(n)):s(X(n),e.x)&&s(e.x,Q(n))&&s(J(n),e.y)&&s(e.y,_(n))},Hi=(t,e)=>Pe(t.one,e.one)&&Pe(t.two,e.two)&&Zt(t.root,e.root),Gr=t=>({width:E(t),height:j(t)}),Xi=t=>({signedWidth:He(t),signedHeight:Xe(t)}),Ji=t=>({top:J(t),left:X(t),width:E(t),height:j(t)}),Yt=(t,e,r=!1)=>{const n=P(e)==="y"?Xe(t):He(t);return r?n:Math.abs(n)},G=(t,e)=>{const r=x(t);return{x:e.x==="center"?yt(r).x:te(r,e.x),y:e.y==="center"?yt(r).y:te(r,e.y)}},te=(t,e)=>{const r=x(t),n=kr(r.root).includes(e)?Math.min:Math.max;return Ve.includes(e)?n(r.one.x,r.two.x):n(r.one.y,r.two.y)},Ki=t=>Jr(t)===0,E=t=>Yt(t,"x"),j=t=>Yt(t,"y"),He=t=>{const e=x(t);return e.two.x-e.one.x},Xe=t=>{const e=x(t);return e.two.y-e.one.y},Hr=t=>G(t,ce),Qi=t=>G(t,kt),_i=t=>G(t,Ct),eo=t=>G(t,Ge),to=t=>G(t,Dt),ro=t=>G(t,Rt),no=t=>G(t,qt),so=t=>G(t,Pt),Q=t=>te(t,"right"),_=t=>te(t,"bottom"),X=t=>te(t,"left"),J=t=>te(t,"top"),yt=t=>ve(Hr(t),{x:He(t)/2,y:Xe(t)/2}),Vt=t=>{const e=x(t);return e.root.x==="left"?X(e):Q(e)},Wt=t=>{const e=x(t);return e.root.y==="top"?J(e):_(e)},io=t=>({x:Vt(t),y:Wt(t)}),$e=t=>{const e=x(t);return{lower:e.one.x,upper:e.two.x}},Ce=t=>{const e=x(t);return{lower:e.one.y,upper:e.two.y}},oo=(t,e)=>Wr(t,e),ao=(t,e)=>{const r=x(t),n=Ve.includes(e)?"x":We.includes(e)?"y":null;if(n===null)throw new Error(`Invalid location: ${e}`);const s=e==="top"||e==="left"?Math.min:Math.max,i={...r.one},o={...r.two};return i[n]=s(r.one[n],r.two[n]),o[n]=s(r.one[n],r.two[n]),[i,o]},uo=(t,e)=>{const r=x(t),n=x(e),s=Vt(n)+(E(n)-E(r))/2,i=Wt(n)+(j(n)-j(r))/2;return x({x:s,y:i},Gr(r))},Xr=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,lo=t=>E(t)/j(t),co=(t,e,r)=>{if(typeof e=="string"){if(r==null)throw new Error("Undefined amount passed into box.translate");const s=P(e);e=v(s,r)}const n=x(t);return x(ve(n.one,e),ve(n.two,e),void 0,void 0,n.root)},ho=(t,e)=>{const r=Math.max(X(t),X(e)),n=Math.max(J(t),J(e)),s=Math.min(Q(t),Q(e)),i=Math.min(_(t),_(e));return r>s||n>i?Vr:x({x:r,y:n},{x:s,y:i},void 0,void 0,t.root)},Jr=t=>E(t)*j(t),fo=(t,e)=>{const r=x(t);return x(qe(r.one,e),qe(r.two,e),void 0,void 0,r.root)},go=(t,e,r,n,s,i)=>{const o={x:t,y:e},u={x:t+r,y:e+n};return s.x!==i.x&&(s.x==="center"?(o.x-=r/2,u.x-=r/2):(o.x-=r,u.x-=r)),s.y!==i.y&&(s.y==="center"?(o.y-=n/2,u.y-=n/2):(o.y-=n,u.y-=n)),x(o,u,void 0,void 0,i)},po=t=>{const e=x(t);return x(pt(e.one),pt(e.two),void 0,void 0,e.root)},yo=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:Vi,ZERO:Vr,area:Jr,areaIsZero:Ki,aspect:lo,bottom:_,bottomCenter:to,bottomLeft:eo,bottomRight:ro,box:Yi,center:yt,centerLeft:no,centerRight:so,construct:x,constructWithAlternateRoot:go,contains:Gi,copy:Wr,css:Ji,cssBox:Zi,dim:Yt,dims:Gr,domRect:Fi,edgePoints:ao,equals:Hi,height:j,intersection:ho,isBox:Xr,left:X,loc:te,positionInCenter:uo,reRoot:oo,resize:Wi,right:Q,root:io,round:po,signedDims:Xi,signedHeight:Xe,signedWidth:He,top:J,topCenter:Qi,topLeft:Hr,topRight:_i,translate:co,truncate:fo,width:E,x:Vt,xBounds:$e,xyLoc:G,y:Wt,yBounds:Ce},Symbol.toStringTag,{value:"Module"})),Kr=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),mo=a.z.union([Mt,Kr,ae,zr]),bo={width:0,height:0},wo={width:1,height:1},D=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},Oo=(t,e)=>{if(e==null)return!1;const r=D(t),n=D(e);return r.width===n.width&&r.height===n.height},vo=t=>{const e=D(t);return{width:e.height,height:e.width}},To=t=>{const e=D(t);return`0 0 ${e.width} ${e.height}`},xo=t=>{const e=D(t);return[e.width,e.height]},So=t=>({width:Math.max(...t.map(e=>D(e).width)),height:Math.max(...t.map(e=>D(e).height))}),No=t=>({width:Math.min(...t.map(e=>D(e).width)),height:Math.min(...t.map(e=>D(e).height))}),Io=(t,e)=>{const r=D(t);return{width:r.width*e,height:r.height*e}},Mo=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:wo,ZERO:bo,construct:D,couple:xo,crude:mo,dimensions:Mt,equals:Oo,max:So,min:No,scale:Io,signed:Kr,svgViewBox:To,swap:vo},Symbol.toStringTag,{value:"Module"})),Qr=(t,e,r)=>e!==void 0&&t<e?e:r!==void 0&&t>r?r:t,Ao=a.z.object({offset:gt,scale:gt}),zo=a.z.object({offset:a.z.number(),scale:a.z.number()}),Eo=t=>(e,r,n,s)=>r==="dimension"?[e,n]:[e,s?n-t:n+t],jo=t=>(e,r,n,s)=>[e,s?n/t:n*t],Uo=t=>(e,r,n)=>{if(e===null)return[t,n];const{lower:s,upper:i}=e,{lower:o,upper:u}=t,l=i-s,h=u-o;if(r==="dimension")return[t,n*(h/l)];const f=(n-s)*(h/l)+o;return[t,f]},Bo=t=>(e,r,n)=>[t,n],$o=()=>(t,e,r)=>{if(t===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[t,r];const{lower:n,upper:s}=t;return[t,s-(r-n)]},Co=t=>(e,r,n)=>{const{lower:s,upper:i}=t;return n=Qr(n,s,i),[e,n]};class F{ops=[];currBounds=null;currType=null;reversed=!1;constructor(){this.ops=[]}static translate(e){return new F().translate(e)}static magnify(e){return new F().magnify(e)}static scale(e,r){return new F().scale(e,r)}translate(e){const r=this.new(),n=Eo(e);return n.type="translate",r.ops.push(n),r}magnify(e){const r=this.new(),n=jo(e);return n.type="magnify",r.ops.push(n),r}scale(e,r){const n=w(e,r),s=this.new(),i=Uo(n);return i.type="scale",s.ops.push(i),s}clamp(e,r){const n=w(e,r),s=this.new(),i=Co(n);return i.type="clamp",s.ops.push(i),s}reBound(e,r){const n=w(e,r),s=this.new(),i=Bo(n);return i.type="re-bound",s.ops.push(i),s}invert(){const e=$o();e.type="invert";const r=this.new();return r.ops.push(e),r}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new F;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,r){return this.currBounds=null,this.ops.reduce(([n,s],i)=>i(n,e,s,this.reversed),[null,r])[1]}reverse(){const e=this.new();e.ops.reverse();const r=[];return e.ops.forEach((n,s)=>{if(n.type==="scale"||r.some(([o,u])=>s>=o&&s<=u))return;const i=e.ops.findIndex((o,u)=>o.type==="scale"&&u>s);i!==-1&&r.push([s,i])}),r.forEach(([n,s])=>{const i=e.ops.slice(n,s);i.unshift(e.ops[s]),e.ops.splice(n,s-n+1,...i)}),e.reversed=!e.reversed,e}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}static IDENTITY=new F}class C{x;y;currRoot;constructor(e=new F,r=new F,n=null){this.x=e,this.y=r,this.currRoot=n}static translate(e,r){return new C().translate(e,r)}static translateX(e){return new C().translateX(e)}static translateY(e){return new C().translateY(e)}static clamp(e){return new C().clamp(e)}static magnify(e){return new C().magnify(e)}static scale(e){return new C().scale(e)}static reBound(e){return new C().reBound(e)}translate(e,r){const n=v(e,r),s=this.copy();return s.x=this.x.translate(n.x),s.y=this.y.translate(n.y),s}translateX(e){const r=this.copy();return r.x=this.x.translate(e),r}translateY(e){const r=this.copy();return r.y=this.y.translate(e),r}magnify(e){const r=this.copy();return r.x=this.x.magnify(e.x),r.y=this.y.magnify(e.y),r}scale(e){const r=this.copy();if(Xr(e)){const n=this.currRoot;return r.currRoot=e.root,n!=null&&!Zt(n,e.root)&&(n.x!==e.root.x&&(r.x=r.x.invert()),n.y!==e.root.y&&(r.y=r.y.invert())),r.x=r.x.scale($e(e)),r.y=r.y.scale(Ce(e)),r}return r.x=r.x.scale(e.width),r.y=r.y.scale(e.height),r}reBound(e){const r=this.copy();return r.x=this.x.reBound($e(e)),r.y=this.y.reBound(Ce(e)),r}clamp(e){const r=this.copy();return r.x=this.x.clamp($e(e)),r.y=this.y.clamp(Ce(e)),r}copy(){const e=new C;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}dim(e){return{x:this.x.dim(e.x),y:this.y.dim(e.y)}}box(e){return x(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}static IDENTITY=new C}const Ro=Object.freeze(Object.defineProperty({__proto__:null,Scale:F,XY:C,crudeXYTransform:Ao,transform:zo},Symbol.toStringTag,{value:"Module"})),_r=ae.extend({root:$t,units:a.object({x:a.enum(["px","decimal"]),y:a.enum(["px","decimal"])})}),Lo=_r.partial({root:!0,units:!0}),ko=t=>{const e={};return e[t.root?.x??"left"]=t?.units?.x==="px"?`${t.x}px`:`${t.x*100}%`,e[t.root?.y??"top"]=t?.units?.y==="px"?`${t.y}px`:`${t.y*100}%`,e},Do=({position:t,element:e,container:r})=>{const n={x:t.x,y:t.y};return t.units?.x==="decimal"?t.root?.x==="right"&&(n.x=1-t.x):t.root?.x==="right"?n.x=1-(t.x+E(e))/E(r):n.x/=E(r),t.units?.y==="decimal"?t.root?.y==="bottom"&&(n.y=1-t.y):t.root?.y==="bottom"?n.y=1-(t.y+j(e))/j(r):n.y/=j(r),n},Po=({position:t,element:e,container:r,lowerThreshold:n=.2,upperThreshold:s=.8})=>{const i={x:t.x,y:t.y,root:{...ce},units:{x:"px",y:"px"}};return t.x>s?(i.x=(1-t.x)*E(r)-E(e),i.root.x="right"):t.x<n?i.x=t.x*E(r):i.units.x="decimal",t.y>s?(i.y=(1-t.y)*j(r)-j(e),i.root.y="bottom"):t.y<n?i.y=t.y*j(r):i.units.y="decimal",i.x=Math.round(i.x*100)/100,{...i,...qe(i,3)}},qo=Object.freeze(Object.defineProperty({__proto__:null,calculate:Po,completeXY:_r,toCSS:ko,toDecimal:Do,xy:Lo},Symbol.toStringTag,{value:"Module"})),Zo=a.z.enum(["static","dynamic"]),tr=365,Ae=30,Fo=a.z.union([a.z.tuple([a.z.int()]),a.z.tuple([a.z.int(),a.z.int().min(1).max(12)]),a.z.tuple([a.z.int(),a.z.int().min(1).max(12),a.z.int().min(1).max(31)])]),en=(t,e)=>{const r=new d(e);if(![g.DAY,g.HOUR,g.MINUTE,g.SECOND,g.MILLISECOND,g.MICROSECOND,g.NANOSECOND].some(s=>s.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=t.valueOf()%r.valueOf();return t instanceof d?new d(n):new g(n)};class d extends re{constructor(e,r="UTC"){if(e==null)super(d.now().valueOf());else if(e instanceof Date)super(BigInt(e.getTime())*d.MILLISECOND.valueOf());else if(typeof e=="string")super(d.parseDateTimeString(e,r).valueOf());else if(Array.isArray(e))super(d.parseDate(e));else{let n=0n;e instanceof Number&&(e=e.valueOf()),r==="local"&&(n=d.utcOffset.valueOf()),typeof e=="number"&&(isFinite(e)?e===Ir?e=ke:e=Math.trunc(e):(isNaN(e)&&(e=0),e===1/0?e=d.MAX:e=d.MIN)),B(e)&&(e=e.value),super(BigInt(e.valueOf())+n)}}static parseDate([e=1970,r=1,n=1]){const s=new Date(e,r-1,n,0,0,0,0);return new d(BigInt(s.getTime())*d.MILLISECOND.valueOf()).truncate(d.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(e,r="UTC"){const[n,s,i]=e.split(":");let o="00",u="00";i!=null&&([o,u]=i.split("."));let l=d.hours(parseInt(n??"00")).add(d.minutes(parseInt(s??"00"))).add(d.seconds(parseInt(o??"00"))).add(d.milliseconds(parseInt(u??"00")));return r==="local"&&(l=l.add(d.utcOffset)),l.valueOf()}static parseDateTimeString(e,r="UTC"){if(!e.includes("/")&&!e.includes("-"))return d.parseTimeString(e,r);if(e.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?$/)!=null){let s=e,i=0;if(e.includes(".")){const h=e.split(".");s=h[0];const f=h[1]||"0";i=parseInt(f.padEnd(3,"0").slice(0,3))}const o=r==="local"?new Date(s.replace("T"," ")):new Date(`${s}Z`),u=BigInt(o.getTime())*d.MILLISECOND.valueOf(),l=BigInt(i)*d.MILLISECOND.valueOf();return u+l}const n=new Date(e);return e.includes(":")||n.setUTCHours(0,0,0,0),new d(BigInt(n.getTime())*d.MILLISECOND.valueOf(),r).valueOf()}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(d.utcOffset).date().toISOString()}timeString(e=!1,r="UTC"){const n=this.toISOString(r);return e?n.slice(11,23):n.slice(11,19)}dateString(){const e=this.date(),r=e.toLocaleString("default",{month:"short"}),n=e.toLocaleString("default",{day:"numeric"});return`${r} ${n}`}static get utcOffset(){return new g(BigInt(new Date().getTimezoneOffset())*d.MINUTE.valueOf())}static since(e){return new d().span(e)}date(){return new Date(this.milliseconds)}equals(e){return this.valueOf()===new d(e).valueOf()}span(e){return this.range(e).span}range(e){return new N(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===0n}after(e){return this.valueOf()>new d(e).valueOf()}afterEq(e){return this.valueOf()>=new d(e).valueOf()}before(e){return this.valueOf()<new d(e).valueOf()}beforeEq(e){return this.valueOf()<=new d(e).valueOf()}add(e){return new d(W(this.valueOf(),new g(e).valueOf()))}sub(e){return new d(q(this.valueOf(),new g(e).valueOf()))}get hours(){return Number(this.valueOf())/Number(g.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(g.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(g.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(g.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(d.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(d.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(e){const r=this.date();return r.setUTCFullYear(e),new d(r)}get month(){return this.date().getUTCMonth()}setMonth(e){const r=this.date();return r.setUTCMonth(e),new d(r)}get day(){return this.date().getUTCDate()}setDay(e){const r=this.date();return r.setUTCDate(e),new d(r)}get hour(){return this.date().getUTCHours()}get localHour(){return this.date().getHours()}setLocalHour(e){const r=this.date();return r.setHours(e),new d(r)}setHour(e){const r=this.date();return r.setUTCHours(e),new d(r)}get minute(){return this.date().getUTCMinutes()}setMinute(e){const r=this.date();return r.setUTCMinutes(e),new d(r)}get second(){return this.date().getUTCSeconds()}setSecond(e){const r=this.date();return r.setUTCSeconds(e),new d(r)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(e){const r=this.date();return r.setUTCMilliseconds(e),new d(r)}toString(e="ISO",r="UTC"){switch(e){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}remainder(e){return en(this,e)}get isToday(){return this.truncate(g.DAY).equals(d.now().truncate(g.DAY))}truncate(e){return this.sub(this.remainder(e))}formatBySpan(e){return e.greaterThanOrEqual(g.days(30))?"shortDate":e.greaterThanOrEqual(g.DAY)?"dateTime":e.greaterThanOrEqual(g.HOUR)?"time":e.greaterThanOrEqual(g.SECOND)?"preciseTime":"ISOTime"}static now(){return new d(new Date)}static max(...e){let r=d.MIN;for(const n of e){const s=new d(n);s.after(r)&&(r=s)}return r}static min(...e){let r=d.MAX;for(const n of e){const s=new d(n);s.before(r)&&(r=s)}return r}static nanoseconds(e,r="UTC"){return new d(e,r)}static NANOSECOND=d.nanoseconds(1);static microseconds(e,r="UTC"){return d.nanoseconds(e*1e3,r)}static MICROSECOND=d.microseconds(1);static milliseconds(e,r="UTC"){return d.microseconds(e*1e3,r)}static MILLISECOND=d.milliseconds(1);static seconds(e,r="UTC"){return d.milliseconds(e*1e3,r)}static SECOND=d.seconds(1);static minutes(e,r="UTC"){return d.seconds(e*60,r)}static MINUTE=d.minutes(1);static hours(e,r="UTC"){return d.minutes(e*60,r)}static HOUR=d.hours(1);static days(e,r="UTC"){return d.hours(e*24,r)}static DAY=d.days(1);static MAX=new d(ke);static MIN=new d(0);static ZERO=new d(0);static z=a.z.union([a.z.instanceof(d),a.z.object({value:a.z.bigint()}).transform(e=>new d(e.value)),a.z.string().transform(e=>new d(BigInt(e))),a.z.number().transform(e=>new d(e)),a.z.bigint().transform(e=>new d(e)),a.z.date().transform(e=>new d(e)),a.z.custom(e=>e instanceof g).transform(e=>new d(e)),Fo.transform(e=>new d(e))]);static sort(e,r){return Number(e.valueOf()-r.valueOf())}}class g extends re{constructor(e){typeof e=="number"&&(e=Math.trunc(e.valueOf())),B(e)&&(e=e.value),super(BigInt(e.valueOf()))}static fromSeconds(e){return e instanceof g?e:e instanceof z?e.period:e instanceof d?new g(e):(B(e)&&(e=e.value),["number","bigint"].includes(typeof e)?g.seconds(e):new g(e))}static fromMilliseconds(e){return e instanceof g?e:e instanceof z?e.period:e instanceof d?new g(e):(B(e)&&(e=e.value),["number","bigint"].includes(typeof e)?g.milliseconds(e):new g(e))}valueOf(){return this.value}lessThan(e){return this.valueOf()<new g(e).valueOf()}greaterThan(e){return this.valueOf()>new g(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new g(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new g(e).valueOf()}remainder(e){return en(this,e)}truncate(e){return new g(BigInt(Math.trunc(Number(this.valueOf()/e.valueOf())))*e.valueOf())}toString(e="full"){if(e==="semantic")return this.toSemanticString();const r=this.truncate(g.DAY),n=this.truncate(g.HOUR),s=this.truncate(g.MINUTE),i=this.truncate(g.SECOND),o=this.truncate(g.MILLISECOND),u=this.truncate(g.MICROSECOND),l=this.truncate(g.NANOSECOND),h=r,f=n.sub(r),y=s.sub(n),p=i.sub(s),I=o.sub(i),A=u.sub(o),$=l.sub(u);let O="";return h.isZero||(O+=`${h.days}d `),f.isZero||(O+=`${f.hours}h `),y.isZero||(O+=`${y.minutes}m `),p.isZero||(O+=`${p.seconds}s `),I.isZero||(O+=`${I.milliseconds}ms `),A.isZero||(O+=`${A.microseconds}µs `),$.isZero||(O+=`${$.nanoseconds}ns`),O.trim()}toSemanticString(){const e=this.valueOf()<0n?-this.valueOf():this.valueOf(),r=new g(e),n=this.valueOf()<0n;if(r.valueOf()===0n)return"0s";if(r.lessThan(g.SECOND))return"< 1s";const s=r.days,i=r.hours,o=r.minutes,u=r.seconds,l=Math.floor(s/tr),h=Math.floor(s/Ae),f=Math.floor(s/7),y=Math.floor(s),p=Math.floor(i),I=Math.floor(o),A=Math.floor(u),$=n?"-":"";if(l>=1){let O=`${l}y`;if(l<2){const S=Math.floor(s%tr/Ae);S>0&&(O+=` ${S}mo`)}return $+O}if(f>=1&&s<Ae&&s%7===0){let O=`${f}w`;const S=Math.floor(s%7),K=Math.floor(i-f*7*24);return f<2&&(S>0?O+=` ${S}d`:K>0&&K<24&&(O+=` ${K}h`)),$+O}if(h>=1){let O=`${h}mo`;if(h<3){const S=Math.floor(s%Ae);S>0&&(O+=` ${S}d`)}return $+O}if(f>=1){let O=`${f}w`;const S=Math.floor(s%7),K=Math.floor(i-f*7*24);return f<2&&(S>0?O+=` ${S}d`:K>0&&K<24&&(O+=` ${K}h`)),$+O}if(y>=1){let O=`${y}d`;const S=Math.floor(i-y*24);return y<2&&S>0&&(O+=` ${S}h`),$+O}if(p>=1){let O=`${p}h`;if(p<3){const S=Math.floor(o-p*60);S>0&&(O+=` ${S}m`)}return $+O}if(I>=1){let O=`${I}m`;if(I<5){const S=Math.floor(u-I*60);S>0&&(O+=` ${S}s`)}return $+O}return`${$}${A}s`}mult(e){return new g(R(this.valueOf(),e))}div(e){return new g(Ne(this.valueOf(),e))}get days(){return Number(this.valueOf())/Number(g.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(g.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(g.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(g.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(g.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(g.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===0n}equals(e){return this.valueOf()===new g(e).valueOf()}add(e){return new g(this.valueOf()+new g(e).valueOf())}sub(e){return new g(this.valueOf()-new g(e).valueOf())}static nanoseconds(e=1){return new g(e)}static NANOSECOND=g.nanoseconds(1);static microseconds(e=1){return g.nanoseconds(R(e,1e3))}static MICROSECOND=g.microseconds(1);static milliseconds(e=1){return g.microseconds(R(e,1e3))}static MILLISECOND=g.milliseconds(1);static seconds(e=1){return g.milliseconds(R(e,1e3))}static SECOND=g.seconds(1);static minutes(e=1){return g.seconds(R(e,60))}static MINUTE=g.minutes(1);static hours(e){return g.minutes(R(e,60))}static HOUR=g.hours(1);static days(e){return g.hours(R(e,24))}static DAY=g.days(1);static MAX=new g(ke);static MIN=new g(0);static ZERO=new g(0);static z=a.z.union([a.z.object({value:a.z.bigint()}).transform(e=>new g(e.value)),a.z.string().transform(e=>new g(BigInt(e))),a.z.number().transform(e=>new g(e)),a.z.bigint().transform(e=>new g(e)),a.z.instanceof(g),a.z.instanceof(d).transform(e=>new g(e)),a.z.custom(e=>e instanceof z).transform(e=>new g(e))])}class z extends re{constructor(e){B(e)&&(e=e.value),super(e.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new z(e).valueOf()}get period(){return g.seconds(1/this.valueOf())}sampleCount(e){return new g(e).seconds*this.valueOf()}byteCount(e,r){return this.sampleCount(e)*new b(r).valueOf()}span(e){return g.seconds(e/this.valueOf())}byteSpan(e,r){return this.span(e.valueOf()/new b(r).valueOf())}add(e){return new z(W(this.valueOf(),new z(e).valueOf()))}sub(e){return new z(q(this.valueOf(),new z(e).valueOf()))}mult(e){return new z(R(this.valueOf(),e))}div(e){return new z(Ne(this.valueOf(),e))}static hz(e){return new z(e)}static khz(e){return z.hz(e*1e3)}static z=a.z.union([a.z.number().transform(e=>new z(e)),a.z.instanceof(z)])}class b extends re{constructor(e){B(e)&&(e=e.value),super(e.valueOf())}length(e){return e.valueOf()/this.valueOf()}size(e){return new m(e*this.valueOf())}add(e){return new b(W(this.valueOf(),new b(e).valueOf()))}sub(e){return new b(q(this.valueOf(),new b(e).valueOf()))}mult(e){return new b(R(this.valueOf(),e))}div(e){return new b(Ne(this.valueOf(),e))}static UNKNOWN=new b(0);static BIT128=new b(16);static BIT64=new b(8);static BIT32=new b(4);static BIT16=new b(2);static BIT8=new b(1);static z=a.z.union([a.z.number().transform(e=>new b(e)),a.z.instanceof(b)])}class N{start;end;constructor(e,r){typeof e=="object"&&"start"in e?(this.start=new d(e.start),this.end=new d(e.end)):(this.start=new d(e),this.end=new d(r))}get span(){return new g(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.start.isZero&&this.end.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new N(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(e,r=g.ZERO){if(r.isZero)return this.start.equals(e.start)&&this.end.equals(e.end);let n=this.start.sub(e.start).valueOf(),s=this.end.sub(e.end).valueOf();return n<0&&(n=-n),s<0&&(s=-s),n<=r.valueOf()&&s<=r.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.toString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e,r=g.ZERO){e=e.makeValid();const n=this.makeValid();if(this.equals(e))return!0;if(e.end.equals(n.start)||n.end.equals(e.start))return!1;const s=d.max(n.start,e.start),i=d.min(n.end,e.end);return i.before(s)?!1:new g(i.sub(s)).greaterThanOrEqual(r)}contains(e){return e instanceof N?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const r=new N(this.start,this.end);return e.start.after(this.start)&&(r.start=e.start),e.start.after(this.end)&&(r.end=e.start),e.end.before(this.end)&&(r.end=e.end),e.end.before(this.start)&&(r.start=e.end),r}static max(...e){return new N(d.min(...e.map(r=>r.start)),d.max(...e.map(r=>r.end)))}static MAX=new N(d.MIN,d.MAX);static ZERO=new N(d.ZERO,d.ZERO);static z=a.z.union([a.z.object({start:d.z,end:d.z}).transform(e=>new N(e.start,e.end)),a.z.instanceof(N)]);static sort(e,r){return d.sort(e.start,r.start)||d.sort(e.end,r.end)}static merge(...e){return N.max(...e.map(r=>new N(r).makeValid()))}}class c extends re{constructor(e){if(B(e)&&(e=e.value),e instanceof c||typeof e=="string"||typeof e.valueOf()=="string")super(e.valueOf());else{const r=c.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(r==null)throw new Error(`unable to find data type for ${e.toString()}`);super(r.valueOf())}}get Array(){const e=c.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}matches(...e){return e.some(r=>this.equals(r))}toString(e=!1){return e?c.SHORT_STRINGS.get(this.valueOf())??this.valueOf():this.valueOf()}get isVariable(){return this.equals(c.JSON)||this.equals(c.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(c.UUID)}get isInteger(){const e=this.toString();return e.startsWith("int")||e.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const e=c.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}get isUnsignedInteger(){return this.equals(c.UINT8)||this.equals(c.UINT16)||this.equals(c.UINT32)||this.equals(c.UINT64)}get isSignedInteger(){return this.equals(c.INT8)||this.equals(c.INT16)||this.equals(c.INT32)||this.equals(c.INT64)}canSafelyCastTo(e){return this.equals(e)?!0:!this.isNumeric||!e.isNumeric||this.isVariable||e.isVariable||this.isUnsignedInteger&&e.isSignedInteger?!1:this.isFloat?e.isFloat&&this.density.valueOf()<=e.density.valueOf():this.equals(c.INT32)&&e.equals(c.FLOAT64)||this.equals(c.INT8)&&e.equals(c.FLOAT32)?!0:this.isInteger&&e.isInteger?this.density.valueOf()<=e.density.valueOf()&&this.isUnsignedInteger===e.isUnsignedInteger:!1}canCastTo(e){return this.isNumeric&&e.isNumeric?!0:this.equals(e)}checkArray(e){return e.constructor===this.Array}get usesBigInt(){return c.BIG_INT_TYPES.some(e=>e.equals(this))}static UNKNOWN=new c("unknown");static FLOAT64=new c("float64");static FLOAT32=new c("float32");static INT64=new c("int64");static INT32=new c("int32");static INT16=new c("int16");static INT8=new c("int8");static UINT64=new c("uint64");static UINT32=new c("uint32");static UINT16=new c("uint16");static UINT8=new c("uint8");static BOOLEAN=new c("boolean");static TIMESTAMP=new c("timestamp");static UUID=new c("uuid");static STRING=new c("string");static JSON=new c("json");static ARRAY_CONSTRUCTORS=new Map([[c.UINT8.toString(),Uint8Array],[c.UINT16.toString(),Uint16Array],[c.UINT32.toString(),Uint32Array],[c.UINT64.toString(),BigUint64Array],[c.FLOAT32.toString(),Float32Array],[c.FLOAT64.toString(),Float64Array],[c.INT8.toString(),Int8Array],[c.INT16.toString(),Int16Array],[c.INT32.toString(),Int32Array],[c.INT64.toString(),BigInt64Array],[c.TIMESTAMP.toString(),BigInt64Array],[c.STRING.toString(),Uint8Array],[c.JSON.toString(),Uint8Array],[c.UUID.toString(),Uint8Array]]);static ARRAY_CONSTRUCTOR_DATA_TYPES=new Map([[Uint8Array.name,c.UINT8],[Uint16Array.name,c.UINT16],[Uint32Array.name,c.UINT32],[BigUint64Array.name,c.UINT64],[Float32Array.name,c.FLOAT32],[Float64Array.name,c.FLOAT64],[Int8Array.name,c.INT8],[Int16Array.name,c.INT16],[Int32Array.name,c.INT32],[BigInt64Array.name,c.INT64]]);static DENSITIES=new Map([[c.UINT8.toString(),b.BIT8],[c.UINT16.toString(),b.BIT16],[c.UINT32.toString(),b.BIT32],[c.UINT64.toString(),b.BIT64],[c.FLOAT32.toString(),b.BIT32],[c.FLOAT64.toString(),b.BIT64],[c.INT8.toString(),b.BIT8],[c.INT16.toString(),b.BIT16],[c.INT32.toString(),b.BIT32],[c.INT64.toString(),b.BIT64],[c.TIMESTAMP.toString(),b.BIT64],[c.STRING.toString(),b.UNKNOWN],[c.JSON.toString(),b.UNKNOWN],[c.UUID.toString(),b.BIT128]]);static ALL=[c.UNKNOWN,c.FLOAT64,c.FLOAT32,c.INT64,c.INT32,c.INT16,c.INT8,c.UINT64,c.UINT32,c.UINT16,c.UINT8,c.TIMESTAMP,c.UUID,c.STRING,c.JSON];static SHORT_STRINGS=new Map([[c.UINT8.toString(),"u8"],[c.UINT16.toString(),"u16"],[c.UINT32.toString(),"u32"],[c.UINT64.toString(),"u64"],[c.INT8.toString(),"i8"],[c.INT16.toString(),"i16"],[c.INT32.toString(),"i32"],[c.INT64.toString(),"i64"],[c.FLOAT32.toString(),"f32"],[c.FLOAT64.toString(),"f64"],[c.BOOLEAN.toString(),"bool"],[c.TIMESTAMP.toString(),"ts"],[c.UUID.toString(),"uuid"],[c.STRING.toString(),"str"],[c.JSON.toString(),"json"]]);static BIG_INT_TYPES=[c.INT64,c.UINT64,c.TIMESTAMP];static z=a.z.union([a.z.string().transform(e=>new c(e)),a.z.instanceof(c)])}class m extends re{constructor(e){B(e)&&(e=e.value),super(e.valueOf())}largerThan(e){return B(e)&&(e=e.value),this.valueOf()>e.valueOf()}smallerThan(e){return B(e)&&(e=e.value),this.valueOf()<e.valueOf()}add(e){return B(e)&&(e=e.value),new m(W(this.valueOf(),e.valueOf()))}sub(e){return B(e)&&(e=e.value),new m(q(this.valueOf(),e.valueOf()))}mult(e){return new m(R(this.valueOf(),e))}div(e){return new m(Ne(this.valueOf(),e))}truncate(e){return new m(Math.trunc(this.valueOf()/new m(e).valueOf())*new m(e).valueOf())}remainder(e){return m.bytes(this.valueOf()%new m(e).valueOf())}get gigabytes(){return this.valueOf()/m.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/m.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/m.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/m.TERABYTE.valueOf()}toString(){const e=this.truncate(m.TERABYTE),r=this.truncate(m.GIGABYTE),n=this.truncate(m.MEGABYTE),s=this.truncate(m.KILOBYTE),i=this.truncate(m.BYTE),o=e,u=r.sub(e),l=n.sub(r),h=s.sub(n),f=i.sub(s);let y="";return o.isZero||(y+=`${o.terabytes}TB `),u.isZero||(y+=`${u.gigabytes}GB `),l.isZero||(y+=`${l.megabytes}MB `),h.isZero||(y+=`${h.kilobytes}KB `),(!f.isZero||y==="")&&(y+=`${f.valueOf()}B`),y.trim()}static bytes(e=1){return new m(e)}static BYTE=new m(1);static kilobytes(e=1){return m.bytes(new m(e).valueOf()*1e3)}static KILOBYTE=m.kilobytes(1);static megabytes(e=1){return m.kilobytes(new m(e).valueOf()*1e3)}static MEGABYTE=m.megabytes(1);static gigabytes(e=1){return m.megabytes(new m(e).valueOf()*1e3)}static GIGABYTE=m.gigabytes(1);static terabytes(e){return m.gigabytes(new m(e).valueOf()*1e3)}static TERABYTE=m.terabytes(1);static ZERO=new m(0);static z=a.z.union([a.z.number().transform(e=>new m(e)),a.z.instanceof(m)]);get isZero(){return this.valueOf()===0}}a.z.object({start:a.z.number(),end:a.z.number()});const Yo=a.z.union([a.z.instanceof(Uint8Array),a.z.instanceof(Uint16Array),a.z.instanceof(Uint32Array),a.z.instanceof(BigUint64Array),a.z.instanceof(Float32Array),a.z.instanceof(Float64Array),a.z.instanceof(Int8Array),a.z.instanceof(Int16Array),a.z.instanceof(Int32Array),a.z.instanceof(BigInt64Array)]),tn=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"||t instanceof d||t instanceof g||t instanceof Date},Vo=(t,e,r,n=0)=>t.usesBigInt&&!e.usesBigInt?Number(r)-Number(n):!t.usesBigInt&&e.usesBigInt?BigInt(r.valueOf())-BigInt(n.valueOf()):q(r,n),Wo="00000000-0000-0000-0000-000000000000",Go=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Ho(t){return typeof t=="string"&&Go.test(t)}const M=[];for(let t=0;t<256;++t)M.push((t+256).toString(16).slice(1));function rn(t,e=0){return(M[t[e+0]]+M[t[e+1]]+M[t[e+2]]+M[t[e+3]]+"-"+M[t[e+4]]+M[t[e+5]]+"-"+M[t[e+6]]+M[t[e+7]]+"-"+M[t[e+8]]+M[t[e+9]]+"-"+M[t[e+10]]+M[t[e+11]]+M[t[e+12]]+M[t[e+13]]+M[t[e+14]]+M[t[e+15]]).toLowerCase()}function Xo(t,e=0){const r=rn(t,e);if(!Ho(r))throw TypeError("Stringified UUID is invalid");return r}let tt;const Jo=new Uint8Array(16);function Ko(){if(!tt){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tt=crypto.getRandomValues.bind(crypto)}return tt(Jo)}const Qo=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rr={randomUUID:Qo};function _o(t,e,r){t=t||{};const n=t.random??t.rng?.()??Ko();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,rn(n)}function ea(t,e,r){return rr.randomUUID&&!t?rr.randomUUID():_o(t)}const ta=()=>ea(),Gt=(t,e)=>Xo(t,e),ra=Wo,na=Object.freeze(Object.defineProperty({__proto__:null,ZERO:ra,create:ta,parse:Gt},Symbol.toStringTag,{value:"Module"})),H=-1,mt={[Symbol.iterator]:()=>mt,next:()=>({done:!0,value:void 0})},sa=a.z.string().transform(t=>new Uint8Array(atob(t).split("").map(e=>e.charCodeAt(0))).buffer),ia=a.z.union([a.z.null(),a.z.undefined()]).transform(()=>new Uint8Array().buffer),bt=10,nn=(t,e)=>{if(t==="number"&&!e.isNumeric)throw new Error(`cannot convert series of type ${e.toString()} to number`);if(t==="bigint"&&!e.usesBigInt)throw new Error(`cannot convert series of type ${e.toString()} to bigint`)},sn="sy_x_telem_series";class L{key;discriminator=sn;dataType;sampleOffset;gl;_data;timeRange=N.ZERO;alignment=0n;alignmentMultiple=1n;cachedMin;cachedMax;writePos=H;_refCount=0;cachedLength;_cachedIndexes;static crudeZ=a.z.object({timeRange:N.z.optional(),dataType:c.z,alignment:a.z.coerce.bigint().optional(),data:a.z.union([sa,ia,a.z.instanceof(ArrayBuffer),a.z.instanceof(Uint8Array)]),glBufferUsage:Zo.default("static").optional()});static z=L.crudeZ.transform(e=>new L(e));constructor(e){oa(e)&&(e={data:e}),e.data??=[];const{dataType:r,timeRange:n,sampleOffset:s=0,glBufferUsage:i="static",alignment:o=0n,alignmentMultiple:u=1n,key:l=It(),data:h}=e;if(on(h)){const p=h;this.key=p.key,this.dataType=p.dataType,this.sampleOffset=p.sampleOffset,this.gl=p.gl,this._data=p._data,this.timeRange=p.timeRange,this.alignment=p.alignment,this.alignmentMultiple=p.alignmentMultiple,this.cachedMin=p.cachedMin,this.cachedMax=p.cachedMax,this.writePos=p.writePos,this._refCount=p._refCount,this.cachedLength=p.cachedLength;return}const f=tn(h),y=Array.isArray(h);if(r!=null)this.dataType=new c(r);else{if(h instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(y||f){let p=h;if(!f){if(h.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");p=h[0]}if(typeof p=="string")this.dataType=c.STRING;else if(typeof p=="number")this.dataType=c.FLOAT64;else if(typeof p=="bigint")this.dataType=c.INT64;else if(typeof p=="boolean")this.dataType=c.BOOLEAN;else if(p instanceof d||p instanceof Date||p instanceof d)this.dataType=c.TIMESTAMP;else if(typeof p=="object")this.dataType=c.JSON;else throw new Error(`cannot infer data type of ${typeof p} when constructing a Series from a JS array`)}else this.dataType=new c(h)}if(!y&&!f)this._data=h;else if(y&&h.length===0)this._data=new this.dataType.Array([]).buffer;else{let p=f?[h]:h;const I=p[0];(I instanceof d||I instanceof Date||I instanceof g)&&(p=p.map(A=>new d(A).valueOf())),this.dataType.equals(c.STRING)?(this.cachedLength=p.length,this._data=new TextEncoder().encode(`${p.join(`
2
2
  `)}
3
3
  `).buffer):this.dataType.equals(c.JSON)?(this.cachedLength=p.length,this._data=new TextEncoder().encode(`${p.map(A=>ot.encodeString(A)).join(`
4
4
  `)}
5
- `).buffer):this.dataType.usesBigInt&&typeof N=="number"?this._data=new this.dataType.Array(p.map(A=>BigInt(Math.round(A)))).buffer:!this.dataType.usesBigInt&&typeof N=="bigint"?this._data=new this.dataType.Array(p.map(Number)).buffer:this._data=new this.dataType.Array(p).buffer}this.key=l,this.alignment=o,this.alignmentMultiple=u,this.sampleOffset=s??0,this.timeRange=n??I.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:i}}static alloc({capacity:e,dataType:r,...n}){if(e===0)throw new Error("[Series] - cannot allocate an array of length 0");const s=new new c(r).Array(e),i=new L({data:s.buffer,dataType:r,...n});return i.writePos=0,i}get refCount(){return this._refCount}acquire(e){this._refCount++,e!=null&&this.updateGLBuffer(e)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(e){if(!e.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(e):this.writeFixed(e)}writeVariable(e){if(this.writePos===H)return 0;const r=this.byteCapacity.valueOf()-this.writePos,n=e.subBytes(0,r);return this.writeToUnderlyingData(n),this.writePos+=n.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=n.length,this.calculateCachedLength()),n.length}writeFixed(e){if(this.writePos===H)return 0;const r=this.capacity-this.writePos,n=e.sub(0,r);return this.writeToUnderlyingData(n),this.cachedLength=void 0,this.maybeRecomputeMinMax(n),this.writePos+=n.length,n.length}writeToUnderlyingData(e){this.underlyingData.set(e.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===H?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
6
- `).slice(0,-1):Array.from(this).map(e=>e.toString())}parseJSON(e){if(!this.dataType.equals(c.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(r=>e.parse(ot.decodeString(r)))}get byteCapacity(){return new m(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===H?this.byteCapacity:this.dataType.isVariable?new m(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===H?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let e=0;const r=[0];return this.data.forEach((n,s)=>{n===bt&&(e++,r.push(s+1))}),this._cachedIndexes=r,this.cachedLength=e,e}convert(e,r=0){if(this.dataType.equals(e))return this;const n=new e.Array(this.length);for(let s=0;s<this.length;s++)n[s]=Yo(this.dataType,e,this.data[s],r);return new L({data:n.buffer,dataType:e,timeRange:this.timeRange,sampleOffset:r,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(c.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMax=e.reduce((r,n)=>r>n?r:n)}else{const e=this.data;this.cachedMax=e.reduce((r,n)=>r>n?r:n)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??=this.calcRawMax(),W(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(c.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMin=e.reduce((r,n)=>r<n?r:n)}else{const e=this.data;this.cachedMin=e.reduce((r,n)=>r<n?r:n)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??=this.calcRawMin(),W(this.cachedMin,this.sampleOffset))}get bounds(){return w(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(e){if(this.cachedMin!=null){const r=e.cachedMin??e.calcRawMin();r<this.cachedMin&&(this.cachedMin=r)}if(this.cachedMax!=null){const r=e.cachedMax??e.calcRawMax();r>this.cachedMax&&(this.cachedMax=r)}}atAlignment(e,r){const n=Number((e-this.alignment)/this.alignmentMultiple);if(n<0||n>=this.length){if(r===!0)throw new Error(`[series] - no value at index ${n}`);return}return this.at(n,r)}at(e,r=!1){if(this.dataType.isVariable)return this.atVariable(e,r??!1);if(this.dataType.equals(c.UUID))return this.atUUID(e,r);e<0&&(e=this.length+e);const n=this.data[e];if(n==null){if(r===!0)throw new Error(`[series] - no value at index ${e}`);return}return W(n,this.sampleOffset)}atUUID(e,r){e<0&&(e=this.length+e);const n=Gt(new Uint8Array(this.buffer,e*this.dataType.density.valueOf()));if(n==null){if(r)throw new Error(`[series] - no value at index ${e}`);return}return n}atVariable(e,r){let n=0,s=0;if(this._cachedIndexes!=null)n=this._cachedIndexes[e],s=this._cachedIndexes[e+1]-1;else{e<0&&(e=this.length+e);for(let o=0;o<this.data.length;o++)if(this.data[o]===bt){if(e===0){s=o;break}n=o+1,e--}if(s===0&&(s=this.data.length),n>=s||e>0){if(r)throw new Error(`[series] - no value at index ${e}`);return}}const i=this.data.slice(n,s);return this.dataType.equals(c.STRING)?new TextDecoder().decode(i):St(JSON.parse(new TextDecoder().decode(i)))}binarySearch(e){let r=0,n=this.length-1;const s=Se(e);for(;r<=n;){const i=Math.floor((r+n)/2),o=s(this.at(i,!0),e);if(o===0)return i;o<0?r=i+1:n=i-1}return r}updateGLBuffer(e){if(this.gl.control=e,!this.dataType.equals(c.FLOAT32)&&!this.dataType.equals(c.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:r,bufferUsage:n,prevBuffer:s}=this.gl;if(r==null&&(this.gl.buffer=e.createBuffer()),this.writePos!==s)if(e.bindBuffer(e.ARRAY_BUFFER,this.gl.buffer),this.writePos!==H){s===0&&e.bufferData(e.ARRAY_BUFFER,this.byteCapacity.valueOf(),e.STATIC_DRAW);const i=this.dataType.density.size(s).valueOf(),o=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);e.bufferSubData(e.ARRAY_BUFFER,i,o.buffer),this.gl.prevBuffer=this.writePos}else e.bufferData(e.ARRAY_BUFFER,this.buffer,n==="static"?e.STATIC_DRAW:e.DYNAMIC_DRAW),this.gl.prevBuffer=H}as(e){return nn(e,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:sr(this.alignmentBounds.lower),upper:sr(this.alignmentBounds.upper),multiple:this.alignmentMultiple},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return w(this.alignment,this.alignment+BigInt(this.length)*this.alignmentMultiple)}maybeGarbageCollectGLBuffer(e){this.gl.buffer!=null&&(e.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const e=new oa(this);return this.dataType.equals(c.JSON)?new Ht(e):e}return this.dataType.equals(c.UUID)?new aa(this):new ua(this)}slice(e,r){return this.sliceSub(!1,e,r)}sub(e,r){return this.sliceSub(!0,e,r)}subIterator(e,r){return new nr(this,e,r??this.length)}subAlignmentIterator(e,r){const n=Math.ceil(Number(e-this.alignment)/Number(this.alignmentMultiple)),s=Math.ceil(Number(r-this.alignment)/Number(this.alignmentMultiple));return new nr(this,n,s)}subBytes(e,r){if(e>=0&&(r==null||r>=this.byteLength.valueOf()))return this;const n=this.data.subarray(e,r);return new L({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}sliceSub(e,r,n){if(r<=0&&(n==null||n>=this.length))return this;let s;return e?s=this.data.subarray(r,n):s=this.data.slice(r,n),new L({data:s,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(r)})}reAlign(e){return new L({data:this.buffer,dataType:this.dataType,timeRange:I.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:e})}toString(){let e=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)e+=Array.from(this).map(r=>r.toString());else{for(let r=0;r<5;r++)e+=`${this.at(r)?.toString()}`,e+=",";e+="...,";for(let r=-5;r<0;r++)e+=this.at(r)?.toString(),r<-1&&(e+=",")}return e+="])",e}}const ia=t=>t==null?!1:Array.isArray(t)||t instanceof ArrayBuffer||ArrayBuffer.isView(t)&&!(t instanceof DataView)||t instanceof L?!0:tn(t),on=ps(sn,L);class nr{series;end;index;constructor(e,r,n){this.series=e;const s=w(0,e.length+1);this.end=ct(s,n),this.index=ct(s,r)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class oa{series;index;decoder;constructor(e){if(!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,r=this.series.data;for(;this.index<r.length&&r[this.index]!==bt;)this.index++;const n=this.index;return e===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,n))})}}class Ht{wrapped;static schema=a.z.record(a.z.string(),a.z.unknown());constructor(e){this.wrapped=e}next(){const e=this.wrapped.next();return e.done===!0?{done:!0,value:void 0}:{done:!1,value:ot.decodeString(e.value,Ht.schema)}}}class aa{series;index;data;density;constructor(e){if(!e.dataType.equals(c.UUID))throw new Error("cannot create a UUID series iterator for a non-UUID series");this.series=e,this.index=0,this.data=new Uint8Array(e.buffer),this.density=c.UUID.density.valueOf()}next(){if(this.index>=this.series.length)return{done:!0,value:void 0};const e=Gt(this.data,this.index*this.density);return this.index++,{done:!1,value:e}}}class ua{series;index;constructor(e){this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class la{series;constructor(e=[]){if(e.length!==0){const r=e[0].dataType;for(let n=1;n<e.length;n++)if(!e[n].dataType.equals(r))throw new Error("[multi-series] - series must have the same data type")}this.series=e}as(e){return nn(e,this.dataType),this}get dataType(){return this.series.length===0?c.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?I.ZERO:new I(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?w(0n,0n):w(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(e){const r=()=>new Error(`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`),n=e.dataType.equals(this.dataType);if(on(e)){if(this.series.length!==0&&!n)throw r();this.series.push(e)}else{if(this.series.length!==0&&e.series.length!==0&&!n)throw r();this.series.push(...e.series)}}get length(){return this.series.reduce((e,r)=>e+r.length,0)}atAlignment(e,r){for(const n of this.series)if(k(n.alignmentBounds,e))return n.atAlignment(e,r);if(r)throw new Error(`[series] - no value at alignment ${e}`)}at(e,r=!1){e<0&&(e=this.length+e);for(const n of this.series){if(e<n.length)return n.at(e,r);e-=n.length}if(r)throw new Error(`[series] - no value at index ${e}`)}subIterator(e,r){return new rt(this,e,r??this.length)}subAlignmentIterator(e,r){if(e>=this.alignmentBounds.upper||r<=this.alignmentBounds.lower)return mt;let n=0;for(let i=0;i<this.series.length;i++){const o=this.series[i];if(e<o.alignment)break;if(e>=o.alignmentBounds.upper)n+=o.length;else if(k(o.alignmentBounds,e)){n+=Math.ceil(Number(e-o.alignment)/Number(o.alignmentMultiple));break}}let s=0;for(let i=0;i<this.series.length;i++){const o=this.series[i];if(r<o.alignment)break;if(r>=o.alignmentBounds.upper)s+=o.length;else if(k(o.alignmentBounds,r)){s+=Math.ceil(Number(r-o.alignment)/Number(o.alignmentMultiple));break}}return new rt(this,n,s)}subAlignmentSpanIterator(e,r){if(e>=this.alignmentBounds.upper)return mt;r=Math.min(r,Number(this.distance(e,this.alignmentBounds.upper)));let n=0;for(let s=0;s<this.series.length;s++){const i=this.series[s];if(e<i.alignment)break;if(e>=i.alignmentBounds.upper)n+=i.length;else if(k(i.alignmentBounds,e)){n+=Number(e-i.alignment);break}}return new rt(this,n,n+r)}updateGLBuffer(e){this.series.forEach(r=>r.updateGLBuffer(e))}get bounds(){return Ur(this.series.map(e=>e.bounds))}get byteLength(){return new m(this.series.reduce((e,r)=>e+r.byteLength.valueOf(),0))}get data(){const e=new this.dataType.Array(this.length);let r=0;for(const n of this.series)e.set(n.data,r),r+=n.length;return new this.dataType.Array(e.buffer)}traverseAlignment(e,r){const n=this.series.map(s=>s.alignmentBounds);return Br(n,e,r)}acquire(e){this.series.forEach(r=>r.acquire(e))}release(){this.series.forEach(e=>e.release())}distance(e,r){const n=this.series.map(s=>s.alignmentBounds);return $r(n,e,r)}parseJSON(e){if(!this.dataType.equals(c.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(r=>r.parseJSON(e))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new ca(this.series)}toStrings(){return this.series.flatMap(e=>e.toStrings())}}class ca{series;seriesIndex;internal;constructor(e){this.series=e,this.seriesIndex=0,this.internal=e[0][Symbol.iterator]()}next(){const e=this.internal.next();return e.done===!1?e:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[Symbol.iterator](){return this}}class rt{series;index;end;constructor(e,r,n){this.series=e,this.end=n,this.index=r}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}const sr=t=>{const e=t>>32n,r=t&0xffffffffn;return{domain:e,sample:r}};a.z.object({baseInterval:g.z.optional(),maxRetries:a.z.number().optional(),scale:a.z.number().optional()});const ha=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Ze=a.z.string().regex(ha),oe=a.z.number().min(0).max(255),an=a.z.number().min(0).max(1),Je=a.z.tuple([oe,oe,oe,an]),fa=a.z.tuple([oe,oe,oe]),da=a.z.object({rgba255:Je}),ga=a.z.number().min(0).max(360),pa=a.z.number().min(0).max(100),ya=a.z.number().min(0).max(100),un=a.z.tuple([ga,pa,ya,an]),Ke=a.z.union([Ze,fa,Je,un,da]),Qe=Ke.transform(t=>T(t)),ma=t=>Qe.safeParse(t).success,ba=t=>Je.safeParse(t).success,wa=(t=>{if(t==null)return;const e=Qe.safeParse(t);if(e.success)return cn(e.data);if(typeof t=="string")return t;throw e.error}),T=(t,e=1)=>{if(t=Ke.parse(t),typeof t=="string")return Re(t,e);if(Array.isArray(t)){if(t.length<3||t.length>4)throw new Error(`Invalid color: [${t.join(", ")}]`);return t.length===3?[...t,e]:t}return t.rgba255},ln=(t,e)=>{if(t==null||e==null)return t==e;const r=T(t),n=T(e);return r.every((s,i)=>s===n[i])},Oa=(t=>{if(t==null)return;const[e,r,n,s]=T(t);return`#${ze(e)}${ze(r)}${ze(n)}${s===1?"":ze(s*255)}`}),cn=t=>{const[e,r,n,s]=T(t);return`rgba(${e}, ${r}, ${n}, ${s})`},va=t=>`rgb(${hn(t)})`,hn=t=>{const[e,r,n]=T(t);return`${e}, ${r}, ${n}`},Ta=t=>[...Xt(t),we(t)],Xt=t=>[ye(t)/255,me(t)/255,be(t)/255],ye=t=>T(t)[0],me=t=>T(t)[1],be=t=>T(t)[2],we=t=>T(t)[3],xa=t=>ln(Jt,t),Sa=t=>Ba(T(t)),Na=(t,e)=>{const[r,n,s]=T(t);if(e>100)throw new Error(`Color opacity must be between 0 and 100, got ${e}`);return e>1&&(e/=100),[r,n,s,e]},Te=t=>{const[e,r,n]=Xt(t).map(s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4);return Number((.2126*e+.7152*r+.0722*n).toFixed(3))},Ia=t=>{const[e,r,n]=Xt(t);return 1-(Math.max(e,r,n)-Math.min(e,r,n))},wt=(t,e)=>{const r=T(t),n=T(e),s=Te(r),i=Te(n);return(Math.max(s,i)+.5)/(Math.min(s,i)+.5)},Ma=(t,...e)=>{if(e.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=T(t),[n]=e.sort((s,i)=>wt(r,i)-wt(r,s));return T(n)},Aa=t=>Te(t)<.5,za=t=>Te(t)>.5,Re=(t,e=1)=>(t=Ze.parse(t),t=Ea(t),[Ee(t,0),Ee(t,2),Ee(t,4),t.length===8?Ee(t,6)/255:e]),Jt=[0,0,0,0],ze=t=>Math.floor(t).toString(16).padStart(2,"0"),Ee=(t,e)=>parseInt(t.slice(e,e+2),16),Ea=t=>t.startsWith("#")?t.slice(1):t,ir={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",silver:"#c0c0c0",gray:"#808080",grey:"#808080",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",brown:"#a52a2a",tan:"#d2b48c",gold:"#ffd700",indigo:"#4b0082",violet:"#ee82ee",pink:"#ffc0cb",coral:"#ff7f50",salmon:"#fa8072",khaki:"#f0e68c",crimson:"#dc143c",transparent:"transparent"},ja=t=>{if(!t)return;const e=t.trim().toLowerCase();if(!(e==="transparent"||e==="none")){if(e.startsWith("#")){if(e.length===4){const r=e[1],n=e[2],s=e[3],i=`#${r}${r}${n}${n}${s}${s}`;if(Ze.safeParse(i).success)return Re(i)}return(e.length===7||e.length===9)&&Ze.safeParse(e).success?Re(e):void 0}if(e.startsWith("rgb")){const r=e.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);if(r){const[,n,s,i,o]=r;return[parseInt(n),parseInt(s),parseInt(i),o?parseFloat(o):1]}}if(ir[e])return Re(ir[e])}},Ua=t=>{t=un.parse(t);let[e,r,n]=t;const s=t[3];e/=360,r/=100,n/=100;let i,o,u;if(r===0)i=o=u=n;else{const l=n<.5?n*(1+r):n+r-n*r,h=2*n-l;i=nt(h,l,e+1/3),o=nt(h,l,e),u=nt(h,l,e-1/3)}return[Math.round(i*255),Math.round(o*255),Math.round(u*255),s]},nt=(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),Ba=t=>{t=Je.parse(t);let[e,r,n]=t;const s=t[3];e/=255,r/=255,n/=255;const i=Math.max(e,r,n),o=Math.min(e,r,n);let u,l,h=(i+o)/2;if(i===o)u=l=0;else{const d=i-o;l=h>.5?d/(2-i-o):d/(i+o),i===e?u=(r-n)/d+(r<n?6:0):i===r?u=(n-e)/d+2:u=(e-r)/d+4,u/=6}return u*=360,l*=100,h*=100,[Math.round(u),Math.round(l),Math.round(h),s]},$a=T("#000000"),Ca=T("#ffffff"),fn=a.z.object({key:a.z.string(),color:Ke,position:a.z.number(),switched:a.z.boolean().optional()}),Ra=a.z.array(fn),La=(t,e)=>{if(t.length===0)return Jt;if(t=t.slice().sort((r,n)=>r.position-n.position),e<=t[0].position)return T(t[0].color);if(e>=t[t.length-1].position)return T(t[t.length-1].color);for(let r=0;r<t.length-1;r++){const n=t[r],s=t[r+1];if(e<n.position||e>s.position)continue;if(e===n.position)return T(n.color);if(e===s.position)return T(s.color);const i=(e-n.position)/(s.position-n.position),o=T(n.color),u=T(s.color),l=Math.round(ye(o)+i*(ye(u)-ye(o))),h=Math.round(me(o)+i*(me(u)-me(o))),d=Math.round(be(o)+i*(be(u)-be(o))),y=we(o)+i*(we(u)-we(o));return T([l,h,d,y])}return T(t[t.length-1].color)},ka=a.z.object({key:a.z.string(),name:a.z.string(),color:Qe}),Da=a.z.object({key:a.z.string(),name:a.z.string(),swatches:a.z.array(ka)}),dn=Object.freeze(Object.defineProperty({__proto__:null,BLACK:$a,WHITE:Ca,ZERO:Jt,aValue:we,bValue:be,colorZ:Qe,construct:T,contrast:wt,crudeZ:Ke,cssString:wa,equals:ln,fromCSS:ja,fromGradient:La,fromHSLA:Ua,gValue:me,gradientZ:Ra,grayness:Ia,hex:Oa,hsla:Sa,isColor:ba,isCrude:ma,isDark:Aa,isLight:za,isZero:xa,luminance:Te,paletteZ:Da,pickByContrast:Ma,rValue:ye,rgbCSS:va,rgbString:hn,rgba1:Ta,rgbaCSS:cn,setAlpha:Na,stopZ:fn},Symbol.toStringTag,{value:"Module"})),gn=a.z.int().min(0).max(255),pn=255,yn=0,Pa={lower:yn,upper:pn+1},mn=a.z.object({name:a.z.string(),key:a.z.string()}),xe=t=>a.z.object({subject:mn,resource:t,authority:gn}),qa=(...t)=>e=>e.filter(r=>{let n=!1;return r.to!=null&&(n=t.includes(r.to.resource)),r.from!=null&&!n&&(n=t.includes(r.from.resource)),n}),bn=t=>a.z.object({from:xe(t),to:a.z.null()}),wn=t=>a.z.object({from:a.z.null(),to:xe(t)}),Za=t=>a.z.union([bn(t),wn(t),a.z.object({from:xe(t),to:xe(t)})]),Fa=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:pn,AUTHORITY_BOUNDS:Pa,ZERO_AUTHORITY:yn,acquireZ:wn,authorityZ:gn,filterTransfersByChannelKey:qa,releaseZ:bn,stateZ:xe,subjectZ:mn,transferZ:Za},Symbol.toStringTag,{value:"Module"})),Ya=(t,e)=>{let r=null;return e===0?t:(...n)=>{r!==null&&(clearTimeout(r),r=null),r=setTimeout(()=>t(...n),e)}},Va=(t,e)=>{let r=null;return e===0?t:(...n)=>{r===null&&(r=setTimeout(()=>{t(...n),r=null},e))}},Wa=t=>{try{return structuredClone(t)}catch{return console.warn("Failed to deep copy object, falling back to JSON.parse(JSON.stringify)",t),console.trace(),JSON.parse(JSON.stringify(t))}},Ga=(t,e,r="")=>{const n={},s=(i,o,u)=>{if(typeof i!=typeof o||i===null||o===null){n[u]=[i,o];return}if(typeof i=="object"&&typeof o=="object")if(Array.isArray(i)&&Array.isArray(o)){if(i.length!==o.length){n[u]=[i,o];return}for(let l=0;l<i.length;l++)s(i[l],o[l],`${u}[${l}]`)}else new Set([...Object.keys(i),...Object.keys(o)]).forEach(l=>{s(i[l],o[l],u!==""?`${u}.${l}`:l)});else i!==o&&(n[u]=[i,o])};return s(t,e,r),n},Ot=(t,e)=>{const r=Array.isArray(t),n=Array.isArray(e);if(r!==n)return!1;if(r&&n){const o=t,u=e;if(o.length!==u.length)return!1;for(let l=0;l<o.length;l++)if(!Ot(o[l],u[l]))return!1;return!0}if(t==null||e==null||typeof t!="object"||typeof e!="object")return t===e;if("equals"in t)return t.equals(e);const s=Object.keys(t),i=Object.keys(e);if(s.length!==i.length)return!1;for(const o of s){const u=t[o],l=e[o];if(typeof u=="object"&&typeof l=="object"){if(!Ot(u,l))return!1}else if(u!==l)return!1}return!0},On=(t,e)=>{if(typeof t!="object"||t==null)return t===e;const r=Object.keys(t),n=Object.keys(e);if(n.length>r.length)return!1;for(const s of n){const i=t[s],o=e[s];if(typeof i=="object"&&typeof o=="object"){if(!On(i,o))return!1}else if(i!==o)return!1}return!0},U=".",vn=(t,e,r=U)=>{const n=t.split(r);return n.map((s,i)=>{const o=e(s,i,n);return o==null?null:typeof o=="string"?o:o.join(r)}).filter(s=>s!=null).join(r)},he=(t,e)=>{if(!Array.isArray(t))return t[e];const r=t[e];if(r!=null||t.length==0)return r;const n=t[0];if(typeof n=="object"&&"key"in n)return t.find(s=>s.key===e)},Ha=(t,e)=>{const r=t.split(U);return r.forEach((n,s)=>{e=he(e,n),e!=null&&typeof e=="object"&&"key"in e&&(r[s]=e.key)}),r.join(U)},Xa=(t,e)=>{const r=t.split(U);return e<0?r[r.length+e]:r[e]},Ja=(t,e)=>{if(e.length===0)return!0;const r=t.split(U),n=e.split(U);if(n.length>r.length)return!1;for(let s=0;s<n.length;s++){const i=r[s],o=n[s];if(o!=="*"&&i!==o)return!1}return!0},ie=t=>{const e=parseInt(t);return isNaN(e)||e<0||e.toString()!==t?null:e},vt=(t,e)=>{for(let r=1;r<=e.length;r++){const n=e.slice(0,r).join(U);if(he(t,n)!=null)return[n,r]}return null},Kt=((t,e,r={optional:!1})=>{const{optional:n,getter:s=he}=r;if(e==="")return t;const i=e.split(U);if(i.length===1){const u=s(t,i[0]);if(u===void 0){if(n)return null;throw new Error(`Path ${e} does not exist. ${i[0]} is undefined`)}return u}const o=(u,l)=>{if(l>=i.length)return u;for(let h=i.length-l;h>=1;h--){const d=i.slice(l,l+h).join(U),y=s(u,d);if(y!==void 0){if(l+h===i.length)return y;if(y===null){if(n)return null;throw new Error(`Path ${e} does not exist. ${d} is null`)}return o(y,l+h)}}if(n)return null;throw new Error(`Path ${e} does not exist. ${i[l]} is undefined`)};return o(t,0)}),Ka=(t,e)=>Kt(t,e,{optional:!0})!==null,Tt=(t,...e)=>{if(e.length===0)return t;const r=e.shift();if(Ue(t)&&Ue(r))for(const n in r)try{Ue(r[n])?(n in t||Object.assign(t,{[n]:{}}),Tt(t[n],r[n])):Object.assign(t,{[n]:r[n]})}catch(s){throw s instanceof TypeError?new TypeError(`.${n}: ${s.message}`):s}return Tt(t,...e)},Qa=(t,e,r)=>{const n=(s,i,o)=>{if(o.def?.type==="union")return o.def.options.reduce((u,l)=>n(u,i,l),s);if(o.def?.type==="intersection"){const u=n(s,i,o.def.left);return n(u,i,o.def.right)}for(const u in i){const l=i[u];let h=o?.shape;if(h!=null)for(;h!=null;){if(h[u]!=null){const d=h[u].safeParse(l);if(d.success){s[u]=d.data;break}}h=h.def?.shape}typeof l=="object"&&!Array.isArray(l)&&l!==null&&o&&o.shape&&o.shape[u]&&(s[u]||={},n(s[u],l,o.shape[u]))}return s};return n({...t},e,r)},_a=(t,e)=>{const r=e.split(U);let n=t,s=0;for(;s<r.length;){if(s===r.length-1){const o=r[s];if(Array.isArray(n)){const u=parseInt(o);if(!isNaN(u)&&u<n.length){n.splice(u,1);return}const l=n[0];if(typeof l=="object"&&"key"in l){const h=n.findIndex(d=>d.key===o);if(h!==-1){n.splice(h,1);return}}return}delete n[o];return}let i=!1;if(Array.isArray(n)&&n.length>0){const o=n[0];if(typeof o=="object"&&"key"in o)for(let u=r.length-s;u>=1;u--){const l=r.slice(s,s+u).join(U),h=n.find(d=>d.key===l);if(h!=null){if(s+u===r.length){const d=n.findIndex(y=>y.key===l);d!==-1&&n.splice(d,1);return}n=h,s+=u,i=!0;break}}}if(!i)for(let o=r.length-s;o>=1;o--){const u=r.slice(s,s+o).join(U);if(!Array.isArray(n)&&typeof n=="object"&&n!==null&&u in n){if(s+o===r.length){delete n[u];return}n=n[u],s+=o,i=!0;break}}if(!i){const o=he(n,r[s]);if(o==null)return;n=o,s++}}},eu=(t,e,r)=>{const n=e.split(U);let s=t,i=0;for(;i<n.length-1;){const o=vt(s,n.slice(i,n.length-1));let u;o!=null?[u,i]=[o[0],i+o[1]]:(u=n[i],i++);let l=he(s,u);if(l==null){const h=n[i];let d=ie(h);d==null&&h.startsWith("-")&&ie(h.substring(1))!=null&&(d=0),l=d!=null?[]:{},s[u]=l}s=l}try{const o=n[n.length-1];if(Array.isArray(s)){let l=ie(o);if(l==null){if(o.startsWith("-")){const h=ie(o.substring(1));h!=null&&(l=s.length-h)}if(l==null){if(s.length===0){const d=ie(o);if(d!=null){s[d]=r;return}}const h=s[0];if(typeof h=="object"&&"key"in h){const d=s.findIndex(y=>y.key===o);if(d!==-1){s[d]=r;return}}return}}s[l]=r;return}const u=vt(s,[o]);if(u!=null){s[u[0]]=r;return}s[o]=r}catch(o){throw console.error("failed to set value",r,"at path",e,"on object",t),o}},tu=Object.freeze(Object.defineProperty({__proto__:null,SEPARATOR:U,copy:Wa,defaultGetter:he,difference:Ga,element:Xa,equal:Ot,findBestKey:vt,get:Kt,getIndex:ie,has:Ka,override:Tt,overrideValidItems:Qa,partialEqual:On,pathsMatch:Ja,remove:_a,resolvePath:Ha,set:eu,transformPath:vn},Symbol.toStringTag,{value:"Module"})),ru=t=>Object.getOwnPropertySymbols(globalThis).includes(t),nu=(t,e)=>{const r=Symbol.for(t);if(!ru(r)){const n=e();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},Tn="sy_x_error",su=t=>e=>e!=null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"?e.type.startsWith(t):e instanceof Error?e.message.startsWith(t):typeof e!="string"?!1:e.startsWith(t),xn=t=>class pe extends Error{static discriminator=Tn;discriminator=pe.discriminator;static TYPE=t;type=pe.TYPE;static matches=su(t);matches=pe.matches;constructor(r,n){super(r,n),this.name=pe.TYPE}static sub(r){return xn(`${t}.${r}`)}},iu=t=>{if(t==null||typeof t!="object")return!1;const e=t;if(e.discriminator!==Tn)return!1;if(!("type"in e))throw new Error(`X Error is missing its type property: ${JSON.stringify(e)}`);return!0},fe="unknown",or="nil";class ou{providers=[];register(e){this.providers.push(e)}encode(e){if(e==null)return{type:or,data:""};if(iu(e))for(const r of this.providers){const n=r.encode(e);if(n!=null)return n}if(e instanceof Error)return{type:fe,data:e.message};if(typeof e=="string")return{type:fe,data:e};try{return{type:fe,data:JSON.stringify(e)}}catch{return{type:fe,data:"unable to encode error information"}}}decode(e){if(e==null||e.type===or)return null;if(e.type===fe)return new ar(e.data);for(const r of this.providers){const n=r.decode(e);if(n!=null)return n}return new ar(e.data)}}nu("synnax-error-registry",()=>new ou);class ar extends xn("unknown"){}a.z.object({type:a.z.string(),data:a.z.string()});const au=a.object({jsonrpc:a.literal("2.0"),method:a.string(),params:a.any().optional(),id:a.union([a.string(),a.number(),a.null()]).optional()}),Sn=a.object({jsonrpc:a.literal("2.0"),id:a.union([a.string(),a.number(),a.null()])}),uu=Sn.extend({result:a.json()}),lu=Sn.extend({error:a.object({code:a.number().int(),message:a.string().optional(),data:a.json().optional()})}),cu=a.union([uu,lu]);a.union([au,cu]);a.z.object({key:a.z.string(),value:a.z.string()});const hu=a.uuid(),fu=a.object({key:hu,name:a.string().min(1),color:a.string()}),du=(t,e,r)=>{const n=t.get(e);return n===void 0?(t.set(e,r),r):n},gu=Object.freeze(Object.defineProperty({__proto__:null,getOrSetDefault:du},Symbol.toStringTag,{value:"Module"})),xt=a.z.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/),pu=(t,e)=>{const r=t.split("."),n=e.split("."),s=Math.max(r.length,n.length);for(let i=0;i<s;i++){const o=r[i],u=n[i];if(o===void 0)return Y;if(u===void 0)return V;const l=/^\d+$/.test(o),h=/^\d+$/.test(u);if(l&&!h)return Y;if(!l&&h)return V;if(l&&h){const d=parseInt(o),y=parseInt(u);if(d<y)return Y;if(d>y)return V}else{if(o<u)return Y;if(o>u)return V}}return ne},Ie=((t,e,r={})=>{r.checkMajor??=!0,r.checkMinor??=!0,r.checkPatch??=!0;const n=xt.parse(t),s=xt.parse(e),[i,o]=n.split("-"),[u,l]=s.split("-"),[h,d,y]=i.split(".").map(Number),[p,N,A]=u.split(".").map(Number);if(r.checkMajor){if(h<p)return Y;if(h>p)return V}if(r.checkMinor){if(d<N)return Y;if(d>N)return V}if(r.checkPatch){if(y<A)return Y;if(y>A)return V}return o===void 0&&l===void 0?ne:o===void 0?V:l===void 0?Y:pu(o,l)}),yu=(t,e,r={})=>Or(Ie(t,e,r)),Nn=(t,e,r={})=>wr(Ie(t,e,r)),mu=(t,e,r={})=>br(Ie(t,e,r)),bu=({name:t,migrate:e})=>r=>{try{const n=e(r);return console.log(`${t} migrated: ${r.version} -> ${n.version}`),n}catch(n){throw console.log(`${t} failed to migrate from ${r.version}`),console.error(n),n}},wu=({name:t,migrations:e,targetSchema:r,defaultVersion:n,def:s})=>{const i=Object.keys(e).sort(Ie).pop();if(i==null)return h=>{if(h.version??=n,h.version!==s.version)return console.log(`${t} version ${h.version} is newer than latest version of ${s.version}.
5
+ `).buffer):this.dataType.usesBigInt&&typeof I=="number"?this._data=new this.dataType.Array(p.map(A=>BigInt(Math.round(A)))).buffer:!this.dataType.usesBigInt&&typeof I=="bigint"?this._data=new this.dataType.Array(p.map(Number)).buffer:this._data=new this.dataType.Array(p).buffer}this.key=l,this.alignment=o,this.alignmentMultiple=u,this.sampleOffset=s??0,this.timeRange=n??N.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:i}}static alloc({capacity:e,dataType:r,...n}){if(e===0)throw new Error("[Series] - cannot allocate an array of length 0");const s=new new c(r).Array(e),i=new L({data:s.buffer,dataType:r,...n});return i.writePos=0,i}get refCount(){return this._refCount}acquire(e){this._refCount++,e!=null&&this.updateGLBuffer(e)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(e){if(!e.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(e):this.writeFixed(e)}writeVariable(e){if(this.writePos===H)return 0;const r=this.byteCapacity.valueOf()-this.writePos,n=e.subBytes(0,r);return this.writeToUnderlyingData(n),this.writePos+=n.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=n.length,this.calculateCachedLength()),n.length}writeFixed(e){if(this.writePos===H)return 0;const r=this.capacity-this.writePos,n=e.sub(0,r);return this.writeToUnderlyingData(n),this.cachedLength=void 0,this.maybeRecomputeMinMax(n),this.writePos+=n.length,n.length}writeToUnderlyingData(e){this.underlyingData.set(e.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===H?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
6
+ `).slice(0,-1):Array.from(this).map(e=>e.toString())}parseJSON(e){if(!this.dataType.equals(c.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(r=>e.parse(ot.decodeString(r)))}get byteCapacity(){return new m(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===H?this.byteCapacity:this.dataType.isVariable?new m(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===H?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let e=0;const r=[0];return this.data.forEach((n,s)=>{n===bt&&(e++,r.push(s+1))}),this._cachedIndexes=r,this.cachedLength=e,e}convert(e,r=0){if(this.dataType.equals(e))return this;const n=new e.Array(this.length);for(let s=0;s<this.length;s++)n[s]=Vo(this.dataType,e,this.data[s],r);return new L({data:n.buffer,dataType:e,timeRange:this.timeRange,sampleOffset:r,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(c.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMax=e.reduce((r,n)=>r>n?r:n)}else{const e=this.data;this.cachedMax=e.reduce((r,n)=>r>n?r:n)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??=this.calcRawMax(),W(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(c.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMin=e.reduce((r,n)=>r<n?r:n)}else{const e=this.data;this.cachedMin=e.reduce((r,n)=>r<n?r:n)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??=this.calcRawMin(),W(this.cachedMin,this.sampleOffset))}get bounds(){return w(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(e){if(this.cachedMin!=null){const r=e.cachedMin??e.calcRawMin();r<this.cachedMin&&(this.cachedMin=r)}if(this.cachedMax!=null){const r=e.cachedMax??e.calcRawMax();r>this.cachedMax&&(this.cachedMax=r)}}atAlignment(e,r){const n=Number((e-this.alignment)/this.alignmentMultiple);if(n<0||n>=this.length){if(r===!0)throw new Error(`[series] - no value at index ${n}`);return}return this.at(n,r)}at(e,r=!1){if(this.dataType.isVariable)return this.atVariable(e,r??!1);if(this.dataType.equals(c.UUID))return this.atUUID(e,r);e<0&&(e=this.length+e);const n=this.data[e];if(n==null){if(r===!0)throw new Error(`[series] - no value at index ${e}`);return}return W(n,this.sampleOffset)}atUUID(e,r){e<0&&(e=this.length+e);const n=Gt(new Uint8Array(this.buffer,e*this.dataType.density.valueOf()));if(n==null){if(r)throw new Error(`[series] - no value at index ${e}`);return}return n}atVariable(e,r){let n=0,s=0;if(this._cachedIndexes!=null)n=this._cachedIndexes[e],s=this._cachedIndexes[e+1]-1;else{e<0&&(e=this.length+e);for(let o=0;o<this.data.length;o++)if(this.data[o]===bt){if(e===0){s=o;break}n=o+1,e--}if(s===0&&(s=this.data.length),n>=s||e>0){if(r)throw new Error(`[series] - no value at index ${e}`);return}}const i=this.data.slice(n,s);return this.dataType.equals(c.STRING)?new TextDecoder().decode(i):St(JSON.parse(new TextDecoder().decode(i)))}binarySearch(e){let r=0,n=this.length-1;const s=Se(e);for(;r<=n;){const i=Math.floor((r+n)/2),o=s(this.at(i,!0),e);if(o===0)return i;o<0?r=i+1:n=i-1}return r}updateGLBuffer(e){if(this.gl.control=e,!this.dataType.equals(c.FLOAT32)&&!this.dataType.equals(c.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:r,bufferUsage:n,prevBuffer:s}=this.gl;if(r==null&&(this.gl.buffer=e.createBuffer()),this.writePos!==s)if(e.bindBuffer(e.ARRAY_BUFFER,this.gl.buffer),this.writePos!==H){s===0&&e.bufferData(e.ARRAY_BUFFER,this.byteCapacity.valueOf(),e.STATIC_DRAW);const i=this.dataType.density.size(s).valueOf(),o=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);e.bufferSubData(e.ARRAY_BUFFER,i,o.buffer),this.gl.prevBuffer=this.writePos}else e.bufferData(e.ARRAY_BUFFER,this.buffer,n==="static"?e.STATIC_DRAW:e.DYNAMIC_DRAW),this.gl.prevBuffer=H}as(e){return nn(e,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:sr(this.alignmentBounds.lower),upper:sr(this.alignmentBounds.upper),multiple:this.alignmentMultiple},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return w(this.alignment,this.alignment+BigInt(this.length)*this.alignmentMultiple)}maybeGarbageCollectGLBuffer(e){this.gl.buffer!=null&&(e.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const e=new aa(this);return this.dataType.equals(c.JSON)?new Ht(e):e}return this.dataType.equals(c.UUID)?new ua(this):new la(this)}slice(e,r){return this.sliceSub(!1,e,r)}sub(e,r){return this.sliceSub(!0,e,r)}subIterator(e,r){return new nr(this,e,r??this.length)}subAlignmentIterator(e,r){const n=Math.ceil(Number(e-this.alignment)/Number(this.alignmentMultiple)),s=Math.ceil(Number(r-this.alignment)/Number(this.alignmentMultiple));return new nr(this,n,s)}subBytes(e,r){if(e>=0&&(r==null||r>=this.byteLength.valueOf()))return this;const n=this.data.subarray(e,r);return new L({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}sliceSub(e,r,n){if(r<=0&&(n==null||n>=this.length))return this;let s;return e?s=this.data.subarray(r,n):s=this.data.slice(r,n),new L({data:s,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(r)})}reAlign(e){return new L({data:this.buffer,dataType:this.dataType,timeRange:N.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:e})}toString(){let e=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)e+=Array.from(this).map(r=>r.toString());else{for(let r=0;r<5;r++)e+=`${this.at(r)?.toString()}`,e+=",";e+="...,";for(let r=-5;r<0;r++)e+=this.at(r)?.toString(),r<-1&&(e+=",")}return e+="])",e}}const oa=t=>t==null?!1:Array.isArray(t)||t instanceof ArrayBuffer||ArrayBuffer.isView(t)&&!(t instanceof DataView)||t instanceof L?!0:tn(t),on=ys(sn,L);class nr{series;end;index;constructor(e,r,n){this.series=e;const s=w(0,e.length+1);this.end=ct(s,n),this.index=ct(s,r)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class aa{series;index;decoder;constructor(e){if(!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,r=this.series.data;for(;this.index<r.length&&r[this.index]!==bt;)this.index++;const n=this.index;return e===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,n))})}}class Ht{wrapped;static schema=a.z.record(a.z.string(),a.z.unknown());constructor(e){this.wrapped=e}next(){const e=this.wrapped.next();return e.done===!0?{done:!0,value:void 0}:{done:!1,value:ot.decodeString(e.value,Ht.schema)}}}class ua{series;index;data;density;constructor(e){if(!e.dataType.equals(c.UUID))throw new Error("cannot create a UUID series iterator for a non-UUID series");this.series=e,this.index=0,this.data=new Uint8Array(e.buffer),this.density=c.UUID.density.valueOf()}next(){if(this.index>=this.series.length)return{done:!0,value:void 0};const e=Gt(this.data,this.index*this.density);return this.index++,{done:!1,value:e}}}class la{series;index;constructor(e){this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}class ca{series;constructor(e=[]){if(e.length!==0){const r=e[0].dataType;for(let n=1;n<e.length;n++)if(!e[n].dataType.equals(r))throw new Error("[multi-series] - series must have the same data type")}this.series=e}as(e){return nn(e,this.dataType),this}get dataType(){return this.series.length===0?c.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?N.ZERO:new N(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?w(0n,0n):w(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(e){const r=()=>new Error(`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`),n=e.dataType.equals(this.dataType);if(on(e)){if(this.series.length!==0&&!n)throw r();this.series.push(e)}else{if(this.series.length!==0&&e.series.length!==0&&!n)throw r();this.series.push(...e.series)}}get length(){return this.series.reduce((e,r)=>e+r.length,0)}atAlignment(e,r){for(const n of this.series)if(k(n.alignmentBounds,e))return n.atAlignment(e,r);if(r)throw new Error(`[series] - no value at alignment ${e}`)}at(e,r=!1){e<0&&(e=this.length+e);for(const n of this.series){if(e<n.length)return n.at(e,r);e-=n.length}if(r)throw new Error(`[series] - no value at index ${e}`)}subIterator(e,r){return new rt(this,e,r??this.length)}subAlignmentIterator(e,r){if(e>=this.alignmentBounds.upper||r<=this.alignmentBounds.lower)return mt;let n=0;for(let i=0;i<this.series.length;i++){const o=this.series[i];if(e<o.alignment)break;if(e>=o.alignmentBounds.upper)n+=o.length;else if(k(o.alignmentBounds,e)){n+=Math.ceil(Number(e-o.alignment)/Number(o.alignmentMultiple));break}}let s=0;for(let i=0;i<this.series.length;i++){const o=this.series[i];if(r<o.alignment)break;if(r>=o.alignmentBounds.upper)s+=o.length;else if(k(o.alignmentBounds,r)){s+=Math.ceil(Number(r-o.alignment)/Number(o.alignmentMultiple));break}}return new rt(this,n,s)}subAlignmentSpanIterator(e,r){if(e>=this.alignmentBounds.upper)return mt;r=Math.min(r,Number(this.distance(e,this.alignmentBounds.upper)));let n=0;for(let s=0;s<this.series.length;s++){const i=this.series[s];if(e<i.alignment)break;if(e>=i.alignmentBounds.upper)n+=i.length;else if(k(i.alignmentBounds,e)){n+=Number(e-i.alignment);break}}return new rt(this,n,n+r)}updateGLBuffer(e){this.series.forEach(r=>r.updateGLBuffer(e))}get bounds(){return Ur(this.series.map(e=>e.bounds))}get byteLength(){return new m(this.series.reduce((e,r)=>e+r.byteLength.valueOf(),0))}get data(){const e=new this.dataType.Array(this.length);let r=0;for(const n of this.series)e.set(n.data,r),r+=n.length;return new this.dataType.Array(e.buffer)}traverseAlignment(e,r){const n=this.series.map(s=>s.alignmentBounds);return Br(n,e,r)}acquire(e){this.series.forEach(r=>r.acquire(e))}release(){this.series.forEach(e=>e.release())}distance(e,r){const n=this.series.map(s=>s.alignmentBounds);return $r(n,e,r)}parseJSON(e){if(!this.dataType.equals(c.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(r=>r.parseJSON(e))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new ha(this.series)}toStrings(){return this.series.flatMap(e=>e.toStrings())}}class ha{series;seriesIndex;internal;constructor(e){this.series=e,this.seriesIndex=0,this.internal=e[0][Symbol.iterator]()}next(){const e=this.internal.next();return e.done===!1?e:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[Symbol.iterator](){return this}}class rt{series;index;end;constructor(e,r,n){this.series=e,this.end=n,this.index=r}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}const sr=t=>{const e=t>>32n,r=t&0xffffffffn;return{domain:e,sample:r}};a.z.object({baseInterval:g.z.optional(),maxRetries:a.z.number().optional(),scale:a.z.number().optional()});const fa=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,Ze=a.z.string().regex(fa),oe=a.z.number().min(0).max(255),an=a.z.number().min(0).max(1),Je=a.z.tuple([oe,oe,oe,an]),da=a.z.tuple([oe,oe,oe]),ga=a.z.object({rgba255:Je}),pa=a.z.number().min(0).max(360),ya=a.z.number().min(0).max(100),ma=a.z.number().min(0).max(100),un=a.z.tuple([pa,ya,ma,an]),Ke=a.z.union([Ze,da,Je,un,ga]),Qe=Ke.transform(t=>T(t)),ba=t=>Qe.safeParse(t).success,wa=t=>Je.safeParse(t).success,Oa=(t=>{if(t==null)return;const e=Qe.safeParse(t);if(e.success)return cn(e.data);if(typeof t=="string")return t;throw e.error}),T=(t,e=1)=>{if(t=Ke.parse(t),typeof t=="string")return Re(t,e);if(Array.isArray(t)){if(t.length<3||t.length>4)throw new Error(`Invalid color: [${t.join(", ")}]`);return t.length===3?[...t,e]:t}return t.rgba255},ln=(t,e)=>{if(t==null||e==null)return t==e;const r=T(t),n=T(e);return r.every((s,i)=>s===n[i])},va=(t=>{if(t==null)return;const[e,r,n,s]=T(t);return`#${ze(e)}${ze(r)}${ze(n)}${s===1?"":ze(s*255)}`}),cn=t=>{const[e,r,n,s]=T(t);return`rgba(${e}, ${r}, ${n}, ${s})`},Ta=t=>`rgb(${hn(t)})`,hn=t=>{const[e,r,n]=T(t);return`${e}, ${r}, ${n}`},xa=t=>[...Xt(t),we(t)],Xt=t=>[ye(t)/255,me(t)/255,be(t)/255],ye=t=>T(t)[0],me=t=>T(t)[1],be=t=>T(t)[2],we=t=>T(t)[3],Sa=t=>ln(Jt,t),Na=t=>$a(T(t)),Ia=(t,e)=>{const[r,n,s]=T(t);if(e>100)throw new Error(`Color opacity must be between 0 and 100, got ${e}`);return e>1&&(e/=100),[r,n,s,e]},Te=t=>{const[e,r,n]=Xt(t).map(s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4);return Number((.2126*e+.7152*r+.0722*n).toFixed(3))},Ma=t=>{const[e,r,n]=Xt(t);return 1-(Math.max(e,r,n)-Math.min(e,r,n))},wt=(t,e)=>{const r=T(t),n=T(e),s=Te(r),i=Te(n);return(Math.max(s,i)+.5)/(Math.min(s,i)+.5)},Aa=(t,...e)=>{if(e.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=T(t),[n]=e.sort((s,i)=>wt(r,i)-wt(r,s));return T(n)},za=t=>Te(t)<.5,Ea=t=>Te(t)>.5,Re=(t,e=1)=>(t=Ze.parse(t),t=ja(t),[Ee(t,0),Ee(t,2),Ee(t,4),t.length===8?Ee(t,6)/255:e]),Jt=[0,0,0,0],ze=t=>Math.floor(t).toString(16).padStart(2,"0"),Ee=(t,e)=>parseInt(t.slice(e,e+2),16),ja=t=>t.startsWith("#")?t.slice(1):t,ir={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",silver:"#c0c0c0",gray:"#808080",grey:"#808080",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",brown:"#a52a2a",tan:"#d2b48c",gold:"#ffd700",indigo:"#4b0082",violet:"#ee82ee",pink:"#ffc0cb",coral:"#ff7f50",salmon:"#fa8072",khaki:"#f0e68c",crimson:"#dc143c",transparent:"transparent"},Ua=t=>{if(!t)return;const e=t.trim().toLowerCase();if(!(e==="transparent"||e==="none")){if(e.startsWith("#")){if(e.length===4){const r=e[1],n=e[2],s=e[3],i=`#${r}${r}${n}${n}${s}${s}`;if(Ze.safeParse(i).success)return Re(i)}return(e.length===7||e.length===9)&&Ze.safeParse(e).success?Re(e):void 0}if(e.startsWith("rgb")){const r=e.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);if(r){const[,n,s,i,o]=r;return[parseInt(n),parseInt(s),parseInt(i),o?parseFloat(o):1]}}if(ir[e])return Re(ir[e])}},Ba=t=>{t=un.parse(t);let[e,r,n]=t;const s=t[3];e/=360,r/=100,n/=100;let i,o,u;if(r===0)i=o=u=n;else{const l=n<.5?n*(1+r):n+r-n*r,h=2*n-l;i=nt(h,l,e+1/3),o=nt(h,l,e),u=nt(h,l,e-1/3)}return[Math.round(i*255),Math.round(o*255),Math.round(u*255),s]},nt=(t,e,r)=>(r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t),$a=t=>{t=Je.parse(t);let[e,r,n]=t;const s=t[3];e/=255,r/=255,n/=255;const i=Math.max(e,r,n),o=Math.min(e,r,n);let u,l,h=(i+o)/2;if(i===o)u=l=0;else{const f=i-o;l=h>.5?f/(2-i-o):f/(i+o),i===e?u=(r-n)/f+(r<n?6:0):i===r?u=(n-e)/f+2:u=(e-r)/f+4,u/=6}return u*=360,l*=100,h*=100,[Math.round(u),Math.round(l),Math.round(h),s]},Ca=T("#000000"),Ra=T("#ffffff"),fn=a.z.object({key:a.z.string(),color:Ke,position:a.z.number(),switched:a.z.boolean().optional()}),La=a.z.array(fn),ka=(t,e)=>{if(t.length===0)return Jt;if(t=t.slice().sort((r,n)=>r.position-n.position),e<=t[0].position)return T(t[0].color);if(e>=t[t.length-1].position)return T(t[t.length-1].color);for(let r=0;r<t.length-1;r++){const n=t[r],s=t[r+1];if(e<n.position||e>s.position)continue;if(e===n.position)return T(n.color);if(e===s.position)return T(s.color);const i=(e-n.position)/(s.position-n.position),o=T(n.color),u=T(s.color),l=Math.round(ye(o)+i*(ye(u)-ye(o))),h=Math.round(me(o)+i*(me(u)-me(o))),f=Math.round(be(o)+i*(be(u)-be(o))),y=we(o)+i*(we(u)-we(o));return T([l,h,f,y])}return T(t[t.length-1].color)},Da=a.z.object({key:a.z.string(),name:a.z.string(),color:Qe}),Pa=a.z.object({key:a.z.string(),name:a.z.string(),swatches:a.z.array(Da)}),dn=Object.freeze(Object.defineProperty({__proto__:null,BLACK:Ca,WHITE:Ra,ZERO:Jt,aValue:we,bValue:be,colorZ:Qe,construct:T,contrast:wt,crudeZ:Ke,cssString:Oa,equals:ln,fromCSS:Ua,fromGradient:ka,fromHSLA:Ba,gValue:me,gradientZ:La,grayness:Ma,hex:va,hsla:Na,isColor:wa,isCrude:ba,isDark:za,isLight:Ea,isZero:Sa,luminance:Te,paletteZ:Pa,pickByContrast:Aa,rValue:ye,rgbCSS:Ta,rgbString:hn,rgba1:xa,rgbaCSS:cn,setAlpha:Ia,stopZ:fn},Symbol.toStringTag,{value:"Module"})),gn=a.z.int().min(0).max(255),pn=255,yn=0,qa={lower:yn,upper:pn+1},mn=a.z.object({name:a.z.string(),key:a.z.string()}),xe=t=>a.z.object({subject:mn,resource:t,authority:gn}),Za=(...t)=>e=>e.filter(r=>{let n=!1;return r.to!=null&&(n=t.includes(r.to.resource)),r.from!=null&&!n&&(n=t.includes(r.from.resource)),n}),bn=t=>a.z.object({from:xe(t),to:a.z.null()}),wn=t=>a.z.object({from:a.z.null(),to:xe(t)}),Fa=t=>a.z.union([bn(t),wn(t),a.z.object({from:xe(t),to:xe(t)})]),Ya=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:pn,AUTHORITY_BOUNDS:qa,ZERO_AUTHORITY:yn,acquireZ:wn,authorityZ:gn,filterTransfersByChannelKey:Za,releaseZ:bn,stateZ:xe,subjectZ:mn,transferZ:Fa},Symbol.toStringTag,{value:"Module"})),Va=(t,e)=>{let r=null;return e===0?t:(...n)=>{r!==null&&(clearTimeout(r),r=null),r=setTimeout(()=>t(...n),e)}},Wa=(t,e)=>{let r=null;return e===0?t:(...n)=>{r===null&&(r=setTimeout(()=>{t(...n),r=null},e))}},Ga=t=>{try{return structuredClone(t)}catch{return console.warn("Failed to deep copy object, falling back to JSON.parse(JSON.stringify)",t),console.trace(),JSON.parse(JSON.stringify(t))}},Ha=(t,e,r="")=>{const n={},s=(i,o,u)=>{if(typeof i!=typeof o||i===null||o===null){n[u]=[i,o];return}if(typeof i=="object"&&typeof o=="object")if(Array.isArray(i)&&Array.isArray(o)){if(i.length!==o.length){n[u]=[i,o];return}for(let l=0;l<i.length;l++)s(i[l],o[l],`${u}[${l}]`)}else new Set([...Object.keys(i),...Object.keys(o)]).forEach(l=>{s(i[l],o[l],u!==""?`${u}.${l}`:l)});else i!==o&&(n[u]=[i,o])};return s(t,e,r),n},Ot=(t,e)=>{const r=Array.isArray(t),n=Array.isArray(e);if(r!==n)return!1;if(r&&n){const o=t,u=e;if(o.length!==u.length)return!1;for(let l=0;l<o.length;l++)if(!Ot(o[l],u[l]))return!1;return!0}if(t==null||e==null||typeof t!="object"||typeof e!="object")return t===e;if("equals"in t)return t.equals(e);const s=Object.keys(t),i=Object.keys(e);if(s.length!==i.length)return!1;for(const o of s){const u=t[o],l=e[o];if(typeof u=="object"&&typeof l=="object"){if(!Ot(u,l))return!1}else if(u!==l)return!1}return!0},On=(t,e)=>{if(typeof t!="object"||t==null)return t===e;const r=Object.keys(t),n=Object.keys(e);if(n.length>r.length)return!1;for(const s of n){const i=t[s],o=e[s];if(typeof i=="object"&&typeof o=="object"){if(!On(i,o))return!1}else if(i!==o)return!1}return!0},U=".",vn=(t,e,r=U)=>{const n=t.split(r);return n.map((s,i)=>{const o=e(s,i,n);return o==null?null:typeof o=="string"?o:o.join(r)}).filter(s=>s!=null).join(r)},he=(t,e)=>{if(!Array.isArray(t))return t[e];const r=t[e];if(r!=null||t.length==0)return r;const n=t[0];if(typeof n=="object"&&"key"in n)return t.find(s=>s.key===e)},Xa=(t,e)=>{const r=t.split(U);return r.forEach((n,s)=>{e=he(e,n),e!=null&&typeof e=="object"&&"key"in e&&(r[s]=e.key)}),r.join(U)},Ja=(t,e)=>{const r=t.split(U);return e<0?r[r.length+e]:r[e]},Ka=(t,e)=>{if(e.length===0)return!0;const r=t.split(U),n=e.split(U);if(n.length>r.length)return!1;for(let s=0;s<n.length;s++){const i=r[s],o=n[s];if(o!=="*"&&i!==o)return!1}return!0},ie=t=>{const e=parseInt(t);return isNaN(e)||e<0||e.toString()!==t?null:e},vt=(t,e)=>{for(let r=1;r<=e.length;r++){const n=e.slice(0,r).join(U);if(he(t,n)!=null)return[n,r]}return null},Kt=((t,e,r={optional:!1})=>{const{optional:n,getter:s=he}=r;if(e==="")return t;const i=e.split(U);if(i.length===1){const u=s(t,i[0]);if(u===void 0){if(n)return null;throw new Error(`Path ${e} does not exist. ${i[0]} is undefined`)}return u}const o=(u,l)=>{if(l>=i.length)return u;for(let h=i.length-l;h>=1;h--){const f=i.slice(l,l+h).join(U),y=s(u,f);if(y!==void 0){if(l+h===i.length)return y;if(y===null){if(n)return null;throw new Error(`Path ${e} does not exist. ${f} is null`)}return o(y,l+h)}}if(n)return null;throw new Error(`Path ${e} does not exist. ${i[l]} is undefined`)};return o(t,0)}),Qa=(t,e)=>Kt(t,e,{optional:!0})!==null,Tt=(t,...e)=>{if(e.length===0)return t;const r=e.shift();if(Ue(t)&&Ue(r))for(const n in r)try{Ue(r[n])?(n in t||Object.assign(t,{[n]:{}}),Tt(t[n],r[n])):Object.assign(t,{[n]:r[n]})}catch(s){throw s instanceof TypeError?new TypeError(`.${n}: ${s.message}`):s}return Tt(t,...e)},_a=(t,e,r)=>{const n=(s,i,o)=>{if(o.def?.type==="union")return o.def.options.reduce((u,l)=>n(u,i,l),s);if(o.def?.type==="intersection"){const u=n(s,i,o.def.left);return n(u,i,o.def.right)}for(const u in i){const l=i[u];let h=o?.shape;if(h!=null)for(;h!=null;){if(h[u]!=null){const f=h[u].safeParse(l);if(f.success){s[u]=f.data;break}}h=h.def?.shape}typeof l=="object"&&!Array.isArray(l)&&l!==null&&o&&o.shape&&o.shape[u]&&(s[u]||={},n(s[u],l,o.shape[u]))}return s};return n({...t},e,r)},eu=(t,e)=>{const r=e.split(U);let n=t,s=0;for(;s<r.length;){if(s===r.length-1){const o=r[s];if(Array.isArray(n)){const u=parseInt(o);if(!isNaN(u)&&u<n.length){n.splice(u,1);return}const l=n[0];if(typeof l=="object"&&"key"in l){const h=n.findIndex(f=>f.key===o);if(h!==-1){n.splice(h,1);return}}return}delete n[o];return}let i=!1;if(Array.isArray(n)&&n.length>0){const o=n[0];if(typeof o=="object"&&"key"in o)for(let u=r.length-s;u>=1;u--){const l=r.slice(s,s+u).join(U),h=n.find(f=>f.key===l);if(h!=null){if(s+u===r.length){const f=n.findIndex(y=>y.key===l);f!==-1&&n.splice(f,1);return}n=h,s+=u,i=!0;break}}}if(!i)for(let o=r.length-s;o>=1;o--){const u=r.slice(s,s+o).join(U);if(!Array.isArray(n)&&typeof n=="object"&&n!==null&&u in n){if(s+o===r.length){delete n[u];return}n=n[u],s+=o,i=!0;break}}if(!i){const o=he(n,r[s]);if(o==null)return;n=o,s++}}},tu=(t,e,r)=>{const n=e.split(U);let s=t,i=0;for(;i<n.length-1;){const o=vt(s,n.slice(i,n.length-1));let u;o!=null?[u,i]=[o[0],i+o[1]]:(u=n[i],i++);let l=he(s,u);if(l==null){const h=n[i];let f=ie(h);f==null&&h.startsWith("-")&&ie(h.substring(1))!=null&&(f=0),l=f!=null?[]:{},s[u]=l}s=l}try{const o=n[n.length-1];if(Array.isArray(s)){let l=ie(o);if(l==null){if(o.startsWith("-")){const h=ie(o.substring(1));h!=null&&(l=s.length-h)}if(l==null){if(s.length===0){const f=ie(o);if(f!=null){s[f]=r;return}}const h=s[0];if(typeof h=="object"&&"key"in h){const f=s.findIndex(y=>y.key===o);if(f!==-1){s[f]=r;return}}return}}s[l]=r;return}const u=vt(s,[o]);if(u!=null){s[u[0]]=r;return}s[o]=r}catch(o){throw console.error("failed to set value",r,"at path",e,"on object",t),o}},ru=Object.freeze(Object.defineProperty({__proto__:null,SEPARATOR:U,copy:Ga,defaultGetter:he,difference:Ha,element:Ja,equal:Ot,findBestKey:vt,get:Kt,getIndex:ie,has:Qa,override:Tt,overrideValidItems:_a,partialEqual:On,pathsMatch:Ka,remove:eu,resolvePath:Xa,set:tu,transformPath:vn},Symbol.toStringTag,{value:"Module"})),nu=t=>Object.getOwnPropertySymbols(globalThis).includes(t),su=(t,e)=>{const r=Symbol.for(t);if(!nu(r)){const n=e();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},Tn="sy_x_error",iu=t=>e=>e!=null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"?e.type.startsWith(t):e instanceof Error?e.message.startsWith(t):typeof e!="string"?!1:e.startsWith(t),xn=t=>class pe extends Error{static discriminator=Tn;discriminator=pe.discriminator;static TYPE=t;type=pe.TYPE;static matches=iu(t);matches=pe.matches;constructor(r,n){super(r,n),this.name=pe.TYPE}static sub(r){return xn(`${t}.${r}`)}},ou=t=>{if(t==null||typeof t!="object")return!1;const e=t;if(e.discriminator!==Tn)return!1;if(!("type"in e))throw new Error(`X Error is missing its type property: ${JSON.stringify(e)}`);return!0},fe="unknown",or="nil";class au{providers=[];register(e){this.providers.push(e)}encode(e){if(e==null)return{type:or,data:""};if(ou(e))for(const r of this.providers){const n=r.encode(e);if(n!=null)return n}if(e instanceof Error)return{type:fe,data:e.message};if(typeof e=="string")return{type:fe,data:e};try{return{type:fe,data:JSON.stringify(e)}}catch{return{type:fe,data:"unable to encode error information"}}}decode(e){if(e==null||e.type===or)return null;if(e.type===fe)return new ar(e.data);for(const r of this.providers){const n=r.decode(e);if(n!=null)return n}return new ar(e.data)}}su("synnax-error-registry",()=>new au);class ar extends xn("unknown"){}a.z.object({type:a.z.string(),data:a.z.string()});const uu=a.object({jsonrpc:a.literal("2.0"),method:a.string(),params:a.any().optional(),id:a.union([a.string(),a.number(),a.null()]).optional()}),Sn=a.object({jsonrpc:a.literal("2.0"),id:a.union([a.string(),a.number(),a.null()])}),lu=Sn.extend({result:a.json()}),cu=Sn.extend({error:a.object({code:a.number().int(),message:a.string().optional(),data:a.json().optional()})}),hu=a.union([lu,cu]);a.union([uu,hu]);a.z.object({key:a.z.string(),value:a.z.string()});const fu=a.uuid(),du=a.object({key:fu,name:a.string().min(1),color:a.string()}),gu=(t,e,r)=>{const n=t.get(e);return n===void 0?(t.set(e,r),r):n},pu=Object.freeze(Object.defineProperty({__proto__:null,getOrSetDefault:gu},Symbol.toStringTag,{value:"Module"})),xt=a.z.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/),yu=(t,e)=>{const r=t.split("."),n=e.split("."),s=Math.max(r.length,n.length);for(let i=0;i<s;i++){const o=r[i],u=n[i];if(o===void 0)return Y;if(u===void 0)return V;const l=/^\d+$/.test(o),h=/^\d+$/.test(u);if(l&&!h)return Y;if(!l&&h)return V;if(l&&h){const f=parseInt(o),y=parseInt(u);if(f<y)return Y;if(f>y)return V}else{if(o<u)return Y;if(o>u)return V}}return ne},Ie=((t,e,r={})=>{r.checkMajor??=!0,r.checkMinor??=!0,r.checkPatch??=!0;const n=xt.parse(t),s=xt.parse(e),[i,o]=n.split("-"),[u,l]=s.split("-"),[h,f,y]=i.split(".").map(Number),[p,I,A]=u.split(".").map(Number);if(r.checkMajor){if(h<p)return Y;if(h>p)return V}if(r.checkMinor){if(f<I)return Y;if(f>I)return V}if(r.checkPatch){if(y<A)return Y;if(y>A)return V}return o===void 0&&l===void 0?ne:o===void 0?V:l===void 0?Y:yu(o,l)}),mu=(t,e,r={})=>Or(Ie(t,e,r)),Nn=(t,e,r={})=>wr(Ie(t,e,r)),bu=(t,e,r={})=>br(Ie(t,e,r)),wu=({name:t,migrate:e})=>r=>{try{const n=e(r);return console.log(`${t} migrated: ${r.version} -> ${n.version}`),n}catch(n){throw console.log(`${t} failed to migrate from ${r.version}`),console.error(n),n}},Ou=({name:t,migrations:e,targetSchema:r,defaultVersion:n,def:s})=>{const i=Object.keys(e).sort(Ie).pop();if(i==null)return h=>{if(h.version??=n,h.version!==s.version)return console.log(`${t} version ${h.version} is newer than latest version of ${s.version}.
7
7
  Returning default instead.
8
- `),s;try{return r!=null?r.parse(h):h}catch(d){return console.log(`${t} failed to parse default. Exiting with default`),console.error(d),s}};const o=Object.keys(e).length;let u=!1;const l=h=>{try{if(o===0||Nn(h.version,i))return console.log(u?`${t} ${h.version} now up to date`:`${t} version ${h.version} is up to date with target version ${s.version}`),h;const d=h.version,y=e[d],p=y(h);return u=!0,l(p)}catch(d){return console.log(`${t} failed to migrate from ${h.version} to ${i}`),console.error(d),s}};return h=>{try{if(h.version==null)if(n!=null)console.log(`${t} version is null. Setting version to default of ${n}`),h.version=n;else return console.log(`${t} version is null and no default version set. Exiting with default`),s;return l(h)}catch(d){return console.log(`${t} failed to parse final result. Exiting with default`),console.error(d),s}}},Ou=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:Ie,createMigration:bu,migrator:wu,semVerNewer:Nn,semVerOlder:mu,semVerZ:xt,versionsEqual:yu},Symbol.toStringTag,{value:"Module"})),In=["standard","scientific","engineering"],vu=a.z.enum(In),Tu=(t,e,r)=>{if(Number.isNaN(t))return"NaN";if(t===1/0)return"∞";if(t===-1/0)return"-∞";if(r==="standard")return t.toFixed(e);if(t===0)return e===0?"0ᴇ0":`0.${"0".repeat(e)}ᴇ0`;let n;return r==="scientific"?n=Math.floor(Math.log10(Math.abs(t))):n=Math.floor(Math.log10(Math.abs(t))/3)*3,`${(t/10**n).toFixed(e)}ᴇ${n}`},xu=Object.freeze(Object.defineProperty({__proto__:null,NOTATIONS:In,notationZ:vu,stringifyNumber:Tu},Symbol.toStringTag,{value:"Module"}));class Su{handlers;transform;closer;constructor(e,r){this.transform=e,this.handlers=r??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){let r=e;if(this.transform!=null){const[n,s]=this.transform(e);if(!s)return;r=n}this.handlers.forEach((n,s)=>s(r))}setCloser(e){this.closer=e}async close(){return await this.closer?.()}}class Nu{handlers;constructor(e){this.handlers=e??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){this.handlers.forEach((r,n)=>n(e))}}const Iu=Object.freeze(Object.defineProperty({__proto__:null,BaseObserver:Nu,Observer:Su},Symbol.toStringTag,{value:"Module"})),Mu=a.z.record(a.z.union([a.z.number(),a.z.string(),a.z.symbol()]),a.z.unknown()),Qt=t=>Object.entries(t),Au=(t,e)=>Object.fromEntries(Qt(t).map(([r,n])=>[r,e(n,r)])),zu=t=>Object.fromEntries(Qt(t).filter(([e,r])=>r!==void 0)),Eu=(t,...e)=>{const r={...t};for(const n of e)delete r[n];return r},ju=Object.freeze(Object.defineProperty({__proto__:null,entries:Qt,map:Au,omit:Eu,purgeUndefined:zu,unknownZ:Mu},Symbol.toStringTag,{value:"Module"})),Mn=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",Uu=Mn(),An=["macOS","Windows","Linux"],Bu=["macos","windows","linux"],$u={macos:"macOS",windows:"Windows",linux:"Linux"},Cu=a.z.enum(An).or(a.z.enum(Bu).transform(t=>$u[t])),Ru=()=>{if(typeof window>"u")return;const t=window.navigator.userAgent.toLowerCase();if(t.includes("mac"))return"macOS";if(t.includes("win"))return"Windows";if(t.includes("linux"))return"Linux"};let st;const Lu=((t={})=>{const{force:e,default:r}=t;return e??st??(st=Ru(),st??r)}),ku=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:An,RUNTIME:Uu,detect:Mn,getOS:Lu,osZ:Cu},Symbol.toStringTag,{value:"Module"})),Du=()=>Promise.resolve(),Pu=()=>new Promise(t=>setTimeout(t,0)),qu=Object.freeze(Object.defineProperty({__proto__:null,flushMicrotasks:Du,flushTaskQueue:Pu},Symbol.toStringTag,{value:"Module"})),Zu=t=>Array.isArray(t)?[...t]:typeof t=="object"&&t!==null?{...t}:t,Fu=Object.freeze(Object.defineProperty({__proto__:null,copy:Zu},Symbol.toStringTag,{value:"Module"})),zn=a.z.enum(["success","info","warning","error","loading","disabled"]),Yu=t=>a.z.object({key:a.z.string(),name:a.z.string().default(""),variant:zn,message:a.z.string(),description:a.z.string().optional(),time:f.z,labels:cr(fu).optional(),details:t??a.z.unknown().optional()}),Vu=a.z.object({stack:a.z.string(),error:a.z.instanceof(Error)}),Wu=(t,e)=>{if(!(t instanceof Error))throw t;return En({variant:"error",message:e??t.message,description:e!=null?t.message:void 0,details:{stack:t.stack??"",error:t}})},En=t=>({key:It(),time:f.now(),name:"",...t}),Gu=(t,e=[])=>{if(t!=null)return Array.isArray(e)?e.includes(t)?t:void 0:e===t?t:void 0},Hu=(t,e=[])=>{if(t!=null)return Array.isArray(e)?e.includes(t)?void 0:t:e===t?void 0:t},Xu=Object.freeze(Object.defineProperty({__proto__:null,create:En,exceptionDetailsSchema:Vu,fromException:Wu,keepVariants:Gu,removeVariants:Hu,statusZ:Yu,variantZ:zn},Symbol.toStringTag,{value:"Module"})),Ju=(t,e)=>{if(!e.has(t))return t;let r=t,n=1,s=t;for(;e.has(s);){const i=s.match(Ku);i?(r=s.slice(0,i.index).trim(),n=parseInt(i[1])+1):(r=s,n=1),s=`${r} (${n})`}return s},Ku=/\((\d+)\)$/,Qu=(t,e="")=>{if(typeof t=="string")return t;const r=t.length;return r===0?e:r===1?t[0]:r===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[r-1]}`},_u=t=>{const e=t.split(" "),r=new Set,n=e.map(o=>o.charAt(0).toLowerCase()).join("");r.add(n.replace(/-/g,"_")),r.add(n.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"));const s=/\d+/g;t.match(s)&&e.forEach((o,u)=>{if(s.test(o)){const l=e.map((h,d)=>d!==u?h.charAt(0).toLowerCase():h).join("");r.add(l.replace(/-/g,"_")),r.add(l.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"))}});const i=e.map(o=>(o.length>3?o.substring(0,3):o).toLowerCase());return r.add(i.join("").replace(/-/g,"_")),r.add(i.join("_").replace(/-/g,"_")),Array.from(r).filter(o=>o.length>=2&&o.length<=12&&!/^\d/.test(o))},el=(t,e)=>t.startsWith(e)?t.slice(e.length):t,tl=Object.freeze(Object.defineProperty({__proto__:null,createShortIdentifiers:_u,deduplicateFileName:Ju,naturalLanguageJoin:Qu,trimPrefix:el},Symbol.toStringTag,{value:"Module"})),rl=new Error("request for lock canceled");var nl=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{h(n.next(d))}catch(y){o(y)}}function l(d){try{h(n.throw(d))}catch(y){o(y)}}function h(d){d.done?i(d.value):s(d.value).then(u,l)}h((n=n.apply(t,e||[])).next())})};class sl{constructor(e,r=rl){this._value=e,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,s)=>{const i={resolve:n,reject:s,weight:e,priority:r},o=jn(this._queue,u=>r<=u.priority);o===-1&&e<=this._value?this._dispatchItem(i):this._queue.splice(o+1,0,i)})}runExclusive(e){return nl(this,arguments,void 0,function*(r,n=1,s=0){const[i,o]=yield this.acquire(n,s);try{return yield r(i)}finally{o()}})}waitForUnlock(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,r)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),il(this._weightedWaiters[e-1],{resolve:n,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const r=this._value;this._value-=e.weight,e.resolve([r,this._newReleaser(e.weight)])}_newReleaser(e){let r=!1;return()=>{r||(r=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const r=this._weightedWaiters[e-1];r&&(r.forEach(n=>n.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let r=this._value;r>0;r--){const n=this._weightedWaiters[r-1];if(!n)continue;const s=n.findIndex(i=>i.priority<=e);(s===-1?n:n.splice(0,s)).forEach((i=>i.resolve()))}}}_couldLockImmediately(e,r){return(this._queue.length===0||this._queue[0].priority<r)&&e<=this._value}}function il(t,e){const r=jn(t,n=>e.priority<=n.priority);t.splice(r+1,0,e)}function jn(t,e){for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1}var ol=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(d){try{h(n.next(d))}catch(y){o(y)}}function l(d){try{h(n.throw(d))}catch(y){o(y)}}function h(d){d.done?i(d.value):s(d.value).then(u,l)}h((n=n.apply(t,e||[])).next())})};class al{constructor(e){this._semaphore=new sl(1,e)}acquire(){return ol(this,arguments,void 0,function*(e=0){const[,r]=yield this._semaphore.acquire(1,e);return r})}runExclusive(e,r=0){return this._semaphore.runExclusive(()=>e(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class Un extends al{constructor(e){super(),Object.assign(this,e)}}const ul=t=>new Un(t),ll=Object.freeze(Object.defineProperty({__proto__:null,mutex:Un,newMutex:ul},Symbol.toStringTag,{value:"Module"})),cl=(...t)=>t.map(Bn).join(""),Bn=t=>(t.endsWith("/")||(t+="/"),t.startsWith("/")&&(t=t.slice(1)),t),hl=t=>t.endsWith("/")?t.slice(0,-1):t;class Le{protocol;host;port;path;constructor({host:e,port:r,protocol:n="",pathPrefix:s=""}){this.protocol=n,this.host=e,this.port=r,this.path=Bn(s)}replace(e){return new Le({host:e.host??this.host,port:e.port??this.port,protocol:e.protocol??this.protocol,pathPrefix:e.pathPrefix??this.path})}child(e){return new Le({...this,pathPrefix:cl(this.path,e)})}toString(){return hl(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}static UNKNOWN=new Le({host:"unknown",port:0})}class fl{sender;handlers;constructor(e){this.sender=e,this.handlers=new Map}handle({data:e}){const r=this.handlers.get(e.type)?.handler;r==null?console.warn(`No handler for ${e.type}`):r(e.payload)}route(e){const r=dl(e,this.sender),n=new gl(r);return this.handlers.set(e,n),n}}const dl=(t,e)=>(r,n)=>e({type:t,payload:r},n);class gl{_send;handler;constructor(e){this._send=e,this.handler=null}send(e,r=[]){this._send(e,r)}handle(e){this.handler=e}}const pl=t=>t.nullable().transform(e=>e===null?void 0:e).optional(),yl=a.z.int().min(0).max(Nr),ml=t=>a.array(t).or(t.transform(e=>[e])),$n=t=>vn(t,(e,r,n)=>{const s=r===n.length-1,i=!isNaN(parseInt(e)),o=!isNaN(parseInt(n[r+1]));return i&&(e="element"),s||o?e:[e,"shape"]}),ur=(t,e)=>{if(t==null)return null;const r=t[e];return r==null&&typeof t=="object"&&"sourceType"in t?t.sourceType()[e]:r},bl=((t,e,r)=>e===""?t:Kt(ur(t,"shape"),$n(e),{...r,getter:ur})),wl=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:bl,getFieldSchemaPath:$n,nullToUndefined:pl,toArray:ml,uint12:yl},Symbol.toStringTag,{value:"Module"}));function Cn(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=Cn(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Rn(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Cn(t))&&(n&&(n+=" "),n+=e);return n}const Ol=Rn,se="-",lr="__",je="--",Ln=t=>{const e=(...r)=>Ol(...r);return e.B=(...r)=>t+se+r.join(se),e.E=r=>t+lr+r,e.M=(...r)=>t+je+r.join("-"),e.BM=(r,...n)=>e.B(r)+je+n.join("-"),e.BE=(r,...n)=>e.B(r)+lr+n.join(se),e.BEM=(r,n,...s)=>e.BE(r,n)+je+s.join(se),e.var=(...r)=>je+t+se+r.join(se),e};class vl{rows=[];columns=[];prefix;constructor(e=""){this.prefix=e}row(e,r,n){const{prefix:s}=this;return this.rows.push({startLabel:s+e,endLabel:s+r,size:n}),this}col(e,r,n){const{prefix:s}=this;return this.columns.push({startLabel:s+e,endLabel:s+r,size:n}),this}build(){return{display:"grid",gridTemplateRows:this.rows.map((e,r)=>{let n=r===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=r===this.rows.length-1?"]":"",n}).join(" "),gridTemplateColumns:this.columns.map((e,r)=>{let n=r===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=r===this.columns.length-1?"]":"",n}).join(" ")}}}const Tl=(t,e)=>Object.entries(e).forEach(([r,n])=>n!=null&&t.style.setProperty(r,`${n}`)),xl=(t,e)=>Array.from(t.style).forEach(r=>{r.startsWith(e)&&t.style.removeProperty(r)}),Sl=t=>{const e=Ln(t);return e.visible=r=>e.M(r?"visible":"hidden"),e.expanded=r=>e.M(r?"expanded":"collapsed"),e.loc=r=>e.M("location",Dr.construct(r)),e.disabled=r=>r===!0&&e.M("disabled"),e.align=r=>e.M(r),e.dir=r=>r!=null&&e.M("direction",Lr.construct(r)),e.sharp=r=>r!==!1&&e.M("sharp"),e.rounded=r=>r!==!1&&e.M("rounded"),e.bordered=r=>typeof r=="boolean"?r&&e.M("bordered"):r!=null?e.M(`bordered-${r.toString()}`):e.M("bordered"),e.selected=r=>r&&e.M("selected"),e.altColor=r=>r&&e.M("alt-color"),e.editable=r=>r&&e.M("editable"),e.noSelect=e.M("no-select"),e.applyVars=Tl,e.removeVars=xl,e.newGridBuilder=r=>new vl(r),e.dropRegion=r=>r&&e.B("haul-drop-region"),e.px=r=>`${r}px`,e.inheritDims=(r=!0)=>r&&e.M("inherit-dims"),e.shade=(r=>r!=null&&e.M(`shade-${r}`)),e.colorVar=r=>{if(!(r==null||r===!1))return typeof r=="number"?`var(--${t}-gray-l${r})`:dn.cssString(r)},e.levelSizeVar=r=>`var(--${t}-${r}-size)`,e.level=r=>e.M(`level-${r}`),e},Nl=Sl("pluto");exports.$=z;exports.$u=Fo;exports.Au=Co;exports.CSS=Nl;exports.Du=Ou;exports.Hu=gu;exports.Io=Qr;exports.Iu=Dr;exports.Ju=xu;exports.Lu=Fa;exports.Mu=Io;exports.Nu=Pi;exports.Ou=si;exports.Pu=dn;exports.Qu=ju;exports.S=I;exports.Su=Po;exports.Uu=ra;exports.Xu=Iu;exports.Zu=Ya;exports._u=Va;exports.clsx=Rn;exports.d=f;exports.el=qu;exports.f=c;exports.fu=Jn;exports.g=g;exports.gu=es;exports.hu=Kn;exports.il=ll;exports.ju=la;exports.ln=fl;exports.lu=qn;exports.mu=cs;exports.newBEM=Ln;exports.nl=Fu;exports.p=m;exports.pu=gs;exports.q=L;exports.qu=tu;exports.rl=Xu;exports.sl=tl;exports.tl=ku;exports.ul=wl;exports.vu=po;exports.wu=_s;exports.x=b;exports.xu=Lr;exports.yu=rs;
8
+ `),s;try{return r!=null?r.parse(h):h}catch(f){return console.log(`${t} failed to parse default. Exiting with default`),console.error(f),s}};const o=Object.keys(e).length;let u=!1;const l=h=>{try{if(o===0||Nn(h.version,i))return console.log(u?`${t} ${h.version} now up to date`:`${t} version ${h.version} is up to date with target version ${s.version}`),h;const f=h.version,y=e[f],p=y(h);return u=!0,l(p)}catch(f){return console.log(`${t} failed to migrate from ${h.version} to ${i}`),console.error(f),s}};return h=>{try{if(h.version==null)if(n!=null)console.log(`${t} version is null. Setting version to default of ${n}`),h.version=n;else return console.log(`${t} version is null and no default version set. Exiting with default`),s;return l(h)}catch(f){return console.log(`${t} failed to parse final result. Exiting with default`),console.error(f),s}}},vu=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:Ie,createMigration:wu,migrator:Ou,semVerNewer:Nn,semVerOlder:bu,semVerZ:xt,versionsEqual:mu},Symbol.toStringTag,{value:"Module"})),In=["standard","scientific","engineering"],Tu=a.z.enum(In),xu=(t,e,r)=>{if(Number.isNaN(t))return"NaN";if(t===1/0)return"∞";if(t===-1/0)return"-∞";if(r==="standard")return t.toFixed(e);if(t===0)return e===0?"0ᴇ0":`0.${"0".repeat(e)}ᴇ0`;let n;return r==="scientific"?n=Math.floor(Math.log10(Math.abs(t))):n=Math.floor(Math.log10(Math.abs(t))/3)*3,`${(t/10**n).toFixed(e)}ᴇ${n}`},Su=Object.freeze(Object.defineProperty({__proto__:null,NOTATIONS:In,notationZ:Tu,stringifyNumber:xu},Symbol.toStringTag,{value:"Module"}));class Nu{handlers;transform;closer;constructor(e,r){this.transform=e,this.handlers=r??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){let r=e;if(this.transform!=null){const[n,s]=this.transform(e);if(!s)return;r=n}this.handlers.forEach((n,s)=>s(r))}setCloser(e){this.closer=e}async close(){return await this.closer?.()}}class Iu{handlers;constructor(e){this.handlers=e??new Map}onChange(e){return this.handlers.set(e,null),()=>this.handlers.delete(e)}notify(e){this.handlers.forEach((r,n)=>n(e))}}const Mu=Object.freeze(Object.defineProperty({__proto__:null,BaseObserver:Iu,Observer:Nu},Symbol.toStringTag,{value:"Module"})),Mn=a.z.union([a.z.string(),a.z.number()]),Au=a.z.record(Mn,a.z.unknown()),Qt=t=>Object.entries(t),zu=(t,e)=>Object.fromEntries(Qt(t).map(([r,n])=>[r,e(n,r)])),Eu=t=>Object.fromEntries(Qt(t).filter(([e,r])=>r!==void 0)),ju=(t,...e)=>{const r={...t};for(const n of e)delete r[n];return r},Uu=Object.freeze(Object.defineProperty({__proto__:null,entries:Qt,keyZ:Mn,map:zu,omit:ju,purgeUndefined:Eu,unknownZ:Au},Symbol.toStringTag,{value:"Module"})),An=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",Bu=An(),zn=["macOS","Windows","Linux"],$u=["macos","windows","linux"],Cu={macos:"macOS",windows:"Windows",linux:"Linux"},Ru=a.z.enum(zn).or(a.z.enum($u).transform(t=>Cu[t])),Lu=()=>{if(typeof window>"u")return;const t=window.navigator.userAgent.toLowerCase();if(t.includes("mac"))return"macOS";if(t.includes("win"))return"Windows";if(t.includes("linux"))return"Linux"};let st;const ku=((t={})=>{const{force:e,default:r}=t;return e??st??(st=Lu(),st??r)}),Du=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:zn,RUNTIME:Bu,detect:An,getOS:ku,osZ:Ru},Symbol.toStringTag,{value:"Module"})),Pu=()=>Promise.resolve(),qu=()=>new Promise(t=>setTimeout(t,0)),Zu=Object.freeze(Object.defineProperty({__proto__:null,flushMicrotasks:Pu,flushTaskQueue:qu},Symbol.toStringTag,{value:"Module"})),Fu=t=>Array.isArray(t)?[...t]:typeof t=="object"&&t!==null?{...t}:t,Yu=Object.freeze(Object.defineProperty({__proto__:null,copy:Fu},Symbol.toStringTag,{value:"Module"})),En=a.z.enum(["success","info","warning","error","loading","disabled"]),Vu=t=>a.z.object({key:a.z.string(),name:a.z.string().default(""),variant:En,message:a.z.string(),description:a.z.string().optional(),time:d.z,labels:cr(du).optional(),details:t??a.z.unknown().optional()}),Wu=a.z.object({stack:a.z.string(),error:a.z.instanceof(Error)}),Gu=(t,e)=>{if(!(t instanceof Error))throw t;return jn({variant:"error",message:e??t.message,description:e!=null?t.message:void 0,details:{stack:t.stack??"",error:t}})},jn=t=>({key:It(),time:d.now(),name:"",...t}),Hu=(t,e=[])=>{if(t!=null)return Array.isArray(e)?e.includes(t)?t:void 0:e===t?t:void 0},Xu=(t,e=[])=>{if(t!=null)return Array.isArray(e)?e.includes(t)?void 0:t:e===t?void 0:t},Ju=Object.freeze(Object.defineProperty({__proto__:null,create:jn,exceptionDetailsSchema:Wu,fromException:Gu,keepVariants:Hu,removeVariants:Xu,statusZ:Vu,variantZ:En},Symbol.toStringTag,{value:"Module"})),Ku=(t,e)=>{if(!e.has(t))return t;let r=t,n=1,s=t;for(;e.has(s);){const i=s.match(Qu);i?(r=s.slice(0,i.index).trim(),n=parseInt(i[1])+1):(r=s,n=1),s=`${r} (${n})`}return s},Qu=/\((\d+)\)$/,_u=(t,e="")=>{if(typeof t=="string")return t;const r=t.length;return r===0?e:r===1?t[0]:r===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[r-1]}`},el=t=>{const e=t.split(" "),r=new Set,n=e.map(o=>o.charAt(0).toLowerCase()).join("");r.add(n.replace(/-/g,"_")),r.add(n.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"));const s=/\d+/g;t.match(s)&&e.forEach((o,u)=>{if(s.test(o)){const l=e.map((h,f)=>f!==u?h.charAt(0).toLowerCase():h).join("");r.add(l.replace(/-/g,"_")),r.add(l.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"))}});const i=e.map(o=>(o.length>3?o.substring(0,3):o).toLowerCase());return r.add(i.join("").replace(/-/g,"_")),r.add(i.join("_").replace(/-/g,"_")),Array.from(r).filter(o=>o.length>=2&&o.length<=12&&!/^\d/.test(o))},tl=(t,e)=>t.startsWith(e)?t.slice(e.length):t,rl=Object.freeze(Object.defineProperty({__proto__:null,createShortIdentifiers:el,deduplicateFileName:Ku,naturalLanguageJoin:_u,trimPrefix:tl},Symbol.toStringTag,{value:"Module"})),nl=new Error("request for lock canceled");var sl=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(f){try{h(n.next(f))}catch(y){o(y)}}function l(f){try{h(n.throw(f))}catch(y){o(y)}}function h(f){f.done?i(f.value):s(f.value).then(u,l)}h((n=n.apply(t,e||[])).next())})};class il{constructor(e,r=nl){this._value=e,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,s)=>{const i={resolve:n,reject:s,weight:e,priority:r},o=Un(this._queue,u=>r<=u.priority);o===-1&&e<=this._value?this._dispatchItem(i):this._queue.splice(o+1,0,i)})}runExclusive(e){return sl(this,arguments,void 0,function*(r,n=1,s=0){const[i,o]=yield this.acquire(n,s);try{return yield r(i)}finally{o()}})}waitForUnlock(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,r)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),ol(this._weightedWaiters[e-1],{resolve:n,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const r=this._value;this._value-=e.weight,e.resolve([r,this._newReleaser(e.weight)])}_newReleaser(e){let r=!1;return()=>{r||(r=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const r=this._weightedWaiters[e-1];r&&(r.forEach(n=>n.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let r=this._value;r>0;r--){const n=this._weightedWaiters[r-1];if(!n)continue;const s=n.findIndex(i=>i.priority<=e);(s===-1?n:n.splice(0,s)).forEach((i=>i.resolve()))}}}_couldLockImmediately(e,r){return(this._queue.length===0||this._queue[0].priority<r)&&e<=this._value}}function ol(t,e){const r=Un(t,n=>e.priority<=n.priority);t.splice(r+1,0,e)}function Un(t,e){for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1}var al=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function u(f){try{h(n.next(f))}catch(y){o(y)}}function l(f){try{h(n.throw(f))}catch(y){o(y)}}function h(f){f.done?i(f.value):s(f.value).then(u,l)}h((n=n.apply(t,e||[])).next())})};class ul{constructor(e){this._semaphore=new il(1,e)}acquire(){return al(this,arguments,void 0,function*(e=0){const[,r]=yield this._semaphore.acquire(1,e);return r})}runExclusive(e,r=0){return this._semaphore.runExclusive(()=>e(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class Bn extends ul{constructor(e){super(),Object.assign(this,e)}}const ll=t=>new Bn(t),cl=Object.freeze(Object.defineProperty({__proto__:null,mutex:Bn,newMutex:ll},Symbol.toStringTag,{value:"Module"})),hl=(...t)=>t.map($n).join(""),$n=t=>(t.endsWith("/")||(t+="/"),t.startsWith("/")&&(t=t.slice(1)),t),fl=t=>t.endsWith("/")?t.slice(0,-1):t;class Le{protocol;host;port;path;constructor({host:e,port:r,protocol:n="",pathPrefix:s=""}){this.protocol=n,this.host=e,this.port=r,this.path=$n(s)}replace(e){return new Le({host:e.host??this.host,port:e.port??this.port,protocol:e.protocol??this.protocol,pathPrefix:e.pathPrefix??this.path})}child(e){return new Le({...this,pathPrefix:hl(this.path,e)})}toString(){return fl(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}static UNKNOWN=new Le({host:"unknown",port:0})}class dl{sender;handlers;constructor(e){this.sender=e,this.handlers=new Map}handle({data:e}){const r=this.handlers.get(e.type)?.handler;r==null?console.warn(`No handler for ${e.type}`):r(e.payload)}route(e){const r=gl(e,this.sender),n=new pl(r);return this.handlers.set(e,n),n}}const gl=(t,e)=>(r,n)=>e({type:t,payload:r},n);class pl{_send;handler;constructor(e){this._send=e,this.handler=null}send(e,r=[]){this._send(e,r)}handle(e){this.handler=e}}const yl=t=>t.nullable().transform(e=>e===null?void 0:e).optional(),ml=a.z.int().min(0).max(Nr),bl=t=>a.array(t).or(t.transform(e=>[e])),wl=t=>t._zod.def.output,Cn=t=>vn(t,(e,r,n)=>{const s=r===n.length-1,i=!isNaN(parseInt(e)),o=!isNaN(parseInt(n[r+1]));return i&&(e="element"),s||o?e:[e,"shape"]}),ur=(t,e)=>{if(t==null)return null;const r=t[e];return r==null&&typeof t=="object"&&"sourceType"in t?t.sourceType()[e]:r},Ol=((t,e,r)=>e===""?t:Kt(ur(t,"shape"),Cn(e),{...r,getter:ur})),vl=Object.freeze(Object.defineProperty({__proto__:null,functionOutput:wl,getFieldSchema:Ol,getFieldSchemaPath:Cn,nullToUndefined:yl,toArray:bl,uint12:ml},Symbol.toStringTag,{value:"Module"}));function Rn(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=Rn(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Ln(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Rn(t))&&(n&&(n+=" "),n+=e);return n}const Tl=Ln,se="-",lr="__",je="--",kn=t=>{const e=(...r)=>Tl(...r);return e.B=(...r)=>t+se+r.join(se),e.E=r=>t+lr+r,e.M=(...r)=>t+je+r.join("-"),e.BM=(r,...n)=>e.B(r)+je+n.join("-"),e.BE=(r,...n)=>e.B(r)+lr+n.join(se),e.BEM=(r,n,...s)=>e.BE(r,n)+je+s.join(se),e.var=(...r)=>je+t+se+r.join(se),e};class xl{rows=[];columns=[];prefix;constructor(e=""){this.prefix=e}row(e,r,n){const{prefix:s}=this;return this.rows.push({startLabel:s+e,endLabel:s+r,size:n}),this}col(e,r,n){const{prefix:s}=this;return this.columns.push({startLabel:s+e,endLabel:s+r,size:n}),this}build(){return{display:"grid",gridTemplateRows:this.rows.map((e,r)=>{let n=r===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=r===this.rows.length-1?"]":"",n}).join(" "),gridTemplateColumns:this.columns.map((e,r)=>{let n=r===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=r===this.columns.length-1?"]":"",n}).join(" ")}}}const Sl=(t,e)=>Object.entries(e).forEach(([r,n])=>n!=null&&t.style.setProperty(r,`${n}`)),Nl=(t,e)=>Array.from(t.style).forEach(r=>{r.startsWith(e)&&t.style.removeProperty(r)}),Il=t=>{const e=kn(t);return e.visible=r=>e.M(r?"visible":"hidden"),e.expanded=r=>e.M(r?"expanded":"collapsed"),e.loc=r=>e.M("location",Dr.construct(r)),e.disabled=r=>r===!0&&e.M("disabled"),e.align=r=>e.M(r),e.dir=r=>r!=null&&e.M("direction",Lr.construct(r)),e.sharp=r=>r!==!1&&e.M("sharp"),e.rounded=r=>r!==!1&&e.M("rounded"),e.bordered=r=>typeof r=="boolean"?r&&e.M("bordered"):r!=null?e.M(`bordered-${r.toString()}`):e.M("bordered"),e.selected=r=>r&&e.M("selected"),e.altColor=r=>r&&e.M("alt-color"),e.editable=r=>r&&e.M("editable"),e.noSelect=e.M("no-select"),e.applyVars=Sl,e.removeVars=Nl,e.newGridBuilder=r=>new xl(r),e.dropRegion=r=>r&&e.B("haul-drop-region"),e.px=r=>`${r}px`,e.inheritDims=(r=!0)=>r&&e.M("inherit-dims"),e.shade=(r=>r!=null&&e.M(`shade-${r}`)),e.colorVar=r=>{if(!(r==null||r===!1))return typeof r=="number"?`var(--${t}-gray-l${r})`:dn.cssString(r)},e.levelSizeVar=r=>`var(--${t}-${r}-size)`,e.level=r=>e.M(`level-${r}`),e},Ml=Il("pluto");exports.$=z;exports.Au=qi;exports.Bu=na;exports.CSS=Ml;exports.Cu=Yo;exports.E=N;exports.Eu=yo;exports.Fu=Va;exports.Iu=ei;exports.Ku=vu;exports.Mu=Dr;exports.Nu=ii;exports.Ou=ps;exports.Qu=Su;exports.Ru=ca;exports.Su=Mo;exports.Tu=Ro;exports.Uu=qo;exports.Vu=ru;exports.Xu=pu;exports.Zu=dn;exports._u=Ya;exports.al=cl;exports.bu=ns;exports.cl=rl;exports.clsx=Ln;exports.d=d;exports.du=Zn;exports.f=c;exports.fn=dl;exports.g=g;exports.gu=Kn;exports.hl=vl;exports.il=Yu;exports.newBEM=kn;exports.nl=Uu;exports.ol=Ju;exports.p=m;exports.pu=ts;exports.q=L;exports.rl=Du;exports.sl=Zu;exports.tl=Mu;exports.vo=Qr;exports.vu=Lr;exports.wu=hs;exports.x=b;exports.yu=Qn;exports.zu=Wa;
package/dist/css.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./css-BVgFAmaj.cjs"),t=require("./units-InoNiVrK.cjs");exports.CSS=e.CSS;exports.newBEM=e.newBEM;exports.createHexOpacityVariants=t.createHexOpacityVariants;exports.unitProperty=t.unitProperty;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./css-D3NdC2sx.cjs"),t=require("./units-Bd_mf9Ye.cjs");exports.CSS=e.CSS;exports.newBEM=e.newBEM;exports.createHexOpacityVariants=t.createHexOpacityVariants;exports.unitProperty=t.unitProperty;
package/dist/css.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as e, n as t } from "./css-bahPRiQI.js";
2
- import { c as s, u as n } from "./units-CgMHbHoA.js";
1
+ import { C as e, n as t } from "./css-BkBrZtKZ.js";
2
+ import { c as s, u as n } from "./units-CEfK1L7C.js";
3
3
  export {
4
4
  e as CSS,
5
5
  s as createHexOpacityVariants,
package/dist/dialog.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-Bixqkw5N.cjs");exports.Dialog=e.external;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-BIW55htp.cjs");exports.Dialog=e.external;
package/dist/dialog.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e } from "./external-m-0q-0os.js";
1
+ import { e } from "./external-6HkYP0wd.js";
2
2
  export {
3
3
  e as Dialog
4
4
  };
@@ -1 +1 @@
1
- "use strict";const i=require("./css-BVgFAmaj.cjs");let e=null;const u=()=>(e??=document.createElement("canvas"),e),c=(t,a,n)=>{if(i.tl.RUNTIME==="node")return{width:0,height:0};n??=u().getContext("2d"),n.font=a;const o=n.measureText(t);return s(o)},s=t=>({width:Math.trunc(Math.abs(t.actualBoundingBoxLeft)+Math.abs(t.actualBoundingBoxRight)),height:Math.trunc(Math.abs(t.actualBoundingBoxAscent)+Math.abs(t.actualBoundingBoxDescent))});exports.dimensions=c;exports.dimensionsFromMetrics=s;
1
+ "use strict";const i=require("./css-D3NdC2sx.cjs");let e=null;const u=()=>(e??=document.createElement("canvas"),e),c=(t,a,n)=>{if(i.rl.RUNTIME==="node")return{width:0,height:0};n??=u().getContext("2d"),n.font=a;const o=n.measureText(t);return s(o)},s=t=>({width:Math.trunc(Math.abs(t.actualBoundingBoxLeft)+Math.abs(t.actualBoundingBoxRight)),height:Math.trunc(Math.abs(t.actualBoundingBoxAscent)+Math.abs(t.actualBoundingBoxDescent))});exports.dimensions=c;exports.dimensionsFromMetrics=s;
@@ -1,11 +1,11 @@
1
- import { t as s } from "./css-bahPRiQI.js";
1
+ import { r as s } from "./css-BkBrZtKZ.js";
2
2
  let n = null;
3
- const u = () => (n ??= document.createElement("canvas"), n), h = (t, e, a) => {
3
+ const u = () => (n ??= document.createElement("canvas"), n), c = (t, e, a) => {
4
4
  if (s.RUNTIME === "node") return { width: 0, height: 0 };
5
5
  a ??= u().getContext("2d"), a.font = e;
6
6
  const o = a.measureText(t);
7
- return i(o);
8
- }, i = (t) => ({
7
+ return r(o);
8
+ }, r = (t) => ({
9
9
  width: Math.trunc(
10
10
  Math.abs(t.actualBoundingBoxLeft) + Math.abs(t.actualBoundingBoxRight)
11
11
  ),
@@ -14,6 +14,6 @@ const u = () => (n ??= document.createElement("canvas"), n), h = (t, e, a) => {
14
14
  )
15
15
  });
16
16
  export {
17
- i as a,
18
- h as d
17
+ r as a,
18
+ c as d
19
19
  };