@pisell/private-materials 6.12.168 → 6.12.170

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 (275) 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 +7 -3
  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/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
  19. package/es/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
  20. package/es/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
  21. package/es/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
  22. 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 +95 -89
  23. package/es/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
  24. package/es/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
  25. package/es/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
  26. 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
  27. 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
  28. package/es/components/HDLKiosk/docs/README.md +6 -2
  29. package/es/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
  30. package/es/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
  31. package/es/components/HDLKiosk/index.js +32 -30
  32. package/es/components/HDLKiosk/index.less +8 -3
  33. package/es/components/HDLKiosk/kernel/README.md +13 -12
  34. package/es/components/HDLKiosk/kernel/application/defineApplication.js +63 -24
  35. package/es/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
  36. package/es/components/HDLKiosk/kernel/application/runtime.js +237 -0
  37. package/es/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
  38. package/es/components/HDLKiosk/kernel/operations/registry.js +3 -3
  39. package/es/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
  40. package/es/components/HDLKiosk/kernel/operations/types.js +7 -3
  41. package/es/components/HDLKiosk/kernel/workflow/actor.js +16 -17
  42. package/es/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
  43. package/es/components/HDLKiosk/runtime/createRuntime.js +238 -0
  44. package/es/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
  45. package/es/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
  46. package/es/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +18 -24
  47. package/es/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
  48. package/es/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
  49. package/es/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
  50. package/es/components/HDLKiosk/runtime/operations/barcode.js +18 -0
  51. package/es/components/HDLKiosk/runtime/operations/cart.js +44 -0
  52. package/es/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
  53. package/es/components/HDLKiosk/{app → runtime}/operations/checkout.js +95 -110
  54. package/es/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
  55. package/es/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
  56. package/es/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
  57. package/es/components/HDLKiosk/runtime/operations/customization.js +70 -0
  58. package/es/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
  59. package/es/components/HDLKiosk/runtime/operations/fulfillment.js +6 -0
  60. package/es/components/HDLKiosk/runtime/operations/identity.js +55 -0
  61. package/es/components/HDLKiosk/runtime/operations/registry.js +34 -0
  62. package/es/components/HDLKiosk/runtime/operations/session.js +29 -0
  63. package/es/components/HDLKiosk/runtime/operations/types.js +13 -0
  64. package/es/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
  65. package/es/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +67 -17
  66. package/es/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
  67. package/es/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
  68. package/es/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
  69. package/es/components/HDLKiosk/runtime/triggers.js +28 -0
  70. package/es/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
  71. package/es/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
  72. package/es/components/HDLKiosk/slices/catalog/slice.js +2 -2
  73. package/es/components/HDLKiosk/slices/customization/Screen/index.js +34 -35
  74. package/es/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
  75. package/es/components/HDLKiosk/slices/customization/slice.js +2 -3
  76. package/es/components/HDLKiosk/slices/fulfillment/slice.js +2 -2
  77. package/es/components/HDLKiosk/slices/fulfillment/view.js +1 -1
  78. package/es/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
  79. package/es/components/HDLKiosk/slices/identity/slice.js +2 -2
  80. package/es/components/HDLKiosk/slices/identity/view.js +1 -1
  81. package/es/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
  82. package/es/components/HDLKiosk/slices/payment/slice.js +3 -3
  83. package/es/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
  84. package/es/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +68 -129
  85. package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +387 -0
  86. package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
  87. package/es/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
  88. package/es/components/HDLKiosk/ui/collaborationStatus.js +11 -0
  89. package/es/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +66 -0
  90. package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
  91. package/es/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +25 -0
  92. package/es/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +53 -0
  93. package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
  94. package/es/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +39 -0
  95. package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
  96. package/es/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
  97. package/es/components/HDLKiosk/ui/scale.js +20 -0
  98. package/es/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -8
  99. package/es/components/HDLKiosk/{app → ui}/views.js +1 -1
  100. package/es/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
  101. package/es/components/HDLKiosk/utils.js +4 -4
  102. package/es/components/bigSale/templates/HDLKiosk/README.md +43 -0
  103. package/es/components/bigSale/templates/HDLKiosk/adapter/createHost.js +7 -7
  104. package/es/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
  105. package/es/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
  106. package/es/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
  107. package/es/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +24 -14
  108. package/es/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
  109. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +187 -0
  110. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +160 -0
  111. package/es/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +3 -3
  112. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
  113. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
  114. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
  115. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
  116. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
  117. package/es/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +124 -0
  118. package/es/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +2 -2
  119. package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +41 -0
  120. package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
  121. package/es/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +122 -0
  122. package/es/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
  123. package/es/components/bigSale/templates/HDLKiosk/index.js +42 -148
  124. package/es/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +33 -62
  125. package/es/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
  126. package/es/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
  127. package/lib/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
  128. package/lib/components/HDLKiosk/app/manifest.js +18 -19
  129. package/lib/components/HDLKiosk/app/operations.js +105 -0
  130. package/lib/components/HDLKiosk/app/workflow/barcode.js +7 -3
  131. package/lib/components/HDLKiosk/app/workflow/index.js +16 -0
  132. package/lib/components/HDLKiosk/app/workflow/predicates.js +1 -0
  133. package/lib/components/HDLKiosk/app/workflow/quick.js +1 -1
  134. package/lib/components/HDLKiosk/app/workflow/registry.js +3 -3
  135. package/lib/components/HDLKiosk/app/workflow/scale.js +5 -1
  136. package/lib/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
  137. package/lib/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
  138. package/lib/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
  139. package/lib/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
  140. 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 +95 -89
  141. package/lib/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
  142. package/lib/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
  143. package/lib/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
  144. 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
  145. 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
  146. package/lib/components/HDLKiosk/docs/README.md +6 -2
  147. package/lib/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
  148. package/lib/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
  149. package/lib/components/HDLKiosk/index.js +35 -33
  150. package/lib/components/HDLKiosk/index.less +8 -3
  151. package/lib/components/HDLKiosk/kernel/README.md +13 -12
  152. package/lib/components/HDLKiosk/kernel/application/defineApplication.js +65 -25
  153. package/lib/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
  154. package/lib/components/HDLKiosk/kernel/application/runtime.js +237 -0
  155. package/lib/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
  156. package/lib/components/HDLKiosk/kernel/operations/registry.js +3 -3
  157. package/lib/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
  158. package/lib/components/HDLKiosk/kernel/operations/types.js +8 -3
  159. package/lib/components/HDLKiosk/kernel/workflow/actor.js +16 -17
  160. package/lib/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
  161. package/lib/components/HDLKiosk/runtime/createRuntime.js +239 -0
  162. package/lib/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
  163. package/lib/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
  164. package/lib/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +17 -27
  165. package/lib/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
  166. package/lib/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
  167. package/lib/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
  168. package/lib/components/HDLKiosk/runtime/operations/barcode.js +17 -0
  169. package/lib/components/HDLKiosk/runtime/operations/cart.js +46 -0
  170. package/lib/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
  171. package/lib/components/HDLKiosk/{app → runtime}/operations/checkout.js +97 -112
  172. package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
  173. package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
  174. package/lib/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
  175. package/lib/components/HDLKiosk/runtime/operations/customization.js +73 -0
  176. package/lib/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
  177. package/lib/components/HDLKiosk/runtime/operations/fulfillment.js +5 -0
  178. package/lib/components/HDLKiosk/runtime/operations/identity.js +55 -0
  179. package/lib/components/HDLKiosk/runtime/operations/registry.js +34 -0
  180. package/lib/components/HDLKiosk/runtime/operations/session.js +30 -0
  181. package/lib/components/HDLKiosk/runtime/operations/types.js +14 -0
  182. package/lib/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
  183. package/lib/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +71 -21
  184. package/lib/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
  185. package/lib/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
  186. package/lib/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
  187. package/lib/components/HDLKiosk/runtime/triggers.js +28 -0
  188. package/lib/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
  189. package/lib/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
  190. package/lib/components/HDLKiosk/slices/catalog/slice.js +3 -3
  191. package/lib/components/HDLKiosk/slices/customization/Screen/index.js +35 -36
  192. package/lib/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
  193. package/lib/components/HDLKiosk/slices/customization/slice.js +5 -6
  194. package/lib/components/HDLKiosk/slices/fulfillment/slice.js +3 -3
  195. package/lib/components/HDLKiosk/slices/fulfillment/view.js +1 -1
  196. package/lib/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
  197. package/lib/components/HDLKiosk/slices/identity/slice.js +4 -4
  198. package/lib/components/HDLKiosk/slices/identity/view.js +1 -1
  199. package/lib/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
  200. package/lib/components/HDLKiosk/slices/payment/slice.js +5 -5
  201. package/lib/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
  202. package/lib/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +69 -130
  203. package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +390 -0
  204. package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
  205. package/lib/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
  206. package/lib/components/HDLKiosk/ui/collaborationStatus.js +11 -0
  207. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +67 -0
  208. package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
  209. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +26 -0
  210. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +54 -0
  211. package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
  212. package/lib/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +40 -0
  213. package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
  214. package/lib/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
  215. package/lib/components/HDLKiosk/ui/scale.js +24 -0
  216. package/lib/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -7
  217. package/lib/components/HDLKiosk/{app → ui}/views.js +1 -1
  218. package/lib/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
  219. package/lib/components/HDLKiosk/utils.js +4 -4
  220. package/lib/components/bigSale/templates/HDLKiosk/README.md +43 -0
  221. package/lib/components/bigSale/templates/HDLKiosk/adapter/createHost.js +9 -9
  222. package/lib/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
  223. package/lib/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
  224. package/lib/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
  225. package/lib/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +25 -14
  226. package/lib/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
  227. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +189 -0
  228. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +162 -0
  229. package/lib/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +4 -4
  230. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
  231. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
  232. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
  233. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
  234. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
  235. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +126 -0
  236. package/lib/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +3 -3
  237. package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +42 -0
  238. package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
  239. package/lib/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +124 -0
  240. package/lib/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
  241. package/lib/components/bigSale/templates/HDLKiosk/index.js +43 -149
  242. package/lib/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +31 -61
  243. package/lib/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
  244. package/lib/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
  245. package/package.json +2 -2
  246. package/es/components/HDLKiosk/app/constants.js +0 -9
  247. package/es/components/HDLKiosk/app/operations/barcode.js +0 -22
  248. package/es/components/HDLKiosk/app/operations/cart.js +0 -60
  249. package/es/components/HDLKiosk/app/operations/fulfillment.js +0 -11
  250. package/es/components/HDLKiosk/app/operations/session.js +0 -41
  251. package/es/components/HDLKiosk/app/operations/types.js +0 -11
  252. package/es/components/HDLKiosk/devices/entryArbiter.js +0 -33
  253. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -75
  254. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -160
  255. package/es/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -185
  256. package/es/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -12
  257. package/es/components/HDLKiosk/slices/customization/operation.js +0 -80
  258. package/es/components/HDLKiosk/slices/identity/operation.js +0 -60
  259. package/es/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -692
  260. package/lib/components/HDLKiosk/app/constants.js +0 -9
  261. package/lib/components/HDLKiosk/app/operations/barcode.js +0 -21
  262. package/lib/components/HDLKiosk/app/operations/cart.js +0 -62
  263. package/lib/components/HDLKiosk/app/operations/fulfillment.js +0 -10
  264. package/lib/components/HDLKiosk/app/operations/session.js +0 -42
  265. package/lib/components/HDLKiosk/app/operations/types.js +0 -12
  266. package/lib/components/HDLKiosk/devices/entryArbiter.js +0 -33
  267. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -76
  268. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -161
  269. package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -186
  270. package/lib/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -13
  271. package/lib/components/HDLKiosk/slices/customization/operation.js +0 -83
  272. package/lib/components/HDLKiosk/slices/identity/operation.js +0 -60
  273. package/lib/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -694
  274. /package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
  275. /package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
@@ -0,0 +1,71 @@
1
+ const require_asyncToGenerator = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
2
+ const require_normalize = require("../normalize.js");
3
+ const require_projection = require("../host/projection.js");
4
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/sales/session.ts
5
+ const PAYMENT_WRITE_FROZEN_STATUSES = new Set(["payment_pending", "processing"]);
6
+ function readPaymentStatus(order) {
7
+ var _order$payment_status;
8
+ return String((_order$payment_status = order === null || order === void 0 ? void 0 : order.payment_status) !== null && _order$payment_status !== void 0 ? _order$payment_status : "").trim().toLowerCase();
9
+ }
10
+ function hasCommittedOrderIdentity(order) {
11
+ const orderId = order === null || order === void 0 ? void 0 : order.order_id;
12
+ return orderId !== null && orderId !== void 0 && String(orderId).trim() !== "";
13
+ }
14
+ function isCommittedPaidOrder(order) {
15
+ return readPaymentStatus(order) === "paid" && hasCommittedOrderIdentity(order);
16
+ }
17
+ function createBigSaleSessionOperations({ getContext }) {
18
+ return {
19
+ ensureSession: function() {
20
+ var _ref = require_asyncToGenerator._asyncToGenerator(function* (signal) {
21
+ if (signal.aborted) return { status: "cancelled" };
22
+ const context = getContext();
23
+ const currentOrder = require_projection.resolveBigSaleLiveTempOrder(context);
24
+ const currentPaymentStatus = readPaymentStatus(currentOrder);
25
+ if (PAYMENT_WRITE_FROZEN_STATUSES.has(currentPaymentStatus)) return require_normalize.unknown("ensureSessionPaymentInProgress");
26
+ if (currentOrder && !isCommittedPaidOrder(currentOrder)) return {
27
+ status: "succeeded",
28
+ data: void 0
29
+ };
30
+ try {
31
+ const createdOrder = isCommittedPaidOrder(currentOrder) ? yield context.sales.clearCartAndReset() : yield context.sales.createNew();
32
+ if (signal.aborted) return require_normalize.unknown("ensureSessionAbortedAfterDispatch");
33
+ const liveCreatedOrder = require_projection.resolveBigSaleLiveTempOrder(getContext());
34
+ const createdPaymentStatus = readPaymentStatus(liveCreatedOrder !== null && liveCreatedOrder !== void 0 ? liveCreatedOrder : createdOrder);
35
+ if (isCommittedPaidOrder(liveCreatedOrder !== null && liveCreatedOrder !== void 0 ? liveCreatedOrder : createdOrder) || PAYMENT_WRITE_FROZEN_STATUSES.has(createdPaymentStatus)) return require_normalize.unknown("ensureSessionNotWritable");
36
+ return {
37
+ status: "succeeded",
38
+ data: void 0
39
+ };
40
+ } catch (error) {
41
+ return require_normalize.partialFailure("ensureSessionFailed", error);
42
+ }
43
+ });
44
+ return function ensureSession(_x) {
45
+ return _ref.apply(this, arguments);
46
+ };
47
+ }(),
48
+ clearAndReset: function() {
49
+ var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (signal) {
50
+ if (signal.aborted) return { status: "cancelled" };
51
+ try {
52
+ var _resetOrder$products$, _resetOrder$products, _resetOrder$bookings$, _resetOrder$bookings;
53
+ const resetOrder = yield getContext().sales.clearCartAndReset();
54
+ if (signal.aborted) return require_normalize.unknown("resetAbortedAfterDispatch");
55
+ if (!(((_resetOrder$products$ = (_resetOrder$products = resetOrder.products) === null || _resetOrder$products === void 0 ? void 0 : _resetOrder$products.length) !== null && _resetOrder$products$ !== void 0 ? _resetOrder$products$ : 0) === 0 && ((_resetOrder$bookings$ = (_resetOrder$bookings = resetOrder.bookings) === null || _resetOrder$bookings === void 0 ? void 0 : _resetOrder$bookings.length) !== null && _resetOrder$bookings$ !== void 0 ? _resetOrder$bookings$ : 0) === 0)) return require_normalize.unknown("resetHostResultNotEmpty");
56
+ return {
57
+ status: "succeeded",
58
+ data: { cartEmpty: true }
59
+ };
60
+ } catch (error) {
61
+ return require_normalize.partialFailure("resetFailed", error);
62
+ }
63
+ });
64
+ return function clearAndReset(_x2) {
65
+ return _ref2.apply(this, arguments);
66
+ };
67
+ }()
68
+ };
69
+ }
70
+ //#endregion
71
+ exports.createBigSaleSessionOperations = createBigSaleSessionOperations;
@@ -0,0 +1,126 @@
1
+ const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
2
+ const require_objectSpread2 = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
3
+ const require_asyncToGenerator = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
4
+ const require_productSkuOptions = require("../../../../../../plus/salesSdk/utils/productSkuOptions.js");
5
+ const require_identity = require("../../../../../../plus/salesSdk/utils/identity.js");
6
+ const require_buildProductLineUpdates = require("../../../../../../plus/salesSdk/utils/buildProductLineUpdates.js");
7
+ const require_product = require("../../../../../HDLKiosk/product.js");
8
+ const require_normalize = require("../normalize.js");
9
+ const require_catalog = require("./catalog.js");
10
+ const require_cart = require("./cart.js");
11
+ const require_customizationProduct = require("./customizationProduct.js");
12
+ let decimal_js = require("decimal.js");
13
+ decimal_js = require_runtime.__toESM(decimal_js);
14
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.ts
15
+ /** Primary weighted-product add/update operations. */
16
+ function resolveCartProduct(line) {
17
+ var _line$_extend;
18
+ return "product_id" in line ? line : (_line$_extend = line._extend) === null || _line$_extend === void 0 ? void 0 : _line$_extend.product;
19
+ }
20
+ function hasRequestedWeight(product, requestedWeightKg) {
21
+ var _product$product_sku$, _product$product_sku;
22
+ const actual = new decimal_js.default((_product$product_sku$ = (_product$product_sku = product.product_sku) === null || _product$product_sku === void 0 ? void 0 : _product$product_sku.net_weight) !== null && _product$product_sku$ !== void 0 ? _product$product_sku$ : NaN);
23
+ const expected = new decimal_js.default(requestedWeightKg || NaN);
24
+ return actual.isFinite() && expected.isFinite() && actual.equals(expected);
25
+ }
26
+ function findConfirmedMutationLine(products, productId, requestedWeightKg, uniqueId) {
27
+ return [...products].reverse().find((candidate) => {
28
+ var _candidate$product_id, _candidate$metadata$u, _candidate$metadata;
29
+ if (String((_candidate$product_id = candidate.product_id) !== null && _candidate$product_id !== void 0 ? _candidate$product_id : "") !== productId) return false;
30
+ if (!hasRequestedWeight(candidate, requestedWeightKg)) return false;
31
+ if (uniqueId == null || uniqueId === "") return true;
32
+ return String((_candidate$metadata$u = (_candidate$metadata = candidate.metadata) === null || _candidate$metadata === void 0 ? void 0 : _candidate$metadata.unique_identification_number) !== null && _candidate$metadata$u !== void 0 ? _candidate$metadata$u : "") === String(uniqueId);
33
+ });
34
+ }
35
+ function findOrderProduct(context, product) {
36
+ var _product$_identity, _context$sales$tempOr, _products$find;
37
+ const uniqueId = ((_product$_identity = product._identity) !== null && _product$_identity !== void 0 ? _product$_identity : require_identity.pickIdentity(product)).unique_identification_number;
38
+ return (_products$find = (((_context$sales$tempOr = context.sales.tempOrder) === null || _context$sales$tempOr === void 0 ? void 0 : _context$sales$tempOr.products) || []).find((candidate) => {
39
+ var _candidate$metadata$u2, _candidate$metadata2;
40
+ return uniqueId != null && String((_candidate$metadata$u2 = (_candidate$metadata2 = candidate.metadata) === null || _candidate$metadata2 === void 0 ? void 0 : _candidate$metadata2.unique_identification_number) !== null && _candidate$metadata$u2 !== void 0 ? _candidate$metadata$u2 : "") === String(uniqueId);
41
+ })) !== null && _products$find !== void 0 ? _products$find : product;
42
+ }
43
+ function createBigSaleWeightedProductOperations({ getContext }) {
44
+ return { syncPrimaryWeightedProduct: function() {
45
+ var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (input, signal) {
46
+ if (signal.aborted) return { status: "cancelled" };
47
+ const productId = Number(input.productId);
48
+ if (!Number.isFinite(productId)) return require_normalize.failed("primaryWeightedProductInputInvalid", "staff");
49
+ try {
50
+ const context = getContext();
51
+ const productResult = yield require_catalog.queryPrimaryProduct(context, String(productId), signal);
52
+ if (productResult.status !== "succeeded") return productResult;
53
+ const product = productResult.data;
54
+ const resolved = require_product.resolveHDLWeightedProduct(product);
55
+ if (!resolved) return require_normalize.failed("primaryWeightedProductConfigInvalid", "staff");
56
+ const prepared = require_customizationProduct.createHDLPrimaryWeightedPreparedProduct(resolved, input);
57
+ if (!prepared) return require_normalize.failed("primaryWeightedProductSelectionInvalid", "retry");
58
+ if (input.existingLineId) {
59
+ var _cartProduct$_identit, _identity$product_var, _ref, _productPatch$product;
60
+ const displayLine = require_cart.findCartLine(context, input.existingLineId);
61
+ const cartProduct = displayLine ? resolveCartProduct(displayLine) : void 0;
62
+ const bookingTicket = context.sales.bookingTicket;
63
+ if (!cartProduct) return require_normalize.failed("primaryWeightedProductLineNotFound", "back");
64
+ if (typeof context.cart.updateItem !== "function" || typeof (bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.transformDetailToProductAndBooking) !== "function") return require_normalize.failed("primaryWeightedProductUpdateUnavailable", "staff");
65
+ const orderLine = findOrderProduct(context, cartProduct);
66
+ const identity = (_cartProduct$_identit = cartProduct._identity) !== null && _cartProduct$_identit !== void 0 ? _cartProduct$_identit : require_identity.pickIdentity(orderLine);
67
+ const preparedForUpdate = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prepared), {}, { _extend: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prepared._extend || {}), identity.unique_identification_number != null ? { unique_identification_number: identity.unique_identification_number } : {}) });
68
+ const transformed = bookingTicket.transformDetailToProductAndBooking({
69
+ item: resolved.product,
70
+ cacheItem: preparedForUpdate
71
+ });
72
+ const productPatch = transformed === null || transformed === void 0 ? void 0 : transformed.product;
73
+ if (!productPatch) return require_normalize.failed("primaryWeightedProductUpdateInvalid", "retry");
74
+ const patchVariantId = Number(productPatch.product_variant_id);
75
+ const nextVariantId = Number.isFinite(patchVariantId) && patchVariantId > 0 ? patchVariantId : Number((_identity$product_var = identity.product_variant_id) !== null && _identity$product_var !== void 0 ? _identity$product_var : 0);
76
+ const nextOptions = require_productSkuOptions.resolvePatchProductOptions(orderLine, productPatch);
77
+ const lineUpdates = require_buildProductLineUpdates.buildProductLineUpdates(orderLine, productPatch);
78
+ lineUpdates.metadata = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, lineUpdates.metadata || {}), identity.unique_identification_number != null ? { unique_identification_number: identity.unique_identification_number } : {});
79
+ const updatedProducts = yield context.cart.updateItem({
80
+ product_id: identity.product_id,
81
+ product_variant_id: nextVariantId,
82
+ unique_identification_number: identity.unique_identification_number,
83
+ identity_key: identity.identity_key,
84
+ product_sku: require_productSkuOptions.buildProductSkuPatch(orderLine, nextOptions, productPatch.product_sku),
85
+ product_option_item: nextOptions,
86
+ product_bundle: (_ref = (_productPatch$product = productPatch.product_bundle) !== null && _productPatch$product !== void 0 ? _productPatch$product : identity.product_bundle) !== null && _ref !== void 0 ? _ref : [],
87
+ updates: lineUpdates
88
+ });
89
+ if (signal.aborted) return require_normalize.unknown("primaryProductUpdateAbortedAfterDispatch");
90
+ const confirmedLine = require_cart.projectConfirmedMutationLine(findConfirmedMutationLine(updatedProducts, input.productId, input.measurement.netWeightKg, identity.unique_identification_number));
91
+ return {
92
+ status: "succeeded",
93
+ data: require_objectSpread2._objectSpread2({ affectedLineId: input.existingLineId }, confirmedLine ? { confirmedLine } : {})
94
+ };
95
+ }
96
+ const result = yield context.cart.addProductWithFlow(product, {
97
+ quantity: 1,
98
+ debounceMs: 0,
99
+ notShowToast: true,
100
+ preparedCacheItem: prepared
101
+ });
102
+ if (signal.aborted) return require_normalize.unknown("primaryProductAddAbortedAfterDispatch");
103
+ if (result.status === "cancelled") return {
104
+ status: "cancelled",
105
+ reason: "userCancelled"
106
+ };
107
+ if (result.status !== "added") return require_normalize.unknown("primaryProductAddAmbiguous");
108
+ const confirmedLine = require_cart.projectConfirmedMutationLine(findConfirmedMutationLine(result.products, input.productId, input.measurement.netWeightKg));
109
+ return {
110
+ status: "succeeded",
111
+ data: confirmedLine ? {
112
+ affectedLineId: confirmedLine.lineId,
113
+ confirmedLine
114
+ } : {}
115
+ };
116
+ } catch (error) {
117
+ return require_normalize.partialFailure("primaryWeightedProductSyncFailed", error);
118
+ }
119
+ });
120
+ return function syncPrimaryWeightedProduct(_x, _x2) {
121
+ return _ref2.apply(this, arguments);
122
+ };
123
+ }() };
124
+ }
125
+ //#endregion
126
+ exports.createBigSaleWeightedProductOperations = createBigSaleWeightedProductOperations;
@@ -1,9 +1,9 @@
1
- const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
2
- const require_objectSpread2 = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
1
+ const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
2
+ const require_objectSpread2 = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
3
3
  let _pisell_utils = require("@pisell/utils");
4
4
  let decimal_js = require("decimal.js");
5
5
  decimal_js = require_runtime.__toESM(decimal_js);
6
- //#region src/components/bigSale/templates/HDLKiosk/adapter/weightedProduct.ts
6
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/sales/weightedProduct.ts
7
7
  /**
8
8
  * 文件角色:根据已验证的标准称重商品生成 SalesSDK 写入结构。
9
9
  * 运行机制:提交时校验稳定净重,并生成 prepared product 及 OS 可识别的
@@ -0,0 +1,42 @@
1
+ require("../../../../../_virtual/_rolldown/runtime.js");
2
+ const require_scaleBridge = require("../runtime/scaleBridge.js");
3
+ const require_fulfillmentWriter = require("./host/fulfillmentWriter.js");
4
+ const require_useBigSaleHDLKioskHost = require("./useBigSaleHDLKioskHost.js");
5
+ let react = require("react");
6
+ //#region src/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.ts
7
+ /**
8
+ * 文件角色:集中装配 BigSale 模板接入 HDLKiosk 所需的稳定 Host、支付控制器、
9
+ * 秤 Runtime 与认证客户暂存。
10
+ * 运行机制:React refs 隔离晚到能力,Host 保持稳定引用;Template 只消费装配结果。
11
+ * 边界:不渲染 UI,不承载商品目录加载、购物车展示或 Workflow 业务规则。
12
+ */
13
+ function useBigSaleHDLKioskAdapter({ context, businessCode, isActive, nativeScaleSourceAvailable }) {
14
+ var _context$customer$sel;
15
+ const scaleBridge = (0, react.useMemo)(require_scaleBridge.createBigSaleScaleBridge, []);
16
+ const authenticatedCustomerRef = (0, react.useRef)();
17
+ const paymentControllerRef = (0, react.useRef)();
18
+ const fulfillmentWriter = (0, react.useMemo)(() => require_fulfillmentWriter.createHDLKioskFulfillmentWriter(context.sales.bookingTicket), [context.sales.bookingTicket]);
19
+ const host = require_useBigSaleHDLKioskHost.useBigSaleHDLKioskHost(context, businessCode, (0, react.useMemo)(() => ({
20
+ writeFulfillment: fulfillmentWriter,
21
+ getPaymentController: () => paymentControllerRef.current,
22
+ subscribeScaleEvents: scaleBridge.subscribeDeviceEvents,
23
+ getAuthenticatedCustomer: (customerId) => {
24
+ const customer = authenticatedCustomerRef.current;
25
+ return customer && String(customer.id) === customerId ? customer : void 0;
26
+ }
27
+ }), [fulfillmentWriter, scaleBridge]), nativeScaleSourceAvailable);
28
+ const selectedCustomerId = (_context$customer$sel = context.customer.selected) === null || _context$customer$sel === void 0 ? void 0 : _context$customer$sel.id;
29
+ (0, react.useEffect)(() => {
30
+ if (!isActive || selectedCustomerId == null) authenticatedCustomerRef.current = void 0;
31
+ }, [isActive, selectedCustomerId]);
32
+ return {
33
+ host,
34
+ paymentControllerRef,
35
+ rememberAuthenticatedCustomer: (0, react.useCallback)((customer) => {
36
+ authenticatedCustomerRef.current = customer;
37
+ }, []),
38
+ scaleBridge
39
+ };
40
+ }
41
+ //#endregion
42
+ exports.useBigSaleHDLKioskAdapter = useBigSaleHDLKioskAdapter;
@@ -1,6 +1,6 @@
1
1
  require("../../../../../_virtual/_rolldown/runtime.js");
2
2
  const require_useSalesSdkGlobalScanHandler = require("../../../../../plus/salesSdk/hooks/useSalesSdkGlobalScanHandler.js");
3
- const require_projection = require("./projection.js");
3
+ const require_projection = require("./host/projection.js");
4
4
  const require_createHost = require("./createHost.js");
5
5
  let react = require("react");
6
6
  //#region src/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.ts
@@ -19,6 +19,7 @@ function useBigSaleHDLKioskHost(context, businessCode, bridge, scaleSourceAvaila
19
19
  const bridgeRef = (0, react.useRef)(bridge);
20
20
  const scaleSourceAvailableRef = (0, react.useRef)(scaleSourceAvailable);
21
21
  const projectionListenersRef = (0, react.useRef)(/* @__PURE__ */ new Set());
22
+ const publishedObservationIdRef = (0, react.useRef)();
22
23
  const pickupReferenceModeRef = (0, react.useRef)("short_number");
23
24
  contextRef.current = context;
24
25
  scanRef.current = scan.handleGlobalScanCode;
@@ -66,16 +67,18 @@ function useBigSaleHDLKioskHost(context, businessCode, bridge, scaleSourceAvaila
66
67
  devices: {
67
68
  getPubsub: () => getPubsubRef.current(),
68
69
  getAcquireScanFocus: () => getAcquireScanFocusRef.current(),
69
- getSubscribeWeightChange: () => {
70
+ getSubscribeScaleEvents: () => {
70
71
  var _bridgeRef$current4;
71
- return scaleSourceAvailableRef.current ? (_bridgeRef$current4 = bridgeRef.current) === null || _bridgeRef$current4 === void 0 ? void 0 : _bridgeRef$current4.subscribeWeightChange : void 0;
72
- },
73
- getSubscribeScaleConnection: () => {
74
- var _bridgeRef$current5;
75
- return scaleSourceAvailableRef.current ? (_bridgeRef$current5 = bridgeRef.current) === null || _bridgeRef$current5 === void 0 ? void 0 : _bridgeRef$current5.subscribeScaleConnection : void 0;
72
+ return scaleSourceAvailableRef.current ? (_bridgeRef$current4 = bridgeRef.current) === null || _bridgeRef$current4 === void 0 ? void 0 : _bridgeRef$current4.subscribeScaleEvents : void 0;
76
73
  }
77
74
  }
78
75
  });
76
+ (0, react.useEffect)(() => {
77
+ const observationId = hostRef.current.sales.getObservedSnapshot().observationId;
78
+ if (publishedObservationIdRef.current === observationId) return;
79
+ publishedObservationIdRef.current = observationId;
80
+ projectionListenersRef.current.forEach((listener) => listener());
81
+ });
79
82
  return hostRef.current;
80
83
  }
81
84
  //#endregion
@@ -0,0 +1,124 @@
1
+ const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
2
+ const require_objectSpread2 = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
3
+ const require_usePickSaleDetailContext = require("../../../hooks/usePickSaleDetailContext.js");
4
+ const require_useOrderNoteModal = require("../../../../../plus/saleDetail/hooks/useOrderNoteModal.js");
5
+ const require_adapters = require("../../../../../plus/saleDetail/components/PromotionWalletPanels/adapters.js");
6
+ const require_useSaleWalletAssets = require("../../../../../plus/saleDetail/components/PromotionWalletPanels/useSaleWalletAssets.js");
7
+ const require_Base = require("../../../../../plus/saleDetail/Base.js");
8
+ let react = require("react");
9
+ react = require_runtime.__toESM(react);
10
+ //#region src/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.tsx
11
+ /**
12
+ * 文件角色:封装 HDLKiosk 复用 SaleDetail 时的购物车展示、备注和优惠券配置。
13
+ * 边界:只负责 Cart Overlay 的 BigSale UI 接入,不创建 Host 或执行 Workflow。
14
+ */
15
+ const HIDDEN_MODULES = [
16
+ "overview",
17
+ "customer",
18
+ "contact",
19
+ "cartActions",
20
+ "orderActions",
21
+ "promotionAlert"
22
+ ];
23
+ const CART_ITEM_PRESENTATION = {
24
+ density: "comfortable",
25
+ optionColumns: 2,
26
+ mediaFit: "cover",
27
+ contentAlign: "center",
28
+ tokens: {
29
+ background: "#ffffff",
30
+ borderColor: "#e4e7ec",
31
+ borderRadius: "18px",
32
+ minHeight: "164px",
33
+ mediaWidth: "228px",
34
+ actionRailWidth: "174px",
35
+ contentPadding: "20px 22px",
36
+ actionRailPadding: "18px 20px",
37
+ accentColor: "#b20d12",
38
+ titleColor: "#101828",
39
+ titleFontSize: "32px",
40
+ titleFontWeight: 800,
41
+ priceColor: "#b20d12",
42
+ priceFontSize: "30px",
43
+ optionBackground: "#f5f6f8",
44
+ optionLabelColor: "#667085",
45
+ optionValueColor: "#101828",
46
+ optionGap: "6px",
47
+ shadow: "0 12px 28px rgba(16, 24, 40, 0.08)"
48
+ }
49
+ };
50
+ function useBigSaleHDLKioskCart({ context, onOrderComplete, primaryWeightedProductId, saleDetailModuleConfig, variant }) {
51
+ var _note, _ref, _context$sales$tempOr, _context$sales$bookin, _context$sales$bookin2;
52
+ const walletAssetsCleanupCoordinatorRef = (0, react.useRef)(require_useSaleWalletAssets.createSaleWalletAssetsCleanupCoordinator());
53
+ const saleDetailContext = require_usePickSaleDetailContext.usePickSaleDetailContext(context, onOrderComplete);
54
+ const { openOrderNoteModal, orderNoteModal } = require_useOrderNoteModal.useOrderNoteModal({
55
+ context: saleDetailContext,
56
+ modalClassName: "pisell-kiosk-modal pisell-kiosk-note-modal"
57
+ });
58
+ const hasOrderNote = Boolean(String((_note = (_ref = (_context$sales$tempOr = context.sales.tempOrder) !== null && _context$sales$tempOr !== void 0 ? _context$sales$tempOr : (_context$sales$bookin = context.sales.bookingTicket) === null || _context$sales$bookin === void 0 || (_context$sales$bookin2 = _context$sales$bookin.getTempOrder) === null || _context$sales$bookin2 === void 0 ? void 0 : _context$sales$bookin2.call(_context$sales$bookin)) === null || _ref === void 0 ? void 0 : _ref.note) !== null && _note !== void 0 ? _note : "").trim());
59
+ const selectedPromotionCount = (0, react.useMemo)(() => require_adapters.buildVoucherViews(context.cart.discountList || []).filter((voucher) => voucher.selected).length, [context.cart.discountList]);
60
+ const cartOverlayActions = (0, react.useMemo)(() => ({
61
+ hasNote: hasOrderNote,
62
+ onAddNote: openOrderNoteModal,
63
+ promotionAppliedCount: selectedPromotionCount
64
+ }), [
65
+ hasOrderNote,
66
+ openOrderNoteModal,
67
+ selectedPromotionCount
68
+ ]);
69
+ const moduleConfig = (0, react.useMemo)(() => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, saleDetailModuleConfig), {}, {
70
+ hidden: HIDDEN_MODULES,
71
+ cartItems: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.cartItems), {}, {
72
+ rightActionsDisplay: "inline",
73
+ bookingQuantityMode: "hidden",
74
+ lineNoteEditingEnabled: true,
75
+ showInlineRemoveButton: false,
76
+ showQuantityBadge: false,
77
+ showRemoveButton: true,
78
+ clearSelectedQuantityOnDelete: true,
79
+ productLineItemType: "a12",
80
+ productLineItemPresentation: CART_ITEM_PRESENTATION
81
+ }),
82
+ amountDetails: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.amountDetails), {}, { defaultExpanded: true }),
83
+ promotionWalletPanels: typeof (saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.promotionWalletPanels) === "object" ? saleDetailModuleConfig.promotionWalletPanels : void 0,
84
+ promotionWalletPanelsAppearance: "light",
85
+ promotionWalletPanelsBehavior: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.promotionWalletPanelsBehavior), {}, {
86
+ walletAssetsCleanupCoordinator: walletAssetsCleanupCoordinatorRef.current,
87
+ enableManualPromotionCode: true,
88
+ enablePromotionBanner: true,
89
+ enableVoucherProductAdd: true,
90
+ enableWalletAssets: true,
91
+ preserveWalletAssetsWhileRefreshing: true
92
+ })
93
+ }), [saleDetailModuleConfig]);
94
+ const isPrimaryProductLine = (0, react.useCallback)((item) => {
95
+ var _ref2, _item$_extend$product, _item$_extend;
96
+ return String((_ref2 = (_item$_extend$product = item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 || (_item$_extend = _item$_extend.product) === null || _item$_extend === void 0 ? void 0 : _item$_extend.product_id) !== null && _item$_extend$product !== void 0 ? _item$_extend$product : item === null || item === void 0 ? void 0 : item.product_id) !== null && _ref2 !== void 0 ? _ref2 : "") === String(primaryWeightedProductId !== null && primaryWeightedProductId !== void 0 ? primaryWeightedProductId : "");
97
+ }, [primaryWeightedProductId]);
98
+ return {
99
+ cartOverlayActions,
100
+ orderNoteModal,
101
+ renderCartContent: (0, react.useCallback)(({ promotionsVisible, onEditPrimaryProduct }) => /* @__PURE__ */ react.default.createElement(require_Base.default, {
102
+ className: "hdl-kiosk-voucher-wallet",
103
+ context: saleDetailContext,
104
+ mobilePresentation: "inline",
105
+ moduleConfig: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, moduleConfig), {}, {
106
+ hidden: [...HIDDEN_MODULES, ...promotionsVisible ? [] : ["promotionWalletPanels"]],
107
+ cartItems: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, moduleConfig.cartItems), {}, {
108
+ isProductLineItemEditable: isPrimaryProductLine,
109
+ onProductLineItemEdit: onEditPrimaryProduct ? () => onEditPrimaryProduct() : void 0
110
+ })
111
+ }),
112
+ renderType: "current",
113
+ template: "A",
114
+ variant
115
+ }), [
116
+ isPrimaryProductLine,
117
+ moduleConfig,
118
+ saleDetailContext,
119
+ variant
120
+ ])
121
+ };
122
+ }
123
+ //#endregion
124
+ exports.useBigSaleHDLKioskCart = useBigSaleHDLKioskCart;
@@ -1,6 +1,7 @@
1
1
  require("../../../../../_virtual/_rolldown/runtime.js");
2
2
  let react = require("react");
3
- //#region src/components/bigSale/templates/HDLKiosk/adapter/useHDLKioskEntryPreparationToast.ts
3
+ //#region src/components/bigSale/templates/HDLKiosk/hooks/useHDLKioskEntryPreparationToast.ts
4
+ /** React 层入口准备提示;不属于 BigSale Host/Port 适配。 */
4
5
  function useHDLKioskEntryPreparationToast({ active, message, preparing, toast }) {
5
6
  (0, react.useEffect)(() => {
6
7
  if (!active || !preparing || !(toast === null || toast === void 0 ? void 0 : toast.loading)) return;