@rebuy/rebuy 3.26.0 → 3.27.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.mjs CHANGED
@@ -1254,105 +1254,212 @@ var OfferProduct = z5.object({
1254
1254
 
1255
1255
  // src/schema/postPurchaseEligibility.ts
1256
1256
  import { z as z6 } from "zod";
1257
- var PostPurchaseSkipReason = z6.enum(["empty", "no-eligible-subscription"]);
1257
+ var PostPurchaseSkipReasonSchema = z6.enum(["empty", "no-eligible-subscription"]);
1258
1258
 
1259
- // src/schema/postPurchaseIdentity.ts
1259
+ // src/schema/postPurchaseExitPolicy.ts
1260
1260
  import { z as z7 } from "zod";
1261
- var PostPurchaseTimestampSchema = z7.number().int().nonnegative();
1262
- var PostPurchaseOrderIdSchema = z7.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
1263
- var ShopifyDomainSchema = z7.string().regex(/^[a-z0-9][a-z0-9-]*\.myshopify\.com$/);
1264
- var DecideRequestSchema = z7.object({
1265
- checkoutToken: z7.string().min(1).max(256),
1261
+ var EXIT_DELAY_MAX_MS = 60 * 60 * 1e3;
1262
+ var ExitPolicySchema = z7.discriminatedUnion("status", [
1263
+ z7.strictObject({ status: z7.literal("unavailable") }),
1264
+ z7.strictObject({
1265
+ delayMs: z7.number().int().nonnegative().max(EXIT_DELAY_MAX_MS),
1266
+ source: z7.enum(["admitted", "selected-flow"]),
1267
+ status: z7.literal("available")
1268
+ })
1269
+ ]);
1270
+
1271
+ // src/schema/postPurchaseIdentity.ts
1272
+ import { z as z8 } from "zod";
1273
+ var POST_PURCHASE_ID_MAX = 128;
1274
+ var PostPurchaseTimestampSchema = z8.number().int().nonnegative();
1275
+ var PostPurchaseOrderIdSchema = z8.string().regex(/^gid:\/\/shopify\/Order\/[1-9]\d*$/);
1276
+ var ShopifyDomainSchema = z8.string().max(POST_PURCHASE_ID_MAX).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?\.myshopify\.com$/);
1277
+ var DecideRequestSchema = z8.object({
1278
+ checkoutToken: z8.string().min(1).max(POST_PURCHASE_ID_MAX),
1266
1279
  shop: ShopifyDomainSchema
1267
1280
  });
1268
- var DecisionEntrySchema = z7.object({
1269
- blockId: z7.number().int().positive(),
1270
- blockIndex: z7.string(),
1271
- blockParentIndex: z7.string(),
1272
- flowId: z7.number().int().positive(),
1273
- sectionId: z7.number().int().positive(),
1274
- widgetId: z7.number().int().positive(),
1275
- widgetTraffic: z7.number().min(0).max(100)
1281
+ var PostPurchaseAppIdSchema = z8.string().min(1).max(POST_PURCHASE_ID_MAX);
1282
+ var DecisionEntrySchema = z8.object({
1283
+ blockId: z8.number().int().positive(),
1284
+ blockIndex: z8.string(),
1285
+ blockParentIndex: z8.string(),
1286
+ flowId: z8.number().int().positive(),
1287
+ sectionId: z8.number().int().positive(),
1288
+ widgetId: z8.number().int().positive(),
1289
+ widgetTraffic: z8.number().min(0).max(100)
1276
1290
  });
1277
1291
 
1292
+ // src/schema/postPurchaseOrderDecision.ts
1293
+ import { z as z9 } from "zod";
1294
+ var OrderDecisionSchema = z9.discriminatedUnion("owner", [
1295
+ z9.object({ owner: z9.literal("session"), sessionId: z9.string().regex(/^[a-f0-9]{64}$/) }),
1296
+ z9.object({ owner: z9.literal("release"), sessionId: z9.null() })
1297
+ ]);
1298
+
1299
+ // src/schema/postPurchasePolicy.ts
1300
+ import { z as z10 } from "zod";
1301
+ var HoldSettingSchema = z10.discriminatedUnion("enabled", [
1302
+ z10.object({ durationMinutes: z10.number().int().min(1).max(60), enabled: z10.literal(true) }),
1303
+ z10.object({ durationMinutes: z10.null(), enabled: z10.literal(false) })
1304
+ ]);
1305
+ var TimingSettingsSchema = z10.object({ flowHold: HoldSettingSchema, shopHold: HoldSettingSchema });
1306
+ var SessionPolicySchema = TimingSettingsSchema.extend({
1307
+ durationMinutes: z10.number().int().min(1).max(60).nullable(),
1308
+ source: z10.enum(["shop", "flow", "native"])
1309
+ }).refine(
1310
+ (policy) => {
1311
+ const expectedSource = policy.shopHold.enabled ? "shop" : policy.flowHold.enabled ? "flow" : "native";
1312
+ const expectedDuration = expectedSource === "shop" ? policy.shopHold.durationMinutes : expectedSource === "flow" ? policy.flowHold.durationMinutes : null;
1313
+ return policy.source === expectedSource && policy.durationMinutes === expectedDuration;
1314
+ },
1315
+ {
1316
+ message: "source and durationMinutes must reflect the shop-over-flow-over-native precedence",
1317
+ path: ["source"]
1318
+ }
1319
+ );
1320
+
1321
+ // src/schema/postPurchaseSelection.ts
1322
+ import { z as z11 } from "zod";
1323
+ var SelectionClaimsSchema = DecideRequestSchema.extend({
1324
+ appId: PostPurchaseAppIdSchema,
1325
+ entry: DecisionEntrySchema,
1326
+ iss: z11.literal("rebuy-api"),
1327
+ purpose: z11.literal("post-purchase-selection")
1328
+ });
1329
+ var SessionStartRequestSchema = DecideRequestSchema.extend({
1330
+ selectionToken: z11.string().min(1).max(8192).optional()
1331
+ }).strict();
1332
+
1333
+ // src/schema/postPurchaseSession.ts
1334
+ import { z as z12 } from "zod";
1335
+ var SessionIdentitySchema = DecideRequestSchema.extend({ appId: PostPurchaseAppIdSchema });
1336
+ var SessionOrderTimingSchema = z12.object({
1337
+ nativeDeadline: PostPurchaseTimestampSchema,
1338
+ orderCreatedAt: PostPurchaseTimestampSchema,
1339
+ orderId: PostPurchaseOrderIdSchema,
1340
+ timingSource: z12.literal("shopify-order-created-at")
1341
+ });
1342
+ var ReadySessionTimingSchema = SessionOrderTimingSchema.extend({
1343
+ deadline: PostPurchaseTimestampSchema,
1344
+ entry: DecisionEntrySchema,
1345
+ policySnapshot: SessionPolicySchema,
1346
+ startedAt: PostPurchaseTimestampSchema
1347
+ }).refine((session) => session.orderCreatedAt <= session.startedAt, {
1348
+ message: "startedAt must not precede orderCreatedAt",
1349
+ path: ["startedAt"]
1350
+ }).refine((session) => session.startedAt <= session.deadline, {
1351
+ message: "deadline must not precede startedAt",
1352
+ path: ["deadline"]
1353
+ }).refine((session) => session.deadline <= session.nativeDeadline, {
1354
+ message: "deadline must not exceed nativeDeadline",
1355
+ path: ["deadline"]
1356
+ });
1357
+ var SessionStartResponseSchema = z12.object({
1358
+ data: z12.object({
1359
+ phase: z12.literal("render"),
1360
+ serverNow: PostPurchaseTimestampSchema,
1361
+ session: ReadySessionTimingSchema,
1362
+ workflowPhase: z12.literal("start")
1363
+ }),
1364
+ successful: z12.literal(true)
1365
+ });
1366
+
1367
+ // src/schema/postPurchaseSessionClose.ts
1368
+ import { z as z13 } from "zod";
1369
+ var SessionClosureSchema = z13.object({ closedAt: PostPurchaseTimestampSchema, status: z13.literal("closed") });
1370
+ var SessionCloseRequestSchema = DecideRequestSchema.strict();
1371
+ var SessionCloseResponseSchema = z13.object({ data: SessionClosureSchema, successful: z13.literal(true) });
1372
+
1278
1373
  // src/schema/postPurchaseShadow.ts
1279
- import { z as z8 } from "zod";
1280
- var PostPurchaseShadowSelectionSchema = z8.discriminatedUnion("verdict", [
1281
- z8.object({ entry: DecisionEntrySchema, verdict: z8.literal("render") }),
1282
- z8.object({ verdict: z8.literal("skip") })
1374
+ import { z as z14 } from "zod";
1375
+ var PostPurchaseShadowSelectionSchema = z14.discriminatedUnion("verdict", [
1376
+ z14.object({ entry: DecisionEntrySchema, verdict: z14.literal("render") }),
1377
+ z14.object({ verdict: z14.literal("skip") })
1283
1378
  ]);
1284
- var PostPurchaseShadowReportSchema = z8.object({
1285
- differences: z8.array(z8.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])),
1379
+ var PostPurchaseShadowReportFields = z14.object({
1380
+ differences: z14.array(z14.enum(["verdict", "entry", "targeting", "incomplete-capture", "unsupported-configuration"])).refine((differences) => new Set(differences).size === differences.length, {
1381
+ message: "differences must not contain duplicate entries"
1382
+ }),
1286
1383
  legacySelection: PostPurchaseShadowSelectionSchema,
1287
- phase: z8.literal("shouldRender"),
1288
- sampleId: z8.string(),
1384
+ phase: z14.literal("shouldRender"),
1385
+ sampleId: z14.string(),
1289
1386
  serverSelection: PostPurchaseShadowSelectionSchema.optional(),
1290
- status: z8.enum(["match", "diverged", "incomplete"]),
1291
- targetingFlowIds: z8.array(z8.number()),
1292
- workflowPhase: z8.literal("decide")
1387
+ status: z14.enum(["match", "diverged", "incomplete"]),
1388
+ targetingFlowIds: z14.array(z14.number().int().positive()),
1389
+ workflowPhase: z14.literal("decide")
1390
+ });
1391
+ var PostPurchaseShadowReportSchema = PostPurchaseShadowReportFields.refine(
1392
+ (report) => report.status !== "match" || report.differences.length === 0,
1393
+ { message: "status 'match' requires an empty differences array", path: ["status"] }
1394
+ ).refine((report) => report.status !== "diverged" || report.differences.length > 0, {
1395
+ message: "status 'diverged' requires a non-empty differences array",
1396
+ path: ["status"]
1397
+ }).refine((report) => report.status !== "diverged" || report.serverSelection !== void 0, {
1398
+ message: "status 'diverged' requires a serverSelection to diverge from",
1399
+ path: ["status"]
1293
1400
  });
1294
1401
 
1295
1402
  // src/schema/postPurchaseSkipTrace.ts
1296
- import { z as z9 } from "zod";
1403
+ import { z as z15 } from "zod";
1297
1404
  var POST_PURCHASE_SKIP_LIMIT = 32;
1298
- var PostPurchaseSkipTrace = z9.array(
1299
- z9.object({
1405
+ var PostPurchaseSkipTraceSchema = z15.array(
1406
+ z15.object({
1300
1407
  entry: DecisionEntrySchema,
1301
- reason: PostPurchaseSkipReason
1408
+ reason: PostPurchaseSkipReasonSchema
1302
1409
  })
1303
1410
  ).max(POST_PURCHASE_SKIP_LIMIT);
1304
1411
 
1305
1412
  // src/schema/shopConfig.ts
1306
- import { z as z10 } from "zod";
1307
- var ShopConfig = z10.object({
1308
- activeExperiments: z10.array(
1309
- z10.object({
1310
- data: z10.array(
1311
- z10.object({
1312
- aliasName: z10.string(),
1313
- cssInput: z10.string().nullish(),
1314
- elementId: z10.coerce.number(),
1315
- id: z10.coerce.number(),
1316
- javascriptInput: z10.string().nullish(),
1317
- traffic: z10.coerce.number()
1413
+ import { z as z16 } from "zod";
1414
+ var ShopConfig = z16.object({
1415
+ activeExperiments: z16.array(
1416
+ z16.object({
1417
+ data: z16.array(
1418
+ z16.object({
1419
+ aliasName: z16.string(),
1420
+ cssInput: z16.string().nullish(),
1421
+ elementId: z16.coerce.number(),
1422
+ id: z16.coerce.number(),
1423
+ javascriptInput: z16.string().nullish(),
1424
+ traffic: z16.coerce.number()
1318
1425
  })
1319
1426
  ),
1320
- id: z10.coerce.number(),
1321
- name: z10.string(),
1322
- pageTarget: z10.string().nullable(),
1323
- pageTargetUrl: z10.string().nullable(),
1324
- placeholderId: z10.coerce.number().nullable(),
1325
- type: z10.string()
1427
+ id: z16.coerce.number(),
1428
+ name: z16.string(),
1429
+ pageTarget: z16.string().nullable(),
1430
+ pageTargetUrl: z16.string().nullable(),
1431
+ placeholderId: z16.coerce.number().nullable(),
1432
+ type: z16.string()
1326
1433
  })
1327
1434
  ),
1328
- activePackages: z10.array(
1329
- z10.object({
1330
- cancelledAt: z10.string().nullable(),
1331
- id: z10.number(),
1332
- installedAt: z10.string().nullable(),
1333
- isActive: z10.boolean(),
1334
- isBillable: z10.boolean(),
1335
- packageId: z10.number(),
1336
- packageName: z10.string(),
1337
- shortName: z10.string(),
1338
- trialDays: z10.number(),
1339
- uninstalledAt: z10.string().nullable()
1435
+ activePackages: z16.array(
1436
+ z16.object({
1437
+ cancelledAt: z16.string().nullable(),
1438
+ id: z16.number(),
1439
+ installedAt: z16.string().nullable(),
1440
+ isActive: z16.boolean(),
1441
+ isBillable: z16.boolean(),
1442
+ packageId: z16.number(),
1443
+ packageName: z16.string(),
1444
+ shortName: z16.string(),
1445
+ trialDays: z16.number(),
1446
+ uninstalledAt: z16.string().nullable()
1340
1447
  })
1341
1448
  ),
1342
- apiKey: z10.string(),
1343
- billingVersion: z10.string().nullable(),
1344
- cacheKey: z10.coerce.number(),
1345
- carousel: z10.enum(["flickity", "splide"]),
1346
- currency: z10.string(),
1347
- currencySymbol: z10.string(),
1348
- domain: z10.string(),
1349
- enabledJquery: z10.boolean(),
1350
- enabledPresentmentCurrencies: z10.array(z10.string()),
1351
- hasSmartCollectionsEnabled: z10.boolean(),
1352
- hasSmartSearchEnabled: z10.boolean(),
1353
- id: z10.coerce.number(),
1354
- integrations: z10.record(
1355
- z10.enum([
1449
+ apiKey: z16.string(),
1450
+ billingVersion: z16.string().nullable(),
1451
+ cacheKey: z16.coerce.number(),
1452
+ carousel: z16.enum(["flickity", "splide"]),
1453
+ currency: z16.string(),
1454
+ currencySymbol: z16.string(),
1455
+ domain: z16.string(),
1456
+ enabledJquery: z16.boolean(),
1457
+ enabledPresentmentCurrencies: z16.array(z16.string()),
1458
+ hasSmartCollectionsEnabled: z16.boolean(),
1459
+ hasSmartSearchEnabled: z16.boolean(),
1460
+ id: z16.coerce.number(),
1461
+ integrations: z16.record(
1462
+ z16.enum([
1356
1463
  "attentive",
1357
1464
  "judgeme",
1358
1465
  "junip",
@@ -1365,46 +1472,46 @@ var ShopConfig = z10.object({
1365
1472
  "stamped",
1366
1473
  "yotpo"
1367
1474
  ]),
1368
- z10.union([z10.boolean(), z10.unknown()])
1475
+ z16.union([z16.boolean(), z16.unknown()])
1369
1476
  ),
1370
- markets: z10.object({
1371
- enabled: z10.boolean()
1477
+ markets: z16.object({
1478
+ enabled: z16.boolean()
1372
1479
  }),
1373
- monetize: z10.object({
1374
- publisherKey: z10.string().nullable()
1480
+ monetize: z16.object({
1481
+ publisherKey: z16.string().nullable()
1375
1482
  }).nullish(),
1376
- moneyFormat: z10.string(),
1377
- myshopifyDomain: z10.string(),
1378
- primaryLocale: z10.string(),
1379
- productGroupsEnabled: z10.enum(["no", "yes"]).transform((value) => value === "yes"),
1380
- rechargeCustomDomain: z10.string().nullable(),
1381
- sellingPlansEnabled: z10.boolean(),
1382
- shopId: z10.number(),
1383
- shopifySellingPlansEnabled: z10.boolean(),
1384
- shopName: z10.string(),
1385
- storefrontAccessToken: z10.string().nullable(),
1386
- useRebuyIcons: z10.boolean()
1483
+ moneyFormat: z16.string(),
1484
+ myshopifyDomain: z16.string(),
1485
+ primaryLocale: z16.string(),
1486
+ productGroupsEnabled: z16.enum(["no", "yes"]).transform((value) => value === "yes"),
1487
+ rechargeCustomDomain: z16.string().nullable(),
1488
+ sellingPlansEnabled: z16.boolean(),
1489
+ shopId: z16.number(),
1490
+ shopifySellingPlansEnabled: z16.boolean(),
1491
+ shopName: z16.string(),
1492
+ storefrontAccessToken: z16.string().nullable(),
1493
+ useRebuyIcons: z16.boolean()
1387
1494
  });
1388
1495
 
1389
1496
  // src/schema/userConfig.ts
1390
- import { z as z11 } from "zod";
1391
- var UserConfig = z11.object({
1497
+ import { z as z17 } from "zod";
1498
+ var UserConfig = z17.object({
1392
1499
  shop: ShopConfig,
1393
1500
  /**
1394
1501
  * `.catch(undefined)` is the safety bar: smart-cart shape drift can NEVER fail `fetchUserConfig`,
1395
1502
  * which resolves the apiKey for every offers/monetize/analytics/gift request.
1396
1503
  */
1397
1504
  smartCart: SmartCartConfig.nullish().catch(void 0),
1398
- smartFlows: z11.array(z11.unknown())
1505
+ smartFlows: z17.array(z17.unknown())
1399
1506
  });
1400
1507
 
1401
1508
  // src/schema/widgetData.ts
1402
- import { z as z41 } from "zod";
1509
+ import { z as z47 } from "zod";
1403
1510
 
1404
1511
  // src/schema/widgets/abTestingPlaceholder.ts
1405
- import { z as z12 } from "zod";
1406
- var ABTestingPlaceholder = z12.looseObject({
1407
- type: z12.literal("placeholder")
1512
+ import { z as z18 } from "zod";
1513
+ var ABTestingPlaceholder = z18.looseObject({
1514
+ type: z18.literal("placeholder")
1408
1515
  });
1409
1516
 
1410
1517
  // src/schema/widgets/checkout-and-beyond/constants.ts
@@ -1664,26 +1771,26 @@ var targetAreas = {
1664
1771
  };
1665
1772
 
1666
1773
  // src/schema/widgets/checkoutExtension.ts
1667
- import { z as z13 } from "zod";
1668
- var CheckoutExtension = z13.looseObject({
1669
- type: z13.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
1774
+ import { z as z19 } from "zod";
1775
+ var CheckoutExtension = z19.looseObject({
1776
+ type: z19.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension)
1670
1777
  });
1671
1778
 
1672
1779
  // src/schema/widgets/contentBlock.ts
1673
- import { z as z35 } from "zod";
1780
+ import { z as z41 } from "zod";
1674
1781
 
1675
1782
  // src/schema/widgets/checkout-and-beyond/root.ts
1676
- import { z as z34 } from "zod";
1783
+ import { z as z40 } from "zod";
1677
1784
 
1678
1785
  // src/schema/widgets/checkout-and-beyond/layout.ts
1679
1786
  import { v7 as uuidv712 } from "uuid";
1680
- import { z as z33 } from "zod";
1787
+ import { z as z39 } from "zod";
1681
1788
 
1682
1789
  // src/schema/widgets/checkout-and-beyond/shared.ts
1683
- import { z as z32 } from "zod";
1790
+ import { z as z38 } from "zod";
1684
1791
 
1685
1792
  // src/schema/widgets/checkout-and-beyond/banner.ts
1686
- import { z as z14 } from "zod";
1793
+ import { z as z20 } from "zod";
1687
1794
 
1688
1795
  // src/schema/widgets/checkout-and-beyond/utils.ts
1689
1796
  import { isPlainObject as isPlainObject2 } from "es-toolkit";
@@ -1761,11 +1868,11 @@ var isTextType = isSectionType(SectionType.text);
1761
1868
  var isVariantsType = isSectionType(SectionType.variants);
1762
1869
 
1763
1870
  // src/schema/widgets/checkout-and-beyond/banner.ts
1764
- var CABBannerSection = z14.lazy(
1871
+ var CABBannerSection = z20.lazy(
1765
1872
  () => CABLayoutSection.omit({ sectionType: true }).extend({
1766
- buttonField: z14.enum(buttonFields).optional(),
1767
- color: z14.enum(bannerColors).default("info"),
1768
- dismissible: z14.boolean().default(true),
1873
+ buttonField: z20.enum(buttonFields).optional(),
1874
+ color: z20.enum(bannerColors).default("info"),
1875
+ dismissible: z20.boolean().default(true),
1769
1876
  /**
1770
1877
  * The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
1771
1878
  * blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
@@ -1781,18 +1888,18 @@ var CABBannerSection = z14.lazy(
1781
1888
  * not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
1782
1889
  * either strips first or teaches `normalizeTextContent` to strip this field.
1783
1890
  */
1784
- heading: z14.record(z14.string(), z14.string().refine(checkForHTML, NO_HTML)).optional(),
1785
- sectionType: z14.literal(SectionType.banner).default(SectionType.banner)
1891
+ heading: z20.record(z20.string(), z20.string().refine(checkForHTML, NO_HTML)).optional(),
1892
+ sectionType: z20.literal(SectionType.banner).default(SectionType.banner)
1786
1893
  })
1787
1894
  );
1788
1895
 
1789
1896
  // src/schema/widgets/checkout-and-beyond/button.ts
1790
1897
  import { v7 as uuidv73 } from "uuid";
1791
- import { z as z19 } from "zod";
1898
+ import { z as z25 } from "zod";
1792
1899
 
1793
1900
  // src/schema/widgets/checkout-and-beyond/image.ts
1794
1901
  import { v7 as uuidv7 } from "uuid";
1795
- import { z as z17 } from "zod";
1902
+ import { z as z23 } from "zod";
1796
1903
 
1797
1904
  // src/schema/widgets/checkout-and-beyond/icons.ts
1798
1905
  var iconNames = [
@@ -1879,10 +1986,10 @@ var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "wa
1879
1986
  var IconTone = freezeEnum(iconTones);
1880
1987
 
1881
1988
  // src/schema/widgets/checkout-and-beyond/variables.ts
1882
- import { z as z16 } from "zod";
1989
+ import { z as z22 } from "zod";
1883
1990
 
1884
1991
  // src/schema/widgets/checkout-and-beyond/rule.ts
1885
- import { z as z15 } from "zod";
1992
+ import { z as z21 } from "zod";
1886
1993
  var ruleTypes = [
1887
1994
  "cart",
1888
1995
  "cart_count",
@@ -1901,7 +2008,7 @@ var ruleTypes = [
1901
2008
  "product_type",
1902
2009
  "product_vendor"
1903
2010
  ];
1904
- var ruleType = z15.enum(ruleTypes);
2011
+ var ruleType = z21.enum(ruleTypes);
1905
2012
  var RuleType = ruleType.enum;
1906
2013
  var ruleOperators = [
1907
2014
  "after",
@@ -1916,124 +2023,124 @@ var ruleOperators = [
1916
2023
  "greater_than",
1917
2024
  "less_than"
1918
2025
  ];
1919
- var ruleOperator = z15.enum(ruleOperators);
2026
+ var ruleOperator = z21.enum(ruleOperators);
1920
2027
  var RuleOperator = ruleOperator.enum;
1921
- var RuleCondition = z15.object({
1922
- operator: z15.enum(ruleOperators).default(RuleOperator.anything),
1923
- products: z15.union([z15.array(z15.unknown()), z15.strictObject({}).transform(() => [])]).default(() => []),
1924
- type: z15.enum(ruleTypes).default(RuleType.cart_subtotal),
1925
- value: z15.coerce.string().default("")
2028
+ var RuleCondition = z21.object({
2029
+ operator: z21.enum(ruleOperators).default(RuleOperator.anything),
2030
+ products: z21.union([z21.array(z21.unknown()), z21.strictObject({}).transform(() => [])]).default(() => []),
2031
+ type: z21.enum(ruleTypes).default(RuleType.cart_subtotal),
2032
+ value: z21.coerce.string().default("")
1926
2033
  });
1927
- var RuleLogicBlock = z15.object({
1928
- rules: z15.array(RuleCondition).default(() => [])
2034
+ var RuleLogicBlock = z21.object({
2035
+ rules: z21.array(RuleCondition).default(() => [])
1929
2036
  });
1930
- var CABRulesetEntry = z15.object({
1931
- exitIfMatched: z15.boolean().default(true),
1932
- logic: z15.array(RuleLogicBlock).default(() => []),
1933
- output: z15.array(
1934
- z15.object({
1935
- key: z15.string().default("should_show"),
1936
- type: z15.literal("data_json").default("data_json"),
1937
- value: z15.string().default("true")
2037
+ var CABRulesetEntry = z21.object({
2038
+ exitIfMatched: z21.boolean().default(true),
2039
+ logic: z21.array(RuleLogicBlock).default(() => []),
2040
+ output: z21.array(
2041
+ z21.object({
2042
+ key: z21.string().default("should_show"),
2043
+ type: z21.literal("data_json").default("data_json"),
2044
+ value: z21.string().default("true")
1938
2045
  })
1939
2046
  ).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
1940
2047
  });
1941
- var CABRuleset = z15.union([z15.array(CABRulesetEntry), z15.strictObject({}).transform(() => [])]).default(() => []);
2048
+ var CABRuleset = z21.union([z21.array(CABRulesetEntry), z21.strictObject({}).transform(() => [])]).default(() => []);
1942
2049
 
1943
2050
  // src/schema/widgets/checkout-and-beyond/variables.ts
1944
- var variableEffect = z16.enum(variableEffects);
1945
- var CABVariableSeed = z16.object({
1946
- dataSourceId: z16.number().nullable().default(null),
2051
+ var variableEffect = z22.enum(variableEffects);
2052
+ var CABVariableSeed = z22.object({
2053
+ dataSourceId: z22.number().nullable().default(null),
1947
2054
  ruleset: CABRuleset
1948
2055
  });
1949
- var CABBooleanVariable = z16.object({
2056
+ var CABBooleanVariable = z22.object({
1950
2057
  /**
1951
2058
  * Holds until the first seed verdict lands (and forever, for unseeded variables). Omitted, it derives
1952
2059
  * from seededness — `false` with a `seed` (visibility is EARNED), `true` without — via the transform
1953
2060
  * below; a cross-field default has no `.default()` spelling. An explicit value always wins.
1954
2061
  */
1955
- defaultValue: z16.boolean().optional(),
1956
- name: z16.string().min(1),
2062
+ defaultValue: z22.boolean().optional(),
2063
+ name: z22.string().min(1),
1957
2064
  seed: CABVariableSeed.optional(),
1958
2065
  /** Defaulted so every stored declaration (all boolean before `text` existed) parses unchanged. */
1959
- type: z16.literal(VariableType.boolean).default(VariableType.boolean)
2066
+ type: z22.literal(VariableType.boolean).default(VariableType.boolean)
1960
2067
  });
1961
- var CABTextVariable = z16.object({
1962
- defaultValue: z16.string(),
1963
- name: z16.string().min(1),
1964
- seed: z16.never().optional(),
1965
- type: z16.literal(VariableType.text)
2068
+ var CABTextVariable = z22.object({
2069
+ defaultValue: z22.string(),
2070
+ name: z22.string().min(1),
2071
+ seed: z22.never().optional(),
2072
+ type: z22.literal(VariableType.text)
1966
2073
  });
1967
- var CABNumberVariable = z16.object({
1968
- defaultValue: z16.number(),
1969
- name: z16.string().min(1),
1970
- seed: z16.never().optional(),
1971
- type: z16.literal(VariableType.number)
2074
+ var CABNumberVariable = z22.object({
2075
+ defaultValue: z22.number(),
2076
+ name: z22.string().min(1),
2077
+ seed: z22.never().optional(),
2078
+ type: z22.literal(VariableType.number)
1972
2079
  });
1973
- var CABVariable = z16.union([CABTextVariable, CABNumberVariable, CABBooleanVariable]).transform(
2080
+ var CABVariable = z22.union([CABTextVariable, CABNumberVariable, CABBooleanVariable]).transform(
1974
2081
  (variable) => variable.type === VariableType.boolean ? { ...variable, defaultValue: variable.defaultValue ?? variable.seed === void 0 } : variable
1975
2082
  );
1976
- var CABVariableEffect = z16.object({
2083
+ var CABVariableEffect = z22.object({
1977
2084
  effect: variableEffect.default(VariableEffect.toggle),
1978
- variable: z16.string().min(1)
2085
+ variable: z22.string().min(1)
1979
2086
  });
1980
- var CABVisibility = z16.object({
1981
- variable: z16.string().min(1),
1982
- visibleWhen: z16.boolean().default(true)
2087
+ var CABVisibility = z22.object({
2088
+ variable: z22.string().min(1),
2089
+ visibleWhen: z22.boolean().default(true)
1983
2090
  });
1984
- var contentOperator = z16.enum(contentOperators);
1985
- var resultCountOperator = z16.enum(resultCountOperators);
1986
- var resultTagOperator = z16.enum(resultTagOperators);
1987
- var mutatorEvent = z16.enum(mutatorEvents);
1988
- var CABContentTrigger = z16.object({
2091
+ var contentOperator = z22.enum(contentOperators);
2092
+ var resultCountOperator = z22.enum(resultCountOperators);
2093
+ var resultTagOperator = z22.enum(resultTagOperators);
2094
+ var mutatorEvent = z22.enum(mutatorEvents);
2095
+ var CABContentTrigger = z22.object({
1989
2096
  operator: contentOperator.default(ContentOperator.is_empty),
1990
- type: z16.literal("content")
2097
+ type: z22.literal("content")
1991
2098
  });
1992
- var CABResultCountTrigger = z16.object({
2099
+ var CABResultCountTrigger = z22.object({
1993
2100
  operator: resultCountOperator.default(ResultCountOperator.equals),
1994
- type: z16.literal("result_count"),
1995
- value: z16.number().default(0)
2101
+ type: z22.literal("result_count"),
2102
+ value: z22.number().default(0)
1996
2103
  });
1997
- var CABResultTagTrigger = z16.object({
2104
+ var CABResultTagTrigger = z22.object({
1998
2105
  operator: resultTagOperator.default(ResultTagOperator.contains),
1999
- type: z16.literal("result_tag"),
2000
- value: z16.string().min(1)
2106
+ type: z22.literal("result_tag"),
2107
+ value: z22.string().min(1)
2001
2108
  });
2002
- var CABEventTrigger = z16.object({
2109
+ var CABEventTrigger = z22.object({
2003
2110
  event: mutatorEvent,
2004
- type: z16.literal("event")
2111
+ type: z22.literal("event")
2005
2112
  });
2006
- var CABVariableTrigger = z16.discriminatedUnion("type", [
2113
+ var CABVariableTrigger = z22.discriminatedUnion("type", [
2007
2114
  CABContentTrigger,
2008
2115
  CABEventTrigger,
2009
2116
  CABResultCountTrigger,
2010
2117
  CABResultTagTrigger
2011
2118
  ]);
2012
- var CABVariableMutator = z16.object({
2119
+ var CABVariableMutator = z22.object({
2013
2120
  effect: variableEffect.default(VariableEffect.set_false),
2014
- variable: z16.string().min(1),
2121
+ variable: z22.string().min(1),
2015
2122
  when: CABVariableTrigger
2016
2123
  });
2017
2124
  var CABVariableFields = {
2018
- mutators: z16.array(CABVariableMutator).optional(),
2019
- variables: z16.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
2125
+ mutators: z22.array(CABVariableMutator).optional(),
2126
+ variables: z22.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
2020
2127
  message: "variable names must be unique within a section"
2021
2128
  }).optional(),
2022
2129
  visibility: CABVisibility.optional()
2023
2130
  };
2024
2131
 
2025
2132
  // src/schema/widgets/checkout-and-beyond/image.ts
2026
- var CABImageSectionFields = z17.object({
2133
+ var CABImageSectionFields = z23.object({
2027
2134
  ...CABVariableFields,
2028
- altText: z17.string().refine(checkForHTML, NO_HTML).default(""),
2135
+ altText: z23.string().refine(checkForHTML, NO_HTML).default(""),
2029
2136
  /**
2030
2137
  * Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
2031
2138
  * ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
2032
2139
  * and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
2033
2140
  */
2034
- aspectRatio: z17.number().positive().nullable().default(null),
2035
- border: z17.lazy(() => CABBorder),
2036
- buttonField: z17.enum(buttonFields).optional(),
2141
+ aspectRatio: z23.number().positive().nullable().default(null),
2142
+ border: z23.lazy(() => CABBorder),
2143
+ buttonField: z23.enum(buttonFields).optional(),
2037
2144
  /**
2038
2145
  * `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
2039
2146
  * `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
@@ -2052,29 +2159,29 @@ var CABImageSectionFields = z17.object({
2052
2159
  * behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
2053
2160
  * the risky half.
2054
2161
  */
2055
- category: z17.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
2162
+ category: z23.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
2056
2163
  /** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
2057
- iconSize: z17.enum(iconSizes).nullable().default(null),
2164
+ iconSize: z23.enum(iconSizes).nullable().default(null),
2058
2165
  /** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
2059
- iconTone: z17.enum(iconTones).nullable().default(null),
2060
- name: z17.string().optional(),
2061
- naturalHeight: z17.number().default(0),
2062
- naturalWidth: z17.number().default(0),
2166
+ iconTone: z23.enum(iconTones).nullable().default(null),
2167
+ name: z23.string().optional(),
2168
+ naturalHeight: z23.number().default(0),
2169
+ naturalWidth: z23.number().default(0),
2063
2170
  /**
2064
2171
  * `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
2065
2172
  * `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
2066
2173
  */
2067
- objectFit: z17.enum(objectFits).default(ObjectFit.contain),
2068
- sectionId: z17.uuid().default(() => uuidv7()),
2069
- sectionType: z17.literal(SectionType.image).default(SectionType.image),
2174
+ objectFit: z23.enum(objectFits).default(ObjectFit.contain),
2175
+ sectionId: z23.uuid().default(() => uuidv7()),
2176
+ sectionType: z23.literal(SectionType.image).default(SectionType.image),
2070
2177
  /**
2071
2178
  * An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
2072
2179
  * takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
2073
2180
  * would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
2074
2181
  * server-chosen tier icon actually needs it.
2075
2182
  */
2076
- source: z17.union([z17.url(), z17.literal(""), z17.string().regex(DYNAMIC_TOKEN_REGEX), z17.enum(iconNames)]).default(""),
2077
- width: z17.number().default(100)
2183
+ source: z23.union([z23.url(), z23.literal(""), z23.string().regex(DYNAMIC_TOKEN_REGEX), z23.enum(iconNames)]).default(""),
2184
+ width: z23.number().default(100)
2078
2185
  });
2079
2186
  var iconNameSet = new Set(iconNames);
2080
2187
  var isIconName = (source) => iconNameSet.has(source);
@@ -2096,71 +2203,71 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source }, c
2096
2203
  // src/schema/widgets/checkout-and-beyond/text.ts
2097
2204
  import { forEach, isString as isString2 } from "es-toolkit/compat";
2098
2205
  import { v7 as uuidv72 } from "uuid";
2099
- import { z as z18 } from "zod";
2100
- var enumOrOmit = (...vals) => z18.string().transform((val) => vals.includes(val) ? val : void 0).optional();
2101
- var TiptapText = z18.object({
2102
- marks: z18.union([
2103
- z18.array(
2104
- z18.discriminatedUnion("type", [
2105
- z18.object({ type: z18.literal("bold") }),
2106
- z18.object({ type: z18.literal("italic") }),
2107
- z18.object({
2108
- attrs: z18.object({
2109
- class: z18.string().nullable(),
2110
- href: z18.union([
2111
- z18.url(),
2112
- z18.literal("#"),
2113
- z18.string().regex(DYNAMIC_TOKEN_REGEX),
2114
- z18.string().regex(ROOT_RELATIVE_PATH_REGEX)
2206
+ import { z as z24 } from "zod";
2207
+ var enumOrOmit = (...vals) => z24.string().transform((val) => vals.includes(val) ? val : void 0).optional();
2208
+ var TiptapText = z24.object({
2209
+ marks: z24.union([
2210
+ z24.array(
2211
+ z24.discriminatedUnion("type", [
2212
+ z24.object({ type: z24.literal("bold") }),
2213
+ z24.object({ type: z24.literal("italic") }),
2214
+ z24.object({
2215
+ attrs: z24.object({
2216
+ class: z24.string().nullable(),
2217
+ href: z24.union([
2218
+ z24.url(),
2219
+ z24.literal("#"),
2220
+ z24.string().regex(DYNAMIC_TOKEN_REGEX),
2221
+ z24.string().regex(ROOT_RELATIVE_PATH_REGEX)
2115
2222
  ]),
2116
- rel: z18.string().default("noopener noreferrer nofollow"),
2117
- target: z18.string().default("_blank")
2223
+ rel: z24.string().default("noopener noreferrer nofollow"),
2224
+ target: z24.string().default("_blank")
2118
2225
  }),
2119
- type: z18.literal("link")
2226
+ type: z24.literal("link")
2120
2227
  }),
2121
- z18.object({ type: z18.literal("strike") }),
2122
- z18.object({
2123
- attrs: z18.object({
2228
+ z24.object({ type: z24.literal("strike") }),
2229
+ z24.object({
2230
+ attrs: z24.object({
2124
2231
  color: enumOrOmit(...textColorNames).default(TextColorName.base),
2125
2232
  fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
2126
2233
  }),
2127
- type: z18.literal("textStyle")
2234
+ type: z24.literal("textStyle")
2128
2235
  })
2129
2236
  ])
2130
2237
  ),
2131
- z18.strictObject({}).transform(() => [])
2238
+ z24.strictObject({}).transform(() => [])
2132
2239
  ]).optional(),
2133
- text: z18.string().default(""),
2134
- type: z18.literal("text").default("text")
2240
+ text: z24.string().default(""),
2241
+ type: z24.literal("text").default("text")
2135
2242
  });
2136
- var TiptapParagraph = z18.object({
2137
- attrs: z18.object({
2243
+ var TiptapParagraph = z24.object({
2244
+ attrs: z24.object({
2138
2245
  textAlign: enumOrOmit(...textAlignments)
2139
2246
  }).default({ textAlign: TextAlignment.start }),
2140
- content: z18.union([z18.array(TiptapText), z18.strictObject({}).transform(() => [])]).default(() => []),
2141
- type: z18.literal("paragraph").default("paragraph")
2247
+ content: z24.union([z24.array(TiptapText), z24.strictObject({}).transform(() => [])]).default(() => []),
2248
+ type: z24.literal("paragraph").default("paragraph")
2142
2249
  });
2143
- var TiptapDocument = z18.object({
2144
- attrs: z18.object({
2250
+ var TiptapDocument = z24.object({
2251
+ attrs: z24.object({
2145
2252
  blockSpacing: enumOrOmit(...spacings)
2146
2253
  }).default({ blockSpacing: Spacing.base }),
2147
- content: z18.union([z18.array(TiptapParagraph), z18.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
2148
- type: z18.literal("doc").default("doc")
2254
+ content: z24.union([z24.array(TiptapParagraph), z24.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
2255
+ type: z24.literal("doc").default("doc")
2149
2256
  });
2150
- var CABTextTier = z18.object({
2151
- threshold: z18.number().int().nonnegative(),
2152
- thresholds: z18.record(z18.string(), z18.number().int().nonnegative()).default(() => ({})),
2153
- tierId: z18.string().optional(),
2154
- tierType: z18.enum(progressTierTypes).default(ProgressTierType.shipping)
2257
+ var CABTextTier = z24.object({
2258
+ threshold: z24.number().int().nonnegative(),
2259
+ thresholds: z24.record(z24.string(), z24.number().int().nonnegative()).default(() => ({})),
2260
+ tierId: z24.string().optional(),
2261
+ tierType: z24.enum(progressTierTypes).default(ProgressTierType.shipping)
2155
2262
  });
2156
- var CABTextSection = z18.object({
2263
+ var CABTextSection = z24.object({
2157
2264
  ...CABVariableFields,
2158
- buttonField: z18.enum(buttonFields).optional(),
2159
- content: z18.record(z18.string(), z18.union([z18.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
2160
- name: z18.string().optional(),
2161
- optionId: z18.number().optional(),
2162
- sectionId: z18.uuid().default(() => uuidv72()),
2163
- sectionType: z18.literal(SectionType.text).default(SectionType.text),
2265
+ buttonField: z24.enum(buttonFields).optional(),
2266
+ content: z24.record(z24.string(), z24.union([z24.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
2267
+ name: z24.string().optional(),
2268
+ optionId: z24.number().optional(),
2269
+ sectionId: z24.uuid().default(() => uuidv72()),
2270
+ sectionType: z24.literal(SectionType.text).default(SectionType.text),
2164
2271
  tier: CABTextTier.optional()
2165
2272
  }).superRefine(({ buttonField, content }, ctx) => {
2166
2273
  if (buttonField === ButtonField.destinationUrl && content) {
@@ -2182,35 +2289,35 @@ var CABTextSection = z18.object({
2182
2289
  });
2183
2290
 
2184
2291
  // src/schema/widgets/checkout-and-beyond/button.ts
2185
- var CABButtonContent = z19.lazy(
2186
- () => z19.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
2292
+ var CABButtonContent = z25.lazy(
2293
+ () => z25.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
2187
2294
  );
2188
- var CABButtonSection = z19.object({
2295
+ var CABButtonSection = z25.object({
2189
2296
  ...CABVariableFields,
2190
- action: z19.union([z19.literal(""), z19.enum(buttonActions)]).default(""),
2191
- buttonStyle: z19.enum(buttonStyles).default(ButtonStyle.primary),
2192
- custom: z19.object({
2193
- color: z19.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
2194
- height: z19.number().default(52),
2195
- width: z19.number().default(300)
2297
+ action: z25.union([z25.literal(""), z25.enum(buttonActions)]).default(""),
2298
+ buttonStyle: z25.enum(buttonStyles).default(ButtonStyle.primary),
2299
+ custom: z25.object({
2300
+ color: z25.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
2301
+ height: z25.number().default(52),
2302
+ width: z25.number().default(300)
2196
2303
  }).default({
2197
2304
  color: "#005bd3",
2198
2305
  height: 52,
2199
2306
  width: 300
2200
2307
  }),
2201
- disableDowngrade: z19.boolean().default(false),
2202
- name: z19.string().optional(),
2203
- optionId: z19.number().optional(),
2204
- popover: z19.object({
2205
- alignment: z19.enum(textAlignments).default(TextAlignment.center),
2206
- position: z19.enum(popoverPositions).default(PopoverPosition.blockStart)
2308
+ disableDowngrade: z25.boolean().default(false),
2309
+ name: z25.string().optional(),
2310
+ optionId: z25.number().optional(),
2311
+ popover: z25.object({
2312
+ alignment: z25.enum(textAlignments).default(TextAlignment.center),
2313
+ position: z25.enum(popoverPositions).default(PopoverPosition.blockStart)
2207
2314
  }).optional().default(() => ({
2208
2315
  alignment: TextAlignment.center,
2209
2316
  position: PopoverPosition.blockStart
2210
2317
  })),
2211
- sectionId: z19.uuid().default(() => uuidv73()),
2212
- sections: z19.union([z19.array(CABButtonContent), z19.strictObject({}).transform(() => [])]).default(() => []),
2213
- sectionType: z19.literal(SectionType.button).default(SectionType.button),
2318
+ sectionId: z25.uuid().default(() => uuidv73()),
2319
+ sections: z25.union([z25.array(CABButtonContent), z25.strictObject({}).transform(() => [])]).default(() => []),
2320
+ sectionType: z25.literal(SectionType.button).default(SectionType.button),
2214
2321
  /**
2215
2322
  * The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
2216
2323
  * client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
@@ -2225,91 +2332,91 @@ var CABButtonSection = z19.object({
2225
2332
  * lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
2226
2333
  * stored payloads to grandfather, and the producer is client code, not a merchant form.
2227
2334
  */
2228
- tier: z19.object({ tierId: z19.string().min(1) }).optional(),
2335
+ tier: z25.object({ tierId: z25.string().min(1) }).optional(),
2229
2336
  /** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
2230
- trackingUrl: z19.string().optional(),
2337
+ trackingUrl: z25.string().optional(),
2231
2338
  /**
2232
2339
  * Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
2233
2340
  * `action` — an `addToOrder` button can also flip a variable. Applied in array order.
2234
2341
  */
2235
- variableEffects: z19.array(CABVariableEffect).optional()
2342
+ variableEffects: z25.array(CABVariableEffect).optional()
2236
2343
  });
2237
2344
 
2238
2345
  // src/schema/widgets/checkout-and-beyond/carousel.ts
2239
- import { z as z24 } from "zod";
2346
+ import { z as z30 } from "zod";
2240
2347
 
2241
2348
  // src/schema/widgets/checkout-and-beyond/offers.ts
2242
- import { z as z23 } from "zod";
2349
+ import { z as z29 } from "zod";
2243
2350
 
2244
2351
  // src/schema/widgets/checkout-and-beyond/dataSource.ts
2245
2352
  import { v7 as uuidv74 } from "uuid";
2246
- import { z as z20 } from "zod";
2247
- var CABDiscount = z20.object({
2248
- amount: z20.union([z20.number(), z20.string()]).catch(0),
2249
- discountedBy: z20.string().optional(),
2250
- discountedFrom: z20.enum(discountSources).optional().catch(void 0),
2251
- type: z20.enum(discountTypes).catch("none")
2353
+ import { z as z26 } from "zod";
2354
+ var CABDiscount = z26.object({
2355
+ amount: z26.union([z26.number(), z26.string()]).catch(0),
2356
+ discountedBy: z26.string().optional(),
2357
+ discountedFrom: z26.enum(discountSources).optional().catch(void 0),
2358
+ type: z26.enum(discountTypes).catch("none")
2252
2359
  });
2253
- var CABIntegrations = z20.object({
2254
- judgeme: z20.boolean().default(false),
2255
- junip: z20.boolean().default(false),
2256
- klaviyo: z20.boolean().default(false),
2257
- loox: z20.boolean().default(false),
2258
- okendo: z20.boolean().default(false),
2259
- opinew: z20.boolean().default(false),
2260
- reviewsio: z20.boolean().default(false),
2261
- stamped: z20.boolean().default(false),
2262
- yotpo: z20.boolean().default(false)
2360
+ var CABIntegrations = z26.object({
2361
+ judgeme: z26.boolean().default(false),
2362
+ junip: z26.boolean().default(false),
2363
+ klaviyo: z26.boolean().default(false),
2364
+ loox: z26.boolean().default(false),
2365
+ okendo: z26.boolean().default(false),
2366
+ opinew: z26.boolean().default(false),
2367
+ reviewsio: z26.boolean().default(false),
2368
+ stamped: z26.boolean().default(false),
2369
+ yotpo: z26.boolean().default(false)
2263
2370
  });
2264
- var CABDataSourceSection = z20.object({
2265
- dataSourceId: z20.number().nullable().default(null),
2266
- dataSourcePath: z20.string().default(DEFAULT_ENDPOINTS[0].value),
2371
+ var CABDataSourceSection = z26.object({
2372
+ dataSourceId: z26.number().nullable().default(null),
2373
+ dataSourcePath: z26.string().default(DEFAULT_ENDPOINTS[0].value),
2267
2374
  discount: CABDiscount.optional(),
2268
2375
  integrations: CABIntegrations.optional(),
2269
- limit: z20.number().default(1),
2270
- matchVariant: z20.boolean().default(false),
2271
- matchVariantOutOfStock: z20.boolean().default(false),
2272
- name: z20.string().default(DEFAULT_ENDPOINTS[0].label),
2273
- productType: z20.enum(productTypes).optional(),
2274
- sectionId: z20.uuid().default(() => uuidv74()),
2275
- sectionType: z20.literal(SectionType.dataSource).default(SectionType.dataSource),
2376
+ limit: z26.number().default(1),
2377
+ matchVariant: z26.boolean().default(false),
2378
+ matchVariantOutOfStock: z26.boolean().default(false),
2379
+ name: z26.string().default(DEFAULT_ENDPOINTS[0].label),
2380
+ productType: z26.enum(productTypes).optional(),
2381
+ sectionId: z26.uuid().default(() => uuidv74()),
2382
+ sectionType: z26.literal(SectionType.dataSource).default(SectionType.dataSource),
2276
2383
  /** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
2277
- subscriptionIsDefault: z20.boolean().default(false),
2278
- treatAsGwp: z20.boolean().default(false)
2384
+ subscriptionIsDefault: z26.boolean().default(false),
2385
+ treatAsGwp: z26.boolean().default(false)
2279
2386
  });
2280
2387
 
2281
2388
  // src/schema/widgets/checkout-and-beyond/products.ts
2282
2389
  import { v7 as uuidv76 } from "uuid";
2283
- import { z as z22 } from "zod";
2390
+ import { z as z28 } from "zod";
2284
2391
 
2285
2392
  // src/schema/widgets/checkout-and-beyond/product.ts
2286
2393
  import { v7 as uuidv75 } from "uuid";
2287
- import { z as z21 } from "zod";
2288
- var CABVariantContent = z21.lazy(
2289
- () => z21.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
2394
+ import { z as z27 } from "zod";
2395
+ var CABVariantContent = z27.lazy(
2396
+ () => z27.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
2290
2397
  );
2291
- var CABProductSection = z21.object({
2398
+ var CABProductSection = z27.object({
2292
2399
  ...CABVariableFields,
2293
- name: z21.string().optional(),
2294
- productId: z21.number().nullable().default(null),
2295
- sectionId: z21.uuid().default(() => uuidv75()),
2296
- sections: z21.union([z21.array(CABVariantContent), z21.strictObject({}).transform(() => [])]).default(() => []),
2297
- sectionType: z21.literal(SectionType.product).default(SectionType.product),
2298
- selectors: z21.record(z21.string(), z21.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
2299
- variantMode: z21.enum(variantModes).default(VariantMode.multiple)
2400
+ name: z27.string().optional(),
2401
+ productId: z27.number().nullable().default(null),
2402
+ sectionId: z27.uuid().default(() => uuidv75()),
2403
+ sections: z27.union([z27.array(CABVariantContent), z27.strictObject({}).transform(() => [])]).default(() => []),
2404
+ sectionType: z27.literal(SectionType.product).default(SectionType.product),
2405
+ selectors: z27.record(z27.string(), z27.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
2406
+ variantMode: z27.enum(variantModes).default(VariantMode.multiple)
2300
2407
  });
2301
2408
 
2302
2409
  // src/schema/widgets/checkout-and-beyond/products.ts
2303
- var CABProductsSection = z22.object({
2410
+ var CABProductsSection = z28.object({
2304
2411
  ...CABVariableFields,
2305
- name: z22.string().optional(),
2306
- sectionId: z22.uuid().default(() => uuidv76()),
2307
- sections: z22.union([z22.array(z22.lazy(() => CABProductSection)), z22.strictObject({}).transform(() => [])]).default(() => []),
2308
- sectionType: z22.literal(SectionType.products).default(SectionType.products)
2412
+ name: z28.string().optional(),
2413
+ sectionId: z28.uuid().default(() => uuidv76()),
2414
+ sections: z28.union([z28.array(z28.lazy(() => CABProductSection)), z28.strictObject({}).transform(() => [])]).default(() => []),
2415
+ sectionType: z28.literal(SectionType.products).default(SectionType.products)
2309
2416
  });
2310
2417
 
2311
2418
  // src/schema/widgets/checkout-and-beyond/offers.ts
2312
- var CABOffersSection = z23.lazy(
2419
+ var CABOffersSection = z29.lazy(
2313
2420
  () => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
2314
2421
  /**
2315
2422
  * A rule between consecutive cards in the vertical list — legacy checkout-offers' `<Divider />`,
@@ -2317,8 +2424,8 @@ var CABOffersSection = z23.lazy(
2317
2424
  * run of products). Optional, not defaulted: only the v1 converter sets it (REB-24265); a
2318
2425
  * hand-built tree keeps React CAB's dividerless rendering.
2319
2426
  */
2320
- divider: z23.boolean().optional(),
2321
- sections: z23.union([z23.array(z23.lazy(() => CABSection)), z23.strictObject({}).transform(() => [])]).default(() => [
2427
+ divider: z29.boolean().optional(),
2428
+ sections: z29.union([z29.array(z29.lazy(() => CABSection)), z29.strictObject({}).transform(() => [])]).default(() => [
2322
2429
  CABBannerSection.parse({
2323
2430
  buttonField: "undoAddToOrder",
2324
2431
  color: "success",
@@ -2332,77 +2439,77 @@ var CABOffersSection = z23.lazy(
2332
2439
  CABDataSourceSection.parse({}),
2333
2440
  CABProductsSection.parse({})
2334
2441
  ]),
2335
- sectionType: z23.literal(SectionType.offers).default(SectionType.offers)
2442
+ sectionType: z29.literal(SectionType.offers).default(SectionType.offers)
2336
2443
  })
2337
2444
  );
2338
2445
 
2339
2446
  // src/schema/widgets/checkout-and-beyond/carousel.ts
2340
- var CABCarouselSection = z24.lazy(
2447
+ var CABCarouselSection = z30.lazy(
2341
2448
  () => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
2342
- autoAdvanceInterval: z24.number().default(0),
2343
- itemsAtOnce: z24.number().min(1).default(1),
2449
+ autoAdvanceInterval: z30.number().default(0),
2450
+ itemsAtOnce: z30.number().min(1).default(1),
2344
2451
  /** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
2345
- offersDirection: z24.enum(offersDirections).default("vertical"),
2346
- sections: z24.union([z24.array(z24.lazy(() => CABSection)), z24.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
2347
- sectionType: z24.literal(SectionType.carousel).default(SectionType.carousel)
2452
+ offersDirection: z30.enum(offersDirections).default("vertical"),
2453
+ sections: z30.union([z30.array(z30.lazy(() => CABSection)), z30.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
2454
+ sectionType: z30.literal(SectionType.carousel).default(SectionType.carousel)
2348
2455
  })
2349
2456
  );
2350
2457
 
2351
2458
  // src/schema/widgets/checkout-and-beyond/cartLine.ts
2352
- import { z as z25 } from "zod";
2353
- var CABCartLineSection = z25.lazy(
2459
+ import { z as z31 } from "zod";
2460
+ var CABCartLineSection = z31.lazy(
2354
2461
  () => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
2355
- sections: z25.union([z25.array(z25.lazy(() => CABSection)), z25.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
2356
- sectionType: z25.literal(SectionType.cartLine).default(SectionType.cartLine)
2462
+ sections: z31.union([z31.array(z31.lazy(() => CABSection)), z31.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
2463
+ sectionType: z31.literal(SectionType.cartLine).default(SectionType.cartLine)
2357
2464
  })
2358
2465
  );
2359
2466
 
2360
2467
  // src/schema/widgets/checkout-and-beyond/discount.ts
2361
2468
  import { v7 as uuidv77 } from "uuid";
2362
- import { z as z26 } from "zod";
2363
- var CABDiscountSection = z26.object({
2469
+ import { z as z32 } from "zod";
2470
+ var CABDiscountSection = z32.object({
2364
2471
  ...CABVariableFields,
2365
- amount: z26.union([z26.number(), z26.string()]).catch(0),
2366
- discountedBy: z26.string().optional(),
2367
- discountedFrom: z26.enum(discountSources).optional().catch(void 0),
2368
- message: z26.string().optional(),
2369
- name: z26.string().optional(),
2370
- quantity: z26.number().default(1),
2371
- sectionId: z26.uuid().default(() => uuidv77()),
2372
- sectionType: z26.literal(SectionType.discount).default(SectionType.discount),
2373
- type: z26.enum(discountTypes).catch("none")
2472
+ amount: z32.union([z32.number(), z32.string()]).catch(0),
2473
+ discountedBy: z32.string().optional(),
2474
+ discountedFrom: z32.enum(discountSources).optional().catch(void 0),
2475
+ message: z32.string().optional(),
2476
+ name: z32.string().optional(),
2477
+ quantity: z32.number().default(1),
2478
+ sectionId: z32.uuid().default(() => uuidv77()),
2479
+ sectionType: z32.literal(SectionType.discount).default(SectionType.discount),
2480
+ type: z32.enum(discountTypes).catch("none")
2374
2481
  });
2375
2482
 
2376
2483
  // src/schema/widgets/checkout-and-beyond/monetize.ts
2377
2484
  import { v7 as uuidv78 } from "uuid";
2378
- import { z as z27 } from "zod";
2379
- var CABMonetizeAds = z27.object({
2380
- requestId: z27.string().optional(),
2485
+ import { z as z33 } from "zod";
2486
+ var CABMonetizeAds = z33.object({
2487
+ requestId: z33.string().optional(),
2381
2488
  /** Defaulted here, never in the beacon: absence of information is `ads` itself being absent. */
2382
- testing: z27.boolean().default(false)
2489
+ testing: z33.boolean().default(false)
2383
2490
  });
2384
- var CABMonetizeSection = z27.object({
2491
+ var CABMonetizeSection = z33.object({
2385
2492
  ...CABVariableFields,
2386
2493
  ads: CABMonetizeAds.optional(),
2387
- name: z27.string().optional(),
2494
+ name: z33.string().optional(),
2388
2495
  /**
2389
2496
  * Server-hydrated offer cards (inline hydration): when `/cab/sections` was asked with a `monetize`
2390
2497
  * context block, the composed cards ride the marker itself — `[]` means "hydrated, no fill" (render
2391
2498
  * nothing, skip the fetch); ABSENT means "not hydrated" (the client fetches via `/cab/monetize`).
2392
2499
  */
2393
- offers: z27.array(z27.lazy(() => CABSection)).optional(),
2500
+ offers: z33.array(z33.lazy(() => CABSection)).optional(),
2394
2501
  /** Privacy Policy footer href (the widget's `privacy_policy_url` setting); read server-side for hydration, relayed by the client only on the legacy `/cab/monetize` fallback. */
2395
- privacyPolicyUrl: z27.string().optional(),
2396
- sectionId: z27.uuid().default(() => uuidv78()),
2397
- sectionType: z27.literal(SectionType.monetize).default(SectionType.monetize),
2502
+ privacyPolicyUrl: z33.string().optional(),
2503
+ sectionId: z33.uuid().default(() => uuidv78()),
2504
+ sectionType: z33.literal(SectionType.monetize).default(SectionType.monetize),
2398
2505
  /** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
2399
- subVertical: z27.string().optional(),
2506
+ subVertical: z33.string().optional(),
2400
2507
  /** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
2401
- vertical: z27.string().optional()
2508
+ vertical: z33.string().optional()
2402
2509
  });
2403
2510
 
2404
2511
  // src/schema/widgets/checkout-and-beyond/progressBar.ts
2405
- import { z as z28 } from "zod";
2512
+ import { z as z34 } from "zod";
2406
2513
 
2407
2514
  // src/schema/widgets/checkout-and-beyond/giftLabels.ts
2408
2515
  var GIFT_LABELS = {
@@ -2521,34 +2628,34 @@ var GIFT_LABELS = {
2521
2628
  };
2522
2629
 
2523
2630
  // src/schema/widgets/checkout-and-beyond/progressBar.ts
2524
- var CABProgressTierExclusion = z28.object({
2525
- collectionIds: z28.array(z28.number().int().positive()).default(() => []),
2526
- productIds: z28.array(z28.number().int().positive()).default(() => []),
2527
- tags: z28.array(z28.string().min(1)).default(() => []),
2528
- type: z28.enum(progressTierExclusionTypes)
2631
+ var CABProgressTierExclusion = z34.object({
2632
+ collectionIds: z34.array(z34.number().int().positive()).default(() => []),
2633
+ productIds: z34.array(z34.number().int().positive()).default(() => []),
2634
+ tags: z34.array(z34.string().min(1)).default(() => []),
2635
+ type: z34.enum(progressTierExclusionTypes)
2529
2636
  });
2530
- var CABProgressTier = z28.object({
2637
+ var CABProgressTier = z34.object({
2531
2638
  /**
2532
2639
  * Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
2533
2640
  * cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
2534
2641
  * `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
2535
2642
  * `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
2536
2643
  */
2537
- discount: z28.object({ amount: z28.number().nonnegative(), type: z28.enum(["fixedAmount", "percentage"]) }).optional(),
2644
+ discount: z34.object({ amount: z34.number().nonnegative(), type: z34.enum(["fixedAmount", "percentage"]) }).optional(),
2538
2645
  /**
2539
2646
  * Per-tier exclusion rules (onsite `exclusions` when `exclusions_enabled`): lines they match don't count
2540
2647
  * toward this tier. Empty (the default, and the converter's output for a disabled or ruleless tier) means
2541
2648
  * the tier measures the plain bar-level adjusted progress. Consumers read ONLY the list named by the rule's
2542
2649
  * `type` — the converter leaves the other two at `[]`, so a populated off-type list never reaches the tree.
2543
2650
  */
2544
- exclusions: z28.array(CABProgressTierExclusion).default(() => []),
2651
+ exclusions: z34.array(CABProgressTierExclusion).default(() => []),
2545
2652
  /**
2546
2653
  * Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
2547
2654
  * tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
2548
2655
  * controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
2549
2656
  * on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
2550
2657
  */
2551
- filterOosVariants: z28.boolean().default(false),
2658
+ filterOosVariants: z34.boolean().default(false),
2552
2659
  /**
2553
2660
  * Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
2554
2661
  * `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
@@ -2556,10 +2663,10 @@ var CABProgressTier = z28.object({
2556
2663
  * tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
2557
2664
  * tree is complete.
2558
2665
  */
2559
- gift: z28.object({
2560
- productId: z28.number().int().positive(),
2561
- title: z28.string().optional(),
2562
- variantIds: z28.array(z28.number().int().positive()).default(() => [])
2666
+ gift: z34.object({
2667
+ productId: z34.number().int().positive(),
2668
+ title: z34.string().optional(),
2669
+ variantIds: z34.array(z34.number().int().positive()).default(() => [])
2563
2670
  }).optional(),
2564
2671
  /**
2565
2672
  * The step-row icon's square size in PIXELS (onsite `product_tier_element_size`, an admin px string the
@@ -2579,7 +2686,7 @@ var CABProgressTier = z28.object({
2579
2686
  * renderer never spells a fallback), which also makes a tree authored before this field render at
2580
2687
  * React's size rather than the old hardcoded 20.
2581
2688
  */
2582
- iconSizePx: z28.number().int().min(1).max(64).default(18),
2689
+ iconSizePx: z34.number().int().min(1).max(64).default(18),
2583
2690
  /**
2584
2691
  * The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
2585
2692
  * type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
@@ -2589,35 +2696,35 @@ var CABProgressTier = z28.object({
2589
2696
  * turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
2590
2697
  * emits no caption slot rather than an empty one). Plain text — a compact icon+label.
2591
2698
  */
2592
- label: z28.record(z28.string(), z28.string()).optional(),
2699
+ label: z34.record(z34.string(), z34.string()).optional(),
2593
2700
  /**
2594
2701
  * Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
2595
2702
  * the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
2596
2703
  * carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
2597
2704
  * parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
2598
2705
  */
2599
- productTierImage: z28.boolean().default(false),
2706
+ productTierImage: z34.boolean().default(false),
2600
2707
  /**
2601
2708
  * The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
2602
2709
  * fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
2603
2710
  * multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
2604
2711
  * `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
2605
2712
  */
2606
- threshold: z28.number().int().nonnegative(),
2713
+ threshold: z34.number().int().nonnegative(),
2607
2714
  /**
2608
2715
  * Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
2609
2716
  * When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
2610
2717
  * `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
2611
2718
  * converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
2612
2719
  */
2613
- thresholds: z28.record(z28.string(), z28.number().int().nonnegative()).default(() => ({})),
2720
+ thresholds: z34.record(z34.string(), z34.number().int().nonnegative()).default(() => ({})),
2614
2721
  /**
2615
2722
  * Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
2616
2723
  * match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
2617
2724
  * shipping bar (single unlabeled tier, no gift).
2618
2725
  */
2619
- tierId: z28.string().optional(),
2620
- tierType: z28.enum(progressTierTypes).default(ProgressTierType.shipping),
2726
+ tierId: z34.string().optional(),
2727
+ tierType: z34.enum(progressTierTypes).default(ProgressTierType.shipping),
2621
2728
  /**
2622
2729
  * What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
2623
2730
  * the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
@@ -2628,9 +2735,9 @@ var CABProgressTier = z28.object({
2628
2735
  * count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
2629
2736
  * template text supplies grammatically-neutral wording around the token.
2630
2737
  */
2631
- unit: z28.enum(progressTierUnits).default(ProgressTierUnit.currency)
2738
+ unit: z34.enum(progressTierUnits).default(ProgressTierUnit.currency)
2632
2739
  });
2633
- var CABProgressBarSection = z28.lazy(
2740
+ var CABProgressBarSection = z34.lazy(
2634
2741
  () => CABLayoutSection.omit({ sectionType: true }).extend({
2635
2742
  /**
2636
2743
  * The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
@@ -2639,35 +2746,35 @@ var CABProgressBarSection = z28.lazy(
2639
2746
  * checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
2640
2747
  * (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
2641
2748
  */
2642
- barId: z28.string().optional(),
2749
+ barId: z34.string().optional(),
2643
2750
  /** Empty = shown everywhere; otherwise uppercase ISO country codes. */
2644
- countryCodes: z28.array(z28.string().transform((code) => code.trim().toUpperCase())).default(() => []),
2751
+ countryCodes: z34.array(z34.string().transform((code) => code.trim().toUpperCase())).default(() => []),
2645
2752
  /**
2646
2753
  * Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
2647
2754
  * hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
2648
2755
  */
2649
- excludeCountryCodes: z28.array(z28.string().transform((code) => code.trim().toUpperCase())).default(() => []),
2756
+ excludeCountryCodes: z34.array(z34.string().transform((code) => code.trim().toUpperCase())).default(() => []),
2650
2757
  /**
2651
2758
  * Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
2652
2759
  * forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
2653
2760
  * adds the cart's discount allocations back to the live subtotal.
2654
2761
  */
2655
- excludeDiscountInSubtotal: z28.boolean().default(false),
2762
+ excludeDiscountInSubtotal: z34.boolean().default(false),
2656
2763
  /** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
2657
- excludedVariantIds: z28.array(z28.number().int().positive()).default(() => []),
2764
+ excludedVariantIds: z34.array(z34.number().int().positive()).default(() => []),
2658
2765
  /**
2659
2766
  * When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
2660
2767
  * `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
2661
2768
  */
2662
- freeShippingOnSubscription: z28.boolean().default(false),
2769
+ freeShippingOnSubscription: z34.boolean().default(false),
2663
2770
  /** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
2664
- giftAreaTitle: z28.record(z28.string(), z28.string()).default(() => ({ en: "FREE GIFTS" })),
2771
+ giftAreaTitle: z34.record(z34.string(), z34.string()).default(() => ({ en: "FREE GIFTS" })),
2665
2772
  /** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
2666
- giftLabels: z28.object({
2667
- addGift: z28.record(z28.string(), z28.string()).default(() => ({ ...GIFT_LABELS.addGift })),
2668
- remove: z28.record(z28.string(), z28.string()).default(() => ({ ...GIFT_LABELS.remove })),
2669
- selectOptions: z28.record(z28.string(), z28.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
2670
- yourGift: z28.record(z28.string(), z28.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
2773
+ giftLabels: z34.object({
2774
+ addGift: z34.record(z34.string(), z34.string()).default(() => ({ ...GIFT_LABELS.addGift })),
2775
+ remove: z34.record(z34.string(), z34.string()).default(() => ({ ...GIFT_LABELS.remove })),
2776
+ selectOptions: z34.record(z34.string(), z34.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
2777
+ yourGift: z34.record(z34.string(), z34.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
2671
2778
  }).default(() => ({
2672
2779
  addGift: { ...GIFT_LABELS.addGift },
2673
2780
  remove: { ...GIFT_LABELS.remove },
@@ -2675,38 +2782,38 @@ var CABProgressBarSection = z28.lazy(
2675
2782
  yourGift: { ...GIFT_LABELS.yourGift }
2676
2783
  })),
2677
2784
  /** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
2678
- name: z28.string().default("Order progress"),
2785
+ name: z34.string().default("Order progress"),
2679
2786
  /**
2680
2787
  * Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
2681
2788
  * fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
2682
2789
  * absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
2683
2790
  * optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
2684
2791
  */
2685
- progressColor: z28.string().optional(),
2686
- sectionType: z28.literal(SectionType.progressBar).default(SectionType.progressBar),
2792
+ progressColor: z34.string().optional(),
2793
+ sectionType: z34.literal(SectionType.progressBar).default(SectionType.progressBar),
2687
2794
  /**
2688
2795
  * The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
2689
2796
  * O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
2690
2797
  * count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
2691
2798
  * gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
2692
2799
  */
2693
- tiers: z28.union([z28.array(CABProgressTier), z28.strictObject({}).transform(() => [])]).default(() => [])
2800
+ tiers: z34.union([z34.array(CABProgressTier), z34.strictObject({}).transform(() => [])]).default(() => [])
2694
2801
  })
2695
2802
  );
2696
2803
 
2697
2804
  // src/schema/widgets/checkout-and-beyond/quantity.ts
2698
2805
  import { v7 as uuidv79 } from "uuid";
2699
- import { z as z29 } from "zod";
2700
- var CABQuantitySection = z29.object({
2806
+ import { z as z35 } from "zod";
2807
+ var CABQuantitySection = z35.object({
2701
2808
  ...CABVariableFields,
2702
- errorMessages: z29.record(
2703
- z29.string(),
2704
- z29.object({
2809
+ errorMessages: z35.record(
2810
+ z35.string(),
2811
+ z35.object({
2705
2812
  /** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
2706
- increment: z29.string().optional(),
2707
- max: z29.string().optional(),
2708
- min: z29.string().optional(),
2709
- neg: z29.string().optional()
2813
+ increment: z35.string().optional(),
2814
+ max: z35.string().optional(),
2815
+ min: z35.string().optional(),
2816
+ neg: z35.string().optional()
2710
2817
  })
2711
2818
  ).default({
2712
2819
  en: {
@@ -2716,18 +2823,18 @@ var CABQuantitySection = z29.object({
2716
2823
  neg: "Quantity cannot be negative"
2717
2824
  }
2718
2825
  }),
2719
- inputType: z29.enum(quantityInputs).default(QuantityInput.select),
2720
- max: z29.number().min(1).max(100).default(10),
2721
- min: z29.number().min(1).default(1),
2826
+ inputType: z35.enum(quantityInputs).default(QuantityInput.select),
2827
+ max: z35.number().min(1).max(100).default(10),
2828
+ min: z35.number().min(1).default(1),
2722
2829
  /** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
2723
- name: z29.string().default("Quantity"),
2724
- sectionId: z29.uuid().default(() => uuidv79()),
2725
- sectionType: z29.literal(SectionType.quantity).default(SectionType.quantity)
2830
+ name: z35.string().default("Quantity"),
2831
+ sectionId: z35.uuid().default(() => uuidv79()),
2832
+ sectionType: z35.literal(SectionType.quantity).default(SectionType.quantity)
2726
2833
  });
2727
2834
 
2728
2835
  // src/schema/widgets/checkout-and-beyond/reviews.ts
2729
2836
  import { v7 as uuidv710 } from "uuid";
2730
- import { z as z30 } from "zod";
2837
+ import { z as z36 } from "zod";
2731
2838
 
2732
2839
  // src/schema/widgets/checkout-and-beyond/reviewLabels.ts
2733
2840
  var REVIEW_LABELS = {
@@ -2790,50 +2897,50 @@ var REVIEW_LABELS = {
2790
2897
  };
2791
2898
 
2792
2899
  // src/schema/widgets/checkout-and-beyond/reviews.ts
2793
- var CABReviewsSection = z30.object({
2900
+ var CABReviewsSection = z36.object({
2794
2901
  ...CABVariableFields,
2795
- color: z30.string().default("#fadb14"),
2902
+ color: z36.string().default("#fadb14"),
2796
2903
  /**
2797
2904
  * Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
2798
2905
  * form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
2799
2906
  * or merchant work.
2800
2907
  */
2801
- countLabels: z30.object({
2802
- one: z30.record(z30.string(), z30.string()).default(() => ({ ...REVIEW_LABELS.one })),
2803
- other: z30.record(z30.string(), z30.string()).default(() => ({ ...REVIEW_LABELS.other }))
2908
+ countLabels: z36.object({
2909
+ one: z36.record(z36.string(), z36.string()).default(() => ({ ...REVIEW_LABELS.one })),
2910
+ other: z36.record(z36.string(), z36.string()).default(() => ({ ...REVIEW_LABELS.other }))
2804
2911
  }).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
2805
- name: z30.string().optional(),
2806
- sectionId: z30.uuid().default(() => uuidv710()),
2807
- sectionType: z30.literal(SectionType.reviews).default(SectionType.reviews),
2808
- size: z30.enum(reviewsSizes).default(ReviewsSize.default)
2912
+ name: z36.string().optional(),
2913
+ sectionId: z36.uuid().default(() => uuidv710()),
2914
+ sectionType: z36.literal(SectionType.reviews).default(SectionType.reviews),
2915
+ size: z36.enum(reviewsSizes).default(ReviewsSize.default)
2809
2916
  });
2810
2917
 
2811
2918
  // src/schema/widgets/checkout-and-beyond/variants.ts
2812
2919
  import { slice } from "es-toolkit/compat";
2813
2920
  import { v7 as uuidv711 } from "uuid";
2814
- import { z as z31 } from "zod";
2815
- var CABVariantsSection = z31.object({
2921
+ import { z as z37 } from "zod";
2922
+ var CABVariantsSection = z37.object({
2816
2923
  ...CABVariableFields,
2817
- hideOutOfStockVariants: z31.boolean().default(false),
2818
- name: z31.string().optional(),
2819
- sectionId: z31.uuid().default(() => uuidv711()),
2820
- sectionType: z31.literal(SectionType.variants).default(SectionType.variants),
2821
- selector: z31.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu),
2822
- variantMode: z31.enum(variantModes).default(VariantMode.multiple)
2924
+ hideOutOfStockVariants: z37.boolean().default(false),
2925
+ name: z37.string().optional(),
2926
+ sectionId: z37.uuid().default(() => uuidv711()),
2927
+ sectionType: z37.literal(SectionType.variants).default(SectionType.variants),
2928
+ selector: z37.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu),
2929
+ variantMode: z37.enum(variantModes).default(VariantMode.multiple)
2823
2930
  });
2824
2931
 
2825
2932
  // src/schema/widgets/checkout-and-beyond/shared.ts
2826
- var CABBorder = z32.object({
2827
- radius: z32.enum(borderRadii).default(BorderRadius.base),
2828
- style: z32.enum(borderStyles).default(BorderStyle.none),
2829
- width: z32.enum(borderWidths).default(BorderWidth.base)
2933
+ var CABBorder = z38.object({
2934
+ radius: z38.enum(borderRadii).default(BorderRadius.base),
2935
+ style: z38.enum(borderStyles).default(BorderStyle.none),
2936
+ width: z38.enum(borderWidths).default(BorderWidth.base)
2830
2937
  }).default({
2831
2938
  radius: BorderRadius.base,
2832
2939
  style: BorderStyle.none,
2833
2940
  width: BorderWidth.base
2834
2941
  });
2835
- var CABSection = z32.lazy(
2836
- () => z32.discriminatedUnion("sectionType", [
2942
+ var CABSection = z38.lazy(
2943
+ () => z38.discriminatedUnion("sectionType", [
2837
2944
  CABBannerSection,
2838
2945
  CABButtonSection,
2839
2946
  CABCarouselSection,
@@ -2855,32 +2962,32 @@ var CABSection = z32.lazy(
2855
2962
  );
2856
2963
 
2857
2964
  // src/schema/widgets/checkout-and-beyond/layout.ts
2858
- var GridItem = z33.union([z33.literal("auto"), z33.literal("fill"), z33.string().regex(/^\d+%$/), z33.number()]);
2859
- var CABLayoutSection = z33.object({
2965
+ var GridItem = z39.union([z39.literal("auto"), z39.literal("fill"), z39.string().regex(/^\d+%$/), z39.number()]);
2966
+ var CABLayoutSection = z39.object({
2860
2967
  ...CABVariableFields,
2861
- alignment: z33.object({
2862
- horizontal: z33.enum(horizontalAlignments).default(HorizontalAlignment.start),
2863
- vertical: z33.enum(verticalAlignments).default(VerticalAlignment.top)
2968
+ alignment: z39.object({
2969
+ horizontal: z39.enum(horizontalAlignments).default(HorizontalAlignment.start),
2970
+ vertical: z39.enum(verticalAlignments).default(VerticalAlignment.top)
2864
2971
  }).default({
2865
2972
  horizontal: HorizontalAlignment.start,
2866
2973
  vertical: VerticalAlignment.top
2867
2974
  }),
2868
- border: z33.lazy(() => CABBorder),
2869
- buttonField: z33.enum(buttonFields).optional(),
2870
- direction: z33.enum(directions).default(Direction.rows),
2871
- grid: z33.object({
2872
- columns: z33.union([z33.array(GridItem), z33.undefined()]).default(() => ["auto"]),
2873
- rows: z33.union([z33.array(GridItem), z33.undefined()]).default(() => ["auto"])
2975
+ border: z39.lazy(() => CABBorder),
2976
+ buttonField: z39.enum(buttonFields).optional(),
2977
+ direction: z39.enum(directions).default(Direction.rows),
2978
+ grid: z39.object({
2979
+ columns: z39.union([z39.array(GridItem), z39.undefined()]).default(() => ["auto"]),
2980
+ rows: z39.union([z39.array(GridItem), z39.undefined()]).default(() => ["auto"])
2874
2981
  }).default({ columns: ["auto"], rows: ["auto"] }).optional(),
2875
- name: z33.string().optional(),
2876
- padding: z33.enum(spacings).default(Spacing.none),
2877
- sectionId: z33.uuid().default(() => uuidv712()),
2878
- sections: z33.union([z33.array(z33.lazy(() => CABSection)), z33.strictObject({}).transform(() => [])]).default(() => []),
2879
- sectionType: z33.literal(SectionType.layout).default(SectionType.layout),
2880
- spacing: z33.enum(spacings).default(Spacing.base),
2982
+ name: z39.string().optional(),
2983
+ padding: z39.enum(spacings).default(Spacing.none),
2984
+ sectionId: z39.uuid().default(() => uuidv712()),
2985
+ sections: z39.union([z39.array(z39.lazy(() => CABSection)), z39.strictObject({}).transform(() => [])]).default(() => []),
2986
+ sectionType: z39.literal(SectionType.layout).default(SectionType.layout),
2987
+ spacing: z39.enum(spacings).default(Spacing.base),
2881
2988
  /** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
2882
- viewUrl: z33.string().optional(),
2883
- width: z33.number().default(100)
2989
+ viewUrl: z39.string().optional(),
2990
+ width: z39.number().default(100)
2884
2991
  });
2885
2992
 
2886
2993
  // src/schema/widgets/checkout-and-beyond/uiLabels.ts
@@ -2901,8 +3008,8 @@ var UI_LABELS = {
2901
3008
  };
2902
3009
 
2903
3010
  // src/schema/widgets/checkout-and-beyond/root.ts
2904
- var localized = (fallback) => z34.record(z34.string(), z34.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
2905
- var CABUILabels = z34.object({
3011
+ var localized = (fallback) => z40.record(z40.string(), z40.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
3012
+ var CABUILabels = z40.object({
2906
3013
  currentPage: localized(UI_LABELS.currentPage),
2907
3014
  guest: localized(UI_LABELS.guest),
2908
3015
  loadingOptions: localized(UI_LABELS.loadingOptions),
@@ -2927,154 +3034,154 @@ var CABUILabels = z34.object({
2927
3034
  subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
2928
3035
  updating: { ...UI_LABELS.updating }
2929
3036
  }));
2930
- var TargetArea = z34.object({
2931
- fill: z34.boolean().optional(),
2932
- flip: z34.enum(["both", "horizontal", "vertical"]).optional(),
2933
- icon: z34.string(),
2934
- label: z34.string(),
2935
- width: z34.string()
3037
+ var TargetArea = z40.object({
3038
+ fill: z40.boolean().optional(),
3039
+ flip: z40.enum(["both", "horizontal", "vertical"]).optional(),
3040
+ icon: z40.string(),
3041
+ label: z40.string(),
3042
+ width: z40.string()
2936
3043
  }).default(targetAreas[EditorMode.checkoutExtension][1]);
2937
- var CABTracking = z34.object({
2938
- enableAttribution: z34.boolean().nullish().transform((value) => value ?? true),
2939
- enableSource: z34.boolean().nullish().transform((value) => value ?? true),
2940
- enableWidget: z34.boolean().nullish().transform((value) => value ?? true)
3044
+ var CABTracking = z40.object({
3045
+ enableAttribution: z40.boolean().nullish().transform((value) => value ?? true),
3046
+ enableSource: z40.boolean().nullish().transform((value) => value ?? true),
3047
+ enableWidget: z40.boolean().nullish().transform((value) => value ?? true)
2941
3048
  }).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
2942
- var CABExperiment = z34.object({
2943
- elementId: z34.number(),
2944
- experimentId: z34.number(),
2945
- experimentType: z34.string(),
2946
- selectedId: z34.number()
3049
+ var CABExperiment = z40.object({
3050
+ elementId: z40.number(),
3051
+ experimentId: z40.number(),
3052
+ experimentType: z40.string(),
3053
+ selectedId: z40.number()
2947
3054
  });
2948
3055
  var CABRootSection = CABLayoutSection.extend({
2949
- editorMode: z34.enum(editorModes).default(EditorMode.checkoutExtension),
3056
+ editorMode: z40.enum(editorModes).default(EditorMode.checkoutExtension),
2950
3057
  experiment: CABExperiment.optional(),
2951
3058
  // Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
2952
3059
  // `null` must fall back rather than throw the widget; malformed values still throw.
2953
- previewMode: z34.boolean().nullish().transform((value) => value ?? false),
2954
- storeId: z34.number().nullable().default(null),
3060
+ previewMode: z40.boolean().nullish().transform((value) => value ?? false),
3061
+ storeId: z40.number().nullable().default(null),
2955
3062
  targetArea: TargetArea.nullable(),
2956
3063
  tracking: CABTracking,
2957
- type: z34.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
3064
+ type: z40.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
2958
3065
  uiLabels: CABUILabels,
2959
- version: z34.literal(2).default(2),
2960
- widgetId: z34.number().nullable().default(null)
3066
+ version: z40.literal(2).default(2),
3067
+ widgetId: z40.number().nullable().default(null)
2961
3068
  });
2962
3069
 
2963
3070
  // src/schema/widgets/contentBlock.ts
2964
- var ContentBlockV1 = z35.object({
2965
- blockSpacing: z35.enum(spacings).optional(),
2966
- imageBlocks: z35.union([
2967
- z35.array(
2968
- z35.object({
2969
- altText: z35.string().nullable(),
2970
- description: z35.string().nullable(),
2971
- id: z35.uuid(),
2972
- imagePlacement: z35.enum(["top", "right", "bottom", "left"]),
2973
- imageSize: z35.number(),
2974
- imageUrl: z35.url(),
2975
- textAlignment: z35.enum(["left", "center", "right"]),
3071
+ var ContentBlockV1 = z41.object({
3072
+ blockSpacing: z41.enum(spacings).optional(),
3073
+ imageBlocks: z41.union([
3074
+ z41.array(
3075
+ z41.object({
3076
+ altText: z41.string().nullable(),
3077
+ description: z41.string().nullable(),
3078
+ id: z41.uuid(),
3079
+ imagePlacement: z41.enum(["top", "right", "bottom", "left"]),
3080
+ imageSize: z41.number(),
3081
+ imageUrl: z41.url(),
3082
+ textAlignment: z41.enum(["left", "center", "right"]),
2976
3083
  /** Inline scale only: an image caption can never be a block-level heading. */
2977
- textSize: z35.enum(inlineTextSizeNames)
3084
+ textSize: z41.enum(inlineTextSizeNames)
2978
3085
  })
2979
3086
  ),
2980
- z35.strictObject({}).transform(() => [])
3087
+ z41.strictObject({}).transform(() => [])
2981
3088
  ]).optional(),
2982
- imageLayout: z35.enum(["row", "column"]).optional(),
2983
- language: z35.object({
2984
- description: z35.string(),
2985
- superTitle: z35.string(),
2986
- title: z35.string()
3089
+ imageLayout: z41.enum(["row", "column"]).optional(),
3090
+ language: z41.object({
3091
+ description: z41.string(),
3092
+ superTitle: z41.string(),
3093
+ title: z41.string()
2987
3094
  }),
2988
- previewMode: z35.boolean(),
2989
- type: z35.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
2990
- version: z35.literal(1)
3095
+ previewMode: z41.boolean(),
3096
+ type: z41.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
3097
+ version: z41.literal(1)
2991
3098
  });
2992
- var ContentBlock = z35.discriminatedUnion("version", [
3099
+ var ContentBlock = z41.discriminatedUnion("version", [
2993
3100
  ContentBlockV1,
2994
3101
  CABRootSection.extend({
2995
- type: z35.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
3102
+ type: z41.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
2996
3103
  })
2997
3104
  ]);
2998
3105
 
2999
3106
  // src/schema/widgets/giftWithPurchase.ts
3000
- import { z as z36 } from "zod";
3001
- var GiftWithPurchase = z36.looseObject({
3002
- type: z36.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
3107
+ import { z as z42 } from "zod";
3108
+ var GiftWithPurchase = z42.looseObject({
3109
+ type: z42.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
3003
3110
  });
3004
3111
 
3005
3112
  // src/schema/widgets/lineItemEditor.ts
3006
- import { z as z37 } from "zod";
3007
- var LineItemEditorSwitchLanguageV1 = z37.object({
3008
- downgradeToOneTimeLabel: z37.string().optional(),
3113
+ import { z as z43 } from "zod";
3114
+ var LineItemEditorSwitchLanguageV1 = z43.object({
3115
+ downgradeToOneTimeLabel: z43.string().optional(),
3009
3116
  /** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
3010
- subscriptionOptionLabel: z37.string().optional(),
3011
- upgradeToSubscriptionLabel: z37.string().optional(),
3012
- upgradeToSubscriptionWithoutDiscountLabel: z37.string().optional()
3117
+ subscriptionOptionLabel: z43.string().optional(),
3118
+ upgradeToSubscriptionLabel: z43.string().optional(),
3119
+ upgradeToSubscriptionWithoutDiscountLabel: z43.string().optional()
3013
3120
  });
3014
- var LineItemEditorV1 = z37.object({
3121
+ var LineItemEditorV1 = z43.object({
3015
3122
  /** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
3016
- button: z37.object({ kind: z37.enum(["plain", "primary", "secondary"]).optional() }).optional(),
3017
- previewMode: z37.boolean().optional(),
3018
- switchToSubscription: z37.object({
3019
- disableDowngrade: z37.boolean().optional(),
3123
+ button: z43.object({ kind: z43.enum(["plain", "primary", "secondary"]).optional() }).optional(),
3124
+ previewMode: z43.boolean().optional(),
3125
+ switchToSubscription: z43.object({
3126
+ disableDowngrade: z43.boolean().optional(),
3020
3127
  language: LineItemEditorSwitchLanguageV1.optional()
3021
3128
  }).optional(),
3022
- switchToSubscriptionEnabled: z37.boolean().optional(),
3023
- tracking: z37.object({
3024
- enableAttribution: z37.boolean().optional(),
3025
- enableSource: z37.boolean().optional(),
3026
- enableWidget: z37.boolean().optional()
3129
+ switchToSubscriptionEnabled: z43.boolean().optional(),
3130
+ tracking: z43.object({
3131
+ enableAttribution: z43.boolean().optional(),
3132
+ enableSource: z43.boolean().optional(),
3133
+ enableWidget: z43.boolean().optional()
3027
3134
  }).optional(),
3028
- type: z37.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
3029
- version: z37.literal(1)
3135
+ type: z43.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
3136
+ version: z43.literal(1)
3030
3137
  });
3031
- var LineItemEditor = z37.discriminatedUnion("version", [
3138
+ var LineItemEditor = z43.discriminatedUnion("version", [
3032
3139
  LineItemEditorV1,
3033
3140
  CABRootSection.extend({
3034
- type: z37.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
3141
+ type: z43.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
3035
3142
  })
3036
3143
  ]);
3037
3144
 
3038
3145
  // src/schema/widgets/progressBar.ts
3039
- import { z as z38 } from "zod";
3040
- var ProgressBar = z38.looseObject({
3041
- type: z38.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
3146
+ import { z as z44 } from "zod";
3147
+ var ProgressBar = z44.looseObject({
3148
+ type: z44.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
3042
3149
  });
3043
3150
 
3044
3151
  // src/schema/widgets/rebuyButton.ts
3045
- import { z as z39 } from "zod";
3046
- var RebuyButtonV1 = z39.looseObject({
3047
- type: z39.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
3048
- version: z39.literal(1)
3152
+ import { z as z45 } from "zod";
3153
+ var RebuyButtonV1 = z45.looseObject({
3154
+ type: z45.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
3155
+ version: z45.literal(1)
3049
3156
  });
3050
- var RebuyButton = z39.discriminatedUnion("version", [
3157
+ var RebuyButton = z45.discriminatedUnion("version", [
3051
3158
  RebuyButtonV1,
3052
3159
  CABRootSection.extend({
3053
- type: z39.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
3160
+ type: z45.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
3054
3161
  })
3055
3162
  ]);
3056
3163
 
3057
3164
  // src/schema/widgets/rebuyMonetize.ts
3058
- import { z as z40 } from "zod";
3059
- var RebuyMonetize = z40.looseObject({
3060
- type: z40.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
3165
+ import { z as z46 } from "zod";
3166
+ var RebuyMonetize = z46.looseObject({
3167
+ type: z46.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
3061
3168
  });
3062
- var RebuyMonetizeV1 = z40.object({
3063
- name: z40.string().nullable().optional(),
3064
- previewMode: z40.boolean().optional(),
3169
+ var RebuyMonetizeV1 = z46.object({
3170
+ name: z46.string().nullable().optional(),
3171
+ previewMode: z46.boolean().optional(),
3065
3172
  /** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
3066
- privacyPolicyUrl: z40.string().nullable().optional(),
3173
+ privacyPolicyUrl: z46.string().nullable().optional(),
3067
3174
  /** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
3068
- subVertical: z40.string().nullable().optional(),
3069
- tracking: z40.object({
3070
- enableAttribution: z40.boolean().optional(),
3071
- enableSource: z40.boolean().optional(),
3072
- enableWidget: z40.boolean().optional()
3175
+ subVertical: z46.string().nullable().optional(),
3176
+ tracking: z46.object({
3177
+ enableAttribution: z46.boolean().optional(),
3178
+ enableSource: z46.boolean().optional(),
3179
+ enableWidget: z46.boolean().optional()
3073
3180
  }).optional(),
3074
- type: z40.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
3075
- version: z40.literal(1),
3181
+ type: z46.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
3182
+ version: z46.literal(1),
3076
3183
  /** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
3077
- vertical: z40.string().nullable().optional()
3184
+ vertical: z46.string().nullable().optional()
3078
3185
  });
3079
3186
 
3080
3187
  // src/schema/widgetData.ts
@@ -3088,7 +3195,7 @@ var extensionWidgetTypes = [
3088
3195
  WidgetType.ui_extension_line_item_editor,
3089
3196
  WidgetType.ui_extension_progress_bar
3090
3197
  ];
3091
- var WidgetData = z41.discriminatedUnion("type", [
3198
+ var WidgetData = z47.discriminatedUnion("type", [
3092
3199
  ABTestingPlaceholder,
3093
3200
  CheckoutExtension,
3094
3201
  ContentBlock,
@@ -3449,15 +3556,15 @@ var SWITCH_LABELS = {
3449
3556
 
3450
3557
  // src/schema/widgets/post-purchase-offer/common.ts
3451
3558
  import { replace, toNumber, toString } from "es-toolkit/compat";
3452
- import { z as z42 } from "zod";
3453
- var strictNumber = z42.union([
3454
- z42.number(),
3455
- z42.string().transform((value) => toNumber(replace(toString(value), /[^0-9.]/g, "")) || 0),
3456
- z42.unknown().transform(() => 0)
3559
+ import { z as z48 } from "zod";
3560
+ var strictNumber = z48.union([
3561
+ z48.number(),
3562
+ z48.string().transform((value) => toNumber(replace(toString(value), /[^0-9.]/g, "")) || 0),
3563
+ z48.unknown().transform(() => 0)
3457
3564
  ]);
3458
3565
 
3459
3566
  // src/schema/widgets/post-purchase-offer/constants.ts
3460
- import { z as z43 } from "zod";
3567
+ import { z as z49 } from "zod";
3461
3568
  var blockTypes = [
3462
3569
  "callout_banner",
3463
3570
  "image",
@@ -3468,144 +3575,144 @@ var blockTypes = [
3468
3575
  "text",
3469
3576
  "timer"
3470
3577
  ];
3471
- var blockType = z43.enum(blockTypes);
3578
+ var blockType = z49.enum(blockTypes);
3472
3579
  var BlockType = blockType.enum;
3473
3580
 
3474
3581
  // src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
3475
3582
  import { get as get3, isEqual } from "es-toolkit/compat";
3476
3583
  import { v4 as uuidv42 } from "uuid";
3477
- import { z as z44 } from "zod";
3478
- var TextAlignment2 = z44.union([z44.enum(["leading", "center", "trailing"]), z44.unknown().transform(() => "leading")]);
3479
- var TextSize = z44.union([
3480
- z44.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
3481
- z44.unknown().transform(() => "medium")
3584
+ import { z as z50 } from "zod";
3585
+ var TextAlignment2 = z50.union([z50.enum(["leading", "center", "trailing"]), z50.unknown().transform(() => "leading")]);
3586
+ var TextSize = z50.union([
3587
+ z50.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
3588
+ z50.unknown().transform(() => "medium")
3482
3589
  ]);
3483
- var CalloutBannerBlock = z44.object({
3484
- id: z44.string().optional().default(() => uuidv42()),
3485
- name: z44.string().optional(),
3486
- settings: z44.object({
3487
- superTitle: z44.union([z44.string(), TiptapDocument]).default(() => "Limited-time Offer"),
3488
- title: z44.union([z44.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
3590
+ var CalloutBannerBlock = z50.object({
3591
+ id: z50.string().optional().default(() => uuidv42()),
3592
+ name: z50.string().optional(),
3593
+ settings: z50.object({
3594
+ superTitle: z50.union([z50.string(), TiptapDocument]).default(() => "Limited-time Offer"),
3595
+ title: z50.union([z50.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
3489
3596
  }),
3490
- styles: z44.object({
3491
- superTitleEmphasized: z44.boolean().default(false),
3597
+ styles: z50.object({
3598
+ superTitleEmphasized: z50.boolean().default(false),
3492
3599
  superTitleSize: TextSize.default("large"),
3493
3600
  textAlignment: TextAlignment2.default("center"),
3494
- titleEmphasized: z44.boolean().default(true),
3601
+ titleEmphasized: z50.boolean().default(true),
3495
3602
  titleSize: TextSize.default("large")
3496
3603
  }),
3497
- type: z44.literal(BlockType.callout_banner).default(BlockType.callout_banner)
3604
+ type: z50.literal(BlockType.callout_banner).default(BlockType.callout_banner)
3498
3605
  });
3499
- var ImageBlock = z44.object({
3500
- id: z44.string().optional().default(() => uuidv42()),
3501
- name: z44.string().optional(),
3502
- settings: z44.union([
3503
- z44.object({
3606
+ var ImageBlock = z50.object({
3607
+ id: z50.string().optional().default(() => uuidv42()),
3608
+ name: z50.string().optional(),
3609
+ settings: z50.union([
3610
+ z50.object({
3504
3611
  /** This isn't used in the post-purchase offer widget */
3505
- alt: z44.string().optional().default(""),
3506
- image: z44.union([z44.literal(""), z44.url()]).default(""),
3507
- imageSize: z44.number().default(20),
3508
- imageType: z44.enum(["URL", "UPLOAD"]).default("URL")
3612
+ alt: z50.string().optional().default(""),
3613
+ image: z50.union([z50.literal(""), z50.url()]).default(""),
3614
+ imageSize: z50.number().default(20),
3615
+ imageType: z50.enum(["URL", "UPLOAD"]).default("URL")
3509
3616
  }),
3510
- z44.array(z44.never()).transform(() => ({}))
3617
+ z50.array(z50.never()).transform(() => ({}))
3511
3618
  ]),
3512
- type: z44.literal(BlockType.image).default(BlockType.image)
3619
+ type: z50.literal(BlockType.image).default(BlockType.image)
3513
3620
  });
3514
- var ImageContentBlock = z44.object({
3515
- id: z44.string().optional().default(() => uuidv42()),
3516
- name: z44.string().optional(),
3517
- settings: z44.object({
3518
- alt: z44.string().optional().default(""),
3519
- description: z44.union([z44.string(), TiptapDocument, z44.null()]).default(
3621
+ var ImageContentBlock = z50.object({
3622
+ id: z50.string().optional().default(() => uuidv42()),
3623
+ name: z50.string().optional(),
3624
+ settings: z50.object({
3625
+ alt: z50.string().optional().default(""),
3626
+ description: z50.union([z50.string(), TiptapDocument, z50.null()]).default(
3520
3627
  "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."
3521
3628
  ),
3522
3629
  descriptionSize: TextSize.default("medium"),
3523
3630
  horizontalAlignment: TextAlignment2.default("leading"),
3524
- image: z44.union([z44.literal(""), z44.url()]).default(""),
3525
- imagePlacement: z44.enum(["bottom", "left", "right", "top"]).optional().default("left"),
3526
- imageSize: z44.number().default(20),
3527
- superTitle: z44.union([z44.string(), TiptapDocument]).default("Lorem Ipsum!"),
3631
+ image: z50.union([z50.literal(""), z50.url()]).default(""),
3632
+ imagePlacement: z50.enum(["bottom", "left", "right", "top"]).optional().default("left"),
3633
+ imageSize: z50.number().default(20),
3634
+ superTitle: z50.union([z50.string(), TiptapDocument]).default("Lorem Ipsum!"),
3528
3635
  superTitleSize: TextSize.default("medium"),
3529
3636
  /** This isn't configurable in the admin-nextjs editor */
3530
- swapContent: z44.boolean().optional().default(false),
3531
- title: z44.union([z44.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
3637
+ swapContent: z50.boolean().optional().default(false),
3638
+ title: z50.union([z50.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
3532
3639
  titleSize: TextSize.default("medium")
3533
3640
  }),
3534
- type: z44.literal(BlockType.image_content).default(BlockType.image_content)
3641
+ type: z50.literal(BlockType.image_content).default(BlockType.image_content)
3535
3642
  });
3536
- var PayButtonBlock = z44.object({
3537
- id: z44.string().optional().default(() => uuidv42()),
3538
- name: z44.string().optional(),
3539
- settings: z44.union([
3540
- z44.object({
3541
- label: z44.string().default("Pay Now")
3643
+ var PayButtonBlock = z50.object({
3644
+ id: z50.string().optional().default(() => uuidv42()),
3645
+ name: z50.string().optional(),
3646
+ settings: z50.union([
3647
+ z50.object({
3648
+ label: z50.string().default("Pay Now")
3542
3649
  }),
3543
- z44.array(z44.never()).transform(() => ({
3650
+ z50.array(z50.never()).transform(() => ({
3544
3651
  label: "Pay Now"
3545
3652
  }))
3546
3653
  ]),
3547
- styles: z44.union([
3548
- z44.object({
3549
- buttonWidth: z44.number().min(10).max(100).default(50)
3654
+ styles: z50.union([
3655
+ z50.object({
3656
+ buttonWidth: z50.number().min(10).max(100).default(50)
3550
3657
  }),
3551
- z44.array(z44.never()).transform(() => ({
3658
+ z50.array(z50.never()).transform(() => ({
3552
3659
  buttonWidth: 50
3553
3660
  }))
3554
3661
  ]),
3555
- type: z44.literal(BlockType.pay_button).default(BlockType.pay_button)
3662
+ type: z50.literal(BlockType.pay_button).default(BlockType.pay_button)
3556
3663
  });
3557
- var ProductInformationBlock = z44.object({
3664
+ var ProductInformationBlock = z50.object({
3558
3665
  /** This isn't configurable in the admin-nextjs editor */
3559
- hideProductImage: z44.boolean().optional().default(false),
3560
- id: z44.string().optional().default(() => uuidv42()),
3561
- name: z44.string().optional(),
3562
- type: z44.literal(BlockType.product_information).default(BlockType.product_information)
3666
+ hideProductImage: z50.boolean().optional().default(false),
3667
+ id: z50.string().optional().default(() => uuidv42()),
3668
+ name: z50.string().optional(),
3669
+ type: z50.literal(BlockType.product_information).default(BlockType.product_information)
3563
3670
  });
3564
- var SeparatorBlock = z44.object({
3565
- id: z44.string().optional().default(() => uuidv42()),
3566
- name: z44.string().optional(),
3567
- type: z44.literal(BlockType.separator).default(BlockType.separator)
3671
+ var SeparatorBlock = z50.object({
3672
+ id: z50.string().optional().default(() => uuidv42()),
3673
+ name: z50.string().optional(),
3674
+ type: z50.literal(BlockType.separator).default(BlockType.separator)
3568
3675
  });
3569
- var TextBlock = z44.object({
3570
- id: z44.string().optional().default(() => uuidv42()),
3571
- name: z44.string().optional(),
3572
- settings: z44.object({
3573
- description: z44.union([z44.string(), TiptapDocument]).optional().default(
3676
+ var TextBlock = z50.object({
3677
+ id: z50.string().optional().default(() => uuidv42()),
3678
+ name: z50.string().optional(),
3679
+ settings: z50.object({
3680
+ description: z50.union([z50.string(), TiptapDocument]).optional().default(
3574
3681
  "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."
3575
3682
  ),
3576
3683
  /** This isn't used in the post-purchase offer widget */
3577
3684
  descriptionSize: TextSize.default("medium"),
3578
3685
  horizontalAlignment: TextAlignment2.default("leading"),
3579
- superTitle: z44.union([z44.string(), TiptapDocument]).default("Super Title"),
3686
+ superTitle: z50.union([z50.string(), TiptapDocument]).default("Super Title"),
3580
3687
  /** This isn't used in the post-purchase offer widget */
3581
3688
  superTitleSize: TextSize.default("medium"),
3582
- title: z44.union([z44.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
3689
+ title: z50.union([z50.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
3583
3690
  /** This isn't used in the post-purchase offer widget */
3584
3691
  titleSize: TextSize.default("medium")
3585
3692
  }),
3586
- type: z44.literal(BlockType.text).default(BlockType.text)
3693
+ type: z50.literal(BlockType.text).default(BlockType.text)
3587
3694
  });
3588
- var TimerBlock = z44.object({
3589
- id: z44.string().optional().default(() => uuidv42()),
3590
- name: z44.string().optional(),
3591
- settings: z44.object({
3592
- durationMinutes: z44.number().min(0).default(10),
3593
- durationSeconds: z44.union([z44.number().min(0), z44.unknown().transform(() => 0)]).default(0),
3594
- endOffer: z44.boolean().default(true),
3595
- title: z44.union([z44.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
3695
+ var TimerBlock = z50.object({
3696
+ id: z50.string().optional().default(() => uuidv42()),
3697
+ name: z50.string().optional(),
3698
+ settings: z50.object({
3699
+ durationMinutes: z50.number().min(0).default(10),
3700
+ durationSeconds: z50.union([z50.number().min(0), z50.unknown().transform(() => 0)]).default(0),
3701
+ endOffer: z50.boolean().default(true),
3702
+ title: z50.union([z50.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
3596
3703
  }),
3597
- styles: z44.object({
3704
+ styles: z50.object({
3598
3705
  textAlignment: TextAlignment2.default("center"),
3599
- timerBackgroundColor: z44.enum(["info", "warning", "success", "critical"]).default("warning"),
3600
- timerEmphasized: z44.union([z44.boolean(), z44.unknown().transform(() => true)]).default(true),
3706
+ timerBackgroundColor: z50.enum(["info", "warning", "success", "critical"]).default("warning"),
3707
+ timerEmphasized: z50.union([z50.boolean(), z50.unknown().transform(() => true)]).default(true),
3601
3708
  timerSize: TextSize.default("medium"),
3602
- timerWidth: z44.number().min(10).max(100).optional().default(100),
3603
- titleEmphasized: z44.union([z44.boolean(), z44.unknown().transform(() => true)]).default(false),
3709
+ timerWidth: z50.number().min(10).max(100).optional().default(100),
3710
+ titleEmphasized: z50.union([z50.boolean(), z50.unknown().transform(() => true)]).default(false),
3604
3711
  titleSize: TextSize.default("medium")
3605
3712
  }),
3606
- type: z44.literal(BlockType.timer).default(BlockType.timer)
3713
+ type: z50.literal(BlockType.timer).default(BlockType.timer)
3607
3714
  });
3608
- var PostPurchaseBlock = z44.discriminatedUnion("type", [
3715
+ var PostPurchaseBlock = z50.discriminatedUnion("type", [
3609
3716
  CalloutBannerBlock,
3610
3717
  ImageBlock,
3611
3718
  ImageContentBlock,
@@ -3625,68 +3732,68 @@ var isTextBlock = (block) => isEqual(get3(block, "type"), BlockType.text);
3625
3732
  var isTimerBlock = (block) => isEqual(get3(block, "type"), BlockType.timer);
3626
3733
 
3627
3734
  // src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
3628
- import { z as z47 } from "zod";
3735
+ import { z as z53 } from "zod";
3629
3736
 
3630
3737
  // src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
3631
- import { z as z46 } from "zod";
3738
+ import { z as z52 } from "zod";
3632
3739
 
3633
3740
  // src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
3634
- import { z as z45 } from "zod";
3635
- var PostPurchaseSettings = z45.object({
3636
- advance: z45.object({ removePartialOrder: z45.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
3637
- blocks: z45.union([z45.array(PostPurchaseBlock), z45.unknown().transform(() => [])]).default(() => [
3741
+ import { z as z51 } from "zod";
3742
+ var PostPurchaseSettings = z51.object({
3743
+ advance: z51.object({ removePartialOrder: z51.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
3744
+ blocks: z51.union([z51.array(PostPurchaseBlock), z51.unknown().transform(() => [])]).default(() => [
3638
3745
  PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
3639
3746
  PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
3640
3747
  PostPurchaseBlock.parse({ type: BlockType.product_information })
3641
3748
  ]),
3642
- columnLayout: z45.boolean().optional(),
3643
- discount: z45.object({
3749
+ columnLayout: z51.boolean().optional(),
3750
+ discount: z51.object({
3644
3751
  amount: strictNumber.default(30),
3645
- shouldShowSavingText: z45.boolean().optional().default(true),
3646
- type: z45.enum(["none", "fixed_amount", "percentage"]).default("none")
3752
+ shouldShowSavingText: z51.boolean().optional().default(true),
3753
+ type: z51.enum(["none", "fixed_amount", "percentage"]).default("none")
3647
3754
  }),
3648
- discountedFrom: z45.enum(["price", "compare_at_price"]).optional().default("price"),
3649
- endpoint: z45.string().optional(),
3650
- integrations: z45.object({
3651
- judgeme: z45.boolean().default(false),
3652
- junip: z45.boolean().optional().default(false),
3653
- klaviyo: z45.boolean().default(false),
3654
- loox: z45.boolean().default(false),
3655
- okendo: z45.boolean().default(false),
3656
- opinew: z45.boolean().optional().default(false),
3657
- reviewsio: z45.boolean().optional().default(false),
3658
- stamped: z45.boolean().default(false),
3659
- yotpo: z45.boolean().default(false)
3755
+ discountedFrom: z51.enum(["price", "compare_at_price"]).optional().default("price"),
3756
+ endpoint: z51.string().optional(),
3757
+ integrations: z51.object({
3758
+ judgeme: z51.boolean().default(false),
3759
+ junip: z51.boolean().optional().default(false),
3760
+ klaviyo: z51.boolean().default(false),
3761
+ loox: z51.boolean().default(false),
3762
+ okendo: z51.boolean().default(false),
3763
+ opinew: z51.boolean().optional().default(false),
3764
+ reviewsio: z51.boolean().optional().default(false),
3765
+ stamped: z51.boolean().default(false),
3766
+ yotpo: z51.boolean().default(false)
3660
3767
  }),
3661
- key: z45.string().optional(),
3662
- language: z45.object({
3663
- description: z45.union([z45.string(), z45.unknown().transform(() => "")]).default(""),
3664
- descriptionEnabled: z45.boolean().optional().default(false),
3665
- descriptionRte: z45.object({
3666
- content: z45.array(z45.unknown()),
3667
- type: z45.string()
3768
+ key: z51.string().optional(),
3769
+ language: z51.object({
3770
+ description: z51.union([z51.string(), z51.unknown().transform(() => "")]).default(""),
3771
+ descriptionEnabled: z51.boolean().optional().default(false),
3772
+ descriptionRte: z51.object({
3773
+ content: z51.array(z51.unknown()),
3774
+ type: z51.string()
3668
3775
  }).optional(),
3669
- descriptionSpacing: z45.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
3670
- displayCtaPrice: z45.boolean().default(true),
3671
- global: z45.object({
3672
- declineAll: z45.string().optional().default("Decline All"),
3673
- declineThisOffer: z45.string().default("Decline this offer"),
3674
- free: z45.string().optional().default("Free"),
3675
- notAvailable: z45.string().optional().default("Not available"),
3676
- payNow: z45.string().default("Pay Now"),
3677
- payNowUpgradeToSubscription: z45.string().optional().default("Upgrade to Subscription"),
3678
- quantity: z45.string().default("Quantity"),
3776
+ descriptionSpacing: z51.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
3777
+ displayCtaPrice: z51.boolean().default(true),
3778
+ global: z51.object({
3779
+ declineAll: z51.string().optional().default("Decline All"),
3780
+ declineThisOffer: z51.string().default("Decline this offer"),
3781
+ free: z51.string().optional().default("Free"),
3782
+ notAvailable: z51.string().optional().default("Not available"),
3783
+ payNow: z51.string().default("Pay Now"),
3784
+ payNowUpgradeToSubscription: z51.string().optional().default("Upgrade to Subscription"),
3785
+ quantity: z51.string().default("Quantity"),
3679
3786
  /** This isn't configurable in the admin-nextjs editor */
3680
- recurringShipping: z45.string().optional().default("Recurring shipping"),
3681
- recurringSubtotal: z45.string().default("Recurring subtotal"),
3682
- reviewsPlural: z45.string().optional().default("Reviews"),
3683
- reviewsSingular: z45.string().optional().default("Review"),
3684
- save: z45.union([z45.string(), z45.unknown().transform(() => "Save")]).optional().default("Save"),
3685
- shipping: z45.string().default("Shipping"),
3686
- subscriptionOption: z45.string().optional().default("Subscribe and Save"),
3687
- subtotal: z45.string().default("Subtotal"),
3688
- taxes: z45.string().default("Taxes"),
3689
- total: z45.string().default("Total")
3787
+ recurringShipping: z51.string().optional().default("Recurring shipping"),
3788
+ recurringSubtotal: z51.string().default("Recurring subtotal"),
3789
+ reviewsPlural: z51.string().optional().default("Reviews"),
3790
+ reviewsSingular: z51.string().optional().default("Review"),
3791
+ save: z51.union([z51.string(), z51.unknown().transform(() => "Save")]).optional().default("Save"),
3792
+ shipping: z51.string().default("Shipping"),
3793
+ subscriptionOption: z51.string().optional().default("Subscribe and Save"),
3794
+ subtotal: z51.string().default("Subtotal"),
3795
+ taxes: z51.string().default("Taxes"),
3796
+ total: z51.string().default("Total")
3690
3797
  }).optional().default(() => ({
3691
3798
  declineAll: "Decline All",
3692
3799
  declineThisOffer: "Decline this offer",
@@ -3707,70 +3814,70 @@ var PostPurchaseSettings = z45.object({
3707
3814
  taxes: "Taxes",
3708
3815
  total: "Total"
3709
3816
  })),
3710
- globalTranslation: z45.string().optional().default("english")
3817
+ globalTranslation: z51.string().optional().default("english")
3711
3818
  }),
3712
- metafields: z45.boolean().default(false),
3819
+ metafields: z51.boolean().default(false),
3713
3820
  /** This isn't configurable in the admin-nextjs editor */
3714
- offer: z45.object({
3715
- count: z45.number().default(1)
3821
+ offer: z51.object({
3822
+ count: z51.number().default(1)
3716
3823
  }),
3717
- offersLayout: z45.object({
3718
- itemsPerPage: z45.number().optional(),
3719
- type: z45.enum(["list", "grid", "carousel"]).default("list")
3824
+ offersLayout: z51.object({
3825
+ itemsPerPage: z51.number().optional(),
3826
+ type: z51.enum(["list", "grid", "carousel"]).default("list")
3720
3827
  }).optional().default({
3721
3828
  type: "list"
3722
3829
  }),
3723
3830
  /** This isn't configurable in the admin-nextjs editor */
3724
- previewMode: z45.boolean().default(false),
3725
- productLimit: z45.number().optional().default(1),
3726
- productOptions: z45.object({
3831
+ previewMode: z51.boolean().default(false),
3832
+ productLimit: z51.number().optional().default(1),
3833
+ productOptions: z51.object({
3727
3834
  /** This isn't configurable in the admin-nextjs editor */
3728
- hideOutOfStockVariants: z45.boolean().optional().default(false),
3729
- matchVariant: z45.boolean().optional().default(true),
3730
- showDeclineAll: z45.enum(["above", "below", "both", "none"]).optional(),
3731
- showShipping: z45.boolean().optional().default(true),
3732
- showSubtotal: z45.boolean().optional().default(true),
3733
- showTaxes: z45.boolean().optional().default(true),
3734
- showTotal: z45.boolean().optional().default(true),
3735
- showVariantSelectors: z45.boolean().optional().default(true),
3736
- variantSelectorDisplayMode: z45.enum(["separate", "single"]).optional().default("separate")
3835
+ hideOutOfStockVariants: z51.boolean().optional().default(false),
3836
+ matchVariant: z51.boolean().optional().default(true),
3837
+ showDeclineAll: z51.enum(["above", "below", "both", "none"]).optional(),
3838
+ showShipping: z51.boolean().optional().default(true),
3839
+ showSubtotal: z51.boolean().optional().default(true),
3840
+ showTaxes: z51.boolean().optional().default(true),
3841
+ showTotal: z51.boolean().optional().default(true),
3842
+ showVariantSelectors: z51.boolean().optional().default(true),
3843
+ variantSelectorDisplayMode: z51.enum(["separate", "single"]).optional().default("separate")
3737
3844
  }),
3738
- productType: z45.union([z45.enum(["one-time", "subscription", "both"]), z45.literal("").transform(() => "one-time")]).default("one-time"),
3739
- productTypeSelector: z45.enum(["dropdown", "radio"]).optional().default("radio"),
3740
- quantityInputs: z45.object({
3741
- defaultQuantity: z45.union([z45.number(), z45.null().transform(() => 1)]).default(1),
3742
- enabled: z45.boolean().default(true),
3743
- maxValue: z45.union([z45.number(), z45.null().transform(() => 15)]).default(15),
3744
- minValue: z45.union([z45.number().min(0), z45.unknown().transform(() => 0)]).default(1)
3845
+ productType: z51.union([z51.enum(["one-time", "subscription", "both"]), z51.literal("").transform(() => "one-time")]).default("one-time"),
3846
+ productTypeSelector: z51.enum(["dropdown", "radio"]).optional().default("radio"),
3847
+ quantityInputs: z51.object({
3848
+ defaultQuantity: z51.union([z51.number(), z51.null().transform(() => 1)]).default(1),
3849
+ enabled: z51.boolean().default(true),
3850
+ maxValue: z51.union([z51.number(), z51.null().transform(() => 15)]).default(15),
3851
+ minValue: z51.union([z51.number().min(0), z51.unknown().transform(() => 0)]).default(1)
3745
3852
  }),
3746
- shipping: z45.object({
3853
+ shipping: z51.object({
3747
3854
  amount: strictNumber.default(10),
3748
3855
  /** This isn't configurable in the admin-nextjs editor */
3749
- enabled: z45.boolean().default(true),
3750
- title: z45.string().optional().default("Shipping Fees"),
3751
- type: z45.enum(["free", "fixed_amount"]).default("free")
3856
+ enabled: z51.boolean().default(true),
3857
+ title: z51.string().optional().default("Shipping Fees"),
3858
+ type: z51.enum(["free", "fixed_amount"]).default("free")
3752
3859
  }),
3753
- styles: z45.object({
3754
- starColor: z45.string().optional().default("#fadb14"),
3755
- starSize: z45.union([z45.enum(["small", "medium", "large"]), z45.unknown().transform(() => "large")]).optional().default("large"),
3756
- starStrokeColor: z45.string().optional().default("#fadb14"),
3757
- strokeWidth: z45.string().optional().default("1")
3860
+ styles: z51.object({
3861
+ starColor: z51.string().optional().default("#fadb14"),
3862
+ starSize: z51.union([z51.enum(["small", "medium", "large"]), z51.unknown().transform(() => "large")]).optional().default("large"),
3863
+ starStrokeColor: z51.string().optional().default("#fadb14"),
3864
+ strokeWidth: z51.string().optional().default("1")
3758
3865
  }).optional(),
3759
- subImages: z45.number().nullish().default(8),
3760
- subscription: z45.object({
3761
- discount: z45.object({
3866
+ subImages: z51.number().nullish().default(8),
3867
+ subscription: z51.object({
3868
+ discount: z51.object({
3762
3869
  amount: strictNumber.default(30),
3763
- shouldShowSavingText: z45.boolean().optional().default(true),
3764
- type: z45.enum(["none", "fixed_amount", "percentage"]).default("none")
3870
+ shouldShowSavingText: z51.boolean().optional().default(true),
3871
+ type: z51.enum(["none", "fixed_amount", "percentage"]).default("none")
3765
3872
  }),
3766
- shipping: z45.object({
3873
+ shipping: z51.object({
3767
3874
  amount: strictNumber.default(1),
3768
3875
  /** This isn't configurable in the admin-nextjs editor */
3769
- enabled: z45.boolean().default(true),
3876
+ enabled: z51.boolean().default(true),
3770
3877
  /** This isn't configurable in the admin-nextjs editor */
3771
3878
  recurringAmount: strictNumber.default(2),
3772
- shippingTitle: z45.string().default("Shipping Fees"),
3773
- type: z45.enum(["free", "fixed_amount"]).default("free")
3879
+ shippingTitle: z51.string().default("Shipping Fees"),
3880
+ type: z51.enum(["free", "fixed_amount"]).default("free")
3774
3881
  })
3775
3882
  }).optional().default({
3776
3883
  discount: {
@@ -3788,15 +3895,15 @@ var PostPurchaseSettings = z45.object({
3788
3895
  type: "free"
3789
3896
  }
3790
3897
  }),
3791
- subscriptionIsDefault: z45.boolean().optional(),
3898
+ subscriptionIsDefault: z51.boolean().optional(),
3792
3899
  /** This isn't configurable in the admin-nextjs editor */
3793
- template: z45.string().optional().default(""),
3794
- type: z45.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
3795
- upgradeToSubscription: z45.object({
3796
- acceptButtonText: z45.string().optional().default("Upgrade"),
3797
- allow: z45.boolean().optional().default(false),
3798
- emailRefundNotice: z45.boolean().optional().default(false),
3799
- errorBannerText: z45.string().optional().default("This subscription cannot be added - limit one per order")
3900
+ template: z51.string().optional().default(""),
3901
+ type: z51.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
3902
+ upgradeToSubscription: z51.object({
3903
+ acceptButtonText: z51.string().optional().default("Upgrade"),
3904
+ allow: z51.boolean().optional().default(false),
3905
+ emailRefundNotice: z51.boolean().optional().default(false),
3906
+ errorBannerText: z51.string().optional().default("This subscription cannot be added - limit one per order")
3800
3907
  }).optional().default(() => ({
3801
3908
  acceptButtonText: "Upgrade",
3802
3909
  allow: false,
@@ -3806,32 +3913,32 @@ var PostPurchaseSettings = z45.object({
3806
3913
  });
3807
3914
 
3808
3915
  // src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
3809
- var PostPurchaseWidgetLinkedFlow = z46.object({
3810
- id: z46.number(),
3811
- name: z46.string()
3916
+ var PostPurchaseWidgetLinkedFlow = z52.object({
3917
+ id: z52.number(),
3918
+ name: z52.string()
3812
3919
  });
3813
- var PostPurchaseWidget = z46.object({
3814
- classification: z46.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
3815
- createdAtTime: z46.iso.datetime({ offset: true }).optional(),
3816
- customEndpointName: z46.string().nullish(),
3817
- id: z46.number().default(0),
3818
- lastViewed: z46.iso.datetime({ offset: true }).nullish(),
3819
- linkedCustomEndpointId: z46.number().nullish(),
3820
- linkedFlows: z46.array(PostPurchaseWidgetLinkedFlow).optional(),
3821
- name: z46.string().default(""),
3822
- owner: z46.number().nullish(),
3920
+ var PostPurchaseWidget = z52.object({
3921
+ classification: z52.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
3922
+ createdAtTime: z52.iso.datetime({ offset: true }).optional(),
3923
+ customEndpointName: z52.string().nullish(),
3924
+ id: z52.number().default(0),
3925
+ lastViewed: z52.iso.datetime({ offset: true }).nullish(),
3926
+ linkedCustomEndpointId: z52.number().nullish(),
3927
+ linkedFlows: z52.array(PostPurchaseWidgetLinkedFlow).optional(),
3928
+ name: z52.string().default(""),
3929
+ owner: z52.number().nullish(),
3823
3930
  settings: PostPurchaseSettings
3824
3931
  });
3825
3932
 
3826
3933
  // src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
3827
- var PostPurchaseOffer = z47.discriminatedUnion("successful", [
3828
- z47.strictObject({
3829
- errors: z47.array(z47.object({ message: z47.string() })),
3830
- message: z47.string(),
3831
- successful: z47.literal(false)
3934
+ var PostPurchaseOffer = z53.discriminatedUnion("successful", [
3935
+ z53.strictObject({
3936
+ errors: z53.array(z53.object({ message: z53.string() })),
3937
+ message: z53.string(),
3938
+ successful: z53.literal(false)
3832
3939
  }),
3833
- z47.strictObject({
3834
- successful: z47.literal(true),
3940
+ z53.strictObject({
3941
+ successful: z53.literal(true),
3835
3942
  widget: PostPurchaseWidget
3836
3943
  })
3837
3944
  ]);
@@ -4981,12 +5088,14 @@ export {
4981
5088
  DiscountSource,
4982
5089
  DiscountType,
4983
5090
  EditorMode,
5091
+ ExitPolicySchema,
4984
5092
  GIFT_LABELS,
4985
5093
  Geolocation,
4986
5094
  GiftWithPurchase,
4987
5095
  GridItem,
4988
5096
  HEX_COLOR_REGEX,
4989
5097
  HTML_TAGS_REGEX,
5098
+ HoldSettingSchema,
4990
5099
  HorizontalAlignment,
4991
5100
  IconName,
4992
5101
  IconSize,
@@ -5006,17 +5115,20 @@ export {
5006
5115
  ObjectFit,
5007
5116
  OfferProduct,
5008
5117
  OffersDirection,
5118
+ OrderDecisionSchema,
5009
5119
  POST_PURCHASE_SKIP_LIMIT,
5010
5120
  PayButtonBlock,
5011
5121
  PopoverPosition,
5122
+ PostPurchaseAppIdSchema,
5012
5123
  PostPurchaseBlock,
5013
5124
  PostPurchaseOffer,
5014
5125
  PostPurchaseOrderIdSchema,
5015
5126
  PostPurchaseSettings,
5127
+ PostPurchaseShadowReportFields,
5016
5128
  PostPurchaseShadowReportSchema,
5017
5129
  PostPurchaseShadowSelectionSchema,
5018
- PostPurchaseSkipReason,
5019
- PostPurchaseSkipTrace,
5130
+ PostPurchaseSkipReasonSchema,
5131
+ PostPurchaseSkipTraceSchema,
5020
5132
  PostPurchaseTimestampSchema,
5021
5133
  PostPurchaseWidget,
5022
5134
  PostPurchaseWidgetLinkedFlow,
@@ -5030,6 +5142,7 @@ export {
5030
5142
  QuantityInput,
5031
5143
  REVIEW_LABELS,
5032
5144
  ROOT_RELATIVE_PATH_REGEX,
5145
+ ReadySessionTimingSchema,
5033
5146
  RebuyButton,
5034
5147
  RebuyButtonV1,
5035
5148
  RebuyClient,
@@ -5046,9 +5159,18 @@ export {
5046
5159
  STATIC_ENDPOINTS,
5047
5160
  SWITCH_LABELS,
5048
5161
  SectionType,
5162
+ SelectionClaimsSchema,
5049
5163
  SellingPlanGroup,
5050
5164
  SeparatorBlock,
5051
5165
  Session,
5166
+ SessionCloseRequestSchema,
5167
+ SessionCloseResponseSchema,
5168
+ SessionClosureSchema,
5169
+ SessionIdentitySchema,
5170
+ SessionOrderTimingSchema,
5171
+ SessionPolicySchema,
5172
+ SessionStartRequestSchema,
5173
+ SessionStartResponseSchema,
5052
5174
  ShopConfig,
5053
5175
  ShopifyDomainSchema,
5054
5176
  SmartCartBar,
@@ -5063,6 +5185,7 @@ export {
5063
5185
  TextColorName,
5064
5186
  TextSizeName,
5065
5187
  TimerBlock,
5188
+ TimingSettingsSchema,
5066
5189
  TiptapDocument,
5067
5190
  TiptapParagraph,
5068
5191
  TiptapText,