@aglyn/plugins-commerce 1.0.0-beta.143

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 (417) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +10 -0
  3. package/package.json +57 -0
  4. package/src/index.d.ts +38 -0
  5. package/src/index.js +38 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/components/account.d.ts +31 -0
  8. package/src/lib/components/account.js +645 -0
  9. package/src/lib/components/account.js.map +1 -0
  10. package/src/lib/components/cart.d.ts +38 -0
  11. package/src/lib/components/cart.js +851 -0
  12. package/src/lib/components/cart.js.map +1 -0
  13. package/src/lib/components/commerce-console-page.d.ts +32 -0
  14. package/src/lib/components/commerce-console-page.js +296 -0
  15. package/src/lib/components/commerce-console-page.js.map +1 -0
  16. package/src/lib/components/commerce-console-sections.d.ts +34 -0
  17. package/src/lib/components/commerce-console-sections.js +62 -0
  18. package/src/lib/components/commerce-console-sections.js.map +1 -0
  19. package/src/lib/components/console/catalog-organization-card.component.d.ts +14 -0
  20. package/src/lib/components/console/catalog-organization-card.component.js +1087 -0
  21. package/src/lib/components/console/catalog-organization-card.component.js.map +1 -0
  22. package/src/lib/components/console/commerce-analytics-card.component.d.ts +27 -0
  23. package/src/lib/components/console/commerce-analytics-card.component.js +310 -0
  24. package/src/lib/components/console/commerce-analytics-card.component.js.map +1 -0
  25. package/src/lib/components/console/commerce-glance-card.component.d.ts +20 -0
  26. package/src/lib/components/console/commerce-glance-card.component.js +340 -0
  27. package/src/lib/components/console/commerce-glance-card.component.js.map +1 -0
  28. package/src/lib/components/console/commerce-stat-tile.component.d.ts +37 -0
  29. package/src/lib/components/console/commerce-stat-tile.component.js +72 -0
  30. package/src/lib/components/console/commerce-stat-tile.component.js.map +1 -0
  31. package/src/lib/components/console/discounts-card.component.d.ts +14 -0
  32. package/src/lib/components/console/discounts-card.component.js +443 -0
  33. package/src/lib/components/console/discounts-card.component.js.map +1 -0
  34. package/src/lib/components/console/entitlement-gate.component.d.ts +76 -0
  35. package/src/lib/components/console/entitlement-gate.component.js +115 -0
  36. package/src/lib/components/console/entitlement-gate.component.js.map +1 -0
  37. package/src/lib/components/console/gift-cards-card.component.d.ts +29 -0
  38. package/src/lib/components/console/gift-cards-card.component.js +379 -0
  39. package/src/lib/components/console/gift-cards-card.component.js.map +1 -0
  40. package/src/lib/components/console/host-coupons-card.component.d.ts +14 -0
  41. package/src/lib/components/console/host-coupons-card.component.js +252 -0
  42. package/src/lib/components/console/host-coupons-card.component.js.map +1 -0
  43. package/src/lib/components/console/host-orders-card.component.d.ts +13 -0
  44. package/src/lib/components/console/host-orders-card.component.js +861 -0
  45. package/src/lib/components/console/host-orders-card.component.js.map +1 -0
  46. package/src/lib/components/console/locations-card.component.d.ts +14 -0
  47. package/src/lib/components/console/locations-card.component.js +256 -0
  48. package/src/lib/components/console/locations-card.component.js.map +1 -0
  49. package/src/lib/components/console/member-posts-card.component.d.ts +8 -0
  50. package/src/lib/components/console/member-posts-card.component.js +283 -0
  51. package/src/lib/components/console/member-posts-card.component.js.map +1 -0
  52. package/src/lib/components/console/newest-site-users-card.component.d.ts +36 -0
  53. package/src/lib/components/console/newest-site-users-card.component.js +126 -0
  54. package/src/lib/components/console/newest-site-users-card.component.js.map +1 -0
  55. package/src/lib/components/console/order-detail-dialog.component.d.ts +28 -0
  56. package/src/lib/components/console/order-detail-dialog.component.js +976 -0
  57. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -0
  58. package/src/lib/components/console/paid-media.d.ts +127 -0
  59. package/src/lib/components/console/paid-media.js +397 -0
  60. package/src/lib/components/console/paid-media.js.map +1 -0
  61. package/src/lib/components/console/payments-settings-card.component.d.ts +13 -0
  62. package/src/lib/components/console/payments-settings-card.component.js +295 -0
  63. package/src/lib/components/console/payments-settings-card.component.js.map +1 -0
  64. package/src/lib/components/console/pos-page.component.d.ts +13 -0
  65. package/src/lib/components/console/pos-page.component.js +916 -0
  66. package/src/lib/components/console/pos-page.component.js.map +1 -0
  67. package/src/lib/components/console/product-editor-dialog.component.d.ts +32 -0
  68. package/src/lib/components/console/product-editor-dialog.component.js +1374 -0
  69. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -0
  70. package/src/lib/components/console/products-hub-card.component.d.ts +16 -0
  71. package/src/lib/components/console/products-hub-card.component.js +1280 -0
  72. package/src/lib/components/console/products-hub-card.component.js.map +1 -0
  73. package/src/lib/components/console/products-hub-zone.component.d.ts +50 -0
  74. package/src/lib/components/console/products-hub-zone.component.js +200 -0
  75. package/src/lib/components/console/products-hub-zone.component.js.map +1 -0
  76. package/src/lib/components/console/recovery-queue-card.component.d.ts +39 -0
  77. package/src/lib/components/console/recovery-queue-card.component.js +262 -0
  78. package/src/lib/components/console/recovery-queue-card.component.js.map +1 -0
  79. package/src/lib/components/console/registers-card.component.d.ts +21 -0
  80. package/src/lib/components/console/registers-card.component.js +296 -0
  81. package/src/lib/components/console/registers-card.component.js.map +1 -0
  82. package/src/lib/components/console/reservations-card.component.d.ts +14 -0
  83. package/src/lib/components/console/reservations-card.component.js +650 -0
  84. package/src/lib/components/console/reservations-card.component.js.map +1 -0
  85. package/src/lib/components/console/reviews-moderation-card.component.d.ts +8 -0
  86. package/src/lib/components/console/reviews-moderation-card.component.js +235 -0
  87. package/src/lib/components/console/reviews-moderation-card.component.js.map +1 -0
  88. package/src/lib/components/console/shipping-settings-card.component.d.ts +38 -0
  89. package/src/lib/components/console/shipping-settings-card.component.js +560 -0
  90. package/src/lib/components/console/shipping-settings-card.component.js.map +1 -0
  91. package/src/lib/components/console/stock-movements-card.component.d.ts +31 -0
  92. package/src/lib/components/console/stock-movements-card.component.js +333 -0
  93. package/src/lib/components/console/stock-movements-card.component.js.map +1 -0
  94. package/src/lib/components/console/store-settings-card.component.d.ts +14 -0
  95. package/src/lib/components/console/store-settings-card.component.js +300 -0
  96. package/src/lib/components/console/store-settings-card.component.js.map +1 -0
  97. package/src/lib/components/console/storefront-tax-summary-card.component.d.ts +73 -0
  98. package/src/lib/components/console/storefront-tax-summary-card.component.js +408 -0
  99. package/src/lib/components/console/storefront-tax-summary-card.component.js.map +1 -0
  100. package/src/lib/components/console/suppliers-card.component.d.ts +8 -0
  101. package/src/lib/components/console/suppliers-card.component.js +328 -0
  102. package/src/lib/components/console/suppliers-card.component.js.map +1 -0
  103. package/src/lib/components/console/tax-settings-card.component.d.ts +14 -0
  104. package/src/lib/components/console/tax-settings-card.component.js +473 -0
  105. package/src/lib/components/console/tax-settings-card.component.js.map +1 -0
  106. package/src/lib/components/gate.d.ts +39 -0
  107. package/src/lib/components/gate.js +202 -0
  108. package/src/lib/components/gate.js.map +1 -0
  109. package/src/lib/components/gated-video.d.ts +40 -0
  110. package/src/lib/components/gated-video.js +366 -0
  111. package/src/lib/components/gated-video.js.map +1 -0
  112. package/src/lib/components/member-feed.d.ts +32 -0
  113. package/src/lib/components/member-feed.js +198 -0
  114. package/src/lib/components/member-feed.js.map +1 -0
  115. package/src/lib/components/member-recovery.d.ts +35 -0
  116. package/src/lib/components/member-recovery.js +313 -0
  117. package/src/lib/components/member-recovery.js.map +1 -0
  118. package/src/lib/components/member-signin.d.ts +35 -0
  119. package/src/lib/components/member-signin.js +257 -0
  120. package/src/lib/components/member-signin.js.map +1 -0
  121. package/src/lib/components/member-signup.d.ts +34 -0
  122. package/src/lib/components/member-signup.js +287 -0
  123. package/src/lib/components/member-signup.js.map +1 -0
  124. package/src/lib/components/newsletter-signup.d.ts +39 -0
  125. package/src/lib/components/newsletter-signup.js +229 -0
  126. package/src/lib/components/newsletter-signup.js.map +1 -0
  127. package/src/lib/components/product-detail.d.ts +38 -0
  128. package/src/lib/components/product-detail.js +1022 -0
  129. package/src/lib/components/product-detail.js.map +1 -0
  130. package/src/lib/components/product-grid.d.ts +67 -0
  131. package/src/lib/components/product-grid.js +909 -0
  132. package/src/lib/components/product-grid.js.map +1 -0
  133. package/src/lib/components/product-reviews.d.ts +32 -0
  134. package/src/lib/components/product-reviews.js +349 -0
  135. package/src/lib/components/product-reviews.js.map +1 -0
  136. package/src/lib/components/related-products.d.ts +33 -0
  137. package/src/lib/components/related-products.js +232 -0
  138. package/src/lib/components/related-products.js.map +1 -0
  139. package/src/lib/components/reservation-widget.d.ts +33 -0
  140. package/src/lib/components/reservation-widget.js +418 -0
  141. package/src/lib/components/reservation-widget.js.map +1 -0
  142. package/src/lib/components/storefront-payment-element-fallback.d.ts +18 -0
  143. package/src/lib/components/storefront-payment-element-fallback.js +51 -0
  144. package/src/lib/components/storefront-payment-element-fallback.js.map +1 -0
  145. package/src/lib/components/storefront-payment-element.d.ts +78 -0
  146. package/src/lib/components/storefront-payment-element.js +156 -0
  147. package/src/lib/components/storefront-payment-element.js.map +1 -0
  148. package/src/lib/components/wishlist.d.ts +46 -0
  149. package/src/lib/components/wishlist.js +304 -0
  150. package/src/lib/components/wishlist.js.map +1 -0
  151. package/src/lib/constants/bundle-common.d.ts +18 -0
  152. package/src/lib/constants/bundle-common.js +18 -0
  153. package/src/lib/constants/bundle-common.js.map +1 -0
  154. package/src/lib/constants/product-filters.d.ts +35 -0
  155. package/src/lib/constants/product-filters.js +109 -0
  156. package/src/lib/constants/product-filters.js.map +1 -0
  157. package/src/lib/model/commerce-cart.d.ts +52 -0
  158. package/src/lib/model/commerce-cart.js +102 -0
  159. package/src/lib/model/commerce-cart.js.map +1 -0
  160. package/src/lib/model/commerce-connect-transfer.d.ts +243 -0
  161. package/src/lib/model/commerce-connect-transfer.js +231 -0
  162. package/src/lib/model/commerce-connect-transfer.js.map +1 -0
  163. package/src/lib/model/commerce-discounts.d.ts +164 -0
  164. package/src/lib/model/commerce-discounts.js +231 -0
  165. package/src/lib/model/commerce-discounts.js.map +1 -0
  166. package/src/lib/model/commerce-dispute.d.ts +124 -0
  167. package/src/lib/model/commerce-dispute.js +225 -0
  168. package/src/lib/model/commerce-dispute.js.map +1 -0
  169. package/src/lib/model/commerce-gift-cards.d.ts +107 -0
  170. package/src/lib/model/commerce-gift-cards.js +121 -0
  171. package/src/lib/model/commerce-gift-cards.js.map +1 -0
  172. package/src/lib/model/commerce-io.d.ts +36 -0
  173. package/src/lib/model/commerce-io.js +245 -0
  174. package/src/lib/model/commerce-io.js.map +1 -0
  175. package/src/lib/model/commerce-orders.d.ts +1040 -0
  176. package/src/lib/model/commerce-orders.js +1022 -0
  177. package/src/lib/model/commerce-orders.js.map +1 -0
  178. package/src/lib/model/commerce-promotions.d.ts +188 -0
  179. package/src/lib/model/commerce-promotions.js +199 -0
  180. package/src/lib/model/commerce-promotions.js.map +1 -0
  181. package/src/lib/model/commerce-reservations.d.ts +175 -0
  182. package/src/lib/model/commerce-reservations.js +157 -0
  183. package/src/lib/model/commerce-reservations.js.map +1 -0
  184. package/src/lib/model/commerce-shipping.d.ts +316 -0
  185. package/src/lib/model/commerce-shipping.js +484 -0
  186. package/src/lib/model/commerce-shipping.js.map +1 -0
  187. package/src/lib/model/commerce-stock-holds.d.ts +199 -0
  188. package/src/lib/model/commerce-stock-holds.js +190 -0
  189. package/src/lib/model/commerce-stock-holds.js.map +1 -0
  190. package/src/lib/model/commerce-subscription-status.d.ts +67 -0
  191. package/src/lib/model/commerce-subscription-status.js +76 -0
  192. package/src/lib/model/commerce-subscription-status.js.map +1 -0
  193. package/src/lib/model/commerce-tax-decision.d.ts +222 -0
  194. package/src/lib/model/commerce-tax-decision.js +165 -0
  195. package/src/lib/model/commerce-tax-decision.js.map +1 -0
  196. package/src/lib/model/commerce-tax.d.ts +176 -0
  197. package/src/lib/model/commerce-tax.js +92 -0
  198. package/src/lib/model/commerce-tax.js.map +1 -0
  199. package/src/lib/model/commerce.d.ts +551 -0
  200. package/src/lib/model/commerce.js +739 -0
  201. package/src/lib/model/commerce.js.map +1 -0
  202. package/src/lib/model/index.d.ts +40 -0
  203. package/src/lib/model/index.js +40 -0
  204. package/src/lib/model/index.js.map +1 -0
  205. package/src/lib/model/order-figures.d.ts +48 -0
  206. package/src/lib/model/order-figures.js +74 -0
  207. package/src/lib/model/order-figures.js.map +1 -0
  208. package/src/lib/model/plugin-permissions.d.ts +23 -0
  209. package/src/lib/model/plugin-permissions.js +34 -0
  210. package/src/lib/model/plugin-permissions.js.map +1 -0
  211. package/src/lib/model/purchase-analytics.d.ts +186 -0
  212. package/src/lib/model/purchase-analytics.js +216 -0
  213. package/src/lib/model/purchase-analytics.js.map +1 -0
  214. package/src/lib/plugin-config.d.ts +62 -0
  215. package/src/lib/plugin-config.js +78 -0
  216. package/src/lib/plugin-config.js.map +1 -0
  217. package/src/lib/plugin.d.ts +28 -0
  218. package/src/lib/plugin.js +147 -0
  219. package/src/lib/plugin.js.map +1 -0
  220. package/src/lib/server/billing-webhook.d.ts +26 -0
  221. package/src/lib/server/billing-webhook.js +4011 -0
  222. package/src/lib/server/billing-webhook.js.map +1 -0
  223. package/src/lib/server/cancel-order.d.ts +87 -0
  224. package/src/lib/server/cancel-order.js +368 -0
  225. package/src/lib/server/cancel-order.js.map +1 -0
  226. package/src/lib/server/cart-checkout.d.ts +25 -0
  227. package/src/lib/server/cart-checkout.js +976 -0
  228. package/src/lib/server/cart-checkout.js.map +1 -0
  229. package/src/lib/server/cart-cookie.d.ts +32 -0
  230. package/src/lib/server/cart-cookie.js +77 -0
  231. package/src/lib/server/cart-cookie.js.map +1 -0
  232. package/src/lib/server/cart.d.ts +34 -0
  233. package/src/lib/server/cart.js +181 -0
  234. package/src/lib/server/cart.js.map +1 -0
  235. package/src/lib/server/catalog.d.ts +127 -0
  236. package/src/lib/server/catalog.js +277 -0
  237. package/src/lib/server/catalog.js.map +1 -0
  238. package/src/lib/server/checkout.d.ts +36 -0
  239. package/src/lib/server/checkout.js +915 -0
  240. package/src/lib/server/checkout.js.map +1 -0
  241. package/src/lib/server/connect.d.ts +26 -0
  242. package/src/lib/server/connect.js +238 -0
  243. package/src/lib/server/connect.js.map +1 -0
  244. package/src/lib/server/contact-refund.d.ts +117 -0
  245. package/src/lib/server/contact-refund.js +196 -0
  246. package/src/lib/server/contact-refund.js.map +1 -0
  247. package/src/lib/server/download.d.ts +39 -0
  248. package/src/lib/server/download.js +206 -0
  249. package/src/lib/server/download.js.map +1 -0
  250. package/src/lib/server/draft-order.d.ts +26 -0
  251. package/src/lib/server/draft-order.js +706 -0
  252. package/src/lib/server/draft-order.js.map +1 -0
  253. package/src/lib/server/feed.d.ts +24 -0
  254. package/src/lib/server/feed.js +59 -0
  255. package/src/lib/server/feed.js.map +1 -0
  256. package/src/lib/server/fulfill-order.d.ts +97 -0
  257. package/src/lib/server/fulfill-order.js +235 -0
  258. package/src/lib/server/fulfill-order.js.map +1 -0
  259. package/src/lib/server/gate.d.ts +36 -0
  260. package/src/lib/server/gate.js +112 -0
  261. package/src/lib/server/gate.js.map +1 -0
  262. package/src/lib/server/gift-cards.d.ts +42 -0
  263. package/src/lib/server/gift-cards.js +219 -0
  264. package/src/lib/server/gift-cards.js.map +1 -0
  265. package/src/lib/server/low-stock.d.ts +49 -0
  266. package/src/lib/server/low-stock.js +60 -0
  267. package/src/lib/server/low-stock.js.map +1 -0
  268. package/src/lib/server/manual-tax-rate.d.ts +82 -0
  269. package/src/lib/server/manual-tax-rate.js +113 -0
  270. package/src/lib/server/manual-tax-rate.js.map +1 -0
  271. package/src/lib/server/member-feed.d.ts +24 -0
  272. package/src/lib/server/member-feed.js +72 -0
  273. package/src/lib/server/member-feed.js.map +1 -0
  274. package/src/lib/server/member-name-search.d.ts +37 -0
  275. package/src/lib/server/member-name-search.js +42 -0
  276. package/src/lib/server/member-name-search.js.map +1 -0
  277. package/src/lib/server/member-post.d.ts +23 -0
  278. package/src/lib/server/member-post.js +166 -0
  279. package/src/lib/server/member-post.js.map +1 -0
  280. package/src/lib/server/membership-account.d.ts +37 -0
  281. package/src/lib/server/membership-account.js +148 -0
  282. package/src/lib/server/membership-account.js.map +1 -0
  283. package/src/lib/server/membership-admin-password.d.ts +33 -0
  284. package/src/lib/server/membership-admin-password.js +202 -0
  285. package/src/lib/server/membership-admin-password.js.map +1 -0
  286. package/src/lib/server/membership-content.d.ts +23 -0
  287. package/src/lib/server/membership-content.js +105 -0
  288. package/src/lib/server/membership-content.js.map +1 -0
  289. package/src/lib/server/membership-login.d.ts +19 -0
  290. package/src/lib/server/membership-login.js +137 -0
  291. package/src/lib/server/membership-login.js.map +1 -0
  292. package/src/lib/server/membership-logout.d.ts +19 -0
  293. package/src/lib/server/membership-logout.js +35 -0
  294. package/src/lib/server/membership-logout.js.map +1 -0
  295. package/src/lib/server/membership-recover.d.ts +60 -0
  296. package/src/lib/server/membership-recover.js +244 -0
  297. package/src/lib/server/membership-recover.js.map +1 -0
  298. package/src/lib/server/membership-register.d.ts +22 -0
  299. package/src/lib/server/membership-register.js +241 -0
  300. package/src/lib/server/membership-register.js.map +1 -0
  301. package/src/lib/server/membership-reset.d.ts +26 -0
  302. package/src/lib/server/membership-reset.js +88 -0
  303. package/src/lib/server/membership-reset.js.map +1 -0
  304. package/src/lib/server/membership-wishlist.d.ts +23 -0
  305. package/src/lib/server/membership-wishlist.js +89 -0
  306. package/src/lib/server/membership-wishlist.js.map +1 -0
  307. package/src/lib/server/membership.d.ts +96 -0
  308. package/src/lib/server/membership.js +222 -0
  309. package/src/lib/server/membership.js.map +1 -0
  310. package/src/lib/server/native-checkout.d.ts +170 -0
  311. package/src/lib/server/native-checkout.js +193 -0
  312. package/src/lib/server/native-checkout.js.map +1 -0
  313. package/src/lib/server/newsletter.d.ts +23 -0
  314. package/src/lib/server/newsletter.js +323 -0
  315. package/src/lib/server/newsletter.js.map +1 -0
  316. package/src/lib/server/notify-restock.d.ts +22 -0
  317. package/src/lib/server/notify-restock.js +84 -0
  318. package/src/lib/server/notify-restock.js.map +1 -0
  319. package/src/lib/server/order-analytics.d.ts +134 -0
  320. package/src/lib/server/order-analytics.js +263 -0
  321. package/src/lib/server/order-analytics.js.map +1 -0
  322. package/src/lib/server/order-figures.d.ts +33 -0
  323. package/src/lib/server/order-figures.js +220 -0
  324. package/src/lib/server/order-figures.js.map +1 -0
  325. package/src/lib/server/paid-media-delivery.d.ts +173 -0
  326. package/src/lib/server/paid-media-delivery.js +212 -0
  327. package/src/lib/server/paid-media-delivery.js.map +1 -0
  328. package/src/lib/server/pos-order.d.ts +54 -0
  329. package/src/lib/server/pos-order.js +1137 -0
  330. package/src/lib/server/pos-order.js.map +1 -0
  331. package/src/lib/server/process-abandoned.d.ts +54 -0
  332. package/src/lib/server/process-abandoned.js +222 -0
  333. package/src/lib/server/process-abandoned.js.map +1 -0
  334. package/src/lib/server/process-restock.d.ts +42 -0
  335. package/src/lib/server/process-restock.js +219 -0
  336. package/src/lib/server/process-restock.js.map +1 -0
  337. package/src/lib/server/product-card.d.ts +29 -0
  338. package/src/lib/server/product-card.js +54 -0
  339. package/src/lib/server/product-card.js.map +1 -0
  340. package/src/lib/server/product.d.ts +70 -0
  341. package/src/lib/server/product.js +105 -0
  342. package/src/lib/server/product.js.map +1 -0
  343. package/src/lib/server/promotion-hold.d.ts +144 -0
  344. package/src/lib/server/promotion-hold.js +174 -0
  345. package/src/lib/server/promotion-hold.js.map +1 -0
  346. package/src/lib/server/reconcile-stock.d.ts +106 -0
  347. package/src/lib/server/reconcile-stock.js +349 -0
  348. package/src/lib/server/reconcile-stock.js.map +1 -0
  349. package/src/lib/server/refund.d.ts +45 -0
  350. package/src/lib/server/refund.js +607 -0
  351. package/src/lib/server/refund.js.map +1 -0
  352. package/src/lib/server/related.d.ts +24 -0
  353. package/src/lib/server/related.js +104 -0
  354. package/src/lib/server/related.js.map +1 -0
  355. package/src/lib/server/reservation-availability.d.ts +23 -0
  356. package/src/lib/server/reservation-availability.js +111 -0
  357. package/src/lib/server/reservation-availability.js.map +1 -0
  358. package/src/lib/server/reserve-stock.d.ts +156 -0
  359. package/src/lib/server/reserve-stock.js +146 -0
  360. package/src/lib/server/reserve-stock.js.map +1 -0
  361. package/src/lib/server/reserve.d.ts +25 -0
  362. package/src/lib/server/reserve.js +426 -0
  363. package/src/lib/server/reserve.js.map +1 -0
  364. package/src/lib/server/restock-flag.d.ts +202 -0
  365. package/src/lib/server/restock-flag.js +449 -0
  366. package/src/lib/server/restock-flag.js.map +1 -0
  367. package/src/lib/server/reviews.d.ts +51 -0
  368. package/src/lib/server/reviews.js +132 -0
  369. package/src/lib/server/reviews.js.map +1 -0
  370. package/src/lib/server/site-page-enricher.d.ts +42 -0
  371. package/src/lib/server/site-page-enricher.js +149 -0
  372. package/src/lib/server/site-page-enricher.js.map +1 -0
  373. package/src/lib/server/site-page-resolver.d.ts +26 -0
  374. package/src/lib/server/site-page-resolver.js +223 -0
  375. package/src/lib/server/site-page-resolver.js.map +1 -0
  376. package/src/lib/server/stock-hold.d.ts +127 -0
  377. package/src/lib/server/stock-hold.js +258 -0
  378. package/src/lib/server/stock-hold.js.map +1 -0
  379. package/src/lib/server/storefront-tax-record.d.ts +22 -0
  380. package/src/lib/server/storefront-tax-record.js +218 -0
  381. package/src/lib/server/storefront-tax-record.js.map +1 -0
  382. package/src/lib/server/storefront-tax.d.ts +197 -0
  383. package/src/lib/server/storefront-tax.js +245 -0
  384. package/src/lib/server/storefront-tax.js.map +1 -0
  385. package/src/lib/server/stream.d.ts +25 -0
  386. package/src/lib/server/stream.js +191 -0
  387. package/src/lib/server/stream.js.map +1 -0
  388. package/src/lib/server/subscription-portal.d.ts +24 -0
  389. package/src/lib/server/subscription-portal.js +91 -0
  390. package/src/lib/server/subscription-portal.js.map +1 -0
  391. package/src/lib/server/supplier-outbox.d.ts +190 -0
  392. package/src/lib/server/supplier-outbox.js +342 -0
  393. package/src/lib/server/supplier-outbox.js.map +1 -0
  394. package/src/lib/server/supplier-update.d.ts +23 -0
  395. package/src/lib/server/supplier-update.js +289 -0
  396. package/src/lib/server/supplier-update.js.map +1 -0
  397. package/src/lib/server/tax-profile.d.ts +29 -0
  398. package/src/lib/server/tax-profile.js +40 -0
  399. package/src/lib/server/tax-profile.js.map +1 -0
  400. package/src/lib/server.d.ts +32 -0
  401. package/src/lib/server.js +311 -0
  402. package/src/lib/server.js.map +1 -0
  403. package/src/lib/site.d.ts +27 -0
  404. package/src/lib/site.js +134 -0
  405. package/src/lib/site.js.map +1 -0
  406. package/src/lib/utils/escape-html.d.ts +41 -0
  407. package/src/lib/utils/escape-html.js +41 -0
  408. package/src/lib/utils/escape-html.js.map +1 -0
  409. package/src/lib/utils/generate-preset-id.d.ts +19 -0
  410. package/src/lib/utils/generate-preset-id.js +25 -0
  411. package/src/lib/utils/generate-preset-id.js.map +1 -0
  412. package/src/lib/utils/member-continue.d.ts +45 -0
  413. package/src/lib/utils/member-continue.js +49 -0
  414. package/src/lib/utils/member-continue.js.map +1 -0
  415. package/src/lib/utils/use-storefront-purchase-event.d.ts +60 -0
  416. package/src/lib/utils/use-storefront-purchase-event.js +142 -0
  417. package/src/lib/utils/use-storefront-purchase-event.js.map +1 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/cart.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 * as Aglyn from '@aglyn/aglyn'\nimport {\n buildBeginCheckoutParams,\n buildViewCartParams,\n trackEvent,\n trackEventBeforeNavigation,\n type AnalyticsItem,\n} from '@aglyn/aglyn/app-utils/analytics-events'\nimport {\n isPaymentsNotConfigured,\n storefrontPaymentsNotConfiguredText,\n} from '@aglyn/aglyn/app-utils/payments-configured'\nimport * as CommerceModel from '../model'\nimport { mdiCartOutline } from '@aglyn/shared-data-mdi'\nimport Alert from '@mui/material/Alert'\nimport Badge from '@mui/material/Badge'\nimport Box from '@mui/material/Box'\nimport Button from '@mui/material/Button'\nimport Checkbox from '@mui/material/Checkbox'\nimport Drawer from '@mui/material/Drawer'\nimport FormControlLabel from '@mui/material/FormControlLabel'\nimport IconButton from '@mui/material/IconButton'\nimport MenuItem from '@mui/material/MenuItem'\nimport SvgIcon from '@mui/material/SvgIcon'\nimport TextField from '@mui/material/TextField'\nimport Typography from '@mui/material/Typography'\nimport {\n Suspense,\n forwardRef,\n lazy,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react'\nimport { StorefrontPaymentElementFallback } from './storefront-payment-element-fallback'\n\n/**\n * The Payment Element (AGL-1944), lazily. Stripe.js and its React wrapper are\n * a large dependency and the flag is OFF, so a static import would ship the\n * whole SDK in the bundle of every page carrying a cart — which is most pages\n * on a storefront — to serve a path no shopper currently reaches.\n */\nconst StorefrontPaymentElement = lazy(() =>\n import('./storefront-payment-element').then((module) => ({\n default: module.StorefrontPaymentElement,\n })),\n)\nimport { BUNDLE_ID } from '../constants/bundle-common'\nimport { generatePresetId } from '../utils/generate-preset-id'\nimport { useStorefrontPurchaseEvent } from '../utils/use-storefront-purchase-event'\n\n// Component ids are persisted in screen documents; never rename.\nexport const ID: Aglyn.ComponentId = 'cart'\n\n/** Blocks dispatch this after mutating the cart so badges refresh. */\nexport const CART_UPDATED_EVENT = 'aglyn:cart-updated'\n\nexport interface CartProps {\n /** 'button' = app-bar icon + drawer; 'inline' = full cart in place. */\n variant?: 'button' | 'inline'\n checkoutLabel?: string\n /** Show the coupon-code field above checkout. */\n showCoupon?: boolean\n emptyText?: string\n}\n\ninterface CartLineView {\n productId: string\n variantId?: string\n quantity: number\n name: string\n variantLabel?: string\n unitAmountCents: number\n imageUrl?: string\n unavailable?: boolean\n}\n\ninterface CartView {\n lines: CartLineView[]\n count: number\n subtotalCents: number\n}\n\nconst usd = (cents: number) => `$${(cents / 100).toFixed(2)}`\n\n/**\n * The cart's lines as GA4 `items`.\n *\n * One mapping for every event this file sends — `view_cart` and both\n * `begin_checkout` branches — because the `item_id` is what joins them into a\n * single per-product funnel with the `view_item` and `add_to_cart` the product\n * blocks send. Three hand-written copies of the same map are three chances for\n * one step to start reporting a variant id, or a name, or a different price\n * basis, and a funnel whose steps disagree about the product silently reports\n * a drop that never happened.\n */\nfunction cartAnalyticsItems(cart: CartView | null): AnalyticsItem[] {\n return (cart?.lines ?? []).map((line) => ({\n item_id: line.productId,\n item_name: line.name,\n price: line.unitAmountCents / 100,\n quantity: line.quantity,\n }))\n}\n\nfunction CartLines(props: {\n hostId: string\n cart: CartView | null\n showCoupon?: boolean\n checkoutLabel?: string\n emptyText?: string\n onMutate: (body: Record<string, unknown>) => Promise<void>\n}) {\n const { hostId, cart, showCoupon, checkoutLabel, emptyText, onMutate } =\n props\n const siteFetch = Aglyn.useSiteFetch()\n const [coupon, setCoupon] = useState('')\n const [email, setEmail] = useState('')\n const [optIn, setOptIn] = useState(false)\n const [giftCard, setGiftCard] = useState('')\n // Where the parcel is going (AGL-1721). Asked ONLY when the server says it\n // cannot price shipping without it — a merchant with one zone, one\n // rest-of-world zone, or no shipping at all never sees this field, which is\n // the common configuration. `null` is \"not asked\", so the field appearing is\n // itself the server's answer rather than a guess made here.\n const [shipTo, setShipTo] = useState('')\n const [shipCountries, setShipCountries] = useState<string[] | null>(null)\n // `paused` is its own state, not an `error` with gentler words (AGL-1511):\n // the two need different severities, and a shopper told in red that\n // checkout failed does not read the sentence explaining it did not. `ask` is\n // the same argument again: being asked for a destination is not a failure.\n // `unconfigured` is the third instance (AGL-2019): a store with no Stripe key\n // answers 501, and before this that fell through to the error tail below and\n // rendered RED. It is also the only one of the five that is TERMINAL — the\n // others can succeed on a retry, this one cannot until the operator acts, so\n // it latches the buy control off instead of inviting another click.\n const [status, setStatus] = useState<\n 'idle' | 'sending' | 'error' | 'paused' | 'ask' | 'unconfigured'\n >('idle')\n const [message, setMessage] = useState('')\n /**\n * The in-page checkout session (AGL-1944). Null unless the server chose\n * native mode, which needs both the release flag and a publishable key.\n */\n const [nativeCheckout, setNativeCheckout] = useState<{\n clientSecret: string\n publishableKey: string\n } | null>(null)\n /**\n * In-progress quantity edits, keyed by line, as the raw field text\n * (AGL-1772). The field used to POST /api/commerce/cart on every\n * keystroke — typing \"100\" was three Firestore writes, and clearing the\n * field to retype passed through `\"\"` → 0, which is the REMOVE path, so a\n * select-all-and-retype could delete the line mid-edit (and the response\n * replacing `cart` state then fought the input).\n *\n * The repo convention for quantity inputs is local state committed on an\n * explicit settle — the PDP's Qty field (product-detail.tsx) holds\n * `useState` and sends nothing until the buy click, and besigner\n * attributes commit on blur. So: keystrokes only edit the draft; blur or\n * Enter commits ONE write; an empty or unparsable draft is a pending\n * state that reverts to the server's quantity, never a 0-as-remove. A\n * genuine remove still works both ways — the ✕ button, and typing an\n * actual 0 then leaving the field.\n */\n const [quantityDrafts, setQuantityDrafts] = useState<Record<string, string>>(\n {},\n )\n const lineKey = (line: CartLineView) =>\n `${line.productId}:${line.variantId ?? ''}`\n const commitQuantity = (line: CartLineView) => {\n const key = lineKey(line)\n const draft = quantityDrafts[key]\n if (draft === undefined) return\n // Drops the draft, but only if it is still THIS one — a keystroke that\n // lands while the write is in flight starts a new edit, and clearing it\n // here would erase what the shopper is typing.\n const settle = () =>\n setQuantityDrafts((drafts) => {\n if (drafts[key] !== draft) return drafts\n const { [key]: _settled, ...rest } = drafts\n return rest\n })\n // `Number('')` is 0 — exactly the misreading that turned a cleared\n // field into a remove. Empty means \"no answer\": show the server's\n // quantity again and write nothing. NaN (letters) reverts the same way.\n if (draft.trim() === '') return settle()\n const parsed = Math.round(Number(draft))\n if (!Number.isFinite(parsed)) return settle()\n const quantity = Math.max(0, parsed)\n // A settled value equal to the server's is not an edit.\n if (quantity === line.quantity) return settle()\n // The draft keeps rendering until the response lands, so the field does\n // not flash the superseded quantity during the round-trip; the server's\n // answer (via the replaced `cart`) takes over when it arrives.\n void onMutate({\n action: 'set',\n productId: line.productId,\n variantId: line.variantId,\n quantity,\n }).finally(settle)\n }\n\n /**\n * Idempotency key for ONE checkout attempt (AGL-1697).\n *\n * Minted lazily on the first checkout click, retired whenever the attempt\n * changes shape — different lines, codes, email or destination are a\n * different checkout. Keyed off a CONTENT signature of the lines rather\n * than the `cart` object, whose identity changes on every refetch: retiring\n * on identity would hand a genuine retry a fresh key, which is exactly the\n * double-session this exists to prevent.\n */\n const attemptKey = useRef('')\n const cartSignature = useMemo(\n () =>\n JSON.stringify(\n (cart?.lines ?? []).map((line) => [\n line.productId,\n line.variantId ?? '',\n line.quantity,\n ]),\n ),\n [cart],\n )\n useEffect(() => {\n attemptKey.current = ''\n }, [cartSignature, email, coupon, giftCard, shipTo])\n\n const handleCheckout = useCallback(async () => {\n if (status === 'sending') return\n setStatus('sending')\n setMessage('')\n if (!attemptKey.current) {\n attemptKey.current =\n globalThis.crypto?.randomUUID?.() ??\n `${Date.now()}-${Math.random().toString(36).slice(2)}`\n }\n try {\n const response = await siteFetch('/api/commerce/cart-checkout', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n // Stable across a retry of THIS attempt (AGL-1697), so a\n // double-click cannot spawn a second session from one cart.\n 'Idempotency-Key': attemptKey.current,\n },\n body: JSON.stringify({\n hostId,\n ...(email.trim() ? { email: email.trim() } : {}),\n ...(optIn ? { marketingOptIn: true } : {}),\n ...(coupon.trim() ? { couponCode: coupon.trim() } : {}),\n ...(giftCard.trim() ? { giftCardCode: giftCard.trim() } : {}),\n // A request, never an instruction: the server resolves the rates\n // for this country AND restricts the session's collectable\n // addresses to it, so declaring one cannot buy a cheaper zone's\n // rate than the address the shopper then enters (AGL-1721).\n ...(shipTo ? { shippingCountry: shipTo } : {}),\n }),\n })\n const payload = await response.json().catch(() => ({}))\n // In-page payment (AGL-1944). Checked BEFORE the redirect branch: a\n // native session carries a client secret and no url, and if a server ever\n // sent both, navigating away would silently discard the form.\n //\n // `begin_checkout` is reported on BOTH paths, and from the same place, so\n // the GA4 funnel does not develop a hole the day the flag flips — a\n // storefront whose `begin_checkout` count halved would look like a\n // conversion collapse rather than a checkout that stopped redirecting.\n if (response.ok && payload?.clientSecret && payload?.publishableKey) {\n trackEvent(\n 'begin_checkout',\n buildBeginCheckoutParams({\n value: (cart?.subtotalCents ?? 0) / 100,\n items: cartAnalyticsItems(cart),\n }),\n )\n setNativeCheckout({\n clientSecret: String(payload.clientSecret),\n publishableKey: String(payload.publishableKey),\n })\n setStatus('idle')\n return\n }\n if (response.ok && payload?.url) {\n // GA4 checkout funnel (AGL-1561, converted by AGL-1591). This used to\n // call `window.gtag` raw with `value`/`currency` only, so the same\n // event name arrived from this surface and from the console's plan\n // checkout in two different shapes — and this half carried no `items`,\n // which is the field GA4's ecommerce funnel is actually built on.\n //\n // The item ids are the PRODUCT ids `view_item` and `add_to_cart`\n // already send, so the three now join into one per-product funnel.\n // `value` is stated rather than derived because the cart subtotal is\n // authoritative after a coupon or gift card, which the line prices\n // below are not. No `billing_interval`: a storefront cart is not a\n // subscription.\n //\n // AWAITED before the redirect (AGL-1580). This surface registers no\n // transport, so delivery is a synchronous `window.gtag` call and the\n // await resolves immediately — a storefront checkout is not slowed by\n // one microtask. It is written this way anyway because the property\n // that makes it safe is invisible from here: the day this bundle grows\n // an async transport, or a host registers one for it, the bare call\n // would start losing the event on exactly the branch that navigates,\n // and nothing at this call site would look different.\n await trackEventBeforeNavigation(\n 'begin_checkout',\n buildBeginCheckoutParams({\n value: (cart?.subtotalCents ?? 0) / 100,\n items: cartAnalyticsItems(cart),\n }),\n )\n window.location.assign(payload.url)\n return\n }\n // A read-only lockdown answers 423 with the visitor pause copy\n // (AGL-1511). Rendering `payload.error` here would print the wire\n // token \"locked\" at a shopper, and the `severity=\"error\"` styling\n // would tell them their payment failed — the one thing this copy\n // exists to never say. So the refusal is parsed and shown as a calm\n // notice instead.\n const paused = Aglyn.parseLockdownRefusal(response.status, payload)\n if (paused) {\n setMessage(Aglyn.lockdownRefusalText(paused))\n setStatus('paused')\n return\n }\n // A store that never had payments configured (AGL-2019). The server's\n // own words are NOT rendered here even though they are safe today:\n // this is a visitor-facing surface, the 501 bodies differ between the\n // cart and buy-now doors, and one of them could grow a variable name\n // without anyone thinking about who reads it.\n if (isPaymentsNotConfigured(response.status)) {\n setMessage(storefrontPaymentsNotConfiguredText())\n setStatus('unconfigured')\n return\n }\n // The merchant's rates differ by destination, so the server will not\n // price this cart until it knows one (AGL-1721). Reveal the field and\n // let the shopper answer; a store that never sends this never shows it.\n if (payload?.needsShippingCountry) {\n setShipCountries(\n (payload.shippingCountries as string[] | undefined)?.length\n ? (payload.shippingCountries as string[])\n : [...CommerceModel.CHECKOUT_SHIPPING_COUNTRIES],\n )\n setMessage(String(payload?.error ?? ''))\n // An unserved destination is a real refusal and reads as one; being\n // asked the first time is not.\n setStatus(shipTo ? 'error' : 'ask')\n return\n }\n setMessage(String(payload?.error ?? ''))\n setStatus('error')\n } catch {\n setStatus('error')\n }\n // `cart` is a dependency because the payload above reads it: without it\n // the handler closes over whichever cart was current when it was created,\n // and a checkout started after a quantity change would report the OLD\n // subtotal and the OLD lines. The pre-AGL-1591 raw call had the same bug\n // in the `value` alone, where a wrong number is indistinguishable from a\n // right one.\n }, [hostId, cart, coupon, email, optIn, giftCard, shipTo, status, siteFetch])\n\n if (!cart || cart.lines.length === 0) {\n return (\n <Typography variant=\"body2\" color=\"text.secondary\" sx={{ p: 2 }}>\n {emptyText || 'Your cart is empty.'}\n </Typography>\n )\n }\n return (\n <Box sx={{ display: 'flex', flexDirection: 'column', gap: 1.5, p: 2 }}>\n {cart.lines.map((line) => {\n // AGL-1726: resolve BEFORE the guard, never inside the `src`. A\n // stored value can be truthy and still resolve to nothing (a\n // malformed `media:` reference), and testing the raw string would\n // turn \"no image\" into an `<img>` with no `src` — a broken-image\n // icon where the placeholder belongs.\n const imageUrl = Aglyn.siteRelativeMediaSrc(line.imageUrl, { hostId })\n return (\n <Box\n key={`${line.productId}:${line.variantId ?? ''}`}\n sx={{ display: 'flex', gap: 1.5, alignItems: 'center' }}\n >\n {imageUrl ? (\n <Box\n component=\"img\"\n src={imageUrl}\n alt=\"\"\n sx={{\n width: 48,\n height: 48,\n objectFit: 'cover',\n borderRadius: 1,\n }}\n // Deferred (AGL-2486). A 48px cart-line thumbnail is the\n // clearest case of the set: it can never be the LCP, and a\n // cart is usually below the fold or inside a panel.\n {...Aglyn.DEFERRED_IMAGE_ATTRIBUTES}\n />\n ) : (\n <Box\n sx={{\n width: 48,\n height: 48,\n bgcolor: 'action.hover',\n borderRadius: 1,\n }}\n />\n )}\n <Box sx={{ flex: 1, minWidth: 0 }}>\n <Typography variant=\"body2\" noWrap>\n {line.name}\n {line.variantLabel ? ` — ${line.variantLabel}` : ''}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {line.unavailable\n ? 'No longer available'\n : usd(line.unitAmountCents)}\n </Typography>\n </Box>\n <TextField\n value={quantityDrafts[lineKey(line)] ?? line.quantity}\n onChange={(event) =>\n setQuantityDrafts((drafts) => ({\n ...drafts,\n [lineKey(line)]: event.target.value,\n }))\n }\n onBlur={() => commitQuantity(line)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') commitQuantity(line)\n }}\n size=\"small\"\n sx={{ width: 60 }}\n slotProps={{ htmlInput: { inputMode: 'numeric' } }}\n />\n <Button\n size=\"small\"\n color=\"error\"\n onClick={() =>\n void onMutate({\n action: 'remove',\n productId: line.productId,\n variantId: line.variantId,\n })\n }\n >\n {'✕'}\n </Button>\n </Box>\n )\n })}\n <Box sx={{ display: 'flex', justifyContent: 'space-between' }}>\n <Typography variant=\"subtitle2\">{'Subtotal'}</Typography>\n <Typography variant=\"subtitle2\">{usd(cart.subtotalCents)}</Typography>\n </Box>\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Shipping and taxes are calculated at checkout.'}\n </Typography>\n <TextField\n label=\"Email\"\n type=\"email\"\n value={email}\n onChange={(event) => setEmail(event.target.value)}\n size=\"small\"\n helperText=\"For your receipt and order updates\"\n />\n <FormControlLabel\n control={\n <Checkbox\n size=\"small\"\n checked={optIn}\n onChange={(event) => setOptIn(event.target.checked)}\n />\n }\n label={\n <Typography variant=\"caption\">\n {'Email me news and offers'}\n </Typography>\n }\n />\n {showCoupon ? (\n <>\n <TextField\n label=\"Coupon code\"\n value={coupon}\n onChange={(event) => setCoupon(event.target.value)}\n size=\"small\"\n />\n <TextField\n label=\"Gift card\"\n value={giftCard}\n onChange={(event) => setGiftCard(event.target.value)}\n size=\"small\"\n placeholder=\"GC-…\"\n />\n </>\n ) : null}\n {shipCountries ? (\n <TextField\n select\n label=\"Ship to\"\n value={shipTo}\n onChange={(event) => setShipTo(event.target.value)}\n size=\"small\"\n helperText=\"Shipping rates depend on where this is going\"\n >\n {shipCountries.map((code) => (\n <MenuItem key={code} value={code}>\n {CommerceModel.CHECKOUT_SHIPPING_COUNTRY_NAMES[code] ?? code}\n </MenuItem>\n ))}\n </TextField>\n ) : null}\n {status === 'paused' || status === 'ask' || status === 'unconfigured' ? (\n <Alert severity=\"info\">{message}</Alert>\n ) : null}\n {status === 'error' ? (\n <Alert severity=\"error\">\n {message || 'Checkout is unavailable right now.'}\n </Alert>\n ) : null}\n <Button\n variant=\"contained\"\n color=\"primary\"\n disabled={\n status === 'sending' ||\n cart.lines.every((line) => line.unavailable) ||\n // No payments on this deployment: every further click gets the same\n // 501, so the control latches off rather than inviting a retry that\n // cannot succeed (AGL-2019).\n status === 'unconfigured' ||\n // Asked but unanswered: the server would only refuse again.\n (shipCountries !== null && !shipTo)\n }\n onClick={handleCheckout}\n >\n {status === 'sending'\n ? // \"Redirecting\" stops being true the moment the form opens in\n // place (AGL-1944).\n nativeCheckout\n ? 'Opening…'\n : 'Redirecting…'\n : checkoutLabel || 'Checkout'}\n </Button>\n {nativeCheckout ? (\n <Suspense fallback={<StorefrontPaymentElementFallback />}>\n <StorefrontPaymentElement\n clientSecret={nativeCheckout.clientSecret}\n publishableKey={nativeCheckout.publishableKey}\n payLabel={checkoutLabel || 'Pay now'}\n // The session is left open on cancel, deliberately: it is what the\n // AGL-323 abandoned-cart recovery emails are built on, and expiring\n // it would be a write against the merchant's Stripe account made\n // from a browser.\n onCancel={() => setNativeCheckout(null)}\n />\n </Suspense>\n ) : null}\n </Box>\n )\n}\n\n/**\n * Cart block (AGL-293): 'button' renders a badge icon + slide-out\n * drawer for app bars; 'inline' renders the full cart for a cart page.\n * Lines live server-side (cookie cart); every mutation re-resolves\n * prices. Other blocks broadcast CART_UPDATED_EVENT to refresh badges.\n */\nconst Cart = forwardRef<HTMLDivElement, CartProps>((props, ref) => {\n const { variant, checkoutLabel, showCoupon, emptyText, ...rest } = props\n // Node styles ride the renderer-merged sx; recompose (stack.ts pattern).\n const nodeSx = Array.isArray(props['sx']) ? props['sx'] : [props['sx']]\n const { hostId } = Aglyn.useSite()\n const siteFetch = Aglyn.useSiteFetch()\n const [cart, setCart] = useState<CartView | null>(null)\n const [open, setOpen] = useState(false)\n\n // Closes the merchant's ecommerce funnel (AGL-1641). Stripe returns a cart\n // checkout to the page it started on — this one — so the `purchase` that\n // `begin_checkout` above has never had a counterpart to is reported here.\n // No-ops on every ordinary render: the hook returns immediately unless the\n // URL carries `?order=success&session_id=…`.\n useStorefrontPurchaseEvent(hostId, siteFetch)\n\n const refresh = useCallback(async () => {\n if (!hostId) return\n try {\n const response = await fetch(\n `/api/commerce/cart?hostId=${encodeURIComponent(hostId)}`,\n )\n if (response.ok) setCart(await response.json())\n } catch {\n // Badge silently stays stale offline.\n }\n }, [hostId])\n\n useEffect(() => {\n void refresh()\n const handler = () => void refresh()\n window.addEventListener(CART_UPDATED_EVENT, handler)\n return () => window.removeEventListener(CART_UPDATED_EVENT, handler)\n }, [refresh])\n\n /**\n * Has THIS opening of the cart already been reported? A drawer that is\n * closed and reopened is a second view; a re-render, a badge refresh or a\n * quantity edit inside an already-open drawer is not.\n */\n const viewReported = useRef(false)\n\n /**\n * `view_cart` — the funnel step between `add_to_cart` and `begin_checkout`.\n *\n * Fired on the cart being SEEN, which is why it hangs off `open` rather off\n * mount: the button variant renders a badge on every page of a storefront,\n * and reporting a view there would have made \"opened the cart\" a synonym for\n * \"loaded a page\" and the checkout rate a fraction of pageviews.\n *\n * Deferred until the lines have actually arrived. The cart is fetched, so a\n * drawer opened while that request is in flight has nothing to describe yet\n * — reporting then would send an empty `items` and a zero `value` for a cart\n * that in fact had both. An empty cart never reports at all: there is no\n * view of nothing, and counting it would put every idle badge click into the\n * denominator of the checkout rate.\n */\n useEffect(() => {\n const onScreen = variant === 'inline' || open\n if (!onScreen) {\n viewReported.current = false\n return\n }\n if (viewReported.current || !cart || cart.lines.length === 0) return\n viewReported.current = true\n trackEvent(\n 'view_cart',\n buildViewCartParams({\n // The server's subtotal, so this and the `begin_checkout` the same\n // cart sends describe one cart at one size.\n value: cart.subtotalCents / 100,\n items: cartAnalyticsItems(cart),\n }),\n )\n }, [variant, open, cart])\n\n const mutate = useCallback(\n async (body: Record<string, unknown>) => {\n if (!hostId) return\n const response = await siteFetch('/api/commerce/cart', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ hostId, ...body }),\n })\n if (response.ok) {\n setCart(await response.json())\n window.dispatchEvent(new Event(CART_UPDATED_EVENT))\n }\n },\n [hostId, siteFetch],\n )\n\n if (!hostId) {\n return (\n <Box\n ref={ref}\n {...rest}\n sx={[\n {\n p: variant === 'inline' ? 3 : 1,\n border: '1px dashed',\n borderColor: 'divider',\n borderRadius: 1,\n color: 'text.secondary',\n fontSize: 13,\n fontFamily: 'system-ui, sans-serif',\n display: 'inline-block',\n },\n ...nodeSx,\n ]}\n >\n {variant === 'inline' ? 'Cart — lines render here' : '🛒 Cart'}\n </Box>\n )\n }\n\n if (variant === 'inline') {\n return (\n <Box ref={ref} {...rest}>\n <CartLines\n hostId={hostId}\n cart={cart}\n showCoupon={showCoupon}\n checkoutLabel={checkoutLabel}\n emptyText={emptyText}\n onMutate={mutate}\n />\n </Box>\n )\n }\n\n return (\n <Box ref={ref} {...rest} sx={[{ display: 'inline-flex' }, ...nodeSx]}>\n <IconButton aria-label=\"Cart\" onClick={() => setOpen(true)}>\n <Badge badgeContent={cart?.count ?? 0} color=\"primary\">\n <SvgIcon>\n <path d={mdiCartOutline.path} />\n </SvgIcon>\n </Badge>\n </IconButton>\n <Drawer anchor=\"right\" open={open} onClose={() => setOpen(false)}>\n <Box sx={{ width: { xs: '85vw', sm: 380 } }}>\n <Typography variant=\"h6\" sx={{ p: 2, pb: 0 }}>\n {'Your cart'}\n </Typography>\n <CartLines\n hostId={hostId}\n cart={cart}\n showCoupon={showCoupon}\n checkoutLabel={checkoutLabel}\n emptyText={emptyText}\n onMutate={mutate}\n />\n </Box>\n </Drawer>\n </Box>\n )\n})\nCart.displayName = 'AglynCart'\n\nexport const schema: Aglyn.ComponentSchema<CartProps> = {\n $id: ID,\n pluginId: BUNDLE_ID,\n displayName: 'Cart',\n description:\n 'The shopping cart — a badge icon with a slide-out drawer, or the full cart page.',\n category: Aglyn.ComponentCategory.COMMERCE,\n icon: { path: mdiCartOutline.path, sx: { color: '#2e7d32' } },\n flags: { selfClosing: Aglyn.FEATURE_FLAG.ENABLED },\n attributes: [\n {\n name: 'variant',\n label: 'Style',\n description: 'Icon-with-drawer for app bars, or the full inline cart.',\n component: Aglyn.FieldComponentType.SELECT,\n options: [\n { value: 'button', label: 'Icon + drawer' },\n { value: 'inline', label: 'Inline (cart page)' },\n ],\n },\n {\n name: 'checkoutLabel',\n label: 'Checkout label',\n description: 'Defaults to \"Checkout\".',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n {\n // The PROP KEY stays `showCoupon` — it is persisted in every saved page\n // that uses this component, and renaming it would blank the control on\n // all of them. Only what the merchant reads changes.\n name: 'showCoupon',\n // ONE CONTROL, TWO FEATURES, AND IT ONLY NAMED ONE. This checkbox gates\n // the gift-card field as well as the coupon field, so a merchant who\n // wanted gift cards had no reason to look here — gift cards are only\n // redeemable in the cart, and this is the switch that shows the box.\n // A control named for one feature that also gates another is how a\n // shipped feature stays invisible.\n label: 'Show coupon and gift card fields',\n description:\n 'One checkbox for both. Coupon codes and gift cards are managed on ' +\n 'the Products page.',\n component: Aglyn.FieldComponentType.CHECKBOX,\n },\n {\n name: 'emptyText',\n label: 'Empty text',\n description: 'Copy when the cart is empty.',\n component: Aglyn.FieldComponentType.TEXT_FIELD,\n },\n ],\n}\n\nexport const presets: Aglyn.PresetSchema[] = [\n {\n $id: generatePresetId(ID, 'button'),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Cart button',\n pluginId: BUNDLE_ID,\n description: 'Badge icon with a slide-out cart drawer',\n category: Aglyn.ComponentCategory.COMMERCE,\n icon: { path: mdiCartOutline.path, sx: { color: '#2e7d32' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { variant: 'button' },\n },\n },\n {\n $id: generatePresetId(ID, 'inline'),\n type: Aglyn.NodeType.PRESET,\n displayName: 'Cart page',\n pluginId: BUNDLE_ID,\n description:\n 'Full cart with quantities, coupon, gift card, and checkout',\n category: Aglyn.ComponentCategory.COMMERCE,\n icon: { path: mdiCartOutline.path, sx: { color: '#2e7d32' } },\n data: {\n $id: null,\n componentId: ID,\n pluginId: BUNDLE_ID,\n props: { variant: 'inline', showCoupon: true },\n },\n },\n]\n\nexport default Cart\n"],"names":["Aglyn","buildBeginCheckoutParams","buildViewCartParams","trackEvent","trackEventBeforeNavigation","isPaymentsNotConfigured","storefrontPaymentsNotConfiguredText","CommerceModel","mdiCartOutline","Alert","Badge","Box","Button","Checkbox","Drawer","FormControlLabel","IconButton","MenuItem","SvgIcon","TextField","Typography","Suspense","forwardRef","lazy","useCallback","useEffect","useMemo","useRef","useState","StorefrontPaymentElementFallback","StorefrontPaymentElement","then","module","default","BUNDLE_ID","generatePresetId","useStorefrontPurchaseEvent","ID","CART_UPDATED_EVENT","usd","cents","toFixed","cartAnalyticsItems","cart","lines","map","line","item_id","productId","item_name","name","price","unitAmountCents","quantity","CartLines","props","hostId","showCoupon","checkoutLabel","emptyText","onMutate","siteFetch","useSiteFetch","coupon","setCoupon","email","setEmail","optIn","setOptIn","giftCard","setGiftCard","shipTo","setShipTo","shipCountries","setShipCountries","status","setStatus","message","setMessage","nativeCheckout","setNativeCheckout","quantityDrafts","setQuantityDrafts","lineKey","variantId","commitQuantity","key","draft","undefined","settle","drafts","_settled","rest","trim","parsed","Math","round","Number","isFinite","max","action","finally","attemptKey","cartSignature","JSON","stringify","current","handleCheckout","globalThis","crypto","randomUUID","Date","now","random","toString","slice","response","method","headers","body","marketingOptIn","couponCode","giftCardCode","shippingCountry","payload","json","catch","ok","clientSecret","publishableKey","value","subtotalCents","items","String","url","window","location","assign","paused","parseLockdownRefusal","lockdownRefusalText","needsShippingCountry","shippingCountries","length","CHECKOUT_SHIPPING_COUNTRIES","error","variant","color","sx","p","display","flexDirection","gap","imageUrl","siteRelativeMediaSrc","alignItems","component","src","alt","width","height","objectFit","borderRadius","DEFERRED_IMAGE_ATTRIBUTES","bgcolor","flex","minWidth","noWrap","variantLabel","unavailable","onChange","event","target","onBlur","onKeyDown","size","slotProps","htmlInput","inputMode","onClick","justifyContent","label","type","helperText","control","checked","placeholder","select","code","CHECKOUT_SHIPPING_COUNTRY_NAMES","severity","disabled","every","fallback","payLabel","onCancel","Cart","ref","nodeSx","Array","isArray","useSite","setCart","open","setOpen","refresh","fetch","encodeURIComponent","handler","addEventListener","removeEventListener","viewReported","onScreen","mutate","dispatchEvent","Event","border","borderColor","fontSize","fontFamily","aria-label","badgeContent","count","path","d","anchor","onClose","xs","sm","pb","displayName","schema","$id","pluginId","description","category","ComponentCategory","COMMERCE","icon","flags","selfClosing","FEATURE_FLAG","ENABLED","attributes","FieldComponentType","SELECT","options","TEXT_FIELD","CHECKBOX","presets","NodeType","PRESET","data","componentId"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;CAeC,GAED,YAAYA,WAAW,eAAc;AACrC,SACEC,wBAAwB,EACxBC,mBAAmB,EACnBC,UAAU,EACVC,0BAA0B,QAErB,0CAAyC;AAChD,SACEC,uBAAuB,EACvBC,mCAAmC,QAC9B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vN,eAAeuN,IAAI;YAAE3E,IAAI;gBAAED,OAAO;YAAU;QAAE;QAC5DyG,MAAM;YACJpB,KAAK;YACLqB,aAAaxN;YACboM,UAAUvM;YACVqB,OAAO;gBAAE2F,SAAS;YAAS;QAC7B;IACF;IACA;QACEsF,KAAKrM,iBAAiBE,IAAI;QAC1BiJ,MAAMtL,MAAM0P,QAAQ,CAACC,MAAM;QAC3BrB,aAAa;QACbG,UAAUvM;QACVwM,aACE;QACFC,UAAU3O,MAAM4O,iBAAiB,CAACC,QAAQ;QAC1CC,MAAM;YAAEf,MAAMvN,eAAeuN,IAAI;YAAE3E,IAAI;gBAAED,OAAO;YAAU;QAAE;QAC5DyG,MAAM;YACJpB,KAAK;YACLqB,aAAaxN;YACboM,UAAUvM;YACVqB,OAAO;gBAAE2F,SAAS;gBAAUzF,YAAY;YAAK;QAC/C;IACF;CACD,CAAA;AAED,eAAe2I,KAAI"}
@@ -0,0 +1,32 @@
1
+ import type { ConsolePluginPageProps } from '@aglyn/aglyn';
2
+ /**
3
+ * Commerce console page (AGL-395): the Products management surface, owned by
4
+ * the commerce plugin and rendered by the shell's generic plugin route. The
5
+ * product editor's media browser is supplied by the shell's
6
+ * ConsoleMediaPickerProvider (the media library is org/session coupled and
7
+ * stays in the app).
8
+ *
9
+ * ## Sections are ROUTES (AGL-2501)
10
+ *
11
+ * The six sections hold thirty-two Firestore listens between them, and a tab
12
+ * strip mounts every panel: opening Catalog also subscribed the orders,
13
+ * promotions, reservations, settings and analytics cards. The `limit()` on
14
+ * those queries is the bill — several ask for 500, and one load reached a
15
+ * ceiling of ~4,460 documents to render one tab.
16
+ *
17
+ * `HubTabs lazy` bought that back as a flag somebody has to remember. A URL
18
+ * per section makes it structural instead: the page builds one section's body
19
+ * and the others do not exist to subscribe. Three things come with it that the
20
+ * tab version faked — a section is linkable, the back button walks sections,
21
+ * and which one is open is a fact about the URL rather than state kept in sync
22
+ * with it. `commerce-console-read-cost.spec.tsx` meters it at the Firestore
23
+ * boundary and refuses a section that listens before it is opened.
24
+ *
25
+ * The shell resolves the section, gates it and hands back the rail's hrefs;
26
+ * this page only has to say what each section contains.
27
+ */
28
+ export declare function CommerceConsolePage(props: ConsolePluginPageProps): import("react").JSX.Element;
29
+ export declare namespace CommerceConsolePage {
30
+ var displayName: string;
31
+ }
32
+ export default CommerceConsolePage;
@@ -0,0 +1,296 @@
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 } from "react/jsx-runtime";
18
+ import { GridItems } from "@aglyn/shared-ui-jsx";
19
+ import { HubSections } from "@aglyn/shared-ui-next";
20
+ import CatalogOrganizationCard from "./console/catalog-organization-card.component.js";
21
+ import CommerceAnalyticsCard from "./console/commerce-analytics-card.component.js";
22
+ import DiscountsCard from "./console/discounts-card.component.js";
23
+ import GiftCardsCard from "./console/gift-cards-card.component.js";
24
+ import HostCouponsCard from "./console/host-coupons-card.component.js";
25
+ import HostOrdersCard from "./console/host-orders-card.component.js";
26
+ import LocationsCard from "./console/locations-card.component.js";
27
+ import MemberPostsCard from "./console/member-posts-card.component.js";
28
+ import PaymentsSettingsCard from "./console/payments-settings-card.component.js";
29
+ import ProductsHubCard from "./console/products-hub-card.component.js";
30
+ import RecoveryQueueCard from "./console/recovery-queue-card.component.js";
31
+ import RegistersCard from "./console/registers-card.component.js";
32
+ import ReservationsCard from "./console/reservations-card.component.js";
33
+ import ReviewsModerationCard from "./console/reviews-moderation-card.component.js";
34
+ import ShippingSettingsCard from "./console/shipping-settings-card.component.js";
35
+ import StockMovementsCard from "./console/stock-movements-card.component.js";
36
+ import StoreSettingsCard from "./console/store-settings-card.component.js";
37
+ import StorefrontTaxSummaryCard from "./console/storefront-tax-summary-card.component.js";
38
+ import SuppliersCard from "./console/suppliers-card.component.js";
39
+ import TaxSettingsCard from "./console/tax-settings-card.component.js";
40
+ /**
41
+ * The body of one commerce section, built only when that section is the one
42
+ * being read (AGL-2501).
43
+ *
44
+ * A function rather than a map of nodes on purpose: a `Record<id, ReactNode>`
45
+ * would CONSTRUCT all six every render, and each card opens its Firestore
46
+ * listens on mount — which is the entire cost this page exists to stop paying.
47
+ * Only the returned branch is ever built.
48
+ */ function sectionBody(section, hostId) {
49
+ switch(section){
50
+ case 'catalog':
51
+ return /*#__PURE__*/ _jsx(GridItems, {
52
+ spacing: 3,
53
+ items: [
54
+ {
55
+ size: {
56
+ xs: 12
57
+ },
58
+ children: /*#__PURE__*/ _jsx(ProductsHubCard, {
59
+ hostId: hostId
60
+ })
61
+ },
62
+ {
63
+ size: {
64
+ xs: 12
65
+ },
66
+ children: /*#__PURE__*/ _jsx(CatalogOrganizationCard, {
67
+ hostId: hostId
68
+ })
69
+ },
70
+ // The ledger every stock writer fills and nothing displayed
71
+ // (AGL-2341). Directly under the catalog, because the question
72
+ // it answers — "why does this count disagree with the shelf" —
73
+ // is asked while looking at the count.
74
+ {
75
+ size: {
76
+ xs: 12
77
+ },
78
+ children: /*#__PURE__*/ _jsx(StockMovementsCard, {
79
+ hostId: hostId
80
+ })
81
+ },
82
+ {
83
+ size: {
84
+ xs: 12
85
+ },
86
+ children: /*#__PURE__*/ _jsx(MemberPostsCard, {
87
+ hostId: hostId
88
+ })
89
+ }
90
+ ]
91
+ });
92
+ case 'orders':
93
+ return /*#__PURE__*/ _jsx(GridItems, {
94
+ spacing: 3,
95
+ items: [
96
+ {
97
+ size: {
98
+ xs: 12
99
+ },
100
+ children: /*#__PURE__*/ _jsx(HostOrdersCard, {
101
+ hostId: hostId
102
+ })
103
+ },
104
+ // The two queues that feed orders rather than record them
105
+ // (AGL-2227): checkouts that stalled and shoppers waiting on
106
+ // stock. Beneath the orders list because both are pre-order.
107
+ {
108
+ size: {
109
+ xs: 12
110
+ },
111
+ children: /*#__PURE__*/ _jsx(RecoveryQueueCard, {
112
+ hostId: hostId
113
+ })
114
+ }
115
+ ]
116
+ });
117
+ case 'promotions':
118
+ return /*#__PURE__*/ _jsx(GridItems, {
119
+ spacing: 3,
120
+ items: [
121
+ {
122
+ size: {
123
+ xs: 12
124
+ },
125
+ children: /*#__PURE__*/ _jsx(DiscountsCard, {
126
+ hostId: hostId
127
+ })
128
+ },
129
+ {
130
+ size: {
131
+ xs: 12
132
+ },
133
+ children: /*#__PURE__*/ _jsx(HostCouponsCard, {
134
+ hostId: hostId
135
+ })
136
+ },
137
+ // Store credit lives with the other money-off surfaces
138
+ // (AGL-2226) — it had no console anywhere before this.
139
+ {
140
+ size: {
141
+ xs: 12
142
+ },
143
+ children: /*#__PURE__*/ _jsx(GiftCardsCard, {
144
+ hostId: hostId
145
+ })
146
+ },
147
+ {
148
+ size: {
149
+ xs: 12
150
+ },
151
+ children: /*#__PURE__*/ _jsx(ReviewsModerationCard, {
152
+ hostId: hostId
153
+ })
154
+ }
155
+ ]
156
+ });
157
+ case 'reservations':
158
+ return /*#__PURE__*/ _jsx(ReservationsCard, {
159
+ hostId: hostId
160
+ });
161
+ case 'settings':
162
+ return /*#__PURE__*/ _jsx(GridItems, {
163
+ spacing: 3,
164
+ items: [
165
+ {
166
+ size: {
167
+ xs: 12
168
+ },
169
+ children: /*#__PURE__*/ _jsx(PaymentsSettingsCard, {
170
+ hostId: hostId
171
+ })
172
+ },
173
+ {
174
+ size: {
175
+ xs: 12
176
+ },
177
+ children: /*#__PURE__*/ _jsx(StoreSettingsCard, {
178
+ hostId: hostId
179
+ })
180
+ },
181
+ {
182
+ size: {
183
+ xs: 12
184
+ },
185
+ children: /*#__PURE__*/ _jsx(TaxSettingsCard, {
186
+ hostId: hostId
187
+ })
188
+ },
189
+ {
190
+ size: {
191
+ xs: 12
192
+ },
193
+ children: /*#__PURE__*/ _jsx(LocationsCard, {
194
+ hostId: hostId
195
+ })
196
+ },
197
+ {
198
+ size: {
199
+ xs: 12
200
+ },
201
+ children: /*#__PURE__*/ _jsx(RegistersCard, {
202
+ hostId: hostId
203
+ })
204
+ },
205
+ {
206
+ size: {
207
+ xs: 12
208
+ },
209
+ children: /*#__PURE__*/ _jsx(ShippingSettingsCard, {
210
+ hostId: hostId
211
+ })
212
+ },
213
+ {
214
+ size: {
215
+ xs: 12
216
+ },
217
+ children: /*#__PURE__*/ _jsx(SuppliersCard, {
218
+ hostId: hostId
219
+ })
220
+ }
221
+ ]
222
+ });
223
+ case 'analytics':
224
+ return(// Two cards since AGL-2440. The tax summary lives here rather
225
+ // than under Settings → Tax because that tab CONFIGURES tax and
226
+ // this REPORTS what was collected — a merchant reading a figure
227
+ // they may file from should not be one field away from changing
228
+ // the rate that produced it.
229
+ /*#__PURE__*/ _jsx(GridItems, {
230
+ spacing: 3,
231
+ items: [
232
+ {
233
+ size: {
234
+ xs: 12
235
+ },
236
+ children: /*#__PURE__*/ _jsx(CommerceAnalyticsCard, {
237
+ hostId: hostId
238
+ })
239
+ },
240
+ {
241
+ size: {
242
+ xs: 12
243
+ },
244
+ children: /*#__PURE__*/ _jsx(StorefrontTaxSummaryCard, {
245
+ hostId: hostId
246
+ })
247
+ }
248
+ ]
249
+ }));
250
+ default:
251
+ return null;
252
+ }
253
+ }
254
+ /**
255
+ * Commerce console page (AGL-395): the Products management surface, owned by
256
+ * the commerce plugin and rendered by the shell's generic plugin route. The
257
+ * product editor's media browser is supplied by the shell's
258
+ * ConsoleMediaPickerProvider (the media library is org/session coupled and
259
+ * stays in the app).
260
+ *
261
+ * ## Sections are ROUTES (AGL-2501)
262
+ *
263
+ * The six sections hold thirty-two Firestore listens between them, and a tab
264
+ * strip mounts every panel: opening Catalog also subscribed the orders,
265
+ * promotions, reservations, settings and analytics cards. The `limit()` on
266
+ * those queries is the bill — several ask for 500, and one load reached a
267
+ * ceiling of ~4,460 documents to render one tab.
268
+ *
269
+ * `HubTabs lazy` bought that back as a flag somebody has to remember. A URL
270
+ * per section makes it structural instead: the page builds one section's body
271
+ * and the others do not exist to subscribe. Three things come with it that the
272
+ * tab version faked — a section is linkable, the back button walks sections,
273
+ * and which one is open is a fact about the URL rather than state kept in sync
274
+ * with it. `commerce-console-read-cost.spec.tsx` meters it at the Firestore
275
+ * boundary and refuses a section that listens before it is opened.
276
+ *
277
+ * The shell resolves the section, gates it and hands back the rail's hrefs;
278
+ * this page only has to say what each section contains.
279
+ */ export function CommerceConsolePage(props) {
280
+ const { hostId, section, sections, basePath } = props;
281
+ /*
282
+ * Nothing, deliberately, while the redirect is in flight.
283
+ *
284
+ * Rendering the default section here instead would issue that section's
285
+ * listens on a URL that is about to be replaced — paying for Catalog on
286
+ * every arrival at `/products`, which is every click of the nav tab.
287
+ */ if (!section || !(sections == null ? void 0 : sections.length) || !basePath) return null;
288
+ return /*#__PURE__*/ _jsx(HubSections, {
289
+ sections: sections,
290
+ children: sectionBody(section, hostId)
291
+ });
292
+ }
293
+ CommerceConsolePage.displayName = 'CommerceConsolePage';
294
+ export default CommerceConsolePage;
295
+
296
+ //# sourceMappingURL=commerce-console-page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/commerce-console-page.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 { ConsolePluginPageProps } from '@aglyn/aglyn'\nimport { GridItems } from '@aglyn/shared-ui-jsx'\nimport { HubSections } from '@aglyn/shared-ui-next'\nimport type { ReactNode } from 'react'\nimport type { CommerceConsoleSectionId } from './commerce-console-sections'\nimport CatalogOrganizationCard from './console/catalog-organization-card.component'\nimport CommerceAnalyticsCard from './console/commerce-analytics-card.component'\nimport DiscountsCard from './console/discounts-card.component'\nimport GiftCardsCard from './console/gift-cards-card.component'\nimport HostCouponsCard from './console/host-coupons-card.component'\nimport HostOrdersCard from './console/host-orders-card.component'\nimport LocationsCard from './console/locations-card.component'\nimport MemberPostsCard from './console/member-posts-card.component'\nimport PaymentsSettingsCard from './console/payments-settings-card.component'\nimport ProductsHubCard from './console/products-hub-card.component'\nimport RecoveryQueueCard from './console/recovery-queue-card.component'\nimport RegistersCard from './console/registers-card.component'\nimport ReservationsCard from './console/reservations-card.component'\nimport ReviewsModerationCard from './console/reviews-moderation-card.component'\nimport ShippingSettingsCard from './console/shipping-settings-card.component'\nimport StockMovementsCard from './console/stock-movements-card.component'\nimport StoreSettingsCard from './console/store-settings-card.component'\nimport StorefrontTaxSummaryCard from './console/storefront-tax-summary-card.component'\nimport SuppliersCard from './console/suppliers-card.component'\nimport TaxSettingsCard from './console/tax-settings-card.component'\n\n/**\n * The body of one commerce section, built only when that section is the one\n * being read (AGL-2501).\n *\n * A function rather than a map of nodes on purpose: a `Record<id, ReactNode>`\n * would CONSTRUCT all six every render, and each card opens its Firestore\n * listens on mount — which is the entire cost this page exists to stop paying.\n * Only the returned branch is ever built.\n */\nfunction sectionBody(\n section: CommerceConsoleSectionId,\n hostId: string,\n): ReactNode {\n switch (section) {\n case 'catalog':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <ProductsHubCard hostId={hostId} /> },\n {\n size: { xs: 12 },\n children: <CatalogOrganizationCard hostId={hostId} />,\n },\n // The ledger every stock writer fills and nothing displayed\n // (AGL-2341). Directly under the catalog, because the question\n // it answers — \"why does this count disagree with the shelf\" —\n // is asked while looking at the count.\n {\n size: { xs: 12 },\n children: <StockMovementsCard hostId={hostId} />,\n },\n { size: { xs: 12 }, children: <MemberPostsCard hostId={hostId} /> },\n ]}\n />\n )\n case 'orders':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <HostOrdersCard hostId={hostId} /> },\n // The two queues that feed orders rather than record them\n // (AGL-2227): checkouts that stalled and shoppers waiting on\n // stock. Beneath the orders list because both are pre-order.\n {\n size: { xs: 12 },\n children: <RecoveryQueueCard hostId={hostId} />,\n },\n ]}\n />\n )\n case 'promotions':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <DiscountsCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <HostCouponsCard hostId={hostId} /> },\n // Store credit lives with the other money-off surfaces\n // (AGL-2226) — it had no console anywhere before this.\n { size: { xs: 12 }, children: <GiftCardsCard hostId={hostId} /> },\n {\n size: { xs: 12 },\n children: <ReviewsModerationCard hostId={hostId} />,\n },\n ]}\n />\n )\n case 'reservations':\n return <ReservationsCard hostId={hostId} />\n case 'settings':\n return (\n <GridItems\n spacing={3}\n items={[\n {\n size: { xs: 12 },\n children: <PaymentsSettingsCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <StoreSettingsCard hostId={hostId} />,\n },\n { size: { xs: 12 }, children: <TaxSettingsCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <LocationsCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <RegistersCard hostId={hostId} /> },\n {\n size: { xs: 12 },\n children: <ShippingSettingsCard hostId={hostId} />,\n },\n { size: { xs: 12 }, children: <SuppliersCard hostId={hostId} /> },\n ]}\n />\n )\n case 'analytics':\n return (\n // Two cards since AGL-2440. The tax summary lives here rather\n // than under Settings → Tax because that tab CONFIGURES tax and\n // this REPORTS what was collected — a merchant reading a figure\n // they may file from should not be one field away from changing\n // the rate that produced it.\n <GridItems\n spacing={3}\n items={[\n {\n size: { xs: 12 },\n children: <CommerceAnalyticsCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <StorefrontTaxSummaryCard hostId={hostId} />,\n },\n ]}\n />\n )\n default:\n return null\n }\n}\n\n/**\n * Commerce console page (AGL-395): the Products management surface, owned by\n * the commerce plugin and rendered by the shell's generic plugin route. The\n * product editor's media browser is supplied by the shell's\n * ConsoleMediaPickerProvider (the media library is org/session coupled and\n * stays in the app).\n *\n * ## Sections are ROUTES (AGL-2501)\n *\n * The six sections hold thirty-two Firestore listens between them, and a tab\n * strip mounts every panel: opening Catalog also subscribed the orders,\n * promotions, reservations, settings and analytics cards. The `limit()` on\n * those queries is the bill — several ask for 500, and one load reached a\n * ceiling of ~4,460 documents to render one tab.\n *\n * `HubTabs lazy` bought that back as a flag somebody has to remember. A URL\n * per section makes it structural instead: the page builds one section's body\n * and the others do not exist to subscribe. Three things come with it that the\n * tab version faked — a section is linkable, the back button walks sections,\n * and which one is open is a fact about the URL rather than state kept in sync\n * with it. `commerce-console-read-cost.spec.tsx` meters it at the Firestore\n * boundary and refuses a section that listens before it is opened.\n *\n * The shell resolves the section, gates it and hands back the rail's hrefs;\n * this page only has to say what each section contains.\n */\nexport function CommerceConsolePage(props: ConsolePluginPageProps) {\n const { hostId, section, sections, basePath } = props\n\n /*\n * Nothing, deliberately, while the redirect is in flight.\n *\n * Rendering the default section here instead would issue that section's\n * listens on a URL that is about to be replaced — paying for Catalog on\n * every arrival at `/products`, which is every click of the nav tab.\n */\n if (!section || !sections?.length || !basePath) return null\n\n return (\n <HubSections sections={sections}>\n {sectionBody(section as CommerceConsoleSectionId, hostId)}\n </HubSections>\n )\n}\nCommerceConsolePage.displayName = 'CommerceConsolePage'\n\nexport default CommerceConsolePage\n"],"names":["GridItems","HubSections","CatalogOrganizationCard","CommerceAnalyticsCard","DiscountsCard","GiftCardsCard","HostCouponsCard","HostOrdersCard","LocationsCard","MemberPostsCard","PaymentsSettingsCard","ProductsHubCard","RecoveryQueueCard","RegistersCard","ReservationsCard","ReviewsModerationCard","ShippingSettingsCard","StockMovementsCard","StoreSettingsCard","StorefrontTaxSummaryCard","SuppliersCard","TaxSettingsCard","sectionBody","section","hostId","spacing","items","size","xs","children","CommerceConsolePage","props","sections","basePath","length","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAGA,SAASA,SAAS,QAAQ,uBAAsB;AAChD,SAASC,WAAW,QAAQ,wBAAuB;AAGnD,OAAOC,6BAA6B,mDAA+C;AACnF,OAAOC,2BAA2B,iDAA6C;AAC/E,OAAOC,mBAAmB,wCAAoC;AAC9D,OAAOC,mBAAmB,yCAAqC;AAC/D,OAAOC,qBAAqB,2CAAuC;AACnE,OAAOC,oBAAoB,0CAAsC;AACjE,OAAOC,mBAAmB,wCAAoC;AAC9D,OAAOC,qBAAqB,2CAAuC;AACnE,OAAOC,0BAA0B,gDAA4C;AAC7E,OAAOC,qBAAqB,2CAAuC;AACnE,OAAOC,uBAAuB,6CAAyC;AACvE,OAAOC,mBAAmB,wCAAoC;AAC9D,OAAOC,sBAAsB,2CAAuC;AACpE,OAAOC,2BAA2B,iDAA6C;AAC/E,OAAOC,0BAA0B,gDAA4C;AAC7E,OAAOC,wBAAwB,8CAA0C;AACzE,OAAOC,uBAAuB,6CAAyC;AACvE,OAAOC,8BAA8B,qDAAiD;AACtF,OAAOC,mBAAmB,wCAAoC;AAC9D,OAAOC,qBAAqB,2CAAuC;AAEnE;;;;;;;;CAQC,GACD,SAASC,YACPC,OAAiC,EACjCC,MAAc;IAEd,OAAQD;QACN,KAAK;YACH,qBACE,KAACvB;gBACCyB,SAAS;gBACTC,OAAO;oBACL;wBAAEC,MAAM;4BAAEC,IAAI;wBAAG;wBAAGC,wBAAU,KAAClB;4BAAgBa,QAAQA;;oBAAW;oBAClE;wBACEG,MAAM;4BAAEC,IAAI;wBAAG;wBACfC,wBAAU,KAAC3B;4BAAwBsB,QAAQA;;oBAC7C;oBACA,4DAA4D;oBAC5D,+DAA+D;oBAC/D,+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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
+ import type { ConsoleNavSection } from '@aglyn/aglyn';
18
+ export type CommerceConsoleSectionId = 'catalog' | 'orders' | 'promotions' | 'reservations' | 'settings' | 'analytics';
19
+ /**
20
+ * The commerce console's sections, in rail order (AGL-2501).
21
+ *
22
+ * One list, read twice and never copied: `plugin.ts` registers it on the nav
23
+ * item so the shell can route and gate each section, and the page switches its
24
+ * body on the id the shell resolves back. A second copy is how a section comes
25
+ * to be routable under one id and drawn under another.
26
+ *
27
+ * Ids appear in links people keep — treat them as persisted, and rename a
28
+ * LABEL rather than an id.
29
+ *
30
+ * No `navTabId` on any of them: every section here ships with the surface, so
31
+ * they inherit the Products nav item's gate. A section that ships later
32
+ * declares its own, which ANDs with the parent's rather than replacing it.
33
+ */
34
+ export declare const COMMERCE_CONSOLE_SECTIONS: readonly ConsoleNavSection[];
@@ -0,0 +1,62 @@
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 commerce console's sections, in rail order (AGL-2501).
18
+ *
19
+ * One list, read twice and never copied: `plugin.ts` registers it on the nav
20
+ * item so the shell can route and gate each section, and the page switches its
21
+ * body on the id the shell resolves back. A second copy is how a section comes
22
+ * to be routable under one id and drawn under another.
23
+ *
24
+ * Ids appear in links people keep — treat them as persisted, and rename a
25
+ * LABEL rather than an id.
26
+ *
27
+ * No `navTabId` on any of them: every section here ships with the surface, so
28
+ * they inherit the Products nav item's gate. A section that ships later
29
+ * declares its own, which ANDs with the parent's rather than replacing it.
30
+ */ export const COMMERCE_CONSOLE_SECTIONS = [
31
+ {
32
+ id: 'catalog',
33
+ label: 'Catalog'
34
+ },
35
+ {
36
+ id: 'orders',
37
+ label: 'Orders'
38
+ },
39
+ {
40
+ id: 'promotions',
41
+ label: 'Promotions'
42
+ },
43
+ {
44
+ id: 'reservations',
45
+ label: 'Reservations'
46
+ },
47
+ {
48
+ id: 'settings',
49
+ label: 'Settings'
50
+ },
51
+ {
52
+ id: 'analytics',
53
+ label: 'Analytics'
54
+ }
55
+ ] /*
56
+ * Rail ORDER decides where `/products` lands: the shell redirects a bare hub
57
+ * URL to the first section in this list the reader may open (AGL-2501). There
58
+ * is deliberately no separate default constant — a second place to say which
59
+ * section is first is a second place for it to disagree with the rail.
60
+ */ ;
61
+
62
+ //# sourceMappingURL=commerce-console-sections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/commerce-console-sections.ts"],"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 type { ConsoleNavSection } from '@aglyn/aglyn'\n\nexport type CommerceConsoleSectionId =\n | 'catalog'\n | 'orders'\n | 'promotions'\n | 'reservations'\n | 'settings'\n | 'analytics'\n\n/**\n * The commerce console's sections, in rail order (AGL-2501).\n *\n * One list, read twice and never copied: `plugin.ts` registers it on the nav\n * item so the shell can route and gate each section, and the page switches its\n * body on the id the shell resolves back. A second copy is how a section comes\n * to be routable under one id and drawn under another.\n *\n * Ids appear in links people keep — treat them as persisted, and rename a\n * LABEL rather than an id.\n *\n * No `navTabId` on any of them: every section here ships with the surface, so\n * they inherit the Products nav item's gate. A section that ships later\n * declares its own, which ANDs with the parent's rather than replacing it.\n */\nexport const COMMERCE_CONSOLE_SECTIONS: readonly ConsoleNavSection[] = [\n { id: 'catalog', label: 'Catalog' },\n { id: 'orders', label: 'Orders' },\n { id: 'promotions', label: 'Promotions' },\n { id: 'reservations', label: 'Reservations' },\n { id: 'settings', label: 'Settings' },\n { id: 'analytics', label: 'Analytics' },\n]\n\n/*\n * Rail ORDER decides where `/products` lands: the shell redirects a bare hub\n * URL to the first section in this list the reader may open (AGL-2501). There\n * is deliberately no separate default constant — a second place to say which\n * section is first is a second place for it to disagree with the rail.\n */\n"],"names":["COMMERCE_CONSOLE_SECTIONS","id","label"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAYD;;;;;;;;;;;;;;CAcC,GACD,OAAO,MAAMA,4BAA0D;IACrE;QAAEC,IAAI;QAAWC,OAAO;IAAU;IAClC;QAAED,IAAI;QAAUC,OAAO;IAAS;IAChC;QAAED,IAAI;QAAcC,OAAO;IAAa;IACxC;QAAED,IAAI;QAAgBC,OAAO;IAAe;IAC5C;QAAED,IAAI;QAAYC,OAAO;IAAW;IACpC;QAAED,IAAI;QAAaC,OAAO;IAAY;CACvC,CAED;;;;;CAKC,IAPA"}
@@ -0,0 +1,14 @@
1
+ export interface CatalogOrganizationCardProps {
2
+ hostId: string;
3
+ }
4
+ /**
5
+ * Categories & collections manager (AGL-280): category tree (parentId)
6
+ * at `hosts/{hostId}/productCategories`, manual + smart collections at
7
+ * `hosts/{hostId}/collections` with a live matched-product preview from
8
+ * the same `matchesCollection` matcher the storefront uses.
9
+ */
10
+ export declare function CatalogOrganizationCard(props: CatalogOrganizationCardProps): import("react").JSX.Element;
11
+ export declare namespace CatalogOrganizationCard {
12
+ var displayName: string;
13
+ }
14
+ export default CatalogOrganizationCard;