@synnaxlabs/pluto 0.53.2 → 0.54.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 (286) hide show
  1. package/dist/aether-BBeeeA1z.cjs +10 -0
  2. package/dist/aether-Bl3vMZO3.js +716 -0
  3. package/dist/aether-DmSenWd4.js +704 -0
  4. package/dist/aether-VeYJQDcf.cjs +11 -0
  5. package/dist/button-DBdzH6Ky.cjs +1 -0
  6. package/dist/button-KtgabnXL.js +251 -0
  7. package/dist/button.cjs +1 -1
  8. package/dist/button.js +2 -4
  9. package/dist/chunk-DeC0fbbY.js +23 -0
  10. package/dist/chunk-FeXHwk1_.cjs +1 -0
  11. package/dist/color-Cspp5cKp.js +7904 -0
  12. package/dist/color-DCCr0Z1b.cjs +29 -0
  13. package/dist/color.cjs +1 -1
  14. package/dist/color.js +2 -4
  15. package/dist/css-Ce-x3HcK.cjs +1 -0
  16. package/dist/css-UEo6g0SR.js +69 -0
  17. package/dist/css.cjs +1 -1
  18. package/dist/css.js +2 -8
  19. package/dist/dialog-BTCrp5Yv.cjs +1 -0
  20. package/dist/dialog-ClQI4sHo.js +331 -0
  21. package/dist/dialog.cjs +1 -1
  22. package/dist/dialog.js +2 -4
  23. package/dist/divider-BYRH8-5K.js +13 -0
  24. package/dist/divider-CEyntx31.cjs +1 -0
  25. package/dist/ether-CZlE80D0.cjs +53 -0
  26. package/dist/ether-KMGPzrZR.js +6222 -0
  27. package/dist/ether.cjs +1 -1
  28. package/dist/ether.js +4 -104
  29. package/dist/event-Btz3eWg1.cjs +1 -0
  30. package/dist/event-Z4V8c501.js +4 -0
  31. package/dist/flex-Bgtu0DK6.js +62 -0
  32. package/dist/flex-D_GoD3ed.cjs +1 -0
  33. package/dist/flex.cjs +1 -1
  34. package/dist/flex.js +2 -4
  35. package/dist/haul-BdMc4rLJ.js +171 -0
  36. package/dist/haul-ZdSHqhp6.cjs +1 -0
  37. package/dist/header-CNx3pAkx.js +64 -0
  38. package/dist/header-lD0sRjCR.cjs +1 -0
  39. package/dist/header.cjs +1 -1
  40. package/dist/header.js +2 -4
  41. package/dist/input-CdL1OPDU.cjs +74 -0
  42. package/dist/input-h-4axMs7.js +47772 -0
  43. package/dist/input.cjs +1 -1
  44. package/dist/input.js +2 -4
  45. package/dist/list-DacuSBB3.cjs +4 -0
  46. package/dist/list-dZDsxTzd.js +1756 -0
  47. package/dist/list.cjs +1 -1
  48. package/dist/list.js +2 -4
  49. package/dist/menu-eeXfR_zT.js +170 -0
  50. package/dist/menu-yADx33I8.cjs +1 -0
  51. package/dist/menu.cjs +1 -1
  52. package/dist/menu.js +2 -4
  53. package/dist/pluto.cjs +52 -0
  54. package/dist/pluto.css +2 -1
  55. package/dist/pluto.js +36474 -0
  56. package/dist/select-B93mFqvf.js +1328 -0
  57. package/dist/select-gt7wGGO4.cjs +1 -0
  58. package/dist/src/access/policy/queries.d.ts +34 -34
  59. package/dist/src/access/policy/queries.d.ts.map +1 -1
  60. package/dist/src/access/queries.d.ts +1 -1
  61. package/dist/src/access/queries.d.ts.map +1 -1
  62. package/dist/src/access/role/queries.d.ts +2 -12
  63. package/dist/src/access/role/queries.d.ts.map +1 -1
  64. package/dist/src/arc/queries.d.ts +1167 -29
  65. package/dist/src/arc/queries.d.ts.map +1 -1
  66. package/dist/src/channel/LinePlot.d.ts +2 -2
  67. package/dist/src/channel/LinePlot.d.ts.map +1 -1
  68. package/dist/src/channel/queries.d.ts +108 -60
  69. package/dist/src/channel/queries.d.ts.map +1 -1
  70. package/dist/src/color/Provider.d.ts +8 -8
  71. package/dist/src/device/queries.d.ts +148 -363
  72. package/dist/src/device/queries.d.ts.map +1 -1
  73. package/dist/src/flux/result.d.ts +5 -5
  74. package/dist/src/flux/result.d.ts.map +1 -1
  75. package/dist/src/flux/update.d.ts +1 -1
  76. package/dist/src/flux/update.d.ts.map +1 -1
  77. package/dist/src/icon/Icon.d.ts.map +1 -1
  78. package/dist/src/icon/registry.d.ts +1 -0
  79. package/dist/src/icon/registry.d.ts.map +1 -1
  80. package/dist/src/label/queries.d.ts +21 -21
  81. package/dist/src/label/queries.d.ts.map +1 -1
  82. package/dist/src/lineplot/aether/XAxis.d.ts +28 -28
  83. package/dist/src/lineplot/aether/YAxis.d.ts +28 -28
  84. package/dist/src/lineplot/aether/axis.d.ts +14 -14
  85. package/dist/src/lineplot/queries.d.ts +2 -2
  86. package/dist/src/lineplot/queries.d.ts.map +1 -1
  87. package/dist/src/lineplot/range/aether/provider.d.ts +126 -102
  88. package/dist/src/lineplot/range/aether/provider.d.ts.map +1 -1
  89. package/dist/src/lineplot/tooltip/aether/tooltip.d.ts +56 -56
  90. package/dist/src/log/aether/Log.d.ts +21 -21
  91. package/dist/src/log/queries.d.ts +2 -2
  92. package/dist/src/log/queries.d.ts.map +1 -1
  93. package/dist/src/memo/index.d.ts +0 -1
  94. package/dist/src/memo/index.d.ts.map +1 -1
  95. package/dist/src/memo/useMemoCompare.d.ts +0 -1
  96. package/dist/src/memo/useMemoCompare.d.ts.map +1 -1
  97. package/dist/src/rack/queries.d.ts.map +1 -1
  98. package/dist/src/ranger/aether/queries.d.ts.map +1 -1
  99. package/dist/src/ranger/queries.d.ts +19 -19
  100. package/dist/src/ranger/queries.d.ts.map +1 -1
  101. package/dist/src/schematic/queries.d.ts +2 -2
  102. package/dist/src/schematic/queries.d.ts.map +1 -1
  103. package/dist/src/schematic/symbol/Forms.d.ts.map +1 -1
  104. package/dist/src/schematic/symbol/Primitives.d.ts +2 -1
  105. package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -1
  106. package/dist/src/schematic/symbol/SelectOrientation.d.ts.map +1 -1
  107. package/dist/src/schematic/symbol/Symbols.d.ts +35 -34
  108. package/dist/src/schematic/symbol/Symbols.d.ts.map +1 -1
  109. package/dist/src/schematic/symbol/queries.d.ts +96 -50
  110. package/dist/src/schematic/symbol/queries.d.ts.map +1 -1
  111. package/dist/src/schematic/symbol/registry.d.ts.map +1 -1
  112. package/dist/src/select/Dialog.d.ts +2 -1
  113. package/dist/src/select/Dialog.d.ts.map +1 -1
  114. package/dist/src/status/Select.d.ts.map +1 -1
  115. package/dist/src/status/SelectMulipleVariants.spec.d.ts +2 -0
  116. package/dist/src/status/SelectMulipleVariants.spec.d.ts.map +1 -0
  117. package/dist/src/status/SelectMultipleVariants.d.ts +9 -0
  118. package/dist/src/status/SelectMultipleVariants.d.ts.map +1 -0
  119. package/dist/src/status/SelectVariant.d.ts +2 -2
  120. package/dist/src/status/SelectVariant.d.ts.map +1 -1
  121. package/dist/src/status/SelectVariant.spec.d.ts +2 -0
  122. package/dist/src/status/SelectVariant.spec.d.ts.map +1 -0
  123. package/dist/src/status/aether/aggregator.d.ts +16 -2
  124. package/dist/src/status/aether/aggregator.d.ts.map +1 -1
  125. package/dist/src/status/aether/errorHandler.d.ts +2 -1
  126. package/dist/src/status/aether/errorHandler.d.ts.map +1 -1
  127. package/dist/src/status/base/Aggregator.d.ts +3 -2
  128. package/dist/src/status/base/Aggregator.d.ts.map +1 -1
  129. package/dist/src/status/external.d.ts +1 -0
  130. package/dist/src/status/external.d.ts.map +1 -1
  131. package/dist/src/status/queries.d.ts +25 -9
  132. package/dist/src/status/queries.d.ts.map +1 -1
  133. package/dist/src/status/variantData.d.ts +4 -0
  134. package/dist/src/status/variantData.d.ts.map +1 -0
  135. package/dist/src/table/cells/Cells.d.ts +17 -17
  136. package/dist/src/table/queries.d.ts +2 -2
  137. package/dist/src/table/queries.d.ts.map +1 -1
  138. package/dist/src/task/queries.d.ts +3 -3
  139. package/dist/src/task/queries.d.ts.map +1 -1
  140. package/dist/src/telem/aether/noop.d.ts.map +1 -1
  141. package/dist/src/telem/aether/static.d.ts +10 -10
  142. package/dist/src/telem/aether/telem.d.ts +1 -1
  143. package/dist/src/telem/aether/telem.d.ts.map +1 -1
  144. package/dist/src/telem/aether/transformers.d.ts +15 -15
  145. package/dist/src/telem/aether/transformers.d.ts.map +1 -1
  146. package/dist/src/telem/client/cache/cache.d.ts +1 -1
  147. package/dist/src/telem/client/cache/cache.d.ts.map +1 -1
  148. package/dist/src/telem/client/client.d.ts +4 -4
  149. package/dist/src/telem/client/client.d.ts.map +1 -1
  150. package/dist/src/telem/client/reader.d.ts +1 -1
  151. package/dist/src/telem/client/reader.d.ts.map +1 -1
  152. package/dist/src/telem/client/streamer.d.ts +1 -1
  153. package/dist/src/telem/client/streamer.d.ts.map +1 -1
  154. package/dist/src/telem/control/Controller.d.ts +1 -1
  155. package/dist/src/telem/control/Controller.d.ts.map +1 -1
  156. package/dist/src/telem/control/aether/chip.d.ts +16 -2
  157. package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
  158. package/dist/src/telem/control/aether/controller.d.ts +16 -16
  159. package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
  160. package/dist/src/telem/control/aether/indicator.d.ts +51 -37
  161. package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
  162. package/dist/src/telem/control/aether/legend.d.ts +18 -16
  163. package/dist/src/telem/control/aether/legend.d.ts.map +1 -1
  164. package/dist/src/telem/control/aether/state.d.ts +9 -8
  165. package/dist/src/telem/control/aether/state.d.ts.map +1 -1
  166. package/dist/src/theming/aether/provider.d.ts +990 -990
  167. package/dist/src/theming/base/theme.d.ts +330 -330
  168. package/dist/src/user/queries.d.ts +2 -2
  169. package/dist/src/view/queries.d.ts +2 -2
  170. package/dist/src/vis/axis/axis.d.ts +14 -14
  171. package/dist/src/vis/gauge/aether/gauge.d.ts +21 -21
  172. package/dist/src/vis/gauge/use.d.ts +7 -7
  173. package/dist/src/vis/line/aether/line.d.ts +7 -7
  174. package/dist/src/vis/measure/aether/measure.d.ts +56 -56
  175. package/dist/src/vis/rule/aether/aether.d.ts +14 -14
  176. package/dist/src/vis/value/aether/value.d.ts +42 -42
  177. package/dist/src/vis/value/redline.d.ts +5 -5
  178. package/dist/src/vis/value/redline.d.ts.map +1 -1
  179. package/dist/src/vis/value/use.d.ts +14 -14
  180. package/dist/src/workspace/queries.d.ts +6 -4
  181. package/dist/src/workspace/queries.d.ts.map +1 -1
  182. package/dist/tabs-CB7d2_0h.cjs +1 -0
  183. package/dist/tabs-DEXXNOZA.js +253 -0
  184. package/dist/tabs.cjs +1 -1
  185. package/dist/tabs.js +2 -4
  186. package/dist/text-Dd6wYgQM.js +142 -0
  187. package/dist/text-n3Fetdk6.cjs +1 -0
  188. package/dist/text.cjs +1 -1
  189. package/dist/text.js +2 -5
  190. package/dist/theming-Blgv4Cvi.js +591 -0
  191. package/dist/theming-KFfFjsRJ.cjs +1 -0
  192. package/dist/theming.cjs +1 -1
  193. package/dist/theming.js +2 -5
  194. package/dist/tree-B4jJAzS1.js +294 -0
  195. package/dist/tree-CsgSEpgy.cjs +1 -0
  196. package/dist/tree.cjs +1 -1
  197. package/dist/tree.js +2 -4
  198. package/dist/triggers-AqBSAR_T.cjs +1 -0
  199. package/dist/triggers-DDlalLoO.js +4748 -0
  200. package/dist/triggers.cjs +1 -1
  201. package/dist/triggers.js +2 -4
  202. package/dist/types-BGbd8pRh.js +73 -0
  203. package/dist/types-ByXvRm2h.cjs +1 -0
  204. package/dist/video-Bnr-2W9p.cjs +1 -0
  205. package/dist/video-ByMlaeKI.js +15 -0
  206. package/dist/video.cjs +1 -1
  207. package/dist/video.js +2 -4
  208. package/package.json +28 -29
  209. package/dist/Animated-B_N04fe6.cjs +0 -1
  210. package/dist/Animated-BsbNkFLg.cjs +0 -1
  211. package/dist/Animated-CLo1CLgn.js +0 -29
  212. package/dist/Animated-CO--9HPM.js +0 -354
  213. package/dist/Box-Bi280MYh.js +0 -96
  214. package/dist/Box-CNUz5BsV.cjs +0 -1
  215. package/dist/Copy-BgRUUzWz.cjs +0 -1
  216. package/dist/Copy-COWBkO_v.js +0 -337
  217. package/dist/Dialog-Bj7FiHJD.js +0 -59
  218. package/dist/Dialog-DBm6Fap1.cjs +0 -1
  219. package/dist/Editable-C17ILP50.js +0 -202
  220. package/dist/Editable-HUPqTaui.cjs +0 -1
  221. package/dist/Haul-CnZK3e-n.js +0 -132
  222. package/dist/Haul-DlwI4b25.cjs +0 -1
  223. package/dist/Items-CXBBG9Ip.cjs +0 -4
  224. package/dist/Items-DQba1BFQ.js +0 -842
  225. package/dist/Menu-BZ6ZGIv3.cjs +0 -1
  226. package/dist/Menu-CniMpPmC.js +0 -139
  227. package/dist/Provider-cSwm-2e_.cjs +0 -1
  228. package/dist/Provider-jFWpR0CX.js +0 -520
  229. package/dist/Tags-CxzMdPpm.cjs +0 -1
  230. package/dist/Tags-DvfGhiWv.js +0 -925
  231. package/dist/Text-2MISZsc5.js +0 -1712
  232. package/dist/Text-XHBXXDRS.cjs +0 -1
  233. package/dist/Video-Bew5_j16.js +0 -10
  234. package/dist/Video-BryrVNlH.cjs +0 -1
  235. package/dist/css-CloSmhZB.cjs +0 -1
  236. package/dist/css-D90kZTM8.js +0 -63
  237. package/dist/dimensions-CdFEW3oU.cjs +0 -1
  238. package/dist/dimensions-DbMN4145.js +0 -19
  239. package/dist/eraser-BShvqlBE.js +0 -958
  240. package/dist/eraser-rFMFKqsg.cjs +0 -11
  241. package/dist/event-BxvV3arE.cjs +0 -1
  242. package/dist/event-nNH_pXSr.js +0 -36
  243. package/dist/external-4jf1Bv96.cjs +0 -1
  244. package/dist/external-B2YeNEwd.cjs +0 -1
  245. package/dist/external-B9PnwQOL.js +0 -29
  246. package/dist/external-BBbkXXN0.js +0 -47
  247. package/dist/external-BByOkVID.cjs +0 -1
  248. package/dist/external-BrEnYrZV.js +0 -32
  249. package/dist/external-BwbypKCk.cjs +0 -1
  250. package/dist/external-C65vBow6.cjs +0 -1
  251. package/dist/external-CCcIJ20u.cjs +0 -1
  252. package/dist/external-CF4uh-dm.js +0 -51423
  253. package/dist/external-Cn6EfkLd.cjs +0 -1
  254. package/dist/external-CovFw1fv.cjs +0 -1
  255. package/dist/external-D2Zb9O5J.js +0 -93
  256. package/dist/external-D6aLGjMg.js +0 -8969
  257. package/dist/external-DDvmnE2k.js +0 -341
  258. package/dist/external-DTi9a-iK.cjs +0 -1
  259. package/dist/external-DYP1_xpd.js +0 -80
  260. package/dist/external-DxsuBuKe.js +0 -392
  261. package/dist/external-DysGdnTb.js +0 -130
  262. package/dist/external-N2L8ffzi.js +0 -71
  263. package/dist/external-UzXlHlr9.js +0 -24
  264. package/dist/external-_Ht_yCRf.cjs +0 -1
  265. package/dist/external-igNfmRSB.cjs +0 -28
  266. package/dist/external-uUEGzmui.cjs +0 -84
  267. package/dist/fontString-76R2eWDd.js +0 -29
  268. package/dist/fontString-BNnhiwug.cjs +0 -1
  269. package/dist/hooks-Co6IVYNw.cjs +0 -1
  270. package/dist/hooks-QNj6PdUo.js +0 -73
  271. package/dist/index.cjs +0 -60
  272. package/dist/index.js +0 -36886
  273. package/dist/jsx-runtime-nZSsnGb7.cjs +0 -6
  274. package/dist/jsx-runtime-tc70JA_2.js +0 -264
  275. package/dist/provider-Bt-E2O6g.js +0 -810
  276. package/dist/provider-DQkVj3tA.cjs +0 -10
  277. package/dist/src/memo/proxyMemo.d.ts +0 -3
  278. package/dist/src/memo/proxyMemo.d.ts.map +0 -1
  279. package/dist/types-CGRCBVD4.js +0 -82
  280. package/dist/types-DI2vtOGs.cjs +0 -1
  281. package/dist/units-Bu36uC6z.cjs +0 -1
  282. package/dist/units-DMip-eZH.js +0 -14
  283. package/dist/useStaticData-BTwIe0Il.cjs +0 -1
  284. package/dist/useStaticData-p8sk2VCJ.js +0 -1051
  285. package/dist/value-BkUH03tl.cjs +0 -53
  286. package/dist/value-D0vfKEY3.js +0 -6821
@@ -1,10 +0,0 @@
1
- "use strict";const i=require("zod"),X=require("@synnaxlabs/alamos"),d=require("@synnaxlabs/client"),s=require("@synnaxlabs/x"),f=require("./types-DI2vtOGs.cjs"),_=(n,t,e="")=>{try{return n.parse(t)}catch(r){if(r instanceof i.z.ZodError){const o=r.issues.map(a=>a.path.length===0?a.message:`${a.path.join(".")}: ${a.message}`);throw new Error(`${e} - ${o.join(`
2
- `)}`)}else throw r}},A=(n,t)=>n instanceof Error?(n.message=`[${t}] - ${n.message}`,n):new Error(t??"unknown error",{cause:n}),$=n=>{const t=n._zod.def.output;return t instanceof i.z.ZodVoid||t instanceof i.z.ZodNever||t instanceof i.z.ZodUnknown};class k{type;key;sender;_internalState;_state;_prevState;_deleted=!1;parentCtxValues;childCtxValues;childCtxChangedKeys;instrumentation;schema=void 0;methods=void 0;_methodImplementations=null;constructor({key:t,type:e,sender:r,instrumentation:o,parentCtxValues:a}){this.type=e,this.key=t,this.sender=r,this._internalState={},this.instrumentation=o.child(this.toString()),this.parentCtxValues=new Map,a?.forEach((h,c)=>this.parentCtxValues.set(c,h)),this.childCtxValues=new Map,this.childCtxChangedKeys=new Set}initializeMethods(){if(!(this.methods==null||this._methodImplementations!=null)){this._methodImplementations={};for(const[t,e]of Object.entries(this.methods)){const r=this[t];if(typeof r!="function")throw new Error(`Method ${t} is not a function`);this._methodImplementations[t]=$(e)?e.implement(r.bind(this)):e.implementAsync(r.bind(this))}}}get _schema(){if(this.schema==null)throw new d.ValidationError(`[AetherLeaf] - expected subclass to define component schema, but none was found.
3
- Make sure to define a property 'schema' on the class.`);return this.schema}setState(t){const e=f.executeSetter(t,this.state);this._prevState=s.shallow.copy(this._state),this._state=_(this._schema,e,`${this.toString()}`),this.sender.send({variant:"update",key:this.key,state:this._state})}get state(){if(this._state==null)throw new d.UnexpectedError(`[AetherLeaf] - state not defined in ${this.toString()}`);return this._state}get internal(){return this._internalState}get prevState(){if(this._prevState===void 0)throw new Error("prevState not defined");return this._prevState}get deleted(){return this._deleted}get ctx(){return{get:t=>{const e=this.parentCtxValues.get(t);if(e===void 0)throw new d.NotFoundError(`Context value for ${t} not found on ${this.toString()}`);return e},getOptional:t=>this.parentCtxValues.get(t),has:t=>this.parentCtxValues.has(t),wasSetPreviously:t=>this.childCtxValues.has(t),set:(t,e,r=!0)=>{this.childCtxValues.set(t,e),r&&this.childCtxChangedKeys.add(t)}}}toString(){return`${this.type}(${this.key})`}_updateState({path:t,state:e}){if(!this.deleted)try{this.initializeMethods();const r=this.instrumentation.T.debug(`${this.toString()}:updateState`);this.validatePath(t);const o=_(this._schema,e,`${this.toString()}`);this._state!=null?this.instrumentation.L.debug("updating state",()=>({diff:s.deep.difference(this.state,o)})):this.instrumentation.L.debug("setting initial state",{state:e,path:t}),this._prevState=this._state??o,this._state=o,this.afterUpdate(this.ctx),r()}catch(r){throw A(r,`${this.toString()}.updateState`)}}_updateContext(t){try{const e=this.instrumentation.T.debug(`${this.toString()}:updateContext`);t.forEach((r,o)=>this.parentCtxValues.set(o,r)),this.afterUpdate(this.ctx),e()}catch(e){throw A(e,`${this.type}.${this.key}.updateContext`)}}_delete(t){try{const e=this.instrumentation.T.debug(`${this.toString()}:delete`);this.validatePath(t),this._deleted=!0,this.afterDelete(this.ctx),e()}catch(e){throw A(e,`[${this.toString()}:delete]`)}}afterUpdate(t){}afterDelete(t){}validatePath(t){if(t.length===0)throw new d.UnexpectedError(`[Leaf.setState] - ${this.toString()} received an empty path`);const e=t[t.length-1];if(t.length>1)throw new d.UnexpectedError(`[Leaf.setState] - ${this.toString()} received a subPath ${t.join(".")} but is a leaf`);if(e!==this.key)throw new d.UnexpectedError(`[Leaf.setState] - ${this.toString()} received a key ${e} but expected ${this.key}`)}handleInvokeError({method:t,key:e,args:r},o){if(!(e!=null))return console.error(`Error in fire and forget method ${t} on ${this.toString()}`,o);const h=o instanceof Error?o:new Error(String(o));this.sender.send({variant:"invoke_response",key:e,result:void 0,error:{name:h.name,message:`Failed to execute ${t}(${e}) with args ${JSON.stringify(r)} on ${this.toString()}: ${h.message}`,stack:h.stack??""}})}_invokeMethod(t){if(this.deleted)return;const{method:e,key:r,args:o}=t,a=r!=null,h=this._methodImplementations?.[e];if(h==null)return this.handleInvokeError(t,new Error(`Method ${e} not found on ${this.toString()}`));try{const c=h(...o);c instanceof Promise&&c.then(p=>{a&&this.sender.send({variant:"invoke_response",key:r,result:p})}).catch(p=>this.handleInvokeError(t,p))}catch(c){this.handleInvokeError(t,c)}}}class E extends k{_children=new Map;get children(){return Array.from(this._children.values())}getChild(t){return this._children.get(t)??null}childrenOfType(...t){return this.children.filter(e=>t.includes(e.type))}_updateState(t){const{path:e,type:r,create:o}=t;if(this.deleted)return;const a=this.parsePath(e);if(a.length===0){if(this.childCtxChangedKeys.clear(),super._updateState(t),this.childCtxChangedKeys.size==0)return;this.updateChildContexts();return}const c=a[0],p=this.getChild(c);if(p!=null)return p._updateState({...t,path:a});if(a.length>1){const M=e.slice(0,e.indexOf(c)+1).join("."),G=e.join(".");throw new d.UnexpectedError(`Child of ${this.toString()} at path ${M} does not exist,
4
- but an extended path ${G} was provided. This means that the aether
5
- tree is attempting to create a new child of type ${r} (or nested children)
6
- on a child that does not exist.
7
-
8
- Children present: ${this.children.map(P=>`${P.type}:${P.key}`).join(".")}
9
-
10
- `)}const F=o(this.childCtx());F._updateState({...t,path:a}),this._children.set(c,F)}_updateContext(t){super._updateContext(t),this.updateChildContexts()}childCtx(){return{get:t=>this.childCtxValues.get(t)??this.parentCtxValues.get(t),forEach:t=>{this.childCtxValues.forEach((e,r)=>t(e,r,this.childCtxValues)),this.parentCtxValues.forEach((e,r)=>{this.childCtxValues.has(r)||t(e,r,this.parentCtxValues)})}}}updateChildContexts(){const t=this.childCtx();this.children.forEach(e=>e._updateContext(t))}_delete(t){const e=this.parsePath(t);if(e.length===0){for(const o of this.children)o._delete([o.key]);this._children.clear(),super._delete([this.key])}const r=this.getChild(e[0]);if(r!=null){if(e.length>1)return r._delete(e);this._children.delete(r.key),r._delete(e)}}findChildAtPath(t){if(t.length===0)return null;const[e,...r]=t,o=this.getChild(e);return o==null?null:r.length===0?o:"findChildAtPath"in o&&typeof o.findChildAtPath=="function"?o.findChildAtPath(r):null}parsePath(t,e){const[r,...o]=t;if(r==null)throw new Error(`Composite ${this.toString()} received an empty path${e!=null?` for ${e}`:""}`);if(r!==this.key)throw new d.UnexpectedError(`[Composite.getRequiredKey] - ${this.toString()} received a key ${r} but expected ${this.key}`);return o}}const q=i.z.object({}),W=()=>{throw new Error("should not call create")};class u extends E{static TYPE="root";static KEY="root";comms;registry;schema=q;constructor({comms:t,instrumentation:e=X.alamos.Instrumentation.NOOP,registry:r}){super({key:u.KEY,type:u.TYPE,sender:t,instrumentation:e,parentCtxValues:null}),this.comms=t,this.registry=r}static render(t){const e=new u(t);return e._updateState({path:[u.KEY],type:"",state:{},create:W}),e.comms.handle(r=>{try{e.handle(r)}catch(o){const a={name:"unknown",message:JSON.stringify(o),stack:"unknown"};o instanceof Error&&(a.name=o.name,a.message=o.message,a.stack=o.stack),e.comms.send({variant:"error",error:a})}}),e}handle(t){const{variant:e}=t;if(e==="invoke_request"){this.invokeAtPath(t);return}const{path:r,type:o}=t;if(e==="delete"){this._delete(r);return}const{state:a}=t;this._updateState({path:r,type:o,state:a,create:h=>{const c=r[r.length-1];return this.create({key:c,type:o,parentCtxValues:h})}})}invokeAtPath(t){const{path:e}=t,[r,...o]=e;if(r!==u.KEY){this.handleInvokeError(t,new Error(`Invalid path: expected root key '${u.KEY}', got '${r}'`));return}if(o.length===0){this._invokeMethod(t);return}const a=this.findChildAtPath(o);if(a==null){this.handleInvokeError(t,new d.NotFoundError(`Component at path ${e.join(".")} not found`));return}a._invokeMethod(t)}create({key:t,type:e,parentCtxValues:r}){const o=this.registry[e];if(o==null)throw new d.UnexpectedError(`[Root.create] - ${e} not found in registry`);return new o({key:t,type:e,sender:this.comms,instrumentation:this.instrumentation,parentCtxValues:r})}}const T=u.render.bind(u),J=Object.freeze(Object.defineProperty({__proto__:null,Composite:E,Leaf:k,Root:u,isFireAndForget:$,render:T},Symbol.toStringTag,{value:"Module"})),Q=(n,t)=>Array.isArray(t)?t.some(e=>e.matches(n)):t?.matches(n)??!1,tt=n=>{console.error(s.status.toString(n))},H=(n,t,e)=>{const r=s.status.fromException(n,t);return tt(r),Q(n,e)?null:r},L=(n,t,e,r)=>{if(typeof n=="function")return!0;const o=H(n,e,r);return o!=null&&t(o),!1},I=async(n,t,e,r)=>{try{const o=n();o!=null&&await o}catch(o){const a=H(o,e,r);if(a!=null)return t(a)}},j=n=>(t,e,r)=>{L(t,n,e,r)&&I(t,n,e,r)},O=n=>async(t,e,r)=>{L(t,n,e,r)&&await I(t,n,e,r)},N=i.z.object({statuses:s.status.statusZ().array()}),w="status.aggregator";class z extends E{static TYPE="status.Aggregator";schema=N;afterUpdate(t){t.wasSetPreviously(w)||t.set(w,{add:this.add.bind(this),create:s.status.create})}add(t){this.setState(e=>({...e,statuses:[...e.statuses,s.status.create(t)]}))}}const Z=n=>n.get(w).add,et=n=>{const t=n.getOptional(w);return t!=null?t.add:()=>{}},R=n=>j(Z(n)),rt=n=>O(Z(n)),nt={[z.TYPE]:z},ot=i.z.object({l0:s.color.colorZ,l1:s.color.colorZ,l2:s.color.colorZ,l3:s.color.colorZ,l4:s.color.colorZ,l5:s.color.colorZ,l6:s.color.colorZ,l7:s.color.colorZ,l8:s.color.colorZ,l9:s.color.colorZ,l10:s.color.colorZ,l11:s.color.colorZ}),l=(n,t)=>[n[0],n[1],t,n[3]],st=i.z.object({m2:s.color.colorZ,m1:s.color.colorZ,z:s.color.colorZ,p1:s.color.colorZ,p2:s.color.colorZ}),C=st.or(s.color.colorZ.transform(n=>{const t=s.color.hsla(n);return{m2:s.color.fromHSLA(l(t,40)),m1:s.color.fromHSLA(l(t,45)),z:n,p1:s.color.fromHSLA(l(t,55)),p2:s.color.fromHSLA(l(t,65))}})),Y=i.z.object({name:i.z.string(),key:i.z.string(),colors:i.z.object({border:s.color.colorZ,primary:C,gray:ot,error:C,secondary:C,warning:C,palettes:i.z.record(i.z.string(),s.color.paletteZ),visualization:i.z.object({palettes:i.z.record(i.z.string(),i.z.array(s.color.colorZ))}).default({palettes:{}}),white:s.color.colorZ,black:s.color.colorZ,text:s.color.colorZ,textInverted:s.color.colorZ,textOnPrimary:s.color.colorZ.default(s.color.ZERO),primaryText:s.color.colorZ,errorText:s.color.colorZ,warningText:s.color.colorZ,logo:i.z.string()}),sizes:i.z.object({base:i.z.number(),border:i.z.object({radius:i.z.number(),width:i.z.number(),thickWidth:i.z.number()}),schematic:i.z.object({elementStrokeWidth:i.z.number()})}),typography:i.z.object({family:i.z.string(),codeFamily:i.z.string(),h1:f.specZ,h2:f.specZ,h3:f.specZ,h4:f.specZ,h5:f.specZ,p:f.specZ,small:f.specZ})}).transform(n=>((n.colors.textOnPrimary==null||s.color.isZero(n.colors.textOnPrimary))&&(n.colors.textOnPrimary=s.color.pickByContrast(n.colors.primary.z,n.colors.text,n.colors.textInverted)),n)),it='"Inter Variable", sans-serif',at='"Geist Mono", monospace',ct=6,m=[357,91,55,1],g=[48,90,55,1],lt=["#FEFEFE","#FAFAFA","#F2F2F2","#ECECEC","#E4E4E4","#D1D1D1","#BCBCBC","#ACACAC","#8F8F8F","#4F4F4F","#292929","#050505"],y=Object.fromEntries(lt.map((n,t)=>[`l${t}`,n])),ht=()=>typeof window>"u"?!1:window.devicePixelRatio>1,dt=ht(),v={key:"synnaxBase",name:"Synnax Base",colors:{primary:{m2:"#041B3D",m1:"#356fc5",z:"#3774D0",p1:"#5E94EE",p2:"#8AB8FF"},secondary:{m2:"#2D8F4E",m1:"#38B261",z:"#50C878",p1:"#73D393",p2:"#96DEAE"},gray:y,border:y.l4,error:{m2:s.color.fromHSLA(l(m,30)),m1:s.color.fromHSLA(l(m,40)),z:s.color.fromHSLA(m),p1:s.color.fromHSLA(l(m,65)),p2:s.color.fromHSLA(l(m,77))},warning:{m2:s.color.fromHSLA(l(g,30)),m1:s.color.fromHSLA(l(g,40)),z:s.color.fromHSLA(g),p1:s.color.fromHSLA(l(g,65)),p2:s.color.fromHSLA(l(g,75))},palettes:{recent:{key:"recent",name:"Recent",swatches:[]}},visualization:{palettes:{default:["#DC136C","#20A4F3","#7AC74F","#FFC43D","#FE5F55","#8075FF","#D90429","#f7aef8","#f18f01","#791e94","#279af1","#d9fff5","#ff6b6b","#52ffb8"]}},logo:"url(#synnax-linear-gradient)",white:"#FFFFFF",black:"#000000",text:y.l11,textInverted:y.l0,textOnPrimary:y.l0,primaryText:"#3b82f6",errorText:"#ef4444",warningText:"#f59e0b"},sizes:{base:ct,border:{radius:3,width:dt?.5:1,thickWidth:1},schematic:{elementStrokeWidth:2}},typography:{family:it,codeFamily:at,h1:{size:5.5,weight:"500",lineHeight:5.5*1.5},h2:{size:4.5,weight:"medium",lineHeight:4.5*1.5},h3:{size:3.5,weight:"medium",lineHeight:3.5*1.5},h4:{size:2.6666,weight:"medium",lineHeight:2.6666*1.5},h5:{size:2.333333,weight:450,lineHeight:2.333333*1.5},p:{size:2.1666666666,weight:"regular",lineHeight:2*1.5},small:{size:1.916666,weight:"regular",lineHeight:2.3333333}}},V=Object.freeze({...v,key:"synnaxLight",name:"Synnax Light"}),ut=["#020202","#080808","#151515","#202020","#272727","#3B3B3B","#4A4A4A","#5C5C5C","#767676","#959595","#dadada","#FAFAFA"],S=Object.fromEntries(ut.map((n,t)=>[`l${t}`,n])),D=Object.freeze({...v,key:"synnaxDark",name:"Synnax Dark",colors:{...v.colors,gray:S,logo:"var(--pluto-text-color)",border:S.l4,text:S.l11,textInverted:S.l0,textOnPrimary:S.l11,primaryText:"#93c5fd",errorText:"#fca5a5",warningText:"#fcd34d"}}),ft={synnaxDark:D,synnaxLight:V},K=["tiny","small","medium","large","huge"],U=i.z.enum(K),pt=n=>U.safeParse(n).success,b="pluto-theming-context",B=i.z.object({name:i.z.string(),url:i.z.string()}),mt=i.z.object({theme:Y,fontURLs:i.z.array(B)});class x extends E{static TYPE="theming.Provider";static z=mt;schema=x.z;afterUpdate(t){if(t.getOptional(b)!=null&&this.state.theme.key===this.prevState.theme.key)return;t.set(b,this.state.theme),R(t)(async()=>{await this.loadFonts()},"failed to load theme fonts")}async loadFonts(){await Promise.all(this.state.fontURLs.map(async({name:t,url:e})=>{const r=new FontFace(t,`url(${e})`);try{await r.load(),self.fonts.add(r)}catch(o){console.error(o)}}))}}const gt=n=>n.get(b),yt={[x.TYPE]:x};exports.Aggregator=z;exports.Composite=E;exports.Leaf=k;exports.Provider=x;exports.REGISTRY=yt;exports.REGISTRY$1=nt;exports.SIZES=K;exports.SYNNAX_DARK=D;exports.SYNNAX_LIGHT=V;exports.SYNNAX_THEMES=ft;exports.aether=J;exports.aggregatorStateZ=N;exports.createAsyncErrorHandler=O;exports.createErrorHandler=j;exports.fontSpecZ=B;exports.isFireAndForget=$;exports.isSize=pt;exports.prettyParse=_;exports.render=T;exports.size=U;exports.themeZ=Y;exports.use=gt;exports.useAdder=Z;exports.useAsyncErrorHandler=rt;exports.useErrorHandler=R;exports.useOptionalAdder=et;
@@ -1,3 +0,0 @@
1
- import { memoize } from 'proxy-memoize';
2
- export declare const proxyMemo: typeof memoize;
3
- //# sourceMappingURL=proxyMemo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proxyMemo.d.ts","sourceRoot":"","sources":["../../../src/memo/proxyMemo.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,eAAO,MAAM,SAAS,EAAE,OAAO,OAG9B,CAAC"}
@@ -1,82 +0,0 @@
1
- import { useState as i, useCallback as h } from "react";
2
- import { z as e } from "zod";
3
- const c = (t) => typeof t == "function", g = (t, n) => c(t) ? t(n) : t, f = (t) => (n) => n == null ? void 0 : t(n), S = (t) => (n) => n == null ? null : t(n), a = (t) => m(t) ? t() : t, m = (t) => typeof t == "function", d = ({
4
- initial: t,
5
- value: n,
6
- onChange: s
7
- }) => {
8
- const [l, r] = i(n ?? t);
9
- return n != null && s != null ? [n, s] : [l, r];
10
- }, p = ({
11
- initial: t,
12
- value: n,
13
- onChange: s
14
- }) => {
15
- const [l, r] = i(
16
- a(n ?? t)
17
- );
18
- return n != null && s != null ? [n, s] : [l, r];
19
- }, b = (t, n) => {
20
- const [s, l] = i(() => {
21
- const o = localStorage.getItem(n);
22
- return o == null ? a(t) : JSON.parse(o);
23
- }), r = h(
24
- (o) => {
25
- l(o), localStorage.setItem(n, JSON.stringify(o));
26
- },
27
- [l, n]
28
- );
29
- return [s, r];
30
- }, O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31
- __proto__: null,
32
- executeInitialSetter: a,
33
- executeSetter: g,
34
- isInitialSetter: m,
35
- isSetter: c,
36
- skipNull: S,
37
- skipUndefined: f,
38
- usePassthrough: d,
39
- usePersisted: b,
40
- usePurePassthrough: p
41
- }, Symbol.toStringTag, { value: "Module" })), u = ["h1", "h2", "h3", "h4", "h5", "p", "small"], L = e.enum(u), _ = (t) => {
42
- const n = u.indexOf(t);
43
- return n === -1 || n === u.length - 1 ? t : u[n + 1];
44
- }, N = e.union([
45
- e.number(),
46
- e.enum(["normal", "bold", "bolder", "lighter"])
47
- ]), P = e.object({
48
- size: e.number(),
49
- weight: e.union([e.number(), e.string()]),
50
- lineHeight: e.number(),
51
- textTransform: e.string().optional()
52
- }), x = {
53
- tiny: "small",
54
- small: "small",
55
- medium: "p",
56
- large: "h5",
57
- huge: "h2"
58
- }, Z = {
59
- h1: "huge",
60
- h2: "huge",
61
- h3: "huge",
62
- h4: "large",
63
- h5: "small",
64
- p: "medium",
65
- small: "small"
66
- };
67
- export {
68
- x as C,
69
- u as L,
70
- Z as a,
71
- d as b,
72
- a as c,
73
- _ as d,
74
- g as e,
75
- f,
76
- S as g,
77
- O as h,
78
- L as l,
79
- P as s,
80
- p as u,
81
- N as w
82
- };
@@ -1 +0,0 @@
1
- "use strict";const i=require("react"),n=require("zod"),a=e=>typeof e=="function",h=(e,t)=>a(e)?e(t):e,S=e=>t=>t==null?void 0:e(t),g=e=>t=>t==null?null:e(t),c=e=>m(e)?e():e,m=e=>typeof e=="function",E=({initial:e,value:t,onChange:s})=>{const[l,r]=i.useState(t??e);return t!=null&&s!=null?[t,s]:[l,r]},d=({initial:e,value:t,onChange:s})=>{const[l,r]=i.useState(c(t??e));return t!=null&&s!=null?[t,s]:[l,r]},f=(e,t)=>{const[s,l]=i.useState(()=>{const u=localStorage.getItem(t);return u==null?c(e):JSON.parse(u)}),r=i.useCallback(u=>{l(u),localStorage.setItem(t,JSON.stringify(u))},[l,t]);return[s,r]},p=Object.freeze(Object.defineProperty({__proto__:null,executeInitialSetter:c,executeSetter:h,isInitialSetter:m,isSetter:a,skipNull:g,skipUndefined:S,usePassthrough:E,usePersisted:f,usePurePassthrough:d},Symbol.toStringTag,{value:"Module"})),o=["h1","h2","h3","h4","h5","p","small"],z=n.z.enum(o),L=e=>{const t=o.indexOf(e);return t===-1||t===o.length-1?e:o[t+1]},O=n.z.union([n.z.number(),n.z.enum(["normal","bold","bolder","lighter"])]),I=n.z.object({size:n.z.number(),weight:n.z.union([n.z.number(),n.z.string()]),lineHeight:n.z.number(),textTransform:n.z.string().optional()}),N={tiny:"small",small:"small",medium:"p",large:"h5",huge:"h2"},P={h1:"huge",h2:"huge",h3:"huge",h4:"large",h5:"small",p:"medium",small:"small"};exports.COMPONENT_SIZE_LEVELS=N;exports.LEVELS=o;exports.LEVEL_COMPONENT_SIZES=P;exports.downLevel=L;exports.executeInitialSetter=c;exports.executeSetter=h;exports.levelZ=z;exports.skipNull=g;exports.skipUndefined=S;exports.specZ=I;exports.state=p;exports.usePassthrough=E;exports.usePurePassthrough=d;exports.weightZ=O;
@@ -1 +0,0 @@
1
- "use strict";const o=require("@synnaxlabs/x"),n=(r,e,c)=>Object.fromEntries(c.map(t=>[`${r}-${t}`,o.color.hex(o.color.setAlpha(o.color.construct(e),t))])),s=(r,e,c=!1)=>{const t=`${r}${e}`;return c?`round(${t}, 1px)`:t};exports.createHexOpacityVariants=n;exports.unitProperty=s;
@@ -1,14 +0,0 @@
1
- import { color as s } from "@synnaxlabs/x";
2
- const c = (r, e, o) => Object.fromEntries(
3
- o.map((t) => [
4
- `${r}-${t}`,
5
- s.hex(s.setAlpha(s.construct(e), t))
6
- ])
7
- ), n = (r, e, o = !1) => {
8
- const t = `${r}${e}`;
9
- return o ? `round(${t}, 1px)` : t;
10
- };
11
- export {
12
- c,
13
- n as u
14
- };
@@ -1 +0,0 @@
1
- "use strict";const b=require("react");function D(t){return Array.isArray?Array.isArray(t):re(t)==="[object Array]"}function le(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function fe(t){return t==null?"":le(t)}function F(t){return typeof t=="string"}function te(t){return typeof t=="number"}function de(t){return t===!0||t===!1||ge(t)&&re(t)=="[object Boolean]"}function se(t){return typeof t=="object"}function ge(t){return se(t)&&t!==null}function E(t){return t!=null}function j(t){return!t.trim().length}function re(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Ae="Incorrect 'index' type",pe=t=>`Invalid value for key ${t}`,Ee=t=>`Pattern length exceeds max of ${t}.`,Ce=t=>`Missing ${t} property in key`,me=t=>`Property 'weight' in key '${t}' must be a positive integer`,U=Object.prototype.hasOwnProperty;class Me{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(r=>{let n=ne(r);this._keys.push(n),this._keyMap[n.id]=n,s+=n.weight}),this._keys.forEach(r=>{r.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ne(t){let e=null,s=null,r=null,n=1,i=null;if(F(t)||D(t))r=t,e=X(t),s=K(t);else{if(!U.call(t,"name"))throw new Error(Ce("name"));const u=t.name;if(r=u,U.call(t,"weight")&&(n=t.weight,n<=0))throw new Error(me(u));e=X(u),s=K(u),i=t.getFn}return{path:e,id:s,weight:n,src:r,getFn:i}}function X(t){return D(t)?t:t.split(".")}function K(t){return D(t)?t.join("."):t}function Fe(t,e){let s=[],r=!1;const n=(i,u,c)=>{if(E(i))if(!u[c])s.push(i);else{let h=u[c];const o=i[h];if(!E(o))return;if(c===u.length-1&&(F(o)||te(o)||de(o)))s.push(fe(o));else if(D(o)){r=!0;for(let a=0,f=o.length;a<f;a+=1)n(o[a],u,c+1)}else u.length&&n(o,u,c+1)}};return n(t,F(e)?e.split("."):e,0),r?s:s[0]}const Be={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},De={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},ye={location:0,threshold:.6,distance:100},xe={useExtendedSearch:!1,getFn:Fe,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var l={...De,...Be,...ye,...xe};const _e=/[^ ]+/g;function Ie(t=1,e=3){const s=new Map,r=Math.pow(10,e);return{get(n){const i=n.match(_e).length;if(s.has(i))return s.get(i);const u=1/Math.pow(i,.5*t),c=parseFloat(Math.round(u*r)/r);return s.set(i,c),c},clear(){s.clear()}}}class V{constructor({getFn:e=l.getFn,fieldNormWeight:s=l.fieldNormWeight}={}){this.norm=Ie(s,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,r)=>{this._keysMap[s.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,F(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){const s=this.size();F(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,r=this.size();s<r;s+=1)this.records[s].i-=1}getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!E(e)||j(e))return;let r={v:e,i:s,n:this.norm.get(e)};this.records.push(r)}_addObject(e,s){let r={i:s,$:{}};this.keys.forEach((n,i)=>{let u=n.getFn?n.getFn(e):this.getFn(e,n.path);if(E(u)){if(D(u)){let c=[];const h=[{nestedArrIndex:-1,value:u}];for(;h.length;){const{nestedArrIndex:o,value:a}=h.pop();if(E(a))if(F(a)&&!j(a)){let f={v:a,i:o,n:this.norm.get(a)};c.push(f)}else D(a)&&a.forEach((f,d)=>{h.push({nestedArrIndex:d,value:f})})}r.$[i]=c}else if(F(u)&&!j(u)){let c={v:u,n:this.norm.get(u)};r.$[i]=c}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function ie(t,e,{getFn:s=l.getFn,fieldNormWeight:r=l.fieldNormWeight}={}){const n=new V({getFn:s,fieldNormWeight:r});return n.setKeys(t.map(ne)),n.setSources(e),n.create(),n}function Se(t,{getFn:e=l.getFn,fieldNormWeight:s=l.fieldNormWeight}={}){const{keys:r,records:n}=t,i=new V({getFn:e,fieldNormWeight:s});return i.setKeys(r),i.setIndexRecords(n),i}function $(t,{errors:e=0,currentLocation:s=0,expectedLocation:r=0,distance:n=l.distance,ignoreLocation:i=l.ignoreLocation}={}){const u=e/t.length;if(i)return u;const c=Math.abs(r-s);return n?u+c/n:c?1:u}function we(t=[],e=l.minMatchCharLength){let s=[],r=-1,n=-1,i=0;for(let u=t.length;i<u;i+=1){let c=t[i];c&&r===-1?r=i:!c&&r!==-1&&(n=i-1,n-r+1>=e&&s.push([r,n]),r=-1)}return t[i-1]&&i-r>=e&&s.push([r,i-1]),s}const w=32;function Re(t,e,s,{location:r=l.location,distance:n=l.distance,threshold:i=l.threshold,findAllMatches:u=l.findAllMatches,minMatchCharLength:c=l.minMatchCharLength,includeMatches:h=l.includeMatches,ignoreLocation:o=l.ignoreLocation}={}){if(e.length>w)throw new Error(Ee(w));const a=e.length,f=t.length,d=Math.max(0,Math.min(r,f));let g=i,A=d;const p=c>1||h,m=p?Array(f):[];let y;for(;(y=t.indexOf(e,A))>-1;){let C=$(e,{currentLocation:y,expectedLocation:d,distance:n,ignoreLocation:o});if(g=Math.min(C,g),A=y+a,p){let x=0;for(;x<a;)m[y+x]=1,x+=1}}A=-1;let B=[],R=1,S=a+f;const ae=1<<a-1;for(let C=0;C<a;C+=1){let x=0,_=S;for(;x<_;)$(e,{errors:C,currentLocation:d+_,expectedLocation:d,distance:n,ignoreLocation:o})<=g?x=_:S=_,_=Math.floor((S-x)/2+x);S=_;let Q=Math.max(1,d-_+1),P=u?f:Math.min(d+_,f)+a,L=Array(P+2);L[P+1]=(1<<C)-1;for(let M=P;M>=Q;M-=1){let O=M-1,J=s[t.charAt(O)];if(p&&(m[O]=+!!J),L[M]=(L[M+1]<<1|1)&J,C&&(L[M]|=(B[M+1]|B[M])<<1|1|B[M+1]),L[M]&ae&&(R=$(e,{errors:C,currentLocation:O,expectedLocation:d,distance:n,ignoreLocation:o}),R<=g)){if(g=R,A=O,A<=d)break;Q=Math.max(1,2*d-A)}}if($(e,{errors:C+1,currentLocation:d,expectedLocation:d,distance:n,ignoreLocation:o})>g)break;B=L}const T={isMatch:A>=0,score:Math.max(.001,R)};if(p){const C=we(m,c);C.length?h&&(T.indices=C):T.isMatch=!1}return T}function Le(t){let e={};for(let s=0,r=t.length;s<r;s+=1){const n=t.charAt(s);e[n]=(e[n]||0)|1<<r-s-1}return e}const N=String.prototype.normalize?(t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"")):(t=>t);class ue{constructor(e,{location:s=l.location,threshold:r=l.threshold,distance:n=l.distance,includeMatches:i=l.includeMatches,findAllMatches:u=l.findAllMatches,minMatchCharLength:c=l.minMatchCharLength,isCaseSensitive:h=l.isCaseSensitive,ignoreDiacritics:o=l.ignoreDiacritics,ignoreLocation:a=l.ignoreLocation}={}){if(this.options={location:s,threshold:r,distance:n,includeMatches:i,findAllMatches:u,minMatchCharLength:c,isCaseSensitive:h,ignoreDiacritics:o,ignoreLocation:a},e=h?e:e.toLowerCase(),e=o?N(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const f=(g,A)=>{this.chunks.push({pattern:g,alphabet:Le(g),startIndex:A})},d=this.pattern.length;if(d>w){let g=0;const A=d%w,p=d-A;for(;g<p;)f(this.pattern.substr(g,w),g),g+=w;if(A){const m=d-w;f(this.pattern.substr(m),m)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:s,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=s?e:e.toLowerCase(),e=r?N(e):e,this.pattern===e){let p={isMatch:!0,score:0};return n&&(p.indices=[[0,e.length-1]]),p}const{location:i,distance:u,threshold:c,findAllMatches:h,minMatchCharLength:o,ignoreLocation:a}=this.options;let f=[],d=0,g=!1;this.chunks.forEach(({pattern:p,alphabet:m,startIndex:y})=>{const{isMatch:B,score:R,indices:S}=Re(e,p,m,{location:i+y,distance:u,threshold:c,findAllMatches:h,minMatchCharLength:o,includeMatches:n,ignoreLocation:a});B&&(g=!0),d+=R,B&&S&&(f=[...f,...S])});let A={isMatch:g,score:g?d/this.chunks.length:1};return g&&n&&(A.indices=f),A}}class I{constructor(e){this.pattern=e}static isMultiMatch(e){return Z(e,this.multiRegex)}static isSingleMatch(e){return Z(e,this.singleRegex)}search(){}}function Z(t,e){const s=t.match(e);return s?s[1]:null}class be extends I{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class ke extends I{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Oe extends I{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class $e extends I{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class Ne extends I{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class ve extends I{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class ce extends I{constructor(e,{location:s=l.location,threshold:r=l.threshold,distance:n=l.distance,includeMatches:i=l.includeMatches,findAllMatches:u=l.findAllMatches,minMatchCharLength:c=l.minMatchCharLength,isCaseSensitive:h=l.isCaseSensitive,ignoreDiacritics:o=l.ignoreDiacritics,ignoreLocation:a=l.ignoreLocation}={}){super(e),this._bitapSearch=new ue(e,{location:s,threshold:r,distance:n,includeMatches:i,findAllMatches:u,minMatchCharLength:c,isCaseSensitive:h,ignoreDiacritics:o,ignoreLocation:a})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class oe extends I{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,r;const n=[],i=this.pattern.length;for(;(r=e.indexOf(this.pattern,s))>-1;)s=r+i,n.push([r,s-1]);const u=!!n.length;return{isMatch:u,score:u?0:1,indices:n}}}const W=[be,oe,Oe,$e,ve,Ne,ke,ce],q=W.length,Te=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Pe="|";function je(t,e={}){return t.split(Pe).map(s=>{let r=s.trim().split(Te).filter(i=>i&&!!i.trim()),n=[];for(let i=0,u=r.length;i<u;i+=1){const c=r[i];let h=!1,o=-1;for(;!h&&++o<q;){const a=W[o];let f=a.isMultiMatch(c);f&&(n.push(new a(f,e)),h=!0)}if(!h)for(o=-1;++o<q;){const a=W[o];let f=a.isSingleMatch(c);if(f){n.push(new a(f,e));break}}}return n})}const Ke=new Set([ce.type,oe.type]);class We{constructor(e,{isCaseSensitive:s=l.isCaseSensitive,ignoreDiacritics:r=l.ignoreDiacritics,includeMatches:n=l.includeMatches,minMatchCharLength:i=l.minMatchCharLength,ignoreLocation:u=l.ignoreLocation,findAllMatches:c=l.findAllMatches,location:h=l.location,threshold:o=l.threshold,distance:a=l.distance}={}){this.query=null,this.options={isCaseSensitive:s,ignoreDiacritics:r,includeMatches:n,minMatchCharLength:i,findAllMatches:c,ignoreLocation:u,location:h,threshold:o,distance:a},e=s?e:e.toLowerCase(),e=r?N(e):e,this.pattern=e,this.query=je(this.pattern,this.options)}static condition(e,s){return s.useExtendedSearch}searchIn(e){const s=this.query;if(!s)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:n,ignoreDiacritics:i}=this.options;e=n?e:e.toLowerCase(),e=i?N(e):e;let u=0,c=[],h=0;for(let o=0,a=s.length;o<a;o+=1){const f=s[o];c.length=0,u=0;for(let d=0,g=f.length;d<g;d+=1){const A=f[d],{isMatch:p,indices:m,score:y}=A.search(e);if(p){if(u+=1,h+=y,r){const B=A.constructor.type;Ke.has(B)?c=[...c,...m]:c.push(m)}}else{h=0,u=0,c.length=0;break}}if(u){let d={isMatch:!0,score:h/u};return r&&(d.indices=c),d}}return{isMatch:!1,score:1}}}const z=[];function ze(...t){z.push(...t)}function G(t,e){for(let s=0,r=z.length;s<r;s+=1){let n=z[s];if(n.condition(t,e))return new n(t,e)}return new ue(t,e)}const v={AND:"$and",OR:"$or"},H={PATH:"$path",PATTERN:"$val"},Y=t=>!!(t[v.AND]||t[v.OR]),Ge=t=>!!t[H.PATH],He=t=>!D(t)&&se(t)&&!Y(t),ee=t=>({[v.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function he(t,e,{auto:s=!0}={}){const r=n=>{let i=Object.keys(n);const u=Ge(n);if(!u&&i.length>1&&!Y(n))return r(ee(n));if(He(n)){const h=u?n[H.PATH]:i[0],o=u?n[H.PATTERN]:n[h];if(!F(o))throw new Error(pe(h));const a={keyId:K(h),pattern:o};return s&&(a.searcher=G(o,e)),a}let c={children:[],operator:i[0]};return i.forEach(h=>{const o=n[h];D(o)&&o.forEach(a=>{c.children.push(r(a))})}),c};return Y(t)||(t=ee(t)),r(t)}function Ye(t,{ignoreFieldNorm:e=l.ignoreFieldNorm}){t.forEach(s=>{let r=1;s.matches.forEach(({key:n,norm:i,score:u})=>{const c=n?n.weight:null;r*=Math.pow(u===0&&c?Number.EPSILON:u,(c||1)*(e?1:i))}),s.score=r})}function Ve(t,e){const s=t.matches;e.matches=[],E(s)&&s.forEach(r=>{if(!E(r.indices)||!r.indices.length)return;const{indices:n,value:i}=r;let u={indices:n,value:i};r.key&&(u.key=r.key.src),r.idx>-1&&(u.refIndex=r.idx),e.matches.push(u)})}function Qe(t,e){e.score=t.score}function Je(t,e,{includeMatches:s=l.includeMatches,includeScore:r=l.includeScore}={}){const n=[];return s&&n.push(Ve),r&&n.push(Qe),t.map(i=>{const{idx:u}=i,c={item:e[u],refIndex:u};return n.length&&n.forEach(h=>{h(i,c)}),c})}class k{constructor(e,s={},r){this.options={...l,...s},this.options.useExtendedSearch,this._keyStore=new Me(this.options.keys),this.setCollection(e,r)}setCollection(e,s){if(this._docs=e,s&&!(s instanceof V))throw new Error(Ae);this._myIndex=s||ie(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){E(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const s=[];for(let r=0,n=this._docs.length;r<n;r+=1){const i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,n-=1,s.push(i))}return s}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:s=-1}={}){const{includeMatches:r,includeScore:n,shouldSort:i,sortFn:u,ignoreFieldNorm:c}=this.options;let h=F(e)?F(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Ye(h,{ignoreFieldNorm:c}),i&&h.sort(u),te(s)&&s>-1&&(h=h.slice(0,s)),Je(h,this._docs,{includeMatches:r,includeScore:n})}_searchStringList(e){const s=G(e,this.options),{records:r}=this._myIndex,n=[];return r.forEach(({v:i,i:u,n:c})=>{if(!E(i))return;const{isMatch:h,score:o,indices:a}=s.searchIn(i);h&&n.push({item:i,idx:u,matches:[{score:o,value:i,norm:c,indices:a}]})}),n}_searchLogical(e){const s=he(e,this.options),r=(c,h,o)=>{if(!c.children){const{keyId:f,searcher:d}=c,g=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(h,f),searcher:d});return g&&g.length?[{idx:o,item:h,matches:g}]:[]}const a=[];for(let f=0,d=c.children.length;f<d;f+=1){const g=c.children[f],A=r(g,h,o);if(A.length)a.push(...A);else if(c.operator===v.AND)return[]}return a},n=this._myIndex.records,i={},u=[];return n.forEach(({$:c,i:h})=>{if(E(c)){let o=r(s,c,h);o.length&&(i[h]||(i[h]={idx:h,item:c,matches:[]},u.push(i[h])),o.forEach(({matches:a})=>{i[h].matches.push(...a)}))}}),u}_searchObjectList(e){const s=G(e,this.options),{keys:r,records:n}=this._myIndex,i=[];return n.forEach(({$:u,i:c})=>{if(!E(u))return;let h=[];r.forEach((o,a)=>{h.push(...this._findMatches({key:o,value:u[a],searcher:s}))}),h.length&&i.push({idx:c,item:u,matches:h})}),i}_findMatches({key:e,value:s,searcher:r}){if(!E(s))return[];let n=[];if(D(s))s.forEach(({v:i,i:u,n:c})=>{if(!E(i))return;const{isMatch:h,score:o,indices:a}=r.searchIn(i);h&&n.push({score:o,key:e,value:i,idx:u,norm:c,indices:a})});else{const{v:i,n:u}=s,{isMatch:c,score:h,indices:o}=r.searchIn(i);c&&n.push({score:h,key:e,value:i,norm:u,indices:o})}return n}}k.version="7.1.0";k.createIndex=ie;k.parseIndex=Se;k.config=l;k.parseQuery=he;ze(We);const Ue=({data:t,filter:e,sort:s})=>{const r=b.useMemo(()=>{let o=t;return e!=null&&(o=o.filter(a=>e(a,{}))),s!=null&&(o=[...o].sort(s)),o},[t,e,s]),n=b.useMemo(()=>r.length===0?null:new k(r,{keys:Object.keys(r[0]),threshold:.3}),[r]),[i,u]=b.useState({}),c=b.useCallback((o=>{if(Array.isArray(o)){const a=new Set(o);return r.filter(f=>a.has(f.key))}return r.find(a=>a.key===o)}),[r]),h=b.useMemo(()=>{let o=r;i.searchTerm!=null&&i.searchTerm.length>0&&n!=null&&(o=n.search(i.searchTerm).map(d=>d.item),s!=null&&(o=[...o].sort(s)));const a=o.map(f=>f.key);return{getItem:c,data:a}},[r,i,c,n,s]);return b.useMemo(()=>({...h,retrieve:u}),[h,u])};exports.useStaticData=Ue;