@rebuy/rebuy 2.27.0 → 2.28.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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1352 -366
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +1351 -365
- package/dist/index.mjs.map +4 -4
- package/dist/schema/checkout-and-beyond/constants.js +1 -0
- package/dist/schema/checkout-and-beyond/constants.js.map +2 -2
- package/dist/schema/checkout-and-beyond/constants.mjs +1 -0
- package/dist/schema/checkout-and-beyond/constants.mjs.map +2 -2
- package/dist/schema/checkout-and-beyond/index.js +285 -92
- package/dist/schema/checkout-and-beyond/index.js.map +4 -4
- package/dist/schema/checkout-and-beyond/index.mjs +285 -92
- package/dist/schema/checkout-and-beyond/index.mjs.map +4 -4
- package/dist/schema/widget-data.js +165 -148
- package/dist/schema/widget-data.js.map +4 -4
- package/dist/schema/widget-data.mjs +165 -148
- package/dist/schema/widget-data.mjs.map +4 -4
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +2 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +30 -0
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts.map +1 -0
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +2 -0
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts +178 -0
- package/dist/schema/widgets/checkout-and-beyond/offerLabels.d.ts.map +1 -0
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts +2 -1
- package/dist/schema/widgets/checkout-and-beyond/shared.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/utils.d.ts +2 -0
- package/dist/schema/widgets/checkout-and-beyond/utils.d.ts.map +1 -1
- package/dist/server/dataSourceResults.d.ts +18 -0
- package/dist/server/dataSourceResults.d.ts.map +1 -0
- package/dist/server/index.d.ts +6 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1162 -435
- package/dist/server/index.js.map +4 -4
- package/dist/server/index.mjs +1161 -434
- package/dist/server/index.mjs.map +4 -4
- package/dist/server/userConfig.d.ts +8 -0
- package/dist/server/userConfig.d.ts.map +1 -0
- package/dist/server/widgetSettings.d.ts.map +1 -1
- package/dist/transforms/index.d.ts +4 -0
- package/dist/transforms/index.d.ts.map +1 -1
- package/dist/transforms/index.js +1004 -81
- package/dist/transforms/index.js.map +4 -4
- package/dist/transforms/index.mjs +1004 -81
- package/dist/transforms/index.mjs.map +4 -4
- package/dist/transforms/offerV1/buildOfferTemplate.d.ts +13 -0
- package/dist/transforms/offerV1/buildOfferTemplate.d.ts.map +1 -0
- package/dist/transforms/offerV1/convertOfferToV2.d.ts +18 -0
- package/dist/transforms/offerV1/convertOfferToV2.d.ts.map +1 -0
- package/dist/transforms/offerV1/offerCard.d.ts +17 -0
- package/dist/transforms/offerV1/offerCard.d.ts.map +1 -0
- package/dist/transforms/offerV1/offerTemplateSeed.d.ts +339 -0
- package/dist/transforms/offerV1/offerTemplateSeed.d.ts.map +1 -0
- package/dist/transforms/offerV1/types.d.ts +145 -0
- package/dist/transforms/offerV1/types.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __export(src_exports, {
|
|
|
39
39
|
CABCartLineSection: () => CABCartLineSection,
|
|
40
40
|
CABDataSourceSection: () => CABDataSourceSection,
|
|
41
41
|
CABDiscount: () => CABDiscount,
|
|
42
|
+
CABDiscountSection: () => CABDiscountSection,
|
|
42
43
|
CABImageSection: () => CABImageSection,
|
|
43
44
|
CABIntegrations: () => CABIntegrations,
|
|
44
45
|
CABLayoutSection: () => CABLayoutSection,
|
|
@@ -84,6 +85,7 @@ __export(src_exports, {
|
|
|
84
85
|
LineItemEditorV1: () => LineItemEditorV1,
|
|
85
86
|
Metadata: () => Metadata,
|
|
86
87
|
NO_HTML: () => NO_HTML,
|
|
88
|
+
OFFER_LABELS: () => OFFER_LABELS,
|
|
87
89
|
ObjectFit: () => ObjectFit,
|
|
88
90
|
PayButtonBlock: () => PayButtonBlock,
|
|
89
91
|
PopoverPosition: () => PopoverPosition,
|
|
@@ -135,11 +137,13 @@ __export(src_exports, {
|
|
|
135
137
|
borderRadii: () => borderRadii,
|
|
136
138
|
borderStyles: () => borderStyles,
|
|
137
139
|
borderWidths: () => borderWidths,
|
|
140
|
+
buildOfferTemplate: () => buildOfferTemplate,
|
|
138
141
|
buttonActions: () => buttonActions,
|
|
139
142
|
buttonFields: () => buttonFields,
|
|
140
143
|
buttonStyles: () => buttonStyles,
|
|
141
144
|
checkForHTML: () => checkForHTML,
|
|
142
145
|
convertNumericObjects: () => convertNumericObjects,
|
|
146
|
+
convertOfferToV2: () => convertOfferToV2,
|
|
143
147
|
convertProductToStorefrontFormat: () => convertProductToStorefrontFormat,
|
|
144
148
|
convertToNodes: () => convertToNodes,
|
|
145
149
|
convertVariantToStorefrontFormat: () => convertVariantToStorefrontFormat,
|
|
@@ -166,12 +170,14 @@ __export(src_exports, {
|
|
|
166
170
|
isCarouselType: () => isCarouselType,
|
|
167
171
|
isCartLineType: () => isCartLineType,
|
|
168
172
|
isDataSourceType: () => isDataSourceType,
|
|
173
|
+
isDiscountType: () => isDiscountType,
|
|
169
174
|
isHTML: () => isHTML,
|
|
170
175
|
isImageBlock: () => isImageBlock,
|
|
171
176
|
isImageContentBlock: () => isImageContentBlock,
|
|
172
177
|
isImageType: () => isImageType,
|
|
173
178
|
isLayoutType: () => isLayoutType,
|
|
174
179
|
isMonetizeType: () => isMonetizeType,
|
|
180
|
+
isOfferV1: () => isOfferV1,
|
|
175
181
|
isOffersType: () => isOffersType,
|
|
176
182
|
isOverlayType: () => isOverlayType,
|
|
177
183
|
isPayButtonBlock: () => isPayButtonBlock,
|
|
@@ -1286,7 +1292,7 @@ var UserConfig = import_v44.z.object({
|
|
|
1286
1292
|
});
|
|
1287
1293
|
|
|
1288
1294
|
// src/schema/widgetData.ts
|
|
1289
|
-
var
|
|
1295
|
+
var import_v433 = require("zod/v4");
|
|
1290
1296
|
|
|
1291
1297
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1292
1298
|
var import_v45 = require("zod/v4");
|
|
@@ -1421,6 +1427,7 @@ var sectionTypes = [
|
|
|
1421
1427
|
"carousel",
|
|
1422
1428
|
"cartLine",
|
|
1423
1429
|
"dataSource",
|
|
1430
|
+
"discount",
|
|
1424
1431
|
"image",
|
|
1425
1432
|
"layout",
|
|
1426
1433
|
"monetize",
|
|
@@ -1531,14 +1538,14 @@ var CheckoutExtension = import_v46.z.looseObject({
|
|
|
1531
1538
|
});
|
|
1532
1539
|
|
|
1533
1540
|
// src/schema/widgets/contentBlock.ts
|
|
1534
|
-
var
|
|
1541
|
+
var import_v427 = require("zod/v4");
|
|
1535
1542
|
|
|
1536
1543
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1537
|
-
var
|
|
1544
|
+
var import_v426 = require("zod/v4");
|
|
1538
1545
|
|
|
1539
1546
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1540
|
-
var
|
|
1541
|
-
var
|
|
1547
|
+
var import_uuid13 = require("uuid");
|
|
1548
|
+
var import_v425 = require("zod/v4");
|
|
1542
1549
|
|
|
1543
1550
|
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1544
1551
|
var import_v47 = require("zod/v4");
|
|
@@ -1608,7 +1615,7 @@ var CABRule = import_v47.z.object({
|
|
|
1608
1615
|
});
|
|
1609
1616
|
|
|
1610
1617
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1611
|
-
var
|
|
1618
|
+
var import_v424 = require("zod/v4");
|
|
1612
1619
|
|
|
1613
1620
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1614
1621
|
var import_v48 = require("zod/v4");
|
|
@@ -1655,6 +1662,7 @@ var isButtonType = (section) => (0, import_compat.get)(section, "sectionType") =
|
|
|
1655
1662
|
var isCarouselType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.carousel;
|
|
1656
1663
|
var isCartLineType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.cartLine;
|
|
1657
1664
|
var isDataSourceType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.dataSource;
|
|
1665
|
+
var isDiscountType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.discount;
|
|
1658
1666
|
var isImageType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.image;
|
|
1659
1667
|
var isLayoutType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.layout;
|
|
1660
1668
|
var isMonetizeType = (section) => (0, import_compat.get)(section, "sectionType") === SectionType.monetize;
|
|
@@ -1925,39 +1933,54 @@ var CABCartLineSection = import_v417.z.lazy(
|
|
|
1925
1933
|
})
|
|
1926
1934
|
);
|
|
1927
1935
|
|
|
1928
|
-
// src/schema/widgets/checkout-and-beyond/
|
|
1936
|
+
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
1929
1937
|
var import_uuid7 = require("uuid");
|
|
1930
1938
|
var import_v418 = require("zod/v4");
|
|
1931
|
-
var
|
|
1939
|
+
var CABDiscountSection = import_v418.z.object({
|
|
1940
|
+
amount: import_v418.z.union([import_v418.z.number(), import_v418.z.string()]).catch(0),
|
|
1941
|
+
discountedBy: import_v418.z.string().optional(),
|
|
1942
|
+
discountedFrom: import_v418.z.enum(discountSources).optional().catch(void 0),
|
|
1943
|
+
message: import_v418.z.string().optional(),
|
|
1932
1944
|
name: import_v418.z.string().optional(),
|
|
1933
|
-
|
|
1945
|
+
quantity: import_v418.z.number().default(1),
|
|
1934
1946
|
sectionId: import_v418.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
1935
|
-
sectionType: import_v418.z.literal(SectionType.
|
|
1947
|
+
sectionType: import_v418.z.literal(SectionType.discount).default(SectionType.discount),
|
|
1948
|
+
type: import_v418.z.enum(discountTypes).catch("none")
|
|
1936
1949
|
});
|
|
1937
1950
|
|
|
1938
|
-
// src/schema/widgets/checkout-and-beyond/
|
|
1951
|
+
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
1939
1952
|
var import_uuid8 = require("uuid");
|
|
1940
1953
|
var import_v419 = require("zod/v4");
|
|
1941
|
-
var
|
|
1942
|
-
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
1943
|
-
countryCodes: import_v419.z.array(import_v419.z.string()).default(() => []),
|
|
1954
|
+
var CABMonetizeSection = import_v419.z.object({
|
|
1944
1955
|
name: import_v419.z.string().optional(),
|
|
1945
1956
|
rule: CABRule.optional(),
|
|
1946
1957
|
sectionId: import_v419.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
1947
|
-
|
|
1948
|
-
sectionType: import_v419.z.literal(SectionType.progressBar).default(SectionType.progressBar)
|
|
1958
|
+
sectionType: import_v419.z.literal(SectionType.monetize).default(SectionType.monetize)
|
|
1949
1959
|
});
|
|
1950
1960
|
|
|
1951
|
-
// src/schema/widgets/checkout-and-beyond/
|
|
1961
|
+
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
1952
1962
|
var import_uuid9 = require("uuid");
|
|
1953
1963
|
var import_v420 = require("zod/v4");
|
|
1954
|
-
var
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1964
|
+
var CABProgressBarSection = import_v420.z.object({
|
|
1965
|
+
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
1966
|
+
countryCodes: import_v420.z.array(import_v420.z.string()).default(() => []),
|
|
1967
|
+
name: import_v420.z.string().optional(),
|
|
1968
|
+
rule: CABRule.optional(),
|
|
1969
|
+
sectionId: import_v420.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
1970
|
+
sections: import_v420.z.union([import_v420.z.array(CABTextSection), import_v420.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1971
|
+
sectionType: import_v420.z.literal(SectionType.progressBar).default(SectionType.progressBar)
|
|
1972
|
+
});
|
|
1973
|
+
|
|
1974
|
+
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
1975
|
+
var import_uuid10 = require("uuid");
|
|
1976
|
+
var import_v421 = require("zod/v4");
|
|
1977
|
+
var CABQuantitySection = import_v421.z.object({
|
|
1978
|
+
errorMessages: import_v421.z.record(
|
|
1979
|
+
import_v421.z.string(),
|
|
1980
|
+
import_v421.z.object({
|
|
1981
|
+
max: import_v421.z.string().optional(),
|
|
1982
|
+
min: import_v421.z.string().optional(),
|
|
1983
|
+
neg: import_v421.z.string().optional()
|
|
1961
1984
|
})
|
|
1962
1985
|
).default({
|
|
1963
1986
|
en: {
|
|
@@ -1966,58 +1989,59 @@ var CABQuantitySection = import_v420.z.object({
|
|
|
1966
1989
|
neg: "Quantity cannot be negative"
|
|
1967
1990
|
}
|
|
1968
1991
|
}),
|
|
1969
|
-
inputType:
|
|
1970
|
-
max:
|
|
1971
|
-
min:
|
|
1972
|
-
name: import_v420.z.string().optional(),
|
|
1973
|
-
rule: CABRule.optional(),
|
|
1974
|
-
sectionId: import_v420.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
1975
|
-
sectionType: import_v420.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
1976
|
-
});
|
|
1977
|
-
|
|
1978
|
-
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
1979
|
-
var import_uuid10 = require("uuid");
|
|
1980
|
-
var import_v421 = require("zod/v4");
|
|
1981
|
-
var CABReviewsSection = import_v421.z.object({
|
|
1982
|
-
color: import_v421.z.string().default("#fadb14"),
|
|
1992
|
+
inputType: import_v421.z.enum(quantityInputs).default(QuantityInput.select),
|
|
1993
|
+
max: import_v421.z.number().min(1).max(100).default(10),
|
|
1994
|
+
min: import_v421.z.number().min(1).default(1),
|
|
1983
1995
|
name: import_v421.z.string().optional(),
|
|
1984
1996
|
rule: CABRule.optional(),
|
|
1985
1997
|
sectionId: import_v421.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
1986
|
-
sectionType: import_v421.z.literal(SectionType.
|
|
1987
|
-
size: import_v421.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
1998
|
+
sectionType: import_v421.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
1988
1999
|
});
|
|
1989
2000
|
|
|
1990
|
-
// src/schema/widgets/checkout-and-beyond/
|
|
1991
|
-
var import_compat3 = require("es-toolkit/compat");
|
|
2001
|
+
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
1992
2002
|
var import_uuid11 = require("uuid");
|
|
1993
2003
|
var import_v422 = require("zod/v4");
|
|
1994
|
-
var
|
|
1995
|
-
|
|
2004
|
+
var CABReviewsSection = import_v422.z.object({
|
|
2005
|
+
color: import_v422.z.string().default("#fadb14"),
|
|
1996
2006
|
name: import_v422.z.string().optional(),
|
|
1997
2007
|
rule: CABRule.optional(),
|
|
1998
2008
|
sectionId: import_v422.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
1999
|
-
sectionType: import_v422.z.literal(SectionType.
|
|
2000
|
-
|
|
2001
|
-
|
|
2009
|
+
sectionType: import_v422.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
2010
|
+
size: import_v422.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2011
|
+
});
|
|
2012
|
+
|
|
2013
|
+
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
2014
|
+
var import_compat3 = require("es-toolkit/compat");
|
|
2015
|
+
var import_uuid12 = require("uuid");
|
|
2016
|
+
var import_v423 = require("zod/v4");
|
|
2017
|
+
var CABVariantsSection = import_v423.z.object({
|
|
2018
|
+
hideOutOfStockVariants: import_v423.z.boolean().default(false),
|
|
2019
|
+
name: import_v423.z.string().optional(),
|
|
2020
|
+
rule: CABRule.optional(),
|
|
2021
|
+
sectionId: import_v423.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
2022
|
+
sectionType: import_v423.z.literal(SectionType.variants).default(SectionType.variants),
|
|
2023
|
+
selector: import_v423.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
2024
|
+
variantMode: import_v423.z.enum(variantModes).default(VariantMode.multiple)
|
|
2002
2025
|
});
|
|
2003
2026
|
|
|
2004
2027
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2005
|
-
var CABBorder =
|
|
2006
|
-
radius:
|
|
2007
|
-
style:
|
|
2008
|
-
width:
|
|
2028
|
+
var CABBorder = import_v424.z.object({
|
|
2029
|
+
radius: import_v424.z.enum(borderRadii).default(BorderRadius.base),
|
|
2030
|
+
style: import_v424.z.enum(borderStyles).default(BorderStyle.none),
|
|
2031
|
+
width: import_v424.z.enum(borderWidths).default(BorderWidth.base)
|
|
2009
2032
|
}).default({
|
|
2010
2033
|
radius: BorderRadius.base,
|
|
2011
2034
|
style: BorderStyle.none,
|
|
2012
2035
|
width: BorderWidth.base
|
|
2013
2036
|
});
|
|
2014
|
-
var CABSection =
|
|
2015
|
-
() =>
|
|
2037
|
+
var CABSection = import_v424.z.lazy(
|
|
2038
|
+
() => import_v424.z.discriminatedUnion("sectionType", [
|
|
2016
2039
|
CABBannerSection,
|
|
2017
2040
|
CABButtonSection,
|
|
2018
2041
|
CABCarouselSection,
|
|
2019
2042
|
CABCartLineSection,
|
|
2020
2043
|
CABDataSourceSection,
|
|
2044
|
+
CABDiscountSection,
|
|
2021
2045
|
CABImageSection,
|
|
2022
2046
|
CABLayoutSection,
|
|
2023
2047
|
CABMonetizeSection,
|
|
@@ -2033,155 +2057,155 @@ var CABSection = import_v423.z.lazy(
|
|
|
2033
2057
|
);
|
|
2034
2058
|
|
|
2035
2059
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2036
|
-
var GridItem =
|
|
2037
|
-
var CABLayoutSection =
|
|
2038
|
-
alignment:
|
|
2039
|
-
horizontal:
|
|
2040
|
-
vertical:
|
|
2060
|
+
var GridItem = import_v425.z.union([import_v425.z.literal("auto"), import_v425.z.literal("fill"), import_v425.z.string().regex(/^\d+%$/), import_v425.z.number()]);
|
|
2061
|
+
var CABLayoutSection = import_v425.z.object({
|
|
2062
|
+
alignment: import_v425.z.object({
|
|
2063
|
+
horizontal: import_v425.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
2064
|
+
vertical: import_v425.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
2041
2065
|
}).default({
|
|
2042
2066
|
horizontal: HorizontalAlignment.start,
|
|
2043
2067
|
vertical: VerticalAlignment.top
|
|
2044
2068
|
}),
|
|
2045
|
-
border:
|
|
2046
|
-
buttonField:
|
|
2047
|
-
direction:
|
|
2048
|
-
grid:
|
|
2049
|
-
columns:
|
|
2050
|
-
rows:
|
|
2069
|
+
border: import_v425.z.lazy(() => CABBorder),
|
|
2070
|
+
buttonField: import_v425.z.enum(buttonFields).optional(),
|
|
2071
|
+
direction: import_v425.z.enum(directions).default(Direction.rows),
|
|
2072
|
+
grid: import_v425.z.object({
|
|
2073
|
+
columns: import_v425.z.union([import_v425.z.array(GridItem), import_v425.z.undefined()]).default(() => ["auto"]),
|
|
2074
|
+
rows: import_v425.z.union([import_v425.z.array(GridItem), import_v425.z.undefined()]).default(() => ["auto"])
|
|
2051
2075
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
2052
|
-
name:
|
|
2053
|
-
padding:
|
|
2076
|
+
name: import_v425.z.string().optional(),
|
|
2077
|
+
padding: import_v425.z.enum(spacings).default(Spacing.none),
|
|
2054
2078
|
rule: CABRule.optional(),
|
|
2055
|
-
sectionId:
|
|
2056
|
-
sections:
|
|
2057
|
-
sectionType:
|
|
2058
|
-
spacing:
|
|
2079
|
+
sectionId: import_v425.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
2080
|
+
sections: import_v425.z.union([import_v425.z.array(import_v425.z.lazy(() => CABSection)), import_v425.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2081
|
+
sectionType: import_v425.z.literal(SectionType.layout).default(SectionType.layout),
|
|
2082
|
+
spacing: import_v425.z.enum(spacings).default(Spacing.base),
|
|
2059
2083
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
2060
|
-
viewUrl:
|
|
2061
|
-
width:
|
|
2084
|
+
viewUrl: import_v425.z.string().optional(),
|
|
2085
|
+
width: import_v425.z.number().default(100)
|
|
2062
2086
|
});
|
|
2063
2087
|
|
|
2064
2088
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2065
|
-
var TargetArea =
|
|
2066
|
-
fill:
|
|
2067
|
-
flip:
|
|
2068
|
-
icon:
|
|
2069
|
-
label:
|
|
2070
|
-
width:
|
|
2089
|
+
var TargetArea = import_v426.z.object({
|
|
2090
|
+
fill: import_v426.z.boolean().optional(),
|
|
2091
|
+
flip: import_v426.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
2092
|
+
icon: import_v426.z.string(),
|
|
2093
|
+
label: import_v426.z.string(),
|
|
2094
|
+
width: import_v426.z.string()
|
|
2071
2095
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
2072
|
-
var CABTracking =
|
|
2073
|
-
enableAttribution:
|
|
2074
|
-
enableSource:
|
|
2075
|
-
enableWidget:
|
|
2096
|
+
var CABTracking = import_v426.z.object({
|
|
2097
|
+
enableAttribution: import_v426.z.boolean().default(true),
|
|
2098
|
+
enableSource: import_v426.z.boolean().default(true),
|
|
2099
|
+
enableWidget: import_v426.z.boolean().default(true)
|
|
2076
2100
|
}).default({ enableAttribution: true, enableSource: true, enableWidget: true });
|
|
2077
2101
|
var CABRootSection = CABLayoutSection.extend({
|
|
2078
|
-
editorMode:
|
|
2079
|
-
previewMode:
|
|
2080
|
-
storeId:
|
|
2102
|
+
editorMode: import_v426.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
2103
|
+
previewMode: import_v426.z.boolean().default(false),
|
|
2104
|
+
storeId: import_v426.z.number().nullable().default(null),
|
|
2081
2105
|
targetArea: TargetArea.nullable(),
|
|
2082
2106
|
tracking: CABTracking,
|
|
2083
|
-
type:
|
|
2084
|
-
version:
|
|
2085
|
-
widgetId:
|
|
2107
|
+
type: import_v426.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
2108
|
+
version: import_v426.z.literal(2).default(2),
|
|
2109
|
+
widgetId: import_v426.z.number().nullable().default(null)
|
|
2086
2110
|
});
|
|
2087
2111
|
|
|
2088
2112
|
// src/schema/widgets/contentBlock.ts
|
|
2089
|
-
var ContentBlockV1 =
|
|
2090
|
-
blockSpacing:
|
|
2091
|
-
imageBlocks:
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
altText:
|
|
2095
|
-
description:
|
|
2096
|
-
id:
|
|
2097
|
-
imagePlacement:
|
|
2098
|
-
imageSize:
|
|
2099
|
-
imageUrl:
|
|
2100
|
-
textAlignment:
|
|
2101
|
-
textSize:
|
|
2113
|
+
var ContentBlockV1 = import_v427.z.object({
|
|
2114
|
+
blockSpacing: import_v427.z.enum(spacings).optional(),
|
|
2115
|
+
imageBlocks: import_v427.z.union([
|
|
2116
|
+
import_v427.z.array(
|
|
2117
|
+
import_v427.z.object({
|
|
2118
|
+
altText: import_v427.z.string().nullable(),
|
|
2119
|
+
description: import_v427.z.string().nullable(),
|
|
2120
|
+
id: import_v427.z.uuid(),
|
|
2121
|
+
imagePlacement: import_v427.z.enum(["top", "right", "bottom", "left"]),
|
|
2122
|
+
imageSize: import_v427.z.number(),
|
|
2123
|
+
imageUrl: import_v427.z.url(),
|
|
2124
|
+
textAlignment: import_v427.z.enum(["left", "center", "right"]),
|
|
2125
|
+
textSize: import_v427.z.enum(textSizeNames)
|
|
2102
2126
|
})
|
|
2103
2127
|
),
|
|
2104
|
-
|
|
2128
|
+
import_v427.z.strictObject({}).transform(() => [])
|
|
2105
2129
|
]).optional(),
|
|
2106
|
-
imageLayout:
|
|
2107
|
-
language:
|
|
2108
|
-
description:
|
|
2109
|
-
superTitle:
|
|
2110
|
-
title:
|
|
2130
|
+
imageLayout: import_v427.z.enum(["row", "column"]).optional(),
|
|
2131
|
+
language: import_v427.z.object({
|
|
2132
|
+
description: import_v427.z.string(),
|
|
2133
|
+
superTitle: import_v427.z.string(),
|
|
2134
|
+
title: import_v427.z.string()
|
|
2111
2135
|
}),
|
|
2112
|
-
previewMode:
|
|
2113
|
-
type:
|
|
2114
|
-
version:
|
|
2136
|
+
previewMode: import_v427.z.boolean(),
|
|
2137
|
+
type: import_v427.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
2138
|
+
version: import_v427.z.literal(1)
|
|
2115
2139
|
});
|
|
2116
|
-
var ContentBlock =
|
|
2140
|
+
var ContentBlock = import_v427.z.discriminatedUnion("version", [
|
|
2117
2141
|
ContentBlockV1,
|
|
2118
2142
|
CABRootSection.extend({
|
|
2119
|
-
type:
|
|
2143
|
+
type: import_v427.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
2120
2144
|
})
|
|
2121
2145
|
]);
|
|
2122
2146
|
|
|
2123
2147
|
// src/schema/widgets/giftWithPurchase.ts
|
|
2124
|
-
var
|
|
2125
|
-
var GiftWithPurchase =
|
|
2126
|
-
type:
|
|
2148
|
+
var import_v428 = require("zod/v4");
|
|
2149
|
+
var GiftWithPurchase = import_v428.z.looseObject({
|
|
2150
|
+
type: import_v428.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
2127
2151
|
});
|
|
2128
2152
|
|
|
2129
2153
|
// src/schema/widgets/lineItemEditor.ts
|
|
2130
|
-
var
|
|
2131
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
2132
|
-
downgradeToOneTimeLabel:
|
|
2154
|
+
var import_v429 = require("zod/v4");
|
|
2155
|
+
var LineItemEditorSwitchLanguageV1 = import_v429.z.object({
|
|
2156
|
+
downgradeToOneTimeLabel: import_v429.z.string().optional(),
|
|
2133
2157
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
2134
|
-
subscriptionOptionLabel:
|
|
2135
|
-
upgradeToSubscriptionLabel:
|
|
2136
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
2158
|
+
subscriptionOptionLabel: import_v429.z.string().optional(),
|
|
2159
|
+
upgradeToSubscriptionLabel: import_v429.z.string().optional(),
|
|
2160
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_v429.z.string().optional()
|
|
2137
2161
|
});
|
|
2138
|
-
var LineItemEditorV1 =
|
|
2162
|
+
var LineItemEditorV1 = import_v429.z.object({
|
|
2139
2163
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
2140
|
-
button:
|
|
2141
|
-
previewMode:
|
|
2142
|
-
switchToSubscription:
|
|
2143
|
-
disableDowngrade:
|
|
2164
|
+
button: import_v429.z.object({ kind: import_v429.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
2165
|
+
previewMode: import_v429.z.boolean().optional(),
|
|
2166
|
+
switchToSubscription: import_v429.z.object({
|
|
2167
|
+
disableDowngrade: import_v429.z.boolean().optional(),
|
|
2144
2168
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
2145
2169
|
}).optional(),
|
|
2146
|
-
switchToSubscriptionEnabled:
|
|
2147
|
-
tracking:
|
|
2148
|
-
enableAttribution:
|
|
2149
|
-
enableSource:
|
|
2150
|
-
enableWidget:
|
|
2170
|
+
switchToSubscriptionEnabled: import_v429.z.boolean().optional(),
|
|
2171
|
+
tracking: import_v429.z.object({
|
|
2172
|
+
enableAttribution: import_v429.z.boolean().optional(),
|
|
2173
|
+
enableSource: import_v429.z.boolean().optional(),
|
|
2174
|
+
enableWidget: import_v429.z.boolean().optional()
|
|
2151
2175
|
}).optional(),
|
|
2152
|
-
type:
|
|
2153
|
-
version:
|
|
2176
|
+
type: import_v429.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
2177
|
+
version: import_v429.z.literal(1)
|
|
2154
2178
|
});
|
|
2155
|
-
var LineItemEditor =
|
|
2179
|
+
var LineItemEditor = import_v429.z.discriminatedUnion("version", [
|
|
2156
2180
|
LineItemEditorV1,
|
|
2157
2181
|
CABRootSection.extend({
|
|
2158
|
-
type:
|
|
2182
|
+
type: import_v429.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
2159
2183
|
})
|
|
2160
2184
|
]);
|
|
2161
2185
|
|
|
2162
2186
|
// src/schema/widgets/progressBar.ts
|
|
2163
|
-
var
|
|
2164
|
-
var ProgressBar =
|
|
2165
|
-
type:
|
|
2187
|
+
var import_v430 = require("zod/v4");
|
|
2188
|
+
var ProgressBar = import_v430.z.looseObject({
|
|
2189
|
+
type: import_v430.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
2166
2190
|
});
|
|
2167
2191
|
|
|
2168
2192
|
// src/schema/widgets/rebuyButton.ts
|
|
2169
|
-
var
|
|
2170
|
-
var RebuyButtonV1 =
|
|
2171
|
-
type:
|
|
2172
|
-
version:
|
|
2193
|
+
var import_v431 = require("zod/v4");
|
|
2194
|
+
var RebuyButtonV1 = import_v431.z.looseObject({
|
|
2195
|
+
type: import_v431.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
2196
|
+
version: import_v431.z.literal(1)
|
|
2173
2197
|
});
|
|
2174
|
-
var RebuyButton =
|
|
2198
|
+
var RebuyButton = import_v431.z.discriminatedUnion("version", [
|
|
2175
2199
|
RebuyButtonV1,
|
|
2176
2200
|
CABRootSection.extend({
|
|
2177
|
-
type:
|
|
2201
|
+
type: import_v431.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
2178
2202
|
})
|
|
2179
2203
|
]);
|
|
2180
2204
|
|
|
2181
2205
|
// src/schema/widgets/rebuyMonetize.ts
|
|
2182
|
-
var
|
|
2183
|
-
var RebuyMonetize =
|
|
2184
|
-
type:
|
|
2206
|
+
var import_v432 = require("zod/v4");
|
|
2207
|
+
var RebuyMonetize = import_v432.z.looseObject({
|
|
2208
|
+
type: import_v432.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
2185
2209
|
});
|
|
2186
2210
|
|
|
2187
2211
|
// src/schema/widgetData.ts
|
|
@@ -2195,7 +2219,7 @@ var extensionWidgetTypes = [
|
|
|
2195
2219
|
WidgetType.ui_extension_line_item_editor,
|
|
2196
2220
|
WidgetType.ui_extension_progress_bar
|
|
2197
2221
|
];
|
|
2198
|
-
var WidgetData =
|
|
2222
|
+
var WidgetData = import_v433.z.discriminatedUnion("type", [
|
|
2199
2223
|
ABTestingPlaceholder,
|
|
2200
2224
|
CheckoutExtension,
|
|
2201
2225
|
ContentBlock,
|
|
@@ -2206,6 +2230,178 @@ var WidgetData = import_v432.z.discriminatedUnion("type", [
|
|
|
2206
2230
|
RebuyMonetize
|
|
2207
2231
|
]);
|
|
2208
2232
|
|
|
2233
|
+
// src/schema/widgets/checkout-and-beyond/offerLabels.ts
|
|
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
|
+
},
|
|
2263
|
+
addedToCart: {
|
|
2264
|
+
ar: "\u062A\u0645\u062A \u0627\u0644\u0625\u0636\u0627\u0641\u0629!",
|
|
2265
|
+
cs: "P\u0159id\xE1no!",
|
|
2266
|
+
da: "Tilf\xF8jet!",
|
|
2267
|
+
de: "Hinzugef\xFCgt!",
|
|
2268
|
+
en: "Added!",
|
|
2269
|
+
es: "\xA1A\xF1adido!",
|
|
2270
|
+
fi: "Lis\xE4tty!",
|
|
2271
|
+
fr: "Ajout\xE9 !",
|
|
2272
|
+
ga: "Curtha leis!",
|
|
2273
|
+
he: "\u05E0\u05D5\u05E1\u05E3!",
|
|
2274
|
+
hi: "\u091C\u094B\u0921\u093C\u093E \u0917\u092F\u093E!",
|
|
2275
|
+
id: "Ditambahkan!",
|
|
2276
|
+
it: "Aggiunto!",
|
|
2277
|
+
ja: "\u8FFD\u52A0\u3057\u307E\u3057\u305F\uFF01",
|
|
2278
|
+
ko: "\uCD94\uAC00\uB428!",
|
|
2279
|
+
nl: "Toegevoegd!",
|
|
2280
|
+
no: "Lagt til!",
|
|
2281
|
+
pl: "Dodano!",
|
|
2282
|
+
pt: "Adicionado!",
|
|
2283
|
+
ru: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E!",
|
|
2284
|
+
sv: "Tillagd!",
|
|
2285
|
+
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E41\u0E25\u0E49\u0E27!",
|
|
2286
|
+
tr: "Eklendi!",
|
|
2287
|
+
uk: "\u0414\u043E\u0434\u0430\u043D\u043E!",
|
|
2288
|
+
vi: "\u0110\xE3 th\xEAm!",
|
|
2289
|
+
zh: "\u5DF2\u6DFB\u52A0\uFF01"
|
|
2290
|
+
},
|
|
2291
|
+
addedToCartMessage: {
|
|
2292
|
+
ar: "\u062A\u0645\u062A \u0625\u0636\u0627\u0641\u0629 {{quantity}} {{productTitle}} \u0625\u0644\u0649 \u0627\u0644\u0633\u0644\u0629.",
|
|
2293
|
+
cs: "{{quantity}} {{productTitle}} p\u0159id\xE1no do ko\u0161\xEDku.",
|
|
2294
|
+
da: "{{quantity}} {{productTitle}} lagt i kurven.",
|
|
2295
|
+
de: "{{quantity}} {{productTitle}} zum Warenkorb hinzugef\xFCgt.",
|
|
2296
|
+
en: "{{quantity}} {{productTitle}} added to cart.",
|
|
2297
|
+
es: "{{quantity}} {{productTitle}} a\xF1adido al carrito.",
|
|
2298
|
+
fi: "{{quantity}} {{productTitle}} lis\xE4tty ostoskoriin.",
|
|
2299
|
+
fr: "{{quantity}} {{productTitle}} ajout\xE9 au panier.",
|
|
2300
|
+
ga: "Cuireadh {{quantity}} {{productTitle}} sa chairt.",
|
|
2301
|
+
he: "{{quantity}} {{productTitle}} \u05E0\u05D5\u05E1\u05E3 \u05DC\u05E2\u05D2\u05DC\u05D4.",
|
|
2302
|
+
hi: "{{quantity}} {{productTitle}} \u0915\u093E\u0930\u094D\u091F \u092E\u0947\u0902 \u091C\u094B\u0921\u093C\u093E \u0917\u092F\u093E\u0964",
|
|
2303
|
+
id: "{{quantity}} {{productTitle}} ditambahkan ke keranjang.",
|
|
2304
|
+
it: "{{quantity}} {{productTitle}} aggiunto al carrello.",
|
|
2305
|
+
ja: "{{quantity}} {{productTitle}}\u3092\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F\u3002",
|
|
2306
|
+
ko: "{{quantity}} {{productTitle}}\uC774(\uAC00) \uC7A5\uBC14\uAD6C\uB2C8\uC5D0 \uCD94\uAC00\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",
|
|
2307
|
+
nl: "{{quantity}} {{productTitle}} toegevoegd aan winkelwagen.",
|
|
2308
|
+
no: "{{quantity}} {{productTitle}} lagt i handlekurven.",
|
|
2309
|
+
pl: "{{quantity}} {{productTitle}} dodano do koszyka.",
|
|
2310
|
+
pt: "{{quantity}} {{productTitle}} adicionado ao carrinho.",
|
|
2311
|
+
ru: "{{quantity}} {{productTitle}} \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443.",
|
|
2312
|
+
sv: "{{quantity}} {{productTitle}} har lagts i varukorgen.",
|
|
2313
|
+
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21 {{quantity}} {{productTitle}} \u0E25\u0E07\u0E15\u0E30\u0E01\u0E23\u0E49\u0E32\u0E41\u0E25\u0E49\u0E27",
|
|
2314
|
+
tr: "{{quantity}} {{productTitle}} sepete eklendi.",
|
|
2315
|
+
uk: "{{quantity}} {{productTitle}} \u0434\u043E\u0434\u0430\u043D\u043E \u0434\u043E \u043A\u043E\u0448\u0438\u043A\u0430.",
|
|
2316
|
+
vi: "\u0110\xE3 th\xEAm {{quantity}} {{productTitle}} v\xE0o gi\u1ECF h\xE0ng.",
|
|
2317
|
+
zh: "{{quantity}} {{productTitle}} \u5DF2\u52A0\u5165\u8D2D\u7269\u8F66\u3002"
|
|
2318
|
+
},
|
|
2319
|
+
addingToCart: {
|
|
2320
|
+
ar: "\u062C\u0627\u0631\u064D \u0627\u0644\u0625\u0636\u0627\u0641\u0629...",
|
|
2321
|
+
cs: "P\u0159id\xE1v\xE1n\xED...",
|
|
2322
|
+
da: "Tilf\xF8jer...",
|
|
2323
|
+
de: "Wird hinzugef\xFCgt...",
|
|
2324
|
+
en: "Adding...",
|
|
2325
|
+
es: "A\xF1adiendo...",
|
|
2326
|
+
fi: "Lis\xE4t\xE4\xE4n...",
|
|
2327
|
+
fr: "Ajout en cours...",
|
|
2328
|
+
ga: "\xC1 chur leis...",
|
|
2329
|
+
he: "\u05DE\u05D5\u05E1\u05D9\u05E3...",
|
|
2330
|
+
hi: "\u091C\u094B\u0921\u093C\u093E \u091C\u093E \u0930\u0939\u093E \u0939\u0948...",
|
|
2331
|
+
id: "Menambahkan...",
|
|
2332
|
+
it: "Aggiunta in corso...",
|
|
2333
|
+
ja: "\u8FFD\u52A0\u4E2D...",
|
|
2334
|
+
ko: "\uCD94\uAC00 \uC911...",
|
|
2335
|
+
nl: "Toevoegen...",
|
|
2336
|
+
no: "Legger til...",
|
|
2337
|
+
pl: "Dodawanie...",
|
|
2338
|
+
pt: "Adicionando...",
|
|
2339
|
+
ru: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435...",
|
|
2340
|
+
sv: "L\xE4gger till...",
|
|
2341
|
+
th: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E40\u0E1E\u0E34\u0E48\u0E21...",
|
|
2342
|
+
tr: "Ekleniyor...",
|
|
2343
|
+
uk: "\u0414\u043E\u0434\u0430\u0432\u0430\u043D\u043D\u044F...",
|
|
2344
|
+
vi: "\u0110ang th\xEAm...",
|
|
2345
|
+
zh: "\u6B63\u5728\u6DFB\u52A0..."
|
|
2346
|
+
},
|
|
2347
|
+
soldOut: {
|
|
2348
|
+
ar: "\u0646\u0641\u062F\u062A \u0627\u0644\u0643\u0645\u064A\u0629",
|
|
2349
|
+
cs: "Vyprod\xE1no",
|
|
2350
|
+
da: "Udsolgt",
|
|
2351
|
+
de: "Ausverkauft",
|
|
2352
|
+
en: "Sold out",
|
|
2353
|
+
es: "Agotado",
|
|
2354
|
+
fi: "Loppuunmyyty",
|
|
2355
|
+
fr: "\xC9puis\xE9",
|
|
2356
|
+
ga: "D\xEDolta amach",
|
|
2357
|
+
he: "\u05D0\u05D6\u05DC \u05DE\u05D4\u05DE\u05DC\u05D0\u05D9",
|
|
2358
|
+
hi: "\u0938\u094D\u091F\u0949\u0915 \u0916\u093C\u0924\u094D\u092E",
|
|
2359
|
+
id: "Habis terjual",
|
|
2360
|
+
it: "Esaurito",
|
|
2361
|
+
ja: "\u58F2\u308A\u5207\u308C",
|
|
2362
|
+
ko: "\uD488\uC808",
|
|
2363
|
+
nl: "Uitverkocht",
|
|
2364
|
+
no: "Utsolgt",
|
|
2365
|
+
pl: "Wyprzedane",
|
|
2366
|
+
pt: "Esgotado",
|
|
2367
|
+
ru: "\u0420\u0430\u0441\u043F\u0440\u043E\u0434\u0430\u043D\u043E",
|
|
2368
|
+
sv: "Sluts\xE5ld",
|
|
2369
|
+
th: "\u0E2A\u0E34\u0E19\u0E04\u0E49\u0E32\u0E2B\u0E21\u0E14",
|
|
2370
|
+
tr: "T\xFCkendi",
|
|
2371
|
+
uk: "\u0420\u043E\u0437\u043F\u0440\u043E\u0434\u0430\u043D\u043E",
|
|
2372
|
+
vi: "H\u1EBFt h\xE0ng",
|
|
2373
|
+
zh: "\u5DF2\u552E\u7F44"
|
|
2374
|
+
},
|
|
2375
|
+
undo: {
|
|
2376
|
+
ar: "\u062A\u0631\u0627\u062C\u0639",
|
|
2377
|
+
cs: "Zp\u011Bt",
|
|
2378
|
+
da: "Fortryd",
|
|
2379
|
+
de: "R\xFCckg\xE4ngig",
|
|
2380
|
+
en: "Undo",
|
|
2381
|
+
es: "Deshacer",
|
|
2382
|
+
fi: "Kumoa",
|
|
2383
|
+
fr: "Annuler",
|
|
2384
|
+
ga: "Cealaigh",
|
|
2385
|
+
he: "\u05D1\u05D8\u05DC",
|
|
2386
|
+
hi: "\u092A\u0942\u0930\u094D\u0935\u0935\u0924 \u0915\u0930\u0947\u0902",
|
|
2387
|
+
id: "Urungkan",
|
|
2388
|
+
it: "Annulla",
|
|
2389
|
+
ja: "\u5143\u306B\u623B\u3059",
|
|
2390
|
+
ko: "\uC2E4\uD589 \uCDE8\uC18C",
|
|
2391
|
+
nl: "Ongedaan maken",
|
|
2392
|
+
no: "Angre",
|
|
2393
|
+
pl: "Cofnij",
|
|
2394
|
+
pt: "Desfazer",
|
|
2395
|
+
ru: "\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",
|
|
2396
|
+
sv: "\xC5ngra",
|
|
2397
|
+
th: "\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",
|
|
2398
|
+
tr: "Geri al",
|
|
2399
|
+
uk: "\u0421\u043A\u0430\u0441\u0443\u0432\u0430\u0442\u0438",
|
|
2400
|
+
vi: "Ho\xE0n t\xE1c",
|
|
2401
|
+
zh: "\u64A4\u9500"
|
|
2402
|
+
}
|
|
2403
|
+
};
|
|
2404
|
+
|
|
2209
2405
|
// src/schema/widgets/checkout-and-beyond/switchLabels.ts
|
|
2210
2406
|
var SWITCH_LABELS = {
|
|
2211
2407
|
subscriptionOption: {
|
|
@@ -2324,15 +2520,15 @@ var SWITCH_LABELS = {
|
|
|
2324
2520
|
|
|
2325
2521
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
2326
2522
|
var import_compat4 = require("es-toolkit/compat");
|
|
2327
|
-
var
|
|
2328
|
-
var strictNumber =
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2523
|
+
var import_v434 = require("zod/v4");
|
|
2524
|
+
var strictNumber = import_v434.z.union([
|
|
2525
|
+
import_v434.z.number(),
|
|
2526
|
+
import_v434.z.string().transform((value) => (0, import_compat4.toNumber)((0, import_compat4.replace)((0, import_compat4.toString)(value), /[^0-9.]/g, "")) || 0),
|
|
2527
|
+
import_v434.z.unknown().transform(() => 0)
|
|
2332
2528
|
]);
|
|
2333
2529
|
|
|
2334
2530
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
2335
|
-
var
|
|
2531
|
+
var import_v435 = require("zod/v4");
|
|
2336
2532
|
var blockTypes = [
|
|
2337
2533
|
"callout_banner",
|
|
2338
2534
|
"image",
|
|
@@ -2343,144 +2539,144 @@ var blockTypes = [
|
|
|
2343
2539
|
"text",
|
|
2344
2540
|
"timer"
|
|
2345
2541
|
];
|
|
2346
|
-
var blockType =
|
|
2542
|
+
var blockType = import_v435.z.enum(blockTypes);
|
|
2347
2543
|
var BlockType = blockType.enum;
|
|
2348
2544
|
|
|
2349
2545
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
2350
2546
|
var import_compat5 = require("es-toolkit/compat");
|
|
2351
|
-
var
|
|
2352
|
-
var
|
|
2353
|
-
var TextAlignment2 =
|
|
2354
|
-
var TextSize =
|
|
2355
|
-
|
|
2356
|
-
|
|
2547
|
+
var import_uuid14 = require("uuid");
|
|
2548
|
+
var import_v436 = require("zod/v4");
|
|
2549
|
+
var TextAlignment2 = import_v436.z.union([import_v436.z.enum(["leading", "center", "trailing"]), import_v436.z.unknown().transform(() => "leading")]);
|
|
2550
|
+
var TextSize = import_v436.z.union([
|
|
2551
|
+
import_v436.z.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
2552
|
+
import_v436.z.unknown().transform(() => "medium")
|
|
2357
2553
|
]);
|
|
2358
|
-
var CalloutBannerBlock =
|
|
2359
|
-
id:
|
|
2360
|
-
name:
|
|
2361
|
-
settings:
|
|
2362
|
-
superTitle:
|
|
2363
|
-
title:
|
|
2554
|
+
var CalloutBannerBlock = import_v436.z.object({
|
|
2555
|
+
id: import_v436.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2556
|
+
name: import_v436.z.string().optional(),
|
|
2557
|
+
settings: import_v436.z.object({
|
|
2558
|
+
superTitle: import_v436.z.union([import_v436.z.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
2559
|
+
title: import_v436.z.union([import_v436.z.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
2364
2560
|
}),
|
|
2365
|
-
styles:
|
|
2366
|
-
superTitleEmphasized:
|
|
2561
|
+
styles: import_v436.z.object({
|
|
2562
|
+
superTitleEmphasized: import_v436.z.boolean().default(false),
|
|
2367
2563
|
superTitleSize: TextSize.default("large"),
|
|
2368
2564
|
textAlignment: TextAlignment2.default("center"),
|
|
2369
|
-
titleEmphasized:
|
|
2565
|
+
titleEmphasized: import_v436.z.boolean().default(true),
|
|
2370
2566
|
titleSize: TextSize.default("large")
|
|
2371
2567
|
}),
|
|
2372
|
-
type:
|
|
2568
|
+
type: import_v436.z.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
2373
2569
|
});
|
|
2374
|
-
var ImageBlock =
|
|
2375
|
-
id:
|
|
2376
|
-
name:
|
|
2377
|
-
settings:
|
|
2378
|
-
|
|
2570
|
+
var ImageBlock = import_v436.z.object({
|
|
2571
|
+
id: import_v436.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2572
|
+
name: import_v436.z.string().optional(),
|
|
2573
|
+
settings: import_v436.z.union([
|
|
2574
|
+
import_v436.z.object({
|
|
2379
2575
|
/** This isn't used in the post-purchase offer widget */
|
|
2380
|
-
alt:
|
|
2381
|
-
image:
|
|
2382
|
-
imageSize:
|
|
2383
|
-
imageType:
|
|
2576
|
+
alt: import_v436.z.string().optional().default(""),
|
|
2577
|
+
image: import_v436.z.union([import_v436.z.literal(""), import_v436.z.url()]).default(""),
|
|
2578
|
+
imageSize: import_v436.z.number().default(20),
|
|
2579
|
+
imageType: import_v436.z.enum(["URL", "UPLOAD"]).default("URL")
|
|
2384
2580
|
}),
|
|
2385
|
-
|
|
2581
|
+
import_v436.z.array(import_v436.z.never()).transform(() => ({}))
|
|
2386
2582
|
]),
|
|
2387
|
-
type:
|
|
2388
|
-
});
|
|
2389
|
-
var ImageContentBlock =
|
|
2390
|
-
id:
|
|
2391
|
-
name:
|
|
2392
|
-
settings:
|
|
2393
|
-
alt:
|
|
2394
|
-
description:
|
|
2583
|
+
type: import_v436.z.literal(BlockType.image).default(BlockType.image)
|
|
2584
|
+
});
|
|
2585
|
+
var ImageContentBlock = import_v436.z.object({
|
|
2586
|
+
id: import_v436.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2587
|
+
name: import_v436.z.string().optional(),
|
|
2588
|
+
settings: import_v436.z.object({
|
|
2589
|
+
alt: import_v436.z.string().optional().default(""),
|
|
2590
|
+
description: import_v436.z.union([import_v436.z.string(), TiptapDocument, import_v436.z.null()]).default(
|
|
2395
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."
|
|
2396
2592
|
),
|
|
2397
2593
|
descriptionSize: TextSize.default("medium"),
|
|
2398
2594
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
2399
|
-
image:
|
|
2400
|
-
imagePlacement:
|
|
2401
|
-
imageSize:
|
|
2402
|
-
superTitle:
|
|
2595
|
+
image: import_v436.z.union([import_v436.z.literal(""), import_v436.z.url()]).default(""),
|
|
2596
|
+
imagePlacement: import_v436.z.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
2597
|
+
imageSize: import_v436.z.number().default(20),
|
|
2598
|
+
superTitle: import_v436.z.union([import_v436.z.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
2403
2599
|
superTitleSize: TextSize.default("medium"),
|
|
2404
2600
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2405
|
-
swapContent:
|
|
2406
|
-
title:
|
|
2601
|
+
swapContent: import_v436.z.boolean().optional().default(false),
|
|
2602
|
+
title: import_v436.z.union([import_v436.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
2407
2603
|
titleSize: TextSize.default("medium")
|
|
2408
2604
|
}),
|
|
2409
|
-
type:
|
|
2410
|
-
});
|
|
2411
|
-
var PayButtonBlock =
|
|
2412
|
-
id:
|
|
2413
|
-
name:
|
|
2414
|
-
settings:
|
|
2415
|
-
|
|
2416
|
-
label:
|
|
2605
|
+
type: import_v436.z.literal(BlockType.image_content).default(BlockType.image_content)
|
|
2606
|
+
});
|
|
2607
|
+
var PayButtonBlock = import_v436.z.object({
|
|
2608
|
+
id: import_v436.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2609
|
+
name: import_v436.z.string().optional(),
|
|
2610
|
+
settings: import_v436.z.union([
|
|
2611
|
+
import_v436.z.object({
|
|
2612
|
+
label: import_v436.z.string().default("Pay Now")
|
|
2417
2613
|
}),
|
|
2418
|
-
|
|
2614
|
+
import_v436.z.array(import_v436.z.never()).transform(() => ({
|
|
2419
2615
|
label: "Pay Now"
|
|
2420
2616
|
}))
|
|
2421
2617
|
]),
|
|
2422
|
-
styles:
|
|
2423
|
-
|
|
2424
|
-
buttonWidth:
|
|
2618
|
+
styles: import_v436.z.union([
|
|
2619
|
+
import_v436.z.object({
|
|
2620
|
+
buttonWidth: import_v436.z.number().min(10).max(100).default(50)
|
|
2425
2621
|
}),
|
|
2426
|
-
|
|
2622
|
+
import_v436.z.array(import_v436.z.never()).transform(() => ({
|
|
2427
2623
|
buttonWidth: 50
|
|
2428
2624
|
}))
|
|
2429
2625
|
]),
|
|
2430
|
-
type:
|
|
2626
|
+
type: import_v436.z.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
2431
2627
|
});
|
|
2432
|
-
var ProductInformationBlock =
|
|
2628
|
+
var ProductInformationBlock = import_v436.z.object({
|
|
2433
2629
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2434
|
-
hideProductImage:
|
|
2435
|
-
id:
|
|
2436
|
-
name:
|
|
2437
|
-
type:
|
|
2438
|
-
});
|
|
2439
|
-
var SeparatorBlock =
|
|
2440
|
-
id:
|
|
2441
|
-
name:
|
|
2442
|
-
type:
|
|
2443
|
-
});
|
|
2444
|
-
var TextBlock =
|
|
2445
|
-
id:
|
|
2446
|
-
name:
|
|
2447
|
-
settings:
|
|
2448
|
-
description:
|
|
2630
|
+
hideProductImage: import_v436.z.boolean().optional().default(false),
|
|
2631
|
+
id: import_v436.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2632
|
+
name: import_v436.z.string().optional(),
|
|
2633
|
+
type: import_v436.z.literal(BlockType.product_information).default(BlockType.product_information)
|
|
2634
|
+
});
|
|
2635
|
+
var SeparatorBlock = import_v436.z.object({
|
|
2636
|
+
id: import_v436.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2637
|
+
name: import_v436.z.string().optional(),
|
|
2638
|
+
type: import_v436.z.literal(BlockType.separator).default(BlockType.separator)
|
|
2639
|
+
});
|
|
2640
|
+
var TextBlock = import_v436.z.object({
|
|
2641
|
+
id: import_v436.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2642
|
+
name: import_v436.z.string().optional(),
|
|
2643
|
+
settings: import_v436.z.object({
|
|
2644
|
+
description: import_v436.z.union([import_v436.z.string(), TiptapDocument]).optional().default(
|
|
2449
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."
|
|
2450
2646
|
),
|
|
2451
2647
|
/** This isn't used in the post-purchase offer widget */
|
|
2452
2648
|
descriptionSize: TextSize.default("medium"),
|
|
2453
2649
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
2454
|
-
superTitle:
|
|
2650
|
+
superTitle: import_v436.z.union([import_v436.z.string(), TiptapDocument]).default("Super Title"),
|
|
2455
2651
|
/** This isn't used in the post-purchase offer widget */
|
|
2456
2652
|
superTitleSize: TextSize.default("medium"),
|
|
2457
|
-
title:
|
|
2653
|
+
title: import_v436.z.union([import_v436.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
2458
2654
|
/** This isn't used in the post-purchase offer widget */
|
|
2459
2655
|
titleSize: TextSize.default("medium")
|
|
2460
2656
|
}),
|
|
2461
|
-
type:
|
|
2462
|
-
});
|
|
2463
|
-
var TimerBlock =
|
|
2464
|
-
id:
|
|
2465
|
-
name:
|
|
2466
|
-
settings:
|
|
2467
|
-
durationMinutes:
|
|
2468
|
-
durationSeconds:
|
|
2469
|
-
endOffer:
|
|
2470
|
-
title:
|
|
2657
|
+
type: import_v436.z.literal(BlockType.text).default(BlockType.text)
|
|
2658
|
+
});
|
|
2659
|
+
var TimerBlock = import_v436.z.object({
|
|
2660
|
+
id: import_v436.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
2661
|
+
name: import_v436.z.string().optional(),
|
|
2662
|
+
settings: import_v436.z.object({
|
|
2663
|
+
durationMinutes: import_v436.z.number().min(0).default(10),
|
|
2664
|
+
durationSeconds: import_v436.z.union([import_v436.z.number().min(0), import_v436.z.unknown().transform(() => 0)]).default(0),
|
|
2665
|
+
endOffer: import_v436.z.boolean().default(true),
|
|
2666
|
+
title: import_v436.z.union([import_v436.z.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
2471
2667
|
}),
|
|
2472
|
-
styles:
|
|
2668
|
+
styles: import_v436.z.object({
|
|
2473
2669
|
textAlignment: TextAlignment2.default("center"),
|
|
2474
|
-
timerBackgroundColor:
|
|
2475
|
-
timerEmphasized:
|
|
2670
|
+
timerBackgroundColor: import_v436.z.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
2671
|
+
timerEmphasized: import_v436.z.union([import_v436.z.boolean(), import_v436.z.unknown().transform(() => true)]).default(true),
|
|
2476
2672
|
timerSize: TextSize.default("medium"),
|
|
2477
|
-
timerWidth:
|
|
2478
|
-
titleEmphasized:
|
|
2673
|
+
timerWidth: import_v436.z.number().min(10).max(100).optional().default(100),
|
|
2674
|
+
titleEmphasized: import_v436.z.union([import_v436.z.boolean(), import_v436.z.unknown().transform(() => true)]).default(false),
|
|
2479
2675
|
titleSize: TextSize.default("medium")
|
|
2480
2676
|
}),
|
|
2481
|
-
type:
|
|
2677
|
+
type: import_v436.z.literal(BlockType.timer).default(BlockType.timer)
|
|
2482
2678
|
});
|
|
2483
|
-
var PostPurchaseBlock =
|
|
2679
|
+
var PostPurchaseBlock = import_v436.z.discriminatedUnion("type", [
|
|
2484
2680
|
CalloutBannerBlock,
|
|
2485
2681
|
ImageBlock,
|
|
2486
2682
|
ImageContentBlock,
|
|
@@ -2500,68 +2696,68 @@ var isTextBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)
|
|
|
2500
2696
|
var isTimerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.timer);
|
|
2501
2697
|
|
|
2502
2698
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
2503
|
-
var
|
|
2699
|
+
var import_v439 = require("zod/v4");
|
|
2504
2700
|
|
|
2505
2701
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
2506
|
-
var
|
|
2702
|
+
var import_v438 = require("zod/v4");
|
|
2507
2703
|
|
|
2508
2704
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
2509
|
-
var
|
|
2510
|
-
var PostPurchaseSettings =
|
|
2511
|
-
advance:
|
|
2512
|
-
blocks:
|
|
2705
|
+
var import_v437 = require("zod/v4");
|
|
2706
|
+
var PostPurchaseSettings = import_v437.z.object({
|
|
2707
|
+
advance: import_v437.z.object({ removePartialOrder: import_v437.z.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
2708
|
+
blocks: import_v437.z.union([import_v437.z.array(PostPurchaseBlock), import_v437.z.unknown().transform(() => [])]).default(() => [
|
|
2513
2709
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
2514
2710
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
2515
2711
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
2516
2712
|
]),
|
|
2517
|
-
columnLayout:
|
|
2518
|
-
discount:
|
|
2713
|
+
columnLayout: import_v437.z.boolean().optional(),
|
|
2714
|
+
discount: import_v437.z.object({
|
|
2519
2715
|
amount: strictNumber.default(30),
|
|
2520
|
-
shouldShowSavingText:
|
|
2521
|
-
type:
|
|
2716
|
+
shouldShowSavingText: import_v437.z.boolean().optional().default(true),
|
|
2717
|
+
type: import_v437.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
2522
2718
|
}),
|
|
2523
|
-
discountedFrom:
|
|
2524
|
-
endpoint:
|
|
2525
|
-
integrations:
|
|
2526
|
-
judgeme:
|
|
2527
|
-
junip:
|
|
2528
|
-
klaviyo:
|
|
2529
|
-
loox:
|
|
2530
|
-
okendo:
|
|
2531
|
-
opinew:
|
|
2532
|
-
reviewsio:
|
|
2533
|
-
stamped:
|
|
2534
|
-
yotpo:
|
|
2719
|
+
discountedFrom: import_v437.z.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
2720
|
+
endpoint: import_v437.z.string().optional(),
|
|
2721
|
+
integrations: import_v437.z.object({
|
|
2722
|
+
judgeme: import_v437.z.boolean().default(false),
|
|
2723
|
+
junip: import_v437.z.boolean().optional().default(false),
|
|
2724
|
+
klaviyo: import_v437.z.boolean().default(false),
|
|
2725
|
+
loox: import_v437.z.boolean().default(false),
|
|
2726
|
+
okendo: import_v437.z.boolean().default(false),
|
|
2727
|
+
opinew: import_v437.z.boolean().optional().default(false),
|
|
2728
|
+
reviewsio: import_v437.z.boolean().optional().default(false),
|
|
2729
|
+
stamped: import_v437.z.boolean().default(false),
|
|
2730
|
+
yotpo: import_v437.z.boolean().default(false)
|
|
2535
2731
|
}),
|
|
2536
|
-
key:
|
|
2537
|
-
language:
|
|
2538
|
-
description:
|
|
2539
|
-
descriptionEnabled:
|
|
2540
|
-
descriptionRte:
|
|
2541
|
-
content:
|
|
2542
|
-
type:
|
|
2732
|
+
key: import_v437.z.string().optional(),
|
|
2733
|
+
language: import_v437.z.object({
|
|
2734
|
+
description: import_v437.z.union([import_v437.z.string(), import_v437.z.unknown().transform(() => "")]).default(""),
|
|
2735
|
+
descriptionEnabled: import_v437.z.boolean().optional().default(false),
|
|
2736
|
+
descriptionRte: import_v437.z.object({
|
|
2737
|
+
content: import_v437.z.array(import_v437.z.unknown()),
|
|
2738
|
+
type: import_v437.z.string()
|
|
2543
2739
|
}).optional(),
|
|
2544
|
-
descriptionSpacing:
|
|
2545
|
-
displayCtaPrice:
|
|
2546
|
-
global:
|
|
2547
|
-
declineAll:
|
|
2548
|
-
declineThisOffer:
|
|
2549
|
-
free:
|
|
2550
|
-
notAvailable:
|
|
2551
|
-
payNow:
|
|
2552
|
-
payNowUpgradeToSubscription:
|
|
2553
|
-
quantity:
|
|
2740
|
+
descriptionSpacing: import_v437.z.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
2741
|
+
displayCtaPrice: import_v437.z.boolean().default(true),
|
|
2742
|
+
global: import_v437.z.object({
|
|
2743
|
+
declineAll: import_v437.z.string().optional().default("Decline All"),
|
|
2744
|
+
declineThisOffer: import_v437.z.string().default("Decline this offer"),
|
|
2745
|
+
free: import_v437.z.string().optional().default("Free"),
|
|
2746
|
+
notAvailable: import_v437.z.string().optional().default("Not available"),
|
|
2747
|
+
payNow: import_v437.z.string().default("Pay Now"),
|
|
2748
|
+
payNowUpgradeToSubscription: import_v437.z.string().optional().default("Upgrade to Subscription"),
|
|
2749
|
+
quantity: import_v437.z.string().default("Quantity"),
|
|
2554
2750
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2555
|
-
recurringShipping:
|
|
2556
|
-
recurringSubtotal:
|
|
2557
|
-
reviewsPlural:
|
|
2558
|
-
reviewsSingular:
|
|
2559
|
-
save:
|
|
2560
|
-
shipping:
|
|
2561
|
-
subscriptionOption:
|
|
2562
|
-
subtotal:
|
|
2563
|
-
taxes:
|
|
2564
|
-
total:
|
|
2751
|
+
recurringShipping: import_v437.z.string().optional().default("Recurring shipping"),
|
|
2752
|
+
recurringSubtotal: import_v437.z.string().default("Recurring subtotal"),
|
|
2753
|
+
reviewsPlural: import_v437.z.string().optional().default("Reviews"),
|
|
2754
|
+
reviewsSingular: import_v437.z.string().optional().default("Review"),
|
|
2755
|
+
save: import_v437.z.union([import_v437.z.string(), import_v437.z.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
2756
|
+
shipping: import_v437.z.string().default("Shipping"),
|
|
2757
|
+
subscriptionOption: import_v437.z.string().optional().default("Subscribe and Save"),
|
|
2758
|
+
subtotal: import_v437.z.string().default("Subtotal"),
|
|
2759
|
+
taxes: import_v437.z.string().default("Taxes"),
|
|
2760
|
+
total: import_v437.z.string().default("Total")
|
|
2565
2761
|
}).optional().default(() => ({
|
|
2566
2762
|
declineAll: "Decline All",
|
|
2567
2763
|
declineThisOffer: "Decline this offer",
|
|
@@ -2582,70 +2778,70 @@ var PostPurchaseSettings = import_v436.z.object({
|
|
|
2582
2778
|
taxes: "Taxes",
|
|
2583
2779
|
total: "Total"
|
|
2584
2780
|
})),
|
|
2585
|
-
globalTranslation:
|
|
2781
|
+
globalTranslation: import_v437.z.string().optional().default("english")
|
|
2586
2782
|
}),
|
|
2587
|
-
metafields:
|
|
2783
|
+
metafields: import_v437.z.boolean().default(false),
|
|
2588
2784
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2589
|
-
offer:
|
|
2590
|
-
count:
|
|
2785
|
+
offer: import_v437.z.object({
|
|
2786
|
+
count: import_v437.z.number().default(1)
|
|
2591
2787
|
}),
|
|
2592
|
-
offersLayout:
|
|
2593
|
-
itemsPerPage:
|
|
2594
|
-
type:
|
|
2788
|
+
offersLayout: import_v437.z.object({
|
|
2789
|
+
itemsPerPage: import_v437.z.number().optional(),
|
|
2790
|
+
type: import_v437.z.enum(["list", "grid", "carousel"]).default("list")
|
|
2595
2791
|
}).optional().default({
|
|
2596
2792
|
type: "list"
|
|
2597
2793
|
}),
|
|
2598
2794
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2599
|
-
previewMode:
|
|
2600
|
-
productLimit:
|
|
2601
|
-
productOptions:
|
|
2795
|
+
previewMode: import_v437.z.boolean().default(false),
|
|
2796
|
+
productLimit: import_v437.z.number().optional().default(1),
|
|
2797
|
+
productOptions: import_v437.z.object({
|
|
2602
2798
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2603
|
-
hideOutOfStockVariants:
|
|
2604
|
-
matchVariant:
|
|
2605
|
-
showDeclineAll:
|
|
2606
|
-
showShipping:
|
|
2607
|
-
showSubtotal:
|
|
2608
|
-
showTaxes:
|
|
2609
|
-
showTotal:
|
|
2610
|
-
showVariantSelectors:
|
|
2611
|
-
variantSelectorDisplayMode:
|
|
2799
|
+
hideOutOfStockVariants: import_v437.z.boolean().optional().default(false),
|
|
2800
|
+
matchVariant: import_v437.z.boolean().optional().default(true),
|
|
2801
|
+
showDeclineAll: import_v437.z.enum(["above", "below", "both", "none"]).optional(),
|
|
2802
|
+
showShipping: import_v437.z.boolean().optional().default(true),
|
|
2803
|
+
showSubtotal: import_v437.z.boolean().optional().default(true),
|
|
2804
|
+
showTaxes: import_v437.z.boolean().optional().default(true),
|
|
2805
|
+
showTotal: import_v437.z.boolean().optional().default(true),
|
|
2806
|
+
showVariantSelectors: import_v437.z.boolean().optional().default(true),
|
|
2807
|
+
variantSelectorDisplayMode: import_v437.z.enum(["separate", "single"]).optional().default("separate")
|
|
2612
2808
|
}),
|
|
2613
|
-
productType:
|
|
2614
|
-
productTypeSelector:
|
|
2615
|
-
quantityInputs:
|
|
2616
|
-
defaultQuantity:
|
|
2617
|
-
enabled:
|
|
2618
|
-
maxValue:
|
|
2619
|
-
minValue:
|
|
2809
|
+
productType: import_v437.z.union([import_v437.z.enum(["one-time", "subscription", "both"]), import_v437.z.literal("").transform(() => "one-time")]).default("one-time"),
|
|
2810
|
+
productTypeSelector: import_v437.z.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
2811
|
+
quantityInputs: import_v437.z.object({
|
|
2812
|
+
defaultQuantity: import_v437.z.union([import_v437.z.number(), import_v437.z.null().transform(() => 1)]).default(1),
|
|
2813
|
+
enabled: import_v437.z.boolean().default(true),
|
|
2814
|
+
maxValue: import_v437.z.union([import_v437.z.number(), import_v437.z.null().transform(() => 15)]).default(15),
|
|
2815
|
+
minValue: import_v437.z.union([import_v437.z.number().min(0), import_v437.z.unknown().transform(() => 0)]).default(1)
|
|
2620
2816
|
}),
|
|
2621
|
-
shipping:
|
|
2817
|
+
shipping: import_v437.z.object({
|
|
2622
2818
|
amount: strictNumber.default(10),
|
|
2623
2819
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2624
|
-
enabled:
|
|
2625
|
-
title:
|
|
2626
|
-
type:
|
|
2820
|
+
enabled: import_v437.z.boolean().default(true),
|
|
2821
|
+
title: import_v437.z.string().optional().default("Shipping Fees"),
|
|
2822
|
+
type: import_v437.z.enum(["free", "fixed_amount"]).default("free")
|
|
2627
2823
|
}),
|
|
2628
|
-
styles:
|
|
2629
|
-
starColor:
|
|
2630
|
-
starSize:
|
|
2631
|
-
starStrokeColor:
|
|
2632
|
-
strokeWidth:
|
|
2824
|
+
styles: import_v437.z.object({
|
|
2825
|
+
starColor: import_v437.z.string().optional().default("#fadb14"),
|
|
2826
|
+
starSize: import_v437.z.union([import_v437.z.enum(["small", "medium", "large"]), import_v437.z.unknown().transform(() => "large")]).optional().default("large"),
|
|
2827
|
+
starStrokeColor: import_v437.z.string().optional().default("#fadb14"),
|
|
2828
|
+
strokeWidth: import_v437.z.string().optional().default("1")
|
|
2633
2829
|
}).optional(),
|
|
2634
|
-
subImages:
|
|
2635
|
-
subscription:
|
|
2636
|
-
discount:
|
|
2830
|
+
subImages: import_v437.z.number().nullish().default(8),
|
|
2831
|
+
subscription: import_v437.z.object({
|
|
2832
|
+
discount: import_v437.z.object({
|
|
2637
2833
|
amount: strictNumber.default(30),
|
|
2638
|
-
shouldShowSavingText:
|
|
2639
|
-
type:
|
|
2834
|
+
shouldShowSavingText: import_v437.z.boolean().optional().default(true),
|
|
2835
|
+
type: import_v437.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
2640
2836
|
}),
|
|
2641
|
-
shipping:
|
|
2837
|
+
shipping: import_v437.z.object({
|
|
2642
2838
|
amount: strictNumber.default(1),
|
|
2643
2839
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2644
|
-
enabled:
|
|
2840
|
+
enabled: import_v437.z.boolean().default(true),
|
|
2645
2841
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2646
2842
|
recurringAmount: strictNumber.default(2),
|
|
2647
|
-
shippingTitle:
|
|
2648
|
-
type:
|
|
2843
|
+
shippingTitle: import_v437.z.string().default("Shipping Fees"),
|
|
2844
|
+
type: import_v437.z.enum(["free", "fixed_amount"]).default("free")
|
|
2649
2845
|
})
|
|
2650
2846
|
}).optional().default({
|
|
2651
2847
|
discount: {
|
|
@@ -2663,15 +2859,15 @@ var PostPurchaseSettings = import_v436.z.object({
|
|
|
2663
2859
|
type: "free"
|
|
2664
2860
|
}
|
|
2665
2861
|
}),
|
|
2666
|
-
subscriptionIsDefault:
|
|
2862
|
+
subscriptionIsDefault: import_v437.z.boolean().optional(),
|
|
2667
2863
|
/** This isn't configurable in the admin-nextjs editor */
|
|
2668
|
-
template:
|
|
2669
|
-
type:
|
|
2670
|
-
upgradeToSubscription:
|
|
2671
|
-
acceptButtonText:
|
|
2672
|
-
allow:
|
|
2673
|
-
emailRefundNotice:
|
|
2674
|
-
errorBannerText:
|
|
2864
|
+
template: import_v437.z.string().optional().default(""),
|
|
2865
|
+
type: import_v437.z.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
2866
|
+
upgradeToSubscription: import_v437.z.object({
|
|
2867
|
+
acceptButtonText: import_v437.z.string().optional().default("Upgrade"),
|
|
2868
|
+
allow: import_v437.z.boolean().optional().default(false),
|
|
2869
|
+
emailRefundNotice: import_v437.z.boolean().optional().default(false),
|
|
2870
|
+
errorBannerText: import_v437.z.string().optional().default("This subscription cannot be added - limit one per order")
|
|
2675
2871
|
}).optional().default(() => ({
|
|
2676
2872
|
acceptButtonText: "Upgrade",
|
|
2677
2873
|
allow: false,
|
|
@@ -2681,33 +2877,823 @@ var PostPurchaseSettings = import_v436.z.object({
|
|
|
2681
2877
|
});
|
|
2682
2878
|
|
|
2683
2879
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
2684
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
2685
|
-
id:
|
|
2686
|
-
name:
|
|
2687
|
-
});
|
|
2688
|
-
var PostPurchaseWidget =
|
|
2689
|
-
classification:
|
|
2690
|
-
createdAtTime:
|
|
2691
|
-
customEndpointName:
|
|
2692
|
-
id:
|
|
2693
|
-
lastViewed:
|
|
2694
|
-
linkedCustomEndpointId:
|
|
2695
|
-
linkedFlows:
|
|
2696
|
-
name:
|
|
2697
|
-
owner:
|
|
2880
|
+
var PostPurchaseWidgetLinkedFlow = import_v438.z.object({
|
|
2881
|
+
id: import_v438.z.number(),
|
|
2882
|
+
name: import_v438.z.string()
|
|
2883
|
+
});
|
|
2884
|
+
var PostPurchaseWidget = import_v438.z.object({
|
|
2885
|
+
classification: import_v438.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
2886
|
+
createdAtTime: import_v438.z.iso.datetime({ offset: true }).optional(),
|
|
2887
|
+
customEndpointName: import_v438.z.string().nullish(),
|
|
2888
|
+
id: import_v438.z.number().default(0),
|
|
2889
|
+
lastViewed: import_v438.z.iso.datetime({ offset: true }).nullish(),
|
|
2890
|
+
linkedCustomEndpointId: import_v438.z.number().nullish(),
|
|
2891
|
+
linkedFlows: import_v438.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
2892
|
+
name: import_v438.z.string().default(""),
|
|
2893
|
+
owner: import_v438.z.number().nullish(),
|
|
2698
2894
|
settings: PostPurchaseSettings
|
|
2699
2895
|
});
|
|
2700
2896
|
|
|
2701
2897
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
2702
|
-
var PostPurchaseOffer =
|
|
2703
|
-
|
|
2704
|
-
errors:
|
|
2705
|
-
message:
|
|
2706
|
-
successful:
|
|
2898
|
+
var PostPurchaseOffer = import_v439.z.discriminatedUnion("successful", [
|
|
2899
|
+
import_v439.z.strictObject({
|
|
2900
|
+
errors: import_v439.z.array(import_v439.z.object({ message: import_v439.z.string() })),
|
|
2901
|
+
message: import_v439.z.string(),
|
|
2902
|
+
successful: import_v439.z.literal(false)
|
|
2707
2903
|
}),
|
|
2708
|
-
|
|
2709
|
-
successful:
|
|
2904
|
+
import_v439.z.strictObject({
|
|
2905
|
+
successful: import_v439.z.literal(true),
|
|
2710
2906
|
widget: PostPurchaseWidget
|
|
2711
2907
|
})
|
|
2712
2908
|
]);
|
|
2909
|
+
|
|
2910
|
+
// src/transforms/contentBlockV1/stripContentBlockHtml.ts
|
|
2911
|
+
var HTML_COMMENT_RE = /<!--[\s\S]*?-->/g;
|
|
2912
|
+
var STRIPPED_ELEMENT_RE = /<(script|style|iframe|object|embed|noscript|template)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/gi;
|
|
2913
|
+
var HTML_TAG_RE = /<\/?[a-zA-Z][^>]*>/g;
|
|
2914
|
+
var stripContentBlockHtml = (text) => text.replace(HTML_COMMENT_RE, "").replace(STRIPPED_ELEMENT_RE, "").replace(HTML_TAG_RE, "");
|
|
2915
|
+
|
|
2916
|
+
// src/transforms/contentBlockV1/convertTextToTiptapParagraph.ts
|
|
2917
|
+
var convertTextToTiptapParagraph = ({
|
|
2918
|
+
color,
|
|
2919
|
+
fontSize,
|
|
2920
|
+
marks = [],
|
|
2921
|
+
text,
|
|
2922
|
+
textAlign
|
|
2923
|
+
}) => {
|
|
2924
|
+
const sanitizedText = stripContentBlockHtml(text);
|
|
2925
|
+
return TiptapParagraph.parse({
|
|
2926
|
+
attrs: { textAlign },
|
|
2927
|
+
content: sanitizedText ? [
|
|
2928
|
+
{
|
|
2929
|
+
marks: [{ attrs: { color, fontSize }, type: "textStyle" }, ...marks],
|
|
2930
|
+
text: sanitizedText,
|
|
2931
|
+
type: "text"
|
|
2932
|
+
}
|
|
2933
|
+
] : [],
|
|
2934
|
+
type: "paragraph"
|
|
2935
|
+
});
|
|
2936
|
+
};
|
|
2937
|
+
|
|
2938
|
+
// src/transforms/contentBlockV1/convertContentBlockTextToV2.ts
|
|
2939
|
+
var convertContentBlockTextToV2 = (language) => {
|
|
2940
|
+
const description = language?.description;
|
|
2941
|
+
const superTitle = language?.superTitle;
|
|
2942
|
+
const title = language?.title;
|
|
2943
|
+
return TiptapDocument.parse({
|
|
2944
|
+
attrs: { blockSpacing: "tight" },
|
|
2945
|
+
content: [
|
|
2946
|
+
superTitle ? convertTextToTiptapParagraph({
|
|
2947
|
+
color: "base",
|
|
2948
|
+
fontSize: "extraLarge",
|
|
2949
|
+
marks: [{ type: "bold" }],
|
|
2950
|
+
text: superTitle,
|
|
2951
|
+
textAlign: "center"
|
|
2952
|
+
}) : null,
|
|
2953
|
+
title ? convertTextToTiptapParagraph({
|
|
2954
|
+
color: "base",
|
|
2955
|
+
fontSize: "medium",
|
|
2956
|
+
marks: [{ type: "bold" }],
|
|
2957
|
+
text: title,
|
|
2958
|
+
textAlign: "center"
|
|
2959
|
+
}) : null,
|
|
2960
|
+
description ? convertTextToTiptapParagraph({
|
|
2961
|
+
color: "base",
|
|
2962
|
+
fontSize: "base",
|
|
2963
|
+
text: description,
|
|
2964
|
+
textAlign: "center"
|
|
2965
|
+
}) : null
|
|
2966
|
+
].filter((p) => p !== null),
|
|
2967
|
+
type: "doc"
|
|
2968
|
+
});
|
|
2969
|
+
};
|
|
2970
|
+
|
|
2971
|
+
// src/transforms/offerV1/offerTemplateSeed.ts
|
|
2972
|
+
var OFFER_TEMPLATE_SEED = {
|
|
2973
|
+
alignment: {
|
|
2974
|
+
horizontal: "center",
|
|
2975
|
+
vertical: "top"
|
|
2976
|
+
},
|
|
2977
|
+
border: {
|
|
2978
|
+
radius: "base",
|
|
2979
|
+
style: "none",
|
|
2980
|
+
width: "thick"
|
|
2981
|
+
},
|
|
2982
|
+
direction: "rows",
|
|
2983
|
+
editorMode: "checkoutExtension",
|
|
2984
|
+
grid: {
|
|
2985
|
+
columns: ["auto"],
|
|
2986
|
+
rows: ["auto"]
|
|
2987
|
+
},
|
|
2988
|
+
padding: "tight",
|
|
2989
|
+
previewMode: false,
|
|
2990
|
+
sections: [
|
|
2991
|
+
{
|
|
2992
|
+
alignment: {
|
|
2993
|
+
horizontal: "end",
|
|
2994
|
+
vertical: "top"
|
|
2995
|
+
},
|
|
2996
|
+
autoAdvanceInterval: 0,
|
|
2997
|
+
border: {
|
|
2998
|
+
radius: "base",
|
|
2999
|
+
style: "none",
|
|
3000
|
+
width: "base"
|
|
3001
|
+
},
|
|
3002
|
+
direction: "rows",
|
|
3003
|
+
grid: {
|
|
3004
|
+
columns: ["auto"],
|
|
3005
|
+
rows: ["auto", "auto"]
|
|
3006
|
+
},
|
|
3007
|
+
itemsAtOnce: 2,
|
|
3008
|
+
padding: "none",
|
|
3009
|
+
sections: [
|
|
3010
|
+
{
|
|
3011
|
+
alignment: {
|
|
3012
|
+
horizontal: "start",
|
|
3013
|
+
vertical: "middle"
|
|
3014
|
+
},
|
|
3015
|
+
border: {
|
|
3016
|
+
radius: "base",
|
|
3017
|
+
style: "none",
|
|
3018
|
+
width: "base"
|
|
3019
|
+
},
|
|
3020
|
+
direction: "columns",
|
|
3021
|
+
grid: {
|
|
3022
|
+
columns: ["auto", "auto"],
|
|
3023
|
+
rows: ["auto"]
|
|
3024
|
+
},
|
|
3025
|
+
name: "pagination",
|
|
3026
|
+
padding: "none",
|
|
3027
|
+
sections: [
|
|
3028
|
+
{
|
|
3029
|
+
action: "goToPrevPage",
|
|
3030
|
+
buttonStyle: "plain",
|
|
3031
|
+
disableDowngrade: false,
|
|
3032
|
+
popover: {
|
|
3033
|
+
alignment: "center",
|
|
3034
|
+
position: "blockStart"
|
|
3035
|
+
},
|
|
3036
|
+
sections: [
|
|
3037
|
+
{
|
|
3038
|
+
buttonField: "buttonLabel",
|
|
3039
|
+
content: {
|
|
3040
|
+
ar: "\u2039",
|
|
3041
|
+
cs: "\u2039",
|
|
3042
|
+
da: "\u2039",
|
|
3043
|
+
de: "\u2039",
|
|
3044
|
+
en: "\u2039",
|
|
3045
|
+
es: "\u2039",
|
|
3046
|
+
fi: "\u2039",
|
|
3047
|
+
fr: "\u2039",
|
|
3048
|
+
ga: "\u2039",
|
|
3049
|
+
he: "\u2039",
|
|
3050
|
+
hi: "\u2039",
|
|
3051
|
+
id: "\u2039",
|
|
3052
|
+
it: "\u2039",
|
|
3053
|
+
ja: "\u2039",
|
|
3054
|
+
ko: "\u2039",
|
|
3055
|
+
nl: "\u2039",
|
|
3056
|
+
no: "\u2039",
|
|
3057
|
+
pl: "\u2039",
|
|
3058
|
+
pt: "\u2039",
|
|
3059
|
+
ru: "\u2039",
|
|
3060
|
+
sv: "\u2039",
|
|
3061
|
+
th: "\u2039",
|
|
3062
|
+
tr: "\u2039",
|
|
3063
|
+
uk: "\u2039",
|
|
3064
|
+
vi: "\u2039",
|
|
3065
|
+
zh: "\u2039"
|
|
3066
|
+
},
|
|
3067
|
+
sectionType: "text"
|
|
3068
|
+
}
|
|
3069
|
+
],
|
|
3070
|
+
sectionType: "button"
|
|
3071
|
+
},
|
|
3072
|
+
{
|
|
3073
|
+
action: "goToNextPage",
|
|
3074
|
+
buttonStyle: "plain",
|
|
3075
|
+
disableDowngrade: false,
|
|
3076
|
+
popover: {
|
|
3077
|
+
alignment: "center",
|
|
3078
|
+
position: "blockStart"
|
|
3079
|
+
},
|
|
3080
|
+
sections: [
|
|
3081
|
+
{
|
|
3082
|
+
buttonField: "buttonLabel",
|
|
3083
|
+
content: {
|
|
3084
|
+
ar: "\u203A",
|
|
3085
|
+
cs: "\u203A",
|
|
3086
|
+
da: "\u203A",
|
|
3087
|
+
de: "\u203A",
|
|
3088
|
+
en: "\u203A",
|
|
3089
|
+
es: "\u203A",
|
|
3090
|
+
fi: "\u203A",
|
|
3091
|
+
fr: "\u203A",
|
|
3092
|
+
ga: "\u203A",
|
|
3093
|
+
he: "\u203A",
|
|
3094
|
+
hi: "\u203A",
|
|
3095
|
+
id: "\u203A",
|
|
3096
|
+
it: "\u203A",
|
|
3097
|
+
ja: "\u203A",
|
|
3098
|
+
ko: "\u203A",
|
|
3099
|
+
nl: "\u203A",
|
|
3100
|
+
no: "\u203A",
|
|
3101
|
+
pl: "\u203A",
|
|
3102
|
+
pt: "\u203A",
|
|
3103
|
+
ru: "\u203A",
|
|
3104
|
+
sv: "\u203A",
|
|
3105
|
+
th: "\u203A",
|
|
3106
|
+
tr: "\u203A",
|
|
3107
|
+
uk: "\u203A",
|
|
3108
|
+
vi: "\u203A",
|
|
3109
|
+
zh: "\u203A"
|
|
3110
|
+
},
|
|
3111
|
+
sectionType: "text"
|
|
3112
|
+
}
|
|
3113
|
+
],
|
|
3114
|
+
sectionType: "button"
|
|
3115
|
+
}
|
|
3116
|
+
],
|
|
3117
|
+
sectionType: "layout",
|
|
3118
|
+
spacing: "base",
|
|
3119
|
+
width: 100
|
|
3120
|
+
},
|
|
3121
|
+
{
|
|
3122
|
+
alignment: {
|
|
3123
|
+
horizontal: "start",
|
|
3124
|
+
vertical: "middle"
|
|
3125
|
+
},
|
|
3126
|
+
border: {
|
|
3127
|
+
radius: "base",
|
|
3128
|
+
style: "base",
|
|
3129
|
+
width: "base"
|
|
3130
|
+
},
|
|
3131
|
+
direction: "rows",
|
|
3132
|
+
grid: {
|
|
3133
|
+
columns: ["15%"],
|
|
3134
|
+
rows: ["auto", "auto"]
|
|
3135
|
+
},
|
|
3136
|
+
padding: "base",
|
|
3137
|
+
sections: [
|
|
3138
|
+
{
|
|
3139
|
+
alignment: {
|
|
3140
|
+
horizontal: "start",
|
|
3141
|
+
vertical: "middle"
|
|
3142
|
+
},
|
|
3143
|
+
border: {
|
|
3144
|
+
radius: "base",
|
|
3145
|
+
style: "none",
|
|
3146
|
+
width: "base"
|
|
3147
|
+
},
|
|
3148
|
+
direction: "grid",
|
|
3149
|
+
grid: {
|
|
3150
|
+
columns: ["15%", "fill", "auto"],
|
|
3151
|
+
rows: ["auto"]
|
|
3152
|
+
},
|
|
3153
|
+
padding: "none",
|
|
3154
|
+
sections: [
|
|
3155
|
+
{
|
|
3156
|
+
altText: "",
|
|
3157
|
+
aspectRatio: null,
|
|
3158
|
+
border: {
|
|
3159
|
+
radius: "base",
|
|
3160
|
+
style: "none",
|
|
3161
|
+
width: "base"
|
|
3162
|
+
},
|
|
3163
|
+
category: null,
|
|
3164
|
+
name: "Product Image",
|
|
3165
|
+
naturalHeight: 0,
|
|
3166
|
+
naturalWidth: 0,
|
|
3167
|
+
objectFit: "cover",
|
|
3168
|
+
sectionType: "image",
|
|
3169
|
+
source: "{{productImage}}",
|
|
3170
|
+
width: 100
|
|
3171
|
+
},
|
|
3172
|
+
{
|
|
3173
|
+
content: {
|
|
3174
|
+
en: {
|
|
3175
|
+
attrs: {
|
|
3176
|
+
blockSpacing: "none"
|
|
3177
|
+
},
|
|
3178
|
+
content: [
|
|
3179
|
+
{
|
|
3180
|
+
attrs: {
|
|
3181
|
+
textAlign: "start"
|
|
3182
|
+
},
|
|
3183
|
+
content: [
|
|
3184
|
+
{
|
|
3185
|
+
marks: [
|
|
3186
|
+
{
|
|
3187
|
+
attrs: {
|
|
3188
|
+
color: "base",
|
|
3189
|
+
fontSize: "medium"
|
|
3190
|
+
},
|
|
3191
|
+
type: "textStyle"
|
|
3192
|
+
},
|
|
3193
|
+
{
|
|
3194
|
+
type: "bold"
|
|
3195
|
+
}
|
|
3196
|
+
],
|
|
3197
|
+
text: "{{productAndVariantTitle}}",
|
|
3198
|
+
type: "text"
|
|
3199
|
+
}
|
|
3200
|
+
],
|
|
3201
|
+
type: "paragraph"
|
|
3202
|
+
},
|
|
3203
|
+
{
|
|
3204
|
+
attrs: {
|
|
3205
|
+
textAlign: "start"
|
|
3206
|
+
},
|
|
3207
|
+
content: [
|
|
3208
|
+
{
|
|
3209
|
+
marks: [
|
|
3210
|
+
{
|
|
3211
|
+
attrs: {
|
|
3212
|
+
color: "accent",
|
|
3213
|
+
fontSize: "medium"
|
|
3214
|
+
},
|
|
3215
|
+
type: "textStyle"
|
|
3216
|
+
}
|
|
3217
|
+
],
|
|
3218
|
+
text: "{{variantPrice}}",
|
|
3219
|
+
type: "text"
|
|
3220
|
+
}
|
|
3221
|
+
],
|
|
3222
|
+
type: "paragraph"
|
|
3223
|
+
}
|
|
3224
|
+
],
|
|
3225
|
+
type: "doc"
|
|
3226
|
+
}
|
|
3227
|
+
},
|
|
3228
|
+
name: "Product Info",
|
|
3229
|
+
sectionType: "text"
|
|
3230
|
+
},
|
|
3231
|
+
{
|
|
3232
|
+
action: "addToOrder",
|
|
3233
|
+
buttonStyle: "primary",
|
|
3234
|
+
disableDowngrade: false,
|
|
3235
|
+
popover: {
|
|
3236
|
+
alignment: "center",
|
|
3237
|
+
position: "blockStart"
|
|
3238
|
+
},
|
|
3239
|
+
sections: [
|
|
3240
|
+
{
|
|
3241
|
+
buttonField: "addingToCart",
|
|
3242
|
+
content: {
|
|
3243
|
+
ar: "\u064A\u062A\u0645 \u0627\u0644\u0625\u0636\u0627\u0641\u0629 \u0625\u0644\u0649 \u0627\u0644\u0633\u0644\u0629",
|
|
3244
|
+
cs: "P\u0159id\xE1v\xE1m do ko\u0161\xEDku",
|
|
3245
|
+
da: "Tilf\xF8jer til kurv",
|
|
3246
|
+
de: "Wird zum Warenkorb hinzugef\xFCgt",
|
|
3247
|
+
en: "Adding...",
|
|
3248
|
+
es: "Agregando al carrito",
|
|
3249
|
+
fi: "Lis\xE4t\xE4\xE4n ostoskoriin",
|
|
3250
|
+
fr: "Ajout au panier",
|
|
3251
|
+
ga: "\xC1 Chur le Cairt",
|
|
3252
|
+
he: "\u05DE\u05D5\u05E1\u05D9\u05E3 \u05DC\u05E2\u05D2\u05DC\u05D4",
|
|
3253
|
+
hi: "\u0915\u093E\u0930\u094D\u091F \u092E\u0947\u0902 \u091C\u094B\u0921\u093C \u0930\u0939\u0947 \u0939\u0948\u0902",
|
|
3254
|
+
id: "Menambahkan ke Keranjang",
|
|
3255
|
+
it: "Aggiungendo al carrello",
|
|
3256
|
+
ja: "\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0\u4E2D",
|
|
3257
|
+
ko: "\uC7A5\uBC14\uAD6C\uB2C8\uC5D0 \uCD94\uAC00 \uC911",
|
|
3258
|
+
nl: "Toevoegen aan winkelwagen",
|
|
3259
|
+
no: "Legger i handlekurv",
|
|
3260
|
+
pl: "Dodaj\u0119 do koszyka",
|
|
3261
|
+
pt: "Adicionando ao carrinho",
|
|
3262
|
+
ru: "\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443",
|
|
3263
|
+
sv: "L\xE4gger till i varukorg",
|
|
3264
|
+
th: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E43\u0E19\u0E23\u0E16\u0E40\u0E02\u0E47\u0E19",
|
|
3265
|
+
tr: "Sepete Ekleniyor",
|
|
3266
|
+
uk: "\u0414\u043E\u0434\u0430\u0454\u043C\u043E \u0434\u043E \u043A\u043E\u0448\u0438\u043A\u0430",
|
|
3267
|
+
vi: "\u0110ang th\xEAm v\xE0o gi\u1ECF h\xE0ng",
|
|
3268
|
+
zh: "\u6B63\u5728\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
3269
|
+
},
|
|
3270
|
+
sectionType: "text"
|
|
3271
|
+
},
|
|
3272
|
+
{
|
|
3273
|
+
buttonField: "addToCart",
|
|
3274
|
+
content: {
|
|
3275
|
+
ar: "\u0623\u0636\u0641 \u0625\u0644\u0649 \u0627\u0644\u0633\u0644\u0629",
|
|
3276
|
+
cs: "P\u0159idat do ko\u0161\xEDku",
|
|
3277
|
+
da: "F\xF8j til kurv",
|
|
3278
|
+
de: "In den Warenkorb",
|
|
3279
|
+
en: "Add",
|
|
3280
|
+
es: "Agregar al carrito",
|
|
3281
|
+
fi: "Lis\xE4\xE4 ostoskoriin",
|
|
3282
|
+
fr: "Ajouter au panier",
|
|
3283
|
+
ga: "Cuir le Cairt",
|
|
3284
|
+
he: "\u05D4\u05D5\u05E1\u05E3 \u05DC\u05E2\u05D2\u05DC\u05D4",
|
|
3285
|
+
hi: "\u0915\u093E\u0930\u094D\u091F \u092E\u0947\u0902 \u091C\u094B\u0921\u093C\u0947\u0902",
|
|
3286
|
+
id: "Tambah ke Keranjang",
|
|
3287
|
+
it: "Aggiungi al carrello",
|
|
3288
|
+
ja: "\u30AB\u30FC\u30C8\u306B\u8FFD\u52A0",
|
|
3289
|
+
ko: "\uC7A5\uBC14\uAD6C\uB2C8\uC5D0 \uCD94\uAC00",
|
|
3290
|
+
nl: "Toevoegen aan winkelwagen",
|
|
3291
|
+
no: "Legg i handlekurv",
|
|
3292
|
+
pl: "Dodaj do koszyka",
|
|
3293
|
+
pt: "Adicionar ao carrinho",
|
|
3294
|
+
ru: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u0440\u0437\u0438\u043D\u0443",
|
|
3295
|
+
sv: "L\xE4gg i varukorg",
|
|
3296
|
+
th: "\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E25\u0E07\u0E43\u0E19\u0E23\u0E16\u0E40\u0E02\u0E47\u0E19",
|
|
3297
|
+
tr: "Sepete Ekle",
|
|
3298
|
+
uk: "\u0414\u043E\u0434\u0430\u0442\u0438 \u0434\u043E \u043A\u043E\u0448\u0438\u043A\u0430",
|
|
3299
|
+
vi: "Th\xEAm v\xE0o gi\u1ECF h\xE0ng",
|
|
3300
|
+
zh: "\u52A0\u5165\u8D2D\u7269\u8F66"
|
|
3301
|
+
},
|
|
3302
|
+
sectionType: "text"
|
|
3303
|
+
}
|
|
3304
|
+
],
|
|
3305
|
+
sectionType: "button"
|
|
3306
|
+
}
|
|
3307
|
+
],
|
|
3308
|
+
sectionType: "layout",
|
|
3309
|
+
spacing: "base",
|
|
3310
|
+
width: 100
|
|
3311
|
+
},
|
|
3312
|
+
{
|
|
3313
|
+
alignment: {
|
|
3314
|
+
horizontal: "start",
|
|
3315
|
+
vertical: "top"
|
|
3316
|
+
},
|
|
3317
|
+
border: {
|
|
3318
|
+
radius: "base",
|
|
3319
|
+
style: "none",
|
|
3320
|
+
width: "base"
|
|
3321
|
+
},
|
|
3322
|
+
direction: "rows",
|
|
3323
|
+
grid: {
|
|
3324
|
+
columns: ["auto"],
|
|
3325
|
+
rows: ["auto"]
|
|
3326
|
+
},
|
|
3327
|
+
padding: "none",
|
|
3328
|
+
sections: [
|
|
3329
|
+
{
|
|
3330
|
+
errorMessages: {
|
|
3331
|
+
en: {
|
|
3332
|
+
max: "Maximum quantity allowed is {{max}}",
|
|
3333
|
+
min: "Minimum quantity required is {{min}}",
|
|
3334
|
+
neg: "Quantity cannot be negative"
|
|
3335
|
+
}
|
|
3336
|
+
},
|
|
3337
|
+
inputType: "select",
|
|
3338
|
+
max: 10,
|
|
3339
|
+
min: 1,
|
|
3340
|
+
sectionType: "quantity"
|
|
3341
|
+
}
|
|
3342
|
+
],
|
|
3343
|
+
sectionType: "layout",
|
|
3344
|
+
spacing: "base",
|
|
3345
|
+
width: 100
|
|
3346
|
+
},
|
|
3347
|
+
{
|
|
3348
|
+
limit: 3,
|
|
3349
|
+
sectionType: "dataSource"
|
|
3350
|
+
},
|
|
3351
|
+
{
|
|
3352
|
+
sectionType: "products"
|
|
3353
|
+
}
|
|
3354
|
+
],
|
|
3355
|
+
sectionType: "offers",
|
|
3356
|
+
spacing: "base",
|
|
3357
|
+
width: 100
|
|
3358
|
+
}
|
|
3359
|
+
],
|
|
3360
|
+
sectionType: "carousel",
|
|
3361
|
+
spacing: "base",
|
|
3362
|
+
width: 100
|
|
3363
|
+
}
|
|
3364
|
+
],
|
|
3365
|
+
sectionType: "layout",
|
|
3366
|
+
spacing: "base",
|
|
3367
|
+
targetArea: {
|
|
3368
|
+
icon: "splitscreen_left",
|
|
3369
|
+
label: "Main Column",
|
|
3370
|
+
width: "503px"
|
|
3371
|
+
},
|
|
3372
|
+
type: "shopify_checkout_extension",
|
|
3373
|
+
version: 2,
|
|
3374
|
+
width: 100
|
|
3375
|
+
};
|
|
3376
|
+
|
|
3377
|
+
// src/transforms/offerV1/types.ts
|
|
3378
|
+
var SHOPIFY_CHECKOUT_EXTENSION = "shopify_checkout_extension";
|
|
3379
|
+
var isOfferV1 = (data) => {
|
|
3380
|
+
if (!data || typeof data !== "object") return false;
|
|
3381
|
+
return data.type === SHOPIFY_CHECKOUT_EXTENSION;
|
|
3382
|
+
};
|
|
3383
|
+
|
|
3384
|
+
// src/transforms/offerV1/buildOfferTemplate.ts
|
|
3385
|
+
var LOCATION_TO_EDITOR_MODE = {
|
|
3386
|
+
checkout: "checkoutExtension",
|
|
3387
|
+
"order-status": "orderStatusPage",
|
|
3388
|
+
"thank-you": "thankYouPage"
|
|
3389
|
+
};
|
|
3390
|
+
var buildOfferTemplate = ({ location: location2, name } = {}) => CABRootSection.parse({
|
|
3391
|
+
...OFFER_TEMPLATE_SEED,
|
|
3392
|
+
editorMode: LOCATION_TO_EDITOR_MODE[location2 ?? "checkout"],
|
|
3393
|
+
...name && { name },
|
|
3394
|
+
previewMode: false,
|
|
3395
|
+
type: SHOPIFY_CHECKOUT_EXTENSION
|
|
3396
|
+
});
|
|
3397
|
+
|
|
3398
|
+
// src/transforms/offerV1/offerCard.ts
|
|
3399
|
+
var VARIANT_SELECTOR = { button: "button", radio: "radio", select: "menu" };
|
|
3400
|
+
var localizedContent = (defaults, override) => {
|
|
3401
|
+
const trimmed = override?.trim();
|
|
3402
|
+
return trimmed ? { ...defaults, en: trimmed } : defaults;
|
|
3403
|
+
};
|
|
3404
|
+
var buildStyledText = (token, style, color = "base") => {
|
|
3405
|
+
const marks = [
|
|
3406
|
+
{ attrs: { color, fontSize: style?.textSize ?? "base" }, type: "textStyle" }
|
|
3407
|
+
];
|
|
3408
|
+
if (style?.textEmphasis === "bold") marks.push({ type: "bold" });
|
|
3409
|
+
if (style?.textEmphasis === "italic") marks.push({ type: "italic" });
|
|
3410
|
+
return { content: [{ content: [{ marks, text: token, type: "text" }], type: "paragraph" }], type: "doc" };
|
|
3411
|
+
};
|
|
3412
|
+
var buildPriceContent = (settings) => {
|
|
3413
|
+
const content = [{ text: "{{variantPrice}}", type: "text" }];
|
|
3414
|
+
if (settings.discount?.showSavingAmount !== false) {
|
|
3415
|
+
content.push(
|
|
3416
|
+
{ text: " ", type: "text" },
|
|
3417
|
+
{
|
|
3418
|
+
marks: [{ type: "strike" }, { attrs: { color: "subdued" }, type: "textStyle" }],
|
|
3419
|
+
text: "{{variantCompareAtPrice}}",
|
|
3420
|
+
type: "text"
|
|
3421
|
+
}
|
|
3422
|
+
);
|
|
3423
|
+
}
|
|
3424
|
+
return { content: [{ content, type: "paragraph" }], type: "doc" };
|
|
3425
|
+
};
|
|
3426
|
+
var buildReviews = (settings) => {
|
|
3427
|
+
if (!settings.integrations || !Object.values(settings.integrations).some(Boolean)) return [];
|
|
3428
|
+
const reviews = settings.displaySettings?.reviews;
|
|
3429
|
+
return [
|
|
3430
|
+
{
|
|
3431
|
+
...reviews?.color && { color: reviews.color },
|
|
3432
|
+
sectionType: "reviews",
|
|
3433
|
+
...reviews?.size && { size: reviews.size }
|
|
3434
|
+
}
|
|
3435
|
+
];
|
|
3436
|
+
};
|
|
3437
|
+
var buildImage = (settings) => ({
|
|
3438
|
+
...settings.displaySettings?.image?.imageFit && {
|
|
3439
|
+
objectFit: settings.displaySettings.image.imageFit
|
|
3440
|
+
},
|
|
3441
|
+
sectionType: "image",
|
|
3442
|
+
source: settings.images?.source === "product" ? "{{productImage}}" : "{{variantImage}}",
|
|
3443
|
+
width: 100
|
|
3444
|
+
});
|
|
3445
|
+
var buildTitle = (settings) => ({
|
|
3446
|
+
content: { en: buildStyledText("{{productTitle}}", settings.displaySettings?.product) },
|
|
3447
|
+
sectionType: "text"
|
|
3448
|
+
});
|
|
3449
|
+
var buildPrice = (settings) => ({
|
|
3450
|
+
content: { en: buildPriceContent(settings) },
|
|
3451
|
+
sectionType: "text"
|
|
3452
|
+
});
|
|
3453
|
+
var buildVariantTitle = (settings) => {
|
|
3454
|
+
const show = settings.productOptions?.showVariantTitle;
|
|
3455
|
+
if (!show || show === "hide") return [];
|
|
3456
|
+
return [
|
|
3457
|
+
{
|
|
3458
|
+
content: { en: buildStyledText("{{variantTitle}}", settings.displaySettings?.variant) },
|
|
3459
|
+
sectionType: "text"
|
|
3460
|
+
}
|
|
3461
|
+
];
|
|
3462
|
+
};
|
|
3463
|
+
var buildDescription = (settings) => {
|
|
3464
|
+
const show = settings.productOptions?.showProductDescription;
|
|
3465
|
+
if (!show || show === "hide") return [];
|
|
3466
|
+
return [{ content: { en: buildStyledText("{{productDescription}}", void 0) }, sectionType: "text" }];
|
|
3467
|
+
};
|
|
3468
|
+
var buildVariants = (settings) => {
|
|
3469
|
+
if (settings.productOptions?.showVariantOptions === "never") return [];
|
|
3470
|
+
const selector = settings.viewOptions?.variantSelector;
|
|
3471
|
+
return [
|
|
3472
|
+
{
|
|
3473
|
+
hideOutOfStockVariants: !!settings.productOptions?.hideOutOfStockVariants,
|
|
3474
|
+
...selector && { selector: VARIANT_SELECTOR[selector] },
|
|
3475
|
+
sectionType: "variants"
|
|
3476
|
+
}
|
|
3477
|
+
];
|
|
3478
|
+
};
|
|
3479
|
+
var QUANTITY_INPUT_TYPE = {
|
|
3480
|
+
"buttons-manual-input": "number",
|
|
3481
|
+
"dropdown-select": "select"
|
|
3482
|
+
};
|
|
3483
|
+
var buildQuantityErrors = (quantity) => {
|
|
3484
|
+
const en = {
|
|
3485
|
+
...quantity.maxError && { max: quantity.maxError },
|
|
3486
|
+
...quantity.minError && { min: quantity.minError },
|
|
3487
|
+
...quantity.negativeError && { neg: quantity.negativeError }
|
|
3488
|
+
};
|
|
3489
|
+
return Object.keys(en).length ? { errorMessages: { en } } : {};
|
|
3490
|
+
};
|
|
3491
|
+
var buildQuantity = (settings) => {
|
|
3492
|
+
const quantity = settings.quantityInputs;
|
|
3493
|
+
if (!quantity?.enabled) return [];
|
|
3494
|
+
const inputType = quantity.type ? QUANTITY_INPUT_TYPE[quantity.type] : void 0;
|
|
3495
|
+
return [
|
|
3496
|
+
{
|
|
3497
|
+
...buildQuantityErrors(quantity),
|
|
3498
|
+
...inputType && { inputType },
|
|
3499
|
+
max: quantity.maxValue ?? 10,
|
|
3500
|
+
min: quantity.minValue ?? 1,
|
|
3501
|
+
sectionType: "quantity"
|
|
3502
|
+
}
|
|
3503
|
+
];
|
|
3504
|
+
};
|
|
3505
|
+
var buildSubscriptionButton = (settings) => {
|
|
3506
|
+
if (settings.productType !== "both" && settings.productType !== "subscription") return [];
|
|
3507
|
+
const language = settings.language;
|
|
3508
|
+
const slot = (buttonField, override) => ({
|
|
3509
|
+
buttonField,
|
|
3510
|
+
content: localizedContent(SWITCH_LABELS[buttonField], override),
|
|
3511
|
+
sectionType: "text"
|
|
3512
|
+
});
|
|
3513
|
+
return [
|
|
3514
|
+
{
|
|
3515
|
+
action: "switchToSubscription",
|
|
3516
|
+
buttonStyle: "plain",
|
|
3517
|
+
sections: [
|
|
3518
|
+
slot("subscriptionOption", void 0),
|
|
3519
|
+
slot("switchToOneTimePurchase", language?.cartSwitchToOnetime),
|
|
3520
|
+
slot("switchToSubscriptionNoDiscount", language?.cartSwitchToSubscription),
|
|
3521
|
+
slot("switchToSubscriptionWithDiscount", language?.upgradeToSubscription)
|
|
3522
|
+
],
|
|
3523
|
+
sectionType: "button"
|
|
3524
|
+
}
|
|
3525
|
+
];
|
|
3526
|
+
};
|
|
3527
|
+
var BUTTON_KINDS = ["plain", "primary", "secondary"];
|
|
3528
|
+
var buildAddButton = (settings) => {
|
|
3529
|
+
const kind = settings.button?.kind;
|
|
3530
|
+
const slot = (buttonField, override) => ({
|
|
3531
|
+
buttonField,
|
|
3532
|
+
content: localizedContent(OFFER_LABELS[buttonField], override),
|
|
3533
|
+
sectionType: "text"
|
|
3534
|
+
});
|
|
3535
|
+
return {
|
|
3536
|
+
action: "addToOrder",
|
|
3537
|
+
buttonStyle: BUTTON_KINDS.includes(kind) ? kind : "primary",
|
|
3538
|
+
sections: [
|
|
3539
|
+
slot("addToCart", settings.language?.addToCart),
|
|
3540
|
+
slot("addingToCart", settings.language?.addingToCart),
|
|
3541
|
+
slot("addedToCart", settings.language?.addedToCart),
|
|
3542
|
+
slot("soldOut", settings.language?.soldOutLabel)
|
|
3543
|
+
],
|
|
3544
|
+
sectionType: "button"
|
|
3545
|
+
};
|
|
3546
|
+
};
|
|
3547
|
+
var rowsLayout = (sections) => ({
|
|
3548
|
+
direction: "rows",
|
|
3549
|
+
sections,
|
|
3550
|
+
sectionType: "layout"
|
|
3551
|
+
});
|
|
3552
|
+
var buildOfferCard = (settings, horizontal) => {
|
|
3553
|
+
const image = buildImage(settings);
|
|
3554
|
+
const title = buildTitle(settings);
|
|
3555
|
+
const variantTitle = buildVariantTitle(settings);
|
|
3556
|
+
const price = buildPrice(settings);
|
|
3557
|
+
const description = buildDescription(settings);
|
|
3558
|
+
const reviews = buildReviews(settings);
|
|
3559
|
+
const variants = buildVariants(settings);
|
|
3560
|
+
const quantity = buildQuantity(settings);
|
|
3561
|
+
const subscription = buildSubscriptionButton(settings);
|
|
3562
|
+
const addButton = buildAddButton(settings);
|
|
3563
|
+
if (!horizontal) {
|
|
3564
|
+
return [
|
|
3565
|
+
image,
|
|
3566
|
+
title,
|
|
3567
|
+
...variantTitle,
|
|
3568
|
+
price,
|
|
3569
|
+
...description,
|
|
3570
|
+
...reviews,
|
|
3571
|
+
...variants,
|
|
3572
|
+
...quantity,
|
|
3573
|
+
...subscription,
|
|
3574
|
+
addButton
|
|
3575
|
+
];
|
|
3576
|
+
}
|
|
3577
|
+
const info = rowsLayout([title, ...variantTitle, price, ...description, ...reviews, ...variants]);
|
|
3578
|
+
const actions = [...subscription, addButton];
|
|
3579
|
+
const actionsCell = actions.length === 1 ? actions[0] : rowsLayout(actions);
|
|
3580
|
+
const card = {
|
|
3581
|
+
direction: "grid",
|
|
3582
|
+
grid: { columns: ["15%", "fill", "auto"], rows: ["auto"] },
|
|
3583
|
+
sections: [image, info, actionsCell],
|
|
3584
|
+
sectionType: "layout"
|
|
3585
|
+
};
|
|
3586
|
+
return [card, ...quantity];
|
|
3587
|
+
};
|
|
3588
|
+
|
|
3589
|
+
// src/transforms/offerV1/convertOfferToV2.ts
|
|
3590
|
+
var LOCATION_TO_EDITOR_MODE2 = {
|
|
3591
|
+
checkout: "checkoutExtension",
|
|
3592
|
+
"order-status": "orderStatusPage",
|
|
3593
|
+
"thank-you": "thankYouPage"
|
|
3594
|
+
};
|
|
3595
|
+
var STYLE_TO_DIRECTION = {
|
|
3596
|
+
grid: "grid",
|
|
3597
|
+
line: "columns",
|
|
3598
|
+
list: "rows",
|
|
3599
|
+
none: "rows"
|
|
3600
|
+
};
|
|
3601
|
+
var directionForStyle = (style) => style ? STYLE_TO_DIRECTION[style] : "rows";
|
|
3602
|
+
var buildProductListLayout = (direction, columns) => direction === "grid" ? { direction, grid: { columns: Array.from({ length: Math.max(columns, 1) }, () => "fill"), rows: ["auto"] } } : { direction };
|
|
3603
|
+
var hasHeaderText = (language) => !!(language?.title || language?.superTitle || language?.description);
|
|
3604
|
+
var DISCOUNTED_FROM = {
|
|
3605
|
+
compare_at_price: "compare_at_price",
|
|
3606
|
+
original_price: "price",
|
|
3607
|
+
price: "price"
|
|
3608
|
+
};
|
|
3609
|
+
var buildDiscountSection = (discount) => {
|
|
3610
|
+
if (!discount?.type || discount.type === "none") return [];
|
|
3611
|
+
const discountedFrom = discount.discountedFrom ? DISCOUNTED_FROM[discount.discountedFrom] : void 0;
|
|
3612
|
+
return [
|
|
3613
|
+
{
|
|
3614
|
+
amount: discount.amount ?? 0,
|
|
3615
|
+
...discount.discountedBy && { discountedBy: discount.discountedBy },
|
|
3616
|
+
...discountedFrom && { discountedFrom },
|
|
3617
|
+
...discount.message && { message: discount.message },
|
|
3618
|
+
...discount.quantity != null && { quantity: discount.quantity },
|
|
3619
|
+
sectionType: "discount",
|
|
3620
|
+
type: discount.type
|
|
3621
|
+
}
|
|
3622
|
+
];
|
|
3623
|
+
};
|
|
3624
|
+
var buildBanner = (language) => language?.successBannerEnabled ? [
|
|
3625
|
+
{
|
|
3626
|
+
color: "success",
|
|
3627
|
+
dismissible: true,
|
|
3628
|
+
sections: [
|
|
3629
|
+
{
|
|
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,
|
|
3635
|
+
sectionType: "text"
|
|
3636
|
+
},
|
|
3637
|
+
{
|
|
3638
|
+
action: "undoAddToOrder",
|
|
3639
|
+
buttonStyle: "plain",
|
|
3640
|
+
sections: [{ buttonField: "buttonLabel", content: OFFER_LABELS.undo, sectionType: "text" }],
|
|
3641
|
+
sectionType: "button"
|
|
3642
|
+
}
|
|
3643
|
+
],
|
|
3644
|
+
sectionType: "banner"
|
|
3645
|
+
}
|
|
3646
|
+
] : [];
|
|
3647
|
+
var convertOfferToV2 = ({ id, name, settings }) => {
|
|
3648
|
+
const layout = settings.layout?.large ?? settings.layout?.medium ?? settings.layout?.small;
|
|
3649
|
+
const columns = layout?.columns ?? 1;
|
|
3650
|
+
const direction = directionForStyle(layout?.style);
|
|
3651
|
+
const listLayout = buildProductListLayout(direction, columns);
|
|
3652
|
+
const horizontalCard = direction === "rows";
|
|
3653
|
+
const dataSource = {
|
|
3654
|
+
...settings.endpoint && { dataSourcePath: settings.endpoint },
|
|
3655
|
+
...settings.integrations && { integrations: settings.integrations },
|
|
3656
|
+
...settings.limit !== void 0 && { limit: settings.limit },
|
|
3657
|
+
matchVariant: !!settings.productOptions?.matchVariant,
|
|
3658
|
+
matchVariantOutOfStock: !!settings.productOptions?.matchVariantOutOfStock,
|
|
3659
|
+
...settings.productType && { productType: settings.productType },
|
|
3660
|
+
sectionType: "dataSource",
|
|
3661
|
+
...settings.treatAsGwp && { treatAsGwp: true }
|
|
3662
|
+
};
|
|
3663
|
+
const offers = {
|
|
3664
|
+
sections: [
|
|
3665
|
+
...buildOfferCard(settings, horizontalCard),
|
|
3666
|
+
dataSource,
|
|
3667
|
+
...buildDiscountSection(settings.discount),
|
|
3668
|
+
...buildBanner(settings.language)
|
|
3669
|
+
],
|
|
3670
|
+
sectionType: "offers"
|
|
3671
|
+
};
|
|
3672
|
+
const display = {
|
|
3673
|
+
autoAdvanceInterval: 0,
|
|
3674
|
+
itemsAtOnce: layout?.carousel ? columns : settings.limit ?? columns,
|
|
3675
|
+
...listLayout,
|
|
3676
|
+
sections: [offers],
|
|
3677
|
+
sectionType: "carousel"
|
|
3678
|
+
};
|
|
3679
|
+
return CABRootSection.parse({
|
|
3680
|
+
direction: "rows",
|
|
3681
|
+
editorMode: LOCATION_TO_EDITOR_MODE2[settings.location ?? "checkout"],
|
|
3682
|
+
// The widget name is required by the admin save schema; carry the legacy widget's name through.
|
|
3683
|
+
...name && { name },
|
|
3684
|
+
previewMode: settings.previewMode,
|
|
3685
|
+
sections: [
|
|
3686
|
+
...hasHeaderText(settings.language) ? [{ content: { en: convertContentBlockTextToV2(settings.language) }, sectionType: "text" }] : [],
|
|
3687
|
+
display
|
|
3688
|
+
],
|
|
3689
|
+
tracking: {
|
|
3690
|
+
enableAttribution: settings.tracking?.enableAttribution ?? true,
|
|
3691
|
+
enableSource: settings.tracking?.enableSource ?? true,
|
|
3692
|
+
enableWidget: settings.tracking?.enableWidget ?? true
|
|
3693
|
+
},
|
|
3694
|
+
type: SHOPIFY_CHECKOUT_EXTENSION,
|
|
3695
|
+
version: 2,
|
|
3696
|
+
widgetId: id
|
|
3697
|
+
});
|
|
3698
|
+
};
|
|
2713
3699
|
//# sourceMappingURL=index.js.map
|