@dropins/storefront-checkout 0.1.0-alpha49 → 0.1.0-alpha50
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/api/errors/errors.d.ts +3 -0
- package/api/estimateShippingMethods/estimateShippingMethods.d.ts +1 -1
- package/api/estimateShippingMethods/graphql/estimateShippingMethods.graphql.d.ts +16 -16
- package/api/getCart/graphql/getCart.graphql.d.ts +16 -16
- package/api/getStoreConfig/graphql/getStoreConfig.graphql.d.ts +16 -16
- package/api/index.d.ts +0 -3
- package/api/initialize/initialize.d.ts +6 -1
- package/api/initializeCheckout/initializeCheckout.d.ts +3 -17
- package/api/setBillingAddress/graphql/setBillingAddress.graphql.d.ts +15 -15
- package/api/setBillingAddress/setBillingAddress.d.ts +2 -11
- package/api/setShippingAddress/graphql/setShippingAddress.graphql.d.ts +15 -15
- package/api/setShippingAddress/setShippingAddress.d.ts +3 -45
- package/api/utils/dispatchApiCall.d.ts +0 -16
- package/api.js +37 -1
- package/chunks/Heading.js +1 -0
- package/chunks/classes.js +1 -0
- package/chunks/fetch-graphql.js +10 -0
- package/chunks/getCart.graphql.js +7 -4
- package/chunks/getCustomer.js +2 -2
- package/chunks/placeOrder2.js +131 -0
- package/chunks/resetCustomer.js +1 -36
- package/chunks/setBillingAddress.js +5 -7
- package/chunks/setGuestEmailOnCart.js +3 -3
- package/chunks/setPaymentMethod.js +2 -2
- package/chunks/setShippingMethods.js +2 -2
- package/chunks/store-config.js +1 -0
- package/chunks/withConditionalRendering.js +1 -1
- package/components/BillToShippingAddress/BillToShippingAddress.d.ts +3 -3
- package/components/LoginForm/Email.d.ts +8 -8
- package/components/LoginForm/LoginForm.d.ts +14 -10
- package/components/LoginForm/SignIn.d.ts +3 -4
- package/components/LoginForm/SignOut.d.ts +3 -3
- package/components/PaymentMethods/PaymentMethods.d.ts +4 -3
- package/components/index.d.ts +0 -2
- package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +18 -6
- package/containers/BillToShippingAddress/index.d.ts +15 -16
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/ErrorBanner/ErrorBanner.d.ts +2 -2
- package/containers/ErrorBanner.js +1 -1
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm/LoginForm.d.ts +2 -3
- package/containers/LoginForm/index.d.ts +15 -16
- package/containers/LoginForm.js +1 -1
- package/containers/MergedCartBanner/MergedCartBanner.d.ts +2 -2
- package/containers/MergedCartBanner.js +1 -1
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods.js +1 -1
- package/containers/PlaceOrder/PlaceOrder.d.ts +1 -5
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods/hooks/useShippingEstimateEventEmitter.d.ts +15 -15
- package/containers/ShippingMethods.js +1 -1
- package/containers/index.d.ts +0 -2
- package/data/models/address.d.ts +11 -15
- package/data/models/api.d.ts +29 -0
- package/data/models/cart.d.ts +9 -5
- package/data/models/customer.d.ts +3 -14
- package/data/models/index.d.ts +19 -17
- package/data/models/region.d.ts +15 -15
- package/data/models/store-config.d.ts +0 -3
- package/data/transforms/index.d.ts +16 -18
- package/data/transforms/transform-address.d.ts +7 -5
- package/hocs/index.d.ts +16 -15
- package/hooks/index.d.ts +16 -16
- package/hooks/useStableList/index.d.ts +2 -0
- package/hooks/useStableList/useStableList.d.ts +2 -0
- package/i18n/en_US.json.d.ts +0 -18
- package/lib/index.d.ts +16 -15
- package/lib/validation.d.ts +5 -0
- package/msw/fixtures/fragments/cart.d.ts +3 -0
- package/msw/fixtures/fragments/index.d.ts +15 -18
- package/msw/fixtures/queries/index.d.ts +0 -3
- package/package.json +1 -1
- package/render.js +4 -4
- package/signals/IsBillToShippingSignal.d.ts +16 -20
- package/signals/index.d.ts +0 -3
- package/utils/index.d.ts +0 -6
- package/utils/refetchEstimatedShippingMethods/refetchEstimatedShippingMethods.d.ts +1 -0
- package/__generated__/types.d.ts +0 -15365
- package/api/fetchAddressFormFields/fetchAddressFormFields.d.ts +0 -18
- package/api/fetchAddressFormFields/fixtures.d.ts +0 -5
- package/api/fetchAddressFormFields/graphql/fetchAddressFormFields.graphql.d.ts +0 -18
- package/api/fetchAddressFormFields/index.d.ts +0 -19
- package/api/getCountries/fixtures.d.ts +0 -6
- package/api/getCountries/getCountries.d.ts +0 -18
- package/api/getCountries/graphql/getCountries.graphql.d.ts +0 -18
- package/api/getCountries/index.d.ts +0 -18
- package/api/getRegions/fixtures.d.ts +0 -5
- package/api/getRegions/getRegions.d.ts +0 -5
- package/api/getRegions/graphql/getRegions.graphql.d.ts +0 -18
- package/api/getRegions/index.d.ts +0 -18
- package/chunks/BillToShippingAddress.js +0 -1
- package/chunks/ShippingMethods.js +0 -1
- package/chunks/fixtures.js +0 -15
- package/chunks/getMultilineValues.js +0 -43
- package/chunks/placeOrder.js +0 -131
- package/chunks/setShippingAddress.js +0 -16
- package/chunks/transform-shipping-methods.js +0 -1
- package/components/AddressForm/AddressForm.d.ts +0 -22
- package/components/AddressForm/constants.d.ts +0 -20
- package/components/AddressForm/index.d.ts +0 -23
- package/components/AddressForm/useAddressBackup.d.ts +0 -8
- package/components/AddressForm/useAddressForm.d.ts +0 -39
- package/components/AddressForm/useCheckoutAddressEventEmitter.d.ts +0 -10
- package/components/AddressForm/usePreselectedFields.d.ts +0 -9
- package/components/AddressForm/utils.d.ts +0 -13
- package/components/FieldsForm/FieldsForm.d.ts +0 -13
- package/components/FieldsForm/FieldsFormSkeleton.d.ts +0 -4
- package/components/FieldsForm/fieldFactory.d.ts +0 -9
- package/components/FieldsForm/fixtures.d.ts +0 -5
- package/components/FieldsForm/index.d.ts +0 -22
- package/components/FieldsForm/validation.d.ts +0 -18
- package/containers/BillToShippingAddress/constants.d.ts +0 -18
- package/containers/BillingForm/BillingForm.d.ts +0 -9
- package/containers/BillingForm/constants.d.ts +0 -18
- package/containers/BillingForm/index.d.ts +0 -20
- package/containers/BillingForm.d.ts +0 -3
- package/containers/BillingForm.js +0 -1
- package/containers/LoginForm/constants.d.ts +0 -18
- package/containers/ShippingForm/ShippingForm.d.ts +0 -12
- package/containers/ShippingForm/constants.d.ts +0 -18
- package/containers/ShippingForm/index.d.ts +0 -20
- package/containers/ShippingForm.d.ts +0 -3
- package/containers/ShippingForm.js +0 -1
- package/data/models/address-form-fields.d.ts +0 -52
- package/data/transforms/transform-address-form-fields.d.ts +0 -66
- package/data/transforms/transform-countries.d.ts +0 -5
- package/data/transforms/transform-regions.d.ts +0 -8
- package/hooks/useValidity/index.d.ts +0 -18
- package/hooks/useValidity/useValidity.d.ts +0 -35
- package/msw/fixtures/fragments/american-regions.d.ts +0 -4
- package/msw/fixtures/fragments/countries.d.ts +0 -4
- package/msw/fixtures/fragments/form-fields.d.ts +0 -4
- package/msw/fixtures/queries/fetch-address-form-fields.d.ts +0 -4
- package/msw/fixtures/queries/get-countries.d.ts +0 -4
- package/msw/fixtures/queries/get-regions.d.ts +0 -4
- package/signals/AddressFormFieldsSignal.d.ts +0 -7
- package/signals/CountryListSignal.d.ts +0 -7
- package/signals/RegionsSignal.d.ts +0 -12
- package/utils/autocompleteFieldCodes/autocompleteFieldCodes.d.ts +0 -34
- package/utils/autocompleteFieldCodes/index.d.ts +0 -18
- package/utils/getMultilineValues/getMultilineValues.d.ts +0 -19
- package/utils/getMultilineValues/index.d.ts +0 -18
- package/utils/parseRegionId/index.d.ts +0 -18
- package/utils/parseRegionId/parseRegionId.d.ts +0 -18
- package/utils/processFormFields/index.d.ts +0 -18
- package/utils/processFormFields/processFormFields.d.ts +0 -21
- package/utils/scrollToElement/index.d.ts +0 -18
- package/utils/scrollToElement/scrollToElement.d.ts +0 -18
- package/utils/validateForms/index.d.ts +0 -18
- package/utils/validateForms/validateForms.d.ts +0 -18
package/api/errors/errors.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ export declare class MissingEmail extends InvalidArgument {
|
|
|
18
18
|
export declare class MissingPaymentMethod extends InvalidArgument {
|
|
19
19
|
constructor();
|
|
20
20
|
}
|
|
21
|
+
export declare class MissingShippinghAddress extends InvalidArgument {
|
|
22
|
+
constructor();
|
|
23
|
+
}
|
|
21
24
|
export declare class MissingBillingAddress extends InvalidArgument {
|
|
22
25
|
constructor();
|
|
23
26
|
}
|
|
@@ -9,5 +9,5 @@ export interface ShippingEstimationCriteria {
|
|
|
9
9
|
export type EstimateShippingInput = {
|
|
10
10
|
criteria: ShippingEstimationCriteria;
|
|
11
11
|
};
|
|
12
|
-
export declare const estimateShippingMethods: (input
|
|
12
|
+
export declare const estimateShippingMethods: (input?: EstimateShippingInput) => Promise<ShippingMethod[] | undefined>;
|
|
13
13
|
//# sourceMappingURL=estimateShippingMethods.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare const estimateShippingMethodsMutation = "\
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export declare const estimateShippingMethodsMutation = "\n mutation estimateShippingMethods(\n $cartId: String!\n $address: EstimateAddressInput!\n ) {\n estimateShippingMethods(input: { cart_id: $cartId, address: $address }) {\n carrier_title\n carrier_code\n method_title\n method_code\n available\n amount {\n currency\n value\n }\n price_excl_tax {\n currency\n value\n }\n price_incl_tax {\n currency\n value\n }\n error_message\n }\n }\n";
|
|
18
18
|
//# sourceMappingURL=estimateShippingMethods.graphql.d.ts.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare const CHECKOUT_DATA_FRAGMENT = "\n fragment CheckoutData on Cart {\n is_virtual\n email\n total_quantity\n billing_address {\n city\n country {\n code\n label\n }\n firstname\n lastname\n company\n postcode\n vat_id\n region {\n region_id\n code\n label\n }\n street\n telephone\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n }\n shipping_addresses {\n firstname\n lastname\n company\n street\n city\n postcode\n vat_id\n region {\n region_id\n code\n label\n }\n country {\n code\n label\n }\n telephone\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n available_shipping_methods {\n amount {\n currency\n value\n }\n available\n carrier_code\n carrier_title\n error_message\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n selected_shipping_method {\n amount {\n value\n currency\n }\n carrier_code\n carrier_title\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n }\n available_payment_methods {\n code\n title\n }\n selected_payment_method {\n code\n title\n }\n }\n";
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export declare const CHECKOUT_DATA_FRAGMENT = "\n fragment CheckoutData on Cart {\n is_virtual\n email\n total_quantity\n billing_address {\n id\n city\n country {\n code\n label\n }\n firstname\n lastname\n company\n postcode\n vat_id\n region {\n region_id\n code\n label\n }\n street\n telephone\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n }\n shipping_addresses {\n id\n firstname\n lastname\n company\n street\n city\n postcode\n vat_id\n region {\n region_id\n code\n label\n }\n country {\n code\n label\n }\n telephone\n custom_attributes {\n ... on AttributeValue {\n code\n value\n }\n }\n available_shipping_methods {\n amount {\n currency\n value\n }\n available\n carrier_code\n carrier_title\n error_message\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n selected_shipping_method {\n amount {\n value\n currency\n }\n carrier_code\n carrier_title\n method_code\n method_title\n price_excl_tax {\n value\n currency\n }\n price_incl_tax {\n value\n currency\n }\n }\n same_as_billing\n }\n available_payment_methods {\n code\n title\n }\n selected_payment_method {\n code\n title\n }\n }\n";
|
|
18
18
|
export declare const getCartQuery: string;
|
|
19
19
|
export declare const getCustomerCartQuery: string;
|
|
20
20
|
//# sourceMappingURL=getCart.graphql.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare const getStoreConfigQuery = "\n query getStoreConfig {\n storeConfig {\n
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
|
+
export declare const getStoreConfigQuery = "\n query getStoreConfig {\n storeConfig {\n default_country\n is_guest_checkout_enabled\n is_one_page_checkout_enabled\n shopping_cart_display_shipping\n }\n }\n";
|
|
18
18
|
//# sourceMappingURL=getStoreConfig.graphql.d.ts.map
|
package/api/index.d.ts
CHANGED
|
@@ -17,12 +17,9 @@
|
|
|
17
17
|
export * from './errors';
|
|
18
18
|
export * from './estimateShippingMethods';
|
|
19
19
|
export * from './fetch-graphql';
|
|
20
|
-
export * from './fetchAddressFormFields';
|
|
21
20
|
export * from './getCart';
|
|
22
21
|
export * from './getCheckoutData';
|
|
23
|
-
export * from './getCountries';
|
|
24
22
|
export * from './getCustomer';
|
|
25
|
-
export * from './getRegions';
|
|
26
23
|
export * from './getStoreConfig';
|
|
27
24
|
export * from './initialize';
|
|
28
25
|
export * from './initializeCheckout';
|
|
@@ -2,8 +2,13 @@ import { Lang } from '@dropins/tools/types/elsie/src/i18n';
|
|
|
2
2
|
import { Initializer } from '@dropins/tools/types/elsie/src/lib';
|
|
3
3
|
|
|
4
4
|
export type ConfigProps = {
|
|
5
|
-
guestViewCookieExpirationDays?: number;
|
|
6
5
|
langDefinitions?: Lang;
|
|
6
|
+
models?: {
|
|
7
|
+
[name: string]: {
|
|
8
|
+
initialData: any;
|
|
9
|
+
transform?: (data?: any) => any;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
7
12
|
};
|
|
8
13
|
export declare const initialize: Initializer<ConfigProps>;
|
|
9
14
|
export declare const config: import('@dropins/tools/types/elsie/src/lib').Config<ConfigProps>;
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare const initializeCheckout: () => Promise<[import('../../data/models/store-config').StoreConfig | undefined, import('../../data/models/country').Country[] | undefined, import('../../data/models/address-form-fields').AddressFormField[] | undefined]>;
|
|
1
|
+
import { ConfigProps } from '..';
|
|
2
|
+
|
|
3
|
+
export declare const initializeCheckout: (config?: ConfigProps) => Promise<import('../../data/models/store-config').StoreConfig | undefined>;
|
|
18
4
|
//# sourceMappingURL=initializeCheckout.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export declare const setBillingAddressMutation: string;
|
|
18
18
|
//# sourceMappingURL=setBillingAddress.graphql.d.ts.map
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BillingAddressInput } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
address?: AddressInput;
|
|
5
|
-
customer_address_id?: number;
|
|
6
|
-
same_as_shipping?: boolean;
|
|
7
|
-
use_for_shipping?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const setBillingAddress: ({ signal, input, }: {
|
|
10
|
-
signal?: AbortSignal | undefined;
|
|
11
|
-
input: BillingAddressInput;
|
|
12
|
-
}) => Promise<import('../../data/models/cart').Cart | null | undefined>;
|
|
3
|
+
export declare const setBillingAddress: ({ address, customerAddressId, sameAsShipping, useForShipping, }: BillingAddressInput) => Promise<import('../../data/models').Cart | null | undefined>;
|
|
13
4
|
//# sourceMappingURL=setBillingAddress.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export declare const setShippingAddressMutation: string;
|
|
18
18
|
//# sourceMappingURL=setShippingAddress.graphql.d.ts.map
|
|
@@ -1,46 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
17
|
-
export declare const STANDARD_ATTRIBUTES: string[];
|
|
18
|
-
export interface AddressInput {
|
|
19
|
-
city: string;
|
|
20
|
-
company?: string;
|
|
21
|
-
country_code: string;
|
|
22
|
-
custom_attributes?: {
|
|
23
|
-
attribute_code: string;
|
|
24
|
-
value?: string;
|
|
25
|
-
selected_options?: {
|
|
26
|
-
uid: string;
|
|
27
|
-
value: string;
|
|
28
|
-
}[];
|
|
29
|
-
}[];
|
|
30
|
-
firstname: string;
|
|
31
|
-
lastname: string;
|
|
32
|
-
postcode?: string;
|
|
33
|
-
region?: string;
|
|
34
|
-
region_id?: number;
|
|
35
|
-
save_in_address_book?: boolean;
|
|
36
|
-
street: string[];
|
|
37
|
-
telephone?: string;
|
|
38
|
-
vat_id?: string;
|
|
39
|
-
}
|
|
40
|
-
export interface setShippingAddressParams {
|
|
41
|
-
address: AddressInput;
|
|
42
|
-
signal?: AbortSignal;
|
|
43
|
-
}
|
|
44
|
-
export declare const prepareAddress: (formFields: Record<string, any>) => AddressInput;
|
|
45
|
-
export declare const setShippingAddress: ({ signal, ...variables }: setShippingAddressParams) => Promise<import('../../data/models').Cart | null | undefined>;
|
|
1
|
+
import { ShippingAddressInput } from '../../data/models';
|
|
2
|
+
|
|
3
|
+
export declare const setShippingAddress: ({ address, customerAddressId, pickupLocationCode, }: ShippingAddressInput) => Promise<import('../../data/models').Cart | null | undefined>;
|
|
46
4
|
//# sourceMappingURL=setShippingAddress.d.ts.map
|
|
@@ -13,26 +13,10 @@ declare const signalTypes: {
|
|
|
13
13
|
pending: boolean;
|
|
14
14
|
data?: import('../../data/models/shipping-method').ShippingMethod[] | undefined;
|
|
15
15
|
}>;
|
|
16
|
-
regions: import('@preact/signals-core').Signal<{
|
|
17
|
-
addressType?: import('../../data/models/address-form-fields').AddressFormType | undefined;
|
|
18
|
-
country?: string | undefined;
|
|
19
|
-
selectedRegion?: string | undefined;
|
|
20
|
-
selectedRegionId?: string | undefined;
|
|
21
|
-
pending: boolean;
|
|
22
|
-
data?: import('../../data/models/region').Region[] | undefined;
|
|
23
|
-
}>;
|
|
24
16
|
storeConfig: import('@preact/signals-core').Signal<{
|
|
25
17
|
data?: import('../../data/models/store-config').StoreConfig | undefined;
|
|
26
18
|
pending: boolean;
|
|
27
19
|
}>;
|
|
28
|
-
countryList: import('@preact/signals-core').Signal<{
|
|
29
|
-
data?: import('../../data/models/country').Country[] | undefined;
|
|
30
|
-
pending: boolean;
|
|
31
|
-
}>;
|
|
32
|
-
addressFormFields: import('@preact/signals-core').Signal<{
|
|
33
|
-
data?: import('../../data/models/address-form-fields').AddressFormField[] | undefined;
|
|
34
|
-
pending: boolean;
|
|
35
|
-
}>;
|
|
36
20
|
};
|
|
37
21
|
type SignalTypesType = typeof signalTypes;
|
|
38
22
|
type SignalTypesKeys = keyof SignalTypesType;
|
package/api.js
CHANGED
|
@@ -1 +1,37 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{s as l,M as m,a as _,d as o,b as f}from"./chunks/fetch-graphql.js";import{D as Q,F as q,I as z,f as N,c as R,e as P,S as j,U as K,j as L,k as Y,l as J,r as V,g as W,h as X,i as Z}from"./chunks/fetch-graphql.js";import{t as C,C as S,a as y,b as h}from"./chunks/getCart.graphql.js";import{a as A,i as M}from"./chunks/store-config.js";import"@dropins/tools/event-bus.js";import{a as st,g as et,b as it}from"./chunks/getCustomer.js";import{c as rt,i as nt,a as ot,r as pt,b as dt}from"./chunks/resetCustomer.js";import{i as gt,s as ht}from"./chunks/setGuestEmailOnCart.js";import{p as mt}from"./chunks/placeOrder2.js";import{a as I}from"./chunks/setBillingAddress.js";import{s as _t}from"./chunks/setBillingAddress.js";import{s as Ct}from"./chunks/setPaymentMethod.js";import{s as yt}from"./chunks/setShippingMethods.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/signals.js";import"@dropins/tools/lib.js";const v=`
|
|
2
|
+
mutation estimateShippingMethods(
|
|
3
|
+
$cartId: String!
|
|
4
|
+
$address: EstimateAddressInput!
|
|
5
|
+
) {
|
|
6
|
+
estimateShippingMethods(input: { cart_id: $cartId, address: $address }) {
|
|
7
|
+
carrier_title
|
|
8
|
+
carrier_code
|
|
9
|
+
method_title
|
|
10
|
+
method_code
|
|
11
|
+
available
|
|
12
|
+
amount {
|
|
13
|
+
currency
|
|
14
|
+
value
|
|
15
|
+
}
|
|
16
|
+
price_excl_tax {
|
|
17
|
+
currency
|
|
18
|
+
value
|
|
19
|
+
}
|
|
20
|
+
price_incl_tax {
|
|
21
|
+
currency
|
|
22
|
+
value
|
|
23
|
+
}
|
|
24
|
+
error_message
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`,$=async e=>{var g;const s=l.cartId,{criteria:r}=e||{},{country_code:i,region_id:t,region_name:a,zip:n}=r||{},p=i||((g=A.value.data)==null?void 0:g.defaultCountry);if(!s)throw new m;if(!p)throw new _;const d=typeof t=="string"?parseInt(t,10):t,c=t||a?{...d&&{region_id:d},...a&&{region_code:a}}:void 0,u={country_code:p,...n&&{postcode:n},...c&&{region:c}};return await o({type:"mutation",query:v,options:{variables:{cartId:s,address:u}},path:"estimateShippingMethods",signalType:"estimateShippingMethods",transformer:C})},D=e=>{var s;(s=window==null?void 0:window.location)==null||s.assign(e)},w=`
|
|
28
|
+
mutation setShippingAddress($input: SetShippingAddressesOnCartInput!) {
|
|
29
|
+
setShippingAddressesOnCart(input: $input) {
|
|
30
|
+
cart {
|
|
31
|
+
id
|
|
32
|
+
...CheckoutData
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
${S}
|
|
37
|
+
`,U=async({address:e,customerAddressId:s,pickupLocationCode:r})=>{const i=l.cartId;if(!i)throw new m;const t={cart_id:i,shipping_addresses:[]};if(s)t.shipping_addresses.push({customer_address_id:s});else if(r)t.shipping_addresses.push({pickup_location_code:r});else{if(!e)throw new f;t.shipping_addresses.push({address:y(e)})}const a=await o({type:"mutation",query:w,options:{variables:{input:t}},path:"setShippingAddressesOnCart.cart",signalType:"cart",transformer:h});return M.value?await o({type:"mutation",query:I,options:{variables:{input:{cart_id:i,billing_address:{same_as_shipping:!0}}}},path:"setBillingAddressOnCart.cart",signalType:"cart",transformer:h}):a};export{Q as DEFAULT_COUNTRY,q as FetchError,z as InvalidArgument,N as MissingBillingAddress,m as MissingCart,_ as MissingCountry,R as MissingEmail,P as MissingPaymentMethod,f as MissingShippinghAddress,j as STORE_CONFIG_DEFAULTS,K as UnexpectedError,rt as config,$ as estimateShippingMethods,L as fetchGraphQl,st as getCart,et as getCheckoutData,Y as getConfig,it as getCustomer,J as getStoreConfig,nt as initialize,ot as initializeCheckout,gt as isEmailAvailable,mt as placeOrder,D as redirect,V as removeFetchGraphQlHeader,pt as resetCheckout,dt as resetCustomer,_t as setBillingAddress,W as setEndpoint,X as setFetchGraphQlHeader,Z as setFetchGraphQlHeaders,ht as setGuestEmailOnCart,Ct as setPaymentMethod,U as setShippingAddress,yt as setShippingMethodsOnCart};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"@dropins/tools/preact-jsx-runtime.js";/* empty css */const m=({className:r,children:t,level:o=2})=>{const n=o>=1&&o<=6?`h${o}`:"h2";return i(n,{className:r,children:t})};export{m as H};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=n=>n.reduce((s,r)=>{if(!r)return s;if(typeof r=="string"&&(s+=` ${r}`),Array.isArray(r)){const[c,a]=r;c&&a&&(s+=` ${c}`)}return s},"").trim();export{e as c};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{c as S,d as T,e as A,a as v,T as i}from"./store-config.js";import{events as G}from"@dropins/tools/event-bus.js";import{FetchGraphQL as b}from"@dropins/tools/fetch-graphql.js";class x extends Error{constructor(t){super(t.map(s=>s.message).join(" ")),this.name="FetchError"}}class a extends Error{constructor(t){super(t),this.name="InvalidArgument"}}class R extends Error{constructor(t){super(t),this.name="UnexpectedError"}}class H extends a{constructor(){super("Cart ID is required")}}class V extends a{constructor(){super("Email is required")}}class j extends a{constructor(){super("Payment method code is required")}}class B extends a{constructor(){super("Shipping address is required")}}class Y extends a{constructor(){super("Billing address is required")}}class $ extends a{constructor(){super("Country Code is required")}}const p=[];function w(e){return new Promise((t,s)=>{p.push(e);const r=()=>{p[0]===e?e().then(t).catch(s).finally(()=>p.shift()):setTimeout(r,100)};r()})}const D=["sender_email","recipient_email"];function k(e){return e.filter(t=>!t.path||!D.some(s=>{var r;return((r=t.path)==null?void 0:r.at(-1))===s}))}const C=e=>{throw e instanceof DOMException&&e.name==="AbortError"||G.emit("error",{source:"checkout",type:"network",error:e}),e},I={cart:S,customer:T,estimateShippingMethods:A,storeConfig:v};function M(e,t){return t.split(".").reduce((s,r)=>s&&s[r]!==void 0?s[r]:void 0,e)}const E={cart:null,customer:null,estimateShippingMethods:null,storeConfig:null};async function U(e){const{defaultValueOnFail:t,query:s,options:r,path:c,signalType:d,type:y,transformer:h}=e,n=I[d],g=Symbol();E[d]=g,n.value={...n.value,pending:!0};try{const{data:l,errors:f}=await(y==="mutation"?w(()=>_(s,r).catch(C)):_(s,{method:"GET",cache:"no-cache",...r}).catch(C));if(f){const m=k(f);if(m.length>0)throw new x(m)}let o=M(l,c);if(o===void 0)throw new Error(`No data found at path: ${c}`);return h&&(o=h(o)),n.value={...n.value,data:o},setTimeout(()=>{n.value={...n.value,pending:E[d]===g?!1:n.value.pending}},0),o}catch(l){if(t)return n.value={pending:!1,data:t},t;if(l.name==="AbortError")return;throw n.value={...n.value,pending:!1},l}}const q={cartId:null,authenticated:!1},z=new Proxy(q,{set(e,t,s){return e[t]=s,!0},get(e,t){return e[t]}}),N=`
|
|
2
|
+
query getStoreConfig {
|
|
3
|
+
storeConfig {
|
|
4
|
+
default_country
|
|
5
|
+
is_guest_checkout_enabled
|
|
6
|
+
is_one_page_checkout_enabled
|
|
7
|
+
shopping_cart_display_shipping
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
`,F="US",u={defaultCountry:F,isGuestCheckoutEnabled:!1,isOnePageCheckoutEnabled:!1,shoppingCartDisplaySetting:{shipping:i.EXCLUDING_TAX}},J=async()=>await U({type:"query",query:N,options:{method:"GET",cache:"no-cache"},path:"storeConfig",signalType:"storeConfig",transformer:O,defaultValueOnFail:u});function L(e){switch(e){case 1:return i.EXCLUDING_TAX;case 2:return i.INCLUDING_TAX;case 3:return i.INCLUDING_EXCLUDING_TAX;default:return i.EXCLUDING_TAX}}function O(e){if(!e)return u;const{default_country:t,is_guest_checkout_enabled:s,is_one_page_checkout_enabled:r,shopping_cart_display_shipping:c}=e;return{defaultCountry:t||u.defaultCountry,isGuestCheckoutEnabled:s||u.isGuestCheckoutEnabled,isOnePageCheckoutEnabled:r||u.isOnePageCheckoutEnabled,shoppingCartDisplaySetting:{shipping:L(c)}}}const{setEndpoint:K,setFetchGraphQlHeader:W,removeFetchGraphQlHeader:Z,setFetchGraphQlHeaders:ee,fetchGraphQl:_,getConfig:te}=new b().getMethods();export{F as D,x as F,a as I,H as M,u as S,R as U,$ as a,B as b,V as c,U as d,j as e,Y as f,K as g,W as h,ee as i,_ as j,te as k,J as l,C as m,Z as r,z as s};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
const a=e=>e==null,m=(e,t)=>e.amount.value-t.amount.value,n=e=>!(!e||!e.method_code||!e.method_title||a(e.amount.value)||!e.amount.currency),o=e=>({amount:{value:e.amount.value,currency:e.amount.currency},title:e.method_title,code:e.method_code,carrier:{code:e.carrier_code,title:e.carrier_title},value:`${e.carrier_code} - ${e.method_code}`,...e.price_excl_tax&&{amountExclTax:{value:e.price_excl_tax.value,currency:e.price_excl_tax.currency}},...e.price_incl_tax&&{amountInclTax:{value:e.price_incl_tax.value,currency:e.price_incl_tax.currency}}}),_=e=>{if(n(e))return o(e)},d=e=>{if(e)return e.filter(n).map(t=>o(t)).sort(m)},p=e=>e?!!e.code&&!!e.label:!1,y=e=>{if(!p(e))return;const{code:t,label:r,region_id:i}=e;return i?{code:t,name:r,id:i}:{code:t,name:r}},v=e=>{const{code:t,label:r}=e;return{value:t,label:r}},h=e=>e?"code"in e&&"value"in e:!1,f=e=>e.filter(h).map(t=>{const{code:r,value:i}=t;return{code:r,value:i}}),c=e=>{const t=e.street.filter(Boolean);return{id:(e==null?void 0:e.id)||void 0,city:e.city,company:e.company||void 0,country:v(e.country),customAttributes:f(e.custom_attributes),firstName:e.firstname,lastName:e.lastname,postCode:e.postcode||void 0,region:y(e.region),street:t,telephone:e.telephone||void 0,vatId:e.vat_id||void 0}},g=e=>{if(e)return c(e)},b=e=>e.filter(t=>!!t).map(t=>{const{available_shipping_methods:r,selected_shipping_method:i,same_as_billing:l,...u}=t;return{...c(u),availableShippingMethods:d(r),selectedShippingMethod:_(i),sameAsBilling:l}}),x=e=>({city:e.city,company:e.company,country_code:e.countryCode,custom_attributes:e.customAttributes.map(t=>({attribute_code:t.code,value:t.value})),firstname:e.firstName,lastname:e.lastName,postcode:e.postcode,region:e.region,region_id:e.regionId,save_in_address_book:e.saveInAddressBook??!0,street:e.street,telephone:e.telephone,vat_id:e.vatId}),A=e=>{if(e)return{code:e.code,title:e.title}},C=e=>{if(e)return e.filter(t=>!!t).map(t=>{const{code:r,title:i}=t;return{code:r,title:i}})},M=e=>({availablePaymentMethods:C(e.available_payment_methods),billingAddress:g(e.billing_address),email:e.email??void 0,id:e.id,isEmpty:e.total_quantity===0,isVirtual:e.is_virtual,selectedPaymentMethod:A(e.selected_payment_method),shippingAddresses:b(e.shipping_addresses)}),s=`
|
|
2
2
|
fragment CheckoutData on Cart {
|
|
3
3
|
is_virtual
|
|
4
4
|
email
|
|
5
5
|
total_quantity
|
|
6
6
|
billing_address {
|
|
7
|
+
id
|
|
7
8
|
city
|
|
8
9
|
country {
|
|
9
10
|
code
|
|
@@ -29,6 +30,7 @@ import{t as a,a as l}from"./transform-shipping-methods.js";const c=e=>{if(e)retu
|
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
shipping_addresses {
|
|
33
|
+
id
|
|
32
34
|
firstname
|
|
33
35
|
lastname
|
|
34
36
|
company
|
|
@@ -90,6 +92,7 @@ import{t as a,a as l}from"./transform-shipping-methods.js";const c=e=>{if(e)retu
|
|
|
90
92
|
currency
|
|
91
93
|
}
|
|
92
94
|
}
|
|
95
|
+
same_as_billing
|
|
93
96
|
}
|
|
94
97
|
available_payment_methods {
|
|
95
98
|
code
|
|
@@ -100,7 +103,7 @@ import{t as a,a as l}from"./transform-shipping-methods.js";const c=e=>{if(e)retu
|
|
|
100
103
|
title
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
|
-
`,
|
|
106
|
+
`,S=`
|
|
104
107
|
query getCart($cartId: String!) {
|
|
105
108
|
cart(cart_id: $cartId) {
|
|
106
109
|
id
|
|
@@ -108,7 +111,7 @@ import{t as a,a as l}from"./transform-shipping-methods.js";const c=e=>{if(e)retu
|
|
|
108
111
|
}
|
|
109
112
|
}
|
|
110
113
|
${s}
|
|
111
|
-
`,
|
|
114
|
+
`,I=`
|
|
112
115
|
query getCustomerCart {
|
|
113
116
|
cart: customerCart {
|
|
114
117
|
id
|
|
@@ -116,4 +119,4 @@ import{t as a,a as l}from"./transform-shipping-methods.js";const c=e=>{if(e)retu
|
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
${s}
|
|
119
|
-
`;export{s as C,
|
|
122
|
+
`;export{s as C,x as a,M as b,I as c,S as g,d as t};
|
package/chunks/getCustomer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"@dropins/tools/event-bus.js";import{
|
|
1
|
+
import"@dropins/tools/event-bus.js";import"./store-config.js";import{s as o,M as l,d as u}from"./fetch-graphql.js";import{b as d,g as f,c as g}from"./getCart.graphql.js";const p=e=>e?"code"in e&&"value"in e:!1,y=e=>e.filter(p).map(t=>{const{code:r,value:s}=t;return{code:r,value:s}}),m=e=>{var n,i,c;const t=e.street.filter(Boolean),r=(n=e.region)==null?void 0:n.region_id,s=r&&r>0;return{id:String(e.id),firstName:e.firstname,lastName:e.lastname,company:e.company||void 0,city:e.city,street:t,postCode:e.postcode||void 0,vatId:e.vat_id||void 0,telephone:e.telephone||void 0,region:{id:s?r:void 0,code:(i=e.region)==null?void 0:i.region_code,name:(c=e.region)==null?void 0:c.region},country:{value:e.country_code,label:e.country_code},customAttributes:y(e.custom_attributesV2)}},h=e=>e?e.filter(Boolean).map(m):[],a=(e,t)=>{if(!t)return;const r=t.find(s=>(s==null?void 0:s[e])===!0);if(r)return m(r)},C=e=>{if(!e)return;const t=e.addresses;return{firstName:e.firstname||"",lastName:e.lastname||"",email:e.email||"",addresses:h(t),defaultBillingAddress:a("default_billing",t),defaultShippingAddress:a("default_shipping",t)}},_=async()=>{const e=o.cartId,t=o.authenticated===!1,r=t?f:g,s=t?{cartId:e}:{};if(t&&!e)throw new l;return await u({type:"query",query:r,options:{method:"POST",cache:"no-cache",variables:s},path:"cart",signalType:"cart",transformer:d})},V=async()=>{const e=o.cartId,t=o.authenticated;if(e)try{await _(),t&&await A()}catch(r){console.error(r)}},v=`
|
|
2
2
|
query getCustomer {
|
|
3
3
|
customer {
|
|
4
4
|
firstname
|
|
@@ -31,4 +31,4 @@ import"@dropins/tools/event-bus.js";import{k as o,M as l,l as u}from"./fixtures.
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
`,A=async()=>{if(o.authenticated)return await u({type:"query",query:v,options:{method:"POST",cache:"no-cache"},path:"customer",signalType:"customer",transformer:C})};export{
|
|
34
|
+
`,A=async()=>{if(o.authenticated)return await u({type:"query",query:v,options:{method:"POST",cache:"no-cache"},path:"customer",signalType:"customer",transformer:C})};export{_ as a,A as b,V as g};
|