@elaraai/e3-ui 1.0.86 → 1.0.87

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 (385) hide show
  1. package/dist/src/bind/data-indexed.d.ts +159 -0
  2. package/dist/src/bind/data-indexed.d.ts.map +1 -0
  3. package/dist/src/bind/data-indexed.js +105 -0
  4. package/dist/src/bind/data-indexed.js.map +1 -0
  5. package/dist/src/bind/data.d.ts +5 -3
  6. package/dist/src/bind/data.d.ts.map +1 -1
  7. package/dist/src/bind/data.js +6 -0
  8. package/dist/src/bind/data.js.map +1 -1
  9. package/dist/src/bind/record.d.ts +34 -23
  10. package/dist/src/bind/record.d.ts.map +1 -1
  11. package/dist/src/bind/record.js +46 -19
  12. package/dist/src/bind/record.js.map +1 -1
  13. package/dist/src/calendar/index.d.ts +2923 -0
  14. package/dist/src/calendar/index.d.ts.map +1 -0
  15. package/dist/src/calendar/index.js +135 -0
  16. package/dist/src/calendar/index.js.map +1 -0
  17. package/dist/src/decision/queue.d.ts +3 -3
  18. package/dist/src/decision/queue.d.ts.map +1 -1
  19. package/dist/src/decision/queue.js +2 -2
  20. package/dist/src/decision/queue.js.map +1 -1
  21. package/dist/src/decision/types.d.ts +4 -0
  22. package/dist/src/decision/types.d.ts.map +1 -1
  23. package/dist/src/decision/types.js +4 -0
  24. package/dist/src/decision/types.js.map +1 -1
  25. package/dist/src/flowchart/canvas.d.ts +114 -0
  26. package/dist/src/flowchart/canvas.d.ts.map +1 -0
  27. package/dist/src/flowchart/canvas.js +84 -0
  28. package/dist/src/flowchart/canvas.js.map +1 -0
  29. package/dist/src/flowchart/flowchart.d.ts +79 -0
  30. package/dist/src/flowchart/flowchart.d.ts.map +1 -0
  31. package/dist/src/flowchart/flowchart.js +9 -0
  32. package/dist/src/flowchart/flowchart.js.map +1 -0
  33. package/dist/src/flowchart/index.d.ts +305 -0
  34. package/dist/src/flowchart/index.d.ts.map +1 -0
  35. package/dist/src/flowchart/index.js +267 -0
  36. package/dist/src/flowchart/index.js.map +1 -0
  37. package/dist/src/flowchart/library.d.ts +720 -0
  38. package/dist/src/flowchart/library.d.ts.map +1 -0
  39. package/dist/src/flowchart/library.js +611 -0
  40. package/dist/src/flowchart/library.js.map +1 -0
  41. package/dist/src/flowchart/over.d.ts +234 -0
  42. package/dist/src/flowchart/over.d.ts.map +1 -0
  43. package/dist/src/flowchart/over.js +220 -0
  44. package/dist/src/flowchart/over.js.map +1 -0
  45. package/dist/src/flowchart/patch.d.ts +64 -0
  46. package/dist/src/flowchart/patch.d.ts.map +1 -0
  47. package/dist/src/flowchart/patch.js +67 -0
  48. package/dist/src/flowchart/patch.js.map +1 -0
  49. package/dist/src/flowchart/payload.d.ts +8220 -0
  50. package/dist/src/flowchart/payload.d.ts.map +1 -0
  51. package/dist/src/flowchart/payload.js +521 -0
  52. package/dist/src/flowchart/payload.js.map +1 -0
  53. package/dist/src/flowchart/types.d.ts +393 -0
  54. package/dist/src/flowchart/types.d.ts.map +1 -0
  55. package/dist/src/flowchart/types.js +216 -0
  56. package/dist/src/flowchart/types.js.map +1 -0
  57. package/dist/src/flowchart/values.d.ts +267 -0
  58. package/dist/src/flowchart/values.d.ts.map +1 -0
  59. package/dist/src/flowchart/values.js +216 -0
  60. package/dist/src/flowchart/values.js.map +1 -0
  61. package/dist/src/flowchart/window.d.ts +521 -0
  62. package/dist/src/flowchart/window.d.ts.map +1 -0
  63. package/dist/src/flowchart/window.js +69 -0
  64. package/dist/src/flowchart/window.js.map +1 -0
  65. package/dist/src/index.d.ts +25 -1
  66. package/dist/src/index.d.ts.map +1 -1
  67. package/dist/src/index.js +48 -1
  68. package/dist/src/index.js.map +1 -1
  69. package/dist/src/internal.d.ts +35 -3
  70. package/dist/src/internal.d.ts.map +1 -1
  71. package/dist/src/internal.js +72 -3
  72. package/dist/src/internal.js.map +1 -1
  73. package/dist/src/plan/assemble.d.ts +2224 -0
  74. package/dist/src/plan/assemble.d.ts.map +1 -0
  75. package/dist/src/plan/assemble.js +210 -0
  76. package/dist/src/plan/assemble.js.map +1 -0
  77. package/dist/src/plan/builders.d.ts +790 -0
  78. package/dist/src/plan/builders.d.ts.map +1 -0
  79. package/dist/src/plan/builders.js +749 -0
  80. package/dist/src/plan/builders.js.map +1 -0
  81. package/dist/src/plan/event-rows.d.ts +2565 -0
  82. package/dist/src/plan/event-rows.d.ts.map +1 -0
  83. package/dist/src/plan/event-rows.js +689 -0
  84. package/dist/src/plan/event-rows.js.map +1 -0
  85. package/dist/src/plan/factories.d.ts +458 -0
  86. package/dist/src/plan/factories.d.ts.map +1 -0
  87. package/dist/src/plan/factories.js +484 -0
  88. package/dist/src/plan/factories.js.map +1 -0
  89. package/dist/src/plan/index.d.ts +672 -0
  90. package/dist/src/plan/index.d.ts.map +1 -0
  91. package/dist/src/plan/index.js +532 -0
  92. package/dist/src/plan/index.js.map +1 -0
  93. package/dist/src/plan/ir.d.ts +2594 -0
  94. package/dist/src/plan/ir.d.ts.map +1 -0
  95. package/dist/src/plan/ir.js +78 -0
  96. package/dist/src/plan/ir.js.map +1 -0
  97. package/dist/src/plan/library.d.ts +772 -0
  98. package/dist/src/plan/library.d.ts.map +1 -0
  99. package/dist/src/plan/library.js +424 -0
  100. package/dist/src/plan/library.js.map +1 -0
  101. package/dist/src/plan/ordered-source.d.ts +27 -0
  102. package/dist/src/plan/ordered-source.d.ts.map +1 -0
  103. package/dist/src/plan/ordered-source.js +48 -0
  104. package/dist/src/plan/ordered-source.js.map +1 -0
  105. package/dist/src/plan/over.d.ts +247 -0
  106. package/dist/src/plan/over.d.ts.map +1 -0
  107. package/dist/src/plan/over.js +266 -0
  108. package/dist/src/plan/over.js.map +1 -0
  109. package/dist/src/plan/pick.d.ts +78 -0
  110. package/dist/src/plan/pick.d.ts.map +1 -0
  111. package/dist/src/plan/pick.js +146 -0
  112. package/dist/src/plan/pick.js.map +1 -0
  113. package/dist/src/plan/plan.d.ts +11611 -0
  114. package/dist/src/plan/plan.d.ts.map +1 -0
  115. package/dist/src/plan/plan.js +428 -0
  116. package/dist/src/plan/plan.js.map +1 -0
  117. package/dist/src/plan/refs.d.ts +218 -0
  118. package/dist/src/plan/refs.d.ts.map +1 -0
  119. package/dist/src/plan/refs.js +226 -0
  120. package/dist/src/plan/refs.js.map +1 -0
  121. package/dist/src/plan/root.d.ts +290 -0
  122. package/dist/src/plan/root.d.ts.map +1 -0
  123. package/dist/src/plan/root.js +463 -0
  124. package/dist/src/plan/root.js.map +1 -0
  125. package/dist/src/plan/series.d.ts +13554 -0
  126. package/dist/src/plan/series.d.ts.map +1 -0
  127. package/dist/src/plan/series.js +1921 -0
  128. package/dist/src/plan/series.js.map +1 -0
  129. package/dist/src/plan/types.d.ts +12400 -0
  130. package/dist/src/plan/types.d.ts.map +1 -0
  131. package/dist/src/plan/types.js +1335 -0
  132. package/dist/src/plan/types.js.map +1 -0
  133. package/dist/src/roster/coverage.d.ts +240 -0
  134. package/dist/src/roster/coverage.d.ts.map +1 -0
  135. package/dist/src/roster/coverage.js +109 -0
  136. package/dist/src/roster/coverage.js.map +1 -0
  137. package/dist/src/roster/index.d.ts +4028 -0
  138. package/dist/src/roster/index.d.ts.map +1 -0
  139. package/dist/src/roster/index.js +115 -0
  140. package/dist/src/roster/index.js.map +1 -0
  141. package/dist/src/roster/library.d.ts +106 -0
  142. package/dist/src/roster/library.d.ts.map +1 -0
  143. package/dist/src/roster/library.js +78 -0
  144. package/dist/src/roster/library.js.map +1 -0
  145. package/dist/src/roster/people.d.ts +50 -0
  146. package/dist/src/roster/people.d.ts.map +1 -0
  147. package/dist/src/roster/people.js +32 -0
  148. package/dist/src/roster/people.js.map +1 -0
  149. package/dist/src/roster/rules.d.ts +275 -0
  150. package/dist/src/roster/rules.d.ts.map +1 -0
  151. package/dist/src/roster/rules.js +162 -0
  152. package/dist/src/roster/rules.js.map +1 -0
  153. package/dist/src/roster/types.d.ts +672 -0
  154. package/dist/src/roster/types.d.ts.map +1 -0
  155. package/dist/src/roster/types.js +248 -0
  156. package/dist/src/roster/types.js.map +1 -0
  157. package/dist/src/roster/visibility.d.ts +66 -0
  158. package/dist/src/roster/visibility.d.ts.map +1 -0
  159. package/dist/src/roster/visibility.js +25 -0
  160. package/dist/src/roster/visibility.js.map +1 -0
  161. package/dist/src/schedule/days.d.ts +54 -0
  162. package/dist/src/schedule/days.d.ts.map +1 -0
  163. package/dist/src/schedule/days.js +68 -0
  164. package/dist/src/schedule/days.js.map +1 -0
  165. package/dist/src/schedule/events.d.ts +433 -0
  166. package/dist/src/schedule/events.d.ts.map +1 -0
  167. package/dist/src/schedule/events.js +851 -0
  168. package/dist/src/schedule/events.js.map +1 -0
  169. package/dist/src/schedule/index.d.ts +150 -0
  170. package/dist/src/schedule/index.d.ts.map +1 -0
  171. package/dist/src/schedule/index.js +132 -0
  172. package/dist/src/schedule/index.js.map +1 -0
  173. package/dist/src/schedule/library.d.ts +70 -0
  174. package/dist/src/schedule/library.d.ts.map +1 -0
  175. package/dist/src/schedule/library.js +102 -0
  176. package/dist/src/schedule/library.js.map +1 -0
  177. package/dist/src/schedule/patch.d.ts +74 -0
  178. package/dist/src/schedule/patch.d.ts.map +1 -0
  179. package/dist/src/schedule/patch.js +68 -0
  180. package/dist/src/schedule/patch.js.map +1 -0
  181. package/dist/src/schedule/record-window.d.ts +189 -0
  182. package/dist/src/schedule/record-window.d.ts.map +1 -0
  183. package/dist/src/schedule/record-window.js +95 -0
  184. package/dist/src/schedule/record-window.js.map +1 -0
  185. package/dist/src/schedule/resources.d.ts +165 -0
  186. package/dist/src/schedule/resources.d.ts.map +1 -0
  187. package/dist/src/schedule/resources.js +234 -0
  188. package/dist/src/schedule/resources.js.map +1 -0
  189. package/dist/src/schedule/templates.d.ts +47 -0
  190. package/dist/src/schedule/templates.d.ts.map +1 -0
  191. package/dist/src/schedule/templates.js +61 -0
  192. package/dist/src/schedule/templates.js.map +1 -0
  193. package/dist/src/schedule/types.d.ts +1677 -0
  194. package/dist/src/schedule/types.d.ts.map +1 -0
  195. package/dist/src/schedule/types.js +374 -0
  196. package/dist/src/schedule/types.js.map +1 -0
  197. package/dist/src/schedule/window.d.ts +154 -0
  198. package/dist/src/schedule/window.d.ts.map +1 -0
  199. package/dist/src/schedule/window.js +363 -0
  200. package/dist/src/schedule/window.js.map +1 -0
  201. package/dist/src/sheet/bridge.d.ts +385 -0
  202. package/dist/src/sheet/bridge.d.ts.map +1 -0
  203. package/dist/src/sheet/bridge.js +809 -0
  204. package/dist/src/sheet/bridge.js.map +1 -0
  205. package/dist/src/sheet/columns.d.ts +410 -0
  206. package/dist/src/sheet/columns.d.ts.map +1 -0
  207. package/dist/src/sheet/columns.js +99 -0
  208. package/dist/src/sheet/columns.js.map +1 -0
  209. package/dist/src/sheet/context-bridge.d.ts +48 -0
  210. package/dist/src/sheet/context-bridge.d.ts.map +1 -0
  211. package/dist/src/sheet/context-bridge.js +216 -0
  212. package/dist/src/sheet/context-bridge.js.map +1 -0
  213. package/dist/src/sheet/draft-bridge.d.ts +37 -0
  214. package/dist/src/sheet/draft-bridge.d.ts.map +1 -0
  215. package/dist/src/sheet/draft-bridge.js +153 -0
  216. package/dist/src/sheet/draft-bridge.js.map +1 -0
  217. package/dist/src/sheet/drafts.d.ts +14 -0
  218. package/dist/src/sheet/drafts.d.ts.map +1 -0
  219. package/dist/src/sheet/drafts.js +14 -0
  220. package/dist/src/sheet/drafts.js.map +1 -0
  221. package/dist/src/sheet/editing-bridge.d.ts +40 -0
  222. package/dist/src/sheet/editing-bridge.d.ts.map +1 -0
  223. package/dist/src/sheet/editing-bridge.js +231 -0
  224. package/dist/src/sheet/editing-bridge.js.map +1 -0
  225. package/dist/src/sheet/editing-types.d.ts +268 -0
  226. package/dist/src/sheet/editing-types.d.ts.map +1 -0
  227. package/dist/src/sheet/editing-types.js +34 -0
  228. package/dist/src/sheet/editing-types.js.map +1 -0
  229. package/dist/src/sheet/edits.d.ts +37 -0
  230. package/dist/src/sheet/edits.d.ts.map +1 -0
  231. package/dist/src/sheet/edits.js +31 -0
  232. package/dist/src/sheet/edits.js.map +1 -0
  233. package/dist/src/sheet/fields.d.ts +693 -0
  234. package/dist/src/sheet/fields.d.ts.map +1 -0
  235. package/dist/src/sheet/fields.js +280 -0
  236. package/dist/src/sheet/fields.js.map +1 -0
  237. package/dist/src/sheet/group.d.ts +165 -0
  238. package/dist/src/sheet/group.d.ts.map +1 -0
  239. package/dist/src/sheet/group.js +52 -0
  240. package/dist/src/sheet/group.js.map +1 -0
  241. package/dist/src/sheet/index.d.ts +542 -0
  242. package/dist/src/sheet/index.d.ts.map +1 -0
  243. package/dist/src/sheet/index.js +387 -0
  244. package/dist/src/sheet/index.js.map +1 -0
  245. package/dist/src/sheet/library.d.ts +284 -0
  246. package/dist/src/sheet/library.d.ts.map +1 -0
  247. package/dist/src/sheet/library.js +259 -0
  248. package/dist/src/sheet/library.js.map +1 -0
  249. package/dist/src/sheet/link.d.ts +398 -0
  250. package/dist/src/sheet/link.d.ts.map +1 -0
  251. package/dist/src/sheet/link.js +228 -0
  252. package/dist/src/sheet/link.js.map +1 -0
  253. package/dist/src/sheet/record.d.ts +75 -0
  254. package/dist/src/sheet/record.d.ts.map +1 -0
  255. package/dist/src/sheet/record.js +128 -0
  256. package/dist/src/sheet/record.js.map +1 -0
  257. package/dist/src/sheet/registers.d.ts +681 -0
  258. package/dist/src/sheet/registers.d.ts.map +1 -0
  259. package/dist/src/sheet/registers.js +671 -0
  260. package/dist/src/sheet/registers.js.map +1 -0
  261. package/dist/src/sheet/root.d.ts +329 -0
  262. package/dist/src/sheet/root.d.ts.map +1 -0
  263. package/dist/src/sheet/root.js +511 -0
  264. package/dist/src/sheet/root.js.map +1 -0
  265. package/dist/src/sheet/seed-bridge.d.ts +14 -0
  266. package/dist/src/sheet/seed-bridge.d.ts.map +1 -0
  267. package/dist/src/sheet/seed-bridge.js +51 -0
  268. package/dist/src/sheet/seed-bridge.js.map +1 -0
  269. package/dist/src/sheet/sheet.d.ts +11819 -0
  270. package/dist/src/sheet/sheet.d.ts.map +1 -0
  271. package/dist/src/sheet/sheet.js +236 -0
  272. package/dist/src/sheet/sheet.js.map +1 -0
  273. package/dist/src/sheet/sub-rows.d.ts +299 -0
  274. package/dist/src/sheet/sub-rows.d.ts.map +1 -0
  275. package/dist/src/sheet/sub-rows.js +272 -0
  276. package/dist/src/sheet/sub-rows.js.map +1 -0
  277. package/dist/src/sheet/templates.d.ts +161 -0
  278. package/dist/src/sheet/templates.d.ts.map +1 -0
  279. package/dist/src/sheet/templates.js +122 -0
  280. package/dist/src/sheet/templates.js.map +1 -0
  281. package/dist/src/sheet/transactions.d.ts +76 -0
  282. package/dist/src/sheet/transactions.d.ts.map +1 -0
  283. package/dist/src/sheet/transactions.js +40 -0
  284. package/dist/src/sheet/transactions.js.map +1 -0
  285. package/dist/src/sheet/types.d.ts +15226 -0
  286. package/dist/src/sheet/types.d.ts.map +1 -0
  287. package/dist/src/sheet/types.js +1070 -0
  288. package/dist/src/sheet/types.js.map +1 -0
  289. package/dist/src/sheet/views.d.ts +29 -0
  290. package/dist/src/sheet/views.d.ts.map +1 -0
  291. package/dist/src/sheet/views.js +43 -0
  292. package/dist/src/sheet/views.js.map +1 -0
  293. package/dist/src/studio/component.d.ts.map +1 -1
  294. package/dist/src/studio/component.js +11 -8
  295. package/dist/src/studio/component.js.map +1 -1
  296. package/dist/src/utils/derive.d.ts +134 -8
  297. package/dist/src/utils/derive.d.ts.map +1 -1
  298. package/dist/src/utils/derive.js +409 -7
  299. package/dist/src/utils/derive.js.map +1 -1
  300. package/dist/src/utils/ordered-source.d.ts +38 -0
  301. package/dist/src/utils/ordered-source.d.ts.map +1 -0
  302. package/dist/src/utils/ordered-source.js +45 -0
  303. package/dist/src/utils/ordered-source.js.map +1 -0
  304. package/dist/src/utils/row-inspector.d.ts +36 -0
  305. package/dist/src/utils/row-inspector.d.ts.map +1 -0
  306. package/dist/src/utils/row-inspector.js +49 -0
  307. package/dist/src/utils/row-inspector.js.map +1 -0
  308. package/dist/test/bind/data/data.examples.d.ts +21 -19
  309. package/dist/test/bind/data/data.examples.d.ts.map +1 -1
  310. package/dist/test/bind/data/data.examples.js +122 -122
  311. package/dist/test/bind/data/data.examples.js.map +1 -1
  312. package/dist/test/bind/record/record.examples.d.ts.map +1 -1
  313. package/dist/test/bind/record/record.examples.js +9 -9
  314. package/dist/test/bind/record/record.examples.js.map +1 -1
  315. package/dist/test/calendar/calendar-records.examples.d.ts +228 -0
  316. package/dist/test/calendar/calendar-records.examples.d.ts.map +1 -0
  317. package/dist/test/calendar/calendar-records.examples.js +91 -0
  318. package/dist/test/calendar/calendar-records.examples.js.map +1 -0
  319. package/dist/test/calendar/calendar.examples.d.ts +776 -0
  320. package/dist/test/calendar/calendar.examples.d.ts.map +1 -0
  321. package/dist/test/calendar/calendar.examples.js +336 -0
  322. package/dist/test/calendar/calendar.examples.js.map +1 -0
  323. package/dist/test/decision/journal.examples.d.ts +28 -28
  324. package/dist/test/decision/journal.examples.d.ts.map +1 -1
  325. package/dist/test/decision/journal.examples.js +4 -4
  326. package/dist/test/decision/journal.examples.js.map +1 -1
  327. package/dist/test/decision/queue.examples.d.ts.map +1 -1
  328. package/dist/test/decision/queue.examples.js +5 -7
  329. package/dist/test/decision/queue.examples.js.map +1 -1
  330. package/dist/test/flowchart/flowchart.examples.d.ts +3713 -0
  331. package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -0
  332. package/dist/test/flowchart/flowchart.examples.js +465 -0
  333. package/dist/test/flowchart/flowchart.examples.js.map +1 -0
  334. package/dist/test/plan/plan-events.examples.d.ts +3666 -0
  335. package/dist/test/plan/plan-events.examples.d.ts.map +1 -0
  336. package/dist/test/plan/plan-events.examples.js +773 -0
  337. package/dist/test/plan/plan-events.examples.js.map +1 -0
  338. package/dist/test/plan/plan-records.examples.d.ts +3 -0
  339. package/dist/test/plan/plan-records.examples.d.ts.map +1 -0
  340. package/dist/test/plan/plan-records.examples.js +45 -0
  341. package/dist/test/plan/plan-records.examples.js.map +1 -0
  342. package/dist/test/plan/plan-windows.examples.d.ts +588 -0
  343. package/dist/test/plan/plan-windows.examples.d.ts.map +1 -0
  344. package/dist/test/plan/plan-windows.examples.js +170 -0
  345. package/dist/test/plan/plan-windows.examples.js.map +1 -0
  346. package/dist/test/plan/plan.examples.d.ts +8095 -0
  347. package/dist/test/plan/plan.examples.d.ts.map +1 -0
  348. package/dist/test/plan/plan.examples.js +2500 -0
  349. package/dist/test/plan/plan.examples.js.map +1 -0
  350. package/dist/test/roster/domain.examples.d.ts +367 -0
  351. package/dist/test/roster/domain.examples.d.ts.map +1 -0
  352. package/dist/test/roster/domain.examples.js +72 -0
  353. package/dist/test/roster/domain.examples.js.map +1 -0
  354. package/dist/test/roster/roster-records.examples.d.ts +729 -0
  355. package/dist/test/roster/roster-records.examples.d.ts.map +1 -0
  356. package/dist/test/roster/roster-records.examples.js +86 -0
  357. package/dist/test/roster/roster-records.examples.js.map +1 -0
  358. package/dist/test/roster/roster.examples.d.ts +750 -0
  359. package/dist/test/roster/roster.examples.d.ts.map +1 -0
  360. package/dist/test/roster/roster.examples.js +198 -0
  361. package/dist/test/roster/roster.examples.js.map +1 -0
  362. package/dist/test/roster/warehouse.d.ts +87 -0
  363. package/dist/test/roster/warehouse.d.ts.map +1 -0
  364. package/dist/test/roster/warehouse.js +883 -0
  365. package/dist/test/roster/warehouse.js.map +1 -0
  366. package/dist/test/sheet/sheet-link.examples.d.ts +7 -0
  367. package/dist/test/sheet/sheet-link.examples.d.ts.map +1 -0
  368. package/dist/test/sheet/sheet-link.examples.js +41 -0
  369. package/dist/test/sheet/sheet-link.examples.js.map +1 -0
  370. package/dist/test/sheet/sheet-records.examples.d.ts +421 -0
  371. package/dist/test/sheet/sheet-records.examples.d.ts.map +1 -0
  372. package/dist/test/sheet/sheet-records.examples.js +79 -0
  373. package/dist/test/sheet/sheet-records.examples.js.map +1 -0
  374. package/dist/test/sheet/sheet-transactions.examples.d.ts +7 -0
  375. package/dist/test/sheet/sheet-transactions.examples.d.ts.map +1 -0
  376. package/dist/test/sheet/sheet-transactions.examples.js +58 -0
  377. package/dist/test/sheet/sheet-transactions.examples.js.map +1 -0
  378. package/dist/test/sheet/sheet.examples.d.ts +5562 -0
  379. package/dist/test/sheet/sheet.examples.d.ts.map +1 -0
  380. package/dist/test/sheet/sheet.examples.js +1178 -0
  381. package/dist/test/sheet/sheet.examples.js.map +1 -0
  382. package/dist/test/studio/studio.examples.d.ts.map +1 -1
  383. package/dist/test/studio/studio.examples.js +11 -11
  384. package/dist/test/studio/studio.examples.js.map +1 -1
  385. package/package.json +12 -9
@@ -0,0 +1,851 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * `Schedule.events(record, config)` (#1218, `Calendar Spec.md` §4.1): one
7
+ * event kind — shifts, jobs, inspections — a record of its own, bound with its
8
+ * patch mutation, each of its entries one event.
9
+ *
10
+ * Field names say what a gesture writes (`title`, `start`, `end`, `resource`,
11
+ * `status`), so a move, a resize or a drop writes the app's own fields; an
12
+ * accessor `(row, key) => …` gives what is not a field (a backlog row's
13
+ * duration and due date). Every name is checked against the record's row type
14
+ * at compile time, and again at build, naming itself.
15
+ *
16
+ * Plan's options sit beside the Calendar's (#1190, `Plan Builder Spec.md`
17
+ * §4.1): how the kind draws (`draw`), an instant kind's one time (`at`, in
18
+ * place of `start` and `end`), the fields its events' lifecycle, quantity
19
+ * and lane are read from (`state`, `quantity`, `lane`), whether two of its
20
+ * events on one resource at once are a conflict (`overlaps`), and the kind's
21
+ * own inspector for one event (`inspector`, #1197).
22
+ *
23
+ * The kind closes the record behind East functions over beast2 bytes
24
+ * ({@link ScheduleKindType}): its events over a window and its backlog, each
25
+ * with the drafts in place; a gesture written into an entry; the author's
26
+ * readiness check; the shared editing session over the record, which commits
27
+ * each Save through its patch mutation (`Record.onApply(record, { keyed:
28
+ * true })`); and its history. A builder's payload is one type whatever the
29
+ * records hold, and the renderer never needs a row type.
30
+ *
31
+ * A record Slice reads overlap queries through its declared interval indexes
32
+ * (`slice: Slice.bindRecord(...)`, with `range` naming the start field).
33
+ * It shares the toolbar's filters and window, counts original events once,
34
+ * and reads backlog through the same choices with an Unset start. It requires
35
+ * `entries` for original-key inspection and Save. Existing drafts outside a
36
+ * new narrowing remain in the session; Save includes them. Do not combine
37
+ * this with a local `filter`, `window`, or `backlogWindow`.
38
+ *
39
+ * A large record may also be read a window at a time (#1199, `window.ts`): given
40
+ * `window`, a paged read of a day index keyed by `Schedule.days`, the kind's
41
+ * events over a window are the rows the index files under the days in view,
42
+ * and given `backlogWindow`, a paged read of an index keyed by
43
+ * `Schedule.unscheduled`, its backlog is the rows that index holds — the
44
+ * record never read whole by either, the drafts in place over them as over the
45
+ * whole record. A kind read through its day index whose times are Options
46
+ * reads its backlog through its backlog index too, and every kind given
47
+ * `window` reads one event by its key through `entries`, a paged read of the
48
+ * record's own entries: the inspector's event (`planEvent`, which looks first
49
+ * among the rows the windows hold, where a gesture's event is drawn), and its
50
+ * editing session's, which is a session over the record's revision rather
51
+ * than its snapshot — its drafts held by key, each checked by the record
52
+ * against what it began from, and a Save's entries read back by key. It builds
53
+ * two ways:
54
+ * `build(slot)` is the Calendar's kind, which takes no notice of Plan's
55
+ * options, and `buildPlan(slot)` Plan's ({@link PlanEventKindType}), the same
56
+ * kind with how it draws, its roles, and its events as Plan draws them.
57
+ *
58
+ * A record may be keyed by any type: an event is named by its key's text, a
59
+ * String key as it is, any other key as East prints it.
60
+ *
61
+ * @packageDocumentation
62
+ */
63
+ import { ArrayType, BlobType, BooleanType, DateTimeType, DictType, East, Expr, FloatType, IntegerType, OptionType, StringType, StructType, isTypeEqual, none, printType, some, toEastTypeValue, variant, } from "@elaraai/east";
64
+ import { EventStateType } from "@elaraai/east-ui";
65
+ import { EditingApplyResultType, EditingChangeSetTypeFor, EditingDraftFieldType, EditingReadinessType, EditingType, EditingWireApplyType, Fields, FieldSpecType, TickFormatType, } from "@elaraai/east-ui/internal";
66
+ import { Record } from "../bind/record.js";
67
+ import { RowInspectorType, rowInspector } from "../utils/row-inspector.js";
68
+ import { SCHEDULE_TEMPLATES, checkedTemplates } from "./templates.js";
69
+ import { SCHEDULE_DEF } from "./resources.js";
70
+ import { scheduleRecordWindow } from "./record-window.js";
71
+ import { checkEntries, checkIndexWindow, scheduleBacklogWindow, scheduleDayWindow, scheduleEntryByKey, scheduleLastKey } from "./window.js";
72
+ import { PlanEventItemType, PlanEventKindType, PlanEventReadType, ScheduleClockType, ScheduleDraftsType, ScheduleDurationType, ScheduleEntriesType, ScheduleItemType, ScheduleKindType, ScheduleReadyEntryType, ScheduleResourceRefType, ScheduleStatusCasesFor, ScheduleStatusType, ScheduleWriteType, ScheduleTemplateType, ScheduleReadType, } from "./types.js";
73
+ // ============================================================================
74
+ // Reading East types
75
+ // ============================================================================
76
+ /** Whether a type is an Option, and of what. */
77
+ function optionOf(type) {
78
+ if (type.type !== "Variant")
79
+ return undefined;
80
+ const some = type.cases["some"];
81
+ return some !== undefined && isTypeEqual(type, OptionType(some)) ? some : undefined;
82
+ }
83
+ /** A variant's cases, when every one of them holds a String. */
84
+ function stringCases(type) {
85
+ if (type.type !== "Variant" || optionOf(type) !== undefined)
86
+ return undefined;
87
+ const cases = Object.entries(type.cases);
88
+ return cases.length > 0 && cases.every(([, t]) => isTypeEqual(t, StringType)) ? cases.map(([c]) => c) : undefined;
89
+ }
90
+ /** A field of a struct as an East expression, by name. */
91
+ function fieldOf(row, name) {
92
+ return row[name];
93
+ }
94
+ /** A type as the refusals name it: an Option as an Option of what it holds. */
95
+ function typeText(type) {
96
+ const inner = optionOf(type);
97
+ return inner === undefined ? printType(type) : `an Option of ${printType(inner)}`;
98
+ }
99
+ /** The ways a kind draws. */
100
+ const DRAWS = ["span", "buckets", "cards", "marks"];
101
+ export function scheduleEvents(record, input) {
102
+ const config = input;
103
+ const where = `Schedule.events: "${config.name}"`;
104
+ const handle = record;
105
+ const handleType = Expr.type(record);
106
+ const read = handleType.type === "Struct" ? handleType.fields["read"] : undefined;
107
+ if (handleType.type !== "Struct" || read === undefined || read.type !== "Function"
108
+ || handleType.fields["binding"] === undefined) {
109
+ throw new Error(`${where}: \`record\` is a record bound with its patch mutation — Record.bind(record, [e3.mutation.patch(record)])`);
110
+ }
111
+ const recordType = read.output;
112
+ if (recordType.type !== "Dict" || recordType.value.type !== "Struct") {
113
+ throw new Error(`${where}: an event kind's record holds its events by key, each a struct — a Dict of row structs, and this one holds ${typeText(recordType)}`);
114
+ }
115
+ const keyType = recordType.key;
116
+ const rowType = recordType.value;
117
+ const fields = rowType.fields;
118
+ const fieldType = (prop, name) => {
119
+ const type = fields[name];
120
+ if (type === undefined)
121
+ throw new Error(`${where}: \`${prop}\` names "${name}", a field the row does not have (${Object.keys(fields).join(", ")})`);
122
+ return type;
123
+ };
124
+ // The title.
125
+ if (!isTypeEqual(fieldType("title", config.title), StringType)) {
126
+ throw new Error(`${where}: \`title\` names a String field — "${config.title}" holds ${typeText(fields[config.title])}`);
127
+ }
128
+ // The times: `start` and `end`, DateTime or Options of DateTime alike; or an instant kind's `at`, in their place.
129
+ const instantKind = config.at !== undefined;
130
+ if (instantKind && (config.start !== undefined || config.end !== undefined)) {
131
+ throw new Error(`${where}: \`at\` is an instant kind's one time, in place of \`start\` and \`end\` — give one or the other`);
132
+ }
133
+ if (!instantKind && (config.start === undefined || config.end === undefined)) {
134
+ throw new Error(`${where}: an event kind runs from \`start\` to \`end\` — DateTime fields, or Options of one — or is one instant, \`at\``);
135
+ }
136
+ let startField;
137
+ let endField;
138
+ if (instantKind) {
139
+ const atType = fieldType("at", config.at);
140
+ if (!isTypeEqual(atType, DateTimeType)) {
141
+ throw new Error(`${where}: \`at\` names a DateTime field, an instant kind's one time — "${config.at}" holds ${typeText(atType)}`);
142
+ }
143
+ startField = config.at;
144
+ endField = config.at;
145
+ }
146
+ else {
147
+ startField = config.start;
148
+ endField = config.end;
149
+ const startType = fieldType("start", startField);
150
+ const endType = fieldType("end", endField);
151
+ const isInstant = (t) => isTypeEqual(t, DateTimeType) || isTypeEqual(t, OptionType(DateTimeType));
152
+ for (const [prop, name, type] of [["start", startField, startType], ["end", endField, endType]]) {
153
+ if (!isInstant(type))
154
+ throw new Error(`${where}: \`${prop}\` names a DateTime field, or an Option of one — "${name}" holds ${typeText(type)}`);
155
+ }
156
+ if (!isTypeEqual(startType, endType)) {
157
+ throw new Error(`${where}: \`start\` and \`end\` are both DateTime fields, or both Options of one — "${startField}" holds ${typeText(startType)} and "${endField}" ${typeText(endType)}`);
158
+ }
159
+ }
160
+ const optional = optionOf(fields[startField]) !== undefined;
161
+ if (config.backlog !== undefined && !optional) {
162
+ throw new Error(instantKind
163
+ ? `${where}: \`backlog\` is a kind's rows with no time, and an instant kind's \`at\` is a plain DateTime field — it has none`
164
+ : `${where}: \`backlog\` is a kind's rows with no time, and its times are plain DateTime fields — make \`start\` and \`end\` Options for a backlog`);
165
+ }
166
+ let resource;
167
+ if (config.resource !== undefined) {
168
+ const { field, of } = config.resource;
169
+ const type = fieldType("resource.field", field);
170
+ const inner = optionOf(type) ?? type;
171
+ const isOptional = optionOf(type) !== undefined;
172
+ const cases = stringCases(inner);
173
+ if (isTypeEqual(inner, StringType)) {
174
+ if (typeof of !== "string" || of === "") {
175
+ throw new Error(`${where}: \`resource.of\` names the resource slot "${field}" holds keys of — a String field holds one kind's keys`);
176
+ }
177
+ resource = { field, shape: "key", of, optional: isOptional };
178
+ }
179
+ else if (cases !== undefined) {
180
+ if (typeof of !== "object" || of === null) {
181
+ throw new Error(`${where}: "${field}" is a variant — \`resource.of\` names a resource slot per case: { ${cases.map((c) => `${c}: "…"`).join(", ")} }`);
182
+ }
183
+ const named = Object.keys(of);
184
+ if (named.length !== cases.length || !named.every((c) => cases.includes(c))) {
185
+ throw new Error(`${where}: \`resource.of\` names a resource slot for each of "${field}"'s cases (${cases.join(", ")}) — and it names ${named.join(", ") || "none"}`);
186
+ }
187
+ const kinds = Object.values(of);
188
+ if (new Set(kinds).size !== kinds.length) {
189
+ throw new Error(`${where}: \`resource.of\` names each resource slot once — a case per kind of resource — and it names ${kinds.join(", ")}`);
190
+ }
191
+ resource = { field, shape: "cases", of, cases, optional: isOptional, variant: inner };
192
+ }
193
+ else {
194
+ throw new Error(`${where}: \`resource.field\` names a field holding a resource's key — a String, a variant of String cases, or an Option of either — and "${field}" holds ${typeText(type)}`);
195
+ }
196
+ }
197
+ const takes = resource === undefined ? [] : resource.shape === "key" ? [resource.of] : Object.values(resource.of);
198
+ // The status: a variant, a Status per case.
199
+ let statusCases;
200
+ let statusTable;
201
+ if (config.status !== undefined) {
202
+ const type = fieldType("status.field", config.status.field);
203
+ if (type.type !== "Variant" || optionOf(type) !== undefined) {
204
+ throw new Error(`${where}: \`status.field\` names a variant field every event holds, a Status per case — "${config.status.field}" holds ${typeText(type)}`);
205
+ }
206
+ statusCases = Object.keys(type.cases);
207
+ statusTable = East.value(config.status.cases, ScheduleStatusCasesFor(type));
208
+ }
209
+ // Plan's: how the kind draws, its roles' fields, and whether its overlaps are a conflict.
210
+ const draw = config.draw ?? (instantKind ? "marks" : "span");
211
+ if (!DRAWS.includes(draw)) {
212
+ throw new Error(`${where}: \`draw\` is "span", "buckets", "cards" or "marks" — and it is "${draw}"`);
213
+ }
214
+ if (instantKind && (draw === "span" || draw === "cards")) {
215
+ throw new Error(`${where}: \`draw: "${draw}"\` draws an event from its start to its end, and an instant kind (\`at\`) has one time — draw it as "buckets" or "marks"`);
216
+ }
217
+ const overlaps = config.overlaps ?? "warn";
218
+ if (overlaps !== "warn" && overlaps !== "allow") {
219
+ throw new Error(`${where}: \`overlaps\` is "warn" or "allow" — and it is "${overlaps}"`);
220
+ }
221
+ const role = (prop, name, type, what) => {
222
+ if (name === undefined)
223
+ return undefined;
224
+ const held = fieldType(prop, name);
225
+ if (!isTypeEqual(held, type))
226
+ throw new Error(`${where}: \`${prop}\` names ${what} — "${name}" holds ${typeText(held)}`);
227
+ return name;
228
+ };
229
+ const stateField = role("state", config.state, EventStateType, "an EventStateType field, the lifecycle an event wears");
230
+ const quantityField = role("quantity.field", config.quantity === undefined ? undefined : config.quantity.field, FloatType, "a Float field, the quantity a bar prints");
231
+ const laneField = role("lane", config.lane, StringType, "a String field, the lane a tile sits in");
232
+ // The removed verdict, named (#1260) — a plain JS caller would otherwise lose it silently.
233
+ if ("review" in config) {
234
+ throw new Error(`${where}: \`review\` is removed (#1260) — a Plan approves and rejects nothing: its changes are drafts of its session, saved together`);
235
+ }
236
+ // The kind's own inspector, checked against the row now and carried over bytes.
237
+ const inspector = config.inspector === undefined ? undefined : rowInspector(config.inspector, rowType, `${where}: \`inspector\` is the kind's own inspector for one event — an East.function over the event's row and its writer: ` +
238
+ "East.function([RowType, FunctionType([RowType], NullType)], UIComponentType, ($, row, update) => …), RowType the record's row");
239
+ // The templates: unique keys, a span kind's duration, and values of the row less what a drop places.
240
+ const placed = new Set([startField, endField, ...(resource === undefined ? [] : [resource.field])]);
241
+ const valuesType = StructType(Object.fromEntries(Object.entries(fields).filter(([name]) => !placed.has(name))));
242
+ const boundTemplates = config.templates !== undefined && SCHEDULE_TEMPLATES in config.templates
243
+ ? checkedTemplates(config.templates, valuesType, where) : undefined;
244
+ const templates = config.templates !== undefined && !(SCHEDULE_TEMPLATES in config.templates) ? config.templates : [];
245
+ const seen = new Set();
246
+ for (const t of templates) {
247
+ if (seen.has(t.key))
248
+ throw new Error(`${where}: template "${t.key}" is declared twice — a template's key is unique within its kind`);
249
+ seen.add(t.key);
250
+ if (!instantKind && t.duration === undefined) {
251
+ throw new Error(`${where}: template "${t.key}" gives its \`duration\` — how long the event it creates runs`);
252
+ }
253
+ if (instantKind && t.duration !== undefined) {
254
+ throw new Error(`${where}: template "${t.key}" gives a \`duration\`, and an instant kind's events are one time — leave it out`);
255
+ }
256
+ }
257
+ // The windows (#1199): the days in view through a day index, the backlog through a backlog index.
258
+ if (config.slice !== undefined && (config.window !== undefined || config.backlogWindow !== undefined || config.filter !== undefined)) {
259
+ throw new Error(`${where}: slice replaces window, backlogWindow and local filter; narrow through the record's indexes`);
260
+ }
261
+ const dayWindow = config.window === undefined ? undefined
262
+ : checkIndexWindow(config.window, "window", keyType, rowType, DateTimeType, where);
263
+ let backlogWindow;
264
+ if (config.backlogWindow !== undefined) {
265
+ if (!optional)
266
+ throw new Error(`${where}: \`backlogWindow\` reads the backlog, and a kind whose times are plain DateTime fields has none`);
267
+ backlogWindow = checkIndexWindow(config.backlogWindow, "backlogWindow", keyType, rowType, OptionType(DateTimeType), where);
268
+ }
269
+ // A kind read through its day index never reads its record whole, its backlog included.
270
+ if (dayWindow !== undefined && optional && backlogWindow === undefined) {
271
+ throw new Error(`${where}: \`window\` reads the days in view through a day index, so the record is never read whole — ` +
272
+ "and this kind's times are Options, so it has a backlog: read it through `backlogWindow` beside it, " +
273
+ "Data.bindPaged(record, { index, join: true }) over an index keyed by Schedule.unscheduled");
274
+ }
275
+ // Nor one event: it is read by its key through the record's own entries.
276
+ let entries;
277
+ if (config.entries !== undefined) {
278
+ if (dayWindow === undefined && config.slice === undefined) {
279
+ throw new Error(`${where}: \`entries\` reads one event by its key beside \`window\` or record \`slice\` — give one of those with it`);
280
+ }
281
+ entries = checkEntries(config.entries, keyType, rowType, `${where}: \`entries\``);
282
+ }
283
+ else if (dayWindow !== undefined || config.slice !== undefined) {
284
+ throw new Error(`${where}: an indexed kind reads only the window — and one event, the inspector's ` +
285
+ "or its editing's, is read by its key: give `entries` beside it, Data.bindPaged(record), the record's own entries");
286
+ }
287
+ const byKey = entries === undefined ? undefined : scheduleEntryByKey(entries, keyType, rowType);
288
+ const lastKey = entries === undefined ? undefined : scheduleLastKey(entries, keyType);
289
+ // The inspector's form: the fields a gesture does not write, in the hints' order.
290
+ const omit = [...new Set([config.title, ...placed, ...(config.status === undefined ? [] : [config.status.field])])];
291
+ const formSpecs = Fields.specs(rowType, (config.fields ?? {}), omit);
292
+ // The Save: one patch commit through the record's patch door, its entries
293
+ // checked against what the drafts began from.
294
+ const apply = Record.onApply(record, { keyed: true });
295
+ // ── The East the seams share ─────────────────────────────────────────
296
+ const draftType = EditingDraftFieldType(rowType);
297
+ const EntryRowType = StructType({ id: StringType, key: keyType, row: rowType });
298
+ const readAll = handle["read"];
299
+ // An entry's id is its key's text: a String key as it is, any other key as East prints it.
300
+ const idOf = (keyType.type === "String"
301
+ ? East.function([StringType], StringType, (_$, key) => key)
302
+ : East.function([keyType], StringType, (_$, key) => East.print(key)));
303
+ const keyOf = (keyType.type === "String"
304
+ ? East.function([StringType], StringType, (_$, id) => id)
305
+ : East.function([StringType], keyType, (_$, id) => id.parse(keyType)));
306
+ // The entry a draft leaves: the drafted entry, none for one deleted, the held one for a draft it cannot read.
307
+ const drafted = East.function([BlobType, OptionType(rowType)], OptionType(rowType), (_$, bytes, held) => bytes.decodeBeast(draftType, "v2").match({
308
+ value: (_$2, row) => East.value(some(row), OptionType(rowType)),
309
+ missing: (_$2) => East.value(none, OptionType(rowType)),
310
+ invalid: (_$2) => held,
311
+ }));
312
+ // Every entry held — the record's, or a window's of it — with the drafts in place, then the drafted
313
+ // entries it does not hold: a draft moved into a window shows, and one moved out of it leaves by its times.
314
+ // Erased as the record's own read is, so the record whole and a window of it are one type.
315
+ const HeldType = DictType(keyType, rowType);
316
+ const withDrafts = East.function([HeldType, ScheduleDraftsType], ArrayType(EntryRowType), ($, held, drafts) => {
317
+ const idText = $.const(idOf);
318
+ const parse = $.const(keyOf);
319
+ const draft = $.const(drafted);
320
+ const out = $.let([], ArrayType(EntryRowType));
321
+ $.for(held, ($2, row, key) => {
322
+ const id = $2.const(idText(key));
323
+ $2.if(drafts.has(id), ($3) => {
324
+ $3.match(draft(drafts.get(id), East.value(some(row), OptionType(rowType))), {
325
+ some: ($4, next) => { $4(out.pushLast({ id, key, row: next })); },
326
+ });
327
+ }).else(($3) => { $3(out.pushLast({ id, key, row })); });
328
+ });
329
+ $.for(drafts, ($2, bytes, id, label) => {
330
+ const key = $2.const(parse(id));
331
+ $2.if(held.has(key).not(), ($3) => {
332
+ // Existing drafts outside an indexed result stay in the session,
333
+ // but do not leak back into a different narrowing. New entries
334
+ // remain an explicit unsaved layer until their first Save.
335
+ if (config.slice !== undefined && byKey !== undefined) {
336
+ const find = $3.const(byKey);
337
+ $3.if(find(id).hasTag("absent").not(), $4 => { $4.continue(label); });
338
+ }
339
+ $3.match(draft(bytes, East.value(none, OptionType(rowType))), {
340
+ some: ($4, next) => { $4(out.pushLast({ id, key, row: next })); },
341
+ });
342
+ });
343
+ });
344
+ return out;
345
+ });
346
+ // An instant field as an Option: a plain DateTime always has one.
347
+ const instant = (row, name) => optional
348
+ ? fieldOf(row, name)
349
+ : East.value(some(fieldOf(row, name)), OptionType(DateTimeType));
350
+ // A time as its field holds it: an Option field holds `some`.
351
+ const placedAt = (t) => (optional ? East.value(some(t), OptionType(DateTimeType)) : t);
352
+ // A duration in minutes — a month counts 30 days.
353
+ const minutesOf = East.function([ScheduleDurationType], IntegerType, (_$, step) => East.Float.roundHalf(step.match({
354
+ minutes: (_$2, n) => n,
355
+ hours: (_$2, n) => n.multiply(60),
356
+ days: (_$2, n) => n.multiply(1_440),
357
+ weeks: (_$2, n) => n.multiply(10_080),
358
+ months: (_$2, n) => n.multiply(43_200),
359
+ })));
360
+ const duration = config.backlog === undefined ? undefined
361
+ : East.function([rowType, keyType], ScheduleDurationType, (_$, row, key) => config.backlog.duration(row, key));
362
+ const dueOf = config.backlog?.due === undefined ? undefined
363
+ : East.function([rowType, keyType], OptionType(DateTimeType), (_$, row, key) => config.backlog.due(row, key));
364
+ // The resource a row is on.
365
+ const RefOption = OptionType(ScheduleResourceRefType);
366
+ const refOf = East.function([rowType], RefOption, (_$, row) => {
367
+ if (resource === undefined)
368
+ return East.value(none, RefOption);
369
+ const value = fieldOf(row, resource.field);
370
+ if (resource.shape === "key") {
371
+ const kind = resource.of;
372
+ const ref = (key) => East.value(some(East.value({ kind, key }, ScheduleResourceRefType)), RefOption);
373
+ return resource.optional
374
+ ? value.match({ none: (_$2) => East.value(none, RefOption), some: (_$2, key) => ref(key) })
375
+ : ref(value);
376
+ }
377
+ const of = resource.of;
378
+ const byCase = (v) => v.match(Object.fromEntries(resource.cases.map((c) => [c, (_$2, key) => East.value(some(East.value({ kind: of[c], key }, ScheduleResourceRefType)), RefOption)])));
379
+ return resource.optional
380
+ ? value.match({ none: (_$2) => East.value(none, RefOption), some: (_$2, v) => byCase(v) })
381
+ : byCase(value);
382
+ });
383
+ // The value a resource field takes for a placement's resource; `none` where the kind refuses it: a resource of a
384
+ // kind it does not take, or none for a field that must hold one.
385
+ const resourceValue = resource === undefined ? undefined : (() => {
386
+ const valueType = fields[resource.field];
387
+ return East.function([RefOption], OptionType(valueType), ($, ref) => {
388
+ const result = $.let(East.value(none, OptionType(valueType)), OptionType(valueType));
389
+ $.match(ref, {
390
+ none: ($2) => {
391
+ if (resource.optional)
392
+ $2.assign(result, East.value(some(East.value(none, valueType)), OptionType(valueType)));
393
+ },
394
+ some: ($2, r) => {
395
+ if (resource.shape === "key") {
396
+ const key = resource.optional ? East.value(some(r.key), valueType) : r.key;
397
+ $2.if(East.equal(r.kind, resource.of), ($3) => { $3.assign(result, East.value(some(key), OptionType(valueType))); });
398
+ }
399
+ else {
400
+ for (const c of resource.cases) {
401
+ const caseValue = East.value(variant(c, r.key), resource.variant);
402
+ const held = resource.optional ? East.value(some(caseValue), valueType) : caseValue;
403
+ $2.if(East.equal(r.kind, resource.of[c]), ($3) => { $3.assign(result, East.value(some(held), OptionType(valueType))); });
404
+ }
405
+ }
406
+ },
407
+ });
408
+ return result;
409
+ });
410
+ })();
411
+ // A row of the record's type, field by field: its times and resource from a placement, the rest from `source`.
412
+ // An instant kind's `at` is its start.
413
+ const rowWith = (source, start, end, resourceField) => East.value(Object.fromEntries(Object.keys(fields).map((f) => [f,
414
+ f === startField ? placedAt(start)
415
+ : f === endField ? placedAt(end)
416
+ : resource !== undefined && f === resource.field && resourceField !== undefined ? resourceField
417
+ : fieldOf(source, f)])), rowType);
418
+ // The entry with its times and resource placed; `none` where the kind refuses the resource.
419
+ const placeIn = East.function([rowType, DateTimeType, DateTimeType, RefOption], OptionType(rowType), ($, row, start, end, ref) => {
420
+ const result = $.let(East.value(none, OptionType(rowType)), OptionType(rowType));
421
+ if (resourceValue === undefined) {
422
+ // A kind on no resource takes a placement on none.
423
+ $.if(ref.hasTag("none"), ($2) => { $2.assign(result, East.value(some(rowWith(row, start, end, undefined)), OptionType(rowType))); });
424
+ }
425
+ else {
426
+ const resolve = $.const(resourceValue);
427
+ $.match(resolve(ref), {
428
+ some: ($2, value) => { $2.assign(result, East.value(some(rowWith(row, start, end, value)), OptionType(rowType))); },
429
+ });
430
+ }
431
+ return result;
432
+ });
433
+ // A setter for every field, at any depth: an inspector edit writes one (`field`), its value as bytes at the field's type.
434
+ const setters = [];
435
+ const setterOf = (prefix, name, type) => East.function([rowType, BlobType], rowType, (_$, row, bytes) => {
436
+ const value = bytes.decodeBeast(type, "v2");
437
+ // The structs down the path, each with the field below it replaced, rebuilt from the leaf up.
438
+ const chain = [];
439
+ let at = row;
440
+ let struct = rowType;
441
+ for (const step of prefix) {
442
+ chain.push({ struct, field: step, at });
443
+ at = fieldOf(at, step);
444
+ struct = struct.fields[step];
445
+ }
446
+ const leaf = struct;
447
+ const leafAt = at;
448
+ let next = East.value(Object.fromEntries(Object.keys(leaf.fields).map((f) => [f, f === name ? value : fieldOf(leafAt, f)])), leaf);
449
+ for (let i = chain.length - 1; i >= 0; i--) {
450
+ const link = chain[i];
451
+ const inner = next;
452
+ next = East.value(Object.fromEntries(Object.keys(link.struct.fields).map((f) => [f, f === link.field ? inner : fieldOf(link.at, f)])), link.struct);
453
+ }
454
+ return next;
455
+ });
456
+ const collect = (struct, prefix) => {
457
+ for (const [name, type] of Object.entries(struct.fields)) {
458
+ setters.push({ path: [...prefix, name], set: setterOf(prefix, name, type) });
459
+ if (type.type === "Struct")
460
+ collect(type, [...prefix, name]);
461
+ }
462
+ };
463
+ collect(rowType, []);
464
+ // The rows a window reads (#1199): the days in view through the day index, and the backlog through
465
+ // the backlog index — each `none` while its search or a page is in flight. Without them, the record whole.
466
+ const readDays = config.slice !== undefined
467
+ ? scheduleRecordWindow(config.slice, keyType, rowType, startField, endField, optional, false, where)
468
+ : dayWindow === undefined ? undefined : scheduleDayWindow(dayWindow, keyType, rowType, where);
469
+ const indexedBacklog = config.slice !== undefined && optional
470
+ ? scheduleRecordWindow(config.slice, keyType, rowType, startField, endField, optional, true, where) : undefined;
471
+ const readBacklog = indexedBacklog === undefined
472
+ ? backlogWindow === undefined ? undefined : scheduleBacklogWindow(backlogWindow, keyType, rowType, where)
473
+ : East.function([], OptionType(HeldType), $ => {
474
+ const read = $.const(indexedBacklog);
475
+ return read(new Date(0), new Date(1));
476
+ });
477
+ // One event by its key through the record's own entries, and the largest key (#1199): what a kind read a
478
+ // window at a time reads in place of the record whole.
479
+ // Adapt the author's typed predicate once; Slice owns its semantics and state.
480
+ const filter = config.filter === undefined ? undefined
481
+ : East.function([rowType, keyType], BooleanType, (_$, row, key) => config.filter(row, key));
482
+ /** An item seam over a window: the events whose items `itemFn` makes that overlap `[from, to)`. */
483
+ const windowOf = (itemType, itemFn) => East.function([DateTimeType, DateTimeType, ScheduleDraftsType], OptionType(ArrayType(itemType)), ($, from, to, drafts) => {
484
+ const inPlace = $.const(withDrafts);
485
+ const item = $.const(itemFn);
486
+ const accepts = filter === undefined ? undefined : $.const(filter);
487
+ const result = $.let(East.value(none, OptionType(ArrayType(itemType))), OptionType(ArrayType(itemType)));
488
+ let read;
489
+ if (readDays === undefined) {
490
+ read = $.let(East.value(some(readAll()), OptionType(HeldType)));
491
+ }
492
+ else {
493
+ const days = $.const(readDays);
494
+ read = $.let(days(from, to));
495
+ }
496
+ $.match(read, {
497
+ some: ($2, rows) => {
498
+ const out = $2.let([], ArrayType(itemType));
499
+ $2.for(inPlace(rows, drafts), ($3, entry, _i, label) => {
500
+ if (accepts !== undefined)
501
+ $3.if(accepts(entry.row, entry.key).not(), $4 => { $4.continue(label); });
502
+ // Every item type holds what every view draws, its start and end among them.
503
+ const one = $3.const(item(entry));
504
+ $3.match(one.start, {
505
+ some: ($4, s) => {
506
+ $4.match(one.end, {
507
+ some: ($5, e) => {
508
+ // Overlapping [from, to): it starts before the window ends, and ends
509
+ // after it starts — or, of no length, sits inside it.
510
+ $5.if(East.less(s, to).and(() => East.greater(e, from).or(() => East.greaterEqual(s, from))), ($6) => {
511
+ $6(out.pushLast(one));
512
+ });
513
+ },
514
+ });
515
+ },
516
+ });
517
+ });
518
+ $2.assign(result, East.value(some(out), OptionType(ArrayType(itemType))));
519
+ },
520
+ });
521
+ return result;
522
+ });
523
+ /** An item seam over the backlog: the rows with no time, as `itemFn` makes them. */
524
+ const backlogOf = (itemType, itemFn) => East.function([ScheduleDraftsType], OptionType(ArrayType(itemType)), ($, drafts) => {
525
+ const result = $.let(East.value(some([]), OptionType(ArrayType(itemType))), OptionType(ArrayType(itemType)));
526
+ if (optional) {
527
+ const inPlace = $.const(withDrafts);
528
+ const item = $.const(itemFn);
529
+ const accepts = filter === undefined ? undefined : $.const(filter);
530
+ let read;
531
+ if (readBacklog === undefined) {
532
+ read = $.let(East.value(some(readAll()), OptionType(HeldType)));
533
+ }
534
+ else {
535
+ const backlog = $.const(readBacklog);
536
+ read = $.let(backlog());
537
+ }
538
+ $.assign(result, East.value(none, OptionType(ArrayType(itemType))));
539
+ $.match(read, {
540
+ some: ($2, rows) => {
541
+ const out = $2.let([], ArrayType(itemType));
542
+ $2.for(inPlace(rows, drafts), ($3, entry, _i, label) => {
543
+ if (accepts !== undefined)
544
+ $3.if(accepts(entry.row, entry.key).not(), $4 => { $4.continue(label); });
545
+ const one = $3.const(item(entry));
546
+ $3.if(one.start.hasTag("none"), ($4) => { $4(out.pushLast(one)); });
547
+ });
548
+ $2.assign(result, East.value(some(out), OptionType(ArrayType(itemType))));
549
+ },
550
+ });
551
+ }
552
+ return result;
553
+ });
554
+ const readEvent = (makeItem, readType) => East.function([StringType, ScheduleDraftsType, DateTimeType, DateTimeType], OptionType(readType), ($, id, drafts, from, to) => {
555
+ const parse = $.const(keyOf);
556
+ const make = $.const(makeItem);
557
+ const key = $.const(parse(id));
558
+ const row = $.let(East.value(none, OptionType(rowType)), OptionType(rowType));
559
+ const unread = $.let(true, BooleanType);
560
+ $.if(drafts.has(id), ($2) => {
561
+ $2.match(drafts.get(id).decodeBeast(draftType, "v2"), {
562
+ value: ($3, entry) => {
563
+ $3.assign(row, East.value(some(entry), OptionType(rowType)));
564
+ $3.assign(unread, false);
565
+ },
566
+ missing: ($3) => { $3.assign(unread, false); },
567
+ });
568
+ });
569
+ $.if(unread, ($2) => {
570
+ if (byKey === undefined || readDays === undefined) {
571
+ const held = $2.const(readAll());
572
+ $2.assign(row, held.tryGet(key));
573
+ return;
574
+ }
575
+ const days = $2.const(readDays);
576
+ $2.match(days(from, to), { some: ($3, held) => { $3.assign(row, held.tryGet(key)); } });
577
+ if (readBacklog !== undefined) {
578
+ const backlog = $2.const(readBacklog);
579
+ $2.if(row.hasTag("none"), ($3) => {
580
+ $3.match(backlog(), { some: ($4, held) => { $4.assign(row, held.tryGet(key)); } });
581
+ });
582
+ }
583
+ const find = $2.const(byKey);
584
+ $2.if(row.hasTag("none"), ($3) => {
585
+ $3.match(find(id), { held: ($4, held) => { $4.assign(row, East.value(some(held), OptionType(rowType))); } });
586
+ });
587
+ });
588
+ return row.match({
589
+ some: (_$2, r) => East.value(some({ item: make({ id, key, row: r }), row: East.Blob.encodeBeast(r, "v2") }), OptionType(readType)),
590
+ none: (_$2) => East.value(none, OptionType(readType)),
591
+ });
592
+ });
593
+ /** The Calendar's kind, part by part, under its slot — and the function that makes one of its events. */
594
+ const kindParts = (slot) => {
595
+ // One event, as every view draws it.
596
+ const itemOf = East.function([EntryRowType], ScheduleItemType, ($, entry) => {
597
+ const row = entry.row;
598
+ const ref = $.const(refOf);
599
+ const start = $.const(instant(row, startField));
600
+ // An optional missing end is an instant at its scheduled start,
601
+ // matching interval-index membership without rewriting the row.
602
+ const end = $.const(instant(row, endField).match({
603
+ none: () => start,
604
+ some: (_$2, end) => East.value(some(end), OptionType(DateTimeType)),
605
+ }));
606
+ const minutes = $.let(0n, IntegerType);
607
+ $.match(start, {
608
+ some: ($2, s) => {
609
+ $2.match(end, { some: ($3, e) => { $3.assign(minutes, East.Float.roundHalf(s.durationMinutes(e))); } });
610
+ },
611
+ none: ($2) => {
612
+ if (duration !== undefined) {
613
+ const length = $2.const(duration);
614
+ const toMinutes = $2.const(minutesOf);
615
+ $2.assign(minutes, toMinutes(length(row, entry.key)));
616
+ }
617
+ },
618
+ });
619
+ const status = statusTable === undefined || statusCases === undefined
620
+ ? East.value(none, OptionType(ScheduleStatusType))
621
+ : fieldOf(row, config.status.field).match(Object.fromEntries(statusCases.map((c) => [c, (_$2) => East.value(some(fieldOf(statusTable, c)), OptionType(ScheduleStatusType))])));
622
+ const due = dueOf === undefined ? East.value(none, OptionType(DateTimeType)) : (() => {
623
+ const dueFn = $.const(dueOf);
624
+ return dueFn(row, entry.key);
625
+ })();
626
+ return East.value({
627
+ kind: slot,
628
+ key: entry.id,
629
+ title: fieldOf(row, config.title),
630
+ start,
631
+ end,
632
+ resource: ref(row),
633
+ status,
634
+ minutes,
635
+ due,
636
+ }, ScheduleItemType);
637
+ });
638
+ const items = windowOf(ScheduleItemType, itemOf);
639
+ const unscheduled = backlogOf(ScheduleItemType, itemOf);
640
+ // Each template's values, by key, as the templates on the wire carry them.
641
+ const templateRows = boundTemplates ?? East.value(templates.map((t) => ({
642
+ key: t.key, name: t.name, group: t.group === undefined ? none : some(t.group),
643
+ at: t.at === undefined ? none : some(East.value(t.at, ScheduleClockType)),
644
+ duration: t.duration === undefined ? variant("minutes", 0) : East.value(t.duration, ScheduleDurationType),
645
+ values: East.Blob.encodeBeast(East.value(t.values, valuesType), "v2"),
646
+ })), ArrayType(ScheduleTemplateType));
647
+ const write = East.function([ArrayType(ScheduleWriteType)], ArrayType(OptionType(BlobType)), ($, requests) => {
648
+ const place = $.const(placeIn);
649
+ const resolve = resourceValue === undefined ? undefined : $.const(resourceValue);
650
+ const byTemplate = $.let(new Map(), DictType(StringType, BlobType));
651
+ const presets = $.const(templateRows);
652
+ $.for(presets, ($2, t) => { $2(byTemplate.insert(t.key, t.values)); });
653
+ // Each setter's path as East holds it: a field is named by its steps, never by text a dotted name could mimic.
654
+ const setterFns = setters.map((setter) => ({ path: $.const([...setter.path], ArrayType(StringType)), set: $.const(setter.set) }));
655
+ return requests.map(($2, request) => {
656
+ const result = $2.let(East.value(none, OptionType(BlobType)), OptionType(BlobType));
657
+ const encoded = (row) => East.value(some(East.Blob.encodeBeast(row, "v2")), OptionType(BlobType));
658
+ $2.match(request.gesture, {
659
+ place: ($3, p) => {
660
+ const row = $3.const(request.entry.decodeBeast(rowType, "v2"));
661
+ $3.match(place(row, p.start, p.end, p.resource), {
662
+ some: ($4, next) => { $4.assign(result, encoded(next)); },
663
+ });
664
+ },
665
+ unplace: ($3) => {
666
+ // Back to the backlog: Option times only.
667
+ if (optional) {
668
+ const row = $3.const(request.entry.decodeBeast(rowType, "v2"));
669
+ $3.assign(result, encoded(East.value(Object.fromEntries(Object.keys(fields).map((f) => [f, f === startField || f === endField ? East.value(none, OptionType(DateTimeType)) : fieldOf(row, f)])), rowType)));
670
+ }
671
+ },
672
+ field: ($3, edit) => {
673
+ const row = $3.const(request.entry.decodeBeast(rowType, "v2"));
674
+ for (const setter of setterFns) {
675
+ $3.if(East.equal(edit.path, setter.path), ($4) => {
676
+ $4.assign(result, encoded(setter.set(row, edit.value)));
677
+ });
678
+ }
679
+ },
680
+ create: ($3, c) => {
681
+ $3.match(byTemplate.tryGet(c.template), {
682
+ some: ($4, bytes) => {
683
+ // The new entry: the template's values, its times and its resource placed.
684
+ const values = $4.const(bytes.decodeBeast(valuesType, "v2"));
685
+ if (resolve === undefined) {
686
+ $4.if(c.resource.hasTag("none"), ($5) => { $5.assign(result, encoded(rowWith(values, c.start, c.end, undefined))); });
687
+ }
688
+ else {
689
+ $4.match(resolve(c.resource), {
690
+ some: ($5, value) => { $5.assign(result, encoded(rowWith(values, c.start, c.end, value))); },
691
+ });
692
+ }
693
+ },
694
+ });
695
+ },
696
+ });
697
+ return result;
698
+ });
699
+ });
700
+ // The author's check, one result per drafted entry, in order; a check that throws refuses its own entry alone.
701
+ const ready = config.ready === undefined ? undefined : (() => {
702
+ const author = East.function([rowType, keyType], EditingReadinessType, ($, row, key) => $.const(config.ready(row, key), EditingReadinessType));
703
+ return East.function([ArrayType(ScheduleReadyEntryType)], ArrayType(EditingReadinessType), ($, batch) => {
704
+ const check = $.const(author);
705
+ const parse = $.const(keyOf);
706
+ return batch.map(($2, item) => {
707
+ const result = $2.let(variant("ready", null), EditingReadinessType);
708
+ $2.try(($3) => {
709
+ $3.assign(result, check(item.entry.decodeBeast(rowType, "v2"), parse(item.id)));
710
+ }).catch(($3, message) => {
711
+ $3.assign(result, variant("invalid", [{ field: "", message: East.str `Readiness check failed: ${message}` }]));
712
+ });
713
+ return result;
714
+ });
715
+ });
716
+ })();
717
+ // The shared session over the record: whole-entry drafts, keyed batches, Save through the patch door.
718
+ // Its base is the record's snapshot — or, for a kind read a window at a time (#1199), its revision,
719
+ // every entry it reads read by key through the record's own entries.
720
+ const batchType = EditingChangeSetTypeFor(rowType, keyType);
721
+ const encodedEntry = (row) => East.value(some(East.Blob.encodeBeast(row, "v2")), OptionType(BlobType));
722
+ const readEntry = byKey === undefined
723
+ ? East.function([StringType, IntegerType], OptionType(BlobType), ($, id, _offset) => {
724
+ const parse = $.const(keyOf);
725
+ const held = $.const(readAll());
726
+ return held.tryGet(parse(id)).match({
727
+ some: (_$2, row) => encodedEntry(row),
728
+ none: (_$2) => East.value(none, OptionType(BlobType)),
729
+ });
730
+ })
731
+ : East.function([StringType, IntegerType], OptionType(BlobType), ($, id, _offset) => {
732
+ const find = $.const(byKey);
733
+ const result = $.let(none, OptionType(BlobType));
734
+ $.match(find(id), { held: ($2, row) => { $2.assign(result, encodedEntry(row)); } });
735
+ return result;
736
+ });
737
+ const onApply = East.asyncFunction([BlobType], EditingApplyResultType, ($, blob) => {
738
+ const commit = $.const(apply);
739
+ return commit(blob.decodeBeast(batchType, "v2"));
740
+ });
741
+ const editing = East.value({
742
+ sourceId: handle["binding"].name,
743
+ entryType: toEastTypeValue(rowType),
744
+ idField: none,
745
+ draftType: toEastTypeValue(draftType),
746
+ children: none,
747
+ keyType: some(toEastTypeValue(keyType)),
748
+ snapshot: byKey === undefined ? some(East.Blob.encodeBeast(readAll(), "v2")) : none,
749
+ readEntry,
750
+ onPatch: none,
751
+ onApply: some(East.value(variant("async", onApply), EditingWireApplyType)),
752
+ mode: variant("batch", null),
753
+ }, EditingType);
754
+ // The record read by key (#1199): its revision and a move to another, one event's row, and its largest key.
755
+ let entriesSeam;
756
+ if (entries === undefined || byKey === undefined || lastKey === undefined) {
757
+ entriesSeam = East.value(none, OptionType(ScheduleEntriesType));
758
+ }
759
+ else {
760
+ const pinned = entries;
761
+ const entry = East.function([StringType], OptionType(OptionType(BlobType)), ($, id) => {
762
+ const find = $.const(byKey);
763
+ const result = $.let(none, OptionType(OptionType(BlobType)));
764
+ $.match(find(id), {
765
+ held: ($2, row) => { $2.assign(result, some(encodedEntry(row))); },
766
+ absent: ($2) => { $2.assign(result, some(none)); },
767
+ });
768
+ return result;
769
+ });
770
+ entriesSeam = East.value(some({ revision: pinned.revision, refresh: pinned.refresh, entry, last: lastKey }), OptionType(ScheduleEntriesType));
771
+ }
772
+ const fieldsOfKind = {
773
+ key: slot,
774
+ name: config.name,
775
+ icon: config.icon,
776
+ takes,
777
+ status: statusTable === undefined || statusCases === undefined ? [] : statusCases.map((c) => ({ case: c, status: fieldOf(statusTable, c) })),
778
+ backlog: optional,
779
+ templates: templateRows,
780
+ fields: East.value(formSpecs, ArrayType(FieldSpecType)),
781
+ items,
782
+ unscheduled,
783
+ write,
784
+ ready: ready === undefined ? none : some(ready),
785
+ editing,
786
+ entries: entriesSeam,
787
+ history: handle["history"],
788
+ event: readEvent(itemOf, ScheduleReadType),
789
+ schedule: { title: config.title, start: startField, end: endField,
790
+ resource: resource === undefined ? none : some(resource.field),
791
+ status: config.status === undefined ? none : some(config.status.field) },
792
+ overlaps: variant(overlaps, null),
793
+ inspector: inspector === undefined ? none : some(inspector),
794
+ };
795
+ return { fields: fieldsOfKind, itemOf };
796
+ };
797
+ return {
798
+ [SCHEDULE_DEF]: "events",
799
+ keyType,
800
+ rowType,
801
+ name: config.name,
802
+ icon: config.icon,
803
+ takes,
804
+ draw: draw,
805
+ build(slot) {
806
+ return East.value(kindParts(slot).fields, ScheduleKindType);
807
+ },
808
+ buildPlan(slot) {
809
+ const parts = kindParts(slot);
810
+ const quantity = config.quantity;
811
+ const format = quantity?.format === undefined ? undefined : East.value(quantity.format, TickFormatType);
812
+ // One event as Plan draws it: what every view draws, with its roles read from their fields.
813
+ const planItemOf = East.function([EntryRowType], PlanEventItemType, ($, entry) => {
814
+ const make = $.const(parts.itemOf);
815
+ const item = $.const(make(entry));
816
+ const row = entry.row;
817
+ const read = item;
818
+ return East.value({
819
+ ...Object.fromEntries(Object.keys(ScheduleItemType.fields).map((f) => [f, read[f]])),
820
+ state: stateField === undefined ? variant("confirmed", null) : fieldOf(row, stateField),
821
+ quantity: quantityField === undefined ? none : some({
822
+ value: fieldOf(row, quantityField),
823
+ unit: quantity?.unit === undefined ? none : some(quantity.unit),
824
+ format: format === undefined ? none : some(format),
825
+ text: none,
826
+ }),
827
+ lane: laneField === undefined ? none : some(fieldOf(row, laneField)),
828
+ }, PlanEventItemType);
829
+ });
830
+ // One event by its id, the drafts in place: as Plan draws it, and its row as bytes. A draft holds its
831
+ // event as drafted, or says it was deleted; an event never drafted — or one whose draft can't be read —
832
+ // is the record's: read whole, or for a kind read a window at a time (#1199) looked for first among the
833
+ // rows its windows hold over [from, to) and its backlog's, where a gesture's event is drawn, then read
834
+ // by its key.
835
+ const planEvent = readEvent(planItemOf, PlanEventReadType);
836
+ const name = (field) => (field === undefined ? none : some(field));
837
+ return East.value({
838
+ ...parts.fields,
839
+ draw: variant(draw, null),
840
+ instant: instantKind,
841
+ overlaps: variant(overlaps, null),
842
+ roles: { state: name(stateField), quantity: name(quantityField), lane: name(laneField) },
843
+ planItems: windowOf(PlanEventItemType, planItemOf),
844
+ planUnscheduled: backlogOf(PlanEventItemType, planItemOf),
845
+ planEvent,
846
+ inspector: inspector === undefined ? East.value(none, OptionType(RowInspectorType)) : East.value(some(inspector), OptionType(RowInspectorType)),
847
+ }, PlanEventKindType);
848
+ },
849
+ };
850
+ }
851
+ //# sourceMappingURL=events.js.map