@cimplify/sdk 0.7.10 → 0.7.12

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.
@@ -1,4 +1,4 @@
1
- export { A as AuthService, B as BusinessService, i as CartOperations, b as CatalogueQueries, j as CheckoutOperations, j as CheckoutService, t as CimplifyElement, s as CimplifyElements, v as ELEMENT_TYPES, E as EVENT_TYPES, z as ElementEventType, x as ElementOptions, y as ElementType, w as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, o as SchedulingService, S as SearchOptions, u as createElements, k as generateIdempotencyKey } from './client-Bj4y523g.mjs';
1
+ export { A as AuthService, B as BusinessService, i as CartOperations, b as CatalogueQueries, j as CheckoutOperations, j as CheckoutService, t as CimplifyElement, s as CimplifyElements, v as ELEMENT_TYPES, E as EVENT_TYPES, z as ElementEventType, x as ElementOptions, y as ElementType, w as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, o as SchedulingService, S as SearchOptions, u as createElements, k as generateIdempotencyKey } from './client-CVqmSTNq.mjs';
2
2
  import './payment-CLIWNMaP.mjs';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
@@ -1,4 +1,4 @@
1
- export { A as AuthService, B as BusinessService, i as CartOperations, b as CatalogueQueries, j as CheckoutOperations, j as CheckoutService, t as CimplifyElement, s as CimplifyElements, v as ELEMENT_TYPES, E as EVENT_TYPES, z as ElementEventType, x as ElementOptions, y as ElementType, w as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, o as SchedulingService, S as SearchOptions, u as createElements, k as generateIdempotencyKey } from './client-CUYaKDjB.js';
1
+ export { A as AuthService, B as BusinessService, i as CartOperations, b as CatalogueQueries, j as CheckoutOperations, j as CheckoutService, t as CimplifyElement, s as CimplifyElements, v as ELEMENT_TYPES, E as EVENT_TYPES, z as ElementEventType, x as ElementOptions, y as ElementType, w as ElementsOptions, F as FetchQuoteInput, q as FxService, G as GetProductsOptions, I as InventoryService, L as LinkService, p as LiteService, M as MESSAGE_TYPES, O as OrderQueries, P as PriceQuote, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, o as SchedulingService, S as SearchOptions, u as createElements, k as generateIdempotencyKey } from './client-Dkinq9Oz.js';
2
2
  import './payment-CLIWNMaP.js';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
package/dist/advanced.js CHANGED
@@ -2249,6 +2249,12 @@ var CimplifyElements = class {
2249
2249
  getElement(type) {
2250
2250
  return this.elements.get(type);
2251
2251
  }
2252
+ _removeElement(type, instance) {
2253
+ const current = this.elements.get(type);
2254
+ if (current === instance) {
2255
+ this.elements.delete(type);
2256
+ }
2257
+ }
2252
2258
  destroy() {
2253
2259
  this.elements.forEach((element) => element.destroy());
2254
2260
  this.elements.clear();
@@ -2287,7 +2293,9 @@ var CimplifyElements = class {
2287
2293
  processCheckout(options) {
2288
2294
  let abortFn = null;
2289
2295
  const task = (async () => {
2296
+ console.debug("[cimplify:checkout] processCheckout called", { cart_id: options.cart_id, order_type: options.order_type, location_id: options.location_id });
2290
2297
  if (this.checkoutInProgress) {
2298
+ console.debug("[cimplify:checkout] BLOCKED: already processing");
2291
2299
  return toCheckoutError(
2292
2300
  "ALREADY_PROCESSING",
2293
2301
  "Checkout is already in progress.",
@@ -2295,6 +2303,7 @@ var CimplifyElements = class {
2295
2303
  );
2296
2304
  }
2297
2305
  if (!options.cart_id) {
2306
+ console.debug("[cimplify:checkout] BLOCKED: no cart_id");
2298
2307
  return toCheckoutError(
2299
2308
  "INVALID_CART",
2300
2309
  "A valid cart is required before checkout can start.",
@@ -2302,6 +2311,7 @@ var CimplifyElements = class {
2302
2311
  );
2303
2312
  }
2304
2313
  if (!options.order_type) {
2314
+ console.debug("[cimplify:checkout] BLOCKED: no order_type");
2305
2315
  return toCheckoutError(
2306
2316
  "ORDER_TYPE_REQUIRED",
2307
2317
  "Order type is required before checkout can start.",
@@ -2310,6 +2320,7 @@ var CimplifyElements = class {
2310
2320
  }
2311
2321
  const paymentElement = this.elements.get(ELEMENT_TYPES.PAYMENT);
2312
2322
  if (!paymentElement) {
2323
+ console.debug("[cimplify:checkout] BLOCKED: no payment element");
2313
2324
  return toCheckoutError(
2314
2325
  "NO_PAYMENT_ELEMENT",
2315
2326
  "Payment element must be mounted before checkout.",
@@ -2317,6 +2328,7 @@ var CimplifyElements = class {
2317
2328
  );
2318
2329
  }
2319
2330
  if (!paymentElement.isMounted()) {
2331
+ console.debug("[cimplify:checkout] BLOCKED: payment element not mounted");
2320
2332
  return toCheckoutError(
2321
2333
  "PAYMENT_NOT_MOUNTED",
2322
2334
  "Payment element must be mounted before checkout.",
@@ -2325,6 +2337,7 @@ var CimplifyElements = class {
2325
2337
  }
2326
2338
  const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
2327
2339
  if (authElement && !this.accessToken) {
2340
+ console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
2328
2341
  return toCheckoutError(
2329
2342
  "AUTH_INCOMPLETE",
2330
2343
  "Authentication must complete before checkout can start.",
@@ -2333,9 +2346,12 @@ var CimplifyElements = class {
2333
2346
  }
2334
2347
  const addressElement = this.elements.get(ELEMENT_TYPES.ADDRESS);
2335
2348
  if (addressElement) {
2349
+ console.debug("[cimplify:checkout] getting address data...");
2336
2350
  await addressElement.getData();
2351
+ console.debug("[cimplify:checkout] address data resolved", this.addressData);
2337
2352
  }
2338
2353
  await this.hydrateCustomerData();
2354
+ console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId });
2339
2355
  const processMessage = {
2340
2356
  type: MESSAGE_TYPES.PROCESS_CHECKOUT,
2341
2357
  cart_id: options.cart_id,
@@ -2412,6 +2428,7 @@ var CimplifyElements = class {
2412
2428
  return;
2413
2429
  }
2414
2430
  if (message.type === MESSAGE_TYPES.CHECKOUT_COMPLETE) {
2431
+ console.debug("[cimplify:checkout] received checkout_complete", { success: message.success, error: message.error });
2415
2432
  settle({
2416
2433
  success: message.success,
2417
2434
  order: message.order,
@@ -2434,7 +2451,9 @@ var CimplifyElements = class {
2434
2451
  );
2435
2452
  };
2436
2453
  this.activeCheckoutAbort = abortFn;
2454
+ console.debug("[cimplify:checkout] sending process_checkout to payment iframe", { cart_id: processMessage.cart_id, order_type: processMessage.order_type, hasCustomer: !!processMessage.customer, hasAddress: !!processMessage.address });
2437
2455
  paymentElement.sendMessage(processMessage);
2456
+ console.debug("[cimplify:checkout] postMessage sent, waiting for checkout_complete...");
2438
2457
  });
2439
2458
  })();
2440
2459
  const abortable = task;
@@ -2575,6 +2594,7 @@ var CimplifyElement = class {
2575
2594
  this.mounted = false;
2576
2595
  this.eventHandlers = /* @__PURE__ */ new Map();
2577
2596
  this.resolvers = /* @__PURE__ */ new Map();
2597
+ this.listening = false;
2578
2598
  this.type = type;
2579
2599
  this.businessId = businessId;
2580
2600
  this.linkUrl = linkUrl;
@@ -2584,6 +2604,7 @@ var CimplifyElement = class {
2584
2604
  this.boundHandleMessage = this.handleMessage.bind(this);
2585
2605
  if (typeof window !== "undefined") {
2586
2606
  window.addEventListener("message", this.boundHandleMessage);
2607
+ this.listening = true;
2587
2608
  }
2588
2609
  }
2589
2610
  mount(container) {
@@ -2598,6 +2619,10 @@ var CimplifyElement = class {
2598
2619
  }
2599
2620
  this.container = target;
2600
2621
  this.mounted = true;
2622
+ if (!this.listening && typeof window !== "undefined") {
2623
+ window.addEventListener("message", this.boundHandleMessage);
2624
+ this.listening = true;
2625
+ }
2601
2626
  void this.createIframe();
2602
2627
  }
2603
2628
  destroy() {
@@ -2610,9 +2635,11 @@ var CimplifyElement = class {
2610
2635
  this.eventHandlers.clear();
2611
2636
  this.resolvers.forEach((entry) => clearTimeout(entry.timeoutId));
2612
2637
  this.resolvers.clear();
2613
- if (typeof window !== "undefined") {
2638
+ if (this.listening && typeof window !== "undefined") {
2614
2639
  window.removeEventListener("message", this.boundHandleMessage);
2640
+ this.listening = false;
2615
2641
  }
2642
+ this.parent._removeElement(this.type, this);
2616
2643
  }
2617
2644
  on(event, handler) {
2618
2645
  if (!this.eventHandlers.has(event)) {
package/dist/advanced.mjs CHANGED
@@ -2247,6 +2247,12 @@ var CimplifyElements = class {
2247
2247
  getElement(type) {
2248
2248
  return this.elements.get(type);
2249
2249
  }
2250
+ _removeElement(type, instance) {
2251
+ const current = this.elements.get(type);
2252
+ if (current === instance) {
2253
+ this.elements.delete(type);
2254
+ }
2255
+ }
2250
2256
  destroy() {
2251
2257
  this.elements.forEach((element) => element.destroy());
2252
2258
  this.elements.clear();
@@ -2285,7 +2291,9 @@ var CimplifyElements = class {
2285
2291
  processCheckout(options) {
2286
2292
  let abortFn = null;
2287
2293
  const task = (async () => {
2294
+ console.debug("[cimplify:checkout] processCheckout called", { cart_id: options.cart_id, order_type: options.order_type, location_id: options.location_id });
2288
2295
  if (this.checkoutInProgress) {
2296
+ console.debug("[cimplify:checkout] BLOCKED: already processing");
2289
2297
  return toCheckoutError(
2290
2298
  "ALREADY_PROCESSING",
2291
2299
  "Checkout is already in progress.",
@@ -2293,6 +2301,7 @@ var CimplifyElements = class {
2293
2301
  );
2294
2302
  }
2295
2303
  if (!options.cart_id) {
2304
+ console.debug("[cimplify:checkout] BLOCKED: no cart_id");
2296
2305
  return toCheckoutError(
2297
2306
  "INVALID_CART",
2298
2307
  "A valid cart is required before checkout can start.",
@@ -2300,6 +2309,7 @@ var CimplifyElements = class {
2300
2309
  );
2301
2310
  }
2302
2311
  if (!options.order_type) {
2312
+ console.debug("[cimplify:checkout] BLOCKED: no order_type");
2303
2313
  return toCheckoutError(
2304
2314
  "ORDER_TYPE_REQUIRED",
2305
2315
  "Order type is required before checkout can start.",
@@ -2308,6 +2318,7 @@ var CimplifyElements = class {
2308
2318
  }
2309
2319
  const paymentElement = this.elements.get(ELEMENT_TYPES.PAYMENT);
2310
2320
  if (!paymentElement) {
2321
+ console.debug("[cimplify:checkout] BLOCKED: no payment element");
2311
2322
  return toCheckoutError(
2312
2323
  "NO_PAYMENT_ELEMENT",
2313
2324
  "Payment element must be mounted before checkout.",
@@ -2315,6 +2326,7 @@ var CimplifyElements = class {
2315
2326
  );
2316
2327
  }
2317
2328
  if (!paymentElement.isMounted()) {
2329
+ console.debug("[cimplify:checkout] BLOCKED: payment element not mounted");
2318
2330
  return toCheckoutError(
2319
2331
  "PAYMENT_NOT_MOUNTED",
2320
2332
  "Payment element must be mounted before checkout.",
@@ -2323,6 +2335,7 @@ var CimplifyElements = class {
2323
2335
  }
2324
2336
  const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
2325
2337
  if (authElement && !this.accessToken) {
2338
+ console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
2326
2339
  return toCheckoutError(
2327
2340
  "AUTH_INCOMPLETE",
2328
2341
  "Authentication must complete before checkout can start.",
@@ -2331,9 +2344,12 @@ var CimplifyElements = class {
2331
2344
  }
2332
2345
  const addressElement = this.elements.get(ELEMENT_TYPES.ADDRESS);
2333
2346
  if (addressElement) {
2347
+ console.debug("[cimplify:checkout] getting address data...");
2334
2348
  await addressElement.getData();
2349
+ console.debug("[cimplify:checkout] address data resolved", this.addressData);
2335
2350
  }
2336
2351
  await this.hydrateCustomerData();
2352
+ console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId });
2337
2353
  const processMessage = {
2338
2354
  type: MESSAGE_TYPES.PROCESS_CHECKOUT,
2339
2355
  cart_id: options.cart_id,
@@ -2410,6 +2426,7 @@ var CimplifyElements = class {
2410
2426
  return;
2411
2427
  }
2412
2428
  if (message.type === MESSAGE_TYPES.CHECKOUT_COMPLETE) {
2429
+ console.debug("[cimplify:checkout] received checkout_complete", { success: message.success, error: message.error });
2413
2430
  settle({
2414
2431
  success: message.success,
2415
2432
  order: message.order,
@@ -2432,7 +2449,9 @@ var CimplifyElements = class {
2432
2449
  );
2433
2450
  };
2434
2451
  this.activeCheckoutAbort = abortFn;
2452
+ console.debug("[cimplify:checkout] sending process_checkout to payment iframe", { cart_id: processMessage.cart_id, order_type: processMessage.order_type, hasCustomer: !!processMessage.customer, hasAddress: !!processMessage.address });
2435
2453
  paymentElement.sendMessage(processMessage);
2454
+ console.debug("[cimplify:checkout] postMessage sent, waiting for checkout_complete...");
2436
2455
  });
2437
2456
  })();
2438
2457
  const abortable = task;
@@ -2573,6 +2592,7 @@ var CimplifyElement = class {
2573
2592
  this.mounted = false;
2574
2593
  this.eventHandlers = /* @__PURE__ */ new Map();
2575
2594
  this.resolvers = /* @__PURE__ */ new Map();
2595
+ this.listening = false;
2576
2596
  this.type = type;
2577
2597
  this.businessId = businessId;
2578
2598
  this.linkUrl = linkUrl;
@@ -2582,6 +2602,7 @@ var CimplifyElement = class {
2582
2602
  this.boundHandleMessage = this.handleMessage.bind(this);
2583
2603
  if (typeof window !== "undefined") {
2584
2604
  window.addEventListener("message", this.boundHandleMessage);
2605
+ this.listening = true;
2585
2606
  }
2586
2607
  }
2587
2608
  mount(container) {
@@ -2596,6 +2617,10 @@ var CimplifyElement = class {
2596
2617
  }
2597
2618
  this.container = target;
2598
2619
  this.mounted = true;
2620
+ if (!this.listening && typeof window !== "undefined") {
2621
+ window.addEventListener("message", this.boundHandleMessage);
2622
+ this.listening = true;
2623
+ }
2599
2624
  void this.createIframe();
2600
2625
  }
2601
2626
  destroy() {
@@ -2608,9 +2633,11 @@ var CimplifyElement = class {
2608
2633
  this.eventHandlers.clear();
2609
2634
  this.resolvers.forEach((entry) => clearTimeout(entry.timeoutId));
2610
2635
  this.resolvers.clear();
2611
- if (typeof window !== "undefined") {
2636
+ if (this.listening && typeof window !== "undefined") {
2612
2637
  window.removeEventListener("message", this.boundHandleMessage);
2638
+ this.listening = false;
2613
2639
  }
2640
+ this.parent._removeElement(this.type, this);
2614
2641
  }
2615
2642
  on(event, handler) {
2616
2643
  if (!this.eventHandlers.has(event)) {
@@ -2108,6 +2108,7 @@ declare class CimplifyElements {
2108
2108
  constructor(client: CimplifyClient, businessId?: string, options?: ElementsOptions);
2109
2109
  create(type: ElementType, options?: ElementOptions): CimplifyElement;
2110
2110
  getElement(type: ElementType): CimplifyElement | undefined;
2111
+ _removeElement(type: ElementType, instance: CimplifyElement): void;
2111
2112
  destroy(): void;
2112
2113
  submitCheckout(data: ElementsCheckoutData): Promise<ElementsCheckoutResult>;
2113
2114
  processCheckout(options: ProcessCheckoutOptions): AbortablePromise<ProcessCheckoutResult>;
@@ -2136,6 +2137,7 @@ declare class CimplifyElement {
2136
2137
  private eventHandlers;
2137
2138
  private resolvers;
2138
2139
  private boundHandleMessage;
2140
+ private listening;
2139
2141
  constructor(type: ElementType, businessId: string | null, linkUrl: string, options: ElementOptions, parent: CimplifyElements);
2140
2142
  mount(container: string | HTMLElement): void;
2141
2143
  destroy(): void;
@@ -2108,6 +2108,7 @@ declare class CimplifyElements {
2108
2108
  constructor(client: CimplifyClient, businessId?: string, options?: ElementsOptions);
2109
2109
  create(type: ElementType, options?: ElementOptions): CimplifyElement;
2110
2110
  getElement(type: ElementType): CimplifyElement | undefined;
2111
+ _removeElement(type: ElementType, instance: CimplifyElement): void;
2111
2112
  destroy(): void;
2112
2113
  submitCheckout(data: ElementsCheckoutData): Promise<ElementsCheckoutResult>;
2113
2114
  processCheckout(options: ProcessCheckoutOptions): AbortablePromise<ProcessCheckoutResult>;
@@ -2136,6 +2137,7 @@ declare class CimplifyElement {
2136
2137
  private eventHandlers;
2137
2138
  private resolvers;
2138
2139
  private boundHandleMessage;
2140
+ private listening;
2139
2141
  constructor(type: ElementType, businessId: string | null, linkUrl: string, options: ElementOptions, parent: CimplifyElements);
2140
2142
  mount(container: string | HTMLElement): void;
2141
2143
  destroy(): void;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { aa as AUTHORIZATION_TYPE, af as AUTH_MUTATION, $ as AbortablePromise, cc as AddressData, cE as AddressInfo, aP as AmountToPay, cn as AuthResponse, A as AuthService, m as AuthStatus, cG as AuthenticatedCustomer, cI as AuthenticatedData, c0 as AvailabilityCheck, c1 as AvailabilityResult, bF as AvailableSlot, bI as Booking, bH as BookingStatus, bJ as BookingWithDetails, b7 as BufferTimes, bm as Business, bA as BusinessHours, bl as BusinessPreferences, B as BusinessService, bz as BusinessSettings, bk as BusinessType, bx as BusinessWithLocations, a3 as CHECKOUT_MODE, ag as CHECKOUT_MUTATION, a6 as CHECKOUT_STEP, ac as CONTACT_TYPE, bQ as CancelBookingInput, bR as CancelBookingResult, b1 as CancelOrderInput, b9 as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aC as CatalogueResult, aD as CatalogueSnapshot, bB as CategoryInfo, bN as CheckSlotAvailabilityInput, bO as CheckSlotAvailabilityResult, cq as CheckoutAddressInfo, cs as CheckoutCustomerInfo, N as CheckoutFormData, a$ as CheckoutInput, D as CheckoutMode, j as CheckoutOperations, H as CheckoutOrderType, J as CheckoutPaymentMethod, V as CheckoutResult, j as CheckoutService, Z as CheckoutStatus, _ as CheckoutStatusContext, K as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, t as CimplifyElement, s as CimplifyElements, a2 as ContactType, c8 as CreateAddressInput, ca as CreateMobileMoneyInput, c3 as Customer, c4 as CustomerAddress, bL as CustomerBooking, bK as CustomerBookingServiceItem, c6 as CustomerLinkPreferences, c5 as CustomerMobileMoney, b6 as CustomerServicePreferences, ak as DEFAULT_COUNTRY, aj as DEFAULT_CURRENCY, ab as DEVICE_TYPE, bG as DayAvailability, bg as DepositResult, a1 as DeviceType, v as ELEMENT_TYPES, E as EVENT_TYPES, cD as ElementAppearance, cN as ElementEventHandler, z as ElementEventType, x as ElementOptions, y as ElementType, cJ as ElementsCheckoutData, cK as ElementsCheckoutResult, cH as ElementsCustomerInfo, w as ElementsOptions, ce as EnrollAndLinkOrderInput, ch as EnrollAndLinkOrderResult, cb as EnrollmentData, an as Err, aO as FeeBearerType, F as FetchQuoteInput, aM as FulfillmentLink, aL as FulfillmentStatus, aK as FulfillmentType, cu as FxQuote, ct as FxQuoteRequest, cv as FxRateResponse, q as FxService, bM as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cM as IframeToParentMessage, I as InventoryService, c2 as InventorySummary, ae as LINK_MUTATION, ad as LINK_QUERY, aQ as LineItem, aH as LineType, c7 as LinkData, cg as LinkEnrollResult, L as LinkService, ci as LinkSession, cf as LinkStatusResult, r as LiteBootstrap, p as LiteService, bp as Location, bj as LocationAppointment, b$ as LocationStock, bn as LocationTaxBehavior, bo as LocationTaxOverrides, bs as LocationTimeProfile, by as LocationWithDetails, M as MESSAGE_TYPES, a9 as MOBILE_MONEY_PROVIDER, cd as MobileMoneyData, cr as MobileMoneyDetails, a0 as MobileMoneyProvider, ai as ORDER_MUTATION, a4 as ORDER_TYPE, cC as ObservabilityHooks, am as Ok, aR as Order, aG as OrderChannel, a_ as OrderFilter, aN as OrderFulfillmentSummary, aU as OrderGroup, aY as OrderGroupDetails, aV as OrderGroupPayment, aT as OrderGroupPaymentState, aX as OrderGroupPaymentSummary, aS as OrderHistory, aI as OrderLineState, aJ as OrderLineStatus, aZ as OrderPaymentEvent, O as OrderQueries, aW as OrderSplitDetail, aE as OrderStatus, n as OtpResult, a5 as PAYMENT_METHOD, ah as PAYMENT_MUTATION, a7 as PAYMENT_STATE, a8 as PICKUP_TIME_TYPE, cL as ParentToIframeMessage, cF as PaymentMethodInfo, aF as PaymentState, cp as PickupTime, co as PickupTimeType, P as PriceQuote, bb as PricingOverrides, Y as ProcessAndResolveOptions, W as ProcessCheckoutOptions, X as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b2 as RefundOrderInput, b5 as ReminderMethod, b8 as ReminderSettings, cw as RequestContext, cz as RequestErrorEvent, cl as RequestOtpInput, cx as RequestStartEvent, cy as RequestSuccessEvent, bP as RescheduleBookingInput, bS as RescheduleBookingResult, be as ResourceAssignment, al as Result, cA as RetryEvent, ck as RevokeAllSessionsResult, cj as RevokeSessionResult, bu as Room, bc as SchedulingMetadata, bf as SchedulingResult, o as SchedulingService, S as SearchOptions, bC as Service, bT as ServiceAvailabilityParams, bU as ServiceAvailabilityResult, bv as ServiceCharge, ba as ServiceNotes, bh as ServiceScheduleRequest, b3 as ServiceStatus, cB as SessionChangeEvent, bD as Staff, bd as StaffAssignment, b4 as StaffRole, bi as StaffScheduleItem, bX as Stock, bY as StockLevel, bV as StockOwnershipType, bW as StockStatus, bw as StorefrontBootstrap, bt as Table, T as TableInfo, bq as TimeRange, br as TimeRanges, bE as TimeSlot, c9 as UpdateAddressInput, b0 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, cm as VerifyOtpInput, aA as combine, aB as combineObject, c as createCimplifyClient, u as createElements, ap as err, au as flatMap, ay as fromPromise, k as generateIdempotencyKey, av as getOrElse, ar as isErr, aq as isOk, at as mapError, as as mapResult, ao as ok, ax as toNullable, az as tryCatch, aw as unwrap } from './client-Bj4y523g.mjs';
1
+ export { aa as AUTHORIZATION_TYPE, af as AUTH_MUTATION, $ as AbortablePromise, cc as AddressData, cE as AddressInfo, aP as AmountToPay, cn as AuthResponse, A as AuthService, m as AuthStatus, cG as AuthenticatedCustomer, cI as AuthenticatedData, c0 as AvailabilityCheck, c1 as AvailabilityResult, bF as AvailableSlot, bI as Booking, bH as BookingStatus, bJ as BookingWithDetails, b7 as BufferTimes, bm as Business, bA as BusinessHours, bl as BusinessPreferences, B as BusinessService, bz as BusinessSettings, bk as BusinessType, bx as BusinessWithLocations, a3 as CHECKOUT_MODE, ag as CHECKOUT_MUTATION, a6 as CHECKOUT_STEP, ac as CONTACT_TYPE, bQ as CancelBookingInput, bR as CancelBookingResult, b1 as CancelOrderInput, b9 as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aC as CatalogueResult, aD as CatalogueSnapshot, bB as CategoryInfo, bN as CheckSlotAvailabilityInput, bO as CheckSlotAvailabilityResult, cq as CheckoutAddressInfo, cs as CheckoutCustomerInfo, N as CheckoutFormData, a$ as CheckoutInput, D as CheckoutMode, j as CheckoutOperations, H as CheckoutOrderType, J as CheckoutPaymentMethod, V as CheckoutResult, j as CheckoutService, Z as CheckoutStatus, _ as CheckoutStatusContext, K as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, t as CimplifyElement, s as CimplifyElements, a2 as ContactType, c8 as CreateAddressInput, ca as CreateMobileMoneyInput, c3 as Customer, c4 as CustomerAddress, bL as CustomerBooking, bK as CustomerBookingServiceItem, c6 as CustomerLinkPreferences, c5 as CustomerMobileMoney, b6 as CustomerServicePreferences, ak as DEFAULT_COUNTRY, aj as DEFAULT_CURRENCY, ab as DEVICE_TYPE, bG as DayAvailability, bg as DepositResult, a1 as DeviceType, v as ELEMENT_TYPES, E as EVENT_TYPES, cD as ElementAppearance, cN as ElementEventHandler, z as ElementEventType, x as ElementOptions, y as ElementType, cJ as ElementsCheckoutData, cK as ElementsCheckoutResult, cH as ElementsCustomerInfo, w as ElementsOptions, ce as EnrollAndLinkOrderInput, ch as EnrollAndLinkOrderResult, cb as EnrollmentData, an as Err, aO as FeeBearerType, F as FetchQuoteInput, aM as FulfillmentLink, aL as FulfillmentStatus, aK as FulfillmentType, cu as FxQuote, ct as FxQuoteRequest, cv as FxRateResponse, q as FxService, bM as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cM as IframeToParentMessage, I as InventoryService, c2 as InventorySummary, ae as LINK_MUTATION, ad as LINK_QUERY, aQ as LineItem, aH as LineType, c7 as LinkData, cg as LinkEnrollResult, L as LinkService, ci as LinkSession, cf as LinkStatusResult, r as LiteBootstrap, p as LiteService, bp as Location, bj as LocationAppointment, b$ as LocationStock, bn as LocationTaxBehavior, bo as LocationTaxOverrides, bs as LocationTimeProfile, by as LocationWithDetails, M as MESSAGE_TYPES, a9 as MOBILE_MONEY_PROVIDER, cd as MobileMoneyData, cr as MobileMoneyDetails, a0 as MobileMoneyProvider, ai as ORDER_MUTATION, a4 as ORDER_TYPE, cC as ObservabilityHooks, am as Ok, aR as Order, aG as OrderChannel, a_ as OrderFilter, aN as OrderFulfillmentSummary, aU as OrderGroup, aY as OrderGroupDetails, aV as OrderGroupPayment, aT as OrderGroupPaymentState, aX as OrderGroupPaymentSummary, aS as OrderHistory, aI as OrderLineState, aJ as OrderLineStatus, aZ as OrderPaymentEvent, O as OrderQueries, aW as OrderSplitDetail, aE as OrderStatus, n as OtpResult, a5 as PAYMENT_METHOD, ah as PAYMENT_MUTATION, a7 as PAYMENT_STATE, a8 as PICKUP_TIME_TYPE, cL as ParentToIframeMessage, cF as PaymentMethodInfo, aF as PaymentState, cp as PickupTime, co as PickupTimeType, P as PriceQuote, bb as PricingOverrides, Y as ProcessAndResolveOptions, W as ProcessCheckoutOptions, X as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b2 as RefundOrderInput, b5 as ReminderMethod, b8 as ReminderSettings, cw as RequestContext, cz as RequestErrorEvent, cl as RequestOtpInput, cx as RequestStartEvent, cy as RequestSuccessEvent, bP as RescheduleBookingInput, bS as RescheduleBookingResult, be as ResourceAssignment, al as Result, cA as RetryEvent, ck as RevokeAllSessionsResult, cj as RevokeSessionResult, bu as Room, bc as SchedulingMetadata, bf as SchedulingResult, o as SchedulingService, S as SearchOptions, bC as Service, bT as ServiceAvailabilityParams, bU as ServiceAvailabilityResult, bv as ServiceCharge, ba as ServiceNotes, bh as ServiceScheduleRequest, b3 as ServiceStatus, cB as SessionChangeEvent, bD as Staff, bd as StaffAssignment, b4 as StaffRole, bi as StaffScheduleItem, bX as Stock, bY as StockLevel, bV as StockOwnershipType, bW as StockStatus, bw as StorefrontBootstrap, bt as Table, T as TableInfo, bq as TimeRange, br as TimeRanges, bE as TimeSlot, c9 as UpdateAddressInput, b0 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, cm as VerifyOtpInput, aA as combine, aB as combineObject, c as createCimplifyClient, u as createElements, ap as err, au as flatMap, ay as fromPromise, k as generateIdempotencyKey, av as getOrElse, ar as isErr, aq as isOk, at as mapError, as as mapResult, ao as ok, ax as toNullable, az as tryCatch, aw as unwrap } from './client-CVqmSTNq.mjs';
2
2
  export { QueryBuilder, query } from './advanced.mjs';
3
3
  import { A as ApiError } from './payment-CLIWNMaP.mjs';
4
4
  export { B as AddOn, at as AddOnDetails, aP as AddOnGroupDetails, G as AddOnOption, aO as AddOnOptionDetails, H as AddOnOptionPrice, F as AddOnWithOptions, aU as AddToCartInput, ai as AdjustmentType, ap as AppliedDiscount, a_ as AuthorizationType, ao as BenefitType, T as Bundle, Y as BundleComponentData, _ as BundleComponentInfo, R as BundlePriceType, W as BundleProduct, ay as BundleSelectionData, aw as BundleSelectionInput, ax as BundleStoredSelection, U as BundleSummary, X as BundleWithDetails, aD as Cart, au as CartAddOn, ag as CartChannel, aE as CartItem, aR as CartItemDetails, af as CartStatus, aW as CartSummary, aF as CartTotals, K as Category, L as CategorySummary, an as ChosenPrice, h as CimplifyError, N as Collection, Q as CollectionProduct, O as CollectionSummary, a4 as ComponentGroup, a5 as ComponentGroupWithComponents, a9 as ComponentPriceBreakdown, a7 as ComponentSelectionInput, a1 as ComponentSourceType, a2 as Composite, a6 as CompositeComponent, aA as CompositePriceBreakdown, a8 as CompositePriceResult, $ as CompositePricingMode, aB as CompositeSelectionData, a7 as CompositeSelectionInput, az as CompositeStoredSelection, a3 as CompositeWithDetails, b as Currency, C as CurrencyCode, p as DepositType, D as DigitalProductType, aq as DiscountBreakdown, ar as DiscountDetails, aI as DisplayAddOn, aJ as DisplayAddOnOption, aG as DisplayCart, aH as DisplayCartItem, g as ERROR_HINTS, E as ErrorCode, e as ErrorCodeType, f as ErrorHint, a0 as GroupPricingBehavior, b2 as InitializePaymentResult, I as InventoryType, aC as LineConfiguration, ac as LocationProductPrice, M as Money, d as Pagination, P as PaginationParams, b1 as Payment, b5 as PaymentErrorDetails, b0 as PaymentMethod, aZ as PaymentMethodType, a$ as PaymentProcessingState, aY as PaymentProvider, b3 as PaymentResponse, aX as PaymentStatus, b4 as PaymentStatusResponse, ab as Price, aj as PriceAdjustment, am as PriceDecisionPath, aa as PriceEntryType, al as PricePathTaxInfo, ah as PriceSource, q as Product, J as ProductAddOn, ad as ProductAvailability, o as ProductRenderHint, ae as ProductTimeProfile, n as ProductType, s as ProductVariant, x as ProductVariantValue, r as ProductWithDetails, S as SalesChannel, as as SelectedAddOnOption, b6 as SubmitAuthorizationInput, ak as TaxPathComponent, aS as UICart, aK as UICartBusiness, aM as UICartCustomer, aL as UICartLocation, aN as UICartPricing, aT as UICartResponse, aV as UpdateCartItemInput, u as VariantAxis, z as VariantAxisSelection, w as VariantAxisValue, v as VariantAxisWithValues, av as VariantDetails, aQ as VariantDetailsDTO, t as VariantDisplayAttribute, y as VariantLocationAvailability, V as VariantStrategy, Z as ZERO, c as currencyCode, k as enrichError, j as getErrorHint, i as isCimplifyError, l as isRetryableError, m as money, a as moneyFromNumber } from './payment-CLIWNMaP.mjs';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { aa as AUTHORIZATION_TYPE, af as AUTH_MUTATION, $ as AbortablePromise, cc as AddressData, cE as AddressInfo, aP as AmountToPay, cn as AuthResponse, A as AuthService, m as AuthStatus, cG as AuthenticatedCustomer, cI as AuthenticatedData, c0 as AvailabilityCheck, c1 as AvailabilityResult, bF as AvailableSlot, bI as Booking, bH as BookingStatus, bJ as BookingWithDetails, b7 as BufferTimes, bm as Business, bA as BusinessHours, bl as BusinessPreferences, B as BusinessService, bz as BusinessSettings, bk as BusinessType, bx as BusinessWithLocations, a3 as CHECKOUT_MODE, ag as CHECKOUT_MUTATION, a6 as CHECKOUT_STEP, ac as CONTACT_TYPE, bQ as CancelBookingInput, bR as CancelBookingResult, b1 as CancelOrderInput, b9 as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aC as CatalogueResult, aD as CatalogueSnapshot, bB as CategoryInfo, bN as CheckSlotAvailabilityInput, bO as CheckSlotAvailabilityResult, cq as CheckoutAddressInfo, cs as CheckoutCustomerInfo, N as CheckoutFormData, a$ as CheckoutInput, D as CheckoutMode, j as CheckoutOperations, H as CheckoutOrderType, J as CheckoutPaymentMethod, V as CheckoutResult, j as CheckoutService, Z as CheckoutStatus, _ as CheckoutStatusContext, K as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, t as CimplifyElement, s as CimplifyElements, a2 as ContactType, c8 as CreateAddressInput, ca as CreateMobileMoneyInput, c3 as Customer, c4 as CustomerAddress, bL as CustomerBooking, bK as CustomerBookingServiceItem, c6 as CustomerLinkPreferences, c5 as CustomerMobileMoney, b6 as CustomerServicePreferences, ak as DEFAULT_COUNTRY, aj as DEFAULT_CURRENCY, ab as DEVICE_TYPE, bG as DayAvailability, bg as DepositResult, a1 as DeviceType, v as ELEMENT_TYPES, E as EVENT_TYPES, cD as ElementAppearance, cN as ElementEventHandler, z as ElementEventType, x as ElementOptions, y as ElementType, cJ as ElementsCheckoutData, cK as ElementsCheckoutResult, cH as ElementsCustomerInfo, w as ElementsOptions, ce as EnrollAndLinkOrderInput, ch as EnrollAndLinkOrderResult, cb as EnrollmentData, an as Err, aO as FeeBearerType, F as FetchQuoteInput, aM as FulfillmentLink, aL as FulfillmentStatus, aK as FulfillmentType, cu as FxQuote, ct as FxQuoteRequest, cv as FxRateResponse, q as FxService, bM as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cM as IframeToParentMessage, I as InventoryService, c2 as InventorySummary, ae as LINK_MUTATION, ad as LINK_QUERY, aQ as LineItem, aH as LineType, c7 as LinkData, cg as LinkEnrollResult, L as LinkService, ci as LinkSession, cf as LinkStatusResult, r as LiteBootstrap, p as LiteService, bp as Location, bj as LocationAppointment, b$ as LocationStock, bn as LocationTaxBehavior, bo as LocationTaxOverrides, bs as LocationTimeProfile, by as LocationWithDetails, M as MESSAGE_TYPES, a9 as MOBILE_MONEY_PROVIDER, cd as MobileMoneyData, cr as MobileMoneyDetails, a0 as MobileMoneyProvider, ai as ORDER_MUTATION, a4 as ORDER_TYPE, cC as ObservabilityHooks, am as Ok, aR as Order, aG as OrderChannel, a_ as OrderFilter, aN as OrderFulfillmentSummary, aU as OrderGroup, aY as OrderGroupDetails, aV as OrderGroupPayment, aT as OrderGroupPaymentState, aX as OrderGroupPaymentSummary, aS as OrderHistory, aI as OrderLineState, aJ as OrderLineStatus, aZ as OrderPaymentEvent, O as OrderQueries, aW as OrderSplitDetail, aE as OrderStatus, n as OtpResult, a5 as PAYMENT_METHOD, ah as PAYMENT_MUTATION, a7 as PAYMENT_STATE, a8 as PICKUP_TIME_TYPE, cL as ParentToIframeMessage, cF as PaymentMethodInfo, aF as PaymentState, cp as PickupTime, co as PickupTimeType, P as PriceQuote, bb as PricingOverrides, Y as ProcessAndResolveOptions, W as ProcessCheckoutOptions, X as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b2 as RefundOrderInput, b5 as ReminderMethod, b8 as ReminderSettings, cw as RequestContext, cz as RequestErrorEvent, cl as RequestOtpInput, cx as RequestStartEvent, cy as RequestSuccessEvent, bP as RescheduleBookingInput, bS as RescheduleBookingResult, be as ResourceAssignment, al as Result, cA as RetryEvent, ck as RevokeAllSessionsResult, cj as RevokeSessionResult, bu as Room, bc as SchedulingMetadata, bf as SchedulingResult, o as SchedulingService, S as SearchOptions, bC as Service, bT as ServiceAvailabilityParams, bU as ServiceAvailabilityResult, bv as ServiceCharge, ba as ServiceNotes, bh as ServiceScheduleRequest, b3 as ServiceStatus, cB as SessionChangeEvent, bD as Staff, bd as StaffAssignment, b4 as StaffRole, bi as StaffScheduleItem, bX as Stock, bY as StockLevel, bV as StockOwnershipType, bW as StockStatus, bw as StorefrontBootstrap, bt as Table, T as TableInfo, bq as TimeRange, br as TimeRanges, bE as TimeSlot, c9 as UpdateAddressInput, b0 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, cm as VerifyOtpInput, aA as combine, aB as combineObject, c as createCimplifyClient, u as createElements, ap as err, au as flatMap, ay as fromPromise, k as generateIdempotencyKey, av as getOrElse, ar as isErr, aq as isOk, at as mapError, as as mapResult, ao as ok, ax as toNullable, az as tryCatch, aw as unwrap } from './client-CUYaKDjB.js';
1
+ export { aa as AUTHORIZATION_TYPE, af as AUTH_MUTATION, $ as AbortablePromise, cc as AddressData, cE as AddressInfo, aP as AmountToPay, cn as AuthResponse, A as AuthService, m as AuthStatus, cG as AuthenticatedCustomer, cI as AuthenticatedData, c0 as AvailabilityCheck, c1 as AvailabilityResult, bF as AvailableSlot, bI as Booking, bH as BookingStatus, bJ as BookingWithDetails, b7 as BufferTimes, bm as Business, bA as BusinessHours, bl as BusinessPreferences, B as BusinessService, bz as BusinessSettings, bk as BusinessType, bx as BusinessWithLocations, a3 as CHECKOUT_MODE, ag as CHECKOUT_MUTATION, a6 as CHECKOUT_STEP, ac as CONTACT_TYPE, bQ as CancelBookingInput, bR as CancelBookingResult, b1 as CancelOrderInput, b9 as CancellationPolicy, i as CartOperations, b as CatalogueQueries, aC as CatalogueResult, aD as CatalogueSnapshot, bB as CategoryInfo, bN as CheckSlotAvailabilityInput, bO as CheckSlotAvailabilityResult, cq as CheckoutAddressInfo, cs as CheckoutCustomerInfo, N as CheckoutFormData, a$ as CheckoutInput, D as CheckoutMode, j as CheckoutOperations, H as CheckoutOrderType, J as CheckoutPaymentMethod, V as CheckoutResult, j as CheckoutService, Z as CheckoutStatus, _ as CheckoutStatusContext, K as CheckoutStep, C as CimplifyClient, a as CimplifyConfig, t as CimplifyElement, s as CimplifyElements, a2 as ContactType, c8 as CreateAddressInput, ca as CreateMobileMoneyInput, c3 as Customer, c4 as CustomerAddress, bL as CustomerBooking, bK as CustomerBookingServiceItem, c6 as CustomerLinkPreferences, c5 as CustomerMobileMoney, b6 as CustomerServicePreferences, ak as DEFAULT_COUNTRY, aj as DEFAULT_CURRENCY, ab as DEVICE_TYPE, bG as DayAvailability, bg as DepositResult, a1 as DeviceType, v as ELEMENT_TYPES, E as EVENT_TYPES, cD as ElementAppearance, cN as ElementEventHandler, z as ElementEventType, x as ElementOptions, y as ElementType, cJ as ElementsCheckoutData, cK as ElementsCheckoutResult, cH as ElementsCustomerInfo, w as ElementsOptions, ce as EnrollAndLinkOrderInput, ch as EnrollAndLinkOrderResult, cb as EnrollmentData, an as Err, aO as FeeBearerType, F as FetchQuoteInput, aM as FulfillmentLink, aL as FulfillmentStatus, aK as FulfillmentType, cu as FxQuote, ct as FxQuoteRequest, cv as FxRateResponse, q as FxService, bM as GetAvailableSlotsInput, l as GetOrdersOptions, G as GetProductsOptions, cM as IframeToParentMessage, I as InventoryService, c2 as InventorySummary, ae as LINK_MUTATION, ad as LINK_QUERY, aQ as LineItem, aH as LineType, c7 as LinkData, cg as LinkEnrollResult, L as LinkService, ci as LinkSession, cf as LinkStatusResult, r as LiteBootstrap, p as LiteService, bp as Location, bj as LocationAppointment, b$ as LocationStock, bn as LocationTaxBehavior, bo as LocationTaxOverrides, bs as LocationTimeProfile, by as LocationWithDetails, M as MESSAGE_TYPES, a9 as MOBILE_MONEY_PROVIDER, cd as MobileMoneyData, cr as MobileMoneyDetails, a0 as MobileMoneyProvider, ai as ORDER_MUTATION, a4 as ORDER_TYPE, cC as ObservabilityHooks, am as Ok, aR as Order, aG as OrderChannel, a_ as OrderFilter, aN as OrderFulfillmentSummary, aU as OrderGroup, aY as OrderGroupDetails, aV as OrderGroupPayment, aT as OrderGroupPaymentState, aX as OrderGroupPaymentSummary, aS as OrderHistory, aI as OrderLineState, aJ as OrderLineStatus, aZ as OrderPaymentEvent, O as OrderQueries, aW as OrderSplitDetail, aE as OrderStatus, n as OtpResult, a5 as PAYMENT_METHOD, ah as PAYMENT_MUTATION, a7 as PAYMENT_STATE, a8 as PICKUP_TIME_TYPE, cL as ParentToIframeMessage, cF as PaymentMethodInfo, aF as PaymentState, cp as PickupTime, co as PickupTimeType, P as PriceQuote, bb as PricingOverrides, Y as ProcessAndResolveOptions, W as ProcessCheckoutOptions, X as ProcessCheckoutResult, bZ as ProductStock, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, f as QuoteDynamicBuckets, e as QuoteStatus, g as QuoteUiMessage, R as RefreshQuoteInput, h as RefreshQuoteResult, b2 as RefundOrderInput, b5 as ReminderMethod, b8 as ReminderSettings, cw as RequestContext, cz as RequestErrorEvent, cl as RequestOtpInput, cx as RequestStartEvent, cy as RequestSuccessEvent, bP as RescheduleBookingInput, bS as RescheduleBookingResult, be as ResourceAssignment, al as Result, cA as RetryEvent, ck as RevokeAllSessionsResult, cj as RevokeSessionResult, bu as Room, bc as SchedulingMetadata, bf as SchedulingResult, o as SchedulingService, S as SearchOptions, bC as Service, bT as ServiceAvailabilityParams, bU as ServiceAvailabilityResult, bv as ServiceCharge, ba as ServiceNotes, bh as ServiceScheduleRequest, b3 as ServiceStatus, cB as SessionChangeEvent, bD as Staff, bd as StaffAssignment, b4 as StaffRole, bi as StaffScheduleItem, bX as Stock, bY as StockLevel, bV as StockOwnershipType, bW as StockStatus, bw as StorefrontBootstrap, bt as Table, T as TableInfo, bq as TimeRange, br as TimeRanges, bE as TimeSlot, c9 as UpdateAddressInput, b0 as UpdateOrderStatusInput, U as UpdateProfileInput, b_ as VariantStock, cm as VerifyOtpInput, aA as combine, aB as combineObject, c as createCimplifyClient, u as createElements, ap as err, au as flatMap, ay as fromPromise, k as generateIdempotencyKey, av as getOrElse, ar as isErr, aq as isOk, at as mapError, as as mapResult, ao as ok, ax as toNullable, az as tryCatch, aw as unwrap } from './client-Dkinq9Oz.js';
2
2
  export { QueryBuilder, query } from './advanced.js';
3
3
  import { A as ApiError } from './payment-CLIWNMaP.js';
4
4
  export { B as AddOn, at as AddOnDetails, aP as AddOnGroupDetails, G as AddOnOption, aO as AddOnOptionDetails, H as AddOnOptionPrice, F as AddOnWithOptions, aU as AddToCartInput, ai as AdjustmentType, ap as AppliedDiscount, a_ as AuthorizationType, ao as BenefitType, T as Bundle, Y as BundleComponentData, _ as BundleComponentInfo, R as BundlePriceType, W as BundleProduct, ay as BundleSelectionData, aw as BundleSelectionInput, ax as BundleStoredSelection, U as BundleSummary, X as BundleWithDetails, aD as Cart, au as CartAddOn, ag as CartChannel, aE as CartItem, aR as CartItemDetails, af as CartStatus, aW as CartSummary, aF as CartTotals, K as Category, L as CategorySummary, an as ChosenPrice, h as CimplifyError, N as Collection, Q as CollectionProduct, O as CollectionSummary, a4 as ComponentGroup, a5 as ComponentGroupWithComponents, a9 as ComponentPriceBreakdown, a7 as ComponentSelectionInput, a1 as ComponentSourceType, a2 as Composite, a6 as CompositeComponent, aA as CompositePriceBreakdown, a8 as CompositePriceResult, $ as CompositePricingMode, aB as CompositeSelectionData, a7 as CompositeSelectionInput, az as CompositeStoredSelection, a3 as CompositeWithDetails, b as Currency, C as CurrencyCode, p as DepositType, D as DigitalProductType, aq as DiscountBreakdown, ar as DiscountDetails, aI as DisplayAddOn, aJ as DisplayAddOnOption, aG as DisplayCart, aH as DisplayCartItem, g as ERROR_HINTS, E as ErrorCode, e as ErrorCodeType, f as ErrorHint, a0 as GroupPricingBehavior, b2 as InitializePaymentResult, I as InventoryType, aC as LineConfiguration, ac as LocationProductPrice, M as Money, d as Pagination, P as PaginationParams, b1 as Payment, b5 as PaymentErrorDetails, b0 as PaymentMethod, aZ as PaymentMethodType, a$ as PaymentProcessingState, aY as PaymentProvider, b3 as PaymentResponse, aX as PaymentStatus, b4 as PaymentStatusResponse, ab as Price, aj as PriceAdjustment, am as PriceDecisionPath, aa as PriceEntryType, al as PricePathTaxInfo, ah as PriceSource, q as Product, J as ProductAddOn, ad as ProductAvailability, o as ProductRenderHint, ae as ProductTimeProfile, n as ProductType, s as ProductVariant, x as ProductVariantValue, r as ProductWithDetails, S as SalesChannel, as as SelectedAddOnOption, b6 as SubmitAuthorizationInput, ak as TaxPathComponent, aS as UICart, aK as UICartBusiness, aM as UICartCustomer, aL as UICartLocation, aN as UICartPricing, aT as UICartResponse, aV as UpdateCartItemInput, u as VariantAxis, z as VariantAxisSelection, w as VariantAxisValue, v as VariantAxisWithValues, av as VariantDetails, aQ as VariantDetailsDTO, t as VariantDisplayAttribute, y as VariantLocationAvailability, V as VariantStrategy, Z as ZERO, c as currencyCode, k as enrichError, j as getErrorHint, i as isCimplifyError, l as isRetryableError, m as money, a as moneyFromNumber } from './payment-CLIWNMaP.js';
package/dist/index.js CHANGED
@@ -2697,6 +2697,12 @@ var CimplifyElements = class {
2697
2697
  getElement(type) {
2698
2698
  return this.elements.get(type);
2699
2699
  }
2700
+ _removeElement(type, instance) {
2701
+ const current = this.elements.get(type);
2702
+ if (current === instance) {
2703
+ this.elements.delete(type);
2704
+ }
2705
+ }
2700
2706
  destroy() {
2701
2707
  this.elements.forEach((element) => element.destroy());
2702
2708
  this.elements.clear();
@@ -2735,7 +2741,9 @@ var CimplifyElements = class {
2735
2741
  processCheckout(options) {
2736
2742
  let abortFn = null;
2737
2743
  const task = (async () => {
2744
+ console.debug("[cimplify:checkout] processCheckout called", { cart_id: options.cart_id, order_type: options.order_type, location_id: options.location_id });
2738
2745
  if (this.checkoutInProgress) {
2746
+ console.debug("[cimplify:checkout] BLOCKED: already processing");
2739
2747
  return toCheckoutError(
2740
2748
  "ALREADY_PROCESSING",
2741
2749
  "Checkout is already in progress.",
@@ -2743,6 +2751,7 @@ var CimplifyElements = class {
2743
2751
  );
2744
2752
  }
2745
2753
  if (!options.cart_id) {
2754
+ console.debug("[cimplify:checkout] BLOCKED: no cart_id");
2746
2755
  return toCheckoutError(
2747
2756
  "INVALID_CART",
2748
2757
  "A valid cart is required before checkout can start.",
@@ -2750,6 +2759,7 @@ var CimplifyElements = class {
2750
2759
  );
2751
2760
  }
2752
2761
  if (!options.order_type) {
2762
+ console.debug("[cimplify:checkout] BLOCKED: no order_type");
2753
2763
  return toCheckoutError(
2754
2764
  "ORDER_TYPE_REQUIRED",
2755
2765
  "Order type is required before checkout can start.",
@@ -2758,6 +2768,7 @@ var CimplifyElements = class {
2758
2768
  }
2759
2769
  const paymentElement = this.elements.get(ELEMENT_TYPES.PAYMENT);
2760
2770
  if (!paymentElement) {
2771
+ console.debug("[cimplify:checkout] BLOCKED: no payment element");
2761
2772
  return toCheckoutError(
2762
2773
  "NO_PAYMENT_ELEMENT",
2763
2774
  "Payment element must be mounted before checkout.",
@@ -2765,6 +2776,7 @@ var CimplifyElements = class {
2765
2776
  );
2766
2777
  }
2767
2778
  if (!paymentElement.isMounted()) {
2779
+ console.debug("[cimplify:checkout] BLOCKED: payment element not mounted");
2768
2780
  return toCheckoutError(
2769
2781
  "PAYMENT_NOT_MOUNTED",
2770
2782
  "Payment element must be mounted before checkout.",
@@ -2773,6 +2785,7 @@ var CimplifyElements = class {
2773
2785
  }
2774
2786
  const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
2775
2787
  if (authElement && !this.accessToken) {
2788
+ console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
2776
2789
  return toCheckoutError(
2777
2790
  "AUTH_INCOMPLETE",
2778
2791
  "Authentication must complete before checkout can start.",
@@ -2781,9 +2794,12 @@ var CimplifyElements = class {
2781
2794
  }
2782
2795
  const addressElement = this.elements.get(ELEMENT_TYPES.ADDRESS);
2783
2796
  if (addressElement) {
2797
+ console.debug("[cimplify:checkout] getting address data...");
2784
2798
  await addressElement.getData();
2799
+ console.debug("[cimplify:checkout] address data resolved", this.addressData);
2785
2800
  }
2786
2801
  await this.hydrateCustomerData();
2802
+ console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId });
2787
2803
  const processMessage = {
2788
2804
  type: MESSAGE_TYPES.PROCESS_CHECKOUT,
2789
2805
  cart_id: options.cart_id,
@@ -2860,6 +2876,7 @@ var CimplifyElements = class {
2860
2876
  return;
2861
2877
  }
2862
2878
  if (message.type === MESSAGE_TYPES.CHECKOUT_COMPLETE) {
2879
+ console.debug("[cimplify:checkout] received checkout_complete", { success: message.success, error: message.error });
2863
2880
  settle({
2864
2881
  success: message.success,
2865
2882
  order: message.order,
@@ -2882,7 +2899,9 @@ var CimplifyElements = class {
2882
2899
  );
2883
2900
  };
2884
2901
  this.activeCheckoutAbort = abortFn;
2902
+ console.debug("[cimplify:checkout] sending process_checkout to payment iframe", { cart_id: processMessage.cart_id, order_type: processMessage.order_type, hasCustomer: !!processMessage.customer, hasAddress: !!processMessage.address });
2885
2903
  paymentElement.sendMessage(processMessage);
2904
+ console.debug("[cimplify:checkout] postMessage sent, waiting for checkout_complete...");
2886
2905
  });
2887
2906
  })();
2888
2907
  const abortable = task;
@@ -3023,6 +3042,7 @@ var CimplifyElement = class {
3023
3042
  this.mounted = false;
3024
3043
  this.eventHandlers = /* @__PURE__ */ new Map();
3025
3044
  this.resolvers = /* @__PURE__ */ new Map();
3045
+ this.listening = false;
3026
3046
  this.type = type;
3027
3047
  this.businessId = businessId;
3028
3048
  this.linkUrl = linkUrl;
@@ -3032,6 +3052,7 @@ var CimplifyElement = class {
3032
3052
  this.boundHandleMessage = this.handleMessage.bind(this);
3033
3053
  if (typeof window !== "undefined") {
3034
3054
  window.addEventListener("message", this.boundHandleMessage);
3055
+ this.listening = true;
3035
3056
  }
3036
3057
  }
3037
3058
  mount(container) {
@@ -3046,6 +3067,10 @@ var CimplifyElement = class {
3046
3067
  }
3047
3068
  this.container = target;
3048
3069
  this.mounted = true;
3070
+ if (!this.listening && typeof window !== "undefined") {
3071
+ window.addEventListener("message", this.boundHandleMessage);
3072
+ this.listening = true;
3073
+ }
3049
3074
  void this.createIframe();
3050
3075
  }
3051
3076
  destroy() {
@@ -3058,9 +3083,11 @@ var CimplifyElement = class {
3058
3083
  this.eventHandlers.clear();
3059
3084
  this.resolvers.forEach((entry) => clearTimeout(entry.timeoutId));
3060
3085
  this.resolvers.clear();
3061
- if (typeof window !== "undefined") {
3086
+ if (this.listening && typeof window !== "undefined") {
3062
3087
  window.removeEventListener("message", this.boundHandleMessage);
3088
+ this.listening = false;
3063
3089
  }
3090
+ this.parent._removeElement(this.type, this);
3064
3091
  }
3065
3092
  on(event, handler) {
3066
3093
  if (!this.eventHandlers.has(event)) {
package/dist/index.mjs CHANGED
@@ -2695,6 +2695,12 @@ var CimplifyElements = class {
2695
2695
  getElement(type) {
2696
2696
  return this.elements.get(type);
2697
2697
  }
2698
+ _removeElement(type, instance) {
2699
+ const current = this.elements.get(type);
2700
+ if (current === instance) {
2701
+ this.elements.delete(type);
2702
+ }
2703
+ }
2698
2704
  destroy() {
2699
2705
  this.elements.forEach((element) => element.destroy());
2700
2706
  this.elements.clear();
@@ -2733,7 +2739,9 @@ var CimplifyElements = class {
2733
2739
  processCheckout(options) {
2734
2740
  let abortFn = null;
2735
2741
  const task = (async () => {
2742
+ console.debug("[cimplify:checkout] processCheckout called", { cart_id: options.cart_id, order_type: options.order_type, location_id: options.location_id });
2736
2743
  if (this.checkoutInProgress) {
2744
+ console.debug("[cimplify:checkout] BLOCKED: already processing");
2737
2745
  return toCheckoutError(
2738
2746
  "ALREADY_PROCESSING",
2739
2747
  "Checkout is already in progress.",
@@ -2741,6 +2749,7 @@ var CimplifyElements = class {
2741
2749
  );
2742
2750
  }
2743
2751
  if (!options.cart_id) {
2752
+ console.debug("[cimplify:checkout] BLOCKED: no cart_id");
2744
2753
  return toCheckoutError(
2745
2754
  "INVALID_CART",
2746
2755
  "A valid cart is required before checkout can start.",
@@ -2748,6 +2757,7 @@ var CimplifyElements = class {
2748
2757
  );
2749
2758
  }
2750
2759
  if (!options.order_type) {
2760
+ console.debug("[cimplify:checkout] BLOCKED: no order_type");
2751
2761
  return toCheckoutError(
2752
2762
  "ORDER_TYPE_REQUIRED",
2753
2763
  "Order type is required before checkout can start.",
@@ -2756,6 +2766,7 @@ var CimplifyElements = class {
2756
2766
  }
2757
2767
  const paymentElement = this.elements.get(ELEMENT_TYPES.PAYMENT);
2758
2768
  if (!paymentElement) {
2769
+ console.debug("[cimplify:checkout] BLOCKED: no payment element");
2759
2770
  return toCheckoutError(
2760
2771
  "NO_PAYMENT_ELEMENT",
2761
2772
  "Payment element must be mounted before checkout.",
@@ -2763,6 +2774,7 @@ var CimplifyElements = class {
2763
2774
  );
2764
2775
  }
2765
2776
  if (!paymentElement.isMounted()) {
2777
+ console.debug("[cimplify:checkout] BLOCKED: payment element not mounted");
2766
2778
  return toCheckoutError(
2767
2779
  "PAYMENT_NOT_MOUNTED",
2768
2780
  "Payment element must be mounted before checkout.",
@@ -2771,6 +2783,7 @@ var CimplifyElements = class {
2771
2783
  }
2772
2784
  const authElement = this.elements.get(ELEMENT_TYPES.AUTH);
2773
2785
  if (authElement && !this.accessToken) {
2786
+ console.debug("[cimplify:checkout] BLOCKED: auth incomplete");
2774
2787
  return toCheckoutError(
2775
2788
  "AUTH_INCOMPLETE",
2776
2789
  "Authentication must complete before checkout can start.",
@@ -2779,9 +2792,12 @@ var CimplifyElements = class {
2779
2792
  }
2780
2793
  const addressElement = this.elements.get(ELEMENT_TYPES.ADDRESS);
2781
2794
  if (addressElement) {
2795
+ console.debug("[cimplify:checkout] getting address data...");
2782
2796
  await addressElement.getData();
2797
+ console.debug("[cimplify:checkout] address data resolved", this.addressData);
2783
2798
  }
2784
2799
  await this.hydrateCustomerData();
2800
+ console.debug("[cimplify:checkout] customer data hydrated", { customerData: this.customerData, accountId: this.accountId });
2785
2801
  const processMessage = {
2786
2802
  type: MESSAGE_TYPES.PROCESS_CHECKOUT,
2787
2803
  cart_id: options.cart_id,
@@ -2858,6 +2874,7 @@ var CimplifyElements = class {
2858
2874
  return;
2859
2875
  }
2860
2876
  if (message.type === MESSAGE_TYPES.CHECKOUT_COMPLETE) {
2877
+ console.debug("[cimplify:checkout] received checkout_complete", { success: message.success, error: message.error });
2861
2878
  settle({
2862
2879
  success: message.success,
2863
2880
  order: message.order,
@@ -2880,7 +2897,9 @@ var CimplifyElements = class {
2880
2897
  );
2881
2898
  };
2882
2899
  this.activeCheckoutAbort = abortFn;
2900
+ console.debug("[cimplify:checkout] sending process_checkout to payment iframe", { cart_id: processMessage.cart_id, order_type: processMessage.order_type, hasCustomer: !!processMessage.customer, hasAddress: !!processMessage.address });
2883
2901
  paymentElement.sendMessage(processMessage);
2902
+ console.debug("[cimplify:checkout] postMessage sent, waiting for checkout_complete...");
2884
2903
  });
2885
2904
  })();
2886
2905
  const abortable = task;
@@ -3021,6 +3040,7 @@ var CimplifyElement = class {
3021
3040
  this.mounted = false;
3022
3041
  this.eventHandlers = /* @__PURE__ */ new Map();
3023
3042
  this.resolvers = /* @__PURE__ */ new Map();
3043
+ this.listening = false;
3024
3044
  this.type = type;
3025
3045
  this.businessId = businessId;
3026
3046
  this.linkUrl = linkUrl;
@@ -3030,6 +3050,7 @@ var CimplifyElement = class {
3030
3050
  this.boundHandleMessage = this.handleMessage.bind(this);
3031
3051
  if (typeof window !== "undefined") {
3032
3052
  window.addEventListener("message", this.boundHandleMessage);
3053
+ this.listening = true;
3033
3054
  }
3034
3055
  }
3035
3056
  mount(container) {
@@ -3044,6 +3065,10 @@ var CimplifyElement = class {
3044
3065
  }
3045
3066
  this.container = target;
3046
3067
  this.mounted = true;
3068
+ if (!this.listening && typeof window !== "undefined") {
3069
+ window.addEventListener("message", this.boundHandleMessage);
3070
+ this.listening = true;
3071
+ }
3047
3072
  void this.createIframe();
3048
3073
  }
3049
3074
  destroy() {
@@ -3056,9 +3081,11 @@ var CimplifyElement = class {
3056
3081
  this.eventHandlers.clear();
3057
3082
  this.resolvers.forEach((entry) => clearTimeout(entry.timeoutId));
3058
3083
  this.resolvers.clear();
3059
- if (typeof window !== "undefined") {
3084
+ if (this.listening && typeof window !== "undefined") {
3060
3085
  window.removeEventListener("message", this.boundHandleMessage);
3086
+ this.listening = false;
3061
3087
  }
3088
+ this.parent._removeElement(this.type, this);
3062
3089
  }
3063
3090
  on(event, handler) {
3064
3091
  if (!this.eventHandlers.has(event)) {
package/dist/react.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CimplifyClient, X as ProcessCheckoutResult, Z as CheckoutStatus, _ as CheckoutStatusContext, bp as Location, bm as Business, aR as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, s as CimplifyElements, w as ElementsOptions, cI as AuthenticatedData, cE as AddressInfo, cF as PaymentMethodInfo, cK as ElementsCheckoutResult, W as ProcessCheckoutOptions } from './client-Bj4y523g.mjs';
1
+ import { C as CimplifyClient, X as ProcessCheckoutResult, Z as CheckoutStatus, _ as CheckoutStatusContext, bp as Location, bm as Business, aR as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, s as CimplifyElements, w as ElementsOptions, cI as AuthenticatedData, cE as AddressInfo, cF as PaymentMethodInfo, cK as ElementsCheckoutResult, W as ProcessCheckoutOptions } from './client-CVqmSTNq.mjs';
2
2
  import React, { ReactNode } from 'react';
3
3
  import { q as Product, d as Pagination, h as CimplifyError, r as ProductWithDetails, K as Category, aw as BundleSelectionInput, a7 as ComponentSelectionInput, N as Collection, X as BundleWithDetails, a3 as CompositeWithDetails, a8 as CompositePriceResult, C as CurrencyCode } from './payment-CLIWNMaP.mjs';
4
4
  import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-t3FBTU8p.mjs';
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CimplifyClient, X as ProcessCheckoutResult, Z as CheckoutStatus, _ as CheckoutStatusContext, bp as Location, bm as Business, aR as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, s as CimplifyElements, w as ElementsOptions, cI as AuthenticatedData, cE as AddressInfo, cF as PaymentMethodInfo, cK as ElementsCheckoutResult, W as ProcessCheckoutOptions } from './client-CUYaKDjB.js';
1
+ import { C as CimplifyClient, X as ProcessCheckoutResult, Z as CheckoutStatus, _ as CheckoutStatusContext, bp as Location, bm as Business, aR as Order, d as QuoteBundleSelectionInput, Q as QuoteCompositeSelectionInput, P as PriceQuote, g as QuoteUiMessage, s as CimplifyElements, w as ElementsOptions, cI as AuthenticatedData, cE as AddressInfo, cF as PaymentMethodInfo, cK as ElementsCheckoutResult, W as ProcessCheckoutOptions } from './client-Dkinq9Oz.js';
2
2
  import React, { ReactNode } from 'react';
3
3
  import { q as Product, d as Pagination, h as CimplifyError, r as ProductWithDetails, K as Category, aw as BundleSelectionInput, a7 as ComponentSelectionInput, N as Collection, X as BundleWithDetails, a3 as CompositeWithDetails, a8 as CompositePriceResult, C as CurrencyCode } from './payment-CLIWNMaP.js';
4
4
  import { A as AdSlot, a as AdPosition, e as AdContextValue } from './ads-t3FBTU8p.js';