@cimplify/sdk 0.7.9 → 0.7.10

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-CWqogWK3.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-Bj4y523g.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-DgIpU12R.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-CUYaKDjB.js';
2
2
  import './payment-CLIWNMaP.js';
3
3
 
4
4
  type Operator = "==" | "!=" | ">" | "<" | ">=" | "<=" | "contains" | "startsWith";
package/dist/advanced.js CHANGED
@@ -2158,6 +2158,7 @@ var MESSAGE_TYPES = {
2158
2158
  PAYMENT_METHOD_SELECTED: "payment_method_selected",
2159
2159
  TOKEN_REFRESHED: "token_refreshed",
2160
2160
  LOGOUT_COMPLETE: "logout_complete",
2161
+ CONTACT_PROVIDED: "contact_provided",
2161
2162
  CHECKOUT_STATUS: "checkout_status",
2162
2163
  CHECKOUT_COMPLETE: "checkout_complete"
2163
2164
  };
@@ -2526,6 +2527,16 @@ var CimplifyElements = class {
2526
2527
  case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
2527
2528
  this.paymentData = message.method;
2528
2529
  break;
2530
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
2531
+ if (!this.customerData) {
2532
+ this.customerData = { name: "", email: null, phone: null };
2533
+ }
2534
+ if (message.contactType === "email") {
2535
+ this.customerData.email = message.contact;
2536
+ } else {
2537
+ this.customerData.phone = message.contact;
2538
+ }
2539
+ break;
2529
2540
  case MESSAGE_TYPES.LOGOUT_COMPLETE:
2530
2541
  if (this.checkoutInProgress && this.activeCheckoutAbort) {
2531
2542
  this.activeCheckoutAbort();
@@ -2546,6 +2557,16 @@ var CimplifyElements = class {
2546
2557
  _setPaymentData(data) {
2547
2558
  this.paymentData = data;
2548
2559
  }
2560
+ _setGuestContact(contact, contactType) {
2561
+ if (!this.customerData) {
2562
+ this.customerData = { name: "", email: null, phone: null };
2563
+ }
2564
+ if (contactType === "email") {
2565
+ this.customerData.email = contact;
2566
+ } else {
2567
+ this.customerData.phone = contact;
2568
+ }
2569
+ }
2549
2570
  };
2550
2571
  var CimplifyElement = class {
2551
2572
  constructor(type, businessId, linkUrl, options, parent) {
@@ -2732,6 +2753,9 @@ var CimplifyElement = class {
2732
2753
  this.emit(EVENT_TYPES.CHANGE, { paymentMethod: message.method });
2733
2754
  this.resolveData(message.method);
2734
2755
  break;
2756
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
2757
+ this.parent._setGuestContact(message.contact, message.contactType);
2758
+ break;
2735
2759
  }
2736
2760
  }
2737
2761
  emit(event, data) {
package/dist/advanced.mjs CHANGED
@@ -2156,6 +2156,7 @@ var MESSAGE_TYPES = {
2156
2156
  PAYMENT_METHOD_SELECTED: "payment_method_selected",
2157
2157
  TOKEN_REFRESHED: "token_refreshed",
2158
2158
  LOGOUT_COMPLETE: "logout_complete",
2159
+ CONTACT_PROVIDED: "contact_provided",
2159
2160
  CHECKOUT_STATUS: "checkout_status",
2160
2161
  CHECKOUT_COMPLETE: "checkout_complete"
2161
2162
  };
@@ -2524,6 +2525,16 @@ var CimplifyElements = class {
2524
2525
  case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
2525
2526
  this.paymentData = message.method;
2526
2527
  break;
2528
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
2529
+ if (!this.customerData) {
2530
+ this.customerData = { name: "", email: null, phone: null };
2531
+ }
2532
+ if (message.contactType === "email") {
2533
+ this.customerData.email = message.contact;
2534
+ } else {
2535
+ this.customerData.phone = message.contact;
2536
+ }
2537
+ break;
2527
2538
  case MESSAGE_TYPES.LOGOUT_COMPLETE:
2528
2539
  if (this.checkoutInProgress && this.activeCheckoutAbort) {
2529
2540
  this.activeCheckoutAbort();
@@ -2544,6 +2555,16 @@ var CimplifyElements = class {
2544
2555
  _setPaymentData(data) {
2545
2556
  this.paymentData = data;
2546
2557
  }
2558
+ _setGuestContact(contact, contactType) {
2559
+ if (!this.customerData) {
2560
+ this.customerData = { name: "", email: null, phone: null };
2561
+ }
2562
+ if (contactType === "email") {
2563
+ this.customerData.email = contact;
2564
+ } else {
2565
+ this.customerData.phone = contact;
2566
+ }
2567
+ }
2547
2568
  };
2548
2569
  var CimplifyElement = class {
2549
2570
  constructor(type, businessId, linkUrl, options, parent) {
@@ -2730,6 +2751,9 @@ var CimplifyElement = class {
2730
2751
  this.emit(EVENT_TYPES.CHANGE, { paymentMethod: message.method });
2731
2752
  this.resolveData(message.method);
2732
2753
  break;
2754
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
2755
+ this.parent._setGuestContact(message.contact, message.contactType);
2756
+ break;
2733
2757
  }
2734
2758
  }
2735
2759
  emit(event, data) {
@@ -1907,6 +1907,7 @@ declare const MESSAGE_TYPES: {
1907
1907
  readonly PAYMENT_METHOD_SELECTED: "payment_method_selected";
1908
1908
  readonly TOKEN_REFRESHED: "token_refreshed";
1909
1909
  readonly LOGOUT_COMPLETE: "logout_complete";
1910
+ readonly CONTACT_PROVIDED: "contact_provided";
1910
1911
  readonly CHECKOUT_STATUS: "checkout_status";
1911
1912
  readonly CHECKOUT_COMPLETE: "checkout_complete";
1912
1913
  };
@@ -2031,6 +2032,10 @@ type IframeToParentMessage = {
2031
2032
  } | {
2032
2033
  type: typeof MESSAGE_TYPES.REQUIRES_OTP;
2033
2034
  contactMasked: string;
2035
+ } | {
2036
+ type: typeof MESSAGE_TYPES.CONTACT_PROVIDED;
2037
+ contact: string;
2038
+ contactType: "email" | "phone";
2034
2039
  } | {
2035
2040
  type: typeof MESSAGE_TYPES.ERROR;
2036
2041
  code: string;
@@ -2116,6 +2121,7 @@ declare class CimplifyElements {
2116
2121
  private handleMessage;
2117
2122
  _setAddressData(data: AddressInfo): void;
2118
2123
  _setPaymentData(data: PaymentMethodInfo): void;
2124
+ _setGuestContact(contact: string, contactType: "email" | "phone"): void;
2119
2125
  }
2120
2126
  declare class CimplifyElement {
2121
2127
  private type;
@@ -1907,6 +1907,7 @@ declare const MESSAGE_TYPES: {
1907
1907
  readonly PAYMENT_METHOD_SELECTED: "payment_method_selected";
1908
1908
  readonly TOKEN_REFRESHED: "token_refreshed";
1909
1909
  readonly LOGOUT_COMPLETE: "logout_complete";
1910
+ readonly CONTACT_PROVIDED: "contact_provided";
1910
1911
  readonly CHECKOUT_STATUS: "checkout_status";
1911
1912
  readonly CHECKOUT_COMPLETE: "checkout_complete";
1912
1913
  };
@@ -2031,6 +2032,10 @@ type IframeToParentMessage = {
2031
2032
  } | {
2032
2033
  type: typeof MESSAGE_TYPES.REQUIRES_OTP;
2033
2034
  contactMasked: string;
2035
+ } | {
2036
+ type: typeof MESSAGE_TYPES.CONTACT_PROVIDED;
2037
+ contact: string;
2038
+ contactType: "email" | "phone";
2034
2039
  } | {
2035
2040
  type: typeof MESSAGE_TYPES.ERROR;
2036
2041
  code: string;
@@ -2116,6 +2121,7 @@ declare class CimplifyElements {
2116
2121
  private handleMessage;
2117
2122
  _setAddressData(data: AddressInfo): void;
2118
2123
  _setPaymentData(data: PaymentMethodInfo): void;
2124
+ _setGuestContact(contact: string, contactType: "email" | "phone"): void;
2119
2125
  }
2120
2126
  declare class CimplifyElement {
2121
2127
  private type;
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-CWqogWK3.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-Bj4y523g.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-DgIpU12R.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-CUYaKDjB.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
@@ -2606,6 +2606,7 @@ var MESSAGE_TYPES = {
2606
2606
  PAYMENT_METHOD_SELECTED: "payment_method_selected",
2607
2607
  TOKEN_REFRESHED: "token_refreshed",
2608
2608
  LOGOUT_COMPLETE: "logout_complete",
2609
+ CONTACT_PROVIDED: "contact_provided",
2609
2610
  CHECKOUT_STATUS: "checkout_status",
2610
2611
  CHECKOUT_COMPLETE: "checkout_complete"
2611
2612
  };
@@ -2974,6 +2975,16 @@ var CimplifyElements = class {
2974
2975
  case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
2975
2976
  this.paymentData = message.method;
2976
2977
  break;
2978
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
2979
+ if (!this.customerData) {
2980
+ this.customerData = { name: "", email: null, phone: null };
2981
+ }
2982
+ if (message.contactType === "email") {
2983
+ this.customerData.email = message.contact;
2984
+ } else {
2985
+ this.customerData.phone = message.contact;
2986
+ }
2987
+ break;
2977
2988
  case MESSAGE_TYPES.LOGOUT_COMPLETE:
2978
2989
  if (this.checkoutInProgress && this.activeCheckoutAbort) {
2979
2990
  this.activeCheckoutAbort();
@@ -2994,6 +3005,16 @@ var CimplifyElements = class {
2994
3005
  _setPaymentData(data) {
2995
3006
  this.paymentData = data;
2996
3007
  }
3008
+ _setGuestContact(contact, contactType) {
3009
+ if (!this.customerData) {
3010
+ this.customerData = { name: "", email: null, phone: null };
3011
+ }
3012
+ if (contactType === "email") {
3013
+ this.customerData.email = contact;
3014
+ } else {
3015
+ this.customerData.phone = contact;
3016
+ }
3017
+ }
2997
3018
  };
2998
3019
  var CimplifyElement = class {
2999
3020
  constructor(type, businessId, linkUrl, options, parent) {
@@ -3180,6 +3201,9 @@ var CimplifyElement = class {
3180
3201
  this.emit(EVENT_TYPES.CHANGE, { paymentMethod: message.method });
3181
3202
  this.resolveData(message.method);
3182
3203
  break;
3204
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
3205
+ this.parent._setGuestContact(message.contact, message.contactType);
3206
+ break;
3183
3207
  }
3184
3208
  }
3185
3209
  emit(event, data) {
package/dist/index.mjs CHANGED
@@ -2604,6 +2604,7 @@ var MESSAGE_TYPES = {
2604
2604
  PAYMENT_METHOD_SELECTED: "payment_method_selected",
2605
2605
  TOKEN_REFRESHED: "token_refreshed",
2606
2606
  LOGOUT_COMPLETE: "logout_complete",
2607
+ CONTACT_PROVIDED: "contact_provided",
2607
2608
  CHECKOUT_STATUS: "checkout_status",
2608
2609
  CHECKOUT_COMPLETE: "checkout_complete"
2609
2610
  };
@@ -2972,6 +2973,16 @@ var CimplifyElements = class {
2972
2973
  case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
2973
2974
  this.paymentData = message.method;
2974
2975
  break;
2976
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
2977
+ if (!this.customerData) {
2978
+ this.customerData = { name: "", email: null, phone: null };
2979
+ }
2980
+ if (message.contactType === "email") {
2981
+ this.customerData.email = message.contact;
2982
+ } else {
2983
+ this.customerData.phone = message.contact;
2984
+ }
2985
+ break;
2975
2986
  case MESSAGE_TYPES.LOGOUT_COMPLETE:
2976
2987
  if (this.checkoutInProgress && this.activeCheckoutAbort) {
2977
2988
  this.activeCheckoutAbort();
@@ -2992,6 +3003,16 @@ var CimplifyElements = class {
2992
3003
  _setPaymentData(data) {
2993
3004
  this.paymentData = data;
2994
3005
  }
3006
+ _setGuestContact(contact, contactType) {
3007
+ if (!this.customerData) {
3008
+ this.customerData = { name: "", email: null, phone: null };
3009
+ }
3010
+ if (contactType === "email") {
3011
+ this.customerData.email = contact;
3012
+ } else {
3013
+ this.customerData.phone = contact;
3014
+ }
3015
+ }
2995
3016
  };
2996
3017
  var CimplifyElement = class {
2997
3018
  constructor(type, businessId, linkUrl, options, parent) {
@@ -3178,6 +3199,9 @@ var CimplifyElement = class {
3178
3199
  this.emit(EVENT_TYPES.CHANGE, { paymentMethod: message.method });
3179
3200
  this.resolveData(message.method);
3180
3201
  break;
3202
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
3203
+ this.parent._setGuestContact(message.contact, message.contactType);
3204
+ break;
3181
3205
  }
3182
3206
  }
3183
3207
  emit(event, data) {
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-CWqogWK3.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-Bj4y523g.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-DgIpU12R.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-CUYaKDjB.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';
package/dist/react.js CHANGED
@@ -29,6 +29,7 @@ var MESSAGE_TYPES = {
29
29
  PAYMENT_METHOD_SELECTED: "payment_method_selected",
30
30
  TOKEN_REFRESHED: "token_refreshed",
31
31
  LOGOUT_COMPLETE: "logout_complete",
32
+ CONTACT_PROVIDED: "contact_provided",
32
33
  CHECKOUT_STATUS: "checkout_status",
33
34
  CHECKOUT_COMPLETE: "checkout_complete"
34
35
  };
@@ -3225,6 +3226,16 @@ var CimplifyElements = class {
3225
3226
  case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
3226
3227
  this.paymentData = message.method;
3227
3228
  break;
3229
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
3230
+ if (!this.customerData) {
3231
+ this.customerData = { name: "", email: null, phone: null };
3232
+ }
3233
+ if (message.contactType === "email") {
3234
+ this.customerData.email = message.contact;
3235
+ } else {
3236
+ this.customerData.phone = message.contact;
3237
+ }
3238
+ break;
3228
3239
  case MESSAGE_TYPES.LOGOUT_COMPLETE:
3229
3240
  if (this.checkoutInProgress && this.activeCheckoutAbort) {
3230
3241
  this.activeCheckoutAbort();
@@ -3245,6 +3256,16 @@ var CimplifyElements = class {
3245
3256
  _setPaymentData(data) {
3246
3257
  this.paymentData = data;
3247
3258
  }
3259
+ _setGuestContact(contact, contactType) {
3260
+ if (!this.customerData) {
3261
+ this.customerData = { name: "", email: null, phone: null };
3262
+ }
3263
+ if (contactType === "email") {
3264
+ this.customerData.email = contact;
3265
+ } else {
3266
+ this.customerData.phone = contact;
3267
+ }
3268
+ }
3248
3269
  };
3249
3270
  var CimplifyElement = class {
3250
3271
  constructor(type, businessId, linkUrl, options, parent) {
@@ -3431,6 +3452,9 @@ var CimplifyElement = class {
3431
3452
  this.emit(EVENT_TYPES.CHANGE, { paymentMethod: message.method });
3432
3453
  this.resolveData(message.method);
3433
3454
  break;
3455
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
3456
+ this.parent._setGuestContact(message.contact, message.contactType);
3457
+ break;
3434
3458
  }
3435
3459
  }
3436
3460
  emit(event, data) {
package/dist/react.mjs CHANGED
@@ -27,6 +27,7 @@ var MESSAGE_TYPES = {
27
27
  PAYMENT_METHOD_SELECTED: "payment_method_selected",
28
28
  TOKEN_REFRESHED: "token_refreshed",
29
29
  LOGOUT_COMPLETE: "logout_complete",
30
+ CONTACT_PROVIDED: "contact_provided",
30
31
  CHECKOUT_STATUS: "checkout_status",
31
32
  CHECKOUT_COMPLETE: "checkout_complete"
32
33
  };
@@ -3223,6 +3224,16 @@ var CimplifyElements = class {
3223
3224
  case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
3224
3225
  this.paymentData = message.method;
3225
3226
  break;
3227
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
3228
+ if (!this.customerData) {
3229
+ this.customerData = { name: "", email: null, phone: null };
3230
+ }
3231
+ if (message.contactType === "email") {
3232
+ this.customerData.email = message.contact;
3233
+ } else {
3234
+ this.customerData.phone = message.contact;
3235
+ }
3236
+ break;
3226
3237
  case MESSAGE_TYPES.LOGOUT_COMPLETE:
3227
3238
  if (this.checkoutInProgress && this.activeCheckoutAbort) {
3228
3239
  this.activeCheckoutAbort();
@@ -3243,6 +3254,16 @@ var CimplifyElements = class {
3243
3254
  _setPaymentData(data) {
3244
3255
  this.paymentData = data;
3245
3256
  }
3257
+ _setGuestContact(contact, contactType) {
3258
+ if (!this.customerData) {
3259
+ this.customerData = { name: "", email: null, phone: null };
3260
+ }
3261
+ if (contactType === "email") {
3262
+ this.customerData.email = contact;
3263
+ } else {
3264
+ this.customerData.phone = contact;
3265
+ }
3266
+ }
3246
3267
  };
3247
3268
  var CimplifyElement = class {
3248
3269
  constructor(type, businessId, linkUrl, options, parent) {
@@ -3429,6 +3450,9 @@ var CimplifyElement = class {
3429
3450
  this.emit(EVENT_TYPES.CHANGE, { paymentMethod: message.method });
3430
3451
  this.resolveData(message.method);
3431
3452
  break;
3453
+ case MESSAGE_TYPES.CONTACT_PROVIDED:
3454
+ this.parent._setGuestContact(message.contact, message.contactType);
3455
+ break;
3432
3456
  }
3433
3457
  }
3434
3458
  emit(event, data) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/sdk",
3
- "version": "0.7.9",
3
+ "version": "0.7.10",
4
4
  "description": "Cimplify Commerce SDK for storefronts",
5
5
  "keywords": [
6
6
  "cimplify",