@nextblock-cms/ecom 0.8.6 → 0.8.7
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.
- package/index.cjs.js +1 -1
- package/index.es.js +136 -533
- package/lib/CurrencyProvider.cjs.js +1 -0
- package/lib/CurrencyProvider.es.js +99 -0
- package/lib/cart-store.cjs.js +1 -0
- package/{cart-store.es.js → lib/cart-store.es.js} +13 -13
- package/lib/components/AccountNavigationMenu.cjs.js +1 -0
- package/lib/components/AccountNavigationMenu.es.js +44 -0
- package/lib/components/AddToCartButton.cjs.js +1 -0
- package/{AddToCartButton-ffE0DhHu.js → lib/components/AddToCartButton.es.js} +14 -13
- package/lib/components/Cart.cjs.js +1 -0
- package/lib/components/Cart.es.js +148 -0
- package/lib/components/CartDrawer.cjs.js +1 -0
- package/{components → lib/components}/CartDrawer.es.js +15 -14
- package/{components → lib/components}/CartIcon.cjs.js +1 -1
- package/{components → lib/components}/CartIcon.es.js +1 -0
- package/lib/components/Checkout.cjs.js +1 -0
- package/{components → lib/components}/Checkout.es.js +330 -363
- package/lib/components/CouponForm.cjs.js +1 -0
- package/lib/components/CouponForm.es.js +136 -0
- package/lib/components/CurrencySwitcher.cjs.js +1 -0
- package/{components → lib/components}/CurrencySwitcher.es.js +5 -4
- package/lib/components/CustomerProfileForm.cjs.js +1 -0
- package/lib/components/CustomerProfileForm.es.js +355 -0
- package/lib/components/FeaturedProduct.cjs.js +1 -0
- package/{components → lib/components}/FeaturedProduct.es.js +9 -8
- package/lib/components/InvoiceDocument.cjs.js +1 -0
- package/lib/components/InvoiceDocument.es.js +196 -0
- package/lib/components/InvoiceViewerShell.cjs.js +29 -0
- package/lib/components/InvoiceViewerShell.es.js +100 -0
- package/lib/components/ProductCard.cjs.js +1 -0
- package/lib/components/ProductCard.es.js +119 -0
- package/lib/components/ProductDetailsLayout.cjs.js +1 -0
- package/lib/components/ProductDetailsLayout.es.js +361 -0
- package/lib/components/ProductGallery.cjs.js +1 -0
- package/lib/components/ProductGallery.es.js +41 -0
- package/lib/components/ProductGrid.cjs.js +1 -0
- package/lib/components/ProductGrid.es.js +19 -0
- package/lib/components/ShippingEstimator.cjs.js +1 -0
- package/lib/components/ShippingEstimator.es.js +125 -0
- package/lib/components/SubscriptionSelector.cjs.js +1 -0
- package/lib/components/SubscriptionSelector.es.js +140 -0
- package/lib/countries.cjs.js +1 -0
- package/lib/countries.es.js +77 -0
- package/lib/coupon-server.cjs.js +1 -0
- package/{coupon-server-DUKVtyYs.js → lib/coupon-server.es.js} +68 -82
- package/lib/coupons.cjs.js +1 -0
- package/lib/coupons.es.js +17 -0
- package/lib/currency-store.cjs.js +1 -0
- package/lib/currency-store.es.js +27 -0
- package/lib/currency-sync.cjs.js +1 -0
- package/lib/currency-sync.es.js +180 -0
- package/lib/customer-addresses.cjs.js +1 -0
- package/lib/customer-addresses.es.js +116 -0
- package/lib/customer-orders.cjs.js +1 -0
- package/lib/customer-orders.es.js +45 -0
- package/lib/customer.cjs.js +1 -0
- package/{customer-C3xccjUg.js → lib/customer.es.js} +15 -14
- package/lib/export-helpers.cjs.js +1 -0
- package/lib/export-helpers.es.js +56 -0
- package/lib/factory.cjs.js +1 -0
- package/lib/factory.es.js +8 -0
- package/lib/freemius-coupons.cjs.js +1 -0
- package/lib/freemius-coupons.es.js +272 -0
- package/lib/freemius-order-sync.cjs.js +1 -0
- package/lib/freemius-order-sync.es.js +284 -0
- package/lib/inventory-settings.cjs.js +1 -0
- package/lib/inventory-settings.es.js +86 -0
- package/lib/invoice-server.cjs.js +33 -0
- package/lib/invoice-server.es.js +141 -0
- package/lib/invoice-ui.cjs.js +1 -0
- package/lib/invoice-ui.es.js +71 -0
- package/lib/invoice.cjs.js +1 -0
- package/lib/invoice.es.js +102 -0
- package/lib/order-inventory.cjs.js +61 -0
- package/lib/order-inventory.es.js +128 -0
- package/lib/order-tax-details.cjs.js +1 -0
- package/lib/order-tax-details.es.js +164 -0
- package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -0
- package/lib/pages/cms/coupons/CouponEditorForm.es.js +189 -0
- package/lib/pages/cms/coupons/CouponsPage.cjs.js +5 -0
- package/lib/pages/cms/coupons/CouponsPage.es.js +171 -0
- package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +1 -0
- package/lib/pages/cms/coupons/CreateCouponDialog.es.js +35 -0
- package/lib/pages/cms/coupons/EditCouponPage.cjs.js +1 -0
- package/lib/pages/cms/coupons/EditCouponPage.es.js +48 -0
- package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +1 -0
- package/lib/pages/cms/coupons/ProductScopePicker.es.js +120 -0
- package/lib/pages/cms/coupons/actions.cjs.js +1 -0
- package/lib/pages/cms/coupons/actions.es.js +128 -0
- package/lib/pages/cms/coupons/product-options.cjs.js +1 -0
- package/lib/pages/cms/coupons/product-options.es.js +27 -0
- package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -0
- package/lib/pages/cms/orders/ExportReportsDialog.es.js +130 -0
- package/lib/pages/cms/orders/OrderDetailPage.cjs.js +1 -0
- package/lib/pages/cms/orders/OrderDetailPage.es.js +137 -0
- package/lib/pages/cms/orders/OrderPrintButton.cjs.js +1 -0
- package/lib/pages/cms/orders/OrderPrintButton.es.js +22 -0
- package/lib/pages/cms/orders/OrderStatusForm.cjs.js +1 -0
- package/lib/pages/cms/orders/OrderStatusForm.es.js +71 -0
- package/lib/pages/cms/orders/OrdersPage.cjs.js +1 -0
- package/lib/pages/cms/orders/OrdersPage.es.js +104 -0
- package/lib/pages/cms/orders/actions.cjs.js +7 -0
- package/lib/pages/cms/orders/actions.es.js +71 -0
- package/lib/pages/cms/orders/export-actions.cjs.js +1 -0
- package/lib/pages/cms/orders/export-actions.es.js +27 -0
- package/lib/pages/cms/orders/server-actions.cjs.js +1 -0
- package/lib/pages/cms/orders/server-actions.es.js +55 -0
- package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -0
- package/lib/pages/cms/payments/PaymentsClient.es.js +188 -0
- package/lib/pages/cms/payments/PaymentsPage.cjs.js +1 -0
- package/lib/pages/cms/payments/PaymentsPage.es.js +29 -0
- package/lib/pages/cms/payments/actions.cjs.js +1 -0
- package/lib/pages/cms/payments/actions.es.js +23 -0
- package/lib/pages/cms/payments/queries.cjs.js +1 -0
- package/lib/pages/cms/payments/queries.es.js +30 -0
- package/lib/pages/cms/products/ProductsPage.cjs.js +1 -0
- package/lib/pages/cms/products/ProductsPage.es.js +46 -0
- package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -0
- package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +156 -0
- package/lib/pages/cms/products/actions.cjs.js +44 -0
- package/lib/pages/cms/products/actions.es.js +175 -0
- package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -0
- package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +48 -0
- package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +1 -0
- package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +291 -0
- package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +1 -0
- package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +36 -0
- package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +1 -0
- package/lib/pages/cms/products/categories/components/CategoryManager.es.js +263 -0
- package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -0
- package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +114 -0
- package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -0
- package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +107 -0
- package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +1 -0
- package/lib/pages/cms/products/components/DeleteProductButton.es.js +48 -0
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +1 -0
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +86 -0
- package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +1 -0
- package/lib/pages/cms/products/components/ProductCategorySelector.es.js +160 -0
- package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -0
- package/lib/pages/cms/products/components/ProductForm.es.js +702 -0
- package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -0
- package/lib/pages/cms/products/components/ProductMediaManager.es.js +104 -0
- package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -0
- package/lib/pages/cms/products/components/ProductsBulkTable.es.js +228 -0
- package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +1 -0
- package/lib/pages/cms/products/components/SaleScheduleFields.es.js +137 -0
- package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +1 -0
- package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +36 -0
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +1 -0
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +40 -0
- package/lib/pages/cms/products/components/VariationsEditor.cjs.js +1 -0
- package/lib/pages/cms/products/components/VariationsEditor.es.js +408 -0
- package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -0
- package/lib/pages/cms/products/inventory/InventoryPage.es.js +16 -0
- package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +2 -0
- package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +214 -0
- package/lib/pages/cms/products/inventory/actions.cjs.js +3 -0
- package/lib/pages/cms/products/inventory/actions.es.js +95 -0
- package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -0
- package/lib/pages/cms/products/new/NewProductPage.es.js +76 -0
- package/lib/pages/cms/products/product-price-sync.cjs.js +1 -0
- package/lib/pages/cms/products/product-price-sync.es.js +98 -0
- package/lib/pages/cms/products/server-actions.cjs.js +1 -0
- package/lib/pages/cms/products/server-actions.es.js +193 -0
- package/lib/pages/cms/shipping/ShippingPage.cjs.js +5 -0
- package/lib/pages/cms/shipping/ShippingPage.es.js +211 -0
- package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -0
- package/lib/pages/cms/shipping/components/RateForm.es.js +441 -0
- package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +1 -0
- package/lib/pages/cms/shipping/components/ZoneForm.es.js +228 -0
- package/lib/pages/cms/shipping/server-actions.cjs.js +1 -0
- package/lib/pages/cms/shipping/server-actions.es.js +159 -0
- package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -0
- package/lib/pages/cms/taxes/TaxesPage.es.js +172 -0
- package/lib/pages/cms/taxes/actions.cjs.js +1 -0
- package/lib/pages/cms/taxes/actions.es.js +57 -0
- package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -0
- package/lib/pages/cms/taxes/components/TaxRateForm.es.js +100 -0
- package/lib/product-actions.cjs.js +237 -0
- package/lib/product-actions.es.js +524 -0
- package/lib/product-context.cjs.js +1 -0
- package/lib/product-context.es.js +16 -0
- package/lib/product-schema.cjs.js +1 -0
- package/lib/product-schema.es.js +134 -0
- package/lib/providers/freemius.cjs.js +5 -0
- package/lib/providers/freemius.es.js +538 -0
- package/lib/providers/stripe.cjs.js +1 -0
- package/lib/providers/stripe.es.js +473 -0
- package/lib/server-actions/coupon-actions.cjs.js +1 -0
- package/lib/server-actions/coupon-actions.es.js +23 -0
- package/lib/server-actions/customer-actions.cjs.js +1 -0
- package/lib/server-actions/customer-actions.es.js +30 -0
- package/lib/server-actions/product-actions.cjs.js +1 -0
- package/{server-actions → lib/server-actions}/product-actions.es.js +5 -4
- package/lib/server-actions/shipping-actions.cjs.js +1 -0
- package/{shipping-actions-BnHjlo2q.js → lib/server-actions/shipping-actions.es.js} +9 -7
- package/lib/server-actions/tax-actions.cjs.js +1 -0
- package/lib/server-actions/tax-actions.es.js +40 -0
- package/lib/shared-inventory.cjs.js +15 -0
- package/lib/shared-inventory.es.js +171 -0
- package/lib/shipping/resolver.cjs.js +7 -0
- package/lib/shipping/resolver.es.js +62 -0
- package/lib/shipping-rate-currency.cjs.js +1 -0
- package/lib/shipping-rate-currency.es.js +72 -0
- package/lib/states.cjs.js +1 -0
- package/{states-DlHJezQ1.js → lib/states.es.js} +27 -100
- package/lib/stripe/checkout.cjs.js +1 -0
- package/lib/stripe/checkout.es.js +182 -0
- package/lib/stripe/client.cjs.js +1 -0
- package/lib/stripe/client.es.js +7 -0
- package/lib/stripe/order-sync.cjs.js +1 -0
- package/lib/stripe/order-sync.es.js +130 -0
- package/lib/stripe/webhooks.cjs.js +1 -0
- package/lib/stripe/webhooks.es.js +30 -0
- package/lib/tax-calculation.cjs.js +1 -0
- package/lib/tax-calculation.es.js +101 -0
- package/lib/trials.cjs.js +1 -0
- package/{trials-RDcRAZKx.js → lib/trials.es.js} +9 -9
- package/{use-cart.es.js → lib/use-cart.es.js} +1 -0
- package/lib/zod-config.cjs.js +1 -0
- package/lib/zod-config.es.js +6 -0
- package/package.json +4 -4
- package/server.cjs.js +1 -110
- package/server.es.js +178 -6052
- package/AddToCartButton-DsSEH9yp.cjs +0 -1
- package/CouponForm-BI_5SBHQ.js +0 -152
- package/CouponForm-D_uu2bLP.cjs +0 -1
- package/CurrencyProvider-Cg-Q6ucj.cjs +0 -1
- package/CurrencyProvider-OzlRN96V.js +0 -120
- package/CurrencyProvider.cjs.js +0 -1
- package/CurrencyProvider.es.js +0 -10
- package/ProductDetailsLayout-BxJH_BxR.cjs +0 -1
- package/ProductDetailsLayout-Dg8dRTYp.js +0 -530
- package/ProductGrid-BdL7iglO.cjs +0 -1
- package/ProductGrid-D3AWM8sr.js +0 -130
- package/actions-AHmBrS5e.cjs +0 -48
- package/actions-j5fuSZX-.js +0 -820
- package/cart-store.cjs.js +0 -1
- package/components/Cart.cjs.js +0 -1
- package/components/Cart.es.js +0 -259
- package/components/CartDrawer.cjs.js +0 -1
- package/components/Checkout.cjs.js +0 -1
- package/components/CurrencySwitcher.cjs.js +0 -1
- package/components/FeaturedProduct.cjs.js +0 -1
- package/components/ProductDetailsLayout.cjs.js +0 -1
- package/components/ProductDetailsLayout.es.js +0 -19
- package/components/ProductGrid.cjs.js +0 -1
- package/components/ProductGrid.es.js +0 -6
- package/coupon-server-C9ySm3I5.cjs +0 -1
- package/customer-C-UPvrYN.cjs +0 -1
- package/invoice-ui-CAnJPu6n.cjs +0 -29
- package/invoice-ui-DtpbTJE1.js +0 -2886
- package/product-actions-CONBF8i6.cjs +0 -251
- package/product-actions-DjlIWCMH.js +0 -691
- package/resolver-Fz_FKsfX.cjs +0 -7
- package/resolver-cfrCaHpE.js +0 -128
- package/server-actions/product-actions.cjs.js +0 -1
- package/shipping-actions-D6zt20gg.cjs +0 -1
- package/states-CWYRxV4B.cjs +0 -1
- package/tax-calculation-Dab89aHd.js +0 -181
- package/tax-calculation-MkDKOEkL.cjs +0 -1
- package/trials-DvZaOtNy.cjs +0 -1
- /package/{components → lib/components}/SimpleTiptapRenderer.cjs.js +0 -0
- /package/{components → lib/components}/SimpleTiptapRenderer.es.js +0 -0
- /package/{currency-constants.cjs.js → lib/currency-constants.cjs.js} +0 -0
- /package/{currency-constants.es.js → lib/currency-constants.es.js} +0 -0
- /package/{currency-rest-client-uolJxUkL.cjs → lib/currency-rest-client.cjs.js} +0 -0
- /package/{currency-rest-client-CwoqdgAP.js → lib/currency-rest-client.es.js} +0 -0
- /package/{currency.cjs.js → lib/currency.cjs.js} +0 -0
- /package/{currency.es.js → lib/currency.es.js} +0 -0
- /package/{types.cjs.js → lib/types.cjs.js} +0 -0
- /package/{types.es.js → lib/types.es.js} +0 -0
- /package/{use-cart.cjs.js → lib/use-cart.cjs.js} +0 -0
- /package/{variation-utils.cjs.js → lib/variation-utils.cjs.js} +0 -0
- /package/{variation-utils.es.js → lib/variation-utils.es.js} +0 -0
package/index.es.js
CHANGED
|
@@ -1,535 +1,138 @@
|
|
|
1
|
-
import { CartDrawer as
|
|
2
|
-
import { Cart as
|
|
3
|
-
import { Checkout as
|
|
4
|
-
import { CartIcon as
|
|
5
|
-
import {
|
|
6
|
-
import { CurrencySwitcher as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import { getCartItemActivePrice as ta, useCartStore as sa, useCartSubtotal as la, useCartTotalItems as ia } from "./cart-store.es.js";
|
|
37
|
-
import { e as oa, g as ca, n as da } from "./coupon-server-DUKVtyYs.js";
|
|
38
|
-
import { C as ua, u as pa, a as ha } from "./CurrencyProvider-OzlRN96V.js";
|
|
39
|
-
import { CURRENCY_ROUNDING_MODES as _a, applyCurrencyRounding as fa, convertMinorUnitAmount as ba, describeCurrencyRoundingRule as ya, getCurrencyLookup as va, getDefaultCurrency as Na, getExchangeRateForCurrency as xa, inferCurrencyCodeFromLocale as Ca, isSaleWindowActive as wa, isScheduledPriceDue as Sa, normalizeCurrencyRecord as Pa, normalizeCurrencyRoundingMode as Ea, normalizePriceMap as Fa, normalizeSalePriceMap as Ia, resolveEffectivePriceForCurrency as Ta, resolvePriceForCurrency as Aa, resolvePriceRangeForCurrency as Ra, sortCurrencies as $a } from "./currency.es.js";
|
|
40
|
-
import { useCart as Ua, useIsCartHydrated as ka } from "./use-cart.es.js";
|
|
41
|
-
import { DEFAULT_ENABLED_PAYMENT_PROVIDERS as Va, derivePaymentProviderFromProductType as za, getProductPaymentProvider as Ga, isDigitalItem as Ba, isDigitalProduct as Ma, normalizeEnabledPaymentProviders as ja } from "./types.es.js";
|
|
42
|
-
import { g as Ha, a as Ka, b as Wa, c as qa, d as Xa } from "./trials-RDcRAZKx.js";
|
|
43
|
-
import { buildCombinationKey as Ja, buildVariantLabel as Qa, chooseInitialVariantSelections as Za, extractSelectedTermsByAttribute as et, findMatchingVariant as rt, generateVariantDrafts as at, getAvailableTermIdsForAttribute as tt, getVariantEffectivePriceRange as st, mapRawVariantRelations as lt, normalizeSelectionsToAvailableVariants as it, resolveAttributeName as nt, resolveTermValue as ot, resolveTranslatedText as ct } from "./variation-utils.es.js";
|
|
44
|
-
function q(e, d, l) {
|
|
45
|
-
const s = e(d);
|
|
46
|
-
return s === d ? l : s;
|
|
47
|
-
}
|
|
48
|
-
function Fe(e) {
|
|
49
|
-
return e === "password" ? ie : ne;
|
|
50
|
-
}
|
|
51
|
-
function Ie({
|
|
52
|
-
links: e,
|
|
53
|
-
title: d,
|
|
54
|
-
className: l
|
|
55
|
-
}) {
|
|
56
|
-
const s = le(), { t: h } = T();
|
|
57
|
-
return e.length ? /* @__PURE__ */ a("div", { className: z("w-full space-y-3", l), children: [
|
|
58
|
-
/* @__PURE__ */ r("div", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: d || q(h, "account_navigation", "Account") }),
|
|
59
|
-
/* @__PURE__ */ r("div", { className: "space-y-2", children: e.map((i) => {
|
|
60
|
-
const u = Fe(i.icon), t = s === i.href || s.startsWith(`${i.href}/`);
|
|
61
|
-
return /* @__PURE__ */ a(
|
|
62
|
-
se,
|
|
63
|
-
{
|
|
64
|
-
href: i.href,
|
|
65
|
-
className: z(
|
|
66
|
-
"flex items-center gap-3 rounded-xl border px-3 py-2.5 text-sm font-medium transition-colors",
|
|
67
|
-
t ? "border-slate-900 bg-slate-900 text-white" : "border-border bg-background hover:bg-muted/40"
|
|
68
|
-
),
|
|
69
|
-
children: [
|
|
70
|
-
/* @__PURE__ */ r(u, { className: "h-4 w-4 shrink-0" }),
|
|
71
|
-
/* @__PURE__ */ r("span", { children: q(h, i.labelKey, i.fallbackLabel) })
|
|
72
|
-
]
|
|
73
|
-
},
|
|
74
|
-
i.href
|
|
75
|
-
);
|
|
76
|
-
}) })
|
|
77
|
-
] }) : null;
|
|
78
|
-
}
|
|
79
|
-
async function Te(e) {
|
|
80
|
-
const d = Ce(), { data: { user: l }, error: s } = await d.auth.getUser();
|
|
81
|
-
if (s || !l)
|
|
82
|
-
throw new Error("Unauthorized");
|
|
83
|
-
const h = {
|
|
84
|
-
full_name: e.full_name || null,
|
|
85
|
-
avatar_url: e.avatar_url || null,
|
|
86
|
-
website: e.website || null,
|
|
87
|
-
github_username: e.github_username || null,
|
|
88
|
-
phone: e.phone || null,
|
|
89
|
-
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
90
|
-
}, { error: i } = await d.from("profiles").update(h).eq("id", l.id);
|
|
91
|
-
if (i)
|
|
92
|
-
throw console.error("Error updating profile:", i), new Error("Failed to update profile");
|
|
93
|
-
const u = S(e.billing_address), t = e.use_billing_for_shipping ? u : S(e.shipping_address);
|
|
94
|
-
return await Se({
|
|
95
|
-
userId: l.id,
|
|
96
|
-
billingAddress: u,
|
|
97
|
-
shippingAddress: t,
|
|
98
|
-
client: d
|
|
99
|
-
}), H("/profile"), H("/checkout"), { success: !0 };
|
|
100
|
-
}
|
|
101
|
-
function w(e) {
|
|
102
|
-
return {
|
|
103
|
-
company_name: e?.company_name || "",
|
|
104
|
-
recipient_name: e?.recipient_name || "",
|
|
105
|
-
line1: e?.line1 || "",
|
|
106
|
-
line2: e?.line2 || "",
|
|
107
|
-
city: e?.city || "",
|
|
108
|
-
state: e?.state || "",
|
|
109
|
-
postal_code: e?.postal_code || "",
|
|
110
|
-
country_code: Pe(e?.country_code) || "CA"
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function X({
|
|
114
|
-
prefix: e,
|
|
115
|
-
title: d,
|
|
116
|
-
register: l
|
|
117
|
-
}) {
|
|
118
|
-
const { t: s } = T(), h = s("company_name") === "company_name" ? "Company name" : s("company_name");
|
|
119
|
-
return /* @__PURE__ */ a("div", { className: "space-y-4 rounded-xl border p-4", children: [
|
|
120
|
-
/* @__PURE__ */ a("div", { children: [
|
|
121
|
-
/* @__PURE__ */ r("h3", { className: "text-lg font-medium", children: d }),
|
|
122
|
-
/* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: s("profile_address_defaults_help") })
|
|
123
|
-
] }),
|
|
124
|
-
/* @__PURE__ */ a("div", { className: "grid gap-4 md:grid-cols-3", children: [
|
|
125
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
126
|
-
/* @__PURE__ */ r(c, { htmlFor: `${e}-company_name`, children: h }),
|
|
127
|
-
/* @__PURE__ */ r(m, { id: `${e}-company_name`, ...l(`${e}.company_name`) })
|
|
128
|
-
] }),
|
|
129
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
130
|
-
/* @__PURE__ */ r(c, { htmlFor: `${e}-recipient_name`, children: s("full_name") }),
|
|
131
|
-
/* @__PURE__ */ r(m, { id: `${e}-recipient_name`, ...l(`${e}.recipient_name`) })
|
|
132
|
-
] }),
|
|
133
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
134
|
-
/* @__PURE__ */ r(c, { htmlFor: `${e}-country_code`, children: s("country") }),
|
|
135
|
-
/* @__PURE__ */ r(
|
|
136
|
-
"select",
|
|
137
|
-
{
|
|
138
|
-
id: `${e}-country_code`,
|
|
139
|
-
className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
140
|
-
...l(`${e}.country_code`),
|
|
141
|
-
children: Ee.map((i) => /* @__PURE__ */ r("option", { value: i.code, children: i.name }, i.code))
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
] })
|
|
145
|
-
] }),
|
|
146
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
147
|
-
/* @__PURE__ */ r(c, { htmlFor: `${e}-line1`, children: s("address_line_1") }),
|
|
148
|
-
/* @__PURE__ */ r(m, { id: `${e}-line1`, ...l(`${e}.line1`) })
|
|
149
|
-
] }),
|
|
150
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
151
|
-
/* @__PURE__ */ r(c, { htmlFor: `${e}-line2`, children: s("address_line_2") }),
|
|
152
|
-
/* @__PURE__ */ r(m, { id: `${e}-line2`, ...l(`${e}.line2`) })
|
|
153
|
-
] }),
|
|
154
|
-
/* @__PURE__ */ a("div", { className: "grid gap-4 md:grid-cols-3", children: [
|
|
155
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
156
|
-
/* @__PURE__ */ r(c, { htmlFor: `${e}-city`, children: s("city") }),
|
|
157
|
-
/* @__PURE__ */ r(m, { id: `${e}-city`, ...l(`${e}.city`) })
|
|
158
|
-
] }),
|
|
159
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
160
|
-
/* @__PURE__ */ r(c, { htmlFor: `${e}-state`, children: s("state_province") }),
|
|
161
|
-
/* @__PURE__ */ r(m, { id: `${e}-state`, ...l(`${e}.state`) })
|
|
162
|
-
] }),
|
|
163
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
164
|
-
/* @__PURE__ */ r(c, { htmlFor: `${e}-postal_code`, children: s("postal_zip_code") }),
|
|
165
|
-
/* @__PURE__ */ r(m, { id: `${e}-postal_code`, ...l(`${e}.postal_code`) })
|
|
166
|
-
] })
|
|
167
|
-
] })
|
|
168
|
-
] });
|
|
169
|
-
}
|
|
170
|
-
function Ze({
|
|
171
|
-
initialData: e,
|
|
172
|
-
MediaPickerComponent: d,
|
|
173
|
-
isAdmin: l,
|
|
174
|
-
email: s,
|
|
175
|
-
accountLinks: h,
|
|
176
|
-
onAction: i,
|
|
177
|
-
initialSuccessMessage: u
|
|
178
|
-
}) {
|
|
179
|
-
const { t } = T(), [A, R] = C(!1), [P, y] = C(
|
|
180
|
-
u ? { type: "success", text: u } : null
|
|
181
|
-
), [$, Y] = C(!1), [L, J] = C(null), Q = e?.use_billing_for_shipping ?? (!e?.shipping_address || K(e?.billing_address, e?.shipping_address)), {
|
|
182
|
-
register: _,
|
|
183
|
-
handleSubmit: Z,
|
|
184
|
-
setValue: g,
|
|
185
|
-
getValues: x,
|
|
186
|
-
watch: v,
|
|
187
|
-
reset: U
|
|
188
|
-
} = te({
|
|
189
|
-
defaultValues: {
|
|
190
|
-
full_name: e?.full_name || "",
|
|
191
|
-
avatar_url: e?.avatar_url || "",
|
|
192
|
-
website: e?.website || "",
|
|
193
|
-
github_username: e?.github_username || "",
|
|
194
|
-
phone: e?.phone || "",
|
|
195
|
-
role: e?.role,
|
|
196
|
-
use_billing_for_shipping: Q,
|
|
197
|
-
billing_address: w(e?.billing_address),
|
|
198
|
-
shipping_address: w(e?.shipping_address)
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
E.useEffect(() => {
|
|
202
|
-
e && U({
|
|
203
|
-
full_name: e.full_name || "",
|
|
204
|
-
avatar_url: e.avatar_url || "",
|
|
205
|
-
website: e.website || "",
|
|
206
|
-
github_username: e.github_username || "",
|
|
207
|
-
phone: e.phone || "",
|
|
208
|
-
role: e.role,
|
|
209
|
-
use_billing_for_shipping: e.use_billing_for_shipping ?? (!e.shipping_address || K(e.billing_address, e.shipping_address)),
|
|
210
|
-
billing_address: w(e.billing_address),
|
|
211
|
-
shipping_address: w(e.shipping_address)
|
|
212
|
-
});
|
|
213
|
-
}, [e, U]), E.useEffect(() => {
|
|
214
|
-
u && y({ type: "success", text: u });
|
|
215
|
-
}, [u]), E.useEffect(() => {
|
|
216
|
-
const n = W();
|
|
217
|
-
(async () => {
|
|
218
|
-
const {
|
|
219
|
-
data: { user: p }
|
|
220
|
-
} = await n.auth.getUser();
|
|
221
|
-
if (!p)
|
|
222
|
-
return;
|
|
223
|
-
const o = p.identities?.find((b) => b.provider === "github");
|
|
224
|
-
if (o) {
|
|
225
|
-
Y(!0);
|
|
226
|
-
const b = o.identity_data?.email || (p.app_metadata.provider === "github" ? p.email : null);
|
|
227
|
-
if (J(b), !x("website")) {
|
|
228
|
-
const N = o.identity_data?.custom_claims?.blog || o.identity_data?.blog || o.identity_data?.html_url;
|
|
229
|
-
N && g("website", N);
|
|
230
|
-
}
|
|
231
|
-
if (!x("avatar_url")) {
|
|
232
|
-
const N = o.identity_data?.avatar_url;
|
|
233
|
-
N && g("avatar_url", N);
|
|
234
|
-
}
|
|
235
|
-
const O = o.identity_data?.user_name || o.identity_data?.preferred_username;
|
|
236
|
-
O && g("github_username", O);
|
|
237
|
-
}
|
|
238
|
-
!x("full_name") && p.user_metadata?.full_name && g("full_name", p.user_metadata.full_name);
|
|
239
|
-
})();
|
|
240
|
-
}, [x, g]);
|
|
241
|
-
const ee = async () => {
|
|
242
|
-
const n = W(), { error: f } = await n.auth.linkIdentity({ provider: "github" });
|
|
243
|
-
f && (console.error("Error linking GitHub:", f), y({
|
|
244
|
-
type: "error",
|
|
245
|
-
text: t("github_link_failed") || "Failed to link GitHub account"
|
|
246
|
-
}));
|
|
247
|
-
}, re = (n) => {
|
|
248
|
-
const p = `${process.env.NEXT_PUBLIC_R2_BASE_URL || "https://assets.nextblock.com"}/${n.object_key}`;
|
|
249
|
-
g("avatar_url", p);
|
|
250
|
-
}, ae = async (n) => {
|
|
251
|
-
R(!0), y(null);
|
|
252
|
-
const f = S(n.billing_address) ?? we(), p = n.use_billing_for_shipping ? f : S(n.shipping_address);
|
|
253
|
-
try {
|
|
254
|
-
const o = {
|
|
255
|
-
...n,
|
|
256
|
-
billing_address: f,
|
|
257
|
-
shipping_address: p
|
|
258
|
-
};
|
|
259
|
-
if (i) {
|
|
260
|
-
const b = await i(o);
|
|
261
|
-
if (b?.error)
|
|
262
|
-
throw new Error(b.error);
|
|
263
|
-
} else
|
|
264
|
-
await Te(o);
|
|
265
|
-
y({ type: "success", text: t("profile_updated_success") });
|
|
266
|
-
} catch (o) {
|
|
267
|
-
if (o.message === "NEXT_REDIRECT" || o.message?.includes("NEXT_REDIRECT"))
|
|
268
|
-
return;
|
|
269
|
-
console.error(o), y({ type: "error", text: o.message || t("profile_update_failed") });
|
|
270
|
-
} finally {
|
|
271
|
-
R(!1);
|
|
272
|
-
}
|
|
273
|
-
}, k = v("use_billing_for_shipping");
|
|
274
|
-
return /* @__PURE__ */ a("div", { className: "grid gap-6 md:grid-cols-12 max-w-5xl mx-auto", children: [
|
|
275
|
-
/* @__PURE__ */ a(B, { className: "md:col-span-4 h-fit", children: [
|
|
276
|
-
/* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(j, { className: "text-xl", children: t("public_profile") }) }),
|
|
277
|
-
/* @__PURE__ */ a(D, { className: "flex flex-col items-center text-center space-y-4", children: [
|
|
278
|
-
/* @__PURE__ */ a("div", { className: "relative group", children: [
|
|
279
|
-
/* @__PURE__ */ a(ue, { className: "h-32 w-32 border-4 border-muted", children: [
|
|
280
|
-
/* @__PURE__ */ r(pe, { src: v("avatar_url") || void 0, className: "object-cover" }),
|
|
281
|
-
/* @__PURE__ */ r(he, { className: "text-4xl bg-secondary", children: v("full_name")?.charAt(0)?.toUpperCase() || /* @__PURE__ */ r(V, { className: "h-12 w-12" }) })
|
|
282
|
-
] }),
|
|
283
|
-
d && /* @__PURE__ */ r("div", { className: "absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/40 rounded-full cursor-pointer", children: /* @__PURE__ */ r(
|
|
284
|
-
d,
|
|
285
|
-
{
|
|
286
|
-
triggerLabel: /* @__PURE__ */ r(oe, { className: "h-6 w-6 text-white" }),
|
|
287
|
-
triggerVariant: "ghost",
|
|
288
|
-
title: t("customer_profile"),
|
|
289
|
-
onSelect: re,
|
|
290
|
-
accept: (n) => n.file_type.startsWith("image/"),
|
|
291
|
-
hideTrigger: !1
|
|
292
|
-
}
|
|
293
|
-
) })
|
|
294
|
-
] }),
|
|
295
|
-
!d && /* @__PURE__ */ a("div", { className: "w-full", children: [
|
|
296
|
-
/* @__PURE__ */ r(c, { htmlFor: "avatar_url", className: "sr-only", children: t("avatar_url") }),
|
|
297
|
-
/* @__PURE__ */ r(m, { id: "avatar_url", ..._("avatar_url"), placeholder: "https://...", className: "mt-2" })
|
|
298
|
-
] }),
|
|
299
|
-
/* @__PURE__ */ a("div", { className: "w-full space-y-1 text-left mt-4", children: [
|
|
300
|
-
/* @__PURE__ */ r("div", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wider", children: t("identity") }),
|
|
301
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ r("span", { className: "font-semibold text-lg", children: v("full_name") || t("full_name") }) }),
|
|
302
|
-
$ && /* @__PURE__ */ a(ge, { variant: "secondary", className: "mt-2 w-fit gap-1", children: [
|
|
303
|
-
/* @__PURE__ */ r(F, { className: "h-3 w-3" }),
|
|
304
|
-
" ",
|
|
305
|
-
t("github_connected") || "GitHub Connected"
|
|
306
|
-
] })
|
|
307
|
-
] }),
|
|
308
|
-
h?.length ? /* @__PURE__ */ r(
|
|
309
|
-
Ie,
|
|
310
|
-
{
|
|
311
|
-
links: h,
|
|
312
|
-
className: "mt-2 text-left"
|
|
313
|
-
}
|
|
314
|
-
) : null
|
|
315
|
-
] })
|
|
316
|
-
] }),
|
|
317
|
-
/* @__PURE__ */ r(B, { className: "md:col-span-8", children: /* @__PURE__ */ a("form", { onSubmit: Z(ae), children: [
|
|
318
|
-
/* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(j, { children: t("details") }) }),
|
|
319
|
-
/* @__PURE__ */ a(D, { className: "space-y-6", children: [
|
|
320
|
-
s && /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
321
|
-
/* @__PURE__ */ a(c, { htmlFor: "email", children: [
|
|
322
|
-
t("email") || "Email",
|
|
323
|
-
" (Read-only)"
|
|
324
|
-
] }),
|
|
325
|
-
/* @__PURE__ */ r(m, { id: "email", value: s, readOnly: !0, disabled: !0, className: "bg-muted/50" })
|
|
326
|
-
] }),
|
|
327
|
-
/* @__PURE__ */ r("div", { className: "rounded-xl border bg-muted/20 p-4 text-sm text-muted-foreground", children: t("profile_basic_info_help") }),
|
|
328
|
-
/* @__PURE__ */ a("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
329
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
330
|
-
/* @__PURE__ */ a(c, { htmlFor: "full_name", className: "flex items-center gap-2", children: [
|
|
331
|
-
/* @__PURE__ */ r(V, { className: "h-4 w-4" }),
|
|
332
|
-
" ",
|
|
333
|
-
t("full_name")
|
|
334
|
-
] }),
|
|
335
|
-
/* @__PURE__ */ r(m, { id: "full_name", ..._("full_name") })
|
|
336
|
-
] }),
|
|
337
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
338
|
-
/* @__PURE__ */ a(c, { htmlFor: "phone", className: "flex items-center gap-2", children: [
|
|
339
|
-
/* @__PURE__ */ r(ce, { className: "h-4 w-4" }),
|
|
340
|
-
" ",
|
|
341
|
-
t("phone_number")
|
|
342
|
-
] }),
|
|
343
|
-
/* @__PURE__ */ r(m, { id: "phone", ..._("phone") })
|
|
344
|
-
] })
|
|
345
|
-
] }),
|
|
346
|
-
/* @__PURE__ */ a("div", { className: "grid gap-4 md:grid-cols-2", children: [
|
|
347
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
348
|
-
/* @__PURE__ */ a(c, { htmlFor: "website", className: "flex items-center gap-2", children: [
|
|
349
|
-
/* @__PURE__ */ r(de, { className: "h-4 w-4" }),
|
|
350
|
-
" ",
|
|
351
|
-
t("website")
|
|
352
|
-
] }),
|
|
353
|
-
/* @__PURE__ */ r(m, { id: "website", ..._("website"), placeholder: "https://example.com" })
|
|
354
|
-
] }),
|
|
355
|
-
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
356
|
-
/* @__PURE__ */ a(c, { htmlFor: "github_username", className: "flex items-center gap-2", children: [
|
|
357
|
-
/* @__PURE__ */ r(F, { className: "h-4 w-4" }),
|
|
358
|
-
" ",
|
|
359
|
-
t("github_username")
|
|
360
|
-
] }),
|
|
361
|
-
$ ? /* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
362
|
-
/* @__PURE__ */ r(m, { id: "github_username", ..._("github_username"), disabled: !0, className: "bg-muted" }),
|
|
363
|
-
L && /* @__PURE__ */ a("p", { className: "text-xs text-muted-foreground flex items-center gap-1", children: [
|
|
364
|
-
/* @__PURE__ */ r(me, { className: "h-3 w-3" }),
|
|
365
|
-
" ",
|
|
366
|
-
t("linked_to") || "Linked to",
|
|
367
|
-
" ",
|
|
368
|
-
L
|
|
369
|
-
] })
|
|
370
|
-
] }) : /* @__PURE__ */ a(G, { type: "button", variant: "outline", className: "w-full", onClick: ee, children: [
|
|
371
|
-
/* @__PURE__ */ r(F, { className: "mr-2 h-4 w-4" }),
|
|
372
|
-
t("connect_github")
|
|
373
|
-
] })
|
|
374
|
-
] })
|
|
375
|
-
] }),
|
|
376
|
-
/* @__PURE__ */ r(xe, { className: "my-2" }),
|
|
377
|
-
/* @__PURE__ */ r(X, { prefix: "billing_address", title: t("billing_address"), register: _ }),
|
|
378
|
-
/* @__PURE__ */ a("div", { className: "flex items-center space-x-3 rounded-lg border p-4", children: [
|
|
379
|
-
/* @__PURE__ */ r(
|
|
380
|
-
fe,
|
|
381
|
-
{
|
|
382
|
-
id: "use_billing_for_shipping",
|
|
383
|
-
checked: !!k,
|
|
384
|
-
onCheckedChange: (n) => g("use_billing_for_shipping", !!n, { shouldDirty: !0 })
|
|
385
|
-
}
|
|
386
|
-
),
|
|
387
|
-
/* @__PURE__ */ a("div", { className: "space-y-1", children: [
|
|
388
|
-
/* @__PURE__ */ r(c, { htmlFor: "use_billing_for_shipping", className: "cursor-pointer", children: t("use_billing_for_shipping") }),
|
|
389
|
-
/* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: t("profile_use_billing_for_shipping_help") })
|
|
390
|
-
] })
|
|
391
|
-
] }),
|
|
392
|
-
!k && /* @__PURE__ */ r(
|
|
393
|
-
X,
|
|
394
|
-
{
|
|
395
|
-
prefix: "shipping_address",
|
|
396
|
-
title: t("shipping_address"),
|
|
397
|
-
register: _
|
|
398
|
-
}
|
|
399
|
-
),
|
|
400
|
-
P && /* @__PURE__ */ r(
|
|
401
|
-
"div",
|
|
402
|
-
{
|
|
403
|
-
className: `mt-4 rounded-xl border p-4 text-sm ${P.type === "success" ? "border-emerald-200 bg-emerald-50 text-emerald-700" : "border-red-200 bg-red-50 text-red-700"}`,
|
|
404
|
-
children: P.text
|
|
405
|
-
}
|
|
406
|
-
),
|
|
407
|
-
l && /* @__PURE__ */ a("div", { className: "border-t pt-4 mt-4", children: [
|
|
408
|
-
/* @__PURE__ */ r("h3", { className: "text-sm font-medium mb-3", children: "Admin Settings" }),
|
|
409
|
-
/* @__PURE__ */ a("div", { className: "grid gap-2", children: [
|
|
410
|
-
/* @__PURE__ */ r(c, { htmlFor: "role", children: "Role" }),
|
|
411
|
-
/* @__PURE__ */ a(
|
|
412
|
-
be,
|
|
413
|
-
{
|
|
414
|
-
value: v("role") || "USER",
|
|
415
|
-
onValueChange: (n) => g("role", n),
|
|
416
|
-
children: [
|
|
417
|
-
/* @__PURE__ */ r(ye, { children: /* @__PURE__ */ r(ve, { placeholder: "Select role" }) }),
|
|
418
|
-
/* @__PURE__ */ a(Ne, { children: [
|
|
419
|
-
/* @__PURE__ */ r(I, { value: "USER", children: "User" }),
|
|
420
|
-
/* @__PURE__ */ r(I, { value: "WRITER", children: "Writer" }),
|
|
421
|
-
/* @__PURE__ */ r(I, { value: "ADMIN", children: "Admin" })
|
|
422
|
-
] })
|
|
423
|
-
]
|
|
424
|
-
}
|
|
425
|
-
)
|
|
426
|
-
] })
|
|
427
|
-
] })
|
|
428
|
-
] }),
|
|
429
|
-
/* @__PURE__ */ r(_e, { className: "flex justify-end", children: /* @__PURE__ */ r(G, { type: "submit", disabled: A, size: "lg", children: t(A ? "saving" : "save_changes") }) })
|
|
430
|
-
] }) })
|
|
431
|
-
] });
|
|
432
|
-
}
|
|
1
|
+
import { CartDrawer as o } from "./lib/components/CartDrawer.es.js";
|
|
2
|
+
import { Cart as a } from "./lib/components/Cart.es.js";
|
|
3
|
+
import { Checkout as n } from "./lib/components/Checkout.es.js";
|
|
4
|
+
import { CartIcon as m } from "./lib/components/CartIcon.es.js";
|
|
5
|
+
import { CouponForm as l } from "./lib/components/CouponForm.es.js";
|
|
6
|
+
import { CurrencySwitcher as d } from "./lib/components/CurrencySwitcher.es.js";
|
|
7
|
+
import { AddToCartButton as C } from "./lib/components/AddToCartButton.es.js";
|
|
8
|
+
import { ProductCard as x } from "./lib/components/ProductCard.es.js";
|
|
9
|
+
import { ProductGrid as g } from "./lib/components/ProductGrid.es.js";
|
|
10
|
+
import { ProductGallery as v } from "./lib/components/ProductGallery.es.js";
|
|
11
|
+
import { FeaturedProduct as S } from "./lib/components/FeaturedProduct.es.js";
|
|
12
|
+
import { CustomerProfileForm as D } from "./lib/components/CustomerProfileForm.es.js";
|
|
13
|
+
import { SubscriptionSelector as R } from "./lib/components/SubscriptionSelector.es.js";
|
|
14
|
+
import { InvoiceDocument as E } from "./lib/components/InvoiceDocument.es.js";
|
|
15
|
+
import { InvoiceViewerShell as L } from "./lib/components/InvoiceViewerShell.es.js";
|
|
16
|
+
import { AccountNavigationMenu as z } from "./lib/components/AccountNavigationMenu.es.js";
|
|
17
|
+
import { SimpleTiptapRenderer as N } from "./lib/components/SimpleTiptapRenderer.es.js";
|
|
18
|
+
import { ProductForm as M } from "./lib/pages/cms/products/components/ProductForm.es.js";
|
|
19
|
+
import { ProductCategorySelector as w } from "./lib/pages/cms/products/components/ProductCategorySelector.es.js";
|
|
20
|
+
import { getCartItemActivePrice as U, useCartStore as k, useCartSubtotal as B, useCartTotalItems as K } from "./lib/cart-store.es.js";
|
|
21
|
+
import { emptyProviderDiscounts as q, getCartLineCouponKey as H, normalizeCouponCode as J } from "./lib/coupons.es.js";
|
|
22
|
+
import { CurrencyProvider as j, useCurrency as Q } from "./lib/CurrencyProvider.es.js";
|
|
23
|
+
import { CURRENCY_ROUNDING_MODES as Z, applyCurrencyRounding as $, convertMinorUnitAmount as ee, describeCurrencyRoundingRule as re, getCurrencyLookup as oe, getDefaultCurrency as te, getExchangeRateForCurrency as ae, inferCurrencyCodeFromLocale as ie, isSaleWindowActive as ne, isScheduledPriceDue as ce, normalizeCurrencyRecord as me, normalizeCurrencyRoundingMode as ue, normalizePriceMap as le, normalizeSalePriceMap as se, resolveEffectivePriceForCurrency as de, resolvePriceForCurrency as pe, resolvePriceRangeForCurrency as Ce, sortCurrencies as fe } from "./lib/currency.es.js";
|
|
24
|
+
import { useCurrencyPreferenceStore as Pe } from "./lib/currency-store.es.js";
|
|
25
|
+
import { useCart as ye, useIsCartHydrated as ve } from "./lib/use-cart.es.js";
|
|
26
|
+
import { addressesMatch as Se, emptyCustomerAddress as Ie, isCustomerAddressComplete as De, normalizeCustomerAddress as be, normalizeOrderCustomerDetails as Re } from "./lib/customer.es.js";
|
|
27
|
+
import { DEFAULT_ENABLED_PAYMENT_PROVIDERS as Ee, derivePaymentProviderFromProductType as Fe, getProductPaymentProvider as Le, isDigitalItem as Oe, isDigitalProduct as ze, normalizeEnabledPaymentProviders as Ve } from "./lib/types.es.js";
|
|
28
|
+
import { getTrialCheckoutMode as he, getTrialLabel as Me, getTrialPaymentRequirementLabel as _e, getTrialPeriodDays as we, getTrialSummary as Ge } from "./lib/trials.es.js";
|
|
29
|
+
import { aggregateOrderTaxLines as ke, buildOrderTaxDetailsFromCalculation as Be, buildOrderTaxDetailsFromStripeSession as Ke, getOrderTaxRateJurisdiction as Ye, getOrderTaxRateLabel as qe, getOrderTaxRatePercentage as He, normalizeOrderTaxDetails as Je } from "./lib/order-tax-details.es.js";
|
|
30
|
+
import { DEFAULT_INVOICE_SETTINGS as je, INVOICE_SETTINGS_KEY as Qe, formatInvoiceCurrency as Xe, formatInvoiceDate as Ze, getInvoiceAddressLines as $e, normalizeInvoiceSettings as er, serializeInvoiceSettings as rr } from "./lib/invoice.es.js";
|
|
31
|
+
import { buildInvoiceDocumentLabels as tr, getInvoiceLocale as ar, localizeInvoicePresentationData as ir, translateOrFallback as nr, translateOrderStatus as cr } from "./lib/invoice-ui.es.js";
|
|
32
|
+
import { productSchema as ur } from "./lib/product-schema.es.js";
|
|
33
|
+
import { ProductProvider as sr, useProduct as dr } from "./lib/product-context.es.js";
|
|
34
|
+
import { ProductDetailsLayout as Cr } from "./lib/components/ProductDetailsLayout.es.js";
|
|
35
|
+
import { buildCombinationKey as xr, buildVariantLabel as Pr, chooseInitialVariantSelections as gr, extractSelectedTermsByAttribute as yr, findMatchingVariant as vr, generateVariantDrafts as Tr, getAvailableTermIdsForAttribute as Sr, getVariantEffectivePriceRange as Ir, mapRawVariantRelations as Dr, normalizeSelectionsToAvailableVariants as br, resolveAttributeName as Rr, resolveTermValue as Ar, resolveTranslatedText as Er } from "./lib/variation-utils.es.js";
|
|
433
36
|
export {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
37
|
+
z as AccountNavigationMenu,
|
|
38
|
+
C as AddToCartButton,
|
|
39
|
+
Z as CURRENCY_ROUNDING_MODES,
|
|
40
|
+
a as Cart,
|
|
41
|
+
o as CartDrawer,
|
|
42
|
+
m as CartIcon,
|
|
43
|
+
n as Checkout,
|
|
44
|
+
l as CouponForm,
|
|
45
|
+
j as CurrencyProvider,
|
|
46
|
+
d as CurrencySwitcher,
|
|
47
|
+
D as CustomerProfileForm,
|
|
48
|
+
Ee as DEFAULT_ENABLED_PAYMENT_PROVIDERS,
|
|
49
|
+
je as DEFAULT_INVOICE_SETTINGS,
|
|
50
|
+
S as FeaturedProduct,
|
|
51
|
+
Qe as INVOICE_SETTINGS_KEY,
|
|
52
|
+
E as InvoiceDocument,
|
|
53
|
+
L as InvoiceViewerShell,
|
|
54
|
+
x as ProductCard,
|
|
55
|
+
w as ProductCategorySelector,
|
|
56
|
+
Cr as ProductDetailsLayout,
|
|
57
|
+
M as ProductForm,
|
|
58
|
+
v as ProductGallery,
|
|
59
|
+
g as ProductGrid,
|
|
60
|
+
sr as ProductProvider,
|
|
61
|
+
N as SimpleTiptapRenderer,
|
|
62
|
+
R as SubscriptionSelector,
|
|
63
|
+
Se as addressesMatch,
|
|
64
|
+
ke as aggregateOrderTaxLines,
|
|
65
|
+
$ as applyCurrencyRounding,
|
|
66
|
+
xr as buildCombinationKey,
|
|
67
|
+
tr as buildInvoiceDocumentLabels,
|
|
68
|
+
Be as buildOrderTaxDetailsFromCalculation,
|
|
69
|
+
Ke as buildOrderTaxDetailsFromStripeSession,
|
|
70
|
+
Pr as buildVariantLabel,
|
|
71
|
+
gr as chooseInitialVariantSelections,
|
|
72
|
+
ee as convertMinorUnitAmount,
|
|
73
|
+
Fe as derivePaymentProviderFromProductType,
|
|
74
|
+
re as describeCurrencyRoundingRule,
|
|
75
|
+
Ie as emptyCustomerAddress,
|
|
76
|
+
q as emptyProviderDiscounts,
|
|
77
|
+
yr as extractSelectedTermsByAttribute,
|
|
78
|
+
vr as findMatchingVariant,
|
|
79
|
+
Xe as formatInvoiceCurrency,
|
|
80
|
+
Ze as formatInvoiceDate,
|
|
81
|
+
Tr as generateVariantDrafts,
|
|
82
|
+
Sr as getAvailableTermIdsForAttribute,
|
|
83
|
+
U as getCartItemActivePrice,
|
|
84
|
+
H as getCartLineCouponKey,
|
|
85
|
+
oe as getCurrencyLookup,
|
|
86
|
+
te as getDefaultCurrency,
|
|
87
|
+
ae as getExchangeRateForCurrency,
|
|
88
|
+
$e as getInvoiceAddressLines,
|
|
89
|
+
ar as getInvoiceLocale,
|
|
90
|
+
Ye as getOrderTaxRateJurisdiction,
|
|
91
|
+
qe as getOrderTaxRateLabel,
|
|
92
|
+
He as getOrderTaxRatePercentage,
|
|
93
|
+
Le as getProductPaymentProvider,
|
|
94
|
+
he as getTrialCheckoutMode,
|
|
95
|
+
Me as getTrialLabel,
|
|
96
|
+
_e as getTrialPaymentRequirementLabel,
|
|
97
|
+
we as getTrialPeriodDays,
|
|
98
|
+
Ge as getTrialSummary,
|
|
99
|
+
Ir as getVariantEffectivePriceRange,
|
|
100
|
+
ie as inferCurrencyCodeFromLocale,
|
|
101
|
+
De as isCustomerAddressComplete,
|
|
102
|
+
Oe as isDigitalItem,
|
|
103
|
+
ze as isDigitalProduct,
|
|
104
|
+
ne as isSaleWindowActive,
|
|
105
|
+
ce as isScheduledPriceDue,
|
|
106
|
+
ir as localizeInvoicePresentationData,
|
|
107
|
+
Dr as mapRawVariantRelations,
|
|
108
|
+
J as normalizeCouponCode,
|
|
109
|
+
me as normalizeCurrencyRecord,
|
|
110
|
+
ue as normalizeCurrencyRoundingMode,
|
|
111
|
+
be as normalizeCustomerAddress,
|
|
112
|
+
Ve as normalizeEnabledPaymentProviders,
|
|
113
|
+
er as normalizeInvoiceSettings,
|
|
114
|
+
Re as normalizeOrderCustomerDetails,
|
|
115
|
+
Je as normalizeOrderTaxDetails,
|
|
116
|
+
le as normalizePriceMap,
|
|
117
|
+
se as normalizeSalePriceMap,
|
|
118
|
+
br as normalizeSelectionsToAvailableVariants,
|
|
119
|
+
ur as productSchema,
|
|
120
|
+
Rr as resolveAttributeName,
|
|
121
|
+
de as resolveEffectivePriceForCurrency,
|
|
122
|
+
pe as resolvePriceForCurrency,
|
|
123
|
+
Ce as resolvePriceRangeForCurrency,
|
|
124
|
+
Ar as resolveTermValue,
|
|
125
|
+
Er as resolveTranslatedText,
|
|
126
|
+
rr as serializeInvoiceSettings,
|
|
127
|
+
fe as sortCurrencies,
|
|
128
|
+
nr as translateOrFallback,
|
|
129
|
+
cr as translateOrderStatus,
|
|
130
|
+
ye as useCart,
|
|
131
|
+
k as useCartStore,
|
|
132
|
+
B as useCartSubtotal,
|
|
133
|
+
K as useCartTotalItems,
|
|
134
|
+
Q as useCurrency,
|
|
135
|
+
Pe as useCurrencyPreferenceStore,
|
|
136
|
+
ve as useIsCartHydrated,
|
|
137
|
+
dr as useProduct
|
|
535
138
|
};
|