tf-checkout-react-native 2.0.0-beta.18 → 2.0.0-beta.21
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/README.md +33 -14
- package/dist/index.d.mts +49 -2
- package/dist/index.d.ts +49 -2
- package/dist/index.js +660 -369
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +569 -271
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/sections/Tickets.tsx +104 -53
package/dist/index.js
CHANGED
|
@@ -217,6 +217,7 @@ __export(index_exports, {
|
|
|
217
217
|
bundleSubmitAction: () => bundleSubmitAction,
|
|
218
218
|
bundleSubmitState: () => bundleSubmitState,
|
|
219
219
|
bundlesFromCatalog: () => bundlesFromCatalog,
|
|
220
|
+
calendarTicketRows: () => calendarTicketRows,
|
|
220
221
|
callHost: () => callHost,
|
|
221
222
|
canLeavePayment: () => canLeavePayment,
|
|
222
223
|
captureSessionAction: () => captureSessionAction,
|
|
@@ -225,6 +226,8 @@ __export(index_exports, {
|
|
|
225
226
|
cardFormShouldPrepare: () => cardFormShouldPrepare,
|
|
226
227
|
cartTicketCount: () => cartTicketCount,
|
|
227
228
|
cartTicketSlots: () => cartTicketSlots,
|
|
229
|
+
catalogDate: () => catalogDate,
|
|
230
|
+
catalogQuantities: () => catalogQuantities,
|
|
228
231
|
changeBillingEmail: () => changeBillingEmail,
|
|
229
232
|
changeBillingField: () => changeBillingField,
|
|
230
233
|
changeBillingPhone: () => changeBillingPhone,
|
|
@@ -497,6 +500,7 @@ __export(index_exports, {
|
|
|
497
500
|
ticketConfirmerKey: () => ticketConfirmerKey,
|
|
498
501
|
ticketFieldsFor: () => ticketFieldsFor,
|
|
499
502
|
ticketPaymentKeys: () => ticketPaymentKeys,
|
|
503
|
+
ticketPriceContext: () => ticketPriceContext,
|
|
500
504
|
ticketQuantityRange: () => ticketQuantityRange,
|
|
501
505
|
ticketRefundConsequences: () => ticketRefundConsequences,
|
|
502
506
|
ticketTypesForTier: () => ticketTypesForTier,
|
|
@@ -2965,6 +2969,8 @@ var import_react_query18 = require("@tanstack/react-query");
|
|
|
2965
2969
|
var import_react40 = require("react");
|
|
2966
2970
|
var import_react41 = require("react");
|
|
2967
2971
|
var import_react_query19 = require("@tanstack/react-query");
|
|
2972
|
+
var import_react_query20 = require("@tanstack/react-query");
|
|
2973
|
+
var import_react42 = require("react");
|
|
2968
2974
|
var __defProp2 = Object.defineProperty;
|
|
2969
2975
|
var __export2 = (target, all) => {
|
|
2970
2976
|
for (var name in all)
|
|
@@ -6302,7 +6308,7 @@ var tripStatus = (status, locale) => {
|
|
|
6302
6308
|
};
|
|
6303
6309
|
var isEventTrip = (data) => "event" in data;
|
|
6304
6310
|
var brandingLines = (identities = []) => identities.map(
|
|
6305
|
-
(
|
|
6311
|
+
(identity2) => [...new Set([identity2.brand_name, identity2.platform_name].filter(Boolean))].join(
|
|
6306
6312
|
" \xB7 "
|
|
6307
6313
|
)
|
|
6308
6314
|
).filter(Boolean);
|
|
@@ -7339,16 +7345,20 @@ var mapOption = (o) => {
|
|
|
7339
7345
|
requiresSignIn: o.requiresSignIn === true || o.requires_sign_in === true
|
|
7340
7346
|
};
|
|
7341
7347
|
};
|
|
7348
|
+
var waitlistId = (value6) => typeof value6 === "string" && /^[1-9]\d*$/.test(value6) ? value6 : typeof value6 === "number" && Number.isSafeInteger(value6) && value6 > 0 ? String(value6) : null;
|
|
7342
7349
|
var mapWaitlist = (w) => {
|
|
7343
|
-
|
|
7350
|
+
const ticketTypeId = waitlistId(w.ticketTypeId);
|
|
7351
|
+
if (!ticketTypeId || typeof w.name !== "string" || !w.name.trim()) return null;
|
|
7352
|
+
if (w.entry === null) return { ticketTypeId, name: w.name, entry: null };
|
|
7353
|
+
if (!w.entry || typeof w.entry !== "object" || Array.isArray(w.entry)) return null;
|
|
7354
|
+
const id2 = waitlistId(w.entry.id);
|
|
7355
|
+
const { status, offerExpiresAt } = w.entry;
|
|
7356
|
+
if (!id2 || !["waiting", "offered"].includes(status) || offerExpiresAt !== void 0 && offerExpiresAt !== null && typeof offerExpiresAt !== "string")
|
|
7357
|
+
return null;
|
|
7344
7358
|
return {
|
|
7345
|
-
ticketTypeId
|
|
7346
|
-
name:
|
|
7347
|
-
entry:
|
|
7348
|
-
id: String((_c = w.entry.id) != null ? _c : ""),
|
|
7349
|
-
status: String((_d = w.entry.status) != null ? _d : ""),
|
|
7350
|
-
offerExpiresAt: text3(w.entry.offerExpiresAt)
|
|
7351
|
-
} : null
|
|
7359
|
+
ticketTypeId,
|
|
7360
|
+
name: w.name,
|
|
7361
|
+
entry: { id: id2, status, offerExpiresAt: text3(offerExpiresAt) }
|
|
7352
7362
|
};
|
|
7353
7363
|
};
|
|
7354
7364
|
var list = (value6) => Array.isArray(value6) ? value6.filter((v) => v && typeof v === "object") : [];
|
|
@@ -7368,7 +7378,7 @@ var ticketChangeOptionsFromResponse = (body3) => {
|
|
|
7368
7378
|
closesAt: text3((_d = a.cutoff) == null ? void 0 : _d.closesAt)
|
|
7369
7379
|
},
|
|
7370
7380
|
options,
|
|
7371
|
-
waitlistOptions: list(a.waitlistOptions).map(mapWaitlist),
|
|
7381
|
+
waitlistOptions: list(a.waitlistOptions).map(mapWaitlist).filter((option) => option !== null),
|
|
7372
7382
|
sellInstead: {
|
|
7373
7383
|
available: Boolean((_e = a.sellInstead) == null ? void 0 : _e.available) && Boolean((_f = a.sellInstead) == null ? void 0 : _f.url),
|
|
7374
7384
|
url: text3((_g = a.sellInstead) == null ? void 0 : _g.url)
|
|
@@ -9040,6 +9050,49 @@ var waitingListEntryFrom = (definition, draft) => {
|
|
|
9040
9050
|
quantity
|
|
9041
9051
|
};
|
|
9042
9052
|
};
|
|
9053
|
+
var identity = (ticket) => {
|
|
9054
|
+
var _a2;
|
|
9055
|
+
return (_a2 = ticket.selectionKey) != null ? _a2 : ticket.id;
|
|
9056
|
+
};
|
|
9057
|
+
var ticketPriceContext = (scope, ticket) => {
|
|
9058
|
+
var _a2, _b;
|
|
9059
|
+
return JSON.stringify([
|
|
9060
|
+
scope,
|
|
9061
|
+
ticket.currency,
|
|
9062
|
+
(_a2 = ticket.timeSlot) == null ? void 0 : _a2.date,
|
|
9063
|
+
(_b = ticket.timeSlot) == null ? void 0 : _b.time,
|
|
9064
|
+
identity(ticket)
|
|
9065
|
+
]);
|
|
9066
|
+
};
|
|
9067
|
+
var calendarTicketRows = (base, dated) => {
|
|
9068
|
+
const ids = new Set(dated.map(identity));
|
|
9069
|
+
return [
|
|
9070
|
+
...dated,
|
|
9071
|
+
...base.filter(
|
|
9072
|
+
(ticket) => ticket.isRegularTicket === true && !ids.has(identity(ticket))
|
|
9073
|
+
)
|
|
9074
|
+
];
|
|
9075
|
+
};
|
|
9076
|
+
var catalogDate = (selected, dates) => {
|
|
9077
|
+
var _a2;
|
|
9078
|
+
return dates.includes(selected) ? selected : (_a2 = dates[0]) != null ? _a2 : "";
|
|
9079
|
+
};
|
|
9080
|
+
var catalogQuantities = (previous, tickets, previousTickets = tickets, dateChanged = false) => {
|
|
9081
|
+
var _a2;
|
|
9082
|
+
const retained = /* @__PURE__ */ new Map();
|
|
9083
|
+
for (const ticket of previousTickets) {
|
|
9084
|
+
if (dateChanged && ticket.timeSlot) continue;
|
|
9085
|
+
if (previous[ticket.id] > 0) retained.set(identity(ticket), previous[ticket.id]);
|
|
9086
|
+
}
|
|
9087
|
+
const next = {};
|
|
9088
|
+
for (const ticket of tickets) {
|
|
9089
|
+
const quantity = (_a2 = retained.get(identity(ticket))) != null ? _a2 : 0;
|
|
9090
|
+
const range = ticketQuantityRange(ticket);
|
|
9091
|
+
if (quantity > 0 && !ticket.soldOut && ticket.salesStarted && !ticket.salesEnded && quantity >= range.min && quantity <= range.max && quantity % range.step === 0)
|
|
9092
|
+
next[ticket.id] = quantity;
|
|
9093
|
+
}
|
|
9094
|
+
return Object.keys(previous).length === Object.keys(next).length && Object.keys(next).every((id2) => previous[id2] === next[id2]) ? previous : next;
|
|
9095
|
+
};
|
|
9043
9096
|
var initialSnapshot = () => ({
|
|
9044
9097
|
status: "idle",
|
|
9045
9098
|
selections: [],
|
|
@@ -10473,10 +10526,22 @@ var badgeOf = (raw) => {
|
|
|
10473
10526
|
const text6 = typeof raw === "string" ? raw.trim() : "";
|
|
10474
10527
|
return text6 || null;
|
|
10475
10528
|
};
|
|
10476
|
-
var
|
|
10529
|
+
var eventCurrency = (raw) => {
|
|
10530
|
+
if (typeof raw === "string") return { currency: raw };
|
|
10531
|
+
if (!raw || typeof raw !== "object") return {};
|
|
10532
|
+
const value6 = raw;
|
|
10533
|
+
return {
|
|
10534
|
+
...typeof value6.currency === "string" ? { currency: value6.currency } : {},
|
|
10535
|
+
...typeof value6.symbol === "string" ? { priceSymbol: value6.symbol } : {}
|
|
10536
|
+
};
|
|
10537
|
+
};
|
|
10538
|
+
var selectionKey = (raw, eventId) => typeof raw === "string" && raw.trim() === raw && /^event:[1-9]\d*:ticket:[1-9]\d*$/.test(raw) && raw.startsWith(`event:${eventId}:ticket:`) ? raw : void 0;
|
|
10539
|
+
var mapTicket = (t, eventId) => {
|
|
10477
10540
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
10478
10541
|
return {
|
|
10479
10542
|
id: String(t.id),
|
|
10543
|
+
...selectionKey(t.selectionKey, eventId) ? { selectionKey: selectionKey(t.selectionKey, eventId) } : {},
|
|
10544
|
+
isRegularTicket: typeof t.isRegularTicket === "boolean" ? t.isRegularTicket : void 0,
|
|
10480
10545
|
name: (_a2 = t.displayName) != null ? _a2 : "",
|
|
10481
10546
|
groupName: (_c = (_b = t.groupName) != null ? _b : t.group_name) != null ? _c : null,
|
|
10482
10547
|
optionName: (_d = t.optionName) != null ? _d : "",
|
|
@@ -10535,7 +10600,7 @@ var getEventDetails = async (eventId, language = "en") => {
|
|
|
10535
10600
|
endDate: hideDate ? null : text6(a.endDate),
|
|
10536
10601
|
formattedDate: hideDate ? "Date TBC" : String((_q = a.formattedDate) != null ? _q : ""),
|
|
10537
10602
|
timezone: text6(a.timezone),
|
|
10538
|
-
currency:
|
|
10603
|
+
currency: (_r = eventCurrency(a.currency).currency) != null ? _r : "",
|
|
10539
10604
|
salesStart: text6(a.salesStart),
|
|
10540
10605
|
salesEnd: text6(a.salesEnd),
|
|
10541
10606
|
salesStarted: Boolean(a.salesStarted),
|
|
@@ -10560,13 +10625,14 @@ var getEventTickets = async (eventId) => {
|
|
|
10560
10625
|
tfCatalogContext: true
|
|
10561
10626
|
});
|
|
10562
10627
|
const ticketsObj = (_c = (_b = (_a2 = body3 == null ? void 0 : body3.data) == null ? void 0 : _a2.attributes) == null ? void 0 : _b.tickets) != null ? _c : {};
|
|
10563
|
-
return Object.values(ticketsObj).map(mapTicket);
|
|
10628
|
+
return Object.values(ticketsObj).map((ticket) => mapTicket(ticket, eventId));
|
|
10564
10629
|
};
|
|
10565
10630
|
var getEventInfo = async (eventId, pk) => {
|
|
10566
10631
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
10567
10632
|
await sdkSeatSessionHeaders(eventId);
|
|
10568
10633
|
const body3 = await get(ENDPOINTS.events.info(eventId), {
|
|
10569
|
-
params: pk ? { pk } : void 0
|
|
10634
|
+
params: pk ? { pk } : void 0,
|
|
10635
|
+
tfCatalogContext: true
|
|
10570
10636
|
});
|
|
10571
10637
|
const attributes6 = (_b = (_a2 = body3 == null ? void 0 : body3.data) == null ? void 0 : _a2.attributes) != null ? _b : {};
|
|
10572
10638
|
const a = attributes6;
|
|
@@ -10575,6 +10641,7 @@ var getEventInfo = async (eventId, pk) => {
|
|
|
10575
10641
|
const rawCountry = a.country;
|
|
10576
10642
|
const countryCode = (_j = (_i = (_h = typeof rawCountry === "string" ? rawCountry : rawCountry == null ? void 0 : rawCountry.code) != null ? _h : a.countryCode) != null ? _i : a.country_code) != null ? _j : null;
|
|
10577
10643
|
return {
|
|
10644
|
+
...eventCurrency(a.currency),
|
|
10578
10645
|
isSeatedEvent: isSeatedEvent(attributes6),
|
|
10579
10646
|
tableMapEnabled: Boolean((_k = a.tableMapEnabled) != null ? _k : a.table_map_enabled),
|
|
10580
10647
|
isTimeSlotEvent: Boolean(
|
|
@@ -10608,7 +10675,7 @@ var getEventConditions = async (eventId) => {
|
|
|
10608
10675
|
}).filter((c) => c.content || c.name);
|
|
10609
10676
|
};
|
|
10610
10677
|
var getEventTimeSlotTickets = async (eventId, date, options) => {
|
|
10611
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
|
10678
|
+
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, _y, _z;
|
|
10612
10679
|
await sdkSeatSessionHeaders(eventId);
|
|
10613
10680
|
const body3 = await get(ENDPOINTS.events.timeSlotByDate(eventId), {
|
|
10614
10681
|
tfCatalogContext: true,
|
|
@@ -10629,25 +10696,28 @@ var getEventTimeSlotTickets = async (eventId, date, options) => {
|
|
|
10629
10696
|
const stock = Number((_h = (_g = s9.in_stock) != null ? _g : s9.real_stock) != null ? _h : 0);
|
|
10630
10697
|
out.push({
|
|
10631
10698
|
id: String(s9.matrix_record_id),
|
|
10699
|
+
...selectionKey(s9.selectionKey, eventId) ? { selectionKey: selectionKey(s9.selectionKey, eventId) } : {},
|
|
10632
10700
|
name: s9.display_name || s9.option_value || "Ticket",
|
|
10633
10701
|
groupName: (_j = (_i = s9.group_name) != null ? _i : s9.groupName) != null ? _j : null,
|
|
10634
|
-
optionName: String((_k = s9.
|
|
10635
|
-
price: Number((
|
|
10636
|
-
priceWithFees: Number((
|
|
10637
|
-
priceSymbol: (
|
|
10638
|
-
currency: "",
|
|
10639
|
-
feeIncluded:
|
|
10702
|
+
optionName: String((_l = (_k = s9.product_option_key) != null ? _k : s9.option_key) != null ? _l : ""),
|
|
10703
|
+
price: Number((_n = (_m = s9.display_price) != null ? _m : s9.base_price) != null ? _n : 0),
|
|
10704
|
+
priceWithFees: Number((_p = (_o = s9.price_with_fees) != null ? _o : s9.base_price) != null ? _p : 0),
|
|
10705
|
+
priceSymbol: (_r = (_q = s9.price_symbol) != null ? _q : s9.priceSymbol) != null ? _r : "",
|
|
10706
|
+
currency: (_s = s9.price_currency) != null ? _s : "",
|
|
10707
|
+
feeIncluded: s9.fee_included === true,
|
|
10640
10708
|
depositPercent: s9.deposit_percent != null ? Number(s9.deposit_percent) : null,
|
|
10641
10709
|
soldOut: Boolean(s9.sold_out) || stock <= 0,
|
|
10642
10710
|
salesStarted: s9.sales_started != null ? Boolean(s9.sales_started) : true,
|
|
10643
10711
|
salesEnded: Boolean(s9.sales_ended),
|
|
10644
|
-
minQuantity: Number((
|
|
10645
|
-
maxQuantity: Number((
|
|
10646
|
-
multiplier: Number((
|
|
10647
|
-
isTable: Boolean(s9.is_table),
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10712
|
+
minQuantity: Number((_t = s9.min_quantity) != null ? _t : 1) || 1,
|
|
10713
|
+
maxQuantity: Number((_u = s9.max_quantity) != null ? _u : 10),
|
|
10714
|
+
multiplier: Number((_v = s9.multiplier) != null ? _v : 1) || 1,
|
|
10715
|
+
isTable: s9.x_is_table !== void 0 && s9.x_is_table !== null ? Number(s9.x_is_table) === 1 : Boolean(s9.is_table),
|
|
10716
|
+
minGuests: s9.min_guests === void 0 || s9.min_guests === null ? void 0 : Number(s9.min_guests),
|
|
10717
|
+
maxGuests: s9.max_guests === void 0 || s9.max_guests === null ? void 0 : Number(s9.max_guests),
|
|
10718
|
+
allowDirectPurchase: Number((_w = s9.allow_direct_purchase_for_seat_map) != null ? _w : 1) === 1,
|
|
10719
|
+
descriptionRich: (_y = (_x = s9.x_description_rich) != null ? _x : s9.description) != null ? _y : null,
|
|
10720
|
+
badgeText: badgeOf((_z = s9.badge_text) != null ? _z : s9.badgeText),
|
|
10651
10721
|
timeSlot: { date: slotDate, time: timeKey }
|
|
10652
10722
|
});
|
|
10653
10723
|
}
|
|
@@ -10784,7 +10854,7 @@ var getEventTicketsWithMeta = async (eventId) => {
|
|
|
10784
10854
|
const attrs = (_b = (_a2 = body3 == null ? void 0 : body3.data) == null ? void 0 : _a2.attributes) != null ? _b : {};
|
|
10785
10855
|
const ticketsObj = (_c = attrs.tickets) != null ? _c : {};
|
|
10786
10856
|
return {
|
|
10787
|
-
tickets: Object.values(ticketsObj).map(mapTicket),
|
|
10857
|
+
tickets: Object.values(ticketsObj).map((ticket) => mapTicket(ticket, eventId)),
|
|
10788
10858
|
promo: {
|
|
10789
10859
|
isPromotionsEnabled: attrs.isPromotionsEnabled === true,
|
|
10790
10860
|
isAccessCodeEnabled: attrs.is_access_code === true,
|
|
@@ -10805,7 +10875,11 @@ var getEventBundles = async (eventId) => {
|
|
|
10805
10875
|
};
|
|
10806
10876
|
var submitPromoCode = async (eventId, promo) => {
|
|
10807
10877
|
await sdkSeatSessionHeaders(eventId);
|
|
10808
|
-
await post(
|
|
10878
|
+
await post(
|
|
10879
|
+
ENDPOINTS.events.promo(eventId),
|
|
10880
|
+
{ promo: promo.trim() },
|
|
10881
|
+
{ tfCatalogContext: true }
|
|
10882
|
+
);
|
|
10809
10883
|
};
|
|
10810
10884
|
var setEventCurrency = async (eventId, code, options) => {
|
|
10811
10885
|
var _a2;
|
|
@@ -15364,6 +15438,7 @@ __export2(hooks_exports, {
|
|
|
15364
15438
|
useSubmitPrizeDetails: () => useSubmitPrizeDetails,
|
|
15365
15439
|
useTicketCardForm: () => useTicketCardForm,
|
|
15366
15440
|
useTicketCardOwner: () => useTicketCardOwner,
|
|
15441
|
+
useTicketCatalog: () => useTicketCatalog,
|
|
15367
15442
|
useTicketChange: () => useTicketChange,
|
|
15368
15443
|
useTicketChangeOptions: () => useTicketChangeOptions,
|
|
15369
15444
|
useTicketGatewayWait: () => useTicketGatewayWait,
|
|
@@ -16314,7 +16389,7 @@ var useCatalogQuery = (options) => {
|
|
|
16314
16389
|
} : queryFn
|
|
16315
16390
|
});
|
|
16316
16391
|
};
|
|
16317
|
-
var useEvent = (eventId, options) =>
|
|
16392
|
+
var useEvent = (eventId, options) => useCatalogQuery({
|
|
16318
16393
|
queryKey: ttfKeys.event(eventId != null ? eventId : ""),
|
|
16319
16394
|
queryFn: () => ttf.events.info(eventId),
|
|
16320
16395
|
enabled: Boolean(eventId),
|
|
@@ -20563,15 +20638,15 @@ var useCheckoutImageField = ({
|
|
|
20563
20638
|
value: value6,
|
|
20564
20639
|
onChange,
|
|
20565
20640
|
pick: pick3,
|
|
20566
|
-
identity,
|
|
20641
|
+
identity: identity2,
|
|
20567
20642
|
disabled = false
|
|
20568
20643
|
}) => {
|
|
20569
20644
|
const assertOwner = useSessionAction();
|
|
20570
20645
|
const [busy, setBusy] = (0, import_react35.useState)(false);
|
|
20571
20646
|
const [error, setError] = (0, import_react35.useState)(null);
|
|
20572
|
-
const owner = (0, import_react35.useRef)({ identity, value: value6, disabled });
|
|
20573
|
-
if (owner.current.identity !==
|
|
20574
|
-
owner.current = { identity, value: value6, disabled };
|
|
20647
|
+
const owner = (0, import_react35.useRef)({ identity: identity2, value: value6, disabled });
|
|
20648
|
+
if (owner.current.identity !== identity2 || owner.current.value !== value6 || owner.current.disabled !== disabled)
|
|
20649
|
+
owner.current = { identity: identity2, value: value6, disabled };
|
|
20575
20650
|
const renderOwner = owner.current;
|
|
20576
20651
|
const operation = (0, import_react35.useRef)(0);
|
|
20577
20652
|
const inFlight = (0, import_react35.useRef)(false);
|
|
@@ -20589,7 +20664,7 @@ var useCheckoutImageField = ({
|
|
|
20589
20664
|
inFlight.current = false;
|
|
20590
20665
|
setBusy(false);
|
|
20591
20666
|
setError(null);
|
|
20592
|
-
}, [
|
|
20667
|
+
}, [identity2, value6, disabled]);
|
|
20593
20668
|
const select = async (picker = pick3) => {
|
|
20594
20669
|
if (!mounted.current || owner.current !== renderOwner || !picker || disabled || inFlight.current)
|
|
20595
20670
|
return;
|
|
@@ -21926,6 +22001,205 @@ var useAccountEmailEnrichment = (options = {}) => {
|
|
|
21926
22001
|
}
|
|
21927
22002
|
};
|
|
21928
22003
|
};
|
|
22004
|
+
var EMPTY_DATES = [];
|
|
22005
|
+
var EMPTY_TICKETS = [];
|
|
22006
|
+
var useTicketCatalog = (eventId, explicitDates) => {
|
|
22007
|
+
var _a2, _b, _c, _d;
|
|
22008
|
+
const queryClient = (0, import_react_query20.useQueryClient)();
|
|
22009
|
+
const account = (0, import_react42.useSyncExternalStore)(subscribeSession, getSessionCacheScope, () => 0);
|
|
22010
|
+
const revision = (0, import_react42.useSyncExternalStore)(
|
|
22011
|
+
subscribeSession,
|
|
22012
|
+
getCatalogContextRevision,
|
|
22013
|
+
() => 0
|
|
22014
|
+
);
|
|
22015
|
+
const assertOwner = (0, import_react42.useMemo)(captureSessionAction, [account]);
|
|
22016
|
+
const actionSubject = JSON.stringify([eventId, account]);
|
|
22017
|
+
const action = useLiveScope(actionSubject);
|
|
22018
|
+
const subject = JSON.stringify([eventId, account, revision]);
|
|
22019
|
+
const { live, instance: instance2 } = useLiveScope(subject);
|
|
22020
|
+
const current5 = (0, import_react42.useCallback)(() => {
|
|
22021
|
+
try {
|
|
22022
|
+
assertOwner();
|
|
22023
|
+
return revision === getCatalogContextRevision() && instance2 !== null && live.current() === instance2;
|
|
22024
|
+
} catch (e) {
|
|
22025
|
+
return false;
|
|
22026
|
+
}
|
|
22027
|
+
}, [assertOwner, revision, instance2, live]);
|
|
22028
|
+
const capturePrimeContinuation = () => {
|
|
22029
|
+
const pin = getCartPinRevision();
|
|
22030
|
+
return () => {
|
|
22031
|
+
try {
|
|
22032
|
+
assertOwner();
|
|
22033
|
+
if (action.instance === null || action.live.current() !== action.instance)
|
|
22034
|
+
return false;
|
|
22035
|
+
if (current5()) return true;
|
|
22036
|
+
return getCartPinRevision() > pin && getCartGuestToken() !== null && getEffectiveGuestCarrier() === getCartGuestToken();
|
|
22037
|
+
} catch (e) {
|
|
22038
|
+
return false;
|
|
22039
|
+
}
|
|
22040
|
+
};
|
|
22041
|
+
};
|
|
22042
|
+
const [selection, updateSelection] = useScopedState(subject, { rows: EMPTY_TICKETS, date: "", quantities: {} });
|
|
22043
|
+
const [slotDate, updateDate] = useScopedState(subject, "");
|
|
22044
|
+
const [refreshing, setRefreshing] = useScopedState(subject, false);
|
|
22045
|
+
const eventQuery = useEvent(eventId);
|
|
22046
|
+
const ticketsQuery = useTicketsWithMeta(eventId);
|
|
22047
|
+
const eventInfo = eventQuery.data;
|
|
22048
|
+
const isTimeSlot = Boolean((explicitDates == null ? void 0 : explicitDates.length) || (eventInfo == null ? void 0 : eventInfo.isTimeSlotEvent));
|
|
22049
|
+
const dates = (_a2 = explicitDates != null ? explicitDates : eventInfo == null ? void 0 : eventInfo.availableDates) != null ? _a2 : EMPTY_DATES;
|
|
22050
|
+
const slotQuery = useTimeSlotTickets(eventId, isTimeSlot ? slotDate : void 0);
|
|
22051
|
+
const { tickets, datedTickets, regularTickets } = (0, import_react42.useMemo)(() => {
|
|
22052
|
+
var _a3, _b2, _c2;
|
|
22053
|
+
if (!eventInfo && explicitDates === void 0)
|
|
22054
|
+
return {
|
|
22055
|
+
tickets: EMPTY_TICKETS,
|
|
22056
|
+
datedTickets: EMPTY_TICKETS,
|
|
22057
|
+
regularTickets: EMPTY_TICKETS
|
|
22058
|
+
};
|
|
22059
|
+
const base = (_b2 = (_a3 = ticketsQuery.data) == null ? void 0 : _a3.tickets) != null ? _b2 : EMPTY_TICKETS;
|
|
22060
|
+
if (!isTimeSlot)
|
|
22061
|
+
return { tickets: base, datedTickets: EMPTY_TICKETS, regularTickets: EMPTY_TICKETS };
|
|
22062
|
+
const currencies = [...new Set(base.map((ticket) => ticket.currency).filter(Boolean))];
|
|
22063
|
+
const currency = (eventInfo == null ? void 0 : eventInfo.currency) || (currencies.length === 1 ? currencies[0] : "");
|
|
22064
|
+
const symbols = [
|
|
22065
|
+
...new Set(
|
|
22066
|
+
base.filter((ticket) => ticket.currency === currency).map((ticket) => ticket.priceSymbol).filter(Boolean)
|
|
22067
|
+
)
|
|
22068
|
+
];
|
|
22069
|
+
const symbol = (eventInfo == null ? void 0 : eventInfo.priceSymbol) || (symbols.length === 1 ? symbols[0] : "");
|
|
22070
|
+
const dated = (slotQuery.isPlaceholderData ? EMPTY_TICKETS : (_c2 = slotQuery.data) != null ? _c2 : EMPTY_TICKETS).map((ticket) => ({
|
|
22071
|
+
...ticket,
|
|
22072
|
+
currency: ticket.currency || currency,
|
|
22073
|
+
priceSymbol: ticket.priceSymbol || symbol
|
|
22074
|
+
}));
|
|
22075
|
+
const rows2 = calendarTicketRows(base, dated);
|
|
22076
|
+
return {
|
|
22077
|
+
tickets: rows2,
|
|
22078
|
+
datedTickets: dated,
|
|
22079
|
+
regularTickets: rows2.slice(dated.length)
|
|
22080
|
+
};
|
|
22081
|
+
}, [
|
|
22082
|
+
eventInfo,
|
|
22083
|
+
explicitDates,
|
|
22084
|
+
isTimeSlot,
|
|
22085
|
+
(_b = ticketsQuery.data) == null ? void 0 : _b.tickets,
|
|
22086
|
+
slotQuery.data,
|
|
22087
|
+
slotQuery.isPlaceholderData
|
|
22088
|
+
]);
|
|
22089
|
+
const liveCatalog = (0, import_react42.useRef)({ tickets, date: slotDate });
|
|
22090
|
+
(0, import_react42.useLayoutEffect)(() => {
|
|
22091
|
+
liveCatalog.current = { tickets, date: slotDate };
|
|
22092
|
+
}, [tickets, slotDate]);
|
|
22093
|
+
const qty = (0, import_react42.useMemo)(
|
|
22094
|
+
() => catalogQuantities(
|
|
22095
|
+
selection.quantities,
|
|
22096
|
+
tickets,
|
|
22097
|
+
selection.rows,
|
|
22098
|
+
selection.date !== slotDate
|
|
22099
|
+
),
|
|
22100
|
+
[selection, tickets, slotDate]
|
|
22101
|
+
);
|
|
22102
|
+
(0, import_react42.useEffect)(() => {
|
|
22103
|
+
if (!current5()) return;
|
|
22104
|
+
const next = isTimeSlot ? catalogDate(slotDate, dates) : "";
|
|
22105
|
+
if (next !== slotDate) updateDate(next);
|
|
22106
|
+
updateSelection((previous) => {
|
|
22107
|
+
const quantities = catalogQuantities(
|
|
22108
|
+
previous.quantities,
|
|
22109
|
+
tickets,
|
|
22110
|
+
previous.rows,
|
|
22111
|
+
previous.date !== slotDate
|
|
22112
|
+
);
|
|
22113
|
+
return previous.rows === tickets && previous.date === slotDate && quantities === previous.quantities ? previous : { rows: tickets, date: slotDate, quantities };
|
|
22114
|
+
});
|
|
22115
|
+
}, [current5, isTimeSlot, slotDate, dates, tickets, updateDate, updateSelection]);
|
|
22116
|
+
const setQty = (0, import_react42.useCallback)(
|
|
22117
|
+
(update) => {
|
|
22118
|
+
if (current5())
|
|
22119
|
+
updateSelection((previous) => {
|
|
22120
|
+
const { tickets: rows2, date } = liveCatalog.current;
|
|
22121
|
+
const quantities = catalogQuantities(
|
|
22122
|
+
previous.quantities,
|
|
22123
|
+
rows2,
|
|
22124
|
+
previous.rows,
|
|
22125
|
+
previous.date !== date
|
|
22126
|
+
);
|
|
22127
|
+
const requested = typeof update === "function" ? update(quantities) : update;
|
|
22128
|
+
return { rows: rows2, date, quantities: catalogQuantities(requested, rows2) };
|
|
22129
|
+
});
|
|
22130
|
+
},
|
|
22131
|
+
[current5, updateSelection]
|
|
22132
|
+
);
|
|
22133
|
+
const setSlotDate = (0, import_react42.useCallback)(
|
|
22134
|
+
(date) => {
|
|
22135
|
+
if (current5() && dates.includes(date)) updateDate(date);
|
|
22136
|
+
},
|
|
22137
|
+
[current5, dates, updateDate]
|
|
22138
|
+
);
|
|
22139
|
+
const { refetch: refetchInfo } = eventQuery;
|
|
22140
|
+
const { refetch: refetchTickets } = ticketsQuery;
|
|
22141
|
+
const refetchCatalog = (0, import_react42.useCallback)(async () => {
|
|
22142
|
+
if (!current5()) return;
|
|
22143
|
+
setRefreshing(true);
|
|
22144
|
+
try {
|
|
22145
|
+
await Promise.all([
|
|
22146
|
+
refetchInfo({ throwOnError: true }),
|
|
22147
|
+
refetchTickets({ throwOnError: true })
|
|
22148
|
+
]);
|
|
22149
|
+
if (!current5()) return;
|
|
22150
|
+
await queryClient.invalidateQueries(
|
|
22151
|
+
{
|
|
22152
|
+
predicate: (query) => {
|
|
22153
|
+
const key5 = query.queryKey;
|
|
22154
|
+
const prefix = [...ttfKeys.tickets(eventId), "slots"];
|
|
22155
|
+
return prefix.every((part, index) => key5[index] === part) && key5.some(
|
|
22156
|
+
(part) => !!part && typeof part === "object" && part.tfCatalogContext === revision
|
|
22157
|
+
) && key5.some(
|
|
22158
|
+
(part) => !!part && typeof part === "object" && part.tfSessionScope === account
|
|
22159
|
+
);
|
|
22160
|
+
},
|
|
22161
|
+
refetchType: "active"
|
|
22162
|
+
},
|
|
22163
|
+
{ throwOnError: true }
|
|
22164
|
+
);
|
|
22165
|
+
if (!current5()) return;
|
|
22166
|
+
} finally {
|
|
22167
|
+
if (current5()) setRefreshing(false);
|
|
22168
|
+
}
|
|
22169
|
+
}, [
|
|
22170
|
+
current5,
|
|
22171
|
+
refetchInfo,
|
|
22172
|
+
refetchTickets,
|
|
22173
|
+
setRefreshing,
|
|
22174
|
+
queryClient,
|
|
22175
|
+
eventId,
|
|
22176
|
+
revision,
|
|
22177
|
+
account
|
|
22178
|
+
]);
|
|
22179
|
+
return {
|
|
22180
|
+
scope: subject,
|
|
22181
|
+
capturePrimeContinuation,
|
|
22182
|
+
attributionReady: !!eventInfo && !!ticketsQuery.data && !eventQuery.isFetching && !ticketsQuery.isFetching,
|
|
22183
|
+
ticketsQuery,
|
|
22184
|
+
eventInfo,
|
|
22185
|
+
slotQuery,
|
|
22186
|
+
tickets,
|
|
22187
|
+
datedTickets,
|
|
22188
|
+
regularTickets,
|
|
22189
|
+
dates,
|
|
22190
|
+
slotDate,
|
|
22191
|
+
isTimeSlot,
|
|
22192
|
+
setSlotDate,
|
|
22193
|
+
qty,
|
|
22194
|
+
setQty,
|
|
22195
|
+
current: current5,
|
|
22196
|
+
instance: instance2,
|
|
22197
|
+
refetchCatalog,
|
|
22198
|
+
busy: refreshing || eventQuery.isFetching || ticketsQuery.isFetching || isTimeSlot && !!slotDate && slotQuery.isFetching,
|
|
22199
|
+
isLoading: eventQuery.isLoading || ticketsQuery.isLoading || isTimeSlot && !!slotDate && slotQuery.isLoading,
|
|
22200
|
+
error: (_d = (_c = eventQuery.error) != null ? _c : ticketsQuery.error) != null ? _d : isTimeSlot ? slotQuery.error : null
|
|
22201
|
+
};
|
|
22202
|
+
};
|
|
21929
22203
|
var accountEn = {
|
|
21930
22204
|
"account.add_an_email_address": "Add an email address",
|
|
21931
22205
|
"account.email_address": "Email address",
|
|
@@ -24311,30 +24585,30 @@ var translateAccountMessage = (translate2, english, vars) => {
|
|
|
24311
24585
|
};
|
|
24312
24586
|
|
|
24313
24587
|
// src/useCheckout.ts
|
|
24314
|
-
var
|
|
24588
|
+
var import_react49 = require("react");
|
|
24315
24589
|
|
|
24316
24590
|
// src/CardInput.tsx
|
|
24317
|
-
var
|
|
24591
|
+
var import_react48 = require("react");
|
|
24318
24592
|
var import_react_native4 = require("react-native");
|
|
24319
24593
|
var import_stripe_react_native = require("@stripe/stripe-react-native");
|
|
24320
24594
|
|
|
24321
24595
|
// src/ui/CheckoutProvider.tsx
|
|
24322
|
-
var
|
|
24323
|
-
var
|
|
24596
|
+
var import_react47 = require("react");
|
|
24597
|
+
var import_react_query21 = require("@tanstack/react-query");
|
|
24324
24598
|
|
|
24325
24599
|
// src/ui/InstallmentPicker.tsx
|
|
24326
|
-
var
|
|
24600
|
+
var import_react45 = require("react");
|
|
24327
24601
|
var import_react_native2 = require("react-native");
|
|
24328
24602
|
|
|
24329
24603
|
// src/ui/primitives.tsx
|
|
24330
|
-
var
|
|
24604
|
+
var import_react44 = require("react");
|
|
24331
24605
|
var import_react_native = require("react-native");
|
|
24332
24606
|
|
|
24333
24607
|
// src/ui/Frozen.tsx
|
|
24334
|
-
var
|
|
24608
|
+
var import_react43 = require("react");
|
|
24335
24609
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24336
|
-
var FrozenContext = (0,
|
|
24337
|
-
var useFrozen = () => (0,
|
|
24610
|
+
var FrozenContext = (0, import_react43.createContext)(false);
|
|
24611
|
+
var useFrozen = () => (0, import_react43.useContext)(FrozenContext);
|
|
24338
24612
|
var FrozenFields = ({
|
|
24339
24613
|
frozen = false,
|
|
24340
24614
|
children
|
|
@@ -24440,7 +24714,7 @@ var Button = ({
|
|
|
24440
24714
|
}
|
|
24441
24715
|
);
|
|
24442
24716
|
};
|
|
24443
|
-
var useStyles = (theme) => (0,
|
|
24717
|
+
var useStyles = (theme) => (0, import_react44.useMemo)(
|
|
24444
24718
|
() => import_react_native.StyleSheet.create({
|
|
24445
24719
|
card: {
|
|
24446
24720
|
backgroundColor: theme.surface,
|
|
@@ -24507,9 +24781,9 @@ var useStyles = (theme) => (0, import_react43.useMemo)(
|
|
|
24507
24781
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
24508
24782
|
var useInstallmentPicker = () => {
|
|
24509
24783
|
var _a2;
|
|
24510
|
-
const [pending3, setPending] = (0,
|
|
24511
|
-
const [choices] = (0,
|
|
24512
|
-
(0,
|
|
24784
|
+
const [pending3, setPending] = (0, import_react45.useState)(null);
|
|
24785
|
+
const [choices] = (0, import_react45.useState)(() => createInstallmentChoices(setPending));
|
|
24786
|
+
(0, import_react45.useEffect)(() => () => choices.cancel(), [choices]);
|
|
24513
24787
|
const onInstallmentOffers = choices.ask;
|
|
24514
24788
|
const choose = (offer) => pending3 == null ? void 0 : pending3.choose(offer);
|
|
24515
24789
|
const picker = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -24564,7 +24838,7 @@ var InstallmentModal = ({ offers, onChoose, onClose }) => {
|
|
|
24564
24838
|
}
|
|
24565
24839
|
);
|
|
24566
24840
|
};
|
|
24567
|
-
var useStyles2 = (theme) => (0,
|
|
24841
|
+
var useStyles2 = (theme) => (0, import_react45.useMemo)(
|
|
24568
24842
|
() => import_react_native2.StyleSheet.create({
|
|
24569
24843
|
backdrop: {
|
|
24570
24844
|
flex: 1,
|
|
@@ -24615,7 +24889,7 @@ var useStyles2 = (theme) => (0, import_react44.useMemo)(
|
|
|
24615
24889
|
);
|
|
24616
24890
|
|
|
24617
24891
|
// src/ui/ProviderPages.tsx
|
|
24618
|
-
var
|
|
24892
|
+
var import_react46 = require("react");
|
|
24619
24893
|
var import_react_native3 = require("react-native");
|
|
24620
24894
|
var import_react_native_webview = require("react-native-webview");
|
|
24621
24895
|
|
|
@@ -24688,10 +24962,10 @@ var externalInitialUri = (uri) => {
|
|
|
24688
24962
|
);
|
|
24689
24963
|
};
|
|
24690
24964
|
var useProviderPages = () => {
|
|
24691
|
-
const [pending3, setPending] = (0,
|
|
24692
|
-
const [pages] = (0,
|
|
24693
|
-
(0,
|
|
24694
|
-
(0,
|
|
24965
|
+
const [pending3, setPending] = (0, import_react46.useState)(null);
|
|
24966
|
+
const [pages] = (0, import_react46.useState)(() => createProviderPages(setPending));
|
|
24967
|
+
(0, import_react46.useEffect)(() => () => pages.cancel(), [pages]);
|
|
24968
|
+
(0, import_react46.useEffect)(() => {
|
|
24695
24969
|
if (!pending3) return;
|
|
24696
24970
|
const subscription = import_react_native3.Linking.addEventListener("url", ({ url: url2 }) => {
|
|
24697
24971
|
if (providerPageMatchesReturn(url2, pending3.request.returnUrlPrefix))
|
|
@@ -24713,10 +24987,10 @@ var ProviderPage = ({
|
|
|
24713
24987
|
const backdrop = resolveTheme({ colorScheme: theme.colorScheme }).background;
|
|
24714
24988
|
const externalUri = pending3.request.uri && externalInitialUri(pending3.request.uri) ? pending3.request.uri : null;
|
|
24715
24989
|
const sourceError = pending3.request.uri && !secureInitialUri(pending3.request.uri) && !externalUri ? "This payment page could not be opened securely." : "";
|
|
24716
|
-
const [error, setError] = (0,
|
|
24990
|
+
const [error, setError] = (0, import_react46.useState)("");
|
|
24717
24991
|
const displayedError = sourceError || error;
|
|
24718
|
-
const [reload, setReload] = (0,
|
|
24719
|
-
(0,
|
|
24992
|
+
const [reload, setReload] = (0, import_react46.useState)(0);
|
|
24993
|
+
(0, import_react46.useEffect)(() => {
|
|
24720
24994
|
if (!externalUri) return;
|
|
24721
24995
|
let active2 = true;
|
|
24722
24996
|
void import_react_native3.Linking.openURL(externalUri).catch(() => {
|
|
@@ -24817,14 +25091,14 @@ var styles = import_react_native3.StyleSheet.create({
|
|
|
24817
25091
|
|
|
24818
25092
|
// src/ui/CheckoutProvider.tsx
|
|
24819
25093
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
24820
|
-
var CheckoutCtx = (0,
|
|
24821
|
-
var ThemeCtx = (0,
|
|
24822
|
-
var ImagePickerCtx = (0,
|
|
24823
|
-
var ValidationCtx = (0,
|
|
25094
|
+
var CheckoutCtx = (0, import_react47.createContext)(null);
|
|
25095
|
+
var ThemeCtx = (0, import_react47.createContext)(resolveTheme());
|
|
25096
|
+
var ImagePickerCtx = (0, import_react47.createContext)(void 0);
|
|
25097
|
+
var ValidationCtx = (0, import_react47.createContext)(null);
|
|
24824
25098
|
var sharedQueryClient = null;
|
|
24825
25099
|
var getQueryClient = () => {
|
|
24826
25100
|
if (!sharedQueryClient) {
|
|
24827
|
-
sharedQueryClient = new
|
|
25101
|
+
sharedQueryClient = new import_react_query21.QueryClient({
|
|
24828
25102
|
defaultOptions: { queries: { retry: 1, staleTime: 6e4 } }
|
|
24829
25103
|
});
|
|
24830
25104
|
}
|
|
@@ -24834,18 +25108,18 @@ var CheckoutThemeProvider = ({
|
|
|
24834
25108
|
theme,
|
|
24835
25109
|
children
|
|
24836
25110
|
}) => {
|
|
24837
|
-
const resolved = (0,
|
|
25111
|
+
const resolved = (0, import_react47.useMemo)(() => resolveTheme(theme), [theme]);
|
|
24838
25112
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThemeCtx.Provider, { value: resolved, children });
|
|
24839
25113
|
};
|
|
24840
25114
|
var CheckoutRoot = ({ checkout, theme, pickImage, children }) => {
|
|
24841
|
-
const inheritedPicker = (0,
|
|
24842
|
-
const [attempt2, setAttempt] = (0,
|
|
24843
|
-
const requestValidation = (0,
|
|
24844
|
-
const validation = (0,
|
|
25115
|
+
const inheritedPicker = (0, import_react47.useContext)(ImagePickerCtx);
|
|
25116
|
+
const [attempt2, setAttempt] = (0, import_react47.useState)(0);
|
|
25117
|
+
const requestValidation = (0, import_react47.useCallback)(() => setAttempt((n) => n + 1), []);
|
|
25118
|
+
const validation = (0, import_react47.useMemo)(
|
|
24845
25119
|
() => ({ attempt: attempt2, requestValidation }),
|
|
24846
25120
|
[attempt2, requestValidation]
|
|
24847
25121
|
);
|
|
24848
|
-
const resolved = (0,
|
|
25122
|
+
const resolved = (0, import_react47.useMemo)(() => resolveTheme(theme), [theme]);
|
|
24849
25123
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckoutCtx.Provider, { value: checkout, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThemeCtx.Provider, { value: resolved, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ImagePickerCtx.Provider, { value: pickImage != null ? pickImage : inheritedPicker, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ValidationCtx.Provider, { value: validation, children }) }) }) });
|
|
24850
25124
|
};
|
|
24851
25125
|
var SelfProvidedCheckout = ({
|
|
@@ -24876,20 +25150,20 @@ var CheckoutProvider = ({
|
|
|
24876
25150
|
return (
|
|
24877
25151
|
// `value` present ⇒ don't call `useCheckout()` (no second binding); absent ⇒
|
|
24878
25152
|
// the self-providing branch owns it. The choice is static per mount.
|
|
24879
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
25153
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_query21.QueryClientProvider, { client: queryClient != null ? queryClient : getQueryClient(), children: value6 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckoutRoot, { checkout: value6, ...rest }, sessionKey) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelfProvidedCheckout, { ...rest }, sessionKey) })
|
|
24880
25154
|
);
|
|
24881
25155
|
};
|
|
24882
25156
|
var useCheckoutContext = () => {
|
|
24883
|
-
const ctx = (0,
|
|
25157
|
+
const ctx = (0, import_react47.useContext)(CheckoutCtx);
|
|
24884
25158
|
if (!ctx) {
|
|
24885
25159
|
throw new Error("useCheckoutContext must be used within <CheckoutProvider>.");
|
|
24886
25160
|
}
|
|
24887
25161
|
return ctx;
|
|
24888
25162
|
};
|
|
24889
|
-
var useTheme = () => (0,
|
|
24890
|
-
var useCheckoutImagePicker = () => (0,
|
|
25163
|
+
var useTheme = () => (0, import_react47.useContext)(ThemeCtx);
|
|
25164
|
+
var useCheckoutImagePicker = () => (0, import_react47.useContext)(ImagePickerCtx);
|
|
24891
25165
|
var useCheckoutValidation = () => {
|
|
24892
|
-
const ctx = (0,
|
|
25166
|
+
const ctx = (0, import_react47.useContext)(ValidationCtx);
|
|
24893
25167
|
if (!ctx) {
|
|
24894
25168
|
throw new Error("useCheckoutValidation must be used within <CheckoutProvider>.");
|
|
24895
25169
|
}
|
|
@@ -24913,11 +25187,11 @@ var CardInput = ({
|
|
|
24913
25187
|
visible = true
|
|
24914
25188
|
}) => {
|
|
24915
25189
|
const theme = useTheme();
|
|
24916
|
-
const [attachment, setAttachment] = (0,
|
|
24917
|
-
const handleRef = (0,
|
|
24918
|
-
const visibleRef = (0,
|
|
25190
|
+
const [attachment, setAttachment] = (0, import_react48.useState)(0);
|
|
25191
|
+
const handleRef = (0, import_react48.useRef)(null);
|
|
25192
|
+
const visibleRef = (0, import_react48.useRef)(visible);
|
|
24919
25193
|
visibleRef.current = visible;
|
|
24920
|
-
(0,
|
|
25194
|
+
(0, import_react48.useEffect)(() => {
|
|
24921
25195
|
const handle = cardFields.mount(
|
|
24922
25196
|
owner,
|
|
24923
25197
|
() => setAttachment((n) => n + 1),
|
|
@@ -24929,7 +25203,7 @@ var CardInput = ({
|
|
|
24929
25203
|
handleRef.current = null;
|
|
24930
25204
|
};
|
|
24931
25205
|
}, [owner]);
|
|
24932
|
-
(0,
|
|
25206
|
+
(0, import_react48.useEffect)(() => {
|
|
24933
25207
|
var _a2;
|
|
24934
25208
|
(_a2 = handleRef.current) == null ? void 0 : _a2.setVisible(visible);
|
|
24935
25209
|
}, [visible]);
|
|
@@ -25492,14 +25766,14 @@ var rnPorts = createRnPorts();
|
|
|
25492
25766
|
// src/useCheckout.ts
|
|
25493
25767
|
var useCheckout2 = (opts = {}) => {
|
|
25494
25768
|
var _a2;
|
|
25495
|
-
const [sheetConfig] = (0,
|
|
25769
|
+
const [sheetConfig] = (0, import_react49.useState)(
|
|
25496
25770
|
() => opts.paymentSheet ? { ...opts.paymentSheet } : void 0
|
|
25497
25771
|
);
|
|
25498
|
-
const [sheetScheme] = (0,
|
|
25772
|
+
const [sheetScheme] = (0, import_react49.useState)(() => {
|
|
25499
25773
|
var _a3;
|
|
25500
25774
|
return (_a3 = opts.options) == null ? void 0 : _a3.urlScheme;
|
|
25501
25775
|
});
|
|
25502
|
-
const [sheet] = (0,
|
|
25776
|
+
const [sheet] = (0, import_react49.useState)(
|
|
25503
25777
|
() => sheetConfig ? rnConfirmer.createPaymentSheetSession(sheetConfig) : void 0
|
|
25504
25778
|
);
|
|
25505
25779
|
const nativePorts = { ...rnPorts, ...opts.ports };
|
|
@@ -25581,7 +25855,7 @@ var configureCheckout = (config) => configure({
|
|
|
25581
25855
|
});
|
|
25582
25856
|
|
|
25583
25857
|
// src/ui/Field.tsx
|
|
25584
|
-
var
|
|
25858
|
+
var import_react50 = require("react");
|
|
25585
25859
|
var import_react_native6 = require("react-native");
|
|
25586
25860
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
25587
25861
|
var Field = ({ label, error, required, children }) => {
|
|
@@ -25612,7 +25886,7 @@ var Input = ({
|
|
|
25612
25886
|
const editable = editableProp && !frozen;
|
|
25613
25887
|
const theme = useTheme();
|
|
25614
25888
|
const s9 = useFieldStyles(theme);
|
|
25615
|
-
const [focused, setFocused] = (0,
|
|
25889
|
+
const [focused, setFocused] = (0, import_react50.useState)(false);
|
|
25616
25890
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
25617
25891
|
import_react_native6.TextInput,
|
|
25618
25892
|
{
|
|
@@ -25669,7 +25943,7 @@ var Checkbox = ({ checked, onChange, label, invalid: invalid3 = false }) => {
|
|
|
25669
25943
|
}
|
|
25670
25944
|
);
|
|
25671
25945
|
};
|
|
25672
|
-
var useFieldStyles = (theme) => (0,
|
|
25946
|
+
var useFieldStyles = (theme) => (0, import_react50.useMemo)(
|
|
25673
25947
|
() => import_react_native6.StyleSheet.create({
|
|
25674
25948
|
field: { gap: 6 },
|
|
25675
25949
|
label: {
|
|
@@ -25719,7 +25993,7 @@ var useFieldStyles = (theme) => (0, import_react49.useMemo)(
|
|
|
25719
25993
|
);
|
|
25720
25994
|
|
|
25721
25995
|
// src/ui/Select.tsx
|
|
25722
|
-
var
|
|
25996
|
+
var import_react51 = require("react");
|
|
25723
25997
|
var import_react_native7 = require("react-native");
|
|
25724
25998
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
25725
25999
|
function Select({
|
|
@@ -25734,16 +26008,16 @@ function Select({
|
|
|
25734
26008
|
const disabled = disabledProp || frozen;
|
|
25735
26009
|
const theme = useTheme();
|
|
25736
26010
|
const s9 = useSelectStyles(theme);
|
|
25737
|
-
const [open, setOpen] = (0,
|
|
25738
|
-
const interaction = (0,
|
|
26011
|
+
const [open, setOpen] = (0, import_react51.useState)(false);
|
|
26012
|
+
const interaction = (0, import_react51.useRef)({ disabled, open: false, revision: 0 });
|
|
25739
26013
|
interaction.current.disabled = disabled;
|
|
25740
26014
|
const revision = interaction.current.revision;
|
|
25741
|
-
const close = (0,
|
|
26015
|
+
const close = (0, import_react51.useCallback)(() => {
|
|
25742
26016
|
interaction.current.open = false;
|
|
25743
26017
|
interaction.current.revision += 1;
|
|
25744
26018
|
setOpen(false);
|
|
25745
26019
|
}, []);
|
|
25746
|
-
(0,
|
|
26020
|
+
(0, import_react51.useEffect)(() => {
|
|
25747
26021
|
if (disabled && interaction.current.open) close();
|
|
25748
26022
|
}, [disabled, close]);
|
|
25749
26023
|
const selected = options.find((o) => o.value === value6);
|
|
@@ -25808,7 +26082,7 @@ function Select({
|
|
|
25808
26082
|
)
|
|
25809
26083
|
] });
|
|
25810
26084
|
}
|
|
25811
|
-
var useSelectStyles = (theme) => (0,
|
|
26085
|
+
var useSelectStyles = (theme) => (0, import_react51.useMemo)(
|
|
25812
26086
|
() => import_react_native7.StyleSheet.create({
|
|
25813
26087
|
control: {
|
|
25814
26088
|
flexDirection: "row",
|
|
@@ -25869,7 +26143,7 @@ var useSelectStyles = (theme) => (0, import_react50.useMemo)(
|
|
|
25869
26143
|
);
|
|
25870
26144
|
|
|
25871
26145
|
// src/ui/QuantitySelect.tsx
|
|
25872
|
-
var
|
|
26146
|
+
var import_react52 = require("react");
|
|
25873
26147
|
var import_react_native8 = require("react-native");
|
|
25874
26148
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
25875
26149
|
var QuantitySelect = ({
|
|
@@ -25940,7 +26214,7 @@ var QuantitySelect = ({
|
|
|
25940
26214
|
}
|
|
25941
26215
|
);
|
|
25942
26216
|
};
|
|
25943
|
-
var useQuantityStyles = (theme) => (0,
|
|
26217
|
+
var useQuantityStyles = (theme) => (0, import_react52.useMemo)(
|
|
25944
26218
|
() => import_react_native8.StyleSheet.create({
|
|
25945
26219
|
stepper: { flexDirection: "row", alignItems: "center", gap: 14 },
|
|
25946
26220
|
btn: {
|
|
@@ -25968,7 +26242,7 @@ var useQuantityStyles = (theme) => (0, import_react51.useMemo)(
|
|
|
25968
26242
|
);
|
|
25969
26243
|
|
|
25970
26244
|
// src/ui/Timer.tsx
|
|
25971
|
-
var
|
|
26245
|
+
var import_react53 = require("react");
|
|
25972
26246
|
var import_react_native9 = require("react-native");
|
|
25973
26247
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
25974
26248
|
var clock = (s9) => {
|
|
@@ -25987,7 +26261,7 @@ var Timer = ({ seconds: seconds2, urgentAt = 60, label }) => {
|
|
|
25987
26261
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.Text, { style: [s9.clock, urgent && s9.clockUrgent], children: clock(seconds2) })
|
|
25988
26262
|
] });
|
|
25989
26263
|
};
|
|
25990
|
-
var useTimerStyles = (theme) => (0,
|
|
26264
|
+
var useTimerStyles = (theme) => (0, import_react53.useMemo)(
|
|
25991
26265
|
() => import_react_native9.StyleSheet.create({
|
|
25992
26266
|
row: { flexDirection: "row", alignItems: "center", gap: 6 },
|
|
25993
26267
|
label: {
|
|
@@ -26008,7 +26282,7 @@ var useTimerStyles = (theme) => (0, import_react52.useMemo)(
|
|
|
26008
26282
|
);
|
|
26009
26283
|
|
|
26010
26284
|
// src/ui/TimerBanner.tsx
|
|
26011
|
-
var
|
|
26285
|
+
var import_react54 = require("react");
|
|
26012
26286
|
var import_react_native10 = require("react-native");
|
|
26013
26287
|
var import_jsx_runtime11 = (
|
|
26014
26288
|
// `accessibilityLiveRegion="polite"` is the RN analogue of the web
|
|
@@ -26027,7 +26301,7 @@ var TimerBanner = ({
|
|
|
26027
26301
|
}) => {
|
|
26028
26302
|
const theme = useTheme();
|
|
26029
26303
|
const s9 = useBannerStyles(theme);
|
|
26030
|
-
const [dismissed, setDismissed] = (0,
|
|
26304
|
+
const [dismissed, setDismissed] = (0, import_react54.useState)(false);
|
|
26031
26305
|
if (seconds2 === void 0 || seconds2 <= 0 || dismissed) return null;
|
|
26032
26306
|
const urgent = seconds2 <= urgentAt;
|
|
26033
26307
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native10.View, { accessibilityLiveRegion: "polite", style: [s9.banner, urgent && s9.bannerUrgent], children: [
|
|
@@ -26046,7 +26320,7 @@ var TimerBanner = ({
|
|
|
26046
26320
|
)
|
|
26047
26321
|
] });
|
|
26048
26322
|
};
|
|
26049
|
-
var useBannerStyles = (theme) => (0,
|
|
26323
|
+
var useBannerStyles = (theme) => (0, import_react54.useMemo)(
|
|
26050
26324
|
() => import_react_native10.StyleSheet.create({
|
|
26051
26325
|
banner: {
|
|
26052
26326
|
flexDirection: "row",
|
|
@@ -26086,7 +26360,7 @@ var useBannerStyles = (theme) => (0, import_react53.useMemo)(
|
|
|
26086
26360
|
);
|
|
26087
26361
|
|
|
26088
26362
|
// src/ui/PaymentMethods.tsx
|
|
26089
|
-
var
|
|
26363
|
+
var import_react55 = require("react");
|
|
26090
26364
|
var import_react_native11 = require("react-native");
|
|
26091
26365
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
26092
26366
|
var EXTRA_LABEL = {
|
|
@@ -26165,7 +26439,7 @@ var PaymentMethods = ({
|
|
|
26165
26439
|
] }, option.value);
|
|
26166
26440
|
}) });
|
|
26167
26441
|
};
|
|
26168
|
-
var useStyles3 = (theme) => (0,
|
|
26442
|
+
var useStyles3 = (theme) => (0, import_react55.useMemo)(
|
|
26169
26443
|
() => import_react_native11.StyleSheet.create({
|
|
26170
26444
|
list: { gap: 8 },
|
|
26171
26445
|
row: {
|
|
@@ -26209,7 +26483,7 @@ var useStyles3 = (theme) => (0, import_react54.useMemo)(
|
|
|
26209
26483
|
);
|
|
26210
26484
|
|
|
26211
26485
|
// src/ui/RichText.tsx
|
|
26212
|
-
var
|
|
26486
|
+
var import_react56 = require("react");
|
|
26213
26487
|
var import_react_native12 = require("react-native");
|
|
26214
26488
|
var import_react_native_render_html = __toESM(require("react-native-render-html"));
|
|
26215
26489
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
@@ -26255,9 +26529,9 @@ var RichText = ({
|
|
|
26255
26529
|
selectable = false
|
|
26256
26530
|
}) => {
|
|
26257
26531
|
const theme = useTheme();
|
|
26258
|
-
const [width, setWidth] = (0,
|
|
26259
|
-
const source = (0,
|
|
26260
|
-
const baseStyle = (0,
|
|
26532
|
+
const [width, setWidth] = (0, import_react56.useState)(0);
|
|
26533
|
+
const source = (0, import_react56.useMemo)(() => ({ html }), [html]);
|
|
26534
|
+
const baseStyle = (0, import_react56.useMemo)(
|
|
26261
26535
|
() => ({
|
|
26262
26536
|
color: theme.muted,
|
|
26263
26537
|
fontSize: theme.fontSize - 1,
|
|
@@ -26267,13 +26541,13 @@ var RichText = ({
|
|
|
26267
26541
|
}),
|
|
26268
26542
|
[theme.muted, theme.fontSize, theme.fontFamily, textStyle]
|
|
26269
26543
|
);
|
|
26270
|
-
const systemFonts = (0,
|
|
26544
|
+
const systemFonts = (0, import_react56.useMemo)(
|
|
26271
26545
|
() => [
|
|
26272
26546
|
.../* @__PURE__ */ new Set([...import_react_native_render_html.defaultSystemFonts, theme.fontFamily, textStyle == null ? void 0 : textStyle.fontFamily])
|
|
26273
26547
|
].filter((font) => typeof font === "string"),
|
|
26274
26548
|
[theme.fontFamily, textStyle == null ? void 0 : textStyle.fontFamily]
|
|
26275
26549
|
);
|
|
26276
|
-
const tagsStyles = (0,
|
|
26550
|
+
const tagsStyles = (0, import_react56.useMemo)(() => {
|
|
26277
26551
|
var _a2;
|
|
26278
26552
|
const defaults = {
|
|
26279
26553
|
p: { marginTop: 0, marginBottom: 8 },
|
|
@@ -26310,7 +26584,7 @@ var RichText = ({
|
|
|
26310
26584
|
defaults[tag] = { ...defaults[tag], ...style };
|
|
26311
26585
|
return defaults;
|
|
26312
26586
|
}, [theme.accent, theme.fontSize, baseStyle.fontSize, tagOverrides]);
|
|
26313
|
-
const renderersProps = (0,
|
|
26587
|
+
const renderersProps = (0, import_react56.useMemo)(
|
|
26314
26588
|
() => ({
|
|
26315
26589
|
a: {
|
|
26316
26590
|
onPress: (event, href) => {
|
|
@@ -26327,7 +26601,7 @@ var RichText = ({
|
|
|
26327
26601
|
}),
|
|
26328
26602
|
[onLinkPress]
|
|
26329
26603
|
);
|
|
26330
|
-
const defaultTextProps = (0,
|
|
26604
|
+
const defaultTextProps = (0, import_react56.useMemo)(() => ({ selectable }), [selectable]);
|
|
26331
26605
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
26332
26606
|
import_react_native12.View,
|
|
26333
26607
|
{
|
|
@@ -26356,7 +26630,7 @@ var RichText = ({
|
|
|
26356
26630
|
var styles3 = import_react_native12.StyleSheet.create({ container: { alignSelf: "stretch", minWidth: 0 } });
|
|
26357
26631
|
|
|
26358
26632
|
// src/sections/Tickets.tsx
|
|
26359
|
-
var
|
|
26633
|
+
var import_react57 = require("react");
|
|
26360
26634
|
var import_react_native14 = require("react-native");
|
|
26361
26635
|
|
|
26362
26636
|
// src/ui/WaitingListForm.tsx
|
|
@@ -26498,7 +26772,20 @@ var Tickets = ({
|
|
|
26498
26772
|
const checkout = useCheckoutContext();
|
|
26499
26773
|
const theme = useTheme();
|
|
26500
26774
|
const s9 = useTicketStyles(theme);
|
|
26501
|
-
const
|
|
26775
|
+
const catalog = hooks_exports.useTicketCatalog(eventId, timeSlotDates);
|
|
26776
|
+
const {
|
|
26777
|
+
ticketsQuery,
|
|
26778
|
+
eventInfo,
|
|
26779
|
+
slotQuery,
|
|
26780
|
+
isTimeSlot,
|
|
26781
|
+
dates,
|
|
26782
|
+
slotDate,
|
|
26783
|
+
setSlotDate,
|
|
26784
|
+
qty,
|
|
26785
|
+
setQty,
|
|
26786
|
+
refetchCatalog,
|
|
26787
|
+
current: catalogCurrent
|
|
26788
|
+
} = catalog;
|
|
26502
26789
|
const waitingBuyer = hooks_exports.useAuthSession();
|
|
26503
26790
|
const cachedProfile = hooks_exports.useProfile({ enabled: false }).data;
|
|
26504
26791
|
const waitingPrefill = waitingListProfilePrefill(
|
|
@@ -26509,48 +26796,23 @@ var Tickets = ({
|
|
|
26509
26796
|
const bundleWait = hooks_exports.useTicketGatewayWait(checkout.store);
|
|
26510
26797
|
const bundleStarting = bundleWait !== null;
|
|
26511
26798
|
const promoMeta = (_a2 = ticketsQuery.data) == null ? void 0 : _a2.promo;
|
|
26512
|
-
const
|
|
26513
|
-
const [
|
|
26514
|
-
const
|
|
26515
|
-
|
|
26516
|
-
|
|
26517
|
-
|
|
26518
|
-
|
|
26519
|
-
|
|
26520
|
-
|
|
26521
|
-
|
|
26522
|
-
);
|
|
26523
|
-
(0,
|
|
26524
|
-
|
|
26525
|
-
|
|
26526
|
-
const slotQuery = hooks_exports.useTimeSlotTickets(eventId, isTimeSlot ? slotDate : void 0);
|
|
26527
|
-
const refetchCatalog = () => Promise.all([
|
|
26528
|
-
ticketsQuery.refetch(),
|
|
26529
|
-
...isTimeSlot && slotDate ? [slotQuery.refetch()] : []
|
|
26530
|
-
]);
|
|
26531
|
-
const tickets = (0, import_react56.useMemo)(
|
|
26532
|
-
() => {
|
|
26533
|
-
var _a3, _b2, _c2;
|
|
26534
|
-
return isTimeSlot ? (_a3 = slotQuery.data) != null ? _a3 : [] : (_c2 = (_b2 = ticketsQuery.data) == null ? void 0 : _b2.tickets) != null ? _c2 : [];
|
|
26535
|
-
},
|
|
26536
|
-
[isTimeSlot, slotQuery.data, (_b = ticketsQuery.data) == null ? void 0 : _b.tickets]
|
|
26537
|
-
);
|
|
26538
|
-
const [error, setError] = (0, import_react56.useState)("");
|
|
26539
|
-
const [code, setCode] = (0, import_react56.useState)("");
|
|
26540
|
-
const [codeState, setCodeState] = (0, import_react56.useState)("idle");
|
|
26541
|
-
const [promoOpen, setPromoOpen] = (0, import_react56.useState)(false);
|
|
26542
|
-
hooks_exports.useOnEventChange(eventId, () => {
|
|
26543
|
-
setQty({});
|
|
26544
|
-
setSlotDate("");
|
|
26545
|
-
setCode("");
|
|
26546
|
-
setPromoOpen(false);
|
|
26547
|
-
setError("");
|
|
26548
|
-
});
|
|
26549
|
-
const [visibleDescription, setVisibleDescription] = (0, import_react56.useState)(null);
|
|
26550
|
-
const attributionEvent = (0, import_react56.useRef)(null);
|
|
26551
|
-
(0, import_react56.useEffect)(() => {
|
|
26799
|
+
const tickets = catalog.tickets;
|
|
26800
|
+
const [error, updateError] = hooks_exports.useScopedState(catalog.scope, "");
|
|
26801
|
+
const setError = (message2) => {
|
|
26802
|
+
if (catalogCurrent()) updateError(message2);
|
|
26803
|
+
};
|
|
26804
|
+
const [code, setCode] = hooks_exports.useScopedState(catalog.scope, "");
|
|
26805
|
+
const [codeState, setCodeState] = hooks_exports.useScopedState(
|
|
26806
|
+
catalog.scope,
|
|
26807
|
+
"idle"
|
|
26808
|
+
);
|
|
26809
|
+
const [promoOpen, setPromoOpen] = hooks_exports.useScopedState(catalog.scope, false);
|
|
26810
|
+
const [visibleDescription, setVisibleDescription] = (0, import_react57.useState)(null);
|
|
26811
|
+
const attributionEvent = (0, import_react57.useRef)(null);
|
|
26812
|
+
(0, import_react57.useEffect)(() => {
|
|
26552
26813
|
var _a3;
|
|
26553
|
-
if (attributionEvent.current === eventId)
|
|
26814
|
+
if (!catalogCurrent() || !catalog.attributionReady || attributionEvent.current === eventId)
|
|
26815
|
+
return;
|
|
26554
26816
|
attributionEvent.current = eventId;
|
|
26555
26817
|
const promo = (_a3 = initialPromoCode == null ? void 0 : initialPromoCode.trim()) != null ? _a3 : "";
|
|
26556
26818
|
const referral = referrer;
|
|
@@ -26562,26 +26824,41 @@ var Tickets = ({
|
|
|
26562
26824
|
setPromoOpen(true);
|
|
26563
26825
|
setCodeState("busy");
|
|
26564
26826
|
checkout.applyPromoCode(eventId, promo).catch(() => void 0).finally(() => {
|
|
26565
|
-
|
|
26827
|
+
if (!catalogCurrent()) return;
|
|
26828
|
+
return refetchCatalog().catch((e) => {
|
|
26829
|
+
if (catalogCurrent()) setError(errorMessage(e));
|
|
26830
|
+
}).finally(() => {
|
|
26831
|
+
if (catalogCurrent()) setCodeState("idle");
|
|
26832
|
+
});
|
|
26566
26833
|
});
|
|
26567
26834
|
}
|
|
26568
|
-
}, [
|
|
26569
|
-
|
|
26835
|
+
}, [
|
|
26836
|
+
eventId,
|
|
26837
|
+
initialPromoCode,
|
|
26838
|
+
referrer,
|
|
26839
|
+
readAttributionFromUrl,
|
|
26840
|
+
catalog.instance,
|
|
26841
|
+
catalog.attributionReady
|
|
26842
|
+
]);
|
|
26843
|
+
(0, import_react57.useEffect)(() => {
|
|
26570
26844
|
checkout.syncCurrency(eventId, void 0, { seed: true }).catch(() => void 0);
|
|
26571
26845
|
}, [eventId]);
|
|
26572
26846
|
const changeCurrency = (nextCode) => {
|
|
26573
26847
|
checkout.syncCurrency(eventId, nextCode).then((res) => {
|
|
26574
|
-
if (res.requiresCatalogRefresh) {
|
|
26848
|
+
if (catalogCurrent() && res.requiresCatalogRefresh) {
|
|
26575
26849
|
setQty({});
|
|
26576
|
-
refetchCatalog()
|
|
26850
|
+
refetchCatalog().catch((e) => {
|
|
26851
|
+
if (catalogCurrent()) setError(errorMessage(e));
|
|
26852
|
+
});
|
|
26577
26853
|
}
|
|
26578
26854
|
}).catch(() => void 0);
|
|
26579
26855
|
};
|
|
26580
|
-
const originals = (0,
|
|
26581
|
-
(0,
|
|
26856
|
+
const originals = (0, import_react57.useRef)({});
|
|
26857
|
+
(0, import_react57.useEffect)(() => {
|
|
26582
26858
|
for (const t of tickets)
|
|
26583
|
-
if (originals.current[t
|
|
26584
|
-
|
|
26859
|
+
if (originals.current[ticketPriceContext(catalog.scope, t)] == null)
|
|
26860
|
+
originals.current[ticketPriceContext(catalog.scope, t)] = t.price;
|
|
26861
|
+
}, [tickets, catalog.scope]);
|
|
26585
26862
|
const selected = tickets.filter((t) => {
|
|
26586
26863
|
var _a3;
|
|
26587
26864
|
return ((_a3 = qty[t.id]) != null ? _a3 : 0) > 0;
|
|
@@ -26591,7 +26868,7 @@ var Tickets = ({
|
|
|
26591
26868
|
const selectQty = (ticket, value6) => setQty(
|
|
26592
26869
|
(previous) => changeTicketQuantity(previous, tickets, ticket, value6, allowMultiple)
|
|
26593
26870
|
);
|
|
26594
|
-
const isSeated = (
|
|
26871
|
+
const isSeated = (_b = eventInfo == null ? void 0 : eventInfo.isSeatedEvent) != null ? _b : false;
|
|
26595
26872
|
const seatMapRow = (t) => isSeated && !t.allowDirectPurchase;
|
|
26596
26873
|
const hasSeatMapTickets = tickets.some(seatMapRow);
|
|
26597
26874
|
const directPurchasable = tickets.filter((t) => !seatMapRow(t));
|
|
@@ -26599,7 +26876,9 @@ var Tickets = ({
|
|
|
26599
26876
|
const firstTableIndex = tickets.findIndex((t) => t.isTable);
|
|
26600
26877
|
const firstTableId = firstTableIndex > 0 && tickets.slice(0, firstTableIndex).some((t) => !t.isTable) ? tickets[firstTableIndex].id : void 0;
|
|
26601
26878
|
const prime = () => {
|
|
26879
|
+
if (!catalogCurrent() || catalog.busy || codeState === "busy" || catalog.error) return;
|
|
26602
26880
|
setError("");
|
|
26881
|
+
const continuationCurrent = catalog.capturePrimeContinuation();
|
|
26603
26882
|
const selections = selected.map((t) => {
|
|
26604
26883
|
var _a3;
|
|
26605
26884
|
return {
|
|
@@ -26611,28 +26890,37 @@ var Tickets = ({
|
|
|
26611
26890
|
currency: t.currency
|
|
26612
26891
|
};
|
|
26613
26892
|
});
|
|
26614
|
-
checkout.setTickets(eventId, selections).then(() =>
|
|
26893
|
+
checkout.setTickets(eventId, selections).then(() => {
|
|
26894
|
+
if (continuationCurrent()) onContinue == null ? void 0 : onContinue();
|
|
26895
|
+
}).catch(
|
|
26615
26896
|
(e) => setError(
|
|
26616
26897
|
e instanceof ConfirmerBusyError ? createTranslator()(e.message) : errorMessage(e)
|
|
26617
26898
|
)
|
|
26618
26899
|
);
|
|
26619
26900
|
};
|
|
26620
26901
|
const applyCode = () => {
|
|
26621
|
-
if (!code.trim())
|
|
26902
|
+
if (!catalogCurrent() || !catalog.attributionReady || catalog.busy || codeState === "busy" || !code.trim())
|
|
26903
|
+
return;
|
|
26904
|
+
setError("");
|
|
26622
26905
|
setCodeState("busy");
|
|
26623
26906
|
checkout.applyPromoCode(eventId, code.trim()).catch(() => void 0).finally(() => {
|
|
26624
|
-
|
|
26907
|
+
if (!catalogCurrent()) return;
|
|
26908
|
+
return refetchCatalog().catch((e) => {
|
|
26909
|
+
if (catalogCurrent()) setError(errorMessage(e));
|
|
26910
|
+
}).finally(() => {
|
|
26911
|
+
if (catalogCurrent()) setCodeState("idle");
|
|
26912
|
+
});
|
|
26625
26913
|
});
|
|
26626
26914
|
};
|
|
26627
26915
|
const isAccess = promoMeta == null ? void 0 : promoMeta.isAccessCodeEnabled;
|
|
26628
26916
|
const showCodeInput = (promoMeta == null ? void 0 : promoMeta.isPromotionsEnabled) || isAccess;
|
|
26629
|
-
const listQuery =
|
|
26917
|
+
const listQuery = catalog;
|
|
26630
26918
|
const currency = checkout.currency;
|
|
26631
26919
|
const renderRow = (t) => {
|
|
26632
26920
|
var _a3, _b2;
|
|
26633
26921
|
const notStarted = !t.salesStarted;
|
|
26634
26922
|
const unavailable = t.soldOut || t.salesEnded || notStarted;
|
|
26635
|
-
const original = originals.current[t
|
|
26923
|
+
const original = originals.current[ticketPriceContext(catalog.scope, t)];
|
|
26636
26924
|
const discounted = original != null && original > t.price;
|
|
26637
26925
|
const isFree = Number(t.price) === 0;
|
|
26638
26926
|
const sym = t.priceSymbol || t.currency;
|
|
@@ -26644,7 +26932,7 @@ var Tickets = ({
|
|
|
26644
26932
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Divider, {}),
|
|
26645
26933
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.Text, { style: s9.group, children: "Reserve tables" })
|
|
26646
26934
|
] }) : null;
|
|
26647
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
26935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react57.Fragment, { children: [
|
|
26648
26936
|
groupHeading,
|
|
26649
26937
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.View, { style: renderTicket ? void 0 : s9.rowWrap, children: renderTicket ? renderTicket({
|
|
26650
26938
|
ticket: t,
|
|
@@ -26705,8 +26993,8 @@ var Tickets = ({
|
|
|
26705
26993
|
};
|
|
26706
26994
|
const timeGroups = [];
|
|
26707
26995
|
if (isTimeSlot)
|
|
26708
|
-
for (const t of
|
|
26709
|
-
const time = (
|
|
26996
|
+
for (const t of catalog.datedTickets) {
|
|
26997
|
+
const time = (_d = (_c = t.timeSlot) == null ? void 0 : _c.time) != null ? _d : "";
|
|
26710
26998
|
const g = timeGroups.find((x) => x.time === time);
|
|
26711
26999
|
if (g) g.items.push(t);
|
|
26712
27000
|
else timeGroups.push({ time, items: [t] });
|
|
@@ -26725,7 +27013,6 @@ var Tickets = ({
|
|
|
26725
27013
|
value: slotDate,
|
|
26726
27014
|
onChange: (d) => {
|
|
26727
27015
|
setSlotDate(d);
|
|
26728
|
-
setQty({});
|
|
26729
27016
|
},
|
|
26730
27017
|
options: dates.map((d) => ({ label: d, value: d }))
|
|
26731
27018
|
}
|
|
@@ -26745,11 +27032,15 @@ var Tickets = ({
|
|
|
26745
27032
|
}
|
|
26746
27033
|
)
|
|
26747
27034
|
] }) : null,
|
|
26748
|
-
isTimeSlot && !slotQuery.isLoading &&
|
|
26749
|
-
isTimeSlot ? timeGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
27035
|
+
isTimeSlot && !slotQuery.isLoading && !((_e = slotQuery.data) == null ? void 0 : _e.length) && slotDate ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(MutedText, { children: "No sessions available on this date." }) : null,
|
|
27036
|
+
isTimeSlot ? timeGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react57.Fragment, { children: [
|
|
26750
27037
|
g.time ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.Text, { style: s9.slotTime, children: g.time }) : null,
|
|
26751
27038
|
g.items.map(renderRow)
|
|
26752
27039
|
] }, g.time)) : tickets.map(renderRow),
|
|
27040
|
+
isTimeSlot && catalog.regularTickets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
27041
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.Text, { style: s9.slotTime, children: createTranslator()("tickets.getTickets") }),
|
|
27042
|
+
catalog.regularTickets.map(renderRow)
|
|
27043
|
+
] }) : null,
|
|
26753
27044
|
showCodeInput ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.View, { style: s9.promo, children: !isAccess && !promoOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
26754
27045
|
import_react_native14.Pressable,
|
|
26755
27046
|
{
|
|
@@ -26774,7 +27065,7 @@ var Tickets = ({
|
|
|
26774
27065
|
variant: "ghost",
|
|
26775
27066
|
onPress: applyCode,
|
|
26776
27067
|
loading: codeState === "busy",
|
|
26777
|
-
disabled: codeState === "busy" || !code.trim(),
|
|
27068
|
+
disabled: !catalog.attributionReady || catalog.busy || codeState === "busy" || !code.trim(),
|
|
26778
27069
|
children: isAccess ? "ENTER" : "APPLY"
|
|
26779
27070
|
}
|
|
26780
27071
|
),
|
|
@@ -26784,14 +27075,14 @@ var Tickets = ({
|
|
|
26784
27075
|
directPurchasable.length > 0 ? renderContinue ? renderContinue({
|
|
26785
27076
|
onPress: prime,
|
|
26786
27077
|
loading: checkout.isBusy,
|
|
26787
|
-
disabled: checkout.orderFixed || checkout.isBusy || bundleStarting || selected.length === 0,
|
|
27078
|
+
disabled: checkout.orderFixed || checkout.isBusy || bundleStarting || catalog.busy || codeState === "busy" || !!catalog.error || selected.length === 0,
|
|
26788
27079
|
title: continueTitle
|
|
26789
27080
|
}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
26790
27081
|
Button,
|
|
26791
27082
|
{
|
|
26792
27083
|
onPress: prime,
|
|
26793
27084
|
loading: checkout.isBusy,
|
|
26794
|
-
disabled: checkout.isBusy || bundleStarting || selected.length === 0,
|
|
27085
|
+
disabled: checkout.isBusy || bundleStarting || catalog.busy || codeState === "busy" || !!catalog.error || selected.length === 0,
|
|
26795
27086
|
children: checkout.isBusy ? "Reserving\u2026" : selectionIsTable ? "Reserve tables" : buttonLabel
|
|
26796
27087
|
}
|
|
26797
27088
|
) : null,
|
|
@@ -26816,7 +27107,7 @@ var Tickets = ({
|
|
|
26816
27107
|
error || checkout.error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ErrorText, { children: error || checkout.error }) : null
|
|
26817
27108
|
] }) });
|
|
26818
27109
|
};
|
|
26819
|
-
var useTicketStyles = (theme) => (0,
|
|
27110
|
+
var useTicketStyles = (theme) => (0, import_react57.useMemo)(
|
|
26820
27111
|
() => import_react_native14.StyleSheet.create({
|
|
26821
27112
|
loading: { paddingVertical: 24, alignItems: "center" },
|
|
26822
27113
|
selectBlock: { gap: 6 },
|
|
@@ -26949,7 +27240,7 @@ var useTicketStyles = (theme) => (0, import_react56.useMemo)(
|
|
|
26949
27240
|
);
|
|
26950
27241
|
|
|
26951
27242
|
// src/sections/SeatsIoMap.tsx
|
|
26952
|
-
var
|
|
27243
|
+
var import_react58 = require("react");
|
|
26953
27244
|
var import_react_native15 = require("react-native");
|
|
26954
27245
|
var import_react_native_webview2 = require("react-native-webview");
|
|
26955
27246
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
@@ -26958,7 +27249,7 @@ var SeatsIoMap = ({ eventId, initial, onContinue }) => {
|
|
|
26958
27249
|
const checkout = useCheckoutContext();
|
|
26959
27250
|
const flow = hooks_exports.useSeatsIoSelection(eventId, checkout, initial, onContinue);
|
|
26960
27251
|
const bundleStarting = hooks_exports.useBundleStarting(checkout.store);
|
|
26961
|
-
const html = (0,
|
|
27252
|
+
const html = (0, import_react58.useMemo)(
|
|
26962
27253
|
() => flow.data.chart ? seatsIoChartDocument(flow.data.chart, flow.nonce) : "",
|
|
26963
27254
|
[flow.data.chart, flow.nonce]
|
|
26964
27255
|
);
|
|
@@ -27044,7 +27335,7 @@ var SeatsIoMap = ({ eventId, initial, onContinue }) => {
|
|
|
27044
27335
|
};
|
|
27045
27336
|
|
|
27046
27337
|
// src/sections/SeatMap.tsx
|
|
27047
|
-
var
|
|
27338
|
+
var import_react59 = require("react");
|
|
27048
27339
|
var import_react_native16 = require("react-native");
|
|
27049
27340
|
var import_react_native_webview3 = require("react-native-webview");
|
|
27050
27341
|
|
|
@@ -27060,9 +27351,9 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
27060
27351
|
const theme = useTheme();
|
|
27061
27352
|
const flow = hooks_exports.useSeatSelection(eventId, checkout, onContinue);
|
|
27062
27353
|
const bundleStarting = hooks_exports.useBundleStarting(checkout.store);
|
|
27063
|
-
const webview = (0,
|
|
27064
|
-
const [rendererError, setRendererError] = (0,
|
|
27065
|
-
const [size, setSize] = (0,
|
|
27354
|
+
const webview = (0, import_react59.useRef)(null);
|
|
27355
|
+
const [rendererError, setRendererError] = (0, import_react59.useState)(false);
|
|
27356
|
+
const [size, setSize] = (0, import_react59.useState)(320);
|
|
27066
27357
|
const properties = flow.chart.state === "ready" ? {
|
|
27067
27358
|
seatData: flow.chart.data.seatData,
|
|
27068
27359
|
statuses: flow.statuses,
|
|
@@ -27078,7 +27369,7 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
27078
27369
|
predefinedSeats: flow.chart.data.predefinedSeats
|
|
27079
27370
|
} : null;
|
|
27080
27371
|
const chart = flow.chart.state === "ready" ? flow.chart.data : null;
|
|
27081
|
-
const html = (0,
|
|
27372
|
+
const html = (0, import_react59.useMemo)(
|
|
27082
27373
|
() => chart ? `<!doctype html><html><head><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><style>html,body,#seat-map{margin:0;width:100%;height:100%;overflow:hidden}body{background:#fff}${SEAT_MAP_CSS}</style></head><body><div id="seat-map"></div><script>${SEAT_MAP_SCRIPT.replace(/<\/script/gi, "<\\/script")}</script></body></html>` : "",
|
|
27083
27374
|
[chart]
|
|
27084
27375
|
);
|
|
@@ -27089,7 +27380,7 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
27089
27380
|
`window.__tfSeatMapUpdate&&window.__tfSeatMapUpdate(${safeJson2(properties)});true;`
|
|
27090
27381
|
);
|
|
27091
27382
|
};
|
|
27092
|
-
(0,
|
|
27383
|
+
(0, import_react59.useEffect)(update, [properties && safeJson2(properties)]);
|
|
27093
27384
|
if (flow.chart.state === "provider") return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SeatsIoMap, { eventId, initial: flow.chart.data, onContinue });
|
|
27094
27385
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FrozenFields, { frozen: checkout.orderFixed, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Card, { children: [
|
|
27095
27386
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SectionHeader, { title: "Select your seats" }),
|
|
@@ -27225,7 +27516,7 @@ var styles5 = import_react_native16.StyleSheet.create({
|
|
|
27225
27516
|
});
|
|
27226
27517
|
|
|
27227
27518
|
// src/sections/AddOns.tsx
|
|
27228
|
-
var
|
|
27519
|
+
var import_react60 = require("react");
|
|
27229
27520
|
var import_react_native18 = require("react-native");
|
|
27230
27521
|
|
|
27231
27522
|
// src/ui/CustomFields.tsx
|
|
@@ -27432,7 +27723,7 @@ var AddOns = ({
|
|
|
27432
27723
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native18.Text, { style: s9.subtitle, children: "PLEASE SELECT FROM THE OPTIONAL ADD-ONS BELOW" }),
|
|
27433
27724
|
groups.map((g, gi) => {
|
|
27434
27725
|
var _a3;
|
|
27435
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
27726
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react60.Fragment, { children: [
|
|
27436
27727
|
g.heading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native18.Text, { style: s9.group, children: g.heading }) : null,
|
|
27437
27728
|
g.items.map((a) => {
|
|
27438
27729
|
var _a4, _b2;
|
|
@@ -27496,7 +27787,7 @@ var AddOns = ({
|
|
|
27496
27787
|
error || checkout.error ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ErrorText, { children: error || checkout.error }) : null
|
|
27497
27788
|
] }) });
|
|
27498
27789
|
};
|
|
27499
|
-
var useAddonStyles = (theme) => (0,
|
|
27790
|
+
var useAddonStyles = (theme) => (0, import_react60.useMemo)(
|
|
27500
27791
|
() => import_react_native18.StyleSheet.create({
|
|
27501
27792
|
head: { flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: 8 },
|
|
27502
27793
|
eyebrow: {
|
|
@@ -27590,7 +27881,7 @@ var useAddonStyles = (theme) => (0, import_react59.useMemo)(
|
|
|
27590
27881
|
);
|
|
27591
27882
|
|
|
27592
27883
|
// src/sections/Bundles.tsx
|
|
27593
|
-
var
|
|
27884
|
+
var import_react61 = require("react");
|
|
27594
27885
|
var import_react_native19 = require("react-native");
|
|
27595
27886
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
27596
27887
|
var money3 = (currency, amount2) => `${currency} ${amount2.toFixed(2)}`;
|
|
@@ -27840,7 +28131,7 @@ var Bundles = ({
|
|
|
27840
28131
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { onPress: flow.continueToDetails, disabled: !anySelected, children: t("bundles.continue") })
|
|
27841
28132
|
] });
|
|
27842
28133
|
};
|
|
27843
|
-
var useBundleStyles = (theme) => (0,
|
|
28134
|
+
var useBundleStyles = (theme) => (0, import_react61.useMemo)(
|
|
27844
28135
|
() => import_react_native19.StyleSheet.create({
|
|
27845
28136
|
loader: { paddingVertical: 20, alignItems: "center" },
|
|
27846
28137
|
heading: {
|
|
@@ -27893,7 +28184,7 @@ var useBundleStyles = (theme) => (0, import_react60.useMemo)(
|
|
|
27893
28184
|
);
|
|
27894
28185
|
|
|
27895
28186
|
// src/sections/BillingInfo.tsx
|
|
27896
|
-
var
|
|
28187
|
+
var import_react64 = require("react");
|
|
27897
28188
|
var import_react_native24 = require("react-native");
|
|
27898
28189
|
|
|
27899
28190
|
// src/sections/billing/BillingAddressFields.tsx
|
|
@@ -28001,11 +28292,11 @@ var styles6 = import_react_native20.StyleSheet.create({
|
|
|
28001
28292
|
});
|
|
28002
28293
|
|
|
28003
28294
|
// src/sections/billing/PhoneIdentity.tsx
|
|
28004
|
-
var
|
|
28295
|
+
var import_react63 = require("react");
|
|
28005
28296
|
var import_react_native22 = require("react-native");
|
|
28006
28297
|
|
|
28007
28298
|
// src/auth/TwoFactorForm.tsx
|
|
28008
|
-
var
|
|
28299
|
+
var import_react62 = require("react");
|
|
28009
28300
|
var import_react_native21 = require("react-native");
|
|
28010
28301
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
28011
28302
|
var TwoFactorForm = ({
|
|
@@ -28018,7 +28309,7 @@ var TwoFactorForm = ({
|
|
|
28018
28309
|
onSendSms,
|
|
28019
28310
|
onCancel
|
|
28020
28311
|
}) => {
|
|
28021
|
-
const [code, setCode] = (0,
|
|
28312
|
+
const [code, setCode] = (0, import_react62.useState)("");
|
|
28022
28313
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react_native21.View, { style: { gap: 14 }, children: [
|
|
28023
28314
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MutedText, { children: "Enter the six-digit code from your authenticator app or registered phone to complete sign-in." }),
|
|
28024
28315
|
error ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ErrorText, { children: error }) : null,
|
|
@@ -28069,35 +28360,35 @@ var PhoneIdentity = ({
|
|
|
28069
28360
|
...options
|
|
28070
28361
|
}) => {
|
|
28071
28362
|
var _a2;
|
|
28072
|
-
const
|
|
28073
|
-
const [code, setCode] = (0,
|
|
28074
|
-
const [emailInstead, setEmailInstead] = (0,
|
|
28363
|
+
const identity2 = hooks_exports.useCheckoutPhoneIdentity(options);
|
|
28364
|
+
const [code, setCode] = (0, import_react63.useState)("");
|
|
28365
|
+
const [emailInstead, setEmailInstead] = (0, import_react63.useState)(false);
|
|
28075
28366
|
if (emailInstead) return null;
|
|
28076
|
-
if (
|
|
28367
|
+
if (identity2.challenge)
|
|
28077
28368
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
28078
28369
|
TwoFactorForm,
|
|
28079
28370
|
{
|
|
28080
|
-
loading:
|
|
28081
|
-
error:
|
|
28371
|
+
loading: identity2.busy,
|
|
28372
|
+
error: identity2.error,
|
|
28082
28373
|
successMessage: "",
|
|
28083
|
-
smsAvailable:
|
|
28084
|
-
smsRetryAfter:
|
|
28085
|
-
onSubmit:
|
|
28086
|
-
onSendSms:
|
|
28087
|
-
onCancel:
|
|
28374
|
+
smsAvailable: identity2.challenge.smsAvailable,
|
|
28375
|
+
smsRetryAfter: identity2.retryAfter,
|
|
28376
|
+
onSubmit: identity2.verifyTwoFactor,
|
|
28377
|
+
onSendSms: identity2.sendTwoFactorSms,
|
|
28378
|
+
onCancel: identity2.cancel
|
|
28088
28379
|
}
|
|
28089
28380
|
);
|
|
28090
28381
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react_native22.View, { style: { gap: 12, paddingVertical: 12 }, children: [
|
|
28091
28382
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_native22.Text, { children: "Verify your phone to complete your details faster" }),
|
|
28092
|
-
|
|
28093
|
-
|
|
28383
|
+
identity2.error ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ErrorText, { children: identity2.error }) : null,
|
|
28384
|
+
identity2.verified ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
28094
28385
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MutedText, { children: "Your phone is verified." }),
|
|
28095
|
-
((_a2 =
|
|
28386
|
+
((_a2 = identity2.result) == null ? void 0 : _a2.prefill.has_known_email) === true && typeof identity2.result.prefill.email_masked === "string" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
28096
28387
|
Checkbox,
|
|
28097
28388
|
{
|
|
28098
28389
|
checked: Boolean(knownEmailSelected),
|
|
28099
28390
|
onChange: onUseKnownEmail,
|
|
28100
|
-
label: `Send my tickets to ${
|
|
28391
|
+
label: `Send my tickets to ${identity2.result.prefill.email_masked}`
|
|
28101
28392
|
}
|
|
28102
28393
|
) : null
|
|
28103
28394
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
@@ -28105,14 +28396,14 @@ var PhoneIdentity = ({
|
|
|
28105
28396
|
Input,
|
|
28106
28397
|
{
|
|
28107
28398
|
accessibilityLabel: "Mobile number",
|
|
28108
|
-
value:
|
|
28109
|
-
onChangeText:
|
|
28399
|
+
value: identity2.phone,
|
|
28400
|
+
onChangeText: identity2.setPhone,
|
|
28110
28401
|
keyboardType: "phone-pad",
|
|
28111
28402
|
autoComplete: "tel",
|
|
28112
|
-
editable: !
|
|
28403
|
+
editable: !identity2.busy && !identity2.sent
|
|
28113
28404
|
}
|
|
28114
28405
|
) }),
|
|
28115
|
-
|
|
28406
|
+
identity2.sent ? /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
28116
28407
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Field, { label: "Verification code", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
28117
28408
|
Input,
|
|
28118
28409
|
{
|
|
@@ -28123,15 +28414,15 @@ var PhoneIdentity = ({
|
|
|
28123
28414
|
autoComplete: "one-time-code",
|
|
28124
28415
|
maxLength: 6,
|
|
28125
28416
|
accessibilityLabel: "Verification code",
|
|
28126
|
-
editable: !
|
|
28417
|
+
editable: !identity2.busy
|
|
28127
28418
|
}
|
|
28128
28419
|
) }),
|
|
28129
28420
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
28130
28421
|
Button,
|
|
28131
28422
|
{
|
|
28132
|
-
loading:
|
|
28423
|
+
loading: identity2.busy,
|
|
28133
28424
|
disabled: !/^\d{6}$/.test(code),
|
|
28134
|
-
onPress: () => void
|
|
28425
|
+
onPress: () => void identity2.verify(code),
|
|
28135
28426
|
children: "Verify phone"
|
|
28136
28427
|
}
|
|
28137
28428
|
)
|
|
@@ -28139,30 +28430,30 @@ var PhoneIdentity = ({
|
|
|
28139
28430
|
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
28140
28431
|
Button,
|
|
28141
28432
|
{
|
|
28142
|
-
disabled:
|
|
28143
|
-
onPress: () => void
|
|
28144
|
-
children:
|
|
28433
|
+
disabled: identity2.busy || identity2.retryAfter > 0 || !identity2.phone.trim(),
|
|
28434
|
+
onPress: () => void identity2.request("sms"),
|
|
28435
|
+
children: identity2.retryAfter > 0 ? `Send another code in ${identity2.retryAfter}s` : "Send code by SMS"
|
|
28145
28436
|
}
|
|
28146
28437
|
),
|
|
28147
28438
|
options.whatsappAvailable ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
28148
28439
|
Button,
|
|
28149
28440
|
{
|
|
28150
28441
|
variant: "ghost",
|
|
28151
|
-
disabled:
|
|
28152
|
-
onPress: () => void
|
|
28442
|
+
disabled: identity2.busy || identity2.retryAfter > 0 || !identity2.phone.trim(),
|
|
28443
|
+
onPress: () => void identity2.request("whatsapp"),
|
|
28153
28444
|
children: "Send code by WhatsApp"
|
|
28154
28445
|
}
|
|
28155
28446
|
) : null
|
|
28156
28447
|
] }),
|
|
28157
|
-
(
|
|
28448
|
+
(identity2.sent || identity2.verified) && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
28158
28449
|
Button,
|
|
28159
28450
|
{
|
|
28160
28451
|
variant: "ghost",
|
|
28161
|
-
disabled:
|
|
28452
|
+
disabled: identity2.busy,
|
|
28162
28453
|
onPress: () => {
|
|
28163
28454
|
setCode("");
|
|
28164
28455
|
onReset();
|
|
28165
|
-
void
|
|
28456
|
+
void identity2.cancel();
|
|
28166
28457
|
},
|
|
28167
28458
|
children: "Change phone number"
|
|
28168
28459
|
}
|
|
@@ -28171,9 +28462,9 @@ var PhoneIdentity = ({
|
|
|
28171
28462
|
Button,
|
|
28172
28463
|
{
|
|
28173
28464
|
variant: "ghost",
|
|
28174
|
-
disabled:
|
|
28465
|
+
disabled: identity2.busy,
|
|
28175
28466
|
onPress: () => {
|
|
28176
|
-
void
|
|
28467
|
+
void identity2.cancel().then(() => setEmailInstead(true));
|
|
28177
28468
|
},
|
|
28178
28469
|
children: "Use email instead"
|
|
28179
28470
|
}
|
|
@@ -28386,17 +28677,17 @@ var BillingInfo = ({
|
|
|
28386
28677
|
const profile = hooks_exports.useCheckoutBuyerProfile(eventId);
|
|
28387
28678
|
const event = hooks_exports.useEvent(eventId);
|
|
28388
28679
|
const combined = !onContinue;
|
|
28389
|
-
const [billing, setBilling] = (0,
|
|
28680
|
+
const [billing, setBilling] = (0, import_react64.useState)(
|
|
28390
28681
|
() => billingDraftFrom(checkout.billing)
|
|
28391
28682
|
);
|
|
28392
|
-
const [dataCapture, setDataCapture] = (0,
|
|
28683
|
+
const [dataCapture, setDataCapture] = (0, import_react64.useState)(
|
|
28393
28684
|
(_b = (_a2 = checkout.billing) == null ? void 0 : _a2.dataCapture) != null ? _b : {}
|
|
28394
28685
|
);
|
|
28395
|
-
const [holders, setHolders] = (0,
|
|
28686
|
+
const [holders, setHolders] = (0, import_react64.useState)(
|
|
28396
28687
|
() => holderDraftsFrom(checkout.holders, checkout.backfilledHolderIndexes)
|
|
28397
28688
|
);
|
|
28398
|
-
const [consent, setConsent] = (0,
|
|
28399
|
-
const [dob, setDob] = (0,
|
|
28689
|
+
const [consent, setConsent] = (0, import_react64.useState)({ ttfOptIn: false, brandOptIn: false });
|
|
28690
|
+
const [dob, setDob] = (0, import_react64.useState)(() => billingDobIso(checkout.billing));
|
|
28400
28691
|
hooks_exports.useOnOrderReleased(checkout.orderFixed, () => {
|
|
28401
28692
|
var _a3, _b2;
|
|
28402
28693
|
setBilling(billingDraftFrom(checkout.billing));
|
|
@@ -28407,35 +28698,35 @@ var BillingInfo = ({
|
|
|
28407
28698
|
(prev) => holderDraftsReloaded(prev, checkout.holders, checkout.backfilledHolderIndexes)
|
|
28408
28699
|
);
|
|
28409
28700
|
});
|
|
28410
|
-
const restoredHolders = (0,
|
|
28701
|
+
const restoredHolders = (0, import_react64.useRef)(checkout.holders);
|
|
28411
28702
|
hooks_exports.useOnEventChange(checkout.eventId, () => {
|
|
28412
28703
|
restoredHolders.current = [];
|
|
28413
28704
|
setHolders([]);
|
|
28414
28705
|
setDataCapture({});
|
|
28415
28706
|
});
|
|
28416
|
-
const profileSeeded = (0,
|
|
28417
|
-
const countryDefaultApplied = (0,
|
|
28707
|
+
const profileSeeded = (0, import_react64.useRef)(false);
|
|
28708
|
+
const countryDefaultApplied = (0, import_react64.useRef)(Boolean((_c = checkout.billing) == null ? void 0 : _c.countryId));
|
|
28418
28709
|
const {
|
|
28419
28710
|
setBilling: commitBilling,
|
|
28420
28711
|
setHolders: commitHolders,
|
|
28421
28712
|
setConsent: commitConsent
|
|
28422
28713
|
} = checkout;
|
|
28423
28714
|
const gates = checkout.fieldGates;
|
|
28424
|
-
const orderGroups = (0,
|
|
28715
|
+
const orderGroups = (0, import_react64.useMemo)(
|
|
28425
28716
|
() => checkout.customFields.filter((g) => g.scope === "order"),
|
|
28426
28717
|
[checkout.customFields]
|
|
28427
28718
|
);
|
|
28428
|
-
const ticketGroups = (0,
|
|
28719
|
+
const ticketGroups = (0, import_react64.useMemo)(
|
|
28429
28720
|
() => checkout.customFields.filter((g) => g.scope === "ticket"),
|
|
28430
28721
|
[checkout.customFields]
|
|
28431
28722
|
);
|
|
28432
|
-
const ticketFields = (0,
|
|
28723
|
+
const ticketFields = (0, import_react64.useMemo)(
|
|
28433
28724
|
() => ticketGroups.flatMap((g) => g.fields),
|
|
28434
28725
|
[ticketGroups]
|
|
28435
28726
|
);
|
|
28436
28727
|
const holderNamesRequired = checkout.holderNamesRequired || collectTicketHolders;
|
|
28437
28728
|
const showHolders = holderNamesRequired || ticketFields.length > 0;
|
|
28438
|
-
const slots = (0,
|
|
28729
|
+
const slots = (0, import_react64.useMemo)(() => {
|
|
28439
28730
|
var _a3, _b2;
|
|
28440
28731
|
const out = [];
|
|
28441
28732
|
const lines = (_b2 = (_a3 = checkout.breakdown) == null ? void 0 : _a3.tickets) != null ? _b2 : [];
|
|
@@ -28448,7 +28739,7 @@ var BillingInfo = ({
|
|
|
28448
28739
|
}
|
|
28449
28740
|
return out;
|
|
28450
28741
|
}, [checkout.breakdown, checkout.selections]);
|
|
28451
|
-
(0,
|
|
28742
|
+
(0, import_react64.useEffect)(() => {
|
|
28452
28743
|
const p = profile.data;
|
|
28453
28744
|
if (!p || profileSeeded.current) return;
|
|
28454
28745
|
profileSeeded.current = true;
|
|
@@ -28471,10 +28762,10 @@ var BillingInfo = ({
|
|
|
28471
28762
|
return keys.every((k) => next[k] === prev[k]) ? prev : next;
|
|
28472
28763
|
});
|
|
28473
28764
|
}, [profile.data, checkout.isLoggedIn]);
|
|
28474
|
-
(0,
|
|
28765
|
+
(0, import_react64.useEffect)(() => {
|
|
28475
28766
|
setHolders((prev) => holderDraftsForSlots(prev, slots, restoredHolders.current));
|
|
28476
28767
|
}, [slots]);
|
|
28477
|
-
(0,
|
|
28768
|
+
(0, import_react64.useEffect)(() => {
|
|
28478
28769
|
if (!showHolders) return;
|
|
28479
28770
|
setHolders(
|
|
28480
28771
|
(prev) => holderDraftsMirroringBuyer(prev, {
|
|
@@ -28485,7 +28776,7 @@ var BillingInfo = ({
|
|
|
28485
28776
|
})
|
|
28486
28777
|
);
|
|
28487
28778
|
}, [showHolders, billing.firstName, billing.lastName, billing.email, billing.phone]);
|
|
28488
|
-
(0,
|
|
28779
|
+
(0, import_react64.useEffect)(() => {
|
|
28489
28780
|
const email = billing.email.trim();
|
|
28490
28781
|
if (checkout.isLoggedIn || !isEmail(email)) return;
|
|
28491
28782
|
const t = setTimeout(
|
|
@@ -28499,18 +28790,18 @@ var BillingInfo = ({
|
|
|
28499
28790
|
const countriesQuery = hooks_exports.useCountries({
|
|
28500
28791
|
enabled: needsNationality || gates.showAddress
|
|
28501
28792
|
});
|
|
28502
|
-
const countries = (0,
|
|
28793
|
+
const countries = (0, import_react64.useMemo)(() => {
|
|
28503
28794
|
var _a3;
|
|
28504
28795
|
return (_a3 = countriesQuery.data) != null ? _a3 : [];
|
|
28505
28796
|
}, [countriesQuery.data]);
|
|
28506
28797
|
const statesQuery = hooks_exports.useStates(billing.countryId, {
|
|
28507
28798
|
enabled: Boolean(billing.countryId)
|
|
28508
28799
|
});
|
|
28509
|
-
const states = (0,
|
|
28800
|
+
const states = (0, import_react64.useMemo)(() => {
|
|
28510
28801
|
var _a3;
|
|
28511
28802
|
return (_a3 = statesQuery.data) != null ? _a3 : [];
|
|
28512
28803
|
}, [statesQuery.data]);
|
|
28513
|
-
(0,
|
|
28804
|
+
(0, import_react64.useEffect)(() => {
|
|
28514
28805
|
var _a3, _b2, _c2, _d2;
|
|
28515
28806
|
if (countryDefaultApplied.current || billing.countryId || countries.length === 0 || profile.isLoading || eventId && event.isLoading) {
|
|
28516
28807
|
return;
|
|
@@ -28549,7 +28840,7 @@ var BillingInfo = ({
|
|
|
28549
28840
|
event.isLoading,
|
|
28550
28841
|
(_e = event.data) == null ? void 0 : _e.countryCode
|
|
28551
28842
|
]);
|
|
28552
|
-
(0,
|
|
28843
|
+
(0, import_react64.useEffect)(() => {
|
|
28553
28844
|
var _a3;
|
|
28554
28845
|
if (!billing.countryId) return;
|
|
28555
28846
|
const country = countries.find(
|
|
@@ -28560,7 +28851,7 @@ var BillingInfo = ({
|
|
|
28560
28851
|
setBilling((current5) => ({ ...current5, countryCode }));
|
|
28561
28852
|
}
|
|
28562
28853
|
}, [billing.countryId, billing.countryCode, countries]);
|
|
28563
|
-
(0,
|
|
28854
|
+
(0, import_react64.useEffect)(() => {
|
|
28564
28855
|
if (!billing.stateId) return;
|
|
28565
28856
|
const state = states.find(
|
|
28566
28857
|
(candidate) => String(candidate.id) === String(billing.stateId)
|
|
@@ -28620,7 +28911,7 @@ var BillingInfo = ({
|
|
|
28620
28911
|
});
|
|
28621
28912
|
if (ttfOptInLabel || brandOptInLabel) commitConsent(consent);
|
|
28622
28913
|
};
|
|
28623
|
-
(0,
|
|
28914
|
+
(0, import_react64.useEffect)(() => {
|
|
28624
28915
|
if (combined) commit();
|
|
28625
28916
|
}, [
|
|
28626
28917
|
combined,
|
|
@@ -28817,7 +29108,7 @@ var BillingInfo = ({
|
|
|
28817
29108
|
setBilling
|
|
28818
29109
|
}
|
|
28819
29110
|
) : null,
|
|
28820
|
-
orderGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
29111
|
+
orderGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react64.Fragment, { children: [
|
|
28821
29112
|
g.label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native24.Text, { style: s9.sectionLabel, children: g.label }) : null,
|
|
28822
29113
|
renderGroupFields(
|
|
28823
29114
|
g,
|
|
@@ -28894,7 +29185,7 @@ var BillingInfo = ({
|
|
|
28894
29185
|
showHolders ? continueButton : null
|
|
28895
29186
|
] });
|
|
28896
29187
|
};
|
|
28897
|
-
var useStyles4 = (theme) => (0,
|
|
29188
|
+
var useStyles4 = (theme) => (0, import_react64.useMemo)(
|
|
28898
29189
|
() => import_react_native24.StyleSheet.create({
|
|
28899
29190
|
loginRow: {
|
|
28900
29191
|
flexDirection: "row",
|
|
@@ -29087,7 +29378,7 @@ var Accommodation = ({ eventId }) => {
|
|
|
29087
29378
|
var styles9 = import_react_native26.StyleSheet.create({ room: { gap: 12, paddingVertical: 12 }, title: { fontSize: 16, fontWeight: "600" } });
|
|
29088
29379
|
|
|
29089
29380
|
// src/sections/Payment.tsx
|
|
29090
|
-
var
|
|
29381
|
+
var import_react65 = require("react");
|
|
29091
29382
|
var import_react_native27 = require("react-native");
|
|
29092
29383
|
var import_stripe_react_native3 = require("@stripe/stripe-react-native");
|
|
29093
29384
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
@@ -29141,14 +29432,14 @@ var Payment = ({
|
|
|
29141
29432
|
const bundleWait = hooks_exports.useTicketGatewayWait(checkout.store);
|
|
29142
29433
|
const bundleStarting = bundleWait !== null;
|
|
29143
29434
|
const validation = useCheckoutValidation();
|
|
29144
|
-
const [error, setError] = (0,
|
|
29435
|
+
const [error, setError] = (0, import_react65.useState)("");
|
|
29145
29436
|
const paymentMethods = hooks_exports.useCheckoutPaymentMethods(checkout.store);
|
|
29146
29437
|
const methods = (_a2 = paymentMethods.data) != null ? _a2 : null;
|
|
29147
|
-
const [selected, setSelected] = (0,
|
|
29148
|
-
const [extras, setExtras] = (0,
|
|
29149
|
-
const [useSavedCard, setUseSavedCard] = (0,
|
|
29150
|
-
const [nativeWalletSupported, setNativeWalletSupported] = (0,
|
|
29151
|
-
(0,
|
|
29438
|
+
const [selected, setSelected] = (0, import_react65.useState)("");
|
|
29439
|
+
const [extras, setExtras] = (0, import_react65.useState)({});
|
|
29440
|
+
const [useSavedCard, setUseSavedCard] = (0, import_react65.useState)(true);
|
|
29441
|
+
const [nativeWalletSupported, setNativeWalletSupported] = (0, import_react65.useState)(false);
|
|
29442
|
+
(0, import_react65.useEffect)(() => {
|
|
29152
29443
|
let mounted = true;
|
|
29153
29444
|
const env = getConfig().env;
|
|
29154
29445
|
(0, import_stripe_react_native3.isPlatformPaySupported)({ googlePay: { testEnv: env === "STAG" || env === "DEV" } }).then((supported) => {
|
|
@@ -29164,7 +29455,7 @@ var Payment = ({
|
|
|
29164
29455
|
const isFree = bd !== void 0 && Number(bd.total) === 0;
|
|
29165
29456
|
const isXendit = checkout.gateway === "xendit";
|
|
29166
29457
|
const offersOxxo = stripeOffersOxxo(checkout.stripeElementsConfig);
|
|
29167
|
-
const options = (0,
|
|
29458
|
+
const options = (0, import_react65.useMemo)(() => {
|
|
29168
29459
|
var _a3, _b2, _c2, _d2, _e2;
|
|
29169
29460
|
if (isFree || !methods) return [];
|
|
29170
29461
|
const out = [];
|
|
@@ -29221,7 +29512,7 @@ var Payment = ({
|
|
|
29221
29512
|
nativeWalletSupported,
|
|
29222
29513
|
offersOxxo
|
|
29223
29514
|
]);
|
|
29224
|
-
(0,
|
|
29515
|
+
(0, import_react65.useEffect)(() => {
|
|
29225
29516
|
if (options.length && !options.some((o) => o.value === selected))
|
|
29226
29517
|
setSelected(options[0].value);
|
|
29227
29518
|
}, [options, selected]);
|
|
@@ -29406,17 +29697,17 @@ var Payment = ({
|
|
|
29406
29697
|
};
|
|
29407
29698
|
|
|
29408
29699
|
// src/sections/WaiverSigning.tsx
|
|
29409
|
-
var
|
|
29700
|
+
var import_react67 = require("react");
|
|
29410
29701
|
var import_react_native29 = require("react-native");
|
|
29411
29702
|
|
|
29412
29703
|
// src/ui/SignaturePad.tsx
|
|
29413
|
-
var
|
|
29704
|
+
var import_react66 = require("react");
|
|
29414
29705
|
var import_react_native28 = require("react-native");
|
|
29415
29706
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
29416
29707
|
var LINE_WIDTH = 2.5;
|
|
29417
29708
|
var PAD_HEIGHT = 160;
|
|
29418
29709
|
var MIN_STEP = 1.5;
|
|
29419
|
-
var StrokeView = (0,
|
|
29710
|
+
var StrokeView = (0, import_react66.memo)(
|
|
29420
29711
|
({ stroke }) => stroke.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
29421
29712
|
import_react_native28.View,
|
|
29422
29713
|
{
|
|
@@ -29456,13 +29747,13 @@ var SignaturePad = ({
|
|
|
29456
29747
|
disabled
|
|
29457
29748
|
}) => {
|
|
29458
29749
|
const theme = useTheme();
|
|
29459
|
-
const strokesRef = (0,
|
|
29460
|
-
const [, setFrame] = (0,
|
|
29461
|
-
const frameRequest = (0,
|
|
29462
|
-
const size = (0,
|
|
29463
|
-
const report = (0,
|
|
29750
|
+
const strokesRef = (0, import_react66.useRef)([]);
|
|
29751
|
+
const [, setFrame] = (0, import_react66.useState)(0);
|
|
29752
|
+
const frameRequest = (0, import_react66.useRef)(null);
|
|
29753
|
+
const size = (0, import_react66.useRef)({ width: 0, height: PAD_HEIGHT });
|
|
29754
|
+
const report = (0, import_react66.useRef)(onChange);
|
|
29464
29755
|
report.current = onChange;
|
|
29465
|
-
const disabledRef = (0,
|
|
29756
|
+
const disabledRef = (0, import_react66.useRef)(disabled);
|
|
29466
29757
|
disabledRef.current = disabled;
|
|
29467
29758
|
const render = () => {
|
|
29468
29759
|
if (frameRequest.current !== null) cancelAnimationFrame(frameRequest.current);
|
|
@@ -29473,7 +29764,7 @@ var SignaturePad = ({
|
|
|
29473
29764
|
if (frameRequest.current !== null) return;
|
|
29474
29765
|
frameRequest.current = requestAnimationFrame(render);
|
|
29475
29766
|
};
|
|
29476
|
-
(0,
|
|
29767
|
+
(0, import_react66.useEffect)(
|
|
29477
29768
|
() => () => {
|
|
29478
29769
|
if (frameRequest.current !== null) cancelAnimationFrame(frameRequest.current);
|
|
29479
29770
|
},
|
|
@@ -29488,7 +29779,7 @@ var SignaturePad = ({
|
|
|
29488
29779
|
});
|
|
29489
29780
|
if (ended) report.current(ended.pngDataUrl, ended.inkLength);
|
|
29490
29781
|
};
|
|
29491
|
-
const responder = (0,
|
|
29782
|
+
const responder = (0, import_react66.useMemo)(
|
|
29492
29783
|
() => import_react_native28.PanResponder.create({
|
|
29493
29784
|
onStartShouldSetPanResponder: () => !disabledRef.current,
|
|
29494
29785
|
onMoveShouldSetPanResponder: () => !disabledRef.current,
|
|
@@ -29600,8 +29891,8 @@ var WaiverSigning = ({
|
|
|
29600
29891
|
checkout.setWaiverSignature,
|
|
29601
29892
|
checkout.holdWaiverSigning
|
|
29602
29893
|
);
|
|
29603
|
-
const [open, setOpen] = (0,
|
|
29604
|
-
const [reloading, setReloading] = (0,
|
|
29894
|
+
const [open, setOpen] = (0, import_react67.useState)({});
|
|
29895
|
+
const [reloading, setReloading] = (0, import_react67.useState)(false);
|
|
29605
29896
|
if ((_a2 = checkout.unavailableDetails) == null ? void 0 : _a2.includes("waiver")) {
|
|
29606
29897
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Card, { children: [
|
|
29607
29898
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SectionHeader, { title: t("waivers.heading") }),
|
|
@@ -29695,17 +29986,17 @@ var TicketForm = ({ ticket, consentText, t, methods, busy, locked = false, error
|
|
|
29695
29986
|
var _a2, _b, _c, _d;
|
|
29696
29987
|
const theme = useTheme();
|
|
29697
29988
|
const s9 = useWaiverStyles(theme);
|
|
29698
|
-
const [heldDraft, setDraft] = (0,
|
|
29989
|
+
const [heldDraft, setDraft] = (0, import_react67.useState)(
|
|
29699
29990
|
() => emptyWaiverDraft(
|
|
29700
29991
|
{ firstName: ticket.holderFirstName, lastName: ticket.holderLastName },
|
|
29701
29992
|
{ signatureMethods: methods }
|
|
29702
29993
|
)
|
|
29703
29994
|
);
|
|
29704
29995
|
const draft = draftWithAllowedMethod(heldDraft, methods);
|
|
29705
|
-
const [problems, setProblems] = (0,
|
|
29706
|
-
const [pressed, setPressed] = (0,
|
|
29996
|
+
const [problems, setProblems] = (0, import_react67.useState)([]);
|
|
29997
|
+
const [pressed, setPressed] = (0, import_react67.useState)(false);
|
|
29707
29998
|
const frozen = busy || locked;
|
|
29708
|
-
const draftRef = (0,
|
|
29999
|
+
const draftRef = (0, import_react67.useRef)(draft);
|
|
29709
30000
|
draftRef.current = draft;
|
|
29710
30001
|
const patch2 = (next) => {
|
|
29711
30002
|
if (!frozen) setDraft((d) => ({ ...d, ...next }));
|
|
@@ -29859,7 +30150,7 @@ var TicketForm = ({ ticket, consentText, t, methods, busy, locked = false, error
|
|
|
29859
30150
|
)
|
|
29860
30151
|
] });
|
|
29861
30152
|
};
|
|
29862
|
-
var useWaiverStyles = (theme) => (0,
|
|
30153
|
+
var useWaiverStyles = (theme) => (0, import_react67.useMemo)(
|
|
29863
30154
|
() => import_react_native29.StyleSheet.create({
|
|
29864
30155
|
muted: {
|
|
29865
30156
|
color: theme.muted,
|
|
@@ -29904,7 +30195,7 @@ var useWaiverStyles = (theme) => (0, import_react66.useMemo)(
|
|
|
29904
30195
|
);
|
|
29905
30196
|
|
|
29906
30197
|
// src/sections/IDVerification.tsx
|
|
29907
|
-
var
|
|
30198
|
+
var import_react68 = require("react");
|
|
29908
30199
|
var import_react_native30 = require("react-native");
|
|
29909
30200
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
29910
30201
|
var MESSAGE = {
|
|
@@ -29919,8 +30210,8 @@ var IDVerification = () => {
|
|
|
29919
30210
|
const checkout = useCheckoutContext();
|
|
29920
30211
|
const theme = useTheme();
|
|
29921
30212
|
const order = checkout.order;
|
|
29922
|
-
const [phase, setPhase] = (0,
|
|
29923
|
-
const [error, setError] = (0,
|
|
30213
|
+
const [phase, setPhase] = (0, import_react68.useState)("idle");
|
|
30214
|
+
const [error, setError] = (0, import_react68.useState)("");
|
|
29924
30215
|
if (!(order == null ? void 0 : order.needIdVerification)) return null;
|
|
29925
30216
|
const done = phase === "verified";
|
|
29926
30217
|
const running = phase === "starting" || phase === "polling";
|
|
@@ -29947,7 +30238,7 @@ var IDVerification = () => {
|
|
|
29947
30238
|
};
|
|
29948
30239
|
|
|
29949
30240
|
// src/sections/Confirmation.tsx
|
|
29950
|
-
var
|
|
30241
|
+
var import_react69 = require("react");
|
|
29951
30242
|
var import_react_native31 = require("react-native");
|
|
29952
30243
|
var import_clipboard = __toESM(require("@react-native-clipboard/clipboard"));
|
|
29953
30244
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
@@ -29961,7 +30252,7 @@ var Confirmation = ({
|
|
|
29961
30252
|
const checkout = useCheckoutContext();
|
|
29962
30253
|
const theme = useTheme();
|
|
29963
30254
|
const order = checkout.order;
|
|
29964
|
-
const [copied, setCopied] = (0,
|
|
30255
|
+
const [copied, setCopied] = (0, import_react69.useState)(false);
|
|
29965
30256
|
if (!order) return null;
|
|
29966
30257
|
const pending3 = order.pending;
|
|
29967
30258
|
const url2 = shareUrl != null ? shareUrl : "";
|
|
@@ -30015,12 +30306,12 @@ var styles11 = import_react_native31.StyleSheet.create({
|
|
|
30015
30306
|
});
|
|
30016
30307
|
|
|
30017
30308
|
// src/sections/Rewards.tsx
|
|
30018
|
-
var
|
|
30309
|
+
var import_react72 = require("react");
|
|
30019
30310
|
var import_react_native34 = require("react-native");
|
|
30020
30311
|
var import_clipboard2 = __toESM(require("@react-native-clipboard/clipboard"));
|
|
30021
30312
|
|
|
30022
30313
|
// src/sections/rewards/RewardsLadder.tsx
|
|
30023
|
-
var
|
|
30314
|
+
var import_react70 = require("react");
|
|
30024
30315
|
var import_react_native32 = require("react-native");
|
|
30025
30316
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
30026
30317
|
var AWARD_STATUS_KEYS = {
|
|
@@ -30030,9 +30321,9 @@ var AWARD_STATUS_KEYS = {
|
|
|
30030
30321
|
cancelled: "rewards.awards.cancelled"
|
|
30031
30322
|
};
|
|
30032
30323
|
var DeliveryDetails = ({ fields, translate: t, onSubmit }) => {
|
|
30033
|
-
const [values2, setValues] = (0,
|
|
30034
|
-
const [saving, setSaving] = (0,
|
|
30035
|
-
const [failure, setFailure] = (0,
|
|
30324
|
+
const [values2, setValues] = (0, import_react70.useState)({});
|
|
30325
|
+
const [saving, setSaving] = (0, import_react70.useState)(false);
|
|
30326
|
+
const [failure, setFailure] = (0, import_react70.useState)("");
|
|
30036
30327
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_native32.View, { style: { gap: 10 }, children: [
|
|
30037
30328
|
fields.map((field) => {
|
|
30038
30329
|
var _a2;
|
|
@@ -30124,7 +30415,7 @@ var styles12 = import_react_native32.StyleSheet.create({
|
|
|
30124
30415
|
});
|
|
30125
30416
|
|
|
30126
30417
|
// src/sections/rewards/RewardsTree.tsx
|
|
30127
|
-
var
|
|
30418
|
+
var import_react71 = require("react");
|
|
30128
30419
|
var import_react_native33 = require("react-native");
|
|
30129
30420
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
30130
30421
|
var MAX_NODES = 120;
|
|
@@ -30132,11 +30423,11 @@ var DOT = 10;
|
|
|
30132
30423
|
var ROOT_DOT = 16;
|
|
30133
30424
|
var RewardsTree = ({ tree, size = 260 }) => {
|
|
30134
30425
|
const theme = useTheme();
|
|
30135
|
-
const nodes = (0,
|
|
30426
|
+
const nodes = (0, import_react71.useMemo)(() => {
|
|
30136
30427
|
var _a2;
|
|
30137
30428
|
return ((_a2 = tree == null ? void 0 : tree.nodes) != null ? _a2 : []).slice(0, MAX_NODES);
|
|
30138
30429
|
}, [tree]);
|
|
30139
|
-
const { layout, edges, rootId } = (0,
|
|
30430
|
+
const { layout, edges, rootId } = (0, import_react71.useMemo)(() => {
|
|
30140
30431
|
const root = treeRootId(nodes);
|
|
30141
30432
|
const computed = computeRadialTreeLayout(nodes, root);
|
|
30142
30433
|
return { layout: computed, edges: radialTreeEdges(nodes, computed), rootId: root };
|
|
@@ -30223,10 +30514,10 @@ var RewardsView = ({
|
|
|
30223
30514
|
var _a2, _b, _c, _d, _e, _f;
|
|
30224
30515
|
const t = translate2 != null ? translate2 : createTranslator({ locale, messages });
|
|
30225
30516
|
const { rewards, failure, busy, hash } = flow;
|
|
30226
|
-
const [packName, setPackName] = (0,
|
|
30227
|
-
const [packCode, setPackCode] = (0,
|
|
30228
|
-
const [copied, setCopied] = (0,
|
|
30229
|
-
(0,
|
|
30517
|
+
const [packName, setPackName] = (0, import_react72.useState)("");
|
|
30518
|
+
const [packCode, setPackCode] = (0, import_react72.useState)("");
|
|
30519
|
+
const [copied, setCopied] = (0, import_react72.useState)(false);
|
|
30520
|
+
(0, import_react72.useEffect)(() => {
|
|
30230
30521
|
setCopied(false);
|
|
30231
30522
|
}, [rewards == null ? void 0 : rewards.share_link]);
|
|
30232
30523
|
if (!rewards)
|
|
@@ -30414,7 +30705,7 @@ var styles14 = import_react_native34.StyleSheet.create({
|
|
|
30414
30705
|
});
|
|
30415
30706
|
|
|
30416
30707
|
// src/sections/TicketChange.tsx
|
|
30417
|
-
var
|
|
30708
|
+
var import_react73 = require("react");
|
|
30418
30709
|
var import_react_native35 = require("react-native");
|
|
30419
30710
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
30420
30711
|
var TicketChange = ({
|
|
@@ -30624,7 +30915,7 @@ var TicketChange = ({
|
|
|
30624
30915
|
flow.notice ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native35.Text, { style: s9.muted, children: t(flow.notice) }) : null
|
|
30625
30916
|
] });
|
|
30626
30917
|
};
|
|
30627
|
-
var useChangeStyles = (theme) => (0,
|
|
30918
|
+
var useChangeStyles = (theme) => (0, import_react73.useMemo)(
|
|
30628
30919
|
() => import_react_native35.StyleSheet.create({
|
|
30629
30920
|
loader: { paddingVertical: 20, alignItems: "center" },
|
|
30630
30921
|
muted: {
|
|
@@ -30720,17 +31011,17 @@ var Trips = ({
|
|
|
30720
31011
|
};
|
|
30721
31012
|
|
|
30722
31013
|
// src/sections/EventDiscussionView.tsx
|
|
30723
|
-
var
|
|
31014
|
+
var import_react77 = require("react");
|
|
30724
31015
|
var import_react_native39 = require("react-native");
|
|
30725
31016
|
|
|
30726
31017
|
// src/sections/discussion/CommentImages.tsx
|
|
30727
|
-
var
|
|
31018
|
+
var import_react75 = require("react");
|
|
30728
31019
|
var import_react_native37 = require("react-native");
|
|
30729
31020
|
|
|
30730
31021
|
// src/ui/useAccountT.ts
|
|
30731
|
-
var
|
|
31022
|
+
var import_react74 = require("react");
|
|
30732
31023
|
var useAccountT = (locale) => {
|
|
30733
|
-
const translate2 = (0,
|
|
31024
|
+
const translate2 = (0, import_react74.useMemo)(
|
|
30734
31025
|
() => createTranslator({ locale: resolveLocale(locale) }),
|
|
30735
31026
|
[locale]
|
|
30736
31027
|
);
|
|
@@ -30794,8 +31085,8 @@ var CommentImages = ({
|
|
|
30794
31085
|
const t = useAccountT(locale);
|
|
30795
31086
|
const theme = useTheme();
|
|
30796
31087
|
const white = [s.white, { fontFamily: theme.fontFamily }];
|
|
30797
|
-
const [selected, setSelected] = (0,
|
|
30798
|
-
(0,
|
|
31088
|
+
const [selected, setSelected] = (0, import_react75.useState)(null);
|
|
31089
|
+
(0, import_react75.useEffect)(() => {
|
|
30799
31090
|
if (selected === null) return;
|
|
30800
31091
|
onPreviewChange(true);
|
|
30801
31092
|
return () => onPreviewChange(false);
|
|
@@ -31051,7 +31342,7 @@ var s = import_react_native37.StyleSheet.create({
|
|
|
31051
31342
|
});
|
|
31052
31343
|
|
|
31053
31344
|
// src/sections/discussion/SwipeReply.tsx
|
|
31054
|
-
var
|
|
31345
|
+
var import_react76 = require("react");
|
|
31055
31346
|
var import_react_native38 = require("react-native");
|
|
31056
31347
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
31057
31348
|
var SwipeReply = ({
|
|
@@ -31062,8 +31353,8 @@ var SwipeReply = ({
|
|
|
31062
31353
|
children
|
|
31063
31354
|
}) => {
|
|
31064
31355
|
const theme = useTheme();
|
|
31065
|
-
const offset = (0,
|
|
31066
|
-
const gesture = (0,
|
|
31356
|
+
const offset = (0, import_react76.useRef)(new import_react_native38.Animated.Value(0)).current;
|
|
31357
|
+
const gesture = (0, import_react76.useMemo)(() => {
|
|
31067
31358
|
const reset = () => import_react_native38.Animated.spring(offset, { toValue: 0, useNativeDriver: true }).start();
|
|
31068
31359
|
return import_react_native38.PanResponder.create({
|
|
31069
31360
|
onMoveShouldSetPanResponder: (_, value6) => enabled && value6.dx < -12 && Math.abs(value6.dx) > Math.abs(value6.dy) * 1.5,
|
|
@@ -31143,17 +31434,17 @@ var EventDiscussionBody = ({
|
|
|
31143
31434
|
var _a2, _b, _c;
|
|
31144
31435
|
const theme = useTheme();
|
|
31145
31436
|
const t = useAccountT(locale);
|
|
31146
|
-
const list2 = (0,
|
|
31147
|
-
const firstContent = (0,
|
|
31148
|
-
const [actions, setActions] = (0,
|
|
31149
|
-
const [reporting, setReporting] = (0,
|
|
31150
|
-
const [moderating, setModerating] = (0,
|
|
31151
|
-
const [reason, setReason] = (0,
|
|
31152
|
-
const [blocksVisible, setBlocksVisible] = (0,
|
|
31153
|
-
const [pickerError, setPickerError] = (0,
|
|
31154
|
-
const [imageOpen, setImageOpen] = (0,
|
|
31155
|
-
const [pickerBusy, setPickerBusy] = (0,
|
|
31156
|
-
const picking = (0,
|
|
31437
|
+
const list2 = (0, import_react77.useRef)(null);
|
|
31438
|
+
const firstContent = (0, import_react77.useRef)(true);
|
|
31439
|
+
const [actions, setActions] = (0, import_react77.useState)(null);
|
|
31440
|
+
const [reporting, setReporting] = (0, import_react77.useState)(null);
|
|
31441
|
+
const [moderating, setModerating] = (0, import_react77.useState)(null);
|
|
31442
|
+
const [reason, setReason] = (0, import_react77.useState)("");
|
|
31443
|
+
const [blocksVisible, setBlocksVisible] = (0, import_react77.useState)(false);
|
|
31444
|
+
const [pickerError, setPickerError] = (0, import_react77.useState)("");
|
|
31445
|
+
const [imageOpen, setImageOpen] = (0, import_react77.useState)(false);
|
|
31446
|
+
const [pickerBusy, setPickerBusy] = (0, import_react77.useState)(false);
|
|
31447
|
+
const picking = (0, import_react77.useRef)(false);
|
|
31157
31448
|
const text6 = { color: theme.text, fontFamily: theme.fontFamily };
|
|
31158
31449
|
const muted = { color: theme.muted, fontFamily: theme.fontFamily };
|
|
31159
31450
|
const closeActions = (work) => {
|
|
@@ -32167,7 +32458,7 @@ var styles15 = import_react_native44.StyleSheet.create({
|
|
|
32167
32458
|
});
|
|
32168
32459
|
|
|
32169
32460
|
// src/sections/Streaming.tsx
|
|
32170
|
-
var
|
|
32461
|
+
var import_react78 = require("react");
|
|
32171
32462
|
var import_react_native45 = require("react-native");
|
|
32172
32463
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
32173
32464
|
var Streaming = (props) => {
|
|
@@ -32189,14 +32480,14 @@ var StreamingView = ({
|
|
|
32189
32480
|
const defaultT = useAccountT(locale);
|
|
32190
32481
|
const t = translate2 != null ? translate2 : defaultT;
|
|
32191
32482
|
const inherited = useTheme();
|
|
32192
|
-
const theme = (0,
|
|
32483
|
+
const theme = (0, import_react78.useMemo)(
|
|
32193
32484
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
32194
32485
|
[inherited, override]
|
|
32195
32486
|
);
|
|
32196
32487
|
const session = hooks_exports.useAuthSession();
|
|
32197
32488
|
const assertOwner = hooks_exports.useSessionAction();
|
|
32198
|
-
const pendingBrowser = (0,
|
|
32199
|
-
const [stored, setStored] = (0,
|
|
32489
|
+
const pendingBrowser = (0, import_react78.useRef)({ scope: session.sessionScope, locked: false });
|
|
32490
|
+
const [stored, setStored] = (0, import_react78.useState)({
|
|
32200
32491
|
scope: session.sessionScope,
|
|
32201
32492
|
busy: false,
|
|
32202
32493
|
error: ""
|
|
@@ -32359,7 +32650,7 @@ var s4 = import_react_native45.StyleSheet.create({
|
|
|
32359
32650
|
});
|
|
32360
32651
|
|
|
32361
32652
|
// src/sections/AccountDeletion.tsx
|
|
32362
|
-
var
|
|
32653
|
+
var import_react79 = require("react");
|
|
32363
32654
|
var import_react_native46 = require("react-native");
|
|
32364
32655
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
32365
32656
|
var AccountDeletion = (props) => {
|
|
@@ -32382,7 +32673,7 @@ var AccountDeletionView = ({
|
|
|
32382
32673
|
const defaultT = useAccountT(locale);
|
|
32383
32674
|
const t = translate2 != null ? translate2 : defaultT;
|
|
32384
32675
|
const inherited = useTheme();
|
|
32385
|
-
const theme = (0,
|
|
32676
|
+
const theme = (0, import_react79.useMemo)(
|
|
32386
32677
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
32387
32678
|
[inherited, override]
|
|
32388
32679
|
);
|
|
@@ -32611,7 +32902,7 @@ var s5 = import_react_native46.StyleSheet.create({
|
|
|
32611
32902
|
});
|
|
32612
32903
|
|
|
32613
32904
|
// src/sections/ProfileSettings.tsx
|
|
32614
|
-
var
|
|
32905
|
+
var import_react80 = require("react");
|
|
32615
32906
|
var import_react_native47 = require("react-native");
|
|
32616
32907
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
32617
32908
|
var ProfileSettings = (props) => {
|
|
@@ -32635,7 +32926,7 @@ var ProfileSettingsView = ({
|
|
|
32635
32926
|
const defaultT = useAccountT(locale);
|
|
32636
32927
|
const t = translate2 != null ? translate2 : defaultT;
|
|
32637
32928
|
const inherited = useTheme();
|
|
32638
|
-
const theme = (0,
|
|
32929
|
+
const theme = (0, import_react80.useMemo)(
|
|
32639
32930
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
32640
32931
|
[inherited, override]
|
|
32641
32932
|
);
|
|
@@ -32647,7 +32938,7 @@ var ProfileSettingsView = ({
|
|
|
32647
32938
|
} catch (e) {
|
|
32648
32939
|
}
|
|
32649
32940
|
};
|
|
32650
|
-
(0,
|
|
32941
|
+
(0, import_react80.useEffect)(() => {
|
|
32651
32942
|
if (flow.settings) flow.open(mode);
|
|
32652
32943
|
}, [mode, flow.scopeKey, Boolean(flow.settings)]);
|
|
32653
32944
|
const text6 = { color: theme.text, fontFamily: theme.fontFamily };
|
|
@@ -33152,7 +33443,7 @@ var AccountPaymentPlanSection = ({
|
|
|
33152
33443
|
};
|
|
33153
33444
|
|
|
33154
33445
|
// src/sections/NotificationPreferences.tsx
|
|
33155
|
-
var
|
|
33446
|
+
var import_react81 = require("react");
|
|
33156
33447
|
var import_react_native50 = require("react-native");
|
|
33157
33448
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
33158
33449
|
var NotificationPreferences = (props) => {
|
|
@@ -33175,7 +33466,7 @@ var NotificationPreferencesView = ({
|
|
|
33175
33466
|
const defaultT = useAccountT(locale);
|
|
33176
33467
|
const t = translate2 != null ? translate2 : defaultT;
|
|
33177
33468
|
const inherited = useTheme();
|
|
33178
|
-
const theme = (0,
|
|
33469
|
+
const theme = (0, import_react81.useMemo)(
|
|
33179
33470
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
33180
33471
|
[inherited, override]
|
|
33181
33472
|
);
|
|
@@ -33187,7 +33478,7 @@ var NotificationPreferencesView = ({
|
|
|
33187
33478
|
} catch (e) {
|
|
33188
33479
|
}
|
|
33189
33480
|
};
|
|
33190
|
-
(0,
|
|
33481
|
+
(0, import_react81.useEffect)(() => {
|
|
33191
33482
|
var _a3;
|
|
33192
33483
|
if ((_a3 = flow.preferences) == null ? void 0 : _a3.available) flow.begin();
|
|
33193
33484
|
}, [flow.scopeKey, Boolean(flow.preferences), (_a2 = flow.preferences) == null ? void 0 : _a2.available]);
|
|
@@ -33352,15 +33643,15 @@ var s7 = import_react_native50.StyleSheet.create({
|
|
|
33352
33643
|
var import_react_native56 = require("react-native");
|
|
33353
33644
|
|
|
33354
33645
|
// src/auth/LoginForm.tsx
|
|
33355
|
-
var
|
|
33646
|
+
var import_react83 = require("react");
|
|
33356
33647
|
var import_react_native52 = require("react-native");
|
|
33357
33648
|
|
|
33358
33649
|
// src/auth/PasswordInput.tsx
|
|
33359
|
-
var
|
|
33650
|
+
var import_react82 = require("react");
|
|
33360
33651
|
var import_react_native51 = require("react-native");
|
|
33361
33652
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
33362
33653
|
var PasswordInput = (props) => {
|
|
33363
|
-
const [visible, setVisible] = (0,
|
|
33654
|
+
const [visible, setVisible] = (0, import_react82.useState)(false);
|
|
33364
33655
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react_native51.View, { style: styles16.wrap, children: [
|
|
33365
33656
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Input, { ...props, autoCapitalize: "none", secureTextEntry: !visible }),
|
|
33366
33657
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
@@ -33402,9 +33693,9 @@ var LoginForm = ({
|
|
|
33402
33693
|
onFieldChange
|
|
33403
33694
|
}) => {
|
|
33404
33695
|
const theme = useTheme();
|
|
33405
|
-
const [email, setEmail] = (0,
|
|
33406
|
-
const [password, setPassword] = (0,
|
|
33407
|
-
(0,
|
|
33696
|
+
const [email, setEmail] = (0, import_react83.useState)(initialEmail);
|
|
33697
|
+
const [password, setPassword] = (0, import_react83.useState)("");
|
|
33698
|
+
(0, import_react83.useEffect)(() => {
|
|
33408
33699
|
if (initialEmail && !email) setEmail(initialEmail);
|
|
33409
33700
|
}, [email, initialEmail]);
|
|
33410
33701
|
const submit = () => void onSubmit({ email, password });
|
|
@@ -33456,7 +33747,7 @@ var styles17 = import_react_native52.StyleSheet.create({
|
|
|
33456
33747
|
});
|
|
33457
33748
|
|
|
33458
33749
|
// src/auth/EmailCodeForm.tsx
|
|
33459
|
-
var
|
|
33750
|
+
var import_react84 = require("react");
|
|
33460
33751
|
var import_react_native53 = require("react-native");
|
|
33461
33752
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
33462
33753
|
var EmailCodeForm = ({
|
|
@@ -33471,8 +33762,8 @@ var EmailCodeForm = ({
|
|
|
33471
33762
|
onVerify,
|
|
33472
33763
|
onBack
|
|
33473
33764
|
}) => {
|
|
33474
|
-
const [email, setEmail] = (0,
|
|
33475
|
-
const [code, setCode] = (0,
|
|
33765
|
+
const [email, setEmail] = (0, import_react84.useState)(initialEmail);
|
|
33766
|
+
const [code, setCode] = (0, import_react84.useState)("");
|
|
33476
33767
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react_native53.View, { style: { gap: 14 }, children: [
|
|
33477
33768
|
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(MutedText, { children: sent ? `Enter the sign-in code sent to ${target}.` : "Receive a one-time sign-in code by email." }),
|
|
33478
33769
|
error ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorText, { children: error }) : null,
|
|
@@ -33528,7 +33819,7 @@ var EmailCodeForm = ({
|
|
|
33528
33819
|
};
|
|
33529
33820
|
|
|
33530
33821
|
// src/auth/ForgotPasswordForm.tsx
|
|
33531
|
-
var
|
|
33822
|
+
var import_react85 = require("react");
|
|
33532
33823
|
var import_react_native54 = require("react-native");
|
|
33533
33824
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
33534
33825
|
var ForgotPasswordForm = ({
|
|
@@ -33542,8 +33833,8 @@ var ForgotPasswordForm = ({
|
|
|
33542
33833
|
onFieldChange
|
|
33543
33834
|
}) => {
|
|
33544
33835
|
const theme = useTheme();
|
|
33545
|
-
const [email, setEmail] = (0,
|
|
33546
|
-
(0,
|
|
33836
|
+
const [email, setEmail] = (0, import_react85.useState)(initialEmail);
|
|
33837
|
+
(0, import_react85.useEffect)(() => {
|
|
33547
33838
|
if (initialEmail && !email) setEmail(initialEmail);
|
|
33548
33839
|
}, [email, initialEmail]);
|
|
33549
33840
|
const submit = () => void onSubmit(email);
|
|
@@ -33591,7 +33882,7 @@ var styles18 = import_react_native54.StyleSheet.create({
|
|
|
33591
33882
|
});
|
|
33592
33883
|
|
|
33593
33884
|
// src/auth/RegisterForm.tsx
|
|
33594
|
-
var
|
|
33885
|
+
var import_react86 = require("react");
|
|
33595
33886
|
var import_react_native55 = require("react-native");
|
|
33596
33887
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
33597
33888
|
var emptyRegistration = (email) => ({
|
|
@@ -33620,30 +33911,30 @@ var RegisterForm = ({
|
|
|
33620
33911
|
onFieldChange
|
|
33621
33912
|
}) => {
|
|
33622
33913
|
var _a2, _b, _c, _d, _e, _f;
|
|
33623
|
-
const t = (0,
|
|
33624
|
-
const [values2, setValues] = (0,
|
|
33914
|
+
const t = (0, import_react86.useMemo)(() => createTranslator({ locale }), [locale]);
|
|
33915
|
+
const [values2, setValues] = (0, import_react86.useState)(
|
|
33625
33916
|
() => emptyRegistration(initialEmail)
|
|
33626
33917
|
);
|
|
33627
|
-
const [termsAccepted, setTermsAccepted] = (0,
|
|
33628
|
-
const [refreshingProof, setRefreshingProof] = (0,
|
|
33629
|
-
const [refreshCode, setRefreshCode] = (0,
|
|
33918
|
+
const [termsAccepted, setTermsAccepted] = (0, import_react86.useState)(false);
|
|
33919
|
+
const [refreshingProof, setRefreshingProof] = (0, import_react86.useState)(false);
|
|
33920
|
+
const [refreshCode, setRefreshCode] = (0, import_react86.useState)("");
|
|
33630
33921
|
const countriesQuery = hooks_exports.useCountries();
|
|
33631
|
-
const countries = (0,
|
|
33922
|
+
const countries = (0, import_react86.useMemo)(() => {
|
|
33632
33923
|
var _a3;
|
|
33633
33924
|
return (_a3 = countriesQuery.data) != null ? _a3 : [];
|
|
33634
33925
|
}, [countriesQuery.data]);
|
|
33635
33926
|
const statesQuery = hooks_exports.useStates(values2.countryId, {
|
|
33636
33927
|
enabled: requireAddress && Boolean(values2.countryId)
|
|
33637
33928
|
});
|
|
33638
|
-
const states = (0,
|
|
33929
|
+
const states = (0, import_react86.useMemo)(() => {
|
|
33639
33930
|
var _a3;
|
|
33640
33931
|
return (_a3 = statesQuery.data) != null ? _a3 : [];
|
|
33641
33932
|
}, [statesQuery.data]);
|
|
33642
|
-
(0,
|
|
33933
|
+
(0, import_react86.useEffect)(() => {
|
|
33643
33934
|
if (initialEmail && !values2.email)
|
|
33644
33935
|
setValues((current5) => ({ ...current5, email: initialEmail }));
|
|
33645
33936
|
}, [initialEmail, values2.email]);
|
|
33646
|
-
(0,
|
|
33937
|
+
(0, import_react86.useEffect)(() => {
|
|
33647
33938
|
var _a3;
|
|
33648
33939
|
if (!requireAddress || values2.countryId || countries.length === 0) return;
|
|
33649
33940
|
const preferred = (_a3 = countries.find((country) => {
|
|
@@ -33664,11 +33955,11 @@ var RegisterForm = ({
|
|
|
33664
33955
|
setValues((current5) => ({ ...current5, [field]: value6 }));
|
|
33665
33956
|
onFieldChange == null ? void 0 : onFieldChange(field);
|
|
33666
33957
|
};
|
|
33667
|
-
const countryOptions = (0,
|
|
33958
|
+
const countryOptions = (0, import_react86.useMemo)(
|
|
33668
33959
|
() => countries.map((country) => ({ label: country.name, value: String(country.id) })),
|
|
33669
33960
|
[countries]
|
|
33670
33961
|
);
|
|
33671
|
-
const stateOptions = (0,
|
|
33962
|
+
const stateOptions = (0, import_react86.useMemo)(
|
|
33672
33963
|
() => states.map((state) => ({ label: state.name, value: String(state.id) })),
|
|
33673
33964
|
[states]
|
|
33674
33965
|
);
|
|
@@ -34267,7 +34558,7 @@ function AccountEmailEnrichment({
|
|
|
34267
34558
|
}
|
|
34268
34559
|
|
|
34269
34560
|
// src/auth/AuthModal.tsx
|
|
34270
|
-
var
|
|
34561
|
+
var import_react87 = require("react");
|
|
34271
34562
|
var import_react_native58 = require("react-native");
|
|
34272
34563
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
34273
34564
|
var Tab = ({
|
|
@@ -34302,7 +34593,7 @@ var CredentialAuthModal = ({
|
|
|
34302
34593
|
}) => {
|
|
34303
34594
|
const theme = useTheme();
|
|
34304
34595
|
const t = useAccountT();
|
|
34305
|
-
const closeAfterAuth = (0,
|
|
34596
|
+
const closeAfterAuth = (0, import_react87.useCallback)(
|
|
34306
34597
|
(profile) => {
|
|
34307
34598
|
onAuthenticated == null ? void 0 : onAuthenticated(profile);
|
|
34308
34599
|
onClose();
|
|
@@ -34494,8 +34785,8 @@ var PhoneAccountModal = ({
|
|
|
34494
34785
|
},
|
|
34495
34786
|
onCancelled: onClose
|
|
34496
34787
|
});
|
|
34497
|
-
const prepared = (0,
|
|
34498
|
-
(0,
|
|
34788
|
+
const prepared = (0, import_react87.useRef)(false);
|
|
34789
|
+
(0, import_react87.useEffect)(() => {
|
|
34499
34790
|
if (prepared.current) return;
|
|
34500
34791
|
prepared.current = true;
|
|
34501
34792
|
if (initialEmail) flow.emailAuth.showLogin(initialEmail);
|
|
@@ -34585,7 +34876,7 @@ var styles20 = import_react_native58.StyleSheet.create({
|
|
|
34585
34876
|
});
|
|
34586
34877
|
|
|
34587
34878
|
// src/auth/ResetPasswordForm.tsx
|
|
34588
|
-
var
|
|
34879
|
+
var import_react88 = require("react");
|
|
34589
34880
|
var import_react_native59 = require("react-native");
|
|
34590
34881
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
34591
34882
|
var ResetPasswordForm = ({
|
|
@@ -34594,11 +34885,11 @@ var ResetPasswordForm = ({
|
|
|
34594
34885
|
onBackToLogin
|
|
34595
34886
|
}) => {
|
|
34596
34887
|
const theme = useTheme();
|
|
34597
|
-
const [password, setPassword] = (0,
|
|
34598
|
-
const [confirmation, setConfirmation] = (0,
|
|
34599
|
-
const [submitted, setSubmitted] = (0,
|
|
34600
|
-
const [success, setSuccess] = (0,
|
|
34601
|
-
const validation = (0,
|
|
34888
|
+
const [password, setPassword] = (0, import_react88.useState)("");
|
|
34889
|
+
const [confirmation, setConfirmation] = (0, import_react88.useState)("");
|
|
34890
|
+
const [submitted, setSubmitted] = (0, import_react88.useState)(false);
|
|
34891
|
+
const [success, setSuccess] = (0, import_react88.useState)(false);
|
|
34892
|
+
const validation = (0, import_react88.useMemo)(() => {
|
|
34602
34893
|
if (!submitted)
|
|
34603
34894
|
return {};
|
|
34604
34895
|
return {
|
|
@@ -34657,7 +34948,7 @@ var styles21 = import_react_native59.StyleSheet.create({
|
|
|
34657
34948
|
});
|
|
34658
34949
|
|
|
34659
34950
|
// src/EmbeddedCheckout.tsx
|
|
34660
|
-
var
|
|
34951
|
+
var import_react89 = require("react");
|
|
34661
34952
|
var import_react_native60 = require("react-native");
|
|
34662
34953
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
34663
34954
|
var Flow = ({
|
|
@@ -34685,13 +34976,13 @@ var Flow = ({
|
|
|
34685
34976
|
var _a2;
|
|
34686
34977
|
const checkout = useCheckoutContext();
|
|
34687
34978
|
const theme = useTheme();
|
|
34688
|
-
const [view, setView] = (0,
|
|
34689
|
-
const [selectionView, setSelectionView] = (0,
|
|
34690
|
-
const editedDetailsRef = (0,
|
|
34691
|
-
const [authRequest, setAuthRequest] = (0,
|
|
34979
|
+
const [view, setView] = (0, import_react89.useState)(initialView);
|
|
34980
|
+
const [selectionView, setSelectionView] = (0, import_react89.useState)(initialView);
|
|
34981
|
+
const editedDetailsRef = (0, import_react89.useRef)(null);
|
|
34982
|
+
const [authRequest, setAuthRequest] = (0, import_react89.useState)(
|
|
34692
34983
|
null
|
|
34693
34984
|
);
|
|
34694
|
-
const [privacyAttempted, setPrivacyAttempted] = (0,
|
|
34985
|
+
const [privacyAttempted, setPrivacyAttempted] = (0, import_react89.useState)(false);
|
|
34695
34986
|
const openBuiltInAuth = (email) => setAuthRequest((current5) => {
|
|
34696
34987
|
var _a3;
|
|
34697
34988
|
return { email, key: ((_a3 = current5 == null ? void 0 : current5.key) != null ? _a3 : 0) + 1 };
|
|
@@ -34704,7 +34995,7 @@ var Flow = ({
|
|
|
34704
34995
|
orderFixed: checkout.orderFixed
|
|
34705
34996
|
});
|
|
34706
34997
|
const leaveAllowed = canLeavePayment(checkout);
|
|
34707
|
-
(0,
|
|
34998
|
+
(0, import_react89.useEffect)(() => {
|
|
34708
34999
|
if (visibleView === view) return;
|
|
34709
35000
|
if (visibleView === "checkout") setView("checkout");
|
|
34710
35001
|
else {
|
|
@@ -34712,7 +35003,7 @@ var Flow = ({
|
|
|
34712
35003
|
setSelectionView("tickets");
|
|
34713
35004
|
}
|
|
34714
35005
|
}, [view, visibleView]);
|
|
34715
|
-
(0,
|
|
35006
|
+
(0, import_react89.useEffect)(() => {
|
|
34716
35007
|
onViewChange == null ? void 0 : onViewChange(visibleView);
|
|
34717
35008
|
}, [onViewChange, visibleView]);
|
|
34718
35009
|
const enterCheckout = (from) => {
|