@synnaxlabs/pluto 0.44.7 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/{Animated-DdcRuSba.js → Animated-B9bcEALW.js} +2 -2
  2. package/dist/Animated-EQN_Zecr.cjs +1 -0
  3. package/dist/{LinePlot-BIZ1E3Rb.js → LinePlot-82qQ7-BC.js} +890 -850
  4. package/dist/LinePlot-Do2q5AyX.cjs +53 -0
  5. package/dist/Toggle-BKrbt8lh.cjs +1 -0
  6. package/dist/{Toggle-DfINNQZ3.js → Toggle-BNABJ5M2.js} +2 -2
  7. package/dist/{Video-CMuBiBcp.js → Video-B4UWip-3.js} +1 -1
  8. package/dist/{Video-CbaEeyGH.cjs → Video-CgaO8bTm.cjs} +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-BlHGoCgb.js → css-BUXMI9PB.js} +1082 -990
  14. package/dist/css-CmXY6iPo.cjs +8 -0
  15. package/dist/css.cjs +1 -1
  16. package/dist/css.js +2 -2
  17. package/dist/dialog.cjs +1 -1
  18. package/dist/dialog.js +1 -1
  19. package/dist/eraser-C1jjA5cv.cjs +63 -0
  20. package/dist/{eraser-BstNvEkO.js → eraser-DXDDmPgV.js} +3097 -2742
  21. package/dist/ether.cjs +1 -1
  22. package/dist/ether.js +9 -9
  23. package/dist/external-5DC2xiKR.cjs +1 -0
  24. package/dist/{external-ClD0dLdB.js → external-65blLb4-.js} +2 -2
  25. package/dist/external-B8KPEzPt.cjs +1 -0
  26. package/dist/external-BEkAplsH.cjs +1 -0
  27. package/dist/external-BIykXq97.cjs +1 -0
  28. package/dist/{external-GS2AbOOd.js → external-BKOEKFd7.js} +3 -3
  29. package/dist/{external-V3Tbt95R.js → external-BOvnkwzO.js} +4 -4
  30. package/dist/{external-J5kFGShS.js → external-BSeWLcfY.js} +5 -4
  31. package/dist/external-Bqmws2bv.cjs +1 -0
  32. package/dist/external-CFsDBQGs.cjs +1 -0
  33. package/dist/{external-CsZA1s33.js → external-CGX7u75x.js} +2 -2
  34. package/dist/external-CJKfUQ-9.cjs +1 -0
  35. package/dist/{external-DkZwoQZk.js → external-CPW2TrSs.js} +43 -45
  36. package/dist/external-CijGOPm7.cjs +1 -0
  37. package/dist/external-DCQ725nK.cjs +1 -0
  38. package/dist/{external-CtRU4mkG.js → external-DLo-151g.js} +13 -10
  39. package/dist/external-DTLy0px_.js +380 -0
  40. package/dist/external-DWfn7Yhk.cjs +1 -0
  41. package/dist/external-DcNW5o-8.cjs +1 -0
  42. package/dist/{external-FrSPoRvt.js → external-Gh_0tAJ0.js} +2 -2
  43. package/dist/external-J1Ji-Eku.js +92 -0
  44. package/dist/{external-Ds3Wz9sk.js → external-SQa3Pr0s.js} +3 -3
  45. package/dist/external-W69NXl-R.js +84 -0
  46. package/dist/{external-BNwo0Mju.js → external-_ninRYLQ.js} +3 -3
  47. package/dist/{external-DSkHe-2Y.cjs → external-kaUzEm1U.cjs} +2 -2
  48. package/dist/external-mOr1FzAd.cjs +1 -0
  49. package/dist/flex.cjs +1 -1
  50. package/dist/flex.js +1 -1
  51. package/dist/{fontString-Cp4X6CqQ.cjs → fontString-4EFXWlQp.cjs} +1 -1
  52. package/dist/{fontString-Ca1-oixk.js → fontString-D_jEa-uI.js} +2 -2
  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 +14308 -13556
  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/main-2qH2bggR.cjs +92 -0
  62. package/dist/{Editable-BrtvNf66.js → main-jKCzbrWn.js} +8859 -8684
  63. package/dist/menu.cjs +1 -1
  64. package/dist/menu.js +1 -1
  65. package/dist/pluto.css +1 -1
  66. package/dist/src/button/Button.d.ts +3 -2
  67. package/dist/src/button/Button.d.ts.map +1 -1
  68. package/dist/src/color/BaseSwatch.d.ts.map +1 -1
  69. package/dist/src/dialog/Frame.d.ts.map +1 -1
  70. package/dist/src/dialog/position.d.ts.map +1 -1
  71. package/dist/src/flex/Box.d.ts +4 -4
  72. package/dist/src/flux/core/store.d.ts +38 -27
  73. package/dist/src/flux/core/store.d.ts.map +1 -1
  74. package/dist/src/flux/form.d.ts.map +1 -1
  75. package/dist/src/flux/form.spec.d.ts.map +1 -1
  76. package/dist/src/flux/list.d.ts +3 -1
  77. package/dist/src/flux/list.d.ts.map +1 -1
  78. package/dist/src/flux/list.spec.d.ts.map +1 -1
  79. package/dist/src/flux/result.spec.d.ts.map +1 -1
  80. package/dist/src/flux/retrieve.spec.d.ts.map +1 -1
  81. package/dist/src/flux/update.d.ts +3 -5
  82. package/dist/src/flux/update.d.ts.map +1 -1
  83. package/dist/src/flux/update.spec.d.ts.map +1 -1
  84. package/dist/src/form/Context.d.ts +1 -0
  85. package/dist/src/form/Context.d.ts.map +1 -1
  86. package/dist/src/form/state.d.ts +5 -1
  87. package/dist/src/form/state.d.ts.map +1 -1
  88. package/dist/src/form/use.d.ts.map +1 -1
  89. package/dist/src/form/useField.d.ts +3 -2
  90. package/dist/src/form/useField.d.ts.map +1 -1
  91. package/dist/src/generic/Generic.d.ts.map +1 -1
  92. package/dist/src/group/queries.d.ts +4 -3
  93. package/dist/src/group/queries.d.ts.map +1 -1
  94. package/dist/src/hardware/task/queries.d.ts +2 -1
  95. package/dist/src/hardware/task/queries.d.ts.map +1 -1
  96. package/dist/src/header/Header.d.ts +2 -1
  97. package/dist/src/header/Header.d.ts.map +1 -1
  98. package/dist/src/hooks/index.d.ts +1 -0
  99. package/dist/src/hooks/index.d.ts.map +1 -1
  100. package/dist/src/hooks/useCursorDrag/useCursorDrag.d.ts.map +1 -1
  101. package/dist/src/hooks/useCursorDrag/useVirtualCursorDragWebKit.d.ts.map +1 -1
  102. package/dist/src/hooks/useCursorDrag/useVirtualCursorDragWebView.d.ts.map +1 -1
  103. package/dist/src/icon/Fitting.d.ts +2 -0
  104. package/dist/src/icon/Fitting.d.ts.map +1 -0
  105. package/dist/src/icon/LabJack.d.ts +3 -0
  106. package/dist/src/icon/LabJack.d.ts.map +1 -0
  107. package/dist/src/icon/NI.d.ts +2 -0
  108. package/dist/src/icon/NI.d.ts.map +1 -0
  109. package/dist/src/icon/OPC.d.ts +2 -0
  110. package/dist/src/icon/OPC.d.ts.map +1 -0
  111. package/dist/src/icon/Process.d.ts +2 -0
  112. package/dist/src/icon/Process.d.ts.map +1 -0
  113. package/dist/src/icon/Pump.d.ts +2 -0
  114. package/dist/src/icon/Pump.d.ts.map +1 -0
  115. package/dist/src/icon/Tank.d.ts +2 -0
  116. package/dist/src/icon/Tank.d.ts.map +1 -0
  117. package/dist/src/icon/Valve.d.ts +2 -0
  118. package/dist/src/icon/Valve.d.ts.map +1 -0
  119. package/dist/src/icon/external.d.ts +5 -0
  120. package/dist/src/icon/external.d.ts.map +1 -1
  121. package/dist/src/icon/registry.d.ts +8 -2
  122. package/dist/src/icon/registry.d.ts.map +1 -1
  123. package/dist/src/index.d.ts +2 -1
  124. package/dist/src/index.d.ts.map +1 -1
  125. package/dist/src/input/DateTime.d.ts.map +1 -1
  126. package/dist/src/input/HelpText.d.ts.map +1 -1
  127. package/dist/src/label/queries.d.ts +1 -1
  128. package/dist/src/label/queries.d.ts.map +1 -1
  129. package/dist/src/list/Frame.d.ts.map +1 -1
  130. package/dist/src/list/Items.d.ts +1 -1
  131. package/dist/src/list/Items.d.ts.map +1 -1
  132. package/dist/src/list/external.d.ts +1 -0
  133. package/dist/src/list/external.d.ts.map +1 -1
  134. package/dist/src/list/pager.spec.d.ts.map +1 -1
  135. package/dist/src/list/useCombinedData.d.ts +8 -0
  136. package/dist/src/list/useCombinedData.d.ts.map +1 -0
  137. package/dist/src/list/useCombinedData.spec.d.ts +2 -0
  138. package/dist/src/list/useCombinedData.spec.d.ts.map +1 -0
  139. package/dist/src/mosaic/use.d.ts.map +1 -1
  140. package/dist/src/ontology/queries.d.ts +2 -2
  141. package/dist/src/pluto/Pluto.d.ts +2 -0
  142. package/dist/src/pluto/Pluto.d.ts.map +1 -1
  143. package/dist/src/ranger/queries.d.ts +3 -2
  144. package/dist/src/ranger/queries.d.ts.map +1 -1
  145. package/dist/src/schematic/external.d.ts +3 -0
  146. package/dist/src/schematic/external.d.ts.map +1 -0
  147. package/dist/src/schematic/index.d.ts.map +1 -0
  148. package/dist/src/schematic/symbol/Custom.d.ts +15 -0
  149. package/dist/src/schematic/symbol/Custom.d.ts.map +1 -0
  150. package/dist/src/schematic/symbol/Custom.spec.d.ts +2 -0
  151. package/dist/src/schematic/symbol/Custom.spec.d.ts.map +1 -0
  152. package/dist/src/{vis/schematic → schematic/symbol}/Forms.d.ts +7 -5
  153. package/dist/src/schematic/symbol/Forms.d.ts.map +1 -0
  154. package/dist/src/schematic/symbol/Grid.d.ts.map +1 -0
  155. package/dist/src/{vis/schematic/primitives → schematic/symbol}/Primitives.d.ts +18 -7
  156. package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -0
  157. package/dist/src/schematic/symbol/SelectOrientation.d.ts.map +1 -0
  158. package/dist/src/{vis/schematic → schematic/symbol}/Symbols.d.ts +18 -8
  159. package/dist/src/schematic/symbol/Symbols.d.ts.map +1 -0
  160. package/dist/src/schematic/symbol/external.d.ts +6 -0
  161. package/dist/src/schematic/symbol/external.d.ts.map +1 -0
  162. package/dist/src/schematic/symbol/extractRegions.d.ts +3 -0
  163. package/dist/src/schematic/symbol/extractRegions.d.ts.map +1 -0
  164. package/dist/src/schematic/symbol/extractRegions.spec.d.ts +2 -0
  165. package/dist/src/schematic/symbol/extractRegions.spec.d.ts.map +1 -0
  166. package/dist/src/schematic/symbol/index.d.ts +2 -0
  167. package/dist/src/schematic/symbol/index.d.ts.map +1 -0
  168. package/dist/src/schematic/symbol/queries.d.ts +179 -0
  169. package/dist/src/schematic/symbol/queries.d.ts.map +1 -0
  170. package/dist/src/schematic/symbol/queries.spec.d.ts +2 -0
  171. package/dist/src/schematic/symbol/queries.spec.d.ts.map +1 -0
  172. package/dist/src/{vis/schematic → schematic/symbol}/registry.d.ts +15 -6
  173. package/dist/src/schematic/symbol/registry.d.ts.map +1 -0
  174. package/dist/src/select/use.d.ts.map +1 -1
  175. package/dist/src/showcase/InputShowcase.d.ts +3 -0
  176. package/dist/src/showcase/InputShowcase.d.ts.map +1 -1
  177. package/dist/src/status/aether/aggregator.d.ts +2 -2
  178. package/dist/src/table/aether/Table.d.ts +4 -0
  179. package/dist/src/table/aether/Table.d.ts.map +1 -1
  180. package/dist/src/table/cells/Cells.d.ts +7 -1
  181. package/dist/src/table/cells/Cells.d.ts.map +1 -1
  182. package/dist/src/table/cells/registry.d.ts.map +1 -1
  183. package/dist/src/tabs/Selector.d.ts +3 -2
  184. package/dist/src/tabs/Selector.d.ts.map +1 -1
  185. package/dist/src/tabs/Tabs.d.ts +2 -2
  186. package/dist/src/tabs/Tabs.d.ts.map +1 -1
  187. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  188. package/dist/src/telem/client/streamer.d.ts.map +1 -1
  189. package/dist/src/telem/control/aether/chip.d.ts +2 -2
  190. package/dist/src/telem/control/aether/controller.d.ts +1 -1
  191. package/dist/src/telem/control/aether/indicator.d.ts +7 -7
  192. package/dist/src/telem/control/aether/legend.d.ts +2 -2
  193. package/dist/src/telem/control/aether/state.d.ts +1 -1
  194. package/dist/src/theming/Provider.d.ts +2 -1
  195. package/dist/src/theming/Provider.d.ts.map +1 -1
  196. package/dist/src/theming/aether/provider.d.ts +129 -129
  197. package/dist/src/theming/core/theme.d.ts +131 -131
  198. package/dist/src/tree/Tree.d.ts.map +1 -1
  199. package/dist/src/triggers/Text.d.ts.map +1 -1
  200. package/dist/src/triggers/hooks.d.ts.map +1 -1
  201. package/dist/src/triggers/triggers.d.ts +11 -11
  202. package/dist/src/vis/axis/axis.d.ts +2 -2
  203. package/dist/src/vis/diagram/aether/Diagram.d.ts +4 -0
  204. package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
  205. package/dist/src/vis/legend/Grouped.d.ts.map +1 -1
  206. package/dist/src/vis/line/Line.d.ts.map +1 -1
  207. package/dist/src/vis/line/aether/line.d.ts +1 -1
  208. package/dist/src/vis/line/aether/line.d.ts.map +1 -1
  209. package/dist/src/vis/lineplot/aether/XAxis.d.ts +4 -4
  210. package/dist/src/vis/lineplot/aether/YAxis.d.ts +4 -4
  211. package/dist/src/vis/lineplot/aether/axis.d.ts +2 -2
  212. package/dist/src/vis/lineplot/range/Annotation.d.ts.map +1 -1
  213. package/dist/src/vis/lineplot/range/aether/annotation.d.ts +4 -4
  214. package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts +8 -8
  215. package/dist/src/vis/lineplot/useBoundQuerier.d.ts.map +1 -1
  216. package/dist/src/vis/log/aether/Log.d.ts +3 -3
  217. package/dist/src/vis/measure/aether/measure.d.ts +8 -8
  218. package/dist/src/vis/rule/aether/aether.d.ts +2 -2
  219. package/dist/src/vis/setpoint/aether/setpoint.d.ts +3 -3
  220. package/dist/src/vis/setpoint/aether/setpoint.d.ts.map +1 -1
  221. package/dist/src/vis/setpoint/use.d.ts +2 -2
  222. package/dist/src/vis/setpoint/use.d.ts.map +1 -1
  223. package/dist/src/vis/value/RedlineForm.d.ts.map +1 -1
  224. package/dist/src/vis/value/TelemForm.d.ts.map +1 -1
  225. package/dist/src/vis/value/aether/value.d.ts +23 -3
  226. package/dist/src/vis/value/aether/value.d.ts.map +1 -1
  227. package/dist/src/vis/value/use.d.ts +8 -2
  228. package/dist/src/vis/value/use.d.ts.map +1 -1
  229. package/dist/tabs.cjs +1 -1
  230. package/dist/tabs.js +1 -1
  231. package/dist/text.cjs +1 -1
  232. package/dist/text.js +2 -2
  233. package/dist/theming.cjs +1 -1
  234. package/dist/theming.js +2 -2
  235. package/dist/tree.cjs +1 -1
  236. package/dist/tree.js +1 -1
  237. package/dist/triggers.cjs +1 -1
  238. package/dist/triggers.js +1 -1
  239. package/dist/{units-D8blpqyN.js → units-BPvO622s.js} +3 -3
  240. package/dist/units-DkdMPsxa.cjs +1 -0
  241. package/dist/video.cjs +1 -1
  242. package/dist/video.js +1 -1
  243. package/package.json +6 -6
  244. package/dist/Animated-D5LYKEkW.cjs +0 -1
  245. package/dist/Editable-7Abx7gK5.cjs +0 -92
  246. package/dist/LinePlot-DslwDvAo.cjs +0 -53
  247. package/dist/Toggle-BVFmU1mL.cjs +0 -1
  248. package/dist/css-CZ_XGkIB.cjs +0 -8
  249. package/dist/eraser-DiJNbabo.cjs +0 -63
  250. package/dist/external-B33LW5pz.cjs +0 -1
  251. package/dist/external-C3hm9xgd.cjs +0 -1
  252. package/dist/external-CE5Gf1U4.cjs +0 -1
  253. package/dist/external-CSkXMvdW.js +0 -82
  254. package/dist/external-C_25EtbW.js +0 -374
  255. package/dist/external-CoEPLcYb.js +0 -69
  256. package/dist/external-CoVeaXHg.cjs +0 -1
  257. package/dist/external-Cs-XdMNw.cjs +0 -1
  258. package/dist/external-D-FHwqls.cjs +0 -1
  259. package/dist/external-D91gCQ3U.cjs +0 -1
  260. package/dist/external-DE-uFhwW.cjs +0 -1
  261. package/dist/external-DXm6LsSg.cjs +0 -1
  262. package/dist/external-IBErJ3kF.cjs +0 -1
  263. package/dist/external-mX8u0eSb.cjs +0 -1
  264. package/dist/external-vdf1a_j1.cjs +0 -1
  265. package/dist/src/vis/schematic/Forms.d.ts.map +0 -1
  266. package/dist/src/vis/schematic/Grid.d.ts.map +0 -1
  267. package/dist/src/vis/schematic/SelectOrientation.d.ts.map +0 -1
  268. package/dist/src/vis/schematic/Symbols.d.ts.map +0 -1
  269. package/dist/src/vis/schematic/external.d.ts +0 -4
  270. package/dist/src/vis/schematic/external.d.ts.map +0 -1
  271. package/dist/src/vis/schematic/index.d.ts.map +0 -1
  272. package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +0 -1
  273. package/dist/src/vis/schematic/primitives/index.d.ts +0 -2
  274. package/dist/src/vis/schematic/primitives/index.d.ts.map +0 -1
  275. package/dist/src/vis/schematic/registry.d.ts.map +0 -1
  276. package/dist/units-Cqxg-SBx.cjs +0 -1
  277. /package/dist/src/{vis/schematic → schematic}/index.d.ts +0 -0
  278. /package/dist/src/{vis/schematic → schematic/symbol}/Grid.d.ts +0 -0
  279. /package/dist/src/{vis/schematic → schematic/symbol}/SelectOrientation.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ "use strict";const a=require("zod"),mn=t=>{const e=t.replace(/_[a-z]/g,r=>r[1].toUpperCase());return e.length>1&&e[0]===e[0].toUpperCase()&&e[1]===e[1].toUpperCase()||e.length===0?e:e[0].toLowerCase()+e.slice(1)},Pe=t=>{const e=(r,n=rt)=>{if(typeof r=="string")return t(r);if(Array.isArray(r))return r.map(o=>e(o,n));if(!Ke(r))return r;n=bn(n);const s={},i=r;return"toJSON"in i&&typeof i.toJSON=="function"?e(i.toJSON(),n):(Object.keys(i).forEach(o=>{let c=i[o];const h=t(o);n.recursive&&(Ke(c)?Vt(c)||(c=e(c,n)):n.recursiveInArray&&Wt(c)&&(c=[...c].map(l=>{let d=l;return Ke(l)?Vt(d)||(d=e(l,n)):Wt(l)&&(d=e({key:l},n).key),d}))),s[h]=c}),s)};return e},wt=Pe(mn),yn=t=>t.replace(/([a-z0-9])([A-Z])/g,(e,r,n)=>`${r}_${n.toLowerCase()}`),_t=Pe(yn),er=t=>t.length===0?t:t[0].toUpperCase()+t.slice(1),wn=[Number,String,Uint8Array],rt={recursive:!0,recursiveInArray:!0},bn=(t=rt)=>(t.recursive==null?t=rt:t.recursiveInArray??=!1,t),Wt=t=>t!=null&&Array.isArray(t),Ke=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),Vt=t=>wn.some(e=>t instanceof e),On=t=>t.replace(/\s+/g,"-").replace(/([a-z0-9])([A-Z])/g,(e,r,n)=>`${r}-${n.toLowerCase()}`).toLowerCase(),vn=Pe(On),$n=t=>{if(t.length===0)return t;let e=t.replace(/[_-]/g," ");return e=e.replace(/([a-z0-9])([A-Z])/g,(r,n,s)=>`${n} ${s}`),e=e.replace(/([A-Z]+)([A-Z][a-z])/g,(r,n,s)=>`${n} ${s}`),e=e.replace(/\s+/g," ").trim(),e=e.replace(/\b\w/g,r=>r.toUpperCase()),e},xn=Pe($n),Tn=Object.freeze(Object.defineProperty({__proto__:null,camelToSnake:_t,capitalize:er,snakeToCamel:wt,toKebab:vn,toProperNoun:xn},Symbol.toStringTag,{value:"Module"}));let Sn=class{contentType="application/json";decoder;encoder;constructor(){this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e))}decode(e,r){return this.decodeString(this.decoder.decode(e),r)}decodeString(e,r){const n=JSON.parse(e),s=wt(n);return r!=null?r.parse(s):s}encodeString(e){const r=_t(e);return JSON.stringify(r,(n,s)=>ArrayBuffer.isView(s)?Array.from(s):typeof s=="bigint"?s.toString():s)}};const nt=new Sn,st=t=>[...new Set(t)],Nn=(t,e,r=!0)=>{const n=new Map;return t.forEach(s=>{const i=e(s);if(n.has(i)){if(r)return;n.delete(i)}n.set(i,s)}),Array.from(n.values())},In=Object.freeze(Object.defineProperty({__proto__:null,by:Nn,unique:st},Symbol.toStringTag,{value:"Module"})),M=t=>t!=null&&typeof t=="object"&&"value"in t;let _=class{value;constructor(e){this.value=e}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}};const bt=t=>t!=null&&typeof t=="object"&&"toString"in t,tr=t=>{if(bt(t))return t?.toString().length===0;switch(typeof t){case"string":return t.length===0;case"number":return t===0;case"bigint":return t===0n;case"boolean":return!t;case"undefined":return!0;case"object":return t==null;default:return!1}},zn=t=>!tr(t),Mn=Object.freeze(Object.defineProperty({__proto__:null,ValueExtension:_,isCrudeValueExtension:M,isNonZero:zn,isStringer:bt,isZero:tr},Symbol.toStringTag,{value:"Module"})),ke=(t,e=!1)=>{const r=bt(t)?"stringer":typeof t;let n;switch(r){case"string":n=(s,i)=>s.localeCompare(i);break;case"stringer":n=(s,i)=>s.toString().localeCompare(i.toString());break;case"number":n=(s,i)=>Number(s)-Number(i);break;case"bigint":n=(s,i)=>BigInt(s)-BigInt(i)>0n?1:-1;break;case"boolean":n=(s,i)=>Number(s)-Number(i);break;case"undefined":n=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return e?nr(n):n},En=(t,e,r)=>{const n=ke(e[t],r);return(s,i)=>n(s[t],i[t])},An=(t,e)=>t.length!==e.length?t.length-e.length:t.every((r,n)=>r===e[n])?0:-1,rr=(t,e)=>{if(t.length!==e.length)return t.length-e.length;if(t.length===0)return 0;const r=ke(t[0]),n=[...t].sort(r),s=[...e].sort(r);return n.every((i,o)=>i===s[o])?0:-1},Bn=(t,e)=>{const r=st(t),n=st(e);return rr(r,n)},Un=(t,e)=>t===e?0:t==="first"&&e==="last"?1:-1,nr=t=>(e,r)=>t(r,e),ne=0,ze=-1,Me=1,sr=t=>t<ne,ir=t=>t>ne,Cn=t=>t>=ne,ar=t=>t===ne,jn=(t,e)=>{const r=/([a-zA-Z]+)|(\d+)/g,n=t.replace(/[\s_.-]+/g,"").match(r),s=e.replace(/[\s_.-]+/g,"").match(r);if(!n||!s)return 0;for(let i=0;i<Math.min(n.length,s.length);i++){const o=n[i],c=s[i];if(isNaN(Number(o))&&isNaN(Number(c))){const h=o.localeCompare(c);if(h!==0)return h}else if(!isNaN(Number(o))&&!isNaN(Number(c))){const h=Number(o)-Number(c);if(h!==0)return h}else return isNaN(Number(o))?-1:1}return n.length-s.length},Rn=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:ne,GREATER_THAN:Me,LESS_THAN:ze,isEqualTo:ar,isGreaterThan:ir,isGreaterThanEqual:Cn,isLessThan:sr,newF:ke,newFieldF:En,order:Un,primitiveArrays:An,reverseF:nr,stringsWithNumbers:jn,uniqueUnorderedPrimitiveArrays:Bn,unorderedPrimitiveArrays:rr},Symbol.toStringTag,{value:"Module"})),qe=a.z.tuple([a.z.number(),a.z.number()]);a.z.tuple([a.z.bigint(),a.z.bigint()]);const Ot=a.z.object({width:a.z.number(),height:a.z.number()}),Ln=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),Dn=["width","height"];a.z.enum(Dn);const Pn=["start","center","end"],kn=["signedWidth","signedHeight"];a.z.enum(kn);const ge=a.z.object({x:a.z.number(),y:a.z.number()}),or=a.z.object({clientX:a.z.number(),clientY:a.z.number()}),Ze=["x","y"],vt=a.z.enum(Ze),$t=["top","right","bottom","left"],qn=a.z.enum($t),Ye=["left","right"],xt=a.z.enum(Ye),Fe=["top","bottom"],Tt=a.z.enum(Fe),St=["center"],it=a.z.enum(St),Zn=[...$t,...St],Nt=a.z.enum(Zn);a.z.enum(Pn);const Yn=["first","last"];a.z.enum(Yn);const ur=a.z.object({lower:a.z.number(),upper:a.z.number()}),Fn=a.z.object({lower:a.z.bigint(),upper:a.z.bigint()});a.z.union([ur,qe]);a.z.union([Fn,qe]);const Wn=a.z.enum([...vt.options,...Nt.options]);a.z.enum(["x","left","right"]);a.z.enum(["y","top","bottom"]);const Vn=a.z.union([vt,Nt,a.z.instanceof(String)]),se=t=>(e,r)=>{if(typeof e=="bigint"){if(Re(r))return t(e,BigInt(r));const n=t(Number(e),Number(r));return typeof n=="number"?BigInt(Math.round(n)):n}return t(Number(e),Number(r))},P=se((t,e)=>t-e),ie=se((t,e)=>t+e),Gn=(t,e,r=1e-4)=>Math.abs(t-e)<r,at=(t,e)=>{const r=typeof t=="bigint",n=typeof e=="bigint";return r&&n?t===e:r&&Re(e)?t===BigInt(e):n&&Re(t)?e===BigInt(t):t===e},Hn=t=>{const e=10**Math.floor(Math.log10(t));return Math.round(t/e)*e},lr=se((t,e)=>t<=e?t:e),Re=t=>typeof t=="bigint"?!0:Number.isInteger(t),Jn=se((t,e)=>t>=e?t:e),cr=t=>typeof t=="bigint"?t<0n?-t:t:t<0?-t:t,B=se((t,e)=>t*e),Oe=se((t,e)=>t/e),b=(t,e,r)=>{const n={};if(typeof e=="object"&&(r=e,e=void 0),r={makeValid:!0,...r},typeof t=="number"||typeof t=="bigint")e!=null?(n.lower=t,n.upper=e):(n.lower=typeof t=="bigint"?0n:0,n.upper=t);else if(Array.isArray(t)){if(t.length!==2)throw new Error("bounds: expected array of length 2");[n.lower,n.upper]=t}else n.lower=t.lower,n.upper=t.upper;return r?.makeValid?hr(n):n},Xn=Object.freeze({lower:0,upper:0}),Kn=Object.freeze({lower:-1/0,upper:1/0}),Qn=Object.freeze({lower:0,upper:1}),_n=Object.freeze({lower:-1,upper:1}),es=(t,e)=>{if(t==null&&e==null)return!0;if(t==null||e==null)return!1;const r=b(t),n=b(e);return r?.lower===n?.lower&&r?.upper===n?.upper},hr=t=>t.lower>t.upper?{lower:t.upper,upper:t.lower}:t,ot=(t,e)=>{const r=b(t);return e<r.lower?r.lower:e>=r.upper?r.upper-(typeof r.upper=="number"?1:1n):e},U=(t,e)=>{const r=b(t);if(typeof e=="number"||typeof e=="bigint")return e>=r.lower&&e<r.upper;const n=b(e);return n.lower>=r.lower&&n.upper<=r.upper},ts=(t,e)=>{const r=b(t),n=b(e);return r.lower===n.lower?!0:n.upper===r.lower||n.lower===r.upper?!1:U(r,n.upper)||U(r,n.lower)||U(n,r.upper)||U(n,r.lower)},ve=t=>{const e=b(t);return e.upper-e.lower},rs=t=>{const e=b(t);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},ns=t=>{const e=ve(t);return typeof e=="number"?e===0:e===0n},ss=t=>{const e=b(t);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},is=t=>{const e=b(t);return(e.upper+e.lower)/2},fr=t=>({lower:Math.min(...t.map(e=>b(e).lower)),upper:Math.max(...t.map(e=>b(e).upper))}),as=t=>({lower:Math.max(...t.map(e=>b(e).lower)),upper:Math.min(...t.map(e=>b(e).upper))}),os=t=>{const e=b(t),r=typeof e.lower=="bigint";return Array.from({length:Number(ve(t))},(n,s)=>r?e.lower+BigInt(s):e.lower+s)},ut=(t,e)=>{const r=t.map(i=>b(i)),n=r.findIndex(i=>U(i,e)||e<i.lower);if(n===-1)return{index:t.length,position:0};const s=r[n];return U(s,e)?{index:n,position:Number(e-s.lower)}:{index:n,position:0}},Qe={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},us=(t,e)=>{const r=t.map(l=>b(l)),n=b(e);if(r.length===0)return Qe;const s=ut(r,n.lower),i=ut(r,n.upper);if(s.index===t.length)return{...Qe,insertInto:t.length};if(i.index===0)return{...Qe,removeAfter:i.position};if(s.index===i.index)return s.position!==0&&i.position!==0?null:{removeAfter:i.position,removeBefore:s.position,insertInto:s.index,deleteInBetween:0};let o=i.index-s.index,c=s.index,h=P(Number(ve(r[s.index])),s.position);return s.position!==0?(o-=1,c+=1):h=0,{removeBefore:h,removeAfter:i.position,insertInto:c,deleteInBetween:o}},dr=(t,e,r)=>{const n=t.map(c=>b(c)),s=r>0?1:r<0?-1:0;if(s===0)return e;let i=r,o=e;for(;at(i,0)===!1;){const c=n.findIndex(h=>s>0?o>=h.lower&&o<h.upper:o>h.lower&&o<=h.upper);if(c!==-1){const h=n[c];let l;if(s>0?l=P(h.upper,o):l=P(o,h.lower),l>0){const d=lr(cr(i),l);if(o=ie(o,s>0?d:-d),i=P(i,s>0?d:-d),at(i,0))return o;continue}}if(s>0){const h=n.filter(l=>l.lower>o);if(h.length>0)o=h[0].lower;else return o}else{const h=n.filter(l=>l.upper<o);if(h.length>0)o=h[h.length-1].upper;else return o}}return o},gr=(t,e,r)=>{const n=t.map(o=>b(o));if(e===r)return typeof e=="bigint"?0n:0;const s=e<r?b([e,r]):b([r,e]);let i=typeof e=="bigint"?0n:0;for(const o of n){const c=o.lower>s.lower?o.lower:s.lower,h=o.upper<s.upper?o.upper:s.upper;if(c<h){const l=h-c;i=i+l}}return i},ls=Object.freeze(Object.defineProperty({__proto__:null,CLIP:_n,DECIMAL:Qn,INFINITE:Kn,ZERO:Xn,bounds:ur,buildInsertionPlan:us,clamp:ot,construct:b,contains:U,distance:gr,equals:es,findInsertPosition:ut,isFinite:ss,isZero:rs,linspace:os,makeValid:hr,max:fr,mean:is,min:as,overlapsWith:ts,span:ve,spanIsZero:ns,traverse:dr},Symbol.toStringTag,{value:"Module"})),pr=Wn,D=t=>Ze.includes(t)?t:Fe.includes(t)?"y":"x",cs=t=>D(t)==="x"?"y":"x",hs=t=>D(t)==="x"?"width":"height",fs=t=>D(t)==="x"?"left":"top",ds=t=>pr.safeParse(t).success,gs=t=>D(t)==="x"?"signedWidth":"signedHeight",ps=t=>t==="center"?!1:D(t)==="x",ms=t=>D(t)==="y",mr=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:Ze,construct:D,crude:pr,dimension:hs,direction:vt,isDirection:ds,isX:ps,isY:ms,location:fs,signedDimension:gs,swap:cs},Symbol.toStringTag,{value:"Module"})),ys=xt,ws=Tt,bs=it,Os={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},vs={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},$s=Vn,G=t=>t instanceof String||!Ze.includes(t)?t:t==="x"?"left":"top",xs=t=>Os[G(t)],Ts=t=>vs[G(t)],pe=t=>{const e=G(t);return e==="top"||e==="bottom"?"y":"x"},Ss=a.z.object({x:xt.or(it),y:Tt.or(it)}),yr=a.z.object({x:xt,y:Tt}),$e=Object.freeze({x:"left",y:"top"}),It=Object.freeze({x:"right",y:"top"}),We=Object.freeze({x:"left",y:"bottom"}),zt=Object.freeze({x:"right",y:"bottom"}),Mt=Object.freeze({x:"center",y:"center"}),Et=Object.freeze({x:"center",y:"top"}),At=Object.freeze({x:"center",y:"bottom"}),Bt=Object.freeze({x:"right",y:"center"}),Ut=Object.freeze({x:"left",y:"center"}),Ns=Object.freeze([Ut,Bt,Et,At,$e,It,We,zt,Mt]),Ct=(t,e)=>t.x===e.x&&t.y===e.y,Is=(t,e)=>{if(typeof e=="object"){let r=!0;return"x"in e&&(t.x===e.x||(r=!1)),"y"in e&&(t.y===e.y||(r=!1)),r}return t.x===e||t.y===e},wr=t=>[t.x,t.y],Ee=t=>pe(G(t))==="x",zs=t=>pe(G(t))==="y",Ms=t=>`${t.x}${er(t.y)}`,Es=(t,e)=>{let r,n;if(typeof t=="object"&&"x"in t?(r=t.x,n=t.y):(r=G(t),n=G(e??t)),pe(r)===pe(n)&&r!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`);const s={...Mt};return r==="center"?Ee(n)?[s.x,s.y]=[n,r]:[s.x,s.y]=[r,n]:n==="center"?Ee(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r]:Ee(r)?[s.x,s.y]=[r,n]:[s.x,s.y]=[n,r],s},br=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:At,BOTTOM_LEFT:We,BOTTOM_RIGHT:zt,CENTER:Mt,CENTER_LEFT:Ut,CENTER_LOCATIONS:St,CENTER_RIGHT:Bt,OUTER_LOCATIONS:$t,TOP_CENTER:Et,TOP_LEFT:$e,TOP_RIGHT:It,XY_LOCATIONS:Ns,X_LOCATIONS:Ye,Y_LOCATIONS:Fe,center:bs,construct:G,constructXY:Es,corner:yr,crude:$s,direction:pe,isX:Ee,isY:zs,location:Nt,outer:qn,rotate90:Ts,swap:xs,x:ys,xy:Ss,xyCouple:wr,xyEquals:Ct,xyMatches:Is,xyToString:Ms,y:ws},Symbol.toStringTag,{value:"Module"})),lt=a.z.union([a.z.number(),ge,qe,Ot,Ln,or]),v=(t,e)=>{if(typeof t=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return t==="x"?{x:e,y:0}:{x:0,y:e}}return typeof t=="number"?{x:t,y:e??t}:Array.isArray(t)?{x:t[0],y:t[1]}:"signedWidth"in t?{x:t.signedWidth,y:t.signedHeight}:"clientX"in t?{x:t.clientX,y:t.clientY}:"width"in t?{x:t.width,y:t.height}:{x:t.x,y:t.y}},L=Object.freeze({x:0,y:0}),Or=Object.freeze({x:1,y:1}),As=Object.freeze({x:1/0,y:1/0}),Bs=Object.freeze({x:NaN,y:NaN}),Le=(t,e,r=0)=>{const n=v(t),s=v(e);return r===0?n.x===s.x&&n.y===s.y:Math.abs(n.x-s.x)<=r&&Math.abs(n.y-s.y)<=r},Us=t=>Le(t,L),jt=(t,e,r)=>{const n=v(t),s=v(e,r);return{x:n.x*s.x,y:n.y*s.y}},vr=(t,e)=>{const r=v(t);return{x:r.x+e,y:r.y}},$r=(t,e)=>{const r=v(t);return{x:r.x,y:r.y+e}},me=(t,e,r,...n)=>{if(typeof e=="string"){if(typeof r!="number")throw new Error("The value must be a number.");return e==="x"?vr(t,r):$r(t,r)}if(typeof e=="object"&&"x"in e&&typeof e.x=="string"){const s=v(r),i=v(t);return e.x==="left"?s.x=-s.x:e.x==="center"&&(s.x=0),e.y==="top"?s.y=-s.y:e.y==="center"&&(s.y=0),{x:i.x+s.x,y:i.y+s.y}}return[t,e,r??L,...n].reduce((s,i)=>{const o=v(i);return{x:s.x+o.x,y:s.y+o.y}},L)},Cs=(t,e,r)=>{const n=v(t);return e==="x"?{x:r,y:n.y}:{x:n.x,y:r}},js=(t,e)=>{const r=v(t),n=v(e);return Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)},Rs=(t,e)=>{const r=v(t),n=v(e);return{x:n.x-r.x,y:n.y-r.y}},Ls=t=>{const e=v(t);return Number.isNaN(e.x)||Number.isNaN(e.y)},Ds=t=>{const e=v(t);return Number.isFinite(e.x)&&Number.isFinite(e.y)},Ps=t=>{const e=v(t);return[e.x,e.y]},ks=t=>{const e=v(t);return{left:e.x,top:e.y}},ct=(t,e=0)=>{const r=v(t);return{x:Number(r.x.toFixed(e)),y:Number(r.y.toFixed(e))}},oe=(t,e)=>{const r=v(t),n=v(e);return{x:r.x-n.x,y:r.y-n.y}},ue=t=>{const e=v(t),r=Math.hypot(e.x,e.y);return r===0?{x:0,y:0}:{x:-e.y/r,y:e.x/r}},xr=t=>{const e=v(t),r=Math.hypot(e.x,e.y);return r===0?{x:0,y:0}:{x:e.x/r,y:e.y/r}},Tr=(...t)=>{const e=t.reduce((r,n)=>me(r,n),L);return jt(e,1/t.length)},qs=(t,e)=>{const r=[];for(let n=0;n<t.length;n++){const s=t[n];let i,o,c,h;if(n===0){const l=t[n+1],d=oe(l,s);o=ue(d),c=o,h=e}else if(n===t.length-1){const l=t[n-1],d=oe(s,l);i=ue(d),c=i,h=e}else{const l=t[n-1],d=t[n+1],w=oe(s,l),p=oe(d,s);i=ue(w),o=ue(p);const j=Math.acos((w.x*p.x+w.y*p.y)/(Math.hypot(w.x,w.y)*Math.hypot(p.x,p.y))),E=Math.sin(j/2);E===0?h=e:h=e/E,c=xr(Tr(i,o))}r.push(jt(c,h))}return r},Zs=t=>{const e=v(t);return{x:e.y,y:e.x}},ht=t=>{const e=v(t);return{x:Math.round(e.x),y:Math.round(e.y)}},Ys=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:As,NAN:Bs,ONE:Or,ZERO:L,average:Tr,calculateMiters:qs,clientXY:or,construct:v,couple:Ps,crudeZ:lt,css:ks,distance:js,equals:Le,isFinite:Ds,isNan:Ls,isZero:Us,normal:ue,normalize:xr,round:ht,scale:jt,set:Cs,sub:oe,swap:Zs,translate:me,translateX:vr,translateY:$r,translation:Rs,truncate:ct,xy:ge},Symbol.toStringTag,{value:"Module"})),Te=a.z.union([a.z.number(),a.z.string()]),Fs=a.z.object({top:Te,left:Te,width:Te,height:Te}),Ws=a.z.object({left:a.z.number(),top:a.z.number(),right:a.z.number(),bottom:a.z.number()}),Vs=a.z.object({one:ge,two:ge,root:yr}),Sr={one:L,two:L,root:$e},Gs={one:L,two:Or,root:We},Nr=(t,e)=>({one:t.one,two:t.two,root:e??t.root}),T=(t,e,r=0,n=0,s)=>{const i={one:{...L},two:{...L},root:s??$e};if(typeof t=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return i.one={x:t,y:e},i.two={x:i.one.x+r,y:i.one.y+n},i}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(i.one={x:t.left,y:t.top},i.two={x:t.right,y:t.bottom},i):(i.one=t,e==null?i.two={x:i.one.x+r,y:i.one.y+n}:typeof e=="number"?i.two={x:i.one.x+e,y:i.one.y+r}:"width"in e?i.two={x:i.one.x+e.width,y:i.one.y+e.height}:"signedWidth"in e?i.two={x:i.one.x+e.signedWidth,y:i.one.y+e.signedHeight}:i.two=e,i))},Hs=(t,e,r)=>{const n=T(t);if(typeof e=="string"){if(r==null)throw new Error("Invalid arguments for resize");const s=D(e);return T(n.one,void 0,s==="x"?r:H(n),s==="y"?r:J(n),n.root)}return T(n.one,e,void 0,void 0,n.root)},Js=(t,e,r=!0)=>{const n=T(t);let s=(i,o)=>i<o;return r&&(s=(i,o)=>i<=o),"one"in e?s(W(n),W(e))&&s(X(e),X(n))&&s(V(n),V(e))&&s(K(e),K(n)):s(W(n),e.x)&&s(e.x,X(n))&&s(V(n),e.y)&&s(e.y,K(n))},Xs=(t,e)=>Le(t.one,e.one)&&Le(t.two,e.two)&&Ct(t.root,e.root),Ir=t=>({width:H(t),height:J(t)}),Ks=t=>({signedWidth:Ve(t),signedHeight:Ge(t)}),Qs=t=>({top:V(t),left:W(t),width:H(t),height:J(t)}),Rt=(t,e,r=!1)=>{const n=D(e)==="y"?Ge(t):Ve(t);return r?n:Math.abs(n)},k=(t,e)=>{const r=T(t);return{x:e.x==="center"?ft(r).x:Q(r,e.x),y:e.y==="center"?ft(r).y:Q(r,e.y)}},Q=(t,e)=>{const r=T(t),n=wr(r.root).includes(e)?Math.min:Math.max;return Ye.includes(e)?n(r.one.x,r.two.x):n(r.one.y,r.two.y)},_s=t=>t.one.x===t.two.x&&t.one.y===t.two.y,H=t=>Rt(t,"x"),J=t=>Rt(t,"y"),Ve=t=>{const e=T(t);return e.two.x-e.one.x},Ge=t=>{const e=T(t);return e.two.y-e.one.y},zr=t=>k(t,$e),ei=t=>k(t,Et),ti=t=>k(t,It),ri=t=>k(t,We),ni=t=>k(t,At),si=t=>k(t,zt),ii=t=>k(t,Ut),ai=t=>k(t,Bt),X=t=>Q(t,"right"),K=t=>Q(t,"bottom"),W=t=>Q(t,"left"),V=t=>Q(t,"top"),ft=t=>me(zr(t),{x:Ve(t)/2,y:Ge(t)/2}),Lt=t=>{const e=T(t);return e.root.x==="left"?W(e):X(e)},Dt=t=>{const e=T(t);return e.root.y==="top"?V(e):K(e)},oi=t=>({x:Lt(t),y:Dt(t)}),Ae=t=>{const e=T(t);return{lower:e.one.x,upper:e.two.x}},Be=t=>{const e=T(t);return{lower:e.one.y,upper:e.two.y}},ui=(t,e)=>Nr(t,e),li=(t,e)=>{const r=T(t),n=Ye.includes(e)?"x":Fe.includes(e)?"y":null;if(n===null)throw new Error(`Invalid location: ${e}`);const s=e==="top"||e==="left"?Math.min:Math.max,i={...r.one},o={...r.two};return i[n]=s(r.one[n],r.two[n]),o[n]=s(r.one[n],r.two[n]),[i,o]},ci=(t,e)=>{const r=T(t),n=T(e),s=Lt(n)+(H(n)-H(r))/2,i=Dt(n)+(J(n)-J(r))/2;return T({x:s,y:i},Ir(r))},Mr=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,hi=t=>H(t)/J(t),fi=(t,e,r)=>{if(typeof e=="string"){if(r==null)throw new Error("Undefined amount passed into box.translate");const s=D(e);e=v(s,r)}const n=T(t);return T(me(n.one,e),me(n.two,e),void 0,void 0,n.root)},di=(t,e)=>{const r=Math.max(W(t),W(e)),n=Math.max(V(t),V(e)),s=Math.min(X(t),X(e)),i=Math.min(K(t),K(e));return r>s||n>i?Sr:T({x:r,y:n},{x:s,y:i},void 0,void 0,t.root)},gi=t=>H(t)*J(t),pi=(t,e)=>{const r=T(t);return T(ct(r.one,e),ct(r.two,e),void 0,void 0,r.root)},mi=(t,e,r,n,s,i)=>{const o={x:t,y:e},c={x:t+r,y:e+n};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)),T(o,c,void 0,void 0,i)},yi=t=>{const e=T(t);return T(ht(e.one),ht(e.two),void 0,void 0,e.root)},wi=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:Gs,ZERO:Sr,area:gi,areaIsZero:_s,aspect:hi,bottom:K,bottomCenter:ni,bottomLeft:ri,bottomRight:si,box:Vs,center:ft,centerLeft:ii,centerRight:ai,construct:T,constructWithAlternateRoot:mi,contains:Js,copy:Nr,css:Qs,cssBox:Fs,dim:Rt,dims:Ir,domRect:Ws,edgePoints:li,equals:Xs,height:J,intersection:di,isBox:Mr,left:W,loc:Q,positionInCenter:ci,reRoot:ui,resize:Hs,right:X,root:oi,round:yi,signedDims:Ks,signedHeight:Ge,signedWidth:Ve,top:V,topCenter:ei,topLeft:zr,topRight:ti,translate:fi,truncate:pi,width:H,x:Lt,xBounds:Ae,xyLoc:k,y:Dt,yBounds:Be},Symbol.toStringTag,{value:"Module"})),Er=a.z.object({signedWidth:a.z.number(),signedHeight:a.z.number()}),bi=a.z.union([Ot,Er,ge,qe]),Oi={width:0,height:0},vi={width:1,height:1},C=(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},$i=(t,e)=>{if(e==null)return!1;const r=C(t),n=C(e);return r.width===n.width&&r.height===n.height},xi=t=>{const e=C(t);return{width:e.height,height:e.width}},Ti=t=>{const e=C(t);return`0 0 ${e.width} ${e.height}`},Si=t=>{const e=C(t);return[e.width,e.height]},Ni=t=>({width:Math.max(...t.map(e=>C(e).width)),height:Math.max(...t.map(e=>C(e).height))}),Ii=t=>({width:Math.min(...t.map(e=>C(e).width)),height:Math.min(...t.map(e=>C(e).height))}),zi=(t,e)=>{const r=C(t);return{width:r.width*e,height:r.height*e}},Mi=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:vi,ZERO:Oi,construct:C,couple:Si,crude:bi,dimensions:Ot,equals:$i,max:Ni,min:Ii,scale:zi,signed:Er,svgViewBox:Ti,swap:xi},Symbol.toStringTag,{value:"Module"})),Ar=(t,e,r)=>e!==void 0&&t<e?e:r!==void 0&&t>r?r:t,Ei=a.z.object({offset:lt,scale:lt}),Ai=a.z.object({offset:a.z.number(),scale:a.z.number()}),Bi=t=>(e,r,n,s)=>r==="dimension"?[e,n]:[e,s?n-t:n+t],Ui=t=>(e,r,n,s)=>[e,s?n/t:n*t],Ci=t=>(e,r,n)=>{if(e===null)return[t,n];const{lower:s,upper:i}=e,{lower:o,upper:c}=t,h=i-s,l=c-o;if(r==="dimension")return[t,n*(l/h)];const d=(n-s)*(l/h)+o;return[t,d]},ji=t=>(e,r,n)=>[t,n],Ri=()=>(t,e,r)=>{if(t===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[t,r];const{lower:n,upper:s}=t;return[t,s-(r-n)]},Li=t=>(e,r,n)=>{const{lower:s,upper:i}=t;return n=Ar(n,s,i),[e,n]};let dt=class te{ops=[];currBounds=null;currType=null;reversed=!1;constructor(){this.ops=[]}static translate(e){return new te().translate(e)}static magnify(e){return new te().magnify(e)}static scale(e,r){return new te().scale(e,r)}translate(e){const r=this.new(),n=Bi(e);return n.type="translate",r.ops.push(n),r}magnify(e){const r=this.new(),n=Ui(e);return n.type="magnify",r.ops.push(n),r}scale(e,r){const n=b(e,r),s=this.new(),i=Ci(n);return i.type="scale",s.ops.push(i),s}clamp(e,r){const n=b(e,r),s=this.new(),i=Li(n);return i.type="clamp",s.ops.push(i),s}reBound(e,r){const n=b(e,r),s=this.new(),i=ji(n);return i.type="re-bound",s.ops.push(i),s}invert(){const e=Ri();e.type="invert";const r=this.new();return r.ops.push(e),r}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new te;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,r){return this.currBounds=null,this.ops.reduce(([n,s],i)=>i(n,e,s,this.reversed),[null,r])[1]}reverse(){const e=this.new();e.ops.reverse();const r=[];return e.ops.forEach((n,s)=>{if(n.type==="scale"||r.some(([o,c])=>s>=o&&s<=c))return;const i=e.ops.findIndex((o,c)=>o.type==="scale"&&c>s);i!==-1&&r.push([s,i])}),r.forEach(([n,s])=>{const i=e.ops.slice(n,s);i.unshift(e.ops[s]),e.ops.splice(n,s-n+1,...i)}),e.reversed=!e.reversed,e}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}static IDENTITY=new te},Di=class R{x;y;currRoot;constructor(e=new dt,r=new dt,n=null){this.x=e,this.y=r,this.currRoot=n}static translate(e,r){return new R().translate(e,r)}static translateX(e){return new R().translateX(e)}static translateY(e){return new R().translateY(e)}static clamp(e){return new R().clamp(e)}static magnify(e){return new R().magnify(e)}static scale(e){return new R().scale(e)}static reBound(e){return new R().reBound(e)}translate(e,r){const n=v(e,r),s=this.copy();return s.x=this.x.translate(n.x),s.y=this.y.translate(n.y),s}translateX(e){const r=this.copy();return r.x=this.x.translate(e),r}translateY(e){const r=this.copy();return r.y=this.y.translate(e),r}magnify(e){const r=this.copy();return r.x=this.x.magnify(e.x),r.y=this.y.magnify(e.y),r}scale(e){const r=this.copy();if(Mr(e)){const n=this.currRoot;return r.currRoot=e.root,n!=null&&!Ct(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(Ae(e)),r.y=r.y.scale(Be(e)),r}return r.x=r.x.scale(e.width),r.y=r.y.scale(e.height),r}reBound(e){const r=this.copy();return r.x=this.x.reBound(Ae(e)),r.y=this.y.reBound(Be(e)),r}clamp(e){const r=this.copy();return r.x=this.x.clamp(Ae(e)),r.y=this.y.clamp(Be(e)),r}copy(){const e=new R;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}dim(e){return{x:this.x.dim(e.x),y:this.y.dim(e.y)}}box(e){return T(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}static IDENTITY=new R};const Pi=Object.freeze(Object.defineProperty({__proto__:null,Scale:dt,XY:Di,crudeXYTransform:Ei,transform:Ai},Symbol.toStringTag,{value:"Module"}));let Br=(t,e=21)=>(r=e)=>{let n="",s=r|0;for(;s--;)n+=t[Math.random()*t.length|0];return n};const Ur="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ki=`0123456789${Ur}`,Cr=11,qi=Br(Ur,1),Zi=Br(ki,Cr-1),Pt=()=>`${qi()}${Zi()}`,Yi=Object.freeze(Object.defineProperty({__proto__:null,LENGTH:Cr,create:Pt},Symbol.toStringTag,{value:"Module"})),Fi=(t,e)=>r=>r instanceof e||typeof r=="object"&&r!==null&&"discriminator"in r&&r.discriminator===t,Wi=a.z.enum(["static","dynamic"]),Vi=a.z.union([a.z.tuple([a.z.int()]),a.z.tuple([a.z.int(),a.z.int().min(1).max(12)]),a.z.tuple([a.z.int(),a.z.int().min(1).max(12),a.z.int().min(1).max(31)])]),jr=(t,e)=>{const r=new y(e);if(![O.DAY,O.HOUR,O.MINUTE,O.SECOND,O.MILLISECOND,O.MICROSECOND,O.NANOSECOND].some(s=>s.equals(r)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const n=t.valueOf()%r.valueOf();return t instanceof y?new y(n):new O(n)};let y=class f extends _{constructor(e,r="UTC"){if(e==null)super(f.now().valueOf());else if(e instanceof Date)super(BigInt(e.getTime())*f.MILLISECOND.valueOf());else if(typeof e=="string")super(f.parseDateTimeString(e,r).valueOf());else if(Array.isArray(e))super(f.parseDate(e));else{let n=0n;e instanceof Number&&(e=e.valueOf()),r==="local"&&(n=f.utcOffset.valueOf()),typeof e=="number"&&(isFinite(e)?e=Math.trunc(e):(isNaN(e)&&(e=0),e===1/0?e=f.MAX:e=f.MIN)),M(e)&&(e=e.value),super(BigInt(e.valueOf())+n)}}static parseDate([e=1970,r=1,n=1]){const s=new Date(e,r-1,n,0,0,0,0);return new f(BigInt(s.getTime())*f.MILLISECOND.valueOf()).truncate(f.DAY).valueOf()}valueOf(){return this.value}static parseTimeString(e,r="UTC"){const[n,s,i]=e.split(":");let o="00",c="00";i!=null&&([o,c]=i.split("."));let h=f.hours(parseInt(n??"00")).add(f.minutes(parseInt(s??"00"))).add(f.seconds(parseInt(o??"00"))).add(f.milliseconds(parseInt(c??"00")));return r==="local"&&(h=h.add(f.utcOffset)),h.valueOf()}static parseDateTimeString(e,r="UTC"){if(!e.includes("/")&&!e.includes("-"))return f.parseTimeString(e,r);const n=new Date(e);return e.includes(":")||n.setUTCHours(0,0,0,0),new f(BigInt(n.getTime())*f.MILLISECOND.valueOf(),r).valueOf()}fString(e="ISO",r="UTC"){switch(e){case"ISODate":return this.toISOString(r).slice(0,10);case"ISOTime":return this.toISOString(r).slice(11,23);case"time":return this.timeString(!1,r);case"preciseTime":return this.timeString(!0,r);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,r)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,r)}`;default:return this.toISOString(r)}}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(f.utcOffset).date().toISOString()}timeString(e=!1,r="UTC"){const n=this.toISOString(r);return e?n.slice(11,23):n.slice(11,19)}dateString(){const e=this.date(),r=e.toLocaleString("default",{month:"short"}),n=e.toLocaleString("default",{day:"numeric"});return`${r} ${n}`}static get utcOffset(){return new O(BigInt(new Date().getTimezoneOffset())*f.MINUTE.valueOf())}static since(e){return new f().span(e)}date(){return new Date(this.milliseconds)}equals(e){return this.valueOf()===new f(e).valueOf()}span(e){return this.range(e).span}range(e){return new F(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===0n}after(e){return this.valueOf()>new f(e).valueOf()}afterEq(e){return this.valueOf()>=new f(e).valueOf()}before(e){return this.valueOf()<new f(e).valueOf()}beforeEq(e){return this.valueOf()<=new f(e).valueOf()}add(e){return new f(ie(this.valueOf(),new O(e).valueOf()))}sub(e){return new f(P(this.valueOf(),new O(e).valueOf()))}get hours(){return Number(this.valueOf())/Number(O.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(O.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(O.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(O.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(f.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(f.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getUTCFullYear()}setYear(e){const r=this.date();return r.setUTCFullYear(e),new f(r)}get month(){return this.date().getUTCMonth()}setMonth(e){const r=this.date();return r.setUTCMonth(e),new f(r)}get day(){return this.date().getUTCDate()}setDay(e){const r=this.date();return r.setUTCDate(e),new f(r)}get hour(){return this.date().getUTCHours()}get localHour(){return this.date().getHours()}setLocalHour(e){const r=this.date();return r.setHours(e),new f(r)}setHour(e){const r=this.date();return r.setUTCHours(e),new f(r)}get minute(){return this.date().getUTCMinutes()}setMinute(e){const r=this.date();return r.setUTCMinutes(e),new f(r)}get second(){return this.date().getUTCSeconds()}setSecond(e){const r=this.date();return r.setUTCSeconds(e),new f(r)}get millisecond(){return this.date().getUTCMilliseconds()}setMillisecond(e){const r=this.date();return r.setUTCMilliseconds(e),new f(r)}toString(){return this.date().toISOString()}remainder(e){return jr(this,e)}get isToday(){return this.truncate(O.DAY).equals(f.now().truncate(O.DAY))}truncate(e){return this.sub(this.remainder(e))}static now(){return new f(new Date)}static max(...e){let r=f.MIN;for(const n of e){const s=new f(n);s.after(r)&&(r=s)}return r}static min(...e){let r=f.MAX;for(const n of e){const s=new f(n);s.before(r)&&(r=s)}return r}static nanoseconds(e,r="UTC"){return new f(e,r)}static NANOSECOND=f.nanoseconds(1);static microseconds(e,r="UTC"){return f.nanoseconds(e*1e3,r)}static MICROSECOND=f.microseconds(1);static milliseconds(e,r="UTC"){return f.microseconds(e*1e3,r)}static MILLISECOND=f.milliseconds(1);static seconds(e,r="UTC"){return f.milliseconds(e*1e3,r)}static SECOND=f.seconds(1);static minutes(e,r="UTC"){return f.seconds(e*60,r)}static MINUTE=f.minutes(1);static hours(e,r="UTC"){return f.minutes(e*60,r)}static HOUR=f.hours(1);static days(e,r="UTC"){return f.hours(e*24,r)}static DAY=f.days(1);static MAX=new f((1n<<63n)-1n);static MIN=new f(0);static ZERO=new f(0);static z=a.z.union([a.z.instanceof(f),a.z.object({value:a.z.bigint()}).transform(e=>new f(e.value)),a.z.string().transform(e=>new f(BigInt(e))),a.z.number().transform(e=>new f(e)),a.z.bigint().transform(e=>new f(e)),a.z.date().transform(e=>new f(e)),a.z.custom(e=>e instanceof O).transform(e=>new f(e)),Vi.transform(e=>new f(e))]);static sort(e,r){return Number(e.valueOf()-r.valueOf())}},O=class g extends _{constructor(e){typeof e=="number"&&(e=Math.trunc(e.valueOf())),M(e)&&(e=e.value),super(BigInt(e.valueOf()))}static fromSeconds(e){return e instanceof g?e:e instanceof I?e.period:e instanceof y?new g(e):(M(e)&&(e=e.value),["number","bigint"].includes(typeof e)?g.seconds(e):new g(e))}static fromMilliseconds(e){return e instanceof g?e:e instanceof I?e.period:e instanceof y?new g(e):(M(e)&&(e=e.value),["number","bigint"].includes(typeof e)?g.milliseconds(e):new g(e))}valueOf(){return this.value}lessThan(e){return this.valueOf()<new g(e).valueOf()}greaterThan(e){return this.valueOf()>new g(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new g(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new g(e).valueOf()}remainder(e){return jr(this,e)}truncate(e){return new g(BigInt(Math.trunc(Number(this.valueOf()/e.valueOf())))*e.valueOf())}toString(){const e=this.truncate(g.DAY),r=this.truncate(g.HOUR),n=this.truncate(g.MINUTE),s=this.truncate(g.SECOND),i=this.truncate(g.MILLISECOND),o=this.truncate(g.MICROSECOND),c=this.truncate(g.NANOSECOND),h=e,l=r.sub(e),d=n.sub(r),w=s.sub(n),p=i.sub(s),j=o.sub(i),E=c.sub(o);let q="";return h.isZero||(q+=`${h.days}d `),l.isZero||(q+=`${l.hours}h `),d.isZero||(q+=`${d.minutes}m `),w.isZero||(q+=`${w.seconds}s `),p.isZero||(q+=`${p.milliseconds}ms `),j.isZero||(q+=`${j.microseconds}µs `),E.isZero||(q+=`${E.nanoseconds}ns`),q.trim()}mult(e){return new g(B(this.valueOf(),e))}div(e){return new g(Oe(this.valueOf(),e))}get days(){return Number(this.valueOf())/Number(g.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(g.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(g.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(g.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(g.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(g.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===0n}equals(e){return this.valueOf()===new g(e).valueOf()}add(e){return new g(this.valueOf()+new g(e).valueOf())}sub(e){return new g(this.valueOf()-new g(e).valueOf())}static nanoseconds(e=1){return new g(e)}static NANOSECOND=g.nanoseconds(1);static microseconds(e=1){return g.nanoseconds(B(e,1e3))}static MICROSECOND=g.microseconds(1);static milliseconds(e=1){return g.microseconds(B(e,1e3))}static MILLISECOND=g.milliseconds(1);static seconds(e=1){return g.milliseconds(B(e,1e3))}static SECOND=g.seconds(1);static minutes(e=1){return g.seconds(B(e,60))}static MINUTE=g.minutes(1);static hours(e){return g.minutes(B(e,60))}static HOUR=g.hours(1);static days(e){return g.hours(B(e,24))}static DAY=g.days(1);static MAX=new g((1n<<63n)-1n);static MIN=new g(0);static ZERO=new g(0);static z=a.z.union([a.z.object({value:a.z.bigint()}).transform(e=>new g(e.value)),a.z.string().transform(e=>new g(BigInt(e))),a.z.number().transform(e=>new g(e)),a.z.bigint().transform(e=>new g(e)),a.z.instanceof(g),a.z.instanceof(y).transform(e=>new g(e)),a.z.custom(e=>e instanceof I).transform(e=>new g(e))])};class I extends _{constructor(e){M(e)&&(e=e.value),super(e.valueOf())}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new I(e).valueOf()}get period(){return O.seconds(1/this.valueOf())}sampleCount(e){return new O(e).seconds*this.valueOf()}byteCount(e,r){return this.sampleCount(e)*new N(r).valueOf()}span(e){return O.seconds(e/this.valueOf())}byteSpan(e,r){return this.span(e.valueOf()/new N(r).valueOf())}add(e){return new I(ie(this.valueOf(),new I(e).valueOf()))}sub(e){return new I(P(this.valueOf(),new I(e).valueOf()))}mult(e){return new I(B(this.valueOf(),e))}div(e){return new I(Oe(this.valueOf(),e))}static hz(e){return new I(e)}static khz(e){return I.hz(e*1e3)}static z=a.z.union([a.z.number().transform(e=>new I(e)),a.z.instanceof(I)])}let N=class z extends _{constructor(e){M(e)&&(e=e.value),super(e.valueOf())}length(e){return e.valueOf()/this.valueOf()}size(e){return new ye(e*this.valueOf())}add(e){return new z(ie(this.valueOf(),new z(e).valueOf()))}sub(e){return new z(P(this.valueOf(),new z(e).valueOf()))}mult(e){return new z(B(this.valueOf(),e))}div(e){return new z(Oe(this.valueOf(),e))}static UNKNOWN=new z(0);static BIT128=new z(16);static BIT64=new z(8);static BIT32=new z(4);static BIT16=new z(2);static BIT8=new z(1);static z=a.z.union([a.z.number().transform(e=>new z(e)),a.z.instanceof(z)])},F=class A{start;end;constructor(e,r){typeof e=="object"&&"start"in e?(this.start=new y(e.start),this.end=new y(e.end)):(this.start=new y(e),this.end=new y(r))}get span(){return new O(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new A(this.end,this.start)}get numericBounds(){return{lower:Number(this.start.valueOf()),upper:Number(this.end.valueOf())}}equals(e,r=O.ZERO){if(r.isZero)return this.start.equals(e.start)&&this.end.equals(e.end);let n=this.start.sub(e.start).valueOf(),s=this.end.sub(e.end).valueOf();return n<0&&(n=-n),s<0&&(s=-s),n<=r.valueOf()&&s<=r.valueOf()}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e,r=O.ZERO){e=e.makeValid();const n=this.makeValid();if(this.equals(e))return!0;if(e.end.equals(n.start)||n.end.equals(e.start))return!1;const s=y.max(n.start,e.start),i=y.min(n.end,e.end);return i.before(s)?!1:new O(i.sub(s)).greaterThanOrEqual(r)}contains(e){return e instanceof A?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const r=new A(this.start,this.end);return e.start.after(this.start)&&(r.start=e.start),e.start.after(this.end)&&(r.end=e.start),e.end.before(this.end)&&(r.end=e.end),e.end.before(this.start)&&(r.start=e.end),r}static max(...e){return new A(y.min(...e.map(r=>r.start)),y.max(...e.map(r=>r.end)))}static MAX=new A(y.MIN,y.MAX);static MIN=new A(y.MAX,y.MIN);static ZERO=new A(y.ZERO,y.ZERO);static z=a.z.union([a.z.object({start:y.z,end:y.z}).transform(e=>new A(e.start,e.end)),a.z.instanceof(A)]);static sort(e,r){return y.sort(e.start,r.start)||y.sort(e.end,r.end)}static simplify(e){return e.map(r=>r.makeValid()).sort((r,n)=>A.sort(r,n)).reduce((r,n)=>{if(n.isZero)return r;if(r.length===0)return r.push(n),r;const s=r[r.length-1];return s.overlapsWith(n)||s.end.equals(n.start)?s.end=y.max(s.end,n.end):r.push(n),r},[])}},x=class u extends _{constructor(e){if(M(e)&&(e=e.value),e instanceof u||typeof e=="string"||typeof e.valueOf()=="string")super(e.valueOf());else{const r=u.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(r==null)throw new Error(`unable to find data type for ${e.toString()}`);super(r.valueOf())}}get Array(){const e=u.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}matches(...e){return e.some(r=>this.equals(r))}toString(){return this.valueOf()}get isVariable(){return this.equals(u.JSON)||this.equals(u.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(u.UUID)}get isInteger(){const e=this.toString();return e.startsWith("int")||e.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const e=u.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}get isUnsignedInteger(){return this.equals(u.UINT8)||this.equals(u.UINT16)||this.equals(u.UINT32)||this.equals(u.UINT64)}get isSignedInteger(){return this.equals(u.INT8)||this.equals(u.INT16)||this.equals(u.INT32)||this.equals(u.INT64)}canSafelyCastTo(e){return this.equals(e)?!0:!this.isNumeric||!e.isNumeric||this.isVariable||e.isVariable||this.isUnsignedInteger&&e.isSignedInteger?!1:this.isFloat?e.isFloat&&this.density.valueOf()<=e.density.valueOf():this.equals(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}canCastTo(e){return this.isNumeric&&e.isNumeric?!0:this.equals(e)}checkArray(e){return e.constructor===this.Array}get usesBigInt(){return u.BIG_INT_TYPES.some(e=>e.equals(this))}static UNKNOWN=new u("unknown");static FLOAT64=new u("float64");static FLOAT32=new u("float32");static INT64=new u("int64");static INT32=new u("int32");static INT16=new u("int16");static INT8=new u("int8");static UINT64=new u("uint64");static UINT32=new u("uint32");static UINT16=new u("uint16");static UINT8=new u("uint8");static BOOLEAN=this.UINT8;static TIMESTAMP=new u("timestamp");static UUID=new u("uuid");static STRING=new u("string");static JSON=new u("json");static ARRAY_CONSTRUCTORS=new Map([[u.UINT8.toString(),Uint8Array],[u.UINT16.toString(),Uint16Array],[u.UINT32.toString(),Uint32Array],[u.UINT64.toString(),BigUint64Array],[u.FLOAT32.toString(),Float32Array],[u.FLOAT64.toString(),Float64Array],[u.INT8.toString(),Int8Array],[u.INT16.toString(),Int16Array],[u.INT32.toString(),Int32Array],[u.INT64.toString(),BigInt64Array],[u.TIMESTAMP.toString(),BigInt64Array],[u.STRING.toString(),Uint8Array],[u.JSON.toString(),Uint8Array],[u.UUID.toString(),Uint8Array]]);static ARRAY_CONSTRUCTOR_DATA_TYPES=new Map([[Uint8Array.name,u.UINT8],[Uint16Array.name,u.UINT16],[Uint32Array.name,u.UINT32],[BigUint64Array.name,u.UINT64],[Float32Array.name,u.FLOAT32],[Float64Array.name,u.FLOAT64],[Int8Array.name,u.INT8],[Int16Array.name,u.INT16],[Int32Array.name,u.INT32],[BigInt64Array.name,u.INT64]]);static DENSITIES=new Map([[u.UINT8.toString(),N.BIT8],[u.UINT16.toString(),N.BIT16],[u.UINT32.toString(),N.BIT32],[u.UINT64.toString(),N.BIT64],[u.FLOAT32.toString(),N.BIT32],[u.FLOAT64.toString(),N.BIT64],[u.INT8.toString(),N.BIT8],[u.INT16.toString(),N.BIT16],[u.INT32.toString(),N.BIT32],[u.INT64.toString(),N.BIT64],[u.TIMESTAMP.toString(),N.BIT64],[u.STRING.toString(),N.UNKNOWN],[u.JSON.toString(),N.UNKNOWN],[u.UUID.toString(),N.BIT128]]);static ALL=[u.UNKNOWN,u.FLOAT64,u.FLOAT32,u.INT64,u.INT32,u.INT16,u.INT8,u.UINT64,u.UINT32,u.UINT16,u.UINT8,u.TIMESTAMP,u.UUID,u.STRING,u.JSON];static BIG_INT_TYPES=[u.INT64,u.UINT64,u.TIMESTAMP];static z=a.z.union([a.z.string().transform(e=>new u(e)),a.z.instanceof(u)])},ye=class m extends _{constructor(e){M(e)&&(e=e.value),super(e.valueOf())}largerThan(e){return M(e)&&(e=e.value),this.valueOf()>e.valueOf()}smallerThan(e){return M(e)&&(e=e.value),this.valueOf()<e.valueOf()}add(e){return M(e)&&(e=e.value),new m(ie(this.valueOf(),e.valueOf()))}sub(e){return M(e)&&(e=e.value),new m(P(this.valueOf(),e.valueOf()))}mult(e){return new m(B(this.valueOf(),e))}div(e){return new m(Oe(this.valueOf(),e))}truncate(e){return new m(Math.trunc(this.valueOf()/new m(e).valueOf())*new m(e).valueOf())}remainder(e){return m.bytes(this.valueOf()%new m(e).valueOf())}get gigabytes(){return this.valueOf()/m.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/m.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/m.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/m.TERABYTE.valueOf()}toString(){const e=this.truncate(m.TERABYTE),r=this.truncate(m.GIGABYTE),n=this.truncate(m.MEGABYTE),s=this.truncate(m.KILOBYTE),i=this.truncate(m.BYTE),o=e,c=r.sub(e),h=n.sub(r),l=s.sub(n),d=i.sub(s);let w="";return o.isZero||(w+=`${o.terabytes}TB `),c.isZero||(w+=`${c.gigabytes}GB `),h.isZero||(w+=`${h.megabytes}MB `),l.isZero||(w+=`${l.kilobytes}KB `),(!d.isZero||w==="")&&(w+=`${d.valueOf()}B`),w.trim()}static bytes(e=1){return new m(e)}static BYTE=new m(1);static kilobytes(e=1){return m.bytes(new m(e).valueOf()*1e3)}static KILOBYTE=m.kilobytes(1);static megabytes(e=1){return m.kilobytes(new m(e).valueOf()*1e3)}static MEGABYTE=m.megabytes(1);static gigabytes(e=1){return m.megabytes(new m(e).valueOf()*1e3)}static GIGABYTE=m.gigabytes(1);static terabytes(e){return m.gigabytes(new m(e).valueOf()*1e3)}static TERABYTE=m.terabytes(1);static ZERO=new m(0);static z=a.z.union([a.z.number().transform(e=>new m(e)),a.z.instanceof(m)]);get isZero(){return this.valueOf()===0}};const Gi=a.z.union([a.z.instanceof(Uint8Array),a.z.instanceof(Uint16Array),a.z.instanceof(Uint32Array),a.z.instanceof(BigUint64Array),a.z.instanceof(Float32Array),a.z.instanceof(Float64Array),a.z.instanceof(Int8Array),a.z.instanceof(Int16Array),a.z.instanceof(Int32Array),a.z.instanceof(BigInt64Array)]),Rr=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"||t instanceof y||t instanceof O||t instanceof Date},Hi=(t,e,r,n=0)=>t.usesBigInt&&!e.usesBigInt?Number(r)-Number(n):!t.usesBigInt&&e.usesBigInt?BigInt(r.valueOf())-BigInt(n.valueOf()):Ue(r,-n),Ue=(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),Ji=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function Xi(t){return typeof t=="string"&&Ji.test(t)}const S=[];for(let t=0;t<256;++t)S.push((t+256).toString(16).slice(1));function Ki(t,e=0){return(S[t[e+0]]+S[t[e+1]]+S[t[e+2]]+S[t[e+3]]+"-"+S[t[e+4]]+S[t[e+5]]+"-"+S[t[e+6]]+S[t[e+7]]+"-"+S[t[e+8]]+S[t[e+9]]+"-"+S[t[e+10]]+S[t[e+11]]+S[t[e+12]]+S[t[e+13]]+S[t[e+14]]+S[t[e+15]]).toLowerCase()}function Qi(t,e=0){const r=Ki(t,e);if(!Xi(r))throw TypeError("Stringified UUID is invalid");return r}typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Lr=(t,e)=>Qi(t,e),Z=-1,gt={[Symbol.iterator]:()=>gt,next:()=>({done:!0,value:void 0})},_i=a.z.string().transform(t=>new Uint8Array(atob(t).split("").map(e=>e.charCodeAt(0))).buffer),ea=a.z.union([a.z.null(),a.z.undefined()]).transform(()=>new Uint8Array().buffer),pt=10,Dr=(t,e)=>{if(t==="number"&&!e.isNumeric)throw new Error(`cannot convert series of type ${e.toString()} to number`);if(t==="bigint"&&!e.usesBigInt)throw new Error(`cannot convert series of type ${e.toString()} to bigint`)},Pr="sy_x_telem_series";let kt=class Y{key;discriminator=Pr;dataType;sampleOffset;gl;_data;timeRange=F.ZERO;alignment=0n;alignmentMultiple=1n;cachedMin;cachedMax;writePos=Z;_refCount=0;cachedLength;_cachedIndexes;static crudeZ=a.z.object({timeRange:F.z.optional(),dataType:x.z,alignment:a.z.coerce.bigint().optional(),data:a.z.union([_i,ea,a.z.instanceof(ArrayBuffer),a.z.instanceof(Uint8Array)]),glBufferUsage:Wi.optional().default("static").optional()});static z=Y.crudeZ.transform(e=>new Y(e));constructor(e){ta(e)&&(e={data:e}),e.data??=[];const{dataType:r,timeRange:n,sampleOffset:s=0,glBufferUsage:i="static",alignment:o=0n,alignmentMultiple:c=1n,key:h=Pt(),data:l}=e;if(kr(l)){const p=l;this.key=p.key,this.dataType=p.dataType,this.sampleOffset=p.sampleOffset,this.gl=p.gl,this._data=p._data,this.timeRange=p.timeRange,this.alignment=p.alignment,this.alignmentMultiple=p.alignmentMultiple,this.cachedMin=p.cachedMin,this.cachedMax=p.cachedMax,this.writePos=p.writePos,this._refCount=p._refCount,this.cachedLength=p.cachedLength;return}const d=Rr(l),w=Array.isArray(l);if(r!=null)this.dataType=new x(r);else{if(l instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(w||d){let p=l;if(!d){if(l.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");p=l[0]}if(typeof p=="string")this.dataType=x.STRING;else if(typeof p=="number")this.dataType=x.FLOAT64;else if(typeof p=="bigint")this.dataType=x.INT64;else if(typeof p=="boolean")this.dataType=x.BOOLEAN;else if(p instanceof y||p instanceof Date||p instanceof y)this.dataType=x.TIMESTAMP;else if(typeof p=="object")this.dataType=x.JSON;else throw new Error(`cannot infer data type of ${typeof p} when constructing a Series from a JS array`)}else this.dataType=new x(l)}if(!w&&!d)this._data=l;else if(w&&l.length===0)this._data=new this.dataType.Array([]).buffer;else{let p=d?[l]:l;const j=p[0];(j instanceof y||j instanceof Date||j instanceof O)&&(p=p.map(E=>new y(E).valueOf())),this.dataType.equals(x.STRING)?(this.cachedLength=p.length,this._data=new TextEncoder().encode(`${p.join(`
2
+ `)}
3
+ `).buffer):this.dataType.equals(x.JSON)?(this.cachedLength=p.length,this._data=new TextEncoder().encode(`${p.map(E=>nt.encodeString(E)).join(`
4
+ `)}
5
+ `).buffer):this.dataType.usesBigInt&&typeof j=="number"?this._data=new this.dataType.Array(p.map(E=>BigInt(Math.round(E)))).buffer:!this.dataType.usesBigInt&&typeof j=="bigint"?this._data=new this.dataType.Array(p.map(Number)).buffer:this._data=new this.dataType.Array(p).buffer}this.key=h,this.alignment=o,this.alignmentMultiple=c,this.sampleOffset=s??0,this.timeRange=n??F.ZERO,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:i}}static alloc({capacity:e,dataType:r,...n}){if(e===0)throw new Error("[Series] - cannot allocate an array of length 0");const s=new new x(r).Array(e),i=new Y({data:s.buffer,dataType:r,...n});return i.writePos=0,i}get refCount(){return this._refCount}acquire(e){this._refCount++,e!=null&&this.updateGLBuffer(e)}release(){this._refCount--,this.refCount===0&&this.gl.control!=null?this.maybeGarbageCollectGLBuffer(this.gl.control):this.refCount<0&&console.warn("cannot release a series with a negative reference count")}write(e){if(!e.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(e):this.writeFixed(e)}writeVariable(e){if(this.writePos===Z)return 0;const r=this.byteCapacity.valueOf()-this.writePos,n=e.subBytes(0,r);return this.writeToUnderlyingData(n),this.writePos+=n.byteLength.valueOf(),this.cachedLength!=null&&(this.cachedLength+=n.length,this.calculateCachedLength()),n.length}writeFixed(e){if(this.writePos===Z)return 0;const r=this.capacity-this.writePos,n=e.sub(0,r);return this.writeToUnderlyingData(n),this.cachedLength=void 0,this.maybeRecomputeMinMax(n),this.writePos+=n.length,n.length}writeToUnderlyingData(e){this.underlyingData.set(e.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===Z?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){return this.dataType.isVariable?new TextDecoder().decode(this.underlyingData).split(`
6
+ `).slice(0,-1):Array.from(this).map(e=>e.toString())}parseJSON(e){if(!this.dataType.equals(x.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.toStrings().map(r=>e.parse(nt.decodeString(r)))}get byteCapacity(){return new ye(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===Z?this.byteCapacity:this.dataType.isVariable?new ye(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this.cachedLength!=null?this.cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===Z?this.byteCapacity.valueOf()/this.dataType.density.valueOf():this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let e=0;const r=[0];return this.data.forEach((n,s)=>{n===pt&&(e++,r.push(s+1))}),this._cachedIndexes=r,this.cachedLength=e,e}convert(e,r=0){if(this.dataType.equals(e))return this;const n=new e.Array(this.length);for(let s=0;s<this.length;s++)n[s]=Hi(this.dataType,e,this.data[s],r);return new Y({data:n.buffer,dataType:e,timeRange:this.timeRange,sampleOffset:r,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(x.TIMESTAMP))this.cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMax=e.reduce((r,n)=>r>n?r:n)}else{const e=this.data;this.cachedMax=e.reduce((r,n)=>r>n?r:n)}return this.cachedMax}get max(){return this.calcMax()}calcMax(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this.cachedMax??=this.calcRawMax(),Ue(this.cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(x.TIMESTAMP))this.cachedMin=this.data[0];else if(this.dataType.usesBigInt){const e=this.data;this.cachedMin=e.reduce((r,n)=>r<n?r:n)}else{const e=this.data;this.cachedMin=e.reduce((r,n)=>r<n?r:n)}return this.cachedMin}get min(){return this.calcMin()}calcMin(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this.cachedMin??=this.calcRawMin(),Ue(this.cachedMin,this.sampleOffset))}get bounds(){return b(Number(this.min),Number(this.max),{makeValid:!1})}maybeRecomputeMinMax(e){if(this.cachedMin!=null){const r=e.cachedMin??e.calcRawMin();r<this.cachedMin&&(this.cachedMin=r)}if(this.cachedMax!=null){const r=e.cachedMax??e.calcRawMax();r>this.cachedMax&&(this.cachedMax=r)}}atAlignment(e,r){const n=Number((e-this.alignment)/this.alignmentMultiple);if(n<0||n>=this.length){if(r===!0)throw new Error(`[series] - no value at index ${n}`);return}return this.at(n,r)}at(e,r=!1){if(this.dataType.isVariable)return this.atVariable(e,r??!1);if(this.dataType.equals(x.UUID))return this.atUUID(e,r);e<0&&(e=this.length+e);const n=this.data[e];if(n==null){if(r===!0)throw new Error(`[series] - no value at index ${e}`);return}return Ue(n,this.sampleOffset)}atUUID(e,r){e<0&&(e=this.length+e);const n=Lr(new Uint8Array(this.buffer,e*this.dataType.density.valueOf()));if(n==null){if(r)throw new Error(`[series] - no value at index ${e}`);return}return n}atVariable(e,r){let n=0,s=0;if(this._cachedIndexes!=null)n=this._cachedIndexes[e],s=this._cachedIndexes[e+1]-1;else{e<0&&(e=this.length+e);for(let o=0;o<this.data.length;o++)if(this.data[o]===pt){if(e===0){s=o;break}n=o+1,e--}if(s===0&&(s=this.data.length),n>=s||e>0){if(r)throw new Error(`[series] - no value at index ${e}`);return}}const i=this.data.slice(n,s);return this.dataType.equals(x.STRING)?new TextDecoder().decode(i):wt(JSON.parse(new TextDecoder().decode(i)))}binarySearch(e){let r=0,n=this.length-1;const s=ke(e);for(;r<=n;){const i=Math.floor((r+n)/2),o=s(this.at(i,!0),e);if(o===0)return i;o<0?r=i+1:n=i-1}return r}updateGLBuffer(e){if(this.gl.control=e,!this.dataType.equals(x.FLOAT32)&&!this.dataType.equals(x.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:r,bufferUsage:n,prevBuffer:s}=this.gl;if(r==null&&(this.gl.buffer=e.createBuffer()),this.writePos!==s)if(e.bindBuffer(e.ARRAY_BUFFER,this.gl.buffer),this.writePos!==Z){s===0&&e.bufferData(e.ARRAY_BUFFER,this.byteCapacity.valueOf(),e.STATIC_DRAW);const i=this.dataType.density.size(s).valueOf(),o=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);e.bufferSubData(e.ARRAY_BUFFER,i,o.buffer),this.gl.prevBuffer=this.writePos}else e.bufferData(e.ARRAY_BUFFER,this.buffer,n==="static"?e.STATIC_DRAW:e.DYNAMIC_DRAW),this.gl.prevBuffer=Z}as(e){return Dr(e,this.dataType),this}get digest(){return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:Ht(this.alignmentBounds.lower),upper:Ht(this.alignmentBounds.upper),multiple:this.alignmentMultiple},timeRange:this.timeRange.toString(),length:this.length,capacity:this.capacity}}get alignmentBounds(){return b(this.alignment,this.alignment+BigInt(this.length)*this.alignmentMultiple)}maybeGarbageCollectGLBuffer(e){this.gl.buffer!=null&&(e.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const e=new ra(this);return this.dataType.equals(x.JSON)?new na(e):e}return this.dataType.equals(x.UUID)?new sa(this):new ia(this)}slice(e,r){return this.sliceSub(!1,e,r)}sub(e,r){return this.sliceSub(!0,e,r)}subIterator(e,r){return new Gt(this,e,r??this.length)}subAlignmentIterator(e,r){const n=Math.ceil(Number(e-this.alignment)/Number(this.alignmentMultiple)),s=Math.ceil(Number(r-this.alignment)/Number(this.alignmentMultiple));return new Gt(this,n,s)}subBytes(e,r){if(e>=0&&(r==null||r>=this.byteLength.valueOf()))return this;const n=this.data.subarray(e,r);return new Y({data:n,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}sliceSub(e,r,n){if(r<=0&&(n==null||n>=this.length))return this;let s;return e?s=this.data.subarray(r,n):s=this.data.slice(r,n),new Y({data:s,dataType:this.dataType,timeRange:this.timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(r)})}reAlign(e){return new Y({data:this.buffer,dataType:this.dataType,timeRange:F.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:e})}toString(){let e=`Series(${this.dataType.toString()} ${this.length} [`;if(this.length<=10)e+=Array.from(this).map(r=>r.toString());else{for(let r=0;r<5;r++)e+=`${this.at(r)?.toString()}`,e+=",";e+="...,";for(let r=-5;r<0;r++)e+=this.at(r)?.toString(),r<-1&&(e+=",")}return e+="])",e}};const ta=t=>t==null?!1:Array.isArray(t)||t instanceof ArrayBuffer||ArrayBuffer.isView(t)&&!(t instanceof DataView)||t instanceof kt?!0:Rr(t),kr=Fi(Pr,kt);class Gt{series;end;index;constructor(e,r,n){this.series=e;const s=b(0,e.length+1);this.end=ot(s,n),this.index=ot(s,r)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}}let ra=class{series;index;decoder;constructor(e){if(!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,r=this.series.data;for(;this.index<r.length&&r[this.index]!==pt;)this.index++;const n=this.index;return e===n?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,n))})}},na=class qr{wrapped;static schema=a.z.record(a.z.string(),a.z.unknown());constructor(e){this.wrapped=e}next(){const e=this.wrapped.next();return e.done===!0?{done:!0,value:void 0}:{done:!1,value:nt.decodeString(e.value,qr.schema)}}},sa=class{series;index;data;density;constructor(e){if(!e.dataType.equals(x.UUID))throw new Error("cannot create a UUID series iterator for a non-UUID series");this.series=e,this.index=0,this.data=new Uint8Array(e.buffer),this.density=x.UUID.density.valueOf()}next(){if(this.index>=this.series.length)return{done:!0,value:void 0};const e=Lr(this.data,this.index*this.density);return this.index++,{done:!1,value:e}}},ia=class{series;index;constructor(e){this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}},aa=class{series;constructor(e=[]){if(e.length!==0){const r=e[0].dataType;for(let n=1;n<e.length;n++)if(!e[n].dataType.equals(r))throw new Error("[multi-series] - series must have the same data type")}this.series=e}as(e){return Dr(e,this.dataType),this}get dataType(){return this.series.length===0?x.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?F.ZERO:new F(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?b(0n,0n):b(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(e){const r=()=>new Error(`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`),n=e.dataType.equals(this.dataType);if(kr(e)){if(this.series.length!==0&&!n)throw r();this.series.push(e)}else{if(this.series.length!==0&&e.series.length!==0&&!n)throw r();this.series.push(...e.series)}}get length(){return this.series.reduce((e,r)=>e+r.length,0)}atAlignment(e,r){for(const n of this.series)if(U(n.alignmentBounds,e))return n.atAlignment(e,r);if(r)throw new Error(`[series] - no value at alignment ${e}`)}at(e,r=!1){e<0&&(e=this.length+e);for(const n of this.series){if(e<n.length)return n.at(e,r);e-=n.length}if(r)throw new Error(`[series] - no value at index ${e}`)}subIterator(e,r){return new _e(this,e,r??this.length)}subAlignmentIterator(e,r){if(e>=this.alignmentBounds.upper||r<=this.alignmentBounds.lower)return gt;let n=0;for(let i=0;i<this.series.length;i++){const o=this.series[i];if(e<o.alignment)break;if(e>=o.alignmentBounds.upper)n+=o.length;else if(U(o.alignmentBounds,e)){n+=Math.ceil(Number(e-o.alignment)/Number(o.alignmentMultiple));break}}let s=0;for(let i=0;i<this.series.length;i++){const o=this.series[i];if(r<o.alignment)break;if(r>=o.alignmentBounds.upper)s+=o.length;else if(U(o.alignmentBounds,r)){s+=Math.ceil(Number(r-o.alignment)/Number(o.alignmentMultiple));break}}return new _e(this,n,s)}subAlignmentSpanIterator(e,r){if(e>=this.alignmentBounds.upper)return gt;r=Math.min(r,Number(this.distance(e,this.alignmentBounds.upper)));let n=0;for(let s=0;s<this.series.length;s++){const i=this.series[s];if(e<i.alignment)break;if(e>=i.alignmentBounds.upper)n+=i.length;else if(U(i.alignmentBounds,e)){n+=Number(e-i.alignment);break}}return new _e(this,n,n+r)}updateGLBuffer(e){this.series.forEach(r=>r.updateGLBuffer(e))}get bounds(){return fr(this.series.map(e=>e.bounds))}get byteLength(){return new ye(this.series.reduce((e,r)=>e+r.byteLength.valueOf(),0))}get data(){const e=new this.dataType.Array(this.length);let r=0;for(const n of this.series)e.set(n.data,r),r+=n.length;return new this.dataType.Array(e.buffer)}traverseAlignment(e,r){const n=this.series.map(s=>s.alignmentBounds);return dr(n,e,r)}acquire(e){this.series.forEach(r=>r.acquire(e))}release(){this.series.forEach(e=>e.release())}distance(e,r){const n=this.series.map(s=>s.alignmentBounds);return gr(n,e,r)}parseJSON(e){if(!this.dataType.equals(x.JSON))throw new Error("cannot parse non-JSON series as JSON");return this.series.flatMap(r=>r.parseJSON(e))}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new oa(this.series)}toStrings(){return this.series.flatMap(e=>e.toStrings())}};class oa{series;seriesIndex;internal;constructor(e){this.series=e,this.seriesIndex=0,this.internal=e[0][Symbol.iterator]()}next(){const e=this.internal.next();return e.done===!1?e:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[Symbol.iterator](){return this}}let _e=class{series;index;end;constructor(e,r,n){this.series=e,this.end=n,this.index=r}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}};const Ht=t=>{const e=t>>32n,r=t&0xffffffffn;return{domain:e,sample:r}};a.z.object({key:a.z.string(),value:a.z.string()});const ua=a.z.record(a.z.union([a.z.number(),a.z.string(),a.z.symbol()]),a.z.unknown()),qt=t=>Object.entries(t),la=(t,e)=>Object.fromEntries(qt(t).map(([r,n])=>[r,e(n,r)])),ca=t=>Object.fromEntries(qt(t).filter(([e,r])=>r!==void 0)),ha=(t,...e)=>{const r={...t};for(const n of e)delete r[n];return r},fa=Object.freeze(Object.defineProperty({__proto__:null,entries:qt,map:la,omit:ha,purgeUndefined:ca,unknownZ:ua},Symbol.toStringTag,{value:"Module"})),Zr=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",da=Zr(),Yr=["macOS","Windows","Linux"],ga=["macos","windows","linux"],pa={macos:"macOS",windows:"Windows",linux:"Linux"},ma=a.z.enum(Yr).or(a.z.enum(ga).transform(t=>pa[t])),ya=()=>{if(typeof window>"u")return;const t=window.navigator.userAgent.toLowerCase();if(t.includes("mac"))return"macOS";if(t.includes("win"))return"Windows";if(t.includes("linux"))return"Linux"};let et;const wa=(t={})=>{const{force:e,default:r}=t;return e??et??(et=ya(),et??r)},ba=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:Yr,RUNTIME:da,detect:Zr,getOS:wa,osZ:ma},Symbol.toStringTag,{value:"Module"})),Oa=(...t)=>t.map(Fr).join(""),Fr=t=>(t.endsWith("/")||(t+="/"),t.startsWith("/")&&(t=t.slice(1)),t),va=t=>t.endsWith("/")?t.slice(0,-1):t;class Ce{protocol;host;port;path;constructor({host:e,port:r,protocol:n="",pathPrefix:s=""}){this.protocol=n,this.host=e,this.port=r,this.path=Fr(s)}replace(e){return new Ce({host:e.host??this.host,port:e.port??this.port,protocol:e.protocol??this.protocol,pathPrefix:e.pathPrefix??this.path})}child(e){return new Ce({...this,pathPrefix:Oa(this.path,e)})}toString(){return va(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}static UNKNOWN=new Ce({host:"unknown",port:0})}const $a=2,xa=3,Ta=2,Sa=(t,e)=>{if(Number.isNaN(t)||!Number.isFinite(t))return t;const r=ve(e);if(r==0)return t;let n;r>=1e3?n=$a:r>=1?n=xa:n=Math.ceil(-Math.log10(r))+Ta;const s=10**n;return Math.round(t*s)/s},Na=Object.freeze(Object.defineProperty({__proto__:null,abs:cr,add:ie,closeTo:Gn,div:Oe,equal:at,isInteger:Re,max:Jn,min:lr,mult:B,roundBySpan:Sa,roundToNearestMagnitude:Hn,sub:P},Symbol.toStringTag,{value:"Module"}));a.z.object({baseInterval:O.z.optional(),maxRetries:a.z.number().optional(),scale:a.z.number().optional()});const Ia=/^#?([0-9a-f]{6}|[0-9a-f]{8})$/i,De=a.z.string().regex(Ia),re=a.z.number().min(0).max(255),Wr=a.z.number().min(0).max(1),He=a.z.tuple([re,re,re,Wr]),za=a.z.tuple([re,re,re]),Ma=a.z.object({rgba255:He}),Ea=a.z.number().min(0).max(360),Aa=a.z.number().min(0).max(100),Ba=a.z.number().min(0).max(100),Vr=a.z.tuple([Ea,Aa,Ba,Wr]),Je=a.z.union([De,za,He,Vr,Ma]),Xe=Je.transform(t=>$(t)),Ua=t=>Xe.safeParse(t).success,Ca=t=>He.safeParse(t).success,ja=t=>{if(t==null)return;const e=Xe.safeParse(t);if(e.success)return Hr(e.data);if(typeof t=="string")return t;throw e.error},$=(t,e=1)=>{if(t=Je.parse(t),typeof t=="string")return je(t,e);if(Array.isArray(t)){if(t.length<3||t.length>4)throw new Error(`Invalid color: [${t.join(", ")}]`);return t.length===3?[...t,e]:t}return t.rgba255},Gr=(t,e)=>{if(t==null||e==null)return t==e;const r=$(t),n=$(e);return r.every((s,i)=>s===n[i])},Ra=t=>{if(t==null)return;const[e,r,n,s]=$(t);return`#${Se(e)}${Se(r)}${Se(n)}${s===1?"":Se(s*255)}`},Hr=t=>{const[e,r,n,s]=$(t);return`rgba(${e}, ${r}, ${n}, ${s})`},La=t=>`rgb(${Jr(t)})`,Jr=t=>{const[e,r,n]=$(t);return`${e}, ${r}, ${n}`},Da=t=>[...Zt(t),de(t)],Zt=t=>[ce(t)/255,he(t)/255,fe(t)/255],ce=t=>$(t)[0],he=t=>$(t)[1],fe=t=>$(t)[2],de=t=>$(t)[3],Pa=t=>Gr(Yt,t),ka=t=>Ja($(t)),qa=(t,e)=>{const[r,n,s]=$(t);if(e>100)throw new Error(`Color opacity must be between 0 and 100, got ${e}`);return e>1&&(e/=100),[r,n,s,e]},we=t=>{const[e,r,n]=Zt(t).map(s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4);return Number((.2126*e+.7152*r+.0722*n).toFixed(3))},Za=t=>{const[e,r,n]=Zt(t);return 1-(Math.max(e,r,n)-Math.min(e,r,n))},mt=(t,e)=>{const r=$(t),n=$(e),s=we(r),i=we(n);return(Math.max(s,i)+.5)/(Math.min(s,i)+.5)},Ya=(t,...e)=>{if(e.length===0)throw new Error("[Color.pickByContrast] - must provide at least one color");const r=$(t),[n]=e.sort((s,i)=>mt(r,i)-mt(r,s));return $(n)},Fa=t=>we(t)<.5,Wa=t=>we(t)>.5,je=(t,e=1)=>(t=De.parse(t),t=Va(t),[Ne(t,0),Ne(t,2),Ne(t,4),t.length===8?Ne(t,6)/255:e]),Yt=[0,0,0,0],Se=t=>Math.floor(t).toString(16).padStart(2,"0"),Ne=(t,e)=>parseInt(t.slice(e,e+2),16),Va=t=>t.startsWith("#")?t.slice(1):t,Jt={black:"#000000",white:"#ffffff",red:"#ff0000",green:"#008000",blue:"#0000ff",yellow:"#ffff00",cyan:"#00ffff",magenta:"#ff00ff",silver:"#c0c0c0",gray:"#808080",grey:"#808080",maroon:"#800000",olive:"#808000",lime:"#00ff00",aqua:"#00ffff",teal:"#008080",navy:"#000080",fuchsia:"#ff00ff",purple:"#800080",orange:"#ffa500",brown:"#a52a2a",tan:"#d2b48c",gold:"#ffd700",indigo:"#4b0082",violet:"#ee82ee",pink:"#ffc0cb",coral:"#ff7f50",salmon:"#fa8072",khaki:"#f0e68c",crimson:"#dc143c",transparent:"transparent"},Ga=t=>{if(!t)return;const e=t.trim().toLowerCase();if(!(e==="transparent"||e==="none")){if(e.startsWith("#")){if(e.length===4){const r=e[1],n=e[2],s=e[3],i=`#${r}${r}${n}${n}${s}${s}`;if(De.safeParse(i).success)return je(i)}return(e.length===7||e.length===9)&&De.safeParse(e).success?je(e):void 0}if(e.startsWith("rgb")){const r=e.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);if(r){const[,n,s,i,o]=r;return[parseInt(n),parseInt(s),parseInt(i),o?parseFloat(o):1]}}if(Jt[e])return je(Jt[e])}},Ha=t=>{t=Vr.parse(t);let[e,r,n]=t;const s=t[3];e/=360,r/=100,n/=100;let i,o,c;if(r===0)i=o=c=n;else{const h=n<.5?n*(1+r):n+r-n*r,l=2*n-h;i=tt(l,h,e+1/3),o=tt(l,h,e),c=tt(l,h,e-1/3)}return[Math.round(i*255),Math.round(o*255),Math.round(c*255),s]},tt=(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),Ja=t=>{t=He.parse(t);let[e,r,n]=t;const s=t[3];e/=255,r/=255,n/=255;const i=Math.max(e,r,n),o=Math.min(e,r,n);let c,h,l=(i+o)/2;if(i===o)c=h=0;else{const d=i-o;h=l>.5?d/(2-i-o):d/(i+o),i===e?c=(r-n)/d+(r<n?6:0):i===r?c=(n-e)/d+2:c=(e-r)/d+4,c/=6}return c*=360,h*=100,l*=100,[Math.round(c),Math.round(h),Math.round(l),s]},Xa=$("#000000"),Ka=$("#ffffff"),Xr=a.z.object({key:a.z.string(),color:Je,position:a.z.number(),switched:a.z.boolean().optional()}),Qa=a.z.array(Xr),_a=(t,e)=>{if(t.length===0)return Yt;if(t=t.slice().sort((r,n)=>r.position-n.position),e<=t[0].position)return $(t[0].color);if(e>=t[t.length-1].position)return $(t[t.length-1].color);for(let r=0;r<t.length-1;r++){const n=t[r],s=t[r+1];if(e<n.position||e>s.position)continue;if(e===n.position)return $(n.color);if(e===s.position)return $(s.color);const i=(e-n.position)/(s.position-n.position),o=$(n.color),c=$(s.color),h=Math.round(ce(o)+i*(ce(c)-ce(o))),l=Math.round(he(o)+i*(he(c)-he(o))),d=Math.round(fe(o)+i*(fe(c)-fe(o))),w=de(o)+i*(de(c)-de(o));return $([h,l,d,w])}return $(t[t.length-1].color)},eo=a.z.object({key:a.z.string(),name:a.z.string(),color:Xe}),to=a.z.object({key:a.z.string(),name:a.z.string(),swatches:a.z.array(eo)}),Kr=Object.freeze(Object.defineProperty({__proto__:null,BLACK:Xa,WHITE:Ka,ZERO:Yt,aValue:de,bValue:fe,colorZ:Xe,construct:$,contrast:mt,crudeZ:Je,cssString:ja,equals:Gr,fromCSS:Ga,fromGradient:_a,fromHSLA:Ha,gValue:he,gradientZ:Qa,grayness:Za,hex:Ra,hsla:ka,isColor:Ca,isCrude:Ua,isDark:Fa,isLight:Wa,isZero:Pa,luminance:we,paletteZ:to,pickByContrast:Ya,rValue:ce,rgbCSS:La,rgbString:Jr,rgba1:Da,rgbaCSS:Hr,setAlpha:qa,stopZ:Xr},Symbol.toStringTag,{value:"Module"})),Qr=a.z.int().min(0).max(255),_r=255,en=0,ro={lower:en,upper:_r+1},tn=a.z.object({name:a.z.string(),key:a.z.string()}),be=t=>a.z.object({subject:tn,resource:t,authority:Qr}),no=(...t)=>e=>e.filter(r=>{let n=!1;return r.to!=null&&(n=t.includes(r.to.resource)),r.from!=null&&!n&&(n=t.includes(r.from.resource)),n}),rn=t=>a.z.object({from:be(t),to:a.z.null()}),nn=t=>a.z.object({from:a.z.null(),to:be(t)}),so=t=>a.z.union([rn(t),nn(t),a.z.object({from:be(t),to:be(t)})]),io=Object.freeze(Object.defineProperty({__proto__:null,ABSOLUTE_AUTHORITY:_r,AUTHORITY_BOUNDS:ro,ZERO_AUTHORITY:en,acquireZ:nn,authorityZ:Qr,filterTransfersByChannelKey:no,releaseZ:rn,stateZ:be,subjectZ:tn,transferZ:so},Symbol.toStringTag,{value:"Module"})),ao=t=>Object.getOwnPropertySymbols(globalThis).includes(t),oo=(t,e)=>{const r=Symbol.for(t);if(!ao(r)){const n=e();Object.defineProperty(globalThis,r,{value:n})}return()=>globalThis[r]},sn="sy_x_error",uo=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),an=t=>class le extends Error{static discriminator=sn;discriminator=le.discriminator;static TYPE=t;type=le.TYPE;static matches=uo(t);matches=le.matches;constructor(r,n){super(r,n),this.name=le.TYPE}static sub(r){return an(`${t}.${r}`)}},lo=t=>{if(t==null||typeof t!="object")return!1;const e=t;if(e.discriminator!==sn)return!1;if(!("type"in e))throw new Error(`X Error is missing its type property: ${JSON.stringify(e)}`);return!0},ae="unknown",Xt="nil";class co{providers=[];register(e){this.providers.push(e)}encode(e){if(e==null)return{type:Xt,data:""};if(lo(e))for(const r of this.providers){const n=r.encode(e);if(n!=null)return n}if(e instanceof Error)return{type:ae,data:e.message};if(typeof e=="string")return{type:ae,data:e};try{return{type:ae,data:JSON.stringify(e)}}catch{return{type:ae,data:"unable to encode error information"}}}decode(e){if(e==null||e.type===Xt)return null;if(e.type===ae)return new Kt(e.data);for(const r of this.providers){const n=r.decode(e);if(n!=null)return n}return new Kt(e.data)}}oo("synnax-error-registry",()=>new co);class Kt extends an("unknown"){}a.z.object({type:a.z.string(),data:a.z.string()});const ho=()=>new Promise(t=>setTimeout(t,0)),fo=a.object({jsonrpc:a.literal("2.0"),method:a.string(),params:a.any().optional(),id:a.union([a.string(),a.number(),a.null()]).optional()}),on=a.object({jsonrpc:a.literal("2.0"),id:a.union([a.string(),a.number(),a.null()])}),go=on.extend({result:a.json()}),po=on.extend({error:a.object({code:a.number().int(),message:a.string().optional(),data:a.json().optional()})}),mo=a.union([go,po]);a.union([fo,mo]);const yo=(t,e,r)=>{const n=t.get(e);return n===void 0?(t.set(e,r),r):n},wo=Object.freeze(Object.defineProperty({__proto__:null,getOrSetDefault:yo},Symbol.toStringTag,{value:"Module"})),yt=a.z.string().regex(/^\d+\.\d+\.\d+$/),xe=(t,e,r={})=>{r.checkMajor??=!0,r.checkMinor??=!0,r.checkPatch??=!0;const n=yt.parse(t),s=yt.parse(e),[i,o,c]=n.split(".").map(Number),[h,l,d]=s.split(".").map(Number);if(r.checkMajor){if(i<h)return ze;if(i>h)return Me}if(r.checkMinor){if(o<l)return ze;if(o>l)return Me}if(r.checkPatch){if(c<d)return ze;if(c>d)return Me}return ne},bo=(t,e,r={})=>ar(xe(t,e,r)),un=(t,e,r={})=>ir(xe(t,e,r)),Oo=(t,e,r={})=>sr(xe(t,e,r)),vo=({name:t,migrate:e})=>r=>{try{const n=e(r);return console.log(`${t} migrated: ${r.version} -> ${n.version}`),n}catch(n){throw console.log(`${t} failed to migrate from ${r.version}`),console.error(n),n}},$o=({name:t,migrations:e,targetSchema:r,defaultVersion:n,def:s})=>{const i=Object.keys(e).sort(xe).pop();if(i==null)return l=>{if(l.version??=n,l.version!==s.version)return console.log(`${t} version ${l.version} is newer than latest version of ${s.version}.
7
+ Returning default instead.
8
+ `),s;try{return r!=null?r.parse(l):l}catch(d){return console.log(`${t} failed to parse default. Exiting with default`),console.error(d),s}};const o=Object.keys(e).length;let c=!1;const h=l=>{try{if(o===0||un(l.version,i))return console.log(c?`${t} ${l.version} now up to date`:`${t} version ${l.version} is up to date with target version ${s.version}`),l;const d=l.version,w=e[d],p=w(l);return c=!0,h(p)}catch(d){return console.log(`${t} failed to migrate from ${l.version} to ${i}`),console.error(d),s}};return l=>{try{if(l.version==null)if(n!=null)console.log(`${t} version is null. Setting version to default of ${n}`),l.version=n;else return console.log(`${t} version is null and no default version set. Exiting with default`),s;return h(l)}catch(d){return console.log(`${t} failed to parse final result. Exiting with default`),console.error(d),s}}},xo=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:xe,createMigration:vo,migrator:$o,semVerNewer:un,semVerOlder:Oo,semVerZ:yt,versionsEqual:bo},Symbol.toStringTag,{value:"Module"})),ln=["standard","scientific","engineering"],To=a.z.enum(ln),So=(t,e,r)=>{if(Number.isNaN(t))return"NaN";if(t===1/0)return"∞";if(t===-1/0)return"-∞";if(r==="standard")return t.toFixed(e);if(t===0)return e===0?"0ᴇ0":`0.${"0".repeat(e)}ᴇ0`;let n;return r==="scientific"?n=Math.floor(Math.log10(Math.abs(t))):n=Math.floor(Math.log10(Math.abs(t))/3)*3,`${(t/10**n).toFixed(e)}ᴇ${n}`},No=Object.freeze(Object.defineProperty({__proto__:null,NOTATIONS:ln,notationZ:To,stringifyNumber:So},Symbol.toStringTag,{value:"Module"})),Io=t=>Array.isArray(t)?[...t]:typeof t=="object"&&t!==null?{...t}:t,cn=a.z.enum(["success","info","warning","error","loading","disabled"]),zo=t=>a.z.object({key:a.z.string(),variant:cn,message:a.z.string(),description:a.z.string().optional(),time:y.z,details:t??a.z.unknown().optional()}),Mo=(t,e)=>{if(!(t instanceof Error))throw t;return hn({variant:"error",message:e??t.message,description:e!=null?t.message:void 0,details:{stack:t.stack??""}})},hn=t=>({key:Pt(),time:y.now(),...t}),Eo=(t,e=[])=>{if(t!=null)return Array.isArray(e)?e.includes(t)?t:void 0:e===t?t:void 0},Ao=(t,e=[])=>{if(t!=null)return Array.isArray(e)?e.includes(t)?void 0:t:e===t?void 0:t},Bo=Object.freeze(Object.defineProperty({__proto__:null,create:hn,fromException:Mo,keepVariants:Eo,removeVariants:Ao,statusZ:zo,variantZ:cn},Symbol.toStringTag,{value:"Module"})),Uo=(t,e="")=>{if(typeof t=="string")return t;const r=t.length;return r===0?e:r===1?t[0]:r===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[r-1]}`},Co=t=>{const e=t.split(" "),r=new Set,n=e.map(o=>o.charAt(0).toLowerCase()).join("");r.add(n.replace(/-/g,"_")),r.add(n.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"));const s=/\d+/g;t.match(s)&&e.forEach((o,c)=>{if(s.test(o)){const h=e.map((l,d)=>d!==c?l.charAt(0).toLowerCase():l).join("");r.add(h.replace(/-/g,"_")),r.add(h.replace(/(.)(.)/g,"$1_$2").replace(/-/g,"_"))}});const i=e.map(o=>(o.length>3?o.substring(0,3):o).toLowerCase());return r.add(i.join("").replace(/-/g,"_")),r.add(i.join("_").replace(/-/g,"_")),Array.from(r).filter(o=>o.length>=2&&o.length<=12&&!/^\d/.test(o))},jo=(t,e)=>t.startsWith(e)?t.slice(e.length):t,Ro=Object.freeze(Object.defineProperty({__proto__:null,createShortIdentifiers:Co,naturalLanguageJoin:Uo,trimPrefix:jo},Symbol.toStringTag,{value:"Module"})),Lo=new Error("request for lock canceled");var Do=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function c(d){try{l(n.next(d))}catch(w){o(w)}}function h(d){try{l(n.throw(d))}catch(w){o(w)}}function l(d){d.done?i(d.value):s(d.value).then(c,h)}l((n=n.apply(t,e||[])).next())})};class Po{constructor(e,r=Lo){this._value=e,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,s)=>{const i={resolve:n,reject:s,weight:e,priority:r},o=fn(this._queue,c=>r<=c.priority);o===-1&&e<=this._value?this._dispatchItem(i):this._queue.splice(o+1,0,i)})}runExclusive(e){return Do(this,arguments,void 0,function*(r,n=1,s=0){const[i,o]=yield this.acquire(n,s);try{return yield r(i)}finally{o()}})}waitForUnlock(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,r)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),ko(this._weightedWaiters[e-1],{resolve:n,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){const r=this._value;this._value-=e.weight,e.resolve([r,this._newReleaser(e.weight)])}_newReleaser(e){let r=!1;return()=>{r||(r=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){const r=this._weightedWaiters[e-1];r&&(r.forEach(n=>n.resolve()),this._weightedWaiters[e-1]=[])}else{const e=this._queue[0].priority;for(let r=this._value;r>0;r--){const n=this._weightedWaiters[r-1];if(!n)continue;const s=n.findIndex(i=>i.priority<=e);(s===-1?n:n.splice(0,s)).forEach(i=>i.resolve())}}}_couldLockImmediately(e,r){return(this._queue.length===0||this._queue[0].priority<r)&&e<=this._value}}function ko(t,e){const r=fn(t,n=>e.priority<=n.priority);t.splice(r+1,0,e)}function fn(t,e){for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1}var qo=function(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function c(d){try{l(n.next(d))}catch(w){o(w)}}function h(d){try{l(n.throw(d))}catch(w){o(w)}}function l(d){d.done?i(d.value):s(d.value).then(c,h)}l((n=n.apply(t,e||[])).next())})};class Zo{constructor(e){this._semaphore=new Po(1,e)}acquire(){return qo(this,arguments,void 0,function*(e=0){const[,r]=yield this._semaphore.acquire(1,e);return r})}runExclusive(e,r=0){return this._semaphore.runExclusive(()=>e(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class dn extends Zo{constructor(e){super(),Object.assign(this,e)}}const Yo=t=>new dn(t),Fo=Object.freeze(Object.defineProperty({__proto__:null,mutex:dn,newMutex:Yo},Symbol.toStringTag,{value:"Module"}));function gn(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=gn(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function pn(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=gn(t))&&(n&&(n+=" "),n+=e);return n}const Wo=pn,ee="-",Qt="__",Ie="--",Ft=t=>{const e=(...r)=>Wo(...r);return e.B=(...r)=>t+ee+r.join(ee),e.E=r=>t+Qt+r,e.M=(...r)=>t+Ie+r.join("-"),e.BM=(r,...n)=>e.B(r)+Ie+n.join("-"),e.BE=(r,...n)=>e.B(r)+Qt+n.join(ee),e.BEM=(r,n,...s)=>e.BE(r,n)+Ie+s.join(ee),e.extend=r=>Ft(e.B(r)),e.var=(...r)=>Ie+t+ee+r.join(ee),e};class Vo{rows=[];columns=[];prefix;constructor(e=""){this.prefix=e}row(e,r,n){const{prefix:s}=this;return this.rows.push({startLabel:s+e,endLabel:s+r,size:n}),this}col(e,r,n){const{prefix:s}=this;return this.columns.push({startLabel:s+e,endLabel:s+r,size:n}),this}build(){return{display:"grid",gridTemplateRows:this.rows.map((e,r)=>{let n=r===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=r===this.rows.length-1?"]":"",n}).join(" "),gridTemplateColumns:this.columns.map((e,r)=>{let n=r===0?"[":"";return n+=`${e.startLabel}] ${e.size}${typeof e.size=="number"?"px":""} [${e.endLabel}`,n+=r===this.columns.length-1?"]":"",n}).join(" ")}}}const Go=(t,e)=>Object.entries(e).forEach(([r,n])=>n!=null&&t.style.setProperty(r,`${n}`)),Ho=(t,e)=>Array.from(t.style).forEach(r=>{r.startsWith(e)&&t.style.removeProperty(r)}),Jo=t=>{const e=Ft(t);return e.visible=r=>e.M(r?"visible":"hidden"),e.expanded=r=>e.M(r?"expanded":"collapsed"),e.loc=r=>e.M("location",br.construct(r)),e.disabled=r=>r===!0&&e.M("disabled"),e.align=r=>e.M(r),e.dir=r=>r!=null&&e.M("direction",mr.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=Go,e.removeVars=Ho,e.newGridBuilder=r=>new Vo(r),e.dropRegion=r=>r&&e.B("haul-drop-region"),e.px=r=>`${r}px`,e.inheritDims=(r=!0)=>r&&e.M("inherit-dims"),e.shade=r=>r!=null&&e.M(`shade-${r}`),e.colorVar=r=>{if(!(r==null||r===!1))return typeof r=="number"?`var(--${t}-gray-l${r})`:Kr.cssString(r)},e.levelSizeVar=r=>`var(--${t}-${r}-size)`,e.level=r=>e.M(`level-${r}`),e},Xo=Jo("pluto");exports.$r=Ro;exports.A=kt;exports.C=Pi;exports.CSS=Xo;exports.Gt=Yi;exports.H=ls;exports.Ho=wi;exports.Ht=Gi;exports.K=Ys;exports.K$1=br;exports.O=F;exports.O$1=Mn;exports.R=Ar;exports.S=ba;exports.Sr=Io;exports.U=Tn;exports.Wt=aa;exports._=Mi;exports._r=xo;exports.b=I;exports.c=In;exports.clsx=pn;exports.cr=Na;exports.d=N;exports.dr=io;exports.fr=Kr;exports.i=O;exports.jr=Fo;exports.k=Rn;exports.l=ye;exports.l$1=fa;exports.n=x;exports.newBEM=Ft;exports.p=mr;exports.pr=ho;exports.r=y;exports.wr=No;exports.xr=Bo;exports.yr=wo;
package/dist/css.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./css-CZ_XGkIB.cjs"),t=require("./units-Cqxg-SBx.cjs");exports.CSS=e.CSS;exports.newBEM=e.newBEM;exports.createHexOpacityVariants=t.createHexOpacityVariants;exports.unitProperty=t.unitProperty;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./css-CmXY6iPo.cjs"),t=require("./units-DkdMPsxa.cjs");exports.CSS=e.CSS;exports.newBEM=e.newBEM;exports.createHexOpacityVariants=t.createHexOpacityVariants;exports.unitProperty=t.unitProperty;
package/dist/css.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as e, n as t } from "./css-BlHGoCgb.js";
2
- import { c as s, u as n } from "./units-D8blpqyN.js";
1
+ import { C as e, n as t } from "./css-BUXMI9PB.js";
2
+ import { c as s, u as n } from "./units-BPvO622s.js";
3
3
  export {
4
4
  e as CSS,
5
5
  s as createHexOpacityVariants,
package/dist/dialog.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-CE5Gf1U4.cjs");exports.Dialog=e.external;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-BIykXq97.cjs");exports.Dialog=e.external;
package/dist/dialog.js CHANGED
@@ -1,4 +1,4 @@
1
- import { e } from "./external-Ds3Wz9sk.js";
1
+ import { e } from "./external-SQa3Pr0s.js";
2
2
  export {
3
3
  e as Dialog
4
4
  };