tf-checkout-react-native 2.0.0-beta.12 → 2.0.0-beta.13

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
@@ -4183,6 +4183,8 @@ var INTENT_OUTCOMES = /* @__PURE__ */ new Map([
4183
4183
  ]);
4184
4184
  var paymentIntentOutcome = (status) => status && INTENT_OUTCOMES.get(status) || "unknown";
4185
4185
  var planUsesSavedCard = (last4, selected) => selected && typeof last4 === "string" && /^\d{4}$/.test(last4);
4186
+ var stripeElementsPaymentContext = (amountMinor, currency) => typeof amountMinor === "number" && Number.isSafeInteger(amountMinor) && amountMinor > 0 && typeof currency === "string" && /^[A-Z]{3}$/.test(currency) ? { amountMinor, currency } : void 0;
4187
+ var stripeWalletPaymentContext = (amount2, currency, merchantCountry) => typeof amount2 === "string" && /^(?:0|[1-9]\d*)(?:\.\d+)?$/.test(amount2) && Number.isFinite(Number(amount2)) && Number(amount2) > 0 && typeof currency === "string" && /^[A-Z]{3}$/.test(currency) && typeof merchantCountry === "string" && /^[A-Z]{2}$/.test(merchantCountry) ? { amount: amount2, currency, merchantCountry } : void 0;
4186
4188
  var DEFAULT_PLAN_TERMINOLOGY = "Payment Plan";
4187
4189
  var planTerminology = (plan) => {
4188
4190
  var _a2;
@@ -9813,27 +9815,36 @@ var mapTicket = (t) => {
9813
9815
  badgeText: badgeOf((_n = t.badgeText) != null ? _n : t.badge_text)
9814
9816
  };
9815
9817
  };
9816
- var getEventDetails = async (eventId) => {
9817
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
9818
+ var getEventDetails = async (eventId, language = "en") => {
9819
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
9818
9820
  const body3 = await get(ENDPOINTS.events.info(eventId));
9819
9821
  const a = (_b = (_a2 = body3 == null ? void 0 : body3.data) == null ? void 0 : _a2.attributes) != null ? _b : {};
9820
9822
  const text6 = (value6) => typeof value6 === "string" && value6.trim() ? value6 : null;
9823
+ const originals = a.imageURLs && typeof a.imageURLs === "object" && !Array.isArray(a.imageURLs) ? a.imageURLs : {};
9824
+ const locale = language.replace(/_/g, "-").toLowerCase();
9825
+ const localized = (_c = Object.entries(originals).find(
9826
+ ([key5]) => key5.toLowerCase() === locale
9827
+ )) == null ? void 0 : _c[1];
9828
+ const base = (_d = Object.entries(originals).find(
9829
+ ([key5]) => key5.toLowerCase() === locale.split("-")[0]
9830
+ )) == null ? void 0 : _d[1];
9831
+ const original = (_f = (_e = text6(localized)) != null ? _e : text6(base)) != null ? _f : text6(originals.en);
9821
9832
  const coordinate = (value6) => value6 !== null && value6 !== void 0 && value6 !== "" && Number.isFinite(Number(value6)) ? Number(value6) : null;
9822
9833
  const hidden = a.hideVenue === true || a.hideVenue === 1 || a.hideVenue === "yes";
9823
9834
  const hideDate = a.hideDate === true || a.hideDate === 1 || a.hideDate === "yes" || a.hideDate === "1";
9824
9835
  return {
9825
- id: String((_d = (_c = body3 == null ? void 0 : body3.data) == null ? void 0 : _c.id) != null ? _d : eventId),
9826
- name: String((_f = (_e = a.name) != null ? _e : a.title) != null ? _f : ""),
9827
- slug: String((_g = a.slug) != null ? _g : ""),
9828
- description: String((_h = a.description) != null ? _h : ""),
9829
- shortDescription: String((_i = a.shortDescription) != null ? _i : ""),
9830
- imageUrl: (_k = (_j = text6(a.imageUrlHd)) != null ? _j : text6(a.productImage)) != null ? _k : text6(a.imageUrl),
9836
+ id: String((_h = (_g = body3 == null ? void 0 : body3.data) == null ? void 0 : _g.id) != null ? _h : eventId),
9837
+ name: String((_j = (_i = a.name) != null ? _i : a.title) != null ? _j : ""),
9838
+ slug: String((_k = a.slug) != null ? _k : ""),
9839
+ description: String((_l = a.description) != null ? _l : ""),
9840
+ shortDescription: String((_m = a.shortDescription) != null ? _m : ""),
9841
+ imageUrl: (_o = (_n = original != null ? original : text6(a.imageUrlHd)) != null ? _n : text6(a.productImage)) != null ? _o : text6(a.imageUrl),
9831
9842
  hideDate,
9832
- startDate: hideDate ? null : (_l = text6(a.startDate)) != null ? _l : text6(a.date),
9843
+ startDate: hideDate ? null : (_p = text6(a.startDate)) != null ? _p : text6(a.date),
9833
9844
  endDate: hideDate ? null : text6(a.endDate),
9834
- formattedDate: hideDate ? "Date TBC" : String((_m = a.formattedDate) != null ? _m : ""),
9845
+ formattedDate: hideDate ? "Date TBC" : String((_q = a.formattedDate) != null ? _q : ""),
9835
9846
  timezone: text6(a.timezone),
9836
- currency: String((_n = a.currency) != null ? _n : ""),
9847
+ currency: String((_r = a.currency) != null ? _r : ""),
9837
9848
  salesStart: text6(a.salesStart),
9838
9849
  salesEnd: text6(a.salesEnd),
9839
9850
  salesStarted: Boolean(a.salesStarted),
@@ -10463,6 +10474,10 @@ var getOrderReview = async (orderHash) => {
10463
10474
  clientSecret: (_e = method.stripe_client_secret) != null ? _e : null,
10464
10475
  publishableKey: (_f = method.stripe_publishable_key) != null ? _f : null,
10465
10476
  connectedAccount: method.stripe_connected_account || null,
10477
+ stripeAmountMinor: Number.isSafeInteger(method.amount_minor) && method.amount_minor >= 0 ? method.amount_minor : void 0,
10478
+ stripeWalletAmount: typeof method.stripe_wallet_amount === "string" ? method.stripe_wallet_amount : void 0,
10479
+ stripeCurrency: typeof method.stripe_currency === "string" && /^[A-Z]{3}$/.test(method.stripe_currency) ? method.stripe_currency : void 0,
10480
+ stripeMerchantCountry: typeof method.stripe_merchant_country === "string" && /^[A-Z]{2}$/.test(method.stripe_merchant_country) ? method.stripe_merchant_country : void 0,
10466
10481
  expiresInSeconds: Number.isFinite(rawExpiry) && rawExpiry > 0 ? rawExpiry : void 0,
10467
10482
  gateway: detectGateway(method),
10468
10483
  orderId: ((_g = a == null ? void 0 : a.order_details) == null ? void 0 : _g.id) != null ? String(a.order_details.id) : void 0,
@@ -12173,7 +12188,13 @@ var primeSeatsIoWith = (store, ctx, eventId, selection) => {
12173
12188
  currency: "",
12174
12189
  quantity: line.labels.length
12175
12190
  }));
12176
- return primeCore(store, ctx, eventId, selections, () => addSeatsIoToCart(eventId, selection));
12191
+ return primeCore(
12192
+ store,
12193
+ ctx,
12194
+ eventId,
12195
+ selections,
12196
+ () => addSeatsIoToCart(eventId, selection)
12197
+ );
12177
12198
  };
12178
12199
  var resumeCartWith = async (store, ctx, eventId, options = {}) => {
12179
12200
  assertNotBusy(store);
@@ -12312,7 +12333,8 @@ var repriceWith = async (store, addOns) => {
12312
12333
  redirectPaymentMethods: pricing.redirectPaymentMethods,
12313
12334
  walletAvailability: pricing.walletAvailability,
12314
12335
  stripeElementsConfig: pricing.stripeElementsConfig,
12315
- ...pricing.stripe ? { stripe: pricing.stripe } : {}
12336
+ stripe: pricing.stripe,
12337
+ paymentStripe: void 0
12316
12338
  });
12317
12339
  } catch (e) {
12318
12340
  failForCart(store, cart, e);
@@ -12377,19 +12399,29 @@ var setExtraItemsWith = async (store, input) => {
12377
12399
  failForCart(store, cart, error);
12378
12400
  }
12379
12401
  };
12380
- var orderStripeKeys = (review, stripe) => {
12381
- var _a2, _b, _c;
12382
- const publishableKey = (_a2 = review.publishableKey) != null ? _a2 : stripe == null ? void 0 : stripe.publishableKey;
12383
- if (!publishableKey) return null;
12402
+ var orderStripeKeys = (review) => {
12403
+ var _a2;
12404
+ if (!review.publishableKey) return null;
12384
12405
  return {
12385
- publishableKey,
12386
- accountId: (_c = (_b = review.connectedAccount) != null ? _b : stripe == null ? void 0 : stripe.accountId) != null ? _c : null
12406
+ publishableKey: review.publishableKey,
12407
+ accountId: (_a2 = review.connectedAccount) != null ? _a2 : null
12387
12408
  };
12388
12409
  };
12389
- var PAYABLE_PRE_ORDER_GATEWAYS = ["stripe_payment_intents", "xendit", "razorpay", "adyen"];
12390
- var NON_STRIPE_RAILS = ["paypal", "razorpay", "xenditCard", "xenditEWallet", "adyen"];
12410
+ var PAYABLE_PRE_ORDER_GATEWAYS = [
12411
+ "stripe_payment_intents",
12412
+ "xendit",
12413
+ "razorpay",
12414
+ "adyen"
12415
+ ];
12416
+ var NON_STRIPE_RAILS = [
12417
+ "paypal",
12418
+ "razorpay",
12419
+ "xenditCard",
12420
+ "xenditEWallet",
12421
+ "adyen"
12422
+ ];
12391
12423
  var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12392
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
12424
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
12393
12425
  const { ports, options } = ctx;
12394
12426
  const { confirmer } = ports;
12395
12427
  const initForCard = async (keys) => {
@@ -12417,7 +12449,7 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12417
12449
  }
12418
12450
  }
12419
12451
  const snap = store.getState();
12420
- const { billing, holders, addOns, consent, stripe } = snap;
12452
+ const { billing, holders, addOns, consent } = snap;
12421
12453
  if (((_d = (_c = snap.waiverSigningIndexes) == null ? void 0 : _c.length) != null ? _d : 0) > 0 && snap.status !== "placing") {
12422
12454
  store.setState({ status: "error", error: SIGNATURE_SAVING_MESSAGE });
12423
12455
  throw new Error(SIGNATURE_SAVING_MESSAGE);
@@ -12543,7 +12575,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12543
12575
  if (!noMoney && sameCart(store, placingCart) && !nothingCharged(error)) {
12544
12576
  store.progress.paymentAttempted = true;
12545
12577
  if (attemptedStripe) store.progress.uncertainStripeAttempt = true;
12546
- if (attemptedStripeIntent) store.progress.uncertainStripeIntent = attemptedStripeIntent;
12578
+ if (attemptedStripeIntent)
12579
+ store.progress.uncertainStripeIntent = attemptedStripeIntent;
12547
12580
  }
12548
12581
  throw error;
12549
12582
  });
@@ -12611,8 +12644,12 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12611
12644
  if (!displayTotal || !Number.isFinite(total) || session.currency !== displayTotal.currencyCode)
12612
12645
  throw new Error("Refresh your accommodation selection before paying.");
12613
12646
  if (Math.abs(total - displayTotal.total) > 5e-3) {
12614
- store.setState({ reviewedExtraOrderTotal: { total, currency: session.currency } });
12615
- throw new Error("The total has changed. Review the updated amount and press Pay again.");
12647
+ store.setState({
12648
+ reviewedExtraOrderTotal: { total, currency: session.currency }
12649
+ });
12650
+ throw new Error(
12651
+ "The total has changed. Review the updated amount and press Pay again."
12652
+ );
12616
12653
  }
12617
12654
  }
12618
12655
  const origin = getOriginUrl();
@@ -12620,10 +12657,14 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12620
12657
  if (returnUrl.origin !== new URL(origin).origin)
12621
12658
  throw new Error("Unable to open your payment window. Please try again.");
12622
12659
  const inspectOriginal = prepareInspectAdyenCheckout(orderHash, session.capability);
12623
- await paying(ports.providerPage({
12624
- uri: adyenCheckoutPage(orderHash, session.capability),
12625
- returnUrlPrefix: returnUrl.href
12626
- }), false, true);
12660
+ await paying(
12661
+ ports.providerPage({
12662
+ uri: adyenCheckoutPage(orderHash, session.capability),
12663
+ returnUrlPrefix: returnUrl.href
12664
+ }),
12665
+ false,
12666
+ true
12667
+ );
12627
12668
  const state = await paying(inspectOriginal(), true, true);
12628
12669
  if (state.status === "completed" || state.status === "pending") {
12629
12670
  store.progress.paymentConfirmed = true;
@@ -12637,13 +12678,19 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12637
12678
  state.status === "declined" ? "declined" : "cancelled"
12638
12679
  );
12639
12680
  }
12640
- throw new Error("Your payment needs another step. Open the payment window to continue.");
12681
+ throw new Error(
12682
+ "Your payment needs another step. Open the payment window to continue."
12683
+ );
12641
12684
  }
12642
12685
  const finishOriginalOrder = prepareConfirmOrderSuccess(orderHash);
12643
12686
  const review = await forThisCart(getOrderReview(orderHash));
12644
12687
  const secretIntentId = paymentIntentIdFromClientSecret(review.clientSecret);
12645
12688
  const reviewIntentId = review.stripeIntentId || secretIntentId;
12646
- const currentStripeIntent = review.gateway === "stripe" && reviewIntentId && (!review.clientSecret || secretIntentId === reviewIntentId) && review.publishableKey ? { id: reviewIntentId, account: cleanAccountId(review.connectedAccount) || "", key: review.publishableKey } : void 0;
12689
+ const currentStripeIntent = review.gateway === "stripe" && reviewIntentId && (!review.clientSecret || secretIntentId === reviewIntentId) && review.publishableKey ? {
12690
+ id: reviewIntentId,
12691
+ account: cleanAccountId(review.connectedAccount) || "",
12692
+ key: review.publishableKey
12693
+ } : void 0;
12647
12694
  const uncertainStripeIntent = store.progress.uncertainStripeIntent;
12648
12695
  if (store.progress.paymentAttempted && store.progress.uncertainStripeAttempt && (!uncertainStripeIntent || !currentStripeIntent || currentStripeIntent.id !== uncertainStripeIntent.id || currentStripeIntent.account !== uncertainStripeIntent.account || currentStripeIntent.key !== uncertainStripeIntent.key)) {
12649
12696
  throw new Error(PAYMENT_UNCONFIRMED_MESSAGE);
@@ -12700,15 +12747,22 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12700
12747
  const placedHash = orderHash;
12701
12748
  const failClosedPage = async (outcome, pageStartsPayment = false) => {
12702
12749
  if (pageStartsPayment && outcome.event === "failed" && outcome.notOpened === true) {
12703
- throw paymentProviderError(outcome.description || "The payment page could not be opened.", "cancelled");
12750
+ throw paymentProviderError(
12751
+ outcome.description || "The payment page could not be opened.",
12752
+ "cancelled"
12753
+ );
12704
12754
  }
12705
12755
  if (request2.method === "razorpay" && outcome.event === "failed" && outcome.paymentOutcome === "declined") {
12706
- throw paymentProviderError(outcome.description || "Your payment was declined.", "declined");
12756
+ throw paymentProviderError(
12757
+ outcome.description || "Your payment was declined.",
12758
+ "declined"
12759
+ );
12707
12760
  }
12708
12761
  assertSameCart();
12709
12762
  store.progress.paymentAttempted = true;
12710
12763
  if (attemptedStripe) store.progress.uncertainStripeAttempt = true;
12711
- if (attemptedStripeIntent) store.progress.uncertainStripeIntent = attemptedStripeIntent;
12764
+ if (attemptedStripeIntent)
12765
+ store.progress.uncertainStripeIntent = attemptedStripeIntent;
12712
12766
  await forThisCart(getOrderReview(placedHash)).catch((e) => {
12713
12767
  if (e instanceof CartChangedError) throw e;
12714
12768
  return null;
@@ -12716,7 +12770,7 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12716
12770
  throw new Error(PAYMENT_UNCONFIRMED_MESSAGE);
12717
12771
  };
12718
12772
  if (!store.progress.paymentConfirmed) {
12719
- const orderKeys = NON_STRIPE_RAILS.includes(request2.method) ? null : orderStripeKeys(review, stripe);
12773
+ const orderKeys = NON_STRIPE_RAILS.includes(request2.method) ? null : orderStripeKeys(review);
12720
12774
  let claimOwnCard = () => void 0;
12721
12775
  if (orderKeys) {
12722
12776
  store.setState({ paymentStripe: orderKeys });
@@ -12796,7 +12850,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12796
12850
  returnUrlPrefix: `${origin}/store/order-complete`
12797
12851
  })
12798
12852
  );
12799
- if (sheet.event === "dismiss" || sheet.event === "failed") await failClosedPage(sheet, true);
12853
+ if (sheet.event === "dismiss" || sheet.event === "failed")
12854
+ await failClosedPage(sheet, true);
12800
12855
  store.progress.paymentConfirmed = true;
12801
12856
  try {
12802
12857
  const { needIdVerification: needIdVerification2 } = await paying(confirmOrderSuccess(orderHash));
@@ -12828,7 +12883,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12828
12883
  returnUrlPrefix: `${getOriginUrl()}/store/order-complete`
12829
12884
  })
12830
12885
  );
12831
- if (sheet.event === "dismiss" || sheet.event === "failed") await failClosedPage(sheet, true);
12886
+ if (sheet.event === "dismiss" || sheet.event === "failed")
12887
+ await failClosedPage(sheet, true);
12832
12888
  store.progress.paymentConfirmed = true;
12833
12889
  const paymentId = typeof ((_k = sheet.data) == null ? void 0 : _k.razorpay_payment_id) === "string" ? sheet.data.razorpay_payment_id : void 0;
12834
12890
  const { needIdVerification: needIdVerification2 } = await paying(
@@ -12947,7 +13003,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12947
13003
  returnUrlPrefix: `${getOriginUrl()}/store/order-complete`
12948
13004
  })
12949
13005
  );
12950
- if (sheet.event === "dismiss" || sheet.event === "failed") await failClosedPage(sheet);
13006
+ if (sheet.event === "dismiss" || sheet.event === "failed")
13007
+ await failClosedPage(sheet);
12951
13008
  store.progress.paymentConfirmed = true;
12952
13009
  } else if (request2.method === "redirect") {
12953
13010
  if (!ports.providerPage || !ports.createRedirectPaymentMethod) {
@@ -12985,7 +13042,8 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
12985
13042
  returnUrlPrefix: returnUrl
12986
13043
  })
12987
13044
  );
12988
- if (sheet.event === "dismiss" || sheet.event === "failed") await failClosedPage(sheet);
13045
+ if (sheet.event === "dismiss" || sheet.event === "failed")
13046
+ await failClosedPage(sheet);
12989
13047
  const redirectStatus = (_u = /[?&]redirect_status=([^&#]+)/.exec(
12990
13048
  sheet.returnUrl || ""
12991
13049
  )) == null ? void 0 : _u[1];
@@ -13060,16 +13118,27 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13060
13118
  }
13061
13119
  }
13062
13120
  if (!confirmedViaInstallments) {
13063
- const currencyCode = (_x = (_w = (_v = snap.breakdown) == null ? void 0 : _v.currencyCode) != null ? _w : review.currency) != null ? _x : "";
13121
+ const wallet = stripeWalletPaymentContext(
13122
+ review.stripeWalletAmount,
13123
+ review.stripeCurrency,
13124
+ review.stripeMerchantCountry
13125
+ );
13126
+ const currencyCode = (_v = wallet == null ? void 0 : wallet.currency) != null ? _v : "";
13127
+ const walletTotal = (_w = wallet == null ? void 0 : wallet.amount) != null ? _w : "";
13128
+ if ((request2.method === "applePay" || request2.method === "googlePay") && !wallet) {
13129
+ throw new Error(
13130
+ "The order payment amount or currency is unavailable. Please refresh checkout."
13131
+ );
13132
+ }
13064
13133
  let status;
13065
13134
  if (request2.method === "applePay") {
13066
13135
  status = await paying(
13067
13136
  confirmer.confirmApplePay(
13068
13137
  review.clientSecret,
13069
- review.total,
13138
+ walletTotal,
13070
13139
  currencyCode,
13071
13140
  {
13072
- merchantCountryCode: options.merchantCountryCode,
13141
+ merchantCountryCode: wallet == null ? void 0 : wallet.merchantCountry,
13073
13142
  merchantName: options.merchantName
13074
13143
  }
13075
13144
  ),
@@ -13081,10 +13150,10 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13081
13150
  status = await paying(
13082
13151
  confirmer.confirmGooglePay(
13083
13152
  review.clientSecret,
13084
- review.total,
13153
+ walletTotal,
13085
13154
  currencyCode,
13086
13155
  {
13087
- merchantCountryCode: options.merchantCountryCode,
13156
+ merchantCountryCode: wallet == null ? void 0 : wallet.merchantCountry,
13088
13157
  merchantName: options.merchantName,
13089
13158
  testEnv: options.googlePayTestEnv
13090
13159
  }
@@ -13093,6 +13162,16 @@ var placeOrderWith = async (store, ctx, method = "card", steps = {}) => {
13093
13162
  true
13094
13163
  );
13095
13164
  } else {
13165
+ if (confirmer.prepareCardPayment) {
13166
+ await forThisCart(
13167
+ confirmer.prepareCardPayment(
13168
+ stripeElementsPaymentContext(
13169
+ review.stripeAmountMinor,
13170
+ review.stripeCurrency
13171
+ )
13172
+ )
13173
+ );
13174
+ }
13096
13175
  status = await paying(
13097
13176
  confirmer.confirmCard(review.clientSecret, billing),
13098
13177
  false,
@@ -23609,6 +23688,8 @@ var useStyles = (theme) => useMemo15(
23609
23688
  buttonDisabled: { opacity: 0.5 },
23610
23689
  buttonPressed: { opacity: 0.85 },
23611
23690
  buttonLabel: {
23691
+ maxWidth: "100%",
23692
+ textAlign: "center",
23612
23693
  color: theme.accentContrast,
23613
23694
  fontSize: theme.fontSize,
23614
23695
  fontWeight: "600",
@@ -23797,7 +23878,7 @@ var secureInitialUri = (uri) => {
23797
23878
  if (!/^https:\/\/[^/?#\s\\]+(?:[/?#][^\s\\]*)?$/i.test(uri)) return false;
23798
23879
  try {
23799
23880
  const url2 = new URL(uri);
23800
- return url2.protocol === "https:" && Boolean(url2.hostname) && !url2.username && !url2.password;
23881
+ return url2 !== null && typeof url2 === "object" && "protocol" in url2 && url2.protocol === "https:" && "hostname" in url2 && typeof url2.hostname === "string" && Boolean(url2.hostname) && "username" in url2 && url2.username === "" && "password" in url2 && url2.password === "";
23801
23882
  } catch (e) {
23802
23883
  return false;
23803
23884
  }
@@ -24150,15 +24231,25 @@ var createRnStripeConfirmer = () => {
24150
24231
  return confirmedStripeIntentStatus(paymentIntent);
24151
24232
  },
24152
24233
  confirmApplePay: async (clientSecret, total, currencyCode, merchant) => {
24153
- var _a2, _b;
24234
+ var _a2;
24235
+ const context = stripeWalletPaymentContext(
24236
+ total,
24237
+ currencyCode,
24238
+ merchant.merchantCountryCode
24239
+ );
24240
+ if (!context)
24241
+ throw paymentProviderError(
24242
+ "The order wallet details are unavailable.",
24243
+ "notStarted"
24244
+ );
24154
24245
  const { error, paymentIntent } = await confirmPlatformPayPayment(clientSecret, {
24155
24246
  applePay: {
24156
- merchantCountryCode: (_a2 = merchant.merchantCountryCode) != null ? _a2 : "US",
24157
- currencyCode,
24247
+ merchantCountryCode: context.merchantCountry,
24248
+ currencyCode: context.currency,
24158
24249
  cartItems: [
24159
24250
  {
24160
- label: (_b = merchant.merchantName) != null ? _b : "Order",
24161
- amount: total,
24251
+ label: (_a2 = merchant.merchantName) != null ? _a2 : "Order",
24252
+ amount: context.amount,
24162
24253
  paymentType: PlatformPay.PaymentType.Immediate
24163
24254
  }
24164
24255
  ]
@@ -24168,13 +24259,23 @@ var createRnStripeConfirmer = () => {
24168
24259
  return confirmedStripeIntentStatus(paymentIntent);
24169
24260
  },
24170
24261
  confirmGooglePay: async (clientSecret, total, currencyCode, merchant) => {
24171
- var _a2, _b;
24262
+ var _a2;
24263
+ const context = stripeWalletPaymentContext(
24264
+ total,
24265
+ currencyCode,
24266
+ merchant.merchantCountryCode
24267
+ );
24268
+ if (!context)
24269
+ throw paymentProviderError(
24270
+ "The order wallet details are unavailable.",
24271
+ "notStarted"
24272
+ );
24172
24273
  const { error, paymentIntent } = await confirmPlatformPayPayment(clientSecret, {
24173
24274
  googlePay: {
24174
24275
  testEnv: merchant.testEnv === true,
24175
- merchantCountryCode: (_a2 = merchant.merchantCountryCode) != null ? _a2 : "US",
24176
- currencyCode,
24177
- merchantName: (_b = merchant.merchantName) != null ? _b : "Order"
24276
+ merchantCountryCode: context.merchantCountry,
24277
+ currencyCode: context.currency,
24278
+ merchantName: (_a2 = merchant.merchantName) != null ? _a2 : "Order"
24178
24279
  }
24179
24280
  });
24180
24281
  if (error) throw stripeFailure(error, "Google Pay failed.");
@@ -24688,9 +24789,10 @@ var useQuantityStyles = (theme) => useMemo20(
24688
24789
  () => StyleSheet7.create({
24689
24790
  stepper: { flexDirection: "row", alignItems: "center", gap: 14 },
24690
24791
  btn: {
24691
- width: 36,
24692
- height: 36,
24693
- borderRadius: 18,
24792
+ minWidth: 44,
24793
+ minHeight: 44,
24794
+ padding: 10,
24795
+ borderRadius: 22,
24694
24796
  borderWidth: StyleSheet7.hairlineWidth,
24695
24797
  borderColor: theme.border,
24696
24798
  alignItems: "center",
@@ -25193,6 +25295,7 @@ var Tickets = ({
25193
25295
  Pressable8,
25194
25296
  {
25195
25297
  accessibilityRole: "button",
25298
+ style: s9.textAction,
25196
25299
  onPress: () => setVisibleDescription((cur) => cur === t.id ? null : t.id),
25197
25300
  children: /* @__PURE__ */ jsx13(Text10, { style: s9.infoToggle, children: visibleDescription === t.id ? "Hide info" : "View info" })
25198
25301
  }
@@ -25239,6 +25342,7 @@ var Tickets = ({
25239
25342
  Pressable8,
25240
25343
  {
25241
25344
  accessibilityRole: "button",
25345
+ style: s9.textAction,
25242
25346
  onPress: () => setWlOpen((w) => ({ ...w, [t.id]: true })),
25243
25347
  children: /* @__PURE__ */ jsx13(Text10, { style: s9.wlToggle, children: "Join the waiting list" })
25244
25348
  }
@@ -25293,7 +25397,15 @@ var Tickets = ({
25293
25397
  g.time ? /* @__PURE__ */ jsx13(Text10, { style: s9.slotTime, children: g.time }) : null,
25294
25398
  g.items.map(renderRow)
25295
25399
  ] }, g.time)) : tickets.map(renderRow),
25296
- showCodeInput ? /* @__PURE__ */ jsx13(View10, { style: s9.promo, children: !isAccess && !promoOpen ? /* @__PURE__ */ jsx13(Pressable8, { accessibilityRole: "button", onPress: () => setPromoOpen(true), children: /* @__PURE__ */ jsx13(Text10, { style: s9.promoToggle, children: "Got a promo code? Tap here" }) }) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
25400
+ showCodeInput ? /* @__PURE__ */ jsx13(View10, { style: s9.promo, children: !isAccess && !promoOpen ? /* @__PURE__ */ jsx13(
25401
+ Pressable8,
25402
+ {
25403
+ accessibilityRole: "button",
25404
+ style: s9.textAction,
25405
+ onPress: () => setPromoOpen(true),
25406
+ children: /* @__PURE__ */ jsx13(Text10, { style: s9.promoToggle, children: "Got a promo code? Tap here" })
25407
+ }
25408
+ ) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
25297
25409
  /* @__PURE__ */ jsx13(Field, { children: /* @__PURE__ */ jsx13(
25298
25410
  Input,
25299
25411
  {
@@ -25369,10 +25481,25 @@ var useTicketStyles = (theme) => useMemo24(
25369
25481
  marginTop: 4,
25370
25482
  fontFamily: theme.fontFamily
25371
25483
  },
25372
- rowWrap: { gap: 8 },
25373
- row: { flexDirection: "row", alignItems: "flex-start", gap: 12 },
25374
- info: { flex: 1, gap: 4 },
25375
- nameRow: { flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: 8 },
25484
+ rowWrap: { gap: 12 },
25485
+ // Keep a readable text column; a narrow host moves controls to the next line.
25486
+ row: {
25487
+ flexDirection: "row",
25488
+ flexWrap: "wrap",
25489
+ alignItems: "flex-start",
25490
+ gap: 16
25491
+ },
25492
+ info: { flexGrow: 1, flexShrink: 1, flexBasis: 220, gap: 8 },
25493
+ nameRow: { gap: 4 },
25494
+ textAction: {
25495
+ alignSelf: "flex-start",
25496
+ maxWidth: "100%",
25497
+ minWidth: 44,
25498
+ minHeight: 44,
25499
+ paddingHorizontal: 8,
25500
+ paddingVertical: 10,
25501
+ justifyContent: "center"
25502
+ },
25376
25503
  name: {
25377
25504
  color: theme.text,
25378
25505
  fontSize: theme.fontSize,
@@ -25389,7 +25516,7 @@ var useTicketStyles = (theme) => useMemo24(
25389
25516
  flexDirection: "row",
25390
25517
  alignItems: "center",
25391
25518
  flexWrap: "wrap",
25392
- gap: 6
25519
+ gap: 8
25393
25520
  },
25394
25521
  oldPrice: {
25395
25522
  color: theme.muted,
@@ -25423,12 +25550,22 @@ var useTicketStyles = (theme) => useMemo24(
25423
25550
  fontFamily: theme.fontFamily
25424
25551
  },
25425
25552
  soldout: {
25553
+ marginStart: "auto",
25554
+ maxWidth: "100%",
25426
25555
  color: theme.muted,
25427
25556
  fontSize: theme.fontSize - 1,
25428
25557
  fontWeight: "600",
25429
25558
  fontFamily: theme.fontFamily
25430
25559
  },
25431
- qtyWrap: { flexDirection: "row", alignItems: "center", gap: 8 },
25560
+ qtyWrap: {
25561
+ flexDirection: "row",
25562
+ flexWrap: "wrap",
25563
+ maxWidth: "100%",
25564
+ alignItems: "center",
25565
+ justifyContent: "flex-end",
25566
+ gap: 12,
25567
+ marginStart: "auto"
25568
+ },
25432
25569
  guests: {
25433
25570
  color: theme.muted,
25434
25571
  fontSize: theme.fontSize - 2,
@@ -25438,6 +25575,7 @@ var useTicketStyles = (theme) => useMemo24(
25438
25575
  description: {
25439
25576
  color: theme.muted,
25440
25577
  fontSize: theme.fontSize - 1,
25578
+ lineHeight: theme.fontSize * 1.5,
25441
25579
  fontFamily: theme.fontFamily
25442
25580
  },
25443
25581
  wlToggle: {
@@ -25953,7 +26091,7 @@ var AddOns = ({
25953
26091
  ] }),
25954
26092
  desc ? /* @__PURE__ */ jsx17(Text12, { style: s9.desc, children: desc }) : null
25955
26093
  ] }),
25956
- soldOut(a) ? /* @__PURE__ */ jsx17(Text12, { style: s9.soldOut, children: "Sold out" }) : /* @__PURE__ */ jsx17(
26094
+ /* @__PURE__ */ jsx17(View14, { style: s9.quantity, children: soldOut(a) ? /* @__PURE__ */ jsx17(Text12, { style: s9.soldOut, children: "Sold out" }) : /* @__PURE__ */ jsx17(
25957
26095
  QuantitySelect,
25958
26096
  {
25959
26097
  value: n,
@@ -25961,7 +26099,7 @@ var AddOns = ({
25961
26099
  max: max(a),
25962
26100
  onChange: (v) => setQty((q) => ({ ...q, [a.id]: v }))
25963
26101
  }
25964
- )
26102
+ ) })
25965
26103
  ] }),
25966
26104
  n > 0 && group ? /* @__PURE__ */ jsx17(View14, { style: s9.fields, children: /* @__PURE__ */ jsx17(
25967
26105
  CustomFieldGroupFields,
@@ -26016,7 +26154,14 @@ var useAddonStyles = (theme) => useMemo27(
26016
26154
  fontWeight: "700",
26017
26155
  fontFamily: theme.fontFamily
26018
26156
  },
26019
- skipBtn: { paddingHorizontal: 4, paddingVertical: 2 },
26157
+ skipBtn: {
26158
+ maxWidth: "100%",
26159
+ minWidth: 44,
26160
+ minHeight: 44,
26161
+ paddingHorizontal: 8,
26162
+ paddingVertical: 10,
26163
+ justifyContent: "center"
26164
+ },
26020
26165
  skip: {
26021
26166
  color: theme.accent,
26022
26167
  fontSize: theme.fontSize - 1,
@@ -26040,8 +26185,14 @@ var useAddonStyles = (theme) => useMemo27(
26040
26185
  fontFamily: theme.fontFamily
26041
26186
  },
26042
26187
  item: { gap: 10 },
26043
- row: { flexDirection: "row", alignItems: "flex-start", gap: 12 },
26044
- info: { flex: 1, gap: 2 },
26188
+ row: {
26189
+ flexDirection: "row",
26190
+ flexWrap: "wrap",
26191
+ alignItems: "flex-start",
26192
+ gap: 16
26193
+ },
26194
+ info: { flexGrow: 1, flexShrink: 1, flexBasis: 220, gap: 8 },
26195
+ quantity: { marginStart: "auto", maxWidth: "100%" },
26045
26196
  name: {
26046
26197
  color: theme.text,
26047
26198
  fontSize: theme.fontSize,
@@ -27166,7 +27317,15 @@ var BillingInfo = ({
27166
27317
  /* @__PURE__ */ jsx24(SectionHeader, { title: heading }),
27167
27318
  onLogin && !checkout.isLoggedIn ? /* @__PURE__ */ jsxs21(View20, { style: s9.loginRow, children: [
27168
27319
  /* @__PURE__ */ jsx24(Text15, { style: s9.note, children: "Login & skip ahead:" }),
27169
- /* @__PURE__ */ jsx24(Pressable10, { onPress: () => onLogin(), children: /* @__PURE__ */ jsx24(Text15, { style: s9.link, children: "Login" }) })
27320
+ /* @__PURE__ */ jsx24(
27321
+ Pressable10,
27322
+ {
27323
+ accessibilityRole: "button",
27324
+ style: s9.loginAction,
27325
+ onPress: () => onLogin(),
27326
+ children: /* @__PURE__ */ jsx24(Text15, { style: s9.link, children: "Login" })
27327
+ }
27328
+ )
27170
27329
  ] }) : null,
27171
27330
  gates.phoneFirstCheckout && !checkout.isLoggedIn ? /* @__PURE__ */ jsx24(
27172
27331
  BillingPhoneIdentity,
@@ -27384,7 +27543,20 @@ var BillingInfo = ({
27384
27543
  };
27385
27544
  var useStyles4 = (theme) => useMemo29(
27386
27545
  () => StyleSheet17.create({
27387
- loginRow: { flexDirection: "row", alignItems: "center", gap: 8 },
27546
+ loginRow: {
27547
+ flexDirection: "row",
27548
+ flexWrap: "wrap",
27549
+ alignItems: "center",
27550
+ gap: 12
27551
+ },
27552
+ loginAction: {
27553
+ maxWidth: "100%",
27554
+ minWidth: 44,
27555
+ minHeight: 44,
27556
+ paddingHorizontal: 8,
27557
+ paddingVertical: 10,
27558
+ justifyContent: "center"
27559
+ },
27388
27560
  note: {
27389
27561
  color: theme.muted,
27390
27562
  fontSize: theme.fontSize - 1,
@@ -27409,8 +27581,8 @@ var useStyles4 = (theme) => useMemo29(
27409
27581
  fontSize: theme.fontSize - 1,
27410
27582
  fontFamily: theme.fontFamily
27411
27583
  },
27412
- row: { flexDirection: "row", gap: 10 },
27413
- col: { flex: 1 }
27584
+ row: { flexDirection: "row", flexWrap: "wrap", gap: 12 },
27585
+ col: { flexGrow: 1, flexShrink: 1, flexBasis: 180 }
27414
27586
  }),
27415
27587
  [theme]
27416
27588
  );
@@ -33878,7 +34050,9 @@ export {
33878
34050
  socialProfileLinkInput,
33879
34051
  socialProfileLinkUrl,
33880
34052
  startBundlePaymentWith,
34053
+ stripeElementsPaymentContext,
33881
34054
  stripeOffersOxxo,
34055
+ stripeWalletPaymentContext,
33882
34056
  subscribeAccountCreation,
33883
34057
  syncCurrency,
33884
34058
  syncCurrencyWith,