@burdenoff/microfe-ggnomad 2026.705.3 → 2026.705.4
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/ggnomad/GGNomadRoot.js +57 -50
- package/dist/ggnomad/GGNomadRoot.js.map +1 -1
- package/dist/ggnomad/GGNomadRoutes.js +13 -5
- package/dist/ggnomad/GGNomadRoutes.js.map +1 -1
- package/dist/ggnomad/graphql.js +97 -1
- package/dist/ggnomad/graphql.js.map +1 -1
- package/dist/ggnomad/pages/TripPlanDetailPage.js +605 -0
- package/dist/ggnomad/pages/TripPlanDetailPage.js.map +1 -0
- package/dist/ggnomad/pages/TripsPage.js +181 -0
- package/dist/ggnomad/pages/TripsPage.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
import { ADD_GGNOMAD_TRIP_PLAN_ITEM_MUTATION as e, CREATE_GGNOMAD_BOOKING_MUTATION as t, GGNOMAD_ACTIVITIES_QUERY as ee, GGNOMAD_EVENTS_QUERY as te, GGNOMAD_PROPERTIES_QUERY as n, GGNOMAD_TOURS_QUERY as r, GGNOMAD_TRIP_PLAN_QUERY as i, REMOVE_GGNOMAD_TRIP_PLAN_ITEM_MUTATION as a, UPDATE_GGNOMAD_TRIP_PLAN_MUTATION as o } from "../graphql.js";
|
|
2
|
+
import { PageShell as s } from "./PageShell.js";
|
|
3
|
+
import { useGGNomad as c } from "../providers/GGNomadProvider.js";
|
|
4
|
+
import { joinPath as ne } from "../utils/navigation.js";
|
|
5
|
+
import { notify as l } from "../utils/notify.js";
|
|
6
|
+
import { useState as u } from "react";
|
|
7
|
+
import { ChevronDown as d, Plus as re, Users as ie, X as ae } from "lucide-react";
|
|
8
|
+
import { useI18n as oe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
9
|
+
import { useNavigate as f, useParams as p } from "react-router-dom";
|
|
10
|
+
import { useMutation as m, useQuery as h } from "@apollo/client/react";
|
|
11
|
+
import { AlertDialog as g, AlertDialogAction as _, AlertDialogCancel as v, AlertDialogContent as y, AlertDialogDescription as b, AlertDialogFooter as x, AlertDialogHeader as S, AlertDialogTitle as C, GlassCard as w, IllustratedEmptyState as se, Tabs as ce, TabsContent as T, TabsList as E, TabsTrigger as D } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
13
|
+
//#region src/ggnomad/pages/TripPlanDetailPage.tsx
|
|
14
|
+
function j() {
|
|
15
|
+
let { t: j } = oe(), M = f(), { basePath: N = "/" } = c(), { id: P = "" } = p(), [F, I] = u(null), [L, R] = u(!1), [z, B] = u(null), [V, H] = u("itinerary"), { data: U, refetch: W } = h(i, {
|
|
16
|
+
variables: { id: P },
|
|
17
|
+
skip: !P
|
|
18
|
+
}), G = U?.ggnomadTripPlan, { data: le } = h(n, { variables: {
|
|
19
|
+
first: 20,
|
|
20
|
+
skip: 0
|
|
21
|
+
} }), { data: ue } = h(r, { variables: {
|
|
22
|
+
first: 20,
|
|
23
|
+
skip: 0
|
|
24
|
+
} }), { data: de } = h(te, { variables: {
|
|
25
|
+
first: 20,
|
|
26
|
+
skip: 0
|
|
27
|
+
} }), { data: fe } = h(ee, { variables: {
|
|
28
|
+
first: 20,
|
|
29
|
+
skip: 0
|
|
30
|
+
} }), [pe, { loading: K }] = m(e), [me, { loading: q }] = m(a), [J] = m(o), [he] = m(t), ge = async () => {
|
|
31
|
+
if (!(!F || !G)) try {
|
|
32
|
+
let e = await pe({ variables: {
|
|
33
|
+
tripPlanId: G.id,
|
|
34
|
+
input: {
|
|
35
|
+
itemType: F.itemType,
|
|
36
|
+
itemId: F.itemId,
|
|
37
|
+
itemName: F.itemName,
|
|
38
|
+
price: F.price,
|
|
39
|
+
currency: F.currency
|
|
40
|
+
}
|
|
41
|
+
} });
|
|
42
|
+
if (e.error) {
|
|
43
|
+
l.error(j("ggnomad.tripPlan.toast.addItemErrorTitle", "Could not add item"), e.error.message);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
l.success(j("ggnomad.tripPlan.toast.addItemSuccessTitle", "Item added"), F.itemName), I(null), await W();
|
|
47
|
+
} catch (e) {
|
|
48
|
+
l.error(j("ggnomad.tripPlan.toast.addItemErrorTitle", "Could not add item"), e instanceof Error ? e.message : String(e));
|
|
49
|
+
}
|
|
50
|
+
}, _e = async () => {
|
|
51
|
+
if (z) try {
|
|
52
|
+
let e = await me({ variables: { id: z } });
|
|
53
|
+
if (e.error) {
|
|
54
|
+
l.error(j("ggnomad.tripPlan.toast.removeItemErrorTitle", "Could not remove item"), e.error.message);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
l.success(j("ggnomad.tripPlan.toast.removeItemSuccessTitle", "Item removed"), ""), B(null), await W();
|
|
58
|
+
} catch (e) {
|
|
59
|
+
l.error(j("ggnomad.tripPlan.toast.removeItemErrorTitle", "Could not remove item"), e instanceof Error ? e.message : String(e));
|
|
60
|
+
}
|
|
61
|
+
}, ve = async () => {
|
|
62
|
+
if (G) try {
|
|
63
|
+
for (let e of G.items) await he({ variables: { input: {
|
|
64
|
+
bookingType: e.itemType,
|
|
65
|
+
itemId: e.itemId,
|
|
66
|
+
itemName: e.itemName,
|
|
67
|
+
guestName: "Guest",
|
|
68
|
+
guestEmail: "guest@burdenoff.com",
|
|
69
|
+
guests: G.travelers,
|
|
70
|
+
totalPrice: e.price,
|
|
71
|
+
currency: e.currency,
|
|
72
|
+
paymentMethod: "card"
|
|
73
|
+
} } });
|
|
74
|
+
await J({ variables: {
|
|
75
|
+
id: G.id,
|
|
76
|
+
input: { status: "BOOKED" }
|
|
77
|
+
} }), l.success(j("ggnomad.tripPlan.toast.checkoutSuccessTitle", "Trip booked!"), j("ggnomad.tripPlan.toast.checkoutSuccessBody", "All items have been booked")), await W(), R(!1), M(ne(N, "bookings"));
|
|
78
|
+
} catch (e) {
|
|
79
|
+
l.error(j("ggnomad.tripPlan.toast.checkoutErrorTitle", "Booking failed"), e instanceof Error ? e.message : String(e));
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
if (!G) return /* @__PURE__ */ k(s, {
|
|
83
|
+
title: j("ggnomad.tripPlan.loadingTitle", "Trip Plan"),
|
|
84
|
+
subtitle: j("ggnomad.tripPlan.loadingSubtitle", "Loading trip plan"),
|
|
85
|
+
children: /* @__PURE__ */ k(se, {
|
|
86
|
+
illustration: "empty-data",
|
|
87
|
+
title: j("ggnomad.tripPlan.notFoundTitle", "Trip plan not found"),
|
|
88
|
+
description: j("ggnomad.tripPlan.notFoundDescription", "This trip may have been deleted or is unavailable.")
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
let Y = {};
|
|
92
|
+
G.items.forEach((e) => {
|
|
93
|
+
let t = e.day ?? 0;
|
|
94
|
+
Y[t] || (Y[t] = []), Y[t].push(e);
|
|
95
|
+
});
|
|
96
|
+
let ye = Object.keys(Y).map((e) => Number(e)).sort((e, t) => e - t), X = le?.ggnomadProperties ?? [], Z = ue?.ggnomadTours ?? [], Q = de?.ggnomadEvents ?? [], $ = fe?.ggnomadActivities ?? [];
|
|
97
|
+
return /* @__PURE__ */ A(s, {
|
|
98
|
+
title: G.name,
|
|
99
|
+
subtitle: j("ggnomad.tripPlan.subtitle", "Build your complete itinerary"),
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ A(ce, {
|
|
102
|
+
value: V,
|
|
103
|
+
onValueChange: H,
|
|
104
|
+
className: "w-full",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ A(E, {
|
|
107
|
+
className: "mb-6 w-full justify-start",
|
|
108
|
+
children: [/* @__PURE__ */ k(D, {
|
|
109
|
+
value: "itinerary",
|
|
110
|
+
children: j("ggnomad.tripPlan.tabs.itinerary", "Itinerary")
|
|
111
|
+
}), /* @__PURE__ */ k(D, {
|
|
112
|
+
value: "timeline",
|
|
113
|
+
children: j("ggnomad.tripPlan.tabs.timeline", "Timeline")
|
|
114
|
+
})]
|
|
115
|
+
}),
|
|
116
|
+
/* @__PURE__ */ k(T, {
|
|
117
|
+
value: "itinerary",
|
|
118
|
+
className: "space-y-6",
|
|
119
|
+
children: /* @__PURE__ */ A("div", {
|
|
120
|
+
className: "grid grid-cols-1 gap-6 lg:grid-cols-4",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ k("div", {
|
|
123
|
+
className: "space-y-4",
|
|
124
|
+
children: /* @__PURE__ */ A(w, {
|
|
125
|
+
treatment: "glass",
|
|
126
|
+
glow: !0,
|
|
127
|
+
className: "border-border-seam p-4",
|
|
128
|
+
children: [/* @__PURE__ */ A("h3", {
|
|
129
|
+
className: "mb-3 flex items-center gap-2 font-medium text-text-primary",
|
|
130
|
+
children: [/* @__PURE__ */ k(re, { className: "size-4" }), j("ggnomad.tripPlan.addToTrip", "Add to trip")]
|
|
131
|
+
}), /* @__PURE__ */ A("div", {
|
|
132
|
+
className: "space-y-3",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ A("details", {
|
|
135
|
+
className: "group",
|
|
136
|
+
children: [/* @__PURE__ */ A("summary", {
|
|
137
|
+
className: "flex cursor-pointer items-center justify-between rounded-md bg-bg-canvas-inverted p-2 text-sm font-medium text-text-primary hover:bg-opacity-80",
|
|
138
|
+
children: [j("ggnomad.tripPlan.stays", "Stays"), /* @__PURE__ */ k(d, { className: "size-4 transition-transform group-open:rotate-180" })]
|
|
139
|
+
}), /* @__PURE__ */ k("div", {
|
|
140
|
+
className: "mt-2 space-y-2",
|
|
141
|
+
children: X.length === 0 ? /* @__PURE__ */ k("p", {
|
|
142
|
+
className: "text-xs text-text-secondary",
|
|
143
|
+
children: j("ggnomad.tripPlan.noStaysAvailable", "No stays available")
|
|
144
|
+
}) : X.map((e) => /* @__PURE__ */ A("button", {
|
|
145
|
+
onClick: () => I({
|
|
146
|
+
itemType: "PROPERTY",
|
|
147
|
+
itemId: e.id,
|
|
148
|
+
itemName: e.name,
|
|
149
|
+
price: e.pricePerNight,
|
|
150
|
+
currency: e.currency
|
|
151
|
+
}),
|
|
152
|
+
className: "w-full rounded-md border border-border-seam bg-bg-canvas p-2 text-left text-xs text-text-primary hover:bg-action-primary-bg hover:text-action-primary-text",
|
|
153
|
+
children: [/* @__PURE__ */ k("div", {
|
|
154
|
+
className: "font-medium",
|
|
155
|
+
children: e.name
|
|
156
|
+
}), /* @__PURE__ */ A("div", {
|
|
157
|
+
className: "text-text-secondary",
|
|
158
|
+
children: [
|
|
159
|
+
e.currency,
|
|
160
|
+
" ",
|
|
161
|
+
e.pricePerNight.toFixed(2)
|
|
162
|
+
]
|
|
163
|
+
})]
|
|
164
|
+
}, e.id))
|
|
165
|
+
})]
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ A("details", {
|
|
168
|
+
className: "group",
|
|
169
|
+
children: [/* @__PURE__ */ A("summary", {
|
|
170
|
+
className: "flex cursor-pointer items-center justify-between rounded-md bg-bg-canvas-inverted p-2 text-sm font-medium text-text-primary hover:bg-opacity-80",
|
|
171
|
+
children: [j("ggnomad.tripPlan.tours", "Tours"), /* @__PURE__ */ k(d, { className: "size-4 transition-transform group-open:rotate-180" })]
|
|
172
|
+
}), /* @__PURE__ */ k("div", {
|
|
173
|
+
className: "mt-2 space-y-2",
|
|
174
|
+
children: Z.length === 0 ? /* @__PURE__ */ k("p", {
|
|
175
|
+
className: "text-xs text-text-secondary",
|
|
176
|
+
children: j("ggnomad.tripPlan.noToursAvailable", "No tours available")
|
|
177
|
+
}) : Z.map((e) => /* @__PURE__ */ A("button", {
|
|
178
|
+
onClick: () => I({
|
|
179
|
+
itemType: "TOUR",
|
|
180
|
+
itemId: e.id,
|
|
181
|
+
itemName: e.name,
|
|
182
|
+
price: e.price,
|
|
183
|
+
currency: e.currency
|
|
184
|
+
}),
|
|
185
|
+
className: "w-full rounded-md border border-border-seam bg-bg-canvas p-2 text-left text-xs text-text-primary hover:bg-action-primary-bg hover:text-action-primary-text",
|
|
186
|
+
children: [/* @__PURE__ */ k("div", {
|
|
187
|
+
className: "font-medium",
|
|
188
|
+
children: e.name
|
|
189
|
+
}), /* @__PURE__ */ A("div", {
|
|
190
|
+
className: "text-text-secondary",
|
|
191
|
+
children: [
|
|
192
|
+
e.currency,
|
|
193
|
+
" ",
|
|
194
|
+
e.price.toFixed(2)
|
|
195
|
+
]
|
|
196
|
+
})]
|
|
197
|
+
}, e.id))
|
|
198
|
+
})]
|
|
199
|
+
}),
|
|
200
|
+
/* @__PURE__ */ A("details", {
|
|
201
|
+
className: "group",
|
|
202
|
+
children: [/* @__PURE__ */ A("summary", {
|
|
203
|
+
className: "flex cursor-pointer items-center justify-between rounded-md bg-bg-canvas-inverted p-2 text-sm font-medium text-text-primary hover:bg-opacity-80",
|
|
204
|
+
children: [j("ggnomad.tripPlan.events", "Events"), /* @__PURE__ */ k(d, { className: "size-4 transition-transform group-open:rotate-180" })]
|
|
205
|
+
}), /* @__PURE__ */ k("div", {
|
|
206
|
+
className: "mt-2 space-y-2",
|
|
207
|
+
children: Q.length === 0 ? /* @__PURE__ */ k("p", {
|
|
208
|
+
className: "text-xs text-text-secondary",
|
|
209
|
+
children: j("ggnomad.tripPlan.noEventsAvailable", "No events available")
|
|
210
|
+
}) : Q.map((e) => /* @__PURE__ */ A("button", {
|
|
211
|
+
onClick: () => I({
|
|
212
|
+
itemType: "EVENT",
|
|
213
|
+
itemId: e.id,
|
|
214
|
+
itemName: e.name,
|
|
215
|
+
price: e.price,
|
|
216
|
+
currency: e.currency
|
|
217
|
+
}),
|
|
218
|
+
className: "w-full rounded-md border border-border-seam bg-bg-canvas p-2 text-left text-xs text-text-primary hover:bg-action-primary-bg hover:text-action-primary-text",
|
|
219
|
+
children: [/* @__PURE__ */ k("div", {
|
|
220
|
+
className: "font-medium",
|
|
221
|
+
children: e.name
|
|
222
|
+
}), /* @__PURE__ */ A("div", {
|
|
223
|
+
className: "text-text-secondary",
|
|
224
|
+
children: [
|
|
225
|
+
e.currency,
|
|
226
|
+
" ",
|
|
227
|
+
e.price.toFixed(2)
|
|
228
|
+
]
|
|
229
|
+
})]
|
|
230
|
+
}, e.id))
|
|
231
|
+
})]
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ A("details", {
|
|
234
|
+
className: "group",
|
|
235
|
+
children: [/* @__PURE__ */ A("summary", {
|
|
236
|
+
className: "flex cursor-pointer items-center justify-between rounded-md bg-bg-canvas-inverted p-2 text-sm font-medium text-text-primary hover:bg-opacity-80",
|
|
237
|
+
children: [j("ggnomad.tripPlan.activities", "Activities"), /* @__PURE__ */ k(d, { className: "size-4 transition-transform group-open:rotate-180" })]
|
|
238
|
+
}), /* @__PURE__ */ k("div", {
|
|
239
|
+
className: "mt-2 space-y-2",
|
|
240
|
+
children: $.length === 0 ? /* @__PURE__ */ k("p", {
|
|
241
|
+
className: "text-xs text-text-secondary",
|
|
242
|
+
children: j("ggnomad.tripPlan.noActivitiesAvailable", "No activities available")
|
|
243
|
+
}) : $.map((e) => /* @__PURE__ */ A("button", {
|
|
244
|
+
onClick: () => I({
|
|
245
|
+
itemType: "ACTIVITY",
|
|
246
|
+
itemId: e.id,
|
|
247
|
+
itemName: e.name,
|
|
248
|
+
price: e.price,
|
|
249
|
+
currency: e.currency
|
|
250
|
+
}),
|
|
251
|
+
className: "w-full rounded-md border border-border-seam bg-bg-canvas p-2 text-left text-xs text-text-primary hover:bg-action-primary-bg hover:text-action-primary-text",
|
|
252
|
+
children: [/* @__PURE__ */ k("div", {
|
|
253
|
+
className: "font-medium",
|
|
254
|
+
children: e.name
|
|
255
|
+
}), /* @__PURE__ */ A("div", {
|
|
256
|
+
className: "text-text-secondary",
|
|
257
|
+
children: [
|
|
258
|
+
e.currency,
|
|
259
|
+
" ",
|
|
260
|
+
e.price.toFixed(2)
|
|
261
|
+
]
|
|
262
|
+
})]
|
|
263
|
+
}, e.id))
|
|
264
|
+
})]
|
|
265
|
+
})
|
|
266
|
+
]
|
|
267
|
+
})]
|
|
268
|
+
})
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ k("div", {
|
|
271
|
+
className: "space-y-4 lg:col-span-2",
|
|
272
|
+
children: /* @__PURE__ */ A(w, {
|
|
273
|
+
treatment: "glass",
|
|
274
|
+
glow: !0,
|
|
275
|
+
className: "border-border-seam p-5",
|
|
276
|
+
children: [/* @__PURE__ */ k("h2", {
|
|
277
|
+
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
278
|
+
children: j("ggnomad.tripPlan.itineraryHeader", "Your itinerary")
|
|
279
|
+
}), G.items.length === 0 ? /* @__PURE__ */ k("p", {
|
|
280
|
+
className: "text-sm text-text-secondary",
|
|
281
|
+
children: j("ggnomad.tripPlan.noItemsYet", "No items added yet. Start adding stays, tours, events and activities from the left.")
|
|
282
|
+
}) : /* @__PURE__ */ k("div", {
|
|
283
|
+
className: "space-y-6",
|
|
284
|
+
children: ye.map((e) => /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h3", {
|
|
285
|
+
className: "mb-2 text-sm font-medium text-text-secondary",
|
|
286
|
+
children: e === 0 ? j("ggnomad.tripPlan.unscheduled", "Unscheduled") : j("ggnomad.tripPlan.day", "Day {{day}}").replace("{{day}}", String(e))
|
|
287
|
+
}), /* @__PURE__ */ k("div", {
|
|
288
|
+
className: "space-y-2",
|
|
289
|
+
children: (Y[e] || []).map((e) => /* @__PURE__ */ A("div", {
|
|
290
|
+
className: "flex items-start justify-between rounded-md border border-border-seam bg-bg-canvas p-3",
|
|
291
|
+
children: [/* @__PURE__ */ A("div", {
|
|
292
|
+
className: "flex-1",
|
|
293
|
+
children: [
|
|
294
|
+
/* @__PURE__ */ k("p", {
|
|
295
|
+
className: "font-medium text-text-primary",
|
|
296
|
+
children: e.itemName
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ k("p", {
|
|
299
|
+
className: "text-xs text-text-secondary",
|
|
300
|
+
children: e.itemType.charAt(0) + e.itemType.slice(1).toLowerCase()
|
|
301
|
+
}),
|
|
302
|
+
/* @__PURE__ */ A("p", {
|
|
303
|
+
className: "mt-1 font-semibold text-status-success-text",
|
|
304
|
+
children: [
|
|
305
|
+
e.currency,
|
|
306
|
+
" ",
|
|
307
|
+
e.price.toFixed(2)
|
|
308
|
+
]
|
|
309
|
+
})
|
|
310
|
+
]
|
|
311
|
+
}), /* @__PURE__ */ k("button", {
|
|
312
|
+
onClick: () => B(e.id),
|
|
313
|
+
className: "ml-2 rounded-md p-1 text-text-secondary hover:bg-action-danger-bg hover:text-action-danger-text",
|
|
314
|
+
"aria-label": j("ggnomad.tripPlan.removeItem", "Remove item"),
|
|
315
|
+
children: /* @__PURE__ */ k(ae, { className: "size-4" })
|
|
316
|
+
})]
|
|
317
|
+
}, e.id))
|
|
318
|
+
})] }, String(e)))
|
|
319
|
+
})]
|
|
320
|
+
})
|
|
321
|
+
}),
|
|
322
|
+
/* @__PURE__ */ k("div", {
|
|
323
|
+
className: "space-y-4",
|
|
324
|
+
children: /* @__PURE__ */ A(w, {
|
|
325
|
+
treatment: "glass",
|
|
326
|
+
glow: !0,
|
|
327
|
+
className: "sticky top-6 border-border-seam p-5",
|
|
328
|
+
children: [
|
|
329
|
+
/* @__PURE__ */ k("h3", {
|
|
330
|
+
className: "mb-4 font-medium text-text-primary",
|
|
331
|
+
children: j("ggnomad.tripPlan.tripTotal", "Trip total")
|
|
332
|
+
}),
|
|
333
|
+
/* @__PURE__ */ A("div", {
|
|
334
|
+
className: "space-y-3 border-b border-border-seam pb-4",
|
|
335
|
+
children: [/* @__PURE__ */ A("div", {
|
|
336
|
+
className: "flex items-center justify-between text-sm",
|
|
337
|
+
children: [/* @__PURE__ */ k("span", {
|
|
338
|
+
className: "text-text-secondary",
|
|
339
|
+
children: j("ggnomad.tripPlan.items", "Items")
|
|
340
|
+
}), /* @__PURE__ */ k("span", {
|
|
341
|
+
className: "font-medium text-text-primary",
|
|
342
|
+
children: G.itemCount
|
|
343
|
+
})]
|
|
344
|
+
}), /* @__PURE__ */ A("div", {
|
|
345
|
+
className: "flex items-center justify-between text-sm",
|
|
346
|
+
children: [/* @__PURE__ */ k("span", {
|
|
347
|
+
className: "text-text-secondary",
|
|
348
|
+
children: j("ggnomad.tripPlan.travelers", "Travelers")
|
|
349
|
+
}), /* @__PURE__ */ A("span", {
|
|
350
|
+
className: "font-medium text-text-primary flex items-center gap-1",
|
|
351
|
+
children: [/* @__PURE__ */ k(ie, { className: "size-3" }), G.travelers]
|
|
352
|
+
})]
|
|
353
|
+
})]
|
|
354
|
+
}),
|
|
355
|
+
/* @__PURE__ */ k("div", {
|
|
356
|
+
className: "my-4",
|
|
357
|
+
children: /* @__PURE__ */ A("div", {
|
|
358
|
+
className: "text-2xl font-bold text-text-primary",
|
|
359
|
+
children: ["USD ", G.total.toFixed(2)]
|
|
360
|
+
})
|
|
361
|
+
}),
|
|
362
|
+
/* @__PURE__ */ A("div", {
|
|
363
|
+
className: "space-y-2",
|
|
364
|
+
children: [/* @__PURE__ */ k("button", {
|
|
365
|
+
onClick: () => R(!0),
|
|
366
|
+
disabled: G.items.length === 0,
|
|
367
|
+
className: "w-full rounded-md bg-action-primary-bg px-4 py-2 font-medium text-action-primary-text hover:bg-action-primary-bgHover disabled:opacity-50",
|
|
368
|
+
children: j("ggnomad.tripPlan.checkout", "Checkout")
|
|
369
|
+
}), /* @__PURE__ */ k("div", {
|
|
370
|
+
className: "flex items-center gap-2",
|
|
371
|
+
children: /* @__PURE__ */ A("select", {
|
|
372
|
+
value: G.status,
|
|
373
|
+
onChange: async (e) => {
|
|
374
|
+
await J({ variables: {
|
|
375
|
+
id: G.id,
|
|
376
|
+
input: { status: e.target.value }
|
|
377
|
+
} }), await W();
|
|
378
|
+
},
|
|
379
|
+
className: "flex-1 rounded-md border border-border-seam bg-bg-canvas px-2 py-1 text-sm text-text-primary",
|
|
380
|
+
children: [
|
|
381
|
+
/* @__PURE__ */ k("option", {
|
|
382
|
+
value: "DRAFT",
|
|
383
|
+
children: "Draft"
|
|
384
|
+
}),
|
|
385
|
+
/* @__PURE__ */ k("option", {
|
|
386
|
+
value: "PLANNED",
|
|
387
|
+
children: "Planned"
|
|
388
|
+
}),
|
|
389
|
+
/* @__PURE__ */ k("option", {
|
|
390
|
+
value: "BOOKED",
|
|
391
|
+
children: "Booked"
|
|
392
|
+
}),
|
|
393
|
+
/* @__PURE__ */ k("option", {
|
|
394
|
+
value: "CONFIRMED",
|
|
395
|
+
children: "Confirmed"
|
|
396
|
+
}),
|
|
397
|
+
/* @__PURE__ */ k("option", {
|
|
398
|
+
value: "COMPLETED",
|
|
399
|
+
children: "Completed"
|
|
400
|
+
}),
|
|
401
|
+
/* @__PURE__ */ k("option", {
|
|
402
|
+
value: "CANCELLED",
|
|
403
|
+
children: "Cancelled"
|
|
404
|
+
})
|
|
405
|
+
]
|
|
406
|
+
})
|
|
407
|
+
})]
|
|
408
|
+
})
|
|
409
|
+
]
|
|
410
|
+
})
|
|
411
|
+
})
|
|
412
|
+
]
|
|
413
|
+
})
|
|
414
|
+
}),
|
|
415
|
+
/* @__PURE__ */ k(T, {
|
|
416
|
+
value: "timeline",
|
|
417
|
+
className: "space-y-4",
|
|
418
|
+
children: /* @__PURE__ */ A(w, {
|
|
419
|
+
treatment: "glass",
|
|
420
|
+
glow: !0,
|
|
421
|
+
className: "border-border-seam p-5",
|
|
422
|
+
children: [/* @__PURE__ */ k("h2", {
|
|
423
|
+
className: "mb-4 text-lg font-medium tracking-tight text-text-primary",
|
|
424
|
+
children: j("ggnomad.tripPlan.timeline", "Trip timeline")
|
|
425
|
+
}), /* @__PURE__ */ A("div", {
|
|
426
|
+
className: "space-y-6",
|
|
427
|
+
children: [
|
|
428
|
+
/* @__PURE__ */ A("div", {
|
|
429
|
+
className: "flex gap-4",
|
|
430
|
+
children: [/* @__PURE__ */ A("div", {
|
|
431
|
+
className: "flex flex-col items-center",
|
|
432
|
+
children: [/* @__PURE__ */ k("div", { className: "size-3 rounded-full bg-status-info-bg" }), /* @__PURE__ */ k("div", { className: "my-2 h-8 w-0.5 bg-border-seam" })]
|
|
433
|
+
}), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h3", {
|
|
434
|
+
className: "font-medium text-text-primary",
|
|
435
|
+
children: j("ggnomad.tripPlan.milestone.started", "Trip started")
|
|
436
|
+
}), /* @__PURE__ */ k("p", {
|
|
437
|
+
className: "text-xs text-text-secondary",
|
|
438
|
+
children: j("ggnomad.tripPlan.milestone.startedDesc", "Created your itinerary")
|
|
439
|
+
})] })]
|
|
440
|
+
}),
|
|
441
|
+
G.items.length === 0 ? /* @__PURE__ */ k("p", {
|
|
442
|
+
className: "text-sm text-text-secondary",
|
|
443
|
+
children: j("ggnomad.tripPlan.noItemsInTimeline", "No items in your timeline yet")
|
|
444
|
+
}) : G.items.map((e, t) => /* @__PURE__ */ A("div", {
|
|
445
|
+
className: "flex gap-4",
|
|
446
|
+
children: [/* @__PURE__ */ A("div", {
|
|
447
|
+
className: "flex flex-col items-center",
|
|
448
|
+
children: [/* @__PURE__ */ k("div", { className: `size-3 rounded-full ${G.status === "BOOKED" || G.status === "COMPLETED" ? "bg-status-success-bg" : "bg-status-warning-bg"}` }), t < G.items.length - 1 && /* @__PURE__ */ k("div", { className: "my-2 h-8 w-0.5 bg-border-seam" })]
|
|
449
|
+
}), /* @__PURE__ */ A("div", { children: [
|
|
450
|
+
/* @__PURE__ */ k("h3", {
|
|
451
|
+
className: "font-medium text-text-primary",
|
|
452
|
+
children: e.itemName
|
|
453
|
+
}),
|
|
454
|
+
/* @__PURE__ */ A("p", {
|
|
455
|
+
className: "text-xs text-text-secondary",
|
|
456
|
+
children: [e.itemType.charAt(0) + e.itemType.slice(1).toLowerCase(), e.day && ` · Day ${e.day}`]
|
|
457
|
+
}),
|
|
458
|
+
/* @__PURE__ */ A("p", {
|
|
459
|
+
className: "mt-1 text-sm font-semibold text-status-success-text",
|
|
460
|
+
children: [
|
|
461
|
+
e.currency,
|
|
462
|
+
" ",
|
|
463
|
+
e.price.toFixed(2)
|
|
464
|
+
]
|
|
465
|
+
}),
|
|
466
|
+
/* @__PURE__ */ k("p", {
|
|
467
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
468
|
+
children: G.status === "BOOKED" || G.status === "COMPLETED" ? j("ggnomad.tripPlan.milestone.booked", "Booked") : j("ggnomad.tripPlan.milestone.planned", "Planned")
|
|
469
|
+
})
|
|
470
|
+
] })]
|
|
471
|
+
}, e.id)),
|
|
472
|
+
G.items.length > 0 && /* @__PURE__ */ k(O, { children: /* @__PURE__ */ A("div", {
|
|
473
|
+
className: "flex gap-4",
|
|
474
|
+
children: [/* @__PURE__ */ k("div", {
|
|
475
|
+
className: "flex flex-col items-center",
|
|
476
|
+
children: /* @__PURE__ */ k("div", { className: `size-3 rounded-full ${G.status === "COMPLETED" ? "bg-status-success-bg" : "bg-status-secondary-bg"}` })
|
|
477
|
+
}), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("h3", {
|
|
478
|
+
className: "font-medium text-text-primary",
|
|
479
|
+
children: G.status === "COMPLETED" ? j("ggnomad.tripPlan.milestone.completed", "Trip completed") : j("ggnomad.tripPlan.milestone.confirming", "Awaiting completion")
|
|
480
|
+
}), /* @__PURE__ */ k("p", {
|
|
481
|
+
className: "text-xs text-text-secondary",
|
|
482
|
+
children: G.status === "COMPLETED" ? j("ggnomad.tripPlan.milestone.completedDesc", "Your trip is complete") : j("ggnomad.tripPlan.milestone.confirmingDesc", "Update status as your trip progresses")
|
|
483
|
+
})] })]
|
|
484
|
+
}) })
|
|
485
|
+
]
|
|
486
|
+
})]
|
|
487
|
+
})
|
|
488
|
+
})
|
|
489
|
+
]
|
|
490
|
+
}),
|
|
491
|
+
/* @__PURE__ */ k(g, {
|
|
492
|
+
open: F !== null,
|
|
493
|
+
onOpenChange: (e) => !e && I(null),
|
|
494
|
+
children: /* @__PURE__ */ A(y, { children: [/* @__PURE__ */ A(S, { children: [/* @__PURE__ */ k(C, { children: j("ggnomad.tripPlan.addItemDialog.title", "Add to itinerary?") }), /* @__PURE__ */ k(b, { children: F && /* @__PURE__ */ A(O, { children: [
|
|
495
|
+
F.itemName,
|
|
496
|
+
" · ",
|
|
497
|
+
F.currency,
|
|
498
|
+
" ",
|
|
499
|
+
F.price.toFixed(2)
|
|
500
|
+
] }) })] }), /* @__PURE__ */ A(x, { children: [/* @__PURE__ */ k(v, {
|
|
501
|
+
disabled: K,
|
|
502
|
+
children: j("ggnomad.tripPlan.addItemDialog.cancel", "Cancel")
|
|
503
|
+
}), /* @__PURE__ */ k(_, {
|
|
504
|
+
disabled: K,
|
|
505
|
+
onClick: (e) => {
|
|
506
|
+
e.preventDefault(), ge();
|
|
507
|
+
},
|
|
508
|
+
children: K ? j("ggnomad.tripPlan.addItemDialog.adding", "Adding…") : j("ggnomad.tripPlan.addItemDialog.add", "Add item")
|
|
509
|
+
})] })] })
|
|
510
|
+
}),
|
|
511
|
+
/* @__PURE__ */ k(g, {
|
|
512
|
+
open: z !== null,
|
|
513
|
+
onOpenChange: (e) => !e && B(null),
|
|
514
|
+
children: /* @__PURE__ */ A(y, { children: [/* @__PURE__ */ A(S, { children: [/* @__PURE__ */ k(C, { children: j("ggnomad.tripPlan.removeItemDialog.title", "Remove item from trip?") }), /* @__PURE__ */ k(b, { children: j("ggnomad.tripPlan.removeItemDialog.description", "This item will be removed from your itinerary.") })] }), /* @__PURE__ */ A(x, { children: [/* @__PURE__ */ k(v, {
|
|
515
|
+
disabled: q,
|
|
516
|
+
children: j("ggnomad.tripPlan.removeItemDialog.cancel", "Keep item")
|
|
517
|
+
}), /* @__PURE__ */ k(_, {
|
|
518
|
+
className: "bg-action-danger-bg text-action-danger-text hover:bg-action-danger-bgHover",
|
|
519
|
+
disabled: q,
|
|
520
|
+
onClick: (e) => {
|
|
521
|
+
e.preventDefault(), _e();
|
|
522
|
+
},
|
|
523
|
+
children: q ? j("ggnomad.tripPlan.removeItemDialog.removing", "Removing…") : j("ggnomad.tripPlan.removeItemDialog.remove", "Remove item")
|
|
524
|
+
})] })] })
|
|
525
|
+
}),
|
|
526
|
+
/* @__PURE__ */ k(g, {
|
|
527
|
+
open: L,
|
|
528
|
+
onOpenChange: R,
|
|
529
|
+
children: /* @__PURE__ */ A(y, {
|
|
530
|
+
className: "max-w-2xl",
|
|
531
|
+
children: [
|
|
532
|
+
/* @__PURE__ */ A(S, { children: [/* @__PURE__ */ k(C, { children: j("ggnomad.tripPlan.checkoutDialog.title", "Review and book") }), /* @__PURE__ */ k(b, { children: j("ggnomad.tripPlan.checkoutDialog.description", "Review your items and confirm to book everything at once.") })] }),
|
|
533
|
+
/* @__PURE__ */ A("div", {
|
|
534
|
+
className: "space-y-4 max-h-96 overflow-y-auto",
|
|
535
|
+
children: [G.items.map((e) => /* @__PURE__ */ A("div", {
|
|
536
|
+
className: "flex items-center justify-between rounded-md border border-border-seam bg-bg-canvas p-3",
|
|
537
|
+
children: [/* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
|
|
538
|
+
className: "font-medium text-text-primary",
|
|
539
|
+
children: e.itemName
|
|
540
|
+
}), /* @__PURE__ */ k("p", {
|
|
541
|
+
className: "text-xs text-text-secondary",
|
|
542
|
+
children: e.itemType.charAt(0) + e.itemType.slice(1).toLowerCase()
|
|
543
|
+
})] }), /* @__PURE__ */ A("p", {
|
|
544
|
+
className: "font-semibold text-text-primary",
|
|
545
|
+
children: [
|
|
546
|
+
e.currency,
|
|
547
|
+
" ",
|
|
548
|
+
e.price.toFixed(2)
|
|
549
|
+
]
|
|
550
|
+
})]
|
|
551
|
+
}, e.id)), /* @__PURE__ */ A("div", {
|
|
552
|
+
className: "space-y-2 border-t border-border-seam pt-4",
|
|
553
|
+
children: [
|
|
554
|
+
/* @__PURE__ */ A("div", {
|
|
555
|
+
className: "flex justify-between text-sm",
|
|
556
|
+
children: [/* @__PURE__ */ k("span", {
|
|
557
|
+
className: "text-text-secondary",
|
|
558
|
+
children: "Subtotal"
|
|
559
|
+
}), /* @__PURE__ */ A("span", {
|
|
560
|
+
className: "text-text-primary",
|
|
561
|
+
children: ["USD ", G.total.toFixed(2)]
|
|
562
|
+
})]
|
|
563
|
+
}),
|
|
564
|
+
/* @__PURE__ */ A("div", {
|
|
565
|
+
className: "flex justify-between text-sm",
|
|
566
|
+
children: [/* @__PURE__ */ k("span", {
|
|
567
|
+
className: "text-text-secondary",
|
|
568
|
+
children: "Taxes (10%)"
|
|
569
|
+
}), /* @__PURE__ */ A("span", {
|
|
570
|
+
className: "text-text-primary",
|
|
571
|
+
children: ["USD ", (G.total * .1).toFixed(2)]
|
|
572
|
+
})]
|
|
573
|
+
}),
|
|
574
|
+
/* @__PURE__ */ A("div", {
|
|
575
|
+
className: "flex justify-between border-t border-border-seam pt-2 text-lg font-bold",
|
|
576
|
+
children: [/* @__PURE__ */ k("span", {
|
|
577
|
+
className: "text-text-primary",
|
|
578
|
+
children: "Total"
|
|
579
|
+
}), /* @__PURE__ */ A("span", {
|
|
580
|
+
className: "text-status-success-text",
|
|
581
|
+
children: ["USD ", (G.total * 1.1).toFixed(2)]
|
|
582
|
+
})]
|
|
583
|
+
})
|
|
584
|
+
]
|
|
585
|
+
})]
|
|
586
|
+
}),
|
|
587
|
+
/* @__PURE__ */ A(x, { children: [/* @__PURE__ */ k(v, {
|
|
588
|
+
disabled: !1,
|
|
589
|
+
children: j("ggnomad.tripPlan.checkoutDialog.cancel", "Cancel")
|
|
590
|
+
}), /* @__PURE__ */ k(_, {
|
|
591
|
+
onClick: (e) => {
|
|
592
|
+
e.preventDefault(), ve();
|
|
593
|
+
},
|
|
594
|
+
children: j("ggnomad.tripPlan.checkoutDialog.confirm", "Confirm & book all")
|
|
595
|
+
})] })
|
|
596
|
+
]
|
|
597
|
+
})
|
|
598
|
+
})
|
|
599
|
+
]
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
//#endregion
|
|
603
|
+
export { j as TripPlanDetailPage };
|
|
604
|
+
|
|
605
|
+
//# sourceMappingURL=TripPlanDetailPage.js.map
|