@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.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React8 = require('react');
|
|
4
4
|
var classVarianceAuthority = require('class-variance-authority');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -37,7 +37,7 @@ function _interopNamespace(e) {
|
|
|
37
37
|
return Object.freeze(n);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var React8__namespace = /*#__PURE__*/_interopNamespace(React8);
|
|
41
41
|
|
|
42
42
|
var __defProp = Object.defineProperty;
|
|
43
43
|
var __defProps = Object.defineProperties;
|
|
@@ -102,7 +102,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
);
|
|
105
|
-
var Button =
|
|
105
|
+
var Button = React8__namespace.forwardRef(
|
|
106
106
|
(_a, ref) => {
|
|
107
107
|
var _b = _a, { className, variant, size } = _b, props = __objRest(_b, ["className", "variant", "size"]);
|
|
108
108
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -323,10 +323,10 @@ function DialogDescription(_a) {
|
|
|
323
323
|
}, props)
|
|
324
324
|
);
|
|
325
325
|
}
|
|
326
|
-
var FloatingInput =
|
|
326
|
+
var FloatingInput = React8__namespace.forwardRef(
|
|
327
327
|
(_a, ref) => {
|
|
328
328
|
var _b = _a, { label, error, id, className, required } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required"]);
|
|
329
|
-
const inputId = id != null ? id :
|
|
329
|
+
const inputId = id != null ? id : React8__namespace.useId();
|
|
330
330
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
331
331
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
332
332
|
"input",
|
|
@@ -366,10 +366,10 @@ var FloatingInput = React25__namespace.forwardRef(
|
|
|
366
366
|
}
|
|
367
367
|
);
|
|
368
368
|
FloatingInput.displayName = "FloatingInput";
|
|
369
|
-
var FloatingSelect =
|
|
369
|
+
var FloatingSelect = React8__namespace.forwardRef(
|
|
370
370
|
(_a, ref) => {
|
|
371
371
|
var _b = _a, { label, error, id, className, required, children, value } = _b, props = __objRest(_b, ["label", "error", "id", "className", "required", "children", "value"]);
|
|
372
|
-
const inputId = id != null ? id :
|
|
372
|
+
const inputId = id != null ? id : React8__namespace.useId();
|
|
373
373
|
const hasValue = typeof value === "string" ? value !== "" : value !== void 0 && value !== null;
|
|
374
374
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative", className), children: [
|
|
375
375
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -633,11 +633,11 @@ function PhoneCountrySelect({
|
|
|
633
633
|
disabled
|
|
634
634
|
}) {
|
|
635
635
|
var _a;
|
|
636
|
-
const [open, setOpen] =
|
|
637
|
-
const containerRef =
|
|
638
|
-
const listRef =
|
|
636
|
+
const [open, setOpen] = React8__namespace.useState(false);
|
|
637
|
+
const containerRef = React8__namespace.useRef(null);
|
|
638
|
+
const listRef = React8__namespace.useRef(null);
|
|
639
639
|
const selected = (_a = PHONE_COUNTRIES.find((c) => c.code === value)) != null ? _a : PHONE_COUNTRIES[0];
|
|
640
|
-
|
|
640
|
+
React8__namespace.useEffect(() => {
|
|
641
641
|
if (!open) return;
|
|
642
642
|
const handler = (e) => {
|
|
643
643
|
var _a2;
|
|
@@ -648,7 +648,7 @@ function PhoneCountrySelect({
|
|
|
648
648
|
document.addEventListener("mousedown", handler);
|
|
649
649
|
return () => document.removeEventListener("mousedown", handler);
|
|
650
650
|
}, [open]);
|
|
651
|
-
|
|
651
|
+
React8__namespace.useEffect(() => {
|
|
652
652
|
if (!open || !listRef.current) return;
|
|
653
653
|
const activeEl = listRef.current.querySelector("[data-selected=true]");
|
|
654
654
|
activeEl == null ? void 0 : activeEl.scrollIntoView({ block: "nearest" });
|
|
@@ -918,8 +918,8 @@ function CalendarDayButton(_a) {
|
|
|
918
918
|
"locale"
|
|
919
919
|
]);
|
|
920
920
|
const defaultClassNames = reactDayPicker.getDefaultClassNames();
|
|
921
|
-
const ref =
|
|
922
|
-
|
|
921
|
+
const ref = React8__namespace.useRef(null);
|
|
922
|
+
React8__namespace.useEffect(() => {
|
|
923
923
|
var _a2;
|
|
924
924
|
if (modifiers.focused) (_a2 = ref.current) == null ? void 0 : _a2.focus();
|
|
925
925
|
}, [modifiers.focused]);
|
|
@@ -950,16 +950,16 @@ function BirthDateField({
|
|
|
950
950
|
className,
|
|
951
951
|
disabled
|
|
952
952
|
}) {
|
|
953
|
-
const [open, setOpen] =
|
|
954
|
-
const [text, setText] =
|
|
953
|
+
const [open, setOpen] = React8__namespace.useState(false);
|
|
954
|
+
const [text, setText] = React8__namespace.useState(
|
|
955
955
|
value ? dateFns.format(value, "dd/MM/yyyy") : ""
|
|
956
956
|
);
|
|
957
|
-
const containerRef =
|
|
958
|
-
const inputId =
|
|
959
|
-
|
|
957
|
+
const containerRef = React8__namespace.useRef(null);
|
|
958
|
+
const inputId = React8__namespace.useId();
|
|
959
|
+
React8__namespace.useEffect(() => {
|
|
960
960
|
setText(value ? dateFns.format(value, "dd/MM/yyyy") : "");
|
|
961
961
|
}, [value]);
|
|
962
|
-
|
|
962
|
+
React8__namespace.useEffect(() => {
|
|
963
963
|
if (!open) return;
|
|
964
964
|
const handler = (e) => {
|
|
965
965
|
var _a;
|
|
@@ -1168,14 +1168,14 @@ function CountrySearchField({
|
|
|
1168
1168
|
}) {
|
|
1169
1169
|
var _a;
|
|
1170
1170
|
const list = countries != null ? countries : COUNTRIES;
|
|
1171
|
-
const [query, setQuery] =
|
|
1172
|
-
const [open, setOpen] =
|
|
1173
|
-
const containerRef =
|
|
1174
|
-
const searchRef =
|
|
1171
|
+
const [query, setQuery] = React8__namespace.useState("");
|
|
1172
|
+
const [open, setOpen] = React8__namespace.useState(false);
|
|
1173
|
+
const containerRef = React8__namespace.useRef(null);
|
|
1174
|
+
const searchRef = React8__namespace.useRef(null);
|
|
1175
1175
|
const selected = list.find((c) => c.code === value);
|
|
1176
1176
|
const isFloated = open || !!selected;
|
|
1177
1177
|
const filtered = query.trim() ? list.filter((c) => c.name.toLowerCase().includes(query.toLowerCase())) : list;
|
|
1178
|
-
|
|
1178
|
+
React8__namespace.useEffect(() => {
|
|
1179
1179
|
if (!open) return;
|
|
1180
1180
|
const handler = (e) => {
|
|
1181
1181
|
var _a2;
|
|
@@ -1289,7 +1289,7 @@ function AdventureCard({
|
|
|
1289
1289
|
}) {
|
|
1290
1290
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
1291
1291
|
const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
|
|
1292
|
-
const [checkedInternal, setCheckedInternal] =
|
|
1292
|
+
const [checkedInternal, setCheckedInternal] = React8__namespace.useState(
|
|
1293
1293
|
new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
|
|
1294
1294
|
);
|
|
1295
1295
|
const isChecked = (opt) => {
|
|
@@ -1687,7 +1687,7 @@ function BookingShell({
|
|
|
1687
1687
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card overflow-hidden", children: [
|
|
1688
1688
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-b border-border px-5 py-4 bg-muted/20", children: [
|
|
1689
1689
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-base font-bold text-foreground font-heading mb-2", children: title }),
|
|
1690
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1690
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: steps.map((label, i) => /* @__PURE__ */ jsxRuntime.jsxs(React8__namespace.Fragment, { children: [
|
|
1691
1691
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1692
1692
|
"span",
|
|
1693
1693
|
{
|
|
@@ -1886,7 +1886,7 @@ function TermsSection({
|
|
|
1886
1886
|
termsContent
|
|
1887
1887
|
}) {
|
|
1888
1888
|
var _a;
|
|
1889
|
-
const [modalOpen, setModalOpen] =
|
|
1889
|
+
const [modalOpen, setModalOpen] = React8__namespace.useState(false);
|
|
1890
1890
|
const i18n = (_a = TERMS_I18N[locale]) != null ? _a : TERMS_I18N.en;
|
|
1891
1891
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-xl border border-border p-4 flex flex-col gap-3", children: [
|
|
1892
1892
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: title }),
|
|
@@ -2024,9 +2024,9 @@ function BookingWizard({
|
|
|
2024
2024
|
}) {
|
|
2025
2025
|
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;
|
|
2026
2026
|
const wizardSteps = WIZARD_STEPS_FN(labels);
|
|
2027
|
-
const [step, setStep] =
|
|
2028
|
-
const [error, setError] =
|
|
2029
|
-
const [responsible, setResponsible] =
|
|
2027
|
+
const [step, setStep] = React8__namespace.useState("responsible");
|
|
2028
|
+
const [error, setError] = React8__namespace.useState(null);
|
|
2029
|
+
const [responsible, setResponsible] = React8__namespace.useState({
|
|
2030
2030
|
firstName: "",
|
|
2031
2031
|
lastName: "",
|
|
2032
2032
|
email: "",
|
|
@@ -2045,7 +2045,7 @@ function BookingWizard({
|
|
|
2045
2045
|
return s + ((_b2 = (_a2 = a.slots) == null ? void 0 : _a2.children) != null ? _b2 : 0);
|
|
2046
2046
|
}, 0);
|
|
2047
2047
|
const totalPax = totalAdults + totalChildren;
|
|
2048
|
-
const [travellers, setTravellers] =
|
|
2048
|
+
const [travellers, setTravellers] = React8__namespace.useState(
|
|
2049
2049
|
Array.from({ length: Math.max(totalPax, 1) }, () => ({
|
|
2050
2050
|
firstName: "",
|
|
2051
2051
|
lastName: "",
|
|
@@ -2053,9 +2053,9 @@ function BookingWizard({
|
|
|
2053
2053
|
email: ""
|
|
2054
2054
|
}))
|
|
2055
2055
|
);
|
|
2056
|
-
const [payAmount, setPayAmount] =
|
|
2057
|
-
const [payMethod, setPayMethod] =
|
|
2058
|
-
const [termsAccepted, setTermsAccepted] =
|
|
2056
|
+
const [payAmount, setPayAmount] = React8__namespace.useState("full");
|
|
2057
|
+
const [payMethod, setPayMethod] = React8__namespace.useState("stripe");
|
|
2058
|
+
const [termsAccepted, setTermsAccepted] = React8__namespace.useState(false);
|
|
2059
2059
|
const setR = (k, v) => setResponsible((p) => __spreadProps(__spreadValues({}, p), { [k]: v }));
|
|
2060
2060
|
const setT = (i, k, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { [k]: v }) : t));
|
|
2061
2061
|
const setTDob = (i, v) => setTravellers((prev) => prev.map((t, idx) => idx === i ? __spreadProps(__spreadValues({}, t), { dateOfBirth: v }) : t));
|
|
@@ -2282,7 +2282,7 @@ function Offer({
|
|
|
2282
2282
|
className
|
|
2283
2283
|
}) {
|
|
2284
2284
|
var _a, _b, _c;
|
|
2285
|
-
const [showBooking, setShowBooking] =
|
|
2285
|
+
const [showBooking, setShowBooking] = React8__namespace.useState(false);
|
|
2286
2286
|
const isShowingCheckout = !confirmedState && (!!checkoutSlot || showBooking);
|
|
2287
2287
|
const handleBook = () => {
|
|
2288
2288
|
if (!checkoutSlot && !externalBookingFlow) setShowBooking(true);
|
|
@@ -2642,11 +2642,12 @@ function AdventureSection({
|
|
|
2642
2642
|
onRequestOpenAddModal,
|
|
2643
2643
|
onRequestOpenEditModal,
|
|
2644
2644
|
onRequestOpenDeleteModal,
|
|
2645
|
+
onRequestOpenResendInviteDialog,
|
|
2645
2646
|
cannotRemoveLastTravellerLabel,
|
|
2646
2647
|
labels
|
|
2647
2648
|
}) {
|
|
2648
2649
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
2649
|
-
const [detailsOpen, setDetailsOpen] =
|
|
2650
|
+
const [detailsOpen, setDetailsOpen] = React8__namespace.useState(false);
|
|
2650
2651
|
const handleCopyUrl = (url) => {
|
|
2651
2652
|
if (onCopyFormLink) {
|
|
2652
2653
|
onCopyFormLink(url);
|
|
@@ -2896,7 +2897,13 @@ function AdventureSection({
|
|
|
2896
2897
|
"button",
|
|
2897
2898
|
{
|
|
2898
2899
|
type: "button",
|
|
2899
|
-
onClick: () =>
|
|
2900
|
+
onClick: () => {
|
|
2901
|
+
if (onRequestOpenResendInviteDialog) {
|
|
2902
|
+
onRequestOpenResendInviteDialog(t);
|
|
2903
|
+
} else {
|
|
2904
|
+
onResendInvite(t.id);
|
|
2905
|
+
}
|
|
2906
|
+
},
|
|
2900
2907
|
disabled: resendingInviteTravellerIds == null ? void 0 : resendingInviteTravellerIds.has(t.id),
|
|
2901
2908
|
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",
|
|
2902
2909
|
"aria-label": resendInviteAriaLabel != null ? resendInviteAriaLabel : "Resend registration invite",
|
|
@@ -3152,8 +3159,8 @@ function AddTravellerDialog({
|
|
|
3152
3159
|
errorMessage
|
|
3153
3160
|
}) {
|
|
3154
3161
|
var _a, _b, _c, _d, _e;
|
|
3155
|
-
const [form, setForm] =
|
|
3156
|
-
|
|
3162
|
+
const [form, setForm] = React8__namespace.useState(() => createInitialAddFormData(config));
|
|
3163
|
+
React8__namespace.useEffect(() => {
|
|
3157
3164
|
if (open) {
|
|
3158
3165
|
setForm(createInitialAddFormData(config));
|
|
3159
3166
|
}
|
|
@@ -3213,7 +3220,7 @@ function EditTravellerDialog({
|
|
|
3213
3220
|
errorMessage
|
|
3214
3221
|
}) {
|
|
3215
3222
|
var _a, _b, _c, _d, _e;
|
|
3216
|
-
const [form, setForm] =
|
|
3223
|
+
const [form, setForm] = React8__namespace.useState(() => ({
|
|
3217
3224
|
firstName: "",
|
|
3218
3225
|
lastName: "",
|
|
3219
3226
|
email: "",
|
|
@@ -3222,7 +3229,7 @@ function EditTravellerDialog({
|
|
|
3222
3229
|
birthDate: "",
|
|
3223
3230
|
personType: "ADULT"
|
|
3224
3231
|
}));
|
|
3225
|
-
|
|
3232
|
+
React8__namespace.useEffect(() => {
|
|
3226
3233
|
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
3227
3234
|
if (open && traveller) {
|
|
3228
3235
|
setForm({
|
|
@@ -3332,6 +3339,58 @@ function DeleteTravellerDialog({
|
|
|
3332
3339
|
}
|
|
3333
3340
|
);
|
|
3334
3341
|
}
|
|
3342
|
+
function ResendInviteConfirmDialog({
|
|
3343
|
+
open,
|
|
3344
|
+
travellerName: _travellerName,
|
|
3345
|
+
onClose,
|
|
3346
|
+
onConfirm,
|
|
3347
|
+
labels,
|
|
3348
|
+
submitting
|
|
3349
|
+
}) {
|
|
3350
|
+
var _a, _b, _c, _d, _e;
|
|
3351
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3352
|
+
Dialog,
|
|
3353
|
+
{
|
|
3354
|
+
open,
|
|
3355
|
+
onOpenChange: (o) => {
|
|
3356
|
+
if (!o) onClose();
|
|
3357
|
+
},
|
|
3358
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-sm text-foreground", children: [
|
|
3359
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogHeader, { children: [
|
|
3360
|
+
/* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: "text-foreground font-heading text-base", children: (_a = labels == null ? void 0 : labels.title) != null ? _a : "Resend registration invite?" }),
|
|
3361
|
+
/* @__PURE__ */ jsxRuntime.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." })
|
|
3362
|
+
] }),
|
|
3363
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 rounded-lg bg-amber-500/10 border border-amber-500/30 px-3 py-2", children: [
|
|
3364
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangleIcon, { className: "h-4 w-4 text-amber-600 mt-0.5 shrink-0" }),
|
|
3365
|
+
/* @__PURE__ */ jsxRuntime.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." })
|
|
3366
|
+
] }),
|
|
3367
|
+
/* @__PURE__ */ jsxRuntime.jsxs(DialogFooter, { children: [
|
|
3368
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3369
|
+
Button,
|
|
3370
|
+
{
|
|
3371
|
+
type: "button",
|
|
3372
|
+
variant: "outline",
|
|
3373
|
+
size: "sm",
|
|
3374
|
+
onClick: onClose,
|
|
3375
|
+
disabled: submitting,
|
|
3376
|
+
children: (_d = labels == null ? void 0 : labels.cancel) != null ? _d : "Cancel"
|
|
3377
|
+
}
|
|
3378
|
+
),
|
|
3379
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3380
|
+
Button,
|
|
3381
|
+
{
|
|
3382
|
+
type: "button",
|
|
3383
|
+
size: "sm",
|
|
3384
|
+
disabled: submitting,
|
|
3385
|
+
onClick: () => void onConfirm(),
|
|
3386
|
+
children: (_e = labels == null ? void 0 : labels.confirm) != null ? _e : "Resend invite"
|
|
3387
|
+
}
|
|
3388
|
+
)
|
|
3389
|
+
] })
|
|
3390
|
+
] })
|
|
3391
|
+
}
|
|
3392
|
+
);
|
|
3393
|
+
}
|
|
3335
3394
|
function OrderSummary({
|
|
3336
3395
|
adventures,
|
|
3337
3396
|
summaryLineItems,
|
|
@@ -3500,43 +3559,53 @@ function BookingDetails({
|
|
|
3500
3559
|
labels,
|
|
3501
3560
|
className
|
|
3502
3561
|
}) {
|
|
3503
|
-
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;
|
|
3562
|
+
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;
|
|
3504
3563
|
const people = totalPeople(adventures);
|
|
3505
3564
|
const hasSubmitAddTraveller = !!onSubmitAddTraveller;
|
|
3506
3565
|
const hasSubmitEditTraveller = !!onSubmitEditTraveller;
|
|
3507
3566
|
const hasConfirmRemoveTraveller = !!onConfirmRemoveTraveller;
|
|
3508
|
-
const [addModalState, setAddModalState] =
|
|
3567
|
+
const [addModalState, setAddModalState] = React8__namespace.useState({
|
|
3509
3568
|
open: false,
|
|
3510
3569
|
adventureId: null
|
|
3511
3570
|
});
|
|
3512
|
-
const [editModalState, setEditModalState] =
|
|
3513
|
-
const [deleteModalState, setDeleteModalState] =
|
|
3514
|
-
const
|
|
3571
|
+
const [editModalState, setEditModalState] = React8__namespace.useState({ open: false, adventureId: null, traveller: null });
|
|
3572
|
+
const [deleteModalState, setDeleteModalState] = React8__namespace.useState({ open: false, adventureId: null, traveller: null });
|
|
3573
|
+
const [resendInviteDialogState, setResendInviteDialogState] = React8__namespace.useState({ open: false, traveller: null });
|
|
3574
|
+
const handleRequestOpenAddModal = React8__namespace.useCallback((adventureId) => {
|
|
3515
3575
|
setAddModalState({ open: true, adventureId });
|
|
3516
3576
|
}, []);
|
|
3517
|
-
const handleRequestOpenEditModal =
|
|
3577
|
+
const handleRequestOpenEditModal = React8__namespace.useCallback(
|
|
3518
3578
|
(adventureId, traveller) => {
|
|
3519
3579
|
setEditModalState({ open: true, adventureId, traveller });
|
|
3520
3580
|
},
|
|
3521
3581
|
[]
|
|
3522
3582
|
);
|
|
3523
|
-
const handleRequestOpenDeleteModal =
|
|
3583
|
+
const handleRequestOpenDeleteModal = React8__namespace.useCallback(
|
|
3524
3584
|
(adventureId, traveller) => {
|
|
3525
3585
|
setDeleteModalState({ open: true, adventureId, traveller });
|
|
3526
3586
|
},
|
|
3527
3587
|
[]
|
|
3528
3588
|
);
|
|
3529
|
-
const
|
|
3589
|
+
const handleRequestOpenResendInviteDialog = React8__namespace.useCallback(
|
|
3590
|
+
(traveller) => {
|
|
3591
|
+
setResendInviteDialogState({ open: true, traveller });
|
|
3592
|
+
},
|
|
3593
|
+
[]
|
|
3594
|
+
);
|
|
3595
|
+
const closeAddModal = React8__namespace.useCallback(() => {
|
|
3530
3596
|
setAddModalState({ open: false, adventureId: null });
|
|
3531
3597
|
}, []);
|
|
3532
|
-
const closeEditModal =
|
|
3598
|
+
const closeEditModal = React8__namespace.useCallback(() => {
|
|
3533
3599
|
setEditModalState({ open: false, adventureId: null, traveller: null });
|
|
3534
3600
|
}, []);
|
|
3535
|
-
const closeDeleteModal =
|
|
3601
|
+
const closeDeleteModal = React8__namespace.useCallback(() => {
|
|
3536
3602
|
setDeleteModalState({ open: false, adventureId: null, traveller: null });
|
|
3537
3603
|
}, []);
|
|
3538
|
-
const
|
|
3539
|
-
|
|
3604
|
+
const closeResendInviteDialog = React8__namespace.useCallback(() => {
|
|
3605
|
+
setResendInviteDialogState({ open: false, traveller: null });
|
|
3606
|
+
}, []);
|
|
3607
|
+
const submitInFlightRef = React8__namespace.useRef(false);
|
|
3608
|
+
const handleAddSubmit = React8__namespace.useCallback(
|
|
3540
3609
|
async (adventureId, data) => {
|
|
3541
3610
|
if (!onSubmitAddTraveller) return;
|
|
3542
3611
|
if (submitInFlightRef.current) return;
|
|
@@ -3551,7 +3620,7 @@ function BookingDetails({
|
|
|
3551
3620
|
},
|
|
3552
3621
|
[onSubmitAddTraveller, closeAddModal]
|
|
3553
3622
|
);
|
|
3554
|
-
const handleEditSubmit =
|
|
3623
|
+
const handleEditSubmit = React8__namespace.useCallback(
|
|
3555
3624
|
async (adventureId, travellerId, data) => {
|
|
3556
3625
|
if (!onSubmitEditTraveller) return;
|
|
3557
3626
|
if (submitInFlightRef.current) return;
|
|
@@ -3566,7 +3635,7 @@ function BookingDetails({
|
|
|
3566
3635
|
},
|
|
3567
3636
|
[onSubmitEditTraveller, closeEditModal]
|
|
3568
3637
|
);
|
|
3569
|
-
const handleDeleteConfirm =
|
|
3638
|
+
const handleDeleteConfirm = React8__namespace.useCallback(
|
|
3570
3639
|
async (adventureId, travellerId) => {
|
|
3571
3640
|
if (!onConfirmRemoveTraveller) return;
|
|
3572
3641
|
if (submitInFlightRef.current) return;
|
|
@@ -3680,6 +3749,7 @@ function BookingDetails({
|
|
|
3680
3749
|
onRequestOpenAddModal: handleRequestOpenAddModal,
|
|
3681
3750
|
onRequestOpenEditModal: handleRequestOpenEditModal,
|
|
3682
3751
|
onRequestOpenDeleteModal: handleRequestOpenDeleteModal,
|
|
3752
|
+
onRequestOpenResendInviteDialog: handleRequestOpenResendInviteDialog,
|
|
3683
3753
|
cannotRemoveLastTravellerLabel,
|
|
3684
3754
|
labels
|
|
3685
3755
|
},
|
|
@@ -3812,6 +3882,23 @@ function BookingDetails({
|
|
|
3812
3882
|
saving: removeTravellerSaving,
|
|
3813
3883
|
errorMessage: deleteModalState.open ? travellerFormError : null
|
|
3814
3884
|
}
|
|
3885
|
+
),
|
|
3886
|
+
onResendInvite && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3887
|
+
ResendInviteConfirmDialog,
|
|
3888
|
+
{
|
|
3889
|
+
open: resendInviteDialogState.open,
|
|
3890
|
+
travellerName: resendInviteDialogState.traveller ? `${(_G = resendInviteDialogState.traveller.firstName) != null ? _G : ""} ${(_H = resendInviteDialogState.traveller.lastName) != null ? _H : ""}`.trim() : "",
|
|
3891
|
+
onClose: closeResendInviteDialog,
|
|
3892
|
+
onConfirm: () => {
|
|
3893
|
+
const traveller = resendInviteDialogState.traveller;
|
|
3894
|
+
if (traveller) {
|
|
3895
|
+
onResendInvite(traveller.id);
|
|
3896
|
+
}
|
|
3897
|
+
closeResendInviteDialog();
|
|
3898
|
+
},
|
|
3899
|
+
labels: labels == null ? void 0 : labels.resendInviteDialog,
|
|
3900
|
+
submitting: resendInviteDialogState.traveller ? resendingInviteTravellerIds == null ? void 0 : resendingInviteTravellerIds.has(resendInviteDialogState.traveller.id) : false
|
|
3901
|
+
}
|
|
3815
3902
|
)
|
|
3816
3903
|
] });
|
|
3817
3904
|
}
|
|
@@ -5022,7 +5109,7 @@ function BookingCreatedEmail({
|
|
|
5022
5109
|
}, children: i + 1 }) }),
|
|
5023
5110
|
/* @__PURE__ */ jsxRuntime.jsx("td", { style: { verticalAlign: "top" }, children: /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "14px", color: emailTokens.bodyText, lineHeight: "1.6", margin: 0 }, children: step }) })
|
|
5024
5111
|
] }) }) }, i)) }),
|
|
5025
|
-
nextStepsImportant && nextStepsImportant.trim().length > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { marginBottom: "32px", fontSize: "14px", color: emailTokens.foreground, lineHeight: "1.6" }, children: nextStepsImportant.split("\n").map((line, idx, arr) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5112
|
+
nextStepsImportant && nextStepsImportant.trim().length > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { style: { marginBottom: "32px", fontSize: "14px", color: emailTokens.foreground, lineHeight: "1.6" }, children: nextStepsImportant.split("\n").map((line, idx, arr) => /* @__PURE__ */ jsxRuntime.jsxs(React8__namespace.Fragment, { children: [
|
|
5026
5113
|
idx === 0 ? /* @__PURE__ */ jsxRuntime.jsx("strong", { children: line }) : line,
|
|
5027
5114
|
idx < arr.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx("br", {}) : null
|
|
5028
5115
|
] }, idx)) })
|
|
@@ -6391,11 +6478,11 @@ function DatePickerField({
|
|
|
6391
6478
|
fromDate,
|
|
6392
6479
|
className
|
|
6393
6480
|
}) {
|
|
6394
|
-
const [open, setOpen] =
|
|
6395
|
-
const containerRef =
|
|
6396
|
-
const [calendarWidth, setCalendarWidth] =
|
|
6481
|
+
const [open, setOpen] = React8__namespace.useState(false);
|
|
6482
|
+
const containerRef = React8__namespace.useRef(null);
|
|
6483
|
+
const [calendarWidth, setCalendarWidth] = React8__namespace.useState();
|
|
6397
6484
|
const hasValue = !!value;
|
|
6398
|
-
|
|
6485
|
+
React8__namespace.useEffect(() => {
|
|
6399
6486
|
if (!containerRef.current) return;
|
|
6400
6487
|
const observer = new ResizeObserver(([entry]) => {
|
|
6401
6488
|
setCalendarWidth(entry.contentRect.width);
|
|
@@ -6504,7 +6591,7 @@ function BookingForm({
|
|
|
6504
6591
|
subtitle = "Free enquiry \u2013 no commitment",
|
|
6505
6592
|
className
|
|
6506
6593
|
}) {
|
|
6507
|
-
const [values, setValues] =
|
|
6594
|
+
const [values, setValues] = React8__namespace.useState(__spreadValues(__spreadValues({}, defaultInitial), defaultValues));
|
|
6508
6595
|
const set = (key, value) => setValues((prev) => __spreadProps(__spreadValues({}, prev), { [key]: value }));
|
|
6509
6596
|
const handleSubmit = (e) => {
|
|
6510
6597
|
e.preventDefault();
|
|
@@ -7041,11 +7128,11 @@ function FloatingTextarea({
|
|
|
7041
7128
|
}
|
|
7042
7129
|
function SelectField({ field, value, onChange, error, disabled }) {
|
|
7043
7130
|
var _a, _b, _c;
|
|
7044
|
-
const [open, setOpen] =
|
|
7045
|
-
const containerRef =
|
|
7131
|
+
const [open, setOpen] = React8__namespace.useState(false);
|
|
7132
|
+
const containerRef = React8__namespace.useRef(null);
|
|
7046
7133
|
const options = (_a = field.options) != null ? _a : [];
|
|
7047
7134
|
const selectedOpt = (_b = options.find((o) => o.value === value)) != null ? _b : null;
|
|
7048
|
-
|
|
7135
|
+
React8__namespace.useEffect(() => {
|
|
7049
7136
|
if (!open) return;
|
|
7050
7137
|
const handleOutside = (e) => {
|
|
7051
7138
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -7434,11 +7521,11 @@ function RegistrationForm({
|
|
|
7434
7521
|
readOnly = false
|
|
7435
7522
|
}) {
|
|
7436
7523
|
var _a;
|
|
7437
|
-
const L =
|
|
7524
|
+
const L = React8__namespace.useMemo(
|
|
7438
7525
|
() => __spreadValues(__spreadValues({}, DEFAULT_LABELS9), labels != null ? labels : {}),
|
|
7439
7526
|
[labels]
|
|
7440
7527
|
);
|
|
7441
|
-
const sortedFields =
|
|
7528
|
+
const sortedFields = React8__namespace.useMemo(
|
|
7442
7529
|
() => [...fields].sort((a, b) => {
|
|
7443
7530
|
var _a2, _b;
|
|
7444
7531
|
return ((_a2 = a.order) != null ? _a2 : 0) - ((_b = b.order) != null ? _b : 0);
|
|
@@ -7446,7 +7533,7 @@ function RegistrationForm({
|
|
|
7446
7533
|
[fields]
|
|
7447
7534
|
);
|
|
7448
7535
|
const isControlled = values !== void 0;
|
|
7449
|
-
const [internal, setInternal] =
|
|
7536
|
+
const [internal, setInternal] = React8__namespace.useState(
|
|
7450
7537
|
() => initializeValues(
|
|
7451
7538
|
sortedFields,
|
|
7452
7539
|
defaultValues != null ? defaultValues : {},
|
|
@@ -7454,9 +7541,9 @@ function RegistrationForm({
|
|
|
7454
7541
|
includeTerms
|
|
7455
7542
|
)
|
|
7456
7543
|
);
|
|
7457
|
-
const [submitAttempted, setSubmitAttempted] =
|
|
7458
|
-
const [validationErrors, setValidationErrors] =
|
|
7459
|
-
|
|
7544
|
+
const [submitAttempted, setSubmitAttempted] = React8__namespace.useState(false);
|
|
7545
|
+
const [validationErrors, setValidationErrors] = React8__namespace.useState({});
|
|
7546
|
+
React8__namespace.useEffect(() => {
|
|
7460
7547
|
if (isControlled) return;
|
|
7461
7548
|
setInternal((prev) => {
|
|
7462
7549
|
const next = initializeValues(
|
|
@@ -7513,7 +7600,7 @@ function RegistrationForm({
|
|
|
7513
7600
|
const termsError = submitAttempted && termsEnabled && !termsAccepted;
|
|
7514
7601
|
const firstErrorFieldId = Object.keys(fieldErrors)[0];
|
|
7515
7602
|
const scrollTargetId = firstErrorFieldId ? `rf-${firstErrorFieldId}` : termsError ? "rf-terms" : null;
|
|
7516
|
-
|
|
7603
|
+
React8__namespace.useEffect(() => {
|
|
7517
7604
|
if (!submitAttempted || !scrollTargetId) return;
|
|
7518
7605
|
const timer = setTimeout(() => {
|
|
7519
7606
|
const elem = document.getElementById(scrollTargetId);
|
|
@@ -7975,10 +8062,10 @@ var OTPCodeInput = ({
|
|
|
7975
8062
|
id,
|
|
7976
8063
|
required
|
|
7977
8064
|
}) => {
|
|
7978
|
-
const baseId = id != null ? id :
|
|
7979
|
-
const inputRef =
|
|
7980
|
-
const [focused, setFocused] =
|
|
7981
|
-
const digits =
|
|
8065
|
+
const baseId = id != null ? id : React8__namespace.useId();
|
|
8066
|
+
const inputRef = React8__namespace.useRef(null);
|
|
8067
|
+
const [focused, setFocused] = React8__namespace.useState(false);
|
|
8068
|
+
const digits = React8__namespace.useMemo(() => {
|
|
7982
8069
|
const arr = value.split("").slice(0, length);
|
|
7983
8070
|
while (arr.length < length) arr.push("");
|
|
7984
8071
|
return arr;
|
|
@@ -8094,7 +8181,7 @@ function Checkbox(_a) {
|
|
|
8094
8181
|
})
|
|
8095
8182
|
);
|
|
8096
8183
|
}
|
|
8097
|
-
var AccordionVariantContext =
|
|
8184
|
+
var AccordionVariantContext = React8__namespace.createContext("default");
|
|
8098
8185
|
function Accordion(_a) {
|
|
8099
8186
|
var _b = _a, { className, variant = "default" } = _b, props = __objRest(_b, ["className", "variant"]);
|
|
8100
8187
|
return /* @__PURE__ */ jsxRuntime.jsx(AccordionVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8112,7 +8199,7 @@ function Accordion(_a) {
|
|
|
8112
8199
|
}
|
|
8113
8200
|
function AccordionItem(_a) {
|
|
8114
8201
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
8115
|
-
const variant =
|
|
8202
|
+
const variant = React8__namespace.useContext(AccordionVariantContext);
|
|
8116
8203
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8117
8204
|
accordion.Accordion.Item,
|
|
8118
8205
|
__spreadValues({
|
|
@@ -8133,7 +8220,7 @@ function AccordionTrigger(_a) {
|
|
|
8133
8220
|
"className",
|
|
8134
8221
|
"children"
|
|
8135
8222
|
]);
|
|
8136
|
-
const variant =
|
|
8223
|
+
const variant = React8__namespace.useContext(AccordionVariantContext);
|
|
8137
8224
|
return /* @__PURE__ */ jsxRuntime.jsx(accordion.Accordion.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8138
8225
|
accordion.Accordion.Trigger,
|
|
8139
8226
|
__spreadProps(__spreadValues({
|
|
@@ -8187,7 +8274,7 @@ function AccordionContent(_a) {
|
|
|
8187
8274
|
"className",
|
|
8188
8275
|
"children"
|
|
8189
8276
|
]);
|
|
8190
|
-
const variant =
|
|
8277
|
+
const variant = React8__namespace.useContext(AccordionVariantContext);
|
|
8191
8278
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8192
8279
|
accordion.Accordion.Panel,
|
|
8193
8280
|
__spreadProps(__spreadValues({
|
|
@@ -8219,7 +8306,7 @@ function FilterPanel({
|
|
|
8219
8306
|
title = "Filters",
|
|
8220
8307
|
className
|
|
8221
8308
|
}) {
|
|
8222
|
-
const [internalValue, setInternalValue] =
|
|
8309
|
+
const [internalValue, setInternalValue] = React8__namespace.useState(
|
|
8223
8310
|
() => Object.fromEntries(groups.map((g) => [g.id, []]))
|
|
8224
8311
|
);
|
|
8225
8312
|
const selected = value != null ? value : internalValue;
|
|
@@ -8318,8 +8405,8 @@ function FilterPanel({
|
|
|
8318
8405
|
var TRUSTPILOT_SCRIPT_SRC = "https://widget.trustpilot.com/bootstrap/v5/tp.widget.bootstrap.min.js";
|
|
8319
8406
|
function TrustpilotEmbed({ config }) {
|
|
8320
8407
|
var _a, _b, _c, _d, _e, _f;
|
|
8321
|
-
const ref =
|
|
8322
|
-
|
|
8408
|
+
const ref = React8__namespace.useRef(null);
|
|
8409
|
+
React8__namespace.useEffect(() => {
|
|
8323
8410
|
if (typeof document === "undefined" || !ref.current) return;
|
|
8324
8411
|
let cancelled = false;
|
|
8325
8412
|
const initWidget = () => {
|
|
@@ -8451,11 +8538,11 @@ function ItineraryModal({
|
|
|
8451
8538
|
onNext
|
|
8452
8539
|
}) {
|
|
8453
8540
|
var _a, _b, _c;
|
|
8454
|
-
const [imgIndex, setImgIndex] =
|
|
8541
|
+
const [imgIndex, setImgIndex] = React8__namespace.useState(0);
|
|
8455
8542
|
const images = stop ? [stop.coverImage, ...(_a = stop.images) != null ? _a : []] : [];
|
|
8456
8543
|
const isFirst = (stop == null ? void 0 : stop.dayNumber) === ((_b = allStops[0]) == null ? void 0 : _b.dayNumber);
|
|
8457
8544
|
const isLast = (stop == null ? void 0 : stop.dayNumber) === ((_c = allStops[allStops.length - 1]) == null ? void 0 : _c.dayNumber);
|
|
8458
|
-
|
|
8545
|
+
React8__namespace.useEffect(() => {
|
|
8459
8546
|
setImgIndex(0);
|
|
8460
8547
|
}, [stop == null ? void 0 : stop.dayNumber]);
|
|
8461
8548
|
if (!stop) return null;
|
|
@@ -8582,8 +8669,8 @@ function ItineraryModal({
|
|
|
8582
8669
|
) });
|
|
8583
8670
|
}
|
|
8584
8671
|
function Itinerary({ title, subtitle, stops, className }) {
|
|
8585
|
-
const [activeIndex, setActiveIndex] =
|
|
8586
|
-
const scrollRef =
|
|
8672
|
+
const [activeIndex, setActiveIndex] = React8__namespace.useState(null);
|
|
8673
|
+
const scrollRef = React8__namespace.useRef(null);
|
|
8587
8674
|
const activeStop = activeIndex !== null ? stops[activeIndex] : null;
|
|
8588
8675
|
const scrollBy = (dir) => {
|
|
8589
8676
|
if (!scrollRef.current) return;
|
|
@@ -8675,18 +8762,18 @@ function Lightbox({
|
|
|
8675
8762
|
onClose
|
|
8676
8763
|
}) {
|
|
8677
8764
|
var _a;
|
|
8678
|
-
const [index, setIndex] =
|
|
8765
|
+
const [index, setIndex] = React8__namespace.useState(initialIndex);
|
|
8679
8766
|
const total = photos.length;
|
|
8680
8767
|
const photo = photos[index];
|
|
8681
|
-
const prev =
|
|
8768
|
+
const prev = React8__namespace.useCallback(
|
|
8682
8769
|
() => setIndex((i) => (i - 1 + total) % total),
|
|
8683
8770
|
[total]
|
|
8684
8771
|
);
|
|
8685
|
-
const next =
|
|
8772
|
+
const next = React8__namespace.useCallback(
|
|
8686
8773
|
() => setIndex((i) => (i + 1) % total),
|
|
8687
8774
|
[total]
|
|
8688
8775
|
);
|
|
8689
|
-
|
|
8776
|
+
React8__namespace.useEffect(() => {
|
|
8690
8777
|
const onKey = (e) => {
|
|
8691
8778
|
if (e.key === "Escape") onClose();
|
|
8692
8779
|
if (e.key === "ArrowLeft") prev();
|
|
@@ -8852,7 +8939,7 @@ function GridGallery({
|
|
|
8852
8939
|
initialVisible,
|
|
8853
8940
|
onOpen
|
|
8854
8941
|
}) {
|
|
8855
|
-
const [expanded, setExpanded] =
|
|
8942
|
+
const [expanded, setExpanded] = React8__namespace.useState(false);
|
|
8856
8943
|
const cols = gridCols(photos.length);
|
|
8857
8944
|
const hasMore = photos.length > initialVisible;
|
|
8858
8945
|
const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
|
|
@@ -8882,7 +8969,7 @@ function MasonryGallery({
|
|
|
8882
8969
|
initialVisible,
|
|
8883
8970
|
onOpen
|
|
8884
8971
|
}) {
|
|
8885
|
-
const [expanded, setExpanded] =
|
|
8972
|
+
const [expanded, setExpanded] = React8__namespace.useState(false);
|
|
8886
8973
|
const hasMore = photos.length > initialVisible;
|
|
8887
8974
|
const visible = expanded || !hasMore ? photos : photos.slice(0, initialVisible);
|
|
8888
8975
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -8955,7 +9042,7 @@ function FeaturedGallery({
|
|
|
8955
9042
|
photos,
|
|
8956
9043
|
onOpen
|
|
8957
9044
|
}) {
|
|
8958
|
-
const [expanded, setExpanded] =
|
|
9045
|
+
const [expanded, setExpanded] = React8__namespace.useState(false);
|
|
8959
9046
|
const featured = photos.slice(0, 3);
|
|
8960
9047
|
const extra = photos.slice(3);
|
|
8961
9048
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -9122,9 +9209,9 @@ function PhotoGallery({
|
|
|
9122
9209
|
onPhotoClick,
|
|
9123
9210
|
className
|
|
9124
9211
|
}) {
|
|
9125
|
-
const [lightboxIndex, setLightboxIndex] =
|
|
9126
|
-
const [carouselIndex, setCarouselIndex] =
|
|
9127
|
-
const normalised =
|
|
9212
|
+
const [lightboxIndex, setLightboxIndex] = React8__namespace.useState(null);
|
|
9213
|
+
const [carouselIndex, setCarouselIndex] = React8__namespace.useState(0);
|
|
9214
|
+
const normalised = React8__namespace.useMemo(() => photos.map(normalise), [photos]);
|
|
9128
9215
|
const handleOpen = (index) => {
|
|
9129
9216
|
setLightboxIndex(index);
|
|
9130
9217
|
onPhotoClick == null ? void 0 : onPhotoClick(normalised[index].src, index);
|
|
@@ -9200,7 +9287,7 @@ function ItineraryDay({
|
|
|
9200
9287
|
photoLayout = "rounded",
|
|
9201
9288
|
className
|
|
9202
9289
|
}) {
|
|
9203
|
-
const photoList =
|
|
9290
|
+
const photoList = React8__namespace.useMemo(() => normalisePhotos(photos), [photos]);
|
|
9204
9291
|
const isFullBleed = photoLayout === "fullBleed" || photoLayout === "fullBleedBottom";
|
|
9205
9292
|
const photoPosition = photoLayout === "fullBleedBottom" ? "bottom" : "top";
|
|
9206
9293
|
const gallery = photoList.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9252,8 +9339,8 @@ function MenuTrip({
|
|
|
9252
9339
|
bold = true,
|
|
9253
9340
|
className
|
|
9254
9341
|
}) {
|
|
9255
|
-
const scrollRef =
|
|
9256
|
-
|
|
9342
|
+
const scrollRef = React8__namespace.useRef(null);
|
|
9343
|
+
React8__namespace.useEffect(() => {
|
|
9257
9344
|
if (!scrollRef.current || !activeSection) return;
|
|
9258
9345
|
const container = scrollRef.current;
|
|
9259
9346
|
const btn = container.querySelector(
|
|
@@ -9444,8 +9531,8 @@ function PricingTrip({
|
|
|
9444
9531
|
className
|
|
9445
9532
|
}) {
|
|
9446
9533
|
const rOuter = sharp ? "rounded-none" : "rounded-2xl";
|
|
9447
|
-
const [showEstimates, setShowEstimates] =
|
|
9448
|
-
const [showPriceInfo, setShowPriceInfo] =
|
|
9534
|
+
const [showEstimates, setShowEstimates] = React8__namespace.useState(false);
|
|
9535
|
+
const [showPriceInfo, setShowPriceInfo] = React8__namespace.useState(false);
|
|
9449
9536
|
if (variant === "compact") {
|
|
9450
9537
|
const showOverlay = showPriceInfo && (!!priceInfo || !!currencyEstimates && currencyEstimates.length > 0);
|
|
9451
9538
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
@@ -9885,14 +9972,14 @@ function SiteHeader({
|
|
|
9885
9972
|
className
|
|
9886
9973
|
}) {
|
|
9887
9974
|
const t = VARIANT[variant];
|
|
9888
|
-
const [openMenu, setOpenMenu] =
|
|
9889
|
-
const [langOpen, setLangOpen] =
|
|
9890
|
-
const [mobileOpen, setMobileOpen] =
|
|
9891
|
-
const [openMobileSection, setOpenMobileSection] =
|
|
9892
|
-
const [activeLang, setActiveLang] =
|
|
9975
|
+
const [openMenu, setOpenMenu] = React8__namespace.useState(null);
|
|
9976
|
+
const [langOpen, setLangOpen] = React8__namespace.useState(false);
|
|
9977
|
+
const [mobileOpen, setMobileOpen] = React8__namespace.useState(false);
|
|
9978
|
+
const [openMobileSection, setOpenMobileSection] = React8__namespace.useState(null);
|
|
9979
|
+
const [activeLang, setActiveLang] = React8__namespace.useState(currentLanguage);
|
|
9893
9980
|
const toggleMobileSection = (label) => setOpenMobileSection((prev) => prev === label ? null : label);
|
|
9894
|
-
const menuCloseTimer =
|
|
9895
|
-
const langCloseTimer =
|
|
9981
|
+
const menuCloseTimer = React8__namespace.useRef(void 0);
|
|
9982
|
+
const langCloseTimer = React8__namespace.useRef(void 0);
|
|
9896
9983
|
const handleMenuEnter = (label) => {
|
|
9897
9984
|
clearTimeout(menuCloseTimer.current);
|
|
9898
9985
|
setOpenMenu(label);
|
|
@@ -9913,7 +10000,7 @@ function SiteHeader({
|
|
|
9913
10000
|
setOpenMenu(null);
|
|
9914
10001
|
setLangOpen(false);
|
|
9915
10002
|
};
|
|
9916
|
-
|
|
10003
|
+
React8__namespace.useEffect(() => () => {
|
|
9917
10004
|
clearTimeout(menuCloseTimer.current);
|
|
9918
10005
|
clearTimeout(langCloseTimer.current);
|
|
9919
10006
|
}, []);
|
|
@@ -10178,7 +10265,7 @@ function SiteHeader({
|
|
|
10178
10265
|
), children: [
|
|
10179
10266
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 flex-wrap", children: languages.map((lang, i) => {
|
|
10180
10267
|
const isActive = lang.code === activeLang;
|
|
10181
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10268
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React8__namespace.Fragment, { children: [
|
|
10182
10269
|
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
10183
10270
|
"text-xs select-none",
|
|
10184
10271
|
variant === "white" ? "text-border" : "text-white/15"
|
|
@@ -10240,8 +10327,8 @@ function SiteHeader({
|
|
|
10240
10327
|
);
|
|
10241
10328
|
}
|
|
10242
10329
|
function ThemeToggle({ className }) {
|
|
10243
|
-
const [dark, setDark] =
|
|
10244
|
-
|
|
10330
|
+
const [dark, setDark] = React8__namespace.useState(false);
|
|
10331
|
+
React8__namespace.useEffect(() => {
|
|
10245
10332
|
const saved = localStorage.getItem("theme");
|
|
10246
10333
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
10247
10334
|
const isDark = saved === "dark" || !saved && prefersDark;
|
|
@@ -10392,7 +10479,7 @@ function TripCard({
|
|
|
10392
10479
|
);
|
|
10393
10480
|
}
|
|
10394
10481
|
function useHlsVideo(videoRef, src) {
|
|
10395
|
-
|
|
10482
|
+
React8__namespace.useEffect(() => {
|
|
10396
10483
|
if (!src || !videoRef.current) return;
|
|
10397
10484
|
const video = videoRef.current;
|
|
10398
10485
|
if (!src.includes(".m3u8")) return;
|
|
@@ -10435,11 +10522,11 @@ function TripHeader({
|
|
|
10435
10522
|
className
|
|
10436
10523
|
}) {
|
|
10437
10524
|
var _a;
|
|
10438
|
-
const [heroIndex, setHeroIndex] =
|
|
10439
|
-
const [videoReady, setVideoReady] =
|
|
10440
|
-
const videoRef =
|
|
10525
|
+
const [heroIndex, setHeroIndex] = React8__namespace.useState(0);
|
|
10526
|
+
const [videoReady, setVideoReady] = React8__namespace.useState(false);
|
|
10527
|
+
const videoRef = React8__namespace.useRef(null);
|
|
10441
10528
|
const isHls = !!(videoUrl == null ? void 0 : videoUrl.includes(".m3u8"));
|
|
10442
|
-
const validImages =
|
|
10529
|
+
const validImages = React8__namespace.useMemo(
|
|
10443
10530
|
() => images.map((u) => u == null ? void 0 : u.trim()).filter(Boolean),
|
|
10444
10531
|
[images]
|
|
10445
10532
|
);
|
|
@@ -10454,7 +10541,7 @@ function TripHeader({
|
|
|
10454
10541
|
const nights = duration ? (_a = duration.nights) != null ? _a : Math.max(duration.days - 1, 1) : null;
|
|
10455
10542
|
const hasMeta = !!(destination || duration);
|
|
10456
10543
|
useHlsVideo(videoRef, isHls ? videoUrl : void 0);
|
|
10457
|
-
|
|
10544
|
+
React8__namespace.useEffect(() => {
|
|
10458
10545
|
if (!videoUrl) return;
|
|
10459
10546
|
const el = videoRef.current;
|
|
10460
10547
|
if (!el) return;
|
|
@@ -10596,7 +10683,7 @@ function TripHeader({
|
|
|
10596
10683
|
siteHeader ? "-mt-44" : "-mt-36"
|
|
10597
10684
|
),
|
|
10598
10685
|
children: [
|
|
10599
|
-
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10686
|
+
breadcrumb && breadcrumb.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-center gap-1.5 flex-wrap", children: breadcrumb.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(React8__namespace.Fragment, { children: [
|
|
10600
10687
|
i > 0 && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "h-3 w-3 text-white/50 shrink-0" }),
|
|
10601
10688
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-white/70 font-ui hover:text-white/90 cursor-default", children: crumb.label })
|
|
10602
10689
|
] }, i)) }),
|
|
@@ -10712,9 +10799,9 @@ function TripPage({
|
|
|
10712
10799
|
features,
|
|
10713
10800
|
className
|
|
10714
10801
|
}) {
|
|
10715
|
-
const [activeSection, setActiveSection] =
|
|
10716
|
-
const [accordionValue, setAccordionValue] =
|
|
10717
|
-
const accordionSectionIds =
|
|
10802
|
+
const [activeSection, setActiveSection] = React8__namespace.useState("");
|
|
10803
|
+
const [accordionValue, setAccordionValue] = React8__namespace.useState([]);
|
|
10804
|
+
const accordionSectionIds = React8__namespace.useMemo(
|
|
10718
10805
|
() => /* @__PURE__ */ new Set([
|
|
10719
10806
|
"key-info",
|
|
10720
10807
|
"what-to-bring",
|
|
@@ -10727,18 +10814,18 @@ function TripPage({
|
|
|
10727
10814
|
]),
|
|
10728
10815
|
[]
|
|
10729
10816
|
);
|
|
10730
|
-
const [navFloating, setNavFloating] =
|
|
10731
|
-
const [navHidden, setNavHidden] =
|
|
10732
|
-
const [isFloating, setIsFloating] =
|
|
10733
|
-
const [sidebarPos, setSidebarPos] =
|
|
10734
|
-
const [pricingBarVisible, setPricingBarVisible] =
|
|
10735
|
-
const navRef =
|
|
10736
|
-
const navSentinelRef =
|
|
10737
|
-
const sentinelRef =
|
|
10738
|
-
const sidebarPlaceholderRef =
|
|
10739
|
-
const pricingBarRef =
|
|
10740
|
-
const galleryRef =
|
|
10741
|
-
const sections =
|
|
10817
|
+
const [navFloating, setNavFloating] = React8__namespace.useState(false);
|
|
10818
|
+
const [navHidden, setNavHidden] = React8__namespace.useState(false);
|
|
10819
|
+
const [isFloating, setIsFloating] = React8__namespace.useState(false);
|
|
10820
|
+
const [sidebarPos, setSidebarPos] = React8__namespace.useState(null);
|
|
10821
|
+
const [pricingBarVisible, setPricingBarVisible] = React8__namespace.useState(false);
|
|
10822
|
+
const navRef = React8__namespace.useRef(null);
|
|
10823
|
+
const navSentinelRef = React8__namespace.useRef(null);
|
|
10824
|
+
const sentinelRef = React8__namespace.useRef(null);
|
|
10825
|
+
const sidebarPlaceholderRef = React8__namespace.useRef(null);
|
|
10826
|
+
const pricingBarRef = React8__namespace.useRef(null);
|
|
10827
|
+
const galleryRef = React8__namespace.useRef(null);
|
|
10828
|
+
const sections = React8__namespace.useMemo(
|
|
10742
10829
|
() => [
|
|
10743
10830
|
{ id: "overview", label: "Overview", show: !!(overview || (overviewHighlights == null ? void 0 : overviewHighlights.length)) },
|
|
10744
10831
|
{
|
|
@@ -10756,7 +10843,7 @@ function TripPage({
|
|
|
10756
10843
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10757
10844
|
[]
|
|
10758
10845
|
);
|
|
10759
|
-
|
|
10846
|
+
React8__namespace.useEffect(() => {
|
|
10760
10847
|
const sentinel = navSentinelRef.current;
|
|
10761
10848
|
if (!sentinel) return;
|
|
10762
10849
|
const update = () => setNavFloating(sentinel.getBoundingClientRect().top < 1);
|
|
@@ -10764,7 +10851,7 @@ function TripPage({
|
|
|
10764
10851
|
update();
|
|
10765
10852
|
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
10766
10853
|
}, []);
|
|
10767
|
-
|
|
10854
|
+
React8__namespace.useEffect(() => {
|
|
10768
10855
|
const sentinel = sentinelRef.current;
|
|
10769
10856
|
if (!sentinel) return;
|
|
10770
10857
|
const update = () => setIsFloating(sentinel.getBoundingClientRect().top < 1);
|
|
@@ -10772,7 +10859,7 @@ function TripPage({
|
|
|
10772
10859
|
update();
|
|
10773
10860
|
return () => document.removeEventListener("scroll", update, { capture: true });
|
|
10774
10861
|
}, []);
|
|
10775
|
-
|
|
10862
|
+
React8__namespace.useEffect(() => {
|
|
10776
10863
|
const measure = () => {
|
|
10777
10864
|
if (!sidebarPlaceholderRef.current) return;
|
|
10778
10865
|
const rect = sidebarPlaceholderRef.current.getBoundingClientRect();
|
|
@@ -10782,7 +10869,7 @@ function TripPage({
|
|
|
10782
10869
|
window.addEventListener("resize", measure);
|
|
10783
10870
|
return () => window.removeEventListener("resize", measure);
|
|
10784
10871
|
}, [isFloating]);
|
|
10785
|
-
|
|
10872
|
+
React8__namespace.useEffect(() => {
|
|
10786
10873
|
const check = () => {
|
|
10787
10874
|
var _a;
|
|
10788
10875
|
const target = (_a = galleryRef.current) != null ? _a : pricingBarRef.current;
|
|
@@ -10793,7 +10880,7 @@ function TripPage({
|
|
|
10793
10880
|
check();
|
|
10794
10881
|
return () => document.removeEventListener("scroll", check, { capture: true });
|
|
10795
10882
|
}, []);
|
|
10796
|
-
|
|
10883
|
+
React8__namespace.useEffect(() => {
|
|
10797
10884
|
const check = () => {
|
|
10798
10885
|
if (!pricingBarRef.current) return;
|
|
10799
10886
|
setNavHidden(pricingBarRef.current.getBoundingClientRect().top < window.innerHeight * 0.92);
|
|
@@ -10802,7 +10889,7 @@ function TripPage({
|
|
|
10802
10889
|
check();
|
|
10803
10890
|
return () => document.removeEventListener("scroll", check, { capture: true });
|
|
10804
10891
|
}, []);
|
|
10805
|
-
|
|
10892
|
+
React8__namespace.useEffect(() => {
|
|
10806
10893
|
if (sections.length === 0) return;
|
|
10807
10894
|
setActiveSection(sections[0].id);
|
|
10808
10895
|
const update = () => {
|
|
@@ -11324,12 +11411,12 @@ function Toast({
|
|
|
11324
11411
|
duration = 6e3,
|
|
11325
11412
|
className
|
|
11326
11413
|
}) {
|
|
11327
|
-
const [mounted, setMounted] =
|
|
11328
|
-
const [visible, setVisible] =
|
|
11329
|
-
|
|
11414
|
+
const [mounted, setMounted] = React8__namespace.useState(false);
|
|
11415
|
+
const [visible, setVisible] = React8__namespace.useState(true);
|
|
11416
|
+
React8__namespace.useEffect(() => {
|
|
11330
11417
|
setMounted(true);
|
|
11331
11418
|
}, []);
|
|
11332
|
-
|
|
11419
|
+
React8__namespace.useEffect(() => {
|
|
11333
11420
|
if (duration === 0) return;
|
|
11334
11421
|
const t = setTimeout(() => {
|
|
11335
11422
|
setVisible(false);
|
|
@@ -11736,21 +11823,21 @@ function LeadCapturePopup({
|
|
|
11736
11823
|
}) {
|
|
11737
11824
|
var _a;
|
|
11738
11825
|
const config = __spreadValues(__spreadValues({}, DEFAULTS), _config);
|
|
11739
|
-
const [open, setOpen] =
|
|
11740
|
-
const [closing, setClosing] =
|
|
11741
|
-
const [submitted, setSubmitted] =
|
|
11742
|
-
const [submitting, setSubmitting] =
|
|
11743
|
-
const [error, setError] =
|
|
11744
|
-
const [name, setName] =
|
|
11745
|
-
const [email, setEmail] =
|
|
11746
|
-
const [travelDate, setTravelDate] =
|
|
11747
|
-
const panelRef =
|
|
11748
|
-
const nameRef =
|
|
11749
|
-
const show =
|
|
11826
|
+
const [open, setOpen] = React8.useState(false);
|
|
11827
|
+
const [closing, setClosing] = React8.useState(false);
|
|
11828
|
+
const [submitted, setSubmitted] = React8.useState(false);
|
|
11829
|
+
const [submitting, setSubmitting] = React8.useState(false);
|
|
11830
|
+
const [error, setError] = React8.useState(null);
|
|
11831
|
+
const [name, setName] = React8.useState("");
|
|
11832
|
+
const [email, setEmail] = React8.useState("");
|
|
11833
|
+
const [travelDate, setTravelDate] = React8.useState("");
|
|
11834
|
+
const panelRef = React8.useRef(null);
|
|
11835
|
+
const nameRef = React8.useRef(null);
|
|
11836
|
+
const show = React8.useCallback(() => {
|
|
11750
11837
|
if (isDismissed()) return;
|
|
11751
11838
|
setOpen(true);
|
|
11752
11839
|
}, []);
|
|
11753
|
-
|
|
11840
|
+
React8.useEffect(() => {
|
|
11754
11841
|
var _a2;
|
|
11755
11842
|
if (isDismissed()) return;
|
|
11756
11843
|
if (config.trigger === "delay") {
|
|
@@ -11777,7 +11864,7 @@ function LeadCapturePopup({
|
|
|
11777
11864
|
return () => window.removeEventListener("scroll", handler);
|
|
11778
11865
|
}
|
|
11779
11866
|
}, [config.trigger, config.delaySeconds, config.scrollPercent, show]);
|
|
11780
|
-
|
|
11867
|
+
React8.useEffect(() => {
|
|
11781
11868
|
if (open && !submitted) {
|
|
11782
11869
|
requestAnimationFrame(() => {
|
|
11783
11870
|
var _a2;
|
|
@@ -11785,7 +11872,7 @@ function LeadCapturePopup({
|
|
|
11785
11872
|
});
|
|
11786
11873
|
}
|
|
11787
11874
|
}, [open, submitted]);
|
|
11788
|
-
const close =
|
|
11875
|
+
const close = React8.useCallback(() => {
|
|
11789
11876
|
setClosing(true);
|
|
11790
11877
|
setDismissed(config.dismissDays);
|
|
11791
11878
|
setTimeout(() => {
|
|
@@ -11793,7 +11880,7 @@ function LeadCapturePopup({
|
|
|
11793
11880
|
setClosing(false);
|
|
11794
11881
|
}, 250);
|
|
11795
11882
|
}, [config.dismissDays]);
|
|
11796
|
-
|
|
11883
|
+
React8.useEffect(() => {
|
|
11797
11884
|
if (!open) return;
|
|
11798
11885
|
const handler = (e) => {
|
|
11799
11886
|
if (e.key === "Escape") close();
|
|
@@ -11801,7 +11888,7 @@ function LeadCapturePopup({
|
|
|
11801
11888
|
document.addEventListener("keydown", handler);
|
|
11802
11889
|
return () => document.removeEventListener("keydown", handler);
|
|
11803
11890
|
}, [open, close]);
|
|
11804
|
-
const onOverlayClick =
|
|
11891
|
+
const onOverlayClick = React8.useCallback(
|
|
11805
11892
|
(e) => {
|
|
11806
11893
|
if (panelRef.current && !panelRef.current.contains(e.target)) {
|
|
11807
11894
|
close();
|