@synnaxlabs/pluto 0.43.1 → 0.44.1

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 (952) hide show
  1. package/dist/Animated-3QNTHym1.cjs +1 -0
  2. package/dist/Animated-KCUNFDvN.js +27 -0
  3. package/dist/Menu-BFD8DPDp.js +61 -0
  4. package/dist/Menu-BPH8apK8.cjs +1 -0
  5. package/dist/Toggle-1E6vrl6G.js +26 -0
  6. package/dist/Toggle-BHiPL61M.cjs +1 -0
  7. package/dist/{Video-BuzHLiXL.cjs → Video-BidrtYj_.cjs} +1 -1
  8. package/dist/{Video-Bq_WSdfc.js → Video-Cm8ZBqid.js} +1 -1
  9. package/dist/button.cjs +1 -1
  10. package/dist/button.js +1 -1
  11. package/dist/color.cjs +1 -1
  12. package/dist/color.js +1 -1
  13. package/dist/css-9yccD6t_.cjs +8 -0
  14. package/dist/css-Dl9aM7Jz.js +4337 -0
  15. package/dist/css.cjs +1 -1
  16. package/dist/css.js +5 -11
  17. package/dist/dialog.cjs +1 -0
  18. package/dist/dialog.js +4 -0
  19. package/dist/eraser-CLWNvWDn.cjs +63 -0
  20. package/dist/eraser-CZknVTjw.js +13325 -0
  21. package/dist/ether.cjs +1 -1
  22. package/dist/ether.js +46 -47
  23. package/dist/external-5PfK-PF3.js +75 -0
  24. package/dist/external-B16icDUE.js +69 -0
  25. package/dist/external-B1mnn7_J.js +30 -0
  26. package/dist/external-BDFD5v83.cjs +1 -0
  27. package/dist/external-BgZRkFq4.js +10 -0
  28. package/dist/external-BmaCxlPM.js +43 -0
  29. package/dist/external-Bmv3JTk3.cjs +1 -0
  30. package/dist/external-Bx2Al5fy.js +82 -0
  31. package/dist/external-Bx2weRCW.cjs +1 -0
  32. package/dist/external-BzGhOwHW.js +319 -0
  33. package/dist/external-CKvxjJs5.cjs +1 -0
  34. package/dist/external-CtwEvFYE.cjs +1 -0
  35. package/dist/external-DF7sP0pe.cjs +1 -0
  36. package/dist/external-DIE22vag.js +375 -0
  37. package/dist/external-DIRuVzOZ.cjs +1 -0
  38. package/dist/external-DJ4pzZBh.cjs +1 -0
  39. package/dist/external-DMB49R_H.cjs +1 -0
  40. package/dist/external-DPN-ziJs.js +25 -0
  41. package/dist/external-DRcsXa_0.cjs +46 -0
  42. package/dist/external-DTzGaj9d.js +69 -0
  43. package/dist/external-DWSWz3Rk.js +42 -0
  44. package/dist/external-Dr5azzr8.cjs +1 -0
  45. package/dist/external-R1cRWCTB.js +126 -0
  46. package/dist/external-T7fQRFNS.cjs +1 -0
  47. package/dist/{external-69bqTAcN.js → external-k23HUvy8.js} +2058 -2056
  48. package/dist/external-lMAel8Te.cjs +1 -0
  49. package/dist/flex.cjs +1 -0
  50. package/dist/flex.js +4 -0
  51. package/dist/{fontString-ap-NPnCD.js → fontString-Bm52S4Lo.js} +12 -13
  52. package/dist/fontString-BptzSQcY.cjs +1 -0
  53. package/dist/header.cjs +1 -1
  54. package/dist/header.js +1 -1
  55. package/dist/index.cjs +7 -7
  56. package/dist/index.js +12608 -11576
  57. package/dist/input.cjs +1 -1
  58. package/dist/input.js +1 -1
  59. package/dist/list.cjs +1 -1
  60. package/dist/list.js +1 -1
  61. package/dist/menu.cjs +1 -1
  62. package/dist/menu.js +1 -1
  63. package/dist/pluto.css +1 -1
  64. package/dist/provider-BhLG7kqF.js +6031 -0
  65. package/dist/provider-DVZt686Q.cjs +53 -0
  66. package/dist/src/aether/aether/aether.d.ts +11 -5
  67. package/dist/src/aether/aether/aether.d.ts.map +1 -1
  68. package/dist/src/aether/aether/aether.spec.d.ts +1 -1
  69. package/dist/src/aether/aether/aether.spec.d.ts.map +1 -1
  70. package/dist/src/aether/main.d.ts +2 -2
  71. package/dist/src/aether/main.d.ts.map +1 -1
  72. package/dist/src/aether/main.spec.d.ts +1 -1
  73. package/dist/src/aether/main.spec.d.ts.map +1 -1
  74. package/dist/src/alamos/aether/alamos.d.ts +1 -1
  75. package/dist/src/alamos/aether/alamos.d.ts.map +1 -1
  76. package/dist/src/breadcrumb/Breadcrumb.d.ts +15 -42
  77. package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
  78. package/dist/src/button/Button.d.ts +16 -32
  79. package/dist/src/button/Button.d.ts.map +1 -1
  80. package/dist/src/button/Toggle.d.ts +3 -36
  81. package/dist/src/button/Toggle.d.ts.map +1 -1
  82. package/dist/src/button/external.d.ts +0 -2
  83. package/dist/src/button/external.d.ts.map +1 -1
  84. package/dist/src/caret/Animated.d.ts +2 -2
  85. package/dist/src/caret/Animated.d.ts.map +1 -1
  86. package/dist/src/channel/AliasContext.d.ts +19 -0
  87. package/dist/src/channel/AliasContext.d.ts.map +1 -0
  88. package/dist/src/channel/AliasInput.d.ts +9 -0
  89. package/dist/src/channel/AliasInput.d.ts.map +1 -0
  90. package/dist/src/channel/AliasProvider.d.ts +1 -19
  91. package/dist/src/channel/AliasProvider.d.ts.map +1 -1
  92. package/dist/src/channel/Select.d.ts +9 -11
  93. package/dist/src/channel/Select.d.ts.map +1 -1
  94. package/dist/src/channel/external.d.ts +3 -0
  95. package/dist/src/channel/external.d.ts.map +1 -1
  96. package/dist/src/channel/queries.d.ts +69 -0
  97. package/dist/src/channel/queries.d.ts.map +1 -0
  98. package/dist/src/channel/queries.spec.d.ts +2 -0
  99. package/dist/src/channel/queries.spec.d.ts.map +1 -0
  100. package/dist/src/color/Picker.d.ts.map +1 -1
  101. package/dist/src/color/Provider.d.ts +2 -2
  102. package/dist/src/color/Provider.d.ts.map +1 -1
  103. package/dist/src/color/Swatch.d.ts +3 -3
  104. package/dist/src/color/Swatch.d.ts.map +1 -1
  105. package/dist/src/component/SelectSize.d.ts +7 -0
  106. package/dist/src/component/SelectSize.d.ts.map +1 -0
  107. package/dist/src/component/external.d.ts +5 -0
  108. package/dist/src/component/external.d.ts.map +1 -0
  109. package/dist/src/component/index.d.ts +2 -0
  110. package/dist/src/component/index.d.ts.map +1 -0
  111. package/dist/src/component/removeProps.d.ts.map +1 -0
  112. package/dist/src/component/removeProps.spec.d.ts.map +1 -0
  113. package/dist/src/{util → component}/renderProp.d.ts +1 -1
  114. package/dist/src/component/renderProp.d.ts.map +1 -0
  115. package/dist/src/component/size.d.ts +12 -0
  116. package/dist/src/component/size.d.ts.map +1 -0
  117. package/dist/src/css/bem.d.ts +6 -6
  118. package/dist/src/css/bem.d.ts.map +1 -1
  119. package/dist/src/css/css.d.ts +6 -6
  120. package/dist/src/css/css.d.ts.map +1 -1
  121. package/dist/src/css/units.d.ts +1 -1
  122. package/dist/src/css/units.d.ts.map +1 -1
  123. package/dist/src/dialog/Background.d.ts +8 -0
  124. package/dist/src/dialog/Background.d.ts.map +1 -0
  125. package/dist/src/dialog/Dialog.d.ts +6 -0
  126. package/dist/src/dialog/Dialog.d.ts.map +1 -0
  127. package/dist/src/dialog/Dialog.spec.d.ts +2 -0
  128. package/dist/src/dialog/Dialog.spec.d.ts.map +1 -0
  129. package/dist/src/dialog/Frame.d.ts +48 -0
  130. package/dist/src/dialog/Frame.d.ts.map +1 -0
  131. package/dist/src/dialog/Trigger.d.ts +7 -0
  132. package/dist/src/dialog/Trigger.d.ts.map +1 -0
  133. package/dist/src/dialog/external.d.ts +5 -0
  134. package/dist/src/dialog/external.d.ts.map +1 -0
  135. package/dist/src/dialog/index.d.ts +1 -1
  136. package/dist/src/dialog/index.d.ts.map +1 -1
  137. package/dist/src/dialog/position.d.ts +10 -0
  138. package/dist/src/dialog/position.d.ts.map +1 -0
  139. package/dist/src/direction/Select.d.ts +8 -0
  140. package/dist/src/direction/Select.d.ts.map +1 -0
  141. package/dist/src/direction/index.d.ts +2 -0
  142. package/dist/src/direction/index.d.ts.map +1 -0
  143. package/dist/src/divider/Divider.d.ts +4 -5
  144. package/dist/src/divider/Divider.d.ts.map +1 -1
  145. package/dist/src/flex/Box.d.ts +128 -0
  146. package/dist/src/flex/Box.d.ts.map +1 -0
  147. package/dist/src/flex/Box.spec.d.ts +2 -0
  148. package/dist/src/flex/Box.spec.d.ts.map +1 -0
  149. package/dist/src/flex/Select.d.ts +7 -0
  150. package/dist/src/flex/Select.d.ts.map +1 -0
  151. package/dist/src/flex/external.d.ts +3 -0
  152. package/dist/src/flex/external.d.ts.map +1 -0
  153. package/dist/src/flex/index.d.ts +2 -0
  154. package/dist/src/flex/index.d.ts.map +1 -0
  155. package/dist/src/flux/Context.d.ts +4 -0
  156. package/dist/src/flux/Context.d.ts.map +1 -0
  157. package/dist/src/flux/Provider.d.ts +9 -0
  158. package/dist/src/flux/Provider.d.ts.map +1 -0
  159. package/dist/src/flux/aether/external.d.ts +5 -0
  160. package/dist/src/flux/aether/external.d.ts.map +1 -0
  161. package/dist/src/flux/aether/index.d.ts +2 -0
  162. package/dist/src/flux/aether/index.d.ts.map +1 -0
  163. package/dist/src/flux/aether/listeners.d.ts +16 -0
  164. package/dist/src/flux/aether/listeners.d.ts.map +1 -0
  165. package/dist/src/flux/aether/params.d.ts +31 -0
  166. package/dist/src/flux/aether/params.d.ts.map +1 -0
  167. package/dist/src/flux/aether/provider.d.ts +29 -0
  168. package/dist/src/flux/aether/provider.d.ts.map +1 -0
  169. package/dist/src/flux/aether/streamer.d.ts +22 -0
  170. package/dist/src/flux/aether/streamer.d.ts.map +1 -0
  171. package/dist/src/flux/aether/streamer.spec.d.ts +2 -0
  172. package/dist/src/flux/aether/streamer.spec.d.ts.map +1 -0
  173. package/dist/src/flux/aether/types.d.ts +13 -0
  174. package/dist/src/flux/aether/types.d.ts.map +1 -0
  175. package/dist/src/flux/external.d.ts +12 -0
  176. package/dist/src/flux/external.d.ts.map +1 -0
  177. package/dist/src/flux/form.d.ts +112 -0
  178. package/dist/src/flux/form.d.ts.map +1 -0
  179. package/dist/src/flux/form.spec.d.ts +2 -0
  180. package/dist/src/flux/form.spec.d.ts.map +1 -0
  181. package/dist/src/flux/index.d.ts +2 -0
  182. package/dist/src/flux/index.d.ts.map +1 -0
  183. package/dist/src/flux/list.d.ts +251 -0
  184. package/dist/src/flux/list.d.ts.map +1 -0
  185. package/dist/src/flux/list.spec.d.ts +2 -0
  186. package/dist/src/flux/list.spec.d.ts.map +1 -0
  187. package/dist/src/flux/listeners.d.ts +4 -0
  188. package/dist/src/flux/listeners.d.ts.map +1 -0
  189. package/dist/src/flux/listeners.spec.d.ts +2 -0
  190. package/dist/src/flux/listeners.spec.d.ts.map +1 -0
  191. package/dist/src/flux/result.d.ts +101 -0
  192. package/dist/src/flux/result.d.ts.map +1 -0
  193. package/dist/src/flux/result.spec.d.ts +2 -0
  194. package/dist/src/flux/result.spec.d.ts.map +1 -0
  195. package/dist/src/flux/retrieve.d.ts +213 -0
  196. package/dist/src/flux/retrieve.d.ts.map +1 -0
  197. package/dist/src/flux/retrieve.spec.d.ts +2 -0
  198. package/dist/src/flux/retrieve.spec.d.ts.map +1 -0
  199. package/dist/src/flux/update.d.ts +132 -0
  200. package/dist/src/flux/update.d.ts.map +1 -0
  201. package/dist/src/flux/update.spec.d.ts +2 -0
  202. package/dist/src/flux/update.spec.d.ts.map +1 -0
  203. package/dist/src/flux/useMountListeners.d.ts +7 -0
  204. package/dist/src/flux/useMountListeners.d.ts.map +1 -0
  205. package/dist/src/form/Context.d.ts +34 -0
  206. package/dist/src/form/Context.d.ts.map +1 -0
  207. package/dist/src/form/Field.d.ts +23 -27
  208. package/dist/src/form/Field.d.ts.map +1 -1
  209. package/dist/src/form/Form.d.ts +2 -173
  210. package/dist/src/form/Form.d.ts.map +1 -1
  211. package/dist/src/form/external.d.ts +3 -0
  212. package/dist/src/form/external.d.ts.map +1 -1
  213. package/dist/src/form/state.d.ts +53 -0
  214. package/dist/src/form/state.d.ts.map +1 -0
  215. package/dist/src/form/state.spec.d.ts +2 -0
  216. package/dist/src/form/state.spec.d.ts.map +1 -0
  217. package/dist/src/form/synced.d.ts +5 -4
  218. package/dist/src/form/synced.d.ts.map +1 -1
  219. package/dist/src/form/use.d.ts +24 -0
  220. package/dist/src/form/use.d.ts.map +1 -0
  221. package/dist/src/form/useField.d.ts +64 -0
  222. package/dist/src/form/useField.d.ts.map +1 -0
  223. package/dist/src/generic/Generic.d.ts +8 -3
  224. package/dist/src/generic/Generic.d.ts.map +1 -1
  225. package/dist/src/generic/Generic.spec.d.ts +2 -0
  226. package/dist/src/generic/Generic.spec.d.ts.map +1 -0
  227. package/dist/src/hardware/device/Select.d.ts +5 -7
  228. package/dist/src/hardware/device/Select.d.ts.map +1 -1
  229. package/dist/src/hardware/device/StatusIndicator.d.ts +8 -0
  230. package/dist/src/hardware/device/StatusIndicator.d.ts.map +1 -0
  231. package/dist/src/hardware/device/external.d.ts +4 -0
  232. package/dist/src/hardware/device/external.d.ts.map +1 -0
  233. package/dist/src/hardware/device/index.d.ts +1 -1
  234. package/dist/src/hardware/device/index.d.ts.map +1 -1
  235. package/dist/src/hardware/device/queries.d.ts +12 -0
  236. package/dist/src/hardware/device/queries.d.ts.map +1 -0
  237. package/dist/src/hardware/device/queries.spec.d.ts +2 -0
  238. package/dist/src/hardware/device/queries.spec.d.ts.map +1 -0
  239. package/dist/src/hardware/rack/Select.d.ts +6 -2
  240. package/dist/src/hardware/rack/Select.d.ts.map +1 -1
  241. package/dist/src/hardware/rack/StatusIndicator.d.ts +8 -0
  242. package/dist/src/hardware/rack/StatusIndicator.d.ts.map +1 -0
  243. package/dist/src/hardware/rack/external.d.ts +7 -0
  244. package/dist/src/hardware/rack/external.d.ts.map +1 -0
  245. package/dist/src/hardware/rack/index.d.ts +1 -1
  246. package/dist/src/hardware/rack/index.d.ts.map +1 -1
  247. package/dist/src/hardware/rack/queries.d.ts +10 -0
  248. package/dist/src/hardware/rack/queries.d.ts.map +1 -0
  249. package/dist/src/hardware/rack/queries.spec.d.ts +2 -0
  250. package/dist/src/hardware/rack/queries.spec.d.ts.map +1 -0
  251. package/dist/src/hardware/rack/synchronizers.d.ts +3 -0
  252. package/dist/src/hardware/rack/synchronizers.d.ts.map +1 -0
  253. package/dist/src/hardware/rack/use.d.ts +3 -0
  254. package/dist/src/hardware/rack/use.d.ts.map +1 -0
  255. package/dist/src/hardware/rack/useStatus.d.ts +3 -0
  256. package/dist/src/hardware/rack/useStatus.d.ts.map +1 -0
  257. package/dist/src/hardware/task/index.d.ts +2 -0
  258. package/dist/src/hardware/task/index.d.ts.map +1 -0
  259. package/dist/src/hardware/task/queries.d.ts +17 -0
  260. package/dist/src/hardware/task/queries.d.ts.map +1 -0
  261. package/dist/src/hardware/task/queries.spec.d.ts +2 -0
  262. package/dist/src/hardware/task/queries.spec.d.ts.map +1 -0
  263. package/dist/src/haul/Haul.d.ts +5 -4
  264. package/dist/src/haul/Haul.d.ts.map +1 -1
  265. package/dist/src/header/Actions.d.ts +4 -6
  266. package/dist/src/header/Actions.d.ts.map +1 -1
  267. package/dist/src/header/Header.d.ts +4 -3
  268. package/dist/src/header/Header.d.ts.map +1 -1
  269. package/dist/src/header/Title.d.ts +1 -1
  270. package/dist/src/header/Title.d.ts.map +1 -1
  271. package/dist/src/hooks/index.d.ts +3 -2
  272. package/dist/src/hooks/index.d.ts.map +1 -1
  273. package/dist/src/hooks/ref.d.ts +2 -2
  274. package/dist/src/hooks/ref.d.ts.map +1 -1
  275. package/dist/src/hooks/useAsyncEffect.d.ts +45 -0
  276. package/dist/src/hooks/useAsyncEffect.d.ts.map +1 -0
  277. package/dist/src/hooks/useAsyncEffect.spec.d.ts +2 -0
  278. package/dist/src/hooks/useAsyncEffect.spec.d.ts.map +1 -0
  279. package/dist/src/hooks/useEffectCompare.d.ts +3 -0
  280. package/dist/src/hooks/useEffectCompare.d.ts.map +1 -0
  281. package/dist/src/hooks/useRequiredContext.d.ts +1 -1
  282. package/dist/src/hooks/useRequiredContext.d.ts.map +1 -1
  283. package/dist/src/icon/Icon.d.ts +14 -16
  284. package/dist/src/icon/Icon.d.ts.map +1 -1
  285. package/dist/src/icon/external.d.ts +3 -0
  286. package/dist/src/icon/external.d.ts.map +1 -0
  287. package/dist/src/icon/index.d.ts +1 -1
  288. package/dist/src/icon/index.d.ts.map +1 -1
  289. package/dist/src/icon/registry.d.ts +206 -0
  290. package/dist/src/icon/registry.d.ts.map +1 -0
  291. package/dist/src/index.d.ts +7 -6
  292. package/dist/src/index.d.ts.map +1 -1
  293. package/dist/src/input/Boolean.d.ts +11 -0
  294. package/dist/src/input/Boolean.d.ts.map +1 -0
  295. package/dist/src/input/Checkbox.d.ts +17 -0
  296. package/dist/src/input/Checkbox.d.ts.map +1 -0
  297. package/dist/src/input/Date.d.ts +3 -3
  298. package/dist/src/input/Date.d.ts.map +1 -1
  299. package/dist/src/input/DateTime.d.ts +3 -2
  300. package/dist/src/input/DateTime.d.ts.map +1 -1
  301. package/dist/src/input/DragButton.d.ts +2 -2
  302. package/dist/src/input/DragButton.d.ts.map +1 -1
  303. package/dist/src/input/HelpText.d.ts +1 -1
  304. package/dist/src/input/HelpText.d.ts.map +1 -1
  305. package/dist/src/input/Item.d.ts +4 -4
  306. package/dist/src/input/Item.d.ts.map +1 -1
  307. package/dist/src/input/Numeric.d.ts +4 -4
  308. package/dist/src/input/Numeric.d.ts.map +1 -1
  309. package/dist/src/input/Switch.d.ts +4 -3
  310. package/dist/src/input/Switch.d.ts.map +1 -1
  311. package/dist/src/input/Text.d.ts +12 -9
  312. package/dist/src/input/Text.d.ts.map +1 -1
  313. package/dist/src/input/TextArea.d.ts +9 -5
  314. package/dist/src/input/TextArea.d.ts.map +1 -1
  315. package/dist/src/input/Time.d.ts +6 -5
  316. package/dist/src/input/Time.d.ts.map +1 -1
  317. package/dist/src/input/external.d.ts +1 -0
  318. package/dist/src/input/external.d.ts.map +1 -1
  319. package/dist/src/input/types.d.ts +7 -22
  320. package/dist/src/input/types.d.ts.map +1 -1
  321. package/dist/src/label/Select.d.ts +6 -5
  322. package/dist/src/label/Select.d.ts.map +1 -1
  323. package/dist/src/label/external.d.ts +1 -0
  324. package/dist/src/label/external.d.ts.map +1 -1
  325. package/dist/src/label/queries.d.ts +38 -0
  326. package/dist/src/label/queries.d.ts.map +1 -0
  327. package/dist/src/label/queries.spec.d.ts +2 -0
  328. package/dist/src/label/queries.spec.d.ts.map +1 -0
  329. package/dist/src/list/Frame.d.ts +33 -0
  330. package/dist/src/list/Frame.d.ts.map +1 -0
  331. package/dist/src/list/Item.d.ts +17 -7
  332. package/dist/src/list/Item.d.ts.map +1 -1
  333. package/dist/src/list/Items.d.ts +13 -0
  334. package/dist/src/list/Items.d.ts.map +1 -0
  335. package/dist/src/list/external.d.ts +6 -10
  336. package/dist/src/list/external.d.ts.map +1 -1
  337. package/dist/src/list/pager.d.ts +62 -0
  338. package/dist/src/list/pager.d.ts.map +1 -0
  339. package/dist/src/list/pager.spec.d.ts +2 -0
  340. package/dist/src/list/pager.spec.d.ts.map +1 -0
  341. package/dist/src/list/useKeysData.d.ts +7 -0
  342. package/dist/src/list/useKeysData.d.ts.map +1 -0
  343. package/dist/src/list/useKeysData.spec.d.ts +2 -0
  344. package/dist/src/list/useKeysData.spec.d.ts.map +1 -0
  345. package/dist/src/list/useMapData.d.ts +18 -0
  346. package/dist/src/list/useMapData.d.ts.map +1 -0
  347. package/dist/src/list/useMapData.spec.d.ts +2 -0
  348. package/dist/src/list/useMapData.spec.d.ts.map +1 -0
  349. package/dist/src/list/useStaticData.d.ts +19 -0
  350. package/dist/src/list/useStaticData.d.ts.map +1 -0
  351. package/dist/src/list/useStaticData.spec.d.ts +2 -0
  352. package/dist/src/list/useStaticData.spec.d.ts.map +1 -0
  353. package/dist/src/memo/useMemoCompare.d.ts +1 -1
  354. package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
  355. package/dist/src/menu/ContextMenu.d.ts +3 -3
  356. package/dist/src/menu/ContextMenu.d.ts.map +1 -1
  357. package/dist/src/menu/Item.d.ts +3 -28
  358. package/dist/src/menu/Item.d.ts.map +1 -1
  359. package/dist/src/menu/Menu.d.ts +6 -5
  360. package/dist/src/menu/Menu.d.ts.map +1 -1
  361. package/dist/src/mosaic/Mosaic.d.ts +2 -2
  362. package/dist/src/mosaic/Mosaic.d.ts.map +1 -1
  363. package/dist/src/mosaic/types.d.ts +1 -1
  364. package/dist/src/mosaic/types.d.ts.map +1 -1
  365. package/dist/src/nav/Bar.d.ts +3 -3
  366. package/dist/src/nav/Bar.d.ts.map +1 -1
  367. package/dist/src/notation/Select.d.ts +3 -3
  368. package/dist/src/notation/Select.d.ts.map +1 -1
  369. package/dist/src/note/Note.d.ts +2 -2
  370. package/dist/src/note/Note.d.ts.map +1 -1
  371. package/dist/src/observe/use.d.ts +0 -7
  372. package/dist/src/observe/use.d.ts.map +1 -1
  373. package/dist/src/ontology/external.d.ts +2 -0
  374. package/dist/src/ontology/external.d.ts.map +1 -0
  375. package/dist/src/ontology/index.d.ts +2 -0
  376. package/dist/src/ontology/index.d.ts.map +1 -0
  377. package/dist/src/ontology/queries.d.ts +27 -0
  378. package/dist/src/ontology/queries.d.ts.map +1 -0
  379. package/dist/src/ontology/queries.spec.d.ts +2 -0
  380. package/dist/src/ontology/queries.spec.d.ts.map +1 -0
  381. package/dist/src/os/Controls/Mac.d.ts.map +1 -1
  382. package/dist/src/os/Controls/Windows.d.ts +1 -1
  383. package/dist/src/os/Controls/Windows.d.ts.map +1 -1
  384. package/dist/src/os/Controls/types.d.ts +4 -4
  385. package/dist/src/os/Controls/types.d.ts.map +1 -1
  386. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  387. package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
  388. package/dist/src/ranger/Breadcrumb.d.ts +9 -0
  389. package/dist/src/ranger/Breadcrumb.d.ts.map +1 -0
  390. package/dist/src/ranger/Select.d.ts +13 -5
  391. package/dist/src/ranger/Select.d.ts.map +1 -1
  392. package/dist/src/ranger/TimeRangeChip.d.ts +3 -4
  393. package/dist/src/ranger/TimeRangeChip.d.ts.map +1 -1
  394. package/dist/src/ranger/external.d.ts +2 -1
  395. package/dist/src/ranger/external.d.ts.map +1 -1
  396. package/dist/src/ranger/queries.d.ts +97 -0
  397. package/dist/src/ranger/queries.d.ts.map +1 -0
  398. package/dist/src/ranger/queries.spec.d.ts +2 -0
  399. package/dist/src/ranger/queries.spec.d.ts.map +1 -0
  400. package/dist/src/resize/Core.d.ts +3 -3
  401. package/dist/src/resize/Core.d.ts.map +1 -1
  402. package/dist/src/resize/Multiple.d.ts +2 -2
  403. package/dist/src/resize/Multiple.d.ts.map +1 -1
  404. package/dist/src/select/Button.d.ts +10 -44
  405. package/dist/src/select/Button.d.ts.map +1 -1
  406. package/dist/src/select/Button.spec.d.ts +2 -0
  407. package/dist/src/select/Button.spec.d.ts.map +1 -0
  408. package/dist/src/select/Dialog.d.ts +16 -0
  409. package/dist/src/select/Dialog.d.ts.map +1 -0
  410. package/dist/src/select/Dialog.spec.d.ts +2 -0
  411. package/dist/src/select/Dialog.spec.d.ts.map +1 -0
  412. package/dist/src/select/Frame.d.ts +41 -0
  413. package/dist/src/select/Frame.d.ts.map +1 -0
  414. package/dist/src/select/ListItem.d.ts +6 -0
  415. package/dist/src/select/ListItem.d.ts.map +1 -0
  416. package/dist/src/select/Multiple.d.ts +16 -51
  417. package/dist/src/select/Multiple.d.ts.map +1 -1
  418. package/dist/src/select/Multiple.spec.d.ts +2 -0
  419. package/dist/src/select/Multiple.spec.d.ts.map +1 -0
  420. package/dist/src/select/MultipleTrigger.d.ts +24 -0
  421. package/dist/src/select/MultipleTrigger.d.ts.map +1 -0
  422. package/dist/src/select/SearchInput.d.ts +10 -0
  423. package/dist/src/select/SearchInput.d.ts.map +1 -0
  424. package/dist/src/select/Single.d.ts +15 -49
  425. package/dist/src/select/Single.d.ts.map +1 -1
  426. package/dist/src/select/Single.spec.d.ts +2 -0
  427. package/dist/src/select/Single.spec.d.ts.map +1 -0
  428. package/dist/src/select/SingleTrigger.d.ts +14 -0
  429. package/dist/src/select/SingleTrigger.d.ts.map +1 -0
  430. package/dist/src/select/Static.d.ts +12 -0
  431. package/dist/src/select/Static.d.ts.map +1 -0
  432. package/dist/src/select/Static.spec.d.ts +2 -0
  433. package/dist/src/select/Static.spec.d.ts.map +1 -0
  434. package/dist/src/select/external.d.ts +8 -4
  435. package/dist/src/select/external.d.ts.map +1 -1
  436. package/dist/src/select/text/Level.d.ts +2 -6
  437. package/dist/src/select/text/Level.d.ts.map +1 -1
  438. package/dist/src/select/text/Weight.d.ts +2 -6
  439. package/dist/src/select/text/Weight.d.ts.map +1 -1
  440. package/dist/src/select/use.d.ts +42 -0
  441. package/dist/src/select/use.d.ts.map +1 -0
  442. package/dist/src/select/use.spec.d.ts +2 -0
  443. package/dist/src/select/use.spec.d.ts.map +1 -0
  444. package/dist/src/select/useHover.d.ts +11 -0
  445. package/dist/src/select/useHover.d.ts.map +1 -0
  446. package/dist/src/select/useHover.spec.d.ts +2 -0
  447. package/dist/src/select/useHover.spec.d.ts.map +1 -0
  448. package/dist/src/select/variant.d.ts +6 -0
  449. package/dist/src/select/variant.d.ts.map +1 -0
  450. package/dist/src/showcase/BreadcrumbShowcase.d.ts +2 -0
  451. package/dist/src/showcase/BreadcrumbShowcase.d.ts.map +1 -0
  452. package/dist/src/showcase/ButtonShowcase.d.ts +2 -0
  453. package/dist/src/showcase/ButtonShowcase.d.ts.map +1 -0
  454. package/dist/src/showcase/DisplaySelector.d.ts +8 -0
  455. package/dist/src/showcase/DisplaySelector.d.ts.map +1 -0
  456. package/dist/src/showcase/DividerShowcase.d.ts +2 -0
  457. package/dist/src/showcase/DividerShowcase.d.ts.map +1 -0
  458. package/dist/src/showcase/FlexShowcase.d.ts +2 -0
  459. package/dist/src/showcase/FlexShowcase.d.ts.map +1 -0
  460. package/dist/src/showcase/HeaderShowcase.d.ts +2 -0
  461. package/dist/src/showcase/HeaderShowcase.d.ts.map +1 -0
  462. package/dist/src/showcase/InputShowcase.d.ts +19 -0
  463. package/dist/src/showcase/InputShowcase.d.ts.map +1 -0
  464. package/dist/src/showcase/MenuShowcase.d.ts +2 -0
  465. package/dist/src/showcase/MenuShowcase.d.ts.map +1 -0
  466. package/dist/src/showcase/NavShowcase.d.ts +2 -0
  467. package/dist/src/showcase/NavShowcase.d.ts.map +1 -0
  468. package/dist/src/showcase/NoteShowcase.d.ts +2 -0
  469. package/dist/src/showcase/NoteShowcase.d.ts.map +1 -0
  470. package/dist/src/showcase/SelectShowcase.d.ts +3 -0
  471. package/dist/src/showcase/SelectShowcase.d.ts.map +1 -0
  472. package/dist/src/showcase/Showcase.d.ts +2 -0
  473. package/dist/src/showcase/Showcase.d.ts.map +1 -0
  474. package/dist/src/showcase/SubcategorySection.d.ts +6 -0
  475. package/dist/src/showcase/SubcategorySection.d.ts.map +1 -0
  476. package/dist/src/showcase/TagShowcase.d.ts +2 -0
  477. package/dist/src/showcase/TagShowcase.d.ts.map +1 -0
  478. package/dist/src/showcase/TextShowcase.d.ts +2 -0
  479. package/dist/src/showcase/TextShowcase.d.ts.map +1 -0
  480. package/dist/src/showcase/constants.d.ts +8 -0
  481. package/dist/src/showcase/constants.d.ts.map +1 -0
  482. package/dist/src/showcase/index.d.ts +16 -0
  483. package/dist/src/showcase/index.d.ts.map +1 -0
  484. package/dist/src/state/state.d.ts +24 -24
  485. package/dist/src/state/state.d.ts.map +1 -1
  486. package/dist/src/status/Aggregator.d.ts +5 -5
  487. package/dist/src/status/Aggregator.d.ts.map +1 -1
  488. package/dist/src/status/Indicator.d.ts +2 -2
  489. package/dist/src/status/Indicator.d.ts.map +1 -1
  490. package/dist/src/status/Notification.d.ts +2 -2
  491. package/dist/src/status/Notification.d.ts.map +1 -1
  492. package/dist/src/status/Summary.d.ts +8 -0
  493. package/dist/src/status/Summary.d.ts.map +1 -0
  494. package/dist/src/status/aether/aggregator.d.ts +13 -30
  495. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  496. package/dist/src/status/aether/index.d.ts +1 -1
  497. package/dist/src/status/aether/index.d.ts.map +1 -1
  498. package/dist/src/status/external.d.ts +1 -2
  499. package/dist/src/status/external.d.ts.map +1 -1
  500. package/dist/src/steps/Steps.d.ts +2 -2
  501. package/dist/src/steps/Steps.d.ts.map +1 -1
  502. package/dist/src/store/index.d.ts +2 -0
  503. package/dist/src/store/index.d.ts.map +1 -0
  504. package/dist/src/store/store.d.ts +7 -0
  505. package/dist/src/store/store.d.ts.map +1 -0
  506. package/dist/src/store/store.spec.d.ts +2 -0
  507. package/dist/src/store/store.spec.d.ts.map +1 -0
  508. package/dist/src/synnax/Provider.d.ts +11 -0
  509. package/dist/src/synnax/Provider.d.ts.map +1 -1
  510. package/dist/src/synnax/aether/provider.d.ts +7 -7
  511. package/dist/src/synnax/aether/provider.d.ts.map +1 -1
  512. package/dist/src/table/Table.d.ts +1 -1
  513. package/dist/src/table/Table.d.ts.map +1 -1
  514. package/dist/src/table/aether/Table.d.ts +1 -1
  515. package/dist/src/table/aether/Table.d.ts.map +1 -1
  516. package/dist/src/table/cells/Cells.d.ts +6 -6
  517. package/dist/src/table/cells/Cells.d.ts.map +1 -1
  518. package/dist/src/table/cells/Forms.d.ts +4 -0
  519. package/dist/src/table/cells/Forms.d.ts.map +1 -1
  520. package/dist/src/table/cells/external.d.ts +4 -0
  521. package/dist/src/table/cells/external.d.ts.map +1 -0
  522. package/dist/src/table/cells/index.d.ts +1 -1
  523. package/dist/src/table/cells/registry.d.ts +1 -1
  524. package/dist/src/table/cells/registry.d.ts.map +1 -1
  525. package/dist/src/tabs/Selector.d.ts +9 -9
  526. package/dist/src/tabs/Selector.d.ts.map +1 -1
  527. package/dist/src/tabs/Tabs.d.ts +6 -6
  528. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  529. package/dist/src/tabs/types.d.ts +3 -3
  530. package/dist/src/tabs/types.d.ts.map +1 -1
  531. package/dist/src/tabs/useContext.d.ts +3 -3
  532. package/dist/src/tabs/useContext.d.ts.map +1 -1
  533. package/dist/src/tag/Tag.d.ts +6 -6
  534. package/dist/src/tag/Tag.d.ts.map +1 -1
  535. package/dist/src/tag/Tags.d.ts +5 -0
  536. package/dist/src/tag/Tags.d.ts.map +1 -0
  537. package/dist/src/tag/external.d.ts +3 -0
  538. package/dist/src/tag/external.d.ts.map +1 -0
  539. package/dist/src/tag/index.d.ts +1 -1
  540. package/dist/src/tag/index.d.ts.map +1 -1
  541. package/dist/src/telem/SelectDataType.d.ts +7 -0
  542. package/dist/src/telem/SelectDataType.d.ts.map +1 -0
  543. package/dist/src/telem/aether/context.d.ts +1 -0
  544. package/dist/src/telem/aether/context.d.ts.map +1 -1
  545. package/dist/src/telem/aether/noop.d.ts.map +1 -1
  546. package/dist/src/telem/aether/pipeline.d.ts +1 -1
  547. package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
  548. package/dist/src/telem/aether/provider.d.ts +1 -1
  549. package/dist/src/telem/aether/provider.d.ts.map +1 -1
  550. package/dist/src/telem/aether/remote.d.ts +13 -13
  551. package/dist/src/telem/aether/remote.d.ts.map +1 -1
  552. package/dist/src/telem/aether/static.d.ts +3 -3
  553. package/dist/src/telem/aether/static.d.ts.map +1 -1
  554. package/dist/src/telem/aether/telem.d.ts +3 -4
  555. package/dist/src/telem/aether/telem.d.ts.map +1 -1
  556. package/dist/src/telem/aether/transformers.d.ts +4 -5
  557. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  558. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  559. package/dist/src/telem/client/cache/static.d.ts +1 -1
  560. package/dist/src/telem/client/cache/static.d.ts.map +1 -1
  561. package/dist/src/telem/client/reader.spec.d.ts +1 -3
  562. package/dist/src/telem/client/reader.spec.d.ts.map +1 -1
  563. package/dist/src/telem/client/streamer.d.ts.map +1 -1
  564. package/dist/src/telem/control/Chip.d.ts +2 -2
  565. package/dist/src/telem/control/Chip.d.ts.map +1 -1
  566. package/dist/src/telem/control/Controller.d.ts +1 -1
  567. package/dist/src/telem/control/Controller.d.ts.map +1 -1
  568. package/dist/src/telem/control/Indicator.d.ts +4 -1
  569. package/dist/src/telem/control/Indicator.d.ts.map +1 -1
  570. package/dist/src/telem/control/Legend.d.ts.map +1 -1
  571. package/dist/src/telem/control/aether/chip.d.ts +22 -25
  572. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  573. package/dist/src/telem/control/aether/controller.d.ts +14 -4
  574. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  575. package/dist/src/telem/control/aether/indicator.d.ts +31 -24
  576. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  577. package/dist/src/telem/control/aether/legend.d.ts +3 -3
  578. package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
  579. package/dist/src/telem/control/aether/state.d.ts +2 -2
  580. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  581. package/dist/src/telem/external.d.ts +3 -0
  582. package/dist/src/telem/external.d.ts.map +1 -0
  583. package/dist/src/telem/index.d.ts +1 -1
  584. package/dist/src/testutil/Aether.d.ts +4 -0
  585. package/dist/src/testutil/Aether.d.ts.map +1 -0
  586. package/dist/src/testutil/Synnax.d.ts +9 -0
  587. package/dist/src/testutil/Synnax.d.ts.map +1 -0
  588. package/dist/src/text/DateTime.d.ts +3 -3
  589. package/dist/src/text/DateTime.d.ts.map +1 -1
  590. package/dist/src/text/Editable.d.ts +5 -6
  591. package/dist/src/text/Editable.d.ts.map +1 -1
  592. package/dist/src/text/Text.d.ts +17 -11
  593. package/dist/src/text/Text.d.ts.map +1 -1
  594. package/dist/src/text/core/types.d.ts +7 -8
  595. package/dist/src/text/core/types.d.ts.map +1 -1
  596. package/dist/src/text/external.d.ts +0 -3
  597. package/dist/src/text/external.d.ts.map +1 -1
  598. package/dist/src/text/symbols.d.ts.map +1 -1
  599. package/dist/src/theming/aether/provider.d.ts +4 -4
  600. package/dist/src/theming/aether/provider.d.ts.map +1 -1
  601. package/dist/src/theming/core/fontString.d.ts +2 -2
  602. package/dist/src/theming/core/fontString.d.ts.map +1 -1
  603. package/dist/src/theming/core/theme.d.ts +2 -2
  604. package/dist/src/theming/core/theme.d.ts.map +1 -1
  605. package/dist/src/tooltip/Dialog.d.ts +1 -1
  606. package/dist/src/tooltip/Dialog.d.ts.map +1 -1
  607. package/dist/src/tree/Item.d.ts +11 -0
  608. package/dist/src/tree/Item.d.ts.map +1 -0
  609. package/dist/src/tree/Tree.d.ts +28 -48
  610. package/dist/src/tree/Tree.d.ts.map +1 -1
  611. package/dist/src/tree/core.d.ts +59 -71
  612. package/dist/src/tree/core.d.ts.map +1 -1
  613. package/dist/src/tree/external.d.ts +1 -0
  614. package/dist/src/tree/external.d.ts.map +1 -1
  615. package/dist/src/triggers/Text.d.ts +3 -2
  616. package/dist/src/triggers/Text.d.ts.map +1 -1
  617. package/dist/src/triggers/triggers.d.ts +6 -6
  618. package/dist/src/triggers/triggers.d.ts.map +1 -1
  619. package/dist/src/util/children.d.ts.map +1 -1
  620. package/dist/src/util/zod.d.ts +1 -1
  621. package/dist/src/util/zod.d.ts.map +1 -1
  622. package/dist/src/viewport/SelectMode.d.ts +3 -3
  623. package/dist/src/viewport/SelectMode.d.ts.map +1 -1
  624. package/dist/src/viewport/use.d.ts +3 -3
  625. package/dist/src/viewport/use.d.ts.map +1 -1
  626. package/dist/src/vis/axis/axis.d.ts +1 -1
  627. package/dist/src/vis/axis/axis.d.ts.map +1 -1
  628. package/dist/src/vis/axis/ticks.d.ts +1 -1
  629. package/dist/src/vis/axis/ticks.d.ts.map +1 -1
  630. package/dist/src/vis/button/SelectMode.d.ts +8 -0
  631. package/dist/src/vis/button/SelectMode.d.ts.map +1 -0
  632. package/dist/src/vis/button/aether/button.d.ts +2 -1
  633. package/dist/src/vis/button/aether/button.d.ts.map +1 -1
  634. package/dist/src/vis/button/external.d.ts +3 -0
  635. package/dist/src/vis/button/external.d.ts.map +1 -0
  636. package/dist/src/vis/button/index.d.ts +1 -1
  637. package/dist/src/vis/button/index.d.ts.map +1 -1
  638. package/dist/src/vis/button/use.d.ts +3 -1
  639. package/dist/src/vis/button/use.d.ts.map +1 -1
  640. package/dist/src/vis/canvas/aether/canvas.d.ts +1 -1
  641. package/dist/src/vis/canvas/aether/canvas.d.ts.map +1 -1
  642. package/dist/src/vis/diagram/Diagram.d.ts +6 -6
  643. package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
  644. package/dist/src/vis/diagram/aether/Diagram.d.ts +1 -1
  645. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  646. package/dist/src/vis/diagram/aether/types.d.ts +1 -1
  647. package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
  648. package/dist/src/vis/diagram/edge/connector/connector.d.ts +1 -1
  649. package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +1 -1
  650. package/dist/src/vis/diagram/edge/paths.d.ts +2 -3
  651. package/dist/src/vis/diagram/edge/paths.d.ts.map +1 -1
  652. package/dist/src/vis/eraser/aether/eraser.d.ts +1 -1
  653. package/dist/src/vis/eraser/aether/eraser.d.ts.map +1 -1
  654. package/dist/src/vis/grid/grid.d.ts +1 -1
  655. package/dist/src/vis/grid/grid.d.ts.map +1 -1
  656. package/dist/src/vis/legend/Container.d.ts +3 -3
  657. package/dist/src/vis/legend/Container.d.ts.map +1 -1
  658. package/dist/src/vis/legend/Simple.d.ts +8 -7
  659. package/dist/src/vis/legend/Simple.d.ts.map +1 -1
  660. package/dist/src/vis/light/aether/light.d.ts +1 -1
  661. package/dist/src/vis/light/aether/light.d.ts.map +1 -1
  662. package/dist/src/vis/light/use.d.ts +1 -1
  663. package/dist/src/vis/light/use.d.ts.map +1 -1
  664. package/dist/src/vis/line/aether/line.d.ts +1 -1
  665. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  666. package/dist/src/vis/lineplot/Axis.d.ts +3 -3
  667. package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
  668. package/dist/src/vis/lineplot/LinePlot.d.ts +1 -1
  669. package/dist/src/vis/lineplot/LinePlot.d.ts.map +1 -1
  670. package/dist/src/vis/lineplot/Title.d.ts +2 -2
  671. package/dist/src/vis/lineplot/Title.d.ts.map +1 -1
  672. package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts +1 -1
  673. package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts.map +1 -1
  674. package/dist/src/vis/lineplot/aether/LinePlot.d.ts +1 -1
  675. package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +1 -1
  676. package/dist/src/vis/lineplot/aether/XAxis.d.ts +56 -56
  677. package/dist/src/vis/lineplot/aether/YAxis.d.ts +56 -56
  678. package/dist/src/vis/lineplot/aether/axis.d.ts +2 -2
  679. package/dist/src/vis/lineplot/aether/axis.d.ts.map +1 -1
  680. package/dist/src/vis/lineplot/range/Annotation.d.ts +1 -1
  681. package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
  682. package/dist/src/vis/lineplot/range/Provider.d.ts +1 -1
  683. package/dist/src/vis/lineplot/range/Provider.d.ts.map +1 -1
  684. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +9 -9
  685. package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +1 -1
  686. package/dist/src/vis/lineplot/range/aether/provider.d.ts +49 -19
  687. package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +1 -1
  688. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts +1 -1
  689. package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts.map +1 -1
  690. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +1 -1
  691. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +1 -1
  692. package/dist/src/vis/log/Log.d.ts +3 -3
  693. package/dist/src/vis/log/Log.d.ts.map +1 -1
  694. package/dist/src/vis/log/aether/Log.d.ts +4 -4
  695. package/dist/src/vis/log/aether/Log.d.ts.map +1 -1
  696. package/dist/src/vis/measure/aether/measure.d.ts +1 -1
  697. package/dist/src/vis/measure/aether/measure.d.ts.map +1 -1
  698. package/dist/src/vis/rule/Rule.d.ts +3 -3
  699. package/dist/src/vis/rule/Rule.d.ts.map +1 -1
  700. package/dist/src/vis/rule/aether/aether.d.ts +1 -1
  701. package/dist/src/vis/rule/aether/aether.d.ts.map +1 -1
  702. package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
  703. package/dist/src/vis/schematic/Grid.d.ts.map +1 -1
  704. package/dist/src/vis/schematic/SelectOrientation.d.ts +3 -3
  705. package/dist/src/vis/schematic/SelectOrientation.d.ts.map +1 -1
  706. package/dist/src/vis/schematic/Symbols.d.ts +15 -12
  707. package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
  708. package/dist/src/vis/schematic/primitives/Primitives.d.ts +3 -3
  709. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
  710. package/dist/src/vis/schematic/registry.d.ts +3 -3
  711. package/dist/src/vis/schematic/registry.d.ts.map +1 -1
  712. package/dist/src/vis/setpoint/aether/setpoint.d.ts +1 -1
  713. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  714. package/dist/src/vis/setpoint/use.d.ts +1 -1
  715. package/dist/src/vis/setpoint/use.d.ts.map +1 -1
  716. package/dist/src/vis/toggle/aether/toggle.d.ts +1 -1
  717. package/dist/src/vis/toggle/aether/toggle.d.ts.map +1 -1
  718. package/dist/src/vis/toggle/use.d.ts +1 -1
  719. package/dist/src/vis/toggle/use.d.ts.map +1 -1
  720. package/dist/src/vis/value/RedlineForm.d.ts +6 -0
  721. package/dist/src/vis/value/RedlineForm.d.ts.map +1 -0
  722. package/dist/src/vis/value/TelemForm.d.ts +6 -0
  723. package/dist/src/vis/value/TelemForm.d.ts.map +1 -0
  724. package/dist/src/vis/value/aether/value.d.ts +31 -4
  725. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  726. package/dist/src/vis/value/external.d.ts +3 -1
  727. package/dist/src/vis/value/external.d.ts.map +1 -1
  728. package/dist/src/vis/value/redline.d.ts +18 -0
  729. package/dist/src/vis/value/redline.d.ts.map +1 -0
  730. package/dist/src/vis/value/use.d.ts +12 -3
  731. package/dist/src/vis/value/use.d.ts.map +1 -1
  732. package/dist/src/workspace/index.d.ts +2 -0
  733. package/dist/src/workspace/index.d.ts.map +1 -0
  734. package/dist/src/workspace/queries.d.ts +12 -0
  735. package/dist/src/workspace/queries.d.ts.map +1 -0
  736. package/dist/src/workspace/queries.spec.d.ts +2 -0
  737. package/dist/src/workspace/queries.spec.d.ts.map +1 -0
  738. package/dist/{external-UeyJ6mPv.js → symbols-5jPiWw_d.js} +21721 -16450
  739. package/dist/symbols-DzAWrATO.cjs +92 -0
  740. package/dist/tabs.cjs +1 -1
  741. package/dist/tabs.js +1 -1
  742. package/dist/text.cjs +1 -1
  743. package/dist/text.js +2 -2
  744. package/dist/theming.cjs +1 -1
  745. package/dist/theming.js +2 -2
  746. package/dist/tree.cjs +1 -1
  747. package/dist/tree.js +1 -1
  748. package/dist/triggers.cjs +1 -1
  749. package/dist/triggers.js +1 -1
  750. package/dist/units-BGkvnLO-.cjs +1 -0
  751. package/dist/units-HcS_zslH.js +14 -0
  752. package/dist/useKeysData-B1kiZOOw.js +14 -0
  753. package/dist/useKeysData-G9Mk3mA6.cjs +1 -0
  754. package/dist/video.cjs +1 -1
  755. package/dist/video.js +1 -1
  756. package/package.json +24 -23
  757. package/dist/Center-Bq5L7oy0.js +0 -24
  758. package/dist/Center-DE_BtCCX.cjs +0 -1
  759. package/dist/ContextMenu-BC5x7XR5.cjs +0 -1
  760. package/dist/ContextMenu-DLM5eLLG.js +0 -95
  761. package/dist/DateTime-CdNKxVxT.js +0 -17
  762. package/dist/DateTime-DC19AIGq.cjs +0 -1
  763. package/dist/Divider-CDFHLK9U.js +0 -1358
  764. package/dist/Divider-D74_FAXn.cjs +0 -22
  765. package/dist/Dropdown-BpoU-xVd.cjs +0 -1
  766. package/dist/Dropdown-CQu3yo3v.js +0 -327
  767. package/dist/Haul-D6kpOYBa.js +0 -124
  768. package/dist/Haul-De8axVdi.cjs +0 -1
  769. package/dist/Item-CB5c--eX.cjs +0 -1
  770. package/dist/Item-LAMTj0X2.js +0 -109
  771. package/dist/Keyboard-CiNuYBa3.cjs +0 -1
  772. package/dist/Keyboard-DjeQa-Nx.js +0 -31
  773. package/dist/Link-CPnT8Xp9.cjs +0 -1
  774. package/dist/Link-DcudTtgT.js +0 -14
  775. package/dist/Pack-80N7XB5O.cjs +0 -1
  776. package/dist/Pack-BiS6QIuA.js +0 -52
  777. package/dist/Provider-CLPfWTcl.js +0 -464
  778. package/dist/Provider-s70PZ9lg.cjs +0 -1
  779. package/dist/Space-ByFmfiTa.cjs +0 -1
  780. package/dist/Space-DxHm2ok7.js +0 -100
  781. package/dist/Stack-BbwDtaE6.cjs +0 -1
  782. package/dist/Stack-D50qN0Vu.js +0 -13
  783. package/dist/Text-BiWcjO1i.js +0 -137
  784. package/dist/Text-CacHYC7L.js +0 -35
  785. package/dist/Text-DTPuORh0.cjs +0 -1
  786. package/dist/Text-Dw0NDc2A.cjs +0 -4
  787. package/dist/Text-bSIbkBIL.cjs +0 -1
  788. package/dist/Text-wL3te5S6.js +0 -1247
  789. package/dist/Toggle-CbzT5wR_.js +0 -383
  790. package/dist/Toggle-CpDGR6M6.cjs +0 -1
  791. package/dist/WithIcon-B7VPBqA2.js +0 -95
  792. package/dist/WithIcon-CCnlO2LC.cjs +0 -1
  793. package/dist/align.cjs +0 -1
  794. package/dist/align.js +0 -4
  795. package/dist/array-CPtP5Oov.js +0 -7
  796. package/dist/array-CZHEGH95.cjs +0 -1
  797. package/dist/css-C7rJrqRi.cjs +0 -38
  798. package/dist/css-DjQu2Qyf.js +0 -12511
  799. package/dist/debounce-CW9Q-DsR.js +0 -17
  800. package/dist/debounce-heEWeOqL.cjs +0 -1
  801. package/dist/deep-BRgXTyZn.cjs +0 -1
  802. package/dist/deep-D72Fid_q.js +0 -193
  803. package/dist/dimensions-BmlCx5q4.cjs +0 -1
  804. package/dist/dimensions-FnMV2fyj.js +0 -19
  805. package/dist/dropdown.cjs +0 -1
  806. package/dist/dropdown.js +0 -4
  807. package/dist/eraser-BJxXs5KS.js +0 -967
  808. package/dist/eraser-CGxyWj3B.cjs +0 -11
  809. package/dist/external-5nVYtLDI.js +0 -431
  810. package/dist/external-B-B5ro_s.cjs +0 -1
  811. package/dist/external-B3Mtbu36.cjs +0 -1
  812. package/dist/external-BgwS5D0j.cjs +0 -1
  813. package/dist/external-Bn3A7Rew.js +0 -20
  814. package/dist/external-Bojct8Fy.cjs +0 -1
  815. package/dist/external-C6mmYO7R.js +0 -1265
  816. package/dist/external-CVHgvs0C.js +0 -28
  817. package/dist/external-CnkWbciu.js +0 -399
  818. package/dist/external-Cxwmal3D.cjs +0 -46
  819. package/dist/external-DC1RT1Js.cjs +0 -1
  820. package/dist/external-DOujCKRS.cjs +0 -1
  821. package/dist/external-Dm9rg2x7.js +0 -13
  822. package/dist/external-EvgywGSS.cjs +0 -1
  823. package/dist/external-GjPk23XZ.cjs +0 -1
  824. package/dist/external-MJ2UMa_L.cjs +0 -1
  825. package/dist/external-V0yO0q2n.cjs +0 -1
  826. package/dist/external-cDUxSE0v.cjs +0 -85
  827. package/dist/external-cJGWYB3x.js +0 -19
  828. package/dist/external-fwvNilmo.js +0 -111
  829. package/dist/external-l7imNJRR.js +0 -78
  830. package/dist/external-upR9Jz-8.js +0 -60
  831. package/dist/font-Csp00pQP.js +0 -15
  832. package/dist/font-ifUcrCey.cjs +0 -1
  833. package/dist/fontString-BWECl_1B.cjs +0 -1
  834. package/dist/hooks-B92WH57y.cjs +0 -1
  835. package/dist/hooks-u_TgL0Xi.js +0 -296
  836. package/dist/provider-YWPkhTn6.cjs +0 -154
  837. package/dist/provider-gW90qzEG.js +0 -32024
  838. package/dist/src/accordion/Accordion.d.ts +0 -39
  839. package/dist/src/accordion/Accordion.d.ts.map +0 -1
  840. package/dist/src/accordion/Accordion.spec.d.ts +0 -2
  841. package/dist/src/accordion/Accordion.spec.d.ts.map +0 -1
  842. package/dist/src/accordion/index.d.ts +0 -2
  843. package/dist/src/accordion/index.d.ts.map +0 -1
  844. package/dist/src/align/Center.d.ts +0 -8
  845. package/dist/src/align/Center.d.ts.map +0 -1
  846. package/dist/src/align/Pack.d.ts +0 -24
  847. package/dist/src/align/Pack.d.ts.map +0 -1
  848. package/dist/src/align/Space.d.ts +0 -74
  849. package/dist/src/align/Space.d.ts.map +0 -1
  850. package/dist/src/align/Space.spec.d.ts +0 -2
  851. package/dist/src/align/Space.spec.d.ts.map +0 -1
  852. package/dist/src/align/Stack.d.ts +0 -7
  853. package/dist/src/align/Stack.d.ts.map +0 -1
  854. package/dist/src/align/external.d.ts +0 -5
  855. package/dist/src/align/external.d.ts.map +0 -1
  856. package/dist/src/align/index.d.ts +0 -2
  857. package/dist/src/align/index.d.ts.map +0 -1
  858. package/dist/src/button/Icon.d.ts +0 -30
  859. package/dist/src/button/Icon.d.ts.map +0 -1
  860. package/dist/src/button/Link.d.ts +0 -18
  861. package/dist/src/button/Link.d.ts.map +0 -1
  862. package/dist/src/dialog/use.d.ts +0 -51
  863. package/dist/src/dialog/use.d.ts.map +0 -1
  864. package/dist/src/dropdown/Dropdown.d.ts +0 -34
  865. package/dist/src/dropdown/Dropdown.d.ts.map +0 -1
  866. package/dist/src/dropdown/Dropdown.spec.d.ts +0 -2
  867. package/dist/src/dropdown/Dropdown.spec.d.ts.map +0 -1
  868. package/dist/src/dropdown/index.d.ts +0 -2
  869. package/dist/src/dropdown/index.d.ts.map +0 -1
  870. package/dist/src/hooks/effect.d.ts +0 -15
  871. package/dist/src/hooks/effect.d.ts.map +0 -1
  872. package/dist/src/hooks/useFilter.d.ts +0 -23
  873. package/dist/src/hooks/useFilter.d.ts.map +0 -1
  874. package/dist/src/list/Column.d.ts +0 -57
  875. package/dist/src/list/Column.d.ts.map +0 -1
  876. package/dist/src/list/Core.d.ts +0 -41
  877. package/dist/src/list/Core.d.ts.map +0 -1
  878. package/dist/src/list/Data.d.ts +0 -31
  879. package/dist/src/list/Data.d.ts.map +0 -1
  880. package/dist/src/list/Filter.d.ts +0 -27
  881. package/dist/src/list/Filter.d.ts.map +0 -1
  882. package/dist/src/list/Hover.d.ts +0 -14
  883. package/dist/src/list/Hover.d.ts.map +0 -1
  884. package/dist/src/list/Infinite.d.ts +0 -15
  885. package/dist/src/list/Infinite.d.ts.map +0 -1
  886. package/dist/src/list/List.d.ts +0 -21
  887. package/dist/src/list/List.d.ts.map +0 -1
  888. package/dist/src/list/Search.d.ts +0 -18
  889. package/dist/src/list/Search.d.ts.map +0 -1
  890. package/dist/src/list/Selector.d.ts +0 -18
  891. package/dist/src/list/Selector.d.ts.map +0 -1
  892. package/dist/src/list/types.d.ts +0 -15
  893. package/dist/src/list/types.d.ts.map +0 -1
  894. package/dist/src/list/useSelect.d.ts +0 -84
  895. package/dist/src/list/useSelect.d.ts.map +0 -1
  896. package/dist/src/list/useSelect.spec.d.ts +0 -2
  897. package/dist/src/list/useSelect.spec.d.ts.map +0 -1
  898. package/dist/src/modal/Modal.d.ts +0 -15
  899. package/dist/src/modal/Modal.d.ts.map +0 -1
  900. package/dist/src/modal/index.d.ts +0 -2
  901. package/dist/src/modal/index.d.ts.map +0 -1
  902. package/dist/src/ranger/SelectLabel.d.ts +0 -7
  903. package/dist/src/ranger/SelectLabel.d.ts.map +0 -1
  904. package/dist/src/select/Alignment.d.ts +0 -13
  905. package/dist/src/select/Alignment.d.ts.map +0 -1
  906. package/dist/src/select/ClearButton.d.ts +0 -4
  907. package/dist/src/select/ClearButton.d.ts.map +0 -1
  908. package/dist/src/select/ComponentSize.d.ts +0 -12
  909. package/dist/src/select/ComponentSize.d.ts.map +0 -1
  910. package/dist/src/select/DataType.d.ts +0 -12
  911. package/dist/src/select/DataType.d.ts.map +0 -1
  912. package/dist/src/select/Direction.d.ts +0 -14
  913. package/dist/src/select/Direction.d.ts.map +0 -1
  914. package/dist/src/select/List.d.ts +0 -15
  915. package/dist/src/select/List.d.ts.map +0 -1
  916. package/dist/src/select/Select.spec.d.ts +0 -10
  917. package/dist/src/select/Select.spec.d.ts.map +0 -1
  918. package/dist/src/status/Text.d.ts +0 -20
  919. package/dist/src/status/Text.d.ts.map +0 -1
  920. package/dist/src/status/aether/external.d.ts +0 -3
  921. package/dist/src/status/aether/external.d.ts.map +0 -1
  922. package/dist/src/status/aether/types.d.ts +0 -26
  923. package/dist/src/status/aether/types.d.ts.map +0 -1
  924. package/dist/src/text/Keyboard.d.ts +0 -6
  925. package/dist/src/text/Keyboard.d.ts.map +0 -1
  926. package/dist/src/text/Link.d.ts +0 -11
  927. package/dist/src/text/Link.d.ts.map +0 -1
  928. package/dist/src/text/WithIcon.d.ts +0 -21
  929. package/dist/src/text/WithIcon.d.ts.map +0 -1
  930. package/dist/src/tree/Tree.spec.d.ts +0 -2
  931. package/dist/src/tree/Tree.spec.d.ts.map +0 -1
  932. package/dist/src/util/component.d.ts +0 -12
  933. package/dist/src/util/component.d.ts.map +0 -1
  934. package/dist/src/util/removeProps.d.ts.map +0 -1
  935. package/dist/src/util/removeProps.spec.d.ts.map +0 -1
  936. package/dist/src/util/renderProp.d.ts.map +0 -1
  937. package/dist/src/vis/value/Form.d.ts +0 -9
  938. package/dist/src/vis/value/Form.d.ts.map +0 -1
  939. package/dist/state-DAFH2z9y.js +0 -4082
  940. package/dist/state-DwM4WaEw.cjs +0 -27
  941. package/dist/useClickOutside-CUa496t0.cjs +0 -1
  942. package/dist/useClickOutside-Dw3KdU3w.js +0 -106
  943. package/dist/useDebouncedCallback-Bx-HX76R.cjs +0 -1
  944. package/dist/useDebouncedCallback-Cvo_HNow.js +0 -7
  945. package/dist/useMemoCompare-B5QPDK2p.js +0 -19
  946. package/dist/useMemoCompare-BDs2sKw5.cjs +0 -1
  947. package/dist/useVirtualCursorDragWebKit-CUbBopD6.cjs +0 -1
  948. package/dist/useVirtualCursorDragWebKit-CfxbToxm.js +0 -65
  949. package/dist/value--TYeJRXm.cjs +0 -55
  950. package/dist/value-dkHk-BsO.js +0 -10797
  951. /package/dist/src/{util → component}/removeProps.d.ts +0 -0
  952. /package/dist/src/{util → component}/removeProps.spec.d.ts +0 -0
@@ -0,0 +1,4337 @@
1
+ import x, { z as a } from "zod";
2
+ const tn = (t) => {
3
+ const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
4
+ return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
5
+ }, lt = (t) => {
6
+ const e = (r, n = Ge) => {
7
+ if (typeof r == "string") return t(r);
8
+ if (Array.isArray(r)) return r.map((o) => e(o, n));
9
+ if (!Fe(r)) return r;
10
+ n = sn(n);
11
+ const s = {}, i = r;
12
+ return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
13
+ let c = i[o];
14
+ const l = t(o);
15
+ n.recursive && (Fe(c) ? Rt(c) || (c = e(c, n)) : n.recursiveInArray && jt(c) && (c = [...c].map((f) => {
16
+ let p = f;
17
+ return Fe(f) ? Rt(p) || (p = e(f, n)) : jt(f) && (p = e({ key: f }, n).key), p;
18
+ }))), s[l] = c;
19
+ }), s);
20
+ };
21
+ return e;
22
+ }, ct = lt(tn), rn = (t) => (
23
+ // Don't convert the first character and don't convert a character that is after a
24
+ // non-alphanumeric character
25
+ t.replace(
26
+ /([a-z0-9])([A-Z])/g,
27
+ (e, r, n) => `${r}_${n.toLowerCase()}`
28
+ )
29
+ ), Ft = lt(rn), Zt = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), nn = [Number, String, Uint8Array], Ge = {
30
+ recursive: !0,
31
+ recursiveInArray: !0
32
+ }, sn = (t = Ge) => (t.recursive == null ? t = Ge : t.recursiveInArray ??= !1, t), jt = (t) => t != null && Array.isArray(t), Fe = (t) => t != null && typeof t == "object" && !Array.isArray(t), Rt = (t) => nn.some((e) => t instanceof e), an = (t) => t.replace(/\s+/g, "-").replace(
33
+ /([a-z0-9])([A-Z])/g,
34
+ (e, r, n) => `${r}-${n.toLowerCase()}`
35
+ ).toLowerCase(), on = lt(an), uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
36
+ __proto__: null,
37
+ camelToSnake: Ft,
38
+ capitalize: Zt,
39
+ snakeToCamel: ct,
40
+ toKebab: on
41
+ }, Symbol.toStringTag, { value: "Module" }));
42
+ let un = class {
43
+ contentType = "application/json";
44
+ decoder;
45
+ encoder;
46
+ constructor() {
47
+ this.decoder = new TextDecoder(), this.encoder = new TextEncoder();
48
+ }
49
+ encode(e) {
50
+ return this.encoder.encode(this.encodeString(e));
51
+ }
52
+ decode(e, r) {
53
+ return this.decodeString(this.decoder.decode(e), r);
54
+ }
55
+ decodeString(e, r) {
56
+ const n = JSON.parse(e), s = ct(n);
57
+ return r != null ? r.parse(s) : s;
58
+ }
59
+ encodeString(e) {
60
+ const r = Ft(e);
61
+ return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
62
+ }
63
+ };
64
+ const He = new un(), Je = (t) => [...new Set(t)], ln = (t, e, r = !0) => {
65
+ const n = /* @__PURE__ */ new Map();
66
+ return t.forEach((s) => {
67
+ const i = e(s);
68
+ if (n.has(i)) {
69
+ if (r) return;
70
+ n.delete(i);
71
+ }
72
+ n.set(i, s);
73
+ }), Array.from(n.values());
74
+ }, co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
75
+ __proto__: null,
76
+ by: ln,
77
+ unique: Je
78
+ }, Symbol.toStringTag, { value: "Module" }));
79
+ let J = class {
80
+ /** The underlying primitive value */
81
+ value;
82
+ constructor(e) {
83
+ this.value = e;
84
+ }
85
+ /** Overrides the JS default valueOf() function to return the primitive value. */
86
+ valueOf() {
87
+ return this.value;
88
+ }
89
+ /** toJSON ensures that only the primitive value gets encoded during JSON
90
+ * stringification. */
91
+ toJSON() {
92
+ return this.value;
93
+ }
94
+ /** @returns a string representation of the item. */
95
+ toString() {
96
+ return this.value.toString();
97
+ }
98
+ };
99
+ const ht = (t) => t != null && typeof t == "object" && "toString" in t, cn = (t) => {
100
+ if (ht(t)) return t?.toString().length === 0;
101
+ switch (typeof t) {
102
+ case "string":
103
+ return t.length === 0;
104
+ case "number":
105
+ return t === 0;
106
+ case "bigint":
107
+ return t === 0n;
108
+ case "boolean":
109
+ return !t;
110
+ case "undefined":
111
+ return !0;
112
+ case "object":
113
+ return t == null;
114
+ default:
115
+ return !1;
116
+ }
117
+ }, fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
118
+ __proto__: null,
119
+ ValueExtension: J,
120
+ isStringer: ht,
121
+ isZero: cn
122
+ }, Symbol.toStringTag, { value: "Module" })), Be = (t, e = !1) => {
123
+ const r = ht(t) ? "stringer" : typeof t;
124
+ let n;
125
+ switch (r) {
126
+ case "string":
127
+ n = (s, i) => s.localeCompare(i);
128
+ break;
129
+ case "stringer":
130
+ n = (s, i) => s.toString().localeCompare(i.toString());
131
+ break;
132
+ case "number":
133
+ n = (s, i) => Number(s) - Number(i);
134
+ break;
135
+ case "bigint":
136
+ n = (s, i) => BigInt(s) - BigInt(i) > 0n ? 1 : -1;
137
+ break;
138
+ case "boolean":
139
+ n = (s, i) => Number(s) - Number(i);
140
+ break;
141
+ case "undefined":
142
+ n = () => 0;
143
+ break;
144
+ default:
145
+ return console.warn(`sortFunc: unknown type ${r}`), () => -1;
146
+ }
147
+ return e ? Vt(n) : n;
148
+ }, hn = (t, e, r) => {
149
+ const n = Be(e[t], r);
150
+ return (s, i) => n(s[t], i[t]);
151
+ }, fn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, Yt = (t, e) => {
152
+ if (t.length !== e.length) return t.length - e.length;
153
+ if (t.length === 0) return 0;
154
+ const r = Be(t[0]), n = [...t].sort(r), s = [...e].sort(r);
155
+ return n.every((i, o) => i === s[o]) ? 0 : -1;
156
+ }, dn = (t, e) => {
157
+ const r = Je(t), n = Je(e);
158
+ return Yt(r, n);
159
+ }, gn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Vt = (t) => (e, r) => t(r, e), ee = 0, xe = -1, $e = 1, Wt = (t) => t < ee, Gt = (t) => t > ee, pn = (t) => t >= ee, Ht = (t) => t === ee, yn = (t, e) => {
160
+ const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
161
+ if (!n || !s) return 0;
162
+ for (let i = 0; i < Math.min(n.length, s.length); i++) {
163
+ const o = n[i], c = s[i];
164
+ if (isNaN(Number(o)) && isNaN(Number(c))) {
165
+ const l = o.localeCompare(c);
166
+ if (l !== 0) return l;
167
+ } else if (!isNaN(Number(o)) && !isNaN(Number(c))) {
168
+ const l = Number(o) - Number(c);
169
+ if (l !== 0) return l;
170
+ } else return isNaN(Number(o)) ? -1 : 1;
171
+ }
172
+ return n.length - s.length;
173
+ }, go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
174
+ __proto__: null,
175
+ EQUAL: ee,
176
+ GREATER_THAN: $e,
177
+ LESS_THAN: xe,
178
+ isEqualTo: Ht,
179
+ isGreaterThan: Gt,
180
+ isGreaterThanEqual: pn,
181
+ isLessThan: Wt,
182
+ newF: Be,
183
+ newFieldF: hn,
184
+ order: gn,
185
+ primitiveArrays: fn,
186
+ reverseF: Vt,
187
+ stringsWithNumbers: yn,
188
+ uniqueUnorderedPrimitiveArrays: dn,
189
+ unorderedPrimitiveArrays: Yt
190
+ }, Symbol.toStringTag, { value: "Module" })), Ue = a.tuple([a.number(), a.number()]);
191
+ a.tuple([a.bigint(), a.bigint()]);
192
+ const ft = a.object({ width: a.number(), height: a.number() }), mn = a.object({
193
+ signedWidth: a.number(),
194
+ signedHeight: a.number()
195
+ }), bn = ["width", "height"];
196
+ a.enum(bn);
197
+ const wn = ["start", "center", "end"], On = ["signedWidth", "signedHeight"];
198
+ a.enum(On);
199
+ const he = a.object({ x: a.number(), y: a.number() }), Jt = a.object({ clientX: a.number(), clientY: a.number() }), Ce = ["x", "y"], dt = a.enum(Ce), Xt = ["top", "right", "bottom", "left"], vn = a.enum(Xt), je = ["left", "right"], gt = a.enum(je), Re = ["top", "bottom"], pt = a.enum(Re), yt = ["center"], Xe = a.enum(yt), Tn = [...Xt, ...yt], mt = a.enum(Tn);
200
+ a.enum(wn);
201
+ const xn = ["first", "last"];
202
+ a.enum(xn);
203
+ const Kt = a.object({ lower: a.number(), upper: a.number() }), $n = a.object({ lower: a.bigint(), upper: a.bigint() });
204
+ a.union([Kt, Ue]);
205
+ a.union([$n, Ue]);
206
+ const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.instanceof(String)]), ae = (t, e) => typeof t == "bigint" ? t - BigInt(e) : t - Number(e), Qt = (t, e) => typeof t == "bigint" ? t + BigInt(e) : t + Number(e), In = (t, e, r = 1e-4) => Math.abs(t - e) < r, Ke = (t, e) => typeof t == "bigint" ? t === BigInt(e) : t === Number(e), Mn = (t) => {
207
+ const e = 10 ** Math.floor(Math.log10(t));
208
+ return Math.round(t / e) * e;
209
+ }, _t = (t, e) => t <= e ? t : typeof t == "bigint" ? t <= e ? t : BigInt(e) : t <= e ? t : Number(e), En = (t, e) => typeof t == "bigint" ? t >= e ? t : BigInt(e) : t >= e ? t : Number(e), er = (t) => t < 0 ? -t : t, Y = (t, e) => typeof t == "bigint" ? t * BigInt(e) : t * Number(e), An = (t, e) => typeof t == "bigint" ? t / BigInt(e) : t / Number(e), y = (t, e, r) => {
210
+ const n = {};
211
+ if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
212
+ e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
213
+ else if (Array.isArray(t)) {
214
+ if (t.length !== 2) throw new Error("bounds: expected array of length 2");
215
+ [n.lower, n.upper] = t;
216
+ } else
217
+ n.lower = t.lower, n.upper = t.upper;
218
+ return r?.makeValid ? tr(n) : n;
219
+ }, Bn = Object.freeze({ lower: 0, upper: 0 }), Un = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), Cn = Object.freeze({ lower: 0, upper: 1 }), jn = Object.freeze({ lower: -1, upper: 1 }), Rn = (t, e) => {
220
+ if (t == null && e == null) return !0;
221
+ if (t == null || e == null) return !1;
222
+ const r = y(t), n = y(e);
223
+ return r?.lower === n?.lower && r?.upper === n?.upper;
224
+ }, tr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Qe = (t, e) => {
225
+ const r = y(t);
226
+ return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
227
+ }, I = (t, e) => {
228
+ const r = y(t);
229
+ if (typeof e == "number" || typeof e == "bigint")
230
+ return e >= r.lower && e < r.upper;
231
+ const n = y(e);
232
+ return n.lower >= r.lower && n.upper <= r.upper;
233
+ }, Ln = (t, e) => {
234
+ const r = y(t), n = y(e);
235
+ return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : I(r, n.upper) || I(r, n.lower) || I(n, r.upper) || I(n, r.lower);
236
+ }, ye = (t) => {
237
+ const e = y(t);
238
+ return e.upper - e.lower;
239
+ }, Dn = (t) => {
240
+ const e = y(t);
241
+ return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
242
+ }, Pn = (t) => {
243
+ const e = ye(t);
244
+ return typeof e == "number" ? e === 0 : e === 0n;
245
+ }, qn = (t) => {
246
+ const e = y(t);
247
+ return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
248
+ }, kn = (t) => {
249
+ const e = y(t);
250
+ return (e.upper + e.lower) / 2;
251
+ }, rr = (t) => ({
252
+ lower: Math.min(...t.map((e) => y(e).lower)),
253
+ upper: Math.max(...t.map((e) => y(e).upper))
254
+ }), zn = (t) => ({
255
+ lower: Math.max(...t.map((e) => y(e).lower)),
256
+ upper: Math.min(...t.map((e) => y(e).upper))
257
+ }), Fn = (t) => {
258
+ const e = y(t), r = typeof e.lower == "bigint";
259
+ return Array.from({ length: Number(ye(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
260
+ }, _e = (t, e) => {
261
+ const r = t.map((i) => y(i)), n = r.findIndex((i) => I(i, e) || e < i.lower);
262
+ if (n === -1) return { index: t.length, position: 0 };
263
+ const s = r[n];
264
+ return I(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
265
+ }, Ze = {
266
+ removeBefore: 0,
267
+ removeAfter: 0,
268
+ insertInto: 0,
269
+ deleteInBetween: 0
270
+ }, Zn = (t, e) => {
271
+ const r = t.map((f) => y(f)), n = y(e);
272
+ if (r.length === 0) return Ze;
273
+ const s = _e(r, n.lower), i = _e(r, n.upper);
274
+ if (s.index === t.length) return { ...Ze, insertInto: t.length };
275
+ if (i.index === 0) return { ...Ze, removeAfter: i.position };
276
+ if (s.index === i.index)
277
+ return s.position !== 0 && i.position !== 0 ? null : {
278
+ removeAfter: i.position,
279
+ removeBefore: s.position,
280
+ insertInto: s.index,
281
+ deleteInBetween: 0
282
+ };
283
+ let o = i.index - s.index, c = s.index, l = ae(Number(ye(r[s.index])), s.position);
284
+ return s.position !== 0 ? (o -= 1, c += 1) : l = 0, {
285
+ removeBefore: l,
286
+ removeAfter: i.position,
287
+ insertInto: c,
288
+ deleteInBetween: o
289
+ };
290
+ }, nr = (t, e, r) => {
291
+ const n = t.map((c) => y(c)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
292
+ if (s === 0) return e;
293
+ let i = r, o = e;
294
+ for (; Ke(i, 0) === !1; ) {
295
+ const c = n.findIndex((l) => s > 0 ? o >= l.lower && o < l.upper : o > l.lower && o <= l.upper);
296
+ if (c !== -1) {
297
+ const l = n[c];
298
+ let f;
299
+ if (s > 0 ? f = ae(l.upper, o) : f = ae(o, l.lower), f > 0) {
300
+ const p = _t(er(i), f);
301
+ if (o = Qt(
302
+ o,
303
+ s > 0 ? p : -p
304
+ ), i = ae(i, s > 0 ? p : -p), Ke(i, 0)) return o;
305
+ continue;
306
+ }
307
+ }
308
+ if (s > 0) {
309
+ const l = n.filter((f) => f.lower > o);
310
+ if (l.length > 0) o = l[0].lower;
311
+ else return o;
312
+ } else {
313
+ const l = n.filter((f) => f.upper < o);
314
+ if (l.length > 0)
315
+ o = l[l.length - 1].upper;
316
+ else return o;
317
+ }
318
+ }
319
+ return o;
320
+ }, sr = (t, e, r) => {
321
+ const n = t.map((o) => y(o));
322
+ if (e === r) return typeof e == "bigint" ? 0n : 0;
323
+ const s = e < r ? y([e, r]) : y([r, e]);
324
+ let i = typeof e == "bigint" ? 0n : 0;
325
+ for (const o of n) {
326
+ const c = o.lower > s.lower ? o.lower : s.lower, l = o.upper < s.upper ? o.upper : s.upper;
327
+ if (c < l) {
328
+ const f = l - c;
329
+ i = i + f;
330
+ }
331
+ }
332
+ return i;
333
+ }, po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
334
+ __proto__: null,
335
+ CLIP: jn,
336
+ DECIMAL: Cn,
337
+ INFINITE: Un,
338
+ ZERO: Bn,
339
+ bounds: Kt,
340
+ buildInsertionPlan: Zn,
341
+ clamp: Qe,
342
+ construct: y,
343
+ contains: I,
344
+ distance: sr,
345
+ equals: Rn,
346
+ findInsertPosition: _e,
347
+ isFinite: qn,
348
+ isZero: Dn,
349
+ linspace: Fn,
350
+ makeValid: tr,
351
+ max: rr,
352
+ mean: kn,
353
+ min: zn,
354
+ overlapsWith: Ln,
355
+ span: ye,
356
+ spanIsZero: Pn,
357
+ traverse: nr
358
+ }, Symbol.toStringTag, { value: "Module" })), ir = Sn, Z = (t) => Ce.includes(t) ? t : Re.includes(t) ? "y" : "x", Yn = (t) => Z(t) === "x" ? "y" : "x", Vn = (t) => Z(t) === "x" ? "width" : "height", Wn = (t) => Z(t) === "x" ? "left" : "top", Gn = (t) => ir.safeParse(t).success, Hn = (t) => Z(t) === "x" ? "signedWidth" : "signedHeight", Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
359
+ __proto__: null,
360
+ DIRECTIONS: Ce,
361
+ construct: Z,
362
+ crude: ir,
363
+ dimension: Vn,
364
+ direction: dt,
365
+ isDirection: Gn,
366
+ location: Wn,
367
+ signedDimension: Hn,
368
+ swap: Yn
369
+ }, Symbol.toStringTag, { value: "Module" })), Xn = gt, Kn = pt, Qn = Xe, _n = {
370
+ top: "bottom",
371
+ right: "left",
372
+ bottom: "top",
373
+ left: "right",
374
+ center: "center"
375
+ }, es = {
376
+ top: "left",
377
+ right: "top",
378
+ bottom: "right",
379
+ left: "bottom",
380
+ center: "center"
381
+ }, ts = Nn, k = (t) => t instanceof String || !Ce.includes(t) ? t : t === "x" ? "left" : "top", rs = (t) => _n[k(t)], ns = (t) => es[k(t)], fe = (t) => {
382
+ const e = k(t);
383
+ return e === "top" || e === "bottom" ? "y" : "x";
384
+ }, ss = a.object({
385
+ x: gt.or(Xe),
386
+ y: pt.or(Xe)
387
+ }), ar = a.object({ x: gt, y: pt }), me = Object.freeze({ x: "left", y: "top" }), bt = Object.freeze({ x: "right", y: "top" }), Le = Object.freeze({ x: "left", y: "bottom" }), wt = Object.freeze({ x: "right", y: "bottom" }), Ot = Object.freeze({ x: "center", y: "center" }), vt = Object.freeze({ x: "center", y: "top" }), Tt = Object.freeze({ x: "center", y: "bottom" }), xt = Object.freeze({ x: "right", y: "center" }), $t = Object.freeze({ x: "left", y: "center" }), is = Object.freeze([
388
+ $t,
389
+ xt,
390
+ vt,
391
+ Tt,
392
+ me,
393
+ bt,
394
+ Le,
395
+ wt,
396
+ Ot
397
+ ]), St = (t, e) => t.x === e.x && t.y === e.y, as = (t, e) => {
398
+ if (typeof e == "object") {
399
+ let r = !0;
400
+ return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
401
+ }
402
+ return t.x === e || t.y === e;
403
+ }, or = (t) => [t.x, t.y], Se = (t) => fe(k(t)) === "x", os = (t) => fe(k(t)) === "y", us = (t) => `${t.x}${Zt(t.y)}`, ls = (t, e) => {
404
+ let r, n;
405
+ if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = k(t), n = k(e ?? t)), fe(r) === fe(n) && r !== "center" && n !== "center")
406
+ throw new Error(
407
+ `[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
408
+ );
409
+ const s = { ...Ot };
410
+ return r === "center" ? Se(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Se(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Se(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
411
+ }, cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
412
+ __proto__: null,
413
+ BOTTOM_CENTER: Tt,
414
+ BOTTOM_LEFT: Le,
415
+ BOTTOM_RIGHT: wt,
416
+ CENTER: Ot,
417
+ CENTER_LEFT: $t,
418
+ CENTER_LOCATIONS: yt,
419
+ CENTER_RIGHT: xt,
420
+ TOP_CENTER: vt,
421
+ TOP_LEFT: me,
422
+ TOP_RIGHT: bt,
423
+ XY_LOCATIONS: is,
424
+ X_LOCATIONS: je,
425
+ Y_LOCATIONS: Re,
426
+ center: Qn,
427
+ construct: k,
428
+ constructXY: ls,
429
+ corner: ar,
430
+ crude: ts,
431
+ direction: fe,
432
+ isX: Se,
433
+ isY: os,
434
+ location: mt,
435
+ outer: vn,
436
+ rotate90: ns,
437
+ swap: rs,
438
+ x: Xn,
439
+ xy: ss,
440
+ xyCouple: or,
441
+ xyEquals: St,
442
+ xyMatches: as,
443
+ xyToString: us,
444
+ y: Kn
445
+ }, Symbol.toStringTag, { value: "Module" })), et = a.union([
446
+ a.number(),
447
+ he,
448
+ Ue,
449
+ ft,
450
+ mn,
451
+ Jt
452
+ ]), v = (t, e) => {
453
+ if (typeof t == "string") {
454
+ if (e === void 0) throw new Error("The y coordinate must be given.");
455
+ return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
456
+ }
457
+ 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 };
458
+ }, U = Object.freeze({ x: 0, y: 0 }), ur = Object.freeze({ x: 1, y: 1 }), hs = Object.freeze({ x: 1 / 0, y: 1 / 0 }), fs = Object.freeze({ x: NaN, y: NaN }), Ae = (t, e, r = 0) => {
459
+ const n = v(t), s = v(e);
460
+ 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;
461
+ }, ds = (t) => Ae(t, U), Nt = (t, e, r) => {
462
+ const n = v(t), s = v(e, r);
463
+ return { x: n.x * s.x, y: n.y * s.y };
464
+ }, lr = (t, e) => {
465
+ const r = v(t);
466
+ return { x: r.x + e, y: r.y };
467
+ }, cr = (t, e) => {
468
+ const r = v(t);
469
+ return { x: r.x, y: r.y + e };
470
+ }, de = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? lr(t, r) : cr(t, r) : [t, e, r ?? U, ...n].reduce((s, i) => {
471
+ const o = v(i);
472
+ return { x: s.x + o.x, y: s.y + o.y };
473
+ }, U), gs = (t, e, r) => {
474
+ const n = v(t);
475
+ return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
476
+ }, ps = (t, e) => {
477
+ const r = v(t), n = v(e);
478
+ return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
479
+ }, ys = (t, e) => {
480
+ const r = v(t), n = v(e);
481
+ return { x: n.x - r.x, y: n.y - r.y };
482
+ }, ms = (t) => {
483
+ const e = v(t);
484
+ return Number.isNaN(e.x) || Number.isNaN(e.y);
485
+ }, bs = (t) => {
486
+ const e = v(t);
487
+ return Number.isFinite(e.x) && Number.isFinite(e.y);
488
+ }, ws = (t) => {
489
+ const e = v(t);
490
+ return [e.x, e.y];
491
+ }, Os = (t) => {
492
+ const e = v(t);
493
+ return { left: e.x, top: e.y };
494
+ }, tt = (t, e = 0) => {
495
+ const r = v(t);
496
+ return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
497
+ }, ne = (t, e) => {
498
+ const r = v(t), n = v(e);
499
+ return { x: r.x - n.x, y: r.y - n.y };
500
+ }, se = (t) => {
501
+ const e = v(t), r = Math.hypot(e.x, e.y);
502
+ return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
503
+ }, hr = (t) => {
504
+ const e = v(t), r = Math.hypot(e.x, e.y);
505
+ return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
506
+ }, fr = (...t) => {
507
+ const e = t.reduce((r, n) => de(r, n), U);
508
+ return Nt(e, 1 / t.length);
509
+ }, vs = (t, e) => {
510
+ const r = [];
511
+ for (let n = 0; n < t.length; n++) {
512
+ const s = t[n];
513
+ let i, o, c, l;
514
+ if (n === 0) {
515
+ const f = t[n + 1], p = ne(f, s);
516
+ o = se(p), c = o, l = e;
517
+ } else if (n === t.length - 1) {
518
+ const f = t[n - 1], p = ne(s, f);
519
+ i = se(p), c = i, l = e;
520
+ } else {
521
+ const f = t[n - 1], p = t[n + 1], g = ne(s, f), S = ne(p, s);
522
+ i = se(g), o = se(S);
523
+ const E = Math.acos(
524
+ (g.x * S.x + g.y * S.y) / (Math.hypot(g.x, g.y) * Math.hypot(S.x, S.y))
525
+ ), te = Math.sin(E / 2);
526
+ te === 0 ? l = e : l = e / te, c = hr(fr(i, o));
527
+ }
528
+ r.push(Nt(c, l));
529
+ }
530
+ return r;
531
+ }, Ts = (t) => {
532
+ const e = v(t);
533
+ return { x: e.y, y: e.x };
534
+ }, rt = (t) => {
535
+ const e = v(t);
536
+ return { x: Math.round(e.x), y: Math.round(e.y) };
537
+ }, yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
538
+ __proto__: null,
539
+ INFINITY: hs,
540
+ NAN: fs,
541
+ ONE: ur,
542
+ ZERO: U,
543
+ average: fr,
544
+ calculateMiters: vs,
545
+ clientXY: Jt,
546
+ construct: v,
547
+ couple: ws,
548
+ crudeZ: et,
549
+ css: Os,
550
+ distance: ps,
551
+ equals: Ae,
552
+ isFinite: bs,
553
+ isNan: ms,
554
+ isZero: ds,
555
+ normal: se,
556
+ normalize: hr,
557
+ round: rt,
558
+ scale: Nt,
559
+ set: gs,
560
+ sub: ne,
561
+ swap: Ts,
562
+ translate: de,
563
+ translateX: lr,
564
+ translateY: cr,
565
+ translation: ys,
566
+ truncate: tt,
567
+ xy: he
568
+ }, Symbol.toStringTag, { value: "Module" })), we = a.union([a.number(), a.string()]), xs = a.object({
569
+ top: we,
570
+ left: we,
571
+ width: we,
572
+ height: we
573
+ }), $s = a.object({
574
+ left: a.number(),
575
+ top: a.number(),
576
+ right: a.number(),
577
+ bottom: a.number()
578
+ }), Ss = a.object({
579
+ one: he,
580
+ two: he,
581
+ root: ar
582
+ }), dr = { one: U, two: U, root: me }, Ns = { one: U, two: ur, root: Le }, gr = (t, e) => ({
583
+ one: t.one,
584
+ two: t.two,
585
+ root: e ?? t.root
586
+ }), O = (t, e, r = 0, n = 0, s) => {
587
+ const i = {
588
+ one: { ...U },
589
+ two: { ...U },
590
+ root: s ?? me
591
+ };
592
+ if (typeof t == "number") {
593
+ if (typeof e != "number")
594
+ throw new Error("Box constructor called with invalid arguments");
595
+ return i.one = { x: t, y: e }, i.two = { x: i.one.x + r, y: i.one.y + n }, i;
596
+ }
597
+ 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 = {
598
+ x: i.one.x + e.width,
599
+ y: i.one.y + e.height
600
+ } : "signedWidth" in e ? i.two = {
601
+ x: i.one.x + e.signedWidth,
602
+ y: i.one.y + e.signedHeight
603
+ } : i.two = e, i));
604
+ }, Is = (t, e, r) => {
605
+ const n = O(t);
606
+ if (typeof e == "string") {
607
+ if (r == null) throw new Error("Invalid arguments for resize");
608
+ const s = Z(e);
609
+ return O(
610
+ n.one,
611
+ void 0,
612
+ s === "x" ? r : z(n),
613
+ s === "y" ? r : F(n),
614
+ n.root
615
+ );
616
+ }
617
+ return O(n.one, e, void 0, void 0, n.root);
618
+ }, Ms = (t, e, r = !0) => {
619
+ const n = O(t);
620
+ let s = (i, o) => i < o;
621
+ return r && (s = (i, o) => i <= o), "one" in e ? s(P(n), P(e)) && s(W(e), W(n)) && s(q(n), q(e)) && s(G(e), G(n)) : s(P(n), e.x) && s(e.x, W(n)) && s(q(n), e.y) && s(e.y, G(n));
622
+ }, Es = (t, e) => Ae(t.one, e.one) && Ae(t.two, e.two) && St(t.root, e.root), pr = (t) => ({
623
+ width: z(t),
624
+ height: F(t)
625
+ }), As = (t) => ({
626
+ signedWidth: De(t),
627
+ signedHeight: Pe(t)
628
+ }), Bs = (t) => ({
629
+ top: q(t),
630
+ left: P(t),
631
+ width: z(t),
632
+ height: F(t)
633
+ }), It = (t, e, r = !1) => {
634
+ const n = Z(e) === "y" ? Pe(t) : De(t);
635
+ return r ? n : Math.abs(n);
636
+ }, j = (t, e) => {
637
+ const r = O(t);
638
+ return {
639
+ x: e.x === "center" ? nt(r).x : H(r, e.x),
640
+ y: e.y === "center" ? nt(r).y : H(r, e.y)
641
+ };
642
+ }, H = (t, e) => {
643
+ const r = O(t), n = or(r.root).includes(e) ? Math.min : Math.max;
644
+ return je.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
645
+ }, Us = (t) => t.one.x === t.two.x && t.one.y === t.two.y, z = (t) => It(t, "x"), F = (t) => It(t, "y"), De = (t) => {
646
+ const e = O(t);
647
+ return e.two.x - e.one.x;
648
+ }, Pe = (t) => {
649
+ const e = O(t);
650
+ return e.two.y - e.one.y;
651
+ }, yr = (t) => j(t, me), Cs = (t) => j(t, vt), js = (t) => j(t, bt), Rs = (t) => j(t, Le), Ls = (t) => j(t, Tt), Ds = (t) => j(t, wt), Ps = (t) => j(t, $t), qs = (t) => j(t, xt), W = (t) => H(t, "right"), G = (t) => H(t, "bottom"), P = (t) => H(t, "left"), q = (t) => H(t, "top"), nt = (t) => de(yr(t), {
652
+ x: De(t) / 2,
653
+ y: Pe(t) / 2
654
+ }), Mt = (t) => {
655
+ const e = O(t);
656
+ return e.root.x === "left" ? P(e) : W(e);
657
+ }, Et = (t) => {
658
+ const e = O(t);
659
+ return e.root.y === "top" ? q(e) : G(e);
660
+ }, ks = (t) => ({ x: Mt(t), y: Et(t) }), Ne = (t) => {
661
+ const e = O(t);
662
+ return { lower: e.one.x, upper: e.two.x };
663
+ }, Ie = (t) => {
664
+ const e = O(t);
665
+ return { lower: e.one.y, upper: e.two.y };
666
+ }, zs = (t, e) => gr(t, e), Fs = (t, e) => {
667
+ const r = O(t), n = je.includes(e) ? "x" : Re.includes(e) ? "y" : null;
668
+ if (n === null) throw new Error(`Invalid location: ${e}`);
669
+ const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
670
+ return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
671
+ }, Zs = (t, e) => {
672
+ const r = O(t), n = O(e), s = Mt(n) + (z(n) - z(r)) / 2, i = Et(n) + (F(n) - F(r)) / 2;
673
+ return O({ x: s, y: i }, pr(r));
674
+ }, mr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Ys = (t) => z(t) / F(t), Vs = (t, e, r) => {
675
+ if (typeof e == "string") {
676
+ if (r == null) throw new Error("Undefined amount passed into box.translate");
677
+ const s = Z(e);
678
+ e = v(s, r);
679
+ }
680
+ const n = O(t);
681
+ return O(
682
+ de(n.one, e),
683
+ de(n.two, e),
684
+ void 0,
685
+ void 0,
686
+ n.root
687
+ );
688
+ }, Ws = (t, e) => {
689
+ const r = Math.max(P(t), P(e)), n = Math.max(q(t), q(e)), s = Math.min(W(t), W(e)), i = Math.min(G(t), G(e));
690
+ return r > s || n > i ? dr : O({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
691
+ }, Gs = (t) => z(t) * F(t), Hs = (t, e) => {
692
+ const r = O(t);
693
+ return O(
694
+ tt(r.one, e),
695
+ tt(r.two, e),
696
+ void 0,
697
+ void 0,
698
+ r.root
699
+ );
700
+ }, Js = (t, e, r, n, s, i) => {
701
+ const o = { x: t, y: e }, c = { x: t + r, y: e + n };
702
+ return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), O(o, c, void 0, void 0, i);
703
+ }, Xs = (t) => {
704
+ const e = O(t);
705
+ return O(rt(e.one), rt(e.two), void 0, void 0, e.root);
706
+ }, mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
707
+ __proto__: null,
708
+ DECIMAL: Ns,
709
+ ZERO: dr,
710
+ area: Gs,
711
+ areaIsZero: Us,
712
+ aspect: Ys,
713
+ bottom: G,
714
+ bottomCenter: Ls,
715
+ bottomLeft: Rs,
716
+ bottomRight: Ds,
717
+ box: Ss,
718
+ center: nt,
719
+ centerLeft: Ps,
720
+ centerRight: qs,
721
+ construct: O,
722
+ constructWithAlternateRoot: Js,
723
+ contains: Ms,
724
+ copy: gr,
725
+ css: Bs,
726
+ cssBox: xs,
727
+ dim: It,
728
+ dims: pr,
729
+ domRect: $s,
730
+ edgePoints: Fs,
731
+ equals: Es,
732
+ height: F,
733
+ intersection: Ws,
734
+ isBox: mr,
735
+ left: P,
736
+ loc: H,
737
+ positionInCenter: Zs,
738
+ reRoot: zs,
739
+ resize: Is,
740
+ right: W,
741
+ root: ks,
742
+ round: Xs,
743
+ signedDims: As,
744
+ signedHeight: Pe,
745
+ signedWidth: De,
746
+ top: q,
747
+ topCenter: Cs,
748
+ topLeft: yr,
749
+ topRight: js,
750
+ translate: Vs,
751
+ truncate: Hs,
752
+ width: z,
753
+ x: Mt,
754
+ xBounds: Ne,
755
+ xyLoc: j,
756
+ y: Et,
757
+ yBounds: Ie
758
+ }, Symbol.toStringTag, { value: "Module" })), br = a.object({ signedWidth: a.number(), signedHeight: a.number() }), Ks = a.union([ft, br, he, Ue]), Qs = { width: 0, height: 0 }, _s = { width: 1, height: 1 }, M = (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 }, ei = (t, e) => {
759
+ if (e == null) return !1;
760
+ const r = M(t), n = M(e);
761
+ return r.width === n.width && r.height === n.height;
762
+ }, ti = (t) => {
763
+ const e = M(t);
764
+ return { width: e.height, height: e.width };
765
+ }, ri = (t) => {
766
+ const e = M(t);
767
+ return `0 0 ${e.width} ${e.height}`;
768
+ }, ni = (t) => {
769
+ const e = M(t);
770
+ return [e.width, e.height];
771
+ }, si = (t) => ({
772
+ width: Math.max(...t.map((e) => M(e).width)),
773
+ height: Math.max(...t.map((e) => M(e).height))
774
+ }), ii = (t) => ({
775
+ width: Math.min(...t.map((e) => M(e).width)),
776
+ height: Math.min(...t.map((e) => M(e).height))
777
+ }), ai = (t, e) => {
778
+ const r = M(t);
779
+ return { width: r.width * e, height: r.height * e };
780
+ }, bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
781
+ __proto__: null,
782
+ DECIMAL: _s,
783
+ ZERO: Qs,
784
+ construct: M,
785
+ couple: ni,
786
+ crude: Ks,
787
+ dimensions: ft,
788
+ equals: ei,
789
+ max: si,
790
+ min: ii,
791
+ scale: ai,
792
+ signed: br,
793
+ svgViewBox: ri,
794
+ swap: ti
795
+ }, Symbol.toStringTag, { value: "Module" })), oi = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, ui = a.object({ offset: et, scale: et }), li = a.object({ offset: a.number(), scale: a.number() }), ci = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
796
+ e,
797
+ s ? n - t : n + t
798
+ ], hi = (t) => (e, r, n, s) => [
799
+ e,
800
+ s ? n / t : n * t
801
+ ], fi = (t) => (e, r, n) => {
802
+ if (e === null) return [t, n];
803
+ const { lower: s, upper: i } = e, { lower: o, upper: c } = t, l = i - s, f = c - o;
804
+ if (r === "dimension") return [t, n * (f / l)];
805
+ const p = (n - s) * (f / l) + o;
806
+ return [t, p];
807
+ }, di = (t) => (e, r, n) => [t, n], gi = () => (t, e, r) => {
808
+ if (t === null) throw new Error("cannot invert without bounds");
809
+ if (e === "dimension") return [t, r];
810
+ const { lower: n, upper: s } = t;
811
+ return [t, s - (r - n)];
812
+ }, pi = (t) => (e, r, n) => {
813
+ const { lower: s, upper: i } = t;
814
+ return n = oi(n, s, i), [e, n];
815
+ };
816
+ let st = class K {
817
+ ops = [];
818
+ currBounds = null;
819
+ currType = null;
820
+ reversed = !1;
821
+ constructor() {
822
+ this.ops = [];
823
+ }
824
+ /**
825
+ * @returns a new scale with a translation as its first operation. Any number provided
826
+ * to the {@link pos} operation on the scale will be translated by the specified value.
827
+ * @param value - The amount to translate by.
828
+ */
829
+ static translate(e) {
830
+ return new K().translate(e);
831
+ }
832
+ /**
833
+ * @returns a new scale with a magnification as its first operation. Any number provided
834
+ * to the {@link pos} or {@link dim} operation will be multiplied by the specified value.
835
+ * @param value - The amount to translate by.
836
+ */
837
+ static magnify(e) {
838
+ return new K().magnify(e);
839
+ }
840
+ static scale(e, r) {
841
+ return new K().scale(e, r);
842
+ }
843
+ /**
844
+ * @returns a copy of the scale with a translation as its next operation. Any
845
+ * number provided to the {@link pos} method on the scale will be translated by the
846
+ * specified value.
847
+ * @param value - The amount to translate by.
848
+ */
849
+ translate(e) {
850
+ const r = this.new(), n = ci(e);
851
+ return n.type = "translate", r.ops.push(n), r;
852
+ }
853
+ /**
854
+ * @returns a copy of the scale with a translation as its next operation. Any number
855
+ * provided to the {@link pos} or {@link dim} method on the scale will be multiplied
856
+ * by the specified value.
857
+ * @param value - The amount to magnify by.
858
+ */
859
+ magnify(e) {
860
+ const r = this.new(), n = hi(e);
861
+ return n.type = "magnify", r.ops.push(n), r;
862
+ }
863
+ scale(e, r) {
864
+ const n = y(e, r), s = this.new(), i = fi(n);
865
+ return i.type = "scale", s.ops.push(i), s;
866
+ }
867
+ clamp(e, r) {
868
+ const n = y(e, r), s = this.new(), i = pi(n);
869
+ return i.type = "clamp", s.ops.push(i), s;
870
+ }
871
+ reBound(e, r) {
872
+ const n = y(e, r), s = this.new(), i = di(n);
873
+ return i.type = "re-bound", s.ops.push(i), s;
874
+ }
875
+ invert() {
876
+ const e = gi();
877
+ e.type = "invert";
878
+ const r = this.new();
879
+ return r.ops.push(e), r;
880
+ }
881
+ pos(e) {
882
+ return this.exec("position", e);
883
+ }
884
+ dim(e) {
885
+ return this.exec("dimension", e);
886
+ }
887
+ new() {
888
+ const e = new K();
889
+ return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
890
+ }
891
+ exec(e, r) {
892
+ return this.currBounds = null, this.ops.reduce(
893
+ ([n, s], i) => i(n, e, s, this.reversed),
894
+ [null, r]
895
+ )[1];
896
+ }
897
+ reverse() {
898
+ const e = this.new();
899
+ e.ops.reverse();
900
+ const r = [];
901
+ return e.ops.forEach((n, s) => {
902
+ if (n.type === "scale" || r.some(([o, c]) => s >= o && s <= c))
903
+ return;
904
+ const i = e.ops.findIndex((o, c) => o.type === "scale" && c > s);
905
+ i !== -1 && r.push([s, i]);
906
+ }), r.forEach(([n, s]) => {
907
+ const i = e.ops.slice(n, s);
908
+ i.unshift(e.ops[s]), e.ops.splice(n, s - n + 1, ...i);
909
+ }), e.reversed = !e.reversed, e;
910
+ }
911
+ get transform() {
912
+ return { scale: this.dim(1), offset: this.pos(0) };
913
+ }
914
+ static IDENTITY = new K();
915
+ }, yi = class A {
916
+ x;
917
+ y;
918
+ currRoot;
919
+ constructor(e = new st(), r = new st(), n = null) {
920
+ this.x = e, this.y = r, this.currRoot = n;
921
+ }
922
+ static translate(e, r) {
923
+ return new A().translate(e, r);
924
+ }
925
+ static translateX(e) {
926
+ return new A().translateX(e);
927
+ }
928
+ static translateY(e) {
929
+ return new A().translateY(e);
930
+ }
931
+ static clamp(e) {
932
+ return new A().clamp(e);
933
+ }
934
+ static magnify(e) {
935
+ return new A().magnify(e);
936
+ }
937
+ static scale(e) {
938
+ return new A().scale(e);
939
+ }
940
+ static reBound(e) {
941
+ return new A().reBound(e);
942
+ }
943
+ translate(e, r) {
944
+ const n = v(e, r), s = this.copy();
945
+ return s.x = this.x.translate(n.x), s.y = this.y.translate(n.y), s;
946
+ }
947
+ translateX(e) {
948
+ const r = this.copy();
949
+ return r.x = this.x.translate(e), r;
950
+ }
951
+ translateY(e) {
952
+ const r = this.copy();
953
+ return r.y = this.y.translate(e), r;
954
+ }
955
+ magnify(e) {
956
+ const r = this.copy();
957
+ return r.x = this.x.magnify(e.x), r.y = this.y.magnify(e.y), r;
958
+ }
959
+ scale(e) {
960
+ const r = this.copy();
961
+ if (mr(e)) {
962
+ const n = this.currRoot;
963
+ return r.currRoot = e.root, n != null && !St(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(Ne(e)), r.y = r.y.scale(Ie(e)), r;
964
+ }
965
+ return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
966
+ }
967
+ reBound(e) {
968
+ const r = this.copy();
969
+ return r.x = this.x.reBound(Ne(e)), r.y = this.y.reBound(Ie(e)), r;
970
+ }
971
+ clamp(e) {
972
+ const r = this.copy();
973
+ return r.x = this.x.clamp(Ne(e)), r.y = this.y.clamp(Ie(e)), r;
974
+ }
975
+ copy() {
976
+ const e = new A();
977
+ return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
978
+ }
979
+ reverse() {
980
+ const e = this.copy();
981
+ return e.x = this.x.reverse(), e.y = this.y.reverse(), e;
982
+ }
983
+ pos(e) {
984
+ return { x: this.x.pos(e.x), y: this.y.pos(e.y) };
985
+ }
986
+ dim(e) {
987
+ return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
988
+ }
989
+ box(e) {
990
+ return O(
991
+ this.pos(e.one),
992
+ this.pos(e.two),
993
+ 0,
994
+ 0,
995
+ this.currRoot ?? e.root
996
+ );
997
+ }
998
+ get transform() {
999
+ return {
1000
+ scale: this.dim({ x: 1, y: 1 }),
1001
+ offset: this.pos({ x: 0, y: 0 })
1002
+ };
1003
+ }
1004
+ static IDENTITY = new A();
1005
+ };
1006
+ const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1007
+ __proto__: null,
1008
+ Scale: st,
1009
+ XY: yi,
1010
+ crudeXYTransform: ui,
1011
+ transform: li
1012
+ }, Symbol.toStringTag, { value: "Module" }));
1013
+ let mi = (t, e = 21) => (r = e) => {
1014
+ let n = "", s = r | 0;
1015
+ for (; s--; )
1016
+ n += t[Math.random() * t.length | 0];
1017
+ return n;
1018
+ };
1019
+ const bi = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", wr = 11, wi = mi(bi, wr), At = () => wi(), Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1020
+ __proto__: null,
1021
+ LENGTH: wr,
1022
+ create: At
1023
+ }, Symbol.toStringTag, { value: "Module" })), Oi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, vi = a.enum(["static", "dynamic"]), Ti = a.union([
1024
+ a.tuple([a.int()]),
1025
+ a.tuple([a.int(), a.int().min(1).max(12)]),
1026
+ a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
1027
+ ]), Or = (t, e) => {
1028
+ const r = new b(e);
1029
+ if (![
1030
+ h.DAY,
1031
+ h.HOUR,
1032
+ h.MINUTE,
1033
+ h.SECOND,
1034
+ h.MILLISECOND,
1035
+ h.MICROSECOND,
1036
+ h.NANOSECOND
1037
+ ].some((s) => s.equals(r)))
1038
+ throw new Error(
1039
+ "Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
1040
+ );
1041
+ const n = t.valueOf() % r.valueOf();
1042
+ return t instanceof b ? new b(n) : new h(n);
1043
+ };
1044
+ let b = class d extends J {
1045
+ constructor(e, r = "UTC") {
1046
+ if (e == null) super(d.now().valueOf());
1047
+ else if (e instanceof Date)
1048
+ super(BigInt(e.getTime()) * d.MILLISECOND.valueOf());
1049
+ else if (typeof e == "string")
1050
+ super(d.parseDateTimeString(e, r).valueOf());
1051
+ else if (Array.isArray(e)) super(d.parseDate(e));
1052
+ else {
1053
+ let n = 0n;
1054
+ e instanceof Number && (e = e.valueOf()), r === "local" && (n = d.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = d.MAX : e = d.MIN)), super(BigInt(e.valueOf()) + n);
1055
+ }
1056
+ }
1057
+ static parseDate([e = 1970, r = 1, n = 1]) {
1058
+ const s = new Date(e, r - 1, n, 0, 0, 0, 0);
1059
+ return new d(BigInt(s.getTime()) * d.MILLISECOND.valueOf()).truncate(d.DAY).valueOf();
1060
+ }
1061
+ /**
1062
+ * @returns the primitive value of the TimeStamp. Overrides standard JS valueOf()
1063
+ * method.
1064
+ */
1065
+ valueOf() {
1066
+ return this.value;
1067
+ }
1068
+ static parseTimeString(e, r = "UTC") {
1069
+ const [n, s, i] = e.split(":");
1070
+ let o = "00", c = "00";
1071
+ i != null && ([o, c] = i.split("."));
1072
+ let l = d.hours(parseInt(n ?? "00")).add(d.minutes(parseInt(s ?? "00"))).add(d.seconds(parseInt(o ?? "00"))).add(d.milliseconds(parseInt(c ?? "00")));
1073
+ return r === "local" && (l = l.add(d.utcOffset)), l.valueOf();
1074
+ }
1075
+ static parseDateTimeString(e, r = "UTC") {
1076
+ if (!e.includes("/") && !e.includes("-"))
1077
+ return d.parseTimeString(e, r);
1078
+ const n = new Date(e);
1079
+ return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new d(
1080
+ BigInt(n.getTime()) * d.MILLISECOND.valueOf(),
1081
+ r
1082
+ ).valueOf();
1083
+ }
1084
+ /**
1085
+ * Formats the TimeStamp as a string in the specified format.
1086
+ *
1087
+ * @param format - The format to use for the string representation.
1088
+ * @param tzInfo - The timezone to use when creating the string representation.
1089
+ * @returns A string representation of the TimeStamp in the specified format.
1090
+ */
1091
+ fString(e = "ISO", r = "UTC") {
1092
+ switch (e) {
1093
+ case "ISODate":
1094
+ return this.toISOString(r).slice(0, 10);
1095
+ case "ISOTime":
1096
+ return this.toISOString(r).slice(11, 23);
1097
+ case "time":
1098
+ return this.timeString(!1, r);
1099
+ case "preciseTime":
1100
+ return this.timeString(!0, r);
1101
+ case "date":
1102
+ return this.dateString();
1103
+ case "preciseDate":
1104
+ return `${this.dateString()} ${this.timeString(!0, r)}`;
1105
+ case "dateTime":
1106
+ return `${this.dateString()} ${this.timeString(!1, r)}`;
1107
+ default:
1108
+ return this.toISOString(r);
1109
+ }
1110
+ }
1111
+ toISOString(e = "UTC") {
1112
+ return e === "UTC" ? this.date().toISOString() : this.sub(d.utcOffset).date().toISOString();
1113
+ }
1114
+ timeString(e = !1, r = "UTC") {
1115
+ const n = this.toISOString(r);
1116
+ return e ? n.slice(11, 23) : n.slice(11, 19);
1117
+ }
1118
+ dateString() {
1119
+ const e = this.date(), r = e.toLocaleString("default", { month: "short" }), n = e.toLocaleString("default", { day: "numeric" });
1120
+ return `${r} ${n}`;
1121
+ }
1122
+ /** @returns The UTC offset for the time zone of the machine. */
1123
+ static get utcOffset() {
1124
+ return new h(
1125
+ BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * d.MINUTE.valueOf()
1126
+ );
1127
+ }
1128
+ /**
1129
+ * @returns a TimeSpan representing the amount time elapsed since
1130
+ * the other timestamp.
1131
+ * @param other - The other timestamp.
1132
+ */
1133
+ static since(e) {
1134
+ return new d().span(e);
1135
+ }
1136
+ /** @returns A JavaScript Date object representing the TimeStamp. */
1137
+ date() {
1138
+ return new Date(this.milliseconds);
1139
+ }
1140
+ /**
1141
+ * Checks if the TimeStamp is equal to another TimeStamp.
1142
+ *
1143
+ * @param other - The other TimeStamp to compare to.
1144
+ * @returns True if the TimeStamps are equal, false otherwise.
1145
+ */
1146
+ equals(e) {
1147
+ return this.valueOf() === new d(e).valueOf();
1148
+ }
1149
+ /**
1150
+ * Creates a TimeSpan representing the duration between the two timestamps.
1151
+ *
1152
+ * @param other - The other TimeStamp to compare to.
1153
+ * @returns A TimeSpan representing the duration between the two timestamps.
1154
+ * The span is guaranteed to be positive.
1155
+ */
1156
+ span(e) {
1157
+ return this.range(e).span;
1158
+ }
1159
+ /**
1160
+ * Creates a TimeRange spanning the given TimeStamp.
1161
+ *
1162
+ * @param other - The other TimeStamp to compare to.
1163
+ * @returns A TimeRange spanning the given TimeStamp that is guaranteed to be
1164
+ * valid, regardless of the TimeStamp order.
1165
+ */
1166
+ range(e) {
1167
+ return new V(this, e).makeValid();
1168
+ }
1169
+ /**
1170
+ * Creates a TimeRange starting at the TimeStamp and spanning the given
1171
+ * TimeSpan.
1172
+ *
1173
+ * @param other - The TimeSpan to span.
1174
+ * @returns A TimeRange starting at the TimeStamp and spanning the given
1175
+ * TimeSpan. The TimeRange is guaranteed to be valid.
1176
+ */
1177
+ spanRange(e) {
1178
+ return this.range(this.add(e)).makeValid();
1179
+ }
1180
+ /**
1181
+ * Checks if the TimeStamp represents the unix epoch.
1182
+ *
1183
+ * @returns True if the TimeStamp represents the unix epoch, false otherwise.
1184
+ */
1185
+ get isZero() {
1186
+ return this.valueOf() === 0n;
1187
+ }
1188
+ /**
1189
+ * Checks if the TimeStamp is after the given TimeStamp.
1190
+ *
1191
+ * @param other - The other TimeStamp to compare to.
1192
+ * @returns True if the TimeStamp is after the given TimeStamp, false
1193
+ * otherwise.
1194
+ */
1195
+ after(e) {
1196
+ return this.valueOf() > new d(e).valueOf();
1197
+ }
1198
+ /**
1199
+ * Checks if the TimeStamp is after or equal to the given TimeStamp.
1200
+ *
1201
+ * @param other - The other TimeStamp to compare to.
1202
+ * @returns True if the TimeStamp is after or equal to the given TimeStamp,
1203
+ * false otherwise.
1204
+ */
1205
+ afterEq(e) {
1206
+ return this.valueOf() >= new d(e).valueOf();
1207
+ }
1208
+ /**
1209
+ * Checks if the TimeStamp is before the given TimeStamp.
1210
+ *
1211
+ * @param other - The other TimeStamp to compare to.
1212
+ * @returns True if the TimeStamp is before the given TimeStamp, false
1213
+ * otherwise.
1214
+ */
1215
+ before(e) {
1216
+ return this.valueOf() < new d(e).valueOf();
1217
+ }
1218
+ /**
1219
+ * Checks if TimeStamp is before or equal to the current timestamp.
1220
+ *
1221
+ * @param other - The other TimeStamp to compare to.
1222
+ * @returns True if TimeStamp is before or equal to the current timestamp,
1223
+ * false otherwise.
1224
+ */
1225
+ beforeEq(e) {
1226
+ return this.valueOf() <= new d(e).valueOf();
1227
+ }
1228
+ /**
1229
+ * Adds a TimeSpan to the TimeStamp.
1230
+ *
1231
+ * @param span - The TimeSpan to add.
1232
+ * @returns A new TimeStamp representing the sum of the TimeStamp and
1233
+ * TimeSpan.
1234
+ */
1235
+ add(e) {
1236
+ return new d(this.valueOf() + BigInt(e.valueOf()));
1237
+ }
1238
+ /**
1239
+ * Subtracts a TimeSpan from the TimeStamp.
1240
+ *
1241
+ * @param span - The TimeSpan to subtract.
1242
+ * @returns A new TimeStamp representing the difference of the TimeStamp and
1243
+ * TimeSpan.
1244
+ */
1245
+ sub(e) {
1246
+ return new d(this.valueOf() - BigInt(e.valueOf()));
1247
+ }
1248
+ /**
1249
+ * @returns the floating point number of hours since the unix epoch to the timestamp
1250
+ * value.
1251
+ */
1252
+ get hours() {
1253
+ return Number(this.valueOf()) / Number(h.HOUR.valueOf());
1254
+ }
1255
+ /**
1256
+ * @returns the floating point number of minutes since the unix epoch to the timestamp
1257
+ * value.
1258
+ */
1259
+ get minutes() {
1260
+ return Number(this.valueOf()) / Number(h.MINUTE.valueOf());
1261
+ }
1262
+ /**
1263
+ * @returns the floating point number of days since the unix epoch to the timestamp
1264
+ * value.
1265
+ */
1266
+ get days() {
1267
+ return Number(this.valueOf()) / Number(h.DAY.valueOf());
1268
+ }
1269
+ /**
1270
+ * @returns the floating point number of seconds since the unix epoch to the timestamp
1271
+ * value.
1272
+ */
1273
+ get seconds() {
1274
+ return Number(this.valueOf()) / Number(h.SECOND.valueOf());
1275
+ }
1276
+ /** @returns the floating point number of milliseconds since the unix epoch. */
1277
+ get milliseconds() {
1278
+ return Number(this.valueOf()) / Number(d.MILLISECOND.valueOf());
1279
+ }
1280
+ /** @returns the floating point number of microseconds since the unix epoch. */
1281
+ get microseconds() {
1282
+ return Number(this.valueOf()) / Number(d.MICROSECOND.valueOf());
1283
+ }
1284
+ /**
1285
+ * @returns the floating point number of nanoseconds since the unix epoch.
1286
+ * Note that since we're converting to float64, this reduces the resolution
1287
+ * to a quarter of a microsecond.
1288
+ */
1289
+ get nanoseconds() {
1290
+ return Number(this.valueOf());
1291
+ }
1292
+ /** @returns the integer year that the timestamp corresponds to. */
1293
+ get year() {
1294
+ return this.date().getUTCFullYear();
1295
+ }
1296
+ /**
1297
+ * @returns a copy of the timestamp with the year changed.
1298
+ * @param year the value to set the year to.
1299
+ */
1300
+ setYear(e) {
1301
+ const r = this.date();
1302
+ return r.setUTCFullYear(e), new d(r);
1303
+ }
1304
+ /** @returns the integer month that the timestamp corresponds to with its year. */
1305
+ get month() {
1306
+ return this.date().getUTCMonth();
1307
+ }
1308
+ /**
1309
+ * @returns a copy of the timestamp with the month changed.
1310
+ * @param month the value to set the month to.
1311
+ */
1312
+ setMonth(e) {
1313
+ const r = this.date();
1314
+ return r.setUTCMonth(e), new d(r);
1315
+ }
1316
+ /** @returns the integer day that the timestamp corresponds to within its month. */
1317
+ get day() {
1318
+ return this.date().getUTCDate();
1319
+ }
1320
+ /**
1321
+ * @returns a copy of the timestamp with the day changed.
1322
+ * @param day the value the set the day to.
1323
+ */
1324
+ setDay(e) {
1325
+ const r = this.date();
1326
+ return r.setUTCDate(e), new d(r);
1327
+ }
1328
+ /**
1329
+ * @returns the integer hour that the timestamp corresponds to within its day.
1330
+ */
1331
+ get hour() {
1332
+ return this.date().getUTCHours();
1333
+ }
1334
+ /**
1335
+ * @returns a copy of the timestamp with the hour changed.
1336
+ * @param hour the value to set the hour to.
1337
+ */
1338
+ setHour(e) {
1339
+ const r = this.date();
1340
+ return r.setUTCHours(e), new d(r, "UTC");
1341
+ }
1342
+ /** @returns the integer minute that the timestamp corresponds to within its hour. */
1343
+ get minute() {
1344
+ return this.date().getUTCMinutes();
1345
+ }
1346
+ /**
1347
+ * @returns a copy of the timestamp with the minute changed.
1348
+ * @param minute the value to set the minute to.
1349
+ */
1350
+ setMinute(e) {
1351
+ const r = this.date();
1352
+ return r.setUTCMinutes(e), new d(r);
1353
+ }
1354
+ /**
1355
+ * @returns the integer second that the timestamp corresponds to within its
1356
+ * minute.
1357
+ */
1358
+ get second() {
1359
+ return this.date().getUTCSeconds();
1360
+ }
1361
+ /**
1362
+ * @returns a copy of the timestamp with the second changed.
1363
+ * @param second the value to set the second to.
1364
+ */
1365
+ setSecond(e) {
1366
+ const r = this.date();
1367
+ return r.setUTCSeconds(e), new d(r);
1368
+ }
1369
+ /**
1370
+ * @reutrns the integer millisecond that the timestamp corresponds to within
1371
+ * its second.
1372
+ */
1373
+ get millisecond() {
1374
+ return this.date().getUTCMilliseconds();
1375
+ }
1376
+ /**
1377
+ * @returns a copy of the timestamp with the milliseconds changed.
1378
+ * @param millisecond the value to set the millisecond to.
1379
+ */
1380
+ setMillisecond(e) {
1381
+ const r = this.date();
1382
+ return r.setUTCMilliseconds(e), new d(r);
1383
+ }
1384
+ /** @returns the time stamp formatted as an ISO string. */
1385
+ toString() {
1386
+ return this.date().toISOString();
1387
+ }
1388
+ /**
1389
+ * @returns A new TimeStamp that is the remainder of the TimeStamp divided by the
1390
+ * given span. This is useful in cases where you want only part of a TimeStamp's value
1391
+ * i.e., the hours, minutes, seconds, milliseconds, microseconds, and nanoseconds but
1392
+ * not the days, years, etc.
1393
+ *
1394
+ * @param divisor - The TimeSpan to divide by. Must be an even TimeSpan or TimeStamp. Even
1395
+ * means it must be a day, hour, minute, second, millisecond, or microsecond, etc.
1396
+ *
1397
+ * @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
1398
+ */
1399
+ remainder(e) {
1400
+ return Or(this, e);
1401
+ }
1402
+ /** @returns true if the day portion TimeStamp is today, false otherwise. */
1403
+ get isToday() {
1404
+ return this.truncate(h.DAY).equals(d.now().truncate(h.DAY));
1405
+ }
1406
+ /**
1407
+ * Truncates the TimeStamp to the nearest multiple of the given span.
1408
+ *
1409
+ * @param span - The TimeSpan to truncate to.
1410
+ * @returns A new TimeStamp that is truncated to the nearest multiple of the given span.
1411
+ */
1412
+ truncate(e) {
1413
+ return this.sub(this.remainder(e));
1414
+ }
1415
+ /**
1416
+ * @returns A new TimeStamp representing the current time in UTC. It's important to
1417
+ * note that this TimeStamp is only accurate to the millisecond level (that's the best
1418
+ * JavaScript can do).
1419
+ */
1420
+ static now() {
1421
+ return new d(/* @__PURE__ */ new Date());
1422
+ }
1423
+ /**
1424
+ * Finds the maximum timestamp among the provided timestamps.
1425
+ *
1426
+ * @param timestamps - The timestamps to compare.
1427
+ * @returns The maximum (latest) timestamp from the input.
1428
+ */
1429
+ static max(...e) {
1430
+ let r = d.MIN;
1431
+ for (const n of e) {
1432
+ const s = new d(n);
1433
+ s.after(r) && (r = s);
1434
+ }
1435
+ return r;
1436
+ }
1437
+ /**
1438
+ * Finds the minimum timestamp among the provided timestamps.
1439
+ *
1440
+ * @param timestamps - The timestamps to compare.
1441
+ * @returns The minimum (earliest) timestamp from the input.
1442
+ */
1443
+ static min(...e) {
1444
+ let r = d.MAX;
1445
+ for (const n of e) {
1446
+ const s = new d(n);
1447
+ s.before(r) && (r = s);
1448
+ }
1449
+ return r;
1450
+ }
1451
+ /**
1452
+ * Creates a TimeStamp representing the given number of nanoseconds.
1453
+ *
1454
+ * @param value - The number of nanoseconds.
1455
+ * @returns A TimeStamp representing the given number of nanoseconds.
1456
+ */
1457
+ static nanoseconds(e, r = "UTC") {
1458
+ return new d(e, r);
1459
+ }
1460
+ /** One nanosecond after the unix epoch */
1461
+ static NANOSECOND = d.nanoseconds(1);
1462
+ /** @returns a new TimeStamp n microseconds after the unix epoch */
1463
+ static microseconds(e, r = "UTC") {
1464
+ return d.nanoseconds(e * 1e3, r);
1465
+ }
1466
+ /** One microsecond after the unix epoch */
1467
+ static MICROSECOND = d.microseconds(1);
1468
+ /** @returns a new TimeStamp n milliseconds after the unix epoch */
1469
+ static milliseconds(e, r = "UTC") {
1470
+ return d.microseconds(e * 1e3, r);
1471
+ }
1472
+ /** One millisecond after the unix epoch */
1473
+ static MILLISECOND = d.milliseconds(1);
1474
+ /** @returns a new TimeStamp n seconds after the unix epoch */
1475
+ static seconds(e, r = "UTC") {
1476
+ return d.milliseconds(e * 1e3, r);
1477
+ }
1478
+ /** One second after the unix epoch */
1479
+ static SECOND = d.seconds(1);
1480
+ /** @returns a new TimeStamp n minutes after the unix epoch */
1481
+ static minutes(e, r = "UTC") {
1482
+ return d.seconds(e * 60, r);
1483
+ }
1484
+ /** One minute after the unix epoch */
1485
+ static MINUTE = d.minutes(1);
1486
+ /** @returns a new TimeStamp n hours after the unix epoch */
1487
+ static hours(e, r = "UTC") {
1488
+ return d.minutes(e * 60, r);
1489
+ }
1490
+ /** One hour after the unix epoch */
1491
+ static HOUR = d.hours(1);
1492
+ /** @returns a new TimeStamp n days after the unix epoch */
1493
+ static days(e, r = "UTC") {
1494
+ return d.hours(e * 24, r);
1495
+ }
1496
+ /** One day after the unix epoch */
1497
+ static DAY = d.days(1);
1498
+ /** The maximum possible value for a timestamp */
1499
+ static MAX = new d((1n << 63n) - 1n);
1500
+ /** The minimum possible value for a timestamp */
1501
+ static MIN = new d(0);
1502
+ /** The unix epoch */
1503
+ static ZERO = new d(0);
1504
+ /** A zod schema for validating timestamps */
1505
+ static z = a.union([
1506
+ a.instanceof(d),
1507
+ a.object({ value: a.bigint() }).transform((e) => new d(e.value)),
1508
+ a.string().transform((e) => new d(BigInt(e))),
1509
+ a.number().transform((e) => new d(e)),
1510
+ a.bigint().transform((e) => new d(e)),
1511
+ a.date().transform((e) => new d(e)),
1512
+ a.custom((e) => e instanceof h).transform((e) => new d(e)),
1513
+ Ti.transform((e) => new d(e))
1514
+ ]);
1515
+ /**
1516
+ * Sorts two timestamps.
1517
+ *
1518
+ * @param a - The first timestamp.
1519
+ * @param b - The second timestamp.
1520
+ * @returns A number indicating the order of the two timestamps (positive if a is
1521
+ * greater than b, negative if a is less than b, and 0 if they are equal).
1522
+ */
1523
+ static sort(e, r) {
1524
+ return Number(e.valueOf() - r.valueOf());
1525
+ }
1526
+ };
1527
+ class h extends J {
1528
+ constructor(e) {
1529
+ typeof e == "number" && (e = Math.trunc(e.valueOf())), super(BigInt(e.valueOf()));
1530
+ }
1531
+ /**
1532
+ * Creates a TimeSpan representing the given number of seconds.
1533
+ *
1534
+ * @param span - The number of seconds.
1535
+ * @returns A TimeSpan representing the given number of seconds.
1536
+ */
1537
+ static fromSeconds(e) {
1538
+ return e instanceof h ? e : e instanceof Lt ? e.period : e instanceof b ? new h(e) : ["number", "bigint"].includes(typeof e) ? h.seconds(e) : new h(e);
1539
+ }
1540
+ /**
1541
+ * Creates a TimeSpan representing the given number of milliseconds.
1542
+ *
1543
+ * @param span - The number of milliseconds.
1544
+ * @returns A TimeSpan representing the given number of milliseconds.
1545
+ */
1546
+ static fromMilliseconds(e) {
1547
+ return e instanceof h ? e : e instanceof Lt ? e.period : e instanceof b ? new h(e) : ["number", "bigint"].includes(typeof e) ? h.milliseconds(e) : new h(e);
1548
+ }
1549
+ /**
1550
+ * @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
1551
+ * method.
1552
+ */
1553
+ valueOf() {
1554
+ return this.value;
1555
+ }
1556
+ /**
1557
+ * Checks if the TimeSpan is less than another TimeSpan.
1558
+ *
1559
+ * @param other - The TimeSpan to compare against.
1560
+ * @returns True if the TimeSpan is less than the other TimeSpan, false otherwise.
1561
+ */
1562
+ lessThan(e) {
1563
+ return this.valueOf() < new h(e).valueOf();
1564
+ }
1565
+ /**
1566
+ * Checks if the TimeSpan is greater than another TimeSpan.
1567
+ *
1568
+ * @param other - The TimeSpan to compare against.
1569
+ * @returns True if the TimeSpan is greater than the other TimeSpan, false otherwise.
1570
+ */
1571
+ greaterThan(e) {
1572
+ return this.valueOf() > new h(e).valueOf();
1573
+ }
1574
+ /**
1575
+ * Checks if the TimeSpan is less than or equal to another TimeSpan.
1576
+ *
1577
+ * @param other - The TimeSpan to compare against.
1578
+ * @returns True if the TimeSpan is less than or equal to the other TimeSpan, false otherwise.
1579
+ */
1580
+ lessThanOrEqual(e) {
1581
+ return this.valueOf() <= new h(e).valueOf();
1582
+ }
1583
+ /**
1584
+ * Checks if the TimeSpan is greater than or equal to another TimeSpan.
1585
+ *
1586
+ * @param other - The TimeSpan to compare against.
1587
+ * @returns True if the TimeSpan is greater than or equal to the other TimeSpan, false otherwise.
1588
+ */
1589
+ greaterThanOrEqual(e) {
1590
+ return this.valueOf() >= new h(e).valueOf();
1591
+ }
1592
+ /**
1593
+ * Calculates the remainder of the TimeSpan when divided by another TimeSpan.
1594
+ *
1595
+ * @param divisor - The TimeSpan to divide by.
1596
+ * @returns A new TimeSpan representing the remainder.
1597
+ */
1598
+ remainder(e) {
1599
+ return Or(this, e);
1600
+ }
1601
+ /**
1602
+ * Truncates the TimeSpan to the nearest multiple of the given span.
1603
+ *
1604
+ * @param span - The TimeSpan to truncate to.
1605
+ * @returns A new TimeSpan that is truncated to the nearest multiple of the given span.
1606
+ */
1607
+ truncate(e) {
1608
+ return new h(
1609
+ BigInt(Math.trunc(Number(this.valueOf() / e.valueOf()))) * e.valueOf()
1610
+ );
1611
+ }
1612
+ /**
1613
+ * Returns a string representation of the TimeSpan.
1614
+ *
1615
+ * @returns A string representation of the TimeSpan.
1616
+ */
1617
+ toString() {
1618
+ const e = this.truncate(h.DAY), r = this.truncate(h.HOUR), n = this.truncate(h.MINUTE), s = this.truncate(h.SECOND), i = this.truncate(h.MILLISECOND), o = this.truncate(h.MICROSECOND), c = this.truncate(h.NANOSECOND), l = e, f = r.sub(e), p = n.sub(r), g = s.sub(n), S = i.sub(s), E = o.sub(i), te = c.sub(o);
1619
+ let R = "";
1620
+ return l.isZero || (R += `${l.days}d `), f.isZero || (R += `${f.hours}h `), p.isZero || (R += `${p.minutes}m `), g.isZero || (R += `${g.seconds}s `), S.isZero || (R += `${S.milliseconds}ms `), E.isZero || (R += `${E.microseconds}µs `), te.isZero || (R += `${te.nanoseconds}ns`), R.trim();
1621
+ }
1622
+ /**
1623
+ * Multiplies the TimeSpan by a scalar value.
1624
+ *
1625
+ * @param value - The scalar value to multiply by.
1626
+ * @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
1627
+ */
1628
+ mult(e) {
1629
+ return new h(this.valueOf() * BigInt(e));
1630
+ }
1631
+ /** @returns the decimal number of days in the TimeSpan. */
1632
+ get days() {
1633
+ return Number(this.valueOf()) / Number(h.DAY.valueOf());
1634
+ }
1635
+ /** @returns the decimal number of hours in the TimeSpan. */
1636
+ get hours() {
1637
+ return Number(this.valueOf()) / Number(h.HOUR.valueOf());
1638
+ }
1639
+ /** @returns the decimal number of minutes in the TimeSpan. */
1640
+ get minutes() {
1641
+ return Number(this.valueOf()) / Number(h.MINUTE.valueOf());
1642
+ }
1643
+ /** @returns The number of seconds in the TimeSpan. */
1644
+ get seconds() {
1645
+ return Number(this.valueOf()) / Number(h.SECOND.valueOf());
1646
+ }
1647
+ /** @returns The number of milliseconds in the TimeSpan. */
1648
+ get milliseconds() {
1649
+ return Number(this.valueOf()) / Number(h.MILLISECOND.valueOf());
1650
+ }
1651
+ /** @returns The number of microseconds in the TimeSpan. */
1652
+ get microseconds() {
1653
+ return Number(this.valueOf()) / Number(h.MICROSECOND.valueOf());
1654
+ }
1655
+ /** @returns The number of nanoseconds in the TimeSpan. */
1656
+ get nanoseconds() {
1657
+ return Number(this.valueOf());
1658
+ }
1659
+ /**
1660
+ * Checks if the TimeSpan represents a zero duration.
1661
+ *
1662
+ * @returns True if the TimeSpan represents a zero duration, false otherwise.
1663
+ */
1664
+ get isZero() {
1665
+ return this.valueOf() === 0n;
1666
+ }
1667
+ /**
1668
+ * Checks if the TimeSpan is equal to another TimeSpan.
1669
+ *
1670
+ * @returns True if the TimeSpans are equal, false otherwise.
1671
+ */
1672
+ equals(e) {
1673
+ return this.valueOf() === new h(e).valueOf();
1674
+ }
1675
+ /**
1676
+ * Adds a TimeSpan to the TimeSpan.
1677
+ *
1678
+ * @returns A new TimeSpan representing the sum of the two TimeSpans.
1679
+ */
1680
+ add(e) {
1681
+ return new h(this.valueOf() + new h(e).valueOf());
1682
+ }
1683
+ /**
1684
+ * Creates a TimeSpan representing the duration between the two timestamps.
1685
+ *
1686
+ * @param other
1687
+ */
1688
+ sub(e) {
1689
+ return new h(this.valueOf() - new h(e).valueOf());
1690
+ }
1691
+ /**
1692
+ * Creates a TimeSpan representing the given number of nanoseconds.
1693
+ *
1694
+ * @param value - The number of nanoseconds.
1695
+ * @returns A TimeSpan representing the given number of nanoseconds.
1696
+ */
1697
+ static nanoseconds(e = 1) {
1698
+ return new h(e);
1699
+ }
1700
+ /** A nanosecond. */
1701
+ static NANOSECOND = h.nanoseconds(1);
1702
+ /**
1703
+ * Creates a TimeSpan representing the given number of microseconds.
1704
+ *
1705
+ * @param value - The number of microseconds.
1706
+ * @returns A TimeSpan representing the given number of microseconds.
1707
+ */
1708
+ static microseconds(e = 1) {
1709
+ return h.nanoseconds(Y(e, 1e3));
1710
+ }
1711
+ /** A microsecond. */
1712
+ static MICROSECOND = h.microseconds(1);
1713
+ /**
1714
+ * Creates a TimeSpan representing the given number of milliseconds.
1715
+ *
1716
+ * @param value - The number of milliseconds.
1717
+ * @returns A TimeSpan representing the given number of milliseconds.
1718
+ */
1719
+ static milliseconds(e = 1) {
1720
+ return h.microseconds(Y(e, 1e3));
1721
+ }
1722
+ /** A millisecond. */
1723
+ static MILLISECOND = h.milliseconds(1);
1724
+ /**
1725
+ * Creates a TimeSpan representing the given number of seconds.
1726
+ *
1727
+ * @param value - The number of seconds.
1728
+ * @returns A TimeSpan representing the given number of seconds.
1729
+ */
1730
+ static seconds(e = 1) {
1731
+ return h.milliseconds(Y(e, 1e3));
1732
+ }
1733
+ /** A second. */
1734
+ static SECOND = h.seconds(1);
1735
+ /**
1736
+ * Creates a TimeSpan representing the given number of minutes.
1737
+ *
1738
+ * @param value - The number of minutes.
1739
+ * @returns A TimeSpan representing the given number of minutes.
1740
+ */
1741
+ static minutes(e = 1) {
1742
+ return h.seconds(Y(e, 60));
1743
+ }
1744
+ /** A minute. */
1745
+ static MINUTE = h.minutes(1);
1746
+ /**
1747
+ * Creates a TimeSpan representing the given number of hours.
1748
+ *
1749
+ * @param value - The number of hours.
1750
+ * @returns A TimeSpan representing the given number of hours.
1751
+ */
1752
+ static hours(e) {
1753
+ return h.minutes(Y(e, 60));
1754
+ }
1755
+ /** Represents an hour. */
1756
+ static HOUR = h.hours(1);
1757
+ /**
1758
+ * Creates a TimeSpan representing the given number of days.
1759
+ *
1760
+ * @param value - The number of days.
1761
+ * @returns A TimeSpan representing the given number of days.
1762
+ */
1763
+ static days(e) {
1764
+ return h.hours(Y(e, 24));
1765
+ }
1766
+ /** Represents a day. */
1767
+ static DAY = h.days(1);
1768
+ /** The maximum possible value for a TimeSpan. */
1769
+ static MAX = new h((1n << 63n) - 1n);
1770
+ /** The minimum possible value for a TimeSpan. */
1771
+ static MIN = new h(0);
1772
+ /** The zero value for a TimeSpan. */
1773
+ static ZERO = new h(0);
1774
+ /** A zod schema for validating and transforming timespans */
1775
+ static z = a.union([
1776
+ a.object({ value: a.bigint() }).transform((e) => new h(e.value)),
1777
+ a.string().transform((e) => new h(BigInt(e))),
1778
+ a.number().transform((e) => new h(e)),
1779
+ a.instanceof(h)
1780
+ ]);
1781
+ }
1782
+ let Lt = class Q extends J {
1783
+ constructor(e) {
1784
+ super(e.valueOf());
1785
+ }
1786
+ /** @returns a pretty string representation of the rate in the format "X Hz". */
1787
+ toString() {
1788
+ return `${this.valueOf()} Hz`;
1789
+ }
1790
+ /** @returns The number of seconds in the Rate. */
1791
+ equals(e) {
1792
+ return this.valueOf() === new Q(e).valueOf();
1793
+ }
1794
+ /**
1795
+ * Calculates the period of the Rate as a TimeSpan.
1796
+ *
1797
+ * @returns A TimeSpan representing the period of the Rate.
1798
+ */
1799
+ get period() {
1800
+ return h.seconds(1 / this.valueOf());
1801
+ }
1802
+ /**
1803
+ * Calculates the number of samples in the given TimeSpan at this rate.
1804
+ *
1805
+ * @param duration - The duration to calculate the sample count from.
1806
+ * @returns The number of samples in the given TimeSpan at this rate.
1807
+ */
1808
+ sampleCount(e) {
1809
+ return new h(e).seconds * this.valueOf();
1810
+ }
1811
+ /**
1812
+ * Calculates the number of bytes in the given TimeSpan at this rate.
1813
+ *
1814
+ * @param span - The duration to calculate the byte count from.
1815
+ * @param density - The density of the data in bytes per sample.
1816
+ * @returns The number of bytes in the given TimeSpan at this rate.
1817
+ */
1818
+ byteCount(e, r) {
1819
+ return this.sampleCount(e) * new N(r).valueOf();
1820
+ }
1821
+ /**
1822
+ * Calculates a TimeSpan given the number of samples at this rate.
1823
+ *
1824
+ * @param sampleCount - The number of samples in the span.
1825
+ * @returns A TimeSpan that corresponds to the given number of samples.
1826
+ */
1827
+ span(e) {
1828
+ return h.seconds(e / this.valueOf());
1829
+ }
1830
+ /**
1831
+ * Calculates a TimeSpan given the number of bytes at this rate.
1832
+ *
1833
+ * @param size - The number of bytes in the span.
1834
+ * @param density - The density of the data in bytes per sample.
1835
+ * @returns A TimeSpan that corresponds to the given number of bytes.
1836
+ */
1837
+ byteSpan(e, r) {
1838
+ return this.span(e.valueOf() / r.valueOf());
1839
+ }
1840
+ /**
1841
+ * Creates a Rate representing the given number of Hz.
1842
+ *
1843
+ * @param value - The number of Hz.
1844
+ * @returns A Rate representing the given number of Hz.
1845
+ */
1846
+ static hz(e) {
1847
+ return new Q(e);
1848
+ }
1849
+ /**
1850
+ * Creates a Rate representing the given number of kHz.
1851
+ *
1852
+ * @param value - The number of kHz.
1853
+ * @returns A Rate representing the given number of kHz.
1854
+ */
1855
+ static khz(e) {
1856
+ return Q.hz(e * 1e3);
1857
+ }
1858
+ /** A zod schema for validating and transforming rates */
1859
+ static z = a.union([
1860
+ a.number().transform((e) => new Q(e)),
1861
+ a.instanceof(Q)
1862
+ ]);
1863
+ }, N = class C extends J {
1864
+ /**
1865
+ * Creates a Density representing the given number of bytes per value.
1866
+ *
1867
+ * @class
1868
+ * @param value - The number of bytes per value.
1869
+ * @returns A Density representing the given number of bytes per value.
1870
+ */
1871
+ constructor(e) {
1872
+ super(e.valueOf());
1873
+ }
1874
+ /**
1875
+ * Calculates the number of values in the given Size.
1876
+ *
1877
+ * @param size - The Size to calculate the value count from.
1878
+ * @returns The number of values in the given Size.
1879
+ */
1880
+ length(e) {
1881
+ return e.valueOf() / this.valueOf();
1882
+ }
1883
+ /**
1884
+ * Calculates a Size representing the given number of values.
1885
+ *
1886
+ * @param sampleCount - The number of values in the Size.
1887
+ * @returns A Size representing the given number of values.
1888
+ */
1889
+ size(e) {
1890
+ return new m(e * this.valueOf());
1891
+ }
1892
+ /** Unknown/Invalid Density. */
1893
+ static UNKNOWN = new C(0);
1894
+ /** 128 bits per value. */
1895
+ static BIT128 = new C(16);
1896
+ /** 64 bits per value. */
1897
+ static BIT64 = new C(8);
1898
+ /** 32 bits per value. */
1899
+ static BIT32 = new C(4);
1900
+ /** 16 bits per value. */
1901
+ static BIT16 = new C(2);
1902
+ /** 8 bits per value. */
1903
+ static BIT8 = new C(1);
1904
+ /** A zod schema for validating and transforming densities */
1905
+ static z = a.union([
1906
+ a.number().transform((e) => new C(e)),
1907
+ a.instanceof(C)
1908
+ ]);
1909
+ }, V = class B {
1910
+ /**
1911
+ * The starting TimeStamp of the TimeRange.
1912
+ *
1913
+ * Note that this value is not guaranteed to be before or equal to the ending value.
1914
+ * To ensure that this is the case, call TimeRange.make_valid().
1915
+ *
1916
+ * In most cases, operations should treat start as inclusive.
1917
+ */
1918
+ start;
1919
+ /**
1920
+ * The starting TimeStamp of the TimeRange.
1921
+ *
1922
+ * Note that this value is not guaranteed to be before or equal to the ending value.
1923
+ * To ensure that this is the case, call TimeRange.make_valid().
1924
+ *
1925
+ * In most cases, operations should treat end as exclusive.
1926
+ */
1927
+ end;
1928
+ /**
1929
+ * Creates a TimeRange from the given start and end TimeStamps.
1930
+ *
1931
+ * @param start - A TimeStamp representing the start of the range.
1932
+ * @param end - A TimeStamp representing the end of the range.
1933
+ */
1934
+ constructor(e, r) {
1935
+ typeof e == "object" && "start" in e ? (this.start = new b(e.start), this.end = new b(e.end)) : (this.start = new b(e), this.end = new b(r));
1936
+ }
1937
+ /** @returns The TimeSpan occupied by the TimeRange. */
1938
+ get span() {
1939
+ return new h(this.end.valueOf() - this.start.valueOf());
1940
+ }
1941
+ /**
1942
+ * Checks if the timestamp is valid i.e. the start is before the end.
1943
+ *
1944
+ * @returns True if the TimeRange is valid.
1945
+ */
1946
+ get isValid() {
1947
+ return this.start.valueOf() <= this.end.valueOf();
1948
+ }
1949
+ /**
1950
+ * Makes sure the TimeRange is valid i.e. the start is before the end.
1951
+ *
1952
+ * @returns A TimeRange that is valid.
1953
+ */
1954
+ makeValid() {
1955
+ return this.isValid ? this : this.swap();
1956
+ }
1957
+ /**
1958
+ * Checks if the TimeRange has a zero span.
1959
+ *
1960
+ * @returns True if the TimeRange has a zero span.
1961
+ */
1962
+ get isZero() {
1963
+ return this.span.isZero;
1964
+ }
1965
+ /**
1966
+ * @returns the TimeRange as a numeric object with start and end properties.
1967
+ */
1968
+ get numeric() {
1969
+ return { start: Number(this.start.valueOf()), end: Number(this.end.valueOf()) };
1970
+ }
1971
+ /**
1972
+ * Creates a new TimeRange with the start and end swapped.
1973
+ *
1974
+ * @returns A TimeRange with the start and end swapped.
1975
+ */
1976
+ swap() {
1977
+ return new B(this.end, this.start);
1978
+ }
1979
+ get numericBounds() {
1980
+ return {
1981
+ lower: Number(this.start.valueOf()),
1982
+ upper: Number(this.end.valueOf())
1983
+ };
1984
+ }
1985
+ /**
1986
+ * Checks if the TimeRange is equal to the given TimeRange.
1987
+ *
1988
+ * @param other - The TimeRange to compare to.
1989
+ * @returns True if the TimeRange is equal to the given TimeRange.
1990
+ */
1991
+ equals(e, r = h.ZERO) {
1992
+ if (r.isZero)
1993
+ return this.start.equals(e.start) && this.end.equals(e.end);
1994
+ let n = this.start.sub(e.start).valueOf(), s = this.end.sub(e.end).valueOf();
1995
+ return n < 0 && (n = -n), s < 0 && (s = -s), n <= r.valueOf() && s <= r.valueOf();
1996
+ }
1997
+ /**
1998
+ * Returns a string representation of the TimeRange.
1999
+ *
2000
+ * @returns A string representation of the TimeRange.
2001
+ */
2002
+ toString() {
2003
+ return `${this.start.toString()} - ${this.end.toString()}`;
2004
+ }
2005
+ /**
2006
+ * Returns a pretty string representation of the TimeRange.
2007
+ *
2008
+ * @returns A pretty string representation of the TimeRange.
2009
+ */
2010
+ toPrettyString() {
2011
+ return `${this.start.fString("preciseDate")} - ${this.span.toString()}`;
2012
+ }
2013
+ /**
2014
+ * Checks if the two time ranges overlap. If the two time ranges are equal, returns
2015
+ * true. If the start of one range is equal to the end of the other, it returns false.
2016
+ * Just follow the rule [start, end), i.e., start is inclusive, and the end is exclusive.
2017
+ *
2018
+ * @param other - The other TimeRange to compare to.
2019
+ * @param delta - A TimeSpan representing the minimum amount of overlap for
2020
+ * overlap to return true. This allows for a slight amount of leeway when
2021
+ * checking for overlap.
2022
+ * @returns True if the two TimeRanges overlap, false otherwise.
2023
+ */
2024
+ overlapsWith(e, r = h.ZERO) {
2025
+ e = e.makeValid();
2026
+ const n = this.makeValid();
2027
+ if (this.equals(e)) return !0;
2028
+ if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
2029
+ const s = b.max(n.start, e.start), i = b.min(n.end, e.end);
2030
+ return i.before(s) ? !1 : new h(i.sub(s)).greaterThanOrEqual(r);
2031
+ }
2032
+ contains(e) {
2033
+ return e instanceof B ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
2034
+ }
2035
+ /**
2036
+ * Returns a new TimeRange that is bound by the given TimeRange.
2037
+ *
2038
+ * @param other - The TimeRange to bound by.
2039
+ * @returns A new TimeRange that is bound by the given TimeRange.
2040
+ * @example
2041
+ * const range = new TimeRange(new TimeStamp(1000), new TimeStamp(2000));
2042
+ * const other = new TimeRange(new TimeStamp(1500), new TimeStamp(2500));
2043
+ * const bounded = range.boundBy(other);
2044
+ * console.log(bounded); // TimeRange(1500, 2000)
2045
+ */
2046
+ boundBy(e) {
2047
+ const r = new B(this.start, this.end);
2048
+ 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;
2049
+ }
2050
+ static max(...e) {
2051
+ return new B(
2052
+ b.min(...e.map((r) => r.start)),
2053
+ b.max(...e.map((r) => r.end))
2054
+ );
2055
+ }
2056
+ /** The maximum possible time range. */
2057
+ static MAX = new B(b.MIN, b.MAX);
2058
+ /** The minimum possible time range. */
2059
+ static MIN = new B(b.MAX, b.MIN);
2060
+ /** A time range whose start and end are both zero. */
2061
+ static ZERO = new B(b.ZERO, b.ZERO);
2062
+ /** A zod schema for validating and transforming time ranges */
2063
+ static z = a.union([
2064
+ a.object({ start: b.z, end: b.z }).transform((e) => new B(e.start, e.end)),
2065
+ a.instanceof(B)
2066
+ ]);
2067
+ /**
2068
+ * Sorts two time ranges. The range with the earlier start time is considered less than
2069
+ * the range with the later start time. If the start times are equal, the range with the
2070
+ * earlier end time is considered less than the range with the later end time.
2071
+ *
2072
+ * @param a - The first time range.
2073
+ * @param b - The second time range.
2074
+ * @returns A number indicating the order of the two time ranges. This number is
2075
+ * positive if a is earlier than b, negative if a is later than b, and 0 if they are
2076
+ * equal.
2077
+ */
2078
+ static sort(e, r) {
2079
+ return b.sort(e.start, r.start) || b.sort(e.end, r.end);
2080
+ }
2081
+ }, T = class u extends J {
2082
+ constructor(e) {
2083
+ if (e instanceof u || typeof e == "string" || typeof e.valueOf() == "string")
2084
+ super(e.valueOf());
2085
+ else {
2086
+ const r = u.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);
2087
+ if (r == null)
2088
+ throw new Error(`unable to find data type for ${e.toString()}`);
2089
+ super(r.valueOf());
2090
+ }
2091
+ }
2092
+ /**
2093
+ * @returns the TypedArray constructor for the DataType.
2094
+ */
2095
+ get Array() {
2096
+ const e = u.ARRAY_CONSTRUCTORS.get(this.toString());
2097
+ if (e == null)
2098
+ throw new Error(`unable to find array constructor for ${this.valueOf()}`);
2099
+ return e;
2100
+ }
2101
+ /**
2102
+ * @returns true if the DataType is equal to the given DataType.
2103
+ */
2104
+ equals(e) {
2105
+ return this.valueOf() === e.valueOf();
2106
+ }
2107
+ /**
2108
+ * @returns true if the DataType is equal to any of the given DataTypes.
2109
+ */
2110
+ matches(...e) {
2111
+ return e.some((r) => this.equals(r));
2112
+ }
2113
+ /** @returns a string representation of the DataType. */
2114
+ toString() {
2115
+ return this.valueOf();
2116
+ }
2117
+ /**
2118
+ * @returns true if the DataType has a variable density.
2119
+ * @example DataType.STRING.isVariable // true
2120
+ * @example DataType.INT32.isVariable // false
2121
+ */
2122
+ get isVariable() {
2123
+ return this.equals(u.JSON) || this.equals(u.STRING);
2124
+ }
2125
+ /**
2126
+ * @returns true if the DataType is numeric.
2127
+ * @example DataType.INT32.isNumeric // true
2128
+ * @example DataType.STRING.isNumeric // false
2129
+ */
2130
+ get isNumeric() {
2131
+ return !this.isVariable && !this.equals(u.UUID);
2132
+ }
2133
+ /**
2134
+ * @returns true if the DataType is an integer.
2135
+ * @example DataType.INT32.isInteger // true
2136
+ * @example DataType.FLOAT32.isInteger // false
2137
+ */
2138
+ get isInteger() {
2139
+ const e = this.toString();
2140
+ return e.startsWith("int") || e.startsWith("uint");
2141
+ }
2142
+ /**
2143
+ * @returns true if the DataType is a floating point number.
2144
+ * @example DataType.FLOAT32.isFloat // true
2145
+ * @example DataType.INT32.isFloat // false
2146
+ */
2147
+ get isFloat() {
2148
+ return this.toString().startsWith("float");
2149
+ }
2150
+ /**
2151
+ * @returns the density of the DataType.
2152
+ * @example DataType.INT16.density // Density.BIT32
2153
+ * @example DataType.FLOAT32.density // Density.BIT32
2154
+ */
2155
+ get density() {
2156
+ const e = u.DENSITIES.get(this.toString());
2157
+ if (e == null) throw new Error(`unable to find density for ${this.valueOf()}`);
2158
+ return e;
2159
+ }
2160
+ /**
2161
+ * @returns true if the DataType is an unsigned integer.
2162
+ * @example DataType.UINT32.isUnsigned // true
2163
+ * @example DataType.INT32.isUnsigned // false
2164
+ */
2165
+ get isUnsignedInteger() {
2166
+ return this.equals(u.UINT8) || this.equals(u.UINT16) || this.equals(u.UINT32) || this.equals(u.UINT64);
2167
+ }
2168
+ /**
2169
+ * @returns true if the DataType is a signed integer.
2170
+ * @example DataType.INT32.isSigned // true
2171
+ * @example DataType.UINT32.isSigned // false
2172
+ */
2173
+ get isSignedInteger() {
2174
+ return this.equals(u.INT8) || this.equals(u.INT16) || this.equals(u.INT32) || this.equals(u.INT64);
2175
+ }
2176
+ /** @returns true if the data type can be cast to the other data type without loss of precision. */
2177
+ canSafelyCastTo(e) {
2178
+ 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(u.INT32) && e.equals(u.FLOAT64) || this.equals(u.INT8) && e.equals(u.FLOAT32) ? !0 : this.isInteger && e.isInteger ? this.density.valueOf() <= e.density.valueOf() && this.isUnsignedInteger === e.isUnsignedInteger : !1;
2179
+ }
2180
+ /** @returns true if the data type can be cast to the other data type, even if there is a loss of precision. */
2181
+ canCastTo(e) {
2182
+ return this.isNumeric && e.isNumeric ? !0 : this.equals(e);
2183
+ }
2184
+ /**
2185
+ * Checks whether the given TypedArray is of the same type as the DataType.
2186
+ *
2187
+ * @param array - The TypedArray to check.
2188
+ * @returns True if the TypedArray is of the same type as the DataType.
2189
+ */
2190
+ checkArray(e) {
2191
+ return e.constructor === this.Array;
2192
+ }
2193
+ /** @returns true if the data type uses bigints to store values. */
2194
+ get usesBigInt() {
2195
+ return u.BIG_INT_TYPES.some((e) => e.equals(this));
2196
+ }
2197
+ /** Represents an Unknown/Invalid DataType. */
2198
+ static UNKNOWN = new u("unknown");
2199
+ /** Represents a 64-bit floating point value. */
2200
+ static FLOAT64 = new u("float64");
2201
+ /** Represents a 32-bit floating point value. */
2202
+ static FLOAT32 = new u("float32");
2203
+ /** Represents a 64-bit signed integer value. */
2204
+ static INT64 = new u("int64");
2205
+ /** Represents a 32-bit signed integer value. */
2206
+ static INT32 = new u("int32");
2207
+ /** Represents a 16-bit signed integer value. */
2208
+ static INT16 = new u("int16");
2209
+ /** Represents a 8-bit signed integer value. */
2210
+ static INT8 = new u("int8");
2211
+ /** Represents a 64-bit unsigned integer value. */
2212
+ static UINT64 = new u("uint64");
2213
+ /** Represents a 32-bit unsigned integer value. */
2214
+ static UINT32 = new u("uint32");
2215
+ /** Represents a 16-bit unsigned integer value. */
2216
+ static UINT16 = new u("uint16");
2217
+ /** Represents a 8-bit unsigned integer value. */
2218
+ static UINT8 = new u("uint8");
2219
+ /** Represents a boolean value. Alias for UINT8. */
2220
+ static BOOLEAN = this.UINT8;
2221
+ /** Represents a 64-bit unix epoch. */
2222
+ static TIMESTAMP = new u("timestamp");
2223
+ /** Represents a UUID data type */
2224
+ static UUID = new u("uuid");
2225
+ /** Represents a string data type. Strings have an unknown density, and are separate
2226
+ * by a newline character. */
2227
+ static STRING = new u("string");
2228
+ /** Represents a JSON data type. JSON has an unknown density, and is separated by a
2229
+ * newline character. */
2230
+ static JSON = new u("json");
2231
+ static ARRAY_CONSTRUCTORS = /* @__PURE__ */ new Map([
2232
+ [u.UINT8.toString(), Uint8Array],
2233
+ [u.UINT16.toString(), Uint16Array],
2234
+ [u.UINT32.toString(), Uint32Array],
2235
+ [u.UINT64.toString(), BigUint64Array],
2236
+ [u.FLOAT32.toString(), Float32Array],
2237
+ [u.FLOAT64.toString(), Float64Array],
2238
+ [u.INT8.toString(), Int8Array],
2239
+ [u.INT16.toString(), Int16Array],
2240
+ [u.INT32.toString(), Int32Array],
2241
+ [u.INT64.toString(), BigInt64Array],
2242
+ [u.TIMESTAMP.toString(), BigInt64Array],
2243
+ [u.STRING.toString(), Uint8Array],
2244
+ [u.JSON.toString(), Uint8Array],
2245
+ [u.UUID.toString(), Uint8Array]
2246
+ ]);
2247
+ static ARRAY_CONSTRUCTOR_DATA_TYPES = /* @__PURE__ */ new Map([
2248
+ [Uint8Array.name, u.UINT8],
2249
+ [Uint16Array.name, u.UINT16],
2250
+ [Uint32Array.name, u.UINT32],
2251
+ [BigUint64Array.name, u.UINT64],
2252
+ [Float32Array.name, u.FLOAT32],
2253
+ [Float64Array.name, u.FLOAT64],
2254
+ [Int8Array.name, u.INT8],
2255
+ [Int16Array.name, u.INT16],
2256
+ [Int32Array.name, u.INT32],
2257
+ [BigInt64Array.name, u.INT64]
2258
+ ]);
2259
+ static DENSITIES = /* @__PURE__ */ new Map([
2260
+ [u.UINT8.toString(), N.BIT8],
2261
+ [u.UINT16.toString(), N.BIT16],
2262
+ [u.UINT32.toString(), N.BIT32],
2263
+ [u.UINT64.toString(), N.BIT64],
2264
+ [u.FLOAT32.toString(), N.BIT32],
2265
+ [u.FLOAT64.toString(), N.BIT64],
2266
+ [u.INT8.toString(), N.BIT8],
2267
+ [u.INT16.toString(), N.BIT16],
2268
+ [u.INT32.toString(), N.BIT32],
2269
+ [u.INT64.toString(), N.BIT64],
2270
+ [u.TIMESTAMP.toString(), N.BIT64],
2271
+ [u.STRING.toString(), N.UNKNOWN],
2272
+ [u.JSON.toString(), N.UNKNOWN],
2273
+ [u.UUID.toString(), N.BIT128]
2274
+ ]);
2275
+ /** All the data types. */
2276
+ static ALL = [
2277
+ u.UNKNOWN,
2278
+ u.FLOAT64,
2279
+ u.FLOAT32,
2280
+ u.INT64,
2281
+ u.INT32,
2282
+ u.INT16,
2283
+ u.INT8,
2284
+ u.UINT64,
2285
+ u.UINT32,
2286
+ u.UINT16,
2287
+ u.UINT8,
2288
+ u.TIMESTAMP,
2289
+ u.UUID,
2290
+ u.STRING,
2291
+ u.JSON
2292
+ ];
2293
+ static BIG_INT_TYPES = [u.INT64, u.UINT64, u.TIMESTAMP];
2294
+ /** A zod schema for a DataType. */
2295
+ static z = a.union([
2296
+ a.string().transform((e) => new u(e)),
2297
+ a.instanceof(u)
2298
+ ]);
2299
+ };
2300
+ class m extends J {
2301
+ constructor(e) {
2302
+ super(e.valueOf());
2303
+ }
2304
+ /** @returns true if the Size is larger than the other size. */
2305
+ largerThan(e) {
2306
+ return this.valueOf() > e.valueOf();
2307
+ }
2308
+ /** @returns true if the Size is smaller than the other size. */
2309
+ smallerThan(e) {
2310
+ return this.valueOf() < e.valueOf();
2311
+ }
2312
+ /** @returns a new Size representing the sum of the two Sizes. */
2313
+ add(e) {
2314
+ return m.bytes(this.valueOf() + e.valueOf());
2315
+ }
2316
+ /** @returns a new Size representing the difference of the two Sizes. */
2317
+ sub(e) {
2318
+ return m.bytes(this.valueOf() - e.valueOf());
2319
+ }
2320
+ /** @returns a new Size representing the truncated value of the Size. */
2321
+ truncate(e) {
2322
+ return new m(Math.trunc(this.valueOf() / e.valueOf()) * e.valueOf());
2323
+ }
2324
+ /** @returns a new Size representing the remainder of the Size. */
2325
+ remainder(e) {
2326
+ return m.bytes(this.valueOf() % e.valueOf());
2327
+ }
2328
+ /** @returns the number of gigabytes in the Size. */
2329
+ get gigabytes() {
2330
+ return this.valueOf() / m.GIGABYTE.valueOf();
2331
+ }
2332
+ /** @returns the number of megabytes in the Size. */
2333
+ get megabytes() {
2334
+ return this.valueOf() / m.MEGABYTE.valueOf();
2335
+ }
2336
+ /** @returns the number of kilobytes in the Size. */
2337
+ get kilobytes() {
2338
+ return this.valueOf() / m.KILOBYTE.valueOf();
2339
+ }
2340
+ /** @returns the number of terabytes in the Size. */
2341
+ get terabytes() {
2342
+ return this.valueOf() / m.TERABYTE.valueOf();
2343
+ }
2344
+ /** @returns a nicely formatted string representation of the Size. */
2345
+ toString() {
2346
+ 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, c = r.sub(e), l = n.sub(r), f = s.sub(n), p = i.sub(s);
2347
+ let g = "";
2348
+ return o.isZero || (g += `${o.terabytes}TB `), c.isZero || (g += `${c.gigabytes}GB `), l.isZero || (g += `${l.megabytes}MB `), f.isZero || (g += `${f.kilobytes}KB `), (!p.isZero || g === "") && (g += `${p.valueOf()}B`), g.trim();
2349
+ }
2350
+ /**
2351
+ * Creates a Size from the given number of bytes.
2352
+ *
2353
+ * @param value - The number of bytes.
2354
+ * @returns A Size representing the given number of bytes.
2355
+ */
2356
+ static bytes(e = 1) {
2357
+ return new m(e);
2358
+ }
2359
+ /** A single byte */
2360
+ static BYTE = new m(1);
2361
+ /**
2362
+ * Creates a Size from the given number if kilobytes.
2363
+ *
2364
+ * @param value - The number of kilobytes.
2365
+ * @returns A Size representing the given number of kilobytes.
2366
+ */
2367
+ static kilobytes(e = 1) {
2368
+ return m.bytes(e.valueOf() * 1e3);
2369
+ }
2370
+ /** A kilobyte */
2371
+ static KILOBYTE = m.kilobytes(1);
2372
+ /**
2373
+ * Creates a Size from the given number of megabytes.
2374
+ *
2375
+ * @param value - The number of megabytes.
2376
+ * @returns A Size representing the given number of megabytes.
2377
+ */
2378
+ static megabytes(e = 1) {
2379
+ return m.kilobytes(e.valueOf() * 1e3);
2380
+ }
2381
+ /** A megabyte */
2382
+ static MEGABYTE = m.megabytes(1);
2383
+ /**
2384
+ * Creates a Size from the given number of gigabytes.
2385
+ *
2386
+ * @param value - The number of gigabytes.
2387
+ * @returns A Size representing the given number of gigabytes.
2388
+ */
2389
+ static gigabytes(e = 1) {
2390
+ return m.megabytes(e.valueOf() * 1e3);
2391
+ }
2392
+ /** A gigabyte */
2393
+ static GIGABYTE = m.gigabytes(1);
2394
+ /**
2395
+ * Creates a Size from the given number of terabytes.
2396
+ *
2397
+ * @param value - The number of terabytes.
2398
+ * @returns A Size representing the given number of terabytes.
2399
+ */
2400
+ static terabytes(e) {
2401
+ return m.gigabytes(e.valueOf() * 1e3);
2402
+ }
2403
+ /** A terabyte. */
2404
+ static TERABYTE = m.terabytes(1);
2405
+ /** The zero value for Size */
2406
+ static ZERO = new m(0);
2407
+ /** A zod schema for a Size. */
2408
+ static z = a.union([
2409
+ a.number().transform((e) => new m(e)),
2410
+ a.instanceof(m)
2411
+ ]);
2412
+ /** @returns true if the Size is zero. */
2413
+ get isZero() {
2414
+ return this.valueOf() === 0;
2415
+ }
2416
+ }
2417
+ const vo = a.union([
2418
+ a.instanceof(Uint8Array),
2419
+ a.instanceof(Uint16Array),
2420
+ a.instanceof(Uint32Array),
2421
+ a.instanceof(BigUint64Array),
2422
+ a.instanceof(Float32Array),
2423
+ a.instanceof(Float64Array),
2424
+ a.instanceof(Int8Array),
2425
+ a.instanceof(Int16Array),
2426
+ a.instanceof(Int32Array),
2427
+ a.instanceof(BigInt64Array)
2428
+ ]), vr = (t) => {
2429
+ const e = typeof t;
2430
+ return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof h || t instanceof Date;
2431
+ }, xi = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Me(r, -n), Me = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), $i = /^(?:[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;
2432
+ function Si(t) {
2433
+ return typeof t == "string" && $i.test(t);
2434
+ }
2435
+ const $ = [];
2436
+ for (let t = 0; t < 256; ++t)
2437
+ $.push((t + 256).toString(16).slice(1));
2438
+ function Ni(t, e = 0) {
2439
+ return ($[t[e + 0]] + $[t[e + 1]] + $[t[e + 2]] + $[t[e + 3]] + "-" + $[t[e + 4]] + $[t[e + 5]] + "-" + $[t[e + 6]] + $[t[e + 7]] + "-" + $[t[e + 8]] + $[t[e + 9]] + "-" + $[t[e + 10]] + $[t[e + 11]] + $[t[e + 12]] + $[t[e + 13]] + $[t[e + 14]] + $[t[e + 15]]).toLowerCase();
2440
+ }
2441
+ function Ii(t, e = 0) {
2442
+ const r = Ni(t, e);
2443
+ if (!Si(r))
2444
+ throw TypeError("Stringified UUID is invalid");
2445
+ return r;
2446
+ }
2447
+ typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
2448
+ const Tr = (t, e) => Ii(t, e), L = -1, it = {
2449
+ [Symbol.iterator]: () => it,
2450
+ next: () => ({ done: !0, value: void 0 })
2451
+ }, Mi = a.string().transform(
2452
+ (t) => new Uint8Array(
2453
+ atob(t).split("").map((e) => e.charCodeAt(0))
2454
+ ).buffer
2455
+ ), Ei = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), at = 10, xr = (t, e) => {
2456
+ if (t === "number" && !e.isNumeric)
2457
+ throw new Error(`cannot convert series of type ${e.toString()} to number`);
2458
+ if (t === "bigint" && !e.usesBigInt)
2459
+ throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
2460
+ }, $r = "sy_x_telem_series";
2461
+ let Sr = class D {
2462
+ /**
2463
+ * A unique identifier for the series. If specified by the user, it is their
2464
+ * responsibility to ensure that it is unique. If not specified, a new ID will be
2465
+ * generated.
2466
+ */
2467
+ key;
2468
+ /**
2469
+ * A discriminator used for identifying instances of the series class even
2470
+ * when bundlers mangle the class name.
2471
+ */
2472
+ discriminator = $r;
2473
+ /** The data type of the series. */
2474
+ dataType;
2475
+ /**
2476
+ * A sample offset that can be used to shift the values of all samples upwards or
2477
+ * downwards. Useful to convert series to lower precision data types while preserving
2478
+ * the relative range of actual values.
2479
+ */
2480
+ sampleOffset;
2481
+ /**
2482
+ * Stores information about the buffer state of this array into a WebGL buffer.
2483
+ */
2484
+ gl;
2485
+ /** The underlying data. */
2486
+ _data;
2487
+ /** The time range occupied by the series' data. */
2488
+ timeRange = V.ZERO;
2489
+ /**
2490
+ * Alignment defines the location of the series relative to other series in a logical
2491
+ * group. Useful for defining the position of the series within a channel's data.
2492
+ */
2493
+ alignment = 0n;
2494
+ /** A cached minimum value. */
2495
+ cachedMin;
2496
+ /** A cached maximum value. */
2497
+ cachedMax;
2498
+ /** The write position of the buffer. */
2499
+ writePos = L;
2500
+ /** Tracks the number of entities currently using this array. */
2501
+ _refCount = 0;
2502
+ /** Caches the length of the array for variable length data types. */
2503
+ cachedLength;
2504
+ /** Caches the indexes of the array for variable length data types. */
2505
+ _cachedIndexes;
2506
+ /**
2507
+ * A zod schema that can be used to validate that a particular value
2508
+ * can be constructed into a series.
2509
+ */
2510
+ static crudeZ = a.object({
2511
+ timeRange: V.z.optional(),
2512
+ dataType: T.z,
2513
+ alignment: a.coerce.bigint().optional(),
2514
+ data: a.union([
2515
+ Mi,
2516
+ Ei,
2517
+ a.instanceof(ArrayBuffer),
2518
+ a.instanceof(Uint8Array)
2519
+ ]),
2520
+ glBufferUsage: vi.optional().default("static").optional()
2521
+ });
2522
+ /**
2523
+ * A zod schema that validates and constructs a series from it's crude
2524
+ * representation.
2525
+ */
2526
+ static z = D.crudeZ.transform((e) => new D(e));
2527
+ /**
2528
+ * The Series constructor accepts either a SeriesArgs object or a CrudeSeries value.
2529
+ *
2530
+ * SeriesArgs interface properties:
2531
+ * @property {CrudeSeries | null} [data] - The data to construct the series from. Can be:
2532
+ * - A typed array (e.g. Float32Array, Int32Array)
2533
+ * - A JS array of numbers, strings, or objects
2534
+ * - A single value (number, string, bigint, etc.)
2535
+ * - An ArrayBuffer
2536
+ * - Another Series instance
2537
+ * @property {CrudeDataType} [dataType] - The data type of the series. If not provided,
2538
+ * will be inferred from the data. Required when constructing from an ArrayBuffer, or
2539
+ * an empty JS array.
2540
+ * @property {TimeRange} [timeRange] - The time range occupied by the series' data.
2541
+ * Defaults to TimeRange.ZERO.
2542
+ * @property {math.Numeric} [sampleOffset] - An offset to apply to each sample value.
2543
+ * Useful for converting arrays to lower precision while preserving relative range.
2544
+ * Defaults to 0.
2545
+ * @property {GLBufferUsage} [glBufferUsage] - The WebGL buffer usage hint. Can be
2546
+ * "static" or "dynamic". Defaults to "static".
2547
+ * @property {bigint} [alignment] - The logical position of the series relative to other
2548
+ * series in a group. Defaults to 0n.
2549
+ * @property {string} [key] - A unique identifier for the series. If not provided,
2550
+ * a new ID will be generated.
2551
+ *
2552
+ * @example
2553
+ * // Create a series from a typed array
2554
+ * const s1 = new Series(new Float32Array([1, 2, 3]));
2555
+ *
2556
+ * @example
2557
+ * // Create a series from a JS array with explicit data type
2558
+ * const s2 = new Series({ data: [1, 2, 3], dataType: DataType.FLOAT32 });
2559
+ *
2560
+ * @example
2561
+ * // Create a series from a single value (data type inferred)
2562
+ * const s3 = new Series(1); // Creates a FLOAT64 series
2563
+ * const s4 = new Series("abc"); // Creates a STRING series
2564
+ * const s5 = new Series(1n); // Creates an INT64 series
2565
+ *
2566
+ * @example
2567
+ * // Create a series from objects (automatically uses JSON data type)
2568
+ * const s6 = new Series([{ a: 1, b: "apple" }]);
2569
+ *
2570
+ * @example
2571
+ * // Create a series with time range and alignment
2572
+ * const s7 = new Series({
2573
+ * data: new Float32Array([1, 2, 3]),
2574
+ * timeRange: new TimeRange(1, 2),
2575
+ * alignment: 1n
2576
+ * });
2577
+ *
2578
+ * @example
2579
+ * // Create a series from another series (copies properties)
2580
+ * const s8 = new Series(s1);
2581
+ *
2582
+ * @example
2583
+ * // Create a series with sample offset
2584
+ * const s9 = new Series({
2585
+ * data: new Float32Array([1, 2, 3]),
2586
+ * sampleOffset: 2
2587
+ * }); // Values will be 3, 4, 5
2588
+ *
2589
+ * @example
2590
+ * // Create a series with WebGL buffer usage
2591
+ * const s10 = new Series({
2592
+ * data: new Float32Array([1, 2, 3]),
2593
+ * glBufferUsage: "dynamic"
2594
+ * });
2595
+ *
2596
+ * @throws Error if constructing from an empty JS array without specifying data type
2597
+ * @throws Error if constructing from an ArrayBuffer without specifying data type
2598
+ * @throws Error if data type cannot be inferred from input
2599
+ */
2600
+ constructor(e) {
2601
+ Ai(e) && (e = { data: e }), e.data ??= [];
2602
+ const {
2603
+ dataType: r,
2604
+ timeRange: n,
2605
+ sampleOffset: s = 0,
2606
+ glBufferUsage: i = "static",
2607
+ alignment: o = 0n,
2608
+ key: c = At(),
2609
+ data: l
2610
+ } = e;
2611
+ if (Nr(l)) {
2612
+ const g = l;
2613
+ this.key = g.key, this.dataType = g.dataType, this.sampleOffset = g.sampleOffset, this.gl = g.gl, this._data = g._data, this.timeRange = g.timeRange, this.alignment = g.alignment, this.cachedMin = g.cachedMin, this.cachedMax = g.cachedMax, this.writePos = g.writePos, this._refCount = g._refCount, this.cachedLength = g.cachedLength;
2614
+ return;
2615
+ }
2616
+ const f = vr(l), p = Array.isArray(l);
2617
+ if (r != null) this.dataType = new T(r);
2618
+ else {
2619
+ if (l instanceof ArrayBuffer)
2620
+ throw new Error(
2621
+ "cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
2622
+ );
2623
+ if (p || f) {
2624
+ let g = l;
2625
+ if (!f) {
2626
+ if (l.length === 0)
2627
+ throw new Error(
2628
+ "cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
2629
+ );
2630
+ g = l[0];
2631
+ }
2632
+ if (typeof g == "string") this.dataType = T.STRING;
2633
+ else if (typeof g == "number") this.dataType = T.FLOAT64;
2634
+ else if (typeof g == "bigint") this.dataType = T.INT64;
2635
+ else if (typeof g == "boolean") this.dataType = T.BOOLEAN;
2636
+ else if (g instanceof b || g instanceof Date || g instanceof b)
2637
+ this.dataType = T.TIMESTAMP;
2638
+ else if (typeof g == "object") this.dataType = T.JSON;
2639
+ else
2640
+ throw new Error(
2641
+ `cannot infer data type of ${typeof g} when constructing a Series from a JS array`
2642
+ );
2643
+ } else this.dataType = new T(l);
2644
+ }
2645
+ if (!p && !f) this._data = l;
2646
+ else if (p && l.length === 0)
2647
+ this._data = new this.dataType.Array([]).buffer;
2648
+ else {
2649
+ let g = f ? [l] : l;
2650
+ const S = g[0];
2651
+ (S instanceof b || S instanceof Date || S instanceof h) && (g = g.map((E) => new b(E).valueOf())), this.dataType.equals(T.STRING) ? (this.cachedLength = g.length, this._data = new TextEncoder().encode(`${g.join(`
2652
+ `)}
2653
+ `).buffer) : this.dataType.equals(T.JSON) ? (this.cachedLength = g.length, this._data = new TextEncoder().encode(
2654
+ `${g.map((E) => He.encodeString(E)).join(`
2655
+ `)}
2656
+ `
2657
+ ).buffer) : this.dataType.usesBigInt && typeof S == "number" ? this._data = new this.dataType.Array(
2658
+ g.map((E) => BigInt(Math.round(E)))
2659
+ ).buffer : !this.dataType.usesBigInt && typeof S == "bigint" ? this._data = new this.dataType.Array(
2660
+ g.map(Number)
2661
+ ).buffer : this._data = new this.dataType.Array(g).buffer;
2662
+ }
2663
+ this.key = c, this.alignment = o, this.sampleOffset = s ?? 0, this.timeRange = n ?? V.ZERO, this.gl = {
2664
+ control: null,
2665
+ buffer: null,
2666
+ prevBuffer: 0,
2667
+ bufferUsage: i
2668
+ };
2669
+ }
2670
+ /**
2671
+ * Allocates a new series with a given capacity and data type.
2672
+ * @param args.capacity the capacity of the series in samples. If the data type is of
2673
+ * variable density (i.e. JSON, STRING, BYTES), this is the capacity in bytes.
2674
+ * @param args.dataType the data type of the series.
2675
+ * @param args.rest the rest of the arguments to pass to the series constructor.
2676
+ */
2677
+ static alloc({ capacity: e, dataType: r, ...n }) {
2678
+ if (e === 0)
2679
+ throw new Error("[Series] - cannot allocate an array of length 0");
2680
+ const s = new new T(r).Array(e), i = new D({ data: s.buffer, dataType: r, ...n });
2681
+ return i.writePos = 0, i;
2682
+ }
2683
+ /**
2684
+ * @returns the number of references to this series i.e. the number of times this
2685
+ * series has been acquired (by calling acquire) and not released (by calling
2686
+ * release).
2687
+ */
2688
+ get refCount() {
2689
+ return this._refCount;
2690
+ }
2691
+ /**
2692
+ * Acquires a reference to this series, optionally buffering its data into the
2693
+ * specified buffer controller. This method is useful for managing the life span
2694
+ * of series buffered to the GPU.
2695
+ * @param gl the buffer controller to buffer the series to. If not provided, the series
2696
+ * will not be buffered to the GPU.
2697
+ */
2698
+ acquire(e) {
2699
+ this._refCount++, e != null && this.updateGLBuffer(e);
2700
+ }
2701
+ /**
2702
+ * Releases a reference to this series. If the reference count to the series reaches
2703
+ * 0 and the series has been buffered to the GPU, the series will be deleted from
2704
+ * the GPU.
2705
+ */
2706
+ release() {
2707
+ 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");
2708
+ }
2709
+ /**
2710
+ * Writes the given series to this series. If the series being written exceeds the
2711
+ * remaining of series being written to, only the portion that fits will be written.
2712
+ * @param other the series to write to this series. The data type of the series written
2713
+ * must be the same as the data type of the series being written to.
2714
+ * @returns the number of samples written. If the entire series fits, this value is
2715
+ * equal to the length of the series being written.
2716
+ */
2717
+ write(e) {
2718
+ if (!e.dataType.equals(this.dataType))
2719
+ throw new Error("buffer must be of the same type as this array");
2720
+ return this.dataType.isVariable ? this.writeVariable(e) : this.writeFixed(e);
2721
+ }
2722
+ writeVariable(e) {
2723
+ if (this.writePos === L) return 0;
2724
+ const r = this.byteCapacity.valueOf() - this.writePos, n = e.subBytes(0, r);
2725
+ return this.writeToUnderlyingData(n), this.writePos += n.byteLength.valueOf(), this.cachedLength != null && (this.cachedLength += n.length, this.calculateCachedLength()), n.length;
2726
+ }
2727
+ writeFixed(e) {
2728
+ if (this.writePos === L) return 0;
2729
+ const r = this.capacity - this.writePos, n = e.sub(0, r);
2730
+ return this.writeToUnderlyingData(n), this.cachedLength = void 0, this.maybeRecomputeMinMax(n), this.writePos += n.length, n.length;
2731
+ }
2732
+ writeToUnderlyingData(e) {
2733
+ this.underlyingData.set(
2734
+ e.data,
2735
+ this.writePos
2736
+ );
2737
+ }
2738
+ /** @returns the underlying buffer backing this array. */
2739
+ get buffer() {
2740
+ return typeof this._data == "object" && "buffer" in this._data ? this._data.buffer : this._data;
2741
+ }
2742
+ get underlyingData() {
2743
+ return new this.dataType.Array(this._data);
2744
+ }
2745
+ /**
2746
+ * Returns a native JS typed array with the proper data type.
2747
+ * If the series is not full, returns a view of the data up to the write position.
2748
+ * @returns A typed array containing the series data.
2749
+ */
2750
+ get data() {
2751
+ return this.writePos === L ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
2752
+ }
2753
+ /**
2754
+ * Returns an array of the values in the series as strings.
2755
+ * For variable length data types (like STRING or JSON), this decodes the underlying buffer.
2756
+ * @returns An array of string representations of the series values.
2757
+ */
2758
+ toStrings() {
2759
+ return this.dataType.isVariable ? new TextDecoder().decode(this.underlyingData).split(`
2760
+ `).slice(0, -1) : Array.from(this).map((e) => e.toString());
2761
+ }
2762
+ /**
2763
+ * Parses a JSON series into an array of values using the provided zod schema.
2764
+ * @template Z The zod schema type.
2765
+ * @param schema The zod schema to use to parse the JSON series.
2766
+ * @throws Error if the series does not have a data type of JSON.
2767
+ * @returns An array of values parsed from the JSON series.
2768
+ */
2769
+ parseJSON(e) {
2770
+ if (!this.dataType.equals(T.JSON))
2771
+ throw new Error("cannot parse non-JSON series as JSON");
2772
+ return this.toStrings().map((r) => e.parse(He.decodeString(r)));
2773
+ }
2774
+ /**
2775
+ * Returns the capacity of the series in bytes.
2776
+ * @returns The size of the underlying buffer in bytes.
2777
+ */
2778
+ get byteCapacity() {
2779
+ return new m(this.underlyingData.byteLength);
2780
+ }
2781
+ /**
2782
+ * Returns the capacity of the series in samples.
2783
+ * For variable length data types, this is the capacity in bytes.
2784
+ * @returns The number of samples that can be stored in the series.
2785
+ */
2786
+ get capacity() {
2787
+ return this.dataType.isVariable ? this.byteCapacity.valueOf() : this.dataType.density.length(this.byteCapacity);
2788
+ }
2789
+ /**
2790
+ * Returns the length of the series in bytes.
2791
+ * For variable length data types, this is the actual number of bytes used.
2792
+ * @returns The size of the data in bytes.
2793
+ */
2794
+ get byteLength() {
2795
+ return this.writePos === L ? this.byteCapacity : this.dataType.isVariable ? new m(this.writePos) : this.dataType.density.size(this.writePos);
2796
+ }
2797
+ /**
2798
+ * Returns the number of samples in this array.
2799
+ * For variable length data types, this is calculated by counting newlines.
2800
+ * @returns The number of samples in the series.
2801
+ */
2802
+ get length() {
2803
+ return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === L ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
2804
+ }
2805
+ calculateCachedLength() {
2806
+ if (!this.dataType.isVariable)
2807
+ throw new Error("cannot calculate length of a non-variable length data type");
2808
+ let e = 0;
2809
+ const r = [0];
2810
+ return this.data.forEach((n, s) => {
2811
+ n === at && (e++, r.push(s + 1));
2812
+ }), this._cachedIndexes = r, this.cachedLength = e, e;
2813
+ }
2814
+ /**
2815
+ * Creates a new array with a different data type.
2816
+ * @param target the data type to convert to.
2817
+ * @param sampleOffset an offset to apply to each sample. This can help with precision
2818
+ * issues when converting between data types.
2819
+ *
2820
+ * WARNING: This method is expensive and copies the entire underlying array. There
2821
+ * also may be untimely precision issues when converting between data types.
2822
+ */
2823
+ convert(e, r = 0) {
2824
+ if (this.dataType.equals(e)) return this;
2825
+ const n = new e.Array(this.length);
2826
+ for (let s = 0; s < this.length; s++)
2827
+ n[s] = xi(this.dataType, e, this.data[s], r);
2828
+ return new D({
2829
+ data: n.buffer,
2830
+ dataType: e,
2831
+ timeRange: this.timeRange,
2832
+ sampleOffset: r,
2833
+ glBufferUsage: this.gl.bufferUsage,
2834
+ alignment: this.alignment
2835
+ });
2836
+ }
2837
+ calcRawMax() {
2838
+ if (this.length === 0) return -1 / 0;
2839
+ if (this.dataType.equals(T.TIMESTAMP))
2840
+ this.cachedMax = this.data[this.data.length - 1];
2841
+ else if (this.dataType.usesBigInt) {
2842
+ const e = this.data;
2843
+ this.cachedMax = e.reduce((r, n) => r > n ? r : n);
2844
+ } else {
2845
+ const e = this.data;
2846
+ this.cachedMax = e.reduce((r, n) => r > n ? r : n);
2847
+ }
2848
+ return this.cachedMax;
2849
+ }
2850
+ /** @returns the maximum value in the array */
2851
+ get max() {
2852
+ return this.calcMax();
2853
+ }
2854
+ calcMax() {
2855
+ if (this.dataType.isVariable)
2856
+ throw new Error("cannot calculate maximum on a variable length data type");
2857
+ return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), Me(this.cachedMax, this.sampleOffset));
2858
+ }
2859
+ calcRawMin() {
2860
+ if (this.length === 0) return 1 / 0;
2861
+ if (this.dataType.equals(T.TIMESTAMP)) this.cachedMin = this.data[0];
2862
+ else if (this.dataType.usesBigInt) {
2863
+ const e = this.data;
2864
+ this.cachedMin = e.reduce((r, n) => r < n ? r : n);
2865
+ } else {
2866
+ const e = this.data;
2867
+ this.cachedMin = e.reduce((r, n) => r < n ? r : n);
2868
+ }
2869
+ return this.cachedMin;
2870
+ }
2871
+ /** @returns the minimum value in the array */
2872
+ get min() {
2873
+ return this.calcMin();
2874
+ }
2875
+ calcMin() {
2876
+ if (this.dataType.isVariable)
2877
+ throw new Error("cannot calculate minimum on a variable length data type");
2878
+ return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), Me(this.cachedMin, this.sampleOffset));
2879
+ }
2880
+ /** @returns the bounds of the series. */
2881
+ get bounds() {
2882
+ return y(Number(this.min), Number(this.max), { makeValid: !1 });
2883
+ }
2884
+ maybeRecomputeMinMax(e) {
2885
+ if (this.cachedMin != null) {
2886
+ const r = e.cachedMin ?? e.calcRawMin();
2887
+ r < this.cachedMin && (this.cachedMin = r);
2888
+ }
2889
+ if (this.cachedMax != null) {
2890
+ const r = e.cachedMax ?? e.calcRawMax();
2891
+ r > this.cachedMax && (this.cachedMax = r);
2892
+ }
2893
+ }
2894
+ atAlignment(e, r) {
2895
+ const n = Number(e - this.alignment);
2896
+ if (n < 0 || n >= this.length) {
2897
+ if (r === !0) throw new Error(`[series] - no value at index ${n}`);
2898
+ return;
2899
+ }
2900
+ return this.at(n, r);
2901
+ }
2902
+ at(e, r = !1) {
2903
+ if (this.dataType.isVariable) return this.atVariable(e, r ?? !1);
2904
+ if (this.dataType.equals(T.UUID)) return this.atUUID(e, r);
2905
+ e < 0 && (e = this.length + e);
2906
+ const n = this.data[e];
2907
+ if (n == null) {
2908
+ if (r === !0) throw new Error(`[series] - no value at index ${e}`);
2909
+ return;
2910
+ }
2911
+ return Me(n, this.sampleOffset);
2912
+ }
2913
+ atUUID(e, r) {
2914
+ e < 0 && (e = this.length + e);
2915
+ const n = Tr(
2916
+ new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
2917
+ );
2918
+ if (n == null) {
2919
+ if (r) throw new Error(`[series] - no value at index ${e}`);
2920
+ return;
2921
+ }
2922
+ return n;
2923
+ }
2924
+ atVariable(e, r) {
2925
+ let n = 0, s = 0;
2926
+ if (this._cachedIndexes != null)
2927
+ n = this._cachedIndexes[e], s = this._cachedIndexes[e + 1] - 1;
2928
+ else {
2929
+ e < 0 && (e = this.length + e);
2930
+ for (let o = 0; o < this.data.length; o++)
2931
+ if (this.data[o] === at) {
2932
+ if (e === 0) {
2933
+ s = o;
2934
+ break;
2935
+ }
2936
+ n = o + 1, e--;
2937
+ }
2938
+ if (s === 0 && (s = this.data.length), n >= s || e > 0) {
2939
+ if (r) throw new Error(`[series] - no value at index ${e}`);
2940
+ return;
2941
+ }
2942
+ }
2943
+ const i = this.data.slice(n, s);
2944
+ return this.dataType.equals(T.STRING) ? new TextDecoder().decode(i) : ct(JSON.parse(new TextDecoder().decode(i)));
2945
+ }
2946
+ /**
2947
+ * @returns the index of the first sample that is greater than or equal to the given value.
2948
+ * The underlying array must be sorted. If it is not, the behavior of this method is undefined.
2949
+ * @param value the value to search for.
2950
+ */
2951
+ binarySearch(e) {
2952
+ let r = 0, n = this.length - 1;
2953
+ const s = Be(e);
2954
+ for (; r <= n; ) {
2955
+ const i = Math.floor((r + n) / 2), o = s(this.at(i, !0), e);
2956
+ if (o === 0) return i;
2957
+ o < 0 ? r = i + 1 : n = i - 1;
2958
+ }
2959
+ return r;
2960
+ }
2961
+ /**
2962
+ * Updates the WebGL buffer for the series if it is not up to date. This method
2963
+ * should be called whenever a series has been previously buffered to the GPU and
2964
+ * then modified via calls to write().
2965
+ * @param gl the buffer controller to update the buffer for. This controller should
2966
+ * be the same buffer previously passed to {@method acquire} or {@method updateGLBuffer}.
2967
+ */
2968
+ updateGLBuffer(e) {
2969
+ if (this.gl.control = e, !this.dataType.equals(T.FLOAT32) && !this.dataType.equals(T.UINT8))
2970
+ throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
2971
+ const { buffer: r, bufferUsage: n, prevBuffer: s } = this.gl;
2972
+ if (r == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
2973
+ if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== L) {
2974
+ s === 0 && e.bufferData(e.ARRAY_BUFFER, this.byteCapacity.valueOf(), e.STATIC_DRAW);
2975
+ const i = this.dataType.density.size(s).valueOf(), o = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
2976
+ e.bufferSubData(e.ARRAY_BUFFER, i, o.buffer), this.gl.prevBuffer = this.writePos;
2977
+ } else
2978
+ e.bufferData(
2979
+ e.ARRAY_BUFFER,
2980
+ this.buffer,
2981
+ n === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW
2982
+ ), this.gl.prevBuffer = L;
2983
+ }
2984
+ as(e) {
2985
+ return xr(e, this.dataType), this;
2986
+ }
2987
+ /** @returns a digest containing information about the series. */
2988
+ get digest() {
2989
+ return {
2990
+ key: this.key,
2991
+ dataType: this.dataType.toString(),
2992
+ sampleOffset: this.sampleOffset,
2993
+ alignment: {
2994
+ lower: Pt(this.alignmentBounds.lower),
2995
+ upper: Pt(this.alignmentBounds.upper)
2996
+ },
2997
+ timeRange: this.timeRange.toString(),
2998
+ length: this.length,
2999
+ capacity: this.capacity
3000
+ };
3001
+ }
3002
+ /**
3003
+ * @returns the alignment bounds of the series, representing the logical space
3004
+ * occupied by the series in a group of series. This is typically used to order the
3005
+ * series within a channel's data.
3006
+ *
3007
+ * The lower bound is the alignment of the first sample, and the upper bound is the
3008
+ * alignment of the last sample + 1. The lower bound is inclusive, while the upper bound
3009
+ * is exclusive.
3010
+ */
3011
+ get alignmentBounds() {
3012
+ return y(this.alignment, this.alignment + BigInt(this.length));
3013
+ }
3014
+ maybeGarbageCollectGLBuffer(e) {
3015
+ this.gl.buffer != null && (e.deleteBuffer(this.gl.buffer), this.gl.buffer = null, this.gl.prevBuffer = 0, this.gl.control = null);
3016
+ }
3017
+ /**
3018
+ * @returns the WebGL buffer for the series. This method should only be called after
3019
+ * the series has been buffered to the GPU via a call to {@method acquire} or
3020
+ * {@method updateGLBuffer}.
3021
+ * @throws if the series has not been buffered to the GPU.
3022
+ */
3023
+ get glBuffer() {
3024
+ if (this.gl.buffer == null) throw new Error("gl buffer not initialized");
3025
+ return this.gl.prevBuffer !== this.writePos && console.warn("buffer not updated"), this.gl.buffer;
3026
+ }
3027
+ [Symbol.iterator]() {
3028
+ if (this.dataType.isVariable) {
3029
+ const e = new Bi(this);
3030
+ return this.dataType.equals(T.JSON) ? new Ui(e) : e;
3031
+ }
3032
+ return this.dataType.equals(T.UUID) ? new Ci(this) : new ji(this);
3033
+ }
3034
+ /**
3035
+ * Returns a slice of the series from start to end.
3036
+ * @param start The start index (inclusive).
3037
+ * @param end The end index (exclusive).
3038
+ * @returns A new series containing the sliced data.
3039
+ */
3040
+ slice(e, r) {
3041
+ return this.sliceSub(!1, e, r);
3042
+ }
3043
+ /**
3044
+ * Returns a subarray view of the series from start to end.
3045
+ * @param start The start index (inclusive).
3046
+ * @param end The end index (exclusive).
3047
+ * @returns A new series containing the subarray data.
3048
+ */
3049
+ sub(e, r) {
3050
+ return this.sliceSub(!0, e, r);
3051
+ }
3052
+ /**
3053
+ * Returns an iterator over a portion of the series.
3054
+ * @param start The start index (inclusive).
3055
+ * @param end The end index (exclusive).
3056
+ * @returns An iterator over the specified range.
3057
+ */
3058
+ subIterator(e, r) {
3059
+ return new Dt(this, e, r ?? this.length);
3060
+ }
3061
+ /**
3062
+ * Returns an iterator over a portion of the series based on alignment.
3063
+ * @param start The start alignment (inclusive).
3064
+ * @param end The end alignment (exclusive).
3065
+ * @returns An iterator over the specified alignment range.
3066
+ */
3067
+ subAlignmentIterator(e, r) {
3068
+ return new Dt(
3069
+ this,
3070
+ Number(e - this.alignment),
3071
+ Number(r - this.alignment)
3072
+ );
3073
+ }
3074
+ subBytes(e, r) {
3075
+ if (e >= 0 && (r == null || r >= this.byteLength.valueOf())) return this;
3076
+ const n = this.data.subarray(e, r);
3077
+ return new D({
3078
+ data: n,
3079
+ dataType: this.dataType,
3080
+ timeRange: this.timeRange,
3081
+ sampleOffset: this.sampleOffset,
3082
+ glBufferUsage: this.gl.bufferUsage,
3083
+ alignment: this.alignment + BigInt(e)
3084
+ });
3085
+ }
3086
+ sliceSub(e, r, n) {
3087
+ if (r <= 0 && (n == null || n >= this.length)) return this;
3088
+ let s;
3089
+ return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new D({
3090
+ data: s,
3091
+ dataType: this.dataType,
3092
+ timeRange: this.timeRange,
3093
+ sampleOffset: this.sampleOffset,
3094
+ glBufferUsage: this.gl.bufferUsage,
3095
+ alignment: this.alignment + BigInt(r)
3096
+ });
3097
+ }
3098
+ /**
3099
+ * Creates a new series with a different alignment.
3100
+ * @param alignment The new alignment value.
3101
+ * @returns A new series with the specified alignment.
3102
+ */
3103
+ reAlign(e) {
3104
+ return new D({
3105
+ data: this.buffer,
3106
+ dataType: this.dataType,
3107
+ timeRange: V.ZERO,
3108
+ sampleOffset: this.sampleOffset,
3109
+ glBufferUsage: "static",
3110
+ alignment: e
3111
+ });
3112
+ }
3113
+ /**
3114
+ * Returns a string representation of the series.
3115
+ * For series with more than 10 elements, shows the first 5 and last 5 elements.
3116
+ * @returns A string representation of the series.
3117
+ */
3118
+ toString() {
3119
+ let e = `Series(${this.dataType.toString()} ${this.length} [`;
3120
+ if (this.length <= 10) e += Array.from(this).map((r) => r.toString());
3121
+ else {
3122
+ for (let r = 0; r < 5; r++)
3123
+ e += `${this.at(r)?.toString()}`, e += ",";
3124
+ e += "...,";
3125
+ for (let r = -5; r < 0; r++)
3126
+ e += this.at(r)?.toString(), r < -1 && (e += ",");
3127
+ }
3128
+ return e += "])", e;
3129
+ }
3130
+ };
3131
+ const Ai = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Sr ? !0 : vr(t), Nr = Oi($r, Sr);
3132
+ let Dt = class {
3133
+ series;
3134
+ end;
3135
+ index;
3136
+ constructor(e, r, n) {
3137
+ this.series = e;
3138
+ const s = y(0, e.length);
3139
+ this.end = Qe(s, n), this.index = Qe(s, r);
3140
+ }
3141
+ next() {
3142
+ return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
3143
+ }
3144
+ };
3145
+ class Bi {
3146
+ series;
3147
+ index;
3148
+ decoder;
3149
+ constructor(e) {
3150
+ if (!e.dataType.isVariable)
3151
+ throw new Error(
3152
+ "cannot create a variable series iterator for a non-variable series"
3153
+ );
3154
+ this.series = e, this.index = 0, this.decoder = new TextDecoder();
3155
+ }
3156
+ next() {
3157
+ const e = this.index, r = this.series.data;
3158
+ for (; this.index < r.length && r[this.index] !== at; ) this.index++;
3159
+ const n = this.index;
3160
+ return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
3161
+ }
3162
+ }
3163
+ let Ui = class Ir {
3164
+ wrapped;
3165
+ static schema = a.record(a.string(), a.unknown());
3166
+ constructor(e) {
3167
+ this.wrapped = e;
3168
+ }
3169
+ next() {
3170
+ const e = this.wrapped.next();
3171
+ return e.done === !0 ? { done: !0, value: void 0 } : {
3172
+ done: !1,
3173
+ value: He.decodeString(e.value, Ir.schema)
3174
+ };
3175
+ }
3176
+ }, Ci = class {
3177
+ series;
3178
+ index;
3179
+ data;
3180
+ density;
3181
+ constructor(e) {
3182
+ if (!e.dataType.equals(T.UUID))
3183
+ throw new Error("cannot create a UUID series iterator for a non-UUID series");
3184
+ this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = T.UUID.density.valueOf();
3185
+ }
3186
+ next() {
3187
+ if (this.index >= this.series.length) return { done: !0, value: void 0 };
3188
+ const e = Tr(this.data, this.index * this.density);
3189
+ return this.index++, { done: !1, value: e };
3190
+ }
3191
+ }, ji = class {
3192
+ series;
3193
+ index;
3194
+ constructor(e) {
3195
+ this.series = e, this.index = 0;
3196
+ }
3197
+ next() {
3198
+ return this.index >= this.series.length ? { done: !0, value: void 0 } : {
3199
+ done: !1,
3200
+ value: this.series.at(this.index++, !0)
3201
+ };
3202
+ }
3203
+ }, So = class {
3204
+ /** The array of series in this collection */
3205
+ series;
3206
+ /**
3207
+ * The MultiSeries constructor accepts an optional array of Series instances. All series
3208
+ * in the collection must have the same data type.
3209
+ *
3210
+ * @example
3211
+ * // Create an empty MultiSeries
3212
+ * const ms1 = new MultiSeries();
3213
+ *
3214
+ * @example
3215
+ * // Create a MultiSeries from multiple numeric series
3216
+ * const s1 = new Series(new Float32Array([1, 2, 3]));
3217
+ * const s2 = new Series(new Float32Array([4, 5, 6]));
3218
+ * const ms2 = new MultiSeries([s1, s2]);
3219
+ *
3220
+ * @example
3221
+ * // Create a MultiSeries from string series
3222
+ * const s3 = new Series(["apple", "banana"]);
3223
+ * const s4 = new Series(["carrot", "date"]);
3224
+ * const ms3 = new MultiSeries([s3, s4]);
3225
+ *
3226
+ * @example
3227
+ * // Create a MultiSeries from JSON series
3228
+ * const s5 = new Series([{ a: 1, b: "apple" }]);
3229
+ * const s6 = new Series([{ a: 2, b: "banana" }]);
3230
+ * const ms4 = new MultiSeries([s5, s6]);
3231
+ *
3232
+ * @example
3233
+ * // Add series to an existing MultiSeries
3234
+ * const ms5 = new MultiSeries();
3235
+ * ms5.push(s1);
3236
+ * ms5.push(s2);
3237
+ *
3238
+ * @example
3239
+ * // Combine two MultiSeries
3240
+ * const ms6 = new MultiSeries([s1]);
3241
+ * const ms7 = new MultiSeries([s2]);
3242
+ * ms6.push(ms7);
3243
+ *
3244
+ * @throws Error if attempting to add a series with a different data type
3245
+ */
3246
+ constructor(e = []) {
3247
+ if (e.length !== 0) {
3248
+ const r = e[0].dataType;
3249
+ for (let n = 1; n < e.length; n++)
3250
+ if (!e[n].dataType.equals(r))
3251
+ throw new Error("[multi-series] - series must have the same data type");
3252
+ }
3253
+ this.series = e;
3254
+ }
3255
+ as(e) {
3256
+ return xr(e, this.dataType), this;
3257
+ }
3258
+ /**
3259
+ * Returns the data type of the series in this collection. If the collection is empty,
3260
+ * returns DataType.UNKNOWN.
3261
+ */
3262
+ get dataType() {
3263
+ return this.series.length === 0 ? T.UNKNOWN : this.series[0].dataType;
3264
+ }
3265
+ /**
3266
+ * Returns the combined time range of all series in the collection. If the collection
3267
+ * is empty, returns TimeRange.ZERO. The time range spans from the start of the first
3268
+ * series to the end of the last series.
3269
+ */
3270
+ get timeRange() {
3271
+ return this.series.length === 0 ? V.ZERO : new V(
3272
+ this.series[0].timeRange.start,
3273
+ this.series[this.series.length - 1].timeRange.end
3274
+ );
3275
+ }
3276
+ /**
3277
+ * Returns the alignment of the first series in the collection. If the collection is
3278
+ * empty, returns 0n.
3279
+ */
3280
+ get alignment() {
3281
+ return this.series.length === 0 ? 0n : this.series[0].alignment;
3282
+ }
3283
+ /**
3284
+ * Returns the alignment bounds of the entire collection. The lower bound is the
3285
+ * alignment of the first series, and the upper bound is the alignment of the last
3286
+ * series + its length. If the collection is empty, returns bounds.construct(0n, 0n).
3287
+ */
3288
+ get alignmentBounds() {
3289
+ return this.series.length === 0 ? y(0n, 0n) : y(
3290
+ this.series[0].alignmentBounds.lower,
3291
+ this.series[this.series.length - 1].alignmentBounds.upper
3292
+ );
3293
+ }
3294
+ push(e) {
3295
+ const r = () => new Error(
3296
+ `cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
3297
+ ), n = e.dataType.equals(this.dataType);
3298
+ if (Nr(e)) {
3299
+ if (this.series.length !== 0 && !n) throw r();
3300
+ this.series.push(e);
3301
+ } else {
3302
+ if (this.series.length !== 0 && e.series.length !== 0 && !n)
3303
+ throw r();
3304
+ this.series.push(...e.series);
3305
+ }
3306
+ }
3307
+ /**
3308
+ * Returns the total length of all series in the collection.
3309
+ * @returns The sum of the lengths of all series.
3310
+ */
3311
+ get length() {
3312
+ return this.series.reduce((e, r) => e + r.length, 0);
3313
+ }
3314
+ atAlignment(e, r) {
3315
+ for (const n of this.series)
3316
+ if (I(n.alignmentBounds, e))
3317
+ return n.atAlignment(e, r);
3318
+ if (r) throw new Error(`[series] - no value at alignment ${e}`);
3319
+ }
3320
+ at(e, r = !1) {
3321
+ e < 0 && (e = this.length + e);
3322
+ for (const n of this.series) {
3323
+ if (e < n.length) return n.at(e, r);
3324
+ e -= n.length;
3325
+ }
3326
+ if (r) throw new Error(`[series] - no value at index ${e}`);
3327
+ }
3328
+ /**
3329
+ * Returns an iterator over a portion of the multi-series.
3330
+ * @param start - The start index (inclusive).
3331
+ * @param end - The end index (exclusive).
3332
+ * @returns An iterator over the specified range.
3333
+ */
3334
+ subIterator(e, r) {
3335
+ return new Ye(this, e, r ?? this.length);
3336
+ }
3337
+ /**
3338
+ * Returns an iterator over a portion of the multi-series based on alignment.
3339
+ * @param start - The start alignment (inclusive).
3340
+ * @param end - The end alignment (exclusive).
3341
+ * @returns An iterator over the specified alignment range.
3342
+ */
3343
+ subAlignmentIterator(e, r) {
3344
+ if (e >= this.alignmentBounds.upper || r <= this.alignmentBounds.lower)
3345
+ return it;
3346
+ let n = 0;
3347
+ for (let i = 0; i < this.series.length; i++) {
3348
+ const o = this.series[i];
3349
+ if (e < o.alignment) break;
3350
+ if (e >= o.alignmentBounds.upper) n += o.length;
3351
+ else if (I(o.alignmentBounds, e)) {
3352
+ n += Number(e - o.alignment);
3353
+ break;
3354
+ }
3355
+ }
3356
+ let s = 0;
3357
+ for (let i = 0; i < this.series.length; i++) {
3358
+ const o = this.series[i];
3359
+ if (r < o.alignment) break;
3360
+ if (r >= o.alignmentBounds.upper) s += o.length;
3361
+ else if (I(o.alignmentBounds, r)) {
3362
+ s += Number(r - o.alignment);
3363
+ break;
3364
+ }
3365
+ }
3366
+ return new Ye(this, n, s);
3367
+ }
3368
+ /**
3369
+ * Returns an iterator over the specified alignment range and span.
3370
+ * @param start - The start alignment (inclusive).
3371
+ * @param span - The number of samples to include.
3372
+ * @returns An iterator over the specified range.
3373
+ */
3374
+ subAlignmentSpanIterator(e, r) {
3375
+ if (e >= this.alignmentBounds.upper) return it;
3376
+ r = Math.min(r, Number(this.distance(e, this.alignmentBounds.upper)));
3377
+ let n = 0;
3378
+ for (let s = 0; s < this.series.length; s++) {
3379
+ const i = this.series[s];
3380
+ if (e < i.alignment) break;
3381
+ if (e >= i.alignmentBounds.upper) n += i.length;
3382
+ else if (I(i.alignmentBounds, e)) {
3383
+ n += Number(e - i.alignment);
3384
+ break;
3385
+ }
3386
+ }
3387
+ return new Ye(this, n, n + r);
3388
+ }
3389
+ /**
3390
+ * Updates the WebGL buffer for all series in the collection.
3391
+ * @param gl - The WebGL buffer controller to use.
3392
+ */
3393
+ updateGLBuffer(e) {
3394
+ this.series.forEach((r) => r.updateGLBuffer(e));
3395
+ }
3396
+ /**
3397
+ * Returns the bounds containing the minimum and maximum values across all series.
3398
+ */
3399
+ get bounds() {
3400
+ return rr(this.series.map((e) => e.bounds));
3401
+ }
3402
+ /**
3403
+ * Returns the sum of the byte lengths of all series.
3404
+ */
3405
+ get byteLength() {
3406
+ return new m(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
3407
+ }
3408
+ /**
3409
+ * Returns a combined typed array containing all data from all series.
3410
+ * @returns A typed array containing all data from all series.
3411
+ */
3412
+ get data() {
3413
+ const e = new this.dataType.Array(this.length);
3414
+ let r = 0;
3415
+ for (const n of this.series)
3416
+ e.set(n.data, r), r += n.length;
3417
+ return new this.dataType.Array(e.buffer);
3418
+ }
3419
+ /**
3420
+ * Traverses the alignment space by a given distance from a start point.
3421
+ * @param start - The starting alignment.
3422
+ * @param dist - The distance to traverse.
3423
+ * @returns The resulting alignment after traversal.
3424
+ */
3425
+ traverseAlignment(e, r) {
3426
+ const n = this.series.map((s) => s.alignmentBounds);
3427
+ return nr(n, e, r);
3428
+ }
3429
+ /**
3430
+ * Acquires a reference to the WebGL buffer for all series.
3431
+ * @param gl - Optional WebGL buffer controller to use.
3432
+ */
3433
+ acquire(e) {
3434
+ this.series.forEach((r) => r.acquire(e));
3435
+ }
3436
+ /**
3437
+ * Releases the WebGL buffer reference for all series.
3438
+ */
3439
+ release() {
3440
+ this.series.forEach((e) => e.release());
3441
+ }
3442
+ /**
3443
+ * Calculates the number of samples between two alignments in the multi-series.
3444
+ * @param start - The starting alignment.
3445
+ * @param end - The ending alignment.
3446
+ * @returns The distance between the alignments.
3447
+ */
3448
+ distance(e, r) {
3449
+ const n = this.series.map((s) => s.alignmentBounds);
3450
+ return sr(n, e, r);
3451
+ }
3452
+ /**
3453
+ * Parses a JSON multi-series into an array of values using the provided zod schema.
3454
+ * @template Z - The zod schema type.
3455
+ * @param schema - The zod schema to use to parse the JSON series.
3456
+ * @throws Error if the series does not have a data type of JSON.
3457
+ * @returns An array of values parsed from the JSON series.
3458
+ */
3459
+ parseJSON(e) {
3460
+ if (!this.dataType.equals(T.JSON))
3461
+ throw new Error("cannot parse non-JSON series as JSON");
3462
+ return this.series.flatMap((r) => r.parseJSON(e));
3463
+ }
3464
+ /**
3465
+ * Returns an iterator over all values in the multi-series.
3466
+ * @returns An iterator that yields all values from all series in sequence.
3467
+ */
3468
+ [Symbol.iterator]() {
3469
+ return this.series.length === 0 ? {
3470
+ next() {
3471
+ return { done: !0, value: void 0 };
3472
+ }
3473
+ } : new Ri(this.series);
3474
+ }
3475
+ /**
3476
+ * Returns an array of the values in the multi-series as strings.
3477
+ * For variable length data types (like STRING or JSON), this decodes the underlying buffer.
3478
+ * @returns An array of string representations of the multi-series values.
3479
+ */
3480
+ toStrings() {
3481
+ return this.series.flatMap((e) => e.toStrings());
3482
+ }
3483
+ }, Ri = class {
3484
+ series;
3485
+ seriesIndex;
3486
+ internal;
3487
+ constructor(e) {
3488
+ this.series = e, this.seriesIndex = 0, this.internal = e[0][Symbol.iterator]();
3489
+ }
3490
+ next() {
3491
+ const e = this.internal.next();
3492
+ 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());
3493
+ }
3494
+ [Symbol.iterator]() {
3495
+ return this;
3496
+ }
3497
+ }, Ye = class {
3498
+ series;
3499
+ index;
3500
+ end;
3501
+ constructor(e, r, n) {
3502
+ this.series = e, this.end = n, this.index = r;
3503
+ }
3504
+ next() {
3505
+ return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
3506
+ }
3507
+ [Symbol.iterator]() {
3508
+ return this;
3509
+ }
3510
+ };
3511
+ const Pt = (t) => {
3512
+ const e = t >> 32n, r = t & 0xffffffffn;
3513
+ return { domain: e, sample: r };
3514
+ };
3515
+ a.object({ key: a.string(), value: a.string() });
3516
+ const Li = a.record(
3517
+ a.union([a.number(), a.string(), a.symbol()]),
3518
+ a.unknown()
3519
+ ), Bt = (t) => Object.entries(t), Di = (t, e) => Object.fromEntries(Bt(t).map(([r, n]) => [r, e(n, r)])), Pi = (t) => Object.fromEntries(Bt(t).filter(([e, r]) => r !== void 0)), Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3520
+ __proto__: null,
3521
+ entries: Bt,
3522
+ map: Di,
3523
+ purgeUndefined: Pi,
3524
+ unknownZ: Li
3525
+ }, Symbol.toStringTag, { value: "Module" })), Mr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", qi = Mr(), Er = ["macOS", "Windows", "Linux"], ki = ["macos", "windows", "linux"], zi = {
3526
+ macos: "macOS",
3527
+ windows: "Windows",
3528
+ linux: "Linux"
3529
+ }, Fi = a.enum(Er).or(
3530
+ a.enum(ki).transform((t) => zi[t])
3531
+ ), Zi = () => {
3532
+ if (typeof window > "u") return;
3533
+ const t = window.navigator.userAgent.toLowerCase();
3534
+ if (t.includes("mac")) return "macOS";
3535
+ if (t.includes("win")) return "Windows";
3536
+ if (t.includes("linux")) return "Linux";
3537
+ };
3538
+ let Ve;
3539
+ const Yi = (t = {}) => {
3540
+ const { force: e, default: r } = t;
3541
+ return e ?? Ve ?? (Ve = Zi(), Ve ?? r);
3542
+ }, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3543
+ __proto__: null,
3544
+ OPERATING_SYSTEMS: Er,
3545
+ RUNTIME: qi,
3546
+ detect: Mr,
3547
+ getOS: Yi,
3548
+ osZ: Fi
3549
+ }, Symbol.toStringTag, { value: "Module" })), Vi = (...t) => t.map(Ar).join(""), Ar = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Wi = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
3550
+ class Ee {
3551
+ protocol;
3552
+ host;
3553
+ port;
3554
+ path;
3555
+ /**
3556
+ * @param host - The hostname or IP address of the server.
3557
+ * @param port - The port number of the server.
3558
+ * @param protocol - The protocol to use for all requests. Defaults to "".
3559
+ * @param pathPrefix - A path prefix to use for all requests. Defaults to "".
3560
+ */
3561
+ constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
3562
+ this.protocol = n, this.host = e, this.port = r, this.path = Ar(s);
3563
+ }
3564
+ /**
3565
+ * Replaces creates a new URL with the specified properties replaced.
3566
+ * @param props - The properties to replace.
3567
+ * @returns a new URL.
3568
+ */
3569
+ replace(e) {
3570
+ return new Ee({
3571
+ host: e.host ?? this.host,
3572
+ port: e.port ?? this.port,
3573
+ protocol: e.protocol ?? this.protocol,
3574
+ pathPrefix: e.pathPrefix ?? this.path
3575
+ });
3576
+ }
3577
+ /**
3578
+ * Creates a new url with the given path appended to the current path.
3579
+ * @param path - the path to append to the URL.
3580
+ * @returns a new URL.
3581
+ */
3582
+ child(e) {
3583
+ return new Ee({
3584
+ ...this,
3585
+ pathPrefix: Vi(this.path, e)
3586
+ });
3587
+ }
3588
+ /** @returns a string representation of the url */
3589
+ toString() {
3590
+ return Wi(
3591
+ `${this.protocol}://${this.host}:${this.port}/${this.path}`
3592
+ );
3593
+ }
3594
+ static UNKNOWN = new Ee({ host: "unknown", port: 0 });
3595
+ }
3596
+ const Gi = 2, Hi = 3, Ji = 2, Xi = (t, e) => {
3597
+ if (Number.isNaN(t) || !Number.isFinite(t)) return t;
3598
+ const r = ye(e);
3599
+ if (r == 0) return t;
3600
+ let n;
3601
+ r >= 1e3 ? n = Gi : r >= 1 ? n = Hi : n = Math.ceil(-Math.log10(r)) + Ji;
3602
+ const s = 10 ** n;
3603
+ return Math.round(t * s) / s;
3604
+ }, Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3605
+ __proto__: null,
3606
+ abs: er,
3607
+ add: Qt,
3608
+ closeTo: In,
3609
+ div: An,
3610
+ equal: Ke,
3611
+ max: En,
3612
+ min: _t,
3613
+ mult: Y,
3614
+ roundBySpan: Xi,
3615
+ roundToNearestMagnitude: Mn,
3616
+ sub: ae
3617
+ }, Symbol.toStringTag, { value: "Module" }));
3618
+ a.object({
3619
+ baseInterval: h.z.optional(),
3620
+ maxRetries: a.number().optional(),
3621
+ scale: a.number().optional()
3622
+ });
3623
+ const Ki = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Br = a.string().regex(Ki), _ = a.number().min(0).max(255), Ur = a.number().min(0).max(1), qe = a.tuple([_, _, _, Ur]), Qi = a.tuple([_, _, _]), _i = a.object({ rgba255: qe }), ea = a.number().min(0).max(360), ta = a.number().min(0).max(100), ra = a.number().min(0).max(100), Cr = a.tuple([ea, ta, ra, Ur]), ke = a.union([Br, Qi, qe, Cr, _i]), ze = ke.transform((t) => w(t)), na = (t) => ze.safeParse(t).success, sa = (t) => qe.safeParse(t).success, ia = (t) => {
3624
+ if (t == null) return;
3625
+ const e = ze.safeParse(t);
3626
+ if (e.success) return Rr(e.data);
3627
+ if (typeof t == "string") return t;
3628
+ throw e.error;
3629
+ }, w = (t, e = 1) => {
3630
+ if (t = ke.parse(t), typeof t == "string") return ya(t, e);
3631
+ if (Array.isArray(t)) {
3632
+ if (t.length < 3 || t.length > 4)
3633
+ throw new Error(`Invalid color: [${t.join(", ")}]`);
3634
+ return t.length === 3 ? [...t, e] : t;
3635
+ }
3636
+ return t.rgba255;
3637
+ }, jr = (t, e) => {
3638
+ if (t == null || e == null) return t == e;
3639
+ const r = w(t), n = w(e);
3640
+ return r.every((s, i) => s === n[i]);
3641
+ }, aa = (t) => {
3642
+ if (t == null) return;
3643
+ const [e, r, n, s] = w(t);
3644
+ return `#${Oe(e)}${Oe(r)}${Oe(n)}${s === 1 ? "" : Oe(s * 255)}`;
3645
+ }, Rr = (t) => {
3646
+ const [e, r, n, s] = w(t);
3647
+ return `rgba(${e}, ${r}, ${n}, ${s})`;
3648
+ }, oa = (t) => `rgb(${Lr(t)})`, Lr = (t) => {
3649
+ const [e, r, n] = w(t);
3650
+ return `${e}, ${r}, ${n}`;
3651
+ }, ua = (t) => [...Ut(t), ce(t)], Ut = (t) => [
3652
+ oe(t) / 255,
3653
+ ue(t) / 255,
3654
+ le(t) / 255
3655
+ ], oe = (t) => w(t)[0], ue = (t) => w(t)[1], le = (t) => w(t)[2], ce = (t) => w(t)[3], la = (t) => jr(Ct, t), ca = (t) => wa(w(t)), ha = (t, e) => {
3656
+ const [r, n, s] = w(t);
3657
+ if (e > 100)
3658
+ throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
3659
+ return e > 1 && (e /= 100), [r, n, s, e];
3660
+ }, ge = (t) => {
3661
+ const [e, r, n] = Ut(t).map(
3662
+ (s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
3663
+ );
3664
+ return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
3665
+ }, fa = (t) => {
3666
+ const [e, r, n] = Ut(t);
3667
+ return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
3668
+ }, ot = (t, e) => {
3669
+ const r = w(t), n = w(e), s = ge(r), i = ge(n);
3670
+ return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
3671
+ }, da = (t, ...e) => {
3672
+ if (e.length === 0)
3673
+ throw new Error("[Color.pickByContrast] - must provide at least one color");
3674
+ const r = w(t), [n] = e.sort((s, i) => ot(r, i) - ot(r, s));
3675
+ return w(n);
3676
+ }, ga = (t) => ge(t) < 0.5, pa = (t) => ge(t) > 0.5, ya = (t, e = 1) => (t = Br.parse(t), t = ma(t), [
3677
+ ve(t, 0),
3678
+ ve(t, 2),
3679
+ ve(t, 4),
3680
+ t.length === 8 ? ve(t, 6) / 255 : e
3681
+ ]), Ct = [0, 0, 0, 0], Oe = (t) => Math.floor(t).toString(16).padStart(2, "0"), ve = (t, e) => parseInt(t.slice(e, e + 2), 16), ma = (t) => t.startsWith("#") ? t.slice(1) : t, ba = (t) => {
3682
+ t = Cr.parse(t);
3683
+ let [e, r, n] = t;
3684
+ const s = t[3];
3685
+ e /= 360, r /= 100, n /= 100;
3686
+ let i, o, c;
3687
+ if (r === 0)
3688
+ i = o = c = n;
3689
+ else {
3690
+ const l = n < 0.5 ? n * (1 + r) : n + r - n * r, f = 2 * n - l;
3691
+ i = We(f, l, e + 1 / 3), o = We(f, l, e), c = We(f, l, e - 1 / 3);
3692
+ }
3693
+ return [Math.round(i * 255), Math.round(o * 255), Math.round(c * 255), s];
3694
+ }, We = (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), wa = (t) => {
3695
+ t = qe.parse(t);
3696
+ let [e, r, n] = t;
3697
+ const s = t[3];
3698
+ e /= 255, r /= 255, n /= 255;
3699
+ const i = Math.max(e, r, n), o = Math.min(e, r, n);
3700
+ let c, l, f = (i + o) / 2;
3701
+ if (i === o)
3702
+ c = l = 0;
3703
+ else {
3704
+ const p = i - o;
3705
+ l = f > 0.5 ? p / (2 - i - o) : p / (i + o), i === e ? c = (r - n) / p + (r < n ? 6 : 0) : i === r ? c = (n - e) / p + 2 : c = (e - r) / p + 4, c /= 6;
3706
+ }
3707
+ return c *= 360, l *= 100, f *= 100, [Math.round(c), Math.round(l), Math.round(f), s];
3708
+ }, Oa = w("#000000"), va = w("#ffffff"), Dr = a.object({
3709
+ key: a.string(),
3710
+ color: ke,
3711
+ position: a.number(),
3712
+ switched: a.boolean().optional()
3713
+ }), Ta = a.array(Dr), xa = (t, e) => {
3714
+ if (t.length === 0) return Ct;
3715
+ if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return w(t[0].color);
3716
+ if (e >= t[t.length - 1].position)
3717
+ return w(t[t.length - 1].color);
3718
+ for (let r = 0; r < t.length - 1; r++) {
3719
+ const n = t[r], s = t[r + 1];
3720
+ if (e < n.position || e > s.position) continue;
3721
+ if (e === n.position) return w(n.color);
3722
+ if (e === s.position) return w(s.color);
3723
+ const i = (e - n.position) / (s.position - n.position), o = w(n.color), c = w(s.color), l = Math.round(
3724
+ oe(o) + i * (oe(c) - oe(o))
3725
+ ), f = Math.round(
3726
+ ue(o) + i * (ue(c) - ue(o))
3727
+ ), p = Math.round(
3728
+ le(o) + i * (le(c) - le(o))
3729
+ ), g = ce(o) + i * (ce(c) - ce(o));
3730
+ return w([l, f, p, g]);
3731
+ }
3732
+ return w(t[t.length - 1].color);
3733
+ }, $a = a.object({
3734
+ key: a.string(),
3735
+ name: a.string(),
3736
+ color: ze
3737
+ }), Sa = a.object({
3738
+ key: a.string(),
3739
+ name: a.string(),
3740
+ swatches: a.array($a)
3741
+ }), Na = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3742
+ __proto__: null,
3743
+ BLACK: Oa,
3744
+ WHITE: va,
3745
+ ZERO: Ct,
3746
+ aValue: ce,
3747
+ bValue: le,
3748
+ colorZ: ze,
3749
+ construct: w,
3750
+ contrast: ot,
3751
+ crudeZ: ke,
3752
+ cssString: ia,
3753
+ equals: jr,
3754
+ fromGradient: xa,
3755
+ fromHSLA: ba,
3756
+ gValue: ue,
3757
+ gradientZ: Ta,
3758
+ grayness: fa,
3759
+ hex: aa,
3760
+ hsla: ca,
3761
+ isColor: sa,
3762
+ isCrude: na,
3763
+ isDark: ga,
3764
+ isLight: pa,
3765
+ isZero: la,
3766
+ luminance: ge,
3767
+ paletteZ: Sa,
3768
+ pickByContrast: da,
3769
+ rValue: oe,
3770
+ rgbCSS: oa,
3771
+ rgbString: Lr,
3772
+ rgba1: ua,
3773
+ rgbaCSS: Rr,
3774
+ setAlpha: ha,
3775
+ stopZ: Dr
3776
+ }, Symbol.toStringTag, { value: "Module" })), Pr = a.int().min(0).max(255), qr = 255, kr = 0, Ia = {
3777
+ lower: kr,
3778
+ upper: qr + 1
3779
+ }, zr = a.object({
3780
+ name: a.string(),
3781
+ key: a.string()
3782
+ }), pe = (t) => a.object({
3783
+ subject: zr,
3784
+ resource: t,
3785
+ authority: Pr
3786
+ }), Ma = (...t) => (e) => e.filter((r) => {
3787
+ let n = !1;
3788
+ return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
3789
+ }), Fr = (t) => a.object({
3790
+ from: pe(t),
3791
+ to: a.null()
3792
+ }), Zr = (t) => a.object({
3793
+ from: a.null(),
3794
+ to: pe(t)
3795
+ }), Ea = (t) => a.union([
3796
+ Fr(t),
3797
+ Zr(t),
3798
+ a.object({
3799
+ from: pe(t),
3800
+ to: pe(t)
3801
+ })
3802
+ ]), Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3803
+ __proto__: null,
3804
+ ABSOLUTE_AUTHORITY: qr,
3805
+ AUTHORITY_BOUNDS: Ia,
3806
+ ZERO_AUTHORITY: kr,
3807
+ acquireZ: Zr,
3808
+ authorityZ: Pr,
3809
+ filterTransfersByChannelKey: Ma,
3810
+ releaseZ: Fr,
3811
+ stateZ: pe,
3812
+ subjectZ: zr,
3813
+ transferZ: Ea
3814
+ }, Symbol.toStringTag, { value: "Module" })), Aa = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Ba = (t, e) => {
3815
+ const r = Symbol.for(t);
3816
+ if (!Aa(r)) {
3817
+ const n = e();
3818
+ Object.defineProperty(globalThis, r, { value: n });
3819
+ }
3820
+ return () => globalThis[r];
3821
+ }, Yr = "sy_x_error", Ua = (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), Vr = (t) => class ie extends Error {
3822
+ static discriminator = Yr;
3823
+ discriminator = ie.discriminator;
3824
+ static TYPE = t;
3825
+ type = ie.TYPE;
3826
+ static matches = Ua(t);
3827
+ matches = ie.matches;
3828
+ constructor(r, n) {
3829
+ super(r, n), this.name = ie.TYPE;
3830
+ }
3831
+ static sub(r) {
3832
+ return Vr(`${t}.${r}`);
3833
+ }
3834
+ }, Ca = (t) => {
3835
+ if (t == null || typeof t != "object") return !1;
3836
+ const e = t;
3837
+ if (e.discriminator !== Yr) return !1;
3838
+ if (!("type" in e))
3839
+ throw new Error(
3840
+ `X Error is missing its type property: ${JSON.stringify(e)}`
3841
+ );
3842
+ return !0;
3843
+ }, re = "unknown", qt = "nil";
3844
+ class ja {
3845
+ providers = [];
3846
+ register(e) {
3847
+ this.providers.push(e);
3848
+ }
3849
+ encode(e) {
3850
+ if (e == null) return { type: qt, data: "" };
3851
+ if (Ca(e))
3852
+ for (const r of this.providers) {
3853
+ const n = r.encode(e);
3854
+ if (n != null) return n;
3855
+ }
3856
+ if (e instanceof Error) return { type: re, data: e.message };
3857
+ if (typeof e == "string") return { type: re, data: e };
3858
+ try {
3859
+ return { type: re, data: JSON.stringify(e) };
3860
+ } catch {
3861
+ return { type: re, data: "unable to encode error information" };
3862
+ }
3863
+ }
3864
+ decode(e) {
3865
+ if (e == null || e.type === qt) return null;
3866
+ if (e.type === re) return new kt(e.data);
3867
+ for (const r of this.providers) {
3868
+ const n = r.decode(e);
3869
+ if (n != null) return n;
3870
+ }
3871
+ return new kt(e.data);
3872
+ }
3873
+ }
3874
+ Ba("synnax-error-registry", () => new ja());
3875
+ class kt extends Vr("unknown") {
3876
+ }
3877
+ a.object({ type: a.string(), data: a.string() });
3878
+ const Co = () => new Promise((t) => setTimeout(t, 0)), jo = (t) => t ? -1 : 1, Ra = x.object({
3879
+ jsonrpc: x.literal("2.0"),
3880
+ method: x.string(),
3881
+ // params should be z.union([z.record(z.string(), z.json()),
3882
+ // z.array(z.json())]).optional() but the VSCode JSON RPC implementation uses a looser
3883
+ // definition of params then in the JSON-RPC spec.
3884
+ params: x.any().optional(),
3885
+ id: x.union([x.string(), x.number(), x.null()]).optional()
3886
+ }), Wr = x.object({
3887
+ jsonrpc: x.literal("2.0"),
3888
+ id: x.union([x.string(), x.number(), x.null()])
3889
+ }), La = Wr.extend({
3890
+ result: x.json()
3891
+ }), Da = Wr.extend({
3892
+ error: x.object({
3893
+ code: x.number().int(),
3894
+ // This should be z.string(), but the VSCode JSON RPC implementation uses a looser
3895
+ // definition of error than the JSON-RPC spec.
3896
+ message: x.string().optional(),
3897
+ data: x.json().optional()
3898
+ })
3899
+ }), Pa = x.union([La, Da]);
3900
+ x.union([Ra, Pa]);
3901
+ const qa = (t, e, r) => {
3902
+ const n = t.get(e);
3903
+ return n === void 0 ? (t.set(e, r), r) : n;
3904
+ }, Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3905
+ __proto__: null,
3906
+ getOrSetDefault: qa
3907
+ }, Symbol.toStringTag, { value: "Module" })), ut = a.string().regex(/^\d+\.\d+\.\d+$/), be = (t, e, r = {}) => {
3908
+ r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
3909
+ const n = ut.parse(t), s = ut.parse(e), [i, o, c] = n.split(".").map(Number), [l, f, p] = s.split(".").map(Number);
3910
+ if (r.checkMajor) {
3911
+ if (i < l) return xe;
3912
+ if (i > l) return $e;
3913
+ }
3914
+ if (r.checkMinor) {
3915
+ if (o < f) return xe;
3916
+ if (o > f) return $e;
3917
+ }
3918
+ if (r.checkPatch) {
3919
+ if (c < p) return xe;
3920
+ if (c > p) return $e;
3921
+ }
3922
+ return ee;
3923
+ }, ka = (t, e, r = {}) => Ht(be(t, e, r)), Gr = (t, e, r = {}) => Gt(be(t, e, r)), za = (t, e, r = {}) => Wt(be(t, e, r)), Fa = ({
3924
+ name: t,
3925
+ migrate: e
3926
+ }) => (r) => {
3927
+ try {
3928
+ const n = e(r);
3929
+ return console.log(`${t} migrated: ${r.version} -> ${n.version}`), n;
3930
+ } catch (n) {
3931
+ throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
3932
+ }
3933
+ }, Za = ({
3934
+ name: t,
3935
+ migrations: e,
3936
+ targetSchema: r,
3937
+ defaultVersion: n,
3938
+ def: s
3939
+ }) => {
3940
+ const i = Object.keys(e).sort(be).pop();
3941
+ if (i == null)
3942
+ return (f) => {
3943
+ if (f.version ??= n, f.version !== s.version)
3944
+ return console.log(
3945
+ `${t} version ${f.version} is newer than latest version of ${s.version}.
3946
+ Returning default instead.
3947
+ `
3948
+ ), s;
3949
+ try {
3950
+ return r != null ? r.parse(f) : f;
3951
+ } catch (p) {
3952
+ return console.log(`${t} failed to parse default. Exiting with default`), console.error(p), s;
3953
+ }
3954
+ };
3955
+ const o = Object.keys(e).length;
3956
+ let c = !1;
3957
+ const l = (f) => {
3958
+ try {
3959
+ if (o === 0 || Gr(f.version, i))
3960
+ return console.log(c ? `${t} ${f.version} now up to date` : `${t} version ${f.version} is up to date with target version ${s.version}`), f;
3961
+ const p = f.version, g = e[p], S = g(f);
3962
+ return c = !0, l(S);
3963
+ } catch (p) {
3964
+ return console.log(
3965
+ `${t} failed to migrate from ${f.version} to ${i}`
3966
+ ), console.error(p), s;
3967
+ }
3968
+ };
3969
+ return (f) => {
3970
+ try {
3971
+ if (f.version == null)
3972
+ if (n != null)
3973
+ console.log(
3974
+ `${t} version is null. Setting version to default of ${n}`
3975
+ ), f.version = n;
3976
+ else
3977
+ return console.log(
3978
+ `${t} version is null and no default version set. Exiting with default`
3979
+ ), s;
3980
+ return l(f);
3981
+ } catch (p) {
3982
+ return console.log(`${t} failed to parse final result. Exiting with default`), console.error(p), s;
3983
+ }
3984
+ };
3985
+ }, Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3986
+ __proto__: null,
3987
+ compareSemVer: be,
3988
+ createMigration: Fa,
3989
+ migrator: Za,
3990
+ semVerNewer: Gr,
3991
+ semVerOlder: za,
3992
+ semVerZ: ut,
3993
+ versionsEqual: ka
3994
+ }, Symbol.toStringTag, { value: "Module" })), Hr = ["standard", "scientific", "engineering"], Ya = a.enum(Hr), Va = (t, e, r) => {
3995
+ if (Number.isNaN(t)) return "NaN";
3996
+ if (t === 1 / 0) return "∞";
3997
+ if (t === -1 / 0) return "-∞";
3998
+ if (r === "standard") return t.toFixed(e);
3999
+ if (t === 0)
4000
+ return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
4001
+ let n;
4002
+ 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}`;
4003
+ }, Do = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4004
+ __proto__: null,
4005
+ NOTATIONS: Hr,
4006
+ notationZ: Ya,
4007
+ stringifyNumber: Va
4008
+ }, Symbol.toStringTag, { value: "Module" })), Po = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, Jr = a.enum([
4009
+ "success",
4010
+ "info",
4011
+ "warning",
4012
+ "error",
4013
+ "loading",
4014
+ "disabled"
4015
+ ]), Wa = (t) => a.object({
4016
+ key: a.string(),
4017
+ variant: Jr,
4018
+ message: a.string(),
4019
+ description: a.string().optional(),
4020
+ time: b.z,
4021
+ details: t ?? a.unknown().optional()
4022
+ }), Ga = (t, e) => {
4023
+ if (!(t instanceof Error)) throw t;
4024
+ return Xr({
4025
+ variant: "error",
4026
+ message: e ?? t.message,
4027
+ description: e != null ? t.message : void 0,
4028
+ details: {
4029
+ stack: t.stack ?? ""
4030
+ }
4031
+ });
4032
+ }, Xr = (t) => ({
4033
+ key: At(),
4034
+ time: b.now(),
4035
+ ...t
4036
+ }), qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4037
+ __proto__: null,
4038
+ create: Xr,
4039
+ fromException: Ga,
4040
+ statusZ: Wa,
4041
+ variantZ: Jr
4042
+ }, Symbol.toStringTag, { value: "Module" })), Ha = new Error("request for lock canceled");
4043
+ var Ja = function(t, e, r, n) {
4044
+ function s(i) {
4045
+ return i instanceof r ? i : new r(function(o) {
4046
+ o(i);
4047
+ });
4048
+ }
4049
+ return new (r || (r = Promise))(function(i, o) {
4050
+ function c(p) {
4051
+ try {
4052
+ f(n.next(p));
4053
+ } catch (g) {
4054
+ o(g);
4055
+ }
4056
+ }
4057
+ function l(p) {
4058
+ try {
4059
+ f(n.throw(p));
4060
+ } catch (g) {
4061
+ o(g);
4062
+ }
4063
+ }
4064
+ function f(p) {
4065
+ p.done ? i(p.value) : s(p.value).then(c, l);
4066
+ }
4067
+ f((n = n.apply(t, e || [])).next());
4068
+ });
4069
+ };
4070
+ class Xa {
4071
+ constructor(e, r = Ha) {
4072
+ this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
4073
+ }
4074
+ acquire(e = 1, r = 0) {
4075
+ if (e <= 0)
4076
+ throw new Error(`invalid weight ${e}: must be positive`);
4077
+ return new Promise((n, s) => {
4078
+ const i = { resolve: n, reject: s, weight: e, priority: r }, o = Kr(this._queue, (c) => r <= c.priority);
4079
+ o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
4080
+ });
4081
+ }
4082
+ runExclusive(e) {
4083
+ return Ja(this, arguments, void 0, function* (r, n = 1, s = 0) {
4084
+ const [i, o] = yield this.acquire(n, s);
4085
+ try {
4086
+ return yield r(i);
4087
+ } finally {
4088
+ o();
4089
+ }
4090
+ });
4091
+ }
4092
+ waitForUnlock(e = 1, r = 0) {
4093
+ if (e <= 0)
4094
+ throw new Error(`invalid weight ${e}: must be positive`);
4095
+ return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
4096
+ this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), Ka(this._weightedWaiters[e - 1], { resolve: n, priority: r });
4097
+ });
4098
+ }
4099
+ isLocked() {
4100
+ return this._value <= 0;
4101
+ }
4102
+ getValue() {
4103
+ return this._value;
4104
+ }
4105
+ setValue(e) {
4106
+ this._value = e, this._dispatchQueue();
4107
+ }
4108
+ release(e = 1) {
4109
+ if (e <= 0)
4110
+ throw new Error(`invalid weight ${e}: must be positive`);
4111
+ this._value += e, this._dispatchQueue();
4112
+ }
4113
+ cancel() {
4114
+ this._queue.forEach((e) => e.reject(this._cancelError)), this._queue = [];
4115
+ }
4116
+ _dispatchQueue() {
4117
+ for (this._drainUnlockWaiters(); this._queue.length > 0 && this._queue[0].weight <= this._value; )
4118
+ this._dispatchItem(this._queue.shift()), this._drainUnlockWaiters();
4119
+ }
4120
+ _dispatchItem(e) {
4121
+ const r = this._value;
4122
+ this._value -= e.weight, e.resolve([r, this._newReleaser(e.weight)]);
4123
+ }
4124
+ _newReleaser(e) {
4125
+ let r = !1;
4126
+ return () => {
4127
+ r || (r = !0, this.release(e));
4128
+ };
4129
+ }
4130
+ _drainUnlockWaiters() {
4131
+ if (this._queue.length === 0)
4132
+ for (let e = this._value; e > 0; e--) {
4133
+ const r = this._weightedWaiters[e - 1];
4134
+ r && (r.forEach((n) => n.resolve()), this._weightedWaiters[e - 1] = []);
4135
+ }
4136
+ else {
4137
+ const e = this._queue[0].priority;
4138
+ for (let r = this._value; r > 0; r--) {
4139
+ const n = this._weightedWaiters[r - 1];
4140
+ if (!n)
4141
+ continue;
4142
+ const s = n.findIndex((i) => i.priority <= e);
4143
+ (s === -1 ? n : n.splice(0, s)).forEach((i) => i.resolve());
4144
+ }
4145
+ }
4146
+ }
4147
+ _couldLockImmediately(e, r) {
4148
+ return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
4149
+ }
4150
+ }
4151
+ function Ka(t, e) {
4152
+ const r = Kr(t, (n) => e.priority <= n.priority);
4153
+ t.splice(r + 1, 0, e);
4154
+ }
4155
+ function Kr(t, e) {
4156
+ for (let r = t.length - 1; r >= 0; r--)
4157
+ if (e(t[r]))
4158
+ return r;
4159
+ return -1;
4160
+ }
4161
+ var Qa = function(t, e, r, n) {
4162
+ function s(i) {
4163
+ return i instanceof r ? i : new r(function(o) {
4164
+ o(i);
4165
+ });
4166
+ }
4167
+ return new (r || (r = Promise))(function(i, o) {
4168
+ function c(p) {
4169
+ try {
4170
+ f(n.next(p));
4171
+ } catch (g) {
4172
+ o(g);
4173
+ }
4174
+ }
4175
+ function l(p) {
4176
+ try {
4177
+ f(n.throw(p));
4178
+ } catch (g) {
4179
+ o(g);
4180
+ }
4181
+ }
4182
+ function f(p) {
4183
+ p.done ? i(p.value) : s(p.value).then(c, l);
4184
+ }
4185
+ f((n = n.apply(t, e || [])).next());
4186
+ });
4187
+ };
4188
+ class _a {
4189
+ constructor(e) {
4190
+ this._semaphore = new Xa(1, e);
4191
+ }
4192
+ acquire() {
4193
+ return Qa(this, arguments, void 0, function* (e = 0) {
4194
+ const [, r] = yield this._semaphore.acquire(1, e);
4195
+ return r;
4196
+ });
4197
+ }
4198
+ runExclusive(e, r = 0) {
4199
+ return this._semaphore.runExclusive(() => e(), 1, r);
4200
+ }
4201
+ isLocked() {
4202
+ return this._semaphore.isLocked();
4203
+ }
4204
+ waitForUnlock(e = 0) {
4205
+ return this._semaphore.waitForUnlock(1, e);
4206
+ }
4207
+ release() {
4208
+ this._semaphore.isLocked() && this._semaphore.release();
4209
+ }
4210
+ cancel() {
4211
+ return this._semaphore.cancel();
4212
+ }
4213
+ }
4214
+ class Qr extends _a {
4215
+ constructor(e) {
4216
+ super(), Object.assign(this, e);
4217
+ }
4218
+ }
4219
+ const eo = (t) => new Qr(t), ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4220
+ __proto__: null,
4221
+ mutex: Qr,
4222
+ newMutex: eo
4223
+ }, Symbol.toStringTag, { value: "Module" }));
4224
+ function _r(t) {
4225
+ var e, r, n = "";
4226
+ if (typeof t == "string" || typeof t == "number") n += t;
4227
+ else if (typeof t == "object") if (Array.isArray(t)) {
4228
+ var s = t.length;
4229
+ for (e = 0; e < s; e++) t[e] && (r = _r(t[e])) && (n && (n += " "), n += r);
4230
+ } else for (r in t) t[r] && (n && (n += " "), n += r);
4231
+ return n;
4232
+ }
4233
+ function to() {
4234
+ for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = _r(t)) && (n && (n += " "), n += e);
4235
+ return n;
4236
+ }
4237
+ const ro = to, X = "-", zt = "__", Te = "--", en = (t) => {
4238
+ const e = (...r) => ro(...r);
4239
+ return e.B = (...r) => t + X + r.join(X), e.E = (r) => t + zt + r, e.M = (...r) => t + Te + r.join("-"), e.BM = (r, ...n) => e.B(r) + Te + n.join("-"), e.BE = (r, ...n) => e.B(r) + zt + n.join(X), e.BEM = (r, n, ...s) => e.BE(r, n) + Te + s.join(X), e.extend = (r) => en(e.B(r)), e.var = (...r) => Te + t + X + r.join(X), e;
4240
+ };
4241
+ class no {
4242
+ rows = [];
4243
+ columns = [];
4244
+ prefix;
4245
+ constructor(e = "") {
4246
+ this.prefix = e;
4247
+ }
4248
+ row(e, r, n) {
4249
+ const { prefix: s } = this;
4250
+ return this.rows.push({ startLabel: s + e, endLabel: s + r, size: n }), this;
4251
+ }
4252
+ col(e, r, n) {
4253
+ const { prefix: s } = this;
4254
+ return this.columns.push({ startLabel: s + e, endLabel: s + r, size: n }), this;
4255
+ }
4256
+ build() {
4257
+ return {
4258
+ display: "grid",
4259
+ gridTemplateRows: this.rows.map((e, r) => {
4260
+ let n = r === 0 ? "[" : "";
4261
+ return n += `${e.startLabel}] ${e.size}${typeof e.size == "number" ? "px" : ""} [${e.endLabel}`, n += r === this.rows.length - 1 ? "]" : "", n;
4262
+ }).join(" "),
4263
+ gridTemplateColumns: this.columns.map((e, r) => {
4264
+ let n = r === 0 ? "[" : "";
4265
+ return n += `${e.startLabel}] ${e.size}${typeof e.size == "number" ? "px" : ""} [${e.endLabel}`, n += r === this.columns.length - 1 ? "]" : "", n;
4266
+ }).join(" ")
4267
+ };
4268
+ }
4269
+ }
4270
+ const so = (t, e) => Object.entries(e).forEach(
4271
+ ([r, n]) => n != null && t.style.setProperty(r, `${n}`)
4272
+ ), io = (t, e) => Array.from(t.style).forEach((r) => {
4273
+ r.startsWith(e) && t.style.removeProperty(r);
4274
+ }), ao = (t) => {
4275
+ const e = en(t);
4276
+ return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", cs.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", Jn.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 = so, e.removeVars = io, e.newGridBuilder = (r) => new no(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) => {
4277
+ if (!(r == null || r === !1))
4278
+ return typeof r == "number" ? `var(--${t}-gray-l${r})` : Na.cssString(r);
4279
+ }, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
4280
+ }, zo = ao("pluto");
4281
+ export {
4282
+ Oo as $,
4283
+ Z as A,
4284
+ is as B,
4285
+ zo as C,
4286
+ as as D,
4287
+ Lt as E,
4288
+ fo as F,
4289
+ St as G,
4290
+ mo as H,
4291
+ Sr as I,
4292
+ Ot as J,
4293
+ yo as K,
4294
+ O as L,
4295
+ j as M,
4296
+ Js as N,
4297
+ go as O,
4298
+ rs as P,
4299
+ F as Q,
4300
+ oi as R,
4301
+ Ao as S,
4302
+ me as T,
4303
+ z as U,
4304
+ So as V,
4305
+ po as W,
4306
+ Gs as X,
4307
+ vo as Y,
4308
+ Ws as Z,
4309
+ qo as _,
4310
+ wo as a,
4311
+ jo as a0,
4312
+ Po as b,
4313
+ co as c,
4314
+ bo as d,
4315
+ b as e,
4316
+ h as f,
4317
+ Jn as g,
4318
+ m as h,
4319
+ Na as i,
4320
+ Bo as j,
4321
+ ko as k,
4322
+ Uo as l,
4323
+ Do as m,
4324
+ en as n,
4325
+ cs as o,
4326
+ to as p,
4327
+ Lo as q,
4328
+ T as r,
4329
+ Ro as s,
4330
+ Eo as t,
4331
+ Co as u,
4332
+ N as v,
4333
+ V as w,
4334
+ ss as x,
4335
+ mt as y,
4336
+ uo as z
4337
+ };