@nextblock-cms/ecom 0.20.3 → 0.21.1

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 (446) hide show
  1. package/README.md +43 -0
  2. package/_virtual/_rolldown/runtime.cjs +1 -0
  3. package/index.cjs +1 -0
  4. package/index.es.js +38 -146
  5. package/lib/CurrencyProvider.cjs +1 -0
  6. package/lib/CurrencyProvider.d.ts +1 -1
  7. package/lib/CurrencyProvider.es.js +85 -95
  8. package/lib/PaymentReadinessProvider.cjs +1 -0
  9. package/lib/PaymentReadinessProvider.d.ts +1 -1
  10. package/lib/PaymentReadinessProvider.es.js +24 -27
  11. package/lib/cart-store.cjs +1 -0
  12. package/lib/cart-store.es.js +109 -121
  13. package/lib/components/AccountNavigationMenu.cjs +1 -0
  14. package/lib/components/AccountNavigationMenu.d.ts +1 -1
  15. package/lib/components/AccountNavigationMenu.es.js +36 -50
  16. package/lib/components/AddToCartButton.cjs +1 -0
  17. package/lib/components/AddToCartButton.d.ts +1 -1
  18. package/lib/components/AddToCartButton.es.js +94 -89
  19. package/lib/components/Cart.cjs +1 -0
  20. package/lib/components/Cart.d.ts +1 -1
  21. package/lib/components/Cart.es.js +261 -180
  22. package/lib/components/CartDrawer.cjs +1 -0
  23. package/lib/components/CartDrawer.d.ts +1 -1
  24. package/lib/components/CartDrawer.es.js +218 -148
  25. package/lib/components/CartIcon.cjs +1 -0
  26. package/lib/components/CartIcon.d.ts +1 -1
  27. package/lib/components/CartIcon.es.js +33 -35
  28. package/lib/components/Checkout.cjs +1 -0
  29. package/lib/components/Checkout.d.ts +1 -1
  30. package/lib/components/Checkout.es.js +1092 -1108
  31. package/lib/components/CouponForm.cjs +1 -0
  32. package/lib/components/CouponForm.d.ts +1 -1
  33. package/lib/components/CouponForm.es.js +136 -148
  34. package/lib/components/CurrencySwitcher.cjs +1 -0
  35. package/lib/components/CurrencySwitcher.d.ts +1 -1
  36. package/lib/components/CurrencySwitcher.es.js +22 -18
  37. package/lib/components/CustomerProfileForm.cjs +1 -0
  38. package/lib/components/CustomerProfileForm.es.js +454 -313
  39. package/lib/components/FeaturedProduct.cjs +1 -0
  40. package/lib/components/FeaturedProduct.d.ts +1 -1
  41. package/lib/components/FeaturedProduct.es.js +98 -83
  42. package/lib/components/FreemiusLicensePanel.cjs +1 -0
  43. package/lib/components/FreemiusLicensePanel.d.ts +1 -1
  44. package/lib/components/FreemiusLicensePanel.es.js +70 -65
  45. package/lib/components/InvoiceDocument.cjs +1 -0
  46. package/lib/components/InvoiceDocument.es.js +256 -192
  47. package/lib/components/InvoiceViewerShell.cjs +29 -0
  48. package/lib/components/InvoiceViewerShell.d.ts +1 -1
  49. package/lib/components/InvoiceViewerShell.es.js +75 -106
  50. package/lib/components/ProductCard.cjs +1 -0
  51. package/lib/components/ProductCard.d.ts +1 -1
  52. package/lib/components/ProductCard.es.js +186 -171
  53. package/lib/components/ProductDetailsLayout.cjs +1 -0
  54. package/lib/components/ProductDetailsLayout.es.js +405 -404
  55. package/lib/components/ProductGallery.cjs +1 -0
  56. package/lib/components/ProductGallery.d.ts +1 -1
  57. package/lib/components/ProductGallery.es.js +51 -54
  58. package/lib/components/ProductGrid.cjs +1 -0
  59. package/lib/components/ProductGrid.d.ts +1 -1
  60. package/lib/components/ProductGrid.es.js +23 -25
  61. package/lib/components/ShippingEstimator.cjs +1 -0
  62. package/lib/components/ShippingEstimator.d.ts +1 -1
  63. package/lib/components/ShippingEstimator.es.js +158 -153
  64. package/lib/components/ShortDescription.cjs +1 -0
  65. package/lib/components/ShortDescription.es.js +17 -17
  66. package/lib/components/SimpleTiptapRenderer.cjs +1 -0
  67. package/lib/components/SimpleTiptapRenderer.es.js +238 -211
  68. package/lib/components/SubscriptionSelector.cjs +1 -0
  69. package/lib/components/SubscriptionSelector.es.js +159 -154
  70. package/lib/countries.cjs +1 -0
  71. package/lib/countries.es.js +232 -75
  72. package/lib/coupon-server.cjs +1 -0
  73. package/lib/coupon-server.es.js +180 -224
  74. package/lib/coupons.cjs +1 -0
  75. package/lib/coupons.es.js +12 -14
  76. package/lib/currency-constants.cjs +1 -0
  77. package/lib/currency-constants.es.js +4 -4
  78. package/lib/currency-rest-client.cjs +1 -0
  79. package/lib/currency-rest-client.es.js +15 -22
  80. package/lib/currency-store.cjs +1 -0
  81. package/lib/currency-store.es.js +20 -27
  82. package/lib/currency-sync.cjs +1 -0
  83. package/lib/currency-sync.es.js +124 -170
  84. package/lib/currency.cjs +1 -0
  85. package/lib/currency.es.js +242 -310
  86. package/lib/customer-addresses.cjs +1 -0
  87. package/lib/customer-addresses.es.js +80 -109
  88. package/lib/customer-orders.cjs +1 -0
  89. package/lib/customer-orders.es.js +31 -43
  90. package/lib/customer.cjs +1 -0
  91. package/lib/customer.es.js +43 -52
  92. package/lib/export-helpers.cjs +1 -0
  93. package/lib/export-helpers.es.js +53 -52
  94. package/lib/factory.cjs +1 -0
  95. package/lib/factory.es.js +10 -7
  96. package/lib/freemius-coupons.cjs +1 -0
  97. package/lib/freemius-coupons.es.js +245 -262
  98. package/lib/freemius-license-claim.cjs +1 -0
  99. package/lib/freemius-license-claim.es.js +87 -71
  100. package/lib/freemius-license.cjs +1 -0
  101. package/lib/freemius-license.es.js +32 -39
  102. package/lib/freemius-order-sync.cjs +1 -0
  103. package/lib/freemius-order-sync.es.js +226 -290
  104. package/lib/freemius-trial-provision.cjs +1 -0
  105. package/lib/freemius-trial-provision.es.js +136 -130
  106. package/lib/inventory-settings.cjs +1 -0
  107. package/lib/inventory-settings.es.js +69 -77
  108. package/lib/invoice-server.cjs +33 -0
  109. package/lib/invoice-server.es.js +94 -141
  110. package/lib/invoice-ui.cjs +1 -0
  111. package/lib/invoice-ui.es.js +50 -66
  112. package/lib/invoice.cjs +1 -0
  113. package/lib/invoice.es.js +85 -94
  114. package/lib/order-inventory.cjs +61 -0
  115. package/lib/order-inventory.es.js +67 -79
  116. package/lib/order-tax-details.cjs +1 -0
  117. package/lib/order-tax-details.es.js +142 -153
  118. package/lib/pages/cms/coupons/CouponEditorForm.cjs +1 -0
  119. package/lib/pages/cms/coupons/CouponEditorForm.d.ts +1 -1
  120. package/lib/pages/cms/coupons/CouponEditorForm.es.js +227 -185
  121. package/lib/pages/cms/coupons/CouponsPage.cjs +5 -0
  122. package/lib/pages/cms/coupons/CouponsPage.d.ts +1 -1
  123. package/lib/pages/cms/coupons/CouponsPage.es.js +235 -166
  124. package/lib/pages/cms/coupons/CreateCouponDialog.cjs +1 -0
  125. package/lib/pages/cms/coupons/CreateCouponDialog.d.ts +1 -1
  126. package/lib/pages/cms/coupons/CreateCouponDialog.es.js +35 -34
  127. package/lib/pages/cms/coupons/EditCouponPage.cjs +1 -0
  128. package/lib/pages/cms/coupons/EditCouponPage.d.ts +1 -1
  129. package/lib/pages/cms/coupons/EditCouponPage.es.js +47 -47
  130. package/lib/pages/cms/coupons/ProductScopePicker.cjs +1 -0
  131. package/lib/pages/cms/coupons/ProductScopePicker.d.ts +1 -1
  132. package/lib/pages/cms/coupons/ProductScopePicker.es.js +128 -117
  133. package/lib/pages/cms/coupons/actions.cjs +1 -0
  134. package/lib/pages/cms/coupons/actions.es.js +112 -115
  135. package/lib/pages/cms/coupons/index.cjs +1 -0
  136. package/lib/pages/cms/coupons/index.es.js +3 -0
  137. package/lib/pages/cms/coupons/product-options.cjs +1 -0
  138. package/lib/pages/cms/coupons/product-options.es.js +21 -23
  139. package/lib/pages/cms/orders/ExportReportsDialog.cjs +1 -0
  140. package/lib/pages/cms/orders/ExportReportsDialog.es.js +135 -129
  141. package/lib/pages/cms/orders/MarkPaidButton.d.ts +1 -1
  142. package/lib/pages/cms/orders/OrderDetailPage.cjs +1 -0
  143. package/lib/pages/cms/orders/OrderDetailPage.d.ts +1 -1
  144. package/lib/pages/cms/orders/OrderDetailPage.es.js +186 -134
  145. package/lib/pages/cms/orders/OrderPrintButton.cjs +1 -0
  146. package/lib/pages/cms/orders/OrderPrintButton.d.ts +1 -1
  147. package/lib/pages/cms/orders/OrderPrintButton.es.js +15 -21
  148. package/lib/pages/cms/orders/OrderStatusForm.cjs +1 -0
  149. package/lib/pages/cms/orders/OrderStatusForm.d.ts +1 -1
  150. package/lib/pages/cms/orders/OrderStatusForm.es.js +85 -69
  151. package/lib/pages/cms/orders/OrdersPage.cjs +1 -0
  152. package/lib/pages/cms/orders/OrdersPage.d.ts +1 -1
  153. package/lib/pages/cms/orders/OrdersPage.es.js +170 -102
  154. package/lib/pages/cms/orders/actions.cjs +7 -0
  155. package/lib/pages/cms/orders/actions.es.js +53 -69
  156. package/lib/pages/cms/orders/export-actions.cjs +1 -0
  157. package/lib/pages/cms/orders/export-actions.es.js +23 -26
  158. package/lib/pages/cms/orders/index.cjs +1 -0
  159. package/lib/pages/cms/orders/index.es.js +6 -0
  160. package/lib/pages/cms/orders/server-actions.cjs +1 -0
  161. package/lib/pages/cms/orders/server-actions.es.js +60 -51
  162. package/lib/pages/cms/payments/PaymentsClient.cjs +1 -0
  163. package/lib/pages/cms/payments/PaymentsClient.d.ts +1 -1
  164. package/lib/pages/cms/payments/PaymentsClient.es.js +316 -346
  165. package/lib/pages/cms/payments/PaymentsPage.cjs +1 -0
  166. package/lib/pages/cms/payments/PaymentsPage.d.ts +1 -1
  167. package/lib/pages/cms/payments/PaymentsPage.es.js +29 -32
  168. package/lib/pages/cms/payments/actions.cjs +1 -0
  169. package/lib/pages/cms/payments/actions.es.js +38 -48
  170. package/lib/pages/cms/payments/index.cjs +1 -0
  171. package/lib/pages/cms/payments/index.es.js +3 -0
  172. package/lib/pages/cms/payments/queries.cjs +1 -0
  173. package/lib/pages/cms/payments/queries.es.js +38 -48
  174. package/lib/pages/cms/products/ProductsPage.cjs +1 -0
  175. package/lib/pages/cms/products/ProductsPage.d.ts +1 -1
  176. package/lib/pages/cms/products/ProductsPage.es.js +63 -66
  177. package/lib/pages/cms/products/[id]/edit/EditProductPage.cjs +1 -0
  178. package/lib/pages/cms/products/[id]/edit/EditProductPage.d.ts +1 -1
  179. package/lib/pages/cms/products/[id]/edit/EditProductPage.es.js +139 -0
  180. package/lib/pages/cms/products/actions.cjs +44 -0
  181. package/lib/pages/cms/products/actions.es.js +121 -162
  182. package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs +1 -0
  183. package/lib/pages/cms/products/attributes/AttributeManagementPage.d.ts +1 -1
  184. package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +55 -47
  185. package/lib/pages/cms/products/attributes/components/AttributeManager.cjs +1 -0
  186. package/lib/pages/cms/products/attributes/components/AttributeManager.d.ts +1 -1
  187. package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +285 -290
  188. package/lib/pages/cms/products/categories/CategoryManagementPage.cjs +1 -0
  189. package/lib/pages/cms/products/categories/CategoryManagementPage.d.ts +1 -1
  190. package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +43 -35
  191. package/lib/pages/cms/products/categories/components/CategoryManager.cjs +1 -0
  192. package/lib/pages/cms/products/categories/components/CategoryManager.es.js +315 -262
  193. package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs +1 -0
  194. package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +115 -113
  195. package/lib/pages/cms/products/components/CurrencyPriceFields.cjs +1 -0
  196. package/lib/pages/cms/products/components/CurrencyPriceFields.d.ts +1 -1
  197. package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +136 -145
  198. package/lib/pages/cms/products/components/DeleteProductButton.cjs +1 -0
  199. package/lib/pages/cms/products/components/DeleteProductButton.d.ts +1 -1
  200. package/lib/pages/cms/products/components/DeleteProductButton.es.js +35 -47
  201. package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs +1 -0
  202. package/lib/pages/cms/products/components/FreemiusPricingDashboard.d.ts +1 -1
  203. package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +106 -84
  204. package/lib/pages/cms/products/components/ProductCategorySelector.cjs +1 -0
  205. package/lib/pages/cms/products/components/ProductCategorySelector.es.js +156 -159
  206. package/lib/pages/cms/products/components/ProductForm.cjs +1 -0
  207. package/lib/pages/cms/products/components/ProductForm.es.js +872 -693
  208. package/lib/pages/cms/products/components/ProductMediaManager.cjs +1 -0
  209. package/lib/pages/cms/products/components/ProductMediaManager.es.js +106 -103
  210. package/lib/pages/cms/products/components/ProductsBulkTable.cjs +1 -0
  211. package/lib/pages/cms/products/components/ProductsBulkTable.d.ts +1 -1
  212. package/lib/pages/cms/products/components/ProductsBulkTable.es.js +303 -294
  213. package/lib/pages/cms/products/components/SaleScheduleFields.cjs +1 -0
  214. package/lib/pages/cms/products/components/SaleScheduleFields.d.ts +1 -1
  215. package/lib/pages/cms/products/components/SaleScheduleFields.es.js +111 -134
  216. package/lib/pages/cms/products/components/SyncFreemiusButton.cjs +1 -0
  217. package/lib/pages/cms/products/components/SyncFreemiusButton.d.ts +1 -1
  218. package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +29 -35
  219. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs +5 -0
  220. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.d.ts +1 -1
  221. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +36 -48
  222. package/lib/pages/cms/products/components/SyncProductForm.d.ts +1 -1
  223. package/lib/pages/cms/products/components/VariationsEditor.cjs +1 -0
  224. package/lib/pages/cms/products/components/VariationsEditor.d.ts +1 -1
  225. package/lib/pages/cms/products/components/VariationsEditor.es.js +396 -405
  226. package/lib/pages/cms/products/index.cjs +1 -0
  227. package/lib/pages/cms/products/index.es.js +8 -0
  228. package/lib/pages/cms/products/inventory/InventoryPage.cjs +1 -0
  229. package/lib/pages/cms/products/inventory/InventoryPage.d.ts +1 -1
  230. package/lib/pages/cms/products/inventory/InventoryPage.es.js +21 -15
  231. package/lib/pages/cms/products/inventory/InventoryTableClient.cjs +2 -0
  232. package/lib/pages/cms/products/inventory/InventoryTableClient.d.ts +1 -1
  233. package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +230 -209
  234. package/lib/pages/cms/products/inventory/actions.cjs +3 -0
  235. package/lib/pages/cms/products/inventory/actions.es.js +83 -91
  236. package/lib/pages/cms/products/new/NewProductPage.cjs +1 -0
  237. package/lib/pages/cms/products/new/NewProductPage.d.ts +1 -1
  238. package/lib/pages/cms/products/new/NewProductPage.es.js +58 -74
  239. package/lib/pages/cms/products/product-price-sync.cjs +1 -0
  240. package/lib/pages/cms/products/product-price-sync.es.js +74 -89
  241. package/lib/pages/cms/products/server-actions.cjs +1 -0
  242. package/lib/pages/cms/products/server-actions.es.js +250 -233
  243. package/lib/pages/cms/shipping/ShippingPage.cjs +5 -0
  244. package/lib/pages/cms/shipping/ShippingPage.es.js +287 -209
  245. package/lib/pages/cms/shipping/components/RateForm.cjs +1 -0
  246. package/lib/pages/cms/shipping/components/RateForm.d.ts +1 -1
  247. package/lib/pages/cms/shipping/components/RateForm.es.js +439 -436
  248. package/lib/pages/cms/shipping/components/ZoneForm.cjs +1 -0
  249. package/lib/pages/cms/shipping/components/ZoneForm.es.js +245 -224
  250. package/lib/pages/cms/shipping/index.cjs +1 -0
  251. package/lib/pages/cms/shipping/index.es.js +3 -0
  252. package/lib/pages/cms/shipping/server-actions.cjs +1 -0
  253. package/lib/pages/cms/shipping/server-actions.es.js +131 -149
  254. package/lib/pages/cms/taxes/TaxesPage.cjs +1 -0
  255. package/lib/pages/cms/taxes/TaxesPage.d.ts +1 -1
  256. package/lib/pages/cms/taxes/TaxesPage.es.js +211 -169
  257. package/lib/pages/cms/taxes/actions.cjs +1 -0
  258. package/lib/pages/cms/taxes/actions.es.js +41 -53
  259. package/lib/pages/cms/taxes/components/TaxRateForm.cjs +1 -0
  260. package/lib/pages/cms/taxes/components/TaxRateForm.d.ts +1 -1
  261. package/lib/pages/cms/taxes/components/TaxRateForm.es.js +112 -99
  262. package/lib/pages/cms/taxes/index.cjs +1 -0
  263. package/lib/pages/cms/taxes/index.es.js +3 -0
  264. package/lib/payment-config.cjs +1 -0
  265. package/lib/payment-config.es.js +110 -126
  266. package/lib/product-actions.cjs +238 -0
  267. package/lib/product-actions.es.js +289 -544
  268. package/lib/product-context.cjs +1 -0
  269. package/lib/product-context.es.js +13 -15
  270. package/lib/product-schema.cjs +1 -0
  271. package/lib/product-schema.es.js +99 -134
  272. package/lib/providers/freemius.cjs +1 -0
  273. package/lib/providers/freemius.es.js +446 -530
  274. package/lib/providers/stripe.cjs +1 -0
  275. package/lib/providers/stripe.es.js +417 -477
  276. package/lib/server-actions/coupon-actions.cjs +1 -0
  277. package/lib/server-actions/coupon-actions.es.js +22 -22
  278. package/lib/server-actions/customer-actions.cjs +1 -0
  279. package/lib/server-actions/customer-actions.es.js +26 -28
  280. package/lib/server-actions/product-actions.cjs +1 -0
  281. package/lib/server-actions/product-actions.es.js +9 -15
  282. package/lib/server-actions/shipping-actions.cjs +1 -0
  283. package/lib/server-actions/shipping-actions.es.js +27 -24
  284. package/lib/server-actions/tax-actions.cjs +1 -0
  285. package/lib/server-actions/tax-actions.es.js +33 -39
  286. package/lib/shared-inventory.cjs +15 -0
  287. package/lib/shared-inventory.es.js +111 -160
  288. package/lib/shipping/resolver.cjs +7 -0
  289. package/lib/shipping/resolver.es.js +44 -61
  290. package/lib/shipping-rate-currency.cjs +1 -0
  291. package/lib/shipping-rate-currency.es.js +52 -67
  292. package/lib/states.cjs +1 -0
  293. package/lib/states.es.js +333 -154
  294. package/lib/stripe/checkout.cjs +1 -0
  295. package/lib/stripe/checkout.es.js +125 -181
  296. package/lib/stripe/client.cjs +1 -0
  297. package/lib/stripe/client.es.js +14 -19
  298. package/lib/stripe/order-sync.cjs +1 -0
  299. package/lib/stripe/order-sync.es.js +106 -126
  300. package/lib/stripe/webhooks.cjs +1 -0
  301. package/lib/stripe/webhooks.es.js +37 -31
  302. package/lib/tax-calculation.cjs +1 -0
  303. package/lib/tax-calculation.es.js +84 -98
  304. package/lib/trials.cjs +1 -0
  305. package/lib/trials.es.js +24 -30
  306. package/lib/types.cjs +1 -0
  307. package/lib/types.es.js +21 -27
  308. package/lib/use-cart.cjs +1 -0
  309. package/lib/use-cart.es.js +38 -40
  310. package/lib/use-price-formatter.cjs +1 -0
  311. package/lib/use-price-formatter.es.js +10 -11
  312. package/lib/variation-utils.cjs +1 -0
  313. package/lib/variation-utils.es.js +199 -261
  314. package/lib/zod-config.cjs +1 -0
  315. package/lib/zod-config.es.js +5 -6
  316. package/package.json +22 -21
  317. package/server.cjs +1 -0
  318. package/server.es.js +56 -211
  319. package/index.cjs.js +0 -1
  320. package/lib/CurrencyProvider.cjs.js +0 -1
  321. package/lib/PaymentReadinessProvider.cjs.js +0 -1
  322. package/lib/cart-store.cjs.js +0 -1
  323. package/lib/components/AccountNavigationMenu.cjs.js +0 -1
  324. package/lib/components/AddToCartButton.cjs.js +0 -1
  325. package/lib/components/Cart.cjs.js +0 -1
  326. package/lib/components/CartDrawer.cjs.js +0 -1
  327. package/lib/components/CartIcon.cjs.js +0 -1
  328. package/lib/components/Checkout.cjs.js +0 -1
  329. package/lib/components/CouponForm.cjs.js +0 -1
  330. package/lib/components/CurrencySwitcher.cjs.js +0 -1
  331. package/lib/components/CustomerProfileForm.cjs.js +0 -1
  332. package/lib/components/FeaturedProduct.cjs.js +0 -1
  333. package/lib/components/FreemiusLicensePanel.cjs.js +0 -1
  334. package/lib/components/InvoiceDocument.cjs.js +0 -1
  335. package/lib/components/InvoiceViewerShell.cjs.js +0 -29
  336. package/lib/components/ProductCard.cjs.js +0 -1
  337. package/lib/components/ProductDetailsLayout.cjs.js +0 -1
  338. package/lib/components/ProductGallery.cjs.js +0 -1
  339. package/lib/components/ProductGrid.cjs.js +0 -1
  340. package/lib/components/ShippingEstimator.cjs.js +0 -1
  341. package/lib/components/ShortDescription.cjs.js +0 -1
  342. package/lib/components/SimpleTiptapRenderer.cjs.js +0 -1
  343. package/lib/components/SubscriptionSelector.cjs.js +0 -1
  344. package/lib/countries.cjs.js +0 -1
  345. package/lib/coupon-server.cjs.js +0 -1
  346. package/lib/coupons.cjs.js +0 -1
  347. package/lib/currency-constants.cjs.js +0 -1
  348. package/lib/currency-rest-client.cjs.js +0 -1
  349. package/lib/currency-store.cjs.js +0 -1
  350. package/lib/currency-sync.cjs.js +0 -1
  351. package/lib/currency.cjs.js +0 -1
  352. package/lib/customer-addresses.cjs.js +0 -1
  353. package/lib/customer-orders.cjs.js +0 -1
  354. package/lib/customer.cjs.js +0 -1
  355. package/lib/export-helpers.cjs.js +0 -1
  356. package/lib/factory.cjs.js +0 -1
  357. package/lib/freemius-coupons.cjs.js +0 -1
  358. package/lib/freemius-license-claim.cjs.js +0 -1
  359. package/lib/freemius-license.cjs.js +0 -1
  360. package/lib/freemius-order-sync.cjs.js +0 -1
  361. package/lib/freemius-trial-provision.cjs.js +0 -1
  362. package/lib/inventory-settings.cjs.js +0 -1
  363. package/lib/invoice-server.cjs.js +0 -33
  364. package/lib/invoice-ui.cjs.js +0 -1
  365. package/lib/invoice.cjs.js +0 -1
  366. package/lib/order-inventory.cjs.js +0 -61
  367. package/lib/order-tax-details.cjs.js +0 -1
  368. package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +0 -1
  369. package/lib/pages/cms/coupons/CouponsPage.cjs.js +0 -5
  370. package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +0 -1
  371. package/lib/pages/cms/coupons/EditCouponPage.cjs.js +0 -1
  372. package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +0 -1
  373. package/lib/pages/cms/coupons/actions.cjs.js +0 -1
  374. package/lib/pages/cms/coupons/product-options.cjs.js +0 -1
  375. package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +0 -1
  376. package/lib/pages/cms/orders/OrderDetailPage.cjs.js +0 -1
  377. package/lib/pages/cms/orders/OrderPrintButton.cjs.js +0 -1
  378. package/lib/pages/cms/orders/OrderStatusForm.cjs.js +0 -1
  379. package/lib/pages/cms/orders/OrdersPage.cjs.js +0 -1
  380. package/lib/pages/cms/orders/actions.cjs.js +0 -7
  381. package/lib/pages/cms/orders/export-actions.cjs.js +0 -1
  382. package/lib/pages/cms/orders/server-actions.cjs.js +0 -1
  383. package/lib/pages/cms/payments/PaymentsClient.cjs.js +0 -1
  384. package/lib/pages/cms/payments/PaymentsPage.cjs.js +0 -1
  385. package/lib/pages/cms/payments/actions.cjs.js +0 -1
  386. package/lib/pages/cms/payments/queries.cjs.js +0 -1
  387. package/lib/pages/cms/products/ProductsPage.cjs.js +0 -1
  388. package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +0 -1
  389. package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +0 -156
  390. package/lib/pages/cms/products/actions.cjs.js +0 -44
  391. package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +0 -1
  392. package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +0 -1
  393. package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +0 -1
  394. package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +0 -1
  395. package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +0 -1
  396. package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +0 -1
  397. package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +0 -1
  398. package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +0 -1
  399. package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +0 -1
  400. package/lib/pages/cms/products/components/ProductForm.cjs.js +0 -1
  401. package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +0 -1
  402. package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +0 -1
  403. package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +0 -1
  404. package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +0 -1
  405. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +0 -5
  406. package/lib/pages/cms/products/components/VariationsEditor.cjs.js +0 -1
  407. package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +0 -1
  408. package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +0 -2
  409. package/lib/pages/cms/products/inventory/actions.cjs.js +0 -3
  410. package/lib/pages/cms/products/new/NewProductPage.cjs.js +0 -1
  411. package/lib/pages/cms/products/product-price-sync.cjs.js +0 -1
  412. package/lib/pages/cms/products/server-actions.cjs.js +0 -1
  413. package/lib/pages/cms/shipping/ShippingPage.cjs.js +0 -5
  414. package/lib/pages/cms/shipping/components/RateForm.cjs.js +0 -1
  415. package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +0 -1
  416. package/lib/pages/cms/shipping/server-actions.cjs.js +0 -1
  417. package/lib/pages/cms/taxes/TaxesPage.cjs.js +0 -1
  418. package/lib/pages/cms/taxes/actions.cjs.js +0 -1
  419. package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +0 -1
  420. package/lib/payment-config.cjs.js +0 -1
  421. package/lib/product-actions.cjs.js +0 -238
  422. package/lib/product-context.cjs.js +0 -1
  423. package/lib/product-schema.cjs.js +0 -1
  424. package/lib/providers/freemius.cjs.js +0 -5
  425. package/lib/providers/stripe.cjs.js +0 -1
  426. package/lib/server-actions/coupon-actions.cjs.js +0 -1
  427. package/lib/server-actions/customer-actions.cjs.js +0 -1
  428. package/lib/server-actions/product-actions.cjs.js +0 -1
  429. package/lib/server-actions/shipping-actions.cjs.js +0 -1
  430. package/lib/server-actions/tax-actions.cjs.js +0 -1
  431. package/lib/shared-inventory.cjs.js +0 -15
  432. package/lib/shipping/resolver.cjs.js +0 -7
  433. package/lib/shipping-rate-currency.cjs.js +0 -1
  434. package/lib/states.cjs.js +0 -1
  435. package/lib/stripe/checkout.cjs.js +0 -1
  436. package/lib/stripe/client.cjs.js +0 -1
  437. package/lib/stripe/order-sync.cjs.js +0 -1
  438. package/lib/stripe/webhooks.cjs.js +0 -1
  439. package/lib/tax-calculation.cjs.js +0 -1
  440. package/lib/trials.cjs.js +0 -1
  441. package/lib/types.cjs.js +0 -1
  442. package/lib/use-cart.cjs.js +0 -1
  443. package/lib/use-price-formatter.cjs.js +0 -1
  444. package/lib/variation-utils.cjs.js +0 -1
  445. package/lib/zod-config.cjs.js +0 -1
  446. package/server.cjs.js +0 -1
@@ -1,352 +1,322 @@
1
- 'use client';
2
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
3
- import { useTransition as K, useState as I } from "react";
4
- import { useRouter as F } from "next/navigation";
5
- import { Card as g, CardHeader as N, CardTitle as k, CardDescription as C, CardContent as S, Button as w, Checkbox as A, Label as P, Input as D } from "@nextblock-cms/ui";
6
- import { CheckCircle2 as x, AlertCircle as j } from "lucide-react";
7
- import { useFormStatus as R } from "react-dom";
8
- function G({
9
- initialEnabledProviders: s,
10
- configStatus: i,
11
- credentials: t,
12
- saveAction: a,
13
- saveCredentialsAction: c
14
- }) {
15
- const o = F(), [m, u] = K(), n = i.stripe.hasKeys, p = i.freemius.hasKeys, [h, b] = I(() => ({
16
- // Older installs can contain an enabled flag from before providers defaulted off.
17
- // An unconfigured provider cannot be enabled, so never present that stale flag as
18
- // an active checkbox. Saving the form also persists this reconciled false value.
19
- stripe: s.stripe && n,
20
- freemius: s.freemius && p
21
- }));
22
- function _() {
23
- const l = new FormData();
24
- l.set("stripe_enabled", h.stripe ? "true" : "false"), l.set(
25
- "freemius_enabled",
26
- h.freemius ? "true" : "false"
27
- ), u(async () => {
28
- await a(l), o.refresh();
29
- });
30
- }
31
- return /* @__PURE__ */ r("div", { className: "max-w-7xl space-y-4 p-4 sm:p-6", children: [
32
- /* @__PURE__ */ r("div", { className: "space-y-1", children: [
33
- /* @__PURE__ */ e("h1", { className: "text-2xl font-bold tracking-tight", children: "Payment Settings" }),
34
- /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "Enter your provider API keys, then enable the providers your store needs. Physical products use Stripe and digital products use Freemius." })
35
- ] }),
36
- /* @__PURE__ */ r("div", { className: "grid gap-4 lg:grid-cols-[minmax(0,3fr)_minmax(20rem,2fr)]", children: [
37
- /* @__PURE__ */ e(
38
- B,
39
- {
40
- credentials: t,
41
- saveAction: c
42
- }
43
- ),
44
- /* @__PURE__ */ r(g, { className: "flex h-full flex-col", children: [
45
- /* @__PURE__ */ r(N, { className: "pb-3", children: [
46
- /* @__PURE__ */ e(k, { children: "Payment Providers" }),
47
- /* @__PURE__ */ e(C, { children: "You can run both providers at the same time. Each product picks its provider from its product type." })
48
- ] }),
49
- /* @__PURE__ */ r(S, { className: "flex flex-1 flex-col gap-4", children: [
50
- /* @__PURE__ */ r("div", { className: "space-y-3", children: [
51
- /* @__PURE__ */ e(
52
- y,
53
- {
54
- id: "stripe-enabled",
55
- label: "Stripe for Physical Products",
56
- description: "Use Stripe Checkout for physical merchandise and other shippable goods.",
57
- checked: h.stripe,
58
- disabled: !n,
59
- onCheckedChange: (l) => b((f) => ({
60
- ...f,
61
- stripe: l
62
- })),
63
- ready: n,
64
- children: n ? /* @__PURE__ */ r("div", { className: "mt-2 flex items-center gap-2 text-xs text-green-600", children: [
65
- /* @__PURE__ */ e(x, { className: "h-4 w-4" }),
66
- /* @__PURE__ */ e("span", { children: "Ready for physical product checkout" })
67
- ] }) : /* @__PURE__ */ e(
68
- v,
69
- {
70
- provider: "Stripe",
71
- missingKeys: i.stripe.missing,
72
- docsUrl: "https://dashboard.stripe.com/apikeys",
73
- docsLabel: "Stripe API keys"
74
- }
75
- )
76
- }
77
- ),
78
- /* @__PURE__ */ e(
79
- y,
80
- {
81
- id: "freemius-enabled",
82
- label: "Freemius for Digital Products",
83
- description: "Use Freemius for software licenses, SaaS plans, and other digital products.",
84
- checked: h.freemius,
85
- disabled: !p,
86
- onCheckedChange: (l) => b((f) => ({
87
- ...f,
88
- freemius: l
89
- })),
90
- ready: p,
91
- children: p ? /* @__PURE__ */ r("div", { className: "mt-2 flex items-center gap-2 text-xs text-green-600", children: [
92
- /* @__PURE__ */ e(x, { className: "h-4 w-4" }),
93
- /* @__PURE__ */ e("span", { children: "Ready for digital product checkout" })
94
- ] }) : /* @__PURE__ */ e(
95
- v,
96
- {
97
- provider: "Freemius",
98
- missingKeys: i.freemius.missing,
99
- docsUrl: "https://dashboard.freemius.com/",
100
- docsLabel: "Freemius credentials"
101
- }
102
- )
103
- }
104
- )
105
- ] }),
106
- /* @__PURE__ */ e("div", { className: "mt-auto flex justify-end border-t pt-4", children: /* @__PURE__ */ e(
107
- w,
108
- {
109
- type: "button",
110
- disabled: m,
111
- onClick: _,
112
- children: m ? "Saving..." : "Save Changes"
113
- }
114
- ) })
115
- ] })
116
- ] })
117
- ] })
118
- ] });
1
+ "use client";
2
+ import { useState as e, useTransition as t } from "react";
3
+ import { AlertCircle as n, CheckCircle2 as r } from "lucide-react";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
+ import { useRouter as o } from "next/navigation";
6
+ import { Button as s, Card as c, CardContent as l, CardDescription as u, CardHeader as d, CardTitle as f, Checkbox as p, Input as m, Label as h } from "@nextblock-cms/ui";
7
+ import { useFormStatus as g } from "react-dom";
8
+ //#region src/lib/pages/cms/payments/PaymentsClient.tsx
9
+ function _({ initialEnabledProviders: n, configStatus: p, credentials: m, saveAction: h, saveCredentialsAction: g }) {
10
+ let _ = o(), [v, y] = t(), C = p.stripe.hasKeys, w = p.freemius.hasKeys, [T, E] = e(() => ({
11
+ stripe: n.stripe && C,
12
+ freemius: n.freemius && w
13
+ }));
14
+ function D() {
15
+ let e = new FormData();
16
+ e.set("stripe_enabled", T.stripe ? "true" : "false"), e.set("freemius_enabled", T.freemius ? "true" : "false"), y(async () => {
17
+ await h(e), _.refresh();
18
+ });
19
+ }
20
+ return /* @__PURE__ */ a("div", {
21
+ className: "max-w-7xl space-y-4 p-4 sm:p-6",
22
+ children: [/* @__PURE__ */ a("div", {
23
+ className: "space-y-1",
24
+ children: [/* @__PURE__ */ i("h1", {
25
+ className: "text-2xl font-bold tracking-tight",
26
+ children: "Payment Settings"
27
+ }), /* @__PURE__ */ i("p", {
28
+ className: "text-sm text-muted-foreground",
29
+ children: "Enter your provider API keys, then enable the providers your store needs. Physical products use Stripe and digital products use Freemius."
30
+ })]
31
+ }), /* @__PURE__ */ a("div", {
32
+ className: "grid gap-4 lg:grid-cols-[minmax(0,3fr)_minmax(20rem,2fr)]",
33
+ children: [/* @__PURE__ */ i(b, {
34
+ credentials: m,
35
+ saveAction: g
36
+ }), /* @__PURE__ */ a(c, {
37
+ className: "flex h-full flex-col",
38
+ children: [/* @__PURE__ */ a(d, {
39
+ className: "pb-3",
40
+ children: [/* @__PURE__ */ i(f, { children: "Payment Providers" }), /* @__PURE__ */ i(u, { children: "You can run both providers at the same time. Each product picks its provider from its product type." })]
41
+ }), /* @__PURE__ */ a(l, {
42
+ className: "flex flex-1 flex-col gap-4",
43
+ children: [/* @__PURE__ */ a("div", {
44
+ className: "space-y-3",
45
+ children: [/* @__PURE__ */ i(x, {
46
+ id: "stripe-enabled",
47
+ label: "Stripe for Physical Products",
48
+ description: "Use Stripe Checkout for physical merchandise and other shippable goods.",
49
+ checked: T.stripe,
50
+ disabled: !C,
51
+ onCheckedChange: (e) => E((t) => ({
52
+ ...t,
53
+ stripe: e
54
+ })),
55
+ ready: C,
56
+ children: C ? /* @__PURE__ */ a("div", {
57
+ className: "mt-2 flex items-center gap-2 text-xs text-green-600",
58
+ children: [/* @__PURE__ */ i(r, { className: "h-4 w-4" }), /* @__PURE__ */ i("span", { children: "Ready for physical product checkout" })]
59
+ }) : /* @__PURE__ */ i(S, {
60
+ provider: "Stripe",
61
+ missingKeys: p.stripe.missing,
62
+ docsUrl: "https://dashboard.stripe.com/apikeys",
63
+ docsLabel: "Stripe API keys"
64
+ })
65
+ }), /* @__PURE__ */ i(x, {
66
+ id: "freemius-enabled",
67
+ label: "Freemius for Digital Products",
68
+ description: "Use Freemius for software licenses, SaaS plans, and other digital products.",
69
+ checked: T.freemius,
70
+ disabled: !w,
71
+ onCheckedChange: (e) => E((t) => ({
72
+ ...t,
73
+ freemius: e
74
+ })),
75
+ ready: w,
76
+ children: w ? /* @__PURE__ */ a("div", {
77
+ className: "mt-2 flex items-center gap-2 text-xs text-green-600",
78
+ children: [/* @__PURE__ */ i(r, { className: "h-4 w-4" }), /* @__PURE__ */ i("span", { children: "Ready for digital product checkout" })]
79
+ }) : /* @__PURE__ */ i(S, {
80
+ provider: "Freemius",
81
+ missingKeys: p.freemius.missing,
82
+ docsUrl: "https://dashboard.freemius.com/",
83
+ docsLabel: "Freemius credentials"
84
+ })
85
+ })]
86
+ }), /* @__PURE__ */ i("div", {
87
+ className: "mt-auto flex justify-end border-t pt-4",
88
+ children: /* @__PURE__ */ i(s, {
89
+ type: "button",
90
+ disabled: v,
91
+ onClick: D,
92
+ children: v ? "Saving..." : "Save Changes"
93
+ })
94
+ })]
95
+ })]
96
+ })]
97
+ })]
98
+ });
119
99
  }
120
- function L() {
121
- const { pending: s } = R();
122
- return /* @__PURE__ */ e(w, { type: "submit", disabled: s, children: s ? "Saving..." : "Save Changes" });
100
+ function v() {
101
+ let { pending: e } = g();
102
+ return /* @__PURE__ */ i(s, {
103
+ type: "submit",
104
+ disabled: e,
105
+ children: e ? "Saving..." : "Save Changes"
106
+ });
123
107
  }
124
- function d({
125
- id: s,
126
- label: i,
127
- type: t = "text",
128
- defaultValue: a,
129
- placeholder: c,
130
- hint: o
131
- }) {
132
- return /* @__PURE__ */ r("div", { className: "space-y-1", children: [
133
- /* @__PURE__ */ e(P, { htmlFor: s, className: "text-xs", children: i }),
134
- /* @__PURE__ */ e(
135
- D,
136
- {
137
- id: s,
138
- name: s,
139
- type: t,
140
- defaultValue: a,
141
- placeholder: c,
142
- autoComplete: t === "password" ? "new-password" : "off"
143
- }
144
- ),
145
- o && /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: o })
146
- ] });
108
+ function y({ id: e, label: t, type: n = "text", defaultValue: r, placeholder: o, hint: s }) {
109
+ return /* @__PURE__ */ a("div", {
110
+ className: "space-y-1",
111
+ children: [
112
+ /* @__PURE__ */ i(h, {
113
+ htmlFor: e,
114
+ className: "text-xs",
115
+ children: t
116
+ }),
117
+ /* @__PURE__ */ i(m, {
118
+ id: e,
119
+ name: e,
120
+ type: n,
121
+ defaultValue: r,
122
+ placeholder: o,
123
+ autoComplete: n === "password" ? "new-password" : "off"
124
+ }),
125
+ s && /* @__PURE__ */ i("p", {
126
+ className: "text-xs text-muted-foreground",
127
+ children: s
128
+ })
129
+ ]
130
+ });
147
131
  }
148
- function B({
149
- credentials: s,
150
- saveAction: i
151
- }) {
152
- const t = "•••••••• (stored — leave blank to keep)";
153
- return /* @__PURE__ */ r(g, { className: "flex h-full flex-col", children: [
154
- /* @__PURE__ */ r(N, { className: "pb-3", children: [
155
- /* @__PURE__ */ e(k, { children: "Provider API Keys" }),
156
- /* @__PURE__ */ r(C, { children: [
157
- "Keys are encrypted at rest and used DB-first (these override any",
158
- " ",
159
- /* @__PURE__ */ e("code", { children: ".env" }),
160
- " values). Leave a secret blank to keep the stored value."
161
- ] })
162
- ] }),
163
- /* @__PURE__ */ e(S, { className: "flex flex-1 flex-col", children: /* @__PURE__ */ r("form", { action: i, className: "flex flex-1 flex-col gap-4", children: [
164
- /* @__PURE__ */ r("div", { className: "space-y-3", children: [
165
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Stripe (physical products)" }),
166
- /* @__PURE__ */ r("details", { className: "rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground", children: [
167
- /* @__PURE__ */ e("summary", { className: "cursor-pointer font-medium text-foreground", children: "Stripe webhook setup" }),
168
- /* @__PURE__ */ r("div", { className: "mt-2 space-y-1.5", children: [
169
- /* @__PURE__ */ r("p", { children: [
170
- "In Stripe, add",
171
- " ",
172
- /* @__PURE__ */ e("code", { children: "https://your-domain/api/webhooks/stripe" }),
173
- " as a webhook endpoint and paste its ",
174
- /* @__PURE__ */ e("code", { children: "whsec_…" }),
175
- " signing secret below."
176
- ] }),
177
- /* @__PURE__ */ r("p", { children: [
178
- "Locally, run",
179
- " ",
180
- /* @__PURE__ */ e("code", { children: "stripe listen --forward-to localhost:4200/api/webhooks/stripe" }),
181
- " ",
182
- "or ",
183
- /* @__PURE__ */ e("code", { children: "npm run stripe" }),
184
- "."
185
- ] })
186
- ] })
187
- ] }),
188
- /* @__PURE__ */ r("div", { className: "grid gap-3 sm:grid-cols-3", children: [
189
- /* @__PURE__ */ e(
190
- d,
191
- {
192
- id: "stripe_publishableKey",
193
- label: "Publishable key",
194
- defaultValue: s.stripe.publishableKey,
195
- placeholder: "pk_live_…"
196
- }
197
- ),
198
- /* @__PURE__ */ e(
199
- d,
200
- {
201
- id: "stripe_secretKey",
202
- label: "Secret key",
203
- type: "password",
204
- placeholder: s.stripe.hasSecretKey ? t : "sk_live_…"
205
- }
206
- ),
207
- /* @__PURE__ */ e(
208
- d,
209
- {
210
- id: "stripe_webhookSecret",
211
- label: "Webhook signing secret",
212
- type: "password",
213
- placeholder: s.stripe.hasWebhookSecret ? t : "whsec_…"
214
- }
215
- )
216
- ] })
217
- ] }),
218
- /* @__PURE__ */ r("div", { className: "space-y-3", children: [
219
- /* @__PURE__ */ e("h3", { className: "text-sm font-semibold", children: "Freemius (digital products)" }),
220
- /* @__PURE__ */ r("div", { className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3", children: [
221
- /* @__PURE__ */ e(
222
- d,
223
- {
224
- id: "freemius_developerId",
225
- label: "Developer ID",
226
- defaultValue: s.freemius.developerId
227
- }
228
- ),
229
- /* @__PURE__ */ e(
230
- d,
231
- {
232
- id: "freemius_productId",
233
- label: "Product ID",
234
- defaultValue: s.freemius.productId
235
- }
236
- ),
237
- /* @__PURE__ */ e(
238
- d,
239
- {
240
- id: "freemius_publicKey",
241
- label: "Public key",
242
- defaultValue: s.freemius.publicKey,
243
- placeholder: "pk_…"
244
- }
245
- ),
246
- /* @__PURE__ */ e(
247
- d,
248
- {
249
- id: "freemius_secretKey",
250
- label: "Secret key",
251
- type: "password",
252
- placeholder: s.freemius.hasSecretKey ? t : "sk_…"
253
- }
254
- ),
255
- /* @__PURE__ */ e(
256
- d,
257
- {
258
- id: "freemius_apiKey",
259
- label: "API key",
260
- type: "password",
261
- placeholder: s.freemius.hasApiKey ? t : "API key"
262
- }
263
- )
264
- ] })
265
- ] }),
266
- s.envFallbackActive && /* @__PURE__ */ e("p", { className: "text-xs text-amber-700", children: "Stripe keys are currently read from environment variables. Saving here moves them into the database and takes precedence." }),
267
- /* @__PURE__ */ e("div", { className: "mt-auto flex justify-end border-t pt-4", children: /* @__PURE__ */ e(L, {}) })
268
- ] }) })
269
- ] });
132
+ function b({ credentials: e, saveAction: t }) {
133
+ let n = "•••••••• (stored — leave blank to keep)";
134
+ return /* @__PURE__ */ a(c, {
135
+ className: "flex h-full flex-col",
136
+ children: [/* @__PURE__ */ a(d, {
137
+ className: "pb-3",
138
+ children: [/* @__PURE__ */ i(f, { children: "Provider API Keys" }), /* @__PURE__ */ a(u, { children: [
139
+ "Keys are encrypted at rest and used DB-first (these override any",
140
+ " ",
141
+ /* @__PURE__ */ i("code", { children: ".env" }),
142
+ " values). Leave a secret blank to keep the stored value."
143
+ ] })]
144
+ }), /* @__PURE__ */ i(l, {
145
+ className: "flex flex-1 flex-col",
146
+ children: /* @__PURE__ */ a("form", {
147
+ action: t,
148
+ className: "flex flex-1 flex-col gap-4",
149
+ children: [
150
+ /* @__PURE__ */ a("div", {
151
+ className: "space-y-3",
152
+ children: [
153
+ /* @__PURE__ */ i("h3", {
154
+ className: "text-sm font-semibold",
155
+ children: "Stripe (physical products)"
156
+ }),
157
+ /* @__PURE__ */ a("details", {
158
+ className: "rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground",
159
+ children: [/* @__PURE__ */ i("summary", {
160
+ className: "cursor-pointer font-medium text-foreground",
161
+ children: "Stripe webhook setup"
162
+ }), /* @__PURE__ */ a("div", {
163
+ className: "mt-2 space-y-1.5",
164
+ children: [/* @__PURE__ */ a("p", { children: [
165
+ "In Stripe, add",
166
+ " ",
167
+ /* @__PURE__ */ i("code", { children: "https://your-domain/api/webhooks/stripe" }),
168
+ " as a webhook endpoint and paste its ",
169
+ /* @__PURE__ */ i("code", { children: "whsec_…" }),
170
+ " signing secret below."
171
+ ] }), /* @__PURE__ */ a("p", { children: [
172
+ "Locally, run",
173
+ " ",
174
+ /* @__PURE__ */ i("code", { children: "stripe listen --forward-to localhost:4200/api/webhooks/stripe" }),
175
+ " ",
176
+ "or ",
177
+ /* @__PURE__ */ i("code", { children: "npm run stripe" }),
178
+ "."
179
+ ] })]
180
+ })]
181
+ }),
182
+ /* @__PURE__ */ a("div", {
183
+ className: "grid gap-3 sm:grid-cols-3",
184
+ children: [
185
+ /* @__PURE__ */ i(y, {
186
+ id: "stripe_publishableKey",
187
+ label: "Publishable key",
188
+ defaultValue: e.stripe.publishableKey,
189
+ placeholder: "pk_live_…"
190
+ }),
191
+ /* @__PURE__ */ i(y, {
192
+ id: "stripe_secretKey",
193
+ label: "Secret key",
194
+ type: "password",
195
+ placeholder: e.stripe.hasSecretKey ? n : "sk_live_…"
196
+ }),
197
+ /* @__PURE__ */ i(y, {
198
+ id: "stripe_webhookSecret",
199
+ label: "Webhook signing secret",
200
+ type: "password",
201
+ placeholder: e.stripe.hasWebhookSecret ? n : "whsec_…"
202
+ })
203
+ ]
204
+ })
205
+ ]
206
+ }),
207
+ /* @__PURE__ */ a("div", {
208
+ className: "space-y-3",
209
+ children: [/* @__PURE__ */ i("h3", {
210
+ className: "text-sm font-semibold",
211
+ children: "Freemius (digital products)"
212
+ }), /* @__PURE__ */ a("div", {
213
+ className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
214
+ children: [
215
+ /* @__PURE__ */ i(y, {
216
+ id: "freemius_developerId",
217
+ label: "Developer ID",
218
+ defaultValue: e.freemius.developerId
219
+ }),
220
+ /* @__PURE__ */ i(y, {
221
+ id: "freemius_productId",
222
+ label: "Product ID",
223
+ defaultValue: e.freemius.productId
224
+ }),
225
+ /* @__PURE__ */ i(y, {
226
+ id: "freemius_publicKey",
227
+ label: "Public key",
228
+ defaultValue: e.freemius.publicKey,
229
+ placeholder: "pk_…"
230
+ }),
231
+ /* @__PURE__ */ i(y, {
232
+ id: "freemius_secretKey",
233
+ label: "Secret key",
234
+ type: "password",
235
+ placeholder: e.freemius.hasSecretKey ? n : "sk_…"
236
+ }),
237
+ /* @__PURE__ */ i(y, {
238
+ id: "freemius_apiKey",
239
+ label: "API key",
240
+ type: "password",
241
+ placeholder: e.freemius.hasApiKey ? n : "API key"
242
+ })
243
+ ]
244
+ })]
245
+ }),
246
+ e.envFallbackActive && /* @__PURE__ */ i("p", {
247
+ className: "text-xs text-amber-700",
248
+ children: "Stripe keys are currently read from environment variables. Saving here moves them into the database and takes precedence."
249
+ }),
250
+ /* @__PURE__ */ i("div", {
251
+ className: "mt-auto flex justify-end border-t pt-4",
252
+ children: /* @__PURE__ */ i(v, {})
253
+ })
254
+ ]
255
+ })
256
+ })]
257
+ });
270
258
  }
271
- function y({
272
- id: s,
273
- label: i,
274
- description: t,
275
- checked: a,
276
- disabled: c,
277
- ready: o,
278
- onCheckedChange: m,
279
- children: u
280
- }) {
281
- return /* @__PURE__ */ e("div", { className: "rounded-md border p-3", children: /* @__PURE__ */ r("div", { className: "flex items-start gap-3", children: [
282
- /* @__PURE__ */ e(
283
- A,
284
- {
285
- id: s,
286
- checked: a,
287
- disabled: c,
288
- onCheckedChange: (n) => m(!!n),
289
- className: "mt-1"
290
- }
291
- ),
292
- /* @__PURE__ */ r("div", { className: "grid gap-1.5 leading-none w-full", children: [
293
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 flex-wrap", children: [
294
- /* @__PURE__ */ e(
295
- P,
296
- {
297
- htmlFor: s,
298
- className: "font-semibold text-base cursor-pointer",
299
- children: i
300
- }
301
- ),
302
- /* @__PURE__ */ e(
303
- "span",
304
- {
305
- className: `text-xs font-medium ${a ? "text-foreground" : "text-muted-foreground"}`,
306
- children: a ? "Enabled" : "Disabled"
307
- }
308
- )
309
- ] }),
310
- /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: t }),
311
- !o && /* @__PURE__ */ e("p", { className: "text-xs text-amber-700", children: "Add all required credentials before enabling this provider." }),
312
- u
313
- ] })
314
- ] }) });
259
+ function x({ id: e, label: t, description: n, checked: r, disabled: o, ready: s, onCheckedChange: c, children: l }) {
260
+ return /* @__PURE__ */ i("div", {
261
+ className: "rounded-md border p-3",
262
+ children: /* @__PURE__ */ a("div", {
263
+ className: "flex items-start gap-3",
264
+ children: [/* @__PURE__ */ i(p, {
265
+ id: e,
266
+ checked: r,
267
+ disabled: o,
268
+ onCheckedChange: (e) => c(!!e),
269
+ className: "mt-1"
270
+ }), /* @__PURE__ */ a("div", {
271
+ className: "grid gap-1.5 leading-none w-full",
272
+ children: [
273
+ /* @__PURE__ */ a("div", {
274
+ className: "flex items-center justify-between gap-3 flex-wrap",
275
+ children: [/* @__PURE__ */ i(h, {
276
+ htmlFor: e,
277
+ className: "font-semibold text-base cursor-pointer",
278
+ children: t
279
+ }), /* @__PURE__ */ i("span", {
280
+ className: `text-xs font-medium ${r ? "text-foreground" : "text-muted-foreground"}`,
281
+ children: r ? "Enabled" : "Disabled"
282
+ })]
283
+ }),
284
+ /* @__PURE__ */ i("p", {
285
+ className: "text-sm text-muted-foreground",
286
+ children: n
287
+ }),
288
+ !s && /* @__PURE__ */ i("p", {
289
+ className: "text-xs text-amber-700",
290
+ children: "Add all required credentials before enabling this provider."
291
+ }),
292
+ l
293
+ ]
294
+ })]
295
+ })
296
+ });
315
297
  }
316
- function v({
317
- provider: s,
318
- missingKeys: i,
319
- docsUrl: t,
320
- docsLabel: a
321
- }) {
322
- return /* @__PURE__ */ r("div", { className: "mt-2 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-xs text-foreground", children: [
323
- /* @__PURE__ */ r("div", { className: "mb-1.5 flex items-center gap-2 font-semibold text-destructive", children: [
324
- /* @__PURE__ */ e(j, { className: "h-4 w-4" }),
325
- /* @__PURE__ */ e("span", { children: "Configuration Required" })
326
- ] }),
327
- /* @__PURE__ */ r("p", { children: [
328
- s,
329
- " needs ",
330
- /* @__PURE__ */ e("strong", { children: i.join(", ") }),
331
- ". Add them in Provider API Keys, save, then enable the provider.",
332
- " ",
333
- /* @__PURE__ */ r(
334
- "a",
335
- {
336
- href: t,
337
- target: "_blank",
338
- rel: "noopener noreferrer",
339
- className: "font-medium underline hover:text-destructive/80",
340
- children: [
341
- "Open ",
342
- a
343
- ]
344
- }
345
- ),
346
- "."
347
- ] })
348
- ] });
298
+ function S({ provider: e, missingKeys: t, docsUrl: r, docsLabel: o }) {
299
+ return /* @__PURE__ */ a("div", {
300
+ className: "mt-2 rounded-md border border-destructive/20 bg-destructive/5 p-3 text-xs text-foreground",
301
+ children: [/* @__PURE__ */ a("div", {
302
+ className: "mb-1.5 flex items-center gap-2 font-semibold text-destructive",
303
+ children: [/* @__PURE__ */ i(n, { className: "h-4 w-4" }), /* @__PURE__ */ i("span", { children: "Configuration Required" })]
304
+ }), /* @__PURE__ */ a("p", { children: [
305
+ e,
306
+ " needs ",
307
+ /* @__PURE__ */ i("strong", { children: t.join(", ") }),
308
+ ". Add them in Provider API Keys, save, then enable the provider.",
309
+ " ",
310
+ /* @__PURE__ */ a("a", {
311
+ href: r,
312
+ target: "_blank",
313
+ rel: "noopener noreferrer",
314
+ className: "font-medium underline hover:text-destructive/80",
315
+ children: ["Open ", o]
316
+ }),
317
+ "."
318
+ ] })]
319
+ });
349
320
  }
350
- export {
351
- G as PaymentsClient
352
- };
321
+ //#endregion
322
+ export { _ as PaymentsClient };