@elaraai/e3-ui 1.0.102 → 1.0.104

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 (326) hide show
  1. package/dist/src/allocation/functions.d.ts +2 -1
  2. package/dist/src/allocation/functions.d.ts.map +1 -1
  3. package/dist/src/allocation/functions.js +3 -2
  4. package/dist/src/allocation/functions.js.map +1 -1
  5. package/dist/src/allocation/index.d.ts +120 -1
  6. package/dist/src/allocation/index.d.ts.map +1 -1
  7. package/dist/src/allocation/index.js +24 -4
  8. package/dist/src/allocation/index.js.map +1 -1
  9. package/dist/src/bind/data-indexed.d.ts +25 -4
  10. package/dist/src/bind/data-indexed.d.ts.map +1 -1
  11. package/dist/src/bind/data-indexed.js +58 -7
  12. package/dist/src/bind/data-indexed.js.map +1 -1
  13. package/dist/src/bind/data.d.ts +12 -14
  14. package/dist/src/bind/data.d.ts.map +1 -1
  15. package/dist/src/bind/data.js +11 -11
  16. package/dist/src/bind/data.js.map +1 -1
  17. package/dist/src/bind/func.d.ts +7 -2
  18. package/dist/src/bind/func.d.ts.map +1 -1
  19. package/dist/src/bind/func.js +10 -3
  20. package/dist/src/bind/func.js.map +1 -1
  21. package/dist/src/bind/record.d.ts +6 -6
  22. package/dist/src/bind/record.d.ts.map +1 -1
  23. package/dist/src/bind/record.js.map +1 -1
  24. package/dist/src/calendar/index.d.ts +148 -1
  25. package/dist/src/calendar/index.d.ts.map +1 -1
  26. package/dist/src/calendar/index.js +55 -5
  27. package/dist/src/calendar/index.js.map +1 -1
  28. package/dist/src/decision/bind.d.ts.map +1 -1
  29. package/dist/src/decision/index.d.ts +218 -218
  30. package/dist/src/decision/index.d.ts.map +1 -1
  31. package/dist/src/decision/types.d.ts.map +1 -1
  32. package/dist/src/flowchart/canvas.d.ts +32 -14
  33. package/dist/src/flowchart/canvas.d.ts.map +1 -1
  34. package/dist/src/flowchart/canvas.js +21 -6
  35. package/dist/src/flowchart/canvas.js.map +1 -1
  36. package/dist/src/flowchart/details.d.ts +469 -0
  37. package/dist/src/flowchart/details.d.ts.map +1 -0
  38. package/dist/src/flowchart/details.js +1035 -0
  39. package/dist/src/flowchart/details.js.map +1 -0
  40. package/dist/src/flowchart/flowchart.d.ts +16 -72
  41. package/dist/src/flowchart/flowchart.d.ts.map +1 -1
  42. package/dist/src/flowchart/flowchart.js +10 -1
  43. package/dist/src/flowchart/flowchart.js.map +1 -1
  44. package/dist/src/flowchart/index.d.ts +282 -251
  45. package/dist/src/flowchart/index.d.ts.map +1 -1
  46. package/dist/src/flowchart/index.js +234 -220
  47. package/dist/src/flowchart/index.js.map +1 -1
  48. package/dist/src/flowchart/kinds.d.ts +438 -0
  49. package/dist/src/flowchart/kinds.d.ts.map +1 -0
  50. package/dist/src/flowchart/kinds.js +799 -0
  51. package/dist/src/flowchart/kinds.js.map +1 -0
  52. package/dist/src/flowchart/library.d.ts +155 -740
  53. package/dist/src/flowchart/library.d.ts.map +1 -1
  54. package/dist/src/flowchart/library.js +191 -673
  55. package/dist/src/flowchart/library.js.map +1 -1
  56. package/dist/src/flowchart/payload.d.ts +3654 -7845
  57. package/dist/src/flowchart/payload.d.ts.map +1 -1
  58. package/dist/src/flowchart/payload.js +331 -469
  59. package/dist/src/flowchart/payload.js.map +1 -1
  60. package/dist/src/flowchart/templates.d.ts +657 -0
  61. package/dist/src/flowchart/templates.d.ts.map +1 -0
  62. package/dist/src/flowchart/templates.js +658 -0
  63. package/dist/src/flowchart/templates.js.map +1 -0
  64. package/dist/src/flowchart/types.d.ts +2258 -214
  65. package/dist/src/flowchart/types.d.ts.map +1 -1
  66. package/dist/src/flowchart/types.js +374 -124
  67. package/dist/src/flowchart/types.js.map +1 -1
  68. package/dist/src/index.d.ts +13 -15
  69. package/dist/src/index.d.ts.map +1 -1
  70. package/dist/src/index.js +24 -29
  71. package/dist/src/index.js.map +1 -1
  72. package/dist/src/internal.d.ts +5 -7
  73. package/dist/src/internal.d.ts.map +1 -1
  74. package/dist/src/internal.js +12 -19
  75. package/dist/src/internal.js.map +1 -1
  76. package/dist/src/ontology/index.d.ts +44 -15
  77. package/dist/src/ontology/index.d.ts.map +1 -1
  78. package/dist/src/ontology/index.js +19 -11
  79. package/dist/src/ontology/index.js.map +1 -1
  80. package/dist/src/plan/builders.d.ts +26 -26
  81. package/dist/src/plan/builders.d.ts.map +1 -1
  82. package/dist/src/plan/builders.js.map +1 -1
  83. package/dist/src/plan/event-rows.d.ts +59 -58
  84. package/dist/src/plan/event-rows.d.ts.map +1 -1
  85. package/dist/src/plan/event-rows.js +6 -4
  86. package/dist/src/plan/event-rows.js.map +1 -1
  87. package/dist/src/plan/factories.js.map +1 -1
  88. package/dist/src/plan/ir.d.ts +1 -0
  89. package/dist/src/plan/ir.d.ts.map +1 -1
  90. package/dist/src/plan/library.d.ts.map +1 -1
  91. package/dist/src/plan/nested-checks.js.map +1 -1
  92. package/dist/src/plan/plan.d.ts +567 -423
  93. package/dist/src/plan/plan.d.ts.map +1 -1
  94. package/dist/src/plan/plan.js +67 -3
  95. package/dist/src/plan/plan.js.map +1 -1
  96. package/dist/src/plan/series.d.ts.map +1 -1
  97. package/dist/src/plan/series.js.map +1 -1
  98. package/dist/src/plan/types.d.ts +173 -172
  99. package/dist/src/plan/types.d.ts.map +1 -1
  100. package/dist/src/query/builder.d.ts +368 -321
  101. package/dist/src/query/builder.d.ts.map +1 -1
  102. package/dist/src/query/builder.js +12 -1
  103. package/dist/src/query/builder.js.map +1 -1
  104. package/dist/src/query/index.d.ts +5 -1
  105. package/dist/src/query/index.d.ts.map +1 -1
  106. package/dist/src/query/index.js +3 -1
  107. package/dist/src/query/index.js.map +1 -1
  108. package/dist/src/query/library.d.ts +6 -6
  109. package/dist/src/query/queries.d.ts +3 -3
  110. package/dist/src/roster/fit.d.ts +5 -2
  111. package/dist/src/roster/fit.d.ts.map +1 -1
  112. package/dist/src/roster/fit.js +5 -3
  113. package/dist/src/roster/fit.js.map +1 -1
  114. package/dist/src/roster/index.d.ts +103 -2
  115. package/dist/src/roster/index.d.ts.map +1 -1
  116. package/dist/src/roster/index.js +45 -6
  117. package/dist/src/roster/index.js.map +1 -1
  118. package/dist/src/runtime/index.d.ts +1 -3
  119. package/dist/src/runtime/index.d.ts.map +1 -1
  120. package/dist/src/runtime/index.js +1 -3
  121. package/dist/src/runtime/index.js.map +1 -1
  122. package/dist/src/schedule/fields.js.map +1 -1
  123. package/dist/src/schedule/library.js.map +1 -1
  124. package/dist/src/schedule/record-window.d.ts +27 -26
  125. package/dist/src/schedule/record-window.d.ts.map +1 -1
  126. package/dist/src/schedule/types.d.ts +196 -196
  127. package/dist/src/schematic/index.d.ts +1 -1
  128. package/dist/src/schematic/index.d.ts.map +1 -1
  129. package/dist/src/schematic/index.js +1 -1
  130. package/dist/src/schematic/index.js.map +1 -1
  131. package/dist/src/schematic/kinds.d.ts +4 -24
  132. package/dist/src/schematic/kinds.d.ts.map +1 -1
  133. package/dist/src/schematic/kinds.js +8 -212
  134. package/dist/src/schematic/kinds.js.map +1 -1
  135. package/dist/src/schematic/library.d.ts.map +1 -1
  136. package/dist/src/schematic/payload.d.ts +1688 -1549
  137. package/dist/src/schematic/payload.d.ts.map +1 -1
  138. package/dist/src/schematic/payload.js +38 -1
  139. package/dist/src/schematic/payload.js.map +1 -1
  140. package/dist/src/schematic/shapes.d.ts.map +1 -1
  141. package/dist/src/schematic/types.d.ts +978 -978
  142. package/dist/src/schematic/types.d.ts.map +1 -1
  143. package/dist/src/schematic/types.js +4 -36
  144. package/dist/src/schematic/types.js.map +1 -1
  145. package/dist/src/schematic/window.d.ts +9 -42
  146. package/dist/src/schematic/window.d.ts.map +1 -1
  147. package/dist/src/schematic/window.js +10 -115
  148. package/dist/src/schematic/window.js.map +1 -1
  149. package/dist/src/sheet/actions.d.ts +388 -0
  150. package/dist/src/sheet/actions.d.ts.map +1 -0
  151. package/dist/src/sheet/actions.js +594 -0
  152. package/dist/src/sheet/actions.js.map +1 -0
  153. package/dist/src/sheet/bridge.d.ts +12 -1
  154. package/dist/src/sheet/bridge.d.ts.map +1 -1
  155. package/dist/src/sheet/bridge.js +30 -6
  156. package/dist/src/sheet/bridge.js.map +1 -1
  157. package/dist/src/sheet/columns.d.ts +5 -2
  158. package/dist/src/sheet/columns.d.ts.map +1 -1
  159. package/dist/src/sheet/columns.js.map +1 -1
  160. package/dist/src/sheet/draft-bridge.d.ts +9 -4
  161. package/dist/src/sheet/draft-bridge.d.ts.map +1 -1
  162. package/dist/src/sheet/draft-bridge.js +22 -7
  163. package/dist/src/sheet/draft-bridge.js.map +1 -1
  164. package/dist/src/sheet/editing-types.d.ts +71 -71
  165. package/dist/src/sheet/fields.d.ts +13 -0
  166. package/dist/src/sheet/fields.d.ts.map +1 -1
  167. package/dist/src/sheet/fields.js +3 -0
  168. package/dist/src/sheet/fields.js.map +1 -1
  169. package/dist/src/sheet/group.js.map +1 -1
  170. package/dist/src/sheet/index.d.ts +32 -2
  171. package/dist/src/sheet/index.d.ts.map +1 -1
  172. package/dist/src/sheet/index.js +18 -3
  173. package/dist/src/sheet/index.js.map +1 -1
  174. package/dist/src/sheet/library.d.ts +8 -0
  175. package/dist/src/sheet/library.d.ts.map +1 -1
  176. package/dist/src/sheet/library.js.map +1 -1
  177. package/dist/src/sheet/link.d.ts.map +1 -1
  178. package/dist/src/sheet/record.js.map +1 -1
  179. package/dist/src/sheet/root.d.ts +23 -1
  180. package/dist/src/sheet/root.d.ts.map +1 -1
  181. package/dist/src/sheet/root.js +40 -5
  182. package/dist/src/sheet/root.js.map +1 -1
  183. package/dist/src/sheet/sheet.d.ts +9332 -5621
  184. package/dist/src/sheet/sheet.d.ts.map +1 -1
  185. package/dist/src/sheet/sheet.js +41 -2
  186. package/dist/src/sheet/sheet.js.map +1 -1
  187. package/dist/src/sheet/templates.d.ts +4 -0
  188. package/dist/src/sheet/templates.d.ts.map +1 -1
  189. package/dist/src/sheet/types.d.ts +13020 -5839
  190. package/dist/src/sheet/types.d.ts.map +1 -1
  191. package/dist/src/sheet/types.js +114 -2
  192. package/dist/src/sheet/types.js.map +1 -1
  193. package/dist/src/studio/builder.d.ts +6 -6
  194. package/dist/src/studio/library.d.ts +9 -9
  195. package/dist/src/studio/pages.d.ts +6 -6
  196. package/dist/src/studio/publish.d.ts +3 -3
  197. package/dist/src/utils/derive.d.ts +1 -1
  198. package/dist/src/utils/derive.js +1 -1
  199. package/dist/src/utils/derive.js.map +1 -1
  200. package/dist/src/utils/key-visibility.d.ts +1 -1
  201. package/dist/src/utils/record-kind.d.ts +625 -0
  202. package/dist/src/utils/record-kind.d.ts.map +1 -0
  203. package/dist/src/utils/record-kind.js +450 -0
  204. package/dist/src/utils/record-kind.js.map +1 -0
  205. package/dist/src/utils/views.d.ts +55 -0
  206. package/dist/src/utils/views.d.ts.map +1 -0
  207. package/dist/src/utils/views.js +72 -0
  208. package/dist/src/utils/views.js.map +1 -0
  209. package/dist/src/utils/vocabulary.d.ts +48 -0
  210. package/dist/src/utils/vocabulary.d.ts.map +1 -0
  211. package/dist/src/utils/vocabulary.js +47 -0
  212. package/dist/src/utils/vocabulary.js.map +1 -0
  213. package/dist/test/allocation/allocation.examples.d.ts +3 -1
  214. package/dist/test/allocation/allocation.examples.d.ts.map +1 -1
  215. package/dist/test/allocation/allocation.examples.js +81 -2
  216. package/dist/test/allocation/allocation.examples.js.map +1 -1
  217. package/dist/test/bind/data/data.examples.d.ts +1 -1
  218. package/dist/test/bind/func/func.examples.d.ts +19 -1
  219. package/dist/test/bind/func/func.examples.d.ts.map +1 -1
  220. package/dist/test/bind/func/func.examples.js +36 -1
  221. package/dist/test/bind/func/func.examples.js.map +1 -1
  222. package/dist/test/calendar/calendar.examples.d.ts +2 -0
  223. package/dist/test/calendar/calendar.examples.d.ts.map +1 -1
  224. package/dist/test/calendar/calendar.examples.js +80 -2
  225. package/dist/test/calendar/calendar.examples.js.map +1 -1
  226. package/dist/test/decision/queue.examples.d.ts +1 -0
  227. package/dist/test/decision/queue.examples.d.ts.map +1 -1
  228. package/dist/test/decision/queue.examples.js +12 -0
  229. package/dist/test/decision/queue.examples.js.map +1 -1
  230. package/dist/test/examples-package.d.ts.map +1 -1
  231. package/dist/test/examples-package.js +5 -4
  232. package/dist/test/examples-package.js.map +1 -1
  233. package/dist/test/flowchart/flowchart.examples.d.ts +1250 -4605
  234. package/dist/test/flowchart/flowchart.examples.d.ts.map +1 -1
  235. package/dist/test/flowchart/flowchart.examples.js +861 -512
  236. package/dist/test/flowchart/flowchart.examples.js.map +1 -1
  237. package/dist/test/ontology/ontology.examples.d.ts +2 -3
  238. package/dist/test/ontology/ontology.examples.d.ts.map +1 -1
  239. package/dist/test/ontology/ontology.examples.js +32 -21
  240. package/dist/test/ontology/ontology.examples.js.map +1 -1
  241. package/dist/test/plan/plan-events.examples.d.ts +1 -0
  242. package/dist/test/plan/plan-events.examples.d.ts.map +1 -1
  243. package/dist/test/plan/plan-events.examples.js +44 -0
  244. package/dist/test/plan/plan-events.examples.js.map +1 -1
  245. package/dist/test/plan/plan-nested.examples.d.ts +15 -15
  246. package/dist/test/plan/plan-nested.examples.d.ts.map +1 -1
  247. package/dist/test/plan/plan-nested.examples.js +5 -5
  248. package/dist/test/plan/plan-nested.examples.js.map +1 -1
  249. package/dist/test/plan/plan-records.examples.d.ts.map +1 -1
  250. package/dist/test/plan/plan-records.examples.js +1 -1
  251. package/dist/test/plan/plan-records.examples.js.map +1 -1
  252. package/dist/test/plan/plan.examples.js.map +1 -1
  253. package/dist/test/query/query.examples.d.ts +2 -0
  254. package/dist/test/query/query.examples.d.ts.map +1 -1
  255. package/dist/test/query/query.examples.js +37 -1
  256. package/dist/test/query/query.examples.js.map +1 -1
  257. package/dist/test/roster/domain.examples.d.ts.map +1 -1
  258. package/dist/test/roster/roster.examples.d.ts +2 -0
  259. package/dist/test/roster/roster.examples.d.ts.map +1 -1
  260. package/dist/test/roster/roster.examples.js +76 -15
  261. package/dist/test/roster/roster.examples.js.map +1 -1
  262. package/dist/test/schematic/schematic-records.examples.d.ts.map +1 -1
  263. package/dist/test/schematic/schematic-records.examples.js +6 -4
  264. package/dist/test/schematic/schematic-records.examples.js.map +1 -1
  265. package/dist/test/schematic/schematic.examples.d.ts +1 -0
  266. package/dist/test/schematic/schematic.examples.d.ts.map +1 -1
  267. package/dist/test/schematic/schematic.examples.js +144 -0
  268. package/dist/test/schematic/schematic.examples.js.map +1 -1
  269. package/dist/test/sheet/sheet-actions.examples.d.ts +1264 -0
  270. package/dist/test/sheet/sheet-actions.examples.d.ts.map +1 -0
  271. package/dist/test/sheet/sheet-actions.examples.js +394 -0
  272. package/dist/test/sheet/sheet-actions.examples.js.map +1 -0
  273. package/dist/test/sheet/sheet-records.examples.d.ts +1 -1
  274. package/dist/test/sheet/sheet.examples.d.ts +1 -0
  275. package/dist/test/sheet/sheet.examples.d.ts.map +1 -1
  276. package/dist/test/sheet/sheet.examples.js +77 -0
  277. package/dist/test/sheet/sheet.examples.js.map +1 -1
  278. package/dist/test/studio/studio.examples.d.ts +1 -0
  279. package/dist/test/studio/studio.examples.d.ts.map +1 -1
  280. package/dist/test/studio/studio.examples.js +18 -8
  281. package/dist/test/studio/studio.examples.js.map +1 -1
  282. package/package.json +14 -13
  283. package/dist/src/diff/index.d.ts +0 -407
  284. package/dist/src/diff/index.d.ts.map +0 -1
  285. package/dist/src/diff/index.js +0 -203
  286. package/dist/src/diff/index.js.map +0 -1
  287. package/dist/src/experiment/index.d.ts +0 -1033
  288. package/dist/src/experiment/index.d.ts.map +0 -1
  289. package/dist/src/experiment/index.js +0 -197
  290. package/dist/src/experiment/index.js.map +0 -1
  291. package/dist/src/experiment/types.d.ts +0 -1093
  292. package/dist/src/experiment/types.d.ts.map +0 -1
  293. package/dist/src/experiment/types.js +0 -423
  294. package/dist/src/experiment/types.js.map +0 -1
  295. package/dist/src/flowchart/over.d.ts +0 -227
  296. package/dist/src/flowchart/over.d.ts.map +0 -1
  297. package/dist/src/flowchart/over.js +0 -213
  298. package/dist/src/flowchart/over.js.map +0 -1
  299. package/dist/src/flowchart/patch.d.ts +0 -64
  300. package/dist/src/flowchart/patch.d.ts.map +0 -1
  301. package/dist/src/flowchart/patch.js +0 -67
  302. package/dist/src/flowchart/patch.js.map +0 -1
  303. package/dist/src/flowchart/values.d.ts +0 -271
  304. package/dist/src/flowchart/values.d.ts.map +0 -1
  305. package/dist/src/flowchart/values.js +0 -220
  306. package/dist/src/flowchart/values.js.map +0 -1
  307. package/dist/src/flowchart/window.d.ts +0 -306
  308. package/dist/src/flowchart/window.d.ts.map +0 -1
  309. package/dist/src/flowchart/window.js +0 -63
  310. package/dist/src/flowchart/window.js.map +0 -1
  311. package/dist/src/runtime/diff.d.ts +0 -36
  312. package/dist/src/runtime/diff.d.ts.map +0 -1
  313. package/dist/src/runtime/diff.js +0 -34
  314. package/dist/src/runtime/diff.js.map +0 -1
  315. package/dist/src/runtime/experiment.d.ts +0 -48
  316. package/dist/src/runtime/experiment.d.ts.map +0 -1
  317. package/dist/src/runtime/experiment.js +0 -10
  318. package/dist/src/runtime/experiment.js.map +0 -1
  319. package/dist/test/diff/diff.examples.d.ts +0 -313
  320. package/dist/test/diff/diff.examples.d.ts.map +0 -1
  321. package/dist/test/diff/diff.examples.js +0 -452
  322. package/dist/test/diff/diff.examples.js.map +0 -1
  323. package/dist/test/experiment/experiment.examples.d.ts +0 -1512
  324. package/dist/test/experiment/experiment.examples.d.ts.map +0 -1
  325. package/dist/test/experiment/experiment.examples.js +0 -609
  326. package/dist/test/experiment/experiment.examples.js.map +0 -1
@@ -0,0 +1,657 @@
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
+ * `Flowchart.templates(rows, spec)` (#1501, `Flowchart Records Spec.md` R14,
7
+ * D8): the cards a kind's library tab lists. Cards are records (#1340,
8
+ * ruling 9), as the Schematic's are: the rows are a record of the app's, read
9
+ * whole through `Data.bind(record).read()`, and each card is one of its rows,
10
+ * its key the record's key. A list names its source of the Flowchart's
11
+ * `Slice.bindRecords`, whose shown keys narrow its cards.
12
+ *
13
+ * - A state's card gives every field of the row but its lane and its order:
14
+ * dropped on a lane, it adds a state there.
15
+ * - A transition's gives every field but its ends: dropped on a transition,
16
+ * it gives it its values, its ends kept.
17
+ * - A lane's gives every field but its order: dropped between two lanes, or at
18
+ * the band row's tail, it adds a lane there.
19
+ *
20
+ * Each accessor is reified once and called per row.
21
+ *
22
+ * @packageDocumentation
23
+ */
24
+ import { ArrayType, OptionType, StringType, type DictType, type EastType, type ExprType, type StructType, type SubtypeExprOrValue } from "@elaraai/east";
25
+ import { FlowchartTemplateType } from "./types.js";
26
+ /** Identifies a list of cards read from a record. */
27
+ export declare const FLOWCHART_TEMPLATES: unique symbol;
28
+ /**
29
+ * A kind's cards, read from a record (see the module docs).
30
+ *
31
+ * @typeParam V - The values' type: the row's fields less what a drop writes
32
+ */
33
+ export interface FlowchartTemplates<V extends StructType> {
34
+ /** Identifies the declaration. */
35
+ readonly [FLOWCHART_TEMPLATES]: true;
36
+ /** The type of each card's values. */
37
+ readonly valuesType: V;
38
+ /** The cards, each its values encoded at their own type. */
39
+ readonly items: ExprType<ArrayType<FlowchartTemplateType>>;
40
+ /** The Flowchart's `Slice.bindRecords` source over the cards' record, whose shown keys narrow them. */
41
+ readonly source: string | undefined;
42
+ }
43
+ /**
44
+ * How each row of a cards record shows, and what it makes.
45
+ *
46
+ * @typeParam C - The cards record's row type
47
+ * @typeParam V - The values' type
48
+ */
49
+ export interface FlowchartTemplatesSpec<C extends EastType, V extends StructType> {
50
+ /** The card's name. */
51
+ name: (row: ExprType<C>, key: ExprType<StringType>) => SubtypeExprOrValue<StringType>;
52
+ /** The tab's group it sits under. */
53
+ group?: (row: ExprType<C>, key: ExprType<StringType>) => SubtypeExprOrValue<OptionType<StringType>>;
54
+ /**
55
+ * Every field of the row the card makes but what a drop writes: a state's every field but its lane and its order,
56
+ * a transition's every field but its ends, a lane's every field but its order.
57
+ */
58
+ values: (row: ExprType<C>, key: ExprType<StringType>) => ExprType<V>;
59
+ /**
60
+ * The Flowchart's `Slice.bindRecords` source over the cards' record (`stepCards`): its shown keys narrow the cards,
61
+ * each card's key its record's key. A list naming no source of the slice is refused, naming the change.
62
+ */
63
+ source: string;
64
+ }
65
+ /**
66
+ * Declares a kind's cards over a record's rows (see the module docs).
67
+ *
68
+ * @typeParam C - The cards record's row type
69
+ * @typeParam V - The values' struct type
70
+ * @param rows - The cards, keyed by String: a record's rows, `Data.bind(record).read()`
71
+ * @param spec - Each card's name and group, its values, and its source of the slice
72
+ * @returns The cards, which a kind's `templates` takes
73
+ * @throws {Error} When the rows are not a Dict keyed by String, or `values` returns no struct
74
+ *
75
+ * @example
76
+ * ```tsx
77
+ * // .tsx file with the `@jsxImportSource @elaraai/e3-ui` pragma
78
+ * import { ArrayType, DateTimeType, DictType, East, FloatType, IntegerType, NullType, OptionType, SetType, StringType, StructType, VariantType, none, some, variant } from "@elaraai/east";
79
+ * import { Box, Fields, Reactive, Slice, UIComponentType } from "@elaraai/east-ui";
80
+ * import { Data, Flowchart, Record } from "@elaraai/e3-ui";
81
+ * import e3 from "@elaraai/e3";
82
+ *
83
+ * // The depot's four records, and the records of the cards its library lists: each list of cards follows its own
84
+ * // source of the rail, as the states and the transitions follow theirs.
85
+ * export const DepotState = StructType({
86
+ * name: StringType, // what its card calls it
87
+ * phase: StringType, // the lane it stands in, by the lane's key
88
+ * seq: FloatType, // its place in its lane
89
+ * slots: OptionType(IntegerType), // a class of interchangeable states: the ×N badge
90
+ * flow: StringType, // the flow it belongs to: one record holds the depot's flows
91
+ * });
92
+ * export const DepotTransition = StructType({
93
+ * src: StringType, // the state it leaves, by its key
94
+ * dst: StringType, // the state it enters
95
+ * kind: VariantType({ planned: NullType, observed: NullType }),
96
+ * trigger: OptionType(StringType), // the decision that governs it, by its key
97
+ * volume: OptionType(FloatType), // the parcels measured on it
98
+ * n: OptionType(IntegerType), // the moves behind them
99
+ * at: OptionType(DateTimeType), // when they were measured
100
+ * flow: StringType,
101
+ * });
102
+ * export const DepotLane = StructType({ label: StringType, seq: FloatType });
103
+ * export const DepotDecision = StructType({ name: StringType, owner: StringType });
104
+ * export const depotStates = e3.record("flowchart_depot_states", DictType(StringType, DepotState), {
105
+ * initial: new Map([
106
+ * ["ARV", { name: "Arrived", phase: "intake", seq: 1, slots: none, flow: "Parcels" }],
107
+ * ["SCN", { name: "Scanned", phase: "intake", seq: 2, slots: none, flow: "Parcels" }],
108
+ * ["IND", { name: "Inducted", phase: "induct", seq: 1, slots: none, flow: "Parcels" }],
109
+ * ["LBL", { name: "Relabelled", phase: "induct", seq: 2, slots: none, flow: "Parcels" }],
110
+ * ["CH*", { name: "Sort chutes (class)", phase: "sort", seq: 1, slots: some(14n), flow: "Parcels" }],
111
+ * ["SRD", { name: "Sorted", phase: "sort", seq: 2, slots: none, flow: "Parcels" }],
112
+ * ["HLD", { name: "Held", phase: "hold", seq: 1, slots: none, flow: "Parcels" }],
113
+ * ["CLR", { name: "Cleared", phase: "hold", seq: 2, slots: none, flow: "Parcels" }],
114
+ * ["LDD", { name: "Loaded", phase: "dispatch", seq: 1, slots: none, flow: "Parcels" }],
115
+ * ["DSP", { name: "Dispatched", phase: "dispatch", seq: 2, slots: none, flow: "Parcels" }],
116
+ * // The returns flow's states, beside the parcels'.
117
+ * ["RCV", { name: "Received", phase: "intake", seq: 3, slots: none, flow: "Returns" }],
118
+ * ["INS", { name: "Inspected", phase: "hold", seq: 3, slots: none, flow: "Returns" }],
119
+ * ["RSD", { name: "Resent", phase: "dispatch", seq: 3, slots: none, flow: "Returns" }],
120
+ * ]),
121
+ * mutations: (mutation) => ({ patch: mutation.patch() }),
122
+ * indexes: (index) => ({
123
+ * flowchart_states_by_flow: index.on(["flow"]),
124
+ * flowchart_states_by_lane: index.on(["flow", "phase"]),
125
+ * }),
126
+ * });
127
+ * export const depotTransitions = e3.record("flowchart_depot_transitions", DictType(StringType, DepotTransition), {
128
+ * initial: new Map([
129
+ * ["l1", { src: "ARV", dst: "SCN", kind: variant("planned", null), trigger: none, volume: some(18460), n: some(412n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
130
+ * ["l2", { src: "SCN", dst: "IND", kind: variant("planned", null), trigger: none, volume: some(18390), n: some(409n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
131
+ * // In place: parcels inducted again, counted but not weighed.
132
+ * ["l3", { src: "IND", dst: "IND", kind: variant("observed", null), trigger: none, volume: none, n: some(2n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
133
+ * ["l4", { src: "IND", dst: "CH*", kind: variant("planned", null), trigger: some("route"), volume: some(17350), n: some(386n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
134
+ * ["l5", { src: "CH*", dst: "SRD", kind: variant("planned", null), trigger: none, volume: some(18210), n: some(405n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
135
+ * ["l6", { src: "SRD", dst: "HLD", kind: variant("planned", null), trigger: none, volume: some(8420), n: some(188n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
136
+ * ["l7", { src: "HLD", dst: "CLR", kind: variant("planned", null), trigger: some("customs"), volume: some(8350), n: some(186n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
137
+ * ["l8", { src: "CLR", dst: "LDD", kind: variant("planned", null), trigger: none, volume: some(8240), n: some(183n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
138
+ * ["l9", { src: "LDD", dst: "DSP", kind: variant("planned", null), trigger: none, volume: some(17030), n: some(378n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
139
+ * // Its far end names a state no row is keyed by: drawn as a ghost, and listed in Issues.
140
+ * ["l10", { src: "DSP", dst: "DLV", kind: variant("planned", null), trigger: none, volume: none, n: none, at: none, flow: "Parcels" }],
141
+ * // Observed, not planned: parcels relabelled before they are sorted.
142
+ * ["l11", { src: "IND", dst: "LBL", kind: variant("observed", null), trigger: none, volume: some(980), n: some(22n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
143
+ * ["l12", { src: "LBL", dst: "CH*", kind: variant("observed", null), trigger: none, volume: some(975), n: some(22n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
144
+ * ["l13", { src: "SRD", dst: "LDD", kind: variant("planned", null), trigger: none, volume: some(8790), n: some(195n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Parcels" }],
145
+ * ["r1", { src: "RCV", dst: "INS", kind: variant("planned", null), trigger: none, volume: some(640), n: some(15n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Returns" }],
146
+ * ["r2", { src: "INS", dst: "RSD", kind: variant("planned", null), trigger: none, volume: some(610), n: some(14n), at: some(new Date("2026-06-30T00:00:00Z")), flow: "Returns" }],
147
+ * ]),
148
+ * mutations: (mutation) => ({ patch: mutation.patch() }),
149
+ * indexes: (index) => ({
150
+ * flowchart_transitions_by_flow: index.on(["flow"]),
151
+ * }),
152
+ * });
153
+ * export const depotLanes = e3.record("flowchart_depot_lanes", DictType(StringType, DepotLane), {
154
+ * initial: new Map([
155
+ * ["intake", { label: "Intake", seq: 1 }], ["induct", { label: "Induct", seq: 2 }], ["sort", { label: "Sort", seq: 3 }],
156
+ * ["hold", { label: "Hold", seq: 4 }], ["dispatch", { label: "Dispatch", seq: 5 }],
157
+ * ]),
158
+ * mutations: (mutation) => ({ patch: mutation.patch() }),
159
+ * });
160
+ * export const depotDecisions = e3.record("flowchart_depot_decisions", DictType(StringType, DepotDecision), {
161
+ * initial: new Map([["route", { name: "route", owner: "sort-planner" }], ["customs", { name: "customs", owner: "customs-desk" }]]),
162
+ * mutations: (mutation) => ({ patch: mutation.patch() }),
163
+ * });
164
+ * // What one service's parcels did in a state: the same figures as the state's own, for that service alone.
165
+ * export const ServiceEvidence = StructType({
166
+ * flags: SetType(StringType), // what the app's task flags this service's parcels with
167
+ * parcels: IntegerType, // its parcels through the state
168
+ * waiting: IntegerType, // still in it when measured
169
+ * hours: ArrayType(IntegerType), // its parcels by time in state: a count a bin, in the bins' order
170
+ * exceptions: DictType(StringType, IntegerType), // its parcels by what went wrong
171
+ * });
172
+ * // What the depot measured in each state and on each transition: the app's own rows, keyed as the states and
173
+ * // the transitions are, written by its evidence task through each record's door.
174
+ * export const StateEvidence = StructType({
175
+ * flags: SetType(StringType), // what the app's task flags the state with
176
+ * equipment: SetType(StringType), // what handles parcels there
177
+ * shifts: SetType(StringType), // the shifts that staff it
178
+ * parcels: IntegerType, // through the state
179
+ * waiting: IntegerType, // still in it when measured
180
+ * hours: ArrayType(IntegerType), // parcels by time in state: a count a bin, in the bins' order
181
+ * service: DictType(StringType, IntegerType), // parcels by service
182
+ * exceptions: DictType(StringType, IntegerType), // parcels by what went wrong
183
+ * byService: DictType(StringType, ServiceEvidence), // each service's own: Standard, Priority, Economy, International
184
+ * });
185
+ * export const MoveEvidence = StructType({
186
+ * region: DictType(StringType, IntegerType),
187
+ * service: DictType(StringType, IntegerType),
188
+ * origins: DictType(StringType, StructType({ parcels: IntegerType, late: IntegerType })),
189
+ * });
190
+ * // What the evidence task last wrote, made up: a row a state but Dispatched, whose card says no data. Each row
191
+ * // files each service's own figures apart, which add up to its own: their parcels are its Service list's counts,
192
+ * // their waiting adds to its waiting, their hours bin by bin to its hours, their exceptions by name to its
193
+ * // exceptions, and their flags join to its flags. The returns take no international parcels: their states hold no
194
+ * // International entry.
195
+ * export const stateEvidence = e3.record("flowchart_depot_state_evidence", DictType(StringType, StateEvidence), {
196
+ * initial: new Map([
197
+ * ["ARV", {
198
+ * flags: new Set<string>(), equipment: new Set(["Conveyor"]), shifts: new Set(["Early", "Late", "Night"]),
199
+ * parcels: 18460n, waiting: 60n,
200
+ * hours: [5538n, 6277n, 3692n, 1846n, 738n, 369n, 0n, 0n, 0n, 0n, 0n, 0n],
201
+ * service: new Map([["Standard", 10337n], ["Priority", 4615n], ["Economy", 2400n], ["International", 1108n]]),
202
+ * exceptions: new Map([["Late arrival", 52n], ["Damaged packaging", 11n]]),
203
+ * byService: new Map([
204
+ * ["Standard", { flags: new Set<string>(), parcels: 10337n, waiting: 33n, hours: [3005n, 3534n, 2118n, 1062n, 417n, 201n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Late arrival", 26n], ["Damaged packaging", 6n]]) }],
205
+ * ["Priority", { flags: new Set<string>(), parcels: 4615n, waiting: 15n, hours: [1735n, 1637n, 788n, 316n, 100n, 39n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Late arrival", 11n], ["Damaged packaging", 3n]]) }],
206
+ * ["Economy", { flags: new Set<string>(), parcels: 2400n, waiting: 8n, hours: [589n, 781n, 528n, 298n, 132n, 72n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Late arrival", 12n], ["Damaged packaging", 1n]]) }],
207
+ * ["International", { flags: new Set<string>(), parcels: 1108n, waiting: 4n, hours: [209n, 325n, 258n, 170n, 89n, 57n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Late arrival", 3n], ["Damaged packaging", 1n]]) }],
208
+ * ]),
209
+ * }],
210
+ * ["SCN", {
211
+ * flags: new Set(["Fragile"]), equipment: new Set(["Scanner", "Conveyor"]), shifts: new Set(["Early", "Late", "Night"]),
212
+ * parcels: 18390n, waiting: 35n,
213
+ * hours: [7723n, 5701n, 2759n, 1471n, 552n, 184n, 0n, 0n, 0n, 0n, 0n, 0n],
214
+ * service: new Map([["Standard", 10298n], ["Priority", 4598n], ["Economy", 2391n], ["International", 1103n]]),
215
+ * exceptions: new Map([["Unreadable label", 61n], ["Damaged packaging", 9n]]),
216
+ * byService: new Map([
217
+ * ["Standard", { flags: new Set(["Fragile"]), parcels: 10298n, waiting: 20n, hours: [4236n, 3228n, 1584n, 842n, 309n, 99n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Unreadable label", 34n], ["Damaged packaging", 5n]]) }],
218
+ * ["Priority", { flags: new Set<string>(), parcels: 4598n, waiting: 9n, hours: [2307n, 1411n, 555n, 237n, 70n, 18n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Unreadable label", 15n], ["Damaged packaging", 2n]]) }],
219
+ * ["Economy", { flags: new Set<string>(), parcels: 2391n, waiting: 4n, hours: [860n, 739n, 409n, 245n, 101n, 37n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Unreadable label", 8n], ["Damaged packaging", 1n]]) }],
220
+ * ["International", { flags: new Set<string>(), parcels: 1103n, waiting: 2n, hours: [320n, 323n, 211n, 147n, 72n, 30n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Unreadable label", 4n], ["Damaged packaging", 1n]]) }],
221
+ * ]),
222
+ * }],
223
+ * ["IND", {
224
+ * flags: new Set(["Oversize", "Fragile"]), equipment: new Set(["Conveyor", "Scanner"]), shifts: new Set(["Early", "Late"]),
225
+ * parcels: 18390n, waiting: 120n,
226
+ * hours: [2207n, 4781n, 5517n, 3310n, 1655n, 736n, 184n, 0n, 0n, 0n, 0n, 0n],
227
+ * service: new Map([["Standard", 10482n], ["Priority", 4414n], ["Economy", 2391n], ["International", 1103n]]),
228
+ * exceptions: new Map([["Missort", 22n]]),
229
+ * byService: new Map([
230
+ * ["Standard", { flags: new Set(["Oversize", "Fragile"]), parcels: 10482n, waiting: 68n, hours: [1183n, 2685n, 3191n, 1939n, 964n, 419n, 101n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 13n]]) }],
231
+ * ["Priority", { flags: new Set<string>(), parcels: 4414n, waiting: 29n, hours: [750n, 1367n, 1303n, 635n, 254n, 88n, 17n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 5n]]) }],
232
+ * ["Economy", { flags: new Set(["Oversize"]), parcels: 2391n, waiting: 16n, hours: [209n, 533n, 715n, 489n, 274n, 135n, 36n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 3n]]) }],
233
+ * ["International", { flags: new Set<string>(), parcels: 1103n, waiting: 7n, hours: [65n, 196n, 308n, 247n, 163n, 94n, 30n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 1n]]) }],
234
+ * ]),
235
+ * }],
236
+ * ["LBL", {
237
+ * flags: new Set(["At risk"]), equipment: new Set(["Label printer", "Scanner"]), shifts: new Set(["Late"]),
238
+ * parcels: 980n, waiting: 15n,
239
+ * hours: [20n, 59n, 137n, 255n, 273n, 157n, 59n, 20n, 0n, 0n, 0n, 0n],
240
+ * service: new Map([["Standard", 471n], ["Priority", 294n], ["Economy", 137n], ["International", 78n]]),
241
+ * exceptions: new Map([["Unreadable label", 712n], ["Address check", 268n]]),
242
+ * byService: new Map([
243
+ * ["Standard", { flags: new Set<string>(), parcels: 471n, waiting: 7n, hours: [9n, 25n, 63n, 123n, 135n, 78n, 29n, 9n, 0n, 0n, 0n, 0n], exceptions: new Map([["Unreadable label", 342n], ["Address check", 129n]]) }],
244
+ * ["Priority", { flags: new Set(["At risk"]), parcels: 294n, waiting: 5n, hours: [10n, 27n, 53n, 83n, 74n, 34n, 10n, 3n, 0n, 0n, 0n, 0n], exceptions: new Map([["Unreadable label", 214n], ["Address check", 80n]]) }],
245
+ * ["Economy", { flags: new Set<string>(), parcels: 137n, waiting: 2n, hours: [1n, 5n, 15n, 33n, 41n, 27n, 11n, 4n, 0n, 0n, 0n, 0n], exceptions: new Map([["Unreadable label", 99n], ["Address check", 38n]]) }],
246
+ * ["International", { flags: new Set<string>(), parcels: 78n, waiting: 1n, hours: [0n, 2n, 6n, 16n, 23n, 18n, 9n, 4n, 0n, 0n, 0n, 0n], exceptions: new Map([["Unreadable label", 57n], ["Address check", 21n]]) }],
247
+ * ]),
248
+ * }],
249
+ * ["CH*", {
250
+ * flags: new Set(["At risk"]), equipment: new Set(["Conveyor", "Scanner"]), shifts: new Set(["Early", "Late", "Night", "Weekend"]),
251
+ * parcels: 18290n, waiting: 140n,
252
+ * hours: [1463n, 4024n, 6218n, 4024n, 1646n, 732n, 183n, 0n, 0n, 0n, 0n, 0n],
253
+ * service: new Map([["Standard", 10425n], ["Priority", 4390n], ["Economy", 2378n], ["International", 1097n]]),
254
+ * exceptions: new Map([["Missort", 41n], ["Chute full", 26n]]),
255
+ * byService: new Map([
256
+ * ["Standard", { flags: new Set<string>(), parcels: 10425n, waiting: 80n, hours: [776n, 2242n, 3579n, 2350n, 960n, 418n, 100n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 23n], ["Chute full", 15n]]) }],
257
+ * ["Priority", { flags: new Set(["At risk"]), parcels: 4390n, waiting: 34n, hours: [512n, 1186n, 1519n, 801n, 262n, 92n, 18n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 10n], ["Chute full", 6n]]) }],
258
+ * ["Economy", { flags: new Set<string>(), parcels: 2378n, waiting: 18n, hours: [134n, 438n, 787n, 583n, 268n, 132n, 36n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 5n], ["Chute full", 3n]]) }],
259
+ * ["International", { flags: new Set<string>(), parcels: 1097n, waiting: 8n, hours: [41n, 158n, 333n, 290n, 156n, 90n, 29n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 3n], ["Chute full", 2n]]) }],
260
+ * ]),
261
+ * }],
262
+ * ["SRD", {
263
+ * flags: new Set(["Fragile"]), equipment: new Set(["Conveyor"]), shifts: new Set(["Early", "Late"]),
264
+ * parcels: 17210n, waiting: 50n,
265
+ * hours: [861n, 2065n, 4303n, 4818n, 3098n, 1377n, 516n, 172n, 0n, 0n, 0n, 0n],
266
+ * service: new Map([["Standard", 9981n], ["Priority", 4303n], ["Economy", 2065n], ["International", 861n]]),
267
+ * exceptions: new Map([["Missort", 14n], ["Damaged packaging", 6n]]),
268
+ * byService: new Map([
269
+ * ["Standard", { flags: new Set(["Fragile"]), parcels: 9981n, waiting: 29n, hours: [441n, 1128n, 2467n, 2852n, 1863n, 827n, 305n, 98n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 8n], ["Damaged packaging", 3n]]) }],
270
+ * ["Priority", { flags: new Set<string>(), parcels: 4303n, waiting: 12n, hours: [341n, 701n, 1230n, 1141n, 598n, 213n, 63n, 16n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 3n], ["Damaged packaging", 2n]]) }],
271
+ * ["Economy", { flags: new Set<string>(), parcels: 2065n, waiting: 6n, hours: [63n, 183n, 453n, 591n, 434n, 218n, 90n, 33n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 2n], ["Damaged packaging", 1n]]) }],
272
+ * ["International", { flags: new Set<string>(), parcels: 861n, waiting: 3n, hours: [16n, 53n, 153n, 234n, 203n, 119n, 58n, 25n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missort", 1n]]) }],
273
+ * ]),
274
+ * }],
275
+ * ["HLD", {
276
+ * flags: new Set(["Customs", "Hazmat", "At risk", "Cold chain", "Oversize"]), equipment: new Set(["Forklift", "X-ray", "Scanner"]), shifts: new Set(["Early", "Late"]),
277
+ * parcels: 1080n, waiting: 70n,
278
+ * hours: [0n, 11n, 22n, 54n, 97n, 151n, 183n, 162n, 173n, 130n, 65n, 32n],
279
+ * service: new Map([["Standard", 335n], ["Priority", 130n], ["Economy", 76n], ["International", 539n]]),
280
+ * exceptions: new Map([["Missing documents", 412n], ["Duty unpaid", 236n], ["Address check", 98n], ["Damaged packaging", 44n]]),
281
+ * byService: new Map([
282
+ * ["Standard", { flags: new Set(["Oversize"]), parcels: 335n, waiting: 22n, hours: [0n, 4n, 9n, 22n, 39n, 57n, 63n, 50n, 45n, 29n, 12n, 5n], exceptions: new Map([["Missing documents", 28n], ["Duty unpaid", 11n], ["Address check", 30n], ["Damaged packaging", 14n]]) }],
283
+ * ["Priority", { flags: new Set(["At risk", "Cold chain"]), parcels: 130n, waiting: 8n, hours: [0n, 5n, 8n, 15n, 22n, 26n, 23n, 14n, 10n, 5n, 2n, 0n], exceptions: new Map([["Missing documents", 11n], ["Duty unpaid", 4n], ["Address check", 12n], ["Damaged packaging", 5n]]) }],
284
+ * ["Economy", { flags: new Set(["Hazmat", "Oversize"]), parcels: 76n, waiting: 5n, hours: [0n, 1n, 1n, 3n, 7n, 11n, 14n, 12n, 12n, 9n, 4n, 2n], exceptions: new Map([["Missing documents", 7n], ["Duty unpaid", 3n], ["Address check", 7n], ["Damaged packaging", 3n]]) }],
285
+ * ["International", { flags: new Set(["Customs"]), parcels: 539n, waiting: 35n, hours: [0n, 1n, 4n, 14n, 29n, 57n, 83n, 86n, 106n, 87n, 47n, 25n], exceptions: new Map([["Missing documents", 366n], ["Duty unpaid", 218n], ["Address check", 49n], ["Damaged packaging", 22n]]) }],
286
+ * ]),
287
+ * }],
288
+ * ["CLR", {
289
+ * flags: new Set(["Customs"]), equipment: new Set(["Label printer", "Scanner", "X-ray"]), shifts: new Set(["Early", "Late"]),
290
+ * parcels: 18170n, waiting: 18n,
291
+ * hours: [1817n, 3634n, 4542n, 3634n, 2180n, 1454n, 727n, 182n, 0n, 0n, 0n, 0n],
292
+ * service: new Map([["Standard", 10175n], ["Priority", 4361n], ["Economy", 2362n], ["International", 1272n]]),
293
+ * exceptions: new Map([["Duty refund", 12n]]),
294
+ * byService: new Map([
295
+ * ["Standard", { flags: new Set<string>(), parcels: 10175n, waiting: 10n, hours: [943n, 1989n, 2575n, 2097n, 1257n, 823n, 397n, 94n, 0n, 0n, 0n, 0n], exceptions: new Map([["Duty refund", 4n]]) }],
296
+ * ["Priority", { flags: new Set<string>(), parcels: 4361n, waiting: 4n, hours: [663n, 1122n, 1166n, 762n, 367n, 193n, 74n, 14n, 0n, 0n, 0n, 0n], exceptions: new Map([["Duty refund", 2n]]) }],
297
+ * ["Economy", { flags: new Set<string>(), parcels: 2362n, waiting: 3n, hours: [159n, 377n, 551n, 506n, 342n, 253n, 137n, 37n, 0n, 0n, 0n, 0n], exceptions: new Map([["Duty refund", 1n]]) }],
298
+ * ["International", { flags: new Set(["Customs"]), parcels: 1272n, waiting: 1n, hours: [52n, 146n, 250n, 269n, 214n, 185n, 119n, 37n, 0n, 0n, 0n, 0n], exceptions: new Map([["Duty refund", 5n]]) }],
299
+ * ]),
300
+ * }],
301
+ * ["LDD", {
302
+ * flags: new Set(["Hazmat", "Oversize"]), equipment: new Set(["Forklift", "Scanner"]), shifts: new Set(["Early", "Late", "Night"]),
303
+ * parcels: 17030n, waiting: 210n,
304
+ * hours: [681n, 1362n, 2725n, 4088n, 3747n, 2384n, 1362n, 511n, 170n, 0n, 0n, 0n],
305
+ * service: new Map([["Standard", 9707n], ["Priority", 4087n], ["Economy", 2214n], ["International", 1022n]]),
306
+ * exceptions: new Map([["Vehicle late", 140n], ["Overweight", 31n]]),
307
+ * byService: new Map([
308
+ * ["Standard", { flags: new Set(["Oversize"]), parcels: 9707n, waiting: 120n, hours: [334n, 717n, 1515n, 2358n, 2205n, 1407n, 792n, 288n, 91n, 0n, 0n, 0n], exceptions: new Map([["Vehicle late", 75n], ["Overweight", 18n]]) }],
309
+ * ["Priority", { flags: new Set<string>(), parcels: 4087n, waiting: 50n, hours: [286n, 493n, 835n, 1043n, 782n, 401n, 181n, 53n, 13n, 0n, 0n, 0n], exceptions: new Map([["Vehicle late", 31n], ["Overweight", 7n]]) }],
310
+ * ["Economy", { flags: new Set(["Hazmat", "Oversize"]), parcels: 2214n, waiting: 27n, hours: [49n, 119n, 282n, 495n, 522n, 375n, 239n, 98n, 35n, 0n, 0n, 0n], exceptions: new Map([["Vehicle late", 26n], ["Overweight", 4n]]) }],
311
+ * ["International", { flags: new Set<string>(), parcels: 1022n, waiting: 13n, hours: [12n, 33n, 93n, 192n, 238n, 201n, 150n, 72n, 31n, 0n, 0n, 0n], exceptions: new Map([["Vehicle late", 8n], ["Overweight", 2n]]) }],
312
+ * ]),
313
+ * }],
314
+ * ["RCV", {
315
+ * flags: new Set(["Fragile"]), equipment: new Set(["Scanner"]), shifts: new Set(["Weekend"]),
316
+ * parcels: 640n, waiting: 25n,
317
+ * hours: [64n, 115n, 154n, 141n, 90n, 51n, 19n, 6n, 0n, 0n, 0n, 0n],
318
+ * service: new Map([["Standard", 435n], ["Priority", 128n], ["Economy", 77n]]),
319
+ * exceptions: new Map([["Missing documents", 18n]]),
320
+ * byService: new Map([
321
+ * ["Standard", { flags: new Set(["Fragile"]), parcels: 435n, waiting: 17n, hours: [39n, 75n, 104n, 98n, 64n, 37n, 14n, 4n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missing documents", 12n]]) }],
322
+ * ["Priority", { flags: new Set<string>(), parcels: 128n, waiting: 5n, hours: [19n, 29n, 33n, 25n, 13n, 6n, 2n, 1n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missing documents", 4n]]) }],
323
+ * ["Economy", { flags: new Set<string>(), parcels: 77n, waiting: 3n, hours: [6n, 11n, 17n, 18n, 13n, 8n, 3n, 1n, 0n, 0n, 0n, 0n], exceptions: new Map([["Missing documents", 2n]]) }],
324
+ * ]),
325
+ * }],
326
+ * ["INS", {
327
+ * flags: new Set(["At risk", "Customs"]), equipment: new Set(["X-ray"]), shifts: new Set(["Early"]),
328
+ * parcels: 640n, waiting: 30n,
329
+ * hours: [0n, 13n, 38n, 77n, 128n, 154n, 115n, 64n, 38n, 13n, 0n, 0n],
330
+ * service: new Map([["Standard", 435n], ["Priority", 128n], ["Economy", 77n]]),
331
+ * exceptions: new Map([["Damaged packaging", 27n]]),
332
+ * byService: new Map([
333
+ * ["Standard", { flags: new Set(["Customs"]), parcels: 435n, waiting: 20n, hours: [0n, 7n, 23n, 49n, 86n, 106n, 81n, 46n, 27n, 10n, 0n, 0n], exceptions: new Map([["Damaged packaging", 18n]]) }],
334
+ * ["Priority", { flags: new Set(["At risk"]), parcels: 128n, waiting: 6n, hours: [0n, 5n, 12n, 21n, 29n, 30n, 18n, 8n, 4n, 1n, 0n, 0n], exceptions: new Map([["Damaged packaging", 6n]]) }],
335
+ * ["Economy", { flags: new Set<string>(), parcels: 77n, waiting: 4n, hours: [0n, 1n, 3n, 7n, 13n, 18n, 16n, 10n, 7n, 2n, 0n, 0n], exceptions: new Map([["Damaged packaging", 3n]]) }],
336
+ * ]),
337
+ * }],
338
+ * ["RSD", {
339
+ * flags: new Set<string>(), equipment: new Set(["Scanner"]), shifts: new Set(["Early"]),
340
+ * parcels: 610n, waiting: 0n,
341
+ * hours: [122n, 183n, 159n, 85n, 43n, 18n, 0n, 0n, 0n, 0n, 0n, 0n],
342
+ * service: new Map([["Standard", 415n], ["Priority", 122n], ["Economy", 73n]]),
343
+ * exceptions: new Map<string, bigint>(),
344
+ * byService: new Map([
345
+ * ["Standard", { flags: new Set<string>(), parcels: 415n, waiting: 0n, hours: [78n, 123n, 110n, 60n, 31n, 13n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map<string, bigint>() }],
346
+ * ["Priority", { flags: new Set<string>(), parcels: 122n, waiting: 0n, hours: [32n, 41n, 29n, 13n, 5n, 2n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map<string, bigint>() }],
347
+ * ["Economy", { flags: new Set<string>(), parcels: 73n, waiting: 0n, hours: [12n, 19n, 20n, 12n, 7n, 3n, 0n, 0n, 0n, 0n, 0n, 0n], exceptions: new Map<string, bigint>() }],
348
+ * ]),
349
+ * }],
350
+ * ]),
351
+ * mutations: (mutation) => ({ patch: mutation.patch() }),
352
+ * // Each service's own figures, a range of the index by the service's name: what the rail's picks read.
353
+ * indexes: (index) => ({ flowchart_evidence_by_service: index.entries("byService") }),
354
+ * });
355
+ * // A row a transition with a volume: the in-place one and the one to Delivered have none, and their labels keep their evidence alone.
356
+ * export const moveEvidence = e3.record("flowchart_depot_move_evidence", DictType(StringType, MoveEvidence), {
357
+ * initial: new Map([
358
+ * ["l1", {
359
+ * region: new Map([["Metro", 8491n], ["Regional", 6092n], ["Remote", 2769n], ["Overseas", 1108n]]),
360
+ * service: new Map([["Standard", 10337n], ["Priority", 4615n], ["Economy", 2400n], ["International", 1108n]]),
361
+ * origins: new Map([["Air hub", { parcels: 5350n, late: 84n }], ["Harbour hub", { parcels: 4377n, late: 135n }], ["Rail yard", { parcels: 2233n, late: 27n }], ["Depot 02", { parcels: 1680n, late: 20n }], ["Depot 05", { parcels: 1349n, late: 9n }], ["Depot 07", { parcels: 995n, late: 13n }], ["Depot 11", { parcels: 730n, late: 4n }], ["City counter", { parcels: 619n, late: 7n }], ["Partner pickup", { parcels: 508n, late: 11n }], ["Returns desk", { parcels: 354n, late: 2n }], ["Locker bank", { parcels: 265n, late: 0n }]]),
362
+ * }],
363
+ * ["l2", {
364
+ * region: new Map([["Metro", 8459n], ["Regional", 6069n], ["Remote", 2759n], ["Overseas", 1103n]]),
365
+ * service: new Map([["Standard", 10298n], ["Priority", 4598n], ["Economy", 2391n], ["International", 1103n]]),
366
+ * origins: new Map([["Air hub", { parcels: 5330n, late: 84n }], ["Harbour hub", { parcels: 4361n, late: 134n }], ["Rail yard", { parcels: 2224n, late: 26n }], ["Depot 02", { parcels: 1674n, late: 20n }], ["Depot 05", { parcels: 1343n, late: 9n }], ["Depot 07", { parcels: 991n, late: 13n }], ["Depot 11", { parcels: 727n, late: 4n }], ["City counter", { parcels: 617n, late: 7n }], ["Partner pickup", { parcels: 507n, late: 11n }], ["Returns desk", { parcels: 352n, late: 2n }], ["Locker bank", { parcels: 264n, late: 0n }]]),
367
+ * }],
368
+ * ["l4", {
369
+ * region: new Map([["Metro", 8153n], ["Regional", 5726n], ["Remote", 2603n], ["Overseas", 868n]]),
370
+ * service: new Map([["Standard", 9889n], ["Priority", 4164n], ["Economy", 2256n], ["International", 1041n]]),
371
+ * origins: new Map([["Air hub", { parcels: 5029n, late: 79n }], ["Harbour hub", { parcels: 4114n, late: 127n }], ["Rail yard", { parcels: 2099n, late: 25n }], ["Depot 02", { parcels: 1579n, late: 19n }], ["Depot 05", { parcels: 1267n, late: 8n }], ["Depot 07", { parcels: 935n, late: 12n }], ["Depot 11", { parcels: 686n, late: 4n }], ["City counter", { parcels: 582n, late: 6n }], ["Partner pickup", { parcels: 478n, late: 10n }], ["Returns desk", { parcels: 332n, late: 2n }], ["Locker bank", { parcels: 249n, late: 0n }]]),
372
+ * }],
373
+ * ["l5", {
374
+ * region: new Map([["Metro", 8376n], ["Regional", 6009n], ["Remote", 2732n], ["Overseas", 1093n]]),
375
+ * service: new Map([["Standard", 10380n], ["Priority", 4370n], ["Economy", 2367n], ["International", 1093n]]),
376
+ * origins: new Map([["Air hub", { parcels: 5277n, late: 83n }], ["Harbour hub", { parcels: 4318n, late: 133n }], ["Rail yard", { parcels: 2203n, late: 26n }], ["Depot 02", { parcels: 1657n, late: 20n }], ["Depot 05", { parcels: 1330n, late: 9n }], ["Depot 07", { parcels: 981n, late: 13n }], ["Depot 11", { parcels: 720n, late: 4n }], ["City counter", { parcels: 611n, late: 7n }], ["Partner pickup", { parcels: 502n, late: 11n }], ["Returns desk", { parcels: 349n, late: 2n }], ["Locker bank", { parcels: 262n, late: 0n }]]),
377
+ * }],
378
+ * ["l6", {
379
+ * region: new Map([["Metro", 1179n], ["Regional", 758n], ["Remote", 421n], ["Overseas", 6062n]]),
380
+ * service: new Map([["Standard", 2610n], ["Priority", 1010n], ["Economy", 589n], ["International", 4211n]]),
381
+ * origins: new Map([["Air hub", { parcels: 2441n, late: 38n }], ["Harbour hub", { parcels: 1997n, late: 62n }], ["Rail yard", { parcels: 1018n, late: 12n }], ["Depot 02", { parcels: 766n, late: 9n }], ["Depot 05", { parcels: 615n, late: 4n }], ["Depot 07", { parcels: 454n, late: 6n }], ["Depot 11", { parcels: 333n, late: 2n }], ["City counter", { parcels: 282n, late: 3n }], ["Partner pickup", { parcels: 232n, late: 5n }], ["Returns desk", { parcels: 161n, late: 1n }], ["Locker bank", { parcels: 121n, late: 0n }]]),
382
+ * }],
383
+ * ["l7", {
384
+ * region: new Map([["Metro", 1169n], ["Regional", 752n], ["Remote", 418n], ["Overseas", 6011n]]),
385
+ * service: new Map([["Standard", 2589n], ["Priority", 1002n], ["Economy", 585n], ["International", 4174n]]),
386
+ * origins: new Map([["Air hub", { parcels: 2420n, late: 38n }], ["Harbour hub", { parcels: 1980n, late: 61n }], ["Rail yard", { parcels: 1010n, late: 12n }], ["Depot 02", { parcels: 760n, late: 9n }], ["Depot 05", { parcels: 610n, late: 4n }], ["Depot 07", { parcels: 450n, late: 6n }], ["Depot 11", { parcels: 330n, late: 2n }], ["City counter", { parcels: 280n, late: 3n }], ["Partner pickup", { parcels: 230n, late: 5n }], ["Returns desk", { parcels: 160n, late: 1n }], ["Locker bank", { parcels: 120n, late: 0n }]]),
387
+ * }],
388
+ * ["l8", {
389
+ * region: new Map([["Metro", 3296n], ["Regional", 2472n], ["Remote", 1154n], ["Overseas", 1318n]]),
390
+ * service: new Map([["Standard", 4120n], ["Priority", 1813n], ["Economy", 989n], ["International", 1318n]]),
391
+ * origins: new Map([["Air hub", { parcels: 2388n, late: 37n }], ["Harbour hub", { parcels: 1954n, late: 60n }], ["Rail yard", { parcels: 997n, late: 12n }], ["Depot 02", { parcels: 750n, late: 9n }], ["Depot 05", { parcels: 602n, late: 4n }], ["Depot 07", { parcels: 444n, late: 6n }], ["Depot 11", { parcels: 326n, late: 2n }], ["City counter", { parcels: 276n, late: 3n }], ["Partner pickup", { parcels: 227n, late: 5n }], ["Returns desk", { parcels: 158n, late: 1n }], ["Locker bank", { parcels: 118n, late: 0n }]]),
392
+ * }],
393
+ * ["l9", {
394
+ * region: new Map([["Metro", 8003n], ["Regional", 5620n], ["Remote", 2555n], ["Overseas", 852n]]),
395
+ * service: new Map([["Standard", 9876n], ["Priority", 4258n], ["Economy", 2044n], ["International", 852n]]),
396
+ * origins: new Map([["Air hub", { parcels: 4936n, late: 78n }], ["Harbour hub", { parcels: 4038n, late: 124n }], ["Rail yard", { parcels: 2060n, late: 24n }], ["Depot 02", { parcels: 1550n, late: 18n }], ["Depot 05", { parcels: 1244n, late: 8n }], ["Depot 07", { parcels: 918n, late: 12n }], ["Depot 11", { parcels: 673n, late: 4n }], ["City counter", { parcels: 571n, late: 6n }], ["Partner pickup", { parcels: 469n, late: 10n }], ["Returns desk", { parcels: 326n, late: 2n }], ["Locker bank", { parcels: 245n, late: 0n }]]),
397
+ * }],
398
+ * ["l11", {
399
+ * region: new Map([["Metro", 294n], ["Regional", 274n], ["Remote", 216n], ["Overseas", 196n]]),
400
+ * service: new Map([["Standard", 471n], ["Priority", 294n], ["Economy", 137n], ["International", 78n]]),
401
+ * origins: new Map([["Air hub", { parcels: 283n, late: 4n }], ["Harbour hub", { parcels: 232n, late: 7n }], ["Rail yard", { parcels: 119n, late: 1n }], ["Depot 02", { parcels: 89n, late: 1n }], ["Depot 05", { parcels: 72n, late: 0n }], ["Depot 07", { parcels: 53n, late: 1n }], ["Depot 11", { parcels: 39n, late: 0n }], ["City counter", { parcels: 33n, late: 0n }], ["Partner pickup", { parcels: 27n, late: 1n }], ["Returns desk", { parcels: 19n, late: 0n }], ["Locker bank", { parcels: 14n, late: 0n }]]),
402
+ * }],
403
+ * ["l12", {
404
+ * region: new Map([["Metro", 292n], ["Regional", 273n], ["Remote", 215n], ["Overseas", 195n]]),
405
+ * service: new Map([["Standard", 467n], ["Priority", 293n], ["Economy", 137n], ["International", 78n]]),
406
+ * origins: new Map([["Air hub", { parcels: 281n, late: 4n }], ["Harbour hub", { parcels: 231n, late: 7n }], ["Rail yard", { parcels: 118n, late: 1n }], ["Depot 02", { parcels: 89n, late: 1n }], ["Depot 05", { parcels: 71n, late: 0n }], ["Depot 07", { parcels: 53n, late: 1n }], ["Depot 11", { parcels: 39n, late: 0n }], ["City counter", { parcels: 33n, late: 0n }], ["Partner pickup", { parcels: 27n, late: 1n }], ["Returns desk", { parcels: 19n, late: 0n }], ["Locker bank", { parcels: 14n, late: 0n }]]),
407
+ * }],
408
+ * ["l13", {
409
+ * region: new Map([["Metro", 4570n], ["Regional", 2989n], ["Remote", 1055n], ["Overseas", 176n]]),
410
+ * service: new Map([["Standard", 5450n], ["Priority", 2285n], ["Economy", 1055n]]),
411
+ * origins: new Map([["Air hub", { parcels: 2549n, late: 40n }], ["Harbour hub", { parcels: 2084n, late: 64n }], ["Rail yard", { parcels: 1063n, late: 13n }], ["Depot 02", { parcels: 800n, late: 9n }], ["Depot 05", { parcels: 642n, late: 4n }], ["Depot 07", { parcels: 474n, late: 6n }], ["Depot 11", { parcels: 347n, late: 2n }], ["City counter", { parcels: 295n, late: 3n }], ["Partner pickup", { parcels: 242n, late: 5n }], ["Returns desk", { parcels: 168n, late: 1n }], ["Locker bank", { parcels: 126n, late: 0n }]]),
412
+ * }],
413
+ * ["r1", {
414
+ * region: new Map([["Metro", 371n], ["Regional", 192n], ["Remote", 77n]]),
415
+ * service: new Map([["Standard", 397n], ["Priority", 128n], ["Economy", 77n], ["International", 38n]]),
416
+ * origins: new Map([["Air hub", { parcels: 187n, late: 3n }], ["Harbour hub", { parcels: 152n, late: 5n }], ["Rail yard", { parcels: 77n, late: 1n }], ["Depot 02", { parcels: 58n, late: 1n }], ["Depot 05", { parcels: 47n, late: 0n }], ["Depot 07", { parcels: 34n, late: 0n }], ["Depot 11", { parcels: 25n, late: 0n }], ["City counter", { parcels: 21n, late: 0n }], ["Partner pickup", { parcels: 18n, late: 0n }], ["Returns desk", { parcels: 12n, late: 0n }], ["Locker bank", { parcels: 9n, late: 0n }]]),
417
+ * }],
418
+ * ["r2", {
419
+ * region: new Map([["Metro", 354n], ["Regional", 183n], ["Remote", 73n]]),
420
+ * service: new Map([["Standard", 378n], ["Priority", 122n], ["Economy", 73n], ["International", 37n]]),
421
+ * origins: new Map([["Air hub", { parcels: 175n, late: 3n }], ["Harbour hub", { parcels: 145n, late: 4n }], ["Rail yard", { parcels: 74n, late: 1n }], ["Depot 02", { parcels: 56n, late: 1n }], ["Depot 05", { parcels: 45n, late: 0n }], ["Depot 07", { parcels: 33n, late: 0n }], ["Depot 11", { parcels: 24n, late: 0n }], ["City counter", { parcels: 20n, late: 0n }], ["Partner pickup", { parcels: 17n, late: 0n }], ["Returns desk", { parcels: 12n, late: 0n }], ["Locker bank", { parcels: 9n, late: 0n }]]),
422
+ * }],
423
+ * ]),
424
+ * mutations: (mutation) => ({ patch: mutation.patch() }),
425
+ * });
426
+ * export const StepCard = StructType({
427
+ * name: StringType,
428
+ * group: StringType,
429
+ * values: StructType({ name: StringType, slots: OptionType(IntegerType), flow: StringType }),
430
+ * });
431
+ * export const MoveCard = StructType({
432
+ * name: StringType,
433
+ * group: StringType,
434
+ * values: StructType({
435
+ * kind: VariantType({ planned: NullType, observed: NullType }), trigger: OptionType(StringType),
436
+ * volume: OptionType(FloatType), n: OptionType(IntegerType), at: OptionType(DateTimeType), flow: StringType,
437
+ * }),
438
+ * });
439
+ * export const stepCards = e3.record("flowchart_step_cards", DictType(StringType, StepCard), {
440
+ * initial: new Map([
441
+ * ["scan", { name: "Scan point", group: "Intake", values: { name: "Scan point", slots: none, flow: "Parcels" } }],
442
+ * ["chutes", { name: "Sort chutes", group: "Sort", values: { name: "Sort chutes", slots: some(12n), flow: "Parcels" } }],
443
+ * ["desk", { name: "Exception desk", group: "Hold", values: { name: "Exception desk", slots: none, flow: "Parcels" } }],
444
+ * ]),
445
+ * indexes: (index) => ({ flowchart_step_cards_by_group: index.on(["group"]) }),
446
+ * });
447
+ * export const moveCards = e3.record("flowchart_move_cards", DictType(StringType, MoveCard), {
448
+ * initial: new Map([
449
+ * ["planned", { name: "Planned", group: "Kinds",
450
+ * values: { kind: variant("planned", null), trigger: none, volume: none, n: none, at: none, flow: "Parcels" } }],
451
+ * ["reroute", { name: "Observed reroute", group: "Kinds",
452
+ * values: { kind: variant("observed", null), trigger: none, volume: none, n: none, at: none, flow: "Parcels" } }],
453
+ * ["routed", { name: "Routed by the sort plan", group: "Decisions",
454
+ * values: { kind: variant("planned", null), trigger: some("route"), volume: none, n: none, at: none, flow: "Parcels" } }],
455
+ * ]),
456
+ * indexes: (index) => ({ flowchart_move_cards_by_group: index.on(["group"]) }),
457
+ * });
458
+ * export const LaneCard = StructType({ name: StringType, group: StringType, values: StructType({ label: StringType }) });
459
+ * export const laneCards = e3.record("flowchart_lane_cards", DictType(StringType, LaneCard), {
460
+ * initial: new Map([
461
+ * ["returns", { name: "Returns", group: "Lanes", values: { label: "Returns" } }],
462
+ * ["check", { name: "Quality check", group: "Lanes", values: { label: "Quality check" } }],
463
+ * ]),
464
+ * indexes: (index) => ({ flowchart_lane_cards_by_group: index.on(["group"]) }),
465
+ * });
466
+ * export const DecisionOwner = StructType({ name: StringType, desk: StringType });
467
+ * export const decisionOwners = e3.input("flowchart_decision_owners", DictType(StringType, DecisionOwner), variant("value", new Map([
468
+ * ["sp", { name: "sort-planner", desk: "Sort office" }],
469
+ * ["cd", { name: "customs-desk", desk: "Customs" }],
470
+ * ["ns", { name: "night-supervisor", desk: "Night shift" }],
471
+ * ])));
472
+ *
473
+ * const flowchartDepot = East.function([], UIComponentType, (_$) => (
474
+ * <Reactive>{$ => {
475
+ * // The states and the transitions: editable through their patch doors, read through their sources of the rail.
476
+ * const states = $.let(Record.bind(depotStates));
477
+ * const stateEntries = $.let(Data.bindPaged(depotStates));
478
+ * const transitions = $.let(Record.bind(depotTransitions));
479
+ * const transitionEntries = $.let(Data.bindPaged(depotTransitions));
480
+ * // The lanes and the decisions: small records, read whole.
481
+ * const lanes = $.let(Record.bind(depotLanes));
482
+ * const decisions = $.let(Record.bind(depotDecisions));
483
+ * // The details, read by the drawn rows' keys, as their kinds are read through their sources. The states'
484
+ * // evidence is bound once, its entries index listed: the rail's evidence source, and the details its picks weigh.
485
+ * const evidence = $.let(Data.bindPaged(stateEvidence, { indexes: ["flowchart_evidence_by_service"] }));
486
+ * const moveRows = $.let(Data.bindPaged(moveEvidence));
487
+ * const steps = $.let(Data.bind(stepCards));
488
+ * const moves = $.let(Data.bind(moveCards));
489
+ * const laneRows = $.let(Data.bind(laneCards));
490
+ * const owners = $.let(Data.bind(decisionOwners));
491
+ * // One rail: the states and the transitions by their flow — the states by their lane too — and each list of
492
+ * // cards by its group. The flowchart opens on the parcels' flow; a preset picks a flow for both at once.
493
+ * const slice = $.let(Slice.bindRecords("flowchart.depot", {
494
+ * states: {
495
+ * source: Data.bindPaged(depotStates, { indexes: ["flowchart_states_by_flow", "flowchart_states_by_lane"] }),
496
+ * icon: { prefix: "fas", name: "circle-nodes" },
497
+ * // Each field the rail offers is one an index answers: the flow, and the lane after it.
498
+ * fields: { flow: { label: "Flow", hints: ["Parcels", "Returns"] }, phase: { label: "Lane" } },
499
+ * initial: { flow: ["Parcels"] },
500
+ * },
501
+ * transitions: {
502
+ * source: Data.bindPaged(depotTransitions, { indexes: ["flowchart_transitions_by_flow"] }),
503
+ * icon: { prefix: "fas", name: "arrow-right-long" },
504
+ * fields: { flow: { label: "Flow", hints: ["Parcels", "Returns"] } },
505
+ * initial: { flow: ["Parcels"] },
506
+ * },
507
+ * // Each service's own figures: the services picked weigh the states' details, and narrow no row.
508
+ * evidence: {
509
+ * source: evidence,
510
+ * icon: { prefix: "fas", name: "boxes-stacked" },
511
+ * fields: { byService: { label: "Service", hints: ["Standard", "Priority", "Economy", "International"] } },
512
+ * },
513
+ * stepCards: { source: Data.bindPaged(stepCards, { indexes: ["flowchart_step_cards_by_group"] }), fields: { group: { label: "Group" } } },
514
+ * moveCards: { source: Data.bindPaged(moveCards, { indexes: ["flowchart_move_cards_by_group"] }), fields: { group: { label: "Group" } } },
515
+ * laneCards: { source: Data.bindPaged(laneCards, { indexes: ["flowchart_lane_cards_by_group"] }), fields: { group: { label: "Group" } } },
516
+ * }, { presets: [
517
+ * { id: "parcels", name: "Parcels", where: { states: { flow: ["Parcels"] }, transitions: { flow: ["Parcels"] } } },
518
+ * { id: "returns", name: "Returns", where: { states: { flow: ["Returns"] }, transitions: { flow: ["Returns"] } } },
519
+ * ] }));
520
+ * return (
521
+ * <Box height="640px">
522
+ * <Flowchart
523
+ * slice={{ slice }}
524
+ * states={Flowchart.states(states, {
525
+ * name: "State", icon: "circle-nodes", entries: stateEntries,
526
+ * label: "name", lane: "phase", order: "seq",
527
+ * members: (s) => s.slots,
528
+ * // Drawn in this order on each state's card and in the inspector, each where its show says — "all" unless given.
529
+ * // The services the rail picks weigh each read their figures hold, added up by kind; the equipment, the
530
+ * // shifts and the Service list, which they lack, draw the state's own.
531
+ * details: Flowchart.details(evidence, {
532
+ * source: "evidence",
533
+ * details: [
534
+ * Flowchart.figure("parcels", { label: "Parcels", unit: "parcels" }),
535
+ * Flowchart.figure("waiting", { label: "Still in state", show: "inspector" }),
536
+ * // each tag's look, as a Tag takes it — first defined, first shown
537
+ * Flowchart.tags("flags", {
538
+ * label: "Flags",
539
+ * colors: {
540
+ * "Hazmat": { colorPalette: "danger", variant: "solid" },
541
+ * "At risk": { colorPalette: "warning", variant: "subtle" },
542
+ * "Customs": { colorPalette: "brand", variant: "outline" },
543
+ * "Oversize": { colorPalette: "orange", variant: "subtle" },
544
+ * "Fragile": { colorPalette: "purple", variant: "subtle" },
545
+ * "Cold chain": { colorPalette: "info", variant: "subtle" },
546
+ * },
547
+ * legend: true, // the legend lists them, under "Flags"
548
+ * }),
549
+ * Flowchart.tags("equipment", {
550
+ * label: "Equipment",
551
+ * colors: {
552
+ * "Conveyor": { colorPalette: "teal" }, // subtle unless given
553
+ * "Scanner": { colorPalette: "blue" },
554
+ * "Forklift": { colorPalette: "gray", variant: "outline" },
555
+ * "Label printer": { colorPalette: "purple", variant: "outline" },
556
+ * "X-ray": { colorPalette: "info", variant: "outline" },
557
+ * },
558
+ * legend: true,
559
+ * }),
560
+ * Flowchart.tags("shifts", {
561
+ * label: "Shifts",
562
+ * colors: {
563
+ * "Early": { colorPalette: "yellow" },
564
+ * "Late": { colorPalette: "orange" },
565
+ * "Night": { colorPalette: "purple", variant: "solid" },
566
+ * "Weekend": { colorPalette: "gray" },
567
+ * },
568
+ * }),
569
+ * // the app's bins, in hours — a quarter hour apiece at first, then hours, days and a
570
+ * // week — a bar each whatever its span, on an axis naming 1h, 12h, 2d and 1w
571
+ * Flowchart.histogram("hours", {
572
+ * unit: "hours", label: "Time in state", counts: "parcels",
573
+ * bins: [0, 0.25, 0.5, 1, 2, 4, 8, 12, 24, 48, 96, 168],
574
+ * ticks: [1, 12, 48, 168],
575
+ * }),
576
+ * Flowchart.list("service", { label: "Service", top: 2, unit: "parcels" }),
577
+ * Flowchart.list("exceptions", { label: "Exceptions", unit: "parcels", show: "inspector" }),
578
+ * ],
579
+ * }),
580
+ * // the Steps tab's cards: a card dropped on a lane adds a state there, from its values
581
+ * templates: Flowchart.templates(steps.read(), {
582
+ * name: (c) => c.name, group: (c) => some(c.group), values: (c) => c.values, source: "stepCards",
583
+ * }),
584
+ * })}
585
+ * transitions={Flowchart.transitions(transitions, {
586
+ * name: "Transition", icon: "arrow-right-long", entries: transitionEntries,
587
+ * from: "src", to: "dst", decision: "trigger",
588
+ * kind: (t) => t.kind,
589
+ * evidence: (t) => some({ volume: t.volume, count: t.n, measuredAt: t.at, unit: some("parcels") }),
590
+ * // Evidence shows them, so the form leaves them out.
591
+ * fields: { volume: Fields.hidden(), n: Fields.hidden(), at: Fields.hidden() },
592
+ * // The label draws the region under its evidence; the inspector shows all three.
593
+ * details: Flowchart.details(moveRows, {
594
+ * details: [
595
+ * Flowchart.list("region", { label: "Region", top: 1, unit: "parcels" }),
596
+ * Flowchart.list("service", { label: "Service", unit: "parcels", show: "inspector" }),
597
+ * // a Dict of structs: its draw says which number is the value, and a note
598
+ * Flowchart.list("origins", { label: "Origin", unit: "parcels", show: "inspector" },
599
+ * (o) => ({ value: o.parcels, note: some(East.str`${o.late} late`) })),
600
+ * ],
601
+ * }),
602
+ * // the Transitions tab's cards: a card dropped on a transition gives it its values
603
+ * templates: Flowchart.templates(moves.read(), {
604
+ * name: (c) => c.name, group: (c) => some(c.group), values: (c) => c.values, source: "moveCards",
605
+ * }),
606
+ * })}
607
+ * lanes={Flowchart.lanes(lanes, {
608
+ * label: "label", order: "seq",
609
+ * // the Lanes tab's cards: one dropped between two lanes adds a lane there, from its values
610
+ * templates: Flowchart.templates(laneRows.read(), {
611
+ * name: (c) => c.name, group: (c) => some(c.group), values: (c) => c.values, source: "laneCards",
612
+ * }),
613
+ * })}
614
+ * decisions={Flowchart.decisions(decisions, { label: (d) => d.name, owner: (d) => some(d.owner) })}
615
+ * library={[
616
+ * Flowchart.library.states(), // Steps: the states' cards, by group
617
+ * Flowchart.library.transitions(), // Transitions: the transitions' cards
618
+ * Flowchart.library.lanes(), // Lanes: the lanes' cards
619
+ * Flowchart.library.tab(owners.read(), {
620
+ * name: "Owners", icon: "user-tie", label: (o) => o.name, meta: (o) => some(o.desk),
621
+ * // its patch is over a decision's row: dropped on a diamond, the card sets the decision's owner
622
+ * drop: (o) => Flowchart.patch(DepotDecision, { owner: o.name }),
623
+ * }),
624
+ * ]}
625
+ * freshness={{ label: "evidence-2026.06", date: new Date("2026-06-30T00:00:00Z") }}
626
+ * name="depot"
627
+ * />
628
+ * </Box>
629
+ * );
630
+ * }}</Reactive>
631
+ * ));
632
+ * ```
633
+ */
634
+ export declare function flowchartTemplates<C extends EastType, V extends StructType>(rows: SubtypeExprOrValue<DictType<StringType, C>>, spec: FlowchartTemplatesSpec<C, V>): FlowchartTemplates<V>;
635
+ /**
636
+ * Whether a kind's `templates` is a list of cards over a record.
637
+ *
638
+ * @param templates - What a kind was given
639
+ * @returns Whether it is `Flowchart.templates`'
640
+ */
641
+ export declare function isFlowchartTemplates(templates: unknown): templates is FlowchartTemplates<StructType>;
642
+ /**
643
+ * Checks a kind's cards: `Flowchart.templates`', never a list written in the
644
+ * code, their values of the type a drop of the kind takes.
645
+ *
646
+ * @param templates - What the kind was given
647
+ * @param expected - The row's fields less what a drop writes
648
+ * @param placed - The fields a drop writes, which the values leave out
649
+ * @param where - The kind, as a refusal names it
650
+ * @returns The cards on the wire, and the source they follow; `undefined` for a kind with no cards
651
+ * @throws {Error} When they are not `Flowchart.templates`', or their values are of another type, naming both
652
+ */
653
+ export declare function checkedFlowchartTemplates(templates: unknown, expected: StructType, placed: readonly string[], where: string): {
654
+ readonly items: ExprType<ArrayType<FlowchartTemplateType>>;
655
+ readonly source: string | undefined;
656
+ } | undefined;
657
+ //# sourceMappingURL=templates.d.ts.map