@rebuy/rebuy 2.29.0-rc.9 → 2.29.0
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/index.js +868 -1259
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +607 -998
- package/dist/index.mjs.map +4 -4
- package/dist/schema/checkout-and-beyond/constants.js +0 -1
- package/dist/schema/checkout-and-beyond/constants.js.map +2 -2
- package/dist/schema/checkout-and-beyond/constants.mjs +0 -1
- package/dist/schema/checkout-and-beyond/constants.mjs.map +2 -2
- package/dist/schema/checkout-and-beyond/index.js +299 -598
- package/dist/schema/checkout-and-beyond/index.js.map +4 -4
- package/dist/schema/checkout-and-beyond/index.mjs +70 -369
- package/dist/schema/checkout-and-beyond/index.mjs.map +4 -4
- package/dist/schema/metadata.d.ts +1 -1
- package/dist/schema/metadata.d.ts.map +1 -1
- package/dist/schema/product.d.ts +1 -1
- package/dist/schema/product.d.ts.map +1 -1
- package/dist/schema/shop-config.js +60 -60
- package/dist/schema/shop-config.js.map +2 -2
- package/dist/schema/shop-config.mjs +1 -1
- package/dist/schema/shop-config.mjs.map +1 -1
- package/dist/schema/shopConfig.d.ts +1 -1
- package/dist/schema/shopConfig.d.ts.map +1 -1
- package/dist/schema/user-config.js +64 -112
- package/dist/schema/user-config.js.map +4 -4
- package/dist/schema/user-config.mjs +5 -53
- package/dist/schema/user-config.mjs.map +4 -4
- package/dist/schema/userConfig.d.ts +2 -48
- package/dist/schema/userConfig.d.ts.map +1 -1
- package/dist/schema/widget-data.js +344 -611
- package/dist/schema/widget-data.js.map +4 -4
- package/dist/schema/widget-data.mjs +50 -317
- package/dist/schema/widget-data.mjs.map +4 -4
- package/dist/schema/widgetData.d.ts +5 -26
- package/dist/schema/widgetData.d.ts.map +1 -1
- package/dist/schema/widgets/abTestingPlaceholder.d.ts +1 -1
- package/dist/schema/widgets/abTestingPlaceholder.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/dataSource.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +0 -2
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts +29 -57
- package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +1 -2
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +130 -148
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/regex.d.ts +1 -13
- package/dist/schema/widgets/checkout-and-beyond/regex.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +1 -5
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +1 -21
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +7 -9
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/utils.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts.map +1 -1
- package/dist/schema/widgets/checkoutExtension.d.ts +1 -1
- package/dist/schema/widgets/checkoutExtension.d.ts.map +1 -1
- package/dist/schema/widgets/contentBlock.d.ts +2 -9
- package/dist/schema/widgets/contentBlock.d.ts.map +1 -1
- package/dist/schema/widgets/giftWithPurchase.d.ts +1 -1
- package/dist/schema/widgets/giftWithPurchase.d.ts.map +1 -1
- package/dist/schema/widgets/lineItemEditor.d.ts +2 -9
- package/dist/schema/widgets/lineItemEditor.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/common.d.ts +1 -1
- package/dist/schema/widgets/post-purchase-offer/common.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts +1 -1
- package/dist/schema/widgets/post-purchase-offer/constants.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts +20 -20
- package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +12 -12
- package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +11 -11
- package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts.map +1 -1
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +11 -11
- package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts.map +1 -1
- package/dist/schema/widgets/progressBar.d.ts +1 -1
- package/dist/schema/widgets/progressBar.d.ts.map +1 -1
- package/dist/schema/widgets/rebuyButton.d.ts +2 -9
- package/dist/schema/widgets/rebuyButton.d.ts.map +1 -1
- package/dist/schema/widgets/rebuyMonetize.d.ts +1 -1
- package/dist/schema/widgets/rebuyMonetize.d.ts.map +1 -1
- package/dist/server/dataSourceResults.d.ts.map +1 -1
- package/dist/server/index.d.ts +0 -3
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +388 -1301
- package/dist/server/index.js.map +4 -4
- package/dist/server/index.mjs +329 -1242
- package/dist/server/index.mjs.map +4 -4
- package/dist/server/widgetSettings.d.ts +2 -4
- package/dist/server/widgetSettings.d.ts.map +1 -1
- package/dist/transforms/index.d.ts +0 -5
- package/dist/transforms/index.d.ts.map +1 -1
- package/dist/transforms/index.js +456 -1039
- package/dist/transforms/index.js.map +4 -4
- package/dist/transforms/index.mjs +227 -810
- package/dist/transforms/index.mjs.map +4 -4
- package/dist/transforms/normalizeTokens.d.ts.map +1 -1
- package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +1 -1
- package/dist/transforms/offerV1/offerCard.d.ts.map +1 -1
- package/dist/transforms/offerV1/offerTemplateSeed.d.ts +3 -100
- package/dist/transforms/offerV1/offerTemplateSeed.d.ts.map +1 -1
- package/dist/transforms/offerV1/types.d.ts +2 -6
- package/dist/transforms/offerV1/types.d.ts.map +1 -1
- package/dist/transforms/parseShielded.d.ts +1 -1
- package/dist/transforms/parseShielded.d.ts.map +1 -1
- package/package.json +4 -14
- package/dist/gwp/getValidGwpProductIds.d.ts +0 -8
- package/dist/gwp/getValidGwpProductIds.d.ts.map +0 -1
- package/dist/gwp/hasUnsupportedRuleTypes.d.ts +0 -7
- package/dist/gwp/hasUnsupportedRuleTypes.d.ts.map +0 -1
- package/dist/gwp/index.d.ts +0 -5
- package/dist/gwp/index.d.ts.map +0 -1
- package/dist/gwp/index.js +0 -43
- package/dist/gwp/index.js.map +0 -7
- package/dist/gwp/index.mjs +0 -20
- package/dist/gwp/index.mjs.map +0 -7
- package/dist/gwp/shouldRemoveGift.d.ts +0 -9
- package/dist/gwp/shouldRemoveGift.d.ts.map +0 -1
- package/dist/gwp/types.d.ts +0 -35
- package/dist/gwp/types.d.ts.map +0 -1
- package/dist/pricing/amountToCents.d.ts +0 -10
- package/dist/pricing/amountToCents.d.ts.map +0 -1
- package/dist/pricing/computeCompareAtPrice.d.ts +0 -10
- package/dist/pricing/computeCompareAtPrice.d.ts.map +0 -1
- package/dist/pricing/computeDisplayPrice.d.ts +0 -26
- package/dist/pricing/computeDisplayPrice.d.ts.map +0 -1
- package/dist/pricing/currencyDecimals.d.ts +0 -12
- package/dist/pricing/currencyDecimals.d.ts.map +0 -1
- package/dist/pricing/index.d.ts +0 -7
- package/dist/pricing/index.d.ts.map +0 -1
- package/dist/pricing/index.js +0 -128
- package/dist/pricing/index.js.map +0 -7
- package/dist/pricing/index.mjs +0 -105
- package/dist/pricing/index.mjs.map +0 -7
- package/dist/pricing/priceVariant.d.ts +0 -10
- package/dist/pricing/priceVariant.d.ts.map +0 -1
- package/dist/pricing/types.d.ts +0 -38
- package/dist/pricing/types.d.ts.map +0 -1
- package/dist/schema/smartCart.d.ts +0 -201
- package/dist/schema/smartCart.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/giftLabels.d.ts +0 -121
- package/dist/schema/widgets/checkout-and-beyond/giftLabels.d.ts.map +0 -1
- package/dist/schema/widgets/checkout-and-beyond/reviewLabels.d.ts +0 -66
- package/dist/schema/widgets/checkout-and-beyond/reviewLabels.d.ts.map +0 -1
- package/dist/server/adsEngine.d.ts +0 -31
- package/dist/server/adsEngine.d.ts.map +0 -1
- package/dist/server/analytics.d.ts +0 -27
- package/dist/server/analytics.d.ts.map +0 -1
- package/dist/server/composeOffer.d.ts +0 -11
- package/dist/server/composeOffer.d.ts.map +0 -1
- package/dist/server/giftValidation.d.ts +0 -11
- package/dist/server/giftValidation.d.ts.map +0 -1
- package/dist/server/monetizeOffers.d.ts +0 -11
- package/dist/server/monetizeOffers.d.ts.map +0 -1
- package/dist/transforms/experiments/resolveExperiment.d.ts +0 -20
- package/dist/transforms/experiments/resolveExperiment.d.ts.map +0 -1
- package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts +0 -24
- package/dist/transforms/progressBarV1/convertProgressBarToV2.d.ts.map +0 -1
- package/dist/transforms/progressBarV1/types.d.ts +0 -44
- package/dist/transforms/progressBarV1/types.d.ts.map +0 -1
- package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts +0 -19
- package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts.map +0 -1
- package/dist/transforms/smartCart/extractSmartCartBars.d.ts +0 -15
- package/dist/transforms/smartCart/extractSmartCartBars.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -40,7 +40,6 @@ __export(src_exports, {
|
|
|
40
40
|
CABDataSourceSection: () => CABDataSourceSection,
|
|
41
41
|
CABDiscount: () => CABDiscount,
|
|
42
42
|
CABDiscountSection: () => CABDiscountSection,
|
|
43
|
-
CABExperiment: () => CABExperiment,
|
|
44
43
|
CABImageSection: () => CABImageSection,
|
|
45
44
|
CABIntegrations: () => CABIntegrations,
|
|
46
45
|
CABLayoutSection: () => CABLayoutSection,
|
|
@@ -56,7 +55,6 @@ __export(src_exports, {
|
|
|
56
55
|
CABRule: () => CABRule,
|
|
57
56
|
CABSection: () => CABSection,
|
|
58
57
|
CABTextSection: () => CABTextSection,
|
|
59
|
-
CABTextTier: () => CABTextTier,
|
|
60
58
|
CABTracking: () => CABTracking,
|
|
61
59
|
CABVariantContent: () => CABVariantContent,
|
|
62
60
|
CABVariantsSection: () => CABVariantsSection,
|
|
@@ -72,7 +70,6 @@ __export(src_exports, {
|
|
|
72
70
|
DiscountSource: () => DiscountSource,
|
|
73
71
|
DiscountType: () => DiscountType,
|
|
74
72
|
EditorMode: () => EditorMode,
|
|
75
|
-
GIFT_LABELS: () => GIFT_LABELS,
|
|
76
73
|
Geolocation: () => Geolocation,
|
|
77
74
|
GiftWithPurchase: () => GiftWithPurchase,
|
|
78
75
|
GridItem: () => GridItem,
|
|
@@ -103,7 +100,6 @@ __export(src_exports, {
|
|
|
103
100
|
ProgressBar: () => ProgressBar,
|
|
104
101
|
ProgressTierType: () => ProgressTierType,
|
|
105
102
|
QuantityInput: () => QuantityInput,
|
|
106
|
-
REVIEW_LABELS: () => REVIEW_LABELS,
|
|
107
103
|
RebuyButton: () => RebuyButton,
|
|
108
104
|
RebuyButtonV1: () => RebuyButtonV1,
|
|
109
105
|
RebuyClient: () => RebuyClient,
|
|
@@ -971,289 +967,289 @@ var RebuyClient = class {
|
|
|
971
967
|
};
|
|
972
968
|
|
|
973
969
|
// src/schema/metadata.ts
|
|
974
|
-
var
|
|
970
|
+
var import_zod2 = require("zod");
|
|
975
971
|
|
|
976
972
|
// src/schema/product.ts
|
|
977
|
-
var
|
|
978
|
-
var zDatetime =
|
|
979
|
-
var CacheInfo =
|
|
980
|
-
cachedAtTime:
|
|
981
|
-
cacheExpires:
|
|
982
|
-
cacheKey:
|
|
983
|
-
cacheKeyReadable:
|
|
984
|
-
cacheType:
|
|
985
|
-
loadedOptions:
|
|
986
|
-
});
|
|
987
|
-
var Category =
|
|
988
|
-
adminGraphqlApiId:
|
|
989
|
-
fullName:
|
|
990
|
-
name:
|
|
991
|
-
});
|
|
992
|
-
var Metafield =
|
|
993
|
-
key:
|
|
994
|
-
namespace:
|
|
995
|
-
type:
|
|
996
|
-
value:
|
|
997
|
-
});
|
|
998
|
-
var Image =
|
|
999
|
-
adminGraphqlApiId:
|
|
1000
|
-
alt:
|
|
973
|
+
var import_zod = require("zod");
|
|
974
|
+
var zDatetime = import_zod.z.iso.datetime({ offset: true });
|
|
975
|
+
var CacheInfo = import_zod.z.object({
|
|
976
|
+
cachedAtTime: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]),
|
|
977
|
+
cacheExpires: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]).optional(),
|
|
978
|
+
cacheKey: import_zod.z.string(),
|
|
979
|
+
cacheKeyReadable: import_zod.z.string(),
|
|
980
|
+
cacheType: import_zod.z.string().optional(),
|
|
981
|
+
loadedOptions: import_zod.z.record(import_zod.z.string(), import_zod.z.boolean()).optional()
|
|
982
|
+
});
|
|
983
|
+
var Category = import_zod.z.object({
|
|
984
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
985
|
+
fullName: import_zod.z.string(),
|
|
986
|
+
name: import_zod.z.string()
|
|
987
|
+
});
|
|
988
|
+
var Metafield = import_zod.z.object({
|
|
989
|
+
key: import_zod.z.string(),
|
|
990
|
+
namespace: import_zod.z.string(),
|
|
991
|
+
type: import_zod.z.string(),
|
|
992
|
+
value: import_zod.z.string()
|
|
993
|
+
});
|
|
994
|
+
var Image = import_zod.z.object({
|
|
995
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
996
|
+
alt: import_zod.z.string().nullable(),
|
|
1001
997
|
createdAt: zDatetime.optional(),
|
|
1002
|
-
height:
|
|
1003
|
-
id:
|
|
1004
|
-
metafields:
|
|
1005
|
-
position:
|
|
1006
|
-
productId:
|
|
1007
|
-
src:
|
|
998
|
+
height: import_zod.z.number(),
|
|
999
|
+
id: import_zod.z.number(),
|
|
1000
|
+
metafields: import_zod.z.array(Metafield).optional(),
|
|
1001
|
+
position: import_zod.z.number(),
|
|
1002
|
+
productId: import_zod.z.number(),
|
|
1003
|
+
src: import_zod.z.url(),
|
|
1008
1004
|
updatedAt: zDatetime.optional(),
|
|
1009
|
-
variantIds:
|
|
1010
|
-
width:
|
|
1005
|
+
variantIds: import_zod.z.array(import_zod.z.number()),
|
|
1006
|
+
width: import_zod.z.number()
|
|
1011
1007
|
});
|
|
1012
|
-
var Media =
|
|
1013
|
-
adminGraphqlApiId:
|
|
1014
|
-
alt:
|
|
1008
|
+
var Media = import_zod.z.object({
|
|
1009
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
1010
|
+
alt: import_zod.z.string().nullable(),
|
|
1015
1011
|
createdAt: zDatetime,
|
|
1016
|
-
id:
|
|
1017
|
-
mediaContentType:
|
|
1018
|
-
position:
|
|
1019
|
-
previewImage:
|
|
1020
|
-
productId:
|
|
1021
|
-
status:
|
|
1012
|
+
id: import_zod.z.number(),
|
|
1013
|
+
mediaContentType: import_zod.z.string(),
|
|
1014
|
+
position: import_zod.z.number(),
|
|
1015
|
+
previewImage: import_zod.z.object({ height: import_zod.z.number(), src: import_zod.z.url(), status: import_zod.z.string(), width: import_zod.z.number() }),
|
|
1016
|
+
productId: import_zod.z.number(),
|
|
1017
|
+
status: import_zod.z.string(),
|
|
1022
1018
|
updatedAt: zDatetime,
|
|
1023
|
-
variantIds:
|
|
1024
|
-
});
|
|
1025
|
-
var Option =
|
|
1026
|
-
id:
|
|
1027
|
-
name:
|
|
1028
|
-
position:
|
|
1029
|
-
productId:
|
|
1030
|
-
values:
|
|
1031
|
-
});
|
|
1032
|
-
var PriceAdjustment =
|
|
1033
|
-
orderCount:
|
|
1034
|
-
position:
|
|
1035
|
-
value:
|
|
1036
|
-
valueType:
|
|
1037
|
-
});
|
|
1038
|
-
var Ratings =
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1019
|
+
variantIds: import_zod.z.array(import_zod.z.number())
|
|
1020
|
+
});
|
|
1021
|
+
var Option = import_zod.z.object({
|
|
1022
|
+
id: import_zod.z.number(),
|
|
1023
|
+
name: import_zod.z.string(),
|
|
1024
|
+
position: import_zod.z.number(),
|
|
1025
|
+
productId: import_zod.z.number(),
|
|
1026
|
+
values: import_zod.z.array(import_zod.z.string())
|
|
1027
|
+
});
|
|
1028
|
+
var PriceAdjustment = import_zod.z.object({
|
|
1029
|
+
orderCount: import_zod.z.number().optional(),
|
|
1030
|
+
position: import_zod.z.number(),
|
|
1031
|
+
value: import_zod.z.string(),
|
|
1032
|
+
valueType: import_zod.z.string()
|
|
1033
|
+
});
|
|
1034
|
+
var Ratings = import_zod.z.union([
|
|
1035
|
+
import_zod.z.object({ judgemeAverageStarRating: import_zod.z.number(), judgemeTotalReviews: import_zod.z.number() }),
|
|
1036
|
+
import_zod.z.object({ junipAverageStarRating: import_zod.z.number(), junipTotalReviews: import_zod.z.number() }),
|
|
1037
|
+
import_zod.z.object({ klaviyoAverageStarRating: import_zod.z.number(), klaviyoTotalReviews: import_zod.z.number() }),
|
|
1038
|
+
import_zod.z.object({ looxAverageStarRating: import_zod.z.number(), looxTotalReviews: import_zod.z.number() }),
|
|
1039
|
+
import_zod.z.object({ okendoAverageStarRating: import_zod.z.number(), okendoTotalReviews: import_zod.z.number() }),
|
|
1040
|
+
import_zod.z.object({ opinewAverageStarRating: import_zod.z.number(), opinewTotalReviews: import_zod.z.number() }),
|
|
1041
|
+
import_zod.z.object({ reviewsioAverageStarRating: import_zod.z.number(), reviewsioTotalReviews: import_zod.z.number() }),
|
|
1042
|
+
import_zod.z.object({ stampedAverageStarRating: import_zod.z.number(), stampedTotalReviews: import_zod.z.number() }),
|
|
1043
|
+
import_zod.z.object({ yotpoAverageStarRating: import_zod.z.number(), yotpoTotalReviews: import_zod.z.number() })
|
|
1048
1044
|
]);
|
|
1049
|
-
var SellingPlan =
|
|
1050
|
-
description:
|
|
1051
|
-
id:
|
|
1052
|
-
name:
|
|
1053
|
-
options:
|
|
1054
|
-
orderIntervalFrequency:
|
|
1055
|
-
orderIntervalUnitType:
|
|
1056
|
-
position:
|
|
1057
|
-
priceAdjustments:
|
|
1058
|
-
shopifyVariantId:
|
|
1059
|
-
});
|
|
1060
|
-
var SellingPlanAllocation =
|
|
1061
|
-
compareAtPrice:
|
|
1062
|
-
perDeliveryPrice:
|
|
1063
|
-
price:
|
|
1064
|
-
priceAdjustments:
|
|
1065
|
-
sellingPlanGroupId:
|
|
1066
|
-
sellingPlanId:
|
|
1067
|
-
});
|
|
1068
|
-
var SellingPlanGroup =
|
|
1069
|
-
appId:
|
|
1070
|
-
description:
|
|
1071
|
-
discountAmount:
|
|
1072
|
-
discountType:
|
|
1073
|
-
id:
|
|
1074
|
-
name:
|
|
1075
|
-
options:
|
|
1076
|
-
requiresSellingPlan:
|
|
1077
|
-
sellingPlans:
|
|
1078
|
-
variants:
|
|
1079
|
-
});
|
|
1080
|
-
var Variant =
|
|
1081
|
-
adminGraphqlApiId:
|
|
1082
|
-
barcode:
|
|
1083
|
-
compareAtPrice:
|
|
1045
|
+
var SellingPlan = import_zod.z.object({
|
|
1046
|
+
description: import_zod.z.string().optional(),
|
|
1047
|
+
id: import_zod.z.number(),
|
|
1048
|
+
name: import_zod.z.string(),
|
|
1049
|
+
options: import_zod.z.array(import_zod.z.object({ name: import_zod.z.string(), position: import_zod.z.number(), value: import_zod.z.string() })),
|
|
1050
|
+
orderIntervalFrequency: import_zod.z.string().optional(),
|
|
1051
|
+
orderIntervalUnitType: import_zod.z.string().optional(),
|
|
1052
|
+
position: import_zod.z.number().optional(),
|
|
1053
|
+
priceAdjustments: import_zod.z.array(PriceAdjustment),
|
|
1054
|
+
shopifyVariantId: import_zod.z.string().optional()
|
|
1055
|
+
});
|
|
1056
|
+
var SellingPlanAllocation = import_zod.z.object({
|
|
1057
|
+
compareAtPrice: import_zod.z.number(),
|
|
1058
|
+
perDeliveryPrice: import_zod.z.number(),
|
|
1059
|
+
price: import_zod.z.number(),
|
|
1060
|
+
priceAdjustments: import_zod.z.array(PriceAdjustment),
|
|
1061
|
+
sellingPlanGroupId: import_zod.z.string(),
|
|
1062
|
+
sellingPlanId: import_zod.z.number()
|
|
1063
|
+
});
|
|
1064
|
+
var SellingPlanGroup = import_zod.z.object({
|
|
1065
|
+
appId: import_zod.z.string().optional(),
|
|
1066
|
+
description: import_zod.z.string().optional(),
|
|
1067
|
+
discountAmount: import_zod.z.number().optional(),
|
|
1068
|
+
discountType: import_zod.z.string().optional(),
|
|
1069
|
+
id: import_zod.z.string(),
|
|
1070
|
+
name: import_zod.z.string(),
|
|
1071
|
+
options: import_zod.z.array(Option),
|
|
1072
|
+
requiresSellingPlan: import_zod.z.boolean().optional(),
|
|
1073
|
+
sellingPlans: import_zod.z.array(SellingPlan),
|
|
1074
|
+
variants: import_zod.z.array(import_zod.z.number())
|
|
1075
|
+
});
|
|
1076
|
+
var Variant = import_zod.z.object({
|
|
1077
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
1078
|
+
barcode: import_zod.z.string().nullable(),
|
|
1079
|
+
compareAtPrice: import_zod.z.string().nullable(),
|
|
1084
1080
|
createdAt: zDatetime,
|
|
1085
|
-
fulfillmentService:
|
|
1086
|
-
grams:
|
|
1087
|
-
id:
|
|
1088
|
-
imageId:
|
|
1089
|
-
inventoryItemId:
|
|
1090
|
-
inventoryManagement:
|
|
1091
|
-
inventoryPolicy:
|
|
1092
|
-
inventoryQuantity:
|
|
1093
|
-
link:
|
|
1094
|
-
oldInventoryQuantity:
|
|
1095
|
-
option1:
|
|
1096
|
-
option2:
|
|
1097
|
-
option3:
|
|
1098
|
-
position:
|
|
1099
|
-
price:
|
|
1100
|
-
productId:
|
|
1101
|
-
requiresShipping:
|
|
1102
|
-
sellingPlanAllocations:
|
|
1103
|
-
sku:
|
|
1104
|
-
taxable:
|
|
1105
|
-
taxCode:
|
|
1106
|
-
title:
|
|
1081
|
+
fulfillmentService: import_zod.z.string().nullish(),
|
|
1082
|
+
grams: import_zod.z.number(),
|
|
1083
|
+
id: import_zod.z.number(),
|
|
1084
|
+
imageId: import_zod.z.number().nullable(),
|
|
1085
|
+
inventoryItemId: import_zod.z.number().optional(),
|
|
1086
|
+
inventoryManagement: import_zod.z.string().nullable(),
|
|
1087
|
+
inventoryPolicy: import_zod.z.string(),
|
|
1088
|
+
inventoryQuantity: import_zod.z.number(),
|
|
1089
|
+
link: import_zod.z.url(),
|
|
1090
|
+
oldInventoryQuantity: import_zod.z.number().optional(),
|
|
1091
|
+
option1: import_zod.z.string(),
|
|
1092
|
+
option2: import_zod.z.string().nullable(),
|
|
1093
|
+
option3: import_zod.z.string().nullable(),
|
|
1094
|
+
position: import_zod.z.number(),
|
|
1095
|
+
price: import_zod.z.string(),
|
|
1096
|
+
productId: import_zod.z.number(),
|
|
1097
|
+
requiresShipping: import_zod.z.boolean(),
|
|
1098
|
+
sellingPlanAllocations: import_zod.z.array(SellingPlanAllocation).optional(),
|
|
1099
|
+
sku: import_zod.z.string().nullable(),
|
|
1100
|
+
taxable: import_zod.z.boolean(),
|
|
1101
|
+
taxCode: import_zod.z.string().optional(),
|
|
1102
|
+
title: import_zod.z.string(),
|
|
1107
1103
|
updatedAt: zDatetime,
|
|
1108
|
-
weight:
|
|
1109
|
-
weightUnit:
|
|
1104
|
+
weight: import_zod.z.number(),
|
|
1105
|
+
weightUnit: import_zod.z.string().optional()
|
|
1110
1106
|
});
|
|
1111
|
-
var Product =
|
|
1112
|
-
adminGraphqlApiId:
|
|
1113
|
-
bodyHtml:
|
|
1107
|
+
var Product = import_zod.z.object({
|
|
1108
|
+
adminGraphqlApiId: import_zod.z.string(),
|
|
1109
|
+
bodyHtml: import_zod.z.string().nullable(),
|
|
1114
1110
|
cacheInfo: CacheInfo,
|
|
1115
1111
|
category: Category.nullish(),
|
|
1116
|
-
collectionIds:
|
|
1112
|
+
collectionIds: import_zod.z.array(import_zod.z.number()),
|
|
1117
1113
|
createdAt: zDatetime,
|
|
1118
|
-
description:
|
|
1119
|
-
handle:
|
|
1120
|
-
hasVariantsThatRequiresComponents:
|
|
1121
|
-
id:
|
|
1114
|
+
description: import_zod.z.string(),
|
|
1115
|
+
handle: import_zod.z.string(),
|
|
1116
|
+
hasVariantsThatRequiresComponents: import_zod.z.boolean().optional(),
|
|
1117
|
+
id: import_zod.z.number(),
|
|
1122
1118
|
image: Image.nullable(),
|
|
1123
|
-
images:
|
|
1124
|
-
link:
|
|
1125
|
-
media:
|
|
1126
|
-
metafields:
|
|
1127
|
-
options:
|
|
1128
|
-
owner:
|
|
1129
|
-
productType:
|
|
1119
|
+
images: import_zod.z.array(Image).nullable(),
|
|
1120
|
+
link: import_zod.z.url(),
|
|
1121
|
+
media: import_zod.z.array(Media).optional(),
|
|
1122
|
+
metafields: import_zod.z.array(Metafield).optional(),
|
|
1123
|
+
options: import_zod.z.array(Option),
|
|
1124
|
+
owner: import_zod.z.union([import_zod.z.string(), import_zod.z.number()]),
|
|
1125
|
+
productType: import_zod.z.string(),
|
|
1130
1126
|
publishedAt: zDatetime.nullable(),
|
|
1131
|
-
publishedScope:
|
|
1132
|
-
purchaseOptions:
|
|
1127
|
+
publishedScope: import_zod.z.string().optional(),
|
|
1128
|
+
purchaseOptions: import_zod.z.array(import_zod.z.object({ discountOptions: import_zod.z.array(import_zod.z.never()) })).optional(),
|
|
1133
1129
|
ratings: Ratings.optional(),
|
|
1134
|
-
selectedIndexPurchasedOption:
|
|
1130
|
+
selectedIndexPurchasedOption: import_zod.z.number().optional(),
|
|
1135
1131
|
sellingPlanAllocation: SellingPlanAllocation.optional(),
|
|
1136
|
-
sellingPlanGroups:
|
|
1137
|
-
status:
|
|
1138
|
-
tags:
|
|
1139
|
-
templateSuffix:
|
|
1140
|
-
title:
|
|
1132
|
+
sellingPlanGroups: import_zod.z.array(SellingPlanGroup).optional(),
|
|
1133
|
+
status: import_zod.z.string(),
|
|
1134
|
+
tags: import_zod.z.string(),
|
|
1135
|
+
templateSuffix: import_zod.z.string().nullable(),
|
|
1136
|
+
title: import_zod.z.string(),
|
|
1141
1137
|
updatedAt: zDatetime,
|
|
1142
|
-
variantGids:
|
|
1143
|
-
variantIds:
|
|
1144
|
-
variants:
|
|
1145
|
-
vendor:
|
|
1138
|
+
variantGids: import_zod.z.array(import_zod.z.object({ adminGraphqlApiId: import_zod.z.string(), updatedAt: zDatetime })).optional(),
|
|
1139
|
+
variantIds: import_zod.z.array(import_zod.z.object({ id: import_zod.z.number() })).optional(),
|
|
1140
|
+
variants: import_zod.z.array(Variant),
|
|
1141
|
+
vendor: import_zod.z.string()
|
|
1146
1142
|
});
|
|
1147
1143
|
|
|
1148
1144
|
// src/schema/metadata.ts
|
|
1149
|
-
var BaseRule =
|
|
1150
|
-
operator:
|
|
1151
|
-
type:
|
|
1152
|
-
value:
|
|
1145
|
+
var BaseRule = import_zod2.z.object({
|
|
1146
|
+
operator: import_zod2.z.string(),
|
|
1147
|
+
type: import_zod2.z.string(),
|
|
1148
|
+
value: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()])
|
|
1153
1149
|
});
|
|
1154
1150
|
var Rule = BaseRule.extend({
|
|
1155
|
-
conditions:
|
|
1156
|
-
products:
|
|
1157
|
-
|
|
1158
|
-
productId:
|
|
1159
|
-
subRules:
|
|
1160
|
-
variantIds:
|
|
1151
|
+
conditions: import_zod2.z.array(import_zod2.z.object({ type: import_zod2.z.string(), value: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number()]) })).optional(),
|
|
1152
|
+
products: import_zod2.z.array(
|
|
1153
|
+
import_zod2.z.object({
|
|
1154
|
+
productId: import_zod2.z.number(),
|
|
1155
|
+
subRules: import_zod2.z.object({ logic: import_zod2.z.array(import_zod2.z.object({ rules: import_zod2.z.array(BaseRule) })) }).optional(),
|
|
1156
|
+
variantIds: import_zod2.z.array(import_zod2.z.number())
|
|
1161
1157
|
})
|
|
1162
1158
|
).optional()
|
|
1163
1159
|
});
|
|
1164
|
-
var Output =
|
|
1165
|
-
channel:
|
|
1166
|
-
collectionId:
|
|
1167
|
-
collectionSort:
|
|
1168
|
-
collectionSortType:
|
|
1169
|
-
days:
|
|
1170
|
-
discount:
|
|
1171
|
-
endpoint:
|
|
1172
|
-
key:
|
|
1173
|
-
operator:
|
|
1174
|
-
productPrice:
|
|
1175
|
-
products:
|
|
1176
|
-
productWithTagsSort:
|
|
1177
|
-
trendingSort:
|
|
1178
|
-
type:
|
|
1179
|
-
value:
|
|
1180
|
-
});
|
|
1181
|
-
var MatchedRule =
|
|
1182
|
-
collapsed:
|
|
1183
|
-
exitIfMatched:
|
|
1184
|
-
index:
|
|
1185
|
-
logic:
|
|
1186
|
-
output:
|
|
1187
|
-
});
|
|
1188
|
-
var Metadata =
|
|
1160
|
+
var Output = import_zod2.z.object({
|
|
1161
|
+
channel: import_zod2.z.string().optional(),
|
|
1162
|
+
collectionId: import_zod2.z.number().optional(),
|
|
1163
|
+
collectionSort: import_zod2.z.string().optional(),
|
|
1164
|
+
collectionSortType: import_zod2.z.string().nullish(),
|
|
1165
|
+
days: import_zod2.z.string().optional(),
|
|
1166
|
+
discount: import_zod2.z.object({ amount: import_zod2.z.string(), type: import_zod2.z.string() }).optional(),
|
|
1167
|
+
endpoint: import_zod2.z.string().optional(),
|
|
1168
|
+
key: import_zod2.z.string().optional(),
|
|
1169
|
+
operator: import_zod2.z.string().optional(),
|
|
1170
|
+
productPrice: import_zod2.z.object({ amount: import_zod2.z.string(), type: import_zod2.z.string() }).optional(),
|
|
1171
|
+
products: import_zod2.z.array(import_zod2.z.object({ productId: import_zod2.z.number(), variantIds: import_zod2.z.array(import_zod2.z.number()) })).optional(),
|
|
1172
|
+
productWithTagsSort: import_zod2.z.string().optional(),
|
|
1173
|
+
trendingSort: import_zod2.z.string().optional(),
|
|
1174
|
+
type: import_zod2.z.string(),
|
|
1175
|
+
value: import_zod2.z.union([import_zod2.z.string(), import_zod2.z.number(), import_zod2.z.boolean()]).optional()
|
|
1176
|
+
});
|
|
1177
|
+
var MatchedRule = import_zod2.z.object({
|
|
1178
|
+
collapsed: import_zod2.z.boolean().optional(),
|
|
1179
|
+
exitIfMatched: import_zod2.z.boolean(),
|
|
1180
|
+
index: import_zod2.z.number(),
|
|
1181
|
+
logic: import_zod2.z.array(import_zod2.z.object({ rules: import_zod2.z.array(Rule) })),
|
|
1182
|
+
output: import_zod2.z.array(Output)
|
|
1183
|
+
});
|
|
1184
|
+
var Metadata = import_zod2.z.object({
|
|
1189
1185
|
cacheInfo: CacheInfo.optional(),
|
|
1190
|
-
cartItems:
|
|
1191
|
-
errors:
|
|
1192
|
-
filteredInputProducts:
|
|
1193
|
-
filteredOosProducts:
|
|
1194
|
-
globalExcludedProducts:
|
|
1195
|
-
inputProducts:
|
|
1196
|
-
matchedRules:
|
|
1197
|
-
topSellersFilled:
|
|
1198
|
-
unevaluatedRules:
|
|
1199
|
-
unmatchedRules:
|
|
1200
|
-
widget:
|
|
1201
|
-
discount:
|
|
1202
|
-
language:
|
|
1186
|
+
cartItems: import_zod2.z.array(import_zod2.z.never()).optional(),
|
|
1187
|
+
errors: import_zod2.z.array(import_zod2.z.never()).optional(),
|
|
1188
|
+
filteredInputProducts: import_zod2.z.array(import_zod2.z.never()).optional(),
|
|
1189
|
+
filteredOosProducts: import_zod2.z.array(Product).optional(),
|
|
1190
|
+
globalExcludedProducts: import_zod2.z.array(Product).optional(),
|
|
1191
|
+
inputProducts: import_zod2.z.array(import_zod2.z.never()).optional(),
|
|
1192
|
+
matchedRules: import_zod2.z.array(MatchedRule).optional(),
|
|
1193
|
+
topSellersFilled: import_zod2.z.boolean().optional(),
|
|
1194
|
+
unevaluatedRules: import_zod2.z.array(MatchedRule).optional(),
|
|
1195
|
+
unmatchedRules: import_zod2.z.array(MatchedRule).optional(),
|
|
1196
|
+
widget: import_zod2.z.object({
|
|
1197
|
+
discount: import_zod2.z.object({ amount: import_zod2.z.string(), type: import_zod2.z.string() }).optional(),
|
|
1198
|
+
language: import_zod2.z.record(import_zod2.z.string(), import_zod2.z.string()).optional()
|
|
1203
1199
|
}).optional()
|
|
1204
1200
|
});
|
|
1205
1201
|
|
|
1206
1202
|
// src/schema/shopConfig.ts
|
|
1207
|
-
var
|
|
1208
|
-
var ShopConfig =
|
|
1209
|
-
activeExperiments:
|
|
1210
|
-
|
|
1211
|
-
data:
|
|
1212
|
-
|
|
1213
|
-
aliasName:
|
|
1214
|
-
cssInput:
|
|
1215
|
-
elementId:
|
|
1216
|
-
id:
|
|
1217
|
-
javascriptInput:
|
|
1218
|
-
traffic:
|
|
1203
|
+
var import_zod3 = require("zod");
|
|
1204
|
+
var ShopConfig = import_zod3.z.object({
|
|
1205
|
+
activeExperiments: import_zod3.z.array(
|
|
1206
|
+
import_zod3.z.object({
|
|
1207
|
+
data: import_zod3.z.array(
|
|
1208
|
+
import_zod3.z.object({
|
|
1209
|
+
aliasName: import_zod3.z.string(),
|
|
1210
|
+
cssInput: import_zod3.z.string().nullish(),
|
|
1211
|
+
elementId: import_zod3.z.coerce.number(),
|
|
1212
|
+
id: import_zod3.z.coerce.number(),
|
|
1213
|
+
javascriptInput: import_zod3.z.string().nullish(),
|
|
1214
|
+
traffic: import_zod3.z.coerce.number()
|
|
1219
1215
|
})
|
|
1220
1216
|
),
|
|
1221
|
-
id:
|
|
1222
|
-
name:
|
|
1223
|
-
pageTarget:
|
|
1224
|
-
pageTargetUrl:
|
|
1225
|
-
placeholderId:
|
|
1226
|
-
type:
|
|
1217
|
+
id: import_zod3.z.coerce.number(),
|
|
1218
|
+
name: import_zod3.z.string(),
|
|
1219
|
+
pageTarget: import_zod3.z.string().nullable(),
|
|
1220
|
+
pageTargetUrl: import_zod3.z.string().nullable(),
|
|
1221
|
+
placeholderId: import_zod3.z.coerce.number().nullable(),
|
|
1222
|
+
type: import_zod3.z.string()
|
|
1227
1223
|
})
|
|
1228
1224
|
),
|
|
1229
|
-
activePackages:
|
|
1230
|
-
|
|
1231
|
-
cancelledAt:
|
|
1232
|
-
id:
|
|
1233
|
-
installedAt:
|
|
1234
|
-
isActive:
|
|
1235
|
-
isBillable:
|
|
1236
|
-
packageId:
|
|
1237
|
-
packageName:
|
|
1238
|
-
shortName:
|
|
1239
|
-
trialDays:
|
|
1240
|
-
uninstalledAt:
|
|
1225
|
+
activePackages: import_zod3.z.array(
|
|
1226
|
+
import_zod3.z.object({
|
|
1227
|
+
cancelledAt: import_zod3.z.string().nullable(),
|
|
1228
|
+
id: import_zod3.z.number(),
|
|
1229
|
+
installedAt: import_zod3.z.string().nullable(),
|
|
1230
|
+
isActive: import_zod3.z.boolean(),
|
|
1231
|
+
isBillable: import_zod3.z.boolean(),
|
|
1232
|
+
packageId: import_zod3.z.number(),
|
|
1233
|
+
packageName: import_zod3.z.string(),
|
|
1234
|
+
shortName: import_zod3.z.string(),
|
|
1235
|
+
trialDays: import_zod3.z.number(),
|
|
1236
|
+
uninstalledAt: import_zod3.z.string().nullable()
|
|
1241
1237
|
})
|
|
1242
1238
|
),
|
|
1243
|
-
apiKey:
|
|
1244
|
-
billingVersion:
|
|
1245
|
-
cacheKey:
|
|
1246
|
-
carousel:
|
|
1247
|
-
currency:
|
|
1248
|
-
currencySymbol:
|
|
1249
|
-
domain:
|
|
1250
|
-
enabledJquery:
|
|
1251
|
-
enabledPresentmentCurrencies:
|
|
1252
|
-
hasSmartCollectionsEnabled:
|
|
1253
|
-
hasSmartSearchEnabled:
|
|
1254
|
-
id:
|
|
1255
|
-
integrations:
|
|
1256
|
-
|
|
1239
|
+
apiKey: import_zod3.z.string(),
|
|
1240
|
+
billingVersion: import_zod3.z.string().nullable(),
|
|
1241
|
+
cacheKey: import_zod3.z.coerce.number(),
|
|
1242
|
+
carousel: import_zod3.z.enum(["flickity", "splide"]),
|
|
1243
|
+
currency: import_zod3.z.string(),
|
|
1244
|
+
currencySymbol: import_zod3.z.string(),
|
|
1245
|
+
domain: import_zod3.z.string(),
|
|
1246
|
+
enabledJquery: import_zod3.z.boolean(),
|
|
1247
|
+
enabledPresentmentCurrencies: import_zod3.z.array(import_zod3.z.string()),
|
|
1248
|
+
hasSmartCollectionsEnabled: import_zod3.z.boolean(),
|
|
1249
|
+
hasSmartSearchEnabled: import_zod3.z.boolean(),
|
|
1250
|
+
id: import_zod3.z.coerce.number(),
|
|
1251
|
+
integrations: import_zod3.z.record(
|
|
1252
|
+
import_zod3.z.enum([
|
|
1257
1253
|
"attentive",
|
|
1258
1254
|
"judgeme",
|
|
1259
1255
|
"junip",
|
|
@@ -1266,92 +1262,42 @@ var ShopConfig = import_v43.z.object({
|
|
|
1266
1262
|
"stamped",
|
|
1267
1263
|
"yotpo"
|
|
1268
1264
|
]),
|
|
1269
|
-
|
|
1265
|
+
import_zod3.z.union([import_zod3.z.boolean(), import_zod3.z.unknown()])
|
|
1270
1266
|
),
|
|
1271
|
-
markets:
|
|
1272
|
-
enabled:
|
|
1267
|
+
markets: import_zod3.z.object({
|
|
1268
|
+
enabled: import_zod3.z.boolean()
|
|
1273
1269
|
}),
|
|
1274
|
-
monetize:
|
|
1275
|
-
publisherKey:
|
|
1270
|
+
monetize: import_zod3.z.object({
|
|
1271
|
+
publisherKey: import_zod3.z.string().nullable()
|
|
1276
1272
|
}).nullish(),
|
|
1277
|
-
moneyFormat:
|
|
1278
|
-
myshopifyDomain:
|
|
1279
|
-
primaryLocale:
|
|
1280
|
-
productGroupsEnabled:
|
|
1281
|
-
rechargeCustomDomain:
|
|
1282
|
-
sellingPlansEnabled:
|
|
1283
|
-
shopId:
|
|
1284
|
-
shopifySellingPlansEnabled:
|
|
1285
|
-
shopName:
|
|
1286
|
-
storefrontAccessToken:
|
|
1287
|
-
useRebuyIcons:
|
|
1273
|
+
moneyFormat: import_zod3.z.string(),
|
|
1274
|
+
myshopifyDomain: import_zod3.z.string(),
|
|
1275
|
+
primaryLocale: import_zod3.z.string(),
|
|
1276
|
+
productGroupsEnabled: import_zod3.z.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
1277
|
+
rechargeCustomDomain: import_zod3.z.string().nullable(),
|
|
1278
|
+
sellingPlansEnabled: import_zod3.z.boolean(),
|
|
1279
|
+
shopId: import_zod3.z.number(),
|
|
1280
|
+
shopifySellingPlansEnabled: import_zod3.z.boolean(),
|
|
1281
|
+
shopName: import_zod3.z.string(),
|
|
1282
|
+
storefrontAccessToken: import_zod3.z.string().nullable(),
|
|
1283
|
+
useRebuyIcons: import_zod3.z.boolean()
|
|
1288
1284
|
});
|
|
1289
1285
|
|
|
1290
1286
|
// src/schema/userConfig.ts
|
|
1291
|
-
var
|
|
1292
|
-
|
|
1293
|
-
// src/schema/smartCart.ts
|
|
1294
|
-
var import_v44 = require("zod/v4");
|
|
1295
|
-
var SmartCartTierProduct = import_v44.z.looseObject({
|
|
1296
|
-
handle: import_v44.z.string().optional(),
|
|
1297
|
-
id: import_v44.z.coerce.number().optional(),
|
|
1298
|
-
productId: import_v44.z.coerce.number().optional(),
|
|
1299
|
-
title: import_v44.z.string().optional(),
|
|
1300
|
-
variantIds: import_v44.z.array(import_v44.z.coerce.number()).optional()
|
|
1301
|
-
});
|
|
1302
|
-
var SmartCartTier = import_v44.z.looseObject({
|
|
1303
|
-
allProducts: import_v44.z.array(SmartCartTierProduct).optional(),
|
|
1304
|
-
/** Merchant-set tier label (e.g. "Free gift", "$100 reward"), shown above the bar when enabled. */
|
|
1305
|
-
customTierLabel: import_v44.z.boolean().optional(),
|
|
1306
|
-
customTierLabelText: import_v44.z.string().optional(),
|
|
1307
|
-
filterOosVariants: import_v44.z.boolean().optional(),
|
|
1308
|
-
id: import_v44.z.string().optional(),
|
|
1309
|
-
minimum: import_v44.z.coerce.number().optional(),
|
|
1310
|
-
presentmentCurrencies: import_v44.z.looseObject({ enabled: import_v44.z.boolean().optional() }).optional(),
|
|
1311
|
-
products: import_v44.z.array(SmartCartTierProduct).optional(),
|
|
1312
|
-
type: import_v44.z.string().optional()
|
|
1313
|
-
});
|
|
1314
|
-
var SmartCartBar = import_v44.z.looseObject({
|
|
1315
|
-
countryCodes: import_v44.z.array(import_v44.z.string()).optional(),
|
|
1316
|
-
/** Products excluded from the progress subtotal; the client subtracts their variants' cart cost. */
|
|
1317
|
-
excludedProducts: import_v44.z.array(import_v44.z.looseObject({ variantIds: import_v44.z.array(import_v44.z.coerce.number()).optional() })).optional(),
|
|
1318
|
-
freeShippingOnSubscription: import_v44.z.boolean().optional(),
|
|
1319
|
-
geolocationEnabled: import_v44.z.boolean().optional(),
|
|
1320
|
-
id: import_v44.z.string().optional(),
|
|
1321
|
-
language: import_v44.z.looseObject({
|
|
1322
|
-
freeShippingReached: import_v44.z.string().optional(),
|
|
1323
|
-
freeShippingRemaining: import_v44.z.string().optional(),
|
|
1324
|
-
giftAreaTitle: import_v44.z.string().optional()
|
|
1325
|
-
}).optional(),
|
|
1326
|
-
name: import_v44.z.string().optional(),
|
|
1327
|
-
tiers: import_v44.z.array(SmartCartTier).optional()
|
|
1328
|
-
});
|
|
1329
|
-
var SmartCartComponent = import_v44.z.looseObject({
|
|
1330
|
-
settings: import_v44.z.looseObject({ bars: import_v44.z.array(SmartCartBar).optional() }).optional(),
|
|
1331
|
-
type: import_v44.z.string().optional()
|
|
1332
|
-
});
|
|
1333
|
-
var SmartCartConfig = import_v44.z.looseObject({
|
|
1334
|
-
components: import_v44.z.array(SmartCartComponent).optional()
|
|
1335
|
-
});
|
|
1336
|
-
|
|
1337
|
-
// src/schema/userConfig.ts
|
|
1338
|
-
var UserConfig = import_v45.z.object({
|
|
1287
|
+
var import_zod4 = require("zod");
|
|
1288
|
+
var UserConfig = import_zod4.z.object({
|
|
1339
1289
|
shop: ShopConfig,
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
* which resolves the apiKey for every offers/monetize/analytics/gift request.
|
|
1343
|
-
*/
|
|
1344
|
-
smartCart: SmartCartConfig.nullish().catch(void 0),
|
|
1345
|
-
smartFlows: import_v45.z.array(import_v45.z.unknown())
|
|
1290
|
+
smartCart: import_zod4.z.unknown(),
|
|
1291
|
+
smartFlows: import_zod4.z.array(import_zod4.z.unknown())
|
|
1346
1292
|
});
|
|
1347
1293
|
|
|
1348
1294
|
// src/schema/widgetData.ts
|
|
1349
|
-
var
|
|
1295
|
+
var import_zod33 = require("zod");
|
|
1350
1296
|
|
|
1351
1297
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1352
|
-
var
|
|
1353
|
-
var ABTestingPlaceholder =
|
|
1354
|
-
type:
|
|
1298
|
+
var import_zod5 = require("zod");
|
|
1299
|
+
var ABTestingPlaceholder = import_zod5.z.looseObject({
|
|
1300
|
+
type: import_zod5.z.literal("placeholder")
|
|
1355
1301
|
});
|
|
1356
1302
|
|
|
1357
1303
|
// src/schema/widgets/checkout-and-beyond/constants.ts
|
|
@@ -1398,7 +1344,6 @@ var buttonFields = [
|
|
|
1398
1344
|
"payNow",
|
|
1399
1345
|
"progressReached",
|
|
1400
1346
|
"progressRemaining",
|
|
1401
|
-
"redirectToCheckout",
|
|
1402
1347
|
"removeFromOrder",
|
|
1403
1348
|
"showVariant",
|
|
1404
1349
|
"showVariants",
|
|
@@ -1587,23 +1532,23 @@ var widgetTypes = [
|
|
|
1587
1532
|
var WidgetType = freezeEnum(widgetTypes);
|
|
1588
1533
|
|
|
1589
1534
|
// src/schema/widgets/checkoutExtension.ts
|
|
1590
|
-
var
|
|
1591
|
-
var CheckoutExtension =
|
|
1592
|
-
type:
|
|
1535
|
+
var import_zod6 = require("zod");
|
|
1536
|
+
var CheckoutExtension = import_zod6.z.looseObject({
|
|
1537
|
+
type: import_zod6.z.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
|
|
1593
1538
|
});
|
|
1594
1539
|
|
|
1595
1540
|
// src/schema/widgets/contentBlock.ts
|
|
1596
|
-
var
|
|
1541
|
+
var import_zod27 = require("zod");
|
|
1597
1542
|
|
|
1598
1543
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1599
|
-
var
|
|
1544
|
+
var import_zod26 = require("zod");
|
|
1600
1545
|
|
|
1601
1546
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1602
|
-
var
|
|
1603
|
-
var
|
|
1547
|
+
var import_uuid13 = require("uuid");
|
|
1548
|
+
var import_zod25 = require("zod");
|
|
1604
1549
|
|
|
1605
1550
|
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1606
|
-
var
|
|
1551
|
+
var import_zod7 = require("zod");
|
|
1607
1552
|
var ruleTypes = [
|
|
1608
1553
|
"cart",
|
|
1609
1554
|
"cart_count",
|
|
@@ -1622,7 +1567,7 @@ var ruleTypes = [
|
|
|
1622
1567
|
"product_type",
|
|
1623
1568
|
"product_vendor"
|
|
1624
1569
|
];
|
|
1625
|
-
var ruleType =
|
|
1570
|
+
var ruleType = import_zod7.z.enum(ruleTypes);
|
|
1626
1571
|
var RuleType = ruleType.enum;
|
|
1627
1572
|
var ruleOperators = [
|
|
1628
1573
|
"after",
|
|
@@ -1637,65 +1582,65 @@ var ruleOperators = [
|
|
|
1637
1582
|
"greater_than",
|
|
1638
1583
|
"less_than"
|
|
1639
1584
|
];
|
|
1640
|
-
var ruleOperator =
|
|
1585
|
+
var ruleOperator = import_zod7.z.enum(ruleOperators);
|
|
1641
1586
|
var RuleOperator = ruleOperator.enum;
|
|
1642
|
-
var RuleCondition =
|
|
1643
|
-
operator:
|
|
1644
|
-
products:
|
|
1645
|
-
type:
|
|
1646
|
-
value:
|
|
1647
|
-
});
|
|
1648
|
-
var RuleLogicBlock =
|
|
1649
|
-
rules:
|
|
1650
|
-
});
|
|
1651
|
-
var CABRule =
|
|
1652
|
-
dataSourceId:
|
|
1653
|
-
enabled:
|
|
1654
|
-
ruleset:
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
exitIfMatched:
|
|
1658
|
-
logic:
|
|
1659
|
-
output:
|
|
1660
|
-
|
|
1661
|
-
key:
|
|
1662
|
-
type:
|
|
1663
|
-
value:
|
|
1587
|
+
var RuleCondition = import_zod7.z.object({
|
|
1588
|
+
operator: import_zod7.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
1589
|
+
products: import_zod7.z.union([import_zod7.z.array(import_zod7.z.unknown()), import_zod7.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1590
|
+
type: import_zod7.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
1591
|
+
value: import_zod7.z.coerce.string().default("")
|
|
1592
|
+
});
|
|
1593
|
+
var RuleLogicBlock = import_zod7.z.object({
|
|
1594
|
+
rules: import_zod7.z.array(RuleCondition).default(() => [])
|
|
1595
|
+
});
|
|
1596
|
+
var CABRule = import_zod7.z.object({
|
|
1597
|
+
dataSourceId: import_zod7.z.number().nullable().default(null),
|
|
1598
|
+
enabled: import_zod7.z.boolean().default(false),
|
|
1599
|
+
ruleset: import_zod7.z.union([
|
|
1600
|
+
import_zod7.z.array(
|
|
1601
|
+
import_zod7.z.object({
|
|
1602
|
+
exitIfMatched: import_zod7.z.boolean().default(true),
|
|
1603
|
+
logic: import_zod7.z.array(RuleLogicBlock).default(() => []),
|
|
1604
|
+
output: import_zod7.z.array(
|
|
1605
|
+
import_zod7.z.object({
|
|
1606
|
+
key: import_zod7.z.string().default("should_show"),
|
|
1607
|
+
type: import_zod7.z.literal("data_json").default("data_json"),
|
|
1608
|
+
value: import_zod7.z.string().default("true")
|
|
1664
1609
|
})
|
|
1665
1610
|
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
1666
1611
|
})
|
|
1667
1612
|
),
|
|
1668
|
-
|
|
1613
|
+
import_zod7.z.strictObject({}).transform(() => [])
|
|
1669
1614
|
]).default(() => [])
|
|
1670
1615
|
});
|
|
1671
1616
|
|
|
1672
1617
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1673
|
-
var
|
|
1618
|
+
var import_zod24 = require("zod");
|
|
1674
1619
|
|
|
1675
1620
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1676
|
-
var
|
|
1677
|
-
var CABBannerSection =
|
|
1621
|
+
var import_zod8 = require("zod");
|
|
1622
|
+
var CABBannerSection = import_zod8.z.lazy(
|
|
1678
1623
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
1679
|
-
buttonField:
|
|
1680
|
-
color:
|
|
1681
|
-
dismissible:
|
|
1682
|
-
sectionType:
|
|
1624
|
+
buttonField: import_zod8.z.enum(buttonFields).optional(),
|
|
1625
|
+
color: import_zod8.z.enum(bannerColors).default("info"),
|
|
1626
|
+
dismissible: import_zod8.z.boolean().default(true),
|
|
1627
|
+
sectionType: import_zod8.z.literal(SectionType.banner).default(SectionType.banner)
|
|
1683
1628
|
})
|
|
1684
1629
|
);
|
|
1685
1630
|
|
|
1686
1631
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1687
1632
|
var import_uuid3 = require("uuid");
|
|
1688
|
-
var
|
|
1633
|
+
var import_zod11 = require("zod");
|
|
1689
1634
|
|
|
1690
1635
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1691
1636
|
var import_uuid = require("uuid");
|
|
1692
|
-
var
|
|
1637
|
+
var import_zod9 = require("zod");
|
|
1693
1638
|
|
|
1694
1639
|
// src/schema/widgets/checkout-and-beyond/regex.ts
|
|
1695
1640
|
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
1696
1641
|
var DYNAMIC_TOKEN_REGEX = /^\{\{\s*[A-Za-z]+\s*\}\}$/;
|
|
1697
1642
|
var HEX_COLOR_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
1698
|
-
var HTML_TAGS_REGEX = /<\/?[
|
|
1643
|
+
var HTML_TAGS_REGEX = /<\/?[^>]+>/g;
|
|
1699
1644
|
|
|
1700
1645
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
1701
1646
|
var import_es_toolkit2 = require("es-toolkit");
|
|
@@ -1707,7 +1652,7 @@ var isHTML = (html = "") => {
|
|
|
1707
1652
|
const hasHTML = (nodeList) => Array.from(nodeList).some((node) => node.nodeType === 1);
|
|
1708
1653
|
return hasHTML(doc.body.childNodes) || hasHTML(doc.head.childNodes);
|
|
1709
1654
|
}
|
|
1710
|
-
return
|
|
1655
|
+
return HTML_TAGS_REGEX.test(html);
|
|
1711
1656
|
};
|
|
1712
1657
|
var hasHTMLInDoc = (doc) => doc.content.some(({ content = [] }) => content.some(({ text }) => isHTML(text)));
|
|
1713
1658
|
var checkForHTML = (input) => !((0, import_compat.isString)(input) && isHTML(input) || (0, import_es_toolkit2.isPlainObject)(input) && hasHTMLInDoc(input));
|
|
@@ -1742,90 +1687,90 @@ var convertNumericObjects = (input) => {
|
|
|
1742
1687
|
};
|
|
1743
1688
|
|
|
1744
1689
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1745
|
-
var CABImageSection =
|
|
1746
|
-
altText:
|
|
1747
|
-
aspectRatio:
|
|
1748
|
-
border:
|
|
1749
|
-
buttonField:
|
|
1750
|
-
category:
|
|
1751
|
-
name:
|
|
1752
|
-
naturalHeight:
|
|
1753
|
-
naturalWidth:
|
|
1690
|
+
var CABImageSection = import_zod9.z.object({
|
|
1691
|
+
altText: import_zod9.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
1692
|
+
aspectRatio: import_zod9.z.literal(1).nullable().default(null),
|
|
1693
|
+
border: import_zod9.z.lazy(() => CABBorder),
|
|
1694
|
+
buttonField: import_zod9.z.enum(buttonFields).optional(),
|
|
1695
|
+
category: import_zod9.z.enum(["gallery", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
1696
|
+
name: import_zod9.z.string().optional(),
|
|
1697
|
+
naturalHeight: import_zod9.z.number().default(0),
|
|
1698
|
+
naturalWidth: import_zod9.z.number().default(0),
|
|
1754
1699
|
/**
|
|
1755
1700
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
1756
1701
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
1757
1702
|
*/
|
|
1758
|
-
objectFit:
|
|
1703
|
+
objectFit: import_zod9.z.enum(objectFits).default(ObjectFit.contain),
|
|
1759
1704
|
rule: CABRule.optional(),
|
|
1760
|
-
sectionId:
|
|
1761
|
-
sectionType:
|
|
1762
|
-
source:
|
|
1763
|
-
width:
|
|
1705
|
+
sectionId: import_zod9.z.uuid().default(() => (0, import_uuid.v7)()),
|
|
1706
|
+
sectionType: import_zod9.z.literal(SectionType.image).default(SectionType.image),
|
|
1707
|
+
source: import_zod9.z.union([import_zod9.z.url(), import_zod9.z.literal(""), import_zod9.z.string().regex(DYNAMIC_TOKEN_REGEX)]).default(""),
|
|
1708
|
+
width: import_zod9.z.number().default(100)
|
|
1764
1709
|
});
|
|
1765
1710
|
|
|
1766
1711
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
1767
1712
|
var import_compat2 = require("es-toolkit/compat");
|
|
1768
1713
|
var import_uuid2 = require("uuid");
|
|
1769
|
-
var
|
|
1770
|
-
var enumOrOmit = (...vals) =>
|
|
1771
|
-
var TiptapText =
|
|
1772
|
-
marks:
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
attrs:
|
|
1779
|
-
class:
|
|
1780
|
-
href:
|
|
1781
|
-
rel:
|
|
1782
|
-
target:
|
|
1714
|
+
var import_zod10 = require("zod");
|
|
1715
|
+
var enumOrOmit = (...vals) => import_zod10.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
1716
|
+
var TiptapText = import_zod10.z.object({
|
|
1717
|
+
marks: import_zod10.z.union([
|
|
1718
|
+
import_zod10.z.array(
|
|
1719
|
+
import_zod10.z.discriminatedUnion("type", [
|
|
1720
|
+
import_zod10.z.object({ type: import_zod10.z.literal("bold") }),
|
|
1721
|
+
import_zod10.z.object({ type: import_zod10.z.literal("italic") }),
|
|
1722
|
+
import_zod10.z.object({
|
|
1723
|
+
attrs: import_zod10.z.object({
|
|
1724
|
+
class: import_zod10.z.string().nullable(),
|
|
1725
|
+
href: import_zod10.z.union([import_zod10.z.url(), import_zod10.z.literal("#"), import_zod10.z.string().regex(DYNAMIC_TOKEN_REGEX)]),
|
|
1726
|
+
rel: import_zod10.z.string().default("noopener noreferrer nofollow"),
|
|
1727
|
+
target: import_zod10.z.string().default("_blank")
|
|
1783
1728
|
}),
|
|
1784
|
-
type:
|
|
1729
|
+
type: import_zod10.z.literal("link")
|
|
1785
1730
|
}),
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
attrs:
|
|
1731
|
+
import_zod10.z.object({ type: import_zod10.z.literal("strike") }),
|
|
1732
|
+
import_zod10.z.object({
|
|
1733
|
+
attrs: import_zod10.z.object({
|
|
1789
1734
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
1790
1735
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
1791
1736
|
}),
|
|
1792
|
-
type:
|
|
1737
|
+
type: import_zod10.z.literal("textStyle")
|
|
1793
1738
|
})
|
|
1794
1739
|
])
|
|
1795
1740
|
),
|
|
1796
|
-
|
|
1741
|
+
import_zod10.z.strictObject({}).transform(() => [])
|
|
1797
1742
|
]).optional(),
|
|
1798
|
-
text:
|
|
1799
|
-
type:
|
|
1743
|
+
text: import_zod10.z.string().default(""),
|
|
1744
|
+
type: import_zod10.z.literal("text").default("text")
|
|
1800
1745
|
});
|
|
1801
|
-
var TiptapParagraph =
|
|
1802
|
-
attrs:
|
|
1746
|
+
var TiptapParagraph = import_zod10.z.object({
|
|
1747
|
+
attrs: import_zod10.z.object({
|
|
1803
1748
|
textAlign: enumOrOmit(...textAlignments)
|
|
1804
1749
|
}).default({ textAlign: TextAlignment.start }),
|
|
1805
|
-
content:
|
|
1806
|
-
type:
|
|
1750
|
+
content: import_zod10.z.union([import_zod10.z.array(TiptapText), import_zod10.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1751
|
+
type: import_zod10.z.literal("paragraph").default("paragraph")
|
|
1807
1752
|
});
|
|
1808
|
-
var TiptapDocument =
|
|
1809
|
-
attrs:
|
|
1753
|
+
var TiptapDocument = import_zod10.z.object({
|
|
1754
|
+
attrs: import_zod10.z.object({
|
|
1810
1755
|
blockSpacing: enumOrOmit(...spacings)
|
|
1811
1756
|
}).default({ blockSpacing: Spacing.base }),
|
|
1812
|
-
content:
|
|
1813
|
-
type:
|
|
1814
|
-
});
|
|
1815
|
-
var
|
|
1816
|
-
threshold:
|
|
1817
|
-
thresholds:
|
|
1818
|
-
tierType:
|
|
1819
|
-
});
|
|
1820
|
-
var CABTextSection =
|
|
1821
|
-
buttonField:
|
|
1822
|
-
content:
|
|
1823
|
-
name:
|
|
1824
|
-
optionId:
|
|
1757
|
+
content: import_zod10.z.union([import_zod10.z.array(TiptapParagraph), import_zod10.z.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
1758
|
+
type: import_zod10.z.literal("doc").default("doc")
|
|
1759
|
+
});
|
|
1760
|
+
var CABProgressTier = import_zod10.z.object({
|
|
1761
|
+
threshold: import_zod10.z.number().int().nonnegative(),
|
|
1762
|
+
thresholds: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.number().int().nonnegative()).default(() => ({})),
|
|
1763
|
+
tierType: import_zod10.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
1764
|
+
});
|
|
1765
|
+
var CABTextSection = import_zod10.z.object({
|
|
1766
|
+
buttonField: import_zod10.z.enum(buttonFields).optional(),
|
|
1767
|
+
content: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.union([import_zod10.z.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
1768
|
+
name: import_zod10.z.string().optional(),
|
|
1769
|
+
optionId: import_zod10.z.number().optional(),
|
|
1825
1770
|
rule: CABRule.optional(),
|
|
1826
|
-
sectionId:
|
|
1827
|
-
sectionType:
|
|
1828
|
-
tier:
|
|
1771
|
+
sectionId: import_zod10.z.uuid().default(() => (0, import_uuid2.v7)()),
|
|
1772
|
+
sectionType: import_zod10.z.literal(SectionType.text).default(SectionType.text),
|
|
1773
|
+
tier: CABProgressTier.optional()
|
|
1829
1774
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
1830
1775
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
1831
1776
|
(0, import_compat2.forEach)(content, (value, lang) => {
|
|
@@ -1846,114 +1791,112 @@ var CABTextSection = import_v411.z.object({
|
|
|
1846
1791
|
});
|
|
1847
1792
|
|
|
1848
1793
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1849
|
-
var CABButtonContent =
|
|
1850
|
-
() =>
|
|
1794
|
+
var CABButtonContent = import_zod11.z.lazy(
|
|
1795
|
+
() => import_zod11.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
1851
1796
|
);
|
|
1852
|
-
var CABButtonSection =
|
|
1853
|
-
action:
|
|
1854
|
-
buttonStyle:
|
|
1855
|
-
custom:
|
|
1856
|
-
color:
|
|
1857
|
-
height:
|
|
1858
|
-
width:
|
|
1797
|
+
var CABButtonSection = import_zod11.z.object({
|
|
1798
|
+
action: import_zod11.z.union([import_zod11.z.literal(""), import_zod11.z.enum(buttonActions)]).default(""),
|
|
1799
|
+
buttonStyle: import_zod11.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
1800
|
+
custom: import_zod11.z.object({
|
|
1801
|
+
color: import_zod11.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
1802
|
+
height: import_zod11.z.number().default(52),
|
|
1803
|
+
width: import_zod11.z.number().default(300)
|
|
1859
1804
|
}).default({
|
|
1860
1805
|
color: "#005bd3",
|
|
1861
1806
|
height: 52,
|
|
1862
1807
|
width: 300
|
|
1863
1808
|
}),
|
|
1864
|
-
disableDowngrade:
|
|
1865
|
-
name:
|
|
1866
|
-
optionId:
|
|
1867
|
-
popover:
|
|
1868
|
-
alignment:
|
|
1869
|
-
position:
|
|
1809
|
+
disableDowngrade: import_zod11.z.boolean().default(false),
|
|
1810
|
+
name: import_zod11.z.string().optional(),
|
|
1811
|
+
optionId: import_zod11.z.number().optional(),
|
|
1812
|
+
popover: import_zod11.z.object({
|
|
1813
|
+
alignment: import_zod11.z.enum(textAlignments).default(TextAlignment.center),
|
|
1814
|
+
position: import_zod11.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
1870
1815
|
}).optional().default(() => ({
|
|
1871
1816
|
alignment: TextAlignment.center,
|
|
1872
1817
|
position: PopoverPosition.blockStart
|
|
1873
1818
|
})),
|
|
1874
1819
|
rule: CABRule.optional(),
|
|
1875
|
-
sectionId:
|
|
1876
|
-
sections:
|
|
1877
|
-
sectionType:
|
|
1820
|
+
sectionId: import_zod11.z.uuid().default(() => (0, import_uuid3.v7)()),
|
|
1821
|
+
sections: import_zod11.z.union([import_zod11.z.array(CABButtonContent), import_zod11.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1822
|
+
sectionType: import_zod11.z.literal(SectionType.button).default(SectionType.button),
|
|
1878
1823
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
1879
|
-
trackingUrl:
|
|
1824
|
+
trackingUrl: import_zod11.z.string().optional()
|
|
1880
1825
|
});
|
|
1881
1826
|
|
|
1882
1827
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
1883
|
-
var
|
|
1828
|
+
var import_zod16 = require("zod");
|
|
1884
1829
|
|
|
1885
1830
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
1886
|
-
var
|
|
1831
|
+
var import_zod15 = require("zod");
|
|
1887
1832
|
|
|
1888
1833
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
1889
1834
|
var import_uuid4 = require("uuid");
|
|
1890
|
-
var
|
|
1891
|
-
var CABDiscount =
|
|
1892
|
-
amount:
|
|
1893
|
-
discountedBy:
|
|
1894
|
-
discountedFrom:
|
|
1895
|
-
type:
|
|
1896
|
-
});
|
|
1897
|
-
var CABIntegrations =
|
|
1898
|
-
judgeme:
|
|
1899
|
-
junip:
|
|
1900
|
-
klaviyo:
|
|
1901
|
-
loox:
|
|
1902
|
-
okendo:
|
|
1903
|
-
opinew:
|
|
1904
|
-
reviewsio:
|
|
1905
|
-
stamped:
|
|
1906
|
-
yotpo:
|
|
1907
|
-
});
|
|
1908
|
-
var CABDataSourceSection =
|
|
1909
|
-
dataSourceId:
|
|
1910
|
-
dataSourcePath:
|
|
1835
|
+
var import_zod12 = require("zod");
|
|
1836
|
+
var CABDiscount = import_zod12.z.object({
|
|
1837
|
+
amount: import_zod12.z.union([import_zod12.z.number(), import_zod12.z.string()]).catch(0),
|
|
1838
|
+
discountedBy: import_zod12.z.string().optional(),
|
|
1839
|
+
discountedFrom: import_zod12.z.enum(discountSources).optional().catch(void 0),
|
|
1840
|
+
type: import_zod12.z.enum(discountTypes).catch("none")
|
|
1841
|
+
});
|
|
1842
|
+
var CABIntegrations = import_zod12.z.object({
|
|
1843
|
+
judgeme: import_zod12.z.boolean().default(false),
|
|
1844
|
+
junip: import_zod12.z.boolean().default(false),
|
|
1845
|
+
klaviyo: import_zod12.z.boolean().default(false),
|
|
1846
|
+
loox: import_zod12.z.boolean().default(false),
|
|
1847
|
+
okendo: import_zod12.z.boolean().default(false),
|
|
1848
|
+
opinew: import_zod12.z.boolean().default(false),
|
|
1849
|
+
reviewsio: import_zod12.z.boolean().default(false),
|
|
1850
|
+
stamped: import_zod12.z.boolean().default(false),
|
|
1851
|
+
yotpo: import_zod12.z.boolean().default(false)
|
|
1852
|
+
});
|
|
1853
|
+
var CABDataSourceSection = import_zod12.z.object({
|
|
1854
|
+
dataSourceId: import_zod12.z.number().nullable().default(null),
|
|
1855
|
+
dataSourcePath: import_zod12.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
1911
1856
|
discount: CABDiscount.optional(),
|
|
1912
1857
|
integrations: CABIntegrations.optional(),
|
|
1913
|
-
limit:
|
|
1914
|
-
matchVariant:
|
|
1915
|
-
matchVariantOutOfStock:
|
|
1916
|
-
name:
|
|
1917
|
-
productType:
|
|
1918
|
-
sectionId:
|
|
1919
|
-
sectionType:
|
|
1920
|
-
|
|
1921
|
-
subscriptionIsDefault: import_v413.z.boolean().default(false),
|
|
1922
|
-
treatAsGwp: import_v413.z.boolean().default(false)
|
|
1858
|
+
limit: import_zod12.z.number().default(1),
|
|
1859
|
+
matchVariant: import_zod12.z.boolean().default(false),
|
|
1860
|
+
matchVariantOutOfStock: import_zod12.z.boolean().default(false),
|
|
1861
|
+
name: import_zod12.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
1862
|
+
productType: import_zod12.z.enum(productTypes).optional(),
|
|
1863
|
+
sectionId: import_zod12.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
1864
|
+
sectionType: import_zod12.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
1865
|
+
treatAsGwp: import_zod12.z.boolean().default(false)
|
|
1923
1866
|
});
|
|
1924
1867
|
|
|
1925
1868
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
1926
1869
|
var import_uuid6 = require("uuid");
|
|
1927
|
-
var
|
|
1870
|
+
var import_zod14 = require("zod");
|
|
1928
1871
|
|
|
1929
1872
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
1930
1873
|
var import_uuid5 = require("uuid");
|
|
1931
|
-
var
|
|
1932
|
-
var CABVariantContent =
|
|
1933
|
-
() =>
|
|
1874
|
+
var import_zod13 = require("zod");
|
|
1875
|
+
var CABVariantContent = import_zod13.z.lazy(
|
|
1876
|
+
() => import_zod13.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
1934
1877
|
);
|
|
1935
|
-
var CABProductSection =
|
|
1936
|
-
name:
|
|
1937
|
-
productId:
|
|
1938
|
-
sectionId:
|
|
1939
|
-
sections:
|
|
1940
|
-
sectionType:
|
|
1941
|
-
selectors:
|
|
1942
|
-
variantMode:
|
|
1878
|
+
var CABProductSection = import_zod13.z.object({
|
|
1879
|
+
name: import_zod13.z.string().optional(),
|
|
1880
|
+
productId: import_zod13.z.number().nullable().default(null),
|
|
1881
|
+
sectionId: import_zod13.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
1882
|
+
sections: import_zod13.z.union([import_zod13.z.array(CABVariantContent), import_zod13.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1883
|
+
sectionType: import_zod13.z.literal(SectionType.product).default(SectionType.product),
|
|
1884
|
+
selectors: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
1885
|
+
variantMode: import_zod13.z.enum(variantModes).default(VariantMode.multiple)
|
|
1943
1886
|
});
|
|
1944
1887
|
|
|
1945
1888
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
1946
|
-
var CABProductsSection =
|
|
1947
|
-
name:
|
|
1948
|
-
sectionId:
|
|
1949
|
-
sections:
|
|
1950
|
-
sectionType:
|
|
1889
|
+
var CABProductsSection = import_zod14.z.object({
|
|
1890
|
+
name: import_zod14.z.string().optional(),
|
|
1891
|
+
sectionId: import_zod14.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
1892
|
+
sections: import_zod14.z.union([import_zod14.z.array(import_zod14.z.lazy(() => CABProductSection)), import_zod14.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1893
|
+
sectionType: import_zod14.z.literal(SectionType.products).default(SectionType.products)
|
|
1951
1894
|
});
|
|
1952
1895
|
|
|
1953
1896
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
1954
|
-
var CABOffersSection =
|
|
1897
|
+
var CABOffersSection = import_zod15.z.lazy(
|
|
1955
1898
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
1956
|
-
sections:
|
|
1899
|
+
sections: import_zod15.z.union([import_zod15.z.array(import_zod15.z.lazy(() => CABSection)), import_zod15.z.strictObject({}).transform(() => [])]).default(() => [
|
|
1957
1900
|
CABBannerSection.parse({
|
|
1958
1901
|
buttonField: "undoAddToOrder",
|
|
1959
1902
|
color: "success",
|
|
@@ -1967,263 +1910,77 @@ var CABOffersSection = import_v416.z.lazy(
|
|
|
1967
1910
|
CABDataSourceSection.parse({}),
|
|
1968
1911
|
CABProductsSection.parse({})
|
|
1969
1912
|
]),
|
|
1970
|
-
sectionType:
|
|
1913
|
+
sectionType: import_zod15.z.literal(SectionType.offers).default(SectionType.offers)
|
|
1971
1914
|
})
|
|
1972
1915
|
);
|
|
1973
1916
|
|
|
1974
1917
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
1975
|
-
var CABCarouselSection =
|
|
1918
|
+
var CABCarouselSection = import_zod16.z.lazy(
|
|
1976
1919
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
1977
|
-
autoAdvanceInterval:
|
|
1978
|
-
itemsAtOnce:
|
|
1979
|
-
sections:
|
|
1980
|
-
sectionType:
|
|
1920
|
+
autoAdvanceInterval: import_zod16.z.number().default(0),
|
|
1921
|
+
itemsAtOnce: import_zod16.z.number().min(1).default(1),
|
|
1922
|
+
sections: import_zod16.z.union([import_zod16.z.array(import_zod16.z.lazy(() => CABSection)), import_zod16.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
1923
|
+
sectionType: import_zod16.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
1981
1924
|
})
|
|
1982
1925
|
);
|
|
1983
1926
|
|
|
1984
1927
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
1985
|
-
var
|
|
1986
|
-
var CABCartLineSection =
|
|
1928
|
+
var import_zod17 = require("zod");
|
|
1929
|
+
var CABCartLineSection = import_zod17.z.lazy(
|
|
1987
1930
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
1988
|
-
sections:
|
|
1989
|
-
sectionType:
|
|
1931
|
+
sections: import_zod17.z.union([import_zod17.z.array(import_zod17.z.lazy(() => CABSection)), import_zod17.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
1932
|
+
sectionType: import_zod17.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
1990
1933
|
})
|
|
1991
1934
|
);
|
|
1992
1935
|
|
|
1993
1936
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
1994
1937
|
var import_uuid7 = require("uuid");
|
|
1995
|
-
var
|
|
1996
|
-
var CABDiscountSection =
|
|
1997
|
-
amount:
|
|
1998
|
-
discountedBy:
|
|
1999
|
-
discountedFrom:
|
|
2000
|
-
message:
|
|
2001
|
-
name:
|
|
2002
|
-
quantity:
|
|
2003
|
-
sectionId:
|
|
2004
|
-
sectionType:
|
|
2005
|
-
type:
|
|
1938
|
+
var import_zod18 = require("zod");
|
|
1939
|
+
var CABDiscountSection = import_zod18.z.object({
|
|
1940
|
+
amount: import_zod18.z.union([import_zod18.z.number(), import_zod18.z.string()]).catch(0),
|
|
1941
|
+
discountedBy: import_zod18.z.string().optional(),
|
|
1942
|
+
discountedFrom: import_zod18.z.enum(discountSources).optional().catch(void 0),
|
|
1943
|
+
message: import_zod18.z.string().optional(),
|
|
1944
|
+
name: import_zod18.z.string().optional(),
|
|
1945
|
+
quantity: import_zod18.z.number().default(1),
|
|
1946
|
+
sectionId: import_zod18.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
1947
|
+
sectionType: import_zod18.z.literal(SectionType.discount).default(SectionType.discount),
|
|
1948
|
+
type: import_zod18.z.enum(discountTypes).catch("none")
|
|
2006
1949
|
});
|
|
2007
1950
|
|
|
2008
1951
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
2009
1952
|
var import_uuid8 = require("uuid");
|
|
2010
|
-
var
|
|
2011
|
-
var CABMonetizeSection =
|
|
2012
|
-
name:
|
|
1953
|
+
var import_zod19 = require("zod");
|
|
1954
|
+
var CABMonetizeSection = import_zod19.z.object({
|
|
1955
|
+
name: import_zod19.z.string().optional(),
|
|
2013
1956
|
rule: CABRule.optional(),
|
|
2014
|
-
sectionId:
|
|
2015
|
-
sectionType:
|
|
1957
|
+
sectionId: import_zod19.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
1958
|
+
sectionType: import_zod19.z.literal(SectionType.monetize).default(SectionType.monetize)
|
|
2016
1959
|
});
|
|
2017
1960
|
|
|
2018
1961
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2019
|
-
var
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
es: "A\xF1adir regalo",
|
|
2030
|
-
fi: "Lis\xE4\xE4 lahja",
|
|
2031
|
-
fr: "Ajouter le cadeau",
|
|
2032
|
-
ga: "Cuir bronntanas leis",
|
|
2033
|
-
he: "\u05D4\u05D5\u05E1\u05E3 \u05DE\u05EA\u05E0\u05D4",
|
|
2034
|
-
hi: "\u0909\u092A\u0939\u093E\u0930 \u091C\u094B\u0921\u093C\u0947\u0902",
|
|
2035
|
-
id: "Tambahkan hadiah",
|
|
2036
|
-
it: "Aggiungi regalo",
|
|
2037
|
-
ja: "\u30AE\u30D5\u30C8\u3092\u8FFD\u52A0",
|
|
2038
|
-
ko: "\uC0AC\uC740\uD488 \uCD94\uAC00",
|
|
2039
|
-
nl: "Cadeau toevoegen",
|
|
2040
|
-
no: "Legg til gave",
|
|
2041
|
-
pl: "Dodaj prezent",
|
|
2042
|
-
pt: "Adicionar presente",
|
|
2043
|
-
ru: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043F\u043E\u0434\u0430\u0440\u043E\u043A",
|
|
2044
|
-
sv: "L\xE4gg till g\xE5va",
|
|
2045
|
-
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E02\u0E2D\u0E07\u0E02\u0E27\u0E31\u0E0D",
|
|
2046
|
-
tr: "Hediye ekle",
|
|
2047
|
-
uk: "\u0414\u043E\u0434\u0430\u0442\u0438 \u043F\u043E\u0434\u0430\u0440\u0443\u043D\u043E\u043A",
|
|
2048
|
-
vi: "Th\xEAm qu\xE0 t\u1EB7ng",
|
|
2049
|
-
zh: "\u6DFB\u52A0\u8D60\u54C1"
|
|
2050
|
-
},
|
|
2051
|
-
remove: {
|
|
2052
|
-
ar: "\u0625\u0632\u0627\u0644\u0629",
|
|
2053
|
-
cs: "Odebrat",
|
|
2054
|
-
da: "Fjern",
|
|
2055
|
-
de: "Entfernen",
|
|
2056
|
-
en: "Remove",
|
|
2057
|
-
es: "Eliminar",
|
|
2058
|
-
fi: "Poista",
|
|
2059
|
-
fr: "Retirer",
|
|
2060
|
-
ga: "Bain",
|
|
2061
|
-
he: "\u05D4\u05E1\u05E8",
|
|
2062
|
-
hi: "\u0939\u091F\u093E\u090F\u0901",
|
|
2063
|
-
id: "Hapus",
|
|
2064
|
-
it: "Rimuovi",
|
|
2065
|
-
ja: "\u524A\u9664",
|
|
2066
|
-
ko: "\uC81C\uAC70",
|
|
2067
|
-
nl: "Verwijderen",
|
|
2068
|
-
no: "Fjern",
|
|
2069
|
-
pl: "Usu\u0144",
|
|
2070
|
-
pt: "Remover",
|
|
2071
|
-
ru: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
|
|
2072
|
-
sv: "Ta bort",
|
|
2073
|
-
th: "\u0E19\u0E33\u0E2D\u0E2D\u0E01",
|
|
2074
|
-
tr: "Kald\u0131r",
|
|
2075
|
-
uk: "\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438",
|
|
2076
|
-
vi: "X\xF3a",
|
|
2077
|
-
zh: "\u79FB\u9664"
|
|
2078
|
-
},
|
|
2079
|
-
selectOptions: {
|
|
2080
|
-
ar: "\u0627\u062E\u062A\u0631 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",
|
|
2081
|
-
cs: "Vyberte mo\u017Enosti",
|
|
2082
|
-
da: "V\xE6lg muligheder",
|
|
2083
|
-
de: "Optionen w\xE4hlen",
|
|
2084
|
-
en: "Select Options",
|
|
2085
|
-
es: "Seleccionar opciones",
|
|
2086
|
-
fi: "Valitse vaihtoehdot",
|
|
2087
|
-
fr: "Choisir les options",
|
|
2088
|
-
ga: "Roghnaigh roghanna",
|
|
2089
|
-
he: "\u05D1\u05D7\u05E8 \u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA",
|
|
2090
|
-
hi: "\u0935\u093F\u0915\u0932\u094D\u092A \u091A\u0941\u0928\u0947\u0902",
|
|
2091
|
-
id: "Pilih opsi",
|
|
2092
|
-
it: "Seleziona le opzioni",
|
|
2093
|
-
ja: "\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u9078\u629E",
|
|
2094
|
-
ko: "\uC635\uC158 \uC120\uD0DD",
|
|
2095
|
-
nl: "Opties kiezen",
|
|
2096
|
-
no: "Velg alternativer",
|
|
2097
|
-
pl: "Wybierz opcje",
|
|
2098
|
-
pt: "Selecionar op\xE7\xF5es",
|
|
2099
|
-
ru: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B",
|
|
2100
|
-
sv: "V\xE4lj alternativ",
|
|
2101
|
-
th: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
2102
|
-
tr: "Se\xE7enekleri se\xE7",
|
|
2103
|
-
uk: "\u0412\u0438\u0431\u0440\u0430\u0442\u0438 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0438",
|
|
2104
|
-
vi: "Ch\u1ECDn t\xF9y ch\u1ECDn",
|
|
2105
|
-
zh: "\u9009\u62E9\u9009\u9879"
|
|
2106
|
-
},
|
|
2107
|
-
yourGift: {
|
|
2108
|
-
ar: "\u0647\u062F\u064A\u062A\u0643",
|
|
2109
|
-
cs: "V\xE1\u0161 d\xE1rek",
|
|
2110
|
-
da: "Din gave",
|
|
2111
|
-
de: "Ihr Geschenk",
|
|
2112
|
-
en: "Your gift",
|
|
2113
|
-
es: "Tu regalo",
|
|
2114
|
-
fi: "Lahjasi",
|
|
2115
|
-
fr: "Votre cadeau",
|
|
2116
|
-
ga: "Do bhronntanas",
|
|
2117
|
-
he: "\u05D4\u05DE\u05EA\u05E0\u05D4 \u05E9\u05DC\u05DA",
|
|
2118
|
-
hi: "\u0906\u092A\u0915\u093E \u0909\u092A\u0939\u093E\u0930",
|
|
2119
|
-
id: "Hadiah Anda",
|
|
2120
|
-
it: "Il tuo regalo",
|
|
2121
|
-
ja: "\u3042\u306A\u305F\u306E\u30AE\u30D5\u30C8",
|
|
2122
|
-
ko: "\uACE0\uAC1D\uB2D8\uC758 \uC0AC\uC740\uD488",
|
|
2123
|
-
nl: "Uw cadeau",
|
|
2124
|
-
no: "Din gave",
|
|
2125
|
-
pl: "Tw\xF3j prezent",
|
|
2126
|
-
pt: "Seu presente",
|
|
2127
|
-
ru: "\u0412\u0430\u0448 \u043F\u043E\u0434\u0430\u0440\u043E\u043A",
|
|
2128
|
-
sv: "Din g\xE5va",
|
|
2129
|
-
th: "\u0E02\u0E2D\u0E07\u0E02\u0E27\u0E31\u0E0D\u0E02\u0E2D\u0E07\u0E04\u0E38\u0E13",
|
|
2130
|
-
tr: "Hediyeniz",
|
|
2131
|
-
uk: "\u0412\u0430\u0448 \u043F\u043E\u0434\u0430\u0440\u0443\u043D\u043E\u043A",
|
|
2132
|
-
vi: "Qu\xE0 c\u1EE7a b\u1EA1n",
|
|
2133
|
-
zh: "\u60A8\u7684\u8D60\u54C1"
|
|
2134
|
-
}
|
|
2135
|
-
};
|
|
2136
|
-
|
|
2137
|
-
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2138
|
-
var CABProgressTier = import_v421.z.object({
|
|
2139
|
-
/**
|
|
2140
|
-
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
2141
|
-
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
2142
|
-
* when the tier is reached (attribution `_tier` = {@link CABProgressTier.tierId}). Absent on shipping
|
|
2143
|
-
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
2144
|
-
* tree is complete.
|
|
2145
|
-
*/
|
|
2146
|
-
gift: import_v421.z.object({
|
|
2147
|
-
productId: import_v421.z.number().int().positive(),
|
|
2148
|
-
title: import_v421.z.string().optional(),
|
|
2149
|
-
variantIds: import_v421.z.array(import_v421.z.number().int().positive()).default(() => [])
|
|
2150
|
-
}).optional(),
|
|
2151
|
-
/**
|
|
2152
|
-
* The tier's goal in the SHOP's base currency, in cents. Always present — the canonical fallback:
|
|
2153
|
-
* when the buyer's presentment currency has no entry in `thresholds`, the client multiplies this by
|
|
2154
|
-
* the live FX rate. (Converter maps the v1 `unlock_price`, e.g. `75` → `7500`.)
|
|
2155
|
-
*/
|
|
2156
|
-
threshold: import_v421.z.number().int().nonnegative(),
|
|
2157
|
-
/**
|
|
2158
|
-
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
2159
|
-
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
2160
|
-
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
2161
|
-
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
2162
|
-
*/
|
|
2163
|
-
thresholds: import_v421.z.record(import_v421.z.string(), import_v421.z.number().int().nonnegative()).default(() => ({})),
|
|
2164
|
-
/**
|
|
2165
|
-
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
2166
|
-
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
2167
|
-
* shipping bar (single unlabeled tier, no gift).
|
|
2168
|
-
*/
|
|
2169
|
-
tierId: import_v421.z.string().optional(),
|
|
2170
|
-
tierType: import_v421.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
1962
|
+
var import_uuid9 = require("uuid");
|
|
1963
|
+
var import_zod20 = require("zod");
|
|
1964
|
+
var CABProgressBarSection = import_zod20.z.object({
|
|
1965
|
+
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
1966
|
+
countryCodes: import_zod20.z.array(import_zod20.z.string()).default(() => []),
|
|
1967
|
+
name: import_zod20.z.string().optional(),
|
|
1968
|
+
rule: CABRule.optional(),
|
|
1969
|
+
sectionId: import_zod20.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
1970
|
+
sections: import_zod20.z.union([import_zod20.z.array(CABTextSection), import_zod20.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1971
|
+
sectionType: import_zod20.z.literal(SectionType.progressBar).default(SectionType.progressBar)
|
|
2171
1972
|
});
|
|
2172
|
-
var CABProgressBarSection = import_v421.z.lazy(
|
|
2173
|
-
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2174
|
-
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
2175
|
-
countryCodes: import_v421.z.array(import_v421.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2176
|
-
/**
|
|
2177
|
-
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
2178
|
-
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
2179
|
-
*/
|
|
2180
|
-
excludeCountryCodes: import_v421.z.array(import_v421.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2181
|
-
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
2182
|
-
excludedVariantIds: import_v421.z.array(import_v421.z.number().int().positive()).default(() => []),
|
|
2183
|
-
/**
|
|
2184
|
-
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
2185
|
-
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
2186
|
-
*/
|
|
2187
|
-
freeShippingOnSubscription: import_v421.z.boolean().default(false),
|
|
2188
|
-
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
2189
|
-
giftLabels: import_v421.z.object({
|
|
2190
|
-
addGift: import_v421.z.record(import_v421.z.string(), import_v421.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
2191
|
-
remove: import_v421.z.record(import_v421.z.string(), import_v421.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
2192
|
-
selectOptions: import_v421.z.record(import_v421.z.string(), import_v421.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
2193
|
-
yourGift: import_v421.z.record(import_v421.z.string(), import_v421.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
2194
|
-
}).default(() => ({
|
|
2195
|
-
addGift: { ...GIFT_LABELS.addGift },
|
|
2196
|
-
remove: { ...GIFT_LABELS.remove },
|
|
2197
|
-
selectOptions: { ...GIFT_LABELS.selectOptions },
|
|
2198
|
-
yourGift: { ...GIFT_LABELS.yourGift }
|
|
2199
|
-
})),
|
|
2200
|
-
/**
|
|
2201
|
-
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
2202
|
-
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
2203
|
-
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
2204
|
-
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
2205
|
-
*/
|
|
2206
|
-
progressColor: import_v421.z.string().optional(),
|
|
2207
|
-
sectionType: import_v421.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
2208
|
-
/**
|
|
2209
|
-
* The bar's milestones, in any order — the renderer sorts by resolved threshold. Drives the fill
|
|
2210
|
-
* (even slot per tier) and, for smart-cart product tiers, the gift add/remove. The visual tier
|
|
2211
|
-
* display lives in `sections` (composable), NOT here.
|
|
2212
|
-
*/
|
|
2213
|
-
tiers: import_v421.z.union([import_v421.z.array(CABProgressTier), import_v421.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
2214
|
-
})
|
|
2215
|
-
);
|
|
2216
1973
|
|
|
2217
1974
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
2218
|
-
var
|
|
2219
|
-
var
|
|
2220
|
-
var CABQuantitySection =
|
|
2221
|
-
errorMessages:
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
max:
|
|
2225
|
-
min:
|
|
2226
|
-
neg:
|
|
1975
|
+
var import_uuid10 = require("uuid");
|
|
1976
|
+
var import_zod21 = require("zod");
|
|
1977
|
+
var CABQuantitySection = import_zod21.z.object({
|
|
1978
|
+
errorMessages: import_zod21.z.record(
|
|
1979
|
+
import_zod21.z.string(),
|
|
1980
|
+
import_zod21.z.object({
|
|
1981
|
+
max: import_zod21.z.string().optional(),
|
|
1982
|
+
min: import_zod21.z.string().optional(),
|
|
1983
|
+
neg: import_zod21.z.string().optional()
|
|
2227
1984
|
})
|
|
2228
1985
|
).default({
|
|
2229
1986
|
en: {
|
|
@@ -2232,124 +1989,53 @@ var CABQuantitySection = import_v422.z.object({
|
|
|
2232
1989
|
neg: "Quantity cannot be negative"
|
|
2233
1990
|
}
|
|
2234
1991
|
}),
|
|
2235
|
-
inputType:
|
|
2236
|
-
max:
|
|
2237
|
-
min:
|
|
2238
|
-
name:
|
|
1992
|
+
inputType: import_zod21.z.enum(quantityInputs).default(QuantityInput.select),
|
|
1993
|
+
max: import_zod21.z.number().min(1).max(100).default(10),
|
|
1994
|
+
min: import_zod21.z.number().min(1).default(1),
|
|
1995
|
+
name: import_zod21.z.string().optional(),
|
|
2239
1996
|
rule: CABRule.optional(),
|
|
2240
|
-
sectionId:
|
|
2241
|
-
sectionType:
|
|
1997
|
+
sectionId: import_zod21.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
1998
|
+
sectionType: import_zod21.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2242
1999
|
});
|
|
2243
2000
|
|
|
2244
2001
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2245
|
-
var
|
|
2246
|
-
var
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
one: {
|
|
2251
|
-
ar: "({{reviewCount}} \u062A\u0642\u064A\u064A\u0645)",
|
|
2252
|
-
cs: "({{reviewCount}} recenze)",
|
|
2253
|
-
da: "({{reviewCount}} anmeldelse)",
|
|
2254
|
-
de: "({{reviewCount}} Bewertung)",
|
|
2255
|
-
en: "({{reviewCount}} review)",
|
|
2256
|
-
es: "({{reviewCount}} rese\xF1a)",
|
|
2257
|
-
fi: "({{reviewCount}} arvostelu)",
|
|
2258
|
-
fr: "({{reviewCount}} avis)",
|
|
2259
|
-
ga: "({{reviewCount}} l\xE9irmheas)",
|
|
2260
|
-
he: "({{reviewCount}} \u05D1\u05D9\u05E7\u05D5\u05E8\u05EA)",
|
|
2261
|
-
hi: "({{reviewCount}} \u0938\u092E\u0940\u0915\u094D\u0937\u093E)",
|
|
2262
|
-
id: "({{reviewCount}} ulasan)",
|
|
2263
|
-
it: "({{reviewCount}} recensione)",
|
|
2264
|
-
ja: "({{reviewCount}}\u4EF6\u306E\u30EC\u30D3\u30E5\u30FC)",
|
|
2265
|
-
ko: "({{reviewCount}}\uAC1C \uB9AC\uBDF0)",
|
|
2266
|
-
nl: "({{reviewCount}} beoordeling)",
|
|
2267
|
-
no: "({{reviewCount}} anmeldelse)",
|
|
2268
|
-
pl: "({{reviewCount}} opinia)",
|
|
2269
|
-
pt: "({{reviewCount}} avalia\xE7\xE3o)",
|
|
2270
|
-
ru: "({{reviewCount}} \u043E\u0442\u0437\u044B\u0432)",
|
|
2271
|
-
sv: "({{reviewCount}} recension)",
|
|
2272
|
-
th: "({{reviewCount}} \u0E23\u0E35\u0E27\u0E34\u0E27)",
|
|
2273
|
-
tr: "({{reviewCount}} de\u011Ferlendirme)",
|
|
2274
|
-
uk: "({{reviewCount}} \u0432\u0456\u0434\u0433\u0443\u043A)",
|
|
2275
|
-
vi: "({{reviewCount}} \u0111\xE1nh gi\xE1)",
|
|
2276
|
-
zh: "({{reviewCount}} \u6761\u8BC4\u4EF7)"
|
|
2277
|
-
},
|
|
2278
|
-
other: {
|
|
2279
|
-
ar: "({{reviewCount}} \u062A\u0642\u064A\u064A\u0645\u0627\u062A)",
|
|
2280
|
-
cs: "({{reviewCount}} recenz\xED)",
|
|
2281
|
-
da: "({{reviewCount}} anmeldelser)",
|
|
2282
|
-
de: "({{reviewCount}} Bewertungen)",
|
|
2283
|
-
en: "({{reviewCount}} reviews)",
|
|
2284
|
-
es: "({{reviewCount}} rese\xF1as)",
|
|
2285
|
-
fi: "({{reviewCount}} arvostelua)",
|
|
2286
|
-
fr: "({{reviewCount}} avis)",
|
|
2287
|
-
ga: "({{reviewCount}} l\xE9irmheasanna)",
|
|
2288
|
-
he: "({{reviewCount}} \u05D1\u05D9\u05E7\u05D5\u05E8\u05D5\u05EA)",
|
|
2289
|
-
hi: "({{reviewCount}} \u0938\u092E\u0940\u0915\u094D\u0937\u093E\u090F\u0901)",
|
|
2290
|
-
id: "({{reviewCount}} ulasan)",
|
|
2291
|
-
it: "({{reviewCount}} recensioni)",
|
|
2292
|
-
ja: "({{reviewCount}}\u4EF6\u306E\u30EC\u30D3\u30E5\u30FC)",
|
|
2293
|
-
ko: "({{reviewCount}}\uAC1C \uB9AC\uBDF0)",
|
|
2294
|
-
nl: "({{reviewCount}} beoordelingen)",
|
|
2295
|
-
no: "({{reviewCount}} anmeldelser)",
|
|
2296
|
-
pl: "({{reviewCount}} opinii)",
|
|
2297
|
-
pt: "({{reviewCount}} avalia\xE7\xF5es)",
|
|
2298
|
-
ru: "({{reviewCount}} \u043E\u0442\u0437\u044B\u0432\u043E\u0432)",
|
|
2299
|
-
sv: "({{reviewCount}} recensioner)",
|
|
2300
|
-
th: "({{reviewCount}} \u0E23\u0E35\u0E27\u0E34\u0E27)",
|
|
2301
|
-
tr: "({{reviewCount}} de\u011Ferlendirme)",
|
|
2302
|
-
uk: "({{reviewCount}} \u0432\u0456\u0434\u0433\u0443\u043A\u0456\u0432)",
|
|
2303
|
-
vi: "({{reviewCount}} \u0111\xE1nh gi\xE1)",
|
|
2304
|
-
zh: "({{reviewCount}} \u6761\u8BC4\u4EF7)"
|
|
2305
|
-
}
|
|
2306
|
-
};
|
|
2307
|
-
|
|
2308
|
-
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2309
|
-
var CABReviewsSection = import_v423.z.object({
|
|
2310
|
-
color: import_v423.z.string().default("#fadb14"),
|
|
2311
|
-
/**
|
|
2312
|
-
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
2313
|
-
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
2314
|
-
* or merchant work.
|
|
2315
|
-
*/
|
|
2316
|
-
countLabels: import_v423.z.object({
|
|
2317
|
-
one: import_v423.z.record(import_v423.z.string(), import_v423.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
2318
|
-
other: import_v423.z.record(import_v423.z.string(), import_v423.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
2319
|
-
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
2320
|
-
name: import_v423.z.string().optional(),
|
|
2002
|
+
var import_uuid11 = require("uuid");
|
|
2003
|
+
var import_zod22 = require("zod");
|
|
2004
|
+
var CABReviewsSection = import_zod22.z.object({
|
|
2005
|
+
color: import_zod22.z.string().default("#fadb14"),
|
|
2006
|
+
name: import_zod22.z.string().optional(),
|
|
2321
2007
|
rule: CABRule.optional(),
|
|
2322
|
-
sectionId:
|
|
2323
|
-
sectionType:
|
|
2324
|
-
size:
|
|
2008
|
+
sectionId: import_zod22.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
2009
|
+
sectionType: import_zod22.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
2010
|
+
size: import_zod22.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2325
2011
|
});
|
|
2326
2012
|
|
|
2327
2013
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
2328
2014
|
var import_compat3 = require("es-toolkit/compat");
|
|
2329
|
-
var
|
|
2330
|
-
var
|
|
2331
|
-
var CABVariantsSection =
|
|
2332
|
-
hideOutOfStockVariants:
|
|
2333
|
-
name:
|
|
2015
|
+
var import_uuid12 = require("uuid");
|
|
2016
|
+
var import_zod23 = require("zod");
|
|
2017
|
+
var CABVariantsSection = import_zod23.z.object({
|
|
2018
|
+
hideOutOfStockVariants: import_zod23.z.boolean().default(false),
|
|
2019
|
+
name: import_zod23.z.string().optional(),
|
|
2334
2020
|
rule: CABRule.optional(),
|
|
2335
|
-
sectionId:
|
|
2336
|
-
sectionType:
|
|
2337
|
-
selector:
|
|
2338
|
-
variantMode:
|
|
2021
|
+
sectionId: import_zod23.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
2022
|
+
sectionType: import_zod23.z.literal(SectionType.variants).default(SectionType.variants),
|
|
2023
|
+
selector: import_zod23.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
2024
|
+
variantMode: import_zod23.z.enum(variantModes).default(VariantMode.multiple)
|
|
2339
2025
|
});
|
|
2340
2026
|
|
|
2341
2027
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2342
|
-
var CABBorder =
|
|
2343
|
-
radius:
|
|
2344
|
-
style:
|
|
2345
|
-
width:
|
|
2028
|
+
var CABBorder = import_zod24.z.object({
|
|
2029
|
+
radius: import_zod24.z.enum(borderRadii).default(BorderRadius.base),
|
|
2030
|
+
style: import_zod24.z.enum(borderStyles).default(BorderStyle.none),
|
|
2031
|
+
width: import_zod24.z.enum(borderWidths).default(BorderWidth.base)
|
|
2346
2032
|
}).default({
|
|
2347
2033
|
radius: BorderRadius.base,
|
|
2348
2034
|
style: BorderStyle.none,
|
|
2349
2035
|
width: BorderWidth.base
|
|
2350
2036
|
});
|
|
2351
|
-
var CABSection =
|
|
2352
|
-
() =>
|
|
2037
|
+
var CABSection = import_zod24.z.lazy(
|
|
2038
|
+
() => import_zod24.z.discriminatedUnion("sectionType", [
|
|
2353
2039
|
CABBannerSection,
|
|
2354
2040
|
CABButtonSection,
|
|
2355
2041
|
CABCarouselSection,
|
|
@@ -2371,162 +2057,155 @@ var CABSection = import_v425.z.lazy(
|
|
|
2371
2057
|
);
|
|
2372
2058
|
|
|
2373
2059
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2374
|
-
var GridItem =
|
|
2375
|
-
var CABLayoutSection =
|
|
2376
|
-
alignment:
|
|
2377
|
-
horizontal:
|
|
2378
|
-
vertical:
|
|
2060
|
+
var GridItem = import_zod25.z.union([import_zod25.z.literal("auto"), import_zod25.z.literal("fill"), import_zod25.z.string().regex(/^\d+%$/), import_zod25.z.number()]);
|
|
2061
|
+
var CABLayoutSection = import_zod25.z.object({
|
|
2062
|
+
alignment: import_zod25.z.object({
|
|
2063
|
+
horizontal: import_zod25.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
2064
|
+
vertical: import_zod25.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
2379
2065
|
}).default({
|
|
2380
2066
|
horizontal: HorizontalAlignment.start,
|
|
2381
2067
|
vertical: VerticalAlignment.top
|
|
2382
2068
|
}),
|
|
2383
|
-
border:
|
|
2384
|
-
buttonField:
|
|
2385
|
-
direction:
|
|
2386
|
-
grid:
|
|
2387
|
-
columns:
|
|
2388
|
-
rows:
|
|
2069
|
+
border: import_zod25.z.lazy(() => CABBorder),
|
|
2070
|
+
buttonField: import_zod25.z.enum(buttonFields).optional(),
|
|
2071
|
+
direction: import_zod25.z.enum(directions).default(Direction.rows),
|
|
2072
|
+
grid: import_zod25.z.object({
|
|
2073
|
+
columns: import_zod25.z.union([import_zod25.z.array(GridItem), import_zod25.z.undefined()]).default(() => ["auto"]),
|
|
2074
|
+
rows: import_zod25.z.union([import_zod25.z.array(GridItem), import_zod25.z.undefined()]).default(() => ["auto"])
|
|
2389
2075
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
2390
|
-
name:
|
|
2391
|
-
padding:
|
|
2076
|
+
name: import_zod25.z.string().optional(),
|
|
2077
|
+
padding: import_zod25.z.enum(spacings).default(Spacing.none),
|
|
2392
2078
|
rule: CABRule.optional(),
|
|
2393
|
-
sectionId:
|
|
2394
|
-
sections:
|
|
2395
|
-
sectionType:
|
|
2396
|
-
spacing:
|
|
2079
|
+
sectionId: import_zod25.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
2080
|
+
sections: import_zod25.z.union([import_zod25.z.array(import_zod25.z.lazy(() => CABSection)), import_zod25.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2081
|
+
sectionType: import_zod25.z.literal(SectionType.layout).default(SectionType.layout),
|
|
2082
|
+
spacing: import_zod25.z.enum(spacings).default(Spacing.base),
|
|
2397
2083
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
2398
|
-
viewUrl:
|
|
2399
|
-
width:
|
|
2084
|
+
viewUrl: import_zod25.z.string().optional(),
|
|
2085
|
+
width: import_zod25.z.number().default(100)
|
|
2400
2086
|
});
|
|
2401
2087
|
|
|
2402
2088
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2403
|
-
var TargetArea =
|
|
2404
|
-
fill:
|
|
2405
|
-
flip:
|
|
2406
|
-
icon:
|
|
2407
|
-
label:
|
|
2408
|
-
width:
|
|
2089
|
+
var TargetArea = import_zod26.z.object({
|
|
2090
|
+
fill: import_zod26.z.boolean().optional(),
|
|
2091
|
+
flip: import_zod26.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
2092
|
+
icon: import_zod26.z.string(),
|
|
2093
|
+
label: import_zod26.z.string(),
|
|
2094
|
+
width: import_zod26.z.string()
|
|
2409
2095
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
2410
|
-
var CABTracking =
|
|
2411
|
-
enableAttribution:
|
|
2412
|
-
enableSource:
|
|
2413
|
-
enableWidget:
|
|
2096
|
+
var CABTracking = import_zod26.z.object({
|
|
2097
|
+
enableAttribution: import_zod26.z.boolean().default(true),
|
|
2098
|
+
enableSource: import_zod26.z.boolean().default(true),
|
|
2099
|
+
enableWidget: import_zod26.z.boolean().default(true)
|
|
2414
2100
|
}).default({ enableAttribution: true, enableSource: true, enableWidget: true });
|
|
2415
|
-
var CABExperiment = import_v427.z.object({
|
|
2416
|
-
elementId: import_v427.z.number(),
|
|
2417
|
-
experimentId: import_v427.z.number(),
|
|
2418
|
-
experimentType: import_v427.z.string(),
|
|
2419
|
-
selectedId: import_v427.z.number()
|
|
2420
|
-
});
|
|
2421
2101
|
var CABRootSection = CABLayoutSection.extend({
|
|
2422
|
-
editorMode:
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
storeId: import_v427.z.number().nullable().default(null),
|
|
2102
|
+
editorMode: import_zod26.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
2103
|
+
previewMode: import_zod26.z.boolean().default(false),
|
|
2104
|
+
storeId: import_zod26.z.number().nullable().default(null),
|
|
2426
2105
|
targetArea: TargetArea.nullable(),
|
|
2427
2106
|
tracking: CABTracking,
|
|
2428
|
-
type:
|
|
2429
|
-
version:
|
|
2430
|
-
widgetId:
|
|
2107
|
+
type: import_zod26.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
2108
|
+
version: import_zod26.z.literal(2).default(2),
|
|
2109
|
+
widgetId: import_zod26.z.number().nullable().default(null)
|
|
2431
2110
|
});
|
|
2432
2111
|
|
|
2433
2112
|
// src/schema/widgets/contentBlock.ts
|
|
2434
|
-
var ContentBlockV1 =
|
|
2435
|
-
blockSpacing:
|
|
2436
|
-
imageBlocks:
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
altText:
|
|
2440
|
-
description:
|
|
2441
|
-
id:
|
|
2442
|
-
imagePlacement:
|
|
2443
|
-
imageSize:
|
|
2444
|
-
imageUrl:
|
|
2445
|
-
textAlignment:
|
|
2446
|
-
textSize:
|
|
2113
|
+
var ContentBlockV1 = import_zod27.z.object({
|
|
2114
|
+
blockSpacing: import_zod27.z.enum(spacings).optional(),
|
|
2115
|
+
imageBlocks: import_zod27.z.union([
|
|
2116
|
+
import_zod27.z.array(
|
|
2117
|
+
import_zod27.z.object({
|
|
2118
|
+
altText: import_zod27.z.string().nullable(),
|
|
2119
|
+
description: import_zod27.z.string().nullable(),
|
|
2120
|
+
id: import_zod27.z.uuid(),
|
|
2121
|
+
imagePlacement: import_zod27.z.enum(["top", "right", "bottom", "left"]),
|
|
2122
|
+
imageSize: import_zod27.z.number(),
|
|
2123
|
+
imageUrl: import_zod27.z.url(),
|
|
2124
|
+
textAlignment: import_zod27.z.enum(["left", "center", "right"]),
|
|
2125
|
+
textSize: import_zod27.z.enum(textSizeNames)
|
|
2447
2126
|
})
|
|
2448
2127
|
),
|
|
2449
|
-
|
|
2128
|
+
import_zod27.z.strictObject({}).transform(() => [])
|
|
2450
2129
|
]).optional(),
|
|
2451
|
-
imageLayout:
|
|
2452
|
-
language:
|
|
2453
|
-
description:
|
|
2454
|
-
superTitle:
|
|
2455
|
-
title:
|
|
2130
|
+
imageLayout: import_zod27.z.enum(["row", "column"]).optional(),
|
|
2131
|
+
language: import_zod27.z.object({
|
|
2132
|
+
description: import_zod27.z.string(),
|
|
2133
|
+
superTitle: import_zod27.z.string(),
|
|
2134
|
+
title: import_zod27.z.string()
|
|
2456
2135
|
}),
|
|
2457
|
-
previewMode:
|
|
2458
|
-
type:
|
|
2459
|
-
version:
|
|
2136
|
+
previewMode: import_zod27.z.boolean(),
|
|
2137
|
+
type: import_zod27.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
2138
|
+
version: import_zod27.z.literal(1)
|
|
2460
2139
|
});
|
|
2461
|
-
var ContentBlock =
|
|
2140
|
+
var ContentBlock = import_zod27.z.discriminatedUnion("version", [
|
|
2462
2141
|
ContentBlockV1,
|
|
2463
2142
|
CABRootSection.extend({
|
|
2464
|
-
type:
|
|
2143
|
+
type: import_zod27.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
2465
2144
|
})
|
|
2466
2145
|
]);
|
|
2467
2146
|
|
|
2468
2147
|
// src/schema/widgets/giftWithPurchase.ts
|
|
2469
|
-
var
|
|
2470
|
-
var GiftWithPurchase =
|
|
2471
|
-
type:
|
|
2148
|
+
var import_zod28 = require("zod");
|
|
2149
|
+
var GiftWithPurchase = import_zod28.z.looseObject({
|
|
2150
|
+
type: import_zod28.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
2472
2151
|
});
|
|
2473
2152
|
|
|
2474
2153
|
// src/schema/widgets/lineItemEditor.ts
|
|
2475
|
-
var
|
|
2476
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
2477
|
-
downgradeToOneTimeLabel:
|
|
2154
|
+
var import_zod29 = require("zod");
|
|
2155
|
+
var LineItemEditorSwitchLanguageV1 = import_zod29.z.object({
|
|
2156
|
+
downgradeToOneTimeLabel: import_zod29.z.string().optional(),
|
|
2478
2157
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
2479
|
-
subscriptionOptionLabel:
|
|
2480
|
-
upgradeToSubscriptionLabel:
|
|
2481
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
2158
|
+
subscriptionOptionLabel: import_zod29.z.string().optional(),
|
|
2159
|
+
upgradeToSubscriptionLabel: import_zod29.z.string().optional(),
|
|
2160
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod29.z.string().optional()
|
|
2482
2161
|
});
|
|
2483
|
-
var LineItemEditorV1 =
|
|
2162
|
+
var LineItemEditorV1 = import_zod29.z.object({
|
|
2484
2163
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
2485
|
-
button:
|
|
2486
|
-
previewMode:
|
|
2487
|
-
switchToSubscription:
|
|
2488
|
-
disableDowngrade:
|
|
2164
|
+
button: import_zod29.z.object({ kind: import_zod29.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
2165
|
+
previewMode: import_zod29.z.boolean().optional(),
|
|
2166
|
+
switchToSubscription: import_zod29.z.object({
|
|
2167
|
+
disableDowngrade: import_zod29.z.boolean().optional(),
|
|
2489
2168
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
2490
2169
|
}).optional(),
|
|
2491
|
-
switchToSubscriptionEnabled:
|
|
2492
|
-
tracking:
|
|
2493
|
-
enableAttribution:
|
|
2494
|
-
enableSource:
|
|
2495
|
-
enableWidget:
|
|
2170
|
+
switchToSubscriptionEnabled: import_zod29.z.boolean().optional(),
|
|
2171
|
+
tracking: import_zod29.z.object({
|
|
2172
|
+
enableAttribution: import_zod29.z.boolean().optional(),
|
|
2173
|
+
enableSource: import_zod29.z.boolean().optional(),
|
|
2174
|
+
enableWidget: import_zod29.z.boolean().optional()
|
|
2496
2175
|
}).optional(),
|
|
2497
|
-
type:
|
|
2498
|
-
version:
|
|
2176
|
+
type: import_zod29.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
2177
|
+
version: import_zod29.z.literal(1)
|
|
2499
2178
|
});
|
|
2500
|
-
var LineItemEditor =
|
|
2179
|
+
var LineItemEditor = import_zod29.z.discriminatedUnion("version", [
|
|
2501
2180
|
LineItemEditorV1,
|
|
2502
2181
|
CABRootSection.extend({
|
|
2503
|
-
type:
|
|
2182
|
+
type: import_zod29.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
2504
2183
|
})
|
|
2505
2184
|
]);
|
|
2506
2185
|
|
|
2507
2186
|
// src/schema/widgets/progressBar.ts
|
|
2508
|
-
var
|
|
2509
|
-
var ProgressBar =
|
|
2510
|
-
type:
|
|
2187
|
+
var import_zod30 = require("zod");
|
|
2188
|
+
var ProgressBar = import_zod30.z.looseObject({
|
|
2189
|
+
type: import_zod30.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
2511
2190
|
});
|
|
2512
2191
|
|
|
2513
2192
|
// src/schema/widgets/rebuyButton.ts
|
|
2514
|
-
var
|
|
2515
|
-
var RebuyButtonV1 =
|
|
2516
|
-
type:
|
|
2517
|
-
version:
|
|
2193
|
+
var import_zod31 = require("zod");
|
|
2194
|
+
var RebuyButtonV1 = import_zod31.z.looseObject({
|
|
2195
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
2196
|
+
version: import_zod31.z.literal(1)
|
|
2518
2197
|
});
|
|
2519
|
-
var RebuyButton =
|
|
2198
|
+
var RebuyButton = import_zod31.z.discriminatedUnion("version", [
|
|
2520
2199
|
RebuyButtonV1,
|
|
2521
2200
|
CABRootSection.extend({
|
|
2522
|
-
type:
|
|
2201
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
2523
2202
|
})
|
|
2524
2203
|
]);
|
|
2525
2204
|
|
|
2526
2205
|
// src/schema/widgets/rebuyMonetize.ts
|
|
2527
|
-
var
|
|
2528
|
-
var RebuyMonetize =
|
|
2529
|
-
type:
|
|
2206
|
+
var import_zod32 = require("zod");
|
|
2207
|
+
var RebuyMonetize = import_zod32.z.looseObject({
|
|
2208
|
+
type: import_zod32.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
2530
2209
|
});
|
|
2531
2210
|
|
|
2532
2211
|
// src/schema/widgetData.ts
|
|
@@ -2540,7 +2219,7 @@ var extensionWidgetTypes = [
|
|
|
2540
2219
|
WidgetType.ui_extension_line_item_editor,
|
|
2541
2220
|
WidgetType.ui_extension_progress_bar
|
|
2542
2221
|
];
|
|
2543
|
-
var WidgetData =
|
|
2222
|
+
var WidgetData = import_zod33.z.discriminatedUnion("type", [
|
|
2544
2223
|
ABTestingPlaceholder,
|
|
2545
2224
|
CheckoutExtension,
|
|
2546
2225
|
ContentBlock,
|
|
@@ -2553,6 +2232,34 @@ var WidgetData = import_v434.z.discriminatedUnion("type", [
|
|
|
2553
2232
|
|
|
2554
2233
|
// src/schema/widgets/checkout-and-beyond/offerLabels.ts
|
|
2555
2234
|
var OFFER_LABELS = {
|
|
2235
|
+
addToCart: {
|
|
2236
|
+
ar: "\u0623\u0636\u0641 \u0625\u0644\u0649 \u0627\u0644\u0633\u0644\u0629",
|
|
2237
|
+
cs: "P\u0159idat do ko\u0161\xEDku",
|
|
2238
|
+
da: "L\xE6g i kurv",
|
|
2239
|
+
de: "In den Warenkorb",
|
|
2240
|
+
en: "Add to cart",
|
|
2241
|
+
es: "A\xF1adir al carrito",
|
|
2242
|
+
fi: "Lis\xE4\xE4 ostoskoriin",
|
|
2243
|
+
fr: "Ajouter au panier",
|
|
2244
|
+
ga: "Cuir sa chairt",
|
|
2245
|
+
he: "\u05D4\u05D5\u05E1\u05E3 \u05DC\u05E2\u05D2\u05DC\u05D4",
|
|
2246
|
+
hi: "\u0915\u093E\u0930\u094D\u091F \u092E\u0947\u0902 \u091C\u094B\u0921\u093C\u0947\u0902",
|
|
2247
|
+
id: "Tambahkan ke keranjang",
|
|
2248
|
+
it: "Aggiungi al carrello",
|
|
2249
|
+
ja: "\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0",
|
|
2250
|
+
ko: "\uC7A5\uBC14\uAD6C\uB2C8\uC5D0 \uCD94\uAC00",
|
|
2251
|
+
nl: "In winkelwagen",
|
|
2252
|
+
no: "Legg i handlekurven",
|
|
2253
|
+
pl: "Dodaj do koszyka",
|
|
2254
|
+
pt: "Adicionar ao carrinho",
|
|
2255
|
+
ru: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443",
|
|
2256
|
+
sv: "L\xE4gg i varukorgen",
|
|
2257
|
+
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E15\u0E30\u0E01\u0E23\u0E49\u0E32",
|
|
2258
|
+
tr: "Sepete ekle",
|
|
2259
|
+
uk: "\u0414\u043E\u0434\u0430\u0442\u0438 \u0432 \u043A\u043E\u0448\u0438\u043A",
|
|
2260
|
+
vi: "Th\xEAm v\xE0o gi\u1ECF h\xE0ng",
|
|
2261
|
+
zh: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
2262
|
+
},
|
|
2556
2263
|
addedToCart: {
|
|
2557
2264
|
ar: "\u062A\u0645\u062A \u0627\u0644\u0625\u0636\u0627\u0641\u0629!",
|
|
2558
2265
|
cs: "P\u0159id\xE1no!",
|
|
@@ -2586,7 +2293,7 @@ var OFFER_LABELS = {
|
|
|
2586
2293
|
cs: "{{quantity}} {{productTitle}} p\u0159id\xE1no do ko\u0161\xEDku.",
|
|
2587
2294
|
da: "{{quantity}} {{productTitle}} lagt i kurven.",
|
|
2588
2295
|
de: "{{quantity}} {{productTitle}} zum Warenkorb hinzugef\xFCgt.",
|
|
2589
|
-
en: "{{quantity}} {{productTitle}}
|
|
2296
|
+
en: "{{quantity}} {{productTitle}} added to cart.",
|
|
2590
2297
|
es: "{{quantity}} {{productTitle}} a\xF1adido al carrito.",
|
|
2591
2298
|
fi: "{{quantity}} {{productTitle}} lis\xE4tty ostoskoriin.",
|
|
2592
2299
|
fr: "{{quantity}} {{productTitle}} ajout\xE9 au panier.",
|
|
@@ -2637,62 +2344,6 @@ var OFFER_LABELS = {
|
|
|
2637
2344
|
vi: "\u0110ang th\xEAm...",
|
|
2638
2345
|
zh: "\u6B63\u5728\u6DFB\u52A0..."
|
|
2639
2346
|
},
|
|
2640
|
-
addToCart: {
|
|
2641
|
-
ar: "\u0623\u0636\u0641 \u0625\u0644\u0649 \u0627\u0644\u0633\u0644\u0629",
|
|
2642
|
-
cs: "P\u0159idat do ko\u0161\xEDku",
|
|
2643
|
-
da: "L\xE6g i kurv",
|
|
2644
|
-
de: "In den Warenkorb",
|
|
2645
|
-
en: "Add to cart",
|
|
2646
|
-
es: "A\xF1adir al carrito",
|
|
2647
|
-
fi: "Lis\xE4\xE4 ostoskoriin",
|
|
2648
|
-
fr: "Ajouter au panier",
|
|
2649
|
-
ga: "Cuir sa chairt",
|
|
2650
|
-
he: "\u05D4\u05D5\u05E1\u05E3 \u05DC\u05E2\u05D2\u05DC\u05D4",
|
|
2651
|
-
hi: "\u0915\u093E\u0930\u094D\u091F \u092E\u0947\u0902 \u091C\u094B\u0921\u093C\u0947\u0902",
|
|
2652
|
-
id: "Tambahkan ke keranjang",
|
|
2653
|
-
it: "Aggiungi al carrello",
|
|
2654
|
-
ja: "\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0",
|
|
2655
|
-
ko: "\uC7A5\uBC14\uAD6C\uB2C8\uC5D0 \uCD94\uAC00",
|
|
2656
|
-
nl: "In winkelwagen",
|
|
2657
|
-
no: "Legg i handlekurven",
|
|
2658
|
-
pl: "Dodaj do koszyka",
|
|
2659
|
-
pt: "Adicionar ao carrinho",
|
|
2660
|
-
ru: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443",
|
|
2661
|
-
sv: "L\xE4gg i varukorgen",
|
|
2662
|
-
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E15\u0E30\u0E01\u0E23\u0E49\u0E32",
|
|
2663
|
-
tr: "Sepete ekle",
|
|
2664
|
-
uk: "\u0414\u043E\u0434\u0430\u0442\u0438 \u0432 \u043A\u043E\u0448\u0438\u043A",
|
|
2665
|
-
vi: "Th\xEAm v\xE0o gi\u1ECF h\xE0ng",
|
|
2666
|
-
zh: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
2667
|
-
},
|
|
2668
|
-
redirectToCheckout: {
|
|
2669
|
-
ar: "\u0627\u0644\u062F\u0641\u0639",
|
|
2670
|
-
cs: "Pokladna",
|
|
2671
|
-
da: "Til kassen",
|
|
2672
|
-
de: "Zur Kasse",
|
|
2673
|
-
en: "Checkout",
|
|
2674
|
-
es: "Finalizar compra",
|
|
2675
|
-
fi: "Kassalle",
|
|
2676
|
-
fr: "Paiement",
|
|
2677
|
-
ga: "Seice\xE1il amach",
|
|
2678
|
-
he: "\u05DC\u05EA\u05E9\u05DC\u05D5\u05DD",
|
|
2679
|
-
hi: "\u091A\u0947\u0915\u0906\u0909\u091F",
|
|
2680
|
-
id: "Checkout",
|
|
2681
|
-
it: "Cassa",
|
|
2682
|
-
ja: "\u30C1\u30A7\u30C3\u30AF\u30A2\u30A6\u30C8",
|
|
2683
|
-
ko: "\uACB0\uC81C\uD558\uAE30",
|
|
2684
|
-
nl: "Afrekenen",
|
|
2685
|
-
no: "Til kassen",
|
|
2686
|
-
pl: "Do kasy",
|
|
2687
|
-
pt: "Finalizar compra",
|
|
2688
|
-
ru: "\u041E\u0444\u043E\u0440\u043C\u0438\u0442\u044C \u0437\u0430\u043A\u0430\u0437",
|
|
2689
|
-
sv: "Till kassan",
|
|
2690
|
-
th: "\u0E0A\u0E33\u0E23\u0E30\u0E40\u0E07\u0E34\u0E19",
|
|
2691
|
-
tr: "\xD6deme",
|
|
2692
|
-
uk: "\u041E\u0444\u043E\u0440\u043C\u0438\u0442\u0438 \u0437\u0430\u043C\u043E\u0432\u043B\u0435\u043D\u043D\u044F",
|
|
2693
|
-
vi: "Thanh to\xE1n",
|
|
2694
|
-
zh: "\u7ED3\u8D26"
|
|
2695
|
-
},
|
|
2696
2347
|
soldOut: {
|
|
2697
2348
|
ar: "\u0646\u0641\u062F\u062A \u0627\u0644\u0643\u0645\u064A\u0629",
|
|
2698
2349
|
cs: "Vyprod\xE1no",
|
|
@@ -2869,15 +2520,15 @@ var SWITCH_LABELS = {
|
|
|
2869
2520
|
|
|
2870
2521
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
2871
2522
|
var import_compat4 = require("es-toolkit/compat");
|
|
2872
|
-
var
|
|
2873
|
-
var strictNumber =
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2523
|
+
var import_zod34 = require("zod");
|
|
2524
|
+
var strictNumber = import_zod34.z.union([
|
|
2525
|
+
import_zod34.z.number(),
|
|
2526
|
+
import_zod34.z.string().transform((value) => (0, import_compat4.toNumber)((0, import_compat4.replace)((0, import_compat4.toString)(value), /[^0-9.]/g, "")) || 0),
|
|
2527
|
+
import_zod34.z.unknown().transform(() => 0)
|
|
2877
2528
|
]);
|
|
2878
2529
|
|
|
2879
2530
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
2880
|
-
var
|
|
2531
|
+
var import_zod35 = require("zod");
|
|
2881
2532
|
var blockTypes = [
|
|
2882
2533
|
"callout_banner",
|
|
2883
2534
|
"image",
|
|
@@ -2888,144 +2539,144 @@ var blockTypes = [
|
|
|
2888
2539
|
"text",
|
|
2889
2540
|
"timer"
|
|
2890
2541
|
];
|
|
2891
|
-
var blockType =
|
|
2542
|
+
var blockType = import_zod35.z.enum(blockTypes);
|
|
2892
2543
|
var BlockType = blockType.enum;
|
|
2893
2544
|
|
|
2894
2545
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
2895
2546
|
var import_compat5 = require("es-toolkit/compat");
|
|
2896
|
-
var
|
|
2897
|
-
var
|
|
2898
|
-
var TextAlignment2 =
|
|
2899
|
-
var TextSize =
|
|
2900
|
-
|
|
2901
|
-
|
|
2547
|
+
var import_uuid14 = require("uuid");
|
|
2548
|
+
var import_zod36 = require("zod");
|
|
2549
|
+
var TextAlignment2 = import_zod36.z.union([import_zod36.z.enum(["leading", "center", "trailing"]), import_zod36.z.unknown().transform(() => "leading")]);
|
|
2550
|
+
var TextSize = import_zod36.z.union([
|
|
2551
|
+
import_zod36.z.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
2552
|
+
import_zod36.z.unknown().transform(() => "medium")
|
|
2902
2553
|
]);
|
|
2903
|
-
var CalloutBannerBlock =
|
|
2904
|
-
id:
|
|
2905
|
-
name:
|
|
2906
|
-
settings:
|
|
2907
|
-
superTitle:
|
|
2908
|
-
title:
|
|
2554
|
+
var CalloutBannerBlock = import_zod36.z.object({
|
|
2555
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2556
|
+
name: import_zod36.z.string().optional(),
|
|
2557
|
+
settings: import_zod36.z.object({
|
|
2558
|
+
superTitle: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
2559
|
+
title: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
2909
2560
|
}),
|
|
2910
|
-
styles:
|
|
2911
|
-
superTitleEmphasized:
|
|
2561
|
+
styles: import_zod36.z.object({
|
|
2562
|
+
superTitleEmphasized: import_zod36.z.boolean().default(false),
|
|
2912
2563
|
superTitleSize: TextSize.default("large"),
|
|
2913
2564
|
textAlignment: TextAlignment2.default("center"),
|
|
2914
|
-
titleEmphasized:
|
|
2565
|
+
titleEmphasized: import_zod36.z.boolean().default(true),
|
|
2915
2566
|
titleSize: TextSize.default("large")
|
|
2916
2567
|
}),
|
|
2917
|
-
type:
|
|
2568
|
+
type: import_zod36.z.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
2918
2569
|
});
|
|
2919
|
-
var ImageBlock =
|
|
2920
|
-
id:
|
|
2921
|
-
name:
|
|
2922
|
-
settings:
|
|
2923
|
-
|
|
2570
|
+
var ImageBlock = import_zod36.z.object({
|
|
2571
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2572
|
+
name: import_zod36.z.string().optional(),
|
|
2573
|
+
settings: import_zod36.z.union([
|
|
2574
|
+
import_zod36.z.object({
|
|
2924
2575
|
/** This isn't used in the post-purchase offer widget */
|
|
2925
|
-
alt:
|
|
2926
|
-
image:
|
|
2927
|
-
imageSize:
|
|
2928
|
-
imageType:
|
|
2576
|
+
alt: import_zod36.z.string().optional().default(""),
|
|
2577
|
+
image: import_zod36.z.union([import_zod36.z.literal(""), import_zod36.z.url()]).default(""),
|
|
2578
|
+
imageSize: import_zod36.z.number().default(20),
|
|
2579
|
+
imageType: import_zod36.z.enum(["URL", "UPLOAD"]).default("URL")
|
|
2929
2580
|
}),
|
|
2930
|
-
|
|
2581
|
+
import_zod36.z.array(import_zod36.z.never()).transform(() => ({}))
|
|
2931
2582
|
]),
|
|
2932
|
-
type:
|
|
2933
|
-
});
|
|
2934
|
-
var ImageContentBlock =
|
|
2935
|
-
id:
|
|
2936
|
-
name:
|
|
2937
|
-
settings:
|
|
2938
|
-
alt:
|
|
2939
|
-
description:
|
|
2583
|
+
type: import_zod36.z.literal(BlockType.image).default(BlockType.image)
|
|
2584
|
+
});
|
|
2585
|
+
var ImageContentBlock = import_zod36.z.object({
|
|
2586
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2587
|
+
name: import_zod36.z.string().optional(),
|
|
2588
|
+
settings: import_zod36.z.object({
|
|
2589
|
+
alt: import_zod36.z.string().optional().default(""),
|
|
2590
|
+
description: import_zod36.z.union([import_zod36.z.string(), TiptapDocument, import_zod36.z.null()]).default(
|
|
2940
2591
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
2941
2592
|
),
|
|
2942
2593
|
descriptionSize: TextSize.default("medium"),
|
|
2943
2594
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
2944
|
-
image:
|
|
2945
|
-
imagePlacement:
|
|
2946
|
-
imageSize:
|
|
2947
|
-
superTitle:
|
|
2595
|
+
image: import_zod36.z.union([import_zod36.z.literal(""), import_zod36.z.url()]).default(""),
|
|
2596
|
+
imagePlacement: import_zod36.z.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
2597
|
+
imageSize: import_zod36.z.number().default(20),
|
|
2598
|
+
superTitle: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
2948
2599
|
superTitleSize: TextSize.default("medium"),
|
|
2949
2600
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2950
|
-
swapContent:
|
|
2951
|
-
title:
|
|
2601
|
+
swapContent: import_zod36.z.boolean().optional().default(false),
|
|
2602
|
+
title: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
2952
2603
|
titleSize: TextSize.default("medium")
|
|
2953
2604
|
}),
|
|
2954
|
-
type:
|
|
2955
|
-
});
|
|
2956
|
-
var PayButtonBlock =
|
|
2957
|
-
id:
|
|
2958
|
-
name:
|
|
2959
|
-
settings:
|
|
2960
|
-
|
|
2961
|
-
label:
|
|
2605
|
+
type: import_zod36.z.literal(BlockType.image_content).default(BlockType.image_content)
|
|
2606
|
+
});
|
|
2607
|
+
var PayButtonBlock = import_zod36.z.object({
|
|
2608
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2609
|
+
name: import_zod36.z.string().optional(),
|
|
2610
|
+
settings: import_zod36.z.union([
|
|
2611
|
+
import_zod36.z.object({
|
|
2612
|
+
label: import_zod36.z.string().default("Pay Now")
|
|
2962
2613
|
}),
|
|
2963
|
-
|
|
2614
|
+
import_zod36.z.array(import_zod36.z.never()).transform(() => ({
|
|
2964
2615
|
label: "Pay Now"
|
|
2965
2616
|
}))
|
|
2966
2617
|
]),
|
|
2967
|
-
styles:
|
|
2968
|
-
|
|
2969
|
-
buttonWidth:
|
|
2618
|
+
styles: import_zod36.z.union([
|
|
2619
|
+
import_zod36.z.object({
|
|
2620
|
+
buttonWidth: import_zod36.z.number().min(10).max(100).default(50)
|
|
2970
2621
|
}),
|
|
2971
|
-
|
|
2622
|
+
import_zod36.z.array(import_zod36.z.never()).transform(() => ({
|
|
2972
2623
|
buttonWidth: 50
|
|
2973
2624
|
}))
|
|
2974
2625
|
]),
|
|
2975
|
-
type:
|
|
2626
|
+
type: import_zod36.z.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
2976
2627
|
});
|
|
2977
|
-
var ProductInformationBlock =
|
|
2628
|
+
var ProductInformationBlock = import_zod36.z.object({
|
|
2978
2629
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2979
|
-
hideProductImage:
|
|
2980
|
-
id:
|
|
2981
|
-
name:
|
|
2982
|
-
type:
|
|
2983
|
-
});
|
|
2984
|
-
var SeparatorBlock =
|
|
2985
|
-
id:
|
|
2986
|
-
name:
|
|
2987
|
-
type:
|
|
2988
|
-
});
|
|
2989
|
-
var TextBlock =
|
|
2990
|
-
id:
|
|
2991
|
-
name:
|
|
2992
|
-
settings:
|
|
2993
|
-
description:
|
|
2630
|
+
hideProductImage: import_zod36.z.boolean().optional().default(false),
|
|
2631
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2632
|
+
name: import_zod36.z.string().optional(),
|
|
2633
|
+
type: import_zod36.z.literal(BlockType.product_information).default(BlockType.product_information)
|
|
2634
|
+
});
|
|
2635
|
+
var SeparatorBlock = import_zod36.z.object({
|
|
2636
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2637
|
+
name: import_zod36.z.string().optional(),
|
|
2638
|
+
type: import_zod36.z.literal(BlockType.separator).default(BlockType.separator)
|
|
2639
|
+
});
|
|
2640
|
+
var TextBlock = import_zod36.z.object({
|
|
2641
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2642
|
+
name: import_zod36.z.string().optional(),
|
|
2643
|
+
settings: import_zod36.z.object({
|
|
2644
|
+
description: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).optional().default(
|
|
2994
2645
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
2995
2646
|
),
|
|
2996
2647
|
/** This isn't used in the post-purchase offer widget */
|
|
2997
2648
|
descriptionSize: TextSize.default("medium"),
|
|
2998
2649
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
2999
|
-
superTitle:
|
|
2650
|
+
superTitle: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default("Super Title"),
|
|
3000
2651
|
/** This isn't used in the post-purchase offer widget */
|
|
3001
2652
|
superTitleSize: TextSize.default("medium"),
|
|
3002
|
-
title:
|
|
2653
|
+
title: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
3003
2654
|
/** This isn't used in the post-purchase offer widget */
|
|
3004
2655
|
titleSize: TextSize.default("medium")
|
|
3005
2656
|
}),
|
|
3006
|
-
type:
|
|
3007
|
-
});
|
|
3008
|
-
var TimerBlock =
|
|
3009
|
-
id:
|
|
3010
|
-
name:
|
|
3011
|
-
settings:
|
|
3012
|
-
durationMinutes:
|
|
3013
|
-
durationSeconds:
|
|
3014
|
-
endOffer:
|
|
3015
|
-
title:
|
|
2657
|
+
type: import_zod36.z.literal(BlockType.text).default(BlockType.text)
|
|
2658
|
+
});
|
|
2659
|
+
var TimerBlock = import_zod36.z.object({
|
|
2660
|
+
id: import_zod36.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2661
|
+
name: import_zod36.z.string().optional(),
|
|
2662
|
+
settings: import_zod36.z.object({
|
|
2663
|
+
durationMinutes: import_zod36.z.number().min(0).default(10),
|
|
2664
|
+
durationSeconds: import_zod36.z.union([import_zod36.z.number().min(0), import_zod36.z.unknown().transform(() => 0)]).default(0),
|
|
2665
|
+
endOffer: import_zod36.z.boolean().default(true),
|
|
2666
|
+
title: import_zod36.z.union([import_zod36.z.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
3016
2667
|
}),
|
|
3017
|
-
styles:
|
|
2668
|
+
styles: import_zod36.z.object({
|
|
3018
2669
|
textAlignment: TextAlignment2.default("center"),
|
|
3019
|
-
timerBackgroundColor:
|
|
3020
|
-
timerEmphasized:
|
|
2670
|
+
timerBackgroundColor: import_zod36.z.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
2671
|
+
timerEmphasized: import_zod36.z.union([import_zod36.z.boolean(), import_zod36.z.unknown().transform(() => true)]).default(true),
|
|
3021
2672
|
timerSize: TextSize.default("medium"),
|
|
3022
|
-
timerWidth:
|
|
3023
|
-
titleEmphasized:
|
|
2673
|
+
timerWidth: import_zod36.z.number().min(10).max(100).optional().default(100),
|
|
2674
|
+
titleEmphasized: import_zod36.z.union([import_zod36.z.boolean(), import_zod36.z.unknown().transform(() => true)]).default(false),
|
|
3024
2675
|
titleSize: TextSize.default("medium")
|
|
3025
2676
|
}),
|
|
3026
|
-
type:
|
|
2677
|
+
type: import_zod36.z.literal(BlockType.timer).default(BlockType.timer)
|
|
3027
2678
|
});
|
|
3028
|
-
var PostPurchaseBlock =
|
|
2679
|
+
var PostPurchaseBlock = import_zod36.z.discriminatedUnion("type", [
|
|
3029
2680
|
CalloutBannerBlock,
|
|
3030
2681
|
ImageBlock,
|
|
3031
2682
|
ImageContentBlock,
|
|
@@ -3045,68 +2696,68 @@ var isTextBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)
|
|
|
3045
2696
|
var isTimerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.timer);
|
|
3046
2697
|
|
|
3047
2698
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3048
|
-
var
|
|
2699
|
+
var import_zod39 = require("zod");
|
|
3049
2700
|
|
|
3050
2701
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3051
|
-
var
|
|
2702
|
+
var import_zod38 = require("zod");
|
|
3052
2703
|
|
|
3053
2704
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
3054
|
-
var
|
|
3055
|
-
var PostPurchaseSettings =
|
|
3056
|
-
advance:
|
|
3057
|
-
blocks:
|
|
2705
|
+
var import_zod37 = require("zod");
|
|
2706
|
+
var PostPurchaseSettings = import_zod37.z.object({
|
|
2707
|
+
advance: import_zod37.z.object({ removePartialOrder: import_zod37.z.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
2708
|
+
blocks: import_zod37.z.union([import_zod37.z.array(PostPurchaseBlock), import_zod37.z.unknown().transform(() => [])]).default(() => [
|
|
3058
2709
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
3059
2710
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
3060
2711
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
3061
2712
|
]),
|
|
3062
|
-
columnLayout:
|
|
3063
|
-
discount:
|
|
2713
|
+
columnLayout: import_zod37.z.boolean().optional(),
|
|
2714
|
+
discount: import_zod37.z.object({
|
|
3064
2715
|
amount: strictNumber.default(30),
|
|
3065
|
-
shouldShowSavingText:
|
|
3066
|
-
type:
|
|
2716
|
+
shouldShowSavingText: import_zod37.z.boolean().optional().default(true),
|
|
2717
|
+
type: import_zod37.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3067
2718
|
}),
|
|
3068
|
-
discountedFrom:
|
|
3069
|
-
endpoint:
|
|
3070
|
-
integrations:
|
|
3071
|
-
judgeme:
|
|
3072
|
-
junip:
|
|
3073
|
-
klaviyo:
|
|
3074
|
-
loox:
|
|
3075
|
-
okendo:
|
|
3076
|
-
opinew:
|
|
3077
|
-
reviewsio:
|
|
3078
|
-
stamped:
|
|
3079
|
-
yotpo:
|
|
2719
|
+
discountedFrom: import_zod37.z.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
2720
|
+
endpoint: import_zod37.z.string().optional(),
|
|
2721
|
+
integrations: import_zod37.z.object({
|
|
2722
|
+
judgeme: import_zod37.z.boolean().default(false),
|
|
2723
|
+
junip: import_zod37.z.boolean().optional().default(false),
|
|
2724
|
+
klaviyo: import_zod37.z.boolean().default(false),
|
|
2725
|
+
loox: import_zod37.z.boolean().default(false),
|
|
2726
|
+
okendo: import_zod37.z.boolean().default(false),
|
|
2727
|
+
opinew: import_zod37.z.boolean().optional().default(false),
|
|
2728
|
+
reviewsio: import_zod37.z.boolean().optional().default(false),
|
|
2729
|
+
stamped: import_zod37.z.boolean().default(false),
|
|
2730
|
+
yotpo: import_zod37.z.boolean().default(false)
|
|
3080
2731
|
}),
|
|
3081
|
-
key:
|
|
3082
|
-
language:
|
|
3083
|
-
description:
|
|
3084
|
-
descriptionEnabled:
|
|
3085
|
-
descriptionRte:
|
|
3086
|
-
content:
|
|
3087
|
-
type:
|
|
2732
|
+
key: import_zod37.z.string().optional(),
|
|
2733
|
+
language: import_zod37.z.object({
|
|
2734
|
+
description: import_zod37.z.union([import_zod37.z.string(), import_zod37.z.unknown().transform(() => "")]).default(""),
|
|
2735
|
+
descriptionEnabled: import_zod37.z.boolean().optional().default(false),
|
|
2736
|
+
descriptionRte: import_zod37.z.object({
|
|
2737
|
+
content: import_zod37.z.array(import_zod37.z.unknown()),
|
|
2738
|
+
type: import_zod37.z.string()
|
|
3088
2739
|
}).optional(),
|
|
3089
|
-
descriptionSpacing:
|
|
3090
|
-
displayCtaPrice:
|
|
3091
|
-
global:
|
|
3092
|
-
declineAll:
|
|
3093
|
-
declineThisOffer:
|
|
3094
|
-
free:
|
|
3095
|
-
notAvailable:
|
|
3096
|
-
payNow:
|
|
3097
|
-
payNowUpgradeToSubscription:
|
|
3098
|
-
quantity:
|
|
2740
|
+
descriptionSpacing: import_zod37.z.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
2741
|
+
displayCtaPrice: import_zod37.z.boolean().default(true),
|
|
2742
|
+
global: import_zod37.z.object({
|
|
2743
|
+
declineAll: import_zod37.z.string().optional().default("Decline All"),
|
|
2744
|
+
declineThisOffer: import_zod37.z.string().default("Decline this offer"),
|
|
2745
|
+
free: import_zod37.z.string().optional().default("Free"),
|
|
2746
|
+
notAvailable: import_zod37.z.string().optional().default("Not available"),
|
|
2747
|
+
payNow: import_zod37.z.string().default("Pay Now"),
|
|
2748
|
+
payNowUpgradeToSubscription: import_zod37.z.string().optional().default("Upgrade to Subscription"),
|
|
2749
|
+
quantity: import_zod37.z.string().default("Quantity"),
|
|
3099
2750
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3100
|
-
recurringShipping:
|
|
3101
|
-
recurringSubtotal:
|
|
3102
|
-
reviewsPlural:
|
|
3103
|
-
reviewsSingular:
|
|
3104
|
-
save:
|
|
3105
|
-
shipping:
|
|
3106
|
-
subscriptionOption:
|
|
3107
|
-
subtotal:
|
|
3108
|
-
taxes:
|
|
3109
|
-
total:
|
|
2751
|
+
recurringShipping: import_zod37.z.string().optional().default("Recurring shipping"),
|
|
2752
|
+
recurringSubtotal: import_zod37.z.string().default("Recurring subtotal"),
|
|
2753
|
+
reviewsPlural: import_zod37.z.string().optional().default("Reviews"),
|
|
2754
|
+
reviewsSingular: import_zod37.z.string().optional().default("Review"),
|
|
2755
|
+
save: import_zod37.z.union([import_zod37.z.string(), import_zod37.z.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
2756
|
+
shipping: import_zod37.z.string().default("Shipping"),
|
|
2757
|
+
subscriptionOption: import_zod37.z.string().optional().default("Subscribe and Save"),
|
|
2758
|
+
subtotal: import_zod37.z.string().default("Subtotal"),
|
|
2759
|
+
taxes: import_zod37.z.string().default("Taxes"),
|
|
2760
|
+
total: import_zod37.z.string().default("Total")
|
|
3110
2761
|
}).optional().default(() => ({
|
|
3111
2762
|
declineAll: "Decline All",
|
|
3112
2763
|
declineThisOffer: "Decline this offer",
|
|
@@ -3127,70 +2778,70 @@ var PostPurchaseSettings = import_v438.z.object({
|
|
|
3127
2778
|
taxes: "Taxes",
|
|
3128
2779
|
total: "Total"
|
|
3129
2780
|
})),
|
|
3130
|
-
globalTranslation:
|
|
2781
|
+
globalTranslation: import_zod37.z.string().optional().default("english")
|
|
3131
2782
|
}),
|
|
3132
|
-
metafields:
|
|
2783
|
+
metafields: import_zod37.z.boolean().default(false),
|
|
3133
2784
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3134
|
-
offer:
|
|
3135
|
-
count:
|
|
2785
|
+
offer: import_zod37.z.object({
|
|
2786
|
+
count: import_zod37.z.number().default(1)
|
|
3136
2787
|
}),
|
|
3137
|
-
offersLayout:
|
|
3138
|
-
itemsPerPage:
|
|
3139
|
-
type:
|
|
2788
|
+
offersLayout: import_zod37.z.object({
|
|
2789
|
+
itemsPerPage: import_zod37.z.number().optional(),
|
|
2790
|
+
type: import_zod37.z.enum(["list", "grid", "carousel"]).default("list")
|
|
3140
2791
|
}).optional().default({
|
|
3141
2792
|
type: "list"
|
|
3142
2793
|
}),
|
|
3143
2794
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3144
|
-
previewMode:
|
|
3145
|
-
productLimit:
|
|
3146
|
-
productOptions:
|
|
2795
|
+
previewMode: import_zod37.z.boolean().default(false),
|
|
2796
|
+
productLimit: import_zod37.z.number().optional().default(1),
|
|
2797
|
+
productOptions: import_zod37.z.object({
|
|
3147
2798
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3148
|
-
hideOutOfStockVariants:
|
|
3149
|
-
matchVariant:
|
|
3150
|
-
showDeclineAll:
|
|
3151
|
-
showShipping:
|
|
3152
|
-
showSubtotal:
|
|
3153
|
-
showTaxes:
|
|
3154
|
-
showTotal:
|
|
3155
|
-
showVariantSelectors:
|
|
3156
|
-
variantSelectorDisplayMode:
|
|
2799
|
+
hideOutOfStockVariants: import_zod37.z.boolean().optional().default(false),
|
|
2800
|
+
matchVariant: import_zod37.z.boolean().optional().default(true),
|
|
2801
|
+
showDeclineAll: import_zod37.z.enum(["above", "below", "both", "none"]).optional(),
|
|
2802
|
+
showShipping: import_zod37.z.boolean().optional().default(true),
|
|
2803
|
+
showSubtotal: import_zod37.z.boolean().optional().default(true),
|
|
2804
|
+
showTaxes: import_zod37.z.boolean().optional().default(true),
|
|
2805
|
+
showTotal: import_zod37.z.boolean().optional().default(true),
|
|
2806
|
+
showVariantSelectors: import_zod37.z.boolean().optional().default(true),
|
|
2807
|
+
variantSelectorDisplayMode: import_zod37.z.enum(["separate", "single"]).optional().default("separate")
|
|
3157
2808
|
}),
|
|
3158
|
-
productType:
|
|
3159
|
-
productTypeSelector:
|
|
3160
|
-
quantityInputs:
|
|
3161
|
-
defaultQuantity:
|
|
3162
|
-
enabled:
|
|
3163
|
-
maxValue:
|
|
3164
|
-
minValue:
|
|
2809
|
+
productType: import_zod37.z.union([import_zod37.z.enum(["one-time", "subscription", "both"]), import_zod37.z.literal("").transform(() => "one-time")]).default("one-time"),
|
|
2810
|
+
productTypeSelector: import_zod37.z.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
2811
|
+
quantityInputs: import_zod37.z.object({
|
|
2812
|
+
defaultQuantity: import_zod37.z.union([import_zod37.z.number(), import_zod37.z.null().transform(() => 1)]).default(1),
|
|
2813
|
+
enabled: import_zod37.z.boolean().default(true),
|
|
2814
|
+
maxValue: import_zod37.z.union([import_zod37.z.number(), import_zod37.z.null().transform(() => 15)]).default(15),
|
|
2815
|
+
minValue: import_zod37.z.union([import_zod37.z.number().min(0), import_zod37.z.unknown().transform(() => 0)]).default(1)
|
|
3165
2816
|
}),
|
|
3166
|
-
shipping:
|
|
2817
|
+
shipping: import_zod37.z.object({
|
|
3167
2818
|
amount: strictNumber.default(10),
|
|
3168
2819
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3169
|
-
enabled:
|
|
3170
|
-
title:
|
|
3171
|
-
type:
|
|
2820
|
+
enabled: import_zod37.z.boolean().default(true),
|
|
2821
|
+
title: import_zod37.z.string().optional().default("Shipping Fees"),
|
|
2822
|
+
type: import_zod37.z.enum(["free", "fixed_amount"]).default("free")
|
|
3172
2823
|
}),
|
|
3173
|
-
styles:
|
|
3174
|
-
starColor:
|
|
3175
|
-
starSize:
|
|
3176
|
-
starStrokeColor:
|
|
3177
|
-
strokeWidth:
|
|
2824
|
+
styles: import_zod37.z.object({
|
|
2825
|
+
starColor: import_zod37.z.string().optional().default("#fadb14"),
|
|
2826
|
+
starSize: import_zod37.z.union([import_zod37.z.enum(["small", "medium", "large"]), import_zod37.z.unknown().transform(() => "large")]).optional().default("large"),
|
|
2827
|
+
starStrokeColor: import_zod37.z.string().optional().default("#fadb14"),
|
|
2828
|
+
strokeWidth: import_zod37.z.string().optional().default("1")
|
|
3178
2829
|
}).optional(),
|
|
3179
|
-
subImages:
|
|
3180
|
-
subscription:
|
|
3181
|
-
discount:
|
|
2830
|
+
subImages: import_zod37.z.number().nullish().default(8),
|
|
2831
|
+
subscription: import_zod37.z.object({
|
|
2832
|
+
discount: import_zod37.z.object({
|
|
3182
2833
|
amount: strictNumber.default(30),
|
|
3183
|
-
shouldShowSavingText:
|
|
3184
|
-
type:
|
|
2834
|
+
shouldShowSavingText: import_zod37.z.boolean().optional().default(true),
|
|
2835
|
+
type: import_zod37.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3185
2836
|
}),
|
|
3186
|
-
shipping:
|
|
2837
|
+
shipping: import_zod37.z.object({
|
|
3187
2838
|
amount: strictNumber.default(1),
|
|
3188
2839
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3189
|
-
enabled:
|
|
2840
|
+
enabled: import_zod37.z.boolean().default(true),
|
|
3190
2841
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3191
2842
|
recurringAmount: strictNumber.default(2),
|
|
3192
|
-
shippingTitle:
|
|
3193
|
-
type:
|
|
2843
|
+
shippingTitle: import_zod37.z.string().default("Shipping Fees"),
|
|
2844
|
+
type: import_zod37.z.enum(["free", "fixed_amount"]).default("free")
|
|
3194
2845
|
})
|
|
3195
2846
|
}).optional().default({
|
|
3196
2847
|
discount: {
|
|
@@ -3208,15 +2859,15 @@ var PostPurchaseSettings = import_v438.z.object({
|
|
|
3208
2859
|
type: "free"
|
|
3209
2860
|
}
|
|
3210
2861
|
}),
|
|
3211
|
-
subscriptionIsDefault:
|
|
2862
|
+
subscriptionIsDefault: import_zod37.z.boolean().optional(),
|
|
3212
2863
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3213
|
-
template:
|
|
3214
|
-
type:
|
|
3215
|
-
upgradeToSubscription:
|
|
3216
|
-
acceptButtonText:
|
|
3217
|
-
allow:
|
|
3218
|
-
emailRefundNotice:
|
|
3219
|
-
errorBannerText:
|
|
2864
|
+
template: import_zod37.z.string().optional().default(""),
|
|
2865
|
+
type: import_zod37.z.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
2866
|
+
upgradeToSubscription: import_zod37.z.object({
|
|
2867
|
+
acceptButtonText: import_zod37.z.string().optional().default("Upgrade"),
|
|
2868
|
+
allow: import_zod37.z.boolean().optional().default(false),
|
|
2869
|
+
emailRefundNotice: import_zod37.z.boolean().optional().default(false),
|
|
2870
|
+
errorBannerText: import_zod37.z.string().optional().default("This subscription cannot be added - limit one per order")
|
|
3220
2871
|
}).optional().default(() => ({
|
|
3221
2872
|
acceptButtonText: "Upgrade",
|
|
3222
2873
|
allow: false,
|
|
@@ -3226,32 +2877,32 @@ var PostPurchaseSettings = import_v438.z.object({
|
|
|
3226
2877
|
});
|
|
3227
2878
|
|
|
3228
2879
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3229
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
3230
|
-
id:
|
|
3231
|
-
name:
|
|
3232
|
-
});
|
|
3233
|
-
var PostPurchaseWidget =
|
|
3234
|
-
classification:
|
|
3235
|
-
createdAtTime:
|
|
3236
|
-
customEndpointName:
|
|
3237
|
-
id:
|
|
3238
|
-
lastViewed:
|
|
3239
|
-
linkedCustomEndpointId:
|
|
3240
|
-
linkedFlows:
|
|
3241
|
-
name:
|
|
3242
|
-
owner:
|
|
2880
|
+
var PostPurchaseWidgetLinkedFlow = import_zod38.z.object({
|
|
2881
|
+
id: import_zod38.z.number(),
|
|
2882
|
+
name: import_zod38.z.string()
|
|
2883
|
+
});
|
|
2884
|
+
var PostPurchaseWidget = import_zod38.z.object({
|
|
2885
|
+
classification: import_zod38.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
2886
|
+
createdAtTime: import_zod38.z.iso.datetime({ offset: true }).optional(),
|
|
2887
|
+
customEndpointName: import_zod38.z.string().nullish(),
|
|
2888
|
+
id: import_zod38.z.number().default(0),
|
|
2889
|
+
lastViewed: import_zod38.z.iso.datetime({ offset: true }).nullish(),
|
|
2890
|
+
linkedCustomEndpointId: import_zod38.z.number().nullish(),
|
|
2891
|
+
linkedFlows: import_zod38.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
2892
|
+
name: import_zod38.z.string().default(""),
|
|
2893
|
+
owner: import_zod38.z.number().nullish(),
|
|
3243
2894
|
settings: PostPurchaseSettings
|
|
3244
2895
|
});
|
|
3245
2896
|
|
|
3246
2897
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3247
|
-
var PostPurchaseOffer =
|
|
3248
|
-
|
|
3249
|
-
errors:
|
|
3250
|
-
message:
|
|
3251
|
-
successful:
|
|
2898
|
+
var PostPurchaseOffer = import_zod39.z.discriminatedUnion("successful", [
|
|
2899
|
+
import_zod39.z.strictObject({
|
|
2900
|
+
errors: import_zod39.z.array(import_zod39.z.object({ message: import_zod39.z.string() })),
|
|
2901
|
+
message: import_zod39.z.string(),
|
|
2902
|
+
successful: import_zod39.z.literal(false)
|
|
3252
2903
|
}),
|
|
3253
|
-
|
|
3254
|
-
successful:
|
|
2904
|
+
import_zod39.z.strictObject({
|
|
2905
|
+
successful: import_zod39.z.literal(true),
|
|
3255
2906
|
widget: PostPurchaseWidget
|
|
3256
2907
|
})
|
|
3257
2908
|
]);
|
|
@@ -3649,21 +3300,6 @@ var OFFER_TEMPLATE_SEED = {
|
|
|
3649
3300
|
zh: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
3650
3301
|
},
|
|
3651
3302
|
sectionType: "text"
|
|
3652
|
-
},
|
|
3653
|
-
{
|
|
3654
|
-
buttonField: "addedToCart",
|
|
3655
|
-
content: OFFER_LABELS.addedToCart,
|
|
3656
|
-
sectionType: "text"
|
|
3657
|
-
},
|
|
3658
|
-
{
|
|
3659
|
-
buttonField: "soldOut",
|
|
3660
|
-
content: OFFER_LABELS.soldOut,
|
|
3661
|
-
sectionType: "text"
|
|
3662
|
-
},
|
|
3663
|
-
{
|
|
3664
|
-
buttonField: "redirectToCheckout",
|
|
3665
|
-
content: OFFER_LABELS.redirectToCheckout,
|
|
3666
|
-
sectionType: "text"
|
|
3667
3303
|
}
|
|
3668
3304
|
],
|
|
3669
3305
|
sectionType: "button"
|
|
@@ -3762,7 +3398,7 @@ var buildOfferTemplate = ({ location: location2, name } = {}) => CABRootSection.
|
|
|
3762
3398
|
// src/transforms/offerV1/offerCard.ts
|
|
3763
3399
|
var VARIANT_SELECTOR = { button: "button", radio: "radio", select: "menu" };
|
|
3764
3400
|
var localizedContent = (defaults, override) => {
|
|
3765
|
-
const trimmed =
|
|
3401
|
+
const trimmed = override?.trim();
|
|
3766
3402
|
return trimmed ? { ...defaults, en: trimmed } : defaults;
|
|
3767
3403
|
};
|
|
3768
3404
|
var buildStyledText = (token, style, color = "base") => {
|
|
@@ -3830,7 +3466,6 @@ var buildDescription = (settings) => {
|
|
|
3830
3466
|
return [{ content: { en: buildStyledText("{{productDescription}}", void 0) }, sectionType: "text" }];
|
|
3831
3467
|
};
|
|
3832
3468
|
var buildVariants = (settings) => {
|
|
3833
|
-
if (settings.viewOptions?.displayActions === false) return [];
|
|
3834
3469
|
if (settings.productOptions?.showVariantOptions === "never") return [];
|
|
3835
3470
|
const selector = settings.viewOptions?.variantSelector;
|
|
3836
3471
|
return [
|
|
@@ -3857,14 +3492,12 @@ var buildQuantity = (settings) => {
|
|
|
3857
3492
|
const quantity = settings.quantityInputs;
|
|
3858
3493
|
if (!quantity?.enabled) return [];
|
|
3859
3494
|
const inputType = quantity.type ? QUANTITY_INPUT_TYPE[quantity.type] : void 0;
|
|
3860
|
-
const max = Math.min(Math.max(quantity.maxValue ?? 10, 1), 100);
|
|
3861
|
-
const min = Math.min(Math.max(quantity.minValue ?? 1, 1), max);
|
|
3862
3495
|
return [
|
|
3863
3496
|
{
|
|
3864
3497
|
...buildQuantityErrors(quantity),
|
|
3865
3498
|
...inputType && { inputType },
|
|
3866
|
-
max,
|
|
3867
|
-
min,
|
|
3499
|
+
max: quantity.maxValue ?? 10,
|
|
3500
|
+
min: quantity.minValue ?? 1,
|
|
3868
3501
|
sectionType: "quantity"
|
|
3869
3502
|
}
|
|
3870
3503
|
];
|
|
@@ -3906,9 +3539,7 @@ var buildAddButton = (settings) => {
|
|
|
3906
3539
|
slot("addToCart", settings.language?.addToCart),
|
|
3907
3540
|
slot("addingToCart", settings.language?.addingToCart),
|
|
3908
3541
|
slot("addedToCart", settings.language?.addedToCart),
|
|
3909
|
-
slot("soldOut", settings.language?.soldOutLabel)
|
|
3910
|
-
// Off-checkout Buy Now: the label the button shows once it links to the created checkout.
|
|
3911
|
-
slot("redirectToCheckout", settings.language?.redirectToCheckout)
|
|
3542
|
+
slot("soldOut", settings.language?.soldOutLabel)
|
|
3912
3543
|
],
|
|
3913
3544
|
sectionType: "button"
|
|
3914
3545
|
};
|
|
@@ -3990,42 +3621,23 @@ var buildDiscountSection = (discount) => {
|
|
|
3990
3621
|
}
|
|
3991
3622
|
];
|
|
3992
3623
|
};
|
|
3993
|
-
var bannerMessageContent = (message) => {
|
|
3994
|
-
const sanitized = typeof message === "string" ? stripContentBlockHtml(message) : message;
|
|
3995
|
-
return sanitized ? { ...OFFER_LABELS.addedToCartMessage, en: sanitized } : OFFER_LABELS.addedToCartMessage;
|
|
3996
|
-
};
|
|
3997
|
-
var coerceIntegrations = (integrations) => Object.fromEntries(
|
|
3998
|
-
Object.entries(integrations).map(([key, value]) => [
|
|
3999
|
-
key,
|
|
4000
|
-
typeof value === "string" ? ["true", "yes"].includes(value.toLowerCase()) : value
|
|
4001
|
-
])
|
|
4002
|
-
);
|
|
4003
3624
|
var buildBanner = (language) => language?.successBannerEnabled ? [
|
|
4004
3625
|
{
|
|
4005
|
-
/**
|
|
4006
|
-
* The banner-level tag is the extraction/routing key on BOTH renderers (React CAB's
|
|
4007
|
-
* `isBannerType` + marker check; the Preact extension's `isUndoBanner`) — without it
|
|
4008
|
-
* the banner renders per card as an always-visible plain success banner and the
|
|
4009
|
-
* cart-scoped undo rail never runs. The schema's default offers tree carries it too.
|
|
4010
|
-
*/
|
|
4011
|
-
buttonField: "undoAddToOrder",
|
|
4012
3626
|
color: "success",
|
|
4013
3627
|
dismissible: true,
|
|
4014
3628
|
sections: [
|
|
4015
3629
|
{
|
|
4016
|
-
|
|
3630
|
+
/**
|
|
3631
|
+
* A defined v1 message (RTE doc or string) passes through verbatim as `en`;
|
|
3632
|
+
* absent falls back to the localized defaults (P4 language policy).
|
|
3633
|
+
*/
|
|
3634
|
+
content: language.successBannerMessageRte ? { ...OFFER_LABELS.addedToCartMessage, en: language.successBannerMessageRte } : OFFER_LABELS.addedToCartMessage,
|
|
4017
3635
|
sectionType: "text"
|
|
4018
3636
|
},
|
|
4019
3637
|
{
|
|
4020
3638
|
action: "undoAddToOrder",
|
|
4021
3639
|
buttonStyle: "plain",
|
|
4022
|
-
|
|
4023
|
-
* Tagged `undoAddToOrder`, never `buttonLabel` — the renderers (React CAB and
|
|
4024
|
-
* the Preact extension) and the schema's default offers tree resolve that slot.
|
|
4025
|
-
*/
|
|
4026
|
-
sections: [
|
|
4027
|
-
{ buttonField: "undoAddToOrder", content: OFFER_LABELS.undo, sectionType: "text" }
|
|
4028
|
-
],
|
|
3640
|
+
sections: [{ buttonField: "buttonLabel", content: OFFER_LABELS.undo, sectionType: "text" }],
|
|
4029
3641
|
sectionType: "button"
|
|
4030
3642
|
}
|
|
4031
3643
|
],
|
|
@@ -4040,13 +3652,12 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
4040
3652
|
const horizontalCard = direction === "rows";
|
|
4041
3653
|
const dataSource = {
|
|
4042
3654
|
...settings.endpoint && { dataSourcePath: settings.endpoint },
|
|
4043
|
-
...settings.integrations && { integrations:
|
|
3655
|
+
...settings.integrations && { integrations: settings.integrations },
|
|
4044
3656
|
...settings.limit !== void 0 && { limit: settings.limit },
|
|
4045
3657
|
matchVariant: !!settings.productOptions?.matchVariant,
|
|
4046
3658
|
matchVariantOutOfStock: !!settings.productOptions?.matchVariantOutOfStock,
|
|
4047
3659
|
...settings.productType && { productType: settings.productType },
|
|
4048
3660
|
sectionType: "dataSource",
|
|
4049
|
-
...settings.subscriptionIsDefault && { subscriptionIsDefault: true },
|
|
4050
3661
|
...settings.treatAsGwp && { treatAsGwp: true }
|
|
4051
3662
|
};
|
|
4052
3663
|
const offers = {
|
|
@@ -4060,9 +3671,7 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
4060
3671
|
};
|
|
4061
3672
|
const display = {
|
|
4062
3673
|
autoAdvanceInterval: 0,
|
|
4063
|
-
|
|
4064
|
-
// otherwise throw at parse, so floor it at 1 (the carousel still shows a product per page).
|
|
4065
|
-
itemsAtOnce: Math.max(layout?.carousel ? columns : settings.limit ?? columns, 1),
|
|
3674
|
+
itemsAtOnce: layout?.carousel ? columns : settings.limit ?? columns,
|
|
4066
3675
|
...listLayout,
|
|
4067
3676
|
sections: [offers],
|
|
4068
3677
|
sectionType: "carousel"
|