@nextblock-cms/ecom 0.20.1 → 0.21.0

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 (317) hide show
  1. package/_virtual/_rolldown/runtime.cjs.js +1 -0
  2. package/index.cjs.js +1 -1
  3. package/index.es.js +38 -146
  4. package/lib/CurrencyProvider.cjs.js +1 -1
  5. package/lib/CurrencyProvider.d.ts +1 -1
  6. package/lib/CurrencyProvider.es.js +85 -95
  7. package/lib/PaymentReadinessProvider.cjs.js +1 -1
  8. package/lib/PaymentReadinessProvider.d.ts +1 -1
  9. package/lib/PaymentReadinessProvider.es.js +24 -27
  10. package/lib/cart-store.cjs.js +1 -1
  11. package/lib/cart-store.es.js +109 -121
  12. package/lib/components/AccountNavigationMenu.cjs.js +1 -1
  13. package/lib/components/AccountNavigationMenu.d.ts +1 -1
  14. package/lib/components/AccountNavigationMenu.es.js +36 -50
  15. package/lib/components/AddToCartButton.cjs.js +1 -1
  16. package/lib/components/AddToCartButton.d.ts +1 -1
  17. package/lib/components/AddToCartButton.es.js +94 -89
  18. package/lib/components/Cart.cjs.js +1 -1
  19. package/lib/components/Cart.d.ts +1 -1
  20. package/lib/components/Cart.es.js +261 -180
  21. package/lib/components/CartDrawer.cjs.js +1 -1
  22. package/lib/components/CartDrawer.d.ts +1 -1
  23. package/lib/components/CartDrawer.es.js +218 -148
  24. package/lib/components/CartIcon.cjs.js +1 -1
  25. package/lib/components/CartIcon.d.ts +1 -1
  26. package/lib/components/CartIcon.es.js +33 -35
  27. package/lib/components/Checkout.cjs.js +1 -1
  28. package/lib/components/Checkout.d.ts +1 -1
  29. package/lib/components/Checkout.es.js +1092 -1108
  30. package/lib/components/CouponForm.cjs.js +1 -1
  31. package/lib/components/CouponForm.d.ts +1 -1
  32. package/lib/components/CouponForm.es.js +136 -148
  33. package/lib/components/CurrencySwitcher.cjs.js +1 -1
  34. package/lib/components/CurrencySwitcher.d.ts +1 -1
  35. package/lib/components/CurrencySwitcher.es.js +22 -18
  36. package/lib/components/CustomerProfileForm.cjs.js +1 -1
  37. package/lib/components/CustomerProfileForm.es.js +454 -313
  38. package/lib/components/FeaturedProduct.cjs.js +1 -1
  39. package/lib/components/FeaturedProduct.d.ts +1 -1
  40. package/lib/components/FeaturedProduct.es.js +98 -83
  41. package/lib/components/FreemiusLicensePanel.cjs.js +1 -1
  42. package/lib/components/FreemiusLicensePanel.d.ts +1 -1
  43. package/lib/components/FreemiusLicensePanel.es.js +70 -65
  44. package/lib/components/InvoiceDocument.cjs.js +1 -1
  45. package/lib/components/InvoiceDocument.es.js +256 -192
  46. package/lib/components/InvoiceViewerShell.cjs.js +2 -2
  47. package/lib/components/InvoiceViewerShell.d.ts +1 -1
  48. package/lib/components/InvoiceViewerShell.es.js +75 -106
  49. package/lib/components/ProductCard.cjs.js +1 -1
  50. package/lib/components/ProductCard.d.ts +1 -1
  51. package/lib/components/ProductCard.es.js +186 -171
  52. package/lib/components/ProductDetailsLayout.cjs.js +1 -1
  53. package/lib/components/ProductDetailsLayout.es.js +405 -404
  54. package/lib/components/ProductGallery.cjs.js +1 -1
  55. package/lib/components/ProductGallery.d.ts +1 -1
  56. package/lib/components/ProductGallery.es.js +51 -54
  57. package/lib/components/ProductGrid.cjs.js +1 -1
  58. package/lib/components/ProductGrid.d.ts +1 -1
  59. package/lib/components/ProductGrid.es.js +23 -25
  60. package/lib/components/ShippingEstimator.cjs.js +1 -1
  61. package/lib/components/ShippingEstimator.d.ts +1 -1
  62. package/lib/components/ShippingEstimator.es.js +158 -153
  63. package/lib/components/ShortDescription.cjs.js +1 -1
  64. package/lib/components/ShortDescription.es.js +17 -17
  65. package/lib/components/SimpleTiptapRenderer.cjs.js +1 -1
  66. package/lib/components/SimpleTiptapRenderer.es.js +238 -211
  67. package/lib/components/SubscriptionSelector.cjs.js +1 -1
  68. package/lib/components/SubscriptionSelector.es.js +159 -154
  69. package/lib/countries.cjs.js +1 -1
  70. package/lib/countries.es.js +232 -75
  71. package/lib/coupon-server.cjs.js +1 -1
  72. package/lib/coupon-server.es.js +180 -224
  73. package/lib/coupons.cjs.js +1 -1
  74. package/lib/coupons.es.js +12 -14
  75. package/lib/currency-constants.cjs.js +1 -1
  76. package/lib/currency-constants.es.js +4 -4
  77. package/lib/currency-rest-client.cjs.js +1 -1
  78. package/lib/currency-rest-client.es.js +15 -22
  79. package/lib/currency-store.cjs.js +1 -1
  80. package/lib/currency-store.es.js +20 -27
  81. package/lib/currency-sync.cjs.js +1 -1
  82. package/lib/currency-sync.es.js +124 -170
  83. package/lib/currency.cjs.js +1 -1
  84. package/lib/currency.es.js +242 -310
  85. package/lib/customer-addresses.cjs.js +1 -1
  86. package/lib/customer-addresses.es.js +80 -109
  87. package/lib/customer-orders.cjs.js +1 -1
  88. package/lib/customer-orders.es.js +31 -43
  89. package/lib/customer.cjs.js +1 -1
  90. package/lib/customer.es.js +43 -52
  91. package/lib/export-helpers.cjs.js +1 -1
  92. package/lib/export-helpers.es.js +53 -52
  93. package/lib/factory.cjs.js +1 -1
  94. package/lib/factory.es.js +10 -7
  95. package/lib/freemius-coupons.cjs.js +1 -1
  96. package/lib/freemius-coupons.es.js +245 -262
  97. package/lib/freemius-license-claim.cjs.js +1 -1
  98. package/lib/freemius-license-claim.es.js +87 -71
  99. package/lib/freemius-license.cjs.js +1 -1
  100. package/lib/freemius-license.es.js +32 -39
  101. package/lib/freemius-order-sync.cjs.js +1 -1
  102. package/lib/freemius-order-sync.es.js +226 -290
  103. package/lib/freemius-trial-provision.cjs.js +1 -1
  104. package/lib/freemius-trial-provision.es.js +136 -130
  105. package/lib/inventory-settings.cjs.js +1 -1
  106. package/lib/inventory-settings.es.js +69 -77
  107. package/lib/invoice-server.cjs.js +3 -3
  108. package/lib/invoice-server.es.js +94 -141
  109. package/lib/invoice-ui.cjs.js +1 -1
  110. package/lib/invoice-ui.es.js +50 -66
  111. package/lib/invoice.cjs.js +1 -1
  112. package/lib/invoice.es.js +85 -94
  113. package/lib/order-inventory.cjs.js +25 -25
  114. package/lib/order-inventory.es.js +67 -79
  115. package/lib/order-tax-details.cjs.js +1 -1
  116. package/lib/order-tax-details.es.js +142 -153
  117. package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -1
  118. package/lib/pages/cms/coupons/CouponEditorForm.d.ts +1 -1
  119. package/lib/pages/cms/coupons/CouponEditorForm.es.js +227 -185
  120. package/lib/pages/cms/coupons/CouponsPage.cjs.js +2 -2
  121. package/lib/pages/cms/coupons/CouponsPage.d.ts +1 -1
  122. package/lib/pages/cms/coupons/CouponsPage.es.js +235 -166
  123. package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +1 -1
  124. package/lib/pages/cms/coupons/CreateCouponDialog.d.ts +1 -1
  125. package/lib/pages/cms/coupons/CreateCouponDialog.es.js +35 -34
  126. package/lib/pages/cms/coupons/EditCouponPage.cjs.js +1 -1
  127. package/lib/pages/cms/coupons/EditCouponPage.d.ts +1 -1
  128. package/lib/pages/cms/coupons/EditCouponPage.es.js +47 -47
  129. package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +1 -1
  130. package/lib/pages/cms/coupons/ProductScopePicker.d.ts +1 -1
  131. package/lib/pages/cms/coupons/ProductScopePicker.es.js +128 -117
  132. package/lib/pages/cms/coupons/actions.cjs.js +1 -1
  133. package/lib/pages/cms/coupons/actions.es.js +112 -115
  134. package/lib/pages/cms/coupons/index.cjs.js +1 -0
  135. package/lib/pages/cms/coupons/index.es.js +3 -0
  136. package/lib/pages/cms/coupons/product-options.cjs.js +1 -1
  137. package/lib/pages/cms/coupons/product-options.es.js +21 -23
  138. package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -1
  139. package/lib/pages/cms/orders/ExportReportsDialog.es.js +135 -129
  140. package/lib/pages/cms/orders/MarkPaidButton.d.ts +1 -1
  141. package/lib/pages/cms/orders/OrderDetailPage.cjs.js +1 -1
  142. package/lib/pages/cms/orders/OrderDetailPage.d.ts +1 -1
  143. package/lib/pages/cms/orders/OrderDetailPage.es.js +186 -134
  144. package/lib/pages/cms/orders/OrderPrintButton.cjs.js +1 -1
  145. package/lib/pages/cms/orders/OrderPrintButton.d.ts +1 -1
  146. package/lib/pages/cms/orders/OrderPrintButton.es.js +15 -21
  147. package/lib/pages/cms/orders/OrderStatusForm.cjs.js +1 -1
  148. package/lib/pages/cms/orders/OrderStatusForm.d.ts +1 -1
  149. package/lib/pages/cms/orders/OrderStatusForm.es.js +85 -69
  150. package/lib/pages/cms/orders/OrdersPage.cjs.js +1 -1
  151. package/lib/pages/cms/orders/OrdersPage.d.ts +1 -1
  152. package/lib/pages/cms/orders/OrdersPage.es.js +170 -102
  153. package/lib/pages/cms/orders/actions.cjs.js +3 -3
  154. package/lib/pages/cms/orders/actions.es.js +53 -69
  155. package/lib/pages/cms/orders/export-actions.cjs.js +1 -1
  156. package/lib/pages/cms/orders/export-actions.es.js +23 -26
  157. package/lib/pages/cms/orders/index.cjs.js +1 -0
  158. package/lib/pages/cms/orders/index.es.js +6 -0
  159. package/lib/pages/cms/orders/server-actions.cjs.js +1 -1
  160. package/lib/pages/cms/orders/server-actions.es.js +60 -51
  161. package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -1
  162. package/lib/pages/cms/payments/PaymentsClient.d.ts +1 -1
  163. package/lib/pages/cms/payments/PaymentsClient.es.js +316 -346
  164. package/lib/pages/cms/payments/PaymentsPage.cjs.js +1 -1
  165. package/lib/pages/cms/payments/PaymentsPage.d.ts +1 -1
  166. package/lib/pages/cms/payments/PaymentsPage.es.js +29 -32
  167. package/lib/pages/cms/payments/actions.cjs.js +1 -1
  168. package/lib/pages/cms/payments/actions.es.js +38 -48
  169. package/lib/pages/cms/payments/index.cjs.js +1 -0
  170. package/lib/pages/cms/payments/index.es.js +3 -0
  171. package/lib/pages/cms/payments/queries.cjs.js +1 -1
  172. package/lib/pages/cms/payments/queries.es.js +38 -48
  173. package/lib/pages/cms/products/ProductsPage.cjs.js +1 -1
  174. package/lib/pages/cms/products/ProductsPage.d.ts +1 -1
  175. package/lib/pages/cms/products/ProductsPage.es.js +63 -66
  176. package/lib/pages/cms/products/[id]/edit/EditProductPage.d.ts +1 -1
  177. package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -1
  178. package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +138 -155
  179. package/lib/pages/cms/products/actions.cjs.js +4 -4
  180. package/lib/pages/cms/products/actions.es.js +121 -162
  181. package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -1
  182. package/lib/pages/cms/products/attributes/AttributeManagementPage.d.ts +1 -1
  183. package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +55 -47
  184. package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +1 -1
  185. package/lib/pages/cms/products/attributes/components/AttributeManager.d.ts +1 -1
  186. package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +285 -290
  187. package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +1 -1
  188. package/lib/pages/cms/products/categories/CategoryManagementPage.d.ts +1 -1
  189. package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +43 -35
  190. package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +1 -1
  191. package/lib/pages/cms/products/categories/components/CategoryManager.es.js +315 -262
  192. package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -1
  193. package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +115 -113
  194. package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -1
  195. package/lib/pages/cms/products/components/CurrencyPriceFields.d.ts +1 -1
  196. package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +136 -145
  197. package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +1 -1
  198. package/lib/pages/cms/products/components/DeleteProductButton.d.ts +1 -1
  199. package/lib/pages/cms/products/components/DeleteProductButton.es.js +35 -47
  200. package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +1 -1
  201. package/lib/pages/cms/products/components/FreemiusPricingDashboard.d.ts +1 -1
  202. package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +106 -84
  203. package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +1 -1
  204. package/lib/pages/cms/products/components/ProductCategorySelector.es.js +156 -159
  205. package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -1
  206. package/lib/pages/cms/products/components/ProductForm.es.js +872 -693
  207. package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -1
  208. package/lib/pages/cms/products/components/ProductMediaManager.es.js +106 -103
  209. package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -1
  210. package/lib/pages/cms/products/components/ProductsBulkTable.d.ts +1 -1
  211. package/lib/pages/cms/products/components/ProductsBulkTable.es.js +303 -294
  212. package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +1 -1
  213. package/lib/pages/cms/products/components/SaleScheduleFields.d.ts +1 -1
  214. package/lib/pages/cms/products/components/SaleScheduleFields.es.js +111 -134
  215. package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +1 -1
  216. package/lib/pages/cms/products/components/SyncFreemiusButton.d.ts +1 -1
  217. package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +29 -35
  218. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +2 -2
  219. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.d.ts +1 -1
  220. package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +36 -48
  221. package/lib/pages/cms/products/components/SyncProductForm.d.ts +1 -1
  222. package/lib/pages/cms/products/components/VariationsEditor.cjs.js +1 -1
  223. package/lib/pages/cms/products/components/VariationsEditor.d.ts +1 -1
  224. package/lib/pages/cms/products/components/VariationsEditor.es.js +396 -405
  225. package/lib/pages/cms/products/index.cjs.js +1 -0
  226. package/lib/pages/cms/products/index.es.js +8 -0
  227. package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -1
  228. package/lib/pages/cms/products/inventory/InventoryPage.d.ts +1 -1
  229. package/lib/pages/cms/products/inventory/InventoryPage.es.js +21 -15
  230. package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +2 -2
  231. package/lib/pages/cms/products/inventory/InventoryTableClient.d.ts +1 -1
  232. package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +230 -209
  233. package/lib/pages/cms/products/inventory/actions.cjs.js +3 -3
  234. package/lib/pages/cms/products/inventory/actions.es.js +83 -91
  235. package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -1
  236. package/lib/pages/cms/products/new/NewProductPage.d.ts +1 -1
  237. package/lib/pages/cms/products/new/NewProductPage.es.js +58 -74
  238. package/lib/pages/cms/products/product-price-sync.cjs.js +1 -1
  239. package/lib/pages/cms/products/product-price-sync.es.js +74 -89
  240. package/lib/pages/cms/products/server-actions.cjs.js +1 -1
  241. package/lib/pages/cms/products/server-actions.es.js +250 -233
  242. package/lib/pages/cms/shipping/ShippingPage.cjs.js +2 -2
  243. package/lib/pages/cms/shipping/ShippingPage.es.js +287 -209
  244. package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -1
  245. package/lib/pages/cms/shipping/components/RateForm.d.ts +1 -1
  246. package/lib/pages/cms/shipping/components/RateForm.es.js +439 -436
  247. package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +1 -1
  248. package/lib/pages/cms/shipping/components/ZoneForm.es.js +245 -224
  249. package/lib/pages/cms/shipping/index.cjs.js +1 -0
  250. package/lib/pages/cms/shipping/index.es.js +3 -0
  251. package/lib/pages/cms/shipping/server-actions.cjs.js +1 -1
  252. package/lib/pages/cms/shipping/server-actions.es.js +131 -149
  253. package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -1
  254. package/lib/pages/cms/taxes/TaxesPage.d.ts +1 -1
  255. package/lib/pages/cms/taxes/TaxesPage.es.js +211 -169
  256. package/lib/pages/cms/taxes/actions.cjs.js +1 -1
  257. package/lib/pages/cms/taxes/actions.es.js +41 -53
  258. package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -1
  259. package/lib/pages/cms/taxes/components/TaxRateForm.d.ts +1 -1
  260. package/lib/pages/cms/taxes/components/TaxRateForm.es.js +112 -99
  261. package/lib/pages/cms/taxes/index.cjs.js +1 -0
  262. package/lib/pages/cms/taxes/index.es.js +3 -0
  263. package/lib/payment-config.cjs.js +1 -1
  264. package/lib/payment-config.es.js +110 -126
  265. package/lib/product-actions.cjs.js +4 -4
  266. package/lib/product-actions.es.js +289 -544
  267. package/lib/product-context.cjs.js +1 -1
  268. package/lib/product-context.es.js +13 -15
  269. package/lib/product-schema.cjs.js +1 -1
  270. package/lib/product-schema.es.js +99 -134
  271. package/lib/providers/freemius.cjs.js +1 -5
  272. package/lib/providers/freemius.es.js +446 -530
  273. package/lib/providers/stripe.cjs.js +1 -1
  274. package/lib/providers/stripe.es.js +417 -477
  275. package/lib/server-actions/coupon-actions.cjs.js +1 -1
  276. package/lib/server-actions/coupon-actions.es.js +22 -22
  277. package/lib/server-actions/customer-actions.cjs.js +1 -1
  278. package/lib/server-actions/customer-actions.es.js +26 -28
  279. package/lib/server-actions/product-actions.cjs.js +1 -1
  280. package/lib/server-actions/product-actions.es.js +9 -15
  281. package/lib/server-actions/shipping-actions.cjs.js +1 -1
  282. package/lib/server-actions/shipping-actions.es.js +27 -24
  283. package/lib/server-actions/tax-actions.cjs.js +1 -1
  284. package/lib/server-actions/tax-actions.es.js +33 -39
  285. package/lib/shared-inventory.cjs.js +2 -2
  286. package/lib/shared-inventory.es.js +111 -160
  287. package/lib/shipping/resolver.cjs.js +2 -2
  288. package/lib/shipping/resolver.es.js +44 -61
  289. package/lib/shipping-rate-currency.cjs.js +1 -1
  290. package/lib/shipping-rate-currency.es.js +52 -67
  291. package/lib/states.cjs.js +1 -1
  292. package/lib/states.es.js +333 -154
  293. package/lib/stripe/checkout.cjs.js +1 -1
  294. package/lib/stripe/checkout.es.js +125 -181
  295. package/lib/stripe/client.cjs.js +1 -1
  296. package/lib/stripe/client.es.js +14 -19
  297. package/lib/stripe/order-sync.cjs.js +1 -1
  298. package/lib/stripe/order-sync.es.js +106 -126
  299. package/lib/stripe/webhooks.cjs.js +1 -1
  300. package/lib/stripe/webhooks.es.js +37 -31
  301. package/lib/tax-calculation.cjs.js +1 -1
  302. package/lib/tax-calculation.es.js +84 -98
  303. package/lib/trials.cjs.js +1 -1
  304. package/lib/trials.es.js +24 -30
  305. package/lib/types.cjs.js +1 -1
  306. package/lib/types.es.js +21 -27
  307. package/lib/use-cart.cjs.js +1 -1
  308. package/lib/use-cart.es.js +38 -40
  309. package/lib/use-price-formatter.cjs.js +1 -1
  310. package/lib/use-price-formatter.es.js +10 -11
  311. package/lib/variation-utils.cjs.js +1 -1
  312. package/lib/variation-utils.es.js +199 -261
  313. package/lib/zod-config.cjs.js +1 -1
  314. package/lib/zod-config.es.js +5 -6
  315. package/package.json +16 -16
  316. package/server.cjs.js +1 -1
  317. package/server.es.js +56 -211
@@ -1,196 +1,260 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import b from "next/image";
3
- import { getInvoiceAddressLines as a, formatInvoiceDate as N, formatInvoiceCurrency as s } from "../invoice.es.js";
4
- import { getOrderTaxRatePercentage as f, getOrderTaxRateLabel as v, getOrderTaxRateJurisdiction as x } from "../order-tax-details.es.js";
5
- function k({
6
- data: t,
7
- labels: r,
8
- locale: p = "en-US",
9
- className: c = ""
10
- }) {
11
- const u = a(t.settings.address), g = a(t.order.customer_details?.billing), y = a(t.order.customer_details?.shipping);
12
- return /* @__PURE__ */ n(
13
- "section",
14
- {
15
- className: `rounded-2xl border bg-white text-slate-900 shadow-sm print:rounded-none print:border-0 print:text-[10px] print:shadow-none ${c}`,
16
- children: [
17
- /* @__PURE__ */ e("div", { className: "border-b px-6 py-6 print:px-0", children: /* @__PURE__ */ n("div", { className: "grid gap-6 md:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] md:items-start print:grid-cols-[minmax(0,1fr)_72px_280px] print:items-start print:gap-4", children: [
18
- /* @__PURE__ */ n("div", { className: "order-2 max-w-md space-y-4 print:order-none print:max-w-none print:space-y-2 md:order-none", children: [
19
- /* @__PURE__ */ n("div", { className: "space-y-1 text-sm print:text-[10px]", children: [
20
- /* @__PURE__ */ e("p", { className: "text-xs font-semibold uppercase tracking-[0.2em] text-slate-500", children: r.from }),
21
- t.settings.businessName ? /* @__PURE__ */ e("p", { className: "text-base font-semibold", children: t.settings.businessName }) : null,
22
- u.map((i, l) => /* @__PURE__ */ e("p", { children: i }, `seller-${l}-${i}`)),
23
- t.settings.email ? /* @__PURE__ */ e("p", { children: t.settings.email }) : null,
24
- t.settings.phone ? /* @__PURE__ */ e("p", { children: t.settings.phone }) : null
25
- ] }),
26
- t.settings.taxRegistrations.length > 0 ? /* @__PURE__ */ n("div", { className: "rounded-xl border bg-slate-50 px-4 py-3 text-sm print:px-3 print:py-2 print:text-[10px]", children: [
27
- /* @__PURE__ */ e("p", { className: "mb-2 font-semibold", children: r.taxRegistrations }),
28
- /* @__PURE__ */ e("div", { className: "space-y-1", children: t.settings.taxRegistrations.map((i, l) => /* @__PURE__ */ n("p", { children: [
29
- /* @__PURE__ */ e("span", { className: "font-medium", children: i.label }),
30
- i.label && i.value ? ": " : "",
31
- i.value
32
- ] }, `${i.label}-${i.value}-${l}`)) })
33
- ] }) : null
34
- ] }),
35
- /* @__PURE__ */ e("div", { className: "order-1 flex justify-center md:order-none md:pt-2 print:order-none print:pt-1", children: t.logo?.url ? /* @__PURE__ */ e(
36
- b,
37
- {
38
- src: t.logo.url,
39
- alt: t.logo.name || t.settings.businessName || "Logo",
40
- className: "mx-auto h-24 w-auto object-contain print:h-14",
41
- width: t.logo.width || 320,
42
- height: t.logo.height || 120
43
- }
44
- ) : null }),
45
- /* @__PURE__ */ e("div", { className: "order-3 flex justify-start md:order-none md:justify-end print:order-none", children: /* @__PURE__ */ n("div", { className: "w-full max-w-[380px] rounded-2xl bg-slate-950 px-5 py-5 text-white print:max-w-none print:border print:border-slate-300 print:bg-white print:px-3 print:py-3 print:text-[10px] print:text-slate-950", children: [
46
- /* @__PURE__ */ e("p", { className: "text-xs uppercase tracking-[0.2em] text-white/70 print:text-slate-500", children: r.invoice }),
47
- /* @__PURE__ */ n("div", { className: "mt-4 space-y-3 text-sm print:mt-3 print:space-y-2 print:text-[10px]", children: [
48
- /* @__PURE__ */ e(
49
- o,
50
- {
51
- label: r.invoiceNumber,
52
- value: t.order.invoice_number || "--"
53
- }
54
- ),
55
- /* @__PURE__ */ e(o, { label: r.orderNumber, value: t.order.id }),
56
- /* @__PURE__ */ e(
57
- o,
58
- {
59
- label: r.paidOn,
60
- value: N(t.order.paid_at || t.order.created_at, p) || "--"
61
- }
62
- ),
63
- /* @__PURE__ */ e(o, { label: r.status, value: t.order.status })
64
- ] })
65
- ] }) })
66
- ] }) }),
67
- /* @__PURE__ */ n("div", { className: "grid gap-4 border-b px-6 py-6 md:grid-cols-2 print:grid-cols-2 print:gap-3 print:px-0 print:py-3", children: [
68
- /* @__PURE__ */ e(h, { title: r.billTo, lines: g }),
69
- /* @__PURE__ */ e(h, { title: r.shipTo, lines: y })
70
- ] }),
71
- /* @__PURE__ */ n("div", { className: "px-6 py-6 print:px-0 print:py-3", children: [
72
- /* @__PURE__ */ e("div", { className: "overflow-x-auto rounded-2xl border print:overflow-visible", children: /* @__PURE__ */ n("table", { className: "w-full border-collapse text-sm tabular-nums print:table-fixed print:text-[9px]", children: [
73
- /* @__PURE__ */ e("thead", { className: "bg-slate-50", children: /* @__PURE__ */ n("tr", { children: [
74
- /* @__PURE__ */ e("th", { className: "px-4 py-3 text-left font-semibold print:w-[22%] print:px-2 print:py-1.5", children: r.item }),
75
- /* @__PURE__ */ e("th", { className: "px-4 py-3 text-left font-semibold print:w-[38%] print:px-2 print:py-1.5", children: r.details }),
76
- /* @__PURE__ */ e("th", { className: "px-4 py-3 text-right font-semibold print:w-[10%] print:px-2 print:py-1.5", children: r.quantity }),
77
- /* @__PURE__ */ e("th", { className: "px-4 py-3 text-right font-semibold print:w-[15%] print:px-2 print:py-1.5", children: r.price }),
78
- /* @__PURE__ */ e("th", { className: "px-4 py-3 text-right font-semibold print:w-[15%] print:px-2 print:py-1.5", children: r.amount })
79
- ] }) }),
80
- /* @__PURE__ */ e("tbody", { children: t.order.items.map((i) => /* @__PURE__ */ n("tr", { className: "border-t", children: [
81
- /* @__PURE__ */ e("td", { className: "px-4 py-4 font-medium print:px-2 print:py-1.5", children: i.title }),
82
- /* @__PURE__ */ e("td", { className: "px-4 py-4 text-slate-600 print:px-2 print:py-1.5", children: i.description || "--" }),
83
- /* @__PURE__ */ e("td", { className: "px-4 py-4 text-right print:px-2 print:py-1.5", children: i.quantity }),
84
- /* @__PURE__ */ e("td", { className: "px-4 py-4 text-right print:px-2 print:py-1.5", children: s(i.unit_amount, t.order.currency, p) }),
85
- /* @__PURE__ */ e("td", { className: "px-4 py-4 text-right font-medium print:px-2 print:py-1.5", children: s(i.total_amount, t.order.currency, p) })
86
- ] }, i.id)) })
87
- ] }) }),
88
- /* @__PURE__ */ n("div", { className: "mt-6 grid gap-6 md:grid-cols-[minmax(0,1fr)_320px] print:mt-4 print:grid-cols-[minmax(0,1fr)_220px] print:items-start print:gap-4", children: [
89
- /* @__PURE__ */ e("div", { children: t.order.tax_details?.lines?.length ? /* @__PURE__ */ n("div", { className: "rounded-xl border bg-slate-50 px-5 py-4 print:break-inside-avoid print:px-3 print:py-2.5 print:text-[10px]", children: [
90
- /* @__PURE__ */ e("p", { className: "mb-3 font-semibold", children: r.taxBreakdown }),
91
- /* @__PURE__ */ e("div", { className: "space-y-3 text-sm print:space-y-2 print:text-[10px]", children: t.order.tax_details.lines.map((i, l) => {
92
- const m = f(i.rate);
93
- return /* @__PURE__ */ n(
94
- "div",
95
- {
96
- className: "flex items-start justify-between gap-4",
97
- children: [
98
- /* @__PURE__ */ n("div", { children: [
99
- /* @__PURE__ */ n("p", { className: "font-medium", children: [
100
- v(i.rate),
101
- typeof m == "number" ? ` - ${m.toFixed(4)}%` : ""
102
- ] }),
103
- x(i.rate) ? /* @__PURE__ */ e("p", { className: "text-xs text-slate-500 print:text-[9px]", children: x(i.rate) }) : null
104
- ] }),
105
- /* @__PURE__ */ e("span", { children: s(i.amount, t.order.currency, p) })
106
- ]
107
- },
108
- `${i.rate.display_name}-${i.description || "tax"}-${l}`
109
- );
110
- }) })
111
- ] }) : null }),
112
- /* @__PURE__ */ n("div", { className: "rounded-xl border bg-slate-950 px-5 py-5 text-sm text-white print:break-inside-avoid print:border-slate-300 print:bg-white print:px-3 print:py-3 print:text-[10px] print:text-slate-950", children: [
113
- /* @__PURE__ */ n("div", { className: "space-y-3 print:space-y-2", children: [
114
- /* @__PURE__ */ e(
115
- d,
116
- {
117
- label: r.subtotal,
118
- value: s(t.order.subtotal, t.order.currency, p)
119
- }
120
- ),
121
- t.order.discount_total > 0 ? /* @__PURE__ */ e(
122
- d,
123
- {
124
- label: t.order.coupon_code ? `${r.discount} (${t.order.coupon_code})` : r.discount,
125
- value: `-${s(
126
- t.order.discount_total,
127
- t.order.currency,
128
- p
129
- )}`
130
- }
131
- ) : null,
132
- /* @__PURE__ */ e(
133
- d,
134
- {
135
- label: r.shipping,
136
- value: s(
137
- t.order.shipping_total,
138
- t.order.currency,
139
- p
140
- )
141
- }
142
- ),
143
- /* @__PURE__ */ e(
144
- d,
145
- {
146
- label: r.tax,
147
- value: s(t.order.tax_total, t.order.currency, p)
148
- }
149
- )
150
- ] }),
151
- /* @__PURE__ */ e("div", { className: "mt-4 border-t border-white/15 pt-4 print:mt-3 print:border-slate-300 print:pt-3", children: /* @__PURE__ */ e(
152
- d,
153
- {
154
- label: r.total,
155
- value: s(t.order.total, t.order.currency, p),
156
- strong: !0
157
- }
158
- ) })
159
- ] })
160
- ] })
161
- ] })
162
- ]
163
- }
164
- );
1
+ import { formatInvoiceCurrency as e, formatInvoiceDate as t, getInvoiceAddressLines as n } from "../invoice.es.js";
2
+ import { getOrderTaxRateJurisdiction as r, getOrderTaxRateLabel as i, getOrderTaxRatePercentage as a } from "../order-tax-details.es.js";
3
+ import "react";
4
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ import c from "next/image";
6
+ //#region libs/ecommerce/src/lib/components/InvoiceDocument.tsx
7
+ function l({ data: l, labels: p, locale: m = "en-US", className: h = "" }) {
8
+ let g = n(l.settings.address), _ = n(l.order.customer_details?.billing), v = n(l.order.customer_details?.shipping);
9
+ return /* @__PURE__ */ s("section", {
10
+ className: `rounded-2xl border bg-white text-slate-900 shadow-sm print:rounded-none print:border-0 print:text-[10px] print:shadow-none ${h}`,
11
+ children: [
12
+ /* @__PURE__ */ o("div", {
13
+ className: "border-b px-6 py-6 print:px-0",
14
+ children: /* @__PURE__ */ s("div", {
15
+ className: "grid gap-6 md:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] md:items-start print:grid-cols-[minmax(0,1fr)_72px_280px] print:items-start print:gap-4",
16
+ children: [
17
+ /* @__PURE__ */ s("div", {
18
+ className: "order-2 max-w-md space-y-4 print:order-none print:max-w-none print:space-y-2 md:order-none",
19
+ children: [/* @__PURE__ */ s("div", {
20
+ className: "space-y-1 text-sm print:text-[10px]",
21
+ children: [
22
+ /* @__PURE__ */ o("p", {
23
+ className: "text-xs font-semibold uppercase tracking-[0.2em] text-slate-500",
24
+ children: p.from
25
+ }),
26
+ l.settings.businessName ? /* @__PURE__ */ o("p", {
27
+ className: "text-base font-semibold",
28
+ children: l.settings.businessName
29
+ }) : null,
30
+ g.map((e, t) => /* @__PURE__ */ o("p", { children: e }, `seller-${t}-${e}`)),
31
+ l.settings.email ? /* @__PURE__ */ o("p", { children: l.settings.email }) : null,
32
+ l.settings.phone ? /* @__PURE__ */ o("p", { children: l.settings.phone }) : null
33
+ ]
34
+ }), l.settings.taxRegistrations.length > 0 ? /* @__PURE__ */ s("div", {
35
+ className: "rounded-xl border bg-slate-50 px-4 py-3 text-sm print:px-3 print:py-2 print:text-[10px]",
36
+ children: [/* @__PURE__ */ o("p", {
37
+ className: "mb-2 font-semibold",
38
+ children: p.taxRegistrations
39
+ }), /* @__PURE__ */ o("div", {
40
+ className: "space-y-1",
41
+ children: l.settings.taxRegistrations.map((e, t) => /* @__PURE__ */ s("p", { children: [
42
+ /* @__PURE__ */ o("span", {
43
+ className: "font-medium",
44
+ children: e.label
45
+ }),
46
+ e.label && e.value ? ": " : "",
47
+ e.value
48
+ ] }, `${e.label}-${e.value}-${t}`))
49
+ })]
50
+ }) : null]
51
+ }),
52
+ /* @__PURE__ */ o("div", {
53
+ className: "order-1 flex justify-center md:order-none md:pt-2 print:order-none print:pt-1",
54
+ children: l.logo?.url ? /* @__PURE__ */ o(c, {
55
+ src: l.logo.url,
56
+ alt: l.logo.name || l.settings.businessName || "Logo",
57
+ className: "mx-auto h-24 w-auto object-contain print:h-14",
58
+ width: l.logo.width || 320,
59
+ height: l.logo.height || 120
60
+ }) : null
61
+ }),
62
+ /* @__PURE__ */ o("div", {
63
+ className: "order-3 flex justify-start md:order-none md:justify-end print:order-none",
64
+ children: /* @__PURE__ */ s("div", {
65
+ className: "w-full max-w-[380px] rounded-2xl bg-slate-950 px-5 py-5 text-white print:max-w-none print:border print:border-slate-300 print:bg-white print:px-3 print:py-3 print:text-[10px] print:text-slate-950",
66
+ children: [/* @__PURE__ */ o("p", {
67
+ className: "text-xs uppercase tracking-[0.2em] text-white/70 print:text-slate-500",
68
+ children: p.invoice
69
+ }), /* @__PURE__ */ s("div", {
70
+ className: "mt-4 space-y-3 text-sm print:mt-3 print:space-y-2 print:text-[10px]",
71
+ children: [
72
+ /* @__PURE__ */ o(d, {
73
+ label: p.invoiceNumber,
74
+ value: l.order.invoice_number || "--"
75
+ }),
76
+ /* @__PURE__ */ o(d, {
77
+ label: p.orderNumber,
78
+ value: l.order.id
79
+ }),
80
+ /* @__PURE__ */ o(d, {
81
+ label: p.paidOn,
82
+ value: t(l.order.paid_at || l.order.created_at, m) || "--"
83
+ }),
84
+ /* @__PURE__ */ o(d, {
85
+ label: p.status,
86
+ value: l.order.status
87
+ })
88
+ ]
89
+ })]
90
+ })
91
+ })
92
+ ]
93
+ })
94
+ }),
95
+ /* @__PURE__ */ s("div", {
96
+ className: "grid gap-4 border-b px-6 py-6 md:grid-cols-2 print:grid-cols-2 print:gap-3 print:px-0 print:py-3",
97
+ children: [/* @__PURE__ */ o(u, {
98
+ title: p.billTo,
99
+ lines: _
100
+ }), /* @__PURE__ */ o(u, {
101
+ title: p.shipTo,
102
+ lines: v
103
+ })]
104
+ }),
105
+ /* @__PURE__ */ s("div", {
106
+ className: "px-6 py-6 print:px-0 print:py-3",
107
+ children: [/* @__PURE__ */ o("div", {
108
+ className: "overflow-x-auto rounded-2xl border print:overflow-visible",
109
+ children: /* @__PURE__ */ s("table", {
110
+ className: "w-full border-collapse text-sm tabular-nums print:table-fixed print:text-[9px]",
111
+ children: [/* @__PURE__ */ o("thead", {
112
+ className: "bg-slate-50",
113
+ children: /* @__PURE__ */ s("tr", { children: [
114
+ /* @__PURE__ */ o("th", {
115
+ className: "px-4 py-3 text-left font-semibold print:w-[22%] print:px-2 print:py-1.5",
116
+ children: p.item
117
+ }),
118
+ /* @__PURE__ */ o("th", {
119
+ className: "px-4 py-3 text-left font-semibold print:w-[38%] print:px-2 print:py-1.5",
120
+ children: p.details
121
+ }),
122
+ /* @__PURE__ */ o("th", {
123
+ className: "px-4 py-3 text-right font-semibold print:w-[10%] print:px-2 print:py-1.5",
124
+ children: p.quantity
125
+ }),
126
+ /* @__PURE__ */ o("th", {
127
+ className: "px-4 py-3 text-right font-semibold print:w-[15%] print:px-2 print:py-1.5",
128
+ children: p.price
129
+ }),
130
+ /* @__PURE__ */ o("th", {
131
+ className: "px-4 py-3 text-right font-semibold print:w-[15%] print:px-2 print:py-1.5",
132
+ children: p.amount
133
+ })
134
+ ] })
135
+ }), /* @__PURE__ */ o("tbody", { children: l.order.items.map((t) => /* @__PURE__ */ s("tr", {
136
+ className: "border-t",
137
+ children: [
138
+ /* @__PURE__ */ o("td", {
139
+ className: "px-4 py-4 font-medium print:px-2 print:py-1.5",
140
+ children: t.title
141
+ }),
142
+ /* @__PURE__ */ o("td", {
143
+ className: "px-4 py-4 text-slate-600 print:px-2 print:py-1.5",
144
+ children: t.description || "--"
145
+ }),
146
+ /* @__PURE__ */ o("td", {
147
+ className: "px-4 py-4 text-right print:px-2 print:py-1.5",
148
+ children: t.quantity
149
+ }),
150
+ /* @__PURE__ */ o("td", {
151
+ className: "px-4 py-4 text-right print:px-2 print:py-1.5",
152
+ children: e(t.unit_amount, l.order.currency, m)
153
+ }),
154
+ /* @__PURE__ */ o("td", {
155
+ className: "px-4 py-4 text-right font-medium print:px-2 print:py-1.5",
156
+ children: e(t.total_amount, l.order.currency, m)
157
+ })
158
+ ]
159
+ }, t.id)) })]
160
+ })
161
+ }), /* @__PURE__ */ s("div", {
162
+ className: "mt-6 grid gap-6 md:grid-cols-[minmax(0,1fr)_320px] print:mt-4 print:grid-cols-[minmax(0,1fr)_220px] print:items-start print:gap-4",
163
+ children: [/* @__PURE__ */ o("div", { children: l.order.tax_details?.lines?.length ? /* @__PURE__ */ s("div", {
164
+ className: "rounded-xl border bg-slate-50 px-5 py-4 print:break-inside-avoid print:px-3 print:py-2.5 print:text-[10px]",
165
+ children: [/* @__PURE__ */ o("p", {
166
+ className: "mb-3 font-semibold",
167
+ children: p.taxBreakdown
168
+ }), /* @__PURE__ */ o("div", {
169
+ className: "space-y-3 text-sm print:space-y-2 print:text-[10px]",
170
+ children: l.order.tax_details.lines.map((t, n) => {
171
+ let c = a(t.rate);
172
+ return /* @__PURE__ */ s("div", {
173
+ className: "flex items-start justify-between gap-4",
174
+ children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ s("p", {
175
+ className: "font-medium",
176
+ children: [i(t.rate), typeof c == "number" ? ` - ${c.toFixed(4)}%` : ""]
177
+ }), r(t.rate) ? /* @__PURE__ */ o("p", {
178
+ className: "text-xs text-slate-500 print:text-[9px]",
179
+ children: r(t.rate)
180
+ }) : null] }), /* @__PURE__ */ o("span", { children: e(t.amount, l.order.currency, m) })]
181
+ }, `${t.rate.display_name}-${t.description || "tax"}-${n}`);
182
+ })
183
+ })]
184
+ }) : null }), /* @__PURE__ */ s("div", {
185
+ className: "rounded-xl border bg-slate-950 px-5 py-5 text-sm text-white print:break-inside-avoid print:border-slate-300 print:bg-white print:px-3 print:py-3 print:text-[10px] print:text-slate-950",
186
+ children: [/* @__PURE__ */ s("div", {
187
+ className: "space-y-3 print:space-y-2",
188
+ children: [
189
+ /* @__PURE__ */ o(f, {
190
+ label: p.subtotal,
191
+ value: e(l.order.subtotal, l.order.currency, m)
192
+ }),
193
+ l.order.discount_total > 0 ? /* @__PURE__ */ o(f, {
194
+ label: l.order.coupon_code ? `${p.discount} (${l.order.coupon_code})` : p.discount,
195
+ value: `-${e(l.order.discount_total, l.order.currency, m)}`
196
+ }) : null,
197
+ /* @__PURE__ */ o(f, {
198
+ label: p.shipping,
199
+ value: e(l.order.shipping_total, l.order.currency, m)
200
+ }),
201
+ /* @__PURE__ */ o(f, {
202
+ label: p.tax,
203
+ value: e(l.order.tax_total, l.order.currency, m)
204
+ })
205
+ ]
206
+ }), /* @__PURE__ */ o("div", {
207
+ className: "mt-4 border-t border-white/15 pt-4 print:mt-3 print:border-slate-300 print:pt-3",
208
+ children: /* @__PURE__ */ o(f, {
209
+ label: p.total,
210
+ value: e(l.order.total, l.order.currency, m),
211
+ strong: !0
212
+ })
213
+ })]
214
+ })]
215
+ })]
216
+ })
217
+ ]
218
+ });
165
219
  }
166
- function h({ title: t, lines: r }) {
167
- return /* @__PURE__ */ n("div", { className: "rounded-xl border bg-slate-50 px-5 py-4 print:break-inside-avoid print:px-3 print:py-2.5 print:text-[10px]", children: [
168
- /* @__PURE__ */ e("p", { className: "mb-3 text-xs font-semibold uppercase tracking-[0.2em] text-slate-500", children: t }),
169
- r.length ? /* @__PURE__ */ e("div", { className: "space-y-1 text-sm print:text-[10px]", children: r.map((p, c) => /* @__PURE__ */ e("p", { children: p }, `${t}-${c}-${p}`)) }) : /* @__PURE__ */ e("p", { className: "text-sm text-slate-500", children: "--" })
170
- ] });
220
+ function u({ title: e, lines: t }) {
221
+ return /* @__PURE__ */ s("div", {
222
+ className: "rounded-xl border bg-slate-50 px-5 py-4 print:break-inside-avoid print:px-3 print:py-2.5 print:text-[10px]",
223
+ children: [/* @__PURE__ */ o("p", {
224
+ className: "mb-3 text-xs font-semibold uppercase tracking-[0.2em] text-slate-500",
225
+ children: e
226
+ }), t.length ? /* @__PURE__ */ o("div", {
227
+ className: "space-y-1 text-sm print:text-[10px]",
228
+ children: t.map((t, n) => /* @__PURE__ */ o("p", { children: t }, `${e}-${n}-${t}`))
229
+ }) : /* @__PURE__ */ o("p", {
230
+ className: "text-sm text-slate-500",
231
+ children: "--"
232
+ })]
233
+ });
171
234
  }
172
- function o({ label: t, value: r }) {
173
- return /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-4", children: [
174
- /* @__PURE__ */ e("span", { className: "text-white/70 print:text-[9px] print:text-slate-500", children: t }),
175
- /* @__PURE__ */ e("span", { className: "text-right font-medium", children: r })
176
- ] });
235
+ function d({ label: e, value: t }) {
236
+ return /* @__PURE__ */ s("div", {
237
+ className: "flex items-center justify-between gap-4",
238
+ children: [/* @__PURE__ */ o("span", {
239
+ className: "text-white/70 print:text-[9px] print:text-slate-500",
240
+ children: e
241
+ }), /* @__PURE__ */ o("span", {
242
+ className: "text-right font-medium",
243
+ children: t
244
+ })]
245
+ });
177
246
  }
178
- function d({
179
- label: t,
180
- value: r,
181
- strong: p = !1
182
- }) {
183
- return /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-4", children: [
184
- /* @__PURE__ */ e(
185
- "span",
186
- {
187
- className: p ? "text-base font-semibold print:text-sm" : "text-white/75 print:text-[9px] print:text-slate-500",
188
- children: t
189
- }
190
- ),
191
- /* @__PURE__ */ e("span", { className: p ? "text-lg font-semibold print:text-base" : "font-medium", children: r })
192
- ] });
247
+ function f({ label: e, value: t, strong: n = !1 }) {
248
+ return /* @__PURE__ */ s("div", {
249
+ className: "flex items-center justify-between gap-4",
250
+ children: [/* @__PURE__ */ o("span", {
251
+ className: n ? "text-base font-semibold print:text-sm" : "text-white/75 print:text-[9px] print:text-slate-500",
252
+ children: e
253
+ }), /* @__PURE__ */ o("span", {
254
+ className: n ? "text-lg font-semibold print:text-base" : "font-medium",
255
+ children: t
256
+ })]
257
+ });
193
258
  }
194
- export {
195
- k as InvoiceDocument
196
- };
259
+ //#endregion
260
+ export { l as InvoiceDocument };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("next/link"),g=require("lucide-react"),n=require("@nextblock-cms/ui/button"),y=require("./InvoiceDocument.cjs.js");function w({invoice:i,labels:c,locale:x,title:m,description:l,printLabel:u,headerVisual:s,action:t,loading:d=!1,loadingMessage:p,error:r,onRetry:a,retryLabel:o,emptyMessage:b,className:h="",showHeader:j=!0,beforeInvoice:v}){return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:`
1
+ "use client";const e=require("../../_virtual/_rolldown/runtime.cjs.js"),t=require("./InvoiceDocument.cjs.js");let n=require("@nextblock-cms/ui/button"),r=require("next/link");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");function o({invoice:e,labels:o,locale:s,title:c,description:l,printLabel:u,headerVisual:d,action:f,loading:p=!1,loadingMessage:m,error:h,onRetry:g,retryLabel:_,emptyMessage:v,className:y=``,showHeader:b=!0,beforeInvoice:x}){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`style`,{children:`
2
2
  @media print {
3
3
  @page {
4
4
  size: portrait;
@@ -26,4 +26,4 @@
26
26
  padding: 0;
27
27
  }
28
28
  }
29
- `}),e.jsxs("div",{className:`mx-auto max-w-6xl px-4 py-10 md:px-6 print:max-w-none print:px-0 print:py-0 ${h}`,children:[j?e.jsxs("div",{className:"mb-6 flex flex-col gap-4 md:flex-row md:items-center md:justify-between print:hidden",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[s?e.jsx("div",{className:"shrink-0",children:s}):null,e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:m}),l?e.jsx("p",{className:"text-sm text-muted-foreground",children:l}):null]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs(n.Button,{type:"button",variant:"outline",onClick:()=>window.print(),disabled:!i,children:[e.jsx(g.Printer,{className:"mr-2 h-4 w-4"}),u]}),t?e.jsx(n.Button,{asChild:!0,variant:t.variant||"default",children:e.jsx(f,{href:t.href,children:t.label})}):null]})]}):null,d?e.jsx("div",{role:"status",className:"mb-6 flex items-center justify-center gap-3 rounded-2xl border bg-background px-5 py-4 text-sm text-muted-foreground print:hidden",children:p}):null,r?e.jsxs("div",{role:"alert",className:"mb-6 flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-amber-200 bg-amber-50 px-5 py-4 text-sm text-amber-800 print:hidden dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200",children:[e.jsx("span",{children:r}),a&&o?e.jsx(n.Button,{type:"button",size:"sm",variant:"outline",onClick:a,children:o}):null]}):null,v,i?e.jsx("div",{"data-print-invoice-root":!0,children:e.jsx(y.InvoiceDocument,{data:i,labels:c,locale:x})}):!d&&!r?e.jsx("div",{className:"rounded-2xl border bg-background px-6 py-12 text-center text-muted-foreground print:hidden",children:b}):null]})]})}exports.InvoiceViewerShell=w;
29
+ `}),(0,a.jsxs)(`div`,{className:`mx-auto max-w-6xl px-4 py-10 md:px-6 print:max-w-none print:px-0 print:py-0 ${y}`,children:[b?(0,a.jsxs)(`div`,{className:`mb-6 flex flex-col gap-4 md:flex-row md:items-center md:justify-between print:hidden`,children:[(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[d?(0,a.jsx)(`div`,{className:`shrink-0`,children:d}):null,(0,a.jsxs)(`div`,{children:[(0,a.jsx)(`h1`,{className:`text-3xl font-bold`,children:c}),l?(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:l}):null]})]}),(0,a.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,a.jsxs)(n.Button,{type:`button`,variant:`outline`,onClick:()=>window.print(),disabled:!e,children:[(0,a.jsx)(i.Printer,{className:`mr-2 h-4 w-4`}),u]}),f?(0,a.jsx)(n.Button,{asChild:!0,variant:f.variant||`default`,children:(0,a.jsx)(r.default,{href:f.href,children:f.label})}):null]})]}):null,p?(0,a.jsx)(`div`,{role:`status`,className:`mb-6 flex items-center justify-center gap-3 rounded-2xl border bg-background px-5 py-4 text-sm text-muted-foreground print:hidden`,children:m}):null,h?(0,a.jsxs)(`div`,{role:`alert`,className:`mb-6 flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-amber-200 bg-amber-50 px-5 py-4 text-sm text-amber-800 print:hidden dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200`,children:[(0,a.jsx)(`span`,{children:h}),g&&_?(0,a.jsx)(n.Button,{type:`button`,size:`sm`,variant:`outline`,onClick:g,children:_}):null]}):null,x,e?(0,a.jsx)(`div`,{"data-print-invoice-root":!0,children:(0,a.jsx)(t.InvoiceDocument,{data:e,labels:o,locale:s})}):!p&&!h?(0,a.jsx)(`div`,{className:`rounded-2xl border bg-background px-6 py-12 text-center text-muted-foreground print:hidden`,children:v}):null]})]})}exports.InvoiceViewerShell=o;
@@ -27,5 +27,5 @@ interface InvoiceViewerShellProps {
27
27
  /** Optional content rendered above the invoice (and hidden when printing). */
28
28
  beforeInvoice?: ReactNode;
29
29
  }
30
- export declare function InvoiceViewerShell({ invoice, labels, locale, title, description, printLabel, headerVisual, action, loading, loadingMessage, error, onRetry, retryLabel, emptyMessage, className, showHeader, beforeInvoice, }: InvoiceViewerShellProps): import("react").JSX.Element;
30
+ export declare function InvoiceViewerShell({ invoice, labels, locale, title, description, printLabel, headerVisual, action, loading, loadingMessage, error, onRetry, retryLabel, emptyMessage, className, showHeader, beforeInvoice, }: InvoiceViewerShellProps): import('react').JSX.Element;
31
31
  export {};