tf-checkout-react-native 2.0.0-beta.18 → 2.0.0-beta.19
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 +8 -8
- package/dist/index.d.mts +42 -2
- package/dist/index.d.ts +42 -2
- package/dist/index.js +500 -303
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +377 -180
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/sections/Tickets.tsx +99 -50
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,
|
|
@@ -2965,6 +2968,8 @@ var import_react_query18 = require("@tanstack/react-query");
|
|
|
2965
2968
|
var import_react40 = require("react");
|
|
2966
2969
|
var import_react41 = require("react");
|
|
2967
2970
|
var import_react_query19 = require("@tanstack/react-query");
|
|
2971
|
+
var import_react_query20 = require("@tanstack/react-query");
|
|
2972
|
+
var import_react42 = require("react");
|
|
2968
2973
|
var __defProp2 = Object.defineProperty;
|
|
2969
2974
|
var __export2 = (target, all) => {
|
|
2970
2975
|
for (var name in all)
|
|
@@ -9040,6 +9045,27 @@ var waitingListEntryFrom = (definition, draft) => {
|
|
|
9040
9045
|
quantity
|
|
9041
9046
|
};
|
|
9042
9047
|
};
|
|
9048
|
+
var calendarTicketRows = (base, dated) => {
|
|
9049
|
+
const ids = new Set(dated.map((ticket) => ticket.id));
|
|
9050
|
+
return [
|
|
9051
|
+
...dated,
|
|
9052
|
+
...base.filter((ticket) => ticket.isRegularTicket === true && !ids.has(ticket.id))
|
|
9053
|
+
];
|
|
9054
|
+
};
|
|
9055
|
+
var catalogDate = (selected, dates) => {
|
|
9056
|
+
var _a2;
|
|
9057
|
+
return dates.includes(selected) ? selected : (_a2 = dates[0]) != null ? _a2 : "";
|
|
9058
|
+
};
|
|
9059
|
+
var catalogQuantities = (previous, tickets) => {
|
|
9060
|
+
const next = {};
|
|
9061
|
+
for (const ticket of tickets) {
|
|
9062
|
+
const quantity = previous[ticket.id];
|
|
9063
|
+
const range = ticketQuantityRange(ticket);
|
|
9064
|
+
if (quantity > 0 && !ticket.soldOut && ticket.salesStarted && !ticket.salesEnded && quantity >= range.min && quantity <= range.max && quantity % range.step === 0)
|
|
9065
|
+
next[ticket.id] = quantity;
|
|
9066
|
+
}
|
|
9067
|
+
return Object.keys(previous).length === Object.keys(next).length && Object.keys(next).every((id2) => previous[id2] === next[id2]) ? previous : next;
|
|
9068
|
+
};
|
|
9043
9069
|
var initialSnapshot = () => ({
|
|
9044
9070
|
status: "idle",
|
|
9045
9071
|
selections: [],
|
|
@@ -10477,6 +10503,7 @@ var mapTicket = (t) => {
|
|
|
10477
10503
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
10478
10504
|
return {
|
|
10479
10505
|
id: String(t.id),
|
|
10506
|
+
isRegularTicket: typeof t.isRegularTicket === "boolean" ? t.isRegularTicket : void 0,
|
|
10480
10507
|
name: (_a2 = t.displayName) != null ? _a2 : "",
|
|
10481
10508
|
groupName: (_c = (_b = t.groupName) != null ? _b : t.group_name) != null ? _c : null,
|
|
10482
10509
|
optionName: (_d = t.optionName) != null ? _d : "",
|
|
@@ -10566,7 +10593,8 @@ var getEventInfo = async (eventId, pk) => {
|
|
|
10566
10593
|
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
10567
10594
|
await sdkSeatSessionHeaders(eventId);
|
|
10568
10595
|
const body3 = await get(ENDPOINTS.events.info(eventId), {
|
|
10569
|
-
params: pk ? { pk } : void 0
|
|
10596
|
+
params: pk ? { pk } : void 0,
|
|
10597
|
+
tfCatalogContext: true
|
|
10570
10598
|
});
|
|
10571
10599
|
const attributes6 = (_b = (_a2 = body3 == null ? void 0 : body3.data) == null ? void 0 : _a2.attributes) != null ? _b : {};
|
|
10572
10600
|
const a = attributes6;
|
|
@@ -10805,7 +10833,11 @@ var getEventBundles = async (eventId) => {
|
|
|
10805
10833
|
};
|
|
10806
10834
|
var submitPromoCode = async (eventId, promo) => {
|
|
10807
10835
|
await sdkSeatSessionHeaders(eventId);
|
|
10808
|
-
await post(
|
|
10836
|
+
await post(
|
|
10837
|
+
ENDPOINTS.events.promo(eventId),
|
|
10838
|
+
{ promo: promo.trim() },
|
|
10839
|
+
{ tfCatalogContext: true }
|
|
10840
|
+
);
|
|
10809
10841
|
};
|
|
10810
10842
|
var setEventCurrency = async (eventId, code, options) => {
|
|
10811
10843
|
var _a2;
|
|
@@ -15364,6 +15396,7 @@ __export2(hooks_exports, {
|
|
|
15364
15396
|
useSubmitPrizeDetails: () => useSubmitPrizeDetails,
|
|
15365
15397
|
useTicketCardForm: () => useTicketCardForm,
|
|
15366
15398
|
useTicketCardOwner: () => useTicketCardOwner,
|
|
15399
|
+
useTicketCatalog: () => useTicketCatalog,
|
|
15367
15400
|
useTicketChange: () => useTicketChange,
|
|
15368
15401
|
useTicketChangeOptions: () => useTicketChangeOptions,
|
|
15369
15402
|
useTicketGatewayWait: () => useTicketGatewayWait,
|
|
@@ -16314,7 +16347,7 @@ var useCatalogQuery = (options) => {
|
|
|
16314
16347
|
} : queryFn
|
|
16315
16348
|
});
|
|
16316
16349
|
};
|
|
16317
|
-
var useEvent = (eventId, options) =>
|
|
16350
|
+
var useEvent = (eventId, options) => useCatalogQuery({
|
|
16318
16351
|
queryKey: ttfKeys.event(eventId != null ? eventId : ""),
|
|
16319
16352
|
queryFn: () => ttf.events.info(eventId),
|
|
16320
16353
|
enabled: Boolean(eventId),
|
|
@@ -21926,6 +21959,154 @@ var useAccountEmailEnrichment = (options = {}) => {
|
|
|
21926
21959
|
}
|
|
21927
21960
|
};
|
|
21928
21961
|
};
|
|
21962
|
+
var EMPTY_DATES = [];
|
|
21963
|
+
var EMPTY_TICKETS = [];
|
|
21964
|
+
var useTicketCatalog = (eventId, explicitDates) => {
|
|
21965
|
+
var _a2, _b, _c, _d;
|
|
21966
|
+
const queryClient = (0, import_react_query20.useQueryClient)();
|
|
21967
|
+
const account = (0, import_react42.useSyncExternalStore)(subscribeSession, getSessionCacheScope, () => 0);
|
|
21968
|
+
const revision = (0, import_react42.useSyncExternalStore)(
|
|
21969
|
+
subscribeSession,
|
|
21970
|
+
getCatalogContextRevision,
|
|
21971
|
+
() => 0
|
|
21972
|
+
);
|
|
21973
|
+
const assertOwner = (0, import_react42.useMemo)(captureSessionAction, [account]);
|
|
21974
|
+
const actionSubject = JSON.stringify([eventId, account]);
|
|
21975
|
+
const action = useLiveScope(actionSubject);
|
|
21976
|
+
const subject = JSON.stringify([eventId, account, revision]);
|
|
21977
|
+
const { live, instance: instance2 } = useLiveScope(subject);
|
|
21978
|
+
const current5 = (0, import_react42.useCallback)(() => {
|
|
21979
|
+
try {
|
|
21980
|
+
assertOwner();
|
|
21981
|
+
return revision === getCatalogContextRevision() && instance2 !== null && live.current() === instance2;
|
|
21982
|
+
} catch (e) {
|
|
21983
|
+
return false;
|
|
21984
|
+
}
|
|
21985
|
+
}, [assertOwner, revision, instance2, live]);
|
|
21986
|
+
const capturePrimeContinuation = () => {
|
|
21987
|
+
const pin = getCartPinRevision();
|
|
21988
|
+
return () => {
|
|
21989
|
+
try {
|
|
21990
|
+
assertOwner();
|
|
21991
|
+
if (action.instance === null || action.live.current() !== action.instance)
|
|
21992
|
+
return false;
|
|
21993
|
+
if (current5()) return true;
|
|
21994
|
+
return getCartPinRevision() > pin && getCartGuestToken() !== null && getEffectiveGuestCarrier() === getCartGuestToken();
|
|
21995
|
+
} catch (e) {
|
|
21996
|
+
return false;
|
|
21997
|
+
}
|
|
21998
|
+
};
|
|
21999
|
+
};
|
|
22000
|
+
const [qty, updateQty] = useScopedState(subject, {});
|
|
22001
|
+
const [slotDate, updateDate] = useScopedState(subject, "");
|
|
22002
|
+
const [refreshing, setRefreshing] = useScopedState(subject, false);
|
|
22003
|
+
const eventQuery = useEvent(eventId);
|
|
22004
|
+
const ticketsQuery = useTicketsWithMeta(eventId);
|
|
22005
|
+
const eventInfo = eventQuery.data;
|
|
22006
|
+
const isTimeSlot = Boolean((explicitDates == null ? void 0 : explicitDates.length) || (eventInfo == null ? void 0 : eventInfo.isTimeSlotEvent));
|
|
22007
|
+
const dates = (_a2 = explicitDates != null ? explicitDates : eventInfo == null ? void 0 : eventInfo.availableDates) != null ? _a2 : EMPTY_DATES;
|
|
22008
|
+
const slotQuery = useTimeSlotTickets(eventId, isTimeSlot ? slotDate : void 0);
|
|
22009
|
+
const { tickets, datedTickets, regularTickets } = (0, import_react42.useMemo)(() => {
|
|
22010
|
+
var _a3, _b2, _c2;
|
|
22011
|
+
if (!eventInfo && explicitDates === void 0)
|
|
22012
|
+
return {
|
|
22013
|
+
tickets: EMPTY_TICKETS,
|
|
22014
|
+
datedTickets: EMPTY_TICKETS,
|
|
22015
|
+
regularTickets: EMPTY_TICKETS
|
|
22016
|
+
};
|
|
22017
|
+
const base = (_b2 = (_a3 = ticketsQuery.data) == null ? void 0 : _a3.tickets) != null ? _b2 : EMPTY_TICKETS;
|
|
22018
|
+
if (!isTimeSlot)
|
|
22019
|
+
return { tickets: base, datedTickets: EMPTY_TICKETS, regularTickets: EMPTY_TICKETS };
|
|
22020
|
+
const dated = (_c2 = slotQuery.data) != null ? _c2 : EMPTY_TICKETS;
|
|
22021
|
+
const rows2 = calendarTicketRows(base, dated);
|
|
22022
|
+
return {
|
|
22023
|
+
tickets: rows2,
|
|
22024
|
+
datedTickets: dated,
|
|
22025
|
+
regularTickets: rows2.slice(dated.length)
|
|
22026
|
+
};
|
|
22027
|
+
}, [eventInfo, explicitDates, isTimeSlot, (_b = ticketsQuery.data) == null ? void 0 : _b.tickets, slotQuery.data]);
|
|
22028
|
+
(0, import_react42.useEffect)(() => {
|
|
22029
|
+
if (!current5()) return;
|
|
22030
|
+
const next = isTimeSlot ? catalogDate(slotDate, dates) : "";
|
|
22031
|
+
if (next !== slotDate) updateDate(next);
|
|
22032
|
+
updateQty((previous) => catalogQuantities(previous, tickets));
|
|
22033
|
+
}, [current5, isTimeSlot, slotDate, dates, tickets, updateDate, updateQty]);
|
|
22034
|
+
const setQty = (0, import_react42.useCallback)(
|
|
22035
|
+
(update) => {
|
|
22036
|
+
if (current5()) updateQty(update);
|
|
22037
|
+
},
|
|
22038
|
+
[current5, updateQty]
|
|
22039
|
+
);
|
|
22040
|
+
const setSlotDate = (0, import_react42.useCallback)(
|
|
22041
|
+
(date) => {
|
|
22042
|
+
if (current5() && dates.includes(date)) updateDate(date);
|
|
22043
|
+
},
|
|
22044
|
+
[current5, dates, updateDate]
|
|
22045
|
+
);
|
|
22046
|
+
const { refetch: refetchInfo } = eventQuery;
|
|
22047
|
+
const { refetch: refetchTickets } = ticketsQuery;
|
|
22048
|
+
const refetchCatalog = (0, import_react42.useCallback)(async () => {
|
|
22049
|
+
if (!current5()) return;
|
|
22050
|
+
setRefreshing(true);
|
|
22051
|
+
try {
|
|
22052
|
+
await Promise.all([
|
|
22053
|
+
refetchInfo({ throwOnError: true }),
|
|
22054
|
+
refetchTickets({ throwOnError: true })
|
|
22055
|
+
]);
|
|
22056
|
+
if (!current5()) return;
|
|
22057
|
+
await queryClient.invalidateQueries(
|
|
22058
|
+
{
|
|
22059
|
+
predicate: (query) => {
|
|
22060
|
+
const key5 = query.queryKey;
|
|
22061
|
+
const prefix = [...ttfKeys.tickets(eventId), "slots"];
|
|
22062
|
+
return prefix.every((part, index) => key5[index] === part) && key5.some(
|
|
22063
|
+
(part) => !!part && typeof part === "object" && part.tfCatalogContext === revision
|
|
22064
|
+
) && key5.some(
|
|
22065
|
+
(part) => !!part && typeof part === "object" && part.tfSessionScope === account
|
|
22066
|
+
);
|
|
22067
|
+
},
|
|
22068
|
+
refetchType: "active"
|
|
22069
|
+
},
|
|
22070
|
+
{ throwOnError: true }
|
|
22071
|
+
);
|
|
22072
|
+
if (!current5()) return;
|
|
22073
|
+
} finally {
|
|
22074
|
+
if (current5()) setRefreshing(false);
|
|
22075
|
+
}
|
|
22076
|
+
}, [
|
|
22077
|
+
current5,
|
|
22078
|
+
refetchInfo,
|
|
22079
|
+
refetchTickets,
|
|
22080
|
+
setRefreshing,
|
|
22081
|
+
queryClient,
|
|
22082
|
+
eventId,
|
|
22083
|
+
revision,
|
|
22084
|
+
account
|
|
22085
|
+
]);
|
|
22086
|
+
return {
|
|
22087
|
+
scope: subject,
|
|
22088
|
+
capturePrimeContinuation,
|
|
22089
|
+
attributionReady: !!eventInfo && !!ticketsQuery.data && !eventQuery.isFetching && !ticketsQuery.isFetching,
|
|
22090
|
+
ticketsQuery,
|
|
22091
|
+
eventInfo,
|
|
22092
|
+
slotQuery,
|
|
22093
|
+
tickets,
|
|
22094
|
+
datedTickets,
|
|
22095
|
+
regularTickets,
|
|
22096
|
+
dates,
|
|
22097
|
+
slotDate,
|
|
22098
|
+
isTimeSlot,
|
|
22099
|
+
setSlotDate,
|
|
22100
|
+
qty,
|
|
22101
|
+
setQty,
|
|
22102
|
+
current: current5,
|
|
22103
|
+
instance: instance2,
|
|
22104
|
+
refetchCatalog,
|
|
22105
|
+
busy: refreshing || eventQuery.isFetching || ticketsQuery.isFetching || isTimeSlot && !!slotDate && slotQuery.isFetching,
|
|
22106
|
+
isLoading: eventQuery.isLoading || ticketsQuery.isLoading || isTimeSlot && !!slotDate && slotQuery.isLoading,
|
|
22107
|
+
error: (_d = (_c = eventQuery.error) != null ? _c : ticketsQuery.error) != null ? _d : isTimeSlot ? slotQuery.error : null
|
|
22108
|
+
};
|
|
22109
|
+
};
|
|
21929
22110
|
var accountEn = {
|
|
21930
22111
|
"account.add_an_email_address": "Add an email address",
|
|
21931
22112
|
"account.email_address": "Email address",
|
|
@@ -24311,30 +24492,30 @@ var translateAccountMessage = (translate2, english, vars) => {
|
|
|
24311
24492
|
};
|
|
24312
24493
|
|
|
24313
24494
|
// src/useCheckout.ts
|
|
24314
|
-
var
|
|
24495
|
+
var import_react49 = require("react");
|
|
24315
24496
|
|
|
24316
24497
|
// src/CardInput.tsx
|
|
24317
|
-
var
|
|
24498
|
+
var import_react48 = require("react");
|
|
24318
24499
|
var import_react_native4 = require("react-native");
|
|
24319
24500
|
var import_stripe_react_native = require("@stripe/stripe-react-native");
|
|
24320
24501
|
|
|
24321
24502
|
// src/ui/CheckoutProvider.tsx
|
|
24322
|
-
var
|
|
24323
|
-
var
|
|
24503
|
+
var import_react47 = require("react");
|
|
24504
|
+
var import_react_query21 = require("@tanstack/react-query");
|
|
24324
24505
|
|
|
24325
24506
|
// src/ui/InstallmentPicker.tsx
|
|
24326
|
-
var
|
|
24507
|
+
var import_react45 = require("react");
|
|
24327
24508
|
var import_react_native2 = require("react-native");
|
|
24328
24509
|
|
|
24329
24510
|
// src/ui/primitives.tsx
|
|
24330
|
-
var
|
|
24511
|
+
var import_react44 = require("react");
|
|
24331
24512
|
var import_react_native = require("react-native");
|
|
24332
24513
|
|
|
24333
24514
|
// src/ui/Frozen.tsx
|
|
24334
|
-
var
|
|
24515
|
+
var import_react43 = require("react");
|
|
24335
24516
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24336
|
-
var FrozenContext = (0,
|
|
24337
|
-
var useFrozen = () => (0,
|
|
24517
|
+
var FrozenContext = (0, import_react43.createContext)(false);
|
|
24518
|
+
var useFrozen = () => (0, import_react43.useContext)(FrozenContext);
|
|
24338
24519
|
var FrozenFields = ({
|
|
24339
24520
|
frozen = false,
|
|
24340
24521
|
children
|
|
@@ -24440,7 +24621,7 @@ var Button = ({
|
|
|
24440
24621
|
}
|
|
24441
24622
|
);
|
|
24442
24623
|
};
|
|
24443
|
-
var useStyles = (theme) => (0,
|
|
24624
|
+
var useStyles = (theme) => (0, import_react44.useMemo)(
|
|
24444
24625
|
() => import_react_native.StyleSheet.create({
|
|
24445
24626
|
card: {
|
|
24446
24627
|
backgroundColor: theme.surface,
|
|
@@ -24507,9 +24688,9 @@ var useStyles = (theme) => (0, import_react43.useMemo)(
|
|
|
24507
24688
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
24508
24689
|
var useInstallmentPicker = () => {
|
|
24509
24690
|
var _a2;
|
|
24510
|
-
const [pending3, setPending] = (0,
|
|
24511
|
-
const [choices] = (0,
|
|
24512
|
-
(0,
|
|
24691
|
+
const [pending3, setPending] = (0, import_react45.useState)(null);
|
|
24692
|
+
const [choices] = (0, import_react45.useState)(() => createInstallmentChoices(setPending));
|
|
24693
|
+
(0, import_react45.useEffect)(() => () => choices.cancel(), [choices]);
|
|
24513
24694
|
const onInstallmentOffers = choices.ask;
|
|
24514
24695
|
const choose = (offer) => pending3 == null ? void 0 : pending3.choose(offer);
|
|
24515
24696
|
const picker = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
@@ -24564,7 +24745,7 @@ var InstallmentModal = ({ offers, onChoose, onClose }) => {
|
|
|
24564
24745
|
}
|
|
24565
24746
|
);
|
|
24566
24747
|
};
|
|
24567
|
-
var useStyles2 = (theme) => (0,
|
|
24748
|
+
var useStyles2 = (theme) => (0, import_react45.useMemo)(
|
|
24568
24749
|
() => import_react_native2.StyleSheet.create({
|
|
24569
24750
|
backdrop: {
|
|
24570
24751
|
flex: 1,
|
|
@@ -24615,7 +24796,7 @@ var useStyles2 = (theme) => (0, import_react44.useMemo)(
|
|
|
24615
24796
|
);
|
|
24616
24797
|
|
|
24617
24798
|
// src/ui/ProviderPages.tsx
|
|
24618
|
-
var
|
|
24799
|
+
var import_react46 = require("react");
|
|
24619
24800
|
var import_react_native3 = require("react-native");
|
|
24620
24801
|
var import_react_native_webview = require("react-native-webview");
|
|
24621
24802
|
|
|
@@ -24688,10 +24869,10 @@ var externalInitialUri = (uri) => {
|
|
|
24688
24869
|
);
|
|
24689
24870
|
};
|
|
24690
24871
|
var useProviderPages = () => {
|
|
24691
|
-
const [pending3, setPending] = (0,
|
|
24692
|
-
const [pages] = (0,
|
|
24693
|
-
(0,
|
|
24694
|
-
(0,
|
|
24872
|
+
const [pending3, setPending] = (0, import_react46.useState)(null);
|
|
24873
|
+
const [pages] = (0, import_react46.useState)(() => createProviderPages(setPending));
|
|
24874
|
+
(0, import_react46.useEffect)(() => () => pages.cancel(), [pages]);
|
|
24875
|
+
(0, import_react46.useEffect)(() => {
|
|
24695
24876
|
if (!pending3) return;
|
|
24696
24877
|
const subscription = import_react_native3.Linking.addEventListener("url", ({ url: url2 }) => {
|
|
24697
24878
|
if (providerPageMatchesReturn(url2, pending3.request.returnUrlPrefix))
|
|
@@ -24713,10 +24894,10 @@ var ProviderPage = ({
|
|
|
24713
24894
|
const backdrop = resolveTheme({ colorScheme: theme.colorScheme }).background;
|
|
24714
24895
|
const externalUri = pending3.request.uri && externalInitialUri(pending3.request.uri) ? pending3.request.uri : null;
|
|
24715
24896
|
const sourceError = pending3.request.uri && !secureInitialUri(pending3.request.uri) && !externalUri ? "This payment page could not be opened securely." : "";
|
|
24716
|
-
const [error, setError] = (0,
|
|
24897
|
+
const [error, setError] = (0, import_react46.useState)("");
|
|
24717
24898
|
const displayedError = sourceError || error;
|
|
24718
|
-
const [reload, setReload] = (0,
|
|
24719
|
-
(0,
|
|
24899
|
+
const [reload, setReload] = (0, import_react46.useState)(0);
|
|
24900
|
+
(0, import_react46.useEffect)(() => {
|
|
24720
24901
|
if (!externalUri) return;
|
|
24721
24902
|
let active2 = true;
|
|
24722
24903
|
void import_react_native3.Linking.openURL(externalUri).catch(() => {
|
|
@@ -24817,14 +24998,14 @@ var styles = import_react_native3.StyleSheet.create({
|
|
|
24817
24998
|
|
|
24818
24999
|
// src/ui/CheckoutProvider.tsx
|
|
24819
25000
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
24820
|
-
var CheckoutCtx = (0,
|
|
24821
|
-
var ThemeCtx = (0,
|
|
24822
|
-
var ImagePickerCtx = (0,
|
|
24823
|
-
var ValidationCtx = (0,
|
|
25001
|
+
var CheckoutCtx = (0, import_react47.createContext)(null);
|
|
25002
|
+
var ThemeCtx = (0, import_react47.createContext)(resolveTheme());
|
|
25003
|
+
var ImagePickerCtx = (0, import_react47.createContext)(void 0);
|
|
25004
|
+
var ValidationCtx = (0, import_react47.createContext)(null);
|
|
24824
25005
|
var sharedQueryClient = null;
|
|
24825
25006
|
var getQueryClient = () => {
|
|
24826
25007
|
if (!sharedQueryClient) {
|
|
24827
|
-
sharedQueryClient = new
|
|
25008
|
+
sharedQueryClient = new import_react_query21.QueryClient({
|
|
24828
25009
|
defaultOptions: { queries: { retry: 1, staleTime: 6e4 } }
|
|
24829
25010
|
});
|
|
24830
25011
|
}
|
|
@@ -24834,18 +25015,18 @@ var CheckoutThemeProvider = ({
|
|
|
24834
25015
|
theme,
|
|
24835
25016
|
children
|
|
24836
25017
|
}) => {
|
|
24837
|
-
const resolved = (0,
|
|
25018
|
+
const resolved = (0, import_react47.useMemo)(() => resolveTheme(theme), [theme]);
|
|
24838
25019
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThemeCtx.Provider, { value: resolved, children });
|
|
24839
25020
|
};
|
|
24840
25021
|
var CheckoutRoot = ({ checkout, theme, pickImage, children }) => {
|
|
24841
|
-
const inheritedPicker = (0,
|
|
24842
|
-
const [attempt2, setAttempt] = (0,
|
|
24843
|
-
const requestValidation = (0,
|
|
24844
|
-
const validation = (0,
|
|
25022
|
+
const inheritedPicker = (0, import_react47.useContext)(ImagePickerCtx);
|
|
25023
|
+
const [attempt2, setAttempt] = (0, import_react47.useState)(0);
|
|
25024
|
+
const requestValidation = (0, import_react47.useCallback)(() => setAttempt((n) => n + 1), []);
|
|
25025
|
+
const validation = (0, import_react47.useMemo)(
|
|
24845
25026
|
() => ({ attempt: attempt2, requestValidation }),
|
|
24846
25027
|
[attempt2, requestValidation]
|
|
24847
25028
|
);
|
|
24848
|
-
const resolved = (0,
|
|
25029
|
+
const resolved = (0, import_react47.useMemo)(() => resolveTheme(theme), [theme]);
|
|
24849
25030
|
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
25031
|
};
|
|
24851
25032
|
var SelfProvidedCheckout = ({
|
|
@@ -24876,20 +25057,20 @@ var CheckoutProvider = ({
|
|
|
24876
25057
|
return (
|
|
24877
25058
|
// `value` present ⇒ don't call `useCheckout()` (no second binding); absent ⇒
|
|
24878
25059
|
// the self-providing branch owns it. The choice is static per mount.
|
|
24879
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
25060
|
+
/* @__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
25061
|
);
|
|
24881
25062
|
};
|
|
24882
25063
|
var useCheckoutContext = () => {
|
|
24883
|
-
const ctx = (0,
|
|
25064
|
+
const ctx = (0, import_react47.useContext)(CheckoutCtx);
|
|
24884
25065
|
if (!ctx) {
|
|
24885
25066
|
throw new Error("useCheckoutContext must be used within <CheckoutProvider>.");
|
|
24886
25067
|
}
|
|
24887
25068
|
return ctx;
|
|
24888
25069
|
};
|
|
24889
|
-
var useTheme = () => (0,
|
|
24890
|
-
var useCheckoutImagePicker = () => (0,
|
|
25070
|
+
var useTheme = () => (0, import_react47.useContext)(ThemeCtx);
|
|
25071
|
+
var useCheckoutImagePicker = () => (0, import_react47.useContext)(ImagePickerCtx);
|
|
24891
25072
|
var useCheckoutValidation = () => {
|
|
24892
|
-
const ctx = (0,
|
|
25073
|
+
const ctx = (0, import_react47.useContext)(ValidationCtx);
|
|
24893
25074
|
if (!ctx) {
|
|
24894
25075
|
throw new Error("useCheckoutValidation must be used within <CheckoutProvider>.");
|
|
24895
25076
|
}
|
|
@@ -24913,11 +25094,11 @@ var CardInput = ({
|
|
|
24913
25094
|
visible = true
|
|
24914
25095
|
}) => {
|
|
24915
25096
|
const theme = useTheme();
|
|
24916
|
-
const [attachment, setAttachment] = (0,
|
|
24917
|
-
const handleRef = (0,
|
|
24918
|
-
const visibleRef = (0,
|
|
25097
|
+
const [attachment, setAttachment] = (0, import_react48.useState)(0);
|
|
25098
|
+
const handleRef = (0, import_react48.useRef)(null);
|
|
25099
|
+
const visibleRef = (0, import_react48.useRef)(visible);
|
|
24919
25100
|
visibleRef.current = visible;
|
|
24920
|
-
(0,
|
|
25101
|
+
(0, import_react48.useEffect)(() => {
|
|
24921
25102
|
const handle = cardFields.mount(
|
|
24922
25103
|
owner,
|
|
24923
25104
|
() => setAttachment((n) => n + 1),
|
|
@@ -24929,7 +25110,7 @@ var CardInput = ({
|
|
|
24929
25110
|
handleRef.current = null;
|
|
24930
25111
|
};
|
|
24931
25112
|
}, [owner]);
|
|
24932
|
-
(0,
|
|
25113
|
+
(0, import_react48.useEffect)(() => {
|
|
24933
25114
|
var _a2;
|
|
24934
25115
|
(_a2 = handleRef.current) == null ? void 0 : _a2.setVisible(visible);
|
|
24935
25116
|
}, [visible]);
|
|
@@ -25492,14 +25673,14 @@ var rnPorts = createRnPorts();
|
|
|
25492
25673
|
// src/useCheckout.ts
|
|
25493
25674
|
var useCheckout2 = (opts = {}) => {
|
|
25494
25675
|
var _a2;
|
|
25495
|
-
const [sheetConfig] = (0,
|
|
25676
|
+
const [sheetConfig] = (0, import_react49.useState)(
|
|
25496
25677
|
() => opts.paymentSheet ? { ...opts.paymentSheet } : void 0
|
|
25497
25678
|
);
|
|
25498
|
-
const [sheetScheme] = (0,
|
|
25679
|
+
const [sheetScheme] = (0, import_react49.useState)(() => {
|
|
25499
25680
|
var _a3;
|
|
25500
25681
|
return (_a3 = opts.options) == null ? void 0 : _a3.urlScheme;
|
|
25501
25682
|
});
|
|
25502
|
-
const [sheet] = (0,
|
|
25683
|
+
const [sheet] = (0, import_react49.useState)(
|
|
25503
25684
|
() => sheetConfig ? rnConfirmer.createPaymentSheetSession(sheetConfig) : void 0
|
|
25504
25685
|
);
|
|
25505
25686
|
const nativePorts = { ...rnPorts, ...opts.ports };
|
|
@@ -25581,7 +25762,7 @@ var configureCheckout = (config) => configure({
|
|
|
25581
25762
|
});
|
|
25582
25763
|
|
|
25583
25764
|
// src/ui/Field.tsx
|
|
25584
|
-
var
|
|
25765
|
+
var import_react50 = require("react");
|
|
25585
25766
|
var import_react_native6 = require("react-native");
|
|
25586
25767
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
25587
25768
|
var Field = ({ label, error, required, children }) => {
|
|
@@ -25612,7 +25793,7 @@ var Input = ({
|
|
|
25612
25793
|
const editable = editableProp && !frozen;
|
|
25613
25794
|
const theme = useTheme();
|
|
25614
25795
|
const s9 = useFieldStyles(theme);
|
|
25615
|
-
const [focused, setFocused] = (0,
|
|
25796
|
+
const [focused, setFocused] = (0, import_react50.useState)(false);
|
|
25616
25797
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
25617
25798
|
import_react_native6.TextInput,
|
|
25618
25799
|
{
|
|
@@ -25669,7 +25850,7 @@ var Checkbox = ({ checked, onChange, label, invalid: invalid3 = false }) => {
|
|
|
25669
25850
|
}
|
|
25670
25851
|
);
|
|
25671
25852
|
};
|
|
25672
|
-
var useFieldStyles = (theme) => (0,
|
|
25853
|
+
var useFieldStyles = (theme) => (0, import_react50.useMemo)(
|
|
25673
25854
|
() => import_react_native6.StyleSheet.create({
|
|
25674
25855
|
field: { gap: 6 },
|
|
25675
25856
|
label: {
|
|
@@ -25719,7 +25900,7 @@ var useFieldStyles = (theme) => (0, import_react49.useMemo)(
|
|
|
25719
25900
|
);
|
|
25720
25901
|
|
|
25721
25902
|
// src/ui/Select.tsx
|
|
25722
|
-
var
|
|
25903
|
+
var import_react51 = require("react");
|
|
25723
25904
|
var import_react_native7 = require("react-native");
|
|
25724
25905
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
25725
25906
|
function Select({
|
|
@@ -25734,16 +25915,16 @@ function Select({
|
|
|
25734
25915
|
const disabled = disabledProp || frozen;
|
|
25735
25916
|
const theme = useTheme();
|
|
25736
25917
|
const s9 = useSelectStyles(theme);
|
|
25737
|
-
const [open, setOpen] = (0,
|
|
25738
|
-
const interaction = (0,
|
|
25918
|
+
const [open, setOpen] = (0, import_react51.useState)(false);
|
|
25919
|
+
const interaction = (0, import_react51.useRef)({ disabled, open: false, revision: 0 });
|
|
25739
25920
|
interaction.current.disabled = disabled;
|
|
25740
25921
|
const revision = interaction.current.revision;
|
|
25741
|
-
const close = (0,
|
|
25922
|
+
const close = (0, import_react51.useCallback)(() => {
|
|
25742
25923
|
interaction.current.open = false;
|
|
25743
25924
|
interaction.current.revision += 1;
|
|
25744
25925
|
setOpen(false);
|
|
25745
25926
|
}, []);
|
|
25746
|
-
(0,
|
|
25927
|
+
(0, import_react51.useEffect)(() => {
|
|
25747
25928
|
if (disabled && interaction.current.open) close();
|
|
25748
25929
|
}, [disabled, close]);
|
|
25749
25930
|
const selected = options.find((o) => o.value === value6);
|
|
@@ -25808,7 +25989,7 @@ function Select({
|
|
|
25808
25989
|
)
|
|
25809
25990
|
] });
|
|
25810
25991
|
}
|
|
25811
|
-
var useSelectStyles = (theme) => (0,
|
|
25992
|
+
var useSelectStyles = (theme) => (0, import_react51.useMemo)(
|
|
25812
25993
|
() => import_react_native7.StyleSheet.create({
|
|
25813
25994
|
control: {
|
|
25814
25995
|
flexDirection: "row",
|
|
@@ -25869,7 +26050,7 @@ var useSelectStyles = (theme) => (0, import_react50.useMemo)(
|
|
|
25869
26050
|
);
|
|
25870
26051
|
|
|
25871
26052
|
// src/ui/QuantitySelect.tsx
|
|
25872
|
-
var
|
|
26053
|
+
var import_react52 = require("react");
|
|
25873
26054
|
var import_react_native8 = require("react-native");
|
|
25874
26055
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
25875
26056
|
var QuantitySelect = ({
|
|
@@ -25940,7 +26121,7 @@ var QuantitySelect = ({
|
|
|
25940
26121
|
}
|
|
25941
26122
|
);
|
|
25942
26123
|
};
|
|
25943
|
-
var useQuantityStyles = (theme) => (0,
|
|
26124
|
+
var useQuantityStyles = (theme) => (0, import_react52.useMemo)(
|
|
25944
26125
|
() => import_react_native8.StyleSheet.create({
|
|
25945
26126
|
stepper: { flexDirection: "row", alignItems: "center", gap: 14 },
|
|
25946
26127
|
btn: {
|
|
@@ -25968,7 +26149,7 @@ var useQuantityStyles = (theme) => (0, import_react51.useMemo)(
|
|
|
25968
26149
|
);
|
|
25969
26150
|
|
|
25970
26151
|
// src/ui/Timer.tsx
|
|
25971
|
-
var
|
|
26152
|
+
var import_react53 = require("react");
|
|
25972
26153
|
var import_react_native9 = require("react-native");
|
|
25973
26154
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
25974
26155
|
var clock = (s9) => {
|
|
@@ -25987,7 +26168,7 @@ var Timer = ({ seconds: seconds2, urgentAt = 60, label }) => {
|
|
|
25987
26168
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_native9.Text, { style: [s9.clock, urgent && s9.clockUrgent], children: clock(seconds2) })
|
|
25988
26169
|
] });
|
|
25989
26170
|
};
|
|
25990
|
-
var useTimerStyles = (theme) => (0,
|
|
26171
|
+
var useTimerStyles = (theme) => (0, import_react53.useMemo)(
|
|
25991
26172
|
() => import_react_native9.StyleSheet.create({
|
|
25992
26173
|
row: { flexDirection: "row", alignItems: "center", gap: 6 },
|
|
25993
26174
|
label: {
|
|
@@ -26008,7 +26189,7 @@ var useTimerStyles = (theme) => (0, import_react52.useMemo)(
|
|
|
26008
26189
|
);
|
|
26009
26190
|
|
|
26010
26191
|
// src/ui/TimerBanner.tsx
|
|
26011
|
-
var
|
|
26192
|
+
var import_react54 = require("react");
|
|
26012
26193
|
var import_react_native10 = require("react-native");
|
|
26013
26194
|
var import_jsx_runtime11 = (
|
|
26014
26195
|
// `accessibilityLiveRegion="polite"` is the RN analogue of the web
|
|
@@ -26027,7 +26208,7 @@ var TimerBanner = ({
|
|
|
26027
26208
|
}) => {
|
|
26028
26209
|
const theme = useTheme();
|
|
26029
26210
|
const s9 = useBannerStyles(theme);
|
|
26030
|
-
const [dismissed, setDismissed] = (0,
|
|
26211
|
+
const [dismissed, setDismissed] = (0, import_react54.useState)(false);
|
|
26031
26212
|
if (seconds2 === void 0 || seconds2 <= 0 || dismissed) return null;
|
|
26032
26213
|
const urgent = seconds2 <= urgentAt;
|
|
26033
26214
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_native10.View, { accessibilityLiveRegion: "polite", style: [s9.banner, urgent && s9.bannerUrgent], children: [
|
|
@@ -26046,7 +26227,7 @@ var TimerBanner = ({
|
|
|
26046
26227
|
)
|
|
26047
26228
|
] });
|
|
26048
26229
|
};
|
|
26049
|
-
var useBannerStyles = (theme) => (0,
|
|
26230
|
+
var useBannerStyles = (theme) => (0, import_react54.useMemo)(
|
|
26050
26231
|
() => import_react_native10.StyleSheet.create({
|
|
26051
26232
|
banner: {
|
|
26052
26233
|
flexDirection: "row",
|
|
@@ -26086,7 +26267,7 @@ var useBannerStyles = (theme) => (0, import_react53.useMemo)(
|
|
|
26086
26267
|
);
|
|
26087
26268
|
|
|
26088
26269
|
// src/ui/PaymentMethods.tsx
|
|
26089
|
-
var
|
|
26270
|
+
var import_react55 = require("react");
|
|
26090
26271
|
var import_react_native11 = require("react-native");
|
|
26091
26272
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
26092
26273
|
var EXTRA_LABEL = {
|
|
@@ -26165,7 +26346,7 @@ var PaymentMethods = ({
|
|
|
26165
26346
|
] }, option.value);
|
|
26166
26347
|
}) });
|
|
26167
26348
|
};
|
|
26168
|
-
var useStyles3 = (theme) => (0,
|
|
26349
|
+
var useStyles3 = (theme) => (0, import_react55.useMemo)(
|
|
26169
26350
|
() => import_react_native11.StyleSheet.create({
|
|
26170
26351
|
list: { gap: 8 },
|
|
26171
26352
|
row: {
|
|
@@ -26209,7 +26390,7 @@ var useStyles3 = (theme) => (0, import_react54.useMemo)(
|
|
|
26209
26390
|
);
|
|
26210
26391
|
|
|
26211
26392
|
// src/ui/RichText.tsx
|
|
26212
|
-
var
|
|
26393
|
+
var import_react56 = require("react");
|
|
26213
26394
|
var import_react_native12 = require("react-native");
|
|
26214
26395
|
var import_react_native_render_html = __toESM(require("react-native-render-html"));
|
|
26215
26396
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
@@ -26255,9 +26436,9 @@ var RichText = ({
|
|
|
26255
26436
|
selectable = false
|
|
26256
26437
|
}) => {
|
|
26257
26438
|
const theme = useTheme();
|
|
26258
|
-
const [width, setWidth] = (0,
|
|
26259
|
-
const source = (0,
|
|
26260
|
-
const baseStyle = (0,
|
|
26439
|
+
const [width, setWidth] = (0, import_react56.useState)(0);
|
|
26440
|
+
const source = (0, import_react56.useMemo)(() => ({ html }), [html]);
|
|
26441
|
+
const baseStyle = (0, import_react56.useMemo)(
|
|
26261
26442
|
() => ({
|
|
26262
26443
|
color: theme.muted,
|
|
26263
26444
|
fontSize: theme.fontSize - 1,
|
|
@@ -26267,13 +26448,13 @@ var RichText = ({
|
|
|
26267
26448
|
}),
|
|
26268
26449
|
[theme.muted, theme.fontSize, theme.fontFamily, textStyle]
|
|
26269
26450
|
);
|
|
26270
|
-
const systemFonts = (0,
|
|
26451
|
+
const systemFonts = (0, import_react56.useMemo)(
|
|
26271
26452
|
() => [
|
|
26272
26453
|
.../* @__PURE__ */ new Set([...import_react_native_render_html.defaultSystemFonts, theme.fontFamily, textStyle == null ? void 0 : textStyle.fontFamily])
|
|
26273
26454
|
].filter((font) => typeof font === "string"),
|
|
26274
26455
|
[theme.fontFamily, textStyle == null ? void 0 : textStyle.fontFamily]
|
|
26275
26456
|
);
|
|
26276
|
-
const tagsStyles = (0,
|
|
26457
|
+
const tagsStyles = (0, import_react56.useMemo)(() => {
|
|
26277
26458
|
var _a2;
|
|
26278
26459
|
const defaults = {
|
|
26279
26460
|
p: { marginTop: 0, marginBottom: 8 },
|
|
@@ -26310,7 +26491,7 @@ var RichText = ({
|
|
|
26310
26491
|
defaults[tag] = { ...defaults[tag], ...style };
|
|
26311
26492
|
return defaults;
|
|
26312
26493
|
}, [theme.accent, theme.fontSize, baseStyle.fontSize, tagOverrides]);
|
|
26313
|
-
const renderersProps = (0,
|
|
26494
|
+
const renderersProps = (0, import_react56.useMemo)(
|
|
26314
26495
|
() => ({
|
|
26315
26496
|
a: {
|
|
26316
26497
|
onPress: (event, href) => {
|
|
@@ -26327,7 +26508,7 @@ var RichText = ({
|
|
|
26327
26508
|
}),
|
|
26328
26509
|
[onLinkPress]
|
|
26329
26510
|
);
|
|
26330
|
-
const defaultTextProps = (0,
|
|
26511
|
+
const defaultTextProps = (0, import_react56.useMemo)(() => ({ selectable }), [selectable]);
|
|
26331
26512
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
26332
26513
|
import_react_native12.View,
|
|
26333
26514
|
{
|
|
@@ -26356,7 +26537,7 @@ var RichText = ({
|
|
|
26356
26537
|
var styles3 = import_react_native12.StyleSheet.create({ container: { alignSelf: "stretch", minWidth: 0 } });
|
|
26357
26538
|
|
|
26358
26539
|
// src/sections/Tickets.tsx
|
|
26359
|
-
var
|
|
26540
|
+
var import_react57 = require("react");
|
|
26360
26541
|
var import_react_native14 = require("react-native");
|
|
26361
26542
|
|
|
26362
26543
|
// src/ui/WaitingListForm.tsx
|
|
@@ -26498,7 +26679,20 @@ var Tickets = ({
|
|
|
26498
26679
|
const checkout = useCheckoutContext();
|
|
26499
26680
|
const theme = useTheme();
|
|
26500
26681
|
const s9 = useTicketStyles(theme);
|
|
26501
|
-
const
|
|
26682
|
+
const catalog = hooks_exports.useTicketCatalog(eventId, timeSlotDates);
|
|
26683
|
+
const {
|
|
26684
|
+
ticketsQuery,
|
|
26685
|
+
eventInfo,
|
|
26686
|
+
slotQuery,
|
|
26687
|
+
isTimeSlot,
|
|
26688
|
+
dates,
|
|
26689
|
+
slotDate,
|
|
26690
|
+
setSlotDate,
|
|
26691
|
+
qty,
|
|
26692
|
+
setQty,
|
|
26693
|
+
refetchCatalog,
|
|
26694
|
+
current: catalogCurrent
|
|
26695
|
+
} = catalog;
|
|
26502
26696
|
const waitingBuyer = hooks_exports.useAuthSession();
|
|
26503
26697
|
const cachedProfile = hooks_exports.useProfile({ enabled: false }).data;
|
|
26504
26698
|
const waitingPrefill = waitingListProfilePrefill(
|
|
@@ -26509,48 +26703,23 @@ var Tickets = ({
|
|
|
26509
26703
|
const bundleWait = hooks_exports.useTicketGatewayWait(checkout.store);
|
|
26510
26704
|
const bundleStarting = bundleWait !== null;
|
|
26511
26705
|
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)(() => {
|
|
26706
|
+
const tickets = catalog.tickets;
|
|
26707
|
+
const [error, updateError] = hooks_exports.useScopedState(catalog.scope, "");
|
|
26708
|
+
const setError = (message2) => {
|
|
26709
|
+
if (catalogCurrent()) updateError(message2);
|
|
26710
|
+
};
|
|
26711
|
+
const [code, setCode] = hooks_exports.useScopedState(catalog.scope, "");
|
|
26712
|
+
const [codeState, setCodeState] = hooks_exports.useScopedState(
|
|
26713
|
+
catalog.scope,
|
|
26714
|
+
"idle"
|
|
26715
|
+
);
|
|
26716
|
+
const [promoOpen, setPromoOpen] = hooks_exports.useScopedState(catalog.scope, false);
|
|
26717
|
+
const [visibleDescription, setVisibleDescription] = (0, import_react57.useState)(null);
|
|
26718
|
+
const attributionEvent = (0, import_react57.useRef)(null);
|
|
26719
|
+
(0, import_react57.useEffect)(() => {
|
|
26552
26720
|
var _a3;
|
|
26553
|
-
if (attributionEvent.current === eventId)
|
|
26721
|
+
if (!catalogCurrent() || !catalog.attributionReady || attributionEvent.current === eventId)
|
|
26722
|
+
return;
|
|
26554
26723
|
attributionEvent.current = eventId;
|
|
26555
26724
|
const promo = (_a3 = initialPromoCode == null ? void 0 : initialPromoCode.trim()) != null ? _a3 : "";
|
|
26556
26725
|
const referral = referrer;
|
|
@@ -26562,23 +26731,37 @@ var Tickets = ({
|
|
|
26562
26731
|
setPromoOpen(true);
|
|
26563
26732
|
setCodeState("busy");
|
|
26564
26733
|
checkout.applyPromoCode(eventId, promo).catch(() => void 0).finally(() => {
|
|
26565
|
-
|
|
26734
|
+
if (!catalogCurrent()) return;
|
|
26735
|
+
return refetchCatalog().catch((e) => {
|
|
26736
|
+
if (catalogCurrent()) setError(errorMessage(e));
|
|
26737
|
+
}).finally(() => {
|
|
26738
|
+
if (catalogCurrent()) setCodeState("idle");
|
|
26739
|
+
});
|
|
26566
26740
|
});
|
|
26567
26741
|
}
|
|
26568
|
-
}, [
|
|
26569
|
-
|
|
26742
|
+
}, [
|
|
26743
|
+
eventId,
|
|
26744
|
+
initialPromoCode,
|
|
26745
|
+
referrer,
|
|
26746
|
+
readAttributionFromUrl,
|
|
26747
|
+
catalog.instance,
|
|
26748
|
+
catalog.attributionReady
|
|
26749
|
+
]);
|
|
26750
|
+
(0, import_react57.useEffect)(() => {
|
|
26570
26751
|
checkout.syncCurrency(eventId, void 0, { seed: true }).catch(() => void 0);
|
|
26571
26752
|
}, [eventId]);
|
|
26572
26753
|
const changeCurrency = (nextCode) => {
|
|
26573
26754
|
checkout.syncCurrency(eventId, nextCode).then((res) => {
|
|
26574
|
-
if (res.requiresCatalogRefresh) {
|
|
26755
|
+
if (catalogCurrent() && res.requiresCatalogRefresh) {
|
|
26575
26756
|
setQty({});
|
|
26576
|
-
refetchCatalog()
|
|
26757
|
+
refetchCatalog().catch((e) => {
|
|
26758
|
+
if (catalogCurrent()) setError(errorMessage(e));
|
|
26759
|
+
});
|
|
26577
26760
|
}
|
|
26578
26761
|
}).catch(() => void 0);
|
|
26579
26762
|
};
|
|
26580
|
-
const originals = (0,
|
|
26581
|
-
(0,
|
|
26763
|
+
const originals = (0, import_react57.useRef)({});
|
|
26764
|
+
(0, import_react57.useEffect)(() => {
|
|
26582
26765
|
for (const t of tickets)
|
|
26583
26766
|
if (originals.current[t.id] == null) originals.current[t.id] = t.price;
|
|
26584
26767
|
}, [tickets]);
|
|
@@ -26591,7 +26774,7 @@ var Tickets = ({
|
|
|
26591
26774
|
const selectQty = (ticket, value6) => setQty(
|
|
26592
26775
|
(previous) => changeTicketQuantity(previous, tickets, ticket, value6, allowMultiple)
|
|
26593
26776
|
);
|
|
26594
|
-
const isSeated = (
|
|
26777
|
+
const isSeated = (_b = eventInfo == null ? void 0 : eventInfo.isSeatedEvent) != null ? _b : false;
|
|
26595
26778
|
const seatMapRow = (t) => isSeated && !t.allowDirectPurchase;
|
|
26596
26779
|
const hasSeatMapTickets = tickets.some(seatMapRow);
|
|
26597
26780
|
const directPurchasable = tickets.filter((t) => !seatMapRow(t));
|
|
@@ -26599,7 +26782,9 @@ var Tickets = ({
|
|
|
26599
26782
|
const firstTableIndex = tickets.findIndex((t) => t.isTable);
|
|
26600
26783
|
const firstTableId = firstTableIndex > 0 && tickets.slice(0, firstTableIndex).some((t) => !t.isTable) ? tickets[firstTableIndex].id : void 0;
|
|
26601
26784
|
const prime = () => {
|
|
26785
|
+
if (!catalogCurrent() || catalog.busy || codeState === "busy" || catalog.error) return;
|
|
26602
26786
|
setError("");
|
|
26787
|
+
const continuationCurrent = catalog.capturePrimeContinuation();
|
|
26603
26788
|
const selections = selected.map((t) => {
|
|
26604
26789
|
var _a3;
|
|
26605
26790
|
return {
|
|
@@ -26611,22 +26796,31 @@ var Tickets = ({
|
|
|
26611
26796
|
currency: t.currency
|
|
26612
26797
|
};
|
|
26613
26798
|
});
|
|
26614
|
-
checkout.setTickets(eventId, selections).then(() =>
|
|
26799
|
+
checkout.setTickets(eventId, selections).then(() => {
|
|
26800
|
+
if (continuationCurrent()) onContinue == null ? void 0 : onContinue();
|
|
26801
|
+
}).catch(
|
|
26615
26802
|
(e) => setError(
|
|
26616
26803
|
e instanceof ConfirmerBusyError ? createTranslator()(e.message) : errorMessage(e)
|
|
26617
26804
|
)
|
|
26618
26805
|
);
|
|
26619
26806
|
};
|
|
26620
26807
|
const applyCode = () => {
|
|
26621
|
-
if (!code.trim())
|
|
26808
|
+
if (!catalogCurrent() || !catalog.attributionReady || catalog.busy || codeState === "busy" || !code.trim())
|
|
26809
|
+
return;
|
|
26810
|
+
setError("");
|
|
26622
26811
|
setCodeState("busy");
|
|
26623
26812
|
checkout.applyPromoCode(eventId, code.trim()).catch(() => void 0).finally(() => {
|
|
26624
|
-
|
|
26813
|
+
if (!catalogCurrent()) return;
|
|
26814
|
+
return refetchCatalog().catch((e) => {
|
|
26815
|
+
if (catalogCurrent()) setError(errorMessage(e));
|
|
26816
|
+
}).finally(() => {
|
|
26817
|
+
if (catalogCurrent()) setCodeState("idle");
|
|
26818
|
+
});
|
|
26625
26819
|
});
|
|
26626
26820
|
};
|
|
26627
26821
|
const isAccess = promoMeta == null ? void 0 : promoMeta.isAccessCodeEnabled;
|
|
26628
26822
|
const showCodeInput = (promoMeta == null ? void 0 : promoMeta.isPromotionsEnabled) || isAccess;
|
|
26629
|
-
const listQuery =
|
|
26823
|
+
const listQuery = catalog;
|
|
26630
26824
|
const currency = checkout.currency;
|
|
26631
26825
|
const renderRow = (t) => {
|
|
26632
26826
|
var _a3, _b2;
|
|
@@ -26644,7 +26838,7 @@ var Tickets = ({
|
|
|
26644
26838
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Divider, {}),
|
|
26645
26839
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.Text, { style: s9.group, children: "Reserve tables" })
|
|
26646
26840
|
] }) : null;
|
|
26647
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
26841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react57.Fragment, { children: [
|
|
26648
26842
|
groupHeading,
|
|
26649
26843
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.View, { style: renderTicket ? void 0 : s9.rowWrap, children: renderTicket ? renderTicket({
|
|
26650
26844
|
ticket: t,
|
|
@@ -26705,8 +26899,8 @@ var Tickets = ({
|
|
|
26705
26899
|
};
|
|
26706
26900
|
const timeGroups = [];
|
|
26707
26901
|
if (isTimeSlot)
|
|
26708
|
-
for (const t of
|
|
26709
|
-
const time = (
|
|
26902
|
+
for (const t of catalog.datedTickets) {
|
|
26903
|
+
const time = (_d = (_c = t.timeSlot) == null ? void 0 : _c.time) != null ? _d : "";
|
|
26710
26904
|
const g = timeGroups.find((x) => x.time === time);
|
|
26711
26905
|
if (g) g.items.push(t);
|
|
26712
26906
|
else timeGroups.push({ time, items: [t] });
|
|
@@ -26725,7 +26919,6 @@ var Tickets = ({
|
|
|
26725
26919
|
value: slotDate,
|
|
26726
26920
|
onChange: (d) => {
|
|
26727
26921
|
setSlotDate(d);
|
|
26728
|
-
setQty({});
|
|
26729
26922
|
},
|
|
26730
26923
|
options: dates.map((d) => ({ label: d, value: d }))
|
|
26731
26924
|
}
|
|
@@ -26745,11 +26938,15 @@ var Tickets = ({
|
|
|
26745
26938
|
}
|
|
26746
26939
|
)
|
|
26747
26940
|
] }) : null,
|
|
26748
|
-
isTimeSlot && !slotQuery.isLoading &&
|
|
26749
|
-
isTimeSlot ? timeGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
26941
|
+
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,
|
|
26942
|
+
isTimeSlot ? timeGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react57.Fragment, { children: [
|
|
26750
26943
|
g.time ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.Text, { style: s9.slotTime, children: g.time }) : null,
|
|
26751
26944
|
g.items.map(renderRow)
|
|
26752
26945
|
] }, g.time)) : tickets.map(renderRow),
|
|
26946
|
+
isTimeSlot && catalog.regularTickets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
26947
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.Text, { style: s9.slotTime, children: createTranslator()("tickets.getTickets") }),
|
|
26948
|
+
catalog.regularTickets.map(renderRow)
|
|
26949
|
+
] }) : null,
|
|
26753
26950
|
showCodeInput ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_native14.View, { style: s9.promo, children: !isAccess && !promoOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
26754
26951
|
import_react_native14.Pressable,
|
|
26755
26952
|
{
|
|
@@ -26774,7 +26971,7 @@ var Tickets = ({
|
|
|
26774
26971
|
variant: "ghost",
|
|
26775
26972
|
onPress: applyCode,
|
|
26776
26973
|
loading: codeState === "busy",
|
|
26777
|
-
disabled: codeState === "busy" || !code.trim(),
|
|
26974
|
+
disabled: !catalog.attributionReady || catalog.busy || codeState === "busy" || !code.trim(),
|
|
26778
26975
|
children: isAccess ? "ENTER" : "APPLY"
|
|
26779
26976
|
}
|
|
26780
26977
|
),
|
|
@@ -26784,14 +26981,14 @@ var Tickets = ({
|
|
|
26784
26981
|
directPurchasable.length > 0 ? renderContinue ? renderContinue({
|
|
26785
26982
|
onPress: prime,
|
|
26786
26983
|
loading: checkout.isBusy,
|
|
26787
|
-
disabled: checkout.orderFixed || checkout.isBusy || bundleStarting || selected.length === 0,
|
|
26984
|
+
disabled: checkout.orderFixed || checkout.isBusy || bundleStarting || catalog.busy || codeState === "busy" || !!catalog.error || selected.length === 0,
|
|
26788
26985
|
title: continueTitle
|
|
26789
26986
|
}) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
26790
26987
|
Button,
|
|
26791
26988
|
{
|
|
26792
26989
|
onPress: prime,
|
|
26793
26990
|
loading: checkout.isBusy,
|
|
26794
|
-
disabled: checkout.isBusy || bundleStarting || selected.length === 0,
|
|
26991
|
+
disabled: checkout.isBusy || bundleStarting || catalog.busy || codeState === "busy" || !!catalog.error || selected.length === 0,
|
|
26795
26992
|
children: checkout.isBusy ? "Reserving\u2026" : selectionIsTable ? "Reserve tables" : buttonLabel
|
|
26796
26993
|
}
|
|
26797
26994
|
) : null,
|
|
@@ -26816,7 +27013,7 @@ var Tickets = ({
|
|
|
26816
27013
|
error || checkout.error ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ErrorText, { children: error || checkout.error }) : null
|
|
26817
27014
|
] }) });
|
|
26818
27015
|
};
|
|
26819
|
-
var useTicketStyles = (theme) => (0,
|
|
27016
|
+
var useTicketStyles = (theme) => (0, import_react57.useMemo)(
|
|
26820
27017
|
() => import_react_native14.StyleSheet.create({
|
|
26821
27018
|
loading: { paddingVertical: 24, alignItems: "center" },
|
|
26822
27019
|
selectBlock: { gap: 6 },
|
|
@@ -26949,7 +27146,7 @@ var useTicketStyles = (theme) => (0, import_react56.useMemo)(
|
|
|
26949
27146
|
);
|
|
26950
27147
|
|
|
26951
27148
|
// src/sections/SeatsIoMap.tsx
|
|
26952
|
-
var
|
|
27149
|
+
var import_react58 = require("react");
|
|
26953
27150
|
var import_react_native15 = require("react-native");
|
|
26954
27151
|
var import_react_native_webview2 = require("react-native-webview");
|
|
26955
27152
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
@@ -26958,7 +27155,7 @@ var SeatsIoMap = ({ eventId, initial, onContinue }) => {
|
|
|
26958
27155
|
const checkout = useCheckoutContext();
|
|
26959
27156
|
const flow = hooks_exports.useSeatsIoSelection(eventId, checkout, initial, onContinue);
|
|
26960
27157
|
const bundleStarting = hooks_exports.useBundleStarting(checkout.store);
|
|
26961
|
-
const html = (0,
|
|
27158
|
+
const html = (0, import_react58.useMemo)(
|
|
26962
27159
|
() => flow.data.chart ? seatsIoChartDocument(flow.data.chart, flow.nonce) : "",
|
|
26963
27160
|
[flow.data.chart, flow.nonce]
|
|
26964
27161
|
);
|
|
@@ -27044,7 +27241,7 @@ var SeatsIoMap = ({ eventId, initial, onContinue }) => {
|
|
|
27044
27241
|
};
|
|
27045
27242
|
|
|
27046
27243
|
// src/sections/SeatMap.tsx
|
|
27047
|
-
var
|
|
27244
|
+
var import_react59 = require("react");
|
|
27048
27245
|
var import_react_native16 = require("react-native");
|
|
27049
27246
|
var import_react_native_webview3 = require("react-native-webview");
|
|
27050
27247
|
|
|
@@ -27060,9 +27257,9 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
27060
27257
|
const theme = useTheme();
|
|
27061
27258
|
const flow = hooks_exports.useSeatSelection(eventId, checkout, onContinue);
|
|
27062
27259
|
const bundleStarting = hooks_exports.useBundleStarting(checkout.store);
|
|
27063
|
-
const webview = (0,
|
|
27064
|
-
const [rendererError, setRendererError] = (0,
|
|
27065
|
-
const [size, setSize] = (0,
|
|
27260
|
+
const webview = (0, import_react59.useRef)(null);
|
|
27261
|
+
const [rendererError, setRendererError] = (0, import_react59.useState)(false);
|
|
27262
|
+
const [size, setSize] = (0, import_react59.useState)(320);
|
|
27066
27263
|
const properties = flow.chart.state === "ready" ? {
|
|
27067
27264
|
seatData: flow.chart.data.seatData,
|
|
27068
27265
|
statuses: flow.statuses,
|
|
@@ -27078,7 +27275,7 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
27078
27275
|
predefinedSeats: flow.chart.data.predefinedSeats
|
|
27079
27276
|
} : null;
|
|
27080
27277
|
const chart = flow.chart.state === "ready" ? flow.chart.data : null;
|
|
27081
|
-
const html = (0,
|
|
27278
|
+
const html = (0, import_react59.useMemo)(
|
|
27082
27279
|
() => 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
27280
|
[chart]
|
|
27084
27281
|
);
|
|
@@ -27089,7 +27286,7 @@ var SeatMap = ({ eventId, onContinue }) => {
|
|
|
27089
27286
|
`window.__tfSeatMapUpdate&&window.__tfSeatMapUpdate(${safeJson2(properties)});true;`
|
|
27090
27287
|
);
|
|
27091
27288
|
};
|
|
27092
|
-
(0,
|
|
27289
|
+
(0, import_react59.useEffect)(update, [properties && safeJson2(properties)]);
|
|
27093
27290
|
if (flow.chart.state === "provider") return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SeatsIoMap, { eventId, initial: flow.chart.data, onContinue });
|
|
27094
27291
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FrozenFields, { frozen: checkout.orderFixed, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Card, { children: [
|
|
27095
27292
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SectionHeader, { title: "Select your seats" }),
|
|
@@ -27225,7 +27422,7 @@ var styles5 = import_react_native16.StyleSheet.create({
|
|
|
27225
27422
|
});
|
|
27226
27423
|
|
|
27227
27424
|
// src/sections/AddOns.tsx
|
|
27228
|
-
var
|
|
27425
|
+
var import_react60 = require("react");
|
|
27229
27426
|
var import_react_native18 = require("react-native");
|
|
27230
27427
|
|
|
27231
27428
|
// src/ui/CustomFields.tsx
|
|
@@ -27432,7 +27629,7 @@ var AddOns = ({
|
|
|
27432
27629
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native18.Text, { style: s9.subtitle, children: "PLEASE SELECT FROM THE OPTIONAL ADD-ONS BELOW" }),
|
|
27433
27630
|
groups.map((g, gi) => {
|
|
27434
27631
|
var _a3;
|
|
27435
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
27632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react60.Fragment, { children: [
|
|
27436
27633
|
g.heading ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_native18.Text, { style: s9.group, children: g.heading }) : null,
|
|
27437
27634
|
g.items.map((a) => {
|
|
27438
27635
|
var _a4, _b2;
|
|
@@ -27496,7 +27693,7 @@ var AddOns = ({
|
|
|
27496
27693
|
error || checkout.error ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ErrorText, { children: error || checkout.error }) : null
|
|
27497
27694
|
] }) });
|
|
27498
27695
|
};
|
|
27499
|
-
var useAddonStyles = (theme) => (0,
|
|
27696
|
+
var useAddonStyles = (theme) => (0, import_react60.useMemo)(
|
|
27500
27697
|
() => import_react_native18.StyleSheet.create({
|
|
27501
27698
|
head: { flexDirection: "row", alignItems: "center", flexWrap: "wrap", gap: 8 },
|
|
27502
27699
|
eyebrow: {
|
|
@@ -27590,7 +27787,7 @@ var useAddonStyles = (theme) => (0, import_react59.useMemo)(
|
|
|
27590
27787
|
);
|
|
27591
27788
|
|
|
27592
27789
|
// src/sections/Bundles.tsx
|
|
27593
|
-
var
|
|
27790
|
+
var import_react61 = require("react");
|
|
27594
27791
|
var import_react_native19 = require("react-native");
|
|
27595
27792
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
27596
27793
|
var money3 = (currency, amount2) => `${currency} ${amount2.toFixed(2)}`;
|
|
@@ -27840,7 +28037,7 @@ var Bundles = ({
|
|
|
27840
28037
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Button, { onPress: flow.continueToDetails, disabled: !anySelected, children: t("bundles.continue") })
|
|
27841
28038
|
] });
|
|
27842
28039
|
};
|
|
27843
|
-
var useBundleStyles = (theme) => (0,
|
|
28040
|
+
var useBundleStyles = (theme) => (0, import_react61.useMemo)(
|
|
27844
28041
|
() => import_react_native19.StyleSheet.create({
|
|
27845
28042
|
loader: { paddingVertical: 20, alignItems: "center" },
|
|
27846
28043
|
heading: {
|
|
@@ -27893,7 +28090,7 @@ var useBundleStyles = (theme) => (0, import_react60.useMemo)(
|
|
|
27893
28090
|
);
|
|
27894
28091
|
|
|
27895
28092
|
// src/sections/BillingInfo.tsx
|
|
27896
|
-
var
|
|
28093
|
+
var import_react64 = require("react");
|
|
27897
28094
|
var import_react_native24 = require("react-native");
|
|
27898
28095
|
|
|
27899
28096
|
// src/sections/billing/BillingAddressFields.tsx
|
|
@@ -28001,11 +28198,11 @@ var styles6 = import_react_native20.StyleSheet.create({
|
|
|
28001
28198
|
});
|
|
28002
28199
|
|
|
28003
28200
|
// src/sections/billing/PhoneIdentity.tsx
|
|
28004
|
-
var
|
|
28201
|
+
var import_react63 = require("react");
|
|
28005
28202
|
var import_react_native22 = require("react-native");
|
|
28006
28203
|
|
|
28007
28204
|
// src/auth/TwoFactorForm.tsx
|
|
28008
|
-
var
|
|
28205
|
+
var import_react62 = require("react");
|
|
28009
28206
|
var import_react_native21 = require("react-native");
|
|
28010
28207
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
28011
28208
|
var TwoFactorForm = ({
|
|
@@ -28018,7 +28215,7 @@ var TwoFactorForm = ({
|
|
|
28018
28215
|
onSendSms,
|
|
28019
28216
|
onCancel
|
|
28020
28217
|
}) => {
|
|
28021
|
-
const [code, setCode] = (0,
|
|
28218
|
+
const [code, setCode] = (0, import_react62.useState)("");
|
|
28022
28219
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react_native21.View, { style: { gap: 14 }, children: [
|
|
28023
28220
|
/* @__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
28221
|
error ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ErrorText, { children: error }) : null,
|
|
@@ -28070,8 +28267,8 @@ var PhoneIdentity = ({
|
|
|
28070
28267
|
}) => {
|
|
28071
28268
|
var _a2;
|
|
28072
28269
|
const identity = hooks_exports.useCheckoutPhoneIdentity(options);
|
|
28073
|
-
const [code, setCode] = (0,
|
|
28074
|
-
const [emailInstead, setEmailInstead] = (0,
|
|
28270
|
+
const [code, setCode] = (0, import_react63.useState)("");
|
|
28271
|
+
const [emailInstead, setEmailInstead] = (0, import_react63.useState)(false);
|
|
28075
28272
|
if (emailInstead) return null;
|
|
28076
28273
|
if (identity.challenge)
|
|
28077
28274
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
@@ -28386,17 +28583,17 @@ var BillingInfo = ({
|
|
|
28386
28583
|
const profile = hooks_exports.useCheckoutBuyerProfile(eventId);
|
|
28387
28584
|
const event = hooks_exports.useEvent(eventId);
|
|
28388
28585
|
const combined = !onContinue;
|
|
28389
|
-
const [billing, setBilling] = (0,
|
|
28586
|
+
const [billing, setBilling] = (0, import_react64.useState)(
|
|
28390
28587
|
() => billingDraftFrom(checkout.billing)
|
|
28391
28588
|
);
|
|
28392
|
-
const [dataCapture, setDataCapture] = (0,
|
|
28589
|
+
const [dataCapture, setDataCapture] = (0, import_react64.useState)(
|
|
28393
28590
|
(_b = (_a2 = checkout.billing) == null ? void 0 : _a2.dataCapture) != null ? _b : {}
|
|
28394
28591
|
);
|
|
28395
|
-
const [holders, setHolders] = (0,
|
|
28592
|
+
const [holders, setHolders] = (0, import_react64.useState)(
|
|
28396
28593
|
() => holderDraftsFrom(checkout.holders, checkout.backfilledHolderIndexes)
|
|
28397
28594
|
);
|
|
28398
|
-
const [consent, setConsent] = (0,
|
|
28399
|
-
const [dob, setDob] = (0,
|
|
28595
|
+
const [consent, setConsent] = (0, import_react64.useState)({ ttfOptIn: false, brandOptIn: false });
|
|
28596
|
+
const [dob, setDob] = (0, import_react64.useState)(() => billingDobIso(checkout.billing));
|
|
28400
28597
|
hooks_exports.useOnOrderReleased(checkout.orderFixed, () => {
|
|
28401
28598
|
var _a3, _b2;
|
|
28402
28599
|
setBilling(billingDraftFrom(checkout.billing));
|
|
@@ -28407,35 +28604,35 @@ var BillingInfo = ({
|
|
|
28407
28604
|
(prev) => holderDraftsReloaded(prev, checkout.holders, checkout.backfilledHolderIndexes)
|
|
28408
28605
|
);
|
|
28409
28606
|
});
|
|
28410
|
-
const restoredHolders = (0,
|
|
28607
|
+
const restoredHolders = (0, import_react64.useRef)(checkout.holders);
|
|
28411
28608
|
hooks_exports.useOnEventChange(checkout.eventId, () => {
|
|
28412
28609
|
restoredHolders.current = [];
|
|
28413
28610
|
setHolders([]);
|
|
28414
28611
|
setDataCapture({});
|
|
28415
28612
|
});
|
|
28416
|
-
const profileSeeded = (0,
|
|
28417
|
-
const countryDefaultApplied = (0,
|
|
28613
|
+
const profileSeeded = (0, import_react64.useRef)(false);
|
|
28614
|
+
const countryDefaultApplied = (0, import_react64.useRef)(Boolean((_c = checkout.billing) == null ? void 0 : _c.countryId));
|
|
28418
28615
|
const {
|
|
28419
28616
|
setBilling: commitBilling,
|
|
28420
28617
|
setHolders: commitHolders,
|
|
28421
28618
|
setConsent: commitConsent
|
|
28422
28619
|
} = checkout;
|
|
28423
28620
|
const gates = checkout.fieldGates;
|
|
28424
|
-
const orderGroups = (0,
|
|
28621
|
+
const orderGroups = (0, import_react64.useMemo)(
|
|
28425
28622
|
() => checkout.customFields.filter((g) => g.scope === "order"),
|
|
28426
28623
|
[checkout.customFields]
|
|
28427
28624
|
);
|
|
28428
|
-
const ticketGroups = (0,
|
|
28625
|
+
const ticketGroups = (0, import_react64.useMemo)(
|
|
28429
28626
|
() => checkout.customFields.filter((g) => g.scope === "ticket"),
|
|
28430
28627
|
[checkout.customFields]
|
|
28431
28628
|
);
|
|
28432
|
-
const ticketFields = (0,
|
|
28629
|
+
const ticketFields = (0, import_react64.useMemo)(
|
|
28433
28630
|
() => ticketGroups.flatMap((g) => g.fields),
|
|
28434
28631
|
[ticketGroups]
|
|
28435
28632
|
);
|
|
28436
28633
|
const holderNamesRequired = checkout.holderNamesRequired || collectTicketHolders;
|
|
28437
28634
|
const showHolders = holderNamesRequired || ticketFields.length > 0;
|
|
28438
|
-
const slots = (0,
|
|
28635
|
+
const slots = (0, import_react64.useMemo)(() => {
|
|
28439
28636
|
var _a3, _b2;
|
|
28440
28637
|
const out = [];
|
|
28441
28638
|
const lines = (_b2 = (_a3 = checkout.breakdown) == null ? void 0 : _a3.tickets) != null ? _b2 : [];
|
|
@@ -28448,7 +28645,7 @@ var BillingInfo = ({
|
|
|
28448
28645
|
}
|
|
28449
28646
|
return out;
|
|
28450
28647
|
}, [checkout.breakdown, checkout.selections]);
|
|
28451
|
-
(0,
|
|
28648
|
+
(0, import_react64.useEffect)(() => {
|
|
28452
28649
|
const p = profile.data;
|
|
28453
28650
|
if (!p || profileSeeded.current) return;
|
|
28454
28651
|
profileSeeded.current = true;
|
|
@@ -28471,10 +28668,10 @@ var BillingInfo = ({
|
|
|
28471
28668
|
return keys.every((k) => next[k] === prev[k]) ? prev : next;
|
|
28472
28669
|
});
|
|
28473
28670
|
}, [profile.data, checkout.isLoggedIn]);
|
|
28474
|
-
(0,
|
|
28671
|
+
(0, import_react64.useEffect)(() => {
|
|
28475
28672
|
setHolders((prev) => holderDraftsForSlots(prev, slots, restoredHolders.current));
|
|
28476
28673
|
}, [slots]);
|
|
28477
|
-
(0,
|
|
28674
|
+
(0, import_react64.useEffect)(() => {
|
|
28478
28675
|
if (!showHolders) return;
|
|
28479
28676
|
setHolders(
|
|
28480
28677
|
(prev) => holderDraftsMirroringBuyer(prev, {
|
|
@@ -28485,7 +28682,7 @@ var BillingInfo = ({
|
|
|
28485
28682
|
})
|
|
28486
28683
|
);
|
|
28487
28684
|
}, [showHolders, billing.firstName, billing.lastName, billing.email, billing.phone]);
|
|
28488
|
-
(0,
|
|
28685
|
+
(0, import_react64.useEffect)(() => {
|
|
28489
28686
|
const email = billing.email.trim();
|
|
28490
28687
|
if (checkout.isLoggedIn || !isEmail(email)) return;
|
|
28491
28688
|
const t = setTimeout(
|
|
@@ -28499,18 +28696,18 @@ var BillingInfo = ({
|
|
|
28499
28696
|
const countriesQuery = hooks_exports.useCountries({
|
|
28500
28697
|
enabled: needsNationality || gates.showAddress
|
|
28501
28698
|
});
|
|
28502
|
-
const countries = (0,
|
|
28699
|
+
const countries = (0, import_react64.useMemo)(() => {
|
|
28503
28700
|
var _a3;
|
|
28504
28701
|
return (_a3 = countriesQuery.data) != null ? _a3 : [];
|
|
28505
28702
|
}, [countriesQuery.data]);
|
|
28506
28703
|
const statesQuery = hooks_exports.useStates(billing.countryId, {
|
|
28507
28704
|
enabled: Boolean(billing.countryId)
|
|
28508
28705
|
});
|
|
28509
|
-
const states = (0,
|
|
28706
|
+
const states = (0, import_react64.useMemo)(() => {
|
|
28510
28707
|
var _a3;
|
|
28511
28708
|
return (_a3 = statesQuery.data) != null ? _a3 : [];
|
|
28512
28709
|
}, [statesQuery.data]);
|
|
28513
|
-
(0,
|
|
28710
|
+
(0, import_react64.useEffect)(() => {
|
|
28514
28711
|
var _a3, _b2, _c2, _d2;
|
|
28515
28712
|
if (countryDefaultApplied.current || billing.countryId || countries.length === 0 || profile.isLoading || eventId && event.isLoading) {
|
|
28516
28713
|
return;
|
|
@@ -28549,7 +28746,7 @@ var BillingInfo = ({
|
|
|
28549
28746
|
event.isLoading,
|
|
28550
28747
|
(_e = event.data) == null ? void 0 : _e.countryCode
|
|
28551
28748
|
]);
|
|
28552
|
-
(0,
|
|
28749
|
+
(0, import_react64.useEffect)(() => {
|
|
28553
28750
|
var _a3;
|
|
28554
28751
|
if (!billing.countryId) return;
|
|
28555
28752
|
const country = countries.find(
|
|
@@ -28560,7 +28757,7 @@ var BillingInfo = ({
|
|
|
28560
28757
|
setBilling((current5) => ({ ...current5, countryCode }));
|
|
28561
28758
|
}
|
|
28562
28759
|
}, [billing.countryId, billing.countryCode, countries]);
|
|
28563
|
-
(0,
|
|
28760
|
+
(0, import_react64.useEffect)(() => {
|
|
28564
28761
|
if (!billing.stateId) return;
|
|
28565
28762
|
const state = states.find(
|
|
28566
28763
|
(candidate) => String(candidate.id) === String(billing.stateId)
|
|
@@ -28620,7 +28817,7 @@ var BillingInfo = ({
|
|
|
28620
28817
|
});
|
|
28621
28818
|
if (ttfOptInLabel || brandOptInLabel) commitConsent(consent);
|
|
28622
28819
|
};
|
|
28623
|
-
(0,
|
|
28820
|
+
(0, import_react64.useEffect)(() => {
|
|
28624
28821
|
if (combined) commit();
|
|
28625
28822
|
}, [
|
|
28626
28823
|
combined,
|
|
@@ -28817,7 +29014,7 @@ var BillingInfo = ({
|
|
|
28817
29014
|
setBilling
|
|
28818
29015
|
}
|
|
28819
29016
|
) : null,
|
|
28820
|
-
orderGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
29017
|
+
orderGroups.map((g) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_react64.Fragment, { children: [
|
|
28821
29018
|
g.label ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_native24.Text, { style: s9.sectionLabel, children: g.label }) : null,
|
|
28822
29019
|
renderGroupFields(
|
|
28823
29020
|
g,
|
|
@@ -28894,7 +29091,7 @@ var BillingInfo = ({
|
|
|
28894
29091
|
showHolders ? continueButton : null
|
|
28895
29092
|
] });
|
|
28896
29093
|
};
|
|
28897
|
-
var useStyles4 = (theme) => (0,
|
|
29094
|
+
var useStyles4 = (theme) => (0, import_react64.useMemo)(
|
|
28898
29095
|
() => import_react_native24.StyleSheet.create({
|
|
28899
29096
|
loginRow: {
|
|
28900
29097
|
flexDirection: "row",
|
|
@@ -29087,7 +29284,7 @@ var Accommodation = ({ eventId }) => {
|
|
|
29087
29284
|
var styles9 = import_react_native26.StyleSheet.create({ room: { gap: 12, paddingVertical: 12 }, title: { fontSize: 16, fontWeight: "600" } });
|
|
29088
29285
|
|
|
29089
29286
|
// src/sections/Payment.tsx
|
|
29090
|
-
var
|
|
29287
|
+
var import_react65 = require("react");
|
|
29091
29288
|
var import_react_native27 = require("react-native");
|
|
29092
29289
|
var import_stripe_react_native3 = require("@stripe/stripe-react-native");
|
|
29093
29290
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
@@ -29141,14 +29338,14 @@ var Payment = ({
|
|
|
29141
29338
|
const bundleWait = hooks_exports.useTicketGatewayWait(checkout.store);
|
|
29142
29339
|
const bundleStarting = bundleWait !== null;
|
|
29143
29340
|
const validation = useCheckoutValidation();
|
|
29144
|
-
const [error, setError] = (0,
|
|
29341
|
+
const [error, setError] = (0, import_react65.useState)("");
|
|
29145
29342
|
const paymentMethods = hooks_exports.useCheckoutPaymentMethods(checkout.store);
|
|
29146
29343
|
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,
|
|
29344
|
+
const [selected, setSelected] = (0, import_react65.useState)("");
|
|
29345
|
+
const [extras, setExtras] = (0, import_react65.useState)({});
|
|
29346
|
+
const [useSavedCard, setUseSavedCard] = (0, import_react65.useState)(true);
|
|
29347
|
+
const [nativeWalletSupported, setNativeWalletSupported] = (0, import_react65.useState)(false);
|
|
29348
|
+
(0, import_react65.useEffect)(() => {
|
|
29152
29349
|
let mounted = true;
|
|
29153
29350
|
const env = getConfig().env;
|
|
29154
29351
|
(0, import_stripe_react_native3.isPlatformPaySupported)({ googlePay: { testEnv: env === "STAG" || env === "DEV" } }).then((supported) => {
|
|
@@ -29164,7 +29361,7 @@ var Payment = ({
|
|
|
29164
29361
|
const isFree = bd !== void 0 && Number(bd.total) === 0;
|
|
29165
29362
|
const isXendit = checkout.gateway === "xendit";
|
|
29166
29363
|
const offersOxxo = stripeOffersOxxo(checkout.stripeElementsConfig);
|
|
29167
|
-
const options = (0,
|
|
29364
|
+
const options = (0, import_react65.useMemo)(() => {
|
|
29168
29365
|
var _a3, _b2, _c2, _d2, _e2;
|
|
29169
29366
|
if (isFree || !methods) return [];
|
|
29170
29367
|
const out = [];
|
|
@@ -29221,7 +29418,7 @@ var Payment = ({
|
|
|
29221
29418
|
nativeWalletSupported,
|
|
29222
29419
|
offersOxxo
|
|
29223
29420
|
]);
|
|
29224
|
-
(0,
|
|
29421
|
+
(0, import_react65.useEffect)(() => {
|
|
29225
29422
|
if (options.length && !options.some((o) => o.value === selected))
|
|
29226
29423
|
setSelected(options[0].value);
|
|
29227
29424
|
}, [options, selected]);
|
|
@@ -29406,17 +29603,17 @@ var Payment = ({
|
|
|
29406
29603
|
};
|
|
29407
29604
|
|
|
29408
29605
|
// src/sections/WaiverSigning.tsx
|
|
29409
|
-
var
|
|
29606
|
+
var import_react67 = require("react");
|
|
29410
29607
|
var import_react_native29 = require("react-native");
|
|
29411
29608
|
|
|
29412
29609
|
// src/ui/SignaturePad.tsx
|
|
29413
|
-
var
|
|
29610
|
+
var import_react66 = require("react");
|
|
29414
29611
|
var import_react_native28 = require("react-native");
|
|
29415
29612
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
29416
29613
|
var LINE_WIDTH = 2.5;
|
|
29417
29614
|
var PAD_HEIGHT = 160;
|
|
29418
29615
|
var MIN_STEP = 1.5;
|
|
29419
|
-
var StrokeView = (0,
|
|
29616
|
+
var StrokeView = (0, import_react66.memo)(
|
|
29420
29617
|
({ stroke }) => stroke.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
29421
29618
|
import_react_native28.View,
|
|
29422
29619
|
{
|
|
@@ -29456,13 +29653,13 @@ var SignaturePad = ({
|
|
|
29456
29653
|
disabled
|
|
29457
29654
|
}) => {
|
|
29458
29655
|
const theme = useTheme();
|
|
29459
|
-
const strokesRef = (0,
|
|
29460
|
-
const [, setFrame] = (0,
|
|
29461
|
-
const frameRequest = (0,
|
|
29462
|
-
const size = (0,
|
|
29463
|
-
const report = (0,
|
|
29656
|
+
const strokesRef = (0, import_react66.useRef)([]);
|
|
29657
|
+
const [, setFrame] = (0, import_react66.useState)(0);
|
|
29658
|
+
const frameRequest = (0, import_react66.useRef)(null);
|
|
29659
|
+
const size = (0, import_react66.useRef)({ width: 0, height: PAD_HEIGHT });
|
|
29660
|
+
const report = (0, import_react66.useRef)(onChange);
|
|
29464
29661
|
report.current = onChange;
|
|
29465
|
-
const disabledRef = (0,
|
|
29662
|
+
const disabledRef = (0, import_react66.useRef)(disabled);
|
|
29466
29663
|
disabledRef.current = disabled;
|
|
29467
29664
|
const render = () => {
|
|
29468
29665
|
if (frameRequest.current !== null) cancelAnimationFrame(frameRequest.current);
|
|
@@ -29473,7 +29670,7 @@ var SignaturePad = ({
|
|
|
29473
29670
|
if (frameRequest.current !== null) return;
|
|
29474
29671
|
frameRequest.current = requestAnimationFrame(render);
|
|
29475
29672
|
};
|
|
29476
|
-
(0,
|
|
29673
|
+
(0, import_react66.useEffect)(
|
|
29477
29674
|
() => () => {
|
|
29478
29675
|
if (frameRequest.current !== null) cancelAnimationFrame(frameRequest.current);
|
|
29479
29676
|
},
|
|
@@ -29488,7 +29685,7 @@ var SignaturePad = ({
|
|
|
29488
29685
|
});
|
|
29489
29686
|
if (ended) report.current(ended.pngDataUrl, ended.inkLength);
|
|
29490
29687
|
};
|
|
29491
|
-
const responder = (0,
|
|
29688
|
+
const responder = (0, import_react66.useMemo)(
|
|
29492
29689
|
() => import_react_native28.PanResponder.create({
|
|
29493
29690
|
onStartShouldSetPanResponder: () => !disabledRef.current,
|
|
29494
29691
|
onMoveShouldSetPanResponder: () => !disabledRef.current,
|
|
@@ -29600,8 +29797,8 @@ var WaiverSigning = ({
|
|
|
29600
29797
|
checkout.setWaiverSignature,
|
|
29601
29798
|
checkout.holdWaiverSigning
|
|
29602
29799
|
);
|
|
29603
|
-
const [open, setOpen] = (0,
|
|
29604
|
-
const [reloading, setReloading] = (0,
|
|
29800
|
+
const [open, setOpen] = (0, import_react67.useState)({});
|
|
29801
|
+
const [reloading, setReloading] = (0, import_react67.useState)(false);
|
|
29605
29802
|
if ((_a2 = checkout.unavailableDetails) == null ? void 0 : _a2.includes("waiver")) {
|
|
29606
29803
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Card, { children: [
|
|
29607
29804
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SectionHeader, { title: t("waivers.heading") }),
|
|
@@ -29695,17 +29892,17 @@ var TicketForm = ({ ticket, consentText, t, methods, busy, locked = false, error
|
|
|
29695
29892
|
var _a2, _b, _c, _d;
|
|
29696
29893
|
const theme = useTheme();
|
|
29697
29894
|
const s9 = useWaiverStyles(theme);
|
|
29698
|
-
const [heldDraft, setDraft] = (0,
|
|
29895
|
+
const [heldDraft, setDraft] = (0, import_react67.useState)(
|
|
29699
29896
|
() => emptyWaiverDraft(
|
|
29700
29897
|
{ firstName: ticket.holderFirstName, lastName: ticket.holderLastName },
|
|
29701
29898
|
{ signatureMethods: methods }
|
|
29702
29899
|
)
|
|
29703
29900
|
);
|
|
29704
29901
|
const draft = draftWithAllowedMethod(heldDraft, methods);
|
|
29705
|
-
const [problems, setProblems] = (0,
|
|
29706
|
-
const [pressed, setPressed] = (0,
|
|
29902
|
+
const [problems, setProblems] = (0, import_react67.useState)([]);
|
|
29903
|
+
const [pressed, setPressed] = (0, import_react67.useState)(false);
|
|
29707
29904
|
const frozen = busy || locked;
|
|
29708
|
-
const draftRef = (0,
|
|
29905
|
+
const draftRef = (0, import_react67.useRef)(draft);
|
|
29709
29906
|
draftRef.current = draft;
|
|
29710
29907
|
const patch2 = (next) => {
|
|
29711
29908
|
if (!frozen) setDraft((d) => ({ ...d, ...next }));
|
|
@@ -29859,7 +30056,7 @@ var TicketForm = ({ ticket, consentText, t, methods, busy, locked = false, error
|
|
|
29859
30056
|
)
|
|
29860
30057
|
] });
|
|
29861
30058
|
};
|
|
29862
|
-
var useWaiverStyles = (theme) => (0,
|
|
30059
|
+
var useWaiverStyles = (theme) => (0, import_react67.useMemo)(
|
|
29863
30060
|
() => import_react_native29.StyleSheet.create({
|
|
29864
30061
|
muted: {
|
|
29865
30062
|
color: theme.muted,
|
|
@@ -29904,7 +30101,7 @@ var useWaiverStyles = (theme) => (0, import_react66.useMemo)(
|
|
|
29904
30101
|
);
|
|
29905
30102
|
|
|
29906
30103
|
// src/sections/IDVerification.tsx
|
|
29907
|
-
var
|
|
30104
|
+
var import_react68 = require("react");
|
|
29908
30105
|
var import_react_native30 = require("react-native");
|
|
29909
30106
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
29910
30107
|
var MESSAGE = {
|
|
@@ -29919,8 +30116,8 @@ var IDVerification = () => {
|
|
|
29919
30116
|
const checkout = useCheckoutContext();
|
|
29920
30117
|
const theme = useTheme();
|
|
29921
30118
|
const order = checkout.order;
|
|
29922
|
-
const [phase, setPhase] = (0,
|
|
29923
|
-
const [error, setError] = (0,
|
|
30119
|
+
const [phase, setPhase] = (0, import_react68.useState)("idle");
|
|
30120
|
+
const [error, setError] = (0, import_react68.useState)("");
|
|
29924
30121
|
if (!(order == null ? void 0 : order.needIdVerification)) return null;
|
|
29925
30122
|
const done = phase === "verified";
|
|
29926
30123
|
const running = phase === "starting" || phase === "polling";
|
|
@@ -29947,7 +30144,7 @@ var IDVerification = () => {
|
|
|
29947
30144
|
};
|
|
29948
30145
|
|
|
29949
30146
|
// src/sections/Confirmation.tsx
|
|
29950
|
-
var
|
|
30147
|
+
var import_react69 = require("react");
|
|
29951
30148
|
var import_react_native31 = require("react-native");
|
|
29952
30149
|
var import_clipboard = __toESM(require("@react-native-clipboard/clipboard"));
|
|
29953
30150
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
@@ -29961,7 +30158,7 @@ var Confirmation = ({
|
|
|
29961
30158
|
const checkout = useCheckoutContext();
|
|
29962
30159
|
const theme = useTheme();
|
|
29963
30160
|
const order = checkout.order;
|
|
29964
|
-
const [copied, setCopied] = (0,
|
|
30161
|
+
const [copied, setCopied] = (0, import_react69.useState)(false);
|
|
29965
30162
|
if (!order) return null;
|
|
29966
30163
|
const pending3 = order.pending;
|
|
29967
30164
|
const url2 = shareUrl != null ? shareUrl : "";
|
|
@@ -30015,12 +30212,12 @@ var styles11 = import_react_native31.StyleSheet.create({
|
|
|
30015
30212
|
});
|
|
30016
30213
|
|
|
30017
30214
|
// src/sections/Rewards.tsx
|
|
30018
|
-
var
|
|
30215
|
+
var import_react72 = require("react");
|
|
30019
30216
|
var import_react_native34 = require("react-native");
|
|
30020
30217
|
var import_clipboard2 = __toESM(require("@react-native-clipboard/clipboard"));
|
|
30021
30218
|
|
|
30022
30219
|
// src/sections/rewards/RewardsLadder.tsx
|
|
30023
|
-
var
|
|
30220
|
+
var import_react70 = require("react");
|
|
30024
30221
|
var import_react_native32 = require("react-native");
|
|
30025
30222
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
30026
30223
|
var AWARD_STATUS_KEYS = {
|
|
@@ -30030,9 +30227,9 @@ var AWARD_STATUS_KEYS = {
|
|
|
30030
30227
|
cancelled: "rewards.awards.cancelled"
|
|
30031
30228
|
};
|
|
30032
30229
|
var DeliveryDetails = ({ fields, translate: t, onSubmit }) => {
|
|
30033
|
-
const [values2, setValues] = (0,
|
|
30034
|
-
const [saving, setSaving] = (0,
|
|
30035
|
-
const [failure, setFailure] = (0,
|
|
30230
|
+
const [values2, setValues] = (0, import_react70.useState)({});
|
|
30231
|
+
const [saving, setSaving] = (0, import_react70.useState)(false);
|
|
30232
|
+
const [failure, setFailure] = (0, import_react70.useState)("");
|
|
30036
30233
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_native32.View, { style: { gap: 10 }, children: [
|
|
30037
30234
|
fields.map((field) => {
|
|
30038
30235
|
var _a2;
|
|
@@ -30124,7 +30321,7 @@ var styles12 = import_react_native32.StyleSheet.create({
|
|
|
30124
30321
|
});
|
|
30125
30322
|
|
|
30126
30323
|
// src/sections/rewards/RewardsTree.tsx
|
|
30127
|
-
var
|
|
30324
|
+
var import_react71 = require("react");
|
|
30128
30325
|
var import_react_native33 = require("react-native");
|
|
30129
30326
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
30130
30327
|
var MAX_NODES = 120;
|
|
@@ -30132,11 +30329,11 @@ var DOT = 10;
|
|
|
30132
30329
|
var ROOT_DOT = 16;
|
|
30133
30330
|
var RewardsTree = ({ tree, size = 260 }) => {
|
|
30134
30331
|
const theme = useTheme();
|
|
30135
|
-
const nodes = (0,
|
|
30332
|
+
const nodes = (0, import_react71.useMemo)(() => {
|
|
30136
30333
|
var _a2;
|
|
30137
30334
|
return ((_a2 = tree == null ? void 0 : tree.nodes) != null ? _a2 : []).slice(0, MAX_NODES);
|
|
30138
30335
|
}, [tree]);
|
|
30139
|
-
const { layout, edges, rootId } = (0,
|
|
30336
|
+
const { layout, edges, rootId } = (0, import_react71.useMemo)(() => {
|
|
30140
30337
|
const root = treeRootId(nodes);
|
|
30141
30338
|
const computed = computeRadialTreeLayout(nodes, root);
|
|
30142
30339
|
return { layout: computed, edges: radialTreeEdges(nodes, computed), rootId: root };
|
|
@@ -30223,10 +30420,10 @@ var RewardsView = ({
|
|
|
30223
30420
|
var _a2, _b, _c, _d, _e, _f;
|
|
30224
30421
|
const t = translate2 != null ? translate2 : createTranslator({ locale, messages });
|
|
30225
30422
|
const { rewards, failure, busy, hash } = flow;
|
|
30226
|
-
const [packName, setPackName] = (0,
|
|
30227
|
-
const [packCode, setPackCode] = (0,
|
|
30228
|
-
const [copied, setCopied] = (0,
|
|
30229
|
-
(0,
|
|
30423
|
+
const [packName, setPackName] = (0, import_react72.useState)("");
|
|
30424
|
+
const [packCode, setPackCode] = (0, import_react72.useState)("");
|
|
30425
|
+
const [copied, setCopied] = (0, import_react72.useState)(false);
|
|
30426
|
+
(0, import_react72.useEffect)(() => {
|
|
30230
30427
|
setCopied(false);
|
|
30231
30428
|
}, [rewards == null ? void 0 : rewards.share_link]);
|
|
30232
30429
|
if (!rewards)
|
|
@@ -30414,7 +30611,7 @@ var styles14 = import_react_native34.StyleSheet.create({
|
|
|
30414
30611
|
});
|
|
30415
30612
|
|
|
30416
30613
|
// src/sections/TicketChange.tsx
|
|
30417
|
-
var
|
|
30614
|
+
var import_react73 = require("react");
|
|
30418
30615
|
var import_react_native35 = require("react-native");
|
|
30419
30616
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
30420
30617
|
var TicketChange = ({
|
|
@@ -30624,7 +30821,7 @@ var TicketChange = ({
|
|
|
30624
30821
|
flow.notice ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_native35.Text, { style: s9.muted, children: t(flow.notice) }) : null
|
|
30625
30822
|
] });
|
|
30626
30823
|
};
|
|
30627
|
-
var useChangeStyles = (theme) => (0,
|
|
30824
|
+
var useChangeStyles = (theme) => (0, import_react73.useMemo)(
|
|
30628
30825
|
() => import_react_native35.StyleSheet.create({
|
|
30629
30826
|
loader: { paddingVertical: 20, alignItems: "center" },
|
|
30630
30827
|
muted: {
|
|
@@ -30720,17 +30917,17 @@ var Trips = ({
|
|
|
30720
30917
|
};
|
|
30721
30918
|
|
|
30722
30919
|
// src/sections/EventDiscussionView.tsx
|
|
30723
|
-
var
|
|
30920
|
+
var import_react77 = require("react");
|
|
30724
30921
|
var import_react_native39 = require("react-native");
|
|
30725
30922
|
|
|
30726
30923
|
// src/sections/discussion/CommentImages.tsx
|
|
30727
|
-
var
|
|
30924
|
+
var import_react75 = require("react");
|
|
30728
30925
|
var import_react_native37 = require("react-native");
|
|
30729
30926
|
|
|
30730
30927
|
// src/ui/useAccountT.ts
|
|
30731
|
-
var
|
|
30928
|
+
var import_react74 = require("react");
|
|
30732
30929
|
var useAccountT = (locale) => {
|
|
30733
|
-
const translate2 = (0,
|
|
30930
|
+
const translate2 = (0, import_react74.useMemo)(
|
|
30734
30931
|
() => createTranslator({ locale: resolveLocale(locale) }),
|
|
30735
30932
|
[locale]
|
|
30736
30933
|
);
|
|
@@ -30794,8 +30991,8 @@ var CommentImages = ({
|
|
|
30794
30991
|
const t = useAccountT(locale);
|
|
30795
30992
|
const theme = useTheme();
|
|
30796
30993
|
const white = [s.white, { fontFamily: theme.fontFamily }];
|
|
30797
|
-
const [selected, setSelected] = (0,
|
|
30798
|
-
(0,
|
|
30994
|
+
const [selected, setSelected] = (0, import_react75.useState)(null);
|
|
30995
|
+
(0, import_react75.useEffect)(() => {
|
|
30799
30996
|
if (selected === null) return;
|
|
30800
30997
|
onPreviewChange(true);
|
|
30801
30998
|
return () => onPreviewChange(false);
|
|
@@ -31051,7 +31248,7 @@ var s = import_react_native37.StyleSheet.create({
|
|
|
31051
31248
|
});
|
|
31052
31249
|
|
|
31053
31250
|
// src/sections/discussion/SwipeReply.tsx
|
|
31054
|
-
var
|
|
31251
|
+
var import_react76 = require("react");
|
|
31055
31252
|
var import_react_native38 = require("react-native");
|
|
31056
31253
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
31057
31254
|
var SwipeReply = ({
|
|
@@ -31062,8 +31259,8 @@ var SwipeReply = ({
|
|
|
31062
31259
|
children
|
|
31063
31260
|
}) => {
|
|
31064
31261
|
const theme = useTheme();
|
|
31065
|
-
const offset = (0,
|
|
31066
|
-
const gesture = (0,
|
|
31262
|
+
const offset = (0, import_react76.useRef)(new import_react_native38.Animated.Value(0)).current;
|
|
31263
|
+
const gesture = (0, import_react76.useMemo)(() => {
|
|
31067
31264
|
const reset = () => import_react_native38.Animated.spring(offset, { toValue: 0, useNativeDriver: true }).start();
|
|
31068
31265
|
return import_react_native38.PanResponder.create({
|
|
31069
31266
|
onMoveShouldSetPanResponder: (_, value6) => enabled && value6.dx < -12 && Math.abs(value6.dx) > Math.abs(value6.dy) * 1.5,
|
|
@@ -31143,17 +31340,17 @@ var EventDiscussionBody = ({
|
|
|
31143
31340
|
var _a2, _b, _c;
|
|
31144
31341
|
const theme = useTheme();
|
|
31145
31342
|
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,
|
|
31343
|
+
const list2 = (0, import_react77.useRef)(null);
|
|
31344
|
+
const firstContent = (0, import_react77.useRef)(true);
|
|
31345
|
+
const [actions, setActions] = (0, import_react77.useState)(null);
|
|
31346
|
+
const [reporting, setReporting] = (0, import_react77.useState)(null);
|
|
31347
|
+
const [moderating, setModerating] = (0, import_react77.useState)(null);
|
|
31348
|
+
const [reason, setReason] = (0, import_react77.useState)("");
|
|
31349
|
+
const [blocksVisible, setBlocksVisible] = (0, import_react77.useState)(false);
|
|
31350
|
+
const [pickerError, setPickerError] = (0, import_react77.useState)("");
|
|
31351
|
+
const [imageOpen, setImageOpen] = (0, import_react77.useState)(false);
|
|
31352
|
+
const [pickerBusy, setPickerBusy] = (0, import_react77.useState)(false);
|
|
31353
|
+
const picking = (0, import_react77.useRef)(false);
|
|
31157
31354
|
const text6 = { color: theme.text, fontFamily: theme.fontFamily };
|
|
31158
31355
|
const muted = { color: theme.muted, fontFamily: theme.fontFamily };
|
|
31159
31356
|
const closeActions = (work) => {
|
|
@@ -32167,7 +32364,7 @@ var styles15 = import_react_native44.StyleSheet.create({
|
|
|
32167
32364
|
});
|
|
32168
32365
|
|
|
32169
32366
|
// src/sections/Streaming.tsx
|
|
32170
|
-
var
|
|
32367
|
+
var import_react78 = require("react");
|
|
32171
32368
|
var import_react_native45 = require("react-native");
|
|
32172
32369
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
32173
32370
|
var Streaming = (props) => {
|
|
@@ -32189,14 +32386,14 @@ var StreamingView = ({
|
|
|
32189
32386
|
const defaultT = useAccountT(locale);
|
|
32190
32387
|
const t = translate2 != null ? translate2 : defaultT;
|
|
32191
32388
|
const inherited = useTheme();
|
|
32192
|
-
const theme = (0,
|
|
32389
|
+
const theme = (0, import_react78.useMemo)(
|
|
32193
32390
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
32194
32391
|
[inherited, override]
|
|
32195
32392
|
);
|
|
32196
32393
|
const session = hooks_exports.useAuthSession();
|
|
32197
32394
|
const assertOwner = hooks_exports.useSessionAction();
|
|
32198
|
-
const pendingBrowser = (0,
|
|
32199
|
-
const [stored, setStored] = (0,
|
|
32395
|
+
const pendingBrowser = (0, import_react78.useRef)({ scope: session.sessionScope, locked: false });
|
|
32396
|
+
const [stored, setStored] = (0, import_react78.useState)({
|
|
32200
32397
|
scope: session.sessionScope,
|
|
32201
32398
|
busy: false,
|
|
32202
32399
|
error: ""
|
|
@@ -32359,7 +32556,7 @@ var s4 = import_react_native45.StyleSheet.create({
|
|
|
32359
32556
|
});
|
|
32360
32557
|
|
|
32361
32558
|
// src/sections/AccountDeletion.tsx
|
|
32362
|
-
var
|
|
32559
|
+
var import_react79 = require("react");
|
|
32363
32560
|
var import_react_native46 = require("react-native");
|
|
32364
32561
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
32365
32562
|
var AccountDeletion = (props) => {
|
|
@@ -32382,7 +32579,7 @@ var AccountDeletionView = ({
|
|
|
32382
32579
|
const defaultT = useAccountT(locale);
|
|
32383
32580
|
const t = translate2 != null ? translate2 : defaultT;
|
|
32384
32581
|
const inherited = useTheme();
|
|
32385
|
-
const theme = (0,
|
|
32582
|
+
const theme = (0, import_react79.useMemo)(
|
|
32386
32583
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
32387
32584
|
[inherited, override]
|
|
32388
32585
|
);
|
|
@@ -32611,7 +32808,7 @@ var s5 = import_react_native46.StyleSheet.create({
|
|
|
32611
32808
|
});
|
|
32612
32809
|
|
|
32613
32810
|
// src/sections/ProfileSettings.tsx
|
|
32614
|
-
var
|
|
32811
|
+
var import_react80 = require("react");
|
|
32615
32812
|
var import_react_native47 = require("react-native");
|
|
32616
32813
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
32617
32814
|
var ProfileSettings = (props) => {
|
|
@@ -32635,7 +32832,7 @@ var ProfileSettingsView = ({
|
|
|
32635
32832
|
const defaultT = useAccountT(locale);
|
|
32636
32833
|
const t = translate2 != null ? translate2 : defaultT;
|
|
32637
32834
|
const inherited = useTheme();
|
|
32638
|
-
const theme = (0,
|
|
32835
|
+
const theme = (0, import_react80.useMemo)(
|
|
32639
32836
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
32640
32837
|
[inherited, override]
|
|
32641
32838
|
);
|
|
@@ -32647,7 +32844,7 @@ var ProfileSettingsView = ({
|
|
|
32647
32844
|
} catch (e) {
|
|
32648
32845
|
}
|
|
32649
32846
|
};
|
|
32650
|
-
(0,
|
|
32847
|
+
(0, import_react80.useEffect)(() => {
|
|
32651
32848
|
if (flow.settings) flow.open(mode);
|
|
32652
32849
|
}, [mode, flow.scopeKey, Boolean(flow.settings)]);
|
|
32653
32850
|
const text6 = { color: theme.text, fontFamily: theme.fontFamily };
|
|
@@ -33152,7 +33349,7 @@ var AccountPaymentPlanSection = ({
|
|
|
33152
33349
|
};
|
|
33153
33350
|
|
|
33154
33351
|
// src/sections/NotificationPreferences.tsx
|
|
33155
|
-
var
|
|
33352
|
+
var import_react81 = require("react");
|
|
33156
33353
|
var import_react_native50 = require("react-native");
|
|
33157
33354
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
33158
33355
|
var NotificationPreferences = (props) => {
|
|
@@ -33175,7 +33372,7 @@ var NotificationPreferencesView = ({
|
|
|
33175
33372
|
const defaultT = useAccountT(locale);
|
|
33176
33373
|
const t = translate2 != null ? translate2 : defaultT;
|
|
33177
33374
|
const inherited = useTheme();
|
|
33178
|
-
const theme = (0,
|
|
33375
|
+
const theme = (0, import_react81.useMemo)(
|
|
33179
33376
|
() => override ? resolveTheme({ ...inherited, ...override }) : inherited,
|
|
33180
33377
|
[inherited, override]
|
|
33181
33378
|
);
|
|
@@ -33187,7 +33384,7 @@ var NotificationPreferencesView = ({
|
|
|
33187
33384
|
} catch (e) {
|
|
33188
33385
|
}
|
|
33189
33386
|
};
|
|
33190
|
-
(0,
|
|
33387
|
+
(0, import_react81.useEffect)(() => {
|
|
33191
33388
|
var _a3;
|
|
33192
33389
|
if ((_a3 = flow.preferences) == null ? void 0 : _a3.available) flow.begin();
|
|
33193
33390
|
}, [flow.scopeKey, Boolean(flow.preferences), (_a2 = flow.preferences) == null ? void 0 : _a2.available]);
|
|
@@ -33352,15 +33549,15 @@ var s7 = import_react_native50.StyleSheet.create({
|
|
|
33352
33549
|
var import_react_native56 = require("react-native");
|
|
33353
33550
|
|
|
33354
33551
|
// src/auth/LoginForm.tsx
|
|
33355
|
-
var
|
|
33552
|
+
var import_react83 = require("react");
|
|
33356
33553
|
var import_react_native52 = require("react-native");
|
|
33357
33554
|
|
|
33358
33555
|
// src/auth/PasswordInput.tsx
|
|
33359
|
-
var
|
|
33556
|
+
var import_react82 = require("react");
|
|
33360
33557
|
var import_react_native51 = require("react-native");
|
|
33361
33558
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
33362
33559
|
var PasswordInput = (props) => {
|
|
33363
|
-
const [visible, setVisible] = (0,
|
|
33560
|
+
const [visible, setVisible] = (0, import_react82.useState)(false);
|
|
33364
33561
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_react_native51.View, { style: styles16.wrap, children: [
|
|
33365
33562
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Input, { ...props, autoCapitalize: "none", secureTextEntry: !visible }),
|
|
33366
33563
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
@@ -33402,9 +33599,9 @@ var LoginForm = ({
|
|
|
33402
33599
|
onFieldChange
|
|
33403
33600
|
}) => {
|
|
33404
33601
|
const theme = useTheme();
|
|
33405
|
-
const [email, setEmail] = (0,
|
|
33406
|
-
const [password, setPassword] = (0,
|
|
33407
|
-
(0,
|
|
33602
|
+
const [email, setEmail] = (0, import_react83.useState)(initialEmail);
|
|
33603
|
+
const [password, setPassword] = (0, import_react83.useState)("");
|
|
33604
|
+
(0, import_react83.useEffect)(() => {
|
|
33408
33605
|
if (initialEmail && !email) setEmail(initialEmail);
|
|
33409
33606
|
}, [email, initialEmail]);
|
|
33410
33607
|
const submit = () => void onSubmit({ email, password });
|
|
@@ -33456,7 +33653,7 @@ var styles17 = import_react_native52.StyleSheet.create({
|
|
|
33456
33653
|
});
|
|
33457
33654
|
|
|
33458
33655
|
// src/auth/EmailCodeForm.tsx
|
|
33459
|
-
var
|
|
33656
|
+
var import_react84 = require("react");
|
|
33460
33657
|
var import_react_native53 = require("react-native");
|
|
33461
33658
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
33462
33659
|
var EmailCodeForm = ({
|
|
@@ -33471,8 +33668,8 @@ var EmailCodeForm = ({
|
|
|
33471
33668
|
onVerify,
|
|
33472
33669
|
onBack
|
|
33473
33670
|
}) => {
|
|
33474
|
-
const [email, setEmail] = (0,
|
|
33475
|
-
const [code, setCode] = (0,
|
|
33671
|
+
const [email, setEmail] = (0, import_react84.useState)(initialEmail);
|
|
33672
|
+
const [code, setCode] = (0, import_react84.useState)("");
|
|
33476
33673
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_react_native53.View, { style: { gap: 14 }, children: [
|
|
33477
33674
|
/* @__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
33675
|
error ? /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(ErrorText, { children: error }) : null,
|
|
@@ -33528,7 +33725,7 @@ var EmailCodeForm = ({
|
|
|
33528
33725
|
};
|
|
33529
33726
|
|
|
33530
33727
|
// src/auth/ForgotPasswordForm.tsx
|
|
33531
|
-
var
|
|
33728
|
+
var import_react85 = require("react");
|
|
33532
33729
|
var import_react_native54 = require("react-native");
|
|
33533
33730
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
33534
33731
|
var ForgotPasswordForm = ({
|
|
@@ -33542,8 +33739,8 @@ var ForgotPasswordForm = ({
|
|
|
33542
33739
|
onFieldChange
|
|
33543
33740
|
}) => {
|
|
33544
33741
|
const theme = useTheme();
|
|
33545
|
-
const [email, setEmail] = (0,
|
|
33546
|
-
(0,
|
|
33742
|
+
const [email, setEmail] = (0, import_react85.useState)(initialEmail);
|
|
33743
|
+
(0, import_react85.useEffect)(() => {
|
|
33547
33744
|
if (initialEmail && !email) setEmail(initialEmail);
|
|
33548
33745
|
}, [email, initialEmail]);
|
|
33549
33746
|
const submit = () => void onSubmit(email);
|
|
@@ -33591,7 +33788,7 @@ var styles18 = import_react_native54.StyleSheet.create({
|
|
|
33591
33788
|
});
|
|
33592
33789
|
|
|
33593
33790
|
// src/auth/RegisterForm.tsx
|
|
33594
|
-
var
|
|
33791
|
+
var import_react86 = require("react");
|
|
33595
33792
|
var import_react_native55 = require("react-native");
|
|
33596
33793
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
33597
33794
|
var emptyRegistration = (email) => ({
|
|
@@ -33620,30 +33817,30 @@ var RegisterForm = ({
|
|
|
33620
33817
|
onFieldChange
|
|
33621
33818
|
}) => {
|
|
33622
33819
|
var _a2, _b, _c, _d, _e, _f;
|
|
33623
|
-
const t = (0,
|
|
33624
|
-
const [values2, setValues] = (0,
|
|
33820
|
+
const t = (0, import_react86.useMemo)(() => createTranslator({ locale }), [locale]);
|
|
33821
|
+
const [values2, setValues] = (0, import_react86.useState)(
|
|
33625
33822
|
() => emptyRegistration(initialEmail)
|
|
33626
33823
|
);
|
|
33627
|
-
const [termsAccepted, setTermsAccepted] = (0,
|
|
33628
|
-
const [refreshingProof, setRefreshingProof] = (0,
|
|
33629
|
-
const [refreshCode, setRefreshCode] = (0,
|
|
33824
|
+
const [termsAccepted, setTermsAccepted] = (0, import_react86.useState)(false);
|
|
33825
|
+
const [refreshingProof, setRefreshingProof] = (0, import_react86.useState)(false);
|
|
33826
|
+
const [refreshCode, setRefreshCode] = (0, import_react86.useState)("");
|
|
33630
33827
|
const countriesQuery = hooks_exports.useCountries();
|
|
33631
|
-
const countries = (0,
|
|
33828
|
+
const countries = (0, import_react86.useMemo)(() => {
|
|
33632
33829
|
var _a3;
|
|
33633
33830
|
return (_a3 = countriesQuery.data) != null ? _a3 : [];
|
|
33634
33831
|
}, [countriesQuery.data]);
|
|
33635
33832
|
const statesQuery = hooks_exports.useStates(values2.countryId, {
|
|
33636
33833
|
enabled: requireAddress && Boolean(values2.countryId)
|
|
33637
33834
|
});
|
|
33638
|
-
const states = (0,
|
|
33835
|
+
const states = (0, import_react86.useMemo)(() => {
|
|
33639
33836
|
var _a3;
|
|
33640
33837
|
return (_a3 = statesQuery.data) != null ? _a3 : [];
|
|
33641
33838
|
}, [statesQuery.data]);
|
|
33642
|
-
(0,
|
|
33839
|
+
(0, import_react86.useEffect)(() => {
|
|
33643
33840
|
if (initialEmail && !values2.email)
|
|
33644
33841
|
setValues((current5) => ({ ...current5, email: initialEmail }));
|
|
33645
33842
|
}, [initialEmail, values2.email]);
|
|
33646
|
-
(0,
|
|
33843
|
+
(0, import_react86.useEffect)(() => {
|
|
33647
33844
|
var _a3;
|
|
33648
33845
|
if (!requireAddress || values2.countryId || countries.length === 0) return;
|
|
33649
33846
|
const preferred = (_a3 = countries.find((country) => {
|
|
@@ -33664,11 +33861,11 @@ var RegisterForm = ({
|
|
|
33664
33861
|
setValues((current5) => ({ ...current5, [field]: value6 }));
|
|
33665
33862
|
onFieldChange == null ? void 0 : onFieldChange(field);
|
|
33666
33863
|
};
|
|
33667
|
-
const countryOptions = (0,
|
|
33864
|
+
const countryOptions = (0, import_react86.useMemo)(
|
|
33668
33865
|
() => countries.map((country) => ({ label: country.name, value: String(country.id) })),
|
|
33669
33866
|
[countries]
|
|
33670
33867
|
);
|
|
33671
|
-
const stateOptions = (0,
|
|
33868
|
+
const stateOptions = (0, import_react86.useMemo)(
|
|
33672
33869
|
() => states.map((state) => ({ label: state.name, value: String(state.id) })),
|
|
33673
33870
|
[states]
|
|
33674
33871
|
);
|
|
@@ -34267,7 +34464,7 @@ function AccountEmailEnrichment({
|
|
|
34267
34464
|
}
|
|
34268
34465
|
|
|
34269
34466
|
// src/auth/AuthModal.tsx
|
|
34270
|
-
var
|
|
34467
|
+
var import_react87 = require("react");
|
|
34271
34468
|
var import_react_native58 = require("react-native");
|
|
34272
34469
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
34273
34470
|
var Tab = ({
|
|
@@ -34302,7 +34499,7 @@ var CredentialAuthModal = ({
|
|
|
34302
34499
|
}) => {
|
|
34303
34500
|
const theme = useTheme();
|
|
34304
34501
|
const t = useAccountT();
|
|
34305
|
-
const closeAfterAuth = (0,
|
|
34502
|
+
const closeAfterAuth = (0, import_react87.useCallback)(
|
|
34306
34503
|
(profile) => {
|
|
34307
34504
|
onAuthenticated == null ? void 0 : onAuthenticated(profile);
|
|
34308
34505
|
onClose();
|
|
@@ -34494,8 +34691,8 @@ var PhoneAccountModal = ({
|
|
|
34494
34691
|
},
|
|
34495
34692
|
onCancelled: onClose
|
|
34496
34693
|
});
|
|
34497
|
-
const prepared = (0,
|
|
34498
|
-
(0,
|
|
34694
|
+
const prepared = (0, import_react87.useRef)(false);
|
|
34695
|
+
(0, import_react87.useEffect)(() => {
|
|
34499
34696
|
if (prepared.current) return;
|
|
34500
34697
|
prepared.current = true;
|
|
34501
34698
|
if (initialEmail) flow.emailAuth.showLogin(initialEmail);
|
|
@@ -34585,7 +34782,7 @@ var styles20 = import_react_native58.StyleSheet.create({
|
|
|
34585
34782
|
});
|
|
34586
34783
|
|
|
34587
34784
|
// src/auth/ResetPasswordForm.tsx
|
|
34588
|
-
var
|
|
34785
|
+
var import_react88 = require("react");
|
|
34589
34786
|
var import_react_native59 = require("react-native");
|
|
34590
34787
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
34591
34788
|
var ResetPasswordForm = ({
|
|
@@ -34594,11 +34791,11 @@ var ResetPasswordForm = ({
|
|
|
34594
34791
|
onBackToLogin
|
|
34595
34792
|
}) => {
|
|
34596
34793
|
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,
|
|
34794
|
+
const [password, setPassword] = (0, import_react88.useState)("");
|
|
34795
|
+
const [confirmation, setConfirmation] = (0, import_react88.useState)("");
|
|
34796
|
+
const [submitted, setSubmitted] = (0, import_react88.useState)(false);
|
|
34797
|
+
const [success, setSuccess] = (0, import_react88.useState)(false);
|
|
34798
|
+
const validation = (0, import_react88.useMemo)(() => {
|
|
34602
34799
|
if (!submitted)
|
|
34603
34800
|
return {};
|
|
34604
34801
|
return {
|
|
@@ -34657,7 +34854,7 @@ var styles21 = import_react_native59.StyleSheet.create({
|
|
|
34657
34854
|
});
|
|
34658
34855
|
|
|
34659
34856
|
// src/EmbeddedCheckout.tsx
|
|
34660
|
-
var
|
|
34857
|
+
var import_react89 = require("react");
|
|
34661
34858
|
var import_react_native60 = require("react-native");
|
|
34662
34859
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
34663
34860
|
var Flow = ({
|
|
@@ -34685,13 +34882,13 @@ var Flow = ({
|
|
|
34685
34882
|
var _a2;
|
|
34686
34883
|
const checkout = useCheckoutContext();
|
|
34687
34884
|
const theme = useTheme();
|
|
34688
|
-
const [view, setView] = (0,
|
|
34689
|
-
const [selectionView, setSelectionView] = (0,
|
|
34690
|
-
const editedDetailsRef = (0,
|
|
34691
|
-
const [authRequest, setAuthRequest] = (0,
|
|
34885
|
+
const [view, setView] = (0, import_react89.useState)(initialView);
|
|
34886
|
+
const [selectionView, setSelectionView] = (0, import_react89.useState)(initialView);
|
|
34887
|
+
const editedDetailsRef = (0, import_react89.useRef)(null);
|
|
34888
|
+
const [authRequest, setAuthRequest] = (0, import_react89.useState)(
|
|
34692
34889
|
null
|
|
34693
34890
|
);
|
|
34694
|
-
const [privacyAttempted, setPrivacyAttempted] = (0,
|
|
34891
|
+
const [privacyAttempted, setPrivacyAttempted] = (0, import_react89.useState)(false);
|
|
34695
34892
|
const openBuiltInAuth = (email) => setAuthRequest((current5) => {
|
|
34696
34893
|
var _a3;
|
|
34697
34894
|
return { email, key: ((_a3 = current5 == null ? void 0 : current5.key) != null ? _a3 : 0) + 1 };
|
|
@@ -34704,7 +34901,7 @@ var Flow = ({
|
|
|
34704
34901
|
orderFixed: checkout.orderFixed
|
|
34705
34902
|
});
|
|
34706
34903
|
const leaveAllowed = canLeavePayment(checkout);
|
|
34707
|
-
(0,
|
|
34904
|
+
(0, import_react89.useEffect)(() => {
|
|
34708
34905
|
if (visibleView === view) return;
|
|
34709
34906
|
if (visibleView === "checkout") setView("checkout");
|
|
34710
34907
|
else {
|
|
@@ -34712,7 +34909,7 @@ var Flow = ({
|
|
|
34712
34909
|
setSelectionView("tickets");
|
|
34713
34910
|
}
|
|
34714
34911
|
}, [view, visibleView]);
|
|
34715
|
-
(0,
|
|
34912
|
+
(0, import_react89.useEffect)(() => {
|
|
34716
34913
|
onViewChange == null ? void 0 : onViewChange(visibleView);
|
|
34717
34914
|
}, [onViewChange, visibleView]);
|
|
34718
34915
|
const enterCheckout = (from) => {
|