@cimplify/sdk 0.7.9 → 0.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/advanced.d.mts +1 -1
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +24 -0
- package/dist/advanced.mjs +24 -0
- package/dist/{client-CWqogWK3.d.mts → client-Bj4y523g.d.mts} +6 -0
- package/dist/{client-DgIpU12R.d.ts → client-CUYaKDjB.d.ts} +6 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +24 -0
- package/dist/index.mjs +24 -0
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +82 -37
- package/dist/react.mjs +82 -37
- package/package.json +1 -1
package/dist/advanced.d.mts
CHANGED
|
@@ -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-
|
|
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";
|
package/dist/advanced.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
};
|
|
@@ -338,6 +339,18 @@ function Ad({
|
|
|
338
339
|
}
|
|
339
340
|
);
|
|
340
341
|
}
|
|
342
|
+
var SPACE = { sm: 8, md: 12, lg: 16, xl: 24 };
|
|
343
|
+
function shellColors(isDark, primaryColor) {
|
|
344
|
+
return {
|
|
345
|
+
text: isDark ? "#f4f4f5" : "#1a1a1a",
|
|
346
|
+
textSecondary: isDark ? "#a1a1aa" : "#52525b",
|
|
347
|
+
textMuted: isDark ? "#71717a" : "#a1a1aa",
|
|
348
|
+
border: isDark ? "#27272a" : "#e4e4e7",
|
|
349
|
+
surface: isDark ? "#18181b" : "#fafafa",
|
|
350
|
+
error: "#dc2626",
|
|
351
|
+
primary: primaryColor
|
|
352
|
+
};
|
|
353
|
+
}
|
|
341
354
|
function labelForOrderType(orderType) {
|
|
342
355
|
if (orderType === "dine_in") {
|
|
343
356
|
return "Dine In";
|
|
@@ -630,11 +643,12 @@ function CimplifyCheckout({
|
|
|
630
643
|
onError,
|
|
631
644
|
orderType
|
|
632
645
|
]);
|
|
646
|
+
const colors = shellColors(isDark ?? false, primaryColor);
|
|
633
647
|
if (isInitializing) {
|
|
634
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-status": "", style: { fontSize:
|
|
648
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-status": "", style: { fontSize: 13, color: colors.textSecondary }, children: "Preparing checkout..." }) });
|
|
635
649
|
}
|
|
636
650
|
if (!isDemoCheckout && (!resolvedBusinessId || !resolvedCartId)) {
|
|
637
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-error": "", style: { fontSize:
|
|
651
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-error": "", style: { fontSize: 13, color: colors.error }, children: errorMessage || "Unable to initialize checkout. Please refresh and try again." }) });
|
|
638
652
|
}
|
|
639
653
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, "data-cimplify-checkout": "", children: [
|
|
640
654
|
isTestMode && !isDemoCheckout && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -651,38 +665,47 @@ function CimplifyCheckout({
|
|
|
651
665
|
}
|
|
652
666
|
),
|
|
653
667
|
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-section": "payment", children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: isDemoCheckout ? void 0 : paymentMountRef }) }),
|
|
654
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-section": "order-type", style: { marginTop:
|
|
655
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize:
|
|
668
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-section": "order-type", style: { marginTop: SPACE.xl }, children: [
|
|
669
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: 13, fontWeight: 500, color: colors.textMuted, marginBottom: SPACE.sm }, children: "Order type" }),
|
|
656
670
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
657
671
|
"div",
|
|
658
672
|
{
|
|
659
673
|
role: "group",
|
|
660
674
|
"aria-label": "Order type",
|
|
661
|
-
style: {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
675
|
+
style: {
|
|
676
|
+
display: "inline-flex",
|
|
677
|
+
border: `1px solid ${colors.border}`,
|
|
678
|
+
borderRadius: 8,
|
|
679
|
+
padding: 3,
|
|
680
|
+
background: colors.surface
|
|
681
|
+
},
|
|
682
|
+
children: resolvedOrderTypes.map((type) => {
|
|
683
|
+
const active = orderType === type;
|
|
684
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
685
|
+
"button",
|
|
686
|
+
{
|
|
687
|
+
type: "button",
|
|
688
|
+
onClick: () => setOrderType(type),
|
|
689
|
+
disabled: isSubmitting,
|
|
690
|
+
"data-selected": active ? "true" : "false",
|
|
691
|
+
style: {
|
|
692
|
+
padding: `${SPACE.sm}px ${SPACE.lg}px`,
|
|
693
|
+
borderRadius: 6,
|
|
694
|
+
border: "none",
|
|
695
|
+
background: active ? primaryColor : "transparent",
|
|
696
|
+
color: active ? "#ffffff" : colors.textSecondary,
|
|
697
|
+
cursor: isSubmitting ? "not-allowed" : "pointer",
|
|
698
|
+
opacity: isSubmitting ? 0.6 : 1,
|
|
699
|
+
fontSize: 14,
|
|
700
|
+
fontWeight: 500,
|
|
701
|
+
transition: "all 150ms ease",
|
|
702
|
+
WebkitTapHighlightColor: "transparent"
|
|
703
|
+
},
|
|
704
|
+
children: labelForOrderType(type)
|
|
681
705
|
},
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
))
|
|
706
|
+
type
|
|
707
|
+
);
|
|
708
|
+
})
|
|
686
709
|
}
|
|
687
710
|
)
|
|
688
711
|
] }),
|
|
@@ -690,11 +713,11 @@ function CimplifyCheckout({
|
|
|
690
713
|
"div",
|
|
691
714
|
{
|
|
692
715
|
"data-cimplify-section": "address",
|
|
693
|
-
style: { marginTop:
|
|
716
|
+
style: { marginTop: SPACE.lg, display: orderType === "delivery" ? "block" : "none" },
|
|
694
717
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: isDemoCheckout ? void 0 : addressMountRef })
|
|
695
718
|
}
|
|
696
719
|
),
|
|
697
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop:
|
|
720
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginTop: SPACE.xl }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
698
721
|
"button",
|
|
699
722
|
{
|
|
700
723
|
type: "button",
|
|
@@ -702,23 +725,22 @@ function CimplifyCheckout({
|
|
|
702
725
|
disabled: isSubmitting,
|
|
703
726
|
style: {
|
|
704
727
|
width: "100%",
|
|
705
|
-
padding:
|
|
706
|
-
borderRadius:
|
|
728
|
+
padding: `${SPACE.md}px ${SPACE.lg}px`,
|
|
729
|
+
borderRadius: 8,
|
|
707
730
|
border: "none",
|
|
708
|
-
background: isSubmitting ?
|
|
731
|
+
background: isSubmitting ? colors.textMuted : primaryColor,
|
|
709
732
|
color: "#ffffff",
|
|
710
733
|
cursor: isSubmitting ? "not-allowed" : "pointer",
|
|
711
734
|
fontWeight: 600,
|
|
712
|
-
fontSize:
|
|
713
|
-
boxShadow: isSubmitting ? "none" : "0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",
|
|
735
|
+
fontSize: 16,
|
|
714
736
|
transition: "all 150ms ease",
|
|
715
737
|
WebkitTapHighlightColor: "transparent"
|
|
716
738
|
},
|
|
717
739
|
children: isSubmitting ? "Processing..." : "Complete Order"
|
|
718
740
|
}
|
|
719
741
|
) }),
|
|
720
|
-
status && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-status": "", style: { marginTop:
|
|
721
|
-
errorMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-error": "", style: { marginTop:
|
|
742
|
+
status && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-status": "", style: { marginTop: SPACE.sm, fontSize: 13, color: colors.textSecondary }, children: statusText || statusToLabel(status) }),
|
|
743
|
+
errorMessage && /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-error": "", style: { marginTop: SPACE.sm, fontSize: 13, color: colors.error }, children: errorMessage })
|
|
722
744
|
] });
|
|
723
745
|
}
|
|
724
746
|
|
|
@@ -3225,6 +3247,16 @@ var CimplifyElements = class {
|
|
|
3225
3247
|
case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
|
|
3226
3248
|
this.paymentData = message.method;
|
|
3227
3249
|
break;
|
|
3250
|
+
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
3251
|
+
if (!this.customerData) {
|
|
3252
|
+
this.customerData = { name: "", email: null, phone: null };
|
|
3253
|
+
}
|
|
3254
|
+
if (message.contactType === "email") {
|
|
3255
|
+
this.customerData.email = message.contact;
|
|
3256
|
+
} else {
|
|
3257
|
+
this.customerData.phone = message.contact;
|
|
3258
|
+
}
|
|
3259
|
+
break;
|
|
3228
3260
|
case MESSAGE_TYPES.LOGOUT_COMPLETE:
|
|
3229
3261
|
if (this.checkoutInProgress && this.activeCheckoutAbort) {
|
|
3230
3262
|
this.activeCheckoutAbort();
|
|
@@ -3245,6 +3277,16 @@ var CimplifyElements = class {
|
|
|
3245
3277
|
_setPaymentData(data) {
|
|
3246
3278
|
this.paymentData = data;
|
|
3247
3279
|
}
|
|
3280
|
+
_setGuestContact(contact, contactType) {
|
|
3281
|
+
if (!this.customerData) {
|
|
3282
|
+
this.customerData = { name: "", email: null, phone: null };
|
|
3283
|
+
}
|
|
3284
|
+
if (contactType === "email") {
|
|
3285
|
+
this.customerData.email = contact;
|
|
3286
|
+
} else {
|
|
3287
|
+
this.customerData.phone = contact;
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3248
3290
|
};
|
|
3249
3291
|
var CimplifyElement = class {
|
|
3250
3292
|
constructor(type, businessId, linkUrl, options, parent) {
|
|
@@ -3431,6 +3473,9 @@ var CimplifyElement = class {
|
|
|
3431
3473
|
this.emit(EVENT_TYPES.CHANGE, { paymentMethod: message.method });
|
|
3432
3474
|
this.resolveData(message.method);
|
|
3433
3475
|
break;
|
|
3476
|
+
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
3477
|
+
this.parent._setGuestContact(message.contact, message.contactType);
|
|
3478
|
+
break;
|
|
3434
3479
|
}
|
|
3435
3480
|
}
|
|
3436
3481
|
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
|
};
|
|
@@ -336,6 +337,18 @@ function Ad({
|
|
|
336
337
|
}
|
|
337
338
|
);
|
|
338
339
|
}
|
|
340
|
+
var SPACE = { sm: 8, md: 12, lg: 16, xl: 24 };
|
|
341
|
+
function shellColors(isDark, primaryColor) {
|
|
342
|
+
return {
|
|
343
|
+
text: isDark ? "#f4f4f5" : "#1a1a1a",
|
|
344
|
+
textSecondary: isDark ? "#a1a1aa" : "#52525b",
|
|
345
|
+
textMuted: isDark ? "#71717a" : "#a1a1aa",
|
|
346
|
+
border: isDark ? "#27272a" : "#e4e4e7",
|
|
347
|
+
surface: isDark ? "#18181b" : "#fafafa",
|
|
348
|
+
error: "#dc2626",
|
|
349
|
+
primary: primaryColor
|
|
350
|
+
};
|
|
351
|
+
}
|
|
339
352
|
function labelForOrderType(orderType) {
|
|
340
353
|
if (orderType === "dine_in") {
|
|
341
354
|
return "Dine In";
|
|
@@ -628,11 +641,12 @@ function CimplifyCheckout({
|
|
|
628
641
|
onError,
|
|
629
642
|
orderType
|
|
630
643
|
]);
|
|
644
|
+
const colors = shellColors(isDark ?? false, primaryColor);
|
|
631
645
|
if (isInitializing) {
|
|
632
|
-
return /* @__PURE__ */ jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsx("p", { "data-cimplify-status": "", style: { fontSize:
|
|
646
|
+
return /* @__PURE__ */ jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsx("p", { "data-cimplify-status": "", style: { fontSize: 13, color: colors.textSecondary }, children: "Preparing checkout..." }) });
|
|
633
647
|
}
|
|
634
648
|
if (!isDemoCheckout && (!resolvedBusinessId || !resolvedCartId)) {
|
|
635
|
-
return /* @__PURE__ */ jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsx("p", { "data-cimplify-error": "", style: { fontSize:
|
|
649
|
+
return /* @__PURE__ */ jsx("div", { className, "data-cimplify-checkout": "", children: /* @__PURE__ */ jsx("p", { "data-cimplify-error": "", style: { fontSize: 13, color: colors.error }, children: errorMessage || "Unable to initialize checkout. Please refresh and try again." }) });
|
|
636
650
|
}
|
|
637
651
|
return /* @__PURE__ */ jsxs("div", { className, "data-cimplify-checkout": "", children: [
|
|
638
652
|
isTestMode && !isDemoCheckout && /* @__PURE__ */ jsx(
|
|
@@ -649,38 +663,47 @@ function CimplifyCheckout({
|
|
|
649
663
|
}
|
|
650
664
|
),
|
|
651
665
|
/* @__PURE__ */ jsx("div", { "data-cimplify-section": "payment", children: /* @__PURE__ */ jsx("div", { ref: isDemoCheckout ? void 0 : paymentMountRef }) }),
|
|
652
|
-
/* @__PURE__ */ jsxs("div", { "data-cimplify-section": "order-type", style: { marginTop:
|
|
653
|
-
/* @__PURE__ */ jsx("p", { style: { fontSize:
|
|
666
|
+
/* @__PURE__ */ jsxs("div", { "data-cimplify-section": "order-type", style: { marginTop: SPACE.xl }, children: [
|
|
667
|
+
/* @__PURE__ */ jsx("p", { style: { fontSize: 13, fontWeight: 500, color: colors.textMuted, marginBottom: SPACE.sm }, children: "Order type" }),
|
|
654
668
|
/* @__PURE__ */ jsx(
|
|
655
669
|
"div",
|
|
656
670
|
{
|
|
657
671
|
role: "group",
|
|
658
672
|
"aria-label": "Order type",
|
|
659
|
-
style: {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
673
|
+
style: {
|
|
674
|
+
display: "inline-flex",
|
|
675
|
+
border: `1px solid ${colors.border}`,
|
|
676
|
+
borderRadius: 8,
|
|
677
|
+
padding: 3,
|
|
678
|
+
background: colors.surface
|
|
679
|
+
},
|
|
680
|
+
children: resolvedOrderTypes.map((type) => {
|
|
681
|
+
const active = orderType === type;
|
|
682
|
+
return /* @__PURE__ */ jsx(
|
|
683
|
+
"button",
|
|
684
|
+
{
|
|
685
|
+
type: "button",
|
|
686
|
+
onClick: () => setOrderType(type),
|
|
687
|
+
disabled: isSubmitting,
|
|
688
|
+
"data-selected": active ? "true" : "false",
|
|
689
|
+
style: {
|
|
690
|
+
padding: `${SPACE.sm}px ${SPACE.lg}px`,
|
|
691
|
+
borderRadius: 6,
|
|
692
|
+
border: "none",
|
|
693
|
+
background: active ? primaryColor : "transparent",
|
|
694
|
+
color: active ? "#ffffff" : colors.textSecondary,
|
|
695
|
+
cursor: isSubmitting ? "not-allowed" : "pointer",
|
|
696
|
+
opacity: isSubmitting ? 0.6 : 1,
|
|
697
|
+
fontSize: 14,
|
|
698
|
+
fontWeight: 500,
|
|
699
|
+
transition: "all 150ms ease",
|
|
700
|
+
WebkitTapHighlightColor: "transparent"
|
|
701
|
+
},
|
|
702
|
+
children: labelForOrderType(type)
|
|
679
703
|
},
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
))
|
|
704
|
+
type
|
|
705
|
+
);
|
|
706
|
+
})
|
|
684
707
|
}
|
|
685
708
|
)
|
|
686
709
|
] }),
|
|
@@ -688,11 +711,11 @@ function CimplifyCheckout({
|
|
|
688
711
|
"div",
|
|
689
712
|
{
|
|
690
713
|
"data-cimplify-section": "address",
|
|
691
|
-
style: { marginTop:
|
|
714
|
+
style: { marginTop: SPACE.lg, display: orderType === "delivery" ? "block" : "none" },
|
|
692
715
|
children: /* @__PURE__ */ jsx("div", { ref: isDemoCheckout ? void 0 : addressMountRef })
|
|
693
716
|
}
|
|
694
717
|
),
|
|
695
|
-
/* @__PURE__ */ jsx("div", { style: { marginTop:
|
|
718
|
+
/* @__PURE__ */ jsx("div", { style: { marginTop: SPACE.xl }, children: /* @__PURE__ */ jsx(
|
|
696
719
|
"button",
|
|
697
720
|
{
|
|
698
721
|
type: "button",
|
|
@@ -700,23 +723,22 @@ function CimplifyCheckout({
|
|
|
700
723
|
disabled: isSubmitting,
|
|
701
724
|
style: {
|
|
702
725
|
width: "100%",
|
|
703
|
-
padding:
|
|
704
|
-
borderRadius:
|
|
726
|
+
padding: `${SPACE.md}px ${SPACE.lg}px`,
|
|
727
|
+
borderRadius: 8,
|
|
705
728
|
border: "none",
|
|
706
|
-
background: isSubmitting ?
|
|
729
|
+
background: isSubmitting ? colors.textMuted : primaryColor,
|
|
707
730
|
color: "#ffffff",
|
|
708
731
|
cursor: isSubmitting ? "not-allowed" : "pointer",
|
|
709
732
|
fontWeight: 600,
|
|
710
|
-
fontSize:
|
|
711
|
-
boxShadow: isSubmitting ? "none" : "0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",
|
|
733
|
+
fontSize: 16,
|
|
712
734
|
transition: "all 150ms ease",
|
|
713
735
|
WebkitTapHighlightColor: "transparent"
|
|
714
736
|
},
|
|
715
737
|
children: isSubmitting ? "Processing..." : "Complete Order"
|
|
716
738
|
}
|
|
717
739
|
) }),
|
|
718
|
-
status && /* @__PURE__ */ jsx("p", { "data-cimplify-status": "", style: { marginTop:
|
|
719
|
-
errorMessage && /* @__PURE__ */ jsx("p", { "data-cimplify-error": "", style: { marginTop:
|
|
740
|
+
status && /* @__PURE__ */ jsx("p", { "data-cimplify-status": "", style: { marginTop: SPACE.sm, fontSize: 13, color: colors.textSecondary }, children: statusText || statusToLabel(status) }),
|
|
741
|
+
errorMessage && /* @__PURE__ */ jsx("p", { "data-cimplify-error": "", style: { marginTop: SPACE.sm, fontSize: 13, color: colors.error }, children: errorMessage })
|
|
720
742
|
] });
|
|
721
743
|
}
|
|
722
744
|
|
|
@@ -3223,6 +3245,16 @@ var CimplifyElements = class {
|
|
|
3223
3245
|
case MESSAGE_TYPES.PAYMENT_METHOD_SELECTED:
|
|
3224
3246
|
this.paymentData = message.method;
|
|
3225
3247
|
break;
|
|
3248
|
+
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
3249
|
+
if (!this.customerData) {
|
|
3250
|
+
this.customerData = { name: "", email: null, phone: null };
|
|
3251
|
+
}
|
|
3252
|
+
if (message.contactType === "email") {
|
|
3253
|
+
this.customerData.email = message.contact;
|
|
3254
|
+
} else {
|
|
3255
|
+
this.customerData.phone = message.contact;
|
|
3256
|
+
}
|
|
3257
|
+
break;
|
|
3226
3258
|
case MESSAGE_TYPES.LOGOUT_COMPLETE:
|
|
3227
3259
|
if (this.checkoutInProgress && this.activeCheckoutAbort) {
|
|
3228
3260
|
this.activeCheckoutAbort();
|
|
@@ -3243,6 +3275,16 @@ var CimplifyElements = class {
|
|
|
3243
3275
|
_setPaymentData(data) {
|
|
3244
3276
|
this.paymentData = data;
|
|
3245
3277
|
}
|
|
3278
|
+
_setGuestContact(contact, contactType) {
|
|
3279
|
+
if (!this.customerData) {
|
|
3280
|
+
this.customerData = { name: "", email: null, phone: null };
|
|
3281
|
+
}
|
|
3282
|
+
if (contactType === "email") {
|
|
3283
|
+
this.customerData.email = contact;
|
|
3284
|
+
} else {
|
|
3285
|
+
this.customerData.phone = contact;
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3246
3288
|
};
|
|
3247
3289
|
var CimplifyElement = class {
|
|
3248
3290
|
constructor(type, businessId, linkUrl, options, parent) {
|
|
@@ -3429,6 +3471,9 @@ var CimplifyElement = class {
|
|
|
3429
3471
|
this.emit(EVENT_TYPES.CHANGE, { paymentMethod: message.method });
|
|
3430
3472
|
this.resolveData(message.method);
|
|
3431
3473
|
break;
|
|
3474
|
+
case MESSAGE_TYPES.CONTACT_PROVIDED:
|
|
3475
|
+
this.parent._setGuestContact(message.contact, message.contactType);
|
|
3476
|
+
break;
|
|
3432
3477
|
}
|
|
3433
3478
|
}
|
|
3434
3479
|
emit(event, data) {
|