@pisell/private-materials 6.12.167 → 6.12.169

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 (231) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +10 -10
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +10 -10
  9. package/es/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
  10. package/es/components/HDLKiosk/app/manifest.js +11 -11
  11. package/es/components/HDLKiosk/app/operations.js +92 -0
  12. package/es/components/HDLKiosk/app/workflow/barcode.js +11 -13
  13. package/es/components/HDLKiosk/app/workflow/index.js +16 -0
  14. package/es/components/HDLKiosk/app/workflow/predicates.js +1 -1
  15. package/es/components/HDLKiosk/app/workflow/quick.js +1 -1
  16. package/es/components/HDLKiosk/app/workflow/registry.js +4 -4
  17. package/es/components/HDLKiosk/app/workflow/scale.js +5 -1
  18. package/es/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
  19. package/es/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +105 -101
  20. package/es/components/HDLKiosk/docs/03-/344/270/232/345/212/241/346/265/201/347/250/213/344/270/216/344/272/244/344/272/222/350/247/204/345/210/231.md +2 -2
  21. package/es/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
  22. package/es/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
  23. package/es/components/HDLKiosk/docs/07-/345/220/216/347/273/255/345/267/245/344/275/234.md +1 -1
  24. package/es/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
  25. package/es/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
  26. package/es/components/HDLKiosk/docs/README.md +6 -2
  27. package/es/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
  28. package/es/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
  29. package/es/components/HDLKiosk/index.js +22 -28
  30. package/es/components/HDLKiosk/index.less +1 -1
  31. package/es/components/HDLKiosk/kernel/README.md +14 -13
  32. package/es/components/HDLKiosk/kernel/application/defineApplication.js +63 -24
  33. package/es/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
  34. package/es/components/HDLKiosk/kernel/application/runtime.js +237 -0
  35. package/es/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
  36. package/es/components/HDLKiosk/kernel/operations/registry.js +3 -3
  37. package/es/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
  38. package/es/components/HDLKiosk/kernel/operations/types.js +7 -3
  39. package/es/components/HDLKiosk/kernel/workflow/actor.js +51 -22
  40. package/es/components/HDLKiosk/kernel/workflow/compiler.js +23 -30
  41. package/es/components/HDLKiosk/runtime/createRuntime.js +238 -0
  42. package/es/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
  43. package/es/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
  44. package/es/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +18 -24
  45. package/es/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
  46. package/es/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
  47. package/es/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
  48. package/es/components/HDLKiosk/runtime/operations/barcode.js +18 -0
  49. package/es/components/HDLKiosk/runtime/operations/cart.js +44 -0
  50. package/es/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
  51. package/es/components/HDLKiosk/{app → runtime}/operations/checkout.js +95 -110
  52. package/es/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
  53. package/es/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
  54. package/es/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
  55. package/es/components/HDLKiosk/runtime/operations/customization.js +70 -0
  56. package/es/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
  57. package/es/components/HDLKiosk/runtime/operations/fulfillment.js +6 -0
  58. package/es/components/HDLKiosk/runtime/operations/identity.js +55 -0
  59. package/es/components/HDLKiosk/runtime/operations/registry.js +34 -0
  60. package/es/components/HDLKiosk/runtime/operations/session.js +29 -0
  61. package/es/components/HDLKiosk/runtime/operations/types.js +13 -0
  62. package/es/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
  63. package/es/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +67 -17
  64. package/es/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
  65. package/es/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
  66. package/es/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
  67. package/es/components/HDLKiosk/runtime/triggers.js +28 -0
  68. package/es/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
  69. package/es/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
  70. package/es/components/HDLKiosk/slices/catalog/slice.js +2 -2
  71. package/es/components/HDLKiosk/slices/customization/Screen/index.js +37 -38
  72. package/es/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
  73. package/es/components/HDLKiosk/slices/customization/slice.js +3 -4
  74. package/es/components/HDLKiosk/slices/fulfillment/slice.js +2 -2
  75. package/es/components/HDLKiosk/slices/fulfillment/view.js +1 -1
  76. package/es/components/HDLKiosk/slices/identity/Screen/index.js +2 -2
  77. package/es/components/HDLKiosk/slices/identity/slice.js +3 -3
  78. package/es/components/HDLKiosk/slices/identity/view.js +1 -1
  79. package/es/components/HDLKiosk/slices/payment/slice.js +3 -3
  80. package/es/components/HDLKiosk/slices/primaryProductPrompt/slice.js +2 -2
  81. package/es/components/HDLKiosk/slices/primaryProductPrompt/view.js +2 -2
  82. package/es/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +45 -131
  83. package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +387 -0
  84. package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
  85. package/es/components/HDLKiosk/{app → ui}/ScreenRenderer.js +7 -7
  86. package/es/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +66 -0
  87. package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
  88. package/es/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +25 -0
  89. package/es/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +53 -0
  90. package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
  91. package/es/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +39 -0
  92. package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
  93. package/es/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
  94. package/es/components/HDLKiosk/ui/scale.js +20 -0
  95. package/es/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -8
  96. package/es/components/HDLKiosk/{app → ui}/views.js +1 -1
  97. package/es/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
  98. package/es/components/HDLKiosk/utils.js +4 -4
  99. package/es/components/bigSale/templates/HDLKiosk/adapter/HDLKioskPaymentRuntime.js +2 -1
  100. package/es/components/bigSale/templates/HDLKiosk/adapter/capabilities.js +1 -1
  101. package/es/components/bigSale/templates/HDLKiosk/adapter/projection.js +21 -11
  102. package/es/components/bigSale/templates/HDLKiosk/adapter/sales.js +21 -3
  103. package/es/components/bigSale/templates/HDLKiosk/adapter/scaleTrigger.js +20 -5
  104. package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +3 -0
  105. package/es/components/bigSale/templates/HDLKiosk/index.js +3 -3
  106. package/lib/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
  107. package/lib/components/HDLKiosk/app/manifest.js +18 -19
  108. package/lib/components/HDLKiosk/app/operations.js +105 -0
  109. package/lib/components/HDLKiosk/app/workflow/barcode.js +11 -13
  110. package/lib/components/HDLKiosk/app/workflow/index.js +16 -0
  111. package/lib/components/HDLKiosk/app/workflow/predicates.js +1 -0
  112. package/lib/components/HDLKiosk/app/workflow/quick.js +1 -1
  113. package/lib/components/HDLKiosk/app/workflow/registry.js +3 -3
  114. package/lib/components/HDLKiosk/app/workflow/scale.js +5 -1
  115. package/lib/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
  116. package/lib/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +105 -101
  117. package/lib/components/HDLKiosk/docs/03-/344/270/232/345/212/241/346/265/201/347/250/213/344/270/216/344/272/244/344/272/222/350/247/204/345/210/231.md +2 -2
  118. package/lib/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
  119. package/lib/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
  120. package/lib/components/HDLKiosk/docs/07-/345/220/216/347/273/255/345/267/245/344/275/234.md +1 -1
  121. package/lib/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
  122. package/lib/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
  123. package/lib/components/HDLKiosk/docs/README.md +6 -2
  124. package/lib/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
  125. package/lib/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
  126. package/lib/components/HDLKiosk/index.js +25 -31
  127. package/lib/components/HDLKiosk/index.less +1 -1
  128. package/lib/components/HDLKiosk/kernel/README.md +14 -13
  129. package/lib/components/HDLKiosk/kernel/application/defineApplication.js +65 -25
  130. package/lib/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
  131. package/lib/components/HDLKiosk/kernel/application/runtime.js +237 -0
  132. package/lib/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
  133. package/lib/components/HDLKiosk/kernel/operations/registry.js +3 -3
  134. package/lib/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
  135. package/lib/components/HDLKiosk/kernel/operations/types.js +8 -3
  136. package/lib/components/HDLKiosk/kernel/workflow/actor.js +51 -22
  137. package/lib/components/HDLKiosk/kernel/workflow/compiler.js +23 -30
  138. package/lib/components/HDLKiosk/runtime/createRuntime.js +239 -0
  139. package/lib/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
  140. package/lib/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
  141. package/lib/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +17 -27
  142. package/lib/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
  143. package/lib/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
  144. package/lib/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
  145. package/lib/components/HDLKiosk/runtime/operations/barcode.js +17 -0
  146. package/lib/components/HDLKiosk/runtime/operations/cart.js +46 -0
  147. package/lib/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
  148. package/lib/components/HDLKiosk/{app → runtime}/operations/checkout.js +97 -112
  149. package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
  150. package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
  151. package/lib/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
  152. package/lib/components/HDLKiosk/runtime/operations/customization.js +73 -0
  153. package/lib/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
  154. package/lib/components/HDLKiosk/runtime/operations/fulfillment.js +5 -0
  155. package/lib/components/HDLKiosk/runtime/operations/identity.js +55 -0
  156. package/lib/components/HDLKiosk/runtime/operations/registry.js +34 -0
  157. package/lib/components/HDLKiosk/runtime/operations/session.js +30 -0
  158. package/lib/components/HDLKiosk/runtime/operations/types.js +14 -0
  159. package/lib/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
  160. package/lib/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +71 -21
  161. package/lib/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
  162. package/lib/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
  163. package/lib/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
  164. package/lib/components/HDLKiosk/runtime/triggers.js +28 -0
  165. package/lib/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
  166. package/lib/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
  167. package/lib/components/HDLKiosk/slices/catalog/slice.js +3 -3
  168. package/lib/components/HDLKiosk/slices/customization/Screen/index.js +38 -39
  169. package/lib/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
  170. package/lib/components/HDLKiosk/slices/customization/slice.js +5 -6
  171. package/lib/components/HDLKiosk/slices/fulfillment/slice.js +3 -3
  172. package/lib/components/HDLKiosk/slices/fulfillment/view.js +1 -1
  173. package/lib/components/HDLKiosk/slices/identity/Screen/index.js +2 -2
  174. package/lib/components/HDLKiosk/slices/identity/slice.js +4 -4
  175. package/lib/components/HDLKiosk/slices/identity/view.js +1 -1
  176. package/lib/components/HDLKiosk/slices/payment/slice.js +5 -5
  177. package/lib/components/HDLKiosk/slices/primaryProductPrompt/slice.js +2 -2
  178. package/lib/components/HDLKiosk/slices/primaryProductPrompt/view.js +2 -2
  179. package/lib/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +46 -132
  180. package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +390 -0
  181. package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
  182. package/lib/components/HDLKiosk/{app → ui}/ScreenRenderer.js +7 -7
  183. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +67 -0
  184. package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
  185. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +26 -0
  186. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +54 -0
  187. package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
  188. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +40 -0
  189. package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
  190. package/lib/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
  191. package/lib/components/HDLKiosk/ui/scale.js +24 -0
  192. package/lib/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -7
  193. package/lib/components/HDLKiosk/{app → ui}/views.js +1 -1
  194. package/lib/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
  195. package/lib/components/HDLKiosk/utils.js +4 -4
  196. package/lib/components/bigSale/templates/HDLKiosk/adapter/HDLKioskPaymentRuntime.js +2 -1
  197. package/lib/components/bigSale/templates/HDLKiosk/adapter/capabilities.js +1 -1
  198. package/lib/components/bigSale/templates/HDLKiosk/adapter/projection.js +21 -10
  199. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales.js +20 -2
  200. package/lib/components/bigSale/templates/HDLKiosk/adapter/scaleTrigger.js +19 -4
  201. package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +3 -0
  202. package/lib/components/bigSale/templates/HDLKiosk/index.js +4 -4
  203. package/package.json +2 -2
  204. package/es/components/HDLKiosk/app/constants.js +0 -9
  205. package/es/components/HDLKiosk/app/operations/barcode.js +0 -22
  206. package/es/components/HDLKiosk/app/operations/cart.js +0 -60
  207. package/es/components/HDLKiosk/app/operations/fulfillment.js +0 -11
  208. package/es/components/HDLKiosk/app/operations/session.js +0 -41
  209. package/es/components/HDLKiosk/app/operations/types.js +0 -11
  210. package/es/components/HDLKiosk/devices/entryArbiter.js +0 -33
  211. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -75
  212. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -160
  213. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -185
  214. package/es/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -12
  215. package/es/components/HDLKiosk/slices/customization/operation.js +0 -80
  216. package/es/components/HDLKiosk/slices/identity/operation.js +0 -60
  217. package/lib/components/HDLKiosk/app/constants.js +0 -9
  218. package/lib/components/HDLKiosk/app/operations/barcode.js +0 -21
  219. package/lib/components/HDLKiosk/app/operations/cart.js +0 -62
  220. package/lib/components/HDLKiosk/app/operations/fulfillment.js +0 -10
  221. package/lib/components/HDLKiosk/app/operations/session.js +0 -42
  222. package/lib/components/HDLKiosk/app/operations/types.js +0 -12
  223. package/lib/components/HDLKiosk/devices/entryArbiter.js +0 -33
  224. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -76
  225. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -161
  226. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -186
  227. package/lib/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -13
  228. package/lib/components/HDLKiosk/slices/customization/operation.js +0 -83
  229. package/lib/components/HDLKiosk/slices/identity/operation.js +0 -60
  230. /package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
  231. /package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
@@ -0,0 +1,60 @@
1
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ //#region src/components/HDLKiosk/runtime/devices/scannerSessionPort.ts
3
+ const NON_WRITABLE_ACTIVITIES = new Set(["paymentCompleted"]);
4
+ const PAYMENT_OPERATION_IDS = new Set([
5
+ "checkout.open",
6
+ "checkout.payEftpos",
7
+ "checkout.requestStaffPaymentApproval",
8
+ "session.reset"
9
+ ]);
10
+ function isPaymentFrozen(host) {
11
+ const status = host.sales.getObservedSnapshot().payment.status;
12
+ return status === "pending" || status === "unknown" || status === "succeeded";
13
+ }
14
+ function isHDLKioskSessionCartWritable(session) {
15
+ var _session$definition$n;
16
+ const snapshot = session.actor.getSnapshot();
17
+ if (snapshot.status === "blocked" || snapshot.status === "finished") return false;
18
+ const activity = (_session$definition$n = session.definition.nodes[snapshot.nodeId]) === null || _session$definition$n === void 0 ? void 0 : _session$definition$n.activity;
19
+ if (!activity || NON_WRITABLE_ACTIVITIES.has(activity)) return false;
20
+ return !(snapshot.activeOperation && PAYMENT_OPERATION_IDS.has(snapshot.activeOperation.definitionId));
21
+ }
22
+ function createHDLKioskScannerSessionPort(host, session) {
23
+ return Object.freeze({
24
+ id: session.id,
25
+ sessionEpoch: () => session.actor.getSnapshot().sessionEpoch,
26
+ decideConsume: () => {
27
+ if (isPaymentFrozen(host)) return {
28
+ status: "rejected",
29
+ reason: "paymentFrozen"
30
+ };
31
+ return isHDLKioskSessionCartWritable(session) ? { status: "accepted" } : {
32
+ status: "rejected",
33
+ reason: "sessionNotCartWritable"
34
+ };
35
+ },
36
+ beforeConsume: () => {
37
+ const pendingNavigation = session.actor.getSnapshot().pendingNavigation;
38
+ if (pendingNavigation) session.actor.resolvePendingNavigation(pendingNavigation.navigationId, "cancel");
39
+ },
40
+ consume: function() {
41
+ var _ref = _asyncToGenerator(function* ({ code, eventId }) {
42
+ const sessionEpoch = session.actor.getSnapshot().sessionEpoch;
43
+ const result = yield session.executeCommand("barcode.consume", { code }, `scan:${sessionEpoch}:${eventId}`);
44
+ if (result.status === "succeeded") return {
45
+ operationStatus: result.status,
46
+ queueDirective: result.data.code === "requiresSelection" ? "pauseForSelection" : "continue"
47
+ };
48
+ return {
49
+ operationStatus: result.status,
50
+ queueDirective: result.status === "partialFailure" || result.status === "unknown" ? "stopUncertain" : "continue"
51
+ };
52
+ });
53
+ return function consume(_x) {
54
+ return _ref.apply(this, arguments);
55
+ };
56
+ }()
57
+ });
58
+ }
59
+ //#endregion
60
+ export { createHDLKioskScannerSessionPort };
@@ -0,0 +1,212 @@
1
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ import { createScannerIngress } from "./scannerIngress.js";
3
+ //#region src/components/HDLKiosk/runtime/devices/scannerSessionRouter.ts
4
+ function createScannerSessionRouter({ host, entrySupported, maxPendingEvents = 5 }) {
5
+ const ingress = createScannerIngress({ maxPendingEvents });
6
+ let phase = "idle";
7
+ let activeStartId;
8
+ let listening = false;
9
+ let session;
10
+ let queue = [];
11
+ let currentTask;
12
+ let processing = false;
13
+ let generation = 0;
14
+ let rejectionSequence = 0;
15
+ const emitRejected = (task, reason) => {
16
+ rejectionSequence += 1;
17
+ try {
18
+ host.telemetry.emit({
19
+ name: "hdlKiosk.device.eventRejected",
20
+ traceId: `hdl-scanner-rejected-${rejectionSequence}`,
21
+ occurredAt: Date.now(),
22
+ attributes: {
23
+ eventType: task.event.type,
24
+ eventId: task.event.eventId,
25
+ reason
26
+ }
27
+ });
28
+ } catch (_unused) {}
29
+ };
30
+ const rejectQueue = (reason) => {
31
+ const rejected = queue;
32
+ queue = [];
33
+ rejected.forEach((task) => emitRejected(task, reason));
34
+ };
35
+ const emitCompleted = (task, target, result, stale) => {
36
+ try {
37
+ host.telemetry.emit({
38
+ name: "hdlKiosk.scanner.taskFinished",
39
+ traceId: `hdl-scan:${target.sessionEpoch()}:${task.event.eventId}`,
40
+ occurredAt: Date.now(),
41
+ attributes: {
42
+ eventId: task.event.eventId,
43
+ sessionEpoch: target.sessionEpoch(),
44
+ status: result.operationStatus,
45
+ stale
46
+ }
47
+ });
48
+ } catch (_unused2) {}
49
+ };
50
+ const processQueue = function() {
51
+ var _ref = _asyncToGenerator(function* () {
52
+ if (processing || phase !== "active" || !listening || !session) return;
53
+ processing = true;
54
+ const processGeneration = generation;
55
+ try {
56
+ while (phase === "active" && listening && generation === processGeneration && session && queue.length > 0) {
57
+ const target = session;
58
+ const task = queue.shift();
59
+ if (!task) continue;
60
+ const decision = target.decideConsume();
61
+ if (decision.status === "rejected") {
62
+ emitRejected(task, decision.reason);
63
+ continue;
64
+ }
65
+ let result;
66
+ try {
67
+ var _target$beforeConsume;
68
+ (_target$beforeConsume = target.beforeConsume) === null || _target$beforeConsume === void 0 || _target$beforeConsume.call(target);
69
+ currentTask = task;
70
+ result = yield target.consume({
71
+ eventId: task.event.eventId,
72
+ code: task.code
73
+ });
74
+ } catch (_unused3) {
75
+ currentTask = void 0;
76
+ emitRejected(task, "scanExecutionFailed");
77
+ rejectQueue("previousScanExecutionFailed");
78
+ break;
79
+ }
80
+ currentTask = void 0;
81
+ const stale = generation !== processGeneration || phase !== "active" || !listening || session !== target;
82
+ emitCompleted(task, target, result, stale);
83
+ if (stale) break;
84
+ if (result.queueDirective === "pauseForSelection") {
85
+ rejectQueue("barcodeSelectionPending");
86
+ break;
87
+ }
88
+ if (result.queueDirective === "stopUncertain") {
89
+ rejectQueue("previousScanResultUncertain");
90
+ break;
91
+ }
92
+ }
93
+ } finally {
94
+ currentTask = void 0;
95
+ processing = false;
96
+ if (phase === "active" && listening && queue.length > 0) processQueue();
97
+ }
98
+ });
99
+ return function processQueue() {
100
+ return _ref.apply(this, arguments);
101
+ };
102
+ }();
103
+ const beginSessionStart = (startId) => {
104
+ if (!startId.trim() || phase === "disposed" || phase === "active") return false;
105
+ if (phase === "starting") return activeStartId === startId;
106
+ phase = "starting";
107
+ activeStartId = startId;
108
+ return true;
109
+ };
110
+ const failSessionStart = (startId, reason = "sessionStartFailed") => {
111
+ if (phase !== "starting" || activeStartId !== startId) return false;
112
+ generation += 1;
113
+ rejectQueue(reason);
114
+ activeStartId = void 0;
115
+ session = void 0;
116
+ phase = "idle";
117
+ return true;
118
+ };
119
+ const triggerAdapter = Object.freeze({
120
+ trigger: "onScan",
121
+ activate: ({ emit }) => {
122
+ if (phase === "disposed") return void 0;
123
+ listening = true;
124
+ const unsubscribe = host.devices.subscribe((event) => {
125
+ if (!listening || phase === "disposed" || event.type !== "barcode") return;
126
+ const target = session;
127
+ const decision = target === null || target === void 0 ? void 0 : target.decideConsume();
128
+ const rejectedReason = (decision === null || decision === void 0 ? void 0 : decision.status) === "rejected" ? decision.reason : void 0;
129
+ const result = ingress.accept(event, {
130
+ active: listening,
131
+ supported: host.capabilities.scanner.available && (phase !== "idle" || entrySupported),
132
+ workflowLocked: false,
133
+ nodeAcceptsEvent: phase !== "active" || (decision === null || decision === void 0 ? void 0 : decision.status) === "accepted" || rejectedReason === "paymentFrozen",
134
+ paymentFrozen: phase === "active" && rejectedReason === "paymentFrozen",
135
+ pendingEventCount: queue.length + (currentTask ? 1 : 0)
136
+ });
137
+ if (result.status === "rejected") {
138
+ emitRejected({
139
+ event,
140
+ code: event.code
141
+ }, result.reason);
142
+ return;
143
+ }
144
+ const task = {
145
+ event: result.event,
146
+ code: result.code
147
+ };
148
+ queue.push(task);
149
+ if (phase === "active") {
150
+ processQueue();
151
+ return;
152
+ }
153
+ if (phase === "starting") return;
154
+ const startId = `device:scanner:${result.event.eventId}`;
155
+ if (!beginSessionStart(startId)) {
156
+ queue.pop();
157
+ emitRejected(task, "sessionStartConflict");
158
+ return;
159
+ }
160
+ emit({
161
+ channel: "product",
162
+ occurrenceId: result.event.eventId,
163
+ correlationId: startId
164
+ }).then((startResult) => {
165
+ if (startResult.status === "rejected") failSessionStart(startId, startResult.reason);
166
+ }).catch(() => failSessionStart(startId, "sessionStartFailed"));
167
+ }, { sources: ["scanner"] });
168
+ return () => {
169
+ listening = false;
170
+ generation += 1;
171
+ rejectQueue("inactive");
172
+ if (phase === "starting" && activeStartId) failSessionStart(activeStartId, "inactive");
173
+ unsubscribe();
174
+ };
175
+ }
176
+ });
177
+ return Object.freeze({
178
+ triggerAdapter,
179
+ beginSessionStart,
180
+ bindSession: (startId, nextSession) => {
181
+ if (phase !== "starting" || activeStartId !== startId) return false;
182
+ activeStartId = void 0;
183
+ session = nextSession;
184
+ phase = "active";
185
+ processQueue();
186
+ return true;
187
+ },
188
+ failSessionStart,
189
+ releaseSession: (sessionId) => {
190
+ if ((session === null || session === void 0 ? void 0 : session.id) !== sessionId) return false;
191
+ generation += 1;
192
+ rejectQueue("sessionDisposed");
193
+ activeStartId = void 0;
194
+ session = void 0;
195
+ phase = "idle";
196
+ ingress.reset();
197
+ return true;
198
+ },
199
+ dispose: () => {
200
+ if (phase === "disposed") return;
201
+ generation += 1;
202
+ rejectQueue("inactive");
203
+ activeStartId = void 0;
204
+ session = void 0;
205
+ listening = false;
206
+ phase = "disposed";
207
+ ingress.reset();
208
+ }
209
+ });
210
+ }
211
+ //#endregion
212
+ export { createScannerSessionRouter };
@@ -0,0 +1,18 @@
1
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ import { barcodeConsumeOperation } from "../../app/operations.js";
3
+ import { finalizeCartMutation } from "./cartConsistency.js";
4
+ import { bindOperation } from "./types.js";
5
+ //#region src/components/HDLKiosk/runtime/operations/barcode.ts
6
+ const barcodeConsumeOperationBinding = bindOperation(barcodeConsumeOperation, { execute: function() {
7
+ var _ref = _asyncToGenerator(function* (context, input, signal) {
8
+ const beforeFingerprint = context.host.sales.getObservedSnapshot().fingerprint.value;
9
+ const mutation = yield context.host.sales.consumeBarcode(input.code, signal);
10
+ if (mutation.status === "succeeded" && mutation.data.code === "requiresSelection") return mutation;
11
+ return finalizeCartMutation(context, mutation, signal, () => mutation.status === "succeeded" && mutation.data.code === "added" && mutation.data.cartChangeConfirmed === true || context.host.sales.getObservedSnapshot().fingerprint.value !== beforeFingerprint);
12
+ });
13
+ return function execute(_x, _x2, _x3) {
14
+ return _ref.apply(this, arguments);
15
+ };
16
+ }() });
17
+ //#endregion
18
+ export { barcodeConsumeOperationBinding };
@@ -0,0 +1,44 @@
1
+ import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
+ import { cartAddProductOperation, cartRemoveLineOperation, cartUpdateQuantityOperation } from "../../app/operations.js";
3
+ import { finalizeCartMutation } from "./cartConsistency.js";
4
+ import { bindOperation } from "./types.js";
5
+ //#region src/components/HDLKiosk/runtime/operations/cart.ts
6
+ const cartAddProductOperationBinding = bindOperation(cartAddProductOperation, { execute: function() {
7
+ var _ref = _asyncToGenerator(function* (context, input, signal) {
8
+ return finalizeCartMutation(context, yield context.host.sales.addProduct(input, signal), signal);
9
+ });
10
+ return function execute(_x, _x2, _x3) {
11
+ return _ref.apply(this, arguments);
12
+ };
13
+ }() });
14
+ const cartUpdateQuantityOperationBinding = bindOperation(cartUpdateQuantityOperation, { execute: function() {
15
+ var _ref2 = _asyncToGenerator(function* (context, input, signal) {
16
+ const mutation = yield context.host.sales.updateQuantity(input, signal);
17
+ return finalizeCartMutation(context, mutation, signal, () => {
18
+ var _mutation$data$confir;
19
+ if (mutation.status === "succeeded" && mutation.data.affectedLineId === input.lineId && ((_mutation$data$confir = mutation.data.confirmedLine) === null || _mutation$data$confir === void 0 ? void 0 : _mutation$data$confir.lineId) === input.lineId && decimalValuesEqual(mutation.data.confirmedLine.quantity, input.quantity)) return true;
20
+ const line = context.host.sales.getObservedSnapshot().cart.lines.find((item) => item.lineId === input.lineId);
21
+ return decimalValuesEqual(line === null || line === void 0 ? void 0 : line.quantity, input.quantity);
22
+ });
23
+ });
24
+ return function execute(_x4, _x5, _x6) {
25
+ return _ref2.apply(this, arguments);
26
+ };
27
+ }() });
28
+ function decimalValuesEqual(left, right) {
29
+ if (left === void 0) return false;
30
+ const leftNumber = Number(left);
31
+ const rightNumber = Number(right);
32
+ return Number.isFinite(leftNumber) && Number.isFinite(rightNumber) && leftNumber === rightNumber;
33
+ }
34
+ const cartRemoveLineOperationBinding = bindOperation(cartRemoveLineOperation, { execute: function() {
35
+ var _ref3 = _asyncToGenerator(function* (context, input, signal) {
36
+ const mutation = yield context.host.sales.removeLine(input, signal);
37
+ return finalizeCartMutation(context, mutation, signal, () => mutation.status === "succeeded" && mutation.data.removedLineId === input.lineId || !context.host.sales.getObservedSnapshot().cart.lines.some((item) => item.lineId === input.lineId));
38
+ });
39
+ return function execute(_x7, _x8, _x9) {
40
+ return _ref3.apply(this, arguments);
41
+ };
42
+ }() });
43
+ //#endregion
44
+ export { cartAddProductOperationBinding, cartRemoveLineOperationBinding, cartUpdateQuantityOperationBinding };
@@ -1,6 +1,6 @@
1
1
  import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
2
2
  import { createOperationError, operationUnknown } from "./errors.js";
3
- //#region src/components/HDLKiosk/app/operations/cartConsistency.ts
3
+ //#region src/components/HDLKiosk/runtime/operations/cartConsistency.ts
4
4
  function finalizeCartMutation(_x, _x2, _x3, _x4) {
5
5
  return _finalizeCartMutation.apply(this, arguments);
6
6
  }
@@ -1,11 +1,23 @@
1
+ import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
1
2
  import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
3
+ import { checkoutOpenOperation, checkoutPayEftposOperation, checkoutPrepareOperation, checkoutRequestStaffPaymentApprovalOperation } from "../../app/operations.js";
2
4
  import { operationFailed, operationUnknown } from "./errors.js";
3
- import { defineOperation } from "./types.js";
5
+ import { bindOperation } from "./types.js";
4
6
  import { defaultCheckoutRequirementRegistry } from "./checkoutRequirements.js";
5
- //#region src/components/HDLKiosk/app/operations/checkout.ts
7
+ //#region src/components/HDLKiosk/runtime/operations/checkout.ts
6
8
  function forwardFailure(result) {
7
9
  return result;
8
10
  }
11
+ const PAYMENT_ALREADY_STARTED_ERRORS = new Set([
12
+ "checkoutPaymentAlreadySettled",
13
+ "checkoutPaymentAlreadyStarted",
14
+ "checkoutAlreadyStarted"
15
+ ]);
16
+ /** 标记当前支付命令尚未进入 Host dispatch,供硬阻断策略安全放行。 */
17
+ function forwardPreDispatchFailure(result) {
18
+ if ((result.status === "partialFailure" || result.status === "unknown") && !PAYMENT_ALREADY_STARTED_ERRORS.has(result.error.code)) return _objectSpread2(_objectSpread2({}, result), {}, { error: _objectSpread2(_objectSpread2({}, result.error), {}, { details: _objectSpread2(_objectSpread2({}, result.error.details), {}, { checkoutDispatched: false }) }) });
19
+ return result;
20
+ }
9
21
  function evaluateCheckoutRequirements(context, sales) {
10
22
  return defaultCheckoutRequirementRegistry.evaluate(context.checkoutRequirementIds, {
11
23
  workflow: context.workflowContext,
@@ -98,123 +110,96 @@ function _ensureCheckoutPrepared() {
98
110
  });
99
111
  return _ensureCheckoutPrepared.apply(this, arguments);
100
112
  }
101
- const checkoutPrepareOperation = defineOperation({
102
- id: "checkout.prepare",
103
- conflictScope: "checkout",
104
- timeoutMs: 2e4,
105
- retry: "explicit-user",
106
- execute: (context, _input, signal) => {
107
- const fulfillment = context.workflowContext.fulfillment;
108
- return prepareCheckout(context, signal, fulfillment ? { mode: fulfillment } : void 0);
109
- }
110
- });
111
- const checkoutOpenOperation = defineOperation({
112
- id: "checkout.open",
113
- tags: ["checkout-dispatch"],
114
- conflictScope: "checkout",
115
- timeoutMs: 12e4,
116
- retry: "never",
117
- execute: function() {
118
- var _ref = _asyncToGenerator(function* (context, _input, signal) {
119
- const { host, checkoutSafety, sessionEpoch } = context;
120
- const preparation = yield ensureCheckoutPrepared(context, signal);
121
- if (preparation.status !== "succeeded") return forwardFailure(preparation);
122
- const snapshot = host.sales.getObservedSnapshot();
123
- const requirements = evaluateCheckoutRequirements(context, snapshot);
124
- const validationFailure = requirementFailure(requirements);
125
- if (validationFailure) return validationFailure;
126
- const decision = checkoutSafety.beginOpen(snapshot, sessionEpoch, requirements.requirementIds);
127
- if (decision.status === "rejected") return decision.reason === "checkoutAlreadyStarted" ? operationUnknown(decision.reason) : operationFailed(decision.reason, "back");
128
- if (signal.aborted) {
129
- const result = {
130
- status: "cancelled",
131
- reason: "checkoutAbortedBeforeDispatch"
132
- };
133
- checkoutSafety.settle(result);
134
- return result;
135
- }
136
- let result;
137
- try {
138
- result = yield host.sales.openCheckout(signal);
139
- } catch (error) {
140
- result = operationUnknown("checkoutInvocationUnhandled", error);
141
- }
113
+ const checkoutPrepareOperationBinding = bindOperation(checkoutPrepareOperation, { execute: (context, _input, signal) => {
114
+ const fulfillment = context.workflowContext.fulfillment;
115
+ return prepareCheckout(context, signal, fulfillment ? { mode: fulfillment } : void 0);
116
+ } });
117
+ const checkoutOpenOperationBinding = bindOperation(checkoutOpenOperation, { execute: function() {
118
+ var _ref = _asyncToGenerator(function* (context, _input, signal) {
119
+ const { host, checkoutSafety, sessionEpoch } = context;
120
+ const preparation = yield ensureCheckoutPrepared(context, signal);
121
+ if (preparation.status !== "succeeded") return forwardPreDispatchFailure(preparation);
122
+ const snapshot = host.sales.getObservedSnapshot();
123
+ const requirements = evaluateCheckoutRequirements(context, snapshot);
124
+ const validationFailure = requirementFailure(requirements);
125
+ if (validationFailure) return validationFailure;
126
+ const decision = checkoutSafety.beginOpen(snapshot, sessionEpoch, requirements.requirementIds);
127
+ if (decision.status === "rejected") return decision.reason === "checkoutAlreadyStarted" ? operationUnknown(decision.reason) : operationFailed(decision.reason, "back");
128
+ if (signal.aborted) {
129
+ const result = {
130
+ status: "cancelled",
131
+ reason: "checkoutAbortedBeforeDispatch"
132
+ };
142
133
  checkoutSafety.settle(result);
143
134
  return result;
144
- });
145
- return function execute(_x8, _x9, _x10) {
146
- return _ref.apply(this, arguments);
147
- };
148
- }()
149
- });
135
+ }
136
+ let result;
137
+ try {
138
+ result = yield host.sales.openCheckout(signal);
139
+ } catch (error) {
140
+ result = operationUnknown("checkoutInvocationUnhandled", error);
141
+ }
142
+ checkoutSafety.settle(result);
143
+ return result;
144
+ });
145
+ return function execute(_x8, _x9, _x10) {
146
+ return _ref.apply(this, arguments);
147
+ };
148
+ }() });
150
149
  /** Kiosk EFTPOS 直连入口:Host 只能调用嵌入式 PaymentMethodRuntime。 */
151
- const checkoutPayEftposOperation = defineOperation({
152
- id: "checkout.payEftpos",
153
- tags: ["checkout-dispatch"],
154
- conflictScope: "checkout",
155
- timeoutMs: 12e4,
156
- retry: "never",
157
- execute: function() {
158
- var _ref2 = _asyncToGenerator(function* (context, input, signal) {
159
- const { host, checkoutSafety, sessionEpoch } = context;
160
- const preparation = yield ensureCheckoutPrepared(context, signal);
161
- if (preparation.status !== "succeeded") return forwardFailure(preparation);
162
- const snapshot = host.sales.getObservedSnapshot();
163
- const requirements = evaluateCheckoutRequirements(context, snapshot);
164
- const validationFailure = requirementFailure(requirements);
165
- if (validationFailure) return validationFailure;
166
- const decision = checkoutSafety.beginOpen(snapshot, sessionEpoch, requirements.requirementIds);
167
- if (decision.status === "rejected") return decision.reason === "checkoutAlreadyStarted" ? operationUnknown(decision.reason) : operationFailed(decision.reason, "back");
168
- if (signal.aborted) {
169
- const result = {
170
- status: "cancelled",
171
- reason: "checkoutAbortedBeforeDispatch"
172
- };
173
- checkoutSafety.settle(result);
174
- return result;
175
- }
176
- let result;
177
- try {
178
- result = yield host.sales.payEftpos(input, signal);
179
- } catch (error) {
180
- result = operationUnknown("checkoutInvocationUnhandled", error);
181
- }
182
- if (result.status === "succeeded" && !(yield waitForPaymentProjection(context, signal))) result = operationUnknown("checkoutPaymentProjectionNotConfirmed");
150
+ const checkoutPayEftposOperationBinding = bindOperation(checkoutPayEftposOperation, { execute: function() {
151
+ var _ref2 = _asyncToGenerator(function* (context, input, signal) {
152
+ const { host, checkoutSafety, sessionEpoch } = context;
153
+ const preparation = yield ensureCheckoutPrepared(context, signal);
154
+ if (preparation.status !== "succeeded") return forwardPreDispatchFailure(preparation);
155
+ const snapshot = host.sales.getObservedSnapshot();
156
+ const requirements = evaluateCheckoutRequirements(context, snapshot);
157
+ const validationFailure = requirementFailure(requirements);
158
+ if (validationFailure) return validationFailure;
159
+ const decision = checkoutSafety.beginOpen(snapshot, sessionEpoch, requirements.requirementIds);
160
+ if (decision.status === "rejected") return decision.reason === "checkoutAlreadyStarted" ? operationUnknown(decision.reason) : operationFailed(decision.reason, "back");
161
+ if (signal.aborted) {
162
+ const result = {
163
+ status: "cancelled",
164
+ reason: "checkoutAbortedBeforeDispatch"
165
+ };
183
166
  checkoutSafety.settle(result);
184
167
  return result;
185
- });
186
- return function execute(_x11, _x12, _x13) {
187
- return _ref2.apply(this, arguments);
188
- };
189
- }()
190
- });
168
+ }
169
+ let result;
170
+ try {
171
+ result = yield host.sales.payEftpos(input, signal);
172
+ } catch (error) {
173
+ result = operationUnknown("checkoutInvocationUnhandled", error);
174
+ }
175
+ if (result.status === "succeeded" && !(yield waitForPaymentProjection(context, signal))) result = operationUnknown("checkoutPaymentProjectionNotConfirmed");
176
+ checkoutSafety.settle(result);
177
+ return result;
178
+ });
179
+ return function execute(_x11, _x12, _x13) {
180
+ return _ref2.apply(this, arguments);
181
+ };
182
+ }() });
191
183
  /** 店员付款只请求主屏授权;授权派发绝不视作付款成功。 */
192
- const checkoutRequestStaffPaymentApprovalOperation = defineOperation({
193
- id: "checkout.requestStaffPaymentApproval",
194
- tags: ["checkout-authorization"],
195
- conflictScope: "checkout",
196
- timeoutMs: 2e4,
197
- retry: "explicit-user",
198
- execute: function() {
199
- var _ref3 = _asyncToGenerator(function* (context, input, signal) {
200
- const preparation = yield ensureCheckoutPrepared(context, signal);
201
- if (preparation.status !== "succeeded") return forwardFailure(preparation);
202
- const validationFailure = requirementFailure(evaluateCheckoutRequirements(context, context.host.sales.getObservedSnapshot()));
203
- if (validationFailure) return validationFailure;
204
- if (signal.aborted) return {
205
- status: "cancelled",
206
- reason: "authorizationAborted"
207
- };
208
- return context.host.sales.requestStaffPaymentApproval(input, signal);
209
- });
210
- return function execute(_x14, _x15, _x16) {
211
- return _ref3.apply(this, arguments);
184
+ const checkoutRequestStaffPaymentApprovalOperationBinding = bindOperation(checkoutRequestStaffPaymentApprovalOperation, { execute: function() {
185
+ var _ref3 = _asyncToGenerator(function* (context, input, signal) {
186
+ const preparation = yield ensureCheckoutPrepared(context, signal);
187
+ if (preparation.status !== "succeeded") return forwardFailure(preparation);
188
+ const validationFailure = requirementFailure(evaluateCheckoutRequirements(context, context.host.sales.getObservedSnapshot()));
189
+ if (validationFailure) return validationFailure;
190
+ if (signal.aborted) return {
191
+ status: "cancelled",
192
+ reason: "authorizationAborted"
212
193
  };
213
- }()
214
- });
194
+ return context.host.sales.requestStaffPaymentApproval(input, signal);
195
+ });
196
+ return function execute(_x14, _x15, _x16) {
197
+ return _ref3.apply(this, arguments);
198
+ };
199
+ }() });
215
200
  const MONEY = /^(?:0|[1-9]\d*)(?:\.\d+)?$/;
216
201
  function isSafeMoney(value) {
217
202
  return MONEY.test(value) && Number.isFinite(Number(value));
218
203
  }
219
204
  //#endregion
220
- export { checkoutOpenOperation, checkoutPayEftposOperation, checkoutPrepareOperation, checkoutRequestStaffPaymentApprovalOperation };
205
+ export { checkoutOpenOperationBinding, checkoutPayEftposOperationBinding, checkoutPrepareOperationBinding, checkoutRequestStaffPaymentApprovalOperationBinding };
@@ -1,5 +1,5 @@
1
1
  import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
- //#region src/components/HDLKiosk/app/operations/checkoutRequirements.ts
2
+ //#region src/components/HDLKiosk/runtime/operations/checkoutRequirements.ts
3
3
  function createCheckoutRequirementRegistry(definitions) {
4
4
  const byId = /* @__PURE__ */ new Map();
5
5
  definitions.forEach((definition) => {
@@ -1,5 +1,5 @@
1
1
  import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
- //#region src/components/HDLKiosk/app/operations/checkoutSafety.ts
2
+ //#region src/components/HDLKiosk/runtime/operations/checkoutSafety.ts
3
3
  const DEFAULT_TOKEN_TTL_MS = 3e4;
4
4
  function createCheckoutSafetyController({ tokenTtlMs = DEFAULT_TOKEN_TTL_MS, now = Date.now } = {}) {
5
5
  if (!Number.isFinite(tokenTtlMs) || tokenTtlMs <= 0) throw new Error("HDLKiosk checkout token TTL must be positive");
@@ -1,8 +1,8 @@
1
1
  import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
2
- import { operationFailed, operationUnknown } from "./errors.js";
3
2
  import { createKernelOperationCoordinator } from "../../kernel/operations/coordinator.js";
3
+ import { operationFailed, operationUnknown } from "./errors.js";
4
4
  import { createCheckoutSafetyController } from "./checkoutSafety.js";
5
- //#region src/components/HDLKiosk/app/operations/coordinator.ts
5
+ //#region src/components/HDLKiosk/runtime/operations/coordinator.ts
6
6
  function conflicts(left, right) {
7
7
  if (left === "none" || right === "none") return false;
8
8
  if (left === "session" || right === "session") return true;