@delopay/sdk 0.113.0 → 0.117.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.
@@ -532,9 +532,9 @@ var Connectors = class {
532
532
  /**
533
533
  * Update a connector account.
534
534
  *
535
- * `connector_webhook_details` **merges** into the stored block key by key
536
- * (be#992): an absent key keeps its stored secret, an explicit value is
537
- * written, and an explicit empty string clears that secret. Send only the
535
+ * `connector_webhook_details` **merges** into the stored block key by key:
536
+ * an absent key keeps its stored secret, an explicit value is written, and
537
+ * an explicit empty string clears that secret. Send only the
538
538
  * keys the operator typed — padding the other environment's keys with `''`
539
539
  * clears a live signing secret and inbound webhooks stop verifying.
540
540
  *
@@ -2388,6 +2388,19 @@ var Routing = class {
2388
2388
  async getDefaultProfile() {
2389
2389
  return this.request("GET", "/routing/default/profile");
2390
2390
  }
2391
+ /**
2392
+ * Retrieve one profile's default config. `GET /routing/default/profile/{profileId}`
2393
+ *
2394
+ * The narrow counterpart of `getDefaultProfile()`: that one returns every
2395
+ * profile of the merchant and needs merchant-level routing read, so a
2396
+ * profile-scoped (shop) role could write its own default through
2397
+ * `updateDefaultProfile()` but never read it back. This read is gated on
2398
+ * profile-level routing read and pinned to the caller's own profile — a shop
2399
+ * role asking for a sibling profile is refused.
2400
+ */
2401
+ async getDefaultForProfile(profileId) {
2402
+ return this.request("GET", `/routing/default/profile/${encodeURIComponent(profileId)}`);
2403
+ }
2391
2404
  /** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
2392
2405
  async updateDefaultProfile(profileId, params) {
2393
2406
  return this.request("POST", `/routing/default/profile/${encodeURIComponent(profileId)}`, {
@@ -4151,11 +4164,12 @@ var Settlement = class {
4151
4164
  /**
4152
4165
  * Record payout progress on a statement (`unpaid` / `partial` / `paid`).
4153
4166
  *
4154
- * Subject to the caller's `settlement_payout` operation limit, which can
4155
- * only be a per-operation ceiling: an over-limit call fails with `DE_01`
4156
- * and nothing is recorded. There is no approval route out of it — four-eyes
4157
- * needs an executor that can run the operation once somebody says yes, and
4158
- * only refunds have one, so a settlement rule can only block.
4167
+ * Subject to the caller's `settlement_payout` operation limit a
4168
+ * per-operation ceiling, a windowed total, a windowed count, or any
4169
+ * combination: an over-limit call fails with `DE_01` and nothing is
4170
+ * recorded. There is no approval route out of it four-eyes needs an
4171
+ * executor that can run the operation once somebody says yes, and only
4172
+ * refunds have one, so a settlement rule can only block.
4159
4173
  *
4160
4174
  * `POST /settlement/statements/{statementId}/payout`
4161
4175
  */
@@ -5021,6 +5035,121 @@ function feeProgram() {
5021
5035
  }
5022
5036
 
5023
5037
  // src/branding.ts
5038
+ function surchargeShowsLabel(labelMode, style, position) {
5039
+ if (labelMode !== "labelled") return false;
5040
+ return !(style === "ribbon" && (position === "cornerStart" || position === "cornerEnd"));
5041
+ }
5042
+ function surchargeFigurePlan(branding, isDiscount, percentAvailable) {
5043
+ const mode = isDiscount ? branding.discountFigure : branding.surchargeFigure;
5044
+ const label = surchargeShowsLabel(
5045
+ branding.surchargeLabel,
5046
+ branding.surchargeStyle,
5047
+ branding.surchargePosition
5048
+ );
5049
+ if (!percentAvailable) return { first: "amount", second: null, label };
5050
+ const ordered = {
5051
+ amount: ["amount", null],
5052
+ percent: ["percent", null],
5053
+ amountThenPercent: ["amount", "percent"],
5054
+ percentThenAmount: ["percent", "amount"]
5055
+ };
5056
+ const [first, second] = ordered[mode];
5057
+ const cornerRibbon = branding.surchargeStyle === "ribbon" && (branding.surchargePosition === "cornerStart" || branding.surchargePosition === "cornerEnd");
5058
+ return { first, second: cornerRibbon ? null : second, label };
5059
+ }
5060
+ function readableInkOn(color) {
5061
+ const onBlack = contrastRatio(color, "#000000");
5062
+ const onWhite = contrastRatio(color, "#ffffff");
5063
+ if (onBlack === null || onWhite === null) return "#ffffff";
5064
+ return onBlack >= onWhite ? "#000000" : "#ffffff";
5065
+ }
5066
+ var SURCHARGE_FONT_SIZE = {
5067
+ sm: "0.6875rem",
5068
+ md: "0.8125rem",
5069
+ lg: "0.9375rem"
5070
+ };
5071
+ var SURCHARGE_PAD = {
5072
+ sm: "1px 6px",
5073
+ md: "2px 8px",
5074
+ lg: "3px 10px"
5075
+ };
5076
+ var SURCHARGE_RADIUS = {
5077
+ pill: "999px",
5078
+ rounded: "6px",
5079
+ square: "0px"
5080
+ };
5081
+ var SURCHARGE_BORDER_WIDTH = {
5082
+ none: "0px",
5083
+ thin: "1px",
5084
+ medium: "2px",
5085
+ thick: "3px"
5086
+ };
5087
+ var SURCHARGE_FONT_WEIGHT = {
5088
+ regular: "400",
5089
+ medium: "600",
5090
+ bold: "700"
5091
+ };
5092
+ var SURCHARGE_POSITIONS = [
5093
+ "trailing",
5094
+ "inline",
5095
+ "below",
5096
+ "above",
5097
+ "cornerStart",
5098
+ "cornerEnd"
5099
+ ];
5100
+ var SURCHARGE_STYLES = [
5101
+ "plain",
5102
+ "underline",
5103
+ "outline",
5104
+ "badge",
5105
+ "solid",
5106
+ "ribbon"
5107
+ ];
5108
+ var SURCHARGE_BORDER_WIDTHS = [
5109
+ "none",
5110
+ "thin",
5111
+ "medium",
5112
+ "thick"
5113
+ ];
5114
+ var SURCHARGE_BORDER_STYLES = [
5115
+ "solid",
5116
+ "dashed",
5117
+ "dotted"
5118
+ ];
5119
+ var SURCHARGE_SIZES = ["sm", "md", "lg"];
5120
+ function surchargeStyleDrawsAShape(style) {
5121
+ return style === "badge" || style === "outline" || style === "solid";
5122
+ }
5123
+ var SURCHARGE_SHAPES = ["pill", "rounded", "square"];
5124
+ var SURCHARGE_WEIGHTS = ["regular", "medium", "bold"];
5125
+ var SURCHARGE_SIGNS = ["always", "minusOnly", "none"];
5126
+ var SURCHARGE_LABEL_MODES = ["amount", "labelled"];
5127
+ var SURCHARGE_FIGURE_MODES = [
5128
+ "amount",
5129
+ "percent",
5130
+ "amountThenPercent",
5131
+ "percentThenAmount"
5132
+ ];
5133
+ var CHECKOUT_LOCALES = ["en", "de"];
5134
+ var LOCALIZABLE_COPY_FIELDS = [
5135
+ "headerText",
5136
+ "payButtonLabel",
5137
+ "cardTermsMessage",
5138
+ "footerText"
5139
+ ];
5140
+ function copyTranslationsKey(field) {
5141
+ return `${field}Translations`;
5142
+ }
5143
+ function checkoutCopy(branding, field, locale) {
5144
+ const translated = translationFor(branding[copyTranslationsKey(field)], locale);
5145
+ return translated ?? branding[field];
5146
+ }
5147
+ function surchargeWordFor(branding, isDiscount, locale) {
5148
+ return translationFor(
5149
+ isDiscount ? branding.discountWordTranslations : branding.surchargeWordTranslations,
5150
+ locale
5151
+ );
5152
+ }
5024
5153
  var FONT_STACKS = {
5025
5154
  inter: "'Inter Variable', 'Inter', system-ui, -apple-system, sans-serif",
5026
5155
  system: "system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif",
@@ -5211,6 +5340,44 @@ var DEFAULT_BRANDING_BASE = {
5211
5340
  verticalGap: "comfortable",
5212
5341
  inputSize: "md",
5213
5342
  buttonSize: "md",
5343
+ // Disclosure on by default: with provider-scoped pricing the tile is where
5344
+ // the buyer chooses between prices, and a price they cannot see is one they
5345
+ // find out about on the statement.
5346
+ showSurcharge: true,
5347
+ surchargePosition: "trailing",
5348
+ surchargeStyle: "badge",
5349
+ surchargeSize: "sm",
5350
+ surchargeShape: "pill",
5351
+ surchargeBorderWidth: "thin",
5352
+ surchargeBorderStyle: "solid",
5353
+ surchargeWeight: "medium",
5354
+ surchargeSign: "always",
5355
+ surchargeUppercase: false,
5356
+ // Named, not bare. A tile that reads "-EUR 2.50" beside a brand name is a
5357
+ // number with no subject — buyers read it as the price, not as a change to
5358
+ // it. "Discount -EUR 2.50" needs no interpreting, and the word is what makes
5359
+ // the default configuration legible without the merchant touching anything.
5360
+ surchargeLabel: "labelled",
5361
+ // The two directions default differently on purpose, which is the whole
5362
+ // reason they are two settings. A fee is something a buyer acts on in money,
5363
+ // so it leads with money and says nothing else. A saving is something worth
5364
+ // advertising, and the share is the persuasive half of it — "-5.1% (EUR
5365
+ // 2.50)" sells what "-EUR 2.50" merely states, and the amount is still right
5366
+ // there beside it.
5367
+ surchargeFigure: "amount",
5368
+ discountFigure: "percentThenAmount",
5369
+ // Empty: the checkout's own localized words are the default, in every
5370
+ // language it ships. A merchant fills these in only to say it differently.
5371
+ surchargeWordTranslations: {},
5372
+ discountWordTranslations: {},
5373
+ // amber-700 / emerald-700, not the 600s: the `plain` style renders the
5374
+ // disclosure as coloured TEXT, so it is bound by `WCAG_AA_TEXT` (4.5) rather
5375
+ // than by the 3:1 a coloured shape would be, and the 600s come to 3.19 and
5376
+ // 3.77 against the default white surface. These are 5.02 and 5.48, pinned by
5377
+ // tests. Far enough apart to read as opposite news at a glance rather than as
5378
+ // two shades of "extra".
5379
+ surchargeColor: "#b45309",
5380
+ discountColor: "#047857",
5214
5381
  layout: "split",
5215
5382
  summaryPosition: "left",
5216
5383
  showOrderSummary: true,
@@ -5219,10 +5386,17 @@ var DEFAULT_BRANDING_BASE = {
5219
5386
  totalLabel: "Total",
5220
5387
  showCurrencyCode: false,
5221
5388
  showOrderItems: true,
5389
+ // Each flat field keeps its meaning: what the merchant wrote, used in every
5390
+ // locale that carries no override. Empty maps therefore change nothing for a
5391
+ // profile saved before translations existed.
5222
5392
  headerText: "",
5393
+ headerTextTranslations: {},
5223
5394
  payButtonLabel: "",
5395
+ payButtonLabelTranslations: {},
5224
5396
  cardTermsMessage: "",
5397
+ cardTermsMessageTranslations: {},
5225
5398
  footerText: "",
5399
+ footerTextTranslations: {},
5226
5400
  supportEmail: "",
5227
5401
  paymentLayout: "tabs",
5228
5402
  labelStyle: "above",
@@ -5248,6 +5422,11 @@ var DEFAULT_BRANDING_DARK = {
5248
5422
  buttonBackground: "#1E4FEB",
5249
5423
  buttonText: "#ffffff",
5250
5424
  surfaceStyle: "flat",
5425
+ // amber-400 / emerald-400: the 700s above are far too dark to read on
5426
+ // slate-900, and this pair is the same news in the same order at the light
5427
+ // end of the ramp — 10.69 and 9.29 against the dark surface, also pinned.
5428
+ surchargeColor: "#fbbf24",
5429
+ discountColor: "#34d399",
5251
5430
  trustBadges: DEFAULT_BADGES_DARK.map((b) => ({ ...b })),
5252
5431
  customFields: []
5253
5432
  };
@@ -5258,7 +5437,16 @@ function cloneBranding(b) {
5258
5437
  return {
5259
5438
  ...b,
5260
5439
  trustBadges: b.trustBadges.map((badge) => ({ ...badge })),
5261
- customFields: b.customFields.map(cloneCustomField)
5440
+ customFields: b.customFields.map(cloneCustomField),
5441
+ // Copied, not shared. A spread alone would leave the clone pointing at the
5442
+ // original's maps, and the dashboard edits a clone precisely so the form
5443
+ // can be abandoned without touching what is saved.
5444
+ surchargeWordTranslations: { ...b.surchargeWordTranslations },
5445
+ discountWordTranslations: { ...b.discountWordTranslations },
5446
+ headerTextTranslations: { ...b.headerTextTranslations },
5447
+ payButtonLabelTranslations: { ...b.payButtonLabelTranslations },
5448
+ cardTermsMessageTranslations: { ...b.cardTermsMessageTranslations },
5449
+ footerTextTranslations: { ...b.footerTextTranslations }
5262
5450
  };
5263
5451
  }
5264
5452
  function cloneCustomField(f) {
@@ -5409,13 +5597,25 @@ function defaultCustomFieldVisibility() {
5409
5597
  return { mode: "always", match: "all", conditions: [] };
5410
5598
  }
5411
5599
  function parseTranslations(raw) {
5412
- if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
5600
+ let value = raw;
5601
+ if (typeof value === "string") {
5602
+ try {
5603
+ value = JSON.parse(value);
5604
+ } catch {
5605
+ return {};
5606
+ }
5607
+ }
5608
+ if (!value || typeof value !== "object" || Array.isArray(value)) return {};
5413
5609
  const out = {};
5414
- for (const [k, v] of Object.entries(raw)) {
5415
- if (typeof v === "string" && v.length > 0) out[k] = v;
5610
+ for (const [k, v] of Object.entries(value)) {
5611
+ if (typeof v === "string" && v.trim().length > 0) out[k] = v;
5416
5612
  }
5417
5613
  return out;
5418
5614
  }
5615
+ function encodeTranslations(map) {
5616
+ const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);
5617
+ return entries.length > 0 ? JSON.stringify(Object.fromEntries(entries)) : void 0;
5618
+ }
5419
5619
  function normalizeCondition(raw, index) {
5420
5620
  if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
5421
5621
  const c = raw;
@@ -5767,6 +5967,74 @@ function decodeBranding(source) {
5767
5967
  ["sm", "md", "lg"],
5768
5968
  DEFAULT_BRANDING.buttonSize
5769
5969
  ),
5970
+ showSurcharge: parseBool(extras["showSurcharge"], DEFAULT_BRANDING.showSurcharge),
5971
+ surchargePosition: pickEnum(
5972
+ extras["surchargePosition"],
5973
+ SURCHARGE_POSITIONS,
5974
+ DEFAULT_BRANDING.surchargePosition
5975
+ ),
5976
+ surchargeStyle: pickEnum(
5977
+ extras["surchargeStyle"],
5978
+ SURCHARGE_STYLES,
5979
+ DEFAULT_BRANDING.surchargeStyle
5980
+ ),
5981
+ surchargeSize: pickEnum(
5982
+ extras["surchargeSize"],
5983
+ SURCHARGE_SIZES,
5984
+ DEFAULT_BRANDING.surchargeSize
5985
+ ),
5986
+ surchargeShape: pickEnum(
5987
+ extras["surchargeShape"],
5988
+ SURCHARGE_SHAPES,
5989
+ DEFAULT_BRANDING.surchargeShape
5990
+ ),
5991
+ surchargeBorderWidth: pickEnum(
5992
+ extras["surchargeBorderWidth"],
5993
+ SURCHARGE_BORDER_WIDTHS,
5994
+ DEFAULT_BRANDING.surchargeBorderWidth
5995
+ ),
5996
+ surchargeBorderStyle: pickEnum(
5997
+ extras["surchargeBorderStyle"],
5998
+ SURCHARGE_BORDER_STYLES,
5999
+ DEFAULT_BRANDING.surchargeBorderStyle
6000
+ ),
6001
+ surchargeWeight: pickEnum(
6002
+ extras["surchargeWeight"],
6003
+ SURCHARGE_WEIGHTS,
6004
+ DEFAULT_BRANDING.surchargeWeight
6005
+ ),
6006
+ surchargeSign: pickEnum(
6007
+ extras["surchargeSign"],
6008
+ SURCHARGE_SIGNS,
6009
+ DEFAULT_BRANDING.surchargeSign
6010
+ ),
6011
+ surchargeUppercase: parseBool(
6012
+ extras["surchargeUppercase"],
6013
+ DEFAULT_BRANDING.surchargeUppercase
6014
+ ),
6015
+ surchargeLabel: pickEnum(
6016
+ extras["surchargeLabel"],
6017
+ SURCHARGE_LABEL_MODES,
6018
+ DEFAULT_BRANDING.surchargeLabel
6019
+ ),
6020
+ surchargeFigure: pickEnum(
6021
+ extras["surchargeFigure"],
6022
+ SURCHARGE_FIGURE_MODES,
6023
+ DEFAULT_BRANDING.surchargeFigure
6024
+ ),
6025
+ discountFigure: pickEnum(
6026
+ extras["discountFigure"],
6027
+ SURCHARGE_FIGURE_MODES,
6028
+ DEFAULT_BRANDING.discountFigure
6029
+ ),
6030
+ surchargeWordTranslations: parseTranslations(extras["surchargeWordTranslations"]),
6031
+ discountWordTranslations: parseTranslations(extras["discountWordTranslations"]),
6032
+ headerTextTranslations: parseTranslations(extras["headerTextTranslations"]),
6033
+ payButtonLabelTranslations: parseTranslations(extras["payButtonLabelTranslations"]),
6034
+ cardTermsMessageTranslations: parseTranslations(extras["cardTermsMessageTranslations"]),
6035
+ footerTextTranslations: parseTranslations(extras["footerTextTranslations"]),
6036
+ surchargeColor: s(extras["surchargeColor"]) || DEFAULT_BRANDING.surchargeColor,
6037
+ discountColor: s(extras["discountColor"]) || DEFAULT_BRANDING.discountColor,
5770
6038
  layout: pickEnum(extras["layout"], ["compact", "split"], DEFAULT_BRANDING.layout),
5771
6039
  summaryPosition: pickEnum(
5772
6040
  extras["summaryPosition"],
@@ -5820,6 +6088,21 @@ function encodeBranding(branding, base) {
5820
6088
  verticalGap: branding.verticalGap,
5821
6089
  inputSize: branding.inputSize,
5822
6090
  buttonSize: branding.buttonSize,
6091
+ showSurcharge: String(branding.showSurcharge),
6092
+ surchargePosition: branding.surchargePosition,
6093
+ surchargeStyle: branding.surchargeStyle,
6094
+ surchargeSize: branding.surchargeSize,
6095
+ surchargeShape: branding.surchargeShape,
6096
+ surchargeBorderWidth: branding.surchargeBorderWidth,
6097
+ surchargeBorderStyle: branding.surchargeBorderStyle,
6098
+ surchargeWeight: branding.surchargeWeight,
6099
+ surchargeSign: branding.surchargeSign,
6100
+ surchargeUppercase: String(branding.surchargeUppercase),
6101
+ surchargeLabel: branding.surchargeLabel,
6102
+ surchargeFigure: branding.surchargeFigure,
6103
+ discountFigure: branding.discountFigure,
6104
+ surchargeColor: branding.surchargeColor,
6105
+ discountColor: branding.discountColor,
5823
6106
  layout: branding.layout,
5824
6107
  summaryPosition: branding.summaryPosition,
5825
6108
  showOrderSummary: String(branding.showOrderSummary),
@@ -5837,6 +6120,17 @@ function encodeBranding(branding, base) {
5837
6120
  if (branding.customFields.length > 0) {
5838
6121
  extras["customFields"] = encodeCustomFields(branding.customFields);
5839
6122
  }
6123
+ for (const key of [
6124
+ "surchargeWordTranslations",
6125
+ "discountWordTranslations",
6126
+ "headerTextTranslations",
6127
+ "payButtonLabelTranslations",
6128
+ "cardTermsMessageTranslations",
6129
+ "footerTextTranslations"
6130
+ ]) {
6131
+ const encoded = encodeTranslations(branding[key]);
6132
+ if (encoded) extras[key] = encoded;
6133
+ }
5840
6134
  const tagline = trim(branding.tagline);
5841
6135
  if (tagline) extras["tagline"] = tagline;
5842
6136
  const footer = trim(branding.footerText);
@@ -5945,6 +6239,71 @@ function parseImportedBranding(raw) {
5945
6239
  ),
5946
6240
  inputSize: pickEnum(root["inputSize"], ["sm", "md", "lg"], dflt.inputSize),
5947
6241
  buttonSize: pickEnum(root["buttonSize"], ["sm", "md", "lg"], dflt.buttonSize),
6242
+ showSurcharge: parseBool(root["showSurcharge"], dflt.showSurcharge),
6243
+ surchargePosition: pickEnum(
6244
+ root["surchargePosition"],
6245
+ SURCHARGE_POSITIONS,
6246
+ dflt.surchargePosition
6247
+ ),
6248
+ surchargeStyle: pickEnum(
6249
+ root["surchargeStyle"],
6250
+ SURCHARGE_STYLES,
6251
+ dflt.surchargeStyle
6252
+ ),
6253
+ surchargeSize: pickEnum(
6254
+ root["surchargeSize"],
6255
+ SURCHARGE_SIZES,
6256
+ dflt.surchargeSize
6257
+ ),
6258
+ surchargeShape: pickEnum(
6259
+ root["surchargeShape"],
6260
+ SURCHARGE_SHAPES,
6261
+ dflt.surchargeShape
6262
+ ),
6263
+ surchargeBorderWidth: pickEnum(
6264
+ root["surchargeBorderWidth"],
6265
+ SURCHARGE_BORDER_WIDTHS,
6266
+ dflt.surchargeBorderWidth
6267
+ ),
6268
+ surchargeBorderStyle: pickEnum(
6269
+ root["surchargeBorderStyle"],
6270
+ SURCHARGE_BORDER_STYLES,
6271
+ dflt.surchargeBorderStyle
6272
+ ),
6273
+ surchargeWeight: pickEnum(
6274
+ root["surchargeWeight"],
6275
+ SURCHARGE_WEIGHTS,
6276
+ dflt.surchargeWeight
6277
+ ),
6278
+ surchargeSign: pickEnum(
6279
+ root["surchargeSign"],
6280
+ SURCHARGE_SIGNS,
6281
+ dflt.surchargeSign
6282
+ ),
6283
+ surchargeUppercase: parseBool(root["surchargeUppercase"], dflt.surchargeUppercase),
6284
+ surchargeLabel: pickEnum(
6285
+ root["surchargeLabel"],
6286
+ SURCHARGE_LABEL_MODES,
6287
+ dflt.surchargeLabel
6288
+ ),
6289
+ surchargeFigure: pickEnum(
6290
+ root["surchargeFigure"],
6291
+ SURCHARGE_FIGURE_MODES,
6292
+ dflt.surchargeFigure
6293
+ ),
6294
+ discountFigure: pickEnum(
6295
+ root["discountFigure"],
6296
+ SURCHARGE_FIGURE_MODES,
6297
+ dflt.discountFigure
6298
+ ),
6299
+ surchargeWordTranslations: parseTranslations(root["surchargeWordTranslations"]),
6300
+ discountWordTranslations: parseTranslations(root["discountWordTranslations"]),
6301
+ headerTextTranslations: parseTranslations(root["headerTextTranslations"]),
6302
+ payButtonLabelTranslations: parseTranslations(root["payButtonLabelTranslations"]),
6303
+ cardTermsMessageTranslations: parseTranslations(root["cardTermsMessageTranslations"]),
6304
+ footerTextTranslations: parseTranslations(root["footerTextTranslations"]),
6305
+ surchargeColor: sHex(root["surchargeColor"], dflt.surchargeColor),
6306
+ discountColor: sHex(root["discountColor"], dflt.discountColor),
5948
6307
  layout: pickEnum(root["layout"], ["compact", "split"], dflt.layout),
5949
6308
  summaryPosition: pickEnum(
5950
6309
  root["summaryPosition"],
@@ -6011,6 +6370,19 @@ function applyBrandingVariables(el, b) {
6011
6370
  set("--dp-gap-vertical", VERTICAL_GAP[b.verticalGap]);
6012
6371
  set("--dp-input-pad", INPUT_PAD[b.inputSize]);
6013
6372
  set("--dp-button-pad", BUTTON_PAD[b.buttonSize]);
6373
+ set("--dp-surcharge", b.surchargeColor);
6374
+ set("--dp-discount", b.discountColor);
6375
+ set("--dp-surcharge-ink", readableInkOn(b.surchargeColor));
6376
+ set("--dp-discount-ink", readableInkOn(b.discountColor));
6377
+ set("--dp-surcharge-size", SURCHARGE_FONT_SIZE[b.surchargeSize]);
6378
+ set("--dp-surcharge-pad", SURCHARGE_PAD[b.surchargeSize]);
6379
+ set("--dp-surcharge-radius", SURCHARGE_RADIUS[b.surchargeShape]);
6380
+ set("--dp-surcharge-weight", SURCHARGE_FONT_WEIGHT[b.surchargeWeight]);
6381
+ set(
6382
+ "--dp-surcharge-border-width",
6383
+ SURCHARGE_BORDER_WIDTH[b.surchargeStyle === "outline" && b.surchargeBorderWidth === "none" ? "thin" : b.surchargeBorderWidth]
6384
+ );
6385
+ set("--dp-surcharge-border-style", b.surchargeBorderStyle);
6014
6386
  set("--dp-shadow", shadowFor(b.surfaceStyle));
6015
6387
  set(
6016
6388
  "--dp-surface-border",
@@ -6401,9 +6773,9 @@ var STRIPE_FALLBACK_PANE_METHODS = [
6401
6773
  requiresBillingCountry: true,
6402
6774
  defaultLabel: "Klarna",
6403
6775
  // NOT the router's current "Pay later or in 3 instalments". This table is
6404
- // what a router predating the capability endpoint (delopay-backend#964)
6405
- // renders, and that copy only gained the "3" in delopay-backend#1051
6406
- // the same release that added the endpoint. Restating the new string here
6776
+ // what a router predating the capability endpoint renders, and that copy
6777
+ // only gained the "3" in the same release that added the endpoint.
6778
+ // Restating the new string here
6407
6779
  // would put copy no reachable router emits in front of a merchant, and
6408
6780
  // would change what the deprecated `nativePaneMethodInfo` has returned
6409
6781
  // since 0.106.0.
@@ -6753,6 +7125,25 @@ export {
6753
7125
  programToTree,
6754
7126
  FeeProgramBuilder,
6755
7127
  feeProgram,
7128
+ surchargeShowsLabel,
7129
+ surchargeFigurePlan,
7130
+ readableInkOn,
7131
+ SURCHARGE_POSITIONS,
7132
+ SURCHARGE_STYLES,
7133
+ SURCHARGE_BORDER_WIDTHS,
7134
+ SURCHARGE_BORDER_STYLES,
7135
+ SURCHARGE_SIZES,
7136
+ surchargeStyleDrawsAShape,
7137
+ SURCHARGE_SHAPES,
7138
+ SURCHARGE_WEIGHTS,
7139
+ SURCHARGE_SIGNS,
7140
+ SURCHARGE_LABEL_MODES,
7141
+ SURCHARGE_FIGURE_MODES,
7142
+ CHECKOUT_LOCALES,
7143
+ LOCALIZABLE_COPY_FIELDS,
7144
+ copyTranslationsKey,
7145
+ checkoutCopy,
7146
+ surchargeWordFor,
6756
7147
  fontStack,
6757
7148
  radiusValue,
6758
7149
  fontWeightValue,
@@ -6839,4 +7230,4 @@ export {
6839
7230
  decodeNativePanes,
6840
7231
  encodeNativePanes
6841
7232
  };
6842
- //# sourceMappingURL=chunk-NY5O6S5X.js.map
7233
+ //# sourceMappingURL=chunk-RN4LGMQM.js.map