@aglyn/plugins-commerce 1.0.0-beta.230 → 1.0.0-beta.231

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 (581) hide show
  1. package/package.json +13 -13
  2. package/src/index.d.ts +0 -1
  3. package/src/index.js +0 -1
  4. package/src/index.js.map +1 -1
  5. package/src/lib/barcode/barcode-decode.d.ts +71 -0
  6. package/src/lib/barcode/barcode-decode.js +498 -0
  7. package/src/lib/barcode/barcode-decode.js.map +1 -0
  8. package/src/lib/barcode/barcode-encode.d.ts +44 -0
  9. package/src/lib/barcode/barcode-encode.js +138 -0
  10. package/src/lib/barcode/barcode-encode.js.map +1 -0
  11. package/src/lib/barcode/barcode-scanner.component.d.ts +23 -0
  12. package/src/lib/barcode/barcode-scanner.component.js +260 -0
  13. package/src/lib/barcode/barcode-scanner.component.js.map +1 -0
  14. package/src/lib/barcode/scan-button.component.d.ts +10 -0
  15. package/src/lib/barcode/scan-button.component.js +62 -0
  16. package/src/lib/barcode/scan-button.component.js.map +1 -0
  17. package/src/lib/barcode/scanner-wedge.d.ts +35 -0
  18. package/src/lib/barcode/scanner-wedge.js +108 -0
  19. package/src/lib/barcode/scanner-wedge.js.map +1 -0
  20. package/src/lib/components/account.js +10 -1
  21. package/src/lib/components/account.js.map +1 -1
  22. package/src/lib/components/cart-extras.d.ts +45 -0
  23. package/src/lib/components/cart-extras.js +127 -0
  24. package/src/lib/components/cart-extras.js.map +1 -0
  25. package/src/lib/components/cart.js +82 -15
  26. package/src/lib/components/cart.js.map +1 -1
  27. package/src/lib/components/checkout-return-notice.d.ts +26 -0
  28. package/src/lib/components/checkout-return-notice.js +48 -0
  29. package/src/lib/components/checkout-return-notice.js.map +1 -0
  30. package/src/lib/components/commerce-console-page.js +124 -0
  31. package/src/lib/components/commerce-console-page.js.map +1 -1
  32. package/src/lib/components/commerce-console-sections.d.ts +1 -1
  33. package/src/lib/components/commerce-console-sections.js +4 -0
  34. package/src/lib/components/commerce-console-sections.js.map +1 -1
  35. package/src/lib/components/console/bulk-fulfill.d.ts +44 -0
  36. package/src/lib/components/console/bulk-fulfill.js +84 -0
  37. package/src/lib/components/console/bulk-fulfill.js.map +1 -0
  38. package/src/lib/components/console/customer-notifications-card.component.d.ts +19 -0
  39. package/src/lib/components/console/customer-notifications-card.component.js +149 -0
  40. package/src/lib/components/console/customer-notifications-card.component.js.map +1 -0
  41. package/src/lib/components/console/host-orders-card.component.js +84 -5
  42. package/src/lib/components/console/host-orders-card.component.js.map +1 -1
  43. package/src/lib/components/console/locations-card.component.js +164 -57
  44. package/src/lib/components/console/locations-card.component.js.map +1 -1
  45. package/src/lib/components/console/order-detail-dialog.component.js +209 -61
  46. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
  47. package/src/lib/components/console/order-fulfillment-panel.component.d.ts +48 -0
  48. package/src/lib/components/console/order-fulfillment-panel.component.js +542 -0
  49. package/src/lib/components/console/order-fulfillment-panel.component.js.map +1 -0
  50. package/src/lib/components/console/order-invoice.component.d.ts +33 -0
  51. package/src/lib/components/console/order-invoice.component.js +81 -0
  52. package/src/lib/components/console/order-invoice.component.js.map +1 -0
  53. package/src/lib/components/console/order-receipt-resend.component.d.ts +21 -0
  54. package/src/lib/components/console/order-receipt-resend.component.js +203 -0
  55. package/src/lib/components/console/order-receipt-resend.component.js.map +1 -0
  56. package/src/lib/components/console/order-returns.component.d.ts +36 -0
  57. package/src/lib/components/console/order-returns.component.js +142 -0
  58. package/src/lib/components/console/order-returns.component.js.map +1 -0
  59. package/src/lib/components/console/order-shipping-actions.component.d.ts +54 -0
  60. package/src/lib/components/console/order-shipping-actions.component.js +149 -0
  61. package/src/lib/components/console/order-shipping-actions.component.js.map +1 -0
  62. package/src/lib/components/console/order-webhooks-card.component.d.ts +50 -0
  63. package/src/lib/components/console/order-webhooks-card.component.js +623 -0
  64. package/src/lib/components/console/order-webhooks-card.component.js.map +1 -0
  65. package/src/lib/components/console/order-zones.d.ts +155 -0
  66. package/src/lib/components/console/order-zones.js +40 -0
  67. package/src/lib/components/console/order-zones.js.map +1 -0
  68. package/src/lib/components/console/payment-methods-card.component.d.ts +67 -0
  69. package/src/lib/components/console/payment-methods-card.component.js +395 -0
  70. package/src/lib/components/console/payment-methods-card.component.js.map +1 -0
  71. package/src/lib/components/console/pos/pos-api.d.ts +124 -0
  72. package/src/lib/components/console/pos/pos-api.js +101 -0
  73. package/src/lib/components/console/pos/pos-api.js.map +1 -0
  74. package/src/lib/components/console/pos/pos-cart-panel.component.d.ts +36 -0
  75. package/src/lib/components/console/pos/pos-cart-panel.component.js +160 -0
  76. package/src/lib/components/console/pos/pos-cart-panel.component.js.map +1 -0
  77. package/src/lib/components/console/pos/pos-item-dialog.component.d.ts +39 -0
  78. package/src/lib/components/console/pos/pos-item-dialog.component.js +352 -0
  79. package/src/lib/components/console/pos/pos-item-dialog.component.js.map +1 -0
  80. package/src/lib/components/console/pos/pos-product-grid.component.d.ts +47 -0
  81. package/src/lib/components/console/pos/pos-product-grid.component.js +272 -0
  82. package/src/lib/components/console/pos/pos-product-grid.component.js.map +1 -0
  83. package/src/lib/components/console/pos/pos-receipt-panel.component.d.ts +27 -0
  84. package/src/lib/components/console/pos/pos-receipt-panel.component.js +282 -0
  85. package/src/lib/components/console/pos/pos-receipt-panel.component.js.map +1 -0
  86. package/src/lib/components/console/pos/pos-tender-dialogs.component.d.ts +53 -0
  87. package/src/lib/components/console/pos/pos-tender-dialogs.component.js +445 -0
  88. package/src/lib/components/console/pos/pos-tender-dialogs.component.js.map +1 -0
  89. package/src/lib/components/console/pos/pos-tender-panel.component.d.ts +31 -0
  90. package/src/lib/components/console/pos/pos-tender-panel.component.js +640 -0
  91. package/src/lib/components/console/pos/pos-tender-panel.component.js.map +1 -0
  92. package/src/lib/components/console/pos/use-pos-display.d.ts +43 -0
  93. package/src/lib/components/console/pos/use-pos-display.js +161 -0
  94. package/src/lib/components/console/pos/use-pos-display.js.map +1 -0
  95. package/src/lib/components/console/pos-devices-card.component.d.ts +14 -0
  96. package/src/lib/components/console/pos-devices-card.component.js +546 -0
  97. package/src/lib/components/console/pos-devices-card.component.js.map +1 -0
  98. package/src/lib/components/console/pos-display/brand-screen.d.ts +33 -0
  99. package/src/lib/components/console/pos-display/brand-screen.js +85 -0
  100. package/src/lib/components/console/pos-display/brand-screen.js.map +1 -0
  101. package/src/lib/components/console/pos-display/cart-screen.d.ts +29 -0
  102. package/src/lib/components/console/pos-display/cart-screen.js +166 -0
  103. package/src/lib/components/console/pos-display/cart-screen.js.map +1 -0
  104. package/src/lib/components/console/pos-display/pairing-screen.d.ts +24 -0
  105. package/src/lib/components/console/pos-display/pairing-screen.js +127 -0
  106. package/src/lib/components/console/pos-display/pairing-screen.js.map +1 -0
  107. package/src/lib/components/console/pos-display/pos-display-api.d.ts +90 -0
  108. package/src/lib/components/console/pos-display/pos-display-api.js +140 -0
  109. package/src/lib/components/console/pos-display/pos-display-api.js.map +1 -0
  110. package/src/lib/components/console/pos-display/receipt-screen.d.ts +35 -0
  111. package/src/lib/components/console/pos-display/receipt-screen.js +200 -0
  112. package/src/lib/components/console/pos-display/receipt-screen.js.map +1 -0
  113. package/src/lib/components/console/pos-display/tip-screen.d.ts +36 -0
  114. package/src/lib/components/console/pos-display/tip-screen.js +211 -0
  115. package/src/lib/components/console/pos-display/tip-screen.js.map +1 -0
  116. package/src/lib/components/console/pos-display-page.component.d.ts +16 -0
  117. package/src/lib/components/console/pos-display-page.component.js +407 -0
  118. package/src/lib/components/console/pos-display-page.component.js.map +1 -0
  119. package/src/lib/components/console/pos-ops/pos-customer-lookup.component.d.ts +40 -0
  120. package/src/lib/components/console/pos-ops/pos-customer-lookup.component.js +289 -0
  121. package/src/lib/components/console/pos-ops/pos-customer-lookup.component.js.map +1 -0
  122. package/src/lib/components/console/pos-ops/pos-last-receipt.component.d.ts +34 -0
  123. package/src/lib/components/console/pos-ops/pos-last-receipt.component.js +61 -0
  124. package/src/lib/components/console/pos-ops/pos-last-receipt.component.js.map +1 -0
  125. package/src/lib/components/console/pos-ops/pos-operations-bar.component.d.ts +38 -0
  126. package/src/lib/components/console/pos-ops/pos-operations-bar.component.js +129 -0
  127. package/src/lib/components/console/pos-ops/pos-operations-bar.component.js.map +1 -0
  128. package/src/lib/components/console/pos-ops/pos-ops-api.d.ts +37 -0
  129. package/src/lib/components/console/pos-ops/pos-ops-api.js +60 -0
  130. package/src/lib/components/console/pos-ops/pos-ops-api.js.map +1 -0
  131. package/src/lib/components/console/pos-ops/pos-pin-pad.component.d.ts +48 -0
  132. package/src/lib/components/console/pos-ops/pos-pin-pad.component.js +220 -0
  133. package/src/lib/components/console/pos-ops/pos-pin-pad.component.js.map +1 -0
  134. package/src/lib/components/console/pos-ops/pos-receipt-actions.component.d.ts +63 -0
  135. package/src/lib/components/console/pos-ops/pos-receipt-actions.component.js +186 -0
  136. package/src/lib/components/console/pos-ops/pos-receipt-actions.component.js.map +1 -0
  137. package/src/lib/components/console/pos-ops/pos-receipt.d.ts +39 -0
  138. package/src/lib/components/console/pos-ops/pos-receipt.js +182 -0
  139. package/src/lib/components/console/pos-ops/pos-receipt.js.map +1 -0
  140. package/src/lib/components/console/pos-ops/pos-return-dialog.component.d.ts +40 -0
  141. package/src/lib/components/console/pos-ops/pos-return-dialog.component.js +465 -0
  142. package/src/lib/components/console/pos-ops/pos-return-dialog.component.js.map +1 -0
  143. package/src/lib/components/console/pos-ops/pos-shift-history-card.component.d.ts +29 -0
  144. package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js +253 -0
  145. package/src/lib/components/console/pos-ops/pos-shift-history-card.component.js.map +1 -0
  146. package/src/lib/components/console/pos-ops/pos-shift-panel.component.d.ts +34 -0
  147. package/src/lib/components/console/pos-ops/pos-shift-panel.component.js +494 -0
  148. package/src/lib/components/console/pos-ops/pos-shift-panel.component.js.map +1 -0
  149. package/src/lib/components/console/pos-ops/pos-shift-report.component.d.ts +37 -0
  150. package/src/lib/components/console/pos-ops/pos-shift-report.component.js +102 -0
  151. package/src/lib/components/console/pos-ops/pos-shift-report.component.js.map +1 -0
  152. package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.d.ts +30 -0
  153. package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.js +277 -0
  154. package/src/lib/components/console/pos-ops/pos-staff-pins-card.component.js.map +1 -0
  155. package/src/lib/components/console/pos-ops/register-ops.d.ts +28 -0
  156. package/src/lib/components/console/pos-ops/register-ops.js +28 -0
  157. package/src/lib/components/console/pos-ops/register-ops.js.map +1 -0
  158. package/src/lib/components/console/pos-ops/use-pos-cashier.d.ts +46 -0
  159. package/src/lib/components/console/pos-ops/use-pos-cashier.js +128 -0
  160. package/src/lib/components/console/pos-ops/use-pos-cashier.js.map +1 -0
  161. package/src/lib/components/console/pos-ops/use-pos-sale-receipt.d.ts +36 -0
  162. package/src/lib/components/console/pos-ops/use-pos-sale-receipt.js +64 -0
  163. package/src/lib/components/console/pos-ops/use-pos-sale-receipt.js.map +1 -0
  164. package/src/lib/components/console/pos-page.component.d.ts +13 -5
  165. package/src/lib/components/console/pos-page.component.js +729 -657
  166. package/src/lib/components/console/pos-page.component.js.map +1 -1
  167. package/src/lib/components/console/product-editor-dialog.component.js +51 -7
  168. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
  169. package/src/lib/components/console/product-labels-dialog.component.d.ts +13 -0
  170. package/src/lib/components/console/product-labels-dialog.component.js +197 -0
  171. package/src/lib/components/console/product-labels-dialog.component.js.map +1 -0
  172. package/src/lib/components/console/product-register-fields.component.d.ts +19 -0
  173. package/src/lib/components/console/product-register-fields.component.js +241 -0
  174. package/src/lib/components/console/product-register-fields.component.js.map +1 -0
  175. package/src/lib/components/console/product-zones.d.ts +44 -0
  176. package/src/lib/components/console/product-zones.js.map +1 -1
  177. package/src/lib/components/console/products-hub-card.component.js +12 -0
  178. package/src/lib/components/console/products-hub-card.component.js.map +1 -1
  179. package/src/lib/components/console/register-hardware-card.component.d.ts +33 -0
  180. package/src/lib/components/console/register-hardware-card.component.js +826 -0
  181. package/src/lib/components/console/register-hardware-card.component.js.map +1 -0
  182. package/src/lib/components/console/registers-card.component.js +24 -5
  183. package/src/lib/components/console/registers-card.component.js.map +1 -1
  184. package/src/lib/components/console/return-actions.d.ts +38 -0
  185. package/src/lib/components/console/return-actions.js +76 -0
  186. package/src/lib/components/console/return-actions.js.map +1 -0
  187. package/src/lib/components/console/return-detail-dialog.component.d.ts +34 -0
  188. package/src/lib/components/console/return-detail-dialog.component.js +718 -0
  189. package/src/lib/components/console/return-detail-dialog.component.js.map +1 -0
  190. package/src/lib/components/console/return-settings-card.component.d.ts +34 -0
  191. package/src/lib/components/console/return-settings-card.component.js +195 -0
  192. package/src/lib/components/console/return-settings-card.component.js.map +1 -0
  193. package/src/lib/components/console/return-zones.d.ts +87 -0
  194. package/src/lib/components/console/return-zones.js +31 -0
  195. package/src/lib/components/console/return-zones.js.map +1 -0
  196. package/src/lib/components/console/returns-card.component.d.ts +45 -0
  197. package/src/lib/components/console/returns-card.component.js +159 -0
  198. package/src/lib/components/console/returns-card.component.js.map +1 -0
  199. package/src/lib/components/console/shipping-settings-card.component.js +161 -5
  200. package/src/lib/components/console/shipping-settings-card.component.js.map +1 -1
  201. package/src/lib/components/console/shippingeasy-card.component.d.ts +59 -0
  202. package/src/lib/components/console/shippingeasy-card.component.js +378 -0
  203. package/src/lib/components/console/shippingeasy-card.component.js.map +1 -0
  204. package/src/lib/components/console/shipstation-card.component.d.ts +35 -0
  205. package/src/lib/components/console/shipstation-card.component.js +345 -0
  206. package/src/lib/components/console/shipstation-card.component.js.map +1 -0
  207. package/src/lib/components/console/start-return-dialog.component.d.ts +40 -0
  208. package/src/lib/components/console/start-return-dialog.component.js +243 -0
  209. package/src/lib/components/console/start-return-dialog.component.js.map +1 -0
  210. package/src/lib/components/console/stock-movements-card.component.js +2 -1
  211. package/src/lib/components/console/stock-movements-card.component.js.map +1 -1
  212. package/src/lib/components/console/store-settings-card.component.js +2 -66
  213. package/src/lib/components/console/store-settings-card.component.js.map +1 -1
  214. package/src/lib/components/console/store-zones.d.ts +42 -0
  215. package/src/lib/components/console/store-zones.js +39 -0
  216. package/src/lib/components/console/store-zones.js.map +1 -0
  217. package/src/lib/components/order-status.d.ts +36 -0
  218. package/src/lib/components/order-status.js +502 -0
  219. package/src/lib/components/order-status.js.map +1 -0
  220. package/src/lib/components/product-detail.js +41 -2
  221. package/src/lib/components/product-detail.js.map +1 -1
  222. package/src/lib/components/return-request.d.ts +32 -0
  223. package/src/lib/components/return-request.js +576 -0
  224. package/src/lib/components/return-request.js.map +1 -0
  225. package/src/lib/components/storefront-payment-appearance.d.ts +32 -0
  226. package/src/lib/components/storefront-payment-appearance.js +114 -0
  227. package/src/lib/components/storefront-payment-appearance.js.map +1 -0
  228. package/src/lib/components/storefront-payment-element.d.ts +57 -1
  229. package/src/lib/components/storefront-payment-element.js +332 -33
  230. package/src/lib/components/storefront-payment-element.js.map +1 -1
  231. package/src/lib/constants/order-status.d.ts +22 -0
  232. package/src/lib/constants/order-status.js +22 -0
  233. package/src/lib/constants/order-status.js.map +1 -0
  234. package/src/lib/constants/return-request.d.ts +27 -0
  235. package/src/lib/constants/return-request.js +32 -0
  236. package/src/lib/constants/return-request.js.map +1 -0
  237. package/src/lib/constants/stock-movement-query.js +2 -1
  238. package/src/lib/constants/stock-movement-query.js.map +1 -1
  239. package/src/lib/declarations.console-server.js +9 -0
  240. package/src/lib/declarations.console-server.js.map +1 -1
  241. package/src/lib/declarations.server.d.ts +2 -1
  242. package/src/lib/declarations.server.js +47 -1
  243. package/src/lib/declarations.server.js.map +1 -1
  244. package/src/lib/model/buyer-notifications.d.ts +59 -0
  245. package/src/lib/model/buyer-notifications.js +97 -0
  246. package/src/lib/model/buyer-notifications.js.map +1 -0
  247. package/src/lib/model/commerce-orders.d.ts +127 -1
  248. package/src/lib/model/commerce-orders.js +24 -15
  249. package/src/lib/model/commerce-orders.js.map +1 -1
  250. package/src/lib/model/commerce-payment-methods.d.ts +146 -0
  251. package/src/lib/model/commerce-payment-methods.js +247 -0
  252. package/src/lib/model/commerce-payment-methods.js.map +1 -0
  253. package/src/lib/model/commerce-pos-ops.d.ts +437 -0
  254. package/src/lib/model/commerce-pos-ops.js +721 -0
  255. package/src/lib/model/commerce-pos-ops.js.map +1 -0
  256. package/src/lib/model/commerce-pos.d.ts +263 -0
  257. package/src/lib/model/commerce-pos.js +375 -0
  258. package/src/lib/model/commerce-pos.js.map +1 -0
  259. package/src/lib/model/commerce-printers.d.ts +211 -0
  260. package/src/lib/model/commerce-printers.js +181 -0
  261. package/src/lib/model/commerce-printers.js.map +1 -0
  262. package/src/lib/model/commerce-receipt.d.ts +97 -0
  263. package/src/lib/model/commerce-receipt.js +180 -0
  264. package/src/lib/model/commerce-receipt.js.map +1 -0
  265. package/src/lib/model/commerce-returns.d.ts +207 -0
  266. package/src/lib/model/commerce-returns.js +300 -0
  267. package/src/lib/model/commerce-returns.js.map +1 -0
  268. package/src/lib/model/commerce-shipping.d.ts +44 -1
  269. package/src/lib/model/commerce-shipping.js +53 -9
  270. package/src/lib/model/commerce-shipping.js.map +1 -1
  271. package/src/lib/model/commerce-tax-engine.d.ts +90 -0
  272. package/src/lib/model/commerce-tax-engine.js +129 -0
  273. package/src/lib/model/commerce-tax-engine.js.map +1 -0
  274. package/src/lib/model/commerce.d.ts +88 -2
  275. package/src/lib/model/commerce.js +89 -1
  276. package/src/lib/model/commerce.js.map +1 -1
  277. package/src/lib/model/index.d.ts +15 -0
  278. package/src/lib/model/index.js +15 -0
  279. package/src/lib/model/index.js.map +1 -1
  280. package/src/lib/model/order-events.d.ts +154 -0
  281. package/src/lib/model/order-events.js +153 -0
  282. package/src/lib/model/order-events.js.map +1 -0
  283. package/src/lib/model/order-fulfillment.d.ts +117 -0
  284. package/src/lib/model/order-fulfillment.js +217 -0
  285. package/src/lib/model/order-fulfillment.js.map +1 -0
  286. package/src/lib/model/order-history.d.ts +58 -0
  287. package/src/lib/model/order-history.js +22 -0
  288. package/src/lib/model/order-history.js.map +1 -0
  289. package/src/lib/model/order-list-fields.d.ts +9 -1
  290. package/src/lib/model/order-list-fields.js +7 -1
  291. package/src/lib/model/order-list-fields.js.map +1 -1
  292. package/src/lib/model/order-shipping-export.d.ts +91 -0
  293. package/src/lib/model/order-shipping-export.js +192 -0
  294. package/src/lib/model/order-shipping-export.js.map +1 -0
  295. package/src/lib/model/order-status-view.d.ts +103 -0
  296. package/src/lib/model/order-status-view.js +156 -0
  297. package/src/lib/model/order-status-view.js.map +1 -0
  298. package/src/lib/model/order-webhooks.d.ts +142 -0
  299. package/src/lib/model/order-webhooks.js +91 -0
  300. package/src/lib/model/order-webhooks.js.map +1 -0
  301. package/src/lib/model/product-channel.d.ts +56 -0
  302. package/src/lib/model/product-channel.js +86 -0
  303. package/src/lib/model/product-channel.js.map +1 -0
  304. package/src/lib/model/product-modifiers.d.ts +80 -0
  305. package/src/lib/model/product-modifiers.js +140 -0
  306. package/src/lib/model/product-modifiers.js.map +1 -0
  307. package/src/lib/model/shippingeasy.d.ts +94 -0
  308. package/src/lib/model/shippingeasy.js +267 -0
  309. package/src/lib/model/shippingeasy.js.map +1 -0
  310. package/src/lib/model/shipstation.d.ts +125 -0
  311. package/src/lib/model/shipstation.js +399 -0
  312. package/src/lib/model/shipstation.js.map +1 -0
  313. package/src/lib/model/smart-collection-reads.d.ts +32 -0
  314. package/src/lib/model/smart-collection-reads.js +63 -0
  315. package/src/lib/model/smart-collection-reads.js.map +1 -0
  316. package/src/lib/model/tracking-url.d.ts +74 -0
  317. package/src/lib/model/tracking-url.js +159 -0
  318. package/src/lib/model/tracking-url.js.map +1 -0
  319. package/src/lib/plugin-config.d.ts +13 -0
  320. package/src/lib/plugin-config.js +77 -5
  321. package/src/lib/plugin-config.js.map +1 -1
  322. package/src/lib/plugin.js +23 -0
  323. package/src/lib/plugin.js.map +1 -1
  324. package/src/lib/pos-ops-config.d.ts +39 -0
  325. package/src/lib/pos-ops-config.js +88 -0
  326. package/src/lib/pos-ops-config.js.map +1 -0
  327. package/src/lib/printing/print-document.d.ts +106 -0
  328. package/src/lib/printing/print-document.js +464 -0
  329. package/src/lib/printing/print-document.js.map +1 -0
  330. package/src/lib/printing/product-labels.d.ts +58 -0
  331. package/src/lib/printing/product-labels.js +116 -0
  332. package/src/lib/printing/product-labels.js.map +1 -0
  333. package/src/lib/printing/render-epson.d.ts +57 -0
  334. package/src/lib/printing/render-epson.js +135 -0
  335. package/src/lib/printing/render-epson.js.map +1 -0
  336. package/src/lib/printing/render-star.d.ts +45 -0
  337. package/src/lib/printing/render-star.js +100 -0
  338. package/src/lib/printing/render-star.js.map +1 -0
  339. package/src/lib/printing/render-text.d.ts +25 -0
  340. package/src/lib/printing/render-text.js +53 -0
  341. package/src/lib/printing/render-text.js.map +1 -0
  342. package/src/lib/server/api-v1/openapi.js +27 -4
  343. package/src/lib/server/api-v1/openapi.js.map +1 -1
  344. package/src/lib/server/api-v1/order-view.d.ts +67 -0
  345. package/src/lib/server/api-v1/order-view.js +120 -0
  346. package/src/lib/server/api-v1/order-view.js.map +1 -0
  347. package/src/lib/server/api-v1/orders-and-products.js +58 -65
  348. package/src/lib/server/api-v1/orders-and-products.js.map +1 -1
  349. package/src/lib/server/billing-webhook.js +135 -28
  350. package/src/lib/server/billing-webhook.js.map +1 -1
  351. package/src/lib/server/cancel-order.js +29 -0
  352. package/src/lib/server/cancel-order.js.map +1 -1
  353. package/src/lib/server/carrier-rates-availability.d.ts +26 -0
  354. package/src/lib/server/carrier-rates-availability.js +76 -0
  355. package/src/lib/server/carrier-rates-availability.js.map +1 -0
  356. package/src/lib/server/carrier-shipping.d.ts +84 -0
  357. package/src/lib/server/carrier-shipping.js +135 -0
  358. package/src/lib/server/carrier-shipping.js.map +1 -0
  359. package/src/lib/server/cart-checkout.d.ts +2 -0
  360. package/src/lib/server/cart-checkout.js +226 -22
  361. package/src/lib/server/cart-checkout.js.map +1 -1
  362. package/src/lib/server/checkout-extras.d.ts +64 -0
  363. package/src/lib/server/checkout-extras.js +157 -0
  364. package/src/lib/server/checkout-extras.js.map +1 -0
  365. package/src/lib/server/{feed.d.ts → checkout-status.d.ts} +2 -7
  366. package/src/lib/server/checkout-status.js +111 -0
  367. package/src/lib/server/checkout-status.js.map +1 -0
  368. package/src/lib/server/checkout.js +86 -9
  369. package/src/lib/server/checkout.js.map +1 -1
  370. package/src/lib/server/draft-order.js +34 -5
  371. package/src/lib/server/draft-order.js.map +1 -1
  372. package/src/lib/server/fulfill-order.d.ts +127 -10
  373. package/src/lib/server/fulfill-order.js +451 -49
  374. package/src/lib/server/fulfill-order.js.map +1 -1
  375. package/src/lib/server/legacy-feed.d.ts +28 -0
  376. package/src/lib/server/legacy-feed.js +52 -0
  377. package/src/lib/server/legacy-feed.js.map +1 -0
  378. package/src/lib/server/native-checkout.d.ts +34 -15
  379. package/src/lib/server/native-checkout.js +32 -17
  380. package/src/lib/server/native-checkout.js.map +1 -1
  381. package/src/lib/server/order-event-host-emit.d.ts +23 -0
  382. package/src/lib/server/order-event-host-emit.js +30 -0
  383. package/src/lib/server/order-event-host-emit.js.map +1 -0
  384. package/src/lib/server/order-event-triggers.d.ts +37 -0
  385. package/src/lib/server/order-event-triggers.js +119 -0
  386. package/src/lib/server/order-event-triggers.js.map +1 -0
  387. package/src/lib/server/order-events.d.ts +62 -0
  388. package/src/lib/server/order-events.js +109 -0
  389. package/src/lib/server/order-events.js.map +1 -0
  390. package/src/lib/server/order-history.d.ts +23 -0
  391. package/src/lib/server/order-history.js +65 -0
  392. package/src/lib/server/order-history.js.map +1 -0
  393. package/src/lib/server/order-notifications.d.ts +185 -0
  394. package/src/lib/server/order-notifications.js +567 -0
  395. package/src/lib/server/order-notifications.js.map +1 -0
  396. package/src/lib/server/order-receipt-send.d.ts +39 -0
  397. package/src/lib/server/order-receipt-send.js +151 -0
  398. package/src/lib/server/order-receipt-send.js.map +1 -0
  399. package/src/lib/server/order-status-token.d.ts +31 -0
  400. package/src/lib/server/order-status-token.js +75 -0
  401. package/src/lib/server/order-status-token.js.map +1 -0
  402. package/src/lib/server/order-status.d.ts +58 -0
  403. package/src/lib/server/order-status.js +141 -0
  404. package/src/lib/server/order-status.js.map +1 -0
  405. package/src/lib/server/order-webhooks.d.ts +108 -0
  406. package/src/lib/server/order-webhooks.js +622 -0
  407. package/src/lib/server/order-webhooks.js.map +1 -0
  408. package/src/lib/server/orders-shipping-prepare.d.ts +26 -0
  409. package/src/lib/server/orders-shipping-prepare.js +121 -0
  410. package/src/lib/server/orders-shipping-prepare.js.map +1 -0
  411. package/src/lib/server/payment-method-domains.d.ts +209 -0
  412. package/src/lib/server/payment-method-domains.js +444 -0
  413. package/src/lib/server/payment-method-domains.js.map +1 -0
  414. package/src/lib/server/payment-methods.d.ts +77 -0
  415. package/src/lib/server/payment-methods.js +284 -0
  416. package/src/lib/server/payment-methods.js.map +1 -0
  417. package/src/lib/server/pos-auth.d.ts +50 -0
  418. package/src/lib/server/pos-auth.js +121 -0
  419. package/src/lib/server/pos-auth.js.map +1 -0
  420. package/src/lib/server/pos-customer.d.ts +49 -0
  421. package/src/lib/server/pos-customer.js +257 -0
  422. package/src/lib/server/pos-customer.js.map +1 -0
  423. package/src/lib/server/pos-display.d.ts +57 -0
  424. package/src/lib/server/pos-display.js +419 -0
  425. package/src/lib/server/pos-display.js.map +1 -0
  426. package/src/lib/server/pos-fee-month.d.ts +34 -0
  427. package/src/lib/server/pos-fee-month.js +36 -0
  428. package/src/lib/server/pos-fee-month.js.map +1 -0
  429. package/src/lib/server/pos-ops-gate.d.ts +161 -0
  430. package/src/lib/server/pos-ops-gate.js +295 -0
  431. package/src/lib/server/pos-ops-gate.js.map +1 -0
  432. package/src/lib/server/pos-ops-routes.d.ts +22 -0
  433. package/src/lib/server/pos-ops-routes.js +36 -0
  434. package/src/lib/server/pos-ops-routes.js.map +1 -0
  435. package/src/lib/server/pos-order.d.ts +1 -18
  436. package/src/lib/server/pos-order.js +222 -42
  437. package/src/lib/server/pos-order.js.map +1 -1
  438. package/src/lib/server/pos-payment.d.ts +39 -0
  439. package/src/lib/server/pos-payment.js +922 -0
  440. package/src/lib/server/pos-payment.js.map +1 -0
  441. package/src/lib/server/pos-print.d.ts +82 -0
  442. package/src/lib/server/pos-print.js +193 -0
  443. package/src/lib/server/pos-print.js.map +1 -0
  444. package/src/lib/server/pos-readers.d.ts +27 -0
  445. package/src/lib/server/pos-readers.js +276 -0
  446. package/src/lib/server/pos-readers.js.map +1 -0
  447. package/src/lib/server/pos-refund-authority.d.ts +60 -0
  448. package/src/lib/server/pos-refund-authority.js +72 -0
  449. package/src/lib/server/pos-refund-authority.js.map +1 -0
  450. package/src/lib/server/pos-return.d.ts +58 -0
  451. package/src/lib/server/pos-return.js +891 -0
  452. package/src/lib/server/pos-return.js.map +1 -0
  453. package/src/lib/server/pos-sale-stamp.d.ts +66 -0
  454. package/src/lib/server/pos-sale-stamp.js +84 -0
  455. package/src/lib/server/pos-sale-stamp.js.map +1 -0
  456. package/src/lib/server/pos-sale.d.ts +170 -0
  457. package/src/lib/server/pos-sale.js +461 -0
  458. package/src/lib/server/pos-sale.js.map +1 -0
  459. package/src/lib/server/pos-shift.d.ts +45 -0
  460. package/src/lib/server/pos-shift.js +484 -0
  461. package/src/lib/server/pos-shift.js.map +1 -0
  462. package/src/lib/server/pos-staff-pin.d.ts +26 -0
  463. package/src/lib/server/pos-staff-pin.js +339 -0
  464. package/src/lib/server/pos-staff-pin.js.map +1 -0
  465. package/src/lib/server/pos-stripe.d.ts +91 -0
  466. package/src/lib/server/pos-stripe.js +129 -0
  467. package/src/lib/server/pos-stripe.js.map +1 -0
  468. package/src/lib/server/pos-terminal-connection-token.d.ts +48 -0
  469. package/src/lib/server/pos-terminal-connection-token.js +166 -0
  470. package/src/lib/server/pos-terminal-connection-token.js.map +1 -0
  471. package/src/lib/server/pos-terminal.d.ts +218 -0
  472. package/src/lib/server/pos-terminal.js +1014 -0
  473. package/src/lib/server/pos-terminal.js.map +1 -0
  474. package/src/lib/server/print-queue.d.ts +124 -0
  475. package/src/lib/server/print-queue.js +301 -0
  476. package/src/lib/server/print-queue.js.map +1 -0
  477. package/src/lib/server/printer-poll.d.ts +75 -0
  478. package/src/lib/server/printer-poll.js +325 -0
  479. package/src/lib/server/printer-poll.js.map +1 -0
  480. package/src/lib/server/printer-secret.d.ts +39 -0
  481. package/src/lib/server/printer-secret.js +56 -0
  482. package/src/lib/server/printer-secret.js.map +1 -0
  483. package/src/lib/server/printers.d.ts +114 -0
  484. package/src/lib/server/printers.js +546 -0
  485. package/src/lib/server/printers.js.map +1 -0
  486. package/src/lib/server/product-catalog.d.ts +42 -0
  487. package/src/lib/server/product-catalog.js +305 -0
  488. package/src/lib/server/product-catalog.js.map +1 -0
  489. package/src/lib/server/refund.js +110 -45
  490. package/src/lib/server/refund.js.map +1 -1
  491. package/src/lib/server/reserve.js +2 -0
  492. package/src/lib/server/reserve.js.map +1 -1
  493. package/src/lib/server/return-status-action.d.ts +37 -0
  494. package/src/lib/server/return-status-action.js +57 -0
  495. package/src/lib/server/return-status-action.js.map +1 -0
  496. package/src/lib/server/returns.d.ts +119 -0
  497. package/src/lib/server/returns.js +938 -0
  498. package/src/lib/server/returns.js.map +1 -0
  499. package/src/lib/server/shipment-records.d.ts +36 -0
  500. package/src/lib/server/shipment-records.js +289 -0
  501. package/src/lib/server/shipment-records.js.map +1 -0
  502. package/src/lib/server/shipping-connector-gates.d.ts +40 -0
  503. package/src/lib/server/shipping-connector-gates.js +97 -0
  504. package/src/lib/server/shipping-connector-gates.js.map +1 -0
  505. package/src/lib/server/shipping-connectors.d.ts +29 -0
  506. package/src/lib/server/shipping-connectors.js +236 -0
  507. package/src/lib/server/shipping-connectors.js.map +1 -0
  508. package/src/lib/server/shippingeasy.d.ts +238 -0
  509. package/src/lib/server/shippingeasy.js +787 -0
  510. package/src/lib/server/shippingeasy.js.map +1 -0
  511. package/src/lib/server/shipstation.d.ts +129 -0
  512. package/src/lib/server/shipstation.js +483 -0
  513. package/src/lib/server/shipstation.js.map +1 -0
  514. package/src/lib/server/site-page-resolver.d.ts +5 -0
  515. package/src/lib/server/site-page-resolver.js +156 -1
  516. package/src/lib/server/site-page-resolver.js.map +1 -1
  517. package/src/lib/server/stock-levels.d.ts +21 -0
  518. package/src/lib/server/stock-levels.js +263 -0
  519. package/src/lib/server/stock-levels.js.map +1 -0
  520. package/src/lib/server/stripe-refund.d.ts +47 -0
  521. package/src/lib/server/stripe-refund.js +87 -0
  522. package/src/lib/server/stripe-refund.js.map +1 -0
  523. package/src/lib/server/supplier-update.js +46 -5
  524. package/src/lib/server/supplier-update.js.map +1 -1
  525. package/src/lib/server/tax-engine-quote.d.ts +47 -0
  526. package/src/lib/server/tax-engine-quote.js +105 -0
  527. package/src/lib/server/tax-engine-quote.js.map +1 -0
  528. package/src/lib/server.js +138 -2
  529. package/src/lib/server.js.map +1 -1
  530. package/src/lib/site.js +12 -0
  531. package/src/lib/site.js.map +1 -1
  532. package/src/lib/subprocessors.d.ts +26 -0
  533. package/src/lib/subprocessors.js +50 -0
  534. package/src/lib/subprocessors.js.map +1 -0
  535. package/src/lib/tenant-emails.js +461 -3
  536. package/src/lib/tenant-emails.js.map +1 -1
  537. package/src/lib/testing/fake-firestore.d.ts +45 -0
  538. package/src/lib/testing/fake-firestore.js +189 -0
  539. package/src/lib/testing/fake-firestore.js.map +1 -0
  540. package/src/lib/testing/memory-firestore.d.ts +123 -0
  541. package/src/lib/testing/memory-firestore.js +274 -0
  542. package/src/lib/testing/memory-firestore.js.map +1 -0
  543. package/src/lib/testing/pos-ops-harness.d.ts +50 -0
  544. package/src/lib/testing/pos-ops-harness.js +184 -0
  545. package/src/lib/testing/pos-ops-harness.js.map +1 -0
  546. package/src/lib/testing/pos-ops-memory-firestore.d.ts +55 -0
  547. package/src/lib/testing/pos-ops-memory-firestore.js +376 -0
  548. package/src/lib/testing/pos-ops-memory-firestore.js.map +1 -0
  549. package/src/lib/transfer/records-transfer.d.ts +11 -1
  550. package/src/lib/transfer/records-transfer.js +127 -5
  551. package/src/lib/transfer/records-transfer.js.map +1 -1
  552. package/src/lib/transfer/records.server.d.ts +9 -2
  553. package/src/lib/transfer/records.server.js +58 -7
  554. package/src/lib/transfer/records.server.js.map +1 -1
  555. package/src/lib/transfer/register-transfer-resources.js +40 -1
  556. package/src/lib/transfer/register-transfer-resources.js.map +1 -1
  557. package/src/lib/transfer/register-transfer-ui.js +4 -1
  558. package/src/lib/transfer/register-transfer-ui.js.map +1 -1
  559. package/src/lib/transfer/shipping-presets.d.ts +23 -0
  560. package/src/lib/transfer/shipping-presets.js +156 -0
  561. package/src/lib/transfer/shipping-presets.js.map +1 -0
  562. package/src/lib/transfer/tracking-transfer.d.ts +101 -0
  563. package/src/lib/transfer/tracking-transfer.js +546 -0
  564. package/src/lib/transfer/tracking-transfer.js.map +1 -0
  565. package/src/lib/transfer/tracking.server.d.ts +37 -0
  566. package/src/lib/transfer/tracking.server.js +393 -0
  567. package/src/lib/transfer/tracking.server.js.map +1 -0
  568. package/src/lib/transfer/transfer-keys.d.ts +2 -1
  569. package/src/lib/transfer/transfer-keys.js +6 -2
  570. package/src/lib/transfer/transfer-keys.js.map +1 -1
  571. package/src/lib/utils/code128.d.ts +37 -0
  572. package/src/lib/utils/code128.js +199 -0
  573. package/src/lib/utils/code128.js.map +1 -0
  574. package/src/lib/utils/order-invoice.d.ts +55 -0
  575. package/src/lib/utils/order-invoice.js +127 -0
  576. package/src/lib/utils/order-invoice.js.map +1 -0
  577. package/src/lib/utils/use-checkout-return-notice.d.ts +34 -0
  578. package/src/lib/utils/use-checkout-return-notice.js +78 -0
  579. package/src/lib/utils/use-checkout-return-notice.js.map +1 -0
  580. package/src/lib/server/feed.js +0 -69
  581. package/src/lib/server/feed.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../libs/plugins/commerce/src/lib/components/console/pos-display/tip-screen.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@mui/material/Button'\nimport InputAdornment from '@mui/material/InputAdornment'\nimport Stack from '@mui/material/Stack'\nimport TextField from '@mui/material/TextField'\nimport Typography from '@mui/material/Typography'\nimport type { CSSObject, Theme } from '@mui/material/styles'\nimport { type FormEvent, useState } from 'react'\nimport * as CommerceModel from '../../../model'\nimport { displayMoney, dollarsToCents, type PosDisplayAnswer } from './pos-display-api'\n\ntype TipPrompt = NonNullable<CommerceModel.PosDisplayState['tip']>\n\n/** A tall, full-width touch target. */\nexport const posDisplayTouchSx = (theme: Theme): CSSObject => ({\n minHeight: theme.spacing(10),\n ...theme.typography.h5,\n})\n\n/**\n * The tip prompt (AGL-3608): the merchant's presets, each with the amount it\n * comes to, a custom amount and no tip. The server recomputes a percentage\n * from the prompt it sent, so what is shown here is never what is charged.\n */\nexport function PosDisplayTipScreen({\n tip,\n promptId,\n busy,\n currency,\n onAnswer,\n}: {\n tip: TipPrompt\n promptId: string\n busy: boolean\n /** The store's currency, from the display state. */\n currency?: string\n onAnswer: (answer: PosDisplayAnswer) => void\n}) {\n const [custom, setCustom] = useState<string | null>(null)\n const [problem, setProblem] = useState<string | null>(null)\n\n const submitCustom = (event: FormEvent) => {\n event.preventDefault()\n const cents = dollarsToCents(custom ?? '')\n const error =\n cents === null\n ? 'Enter an amount, like 5 or 5.50.'\n : CommerceModel.posTipProblem(cents, tip.baseCents)\n if (cents === null || error) {\n setProblem(error)\n return\n }\n setCustom(null)\n setProblem(null)\n onAnswer({ promptId, tipChoice: 'custom', tipCents: cents })\n }\n\n if (custom !== null) {\n return (\n <Stack component=\"form\" onSubmit={submitCustom} spacing={3} sx={{ width: '100%' }}>\n <Typography variant=\"h3\" component=\"h1\" sx={{ textAlign: 'center' }}>\n Custom tip\n </Typography>\n <TextField\n value={custom}\n onChange={(event) => {\n setCustom(event.target.value)\n setProblem(null)\n }}\n autoFocus\n error={Boolean(problem)}\n helperText={problem ?? `Up to ${displayMoney(tip.baseCents, currency)}`}\n slotProps={{\n input: { startAdornment: <InputAdornment position=\"start\">$</InputAdornment> },\n htmlInput: { inputMode: 'decimal', 'aria-label': 'Tip amount' },\n }}\n sx={(theme) => ({ '& input': theme.typography.h4 })}\n />\n <Stack direction=\"row\" spacing={2}>\n <Button\n variant=\"outlined\"\n size=\"large\"\n fullWidth\n disabled={busy}\n onClick={() => {\n setCustom(null)\n setProblem(null)\n }}\n sx={posDisplayTouchSx}\n >\n Back\n </Button>\n <Button\n type=\"submit\"\n variant=\"contained\"\n size=\"large\"\n fullWidth\n disabled={busy || !custom}\n sx={posDisplayTouchSx}\n >\n Add tip\n </Button>\n </Stack>\n </Stack>\n )\n }\n\n return (\n <Stack spacing={3} sx={{ width: '100%' }}>\n <Typography variant=\"h3\" component=\"h1\" sx={{ textAlign: 'center' }}>\n Add a tip?\n </Typography>\n <Typography variant=\"h6\" color=\"text.secondary\" sx={{ textAlign: 'center' }}>\n {`On ${displayMoney(tip.baseCents, currency)}`}\n </Typography>\n <Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>\n {tip.percentages.map((percent) => (\n <Button\n key={percent}\n variant=\"contained\"\n size=\"large\"\n fullWidth\n disabled={busy}\n onClick={() => onAnswer({ promptId, tipChoice: 'percent', tipPercent: percent })}\n sx={(theme) => ({ ...posDisplayTouchSx(theme), flexDirection: 'column' })}\n >\n <span>{`${percent}%`}</span>\n <Typography variant=\"body1\" component=\"span\">\n {displayMoney(CommerceModel.posTipFromPercent(tip.baseCents, percent), currency)}\n </Typography>\n </Button>\n ))}\n </Stack>\n <Stack direction={{ xs: 'column', sm: 'row' }} spacing={2}>\n {tip.allowCustom ? (\n <Button\n variant=\"outlined\"\n size=\"large\"\n fullWidth\n disabled={busy}\n onClick={() => setCustom('')}\n sx={posDisplayTouchSx}\n >\n Custom amount\n </Button>\n ) : null}\n <Button\n variant=\"outlined\"\n size=\"large\"\n fullWidth\n disabled={busy}\n onClick={() => onAnswer({ promptId, tipChoice: 'none' })}\n sx={posDisplayTouchSx}\n >\n No tip\n </Button>\n </Stack>\n </Stack>\n )\n}\n"],"names":["Button","InputAdornment","Stack","TextField","Typography","useState","CommerceModel","displayMoney","dollarsToCents","posDisplayTouchSx","theme","minHeight","spacing","typography","h5","PosDisplayTipScreen","tip","promptId","busy","currency","onAnswer","custom","setCustom","problem","setProblem","submitCustom","event","preventDefault","cents","error","posTipProblem","baseCents","tipChoice","tipCents","component","onSubmit","sx","width","variant","textAlign","value","onChange","target","autoFocus","Boolean","helperText","slotProps","input","startAdornment","position","htmlInput","inputMode","h4","direction","size","fullWidth","disabled","onClick","type","color","xs","sm","percentages","map","percent","tipPercent","flexDirection","span","posTipFromPercent","allowCustom"],"mappings":";;AAAA;;;;;;;;;;;;;;;CAeC,GAED,OAAOA,YAAY,uBAAsB;AACzC,OAAOC,oBAAoB,+BAA8B;AACzD,OAAOC,WAAW,sBAAqB;AACvC,OAAOC,eAAe,0BAAyB;AAC/C,OAAOC,gBAAgB,2BAA0B;AAEjD,SAAyBC,QAAQ,QAAQ,QAAO;AAChD,YAAYC,mBAAmB,0BAAgB;AAC/C,SAASC,YAAY,EAAEC,cAAc,QAA+B,uBAAmB;AAIvF,qCAAqC,GACrC,OAAO,MAAMC,oBAAoB,CAACC,QAA6B;QAC7DC,WAAWD,MAAME,OAAO,CAAC;OACtBF,MAAMG,UAAU,CAACC,EAAE,EACtB;AAEF;;;;CAIC,GACD,OAAO,SAASC,oBAAoB,EAClCC,GAAG,EACHC,QAAQ,EACRC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EAQT;IACC,MAAM,CAACC,QAAQC,UAAU,GAAGjB,SAAwB;IACpD,MAAM,CAACkB,SAAS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AQ;wBACRgB,MAAK;wBACLC,SAAS;wBACTC,UAAUtC;wBACVuC,SAAS,IAAMrC,SAAS;gCAAEH;gCAAUe,WAAW;4BAAO;wBACtDI,IAAI3B;kCACL;;;;;;AAMT"}
@@ -0,0 +1,16 @@
1
+ import type { ConsolePublicPageProps } from '@aglyn/aglyn';
2
+ /** How often the display asks for news while a sale is on screen. */
3
+ export declare const POS_DISPLAY_ACTIVE_POLL_MS = 1000;
4
+ /** And between sales, when nothing on it is changing. */
5
+ export declare const POS_DISPLAY_IDLE_POLL_MS = 3000;
6
+ /**
7
+ * The screen a register turns toward its customer (AGL-3608), served at
8
+ * `/kiosk/commerce/pos-display` with no staff session.
9
+ *
10
+ * It holds one secret, the display token from pairing, and reads one thing
11
+ * with it: its register's display state, polled. Everything the customer
12
+ * answers goes back through `respond`, and the server checks each answer
13
+ * against the prompt it claims to answer, so a stale screen cannot answer
14
+ * the next sale's question.
15
+ */
16
+ export default function PosDisplayPage(_props: ConsolePublicPageProps): import("react").JSX.Element;
@@ -0,0 +1,407 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ 'use client';
17
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
+ import Alert from "@mui/material/Alert";
19
+ import Box from "@mui/material/Box";
20
+ import Button from "@mui/material/Button";
21
+ import CircularProgress from "@mui/material/CircularProgress";
22
+ import Container from "@mui/material/Container";
23
+ import Dialog from "@mui/material/Dialog";
24
+ import DialogActions from "@mui/material/DialogActions";
25
+ import DialogContent from "@mui/material/DialogContent";
26
+ import DialogContentText from "@mui/material/DialogContentText";
27
+ import DialogTitle from "@mui/material/DialogTitle";
28
+ import Stack from "@mui/material/Stack";
29
+ import { useCallback, useEffect, useRef, useState } from "react";
30
+ import * as CommerceModel from "../../model/index.js";
31
+ import { PosDisplayBrandMark, PosDisplayBrandScreen } from "./pos-display/brand-screen.js";
32
+ import { PosDisplayCartView } from "./pos-display/cart-screen.js";
33
+ import { PosDisplayPairingScreen } from "./pos-display/pairing-screen.js";
34
+ import { displayMoney, forgetDisplay, pollDisplay, readStoredToken, respondToDisplay, storeToken } from "./pos-display/pos-display-api.js";
35
+ import { PosDisplayReceiptScreen } from "./pos-display/receipt-screen.js";
36
+ import { PosDisplayTipScreen } from "./pos-display/tip-screen.js";
37
+ /** How often the display asks for news while a sale is on screen. */ export const POS_DISPLAY_ACTIVE_POLL_MS = 1000;
38
+ /** And between sales, when nothing on it is changing. */ export const POS_DISPLAY_IDLE_POLL_MS = 3000;
39
+ /** The store's name and logo are re-read this often, so an edit reaches the screen. */ const BRANDING_REFRESH_MS = 10 * 60 * 1000;
40
+ /**
41
+ * The screen a register turns toward its customer (AGL-3608), served at
42
+ * `/kiosk/commerce/pos-display` with no staff session.
43
+ *
44
+ * It holds one secret, the display token from pairing, and reads one thing
45
+ * with it: its register's display state, polled. Everything the customer
46
+ * answers goes back through `respond`, and the server checks each answer
47
+ * against the prompt it claims to answer, so a stale screen cannot answer
48
+ * the next sale's question.
49
+ */ export default function PosDisplayPage(_props) {
50
+ var _ref, _ref1, _state_promptId;
51
+ // `undefined` while storage is being read, so the pairing screen never
52
+ // flashes on a display that is already paired.
53
+ const [token, setToken] = useState(undefined);
54
+ const [branding, setBranding] = useState(null);
55
+ const [state, setState] = useState(null);
56
+ const [offline, setOffline] = useState(false);
57
+ const [busy, setBusy] = useState(false);
58
+ const [notice, setNotice] = useState(null);
59
+ // The prompt this screen has answered, so "the cashier will finish up"
60
+ // shows the moment the answer lands rather than on the next poll.
61
+ const [sentPromptId, setSentPromptId] = useState(null);
62
+ const [thanksOver, setThanksOver] = useState(false);
63
+ const stateRef = useRef(state);
64
+ stateRef.current = state;
65
+ const brandingAtRef = useRef(0);
66
+ useEffect(()=>{
67
+ setToken(readStoredToken());
68
+ }, []);
69
+ const unpaired = useCallback(()=>{
70
+ storeToken(null);
71
+ brandingAtRef.current = 0;
72
+ setToken(null);
73
+ setState(null);
74
+ setBranding(null);
75
+ setSentPromptId(null);
76
+ }, []);
77
+ const paired = useCallback((next, nextBranding)=>{
78
+ storeToken(next);
79
+ setBranding(nextBranding != null ? nextBranding : null);
80
+ brandingAtRef.current = Date.now();
81
+ setToken(next);
82
+ }, []);
83
+ // The poll: every second while a sale is on screen, every three between
84
+ // sales, and not at all while the tab is hidden.
85
+ useEffect(()=>{
86
+ if (!token) return undefined;
87
+ let active = true;
88
+ let inFlight = false;
89
+ let timer;
90
+ const schedule = ()=>{
91
+ var _ref;
92
+ var _stateRef_current;
93
+ if (!active) return;
94
+ if (timer) clearTimeout(timer);
95
+ const mode = (_ref = (_stateRef_current = stateRef.current) == null ? void 0 : _stateRef_current.mode) != null ? _ref : 'idle';
96
+ timer = setTimeout(()=>void tick(), mode === 'idle' ? POS_DISPLAY_IDLE_POLL_MS : POS_DISPLAY_ACTIVE_POLL_MS);
97
+ };
98
+ const tick = async ()=>{
99
+ timer = undefined;
100
+ if (!active || inFlight) return;
101
+ // Hidden: stop here. Coming back into view polls at once.
102
+ if (typeof document !== 'undefined' && document.hidden) return;
103
+ inFlight = true;
104
+ const withBranding = Date.now() - brandingAtRef.current > BRANDING_REFRESH_MS;
105
+ const result = await pollDisplay(token, withBranding);
106
+ inFlight = false;
107
+ if (!active) return;
108
+ if (result.ok) {
109
+ var _result_value;
110
+ setOffline(false);
111
+ const { state: next, branding: nextBranding } = (_result_value = result.value) != null ? _result_value : {};
112
+ if (next) {
113
+ stateRef.current = next;
114
+ setState(next);
115
+ }
116
+ if (nextBranding) {
117
+ brandingAtRef.current = Date.now();
118
+ setBranding(nextBranding);
119
+ }
120
+ } else if (result.status === 401) {
121
+ unpaired();
122
+ return;
123
+ } else {
124
+ setOffline(true);
125
+ }
126
+ schedule();
127
+ };
128
+ const onVisibility = ()=>{
129
+ if (document.hidden) return;
130
+ if (timer) clearTimeout(timer);
131
+ void tick();
132
+ };
133
+ void tick();
134
+ document.addEventListener('visibilitychange', onVisibility);
135
+ return ()=>{
136
+ active = false;
137
+ if (timer) clearTimeout(timer);
138
+ document.removeEventListener('visibilitychange', onVisibility);
139
+ };
140
+ }, [
141
+ token,
142
+ unpaired
143
+ ]);
144
+ // Keep the screen on while paired. Best effort: a browser without the
145
+ // Wake Lock API, or one that refuses it, just follows its own sleep.
146
+ useEffect(()=>{
147
+ if (!token) return undefined;
148
+ let active = true;
149
+ let lock = null;
150
+ const request = async ()=>{
151
+ try {
152
+ const wakeLock = navigator.wakeLock;
153
+ if (!wakeLock || document.hidden) return;
154
+ const next = await wakeLock.request('screen');
155
+ if (active) lock = next;
156
+ else await (next.release == null ? void 0 : next.release.call(next));
157
+ } catch (unused) {
158
+ // Refused (battery saver, no user gesture yet): nothing to do.
159
+ }
160
+ };
161
+ void request();
162
+ // The browser drops the lock when the tab is hidden; take it back.
163
+ const onVisibility = ()=>{
164
+ if (!document.hidden) void request();
165
+ };
166
+ document.addEventListener('visibilitychange', onVisibility);
167
+ return ()=>{
168
+ var _lock_release;
169
+ active = false;
170
+ document.removeEventListener('visibilitychange', onVisibility);
171
+ lock == null ? void 0 : (_lock_release = lock.release) == null ? void 0 : _lock_release.call(lock).catch(()=>undefined);
172
+ };
173
+ }, [
174
+ token
175
+ ]);
176
+ // A new prompt or mode clears whatever this screen said about the last one.
177
+ const promptKey = `${(_ref = state == null ? void 0 : state.mode) != null ? _ref : 'idle'}:${(_ref1 = state == null ? void 0 : state.promptId) != null ? _ref1 : ''}`;
178
+ useEffect(()=>{
179
+ setNotice(null);
180
+ }, [
181
+ promptKey
182
+ ]);
183
+ // The thank-you returns to the idle screen on its own, even if the next
184
+ // poll is late; the server reports idle after the same interval.
185
+ const thanksKey = (state == null ? void 0 : state.mode) === 'thanks' ? `${(_state_promptId = state.promptId) != null ? _state_promptId : ''}:${state.updatedAtMs}` : '';
186
+ useEffect(()=>{
187
+ setThanksOver(false);
188
+ if (!thanksKey) return undefined;
189
+ const timer = setTimeout(()=>setThanksOver(true), CommerceModel.POS_DISPLAY_THANKS_MS);
190
+ return ()=>clearTimeout(timer);
191
+ }, [
192
+ thanksKey
193
+ ]);
194
+ const answer = useCallback(async (response)=>{
195
+ var _result_error;
196
+ if (!token) return;
197
+ setBusy(true);
198
+ setNotice(null);
199
+ const result = await respondToDisplay(token, response);
200
+ setBusy(false);
201
+ if (result.ok) {
202
+ setSentPromptId(response.promptId);
203
+ return;
204
+ }
205
+ if (result.status === 401) {
206
+ unpaired();
207
+ return;
208
+ }
209
+ setNotice(result.status === 409 ? 'That screen has moved on. Check the display.' : (_result_error = result.error) != null ? _result_error : 'Something went wrong. Try again.');
210
+ }, [
211
+ token,
212
+ unpaired
213
+ ]);
214
+ if (token === undefined) {
215
+ return /*#__PURE__*/ _jsx(Box, {
216
+ sx: {
217
+ minHeight: '100dvh',
218
+ display: 'grid',
219
+ placeItems: 'center'
220
+ },
221
+ children: /*#__PURE__*/ _jsx(CircularProgress, {
222
+ "aria-label": "Loading"
223
+ })
224
+ });
225
+ }
226
+ if (!token) return /*#__PURE__*/ _jsx(PosDisplayPairingScreen, {
227
+ onPaired: paired
228
+ });
229
+ return /*#__PURE__*/ _jsxs(Box, {
230
+ sx: {
231
+ position: 'relative',
232
+ minHeight: '100dvh'
233
+ },
234
+ children: [
235
+ offline ? /*#__PURE__*/ _jsx(Alert, {
236
+ severity: "warning",
237
+ sx: {
238
+ position: 'absolute',
239
+ top: 0,
240
+ left: 0,
241
+ right: 0
242
+ },
243
+ children: "Reconnecting…"
244
+ }) : null,
245
+ /*#__PURE__*/ _jsx(PosDisplayBody, {
246
+ state: state,
247
+ branding: branding,
248
+ busy: busy,
249
+ notice: notice,
250
+ answered: Boolean(state && (state.answered || state.promptId && state.promptId === sentPromptId)),
251
+ thanksOver: thanksOver,
252
+ onAnswer: answer
253
+ }, promptKey),
254
+ /*#__PURE__*/ _jsx(UnpairControl, {
255
+ onUnpair: async ()=>{
256
+ await forgetDisplay(token);
257
+ unpaired();
258
+ }
259
+ })
260
+ ]
261
+ });
262
+ }
263
+ /**
264
+ * The screen for the current mode. Keyed by mode and prompt where it is
265
+ * used, so moving on unmounts every input the customer typed into.
266
+ */ function PosDisplayBody({ state, branding, busy, notice, answered, thanksOver, onAnswer }) {
267
+ var _state_promptId;
268
+ const idle = /*#__PURE__*/ _jsx(PosDisplayBrandScreen, {
269
+ branding: branding,
270
+ message: (branding == null ? void 0 : branding.message) || 'Welcome'
271
+ });
272
+ if (!state || state.mode === 'idle') return idle;
273
+ if (state.mode === 'thanks') {
274
+ if (thanksOver) return idle;
275
+ return /*#__PURE__*/ _jsx(PosDisplayBrandScreen, {
276
+ branding: branding,
277
+ title: "Thank you!"
278
+ });
279
+ }
280
+ if (state.mode === 'processing') {
281
+ var _ref;
282
+ var _state_cart, _state_cart1, _state_processing;
283
+ const due = (_ref = (_state_cart = state.cart) == null ? void 0 : _state_cart.dueCents) != null ? _ref : (_state_cart1 = state.cart) == null ? void 0 : _state_cart1.totalCents;
284
+ return /*#__PURE__*/ _jsx(PosDisplayBrandScreen, {
285
+ branding: branding,
286
+ title: ((_state_processing = state.processing) == null ? void 0 : _state_processing.message) || 'Tap, insert or swipe your card on the reader.',
287
+ message: due ? `Total ${displayMoney(due, state.currency)}` : undefined,
288
+ busy: true
289
+ });
290
+ }
291
+ if ((state.mode === 'tip' || state.mode === 'receipt') && answered) {
292
+ return /*#__PURE__*/ _jsx(PosDisplayBrandScreen, {
293
+ branding: branding,
294
+ title: "Thanks — the cashier will finish up"
295
+ });
296
+ }
297
+ const promptId = (_state_promptId = state.promptId) != null ? _state_promptId : '';
298
+ let body;
299
+ if (state.mode === 'tip' && state.tip && promptId) {
300
+ body = /*#__PURE__*/ _jsx(PosDisplayTipScreen, {
301
+ tip: state.tip,
302
+ promptId: promptId,
303
+ busy: busy,
304
+ currency: state.currency,
305
+ onAnswer: onAnswer
306
+ });
307
+ } else if (state.mode === 'receipt' && state.receipt && promptId) {
308
+ body = /*#__PURE__*/ _jsx(PosDisplayReceiptScreen, {
309
+ receipt: state.receipt,
310
+ promptId: promptId,
311
+ busy: busy,
312
+ onAnswer: onAnswer
313
+ });
314
+ } else if (state.cart) {
315
+ body = /*#__PURE__*/ _jsx(PosDisplayCartView, {
316
+ cart: state.cart,
317
+ currency: state.currency
318
+ });
319
+ } else {
320
+ return idle;
321
+ }
322
+ return /*#__PURE__*/ _jsx(Container, {
323
+ maxWidth: "md",
324
+ sx: {
325
+ py: 4
326
+ },
327
+ children: /*#__PURE__*/ _jsxs(Stack, {
328
+ spacing: 4,
329
+ sx: {
330
+ alignItems: 'center'
331
+ },
332
+ children: [
333
+ /*#__PURE__*/ _jsx(PosDisplayBrandMark, {
334
+ branding: branding
335
+ }),
336
+ notice ? /*#__PURE__*/ _jsx(Alert, {
337
+ severity: "info",
338
+ sx: {
339
+ width: '100%'
340
+ },
341
+ children: notice
342
+ }) : null,
343
+ body
344
+ ]
345
+ })
346
+ });
347
+ }
348
+ /**
349
+ * Unpairing, tucked into a corner behind a confirmation: the person at the
350
+ * counter is a customer, and one stray tap must not take the screen away.
351
+ */ function UnpairControl({ onUnpair }) {
352
+ const [open, setOpen] = useState(false);
353
+ const [busy, setBusy] = useState(false);
354
+ return /*#__PURE__*/ _jsxs(_Fragment, {
355
+ children: [
356
+ /*#__PURE__*/ _jsx(Button, {
357
+ size: "small",
358
+ color: "inherit",
359
+ onClick: ()=>setOpen(true),
360
+ sx: (theme)=>({
361
+ position: 'fixed',
362
+ right: theme.spacing(1),
363
+ bottom: theme.spacing(1),
364
+ opacity: 0.4
365
+ }),
366
+ children: "Unpair this display"
367
+ }),
368
+ /*#__PURE__*/ _jsxs(Dialog, {
369
+ open: open,
370
+ onClose: ()=>busy ? undefined : setOpen(false),
371
+ children: [
372
+ /*#__PURE__*/ _jsx(DialogTitle, {
373
+ children: "Unpair this display?"
374
+ }),
375
+ /*#__PURE__*/ _jsx(DialogContent, {
376
+ children: /*#__PURE__*/ _jsx(DialogContentText, {
377
+ children: "It stops showing sales from the register. To use it again, enter a new code from the register."
378
+ })
379
+ }),
380
+ /*#__PURE__*/ _jsxs(DialogActions, {
381
+ children: [
382
+ /*#__PURE__*/ _jsx(Button, {
383
+ onClick: ()=>setOpen(false),
384
+ disabled: busy,
385
+ children: "Cancel"
386
+ }),
387
+ /*#__PURE__*/ _jsx(Button, {
388
+ color: "error",
389
+ variant: "contained",
390
+ disabled: busy,
391
+ onClick: async ()=>{
392
+ setBusy(true);
393
+ await onUnpair();
394
+ setBusy(false);
395
+ setOpen(false);
396
+ },
397
+ children: "Unpair"
398
+ })
399
+ ]
400
+ })
401
+ ]
402
+ })
403
+ ]
404
+ });
405
+ }
406
+
407
+ //# sourceMappingURL=pos-display-page.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/pos-display-page.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport type { ConsolePublicPageProps } from '@aglyn/aglyn'\nimport Alert from '@mui/material/Alert'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport CircularProgress from '@mui/material/CircularProgress'\nimport Container from '@mui/material/Container'\nimport Dialog from '@mui/material/Dialog'\nimport DialogActions from '@mui/material/DialogActions'\nimport DialogContent from '@mui/material/DialogContent'\nimport DialogContentText from '@mui/material/DialogContentText'\nimport DialogTitle from '@mui/material/DialogTitle'\nimport Stack from '@mui/material/Stack'\nimport { type ReactNode, useCallback, useEffect, useRef, useState } from 'react'\nimport * as CommerceModel from '../../model'\nimport { PosDisplayBrandMark, PosDisplayBrandScreen } from './pos-display/brand-screen'\nimport { PosDisplayCartView } from './pos-display/cart-screen'\nimport { PosDisplayPairingScreen } from './pos-display/pairing-screen'\nimport {\n displayMoney,\n forgetDisplay,\n pollDisplay,\n type PosDisplayAnswer,\n type PosDisplayBranding,\n type PosDisplayPublicState,\n readStoredToken,\n respondToDisplay,\n storeToken,\n} from './pos-display/pos-display-api'\nimport { PosDisplayReceiptScreen } from './pos-display/receipt-screen'\nimport { PosDisplayTipScreen } from './pos-display/tip-screen'\n\n/** How often the display asks for news while a sale is on screen. */\nexport const POS_DISPLAY_ACTIVE_POLL_MS = 1_000\n/** And between sales, when nothing on it is changing. */\nexport const POS_DISPLAY_IDLE_POLL_MS = 3_000\n/** The store's name and logo are re-read this often, so an edit reaches the screen. */\nconst BRANDING_REFRESH_MS = 10 * 60 * 1000\n\n/**\n * The screen a register turns toward its customer (AGL-3608), served at\n * `/kiosk/commerce/pos-display` with no staff session.\n *\n * It holds one secret, the display token from pairing, and reads one thing\n * with it: its register's display state, polled. Everything the customer\n * answers goes back through `respond`, and the server checks each answer\n * against the prompt it claims to answer, so a stale screen cannot answer\n * the next sale's question.\n */\nexport default function PosDisplayPage(_props: ConsolePublicPageProps) {\n // `undefined` while storage is being read, so the pairing screen never\n // flashes on a display that is already paired.\n const [token, setToken] = useState<string | null | undefined>(undefined)\n const [branding, setBranding] = useState<PosDisplayBranding | null>(null)\n const [state, setState] = useState<PosDisplayPublicState | null>(null)\n const [offline, setOffline] = useState(false)\n const [busy, setBusy] = useState(false)\n const [notice, setNotice] = useState<string | null>(null)\n // The prompt this screen has answered, so \"the cashier will finish up\"\n // shows the moment the answer lands rather than on the next poll.\n const [sentPromptId, setSentPromptId] = useState<string | null>(null)\n const [thanksOver, setThanksOver] = useState(false)\n\n const stateRef = useRef(state)\n stateRef.current = state\n const brandingAtRef = useRef(0)\n\n useEffect(() => {\n setToken(readStoredToken())\n }, [])\n\n const unpaired = useCallback(() => {\n storeToken(null)\n brandingAtRef.current = 0\n setToken(null)\n setState(null)\n setBranding(null)\n setSentPromptId(null)\n }, [])\n\n const paired = useCallback((next: string, nextBranding: PosDisplayBranding) => {\n storeToken(next)\n setBranding(nextBranding ?? null)\n brandingAtRef.current = Date.now()\n setToken(next)\n }, [])\n\n // The poll: every second while a sale is on screen, every three between\n // sales, and not at all while the tab is hidden.\n useEffect(() => {\n if (!token) return undefined\n let active = true\n let inFlight = false\n let timer: ReturnType<typeof setTimeout> | undefined\n\n const schedule = () => {\n if (!active) return\n if (timer) clearTimeout(timer)\n const mode = stateRef.current?.mode ?? 'idle'\n timer = setTimeout(\n () => void tick(),\n mode === 'idle' ? POS_DISPLAY_IDLE_POLL_MS : POS_DISPLAY_ACTIVE_POLL_MS,\n )\n }\n\n const tick = async () => {\n timer = undefined\n if (!active || inFlight) return\n // Hidden: stop here. Coming back into view polls at once.\n if (typeof document !== 'undefined' && document.hidden) return\n inFlight = true\n const withBranding = Date.now() - brandingAtRef.current > BRANDING_REFRESH_MS\n const result = await pollDisplay(token, withBranding)\n inFlight = false\n if (!active) return\n if (result.ok) {\n setOffline(false)\n const { state: next, branding: nextBranding } = result.value ?? {}\n if (next) {\n stateRef.current = next\n setState(next)\n }\n if (nextBranding) {\n brandingAtRef.current = Date.now()\n setBranding(nextBranding)\n }\n } else if (result.status === 401) {\n unpaired()\n return\n } else {\n setOffline(true)\n }\n schedule()\n }\n\n const onVisibility = () => {\n if (document.hidden) return\n if (timer) clearTimeout(timer)\n void tick()\n }\n\n void tick()\n document.addEventListener('visibilitychange', onVisibility)\n return () => {\n active = false\n if (timer) clearTimeout(timer)\n document.removeEventListener('visibilitychange', onVisibility)\n }\n }, [token, unpaired])\n\n // Keep the screen on while paired. Best effort: a browser without the\n // Wake Lock API, or one that refuses it, just follows its own sleep.\n useEffect(() => {\n if (!token) return undefined\n let active = true\n let lock: { release?: () => Promise<void> } | null = null\n const request = async () => {\n try {\n const wakeLock = (\n navigator as Navigator & {\n wakeLock?: { request: (type: 'screen') => Promise<{ release?: () => Promise<void> }> }\n }\n ).wakeLock\n if (!wakeLock || document.hidden) return\n const next = await wakeLock.request('screen')\n if (active) lock = next\n else await next.release?.()\n } catch {\n // Refused (battery saver, no user gesture yet): nothing to do.\n }\n }\n void request()\n // The browser drops the lock when the tab is hidden; take it back.\n const onVisibility = () => {\n if (!document.hidden) void request()\n }\n document.addEventListener('visibilitychange', onVisibility)\n return () => {\n active = false\n document.removeEventListener('visibilitychange', onVisibility)\n lock?.release?.().catch(() => undefined)\n }\n }, [token])\n\n // A new prompt or mode clears whatever this screen said about the last one.\n const promptKey = `${state?.mode ?? 'idle'}:${state?.promptId ?? ''}`\n useEffect(() => {\n setNotice(null)\n }, [promptKey])\n\n // The thank-you returns to the idle screen on its own, even if the next\n // poll is late; the server reports idle after the same interval.\n const thanksKey = state?.mode === 'thanks' ? `${state.promptId ?? ''}:${state.updatedAtMs}` : ''\n useEffect(() => {\n setThanksOver(false)\n if (!thanksKey) return undefined\n const timer = setTimeout(() => setThanksOver(true), CommerceModel.POS_DISPLAY_THANKS_MS)\n return () => clearTimeout(timer)\n }, [thanksKey])\n\n const answer = useCallback(\n async (response: PosDisplayAnswer) => {\n if (!token) return\n setBusy(true)\n setNotice(null)\n const result = await respondToDisplay(token, response)\n setBusy(false)\n if (result.ok) {\n setSentPromptId(response.promptId)\n return\n }\n if (result.status === 401) {\n unpaired()\n return\n }\n setNotice(\n result.status === 409\n ? 'That screen has moved on. Check the display.'\n : (result.error ?? 'Something went wrong. Try again.'),\n )\n },\n [token, unpaired],\n )\n\n if (token === undefined) {\n return (\n <Box sx={{ minHeight: '100dvh', display: 'grid', placeItems: 'center' }}>\n <CircularProgress aria-label=\"Loading\" />\n </Box>\n )\n }\n\n if (!token) return <PosDisplayPairingScreen onPaired={paired} />\n\n return (\n <Box sx={{ position: 'relative', minHeight: '100dvh' }}>\n {offline ? (\n <Alert severity=\"warning\" sx={{ position: 'absolute', top: 0, left: 0, right: 0 }}>\n Reconnecting…\n </Alert>\n ) : null}\n <PosDisplayBody\n key={promptKey}\n state={state}\n branding={branding}\n busy={busy}\n notice={notice}\n answered={Boolean(\n state && (state.answered || (state.promptId && state.promptId === sentPromptId)),\n )}\n thanksOver={thanksOver}\n onAnswer={answer}\n />\n <UnpairControl\n onUnpair={async () => {\n await forgetDisplay(token)\n unpaired()\n }}\n />\n </Box>\n )\n}\n\n/**\n * The screen for the current mode. Keyed by mode and prompt where it is\n * used, so moving on unmounts every input the customer typed into.\n */\nfunction PosDisplayBody({\n state,\n branding,\n busy,\n notice,\n answered,\n thanksOver,\n onAnswer,\n}: {\n state: PosDisplayPublicState | null\n branding: PosDisplayBranding | null\n busy: boolean\n notice: string | null\n answered: boolean\n thanksOver: boolean\n onAnswer: (answer: PosDisplayAnswer) => void\n}) {\n const idle = <PosDisplayBrandScreen branding={branding} message={branding?.message || 'Welcome'} />\n if (!state || state.mode === 'idle') return idle\n\n if (state.mode === 'thanks') {\n if (thanksOver) return idle\n return <PosDisplayBrandScreen branding={branding} title=\"Thank you!\" />\n }\n\n if (state.mode === 'processing') {\n const due = state.cart?.dueCents ?? state.cart?.totalCents\n return (\n <PosDisplayBrandScreen\n branding={branding}\n title={state.processing?.message || 'Tap, insert or swipe your card on the reader.'}\n message={due ? `Total ${displayMoney(due, state.currency)}` : undefined}\n busy\n />\n )\n }\n\n if ((state.mode === 'tip' || state.mode === 'receipt') && answered) {\n return <PosDisplayBrandScreen branding={branding} title=\"Thanks — the cashier will finish up\" />\n }\n\n const promptId = state.promptId ?? ''\n let body: ReactNode\n if (state.mode === 'tip' && state.tip && promptId) {\n body = (\n <PosDisplayTipScreen\n tip={state.tip}\n promptId={promptId}\n busy={busy}\n currency={state.currency}\n onAnswer={onAnswer}\n />\n )\n } else if (state.mode === 'receipt' && state.receipt && promptId) {\n body = (\n <PosDisplayReceiptScreen\n receipt={state.receipt}\n promptId={promptId}\n busy={busy}\n onAnswer={onAnswer}\n />\n )\n } else if (state.cart) {\n body = <PosDisplayCartView cart={state.cart} currency={state.currency} />\n } else {\n return idle\n }\n\n return (\n <Container maxWidth=\"md\" sx={{ py: 4 }}>\n <Stack spacing={4} sx={{ alignItems: 'center' }}>\n <PosDisplayBrandMark branding={branding} />\n {notice ? (\n <Alert severity=\"info\" sx={{ width: '100%' }}>\n {notice}\n </Alert>\n ) : null}\n {body}\n </Stack>\n </Container>\n )\n}\n\n/**\n * Unpairing, tucked into a corner behind a confirmation: the person at the\n * counter is a customer, and one stray tap must not take the screen away.\n */\nfunction UnpairControl({ onUnpair }: { onUnpair: () => Promise<void> }) {\n const [open, setOpen] = useState(false)\n const [busy, setBusy] = useState(false)\n return (\n <>\n <Button\n size=\"small\"\n color=\"inherit\"\n onClick={() => setOpen(true)}\n sx={(theme) => ({\n position: 'fixed',\n right: theme.spacing(1),\n bottom: theme.spacing(1),\n opacity: 0.4,\n })}\n >\n Unpair this display\n </Button>\n <Dialog open={open} onClose={() => (busy ? undefined : setOpen(false))}>\n <DialogTitle>Unpair this display?</DialogTitle>\n <DialogContent>\n <DialogContentText>\n It stops showing sales from the register. To use it again, enter a new code from the\n register.\n </DialogContentText>\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setOpen(false)} disabled={busy}>\n Cancel\n </Button>\n <Button\n color=\"error\"\n variant=\"contained\"\n disabled={busy}\n onClick={async () => {\n setBusy(true)\n await onUnpair()\n setBusy(false)\n setOpen(false)\n }}\n >\n Unpair\n </Button>\n </DialogActions>\n </Dialog>\n </>\n )\n}\n"],"names":["Alert","Box","Button","CircularProgress","Container","Dialog","DialogActions","DialogContent","DialogContentText","DialogTitle","Stack","useCallback","useEffect","useRef","useState","CommerceModel","PosDisplayBrandMark","PosDisplayBrandScreen","PosDisplayCartView","PosDisplayPairingScreen","displayMoney","forgetDisplay","pollDisplay","readStoredToken","respondToDisplay","storeToken","PosDisplayReceiptScreen","PosDisplayTipScreen","POS_DISPLAY_ACTIVE_POLL_MS","POS_DISPLAY_IDLE_POLL_MS","BRANDING_REFRESH_MS","PosDisplayPage","_props","state","token","setToken","undefined","branding","setBranding","setState","offline","setOffline","busy","setBusy","notice","setNotice","sentPromptId","setSentPromptId","thanksOver","setThanksOver","stateRef","current","brandingAtRef","unpaired","paired","next","nextBranding","Date","now","active","inFlight","timer","schedule","clearTimeout","mode","setTimeout","tick","document","hidden","withBranding","result","ok","value","status","onVisibility","addEventListener","removeEventListener","lock","request","wakeLock","navigator","release","catch","promptKey","promptId","thanksKey","updatedAtMs","POS_DISPLAY_THANKS_MS","answer","response","error","sx","minHeight","display","placeItems","aria-label","onPaired","position","severity","top","left","right","PosDisplayBody","answered","Boolean","onAnswer","UnpairControl","onUnpair","idle","message","title","due","cart","dueCents","totalCents","processing","currency","body","tip","receipt","maxWidth","py","spacing","alignItems","width","open","setOpen","size","color","onClick","theme","bottom","opacity","onClose","disabled","variant"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAGA,OAAOA,WAAW,sBAAqB;AACvC,OAAOC,SAAS,oBAAmB;AACnC,OAAOC,YAAY,uBAAsB;AACzC,OAAOC,sBAAsB,iCAAgC;AAC7D,OAAOC,eAAe,0BAAyB;AAC/C,OAAOC,YAAY,uBAAsB;AACzC,OAAOC,mBAAmB,8BAA6B;AACvD,OAAOC,mBAAmB,8BAA6B;AACvD,OAAOC,uBAAuB,kCAAiC;AAC/D,OAAOC,iBAAiB,4BAA2B;AACnD,OAAOC,WAAW,sBAAqB;AACvC,SAAyBC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAChF,YAAYC,mBAAmB,uBAAa;AAC5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D,MAAMR,OAAO,CAAC;wBACtBU,SAAS;oBACX,CAAA;0BACD;;0BAGD,MAAC/H;gBAAOwH,MAAMA;gBAAMQ,SAAS,IAAO3F,OAAON,YAAY0F,QAAQ;;kCAC7D,KAACrH;kCAAY;;kCACb,KAACF;kCACC,cAAA,KAACC;sCAAkB;;;kCAKrB,MAACF;;0CACC,KAACJ;gCAAO+H,SAAS,IAAMH,QAAQ;gCAAQQ,UAAU5F;0CAAM;;0CAGvD,KAACxC;gCACC8H,OAAM;gCACNO,SAAQ;gCACRD,UAAU5F;gCACVuF,SAAS;oCACPtF,QAAQ;oCACR,MAAMgE;oCACNhE,QAAQ;oCACRmF,QAAQ;gCACV;0CACD;;;;;;;;AAOX"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /** The customer a sale is rung for. `id` is empty when no record system keeps people. */
18
+ export interface PosSelectedCustomer {
19
+ kind: string;
20
+ id: string;
21
+ name: string;
22
+ email: string | null;
23
+ phone: string | null;
24
+ }
25
+ export interface PosCustomerLookupProps {
26
+ hostId: string;
27
+ value: PosSelectedCustomer | null;
28
+ onChange: (customer: PosSelectedCustomer | null) => void;
29
+ }
30
+ /**
31
+ * The customer at the register (AGL-3609): search the workspace's people by
32
+ * name, email or phone, see what they have bought here before, attach them
33
+ * to the sale — or add a new one in a few taps. Where the workspace keeps no
34
+ * people, it falls back to an email typed for the receipt.
35
+ */
36
+ export declare function PosCustomerLookup(props: PosCustomerLookupProps): import("react").JSX.Element;
37
+ export declare namespace PosCustomerLookup {
38
+ var displayName: string;
39
+ }
40
+ export default PosCustomerLookup;