@planetaexo/design-system 0.36.0 → 0.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +248 -161
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +231 -144
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React8 from 'react';
|
|
2
2
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
@@ -81,7 +81,7 @@ var buttonVariants = cva(
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
|
-
var Button =
|
|
84
|
+
var Button = React8.forwardRef(
|
|
85
85
|
(_a, ref) => {
|
|
86
86
|
var _b = _a, { className, variant, size } = _b, props = __objRest(_b, ["className", "variant", "size"]);
|
|
87
87
|
return /* @__PURE__ */ jsx(
|
|
@@ -302,10 +302,10 @@ function DialogDescription(_a) {
|
|
|
302
302
|
}, props)
|
|
303
303
|
);
|
|
304
304
|
}
|
|
305
|
-
var FloatingInput =
|
|
305
|
+
var FloatingInput = React8.forwardRef(
|
|
306
306
|
(_a, ref) => {
|
|
307
307
|
var _b = _a, { label, error, id, className, required } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required"]);
|
|
308
|
-
const inputId = id != null ? id :
|
|
308
|
+
const inputId = id != null ? id : React8.useId();
|
|
309
309
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
310
310
|
/* @__PURE__ */ jsx(
|
|
311
311
|
"input",
|
|
@@ -345,10 +345,10 @@ var FloatingInput = React25.forwardRef(
|
|
|
345
345
|
}
|
|
346
346
|
);
|
|
347
347
|
FloatingInput.displayName = "FloatingInput";
|
|
348
|
-
var FloatingSelect =
|
|
348
|
+
var FloatingSelect = React8.forwardRef(
|
|
349
349
|
(_a, ref) => {
|
|
350
350
|
var _b = _a, { label, error, id, className, required, children, value } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required", "children", "value"]);
|
|
351
|
-
const inputId = id != null ? id :
|
|
351
|
+
const inputId = id != null ? id : React8.useId();
|
|
352
352
|
const hasValue = typeof value === "string" ? value !== "" : value !== void 0 && value !== null;
|
|
353
353
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
354
354
|
/* @__PURE__ */ jsx(
|
|
@@ -612,11 +612,11 @@ function PhoneCountrySelect({
|
|
|
612
612
|
disabled
|
|
613
613
|
}) {
|
|
614
614
|
var _a;
|
|
615
|
-
const [open, setOpen] =
|
|
616
|
-
const containerRef =
|
|
617
|
-
const listRef =
|
|
615
|
+
const [open, setOpen] = React8.useState(false);
|
|
616
|
+
const containerRef = React8.useRef(null);
|
|
617
|
+
const listRef = React8.useRef(null);
|
|
618
618
|
const selected = (_a = PHONE_COUNTRIES.find((c) => c.code === value)) != null ? _a : PHONE_COUNTRIES[0];
|
|
619
|
-
|
|
619
|
+
React8.useEffect(() => {
|
|
620
620
|
if (!open) return;
|
|
621
621
|
const handler = (e) => {
|
|
622
622
|
var _a2;
|
|
@@ -627,7 +627,7 @@ function PhoneCountrySelect({
|
|
|
627
627
|
document.addEventListener("mousedown", handler);
|
|
628
628
|
return () => document.removeEventListener("mousedown", handler);
|
|
629
629
|
}, [open]);
|
|
630
|
-
|
|
630
|
+
React8.useEffect(() => {
|
|
631
631
|
if (!open || !listRef.current) return;
|
|
632
632
|
const activeEl = listRef.current.querySelector("[data-selected=true]");
|
|
633
633
|
activeEl == null ? void 0 : activeEl.scrollIntoView({ block: "nearest" });
|
|
@@ -897,8 +897,8 @@ function CalendarDayButton(_a) {
|
|
|
897
897
|
"locale"
|
|
898
898
|
]);
|
|
899
899
|
const defaultClassNames = getDefaultClassNames();
|
|
900
|
-
const ref =
|
|
901
|
-
|
|
900
|
+
const ref = React8.useRef(null);
|
|
901
|
+
React8.useEffect(() => {
|
|
902
902
|
var _a2;
|
|
903
903
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
904
904
|
}, [modifiers.focused]);
|
|
@@ -929,16 +929,16 @@ function BirthDateField({
|
|
|
929
929
|
className,
|
|
930
930
|
disabled
|
|
931
931
|
}) {
|
|
932
|
-
const [open, setOpen] =
|
|
933
|
-
const [text, setText] =
|
|
932
|
+
const [open, setOpen] = React8.useState(false);
|
|
933
|
+
const [text, setText] = React8.useState(
|
|
934
934
|
value ? format(value, "dd/MM/yyyy") : ""
|
|
935
935
|
);
|
|
936
|
-
const containerRef =
|
|
937
|
-
const inputId =
|
|
938
|
-
|
|
936
|
+
const containerRef = React8.useRef(null);
|
|
937
|
+
const inputId = React8.useId();
|
|
938
|
+
React8.useEffect(() => {
|
|
939
939
|
setText(value ? format(value, "dd/MM/yyyy") : "");
|
|
940
940
|
}, [value]);
|
|
941
|
-
|
|
941
|
+
React8.useEffect(() => {
|
|
942
942
|
if (!open) return;
|
|
943
943
|
const handler = (e) => {
|
|
944
944
|
var _a;
|
|
@@ -1147,14 +1147,14 @@ function CountrySearchField({
|
|
|
1147
1147
|
}) {
|
|
1148
1148
|
var _a;
|
|
1149
1149
|
const list = countries != null ? countries : COUNTRIES;
|
|
1150
|
-
const [query, setQuery] =
|
|
1151
|
-
const [open, setOpen] =
|
|
1152
|
-
const containerRef =
|
|
1153
|
-
const searchRef =
|
|
1150
|
+
const [query, setQuery] = React8.useState("");
|
|
1151
|
+
const [open, setOpen] = React8.useState(false);
|
|
1152
|
+
const containerRef = React8.useRef(null);
|
|
1153
|
+
const searchRef = React8.useRef(null);
|
|
1154
1154
|
const selected = list.find((c) => c.code === value);
|
|
1155
1155
|
const isFloated = open || !!selected;
|
|
1156
1156
|
const filtered = query.trim() ? list.filter((c) => c.name.toLowerCase().includes(query.toLowerCase())) : list;
|
|
1157
|
-
|
|
1157
|
+
React8.useEffect(() => {
|
|
1158
1158
|
if (!open) return;
|
|
1159
1159
|
const handler = (e) => {
|
|
1160
1160
|
var _a2;
|
|
@@ -1268,7 +1268,7 @@ function AdventureCard({
|
|
|
1268
1268
|
}) {
|
|
1269
1269
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
1270
1270
|
const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
|
|
1271
|
-
const [checkedInternal, setCheckedInternal] =
|
|
1271
|
+
const [checkedInternal, setCheckedInternal] = React8.useState(
|
|
1272
1272
|
new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
|
|
1273
1273
|
);
|
|
1274
1274
|
const isChecked = (opt) => {
|
|
@@ -1666,7 +1666,7 @@ function BookingShell({
|
|
|
1666
1666
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-border bg-card overflow-hidden", children: [
|
|
1667
1667
|
/* @__PURE__ */ jsxs("div", { className: "border-b border-border px-5 py-4 bg-muted/20", children: [
|
|
1668
1668
|
/* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground font-heading mb-2", children: title }),
|
|
1669
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxs(
|
|
1669
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
1670
1670
|
/* @__PURE__ */ jsx(
|
|
1671
1671
|
"span",
|
|
1672
1672
|
{
|
|
@@ -1865,7 +1865,7 @@ function TermsSection({
|
|
|
1865
1865
|
termsContent
|
|
1866
1866
|
}) {
|
|
1867
1867
|
var _a;
|
|
1868
|
-
const [modalOpen, setModalOpen] =
|
|
1868
|
+
const [modalOpen, setModalOpen] = React8.useState(false);
|
|
1869
1869
|
const i18n = (_a = TERMS_I18N[locale]) != null ? _a : TERMS_I18N.en;
|
|
1870
1870
|
return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
|
|
1871
1871
|
/* @__PURE__ */ jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
|
|
@@ -2003,9 +2003,9 @@ function BookingWizard({
|
|
|
2003
2003
|
}) {
|
|
2004
2004
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T;
|
|
2005
2005
|
const wizardSteps = WIZARD_STEPS_FN(labels);
|
|
2006
|
-
const [step, setStep] =
|
|
2007
|
-
const [error, setError] =
|
|
2008
|
-
const [responsible, setResponsible] =
|
|
2006
|
+
const [step, setStep] = React8.useState("responsible");
|
|
2007
|
+
const [error, setError] = React8.useState(null);
|
|
2008
|
+
const [responsible, setResponsible] = React8.useState({
|
|
2009
2009
|
firstName: "",
|
|
2010
2010
|
lastName: "",
|
|
2011
2011
|
email: "",
|
|
@@ -2024,7 +2024,7 @@ function BookingWizard({
|
|
|
2024
2024
|
return s + ((_b2 = (_a2 = a.slots) == null ? void 0 : _a2.children) != null ? _b2 : 0);
|
|
2025
2025
|
}, 0);
|
|
2026
2026
|
const totalPax = totalAdults + totalChildren;
|
|
2027
|
-
const [travellers, setTravellers] =
|
|
2027
|
+
const [travellers, setTravellers] = React8.useState(
|
|
2028
2028
|
Array.from({ length: Math.max(totalPax, 1) }, () => ({
|
|
2029
2029
|
firstName: "",
|
|
2030
2030
|
lastName: "",
|
|
@@ -2032,9 +2032,9 @@ function BookingWizard({
|
|
|
2032
2032
|
email: ""
|
|
2033
2033
|
}))
|
|
2034
2034
|
);
|
|
2035
|
-
const [payAmount, setPayAmount] =
|
|
2036
|
-
const [payMethod, setPayMethod] =
|
|
2037
|
-
const [termsAccepted, setTermsAccepted] =
|
|
2035
|
+
const [payAmount, setPayAmount] = React8.useState("full");
|
|
2036
|
+
const [payMethod, setPayMethod] = React8.useState("stripe");
|
|
2037
|
+
const [termsAccepted, setTermsAccepted] = React8.useState(false);
|
|
2038
2038
|
const setR = (k, v) => setResponsible((p) => __spreadProps(__spreadValues({}, p), { [k]: v }));
|
|
2039
2039
|
const setT = (i, k, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { [k]: v }) : t));
|
|
2040
2040
|
const setTDob = (i, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { dateOfBirth: v }) : t));
|
|
@@ -2261,7 +2261,7 @@ function Offer({
|
|
|
2261
2261
|
className
|
|
2262
2262
|
}) {
|
|
2263
2263
|
var _a, _b, _c;
|
|
2264
|
-
const [showBooking, setShowBooking] =
|
|
2264
|
+
const [showBooking, setShowBooking] = React8.useState(false);
|
|
2265
2265
|
const isShowingCheckout = !confirmedState && (!!checkoutSlot || showBooking);
|
|
2266
2266
|
const handleBook = () => {
|
|
2267
2267
|
if (!checkoutSlot && !externalBookingFlow) setShowBooking(true);
|
|
@@ -2621,11 +2621,12 @@ function AdventureSection({
|
|
|
2621
2621
|
onRequestOpenAddModal,
|
|
2622
2622
|
onRequestOpenEditModal,
|
|
2623
2623
|
onRequestOpenDeleteModal,
|
|
2624
|
+
onRequestOpenResendInviteDialog,
|
|
2624
2625
|
cannotRemoveLastTravellerLabel,
|
|
2625
2626
|
labels
|
|
2626
2627
|
}) {
|
|
2627
2628
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
2628
|
-
const [detailsOpen, setDetailsOpen] =
|
|
2629
|
+
const [detailsOpen, setDetailsOpen] = React8.useState(false);
|
|
2629
2630
|
const handleCopyUrl = (url) => {
|
|
2630
2631
|
if (onCopyFormLink) {
|
|
2631
2632
|
onCopyFormLink(url);
|
|
@@ -2875,7 +2876,13 @@ function AdventureSection({
|
|
|
2875
2876
|
"button",
|
|
2876
2877
|
{
|
|
2877
2878
|
type: "button",
|
|
2878
|
-
onClick: () =>
|
|
2879
|
+
onClick: () => {
|
|
2880
|
+
if (onRequestOpenResendInviteDialog) {
|
|
2881
|
+
onRequestOpenResendInviteDialog(t);
|
|
2882
|
+
} else {
|
|
2883
|
+
onResendInvite(t.id);
|
|
2884
|
+
}
|
|
2885
|
+
},
|
|
2879
2886
|
disabled: resendingInviteTravellerIds == null ? void 0 : resendingInviteTravellerIds.has(t.id),
|
|
2880
2887
|
className: "flex h-8 w-8 sm:h-7 sm:w-7 items-center justify-center rounded-lg text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none",
|
|
2881
2888
|
"aria-label": resendInviteAriaLabel != null ? resendInviteAriaLabel : "Resend registration invite",
|
|
@@ -3131,8 +3138,8 @@ function AddTravellerDialog({
|
|
|
3131
3138
|
errorMessage
|
|
3132
3139
|
}) {
|
|
3133
3140
|
var _a, _b, _c, _d, _e;
|
|
3134
|
-
const [form, setForm] =
|
|
3135
|
-
|
|
3141
|
+
const [form, setForm] = React8.useState(() => createInitialAddFormData(config));
|
|
3142
|
+
React8.useEffect(() => {
|
|
3136
3143
|
if (open) {
|
|
3137
3144
|
setForm(createInitialAddFormData(config));
|
|
3138
3145
|
}
|
|
@@ -3192,7 +3199,7 @@ function EditTravellerDialog({
|
|
|
3192
3199
|
errorMessage
|
|
3193
3200
|
}) {
|
|
3194
3201
|
var _a, _b, _c, _d, _e;
|
|
3195
|
-
const [form, setForm] =
|
|
3202
|
+
const [form, setForm] = React8.useState(() => ({
|
|
3196
3203
|
firstName: "",
|
|
3197
3204
|
lastName: "",
|
|
3198
3205
|
email: "",
|
|
@@ -3201,7 +3208,7 @@ function EditTravellerDialog({
|
|
|
3201
3208
|
birthDate: "",
|
|
3202
3209
|
personType: "ADULT"
|
|
3203
3210
|
}));
|
|
3204
|
-
|
|
3211
|
+
React8.useEffect(() => {
|
|
3205
3212
|
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
3206
3213
|
if (open && traveller) {
|
|
3207
3214
|
setForm({
|
|
@@ -3311,6 +3318,58 @@ function DeleteTravellerDialog({
|
|
|
3311
3318
|
}
|
|
3312
3319
|
);
|
|
3313
3320
|
}
|
|
3321
|
+
function ResendInviteConfirmDialog({
|
|
3322
|
+
open,
|
|
3323
|
+
travellerName: _travellerName,
|
|
3324
|
+
onClose,
|
|
3325
|
+
onConfirm,
|
|
3326
|
+
labels,
|
|
3327
|
+
submitting
|
|
3328
|
+
}) {
|
|
3329
|
+
var _a, _b, _c, _d, _e;
|
|
3330
|
+
return /* @__PURE__ */ jsx(
|
|
3331
|
+
Dialog,
|
|
3332
|
+
{
|
|
3333
|
+
open,
|
|
3334
|
+
onOpenChange: (o) => {
|
|
3335
|
+
if (!o) onClose();
|
|
3336
|
+
},
|
|
3337
|
+
children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-sm text-foreground", children: [
|
|
3338
|
+
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
3339
|
+
/* @__PURE__ */ jsx(DialogTitle, { className: "text-foreground font-heading text-base", children: (_a = labels == null ? void 0 : labels.title) != null ? _a : "Resend registration invite?" }),
|
|
3340
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: (_b = labels == null ? void 0 : labels.body) != null ? _b : "The traveller will receive the registration form link again. This action cannot be undone." })
|
|
3341
|
+
] }),
|
|
3342
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 rounded-lg bg-amber-500/10 border border-amber-500/30 px-3 py-2", children: [
|
|
3343
|
+
/* @__PURE__ */ jsx(AlertTriangleIcon, { className: "h-4 w-4 text-amber-600 mt-0.5 shrink-0" }),
|
|
3344
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: (_c = labels == null ? void 0 : labels.warning) != null ? _c : "After resending, you will need to wait 60 seconds to send again." })
|
|
3345
|
+
] }),
|
|
3346
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [
|
|
3347
|
+
/* @__PURE__ */ jsx(
|
|
3348
|
+
Button,
|
|
3349
|
+
{
|
|
3350
|
+
type: "button",
|
|
3351
|
+
variant: "outline",
|
|
3352
|
+
size: "sm",
|
|
3353
|
+
onClick: onClose,
|
|
3354
|
+
disabled: submitting,
|
|
3355
|
+
children: (_d = labels == null ? void 0 : labels.cancel) != null ? _d : "Cancel"
|
|
3356
|
+
}
|
|
3357
|
+
),
|
|
3358
|
+
/* @__PURE__ */ jsx(
|
|
3359
|
+
Button,
|
|
3360
|
+
{
|
|
3361
|
+
type: "button",
|
|
3362
|
+
size: "sm",
|
|
3363
|
+
disabled: submitting,
|
|
3364
|
+
onClick: () => void onConfirm(),
|
|
3365
|
+
children: (_e = labels == null ? void 0 : labels.confirm) != null ? _e : "Resend invite"
|
|
3366
|
+
}
|
|
3367
|
+
)
|
|
3368
|
+
] })
|
|
3369
|
+
] })
|
|
3370
|
+
}
|
|
3371
|
+
);
|
|
3372
|
+
}
|
|
3314
3373
|
function OrderSummary({
|
|
3315
3374
|
adventures,
|
|
3316
3375
|
summaryLineItems,
|
|
@@ -3479,43 +3538,53 @@ function BookingDetails({
|
|
|
3479
3538
|
labels,
|
|
3480
3539
|
className
|
|
3481
3540
|
}) {
|
|
3482
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
|
|
3541
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H;
|
|
3483
3542
|
const people = totalPeople(adventures);
|
|
3484
3543
|
const hasSubmitAddTraveller = !!onSubmitAddTraveller;
|
|
3485
3544
|
const hasSubmitEditTraveller = !!onSubmitEditTraveller;
|
|
3486
3545
|
const hasConfirmRemoveTraveller = !!onConfirmRemoveTraveller;
|
|
3487
|
-
const [addModalState, setAddModalState] =
|
|
3546
|
+
const [addModalState, setAddModalState] = React8.useState({
|
|
3488
3547
|
open: false,
|
|
3489
3548
|
adventureId: null
|
|
3490
3549
|
});
|
|
3491
|
-
const [editModalState, setEditModalState] =
|
|
3492
|
-
const [deleteModalState, setDeleteModalState] =
|
|
3493
|
-
const
|
|
3550
|
+
const [editModalState, setEditModalState] = React8.useState({ open: false, adventureId: null, traveller: null });
|
|
3551
|
+
const [deleteModalState, setDeleteModalState] = React8.useState({ open: false, adventureId: null, traveller: null });
|
|
3552
|
+
const [resendInviteDialogState, setResendInviteDialogState] = React8.useState({ open: false, traveller: null });
|
|
3553
|
+
const handleRequestOpenAddModal = React8.useCallback((adventureId) => {
|
|
3494
3554
|
setAddModalState({ open: true, adventureId });
|
|
3495
3555
|
}, []);
|
|
3496
|
-
const handleRequestOpenEditModal =
|
|
3556
|
+
const handleRequestOpenEditModal = React8.useCallback(
|
|
3497
3557
|
(adventureId, traveller) => {
|
|
3498
3558
|
setEditModalState({ open: true, adventureId, traveller });
|
|
3499
3559
|
},
|
|
3500
3560
|
[]
|
|
3501
3561
|
);
|
|
3502
|
-
const handleRequestOpenDeleteModal =
|
|
3562
|
+
const handleRequestOpenDeleteModal = React8.useCallback(
|
|
3503
3563
|
(adventureId, traveller) => {
|
|
3504
3564
|
setDeleteModalState({ open: true, adventureId, traveller });
|
|
3505
3565
|
},
|
|
3506
3566
|
[]
|
|
3507
3567
|
);
|
|
3508
|
-
const
|
|
3568
|
+
const handleRequestOpenResendInviteDialog = React8.useCallback(
|
|
3569
|
+
(traveller) => {
|
|
3570
|
+
setResendInviteDialogState({ open: true, traveller });
|
|
3571
|
+
},
|
|
3572
|
+
[]
|
|
3573
|
+
);
|
|
3574
|
+
const closeAddModal = React8.useCallback(() => {
|
|
3509
3575
|
setAddModalState({ open: false, adventureId: null });
|
|
3510
3576
|
}, []);
|
|
3511
|
-
const closeEditModal =
|
|
3577
|
+
const closeEditModal = React8.useCallback(() => {
|
|
3512
3578
|
setEditModalState({ open: false, adventureId: null, traveller: null });
|
|
3513
3579
|
}, []);
|
|
3514
|
-
const closeDeleteModal =
|
|
3580
|
+
const closeDeleteModal = React8.useCallback(() => {
|
|
3515
3581
|
setDeleteModalState({ open: false, adventureId: null, traveller: null });
|
|
3516
3582
|
}, []);
|
|
3517
|
-
const
|
|
3518
|
-
|
|
3583
|
+
const closeResendInviteDialog = React8.useCallback(() => {
|
|
3584
|
+
setResendInviteDialogState({ open: false, traveller: null });
|
|
3585
|
+
}, []);
|
|
3586
|
+
const submitInFlightRef = React8.useRef(false);
|
|
3587
|
+
const handleAddSubmit = React8.useCallback(
|
|
3519
3588
|
async (adventureId, data) => {
|
|
3520
3589
|
if (!onSubmitAddTraveller) return;
|
|
3521
3590
|
if (submitInFlightRef.current) return;
|
|
@@ -3530,7 +3599,7 @@ function BookingDetails({
|
|
|
3530
3599
|
},
|
|
3531
3600
|
[onSubmitAddTraveller, closeAddModal]
|
|
3532
3601
|
);
|
|
3533
|
-
const handleEditSubmit =
|
|
3602
|
+
const handleEditSubmit = React8.useCallback(
|
|
3534
3603
|
async (adventureId, travellerId, data) => {
|
|
3535
3604
|
if (!onSubmitEditTraveller) return;
|
|
3536
3605
|
if (submitInFlightRef.current) return;
|
|
@@ -3545,7 +3614,7 @@ function BookingDetails({
|
|
|
3545
3614
|
},
|
|
3546
3615
|
[onSubmitEditTraveller, closeEditModal]
|
|
3547
3616
|
);
|
|
3548
|
-
const handleDeleteConfirm =
|
|
3617
|
+
const handleDeleteConfirm = React8.useCallback(
|
|
3549
3618
|
async (adventureId, travellerId) => {
|
|
3550
3619
|
if (!onConfirmRemoveTraveller) return;
|
|
3551
3620
|
if (submitInFlightRef.current) return;
|
|
@@ -3659,6 +3728,7 @@ function BookingDetails({
|
|
|
3659
3728
|
onRequestOpenAddModal: handleRequestOpenAddModal,
|
|
3660
3729
|
onRequestOpenEditModal: handleRequestOpenEditModal,
|
|
3661
3730
|
onRequestOpenDeleteModal: handleRequestOpenDeleteModal,
|
|
3731
|
+
onRequestOpenResendInviteDialog: handleRequestOpenResendInviteDialog,
|
|
3662
3732
|
cannotRemoveLastTravellerLabel,
|
|
3663
3733
|
labels
|
|
3664
3734
|
},
|
|
@@ -3791,6 +3861,23 @@ function BookingDetails({
|
|
|
3791
3861
|
saving: removeTravellerSaving,
|
|
3792
3862
|
errorMessage: deleteModalState.open ? travellerFormError : null
|
|
3793
3863
|
}
|
|
3864
|
+
),
|
|
3865
|
+
onResendInvite && /* @__PURE__ */ jsx(
|
|
3866
|
+
ResendInviteConfirmDialog,
|
|
3867
|
+
{
|
|
3868
|
+
open: resendInviteDialogState.open,
|
|
3869
|
+
travellerName: resendInviteDialogState.traveller ? `${(_G = resendInviteDialogState.traveller.firstName) != null ? _G : ""} ${(_H = resendInviteDialogState.traveller.lastName) != null ? _H : ""}`.trim() : "",
|
|
3870
|
+
onClose: closeResendInviteDialog,
|
|
3871
|
+
onConfirm: () => {
|
|
3872
|
+
const traveller = resendInviteDialogState.traveller;
|
|
3873
|
+
if (traveller) {
|
|
3874
|
+
onResendInvite(traveller.id);
|
|
3875
|
+
}
|
|
3876
|
+
closeResendInviteDialog();
|
|
3877
|
+
},
|
|
3878
|
+
labels: labels == null ? void 0 : labels.resendInviteDialog,
|
|
3879
|
+
submitting: resendInviteDialogState.traveller ? resendingInviteTravellerIds == null ? void 0 : resendingInviteTravellerIds.has(resendInviteDialogState.traveller.id) : false
|
|
3880
|
+
}
|
|
3794
3881
|
)
|
|
3795
3882
|
] });
|
|
3796
3883
|
}
|
|
@@ -5001,7 +5088,7 @@ function BookingCreatedEmail({
|
|
|
5001
5088
|
}, children: i + 1 }) }),
|
|
5002
5089
|
/* @__PURE__ */ jsx("td", { style: { verticalAlign: "top" }, children: /* @__PURE__ */ jsx("p", { style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.6", margin: 0 }, children: step }) })
|
|
5003
5090
|
] }) }) }, i)) }),
|
|
5004
|
-
nextStepsImportant && nextStepsImportant.trim().length > 0 && /* @__PURE__ */ jsx("p", { style: { marginBottom: "32px", fontSize: "14px", color: emailTokens.foreground, lineHeight: "1.6" }, children: nextStepsImportant.split("\n").map((line, idx, arr) => /* @__PURE__ */ jsxs(
|
|
5091
|
+
nextStepsImportant && nextStepsImportant.trim().length > 0 && /* @__PURE__ */ jsx("p", { style: { marginBottom: "32px", fontSize: "14px", color: emailTokens.foreground, lineHeight: "1.6" }, children: nextStepsImportant.split("\n").map((line, idx, arr) => /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
5005
5092
|
idx === 0 ? /* @__PURE__ */ jsx("strong", { children: line }) : line,
|
|
5006
5093
|
idx < arr.length - 1 ? /* @__PURE__ */ jsx("br", {}) : null
|
|
5007
5094
|
] }, idx)) })
|
|
@@ -6370,11 +6457,11 @@ function DatePickerField({
|
|
|
6370
6457
|
fromDate,
|
|
6371
6458
|
className
|
|
6372
6459
|
}) {
|
|
6373
|
-
const [open, setOpen] =
|
|
6374
|
-
const containerRef =
|
|
6375
|
-
const [calendarWidth, setCalendarWidth] =
|
|
6460
|
+
const [open, setOpen] = React8.useState(false);
|
|
6461
|
+
const containerRef = React8.useRef(null);
|
|
6462
|
+
const [calendarWidth, setCalendarWidth] = React8.useState();
|
|
6376
6463
|
const hasValue = !!value;
|
|
6377
|
-
|
|
6464
|
+
React8.useEffect(() => {
|
|
6378
6465
|
if (!containerRef.current) return;
|
|
6379
6466
|
const observer = new ResizeObserver(([entry]) => {
|
|
6380
6467
|
setCalendarWidth(entry.contentRect.width);
|
|
@@ -6483,7 +6570,7 @@ function BookingForm({
|
|
|
6483
6570
|
subtitle = "Free enquiry \u2013 no commitment",
|
|
6484
6571
|
className
|
|
6485
6572
|
}) {
|
|
6486
|
-
const [values, setValues] =
|
|
6573
|
+
const [values, setValues] = React8.useState(__spreadValues(__spreadValues({}, defaultInitial), defaultValues));
|
|
6487
6574
|
const set = (key, value) => setValues((prev) => __spreadProps(__spreadValues({}, prev), { [key]: value }));
|
|
6488
6575
|
const handleSubmit = (e) => {
|
|
6489
6576
|
e.preventDefault();
|
|
@@ -7020,11 +7107,11 @@ function FloatingTextarea({
|
|
|
7020
7107
|
}
|
|
7021
7108
|
function SelectField({ field, value, onChange, error, disabled }) {
|
|
7022
7109
|
var _a, _b, _c;
|
|
7023
|
-
const [open, setOpen] =
|
|
7024
|
-
const containerRef =
|
|
7110
|
+
const [open, setOpen] = React8.useState(false);
|
|
7111
|
+
const containerRef = React8.useRef(null);
|
|
7025
7112
|
const options = (_a = field.options) != null ? _a : [];
|
|
7026
7113
|
const selectedOpt = (_b = options.find((o) => o.value === value)) != null ? _b : null;
|
|
7027
|
-
|
|
7114
|
+
React8.useEffect(() => {
|
|
7028
7115
|
if (!open) return;
|
|
7029
7116
|
const handleOutside = (e) => {
|
|
7030
7117
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -7413,11 +7500,11 @@ function RegistrationForm({
|
|
|
7413
7500
|
readOnly = false
|
|
7414
7501
|
}) {
|
|
7415
7502
|
var _a;
|
|
7416
|
-
const L =
|
|
7503
|
+
const L = React8.useMemo(
|
|
7417
7504
|
() => __spreadValues(__spreadValues({}, DEFAULT_LABELS9), labels != null ? labels : {}),
|
|
7418
7505
|
[labels]
|
|
7419
7506
|
);
|
|
7420
|
-
const sortedFields =
|
|
7507
|
+
const sortedFields = React8.useMemo(
|
|
7421
7508
|
() => [...fields].sort((a, b) => {
|
|
7422
7509
|
var _a2, _b;
|
|
7423
7510
|
return ((_a2 = a.order) != null ? _a2 : 0) - ((_b = b.order) != null ? _b : 0);
|
|
@@ -7425,7 +7512,7 @@ function RegistrationForm({
|
|
|
7425
7512
|
[fields]
|
|
7426
7513
|
);
|
|
7427
7514
|
const isControlled = values !== void 0;
|
|
7428
|
-
const [internal, setInternal] =
|
|
7515
|
+
const [internal, setInternal] = React8.useState(
|
|
7429
7516
|
() => initializeValues(
|
|
7430
7517
|
sortedFields,
|
|
7431
7518
|
defaultValues != null ? defaultValues : {},
|
|
@@ -7433,9 +7520,9 @@ function RegistrationForm({
|
|
|
7433
7520
|
includeTerms
|
|
7434
7521
|
)
|
|
7435
7522
|
);
|
|
7436
|
-
const [submitAttempted, setSubmitAttempted] =
|
|
7437
|
-
const [validationErrors, setValidationErrors] =
|
|
7438
|
-
|
|
7523
|
+
const [submitAttempted, setSubmitAttempted] = React8.useState(false);
|
|
7524
|
+
const [validationErrors, setValidationErrors] = React8.useState({});
|
|
7525
|
+
React8.useEffect(() => {
|
|
7439
7526
|
if (isControlled) return;
|
|
7440
7527
|
setInternal((prev) => {
|
|
7441
7528
|
const next = initializeValues(
|
|
@@ -7492,7 +7579,7 @@ function RegistrationForm({
|
|
|
7492
7579
|
const termsError = submitAttempted && termsEnabled && !termsAccepted;
|
|
7493
7580
|
const firstErrorFieldId = Object.keys(fieldErrors)[0];
|
|
7494
7581
|
const scrollTargetId = firstErrorFieldId ? `rf-${firstErrorFieldId}` : termsError ? "rf-terms" : null;
|
|
7495
|
-
|
|
7582
|
+
React8.useEffect(() => {
|
|
7496
7583
|
if (!submitAttempted || !scrollTargetId) return;
|
|
7497
7584
|
const timer = setTimeout(() => {
|
|
7498
7585
|
const elem = document.getElementById(scrollTargetId);
|
|
@@ -7954,10 +8041,10 @@ var OTPCodeInput = ({
|
|
|
7954
8041
|
id,
|
|
7955
8042
|
required
|
|
7956
8043
|
}) => {
|
|
7957
|
-
const baseId = id != null ? id :
|
|
7958
|
-
const inputRef =
|
|
7959
|
-
const [focused, setFocused] =
|
|
7960
|
-
const digits =
|
|
8044
|
+
const baseId = id != null ? id : React8.useId();
|
|
8045
|
+
const inputRef = React8.useRef(null);
|
|
8046
|
+
const [focused, setFocused] = React8.useState(false);
|
|
8047
|
+
const digits = React8.useMemo(() => {
|
|
7961
8048
|
const arr = value.split("").slice(0, length);
|
|
7962
8049
|
while (arr.length < length) arr.push("");
|
|
7963
8050
|
return arr;
|
|
@@ -8073,7 +8160,7 @@ function Checkbox(_a) {
|
|
|
8073
8160
|
})
|
|
8074
8161
|
);
|
|
8075
8162
|
}
|
|
8076
|
-
var AccordionVariantContext =
|
|
8163
|
+
var AccordionVariantContext = React8.createContext("default");
|
|
8077
8164
|
function Accordion(_a) {
|
|
8078
8165
|
var _b = _a, { className, variant = "default" } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
8079
8166
|
return /* @__PURE__ */ jsx(AccordionVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx(
|
|
@@ -8091,7 +8178,7 @@ function Accordion(_a) {
|
|
|
8091
8178
|
}
|
|
8092
8179
|
function AccordionItem(_a) {
|
|
8093
8180
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8094
|
-
const variant =
|
|
8181
|
+
const variant = React8.useContext(AccordionVariantContext);
|
|
8095
8182
|
return /* @__PURE__ */ jsx(
|
|
8096
8183
|
Accordion$1.Item,
|
|
8097
8184
|
__spreadValues({
|
|
@@ -8112,7 +8199,7 @@ function AccordionTrigger(_a) {
|
|
|
8112
8199
|
"className",
|
|
8113
8200
|
"children"
|
|
8114
8201
|
]);
|
|
8115
|
-
const variant =
|
|
8202
|
+
const variant = React8.useContext(AccordionVariantContext);
|
|
8116
8203
|
return /* @__PURE__ */ jsx(Accordion$1.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
|
|
8117
8204
|
Accordion$1.Trigger,
|
|
8118
8205
|
__spreadProps(__spreadValues({
|
|
@@ -8166,7 +8253,7 @@ function AccordionContent(_a) {
|
|
|
8166
8253
|
"className",
|
|
8167
8254
|
"children"
|
|
8168
8255
|
]);
|
|
8169
|
-
const variant =
|
|
8256
|
+
const variant = React8.useContext(AccordionVariantContext);
|
|
8170
8257
|
return /* @__PURE__ */ jsx(
|
|
8171
8258
|
Accordion$1.Panel,
|
|
8172
8259
|
__spreadProps(__spreadValues({
|
|
@@ -8198,7 +8285,7 @@ function FilterPanel({
|
|
|
8198
8285
|
title = "Filters",
|
|
8199
8286
|
className
|
|
8200
8287
|
}) {
|
|
8201
|
-
const [internalValue, setInternalValue] =
|
|
8288
|
+
const [internalValue, setInternalValue] = React8.useState(
|
|
8202
8289
|
() => Object.fromEntries(groups.map((g) => [g.id, []]))
|
|
8203
8290
|
);
|
|
8204
8291
|
const selected = value != null ? value : internalValue;
|
|
@@ -8297,8 +8384,8 @@ function FilterPanel({
|
|
|
8297
8384
|
var TRUSTPILOT_SCRIPT_SRC = "https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js";
|
|
8298
8385
|
function TrustpilotEmbed({ config }) {
|
|
8299
8386
|
var _a, _b, _c, _d, _e, _f;
|
|
8300
|
-
const ref =
|
|
8301
|
-
|
|
8387
|
+
const ref = React8.useRef(null);
|
|
8388
|
+
React8.useEffect(() => {
|
|
8302
8389
|
if (typeof document === "undefined" || !ref.current) return;
|
|
8303
8390
|
let cancelled = false;
|
|
8304
8391
|
const initWidget = () => {
|
|
@@ -8430,11 +8517,11 @@ function ItineraryModal({
|
|
|
8430
8517
|
onNext
|
|
8431
8518
|
}) {
|
|
8432
8519
|
var _a, _b, _c;
|
|
8433
|
-
const [imgIndex, setImgIndex] =
|
|
8520
|
+
const [imgIndex, setImgIndex] = React8.useState(0);
|
|
8434
8521
|
const images = stop ? [stop.coverImage, ...(_a = stop.images) != null ? _a : []] : [];
|
|
8435
8522
|
const isFirst = (stop == null ? void 0 : stop.dayNumber) === ((_b = allStops[0]) == null ? void 0 : _b.dayNumber);
|
|
8436
8523
|
const isLast = (stop == null ? void 0 : stop.dayNumber) === ((_c = allStops[allStops.length - 1]) == null ? void 0 : _c.dayNumber);
|
|
8437
|
-
|
|
8524
|
+
React8.useEffect(() => {
|
|
8438
8525
|
setImgIndex(0);
|
|
8439
8526
|
}, [stop == null ? void 0 : stop.dayNumber]);
|
|
8440
8527
|
if (!stop) return null;
|
|
@@ -8561,8 +8648,8 @@ function ItineraryModal({
|
|
|
8561
8648
|
) });
|
|
8562
8649
|
}
|
|
8563
8650
|
function Itinerary({ title, subtitle, stops, className }) {
|
|
8564
|
-
const [activeIndex, setActiveIndex] =
|
|
8565
|
-
const scrollRef =
|
|
8651
|
+
const [activeIndex, setActiveIndex] = React8.useState(null);
|
|
8652
|
+
const scrollRef = React8.useRef(null);
|
|
8566
8653
|
const activeStop = activeIndex !== null ? stops[activeIndex] : null;
|
|
8567
8654
|
const scrollBy = (dir) => {
|
|
8568
8655
|
if (!scrollRef.current) return;
|
|
@@ -8654,18 +8741,18 @@ function Lightbox({
|
|
|
8654
8741
|
onClose
|
|
8655
8742
|
}) {
|
|
8656
8743
|
var _a;
|
|
8657
|
-
const [index, setIndex] =
|
|
8744
|
+
const [index, setIndex] = React8.useState(initialIndex);
|
|
8658
8745
|
const total = photos.length;
|
|
8659
8746
|
const photo = photos[index];
|
|
8660
|
-
const prev =
|
|
8747
|
+
const prev = React8.useCallback(
|
|
8661
8748
|
() => setIndex((i) => (i - 1 + total) % total),
|
|
8662
8749
|
[total]
|
|
8663
8750
|
);
|
|
8664
|
-
const next =
|
|
8751
|
+
const next = React8.useCallback(
|
|
8665
8752
|
() => setIndex((i) => (i + 1) % total),
|
|
8666
8753
|
[total]
|
|
8667
8754
|
);
|
|
8668
|
-
|
|
8755
|
+
React8.useEffect(() => {
|
|
8669
8756
|
const onKey = (e) => {
|
|
8670
8757
|
if (e.key === "Escape") onClose();
|
|
8671
8758
|
if (e.key === "ArrowLeft") prev();
|
|
@@ -8831,7 +8918,7 @@ function GridGallery({
|
|
|
8831
8918
|
initialVisible,
|
|
8832
8919
|
onOpen
|
|
8833
8920
|
}) {
|
|
8834
|
-
const [expanded, setExpanded] =
|
|
8921
|
+
const [expanded, setExpanded] = React8.useState(false);
|
|
8835
8922
|
const cols = gridCols(photos.length);
|
|
8836
8923
|
const hasMore = photos.length > initialVisible;
|
|
8837
8924
|
const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
|
|
@@ -8861,7 +8948,7 @@ function MasonryGallery({
|
|
|
8861
8948
|
initialVisible,
|
|
8862
8949
|
onOpen
|
|
8863
8950
|
}) {
|
|
8864
|
-
const [expanded, setExpanded] =
|
|
8951
|
+
const [expanded, setExpanded] = React8.useState(false);
|
|
8865
8952
|
const hasMore = photos.length > initialVisible;
|
|
8866
8953
|
const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
|
|
8867
8954
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -8934,7 +9021,7 @@ function FeaturedGallery({
|
|
|
8934
9021
|
photos,
|
|
8935
9022
|
onOpen
|
|
8936
9023
|
}) {
|
|
8937
|
-
const [expanded, setExpanded] =
|
|
9024
|
+
const [expanded, setExpanded] = React8.useState(false);
|
|
8938
9025
|
const featured = photos.slice(0, 3);
|
|
8939
9026
|
const extra = photos.slice(3);
|
|
8940
9027
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -9101,9 +9188,9 @@ function PhotoGallery({
|
|
|
9101
9188
|
onPhotoClick,
|
|
9102
9189
|
className
|
|
9103
9190
|
}) {
|
|
9104
|
-
const [lightboxIndex, setLightboxIndex] =
|
|
9105
|
-
const [carouselIndex, setCarouselIndex] =
|
|
9106
|
-
const normalised =
|
|
9191
|
+
const [lightboxIndex, setLightboxIndex] = React8.useState(null);
|
|
9192
|
+
const [carouselIndex, setCarouselIndex] = React8.useState(0);
|
|
9193
|
+
const normalised = React8.useMemo(() => photos.map(normalise), [photos]);
|
|
9107
9194
|
const handleOpen = (index) => {
|
|
9108
9195
|
setLightboxIndex(index);
|
|
9109
9196
|
onPhotoClick == null ? void 0 : onPhotoClick(normalised[index].src, index);
|
|
@@ -9179,7 +9266,7 @@ function ItineraryDay({
|
|
|
9179
9266
|
photoLayout = "rounded",
|
|
9180
9267
|
className
|
|
9181
9268
|
}) {
|
|
9182
|
-
const photoList =
|
|
9269
|
+
const photoList = React8.useMemo(() => normalisePhotos(photos), [photos]);
|
|
9183
9270
|
const isFullBleed = photoLayout === "fullBleed" || photoLayout === "fullBleedBottom";
|
|
9184
9271
|
const photoPosition = photoLayout === "fullBleedBottom" ? "bottom" : "top";
|
|
9185
9272
|
const gallery = photoList.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -9231,8 +9318,8 @@ function MenuTrip({
|
|
|
9231
9318
|
bold = true,
|
|
9232
9319
|
className
|
|
9233
9320
|
}) {
|
|
9234
|
-
const scrollRef =
|
|
9235
|
-
|
|
9321
|
+
const scrollRef = React8.useRef(null);
|
|
9322
|
+
React8.useEffect(() => {
|
|
9236
9323
|
if (!scrollRef.current || !activeSection) return;
|
|
9237
9324
|
const container = scrollRef.current;
|
|
9238
9325
|
const btn = container.querySelector(
|
|
@@ -9423,8 +9510,8 @@ function PricingTrip({
|
|
|
9423
9510
|
className
|
|
9424
9511
|
}) {
|
|
9425
9512
|
const rOuter = sharp ? "rounded-none" : "rounded-2xl";
|
|
9426
|
-
const [showEstimates, setShowEstimates] =
|
|
9427
|
-
const [showPriceInfo, setShowPriceInfo] =
|
|
9513
|
+
const [showEstimates, setShowEstimates] = React8.useState(false);
|
|
9514
|
+
const [showPriceInfo, setShowPriceInfo] = React8.useState(false);
|
|
9428
9515
|
if (variant === "compact") {
|
|
9429
9516
|
const showOverlay = showPriceInfo && (!!priceInfo || !!currencyEstimates && currencyEstimates.length > 0);
|
|
9430
9517
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
@@ -9864,14 +9951,14 @@ function SiteHeader({
|
|
|
9864
9951
|
className
|
|
9865
9952
|
}) {
|
|
9866
9953
|
const t = VARIANT[variant];
|
|
9867
|
-
const [openMenu, setOpenMenu] =
|
|
9868
|
-
const [langOpen, setLangOpen] =
|
|
9869
|
-
const [mobileOpen, setMobileOpen] =
|
|
9870
|
-
const [openMobileSection, setOpenMobileSection] =
|
|
9871
|
-
const [activeLang, setActiveLang] =
|
|
9954
|
+
const [openMenu, setOpenMenu] = React8.useState(null);
|
|
9955
|
+
const [langOpen, setLangOpen] = React8.useState(false);
|
|
9956
|
+
const [mobileOpen, setMobileOpen] = React8.useState(false);
|
|
9957
|
+
const [openMobileSection, setOpenMobileSection] = React8.useState(null);
|
|
9958
|
+
const [activeLang, setActiveLang] = React8.useState(currentLanguage);
|
|
9872
9959
|
const toggleMobileSection = (label) => setOpenMobileSection((prev) => prev === label ? null : label);
|
|
9873
|
-
const menuCloseTimer =
|
|
9874
|
-
const langCloseTimer =
|
|
9960
|
+
const menuCloseTimer = React8.useRef(void 0);
|
|
9961
|
+
const langCloseTimer = React8.useRef(void 0);
|
|
9875
9962
|
const handleMenuEnter = (label) => {
|
|
9876
9963
|
clearTimeout(menuCloseTimer.current);
|
|
9877
9964
|
setOpenMenu(label);
|
|
@@ -9892,7 +9979,7 @@ function SiteHeader({
|
|
|
9892
9979
|
setOpenMenu(null);
|
|
9893
9980
|
setLangOpen(false);
|
|
9894
9981
|
};
|
|
9895
|
-
|
|
9982
|
+
React8.useEffect(() => () => {
|
|
9896
9983
|
clearTimeout(menuCloseTimer.current);
|
|
9897
9984
|
clearTimeout(langCloseTimer.current);
|
|
9898
9985
|
}, []);
|
|
@@ -10157,7 +10244,7 @@ function SiteHeader({
|
|
|
10157
10244
|
), children: [
|
|
10158
10245
|
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: languages.map((lang, i) => {
|
|
10159
10246
|
const isActive = lang.code === activeLang;
|
|
10160
|
-
return /* @__PURE__ */ jsxs(
|
|
10247
|
+
return /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
10161
10248
|
i > 0 && /* @__PURE__ */ jsx("span", { className: cn(
|
|
10162
10249
|
"text-xs select-none",
|
|
10163
10250
|
variant === "white" ? "text-border" : "text-white/15"
|
|
@@ -10219,8 +10306,8 @@ function SiteHeader({
|
|
|
10219
10306
|
);
|
|
10220
10307
|
}
|
|
10221
10308
|
function ThemeToggle({ className }) {
|
|
10222
|
-
const [dark, setDark] =
|
|
10223
|
-
|
|
10309
|
+
const [dark, setDark] = React8.useState(false);
|
|
10310
|
+
React8.useEffect(() => {
|
|
10224
10311
|
const saved = localStorage.getItem("theme");
|
|
10225
10312
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
10226
10313
|
const isDark = saved === "dark" || !saved && prefersDark;
|
|
@@ -10371,7 +10458,7 @@ function TripCard({
|
|
|
10371
10458
|
);
|
|
10372
10459
|
}
|
|
10373
10460
|
function useHlsVideo(videoRef, src) {
|
|
10374
|
-
|
|
10461
|
+
React8.useEffect(() => {
|
|
10375
10462
|
if (!src || !videoRef.current) return;
|
|
10376
10463
|
const video = videoRef.current;
|
|
10377
10464
|
if (!src.includes(".m3u8")) return;
|
|
@@ -10414,11 +10501,11 @@ function TripHeader({
|
|
|
10414
10501
|
className
|
|
10415
10502
|
}) {
|
|
10416
10503
|
var _a;
|
|
10417
|
-
const [heroIndex, setHeroIndex] =
|
|
10418
|
-
const [videoReady, setVideoReady] =
|
|
10419
|
-
const videoRef =
|
|
10504
|
+
const [heroIndex, setHeroIndex] = React8.useState(0);
|
|
10505
|
+
const [videoReady, setVideoReady] = React8.useState(false);
|
|
10506
|
+
const videoRef = React8.useRef(null);
|
|
10420
10507
|
const isHls = !!(videoUrl == null ? void 0 : videoUrl.includes(".m3u8"));
|
|
10421
|
-
const validImages =
|
|
10508
|
+
const validImages = React8.useMemo(
|
|
10422
10509
|
() => images.map((u) => u == null ? void 0 : u.trim()).filter(Boolean),
|
|
10423
10510
|
[images]
|
|
10424
10511
|
);
|
|
@@ -10433,7 +10520,7 @@ function TripHeader({
|
|
|
10433
10520
|
const nights = duration ? (_a = duration.nights) != null ? _a : Math.max(duration.days - 1, 1) : null;
|
|
10434
10521
|
const hasMeta = !!(destination || duration);
|
|
10435
10522
|
useHlsVideo(videoRef, isHls ? videoUrl : void 0);
|
|
10436
|
-
|
|
10523
|
+
React8.useEffect(() => {
|
|
10437
10524
|
if (!videoUrl) return;
|
|
10438
10525
|
const el = videoRef.current;
|
|
10439
10526
|
if (!el) return;
|
|
@@ -10575,7 +10662,7 @@ function TripHeader({
|
|
|
10575
10662
|
siteHeader ? "-mt-44" : "-mt-36"
|
|
10576
10663
|
),
|
|
10577
10664
|
children: [
|
|
10578
|
-
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxs(
|
|
10665
|
+
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxs(React8.Fragment, { children: [
|
|
10579
10666
|
i > 0 && /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-3 w-3 text-white/50 shrink-0" }),
|
|
10580
10667
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-white/70 font-ui hover:text-white/90 cursor-default", children: crumb.label })
|
|
10581
10668
|
] }, i)) }),
|
|
@@ -10691,9 +10778,9 @@ function TripPage({
|
|
|
10691
10778
|
features,
|
|
10692
10779
|
className
|
|
10693
10780
|
}) {
|
|
10694
|
-
const [activeSection, setActiveSection] =
|
|
10695
|
-
const [accordionValue, setAccordionValue] =
|
|
10696
|
-
const accordionSectionIds =
|
|
10781
|
+
const [activeSection, setActiveSection] = React8.useState("");
|
|
10782
|
+
const [accordionValue, setAccordionValue] = React8.useState([]);
|
|
10783
|
+
const accordionSectionIds = React8.useMemo(
|
|
10697
10784
|
() => /* @__PURE__ */ new Set([
|
|
10698
10785
|
"key-info",
|
|
10699
10786
|
"what-to-bring",
|
|
@@ -10706,18 +10793,18 @@ function TripPage({
|
|
|
10706
10793
|
]),
|
|
10707
10794
|
[]
|
|
10708
10795
|
);
|
|
10709
|
-
const [navFloating, setNavFloating] =
|
|
10710
|
-
const [navHidden, setNavHidden] =
|
|
10711
|
-
const [isFloating, setIsFloating] =
|
|
10712
|
-
const [sidebarPos, setSidebarPos] =
|
|
10713
|
-
const [pricingBarVisible, setPricingBarVisible] =
|
|
10714
|
-
const navRef =
|
|
10715
|
-
const navSentinelRef =
|
|
10716
|
-
const sentinelRef =
|
|
10717
|
-
const sidebarPlaceholderRef =
|
|
10718
|
-
const pricingBarRef =
|
|
10719
|
-
const galleryRef =
|
|
10720
|
-
const sections =
|
|
10796
|
+
const [navFloating, setNavFloating] = React8.useState(false);
|
|
10797
|
+
const [navHidden, setNavHidden] = React8.useState(false);
|
|
10798
|
+
const [isFloating, setIsFloating] = React8.useState(false);
|
|
10799
|
+
const [sidebarPos, setSidebarPos] = React8.useState(null);
|
|
10800
|
+
const [pricingBarVisible, setPricingBarVisible] = React8.useState(false);
|
|
10801
|
+
const navRef = React8.useRef(null);
|
|
10802
|
+
const navSentinelRef = React8.useRef(null);
|
|
10803
|
+
const sentinelRef = React8.useRef(null);
|
|
10804
|
+
const sidebarPlaceholderRef = React8.useRef(null);
|
|
10805
|
+
const pricingBarRef = React8.useRef(null);
|
|
10806
|
+
const galleryRef = React8.useRef(null);
|
|
10807
|
+
const sections = React8.useMemo(
|
|
10721
10808
|
() => [
|
|
10722
10809
|
{ id: "overview", label: "Overview", show: !!(overview || (overviewHighlights == null ? void 0 : overviewHighlights.length)) },
|
|
10723
10810
|
{
|
|
@@ -10735,7 +10822,7 @@ function TripPage({
|
|
|
10735
10822
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10736
10823
|
[]
|
|
10737
10824
|
);
|
|
10738
|
-
|
|
10825
|
+
React8.useEffect(() => {
|
|
10739
10826
|
const sentinel = navSentinelRef.current;
|
|
10740
10827
|
if (!sentinel) return;
|
|
10741
10828
|
const update = () => setNavFloating(sentinel.getBoundingClientRect().top < 1);
|
|
@@ -10743,7 +10830,7 @@ function TripPage({
|
|
|
10743
10830
|
update();
|
|
10744
10831
|
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
10745
10832
|
}, []);
|
|
10746
|
-
|
|
10833
|
+
React8.useEffect(() => {
|
|
10747
10834
|
const sentinel = sentinelRef.current;
|
|
10748
10835
|
if (!sentinel) return;
|
|
10749
10836
|
const update = () => setIsFloating(sentinel.getBoundingClientRect().top < 1);
|
|
@@ -10751,7 +10838,7 @@ function TripPage({
|
|
|
10751
10838
|
update();
|
|
10752
10839
|
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
10753
10840
|
}, []);
|
|
10754
|
-
|
|
10841
|
+
React8.useEffect(() => {
|
|
10755
10842
|
const measure = () => {
|
|
10756
10843
|
if (!sidebarPlaceholderRef.current) return;
|
|
10757
10844
|
const rect = sidebarPlaceholderRef.current.getBoundingClientRect();
|
|
@@ -10761,7 +10848,7 @@ function TripPage({
|
|
|
10761
10848
|
window.addEventListener("resize", measure);
|
|
10762
10849
|
return () => window.removeEventListener("resize", measure);
|
|
10763
10850
|
}, [isFloating]);
|
|
10764
|
-
|
|
10851
|
+
React8.useEffect(() => {
|
|
10765
10852
|
const check = () => {
|
|
10766
10853
|
var _a;
|
|
10767
10854
|
const target = (_a = galleryRef.current) != null ? _a : pricingBarRef.current;
|
|
@@ -10772,7 +10859,7 @@ function TripPage({
|
|
|
10772
10859
|
check();
|
|
10773
10860
|
return () => document.removeEventListener("scroll", check, { capture: true });
|
|
10774
10861
|
}, []);
|
|
10775
|
-
|
|
10862
|
+
React8.useEffect(() => {
|
|
10776
10863
|
const check = () => {
|
|
10777
10864
|
if (!pricingBarRef.current) return;
|
|
10778
10865
|
setNavHidden(pricingBarRef.current.getBoundingClientRect().top < window.innerHeight * 0.92);
|
|
@@ -10781,7 +10868,7 @@ function TripPage({
|
|
|
10781
10868
|
check();
|
|
10782
10869
|
return () => document.removeEventListener("scroll", check, { capture: true });
|
|
10783
10870
|
}, []);
|
|
10784
|
-
|
|
10871
|
+
React8.useEffect(() => {
|
|
10785
10872
|
if (sections.length === 0) return;
|
|
10786
10873
|
setActiveSection(sections[0].id);
|
|
10787
10874
|
const update = () => {
|
|
@@ -11303,12 +11390,12 @@ function Toast({
|
|
|
11303
11390
|
duration = 6e3,
|
|
11304
11391
|
className
|
|
11305
11392
|
}) {
|
|
11306
|
-
const [mounted, setMounted] =
|
|
11307
|
-
const [visible, setVisible] =
|
|
11308
|
-
|
|
11393
|
+
const [mounted, setMounted] = React8.useState(false);
|
|
11394
|
+
const [visible, setVisible] = React8.useState(true);
|
|
11395
|
+
React8.useEffect(() => {
|
|
11309
11396
|
setMounted(true);
|
|
11310
11397
|
}, []);
|
|
11311
|
-
|
|
11398
|
+
React8.useEffect(() => {
|
|
11312
11399
|
if (duration === 0) return;
|
|
11313
11400
|
const t = setTimeout(() => {
|
|
11314
11401
|
setVisible(false);
|