@cimplify/sdk 0.110.2 → 0.111.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.
- package/CHANGELOG.md +54 -0
- package/README.md +18 -0
- package/dist/advanced.d.mts +4 -4
- package/dist/advanced.d.ts +4 -4
- package/dist/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{catalogue-OTuS5zp-.d.ts → catalogue-1QcoGDO6.d.ts} +2 -2
- package/dist/{catalogue-CPTMyBUz.d.mts → catalogue-FdFQiWrU.d.mts} +2 -2
- package/dist/{chunk-SYEO2WV4.mjs → chunk-42JTCWIE.mjs} +3 -3
- package/dist/{chunk-OMTVH334.js → chunk-6QANXRUM.js} +203 -186
- package/dist/{chunk-6ETDAU62.mjs → chunk-B45X3HPO.mjs} +98 -39
- package/dist/{chunk-MKIJQL5Q.js → chunk-CJVEJPIG.js} +69 -69
- package/dist/{chunk-Q2Y3VMKH.js → chunk-ETZDIISN.js} +151 -151
- package/dist/{chunk-GCKWKLZF.mjs → chunk-FT6GFYJL.mjs} +17 -3
- package/dist/{chunk-A36JRXXH.mjs → chunk-KWZHIPRN.mjs} +26 -9
- package/dist/{chunk-SNNEOS5Z.js → chunk-MHDUUSG6.js} +75 -75
- package/dist/{chunk-UCR5HRYM.js → chunk-NFXCKTE2.js} +17 -3
- package/dist/{chunk-DFZWHNRG.js → chunk-QOCHWR4V.js} +105 -42
- package/dist/{chunk-IZDWAL53.mjs → chunk-UJDQQTBS.mjs} +8 -8
- package/dist/{chunk-BTUSVHIE.mjs → chunk-WLSU5QJT.mjs} +2 -2
- package/dist/{client-dqOhP9Nc.d.ts → client-CChON4-x.d.ts} +2 -2
- package/dist/{client-CX_WR0-J.d.mts → client-EeuGm5gj.d.mts} +2 -2
- package/dist/{elements-DdsRig-2.d.mts → elements-ss9xZgRg.d.mts} +27 -1
- package/dist/{elements-DdsRig-2.d.ts → elements-ss9xZgRg.d.ts} +27 -1
- package/dist/index-BB2gjVvA.d.mts +153 -0
- package/dist/index-BEfmBDAH.d.ts +153 -0
- package/dist/{index-B98Xac8e.d.ts → index-DQK8sTfu.d.ts} +2 -2
- package/dist/{index-DbAN_VQE.d.mts → index-DSVkhRmW.d.mts} +2 -2
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +189 -177
- package/dist/index.mjs +8 -8
- package/dist/mock/cli.mjs +25 -10
- package/dist/mock/library.js +25 -10
- package/dist/mock/library.mjs +25 -10
- package/dist/mock/msw.js +25 -10
- package/dist/mock/msw.mjs +25 -10
- package/dist/{price-BOzexBww.d.mts → price-B-w4PwHm.d.mts} +1 -1
- package/dist/{price-C1h9sPxE.d.ts → price-BEvQFNJv.d.ts} +1 -1
- package/dist/react.d.mts +23 -15
- package/dist/react.d.ts +23 -15
- package/dist/react.js +254 -237
- package/dist/react.mjs +128 -111
- package/dist/{scheduling-D2ajXpMC.d.ts → scheduling-D9WwOxbo.d.ts} +1 -1
- package/dist/{scheduling-DSRbbaZb.d.mts → scheduling-DDmrYCr-.d.mts} +1 -1
- package/dist/{server-D29IIuDV.d.ts → server-BiKwxvnf.d.ts} +2 -2
- package/dist/{server-DQMWPnc8.d.mts → server-DPdtl2dd.d.mts} +2 -2
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +10 -10
- package/dist/server.mjs +4 -4
- package/dist/styles.css +1 -1
- package/dist/testing/msw.d.mts +3 -3
- package/dist/testing/msw.d.ts +3 -3
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +25 -25
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +117 -117
- package/dist/testing.mjs +7 -7
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +44 -32
- package/dist/utils.mjs +2 -2
- package/package.json +5 -3
- package/registry/cart-summary.json +1 -1
- package/registry/chat-widget.json +1 -1
- package/registry/price.json +1 -1
- package/registry/product-customizer.json +1 -1
- package/registry/search-input.json +1 -1
- package/dist/index-6gkHMGAq.d.mts +0 -86
- package/dist/index-B_ByTtIT.d.ts +0 -86
package/dist/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export { SHOPPER_RESCHEDULE_TYPE } from './chunk-76L2V6KD.mjs';
|
|
2
2
|
export { BOUNDARY_KIND, CIMPLIFY_CDN_HOSTS, DEFAULT_CDN_BASE_URL, DURATION_UNIT, INPUT_FIELD_TYPE, PRODUCT_TYPE, RENDER_HINT, allGalleryImages, assetUrl, chatMessageCards, displaysGrossPrices, getVariantDisplayName, isCimplifyAsset, isMultiDayService, priceBasisLabel, resolveGallery, serviceBillingMultiplier, stayLength, stayPeriods, transformToCheckoutCart } from './chunk-LUY45X3U.mjs';
|
|
3
3
|
export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-WIZRUIZB.mjs';
|
|
4
|
-
import { isTransientPurchaseIntentError } from './chunk-
|
|
5
|
-
export { ActivityService, CONTENT_SHA256_HEADER, CimplifyClient, DeliveryService, HostedPurchaseIntentService, PURCHASE_INTENT_ROUTE, PlacesService, PurchaseIntentResolver, PurchaseIntentService, SESSION_CHANGE_SOURCE, SessionService, StoreCreditQueries, SubscriptionService, SupportService, UploadService, contentSha256, createCimplifyClient, isTransientPurchaseIntentError } from './chunk-
|
|
4
|
+
import { isTransientPurchaseIntentError } from './chunk-WLSU5QJT.mjs';
|
|
5
|
+
export { ActivityService, CONTENT_SHA256_HEADER, CimplifyClient, DeliveryService, HostedPurchaseIntentService, PURCHASE_INTENT_ROUTE, PlacesService, PurchaseIntentResolver, PurchaseIntentService, SESSION_CHANGE_SOURCE, SessionService, StoreCreditQueries, SubscriptionService, SupportService, UploadService, contentSha256, createCimplifyClient, isTransientPurchaseIntentError } from './chunk-WLSU5QJT.mjs';
|
|
6
6
|
import './chunk-SWX4SALA.mjs';
|
|
7
|
-
import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-
|
|
8
|
-
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENTS_AUTH_CONTACT_TYPES, ELEMENTS_AUTH_MODES, ELEMENTS_AUTH_PROMPTS, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, PAYMENT_AUTHORIZATION_OUTCOME_STATUS, PAYMENT_AUTHORIZATION_PROVIDER, PaymentAuthorizationAdapterRegistry, PaystackAuthorizationAdapter, SchedulingService, StripeAuthorizationAdapter, clearIntentIdempotencyKey as clearPurchaseIntentIdempotencyKey, combine, combineObject, confirmationForUnchangedReplacement, createDefaultPaymentAuthorizationAdapterRegistry, createElements, createPurchaseIntentConfirmation, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, intentIdempotencyKey as purchaseIntentIdempotencyKey, purchaseIntentRequiresPaymentOption, selectPurchaseIntentPaymentOption, startSignIn, toNullable, tryCatch, unwrap } from './chunk-
|
|
7
|
+
import { getAuthorizationEndpoint, DEFAULT_ISSUER, generatePkce, generateState } from './chunk-KWZHIPRN.mjs';
|
|
8
|
+
export { AuthService, BusinessService, CartOperations, CatalogueQueries, CheckoutService as CheckoutOperations, CheckoutService, CimplifyElement, CimplifyElements, ELEMENTS_AUTH_CONTACT_TYPES, ELEMENTS_AUTH_MODES, ELEMENTS_AUTH_PROMPTS, ELEMENT_TYPES, EVENT_TYPES, FxService, InventoryService, LinkService, LiteService, MESSAGE_TYPES, OrderQueries, PAYMENT_AUTHORIZATION_OUTCOME_STATUS, PAYMENT_AUTHORIZATION_PROVIDER, PaymentAuthorizationAdapterRegistry, PaystackAuthorizationAdapter, SchedulingService, StripeAuthorizationAdapter, clearIntentIdempotencyKey as clearPurchaseIntentIdempotencyKey, combine, combineObject, confirmationForUnchangedReplacement, createDefaultPaymentAuthorizationAdapterRegistry, createElements, createPurchaseIntentConfirmation, err, flatMap, fromPromise, generateIdempotencyKey, getOrElse, isErr, isOk, mapError, mapResult, ok, intentIdempotencyKey as purchaseIntentIdempotencyKey, purchaseIntentRequiresPaymentOption, selectPurchaseIntentPaymentOption, startSignIn, toNullable, tryCatch, unwrap } from './chunk-KWZHIPRN.mjs';
|
|
9
9
|
export { AUTHORIZATION_TYPE, AUTH_MUTATION, CHECKOUT_MODE, CHECKOUT_MUTATION, CHECKOUT_NEXT_ACTION, CHECKOUT_ORDER_RESULT_STATUS, CHECKOUT_STATUS, CHECKOUT_STEP, CONTACT_TYPE, DEFAULT_COUNTRY, DEFAULT_CURRENCY, DEVICE_TYPE, LINK_MUTATION, LINK_QUERY, MAX_PAYMENT_AUTHORIZATION_STEPS, MOBILE_MONEY_PROVIDER, ORDER_MUTATION, ORDER_TYPE, PAYMENT_METHOD, PAYMENT_MUTATION, PAYMENT_STATE, PICKUP_TIME_TYPE, SAVE_DETAILS_CONSENT } from './chunk-E6QQKDNE.mjs';
|
|
10
|
-
import { parsePrice } from './chunk-
|
|
11
|
-
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, PAYMENT_TERMINAL_FAILURE_STATUSES, canonicalMobileMoneyProvider, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice, paymentAuthorizationUrl, purchaseIntentMobileMoneyNetwork } from './chunk-
|
|
12
|
-
import { ErrorCode, PURCHASE_INTENT_RESOLUTION_KIND } from './chunk-
|
|
13
|
-
export { CHECKOUT_COMPLIANCE_LANE, CHECKOUT_COMPLIANCE_REASON, CHECKOUT_INVALIDATION_REASON, CHECKOUT_MATERIAL_TERMS_COMPONENT, CHECKOUT_PROTECTION_STATUS, CHECKOUT_PURCHASE_SURFACE, CHECKOUT_TERMS_COMPONENT, CHECKOUT_TERMS_DELTA_KIND, CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, LEGACY_CHECKOUT_PAYMENT_METHOD_ALIAS, LEGACY_CHECKOUT_PAYMENT_STATUS, MOBILE_MONEY_TENDER_AUTHORITY_KIND, NATIVE_PURCHASE_PLATFORM, PAYMENT_COLLECTION_MODE, PAYMENT_INSTRUMENT_DISPLAY_KIND, PAYMENT_OPTION_NEXT_ACTION, PAYMENT_OPTION_STATUS, PURCHASE_DISPOSITION, PURCHASE_INTENT_ACTION_DECISION, PURCHASE_INTENT_CONFIRM_STATUS, PURCHASE_INTENT_ERROR_CODE, PURCHASE_INTENT_LINE_CONFIGURATION_KIND, PURCHASE_INTENT_MOBILE_MONEY_NETWORK, PURCHASE_INTENT_OFFER_KIND, PURCHASE_INTENT_PAYMENT_METHOD, PURCHASE_INTENT_PAYMENT_PROVIDER, PURCHASE_INTENT_RESOLUTION_KIND, PURCHASE_INTENT_RESOLVE_STATUS, PURCHASE_INTENT_SELLABLE_KIND, PURCHASE_INTENT_SOURCE_KIND, PURCHASE_INTENT_STATUS, PURCHASE_SURFACE, PURCHASING_PRINCIPAL_KIND, SOURCE_REFUSAL, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-
|
|
10
|
+
import { parsePrice } from './chunk-B45X3HPO.mjs';
|
|
11
|
+
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, PAYMENT_TERMINAL_FAILURE_STATUSES, PRICE_UNAVAILABLE_LABEL, canonicalMobileMoneyProvider, categorizePaymentError, currencyFractionDigits, detectMobileMoneyProvider, formatCurrencyAmount, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceRange, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getPriceRange, getProductCurrency, getTaxAmount, getUnitPriceAtQuantity, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice, paymentAuthorizationUrl, purchaseIntentMobileMoneyNetwork } from './chunk-B45X3HPO.mjs';
|
|
12
|
+
import { ErrorCode, PURCHASE_INTENT_RESOLUTION_KIND } from './chunk-FT6GFYJL.mjs';
|
|
13
|
+
export { CHECKOUT_COMPLIANCE_LANE, CHECKOUT_COMPLIANCE_REASON, CHECKOUT_INVALIDATION_REASON, CHECKOUT_MATERIAL_TERMS_COMPONENT, CHECKOUT_PROTECTION_STATUS, CHECKOUT_PURCHASE_SURFACE, CHECKOUT_TERMS_COMPONENT, CHECKOUT_TERMS_DELTA_KIND, CimplifyError, ERROR_HINTS, ErrorCode, IdempotencyMismatchError, LEGACY_CHECKOUT_PAYMENT_METHOD_ALIAS, LEGACY_CHECKOUT_PAYMENT_STATUS, MOBILE_MONEY_TENDER_AUTHORITY_KIND, NATIVE_PURCHASE_PLATFORM, PAYMENT_COLLECTION_MODE, PAYMENT_INSTRUMENT_DISPLAY_KIND, PAYMENT_OPTION_NEXT_ACTION, PAYMENT_OPTION_STATUS, PURCHASE_DISPOSITION, PURCHASE_INTENT_ACTION_DECISION, PURCHASE_INTENT_CONFIRM_STATUS, PURCHASE_INTENT_ERROR_CODE, PURCHASE_INTENT_LINE_CONFIGURATION_KIND, PURCHASE_INTENT_MOBILE_MONEY_NETWORK, PURCHASE_INTENT_OFFER_KIND, PURCHASE_INTENT_PAYMENT_METHOD, PURCHASE_INTENT_PAYMENT_PROVIDER, PURCHASE_INTENT_RESOLUTION_KIND, PURCHASE_INTENT_RESOLVE_STATUS, PURCHASE_INTENT_SELLABLE_KIND, PURCHASE_INTENT_SOURCE_KIND, PURCHASE_INTENT_STATUS, PURCHASE_SURFACE, PURCHASING_PRINCIPAL_KIND, SOURCE_REFUSAL, ZERO, currencyCode, enrichError, getErrorHint, isCimplifyError, isIdempotencyMismatchError, isQuoteConflictRequiringConsent, isQuoteError, isRetryableError, isSupportedCurrency, money, moneyFromNumber } from './chunk-FT6GFYJL.mjs';
|
|
14
14
|
import './chunk-25T4JHEA.mjs';
|
|
15
15
|
|
|
16
16
|
// src/checkout-controller.ts
|
package/dist/mock/cli.mjs
CHANGED
|
@@ -3272,7 +3272,7 @@ var Hono2 = class extends Hono {
|
|
|
3272
3272
|
};
|
|
3273
3273
|
|
|
3274
3274
|
// src/types/common.ts
|
|
3275
|
-
var
|
|
3275
|
+
var CURRENCY_CODES = [
|
|
3276
3276
|
"USD",
|
|
3277
3277
|
"EUR",
|
|
3278
3278
|
"GBP",
|
|
@@ -3321,8 +3321,23 @@ var SUPPORTED_CURRENCY_CODES = /* @__PURE__ */ new Set([
|
|
|
3321
3321
|
"TWD",
|
|
3322
3322
|
"AED",
|
|
3323
3323
|
"SAR",
|
|
3324
|
-
"ILS"
|
|
3325
|
-
|
|
3324
|
+
"ILS",
|
|
3325
|
+
"BHD",
|
|
3326
|
+
"IQD",
|
|
3327
|
+
"JOD",
|
|
3328
|
+
"KWD",
|
|
3329
|
+
"LYD",
|
|
3330
|
+
"OMR",
|
|
3331
|
+
"TND",
|
|
3332
|
+
"CLP",
|
|
3333
|
+
"DJF",
|
|
3334
|
+
"ISK",
|
|
3335
|
+
"KMF",
|
|
3336
|
+
"PYG",
|
|
3337
|
+
"VUV",
|
|
3338
|
+
"XPF"
|
|
3339
|
+
];
|
|
3340
|
+
var SUPPORTED_CURRENCY_CODES = new Set(CURRENCY_CODES);
|
|
3326
3341
|
function isSupportedCurrency(code) {
|
|
3327
3342
|
return SUPPORTED_CURRENCY_CODES.has(code);
|
|
3328
3343
|
}
|
|
@@ -3552,7 +3567,6 @@ var CHECKOUT_ORDER_RESULT_STATUS = {
|
|
|
3552
3567
|
CONFIRMED: "confirmed"};
|
|
3553
3568
|
var AUTHORIZATION_TYPE = {
|
|
3554
3569
|
OTP: "otp"};
|
|
3555
|
-
var DEFAULT_CURRENCY = "GHS";
|
|
3556
3570
|
|
|
3557
3571
|
// src/types/purchase-intent.ts
|
|
3558
3572
|
var PURCHASE_INTENT_SOURCE_KIND = {
|
|
@@ -3621,6 +3635,7 @@ var SOURCE_REFUSAL = {
|
|
|
3621
3635
|
SOURCE_NOT_FOUND: "source_not_found"};
|
|
3622
3636
|
|
|
3623
3637
|
// src/mock/routes/v1.ts
|
|
3638
|
+
var MOBILE_MONEY_FIXTURE_CURRENCY = "GHS";
|
|
3624
3639
|
var PURCHASE_INTENT_ROUTE = {
|
|
3625
3640
|
COLLECTION: "/purchase-intents",
|
|
3626
3641
|
MEMBER: "/purchase-intents/:intent_id",
|
|
@@ -4015,7 +4030,7 @@ function buildV1(deps) {
|
|
|
4015
4030
|
}
|
|
4016
4031
|
return tryRoute(c, () => ({
|
|
4017
4032
|
presentment_currency: currency,
|
|
4018
|
-
options: currency ===
|
|
4033
|
+
options: currency === MOBILE_MONEY_FIXTURE_CURRENCY ? [
|
|
4019
4034
|
{ method: PAYMENT_METHOD.CARD, network: null },
|
|
4020
4035
|
{
|
|
4021
4036
|
method: PAYMENT_METHOD.MOBILE_MONEY,
|
|
@@ -10648,8 +10663,8 @@ function seedRetail(registry) {
|
|
|
10648
10663
|
};
|
|
10649
10664
|
registry.variantAxes.put(ramAxis.id, ramAxis);
|
|
10650
10665
|
registry.variantAxes.put(ssdAxis.id, ssdAxis);
|
|
10651
|
-
const
|
|
10652
|
-
const
|
|
10666
|
+
const ramAdjWhole = { "16": 0, "32": 2500 };
|
|
10667
|
+
const ssdAdjWhole = { "512": 0, "1tb": 1500, "2tb": 3500 };
|
|
10653
10668
|
const laptopVariantIds = [];
|
|
10654
10669
|
let firstLaptop = true;
|
|
10655
10670
|
for (const r of ramAxis.values) {
|
|
@@ -10657,7 +10672,7 @@ function seedRetail(registry) {
|
|
|
10657
10672
|
const ramKey = r.id.replace("axv_ram_", "");
|
|
10658
10673
|
const ssdKey = s.id.replace("axv_ssd_", "");
|
|
10659
10674
|
const id = `var_laptop_${ramKey}_${ssdKey}`;
|
|
10660
|
-
const adj = (
|
|
10675
|
+
const adj = `${(ramAdjWhole[ramKey] ?? 0) + (ssdAdjWhole[ssdKey] ?? 0)}.00`;
|
|
10661
10676
|
const variant = {
|
|
10662
10677
|
id,
|
|
10663
10678
|
product_id: "prod_laptop-pro",
|
|
@@ -12956,7 +12971,7 @@ var ID_PREFIX = {
|
|
|
12956
12971
|
product: "prod_",
|
|
12957
12972
|
service: "svc_"
|
|
12958
12973
|
};
|
|
12959
|
-
var
|
|
12974
|
+
var SEED_BUSINESS_CURRENCY = "GHS";
|
|
12960
12975
|
function slugify(value) {
|
|
12961
12976
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
12962
12977
|
}
|
|
@@ -12991,7 +13006,7 @@ function makeSeedContext(registry) {
|
|
|
12991
13006
|
const business = {
|
|
12992
13007
|
business_type: "other",
|
|
12993
13008
|
email: `hello@${handle}.test`,
|
|
12994
|
-
default_currency:
|
|
13009
|
+
default_currency: SEED_BUSINESS_CURRENCY,
|
|
12995
13010
|
default_offers_table_service: false,
|
|
12996
13011
|
default_accepts_online_orders: true,
|
|
12997
13012
|
status: "active",
|
package/dist/mock/library.js
CHANGED
|
@@ -2094,7 +2094,7 @@ var Hono2 = class extends Hono {
|
|
|
2094
2094
|
};
|
|
2095
2095
|
|
|
2096
2096
|
// src/types/common.ts
|
|
2097
|
-
var
|
|
2097
|
+
var CURRENCY_CODES = [
|
|
2098
2098
|
"USD",
|
|
2099
2099
|
"EUR",
|
|
2100
2100
|
"GBP",
|
|
@@ -2143,8 +2143,23 @@ var SUPPORTED_CURRENCY_CODES = /* @__PURE__ */ new Set([
|
|
|
2143
2143
|
"TWD",
|
|
2144
2144
|
"AED",
|
|
2145
2145
|
"SAR",
|
|
2146
|
-
"ILS"
|
|
2147
|
-
|
|
2146
|
+
"ILS",
|
|
2147
|
+
"BHD",
|
|
2148
|
+
"IQD",
|
|
2149
|
+
"JOD",
|
|
2150
|
+
"KWD",
|
|
2151
|
+
"LYD",
|
|
2152
|
+
"OMR",
|
|
2153
|
+
"TND",
|
|
2154
|
+
"CLP",
|
|
2155
|
+
"DJF",
|
|
2156
|
+
"ISK",
|
|
2157
|
+
"KMF",
|
|
2158
|
+
"PYG",
|
|
2159
|
+
"VUV",
|
|
2160
|
+
"XPF"
|
|
2161
|
+
];
|
|
2162
|
+
var SUPPORTED_CURRENCY_CODES = new Set(CURRENCY_CODES);
|
|
2148
2163
|
function isSupportedCurrency(code) {
|
|
2149
2164
|
return SUPPORTED_CURRENCY_CODES.has(code);
|
|
2150
2165
|
}
|
|
@@ -2374,7 +2389,6 @@ var CHECKOUT_ORDER_RESULT_STATUS = {
|
|
|
2374
2389
|
CONFIRMED: "confirmed"};
|
|
2375
2390
|
var AUTHORIZATION_TYPE = {
|
|
2376
2391
|
OTP: "otp"};
|
|
2377
|
-
var DEFAULT_CURRENCY = "GHS";
|
|
2378
2392
|
|
|
2379
2393
|
// src/types/purchase-intent.ts
|
|
2380
2394
|
var PURCHASE_INTENT_SOURCE_KIND = {
|
|
@@ -2443,6 +2457,7 @@ var SOURCE_REFUSAL = {
|
|
|
2443
2457
|
SOURCE_NOT_FOUND: "source_not_found"};
|
|
2444
2458
|
|
|
2445
2459
|
// src/mock/routes/v1.ts
|
|
2460
|
+
var MOBILE_MONEY_FIXTURE_CURRENCY = "GHS";
|
|
2446
2461
|
var PURCHASE_INTENT_ROUTE = {
|
|
2447
2462
|
COLLECTION: "/purchase-intents",
|
|
2448
2463
|
MEMBER: "/purchase-intents/:intent_id",
|
|
@@ -2837,7 +2852,7 @@ function buildV1(deps) {
|
|
|
2837
2852
|
}
|
|
2838
2853
|
return tryRoute(c, () => ({
|
|
2839
2854
|
presentment_currency: currency,
|
|
2840
|
-
options: currency ===
|
|
2855
|
+
options: currency === MOBILE_MONEY_FIXTURE_CURRENCY ? [
|
|
2841
2856
|
{ method: PAYMENT_METHOD.CARD, network: null },
|
|
2842
2857
|
{
|
|
2843
2858
|
method: PAYMENT_METHOD.MOBILE_MONEY,
|
|
@@ -9470,8 +9485,8 @@ function seedRetail(registry) {
|
|
|
9470
9485
|
};
|
|
9471
9486
|
registry.variantAxes.put(ramAxis.id, ramAxis);
|
|
9472
9487
|
registry.variantAxes.put(ssdAxis.id, ssdAxis);
|
|
9473
|
-
const
|
|
9474
|
-
const
|
|
9488
|
+
const ramAdjWhole = { "16": 0, "32": 2500 };
|
|
9489
|
+
const ssdAdjWhole = { "512": 0, "1tb": 1500, "2tb": 3500 };
|
|
9475
9490
|
const laptopVariantIds = [];
|
|
9476
9491
|
let firstLaptop = true;
|
|
9477
9492
|
for (const r of ramAxis.values) {
|
|
@@ -9479,7 +9494,7 @@ function seedRetail(registry) {
|
|
|
9479
9494
|
const ramKey = r.id.replace("axv_ram_", "");
|
|
9480
9495
|
const ssdKey = s.id.replace("axv_ssd_", "");
|
|
9481
9496
|
const id = `var_laptop_${ramKey}_${ssdKey}`;
|
|
9482
|
-
const adj = (
|
|
9497
|
+
const adj = `${(ramAdjWhole[ramKey] ?? 0) + (ssdAdjWhole[ssdKey] ?? 0)}.00`;
|
|
9483
9498
|
const variant = {
|
|
9484
9499
|
id,
|
|
9485
9500
|
product_id: "prod_laptop-pro",
|
|
@@ -11778,7 +11793,7 @@ var ID_PREFIX = {
|
|
|
11778
11793
|
product: "prod_",
|
|
11779
11794
|
service: "svc_"
|
|
11780
11795
|
};
|
|
11781
|
-
var
|
|
11796
|
+
var SEED_BUSINESS_CURRENCY = "GHS";
|
|
11782
11797
|
function slugify(value) {
|
|
11783
11798
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
11784
11799
|
}
|
|
@@ -11813,7 +11828,7 @@ function makeSeedContext(registry) {
|
|
|
11813
11828
|
const business = {
|
|
11814
11829
|
business_type: "other",
|
|
11815
11830
|
email: `hello@${handle}.test`,
|
|
11816
|
-
default_currency:
|
|
11831
|
+
default_currency: SEED_BUSINESS_CURRENCY,
|
|
11817
11832
|
default_offers_table_service: false,
|
|
11818
11833
|
default_accepts_online_orders: true,
|
|
11819
11834
|
status: "active",
|
package/dist/mock/library.mjs
CHANGED
|
@@ -2092,7 +2092,7 @@ var Hono2 = class extends Hono {
|
|
|
2092
2092
|
};
|
|
2093
2093
|
|
|
2094
2094
|
// src/types/common.ts
|
|
2095
|
-
var
|
|
2095
|
+
var CURRENCY_CODES = [
|
|
2096
2096
|
"USD",
|
|
2097
2097
|
"EUR",
|
|
2098
2098
|
"GBP",
|
|
@@ -2141,8 +2141,23 @@ var SUPPORTED_CURRENCY_CODES = /* @__PURE__ */ new Set([
|
|
|
2141
2141
|
"TWD",
|
|
2142
2142
|
"AED",
|
|
2143
2143
|
"SAR",
|
|
2144
|
-
"ILS"
|
|
2145
|
-
|
|
2144
|
+
"ILS",
|
|
2145
|
+
"BHD",
|
|
2146
|
+
"IQD",
|
|
2147
|
+
"JOD",
|
|
2148
|
+
"KWD",
|
|
2149
|
+
"LYD",
|
|
2150
|
+
"OMR",
|
|
2151
|
+
"TND",
|
|
2152
|
+
"CLP",
|
|
2153
|
+
"DJF",
|
|
2154
|
+
"ISK",
|
|
2155
|
+
"KMF",
|
|
2156
|
+
"PYG",
|
|
2157
|
+
"VUV",
|
|
2158
|
+
"XPF"
|
|
2159
|
+
];
|
|
2160
|
+
var SUPPORTED_CURRENCY_CODES = new Set(CURRENCY_CODES);
|
|
2146
2161
|
function isSupportedCurrency(code) {
|
|
2147
2162
|
return SUPPORTED_CURRENCY_CODES.has(code);
|
|
2148
2163
|
}
|
|
@@ -2372,7 +2387,6 @@ var CHECKOUT_ORDER_RESULT_STATUS = {
|
|
|
2372
2387
|
CONFIRMED: "confirmed"};
|
|
2373
2388
|
var AUTHORIZATION_TYPE = {
|
|
2374
2389
|
OTP: "otp"};
|
|
2375
|
-
var DEFAULT_CURRENCY = "GHS";
|
|
2376
2390
|
|
|
2377
2391
|
// src/types/purchase-intent.ts
|
|
2378
2392
|
var PURCHASE_INTENT_SOURCE_KIND = {
|
|
@@ -2441,6 +2455,7 @@ var SOURCE_REFUSAL = {
|
|
|
2441
2455
|
SOURCE_NOT_FOUND: "source_not_found"};
|
|
2442
2456
|
|
|
2443
2457
|
// src/mock/routes/v1.ts
|
|
2458
|
+
var MOBILE_MONEY_FIXTURE_CURRENCY = "GHS";
|
|
2444
2459
|
var PURCHASE_INTENT_ROUTE = {
|
|
2445
2460
|
COLLECTION: "/purchase-intents",
|
|
2446
2461
|
MEMBER: "/purchase-intents/:intent_id",
|
|
@@ -2835,7 +2850,7 @@ function buildV1(deps) {
|
|
|
2835
2850
|
}
|
|
2836
2851
|
return tryRoute(c, () => ({
|
|
2837
2852
|
presentment_currency: currency,
|
|
2838
|
-
options: currency ===
|
|
2853
|
+
options: currency === MOBILE_MONEY_FIXTURE_CURRENCY ? [
|
|
2839
2854
|
{ method: PAYMENT_METHOD.CARD, network: null },
|
|
2840
2855
|
{
|
|
2841
2856
|
method: PAYMENT_METHOD.MOBILE_MONEY,
|
|
@@ -9468,8 +9483,8 @@ function seedRetail(registry) {
|
|
|
9468
9483
|
};
|
|
9469
9484
|
registry.variantAxes.put(ramAxis.id, ramAxis);
|
|
9470
9485
|
registry.variantAxes.put(ssdAxis.id, ssdAxis);
|
|
9471
|
-
const
|
|
9472
|
-
const
|
|
9486
|
+
const ramAdjWhole = { "16": 0, "32": 2500 };
|
|
9487
|
+
const ssdAdjWhole = { "512": 0, "1tb": 1500, "2tb": 3500 };
|
|
9473
9488
|
const laptopVariantIds = [];
|
|
9474
9489
|
let firstLaptop = true;
|
|
9475
9490
|
for (const r of ramAxis.values) {
|
|
@@ -9477,7 +9492,7 @@ function seedRetail(registry) {
|
|
|
9477
9492
|
const ramKey = r.id.replace("axv_ram_", "");
|
|
9478
9493
|
const ssdKey = s.id.replace("axv_ssd_", "");
|
|
9479
9494
|
const id = `var_laptop_${ramKey}_${ssdKey}`;
|
|
9480
|
-
const adj = (
|
|
9495
|
+
const adj = `${(ramAdjWhole[ramKey] ?? 0) + (ssdAdjWhole[ssdKey] ?? 0)}.00`;
|
|
9481
9496
|
const variant = {
|
|
9482
9497
|
id,
|
|
9483
9498
|
product_id: "prod_laptop-pro",
|
|
@@ -11776,7 +11791,7 @@ var ID_PREFIX = {
|
|
|
11776
11791
|
product: "prod_",
|
|
11777
11792
|
service: "svc_"
|
|
11778
11793
|
};
|
|
11779
|
-
var
|
|
11794
|
+
var SEED_BUSINESS_CURRENCY = "GHS";
|
|
11780
11795
|
function slugify(value) {
|
|
11781
11796
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
11782
11797
|
}
|
|
@@ -11811,7 +11826,7 @@ function makeSeedContext(registry) {
|
|
|
11811
11826
|
const business = {
|
|
11812
11827
|
business_type: "other",
|
|
11813
11828
|
email: `hello@${handle}.test`,
|
|
11814
|
-
default_currency:
|
|
11829
|
+
default_currency: SEED_BUSINESS_CURRENCY,
|
|
11815
11830
|
default_offers_table_service: false,
|
|
11816
11831
|
default_accepts_online_orders: true,
|
|
11817
11832
|
status: "active",
|
package/dist/mock/msw.js
CHANGED
|
@@ -2092,7 +2092,7 @@ var Hono2 = class extends Hono {
|
|
|
2092
2092
|
};
|
|
2093
2093
|
|
|
2094
2094
|
// src/types/common.ts
|
|
2095
|
-
var
|
|
2095
|
+
var CURRENCY_CODES = [
|
|
2096
2096
|
"USD",
|
|
2097
2097
|
"EUR",
|
|
2098
2098
|
"GBP",
|
|
@@ -2141,8 +2141,23 @@ var SUPPORTED_CURRENCY_CODES = /* @__PURE__ */ new Set([
|
|
|
2141
2141
|
"TWD",
|
|
2142
2142
|
"AED",
|
|
2143
2143
|
"SAR",
|
|
2144
|
-
"ILS"
|
|
2145
|
-
|
|
2144
|
+
"ILS",
|
|
2145
|
+
"BHD",
|
|
2146
|
+
"IQD",
|
|
2147
|
+
"JOD",
|
|
2148
|
+
"KWD",
|
|
2149
|
+
"LYD",
|
|
2150
|
+
"OMR",
|
|
2151
|
+
"TND",
|
|
2152
|
+
"CLP",
|
|
2153
|
+
"DJF",
|
|
2154
|
+
"ISK",
|
|
2155
|
+
"KMF",
|
|
2156
|
+
"PYG",
|
|
2157
|
+
"VUV",
|
|
2158
|
+
"XPF"
|
|
2159
|
+
];
|
|
2160
|
+
var SUPPORTED_CURRENCY_CODES = new Set(CURRENCY_CODES);
|
|
2146
2161
|
function isSupportedCurrency(code) {
|
|
2147
2162
|
return SUPPORTED_CURRENCY_CODES.has(code);
|
|
2148
2163
|
}
|
|
@@ -2372,7 +2387,6 @@ var CHECKOUT_ORDER_RESULT_STATUS = {
|
|
|
2372
2387
|
CONFIRMED: "confirmed"};
|
|
2373
2388
|
var AUTHORIZATION_TYPE = {
|
|
2374
2389
|
OTP: "otp"};
|
|
2375
|
-
var DEFAULT_CURRENCY = "GHS";
|
|
2376
2390
|
|
|
2377
2391
|
// src/types/purchase-intent.ts
|
|
2378
2392
|
var PURCHASE_INTENT_SOURCE_KIND = {
|
|
@@ -2441,6 +2455,7 @@ var SOURCE_REFUSAL = {
|
|
|
2441
2455
|
SOURCE_NOT_FOUND: "source_not_found"};
|
|
2442
2456
|
|
|
2443
2457
|
// src/mock/routes/v1.ts
|
|
2458
|
+
var MOBILE_MONEY_FIXTURE_CURRENCY = "GHS";
|
|
2444
2459
|
var PURCHASE_INTENT_ROUTE = {
|
|
2445
2460
|
COLLECTION: "/purchase-intents",
|
|
2446
2461
|
MEMBER: "/purchase-intents/:intent_id",
|
|
@@ -2835,7 +2850,7 @@ function buildV1(deps) {
|
|
|
2835
2850
|
}
|
|
2836
2851
|
return tryRoute(c, () => ({
|
|
2837
2852
|
presentment_currency: currency,
|
|
2838
|
-
options: currency ===
|
|
2853
|
+
options: currency === MOBILE_MONEY_FIXTURE_CURRENCY ? [
|
|
2839
2854
|
{ method: PAYMENT_METHOD.CARD, network: null },
|
|
2840
2855
|
{
|
|
2841
2856
|
method: PAYMENT_METHOD.MOBILE_MONEY,
|
|
@@ -9468,8 +9483,8 @@ function seedRetail(registry) {
|
|
|
9468
9483
|
};
|
|
9469
9484
|
registry.variantAxes.put(ramAxis.id, ramAxis);
|
|
9470
9485
|
registry.variantAxes.put(ssdAxis.id, ssdAxis);
|
|
9471
|
-
const
|
|
9472
|
-
const
|
|
9486
|
+
const ramAdjWhole = { "16": 0, "32": 2500 };
|
|
9487
|
+
const ssdAdjWhole = { "512": 0, "1tb": 1500, "2tb": 3500 };
|
|
9473
9488
|
const laptopVariantIds = [];
|
|
9474
9489
|
let firstLaptop = true;
|
|
9475
9490
|
for (const r of ramAxis.values) {
|
|
@@ -9477,7 +9492,7 @@ function seedRetail(registry) {
|
|
|
9477
9492
|
const ramKey = r.id.replace("axv_ram_", "");
|
|
9478
9493
|
const ssdKey = s.id.replace("axv_ssd_", "");
|
|
9479
9494
|
const id = `var_laptop_${ramKey}_${ssdKey}`;
|
|
9480
|
-
const adj = (
|
|
9495
|
+
const adj = `${(ramAdjWhole[ramKey] ?? 0) + (ssdAdjWhole[ssdKey] ?? 0)}.00`;
|
|
9481
9496
|
const variant = {
|
|
9482
9497
|
id,
|
|
9483
9498
|
product_id: "prod_laptop-pro",
|
|
@@ -11776,7 +11791,7 @@ var ID_PREFIX = {
|
|
|
11776
11791
|
product: "prod_",
|
|
11777
11792
|
service: "svc_"
|
|
11778
11793
|
};
|
|
11779
|
-
var
|
|
11794
|
+
var SEED_BUSINESS_CURRENCY = "GHS";
|
|
11780
11795
|
function slugify(value) {
|
|
11781
11796
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
11782
11797
|
}
|
|
@@ -11811,7 +11826,7 @@ function makeSeedContext(registry) {
|
|
|
11811
11826
|
const business = {
|
|
11812
11827
|
business_type: "other",
|
|
11813
11828
|
email: `hello@${handle}.test`,
|
|
11814
|
-
default_currency:
|
|
11829
|
+
default_currency: SEED_BUSINESS_CURRENCY,
|
|
11815
11830
|
default_offers_table_service: false,
|
|
11816
11831
|
default_accepts_online_orders: true,
|
|
11817
11832
|
status: "active",
|
package/dist/mock/msw.mjs
CHANGED
|
@@ -2090,7 +2090,7 @@ var Hono2 = class extends Hono {
|
|
|
2090
2090
|
};
|
|
2091
2091
|
|
|
2092
2092
|
// src/types/common.ts
|
|
2093
|
-
var
|
|
2093
|
+
var CURRENCY_CODES = [
|
|
2094
2094
|
"USD",
|
|
2095
2095
|
"EUR",
|
|
2096
2096
|
"GBP",
|
|
@@ -2139,8 +2139,23 @@ var SUPPORTED_CURRENCY_CODES = /* @__PURE__ */ new Set([
|
|
|
2139
2139
|
"TWD",
|
|
2140
2140
|
"AED",
|
|
2141
2141
|
"SAR",
|
|
2142
|
-
"ILS"
|
|
2143
|
-
|
|
2142
|
+
"ILS",
|
|
2143
|
+
"BHD",
|
|
2144
|
+
"IQD",
|
|
2145
|
+
"JOD",
|
|
2146
|
+
"KWD",
|
|
2147
|
+
"LYD",
|
|
2148
|
+
"OMR",
|
|
2149
|
+
"TND",
|
|
2150
|
+
"CLP",
|
|
2151
|
+
"DJF",
|
|
2152
|
+
"ISK",
|
|
2153
|
+
"KMF",
|
|
2154
|
+
"PYG",
|
|
2155
|
+
"VUV",
|
|
2156
|
+
"XPF"
|
|
2157
|
+
];
|
|
2158
|
+
var SUPPORTED_CURRENCY_CODES = new Set(CURRENCY_CODES);
|
|
2144
2159
|
function isSupportedCurrency(code) {
|
|
2145
2160
|
return SUPPORTED_CURRENCY_CODES.has(code);
|
|
2146
2161
|
}
|
|
@@ -2370,7 +2385,6 @@ var CHECKOUT_ORDER_RESULT_STATUS = {
|
|
|
2370
2385
|
CONFIRMED: "confirmed"};
|
|
2371
2386
|
var AUTHORIZATION_TYPE = {
|
|
2372
2387
|
OTP: "otp"};
|
|
2373
|
-
var DEFAULT_CURRENCY = "GHS";
|
|
2374
2388
|
|
|
2375
2389
|
// src/types/purchase-intent.ts
|
|
2376
2390
|
var PURCHASE_INTENT_SOURCE_KIND = {
|
|
@@ -2439,6 +2453,7 @@ var SOURCE_REFUSAL = {
|
|
|
2439
2453
|
SOURCE_NOT_FOUND: "source_not_found"};
|
|
2440
2454
|
|
|
2441
2455
|
// src/mock/routes/v1.ts
|
|
2456
|
+
var MOBILE_MONEY_FIXTURE_CURRENCY = "GHS";
|
|
2442
2457
|
var PURCHASE_INTENT_ROUTE = {
|
|
2443
2458
|
COLLECTION: "/purchase-intents",
|
|
2444
2459
|
MEMBER: "/purchase-intents/:intent_id",
|
|
@@ -2833,7 +2848,7 @@ function buildV1(deps) {
|
|
|
2833
2848
|
}
|
|
2834
2849
|
return tryRoute(c, () => ({
|
|
2835
2850
|
presentment_currency: currency,
|
|
2836
|
-
options: currency ===
|
|
2851
|
+
options: currency === MOBILE_MONEY_FIXTURE_CURRENCY ? [
|
|
2837
2852
|
{ method: PAYMENT_METHOD.CARD, network: null },
|
|
2838
2853
|
{
|
|
2839
2854
|
method: PAYMENT_METHOD.MOBILE_MONEY,
|
|
@@ -9466,8 +9481,8 @@ function seedRetail(registry) {
|
|
|
9466
9481
|
};
|
|
9467
9482
|
registry.variantAxes.put(ramAxis.id, ramAxis);
|
|
9468
9483
|
registry.variantAxes.put(ssdAxis.id, ssdAxis);
|
|
9469
|
-
const
|
|
9470
|
-
const
|
|
9484
|
+
const ramAdjWhole = { "16": 0, "32": 2500 };
|
|
9485
|
+
const ssdAdjWhole = { "512": 0, "1tb": 1500, "2tb": 3500 };
|
|
9471
9486
|
const laptopVariantIds = [];
|
|
9472
9487
|
let firstLaptop = true;
|
|
9473
9488
|
for (const r of ramAxis.values) {
|
|
@@ -9475,7 +9490,7 @@ function seedRetail(registry) {
|
|
|
9475
9490
|
const ramKey = r.id.replace("axv_ram_", "");
|
|
9476
9491
|
const ssdKey = s.id.replace("axv_ssd_", "");
|
|
9477
9492
|
const id = `var_laptop_${ramKey}_${ssdKey}`;
|
|
9478
|
-
const adj = (
|
|
9493
|
+
const adj = `${(ramAdjWhole[ramKey] ?? 0) + (ssdAdjWhole[ssdKey] ?? 0)}.00`;
|
|
9479
9494
|
const variant = {
|
|
9480
9495
|
id,
|
|
9481
9496
|
product_id: "prod_laptop-pro",
|
|
@@ -11774,7 +11789,7 @@ var ID_PREFIX = {
|
|
|
11774
11789
|
product: "prod_",
|
|
11775
11790
|
service: "svc_"
|
|
11776
11791
|
};
|
|
11777
|
-
var
|
|
11792
|
+
var SEED_BUSINESS_CURRENCY = "GHS";
|
|
11778
11793
|
function slugify(value) {
|
|
11779
11794
|
return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
11780
11795
|
}
|
|
@@ -11809,7 +11824,7 @@ function makeSeedContext(registry) {
|
|
|
11809
11824
|
const business = {
|
|
11810
11825
|
business_type: "other",
|
|
11811
11826
|
email: `hello@${handle}.test`,
|
|
11812
|
-
default_currency:
|
|
11827
|
+
default_currency: SEED_BUSINESS_CURRENCY,
|
|
11813
11828
|
default_offers_table_service: false,
|
|
11814
11829
|
default_accepts_online_orders: true,
|
|
11815
11830
|
status: "active",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CurrencyCode, a as ChosenPrice, b as SaleInfo, U as UpcomingSale } from './elements-
|
|
1
|
+
import { C as CurrencyCode, a as ChosenPrice, b as SaleInfo, U as UpcomingSale } from './elements-ss9xZgRg.mjs';
|
|
2
2
|
|
|
3
3
|
interface ProductWithPrice {
|
|
4
4
|
price_info?: ChosenPrice;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CurrencyCode, a as ChosenPrice, b as SaleInfo, U as UpcomingSale } from './elements-
|
|
1
|
+
import { C as CurrencyCode, a as ChosenPrice, b as SaleInfo, U as UpcomingSale } from './elements-ss9xZgRg.js';
|
|
2
2
|
|
|
3
3
|
interface ProductWithPrice {
|
|
4
4
|
price_info?: ChosenPrice;
|
package/dist/react.d.mts
CHANGED
|
@@ -2,11 +2,11 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, PointerEvent, MouseEvent } from 'react';
|
|
3
3
|
import { d as AdSlot, c as AdPosition, a as AdContextValue, S as SignInOptions, f as AssetTransform } from './url-52ndUruG.mjs';
|
|
4
4
|
export { A as AdConfig, i as getVariantDisplayName } from './url-52ndUruG.mjs';
|
|
5
|
-
import { C as CimplifyClient, aa as EnrichedOrderItem, a9 as EnrichedOrder, p as Business, aD as Location, bG as ReorderResult, b4 as OrderStatus, aL as Order, bs as QuoteBundleSelectionInput, bt as QuoteCompositeSelectionInput, bi as PriceQuote, bw as QuoteUiMessage, h as ActivityStateResponse, c2 as SessionMessage, A as ActivityRecommendation, a0 as DeliveryFeeResponse, a4 as DeliveryOptionsResponse, an as FxRateResponse, c9 as StoreCreditBalance, cb as StorefrontBootstrap, O as ChatWidgetStarter, L as ChatMessage, N as ChatUploadAttachment, V as CimplifyElements, I as ChatAttachment, aw as LineItem, bR as Room, M as ChatReplyContext } from './catalogue-
|
|
6
|
-
import { i as CheckoutTermsView, cW as OrderType, dP as ProcessCheckoutResult, b1 as CheckoutStatus, b2 as CheckoutStatusContext, C as CurrencyCode, P as Product, di as Pagination, d as CimplifyError, f as ProductWithDetails, c as Category, M as Money, a as ChosenPrice, a9 as BundleSelectionInput, bd as ComponentSelectionInput, a8 as BundleSelectionData, bm as CompositeSelectionData, e as Collection, dY as ProductTaxonomy, eT as TaxonomyWithChildren, dZ as ProductTimeProfile, bH as Deal, dU as ProductDealInfo, bR as DiscountValidation, ab as BundleSummary, bk as CompositePriceResult, eO as SubscriptionWithDetails, eN as SubscriptionStatus, eK as Subscription, bv as CustomAttributeDefinition, e1 as PropertyFacet, dT as ProductBillingPlan, fa as VariantView, f4 as VariantAxisWithValues, G as AddressInfo, V as AuthenticatedData, ce as ElementsOptions, dt as PaymentMethodInfo, cc as ElementsCheckoutResult, dO as ProcessCheckoutOptions, z as AddOnWithOptions, a5 as BundleComponentView, a6 as BundlePriceType, bi as CompositeGroupView, bU as DisplayCart, dV as ProductInputField, H as AddressValue, b as SaleInfo, U as UpcomingSale, D as DurationUnit, a0 as BoundaryKind, S as SchedulingMode, bJ as DepositType, bw as CustomAttributeValue, dW as ProductProperty, el as QuantityPricingTier } from './elements-
|
|
5
|
+
import { C as CimplifyClient, aa as EnrichedOrderItem, a9 as EnrichedOrder, p as Business, aD as Location, bG as ReorderResult, b4 as OrderStatus, aL as Order, bs as QuoteBundleSelectionInput, bt as QuoteCompositeSelectionInput, bi as PriceQuote, bw as QuoteUiMessage, h as ActivityStateResponse, c2 as SessionMessage, A as ActivityRecommendation, a0 as DeliveryFeeResponse, a4 as DeliveryOptionsResponse, an as FxRateResponse, c9 as StoreCreditBalance, cb as StorefrontBootstrap, O as ChatWidgetStarter, L as ChatMessage, N as ChatUploadAttachment, V as CimplifyElements, I as ChatAttachment, aw as LineItem, bR as Room, M as ChatReplyContext } from './catalogue-FdFQiWrU.mjs';
|
|
6
|
+
import { i as CheckoutTermsView, cW as OrderType, dP as ProcessCheckoutResult, b1 as CheckoutStatus, b2 as CheckoutStatusContext, C as CurrencyCode, P as Product, di as Pagination, d as CimplifyError, f as ProductWithDetails, c as Category, M as Money, a as ChosenPrice, a9 as BundleSelectionInput, bd as ComponentSelectionInput, a8 as BundleSelectionData, bm as CompositeSelectionData, e as Collection, dY as ProductTaxonomy, eT as TaxonomyWithChildren, dZ as ProductTimeProfile, bH as Deal, dU as ProductDealInfo, bR as DiscountValidation, ab as BundleSummary, bk as CompositePriceResult, eO as SubscriptionWithDetails, eN as SubscriptionStatus, eK as Subscription, bv as CustomAttributeDefinition, e1 as PropertyFacet, dT as ProductBillingPlan, fa as VariantView, f4 as VariantAxisWithValues, G as AddressInfo, V as AuthenticatedData, ce as ElementsOptions, dt as PaymentMethodInfo, cc as ElementsCheckoutResult, dO as ProcessCheckoutOptions, z as AddOnWithOptions, a5 as BundleComponentView, a6 as BundlePriceType, bi as CompositeGroupView, bU as DisplayCart, dV as ProductInputField, H as AddressValue, b as SaleInfo, U as UpcomingSale, D as DurationUnit, a0 as BoundaryKind, S as SchedulingMode, bJ as DepositType, bw as CustomAttributeValue, dW as ProductProperty, el as QuantityPricingTier } from './elements-ss9xZgRg.mjs';
|
|
7
7
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
8
|
-
import { k as Service, A as AvailableSlot, D as DayAvailability, g as CustomerBooking, d as CancelBookingResult, p as Staff } from './scheduling-
|
|
9
|
-
import { P as ProductWithPrice } from './price-
|
|
8
|
+
import { k as Service, A as AvailableSlot, D as DayAvailability, g as CustomerBooking, d as CancelBookingResult, p as Staff } from './scheduling-DDmrYCr-.mjs';
|
|
9
|
+
import { P as ProductWithPrice } from './price-B-w4PwHm.mjs';
|
|
10
10
|
import { ClassValue } from 'clsx';
|
|
11
11
|
import { Matcher } from 'react-day-picker';
|
|
12
12
|
import { b4 as WebHost, av as HostChromeController, ae as ConsentStore, R as RegistryClient } from './web-f9ZQPoyw.mjs';
|
|
@@ -792,11 +792,12 @@ interface PriceProps {
|
|
|
792
792
|
amount: number | string;
|
|
793
793
|
/**
|
|
794
794
|
* Currency the `amount` is denominated in. Pass the product/order currency
|
|
795
|
-
* so the value renders correctly during SSR
|
|
795
|
+
* so the value renders correctly during SSR, before the provider has
|
|
796
796
|
* loaded the business client-side. Falls back to the provider's base
|
|
797
|
-
* currency
|
|
797
|
+
* currency. When neither is known the component renders nothing rather
|
|
798
|
+
* than guessing a currency.
|
|
798
799
|
*/
|
|
799
|
-
currency?: CurrencyCode;
|
|
800
|
+
currency?: CurrencyCode | null;
|
|
800
801
|
/** Optional CSS class name for the wrapping span. */
|
|
801
802
|
className?: string;
|
|
802
803
|
/** Optional prefix rendered before the formatted price (e.g. "+"). */
|
|
@@ -813,7 +814,8 @@ interface PriceProps {
|
|
|
813
814
|
* Price — renders a formatted price value.
|
|
814
815
|
*
|
|
815
816
|
* Currency is resolved from the `currency` prop (the amount's source currency),
|
|
816
|
-
* falling back to the provider's base currency
|
|
817
|
+
* falling back to the provider's base currency. With neither known it renders
|
|
818
|
+
* null, a loading state, and never a guessed currency. Because the source
|
|
817
819
|
* currency comes from data rather than the client-only provider bootstrap, an
|
|
818
820
|
* explicit `currency` renders correctly during SSR.
|
|
819
821
|
*
|
|
@@ -822,7 +824,7 @@ interface PriceProps {
|
|
|
822
824
|
* base currency the FX rate is computed from. It never affects the server or
|
|
823
825
|
* first-paint render, so there is no hydration mismatch.
|
|
824
826
|
*/
|
|
825
|
-
declare function Price({ amount, currency, className, prefix, convert, }: PriceProps): React__default.ReactElement;
|
|
827
|
+
declare function Price({ amount, currency, className, prefix, convert, }: PriceProps): React__default.ReactElement | null;
|
|
826
828
|
|
|
827
829
|
type PrefetchMode = "aggressive" | "hover" | "off";
|
|
828
830
|
interface PrefetchOptions {
|
|
@@ -846,14 +848,19 @@ type CimplifyLinkComponent = React__default.ComponentType<CimplifyLinkProps>;
|
|
|
846
848
|
interface CimplifyClientContextValue {
|
|
847
849
|
client: CimplifyClient;
|
|
848
850
|
business: Business | null;
|
|
849
|
-
|
|
851
|
+
/**
|
|
852
|
+
* The business's currency, from `business.default_currency`. Null until the
|
|
853
|
+
* business has loaded (or when it failed to load): render a loading or
|
|
854
|
+
* unavailable state, never a guessed currency.
|
|
855
|
+
*/
|
|
856
|
+
currency: CurrencyCode | null;
|
|
850
857
|
country: string;
|
|
851
858
|
locations: Location[];
|
|
852
859
|
isReady: boolean;
|
|
853
860
|
prefetch: ResolvedPrefetchOptions;
|
|
854
861
|
linkComponent: CimplifyLinkComponent | null;
|
|
855
|
-
/** The business's pricing currency (always the base, for API calls). */
|
|
856
|
-
baseCurrency:
|
|
862
|
+
/** The business's pricing currency (always the base, for API calls). Null until the business loads. */
|
|
863
|
+
baseCurrency: CurrencyCode | null;
|
|
857
864
|
/**
|
|
858
865
|
* When false, collection-backed hooks (`useCart`, etc.) skip optimistic
|
|
859
866
|
* updates and fall back to fire-and-refetch. Default true. Mainly useful
|
|
@@ -865,8 +872,8 @@ interface CimplifyClientContextValue {
|
|
|
865
872
|
interface CimplifyStateContextValue {
|
|
866
873
|
currentLocation: Location | null;
|
|
867
874
|
setCurrentLocation: (location: Location) => void;
|
|
868
|
-
/** The currency prices are displayed in. Equals baseCurrency when no FX override is set. */
|
|
869
|
-
displayCurrency:
|
|
875
|
+
/** The currency prices are displayed in. Equals baseCurrency when no FX override is set; null until the business loads. */
|
|
876
|
+
displayCurrency: CurrencyCode | null;
|
|
870
877
|
/** Set a display currency override for FX conversion. Pass null to reset to base currency. */
|
|
871
878
|
setDisplayCurrency: (currency: string | null) => void;
|
|
872
879
|
/** Convert a base-currency amount to the display currency. No-op when currencies match. */
|
|
@@ -1038,7 +1045,8 @@ interface UseCartResult {
|
|
|
1038
1045
|
displayGross: boolean;
|
|
1039
1046
|
taxJurisdictionLabel: string | null;
|
|
1040
1047
|
total: number;
|
|
1041
|
-
currency
|
|
1048
|
+
/** The cart's currency from the server, or the business currency. Null until either is known. */
|
|
1049
|
+
currency: string | null;
|
|
1042
1050
|
isEmpty: boolean;
|
|
1043
1051
|
isLoading: boolean;
|
|
1044
1052
|
/** Any pending optimistic op is in flight. */
|