@anker-in/shopify-react 0.1.1-beta.1 → 0.1.1-beta.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/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +337 -113
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +332 -113
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/{index-CCMIeIUh.d.ts → index-BOsx-Rx3.d.ts} +196 -64
- package/dist/{index-RevQokdZ.d.mts → index-D5VVTzBT.d.mts} +196 -64
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +360 -123
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +355 -123
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +3 -1
- package/dist/provider/index.d.ts +3 -1
- package/dist/provider/index.js +159 -42
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +159 -42
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-CICUnw0v.d.mts → types-CUv-lzQk.d.mts} +5 -3
- package/dist/{types-CICUnw0v.d.ts → types-CUv-lzQk.d.ts} +5 -3
- package/package.json +3 -3
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, useMemo, useRef, useState, useEffect, useCallback, useContext } from 'react';
|
|
2
2
|
import useSWRMutation from 'swr/mutation';
|
|
3
|
-
import { getProductsByHandles, createCart, updateCartCodes, addCartLines, updateCartLines, removeCartLines, updateCartAttributes, getProduct, getAllProducts, getCollection, getAllCollections, getCollections, getBlog, getAllBlogs, getArticle, getArticles, getArticlesInBlog, getLocalStorage, setLocalStorage } from '@anker-in/shopify-sdk';
|
|
3
|
+
import { getProductsByHandles, createCart, updateCartCodes, addCartLines, updateCartLines, removeCartLines, updateCartAttributes, getProduct, getAllProducts, getCollection, getAllCollections, getCollections, getBlog, getAllBlogs, getArticle, getArticles, getArticlesInBlog, getLocalStorage, setLocalStorage, updateCartDeliveryOptions } from '@anker-in/shopify-sdk';
|
|
4
4
|
import Cookies5 from 'js-cookie';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import Decimal2 from 'decimal.js';
|
|
@@ -62,6 +62,81 @@ var CODE_AMOUNT_KEY = "_sku_code_money";
|
|
|
62
62
|
var SCRIPT_CODE_AMOUNT_KEY = "_code_money";
|
|
63
63
|
var MAIN_PRODUCT_CODE = ["WS24", "WSTD", "WS7D", "WSCP", "WSPE", "WSPD"];
|
|
64
64
|
|
|
65
|
+
// src/hooks/cart/utils/normalize-add-to-cart-lines.ts
|
|
66
|
+
function normalizeAddToCartLines(lines) {
|
|
67
|
+
return lines.filter((line) => line.variant?.id).map((line, index) => {
|
|
68
|
+
const variant = line.variant;
|
|
69
|
+
const product = variant.product;
|
|
70
|
+
const quantity = line.quantity || 1;
|
|
71
|
+
const price = variant.finalPrice?.amount ? Number(variant.finalPrice.amount) : variant.compareAtPrice?.amount ? Number(variant.compareAtPrice.amount) : variant.price?.amount ? Number(variant.price.amount) : 0;
|
|
72
|
+
const subtotalAmount = price * quantity;
|
|
73
|
+
const totalAmount = subtotalAmount;
|
|
74
|
+
return {
|
|
75
|
+
id: `temp-line-${index}-${variant.id}`,
|
|
76
|
+
// Temporary ID for pre-cart lines
|
|
77
|
+
name: product?.title || variant.title || "",
|
|
78
|
+
quantity,
|
|
79
|
+
variantId: variant.id,
|
|
80
|
+
productId: product?.id || variant.id.split("/").slice(0, -2).join("/"),
|
|
81
|
+
totalAmount,
|
|
82
|
+
subtotalAmount,
|
|
83
|
+
discountAllocations: [],
|
|
84
|
+
customAttributes: line.attributes || [],
|
|
85
|
+
variant: {
|
|
86
|
+
id: variant.id,
|
|
87
|
+
price,
|
|
88
|
+
listPrice: variant.compareAtPrice?.amount ? Number(variant.compareAtPrice.amount) : 0,
|
|
89
|
+
sku: variant.sku || "",
|
|
90
|
+
name: variant.title || "",
|
|
91
|
+
image: variant.image ? {
|
|
92
|
+
url: variant.image.url,
|
|
93
|
+
altText: variant.image.altText || void 0
|
|
94
|
+
} : void 0,
|
|
95
|
+
requiresShipping: false,
|
|
96
|
+
// Default value, not available in NormalizedProductVariant
|
|
97
|
+
availableForSale: variant.availableForSale ?? true,
|
|
98
|
+
quantityAvailable: variant.quantityAvailable ?? 0,
|
|
99
|
+
currentlyNotInStock: false,
|
|
100
|
+
// Default value, will be updated when added to cart
|
|
101
|
+
weight: variant.weight,
|
|
102
|
+
metafields: variant.metafields
|
|
103
|
+
},
|
|
104
|
+
product,
|
|
105
|
+
path: product?.handle ? `/products/${product.handle}` : "",
|
|
106
|
+
discounts: [],
|
|
107
|
+
options: variant.selectedOptions?.map((opt) => ({
|
|
108
|
+
name: opt.name,
|
|
109
|
+
value: opt.value
|
|
110
|
+
}))
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function createMockCartFromLines(lines, existingCart) {
|
|
115
|
+
const normalizedLines = normalizeAddToCartLines(lines);
|
|
116
|
+
const subtotalPrice = normalizedLines.reduce((sum, line) => sum + line.subtotalAmount, 0);
|
|
117
|
+
const totalPrice = normalizedLines.reduce((sum, line) => sum + line.totalAmount, 0);
|
|
118
|
+
return {
|
|
119
|
+
id: existingCart?.id || "temp-cart-id",
|
|
120
|
+
customerId: existingCart?.customerId,
|
|
121
|
+
email: existingCart?.email,
|
|
122
|
+
createdAt: existingCart?.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
123
|
+
currency: existingCart?.currency || { code: "USD" },
|
|
124
|
+
taxesIncluded: existingCart?.taxesIncluded,
|
|
125
|
+
lineItems: normalizedLines,
|
|
126
|
+
totalLineItemsDiscount: 0,
|
|
127
|
+
orderDiscounts: 0,
|
|
128
|
+
lineItemsSubtotalPrice: subtotalPrice,
|
|
129
|
+
subtotalPrice,
|
|
130
|
+
totalPrice,
|
|
131
|
+
totalTaxAmount: 0,
|
|
132
|
+
discountCodes: existingCart?.discountCodes || [],
|
|
133
|
+
discountAllocations: [],
|
|
134
|
+
url: existingCart?.url || "",
|
|
135
|
+
ready: true,
|
|
136
|
+
customAttributes: existingCart?.customAttributes
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
65
140
|
// src/hooks/cart/utils/index.ts
|
|
66
141
|
var getQuery = () => {
|
|
67
142
|
const url = typeof window !== "undefined" ? window.location.search : "";
|
|
@@ -101,25 +176,25 @@ var getMatchedMainProductSubTotal = (cartData, variant_list, main_product) => {
|
|
|
101
176
|
return acc + (main_product?.spend_money_type === 1 /* ORIGIN_PRICE */ ? Number(line.subtotalAmount) || 0 : Number(line.totalAmount) || 0);
|
|
102
177
|
}, 0) || 0;
|
|
103
178
|
};
|
|
104
|
-
var
|
|
105
|
-
const attr = attributes.find((attr2) => attr2.key === CUSTOMER_ATTRIBUTE_KEY);
|
|
106
|
-
return safeParseJson(attr?.value ?? "") ?? {};
|
|
107
|
-
};
|
|
108
|
-
var isAttributesEqual = (attrs1 = [], attrs2 = []) => {
|
|
109
|
-
if (attrs1.length !== attrs2.length) return false;
|
|
110
|
-
const sorted1 = [...attrs1].sort((a, b) => a.key.localeCompare(b.key));
|
|
111
|
-
const sorted2 = [...attrs2].sort((a, b) => a.key.localeCompare(b.key));
|
|
112
|
-
return sorted1.every(
|
|
113
|
-
(attr, i) => attr.key === sorted2[i]?.key && attr.value === sorted2[i]?.value
|
|
114
|
-
);
|
|
115
|
-
};
|
|
116
|
-
var safeParseJson = (str) => {
|
|
179
|
+
var safeParse = (str) => {
|
|
117
180
|
try {
|
|
118
181
|
return JSON.parse(str);
|
|
119
182
|
} catch (err) {
|
|
120
183
|
return {};
|
|
121
184
|
}
|
|
122
185
|
};
|
|
186
|
+
var getDiscountEnvAttributeValue = (attributes = []) => {
|
|
187
|
+
const attr = attributes.find((attr2) => attr2.key === CUSTOMER_ATTRIBUTE_KEY);
|
|
188
|
+
return safeParse(attr?.value ?? "") ?? {};
|
|
189
|
+
};
|
|
190
|
+
var checkAttributesUpdateNeeded = (oldAttributes, newAttributes, customAttributesNeedRemove) => {
|
|
191
|
+
return oldAttributes.some((attr) => {
|
|
192
|
+
const newAttr = newAttributes.find((newAttr2) => newAttr2.key === attr.key);
|
|
193
|
+
return newAttr ? newAttr.value !== attr.value : true;
|
|
194
|
+
}) || newAttributes.some((attr) => !oldAttributes.some((oldAttr) => oldAttr.key === attr.key)) || customAttributesNeedRemove.some(
|
|
195
|
+
(removeAttr) => oldAttributes.some((oldAttr) => oldAttr.key === removeAttr.key)
|
|
196
|
+
);
|
|
197
|
+
};
|
|
123
198
|
var containsAll = (source, requiredItems = []) => {
|
|
124
199
|
if (!requiredItems?.length) return true;
|
|
125
200
|
const sourceSet = new Set(source);
|
|
@@ -286,12 +361,18 @@ var formatFunctionAutoFreeGift = ({
|
|
|
286
361
|
};
|
|
287
362
|
return result;
|
|
288
363
|
};
|
|
289
|
-
var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
364
|
+
var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer, lines) => {
|
|
290
365
|
const tags = useMemo(() => customer?.tags || [], [customer?.tags]);
|
|
291
366
|
const isCustomerLoading = useMemo(() => !customer ? true : false, [customer]);
|
|
292
367
|
const dealsType = "";
|
|
293
368
|
const { client, locale } = useShopify();
|
|
294
369
|
const giftProductsCache = useRef(null);
|
|
370
|
+
const effectiveCart = useMemo(() => {
|
|
371
|
+
if (lines && lines.length > 0) {
|
|
372
|
+
return createMockCartFromLines(lines, cart);
|
|
373
|
+
}
|
|
374
|
+
return cart;
|
|
375
|
+
}, [lines, cart]);
|
|
295
376
|
const { activeCampaign, subtotal } = useMemo(() => {
|
|
296
377
|
for (const campaign of autoFreeGiftConfig) {
|
|
297
378
|
const { rule_conditions = [], rule_result } = campaign;
|
|
@@ -299,7 +380,7 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
|
299
380
|
const isPreCheckPassed = preCheck(rule_conditions, tags, []);
|
|
300
381
|
if (isPreCheckPassed && spend_get_reward) {
|
|
301
382
|
const matchedSubtotal = getMatchedMainProductSubTotal(
|
|
302
|
-
|
|
383
|
+
effectiveCart,
|
|
303
384
|
spend_get_reward.main_product?.variant_list?.map((v) => v.variant_id) || [],
|
|
304
385
|
{
|
|
305
386
|
spend_money_type: spend_get_reward.main_product?.spend_money_type || 1,
|
|
@@ -313,13 +394,13 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
|
313
394
|
}
|
|
314
395
|
}
|
|
315
396
|
return { activeCampaign: null, subtotal: 0 };
|
|
316
|
-
}, [autoFreeGiftConfig,
|
|
397
|
+
}, [autoFreeGiftConfig, effectiveCart, tags, dealsType]);
|
|
317
398
|
const { qualifyingGift, nextTierGoal } = useMemo(() => {
|
|
318
399
|
if (!activeCampaign || !activeCampaign.rule_result?.spend_get_reward?.gift_product) {
|
|
319
400
|
return { qualifyingGift: null, nextTierGoal: null };
|
|
320
401
|
}
|
|
321
402
|
const giftTiers = activeCampaign.rule_result.spend_get_reward.gift_product;
|
|
322
|
-
const qualifyingTier = [...giftTiers].
|
|
403
|
+
const qualifyingTier = [...giftTiers].sort((a, b) => Number(b.spend_sum_money) - Number(a.spend_sum_money)).find((tier) => subtotal >= Number(tier.spend_sum_money));
|
|
323
404
|
const nextGoal = giftTiers.find((tier) => subtotal < Number(tier.spend_sum_money));
|
|
324
405
|
if (!qualifyingTier) {
|
|
325
406
|
return { qualifyingGift: null, nextTierGoal: nextGoal || null };
|
|
@@ -396,18 +477,33 @@ var useScriptAutoFreeGift = ({
|
|
|
396
477
|
campaign,
|
|
397
478
|
_giveaway,
|
|
398
479
|
cart,
|
|
399
|
-
locale: providedLocale
|
|
480
|
+
locale: providedLocale,
|
|
481
|
+
lines
|
|
400
482
|
}) => {
|
|
401
483
|
const { client, locale: contextLocale } = useShopify();
|
|
402
484
|
const locale = providedLocale || contextLocale;
|
|
403
485
|
const [points_subscribe, set_points_subscribe] = useState(false);
|
|
404
486
|
const giftProductsCache = useRef(null);
|
|
487
|
+
const effectiveCart = useMemo(() => {
|
|
488
|
+
if (lines && lines.length > 0) {
|
|
489
|
+
return createMockCartFromLines(lines, cart);
|
|
490
|
+
}
|
|
491
|
+
return cart;
|
|
492
|
+
}, [lines, cart]);
|
|
405
493
|
useEffect(() => {
|
|
406
494
|
if (locale === "au") {
|
|
407
495
|
const isPointsSubscribe = Cookies5.get("points_subscribe");
|
|
408
496
|
set_points_subscribe(!!isPointsSubscribe);
|
|
409
497
|
}
|
|
410
498
|
}, [locale]);
|
|
499
|
+
const isActivityAvailable = useMemo(() => {
|
|
500
|
+
if (!campaign) return false;
|
|
501
|
+
const query = getQuery();
|
|
502
|
+
const utmCampaign = Cookies5.get("utm_campaign") || query?.utm_campaign;
|
|
503
|
+
if (campaign.activityAvailableQuery && !utmCampaign?.includes(campaign.activityAvailableQuery))
|
|
504
|
+
return false;
|
|
505
|
+
return true;
|
|
506
|
+
}, [campaign]);
|
|
411
507
|
const [upgrade_multiple, upgrade_value] = useMemo(() => {
|
|
412
508
|
let upgrade_multiple2 = 1;
|
|
413
509
|
let upgrade_value2 = 0;
|
|
@@ -415,17 +511,17 @@ var useScriptAutoFreeGift = ({
|
|
|
415
511
|
upgrade_multiple2 = 1.2;
|
|
416
512
|
upgrade_value2 = 40;
|
|
417
513
|
}
|
|
418
|
-
|
|
514
|
+
effectiveCart?.lineItems?.forEach(({ customAttributes }) => {
|
|
419
515
|
customAttributes?.forEach(({ key, value }) => {
|
|
420
516
|
if (key === "_amount_upgrade_multiple") upgrade_multiple2 = Number(value) || 1;
|
|
421
517
|
if (key === "_amount_upgrade_value") upgrade_value2 = Number(value) || 0;
|
|
422
518
|
});
|
|
423
519
|
});
|
|
424
520
|
return [upgrade_multiple2, upgrade_value2];
|
|
425
|
-
}, [
|
|
521
|
+
}, [effectiveCart?.lineItems, points_subscribe]);
|
|
426
522
|
const breakpoints = useMemo(() => {
|
|
427
|
-
if (!
|
|
428
|
-
return (campaign
|
|
523
|
+
if (!isActivityAvailable) return [];
|
|
524
|
+
return (campaign?.breakpoints || []).map((item) => ({
|
|
429
525
|
breakpoint: new Decimal2(item.breakpoint).minus(new Decimal2(upgrade_value)).dividedBy(new Decimal2(upgrade_multiple)).toFixed(2, Decimal2.ROUND_DOWN),
|
|
430
526
|
giveawayProducts: item.giveawayProducts || []
|
|
431
527
|
}));
|
|
@@ -449,25 +545,26 @@ var useScriptAutoFreeGift = ({
|
|
|
449
545
|
return true;
|
|
450
546
|
}, [giftHandles]);
|
|
451
547
|
const involvedLines = useMemo(() => {
|
|
452
|
-
if (!
|
|
453
|
-
return (
|
|
548
|
+
if (!isActivityAvailable) return [];
|
|
549
|
+
return (effectiveCart?.lineItems || []).filter((line) => {
|
|
454
550
|
const isNotGift = line?.totalAmount && Number(line.totalAmount) > 0 && line.customAttributes?.every(
|
|
455
551
|
(item) => item.key !== _giveaway
|
|
456
552
|
);
|
|
457
553
|
const hasCampaignTag = line.product?.tags?.some(
|
|
458
|
-
(tag) => campaign
|
|
554
|
+
(tag) => campaign?.includeTags?.includes(tag.trim()) && line.variant?.availableForSale
|
|
459
555
|
);
|
|
460
556
|
return isNotGift && hasCampaignTag;
|
|
461
557
|
});
|
|
462
|
-
}, [
|
|
558
|
+
}, [effectiveCart?.lineItems, isActivityAvailable, _giveaway]);
|
|
463
559
|
const involvedSubTotal = useMemo(() => {
|
|
464
|
-
if (!
|
|
560
|
+
if (!isActivityAvailable) return new Decimal2(0);
|
|
465
561
|
return involvedLines.reduce((prev, item) => {
|
|
466
|
-
const amount = campaign
|
|
562
|
+
const amount = campaign?.useTotalAmount ? item.totalAmount : item.subtotalAmount;
|
|
467
563
|
return new Decimal2(prev).plus(new Decimal2(amount || 0));
|
|
468
564
|
}, new Decimal2(0));
|
|
469
|
-
}, [involvedLines,
|
|
565
|
+
}, [involvedLines, isActivityAvailable]);
|
|
470
566
|
const [freeGiftLevel, nextFreeGiftLevel] = useMemo(() => {
|
|
567
|
+
if (!isActivityAvailable) return [null, null];
|
|
471
568
|
const sortedLevels = [...breakpoints].sort(
|
|
472
569
|
(a, b) => Number(b.breakpoint) - Number(a.breakpoint)
|
|
473
570
|
);
|
|
@@ -621,8 +718,12 @@ var trackAddToCartGA = ({
|
|
|
621
718
|
}
|
|
622
719
|
const { variant } = lineItems[0];
|
|
623
720
|
const currencyCode = variant.product?.price?.currencyCode;
|
|
624
|
-
const
|
|
625
|
-
|
|
721
|
+
const totalPrice = lineItems?.reduce(
|
|
722
|
+
(prev, { variant: variant2 }) => prev.plus(
|
|
723
|
+
variant2?.finalPrice?.amount ?? variant2?.compareAtPrice?.amount ?? variant2?.price?.amount ?? 0
|
|
724
|
+
),
|
|
725
|
+
new Decimal2(0)
|
|
726
|
+
).toNumber();
|
|
626
727
|
gaTrack({
|
|
627
728
|
event: "ga4Event",
|
|
628
729
|
event_name: "add_to_cart",
|
|
@@ -637,7 +738,7 @@ var trackAddToCartGA = ({
|
|
|
637
738
|
item_brand: gtmParams?.brand || "",
|
|
638
739
|
item_category: variant2?.product?.productType || "",
|
|
639
740
|
item_variant: variant2?.title || variant2?.title,
|
|
640
|
-
price,
|
|
741
|
+
price: variant2?.compareAtPrice?.amount ?? variant2?.price?.amount,
|
|
641
742
|
quantity: quantity || 1
|
|
642
743
|
})),
|
|
643
744
|
...gtmParams?.ga4Params
|
|
@@ -653,8 +754,12 @@ var trackBuyNowGA = ({
|
|
|
653
754
|
}
|
|
654
755
|
const { variant } = lineItems[0];
|
|
655
756
|
const currencyCode = variant.price?.currencyCode;
|
|
656
|
-
const
|
|
657
|
-
|
|
757
|
+
const totalPrice = lineItems?.reduce(
|
|
758
|
+
(prev, { variant: variant2 }) => prev.plus(
|
|
759
|
+
variant2?.finalPrice?.amount ?? variant2?.compareAtPrice?.amount ?? (variant2?.price?.amount || 0)
|
|
760
|
+
),
|
|
761
|
+
new Decimal2(0)
|
|
762
|
+
).toNumber();
|
|
658
763
|
gaTrack({
|
|
659
764
|
event: "ga4Event",
|
|
660
765
|
event_name: "begin_checkout",
|
|
@@ -669,7 +774,7 @@ var trackBuyNowGA = ({
|
|
|
669
774
|
item_brand: gtmParams?.brand || "",
|
|
670
775
|
item_category: item.variant?.product?.productType || "",
|
|
671
776
|
item_variant: item.variant?.title,
|
|
672
|
-
price,
|
|
777
|
+
price: item.variant?.compareAtPrice?.amount ?? item.variant?.price?.amount,
|
|
673
778
|
quantity: item.quantity || 1
|
|
674
779
|
})),
|
|
675
780
|
...gtmParams?.ga4Params
|
|
@@ -812,6 +917,7 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
812
917
|
if (!resultCart) {
|
|
813
918
|
return void 0;
|
|
814
919
|
}
|
|
920
|
+
console.log("npm addCartLines resultCart", resultCart);
|
|
815
921
|
if (resultCart.discountCodes && resultCart.discountCodes.length > 0) {
|
|
816
922
|
const unapplicableCodes = resultCart.discountCodes.filter((item) => !item.applicable).map((item) => item.code);
|
|
817
923
|
if (unapplicableCodes.length > 0) {
|
|
@@ -985,6 +1091,60 @@ function useBuyNow({ withTrack = true } = {}, swrOptions) {
|
|
|
985
1091
|
);
|
|
986
1092
|
return useSWRMutation("buy-now", buyNow, swrOptions);
|
|
987
1093
|
}
|
|
1094
|
+
function useCalcGiftsFromLines({
|
|
1095
|
+
lines,
|
|
1096
|
+
customer,
|
|
1097
|
+
scriptGiveawayKey = CUSTOMER_SCRIPT_GIFT_KEY
|
|
1098
|
+
}) {
|
|
1099
|
+
const { locale } = useShopify();
|
|
1100
|
+
const { cart, autoFreeGiftConfig, gradientGiftsConfig } = useCartContext();
|
|
1101
|
+
const functionGift = useCalcAutoFreeGift(cart, autoFreeGiftConfig || [], customer, lines);
|
|
1102
|
+
const scriptGift = useScriptAutoFreeGift({
|
|
1103
|
+
campaign: gradientGiftsConfig || null,
|
|
1104
|
+
_giveaway: scriptGiveawayKey,
|
|
1105
|
+
cart,
|
|
1106
|
+
locale,
|
|
1107
|
+
lines
|
|
1108
|
+
});
|
|
1109
|
+
const allGiftLines = useMemo(() => {
|
|
1110
|
+
const functionGiftLines = functionGift.qualifyingGift?.itemsToAdd || [];
|
|
1111
|
+
const scriptGiftLines = scriptGift.freeGiftLevel ? scriptGift.freeGiftLevel.giveawayProducts.map((product) => {
|
|
1112
|
+
const giftProduct = scriptGift.giftProductsResult?.find(
|
|
1113
|
+
(p) => p.handle === product.handle
|
|
1114
|
+
);
|
|
1115
|
+
const variant = giftProduct?.variants?.[0];
|
|
1116
|
+
return {
|
|
1117
|
+
variant: {
|
|
1118
|
+
id: variant?.id || "",
|
|
1119
|
+
handle: product.handle,
|
|
1120
|
+
sku: product.sku
|
|
1121
|
+
},
|
|
1122
|
+
quantity: 1,
|
|
1123
|
+
attributes: [
|
|
1124
|
+
{
|
|
1125
|
+
key: scriptGiveawayKey,
|
|
1126
|
+
value: "true"
|
|
1127
|
+
}
|
|
1128
|
+
]
|
|
1129
|
+
};
|
|
1130
|
+
}).filter((item) => item.variant.id) : [];
|
|
1131
|
+
return [...functionGiftLines, ...scriptGiftLines];
|
|
1132
|
+
}, [
|
|
1133
|
+
functionGift.qualifyingGift,
|
|
1134
|
+
scriptGift.freeGiftLevel,
|
|
1135
|
+
scriptGift.giftProductsResult,
|
|
1136
|
+
scriptGiveawayKey
|
|
1137
|
+
]);
|
|
1138
|
+
const hasGifts = useMemo(() => {
|
|
1139
|
+
return allGiftLines.length > 0;
|
|
1140
|
+
}, [allGiftLines]);
|
|
1141
|
+
return {
|
|
1142
|
+
functionGift,
|
|
1143
|
+
scriptGift,
|
|
1144
|
+
allGiftLines,
|
|
1145
|
+
hasGifts
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
988
1148
|
|
|
989
1149
|
// src/hooks/cart/types/order-discount.ts
|
|
990
1150
|
var OrderDiscountType = /* @__PURE__ */ ((OrderDiscountType2) => {
|
|
@@ -1134,8 +1294,6 @@ var useCartAttributes = ({
|
|
|
1134
1294
|
memberSetting,
|
|
1135
1295
|
cart
|
|
1136
1296
|
});
|
|
1137
|
-
console.log("memberSetting", memberSetting);
|
|
1138
|
-
console.log("hasPlusMember", hasPlusMember);
|
|
1139
1297
|
useEffect(() => {
|
|
1140
1298
|
setCurrentUrl(window.location.href);
|
|
1141
1299
|
}, []);
|
|
@@ -1161,7 +1319,7 @@ var useCartAttributes = ({
|
|
|
1161
1319
|
return "new_user_login";
|
|
1162
1320
|
}, [customer]);
|
|
1163
1321
|
const memberAttributes = useMemo(() => {
|
|
1164
|
-
|
|
1322
|
+
const attributes = [
|
|
1165
1323
|
{
|
|
1166
1324
|
key: "_token",
|
|
1167
1325
|
value: profile?.token
|
|
@@ -1180,19 +1338,34 @@ var useCartAttributes = ({
|
|
|
1180
1338
|
{
|
|
1181
1339
|
key: "_is_login",
|
|
1182
1340
|
value: profile?.token ? "true" : "false"
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
key: "_last_url",
|
|
1344
|
+
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
1183
1345
|
}
|
|
1184
1346
|
];
|
|
1347
|
+
if (profile?.token) {
|
|
1348
|
+
attributes.push({
|
|
1349
|
+
key: "_login_user",
|
|
1350
|
+
value: "1"
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1353
|
+
return attributes;
|
|
1185
1354
|
}, [profile?.memberType, profile?.token, userType, hasPlusMember]);
|
|
1186
1355
|
const functionAttributes = useMemo(() => {
|
|
1187
|
-
|
|
1188
|
-
|
|
1356
|
+
const hasFunctionEnvAttribute = cart?.lineItems.some(
|
|
1357
|
+
(item) => item.customAttributes?.some((attr) => attr.key === CUSTOMER_ATTRIBUTE_KEY)
|
|
1358
|
+
);
|
|
1359
|
+
const discountCodes = cart?.discountCodes.map((item) => item.code).filter((code) => code) || [];
|
|
1360
|
+
return hasFunctionEnvAttribute ? [
|
|
1361
|
+
{
|
|
1189
1362
|
key: "_discounts_function_env",
|
|
1190
1363
|
value: JSON.stringify({
|
|
1191
|
-
discount_code:
|
|
1364
|
+
discount_code: discountCodes,
|
|
1192
1365
|
user_tags: customer?.tags || []
|
|
1193
1366
|
})
|
|
1194
1367
|
}
|
|
1195
|
-
];
|
|
1368
|
+
] : [];
|
|
1196
1369
|
}, [cart]);
|
|
1197
1370
|
const presellAttributes = useMemo(() => {
|
|
1198
1371
|
return [
|
|
@@ -2369,6 +2542,69 @@ var usePlusMemberDeliveryCodes = ({
|
|
|
2369
2542
|
[deliveryData]
|
|
2370
2543
|
);
|
|
2371
2544
|
};
|
|
2545
|
+
function useUpdateCartDeliveryOptions(mutate, metafieldIdentifiers, options) {
|
|
2546
|
+
const { client, locale, cartCookieAdapter } = useShopify();
|
|
2547
|
+
const updateDeliveryOptions = useCallback(
|
|
2548
|
+
async (_key, { arg }) => {
|
|
2549
|
+
const updatedCart = await updateCartDeliveryOptions(client, {
|
|
2550
|
+
...arg,
|
|
2551
|
+
metafieldIdentifiers,
|
|
2552
|
+
cookieAdapter: cartCookieAdapter
|
|
2553
|
+
});
|
|
2554
|
+
console.log("useUpdateCartDeliveryOptions updatedCart", updatedCart);
|
|
2555
|
+
if (updatedCart) {
|
|
2556
|
+
mutate(updatedCart);
|
|
2557
|
+
}
|
|
2558
|
+
return updatedCart;
|
|
2559
|
+
},
|
|
2560
|
+
[client, locale, cartCookieAdapter, mutate]
|
|
2561
|
+
);
|
|
2562
|
+
return useSWRMutation("update-cart-delivery-options", updateDeliveryOptions, options);
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
// src/hooks/member/plus/use-update-plus-member-delivery-options.ts
|
|
2566
|
+
var useUpdatePlusMemberDeliveryOptions = ({
|
|
2567
|
+
options
|
|
2568
|
+
}) => {
|
|
2569
|
+
const { cart, mutateCart: mutate, metafieldIdentifiers } = useCartContext();
|
|
2570
|
+
const { trigger: updateCartDeliveryOptions2, isMutating } = useUpdateCartDeliveryOptions(
|
|
2571
|
+
mutate,
|
|
2572
|
+
metafieldIdentifiers
|
|
2573
|
+
);
|
|
2574
|
+
const handler = useCallback(
|
|
2575
|
+
async (_, { arg }) => {
|
|
2576
|
+
const { deliveryData } = arg;
|
|
2577
|
+
const firstDeliveryGroup = cart?.deliveryGroups?.[0];
|
|
2578
|
+
const deliveryGroupId = firstDeliveryGroup?.id;
|
|
2579
|
+
const selectedOptionCode = deliveryData?.deliveryCustomData?.selected_delivery_option?.code;
|
|
2580
|
+
if (!deliveryGroupId || !selectedOptionCode || selectedOptionCode === firstDeliveryGroup?.selectedDeliveryOption?.code) {
|
|
2581
|
+
return null;
|
|
2582
|
+
}
|
|
2583
|
+
const deliveryGroup = cart?.deliveryGroups?.find((group) => group?.id === deliveryGroupId);
|
|
2584
|
+
const matchedOption = deliveryGroup?.deliveryOptions?.find(
|
|
2585
|
+
(option) => option?.code === selectedOptionCode
|
|
2586
|
+
);
|
|
2587
|
+
if (!matchedOption?.handle) {
|
|
2588
|
+
return null;
|
|
2589
|
+
}
|
|
2590
|
+
const deliveryOptions = [
|
|
2591
|
+
{
|
|
2592
|
+
deliveryGroupId,
|
|
2593
|
+
deliveryOptionHandle: matchedOption.handle
|
|
2594
|
+
}
|
|
2595
|
+
];
|
|
2596
|
+
const updatedCart = await updateCartDeliveryOptions2({
|
|
2597
|
+
selectedDeliveryOptions: deliveryOptions
|
|
2598
|
+
});
|
|
2599
|
+
if (updatedCart && mutate) {
|
|
2600
|
+
mutate(updatedCart);
|
|
2601
|
+
}
|
|
2602
|
+
return updatedCart;
|
|
2603
|
+
},
|
|
2604
|
+
[cart, updateCartDeliveryOptions2, mutate]
|
|
2605
|
+
);
|
|
2606
|
+
return useSWRMutation("update-cart-delivery-options", handler, options);
|
|
2607
|
+
};
|
|
2372
2608
|
var usePlusMemberItemCustomAttributes = ({
|
|
2373
2609
|
deliveryData
|
|
2374
2610
|
}) => {
|
|
@@ -2388,48 +2624,12 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2388
2624
|
deliveryData,
|
|
2389
2625
|
product,
|
|
2390
2626
|
variant,
|
|
2391
|
-
customer,
|
|
2392
2627
|
isShowShippingBenefits
|
|
2393
2628
|
}) => {
|
|
2394
2629
|
const { deliveryCustomData } = deliveryData || {};
|
|
2395
2630
|
const { profile } = usePlusMemberContext();
|
|
2396
|
-
const userType = useMemo(() => {
|
|
2397
|
-
const customerInfo = customer;
|
|
2398
|
-
if (!customerInfo) {
|
|
2399
|
-
return "new_user_unlogin";
|
|
2400
|
-
}
|
|
2401
|
-
if (customer) {
|
|
2402
|
-
const { orders = {} } = customer;
|
|
2403
|
-
const edgesLength = orders?.edges?.length;
|
|
2404
|
-
if (edgesLength === 1) {
|
|
2405
|
-
return "old_user_orders_once";
|
|
2406
|
-
} else if (edgesLength && edgesLength > 1) {
|
|
2407
|
-
return "old_user_orders_twice";
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
return "new_user_login";
|
|
2411
|
-
}, [customer]);
|
|
2412
2631
|
return useMemo(() => {
|
|
2413
|
-
const checkoutCustomAttributes = [
|
|
2414
|
-
{
|
|
2415
|
-
key: "_token",
|
|
2416
|
-
value: profile?.token || ""
|
|
2417
|
-
},
|
|
2418
|
-
{
|
|
2419
|
-
key: "_last_url",
|
|
2420
|
-
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
2421
|
-
},
|
|
2422
|
-
{
|
|
2423
|
-
key: "_user_type",
|
|
2424
|
-
value: userType
|
|
2425
|
-
}
|
|
2426
|
-
];
|
|
2427
|
-
if (profile) {
|
|
2428
|
-
checkoutCustomAttributes.push({
|
|
2429
|
-
key: "_login_user",
|
|
2430
|
-
value: "1"
|
|
2431
|
-
});
|
|
2432
|
-
}
|
|
2632
|
+
const checkoutCustomAttributes = [];
|
|
2433
2633
|
if (deliveryCustomData) {
|
|
2434
2634
|
checkoutCustomAttributes.push({
|
|
2435
2635
|
key: "_checkout_delivery_custom",
|
|
@@ -2439,12 +2639,6 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2439
2639
|
})
|
|
2440
2640
|
});
|
|
2441
2641
|
}
|
|
2442
|
-
if (variant?.metafields?.presell) {
|
|
2443
|
-
checkoutCustomAttributes.push({
|
|
2444
|
-
key: "_presale",
|
|
2445
|
-
value: "true"
|
|
2446
|
-
});
|
|
2447
|
-
}
|
|
2448
2642
|
if (isShowShippingBenefits && !isShowShippingBenefits({ variant, product, setting: {} })) {
|
|
2449
2643
|
checkoutCustomAttributes.push({
|
|
2450
2644
|
key: "_hide_shipping",
|
|
@@ -2452,18 +2646,17 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2452
2646
|
});
|
|
2453
2647
|
}
|
|
2454
2648
|
return checkoutCustomAttributes;
|
|
2455
|
-
}, [deliveryCustomData, product, profile,
|
|
2649
|
+
}, [deliveryCustomData, product, profile, variant, isShowShippingBenefits]);
|
|
2456
2650
|
};
|
|
2457
2651
|
function useAutoRemovePlusMemberInCart({
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2652
|
+
cart,
|
|
2653
|
+
profile,
|
|
2654
|
+
memberSetting
|
|
2461
2655
|
}) {
|
|
2462
|
-
const { plus_monthly_product, plus_annual_product } =
|
|
2463
|
-
const { cart } = useCartContext();
|
|
2656
|
+
const { plus_monthly_product, plus_annual_product } = memberSetting || {};
|
|
2464
2657
|
const { trigger: removeCartLines2 } = useRemoveCartLines();
|
|
2465
2658
|
useEffect(() => {
|
|
2466
|
-
if (!cart) return;
|
|
2659
|
+
if (!cart || !plus_monthly_product || !plus_annual_product) return;
|
|
2467
2660
|
const removePlusProduct = async (productType) => {
|
|
2468
2661
|
if (!productType) return;
|
|
2469
2662
|
const product = cart.lineItems?.find(
|
|
@@ -2475,26 +2668,53 @@ function useAutoRemovePlusMemberInCart({
|
|
|
2475
2668
|
});
|
|
2476
2669
|
}
|
|
2477
2670
|
};
|
|
2478
|
-
if (isMonthlyPlus) {
|
|
2671
|
+
if (profile?.isMonthlyPlus) {
|
|
2479
2672
|
removePlusProduct(plus_monthly_product);
|
|
2480
2673
|
}
|
|
2481
|
-
if (isAnnualPlus) {
|
|
2674
|
+
if (profile?.isAnnualPlus) {
|
|
2482
2675
|
removePlusProduct(plus_annual_product);
|
|
2483
2676
|
}
|
|
2677
|
+
}, [cart, plus_annual_product, plus_monthly_product, profile, removeCartLines2]);
|
|
2678
|
+
}
|
|
2679
|
+
function useAddPlusMemberProductsToCart({
|
|
2680
|
+
cart,
|
|
2681
|
+
profile
|
|
2682
|
+
}) {
|
|
2683
|
+
const { selectedPlusMemberMode, selectedPlusMemberProduct, plusMemberMetafields } = usePlusMemberContext();
|
|
2684
|
+
const { hasMonthlyPlus, hasAnnualPlus } = useHasPlusMemberInCart({
|
|
2685
|
+
memberSetting: plusMemberMetafields,
|
|
2686
|
+
cart
|
|
2687
|
+
});
|
|
2688
|
+
const plusMemberProduct = useMemo(() => {
|
|
2689
|
+
if (!selectedPlusMemberProduct || selectedPlusMemberMode === "free" /* FREE */) {
|
|
2690
|
+
return void 0;
|
|
2691
|
+
}
|
|
2692
|
+
if (selectedPlusMemberMode === "monthly" /* MONTHLY */ && hasMonthlyPlus) {
|
|
2693
|
+
return void 0;
|
|
2694
|
+
}
|
|
2695
|
+
if (selectedPlusMemberMode === "annual" /* ANNUAL */ && hasAnnualPlus) {
|
|
2696
|
+
return void 0;
|
|
2697
|
+
}
|
|
2698
|
+
if (profile?.isMonthlyPlus && selectedPlusMemberMode === "monthly" /* MONTHLY */) {
|
|
2699
|
+
return void 0;
|
|
2700
|
+
}
|
|
2701
|
+
if (!profile?.isAnnualPlus && selectedPlusMemberMode === "annual" /* ANNUAL */) {
|
|
2702
|
+
return void 0;
|
|
2703
|
+
}
|
|
2704
|
+
return selectedPlusMemberProduct;
|
|
2484
2705
|
}, [
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
removeCartLines2
|
|
2706
|
+
selectedPlusMemberMode,
|
|
2707
|
+
selectedPlusMemberProduct?.variant,
|
|
2708
|
+
selectedPlusMemberProduct?.product,
|
|
2709
|
+
hasMonthlyPlus,
|
|
2710
|
+
hasAnnualPlus
|
|
2491
2711
|
]);
|
|
2712
|
+
return plusMemberProduct;
|
|
2492
2713
|
}
|
|
2493
2714
|
var PlusMemberProvider = ({
|
|
2494
2715
|
variant,
|
|
2495
2716
|
product,
|
|
2496
|
-
|
|
2497
|
-
metafields,
|
|
2717
|
+
memberSetting,
|
|
2498
2718
|
initialSelectedPlusMemberMode = "free",
|
|
2499
2719
|
profile,
|
|
2500
2720
|
locale,
|
|
@@ -2514,14 +2734,14 @@ var PlusMemberProvider = ({
|
|
|
2514
2734
|
const [deleteMarginBottom, setDeleteMarginBottom] = useState(false);
|
|
2515
2735
|
const shippingMethodsContext = useShippingMethods({
|
|
2516
2736
|
variant,
|
|
2517
|
-
plusMemberMetafields:
|
|
2737
|
+
plusMemberMetafields: memberSetting,
|
|
2518
2738
|
selectedPlusMemberMode});
|
|
2519
2739
|
const plusMemberHandles = useMemo(() => {
|
|
2520
2740
|
return [
|
|
2521
|
-
|
|
2522
|
-
|
|
2741
|
+
memberSetting?.plus_monthly_product?.handle,
|
|
2742
|
+
memberSetting?.plus_annual_product?.handle
|
|
2523
2743
|
].filter(Boolean);
|
|
2524
|
-
}, [
|
|
2744
|
+
}, [memberSetting]);
|
|
2525
2745
|
const { data: plusMemberProducts = [] } = useProductsByHandles({
|
|
2526
2746
|
handles: plusMemberHandles
|
|
2527
2747
|
});
|
|
@@ -2529,25 +2749,24 @@ var PlusMemberProvider = ({
|
|
|
2529
2749
|
if (selectedPlusMemberMode === "free" /* FREE */) {
|
|
2530
2750
|
return null;
|
|
2531
2751
|
}
|
|
2532
|
-
const handle = selectedPlusMemberMode === "monthly" /* MONTHLY */ ?
|
|
2533
|
-
const sku = selectedPlusMemberMode === "monthly" /* MONTHLY */ ?
|
|
2752
|
+
const handle = selectedPlusMemberMode === "monthly" /* MONTHLY */ ? memberSetting?.plus_monthly_product?.handle : memberSetting?.plus_annual_product?.handle;
|
|
2753
|
+
const sku = selectedPlusMemberMode === "monthly" /* MONTHLY */ ? memberSetting?.plus_monthly_product?.sku : memberSetting?.plus_annual_product?.sku;
|
|
2534
2754
|
const product2 = plusMemberProducts?.find((p) => p.handle === handle);
|
|
2535
2755
|
const variant2 = product2?.variants?.find((v) => v.sku === sku);
|
|
2536
2756
|
return product2 && variant2 ? { product: product2, variant: variant2 } : null;
|
|
2537
|
-
}, [plusMemberProducts,
|
|
2757
|
+
}, [plusMemberProducts, memberSetting, selectedPlusMemberMode]);
|
|
2538
2758
|
return /* @__PURE__ */ jsx(
|
|
2539
2759
|
PlusMemberContext.Provider,
|
|
2540
2760
|
{
|
|
2541
2761
|
value: {
|
|
2542
2762
|
variant,
|
|
2543
|
-
shopCommon,
|
|
2544
2763
|
zipCode,
|
|
2545
2764
|
setZipCode,
|
|
2546
2765
|
allowNextDayDelivery,
|
|
2547
2766
|
setAllowNextDayDelivery,
|
|
2548
2767
|
allowThirdDayDelivery,
|
|
2549
2768
|
setAllowThirdDayDelivery,
|
|
2550
|
-
plusMemberMetafields:
|
|
2769
|
+
plusMemberMetafields: memberSetting,
|
|
2551
2770
|
selectedPlusMemberMode,
|
|
2552
2771
|
setSelectedPlusMemberMode,
|
|
2553
2772
|
showAreaCheckModal,
|
|
@@ -2753,6 +2972,6 @@ function clearGeoLocationCache(cacheKey = "geoLocation") {
|
|
|
2753
2972
|
}
|
|
2754
2973
|
}
|
|
2755
2974
|
|
|
2756
|
-
export { BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, DeliveryPlusType, MAIN_PRODUCT_CODE, OrderBasePriceType, OrderDiscountType, PLUS_MEMBER_TYPE, PlusMemberContext, PlusMemberMode, PlusMemberProvider, PriceBasePriceType, PriceDiscountType, RuleType, SCRIPT_CODE_AMOUNT_KEY, ShippingMethodMode, SpendMoneyType, atobID, btoaID, clearGeoLocationCache, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes,
|
|
2975
|
+
export { BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, DeliveryPlusType, MAIN_PRODUCT_CODE, OrderBasePriceType, OrderDiscountType, PLUS_MEMBER_TYPE, PlusMemberContext, PlusMemberMode, PlusMemberProvider, PriceBasePriceType, PriceDiscountType, RuleType, SCRIPT_CODE_AMOUNT_KEY, ShippingMethodMode, SpendMoneyType, atobID, btoaID, checkAttributesUpdateNeeded, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, normalizeAddToCartLines, preCheck, safeParse, useAddCartLines, useAddPlusMemberProductsToCart, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useIntersection, usePlusAnnualProductVariant, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberDeliveryCodes, usePlusMemberItemCustomAttributes, usePlusMonthlyProductVariant, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useScriptAutoFreeGift, useSearch, useSelectedOptions, useShippingMethodAvailableCheck, useShippingMethods, useSite, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdatePlusMemberDeliveryOptions, useUpdateVariantQuery, useVariant, useVariantMedia };
|
|
2757
2976
|
//# sourceMappingURL=index.mjs.map
|
|
2758
2977
|
//# sourceMappingURL=index.mjs.map
|