@burdenoff/microfe-tours 2026.523.1 → 2026.525.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/tours/i18n.d.ts +9 -1
- package/dist/tours/i18n.d.ts.map +1 -1
- package/dist/tours/i18n.js +8 -0
- package/dist/tours/i18n.js.map +1 -1
- package/dist/tours/pages/TourBuilderPage.d.ts.map +1 -1
- package/dist/tours/pages/TourBuilderPage.js +650 -474
- package/dist/tours/pages/TourBuilderPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,17 +3,51 @@ import { useGetPlatformProductsForToursQuery as t } from "../../generated/global
|
|
|
3
3
|
import { useTourLifecycle as n } from "../hooks/useTourLifecycle.js";
|
|
4
4
|
import { useToursPermissionAccess as r } from "../hooks/useToursPermissionAccess.js";
|
|
5
5
|
import { TOUR_PERMISSIONS as i } from "../../constants/permissions.js";
|
|
6
|
-
import { useToursI18n as
|
|
7
|
-
import { emitToursApiFailed as
|
|
8
|
-
import { useTourBuilder as
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { PermissionGate as
|
|
11
|
-
import { ArrowLeft as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { useNavigate as
|
|
14
|
-
import {
|
|
6
|
+
import { useToursI18n as ee } from "../i18n.js";
|
|
7
|
+
import { emitToursApiFailed as a } from "../telemetry.js";
|
|
8
|
+
import { useTourBuilder as te } from "../hooks/useTourBuilder.js";
|
|
9
|
+
import { useEffect as o, useMemo as s, useRef as ne, useState as c } from "react";
|
|
10
|
+
import { PermissionGate as l } from "@burdenoff/fe-libs/shared/components";
|
|
11
|
+
import { ArrowLeft as re, BarChart3 as ie, Calendar as ae, Eye as oe, LayoutTemplate as se, ListOrdered as ce, Save as le, Sparkles as ue } from "lucide-react";
|
|
12
|
+
import { Fragment as de, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
import { useNavigate as fe, useParams as pe } from "react-router-dom";
|
|
14
|
+
import { useGatewayClient as f } from "@burdenoff/fe-libs/shared/graphql";
|
|
15
|
+
import { useEventBus as me } from "@burdenoff/fe-libs/shared/events";
|
|
16
|
+
import { gql as p } from "@apollo/client/core";
|
|
15
17
|
//#region src/tours/pages/TourBuilderPage.tsx
|
|
16
|
-
var
|
|
18
|
+
var he = 250, ge = p`
|
|
19
|
+
mutation SeedVibeControlsUserTours {
|
|
20
|
+
seedVibeControlsUserTours {
|
|
21
|
+
productId
|
|
22
|
+
workspaceId
|
|
23
|
+
createdCount
|
|
24
|
+
updatedCount
|
|
25
|
+
totalCount
|
|
26
|
+
tours {
|
|
27
|
+
tourId
|
|
28
|
+
slug
|
|
29
|
+
name
|
|
30
|
+
action
|
|
31
|
+
stepCount
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
36
|
+
function _e(e) {
|
|
37
|
+
if (!e || typeof e != "object") return null;
|
|
38
|
+
let t = e, n = t.error;
|
|
39
|
+
if (n instanceof Error) return n.message;
|
|
40
|
+
let r = t.errors;
|
|
41
|
+
if (!Array.isArray(r) || r.length === 0) return null;
|
|
42
|
+
let i = r.map((e) => {
|
|
43
|
+
if (e instanceof Error) return e.message;
|
|
44
|
+
if (!e || typeof e != "object") return null;
|
|
45
|
+
let t = e.message;
|
|
46
|
+
return typeof t == "string" ? t : null;
|
|
47
|
+
}).filter((e) => !!e);
|
|
48
|
+
return i.length > 0 ? i.join("; ") : "Seed mutation returned errors.";
|
|
49
|
+
}
|
|
50
|
+
var m = [
|
|
17
51
|
{
|
|
18
52
|
productId: "vibecontrols",
|
|
19
53
|
moduleId: "dashboard",
|
|
@@ -169,40 +203,115 @@ var v = 250, y = [
|
|
|
169
203
|
pageLabel: "Sandbox",
|
|
170
204
|
path: "/sandbox",
|
|
171
205
|
isModuleHome: !0
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
productId: "vibecontrols",
|
|
209
|
+
moduleId: "support",
|
|
210
|
+
moduleLabel: "Support",
|
|
211
|
+
pageId: "tickets",
|
|
212
|
+
pageLabel: "Tickets",
|
|
213
|
+
path: "/support/tickets",
|
|
214
|
+
isModuleHome: !0
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
productId: "vibecontrols",
|
|
218
|
+
moduleId: "support",
|
|
219
|
+
moduleLabel: "Support",
|
|
220
|
+
pageId: "knowledge-base",
|
|
221
|
+
pageLabel: "Knowledge Base",
|
|
222
|
+
path: "/support/kb"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
productId: "vibecontrols",
|
|
226
|
+
moduleId: "notifications",
|
|
227
|
+
moduleLabel: "Notifications",
|
|
228
|
+
pageId: "center",
|
|
229
|
+
pageLabel: "Notification Center",
|
|
230
|
+
path: "/notifications/center",
|
|
231
|
+
isModuleHome: !0
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
productId: "vibecontrols",
|
|
235
|
+
moduleId: "notifications",
|
|
236
|
+
moduleLabel: "Notifications",
|
|
237
|
+
pageId: "history",
|
|
238
|
+
pageLabel: "History",
|
|
239
|
+
path: "/notifications/history"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
productId: "vibecontrols",
|
|
243
|
+
moduleId: "notifications",
|
|
244
|
+
moduleLabel: "Notifications",
|
|
245
|
+
pageId: "preferences",
|
|
246
|
+
pageLabel: "Preferences",
|
|
247
|
+
path: "/notifications/preferences"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
productId: "vibecontrols",
|
|
251
|
+
moduleId: "conversations",
|
|
252
|
+
moduleLabel: "Conversations",
|
|
253
|
+
pageId: "home",
|
|
254
|
+
pageLabel: "All Conversations",
|
|
255
|
+
path: "/conversations",
|
|
256
|
+
isModuleHome: !0
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
productId: "vibecontrols",
|
|
260
|
+
moduleId: "conversations",
|
|
261
|
+
moduleLabel: "Conversations",
|
|
262
|
+
pageId: "list",
|
|
263
|
+
pageLabel: "Conversation List",
|
|
264
|
+
path: "/conversations/list"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
productId: "vibecontrols",
|
|
268
|
+
moduleId: "conversations",
|
|
269
|
+
moduleLabel: "Conversations",
|
|
270
|
+
pageId: "new",
|
|
271
|
+
pageLabel: "New Conversation",
|
|
272
|
+
path: "/conversations/new"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
productId: "vibecontrols",
|
|
276
|
+
moduleId: "conversations",
|
|
277
|
+
moduleLabel: "Conversations",
|
|
278
|
+
pageId: "settings",
|
|
279
|
+
pageLabel: "Settings",
|
|
280
|
+
path: "/conversations/settings"
|
|
172
281
|
}
|
|
173
282
|
];
|
|
174
|
-
function
|
|
283
|
+
function h(e) {
|
|
175
284
|
return e?.trim() || void 0;
|
|
176
285
|
}
|
|
177
|
-
function
|
|
178
|
-
let t =
|
|
179
|
-
return t ?
|
|
286
|
+
function g(e) {
|
|
287
|
+
let t = h(e);
|
|
288
|
+
return t ? m.filter((e) => e.productId === t) : [];
|
|
180
289
|
}
|
|
181
|
-
function
|
|
290
|
+
function ve(e) {
|
|
182
291
|
let t = /* @__PURE__ */ new Map();
|
|
183
|
-
for (let n of
|
|
292
|
+
for (let n of g(e)) (!t.get(n.moduleId) || n.isModuleHome) && t.set(n.moduleId, {
|
|
184
293
|
moduleId: n.moduleId,
|
|
185
294
|
label: n.moduleLabel,
|
|
186
295
|
path: n.path
|
|
187
296
|
});
|
|
188
297
|
return [...t.values()];
|
|
189
298
|
}
|
|
190
|
-
function
|
|
191
|
-
let n =
|
|
192
|
-
return n ?
|
|
299
|
+
function ye(e, t) {
|
|
300
|
+
let n = h(t);
|
|
301
|
+
return n ? g(e).filter((e) => e.moduleId === n).map((e) => ({
|
|
193
302
|
pageId: e.pageId,
|
|
194
303
|
label: e.pageLabel,
|
|
195
304
|
path: e.path
|
|
196
305
|
})) : [];
|
|
197
306
|
}
|
|
198
|
-
function
|
|
199
|
-
let { tr:
|
|
307
|
+
function _() {
|
|
308
|
+
let { tr: p } = ee(), { tourId: m } = pe(), h = fe(), g = e(), { basePath: _ = "/" } = g, v = me(), be = f("global"), { hasPermission: y } = r(), b = !m || m === "new", x = y(i.TOUR_CREATE), S = y(i.TOUR_UPDATE), xe = y(i.TOUR_TEMPLATE_CREATE), Se = b ? x : S, C = x && S, { tour: w, loadTour: T, createTour: Ce, updateTour: we, saving: E, validationErrors: D, error: O } = te(m), { saveAsTemplate: k } = n(), { data: A, loading: j } = t({
|
|
200
309
|
variables: {
|
|
201
|
-
limit:
|
|
310
|
+
limit: he,
|
|
202
311
|
offset: 0
|
|
203
312
|
},
|
|
204
313
|
fetchPolicy: "cache-and-network"
|
|
205
|
-
}), [
|
|
314
|
+
}), [M, N] = c({
|
|
206
315
|
name: "",
|
|
207
316
|
description: "",
|
|
208
317
|
productId: "",
|
|
@@ -215,525 +324,592 @@ function S() {
|
|
|
215
324
|
displayOrder: 1,
|
|
216
325
|
startDate: "",
|
|
217
326
|
endDate: ""
|
|
218
|
-
}), [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
|
|
223
|
-
}, [
|
|
224
|
-
if (!
|
|
225
|
-
|
|
327
|
+
}), [P, F] = c(!1), [I, L] = c(!1), [R, z] = c(!1), [B, V] = c(!1), [H, U] = c(null), [W, G] = c(null), K = ne(!1), q = s(() => [...A?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [A]), J = s(() => new Set(q.map((e) => e.slug)), [q]), Y = s(() => ve(M.productId), [M.productId]), X = s(() => new Set(Y.map((e) => e.moduleId)), [Y]), Z = s(() => ye(M.productId, M.moduleId), [M.moduleId, M.productId]), Q = s(() => new Set(Z.map((e) => e.pageId)), [Z]);
|
|
328
|
+
o(() => {
|
|
329
|
+
m && m !== "new" && (K.current = !1, T(m));
|
|
330
|
+
}, [m, T]), o(() => {
|
|
331
|
+
w && !K.current && (N(w), K.current = !0);
|
|
332
|
+
}, [w]), o(() => {
|
|
333
|
+
if (!M.productId || j) {
|
|
334
|
+
F(!1);
|
|
226
335
|
return;
|
|
227
336
|
}
|
|
228
|
-
|
|
337
|
+
F(q.length > 0 && !J.has(M.productId));
|
|
229
338
|
}, [
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
]),
|
|
235
|
-
if (!
|
|
236
|
-
|
|
339
|
+
M.productId,
|
|
340
|
+
J,
|
|
341
|
+
q.length,
|
|
342
|
+
j
|
|
343
|
+
]), o(() => {
|
|
344
|
+
if (!M.productId || !M.moduleId) {
|
|
345
|
+
L(!1);
|
|
237
346
|
return;
|
|
238
347
|
}
|
|
239
|
-
|
|
348
|
+
L(Y.length === 0 || !X.has(M.moduleId));
|
|
240
349
|
}, [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
]),
|
|
246
|
-
if (!
|
|
247
|
-
|
|
350
|
+
M.moduleId,
|
|
351
|
+
M.productId,
|
|
352
|
+
X,
|
|
353
|
+
Y.length
|
|
354
|
+
]), o(() => {
|
|
355
|
+
if (!M.productId || !M.pageId) {
|
|
356
|
+
z(!1);
|
|
248
357
|
return;
|
|
249
358
|
}
|
|
250
|
-
|
|
359
|
+
z(Z.length === 0 || !Q.has(M.pageId));
|
|
251
360
|
}, [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
361
|
+
M.pageId,
|
|
362
|
+
M.productId,
|
|
363
|
+
Q,
|
|
364
|
+
Z.length
|
|
256
365
|
]);
|
|
257
|
-
let
|
|
366
|
+
let Te = !!(M.productId && !P && !J.has(M.productId)), Ee = !!(M.moduleId && !I && !X.has(M.moduleId)), De = !!(M.pageId && !R && !Q.has(M.pageId)), Oe = async (e) => {
|
|
258
367
|
e.preventDefault();
|
|
259
368
|
try {
|
|
260
|
-
|
|
369
|
+
m && m !== "new" ? await we(m, M) : await Ce(M);
|
|
261
370
|
} catch {
|
|
262
|
-
|
|
371
|
+
a(v, "tour.save", g);
|
|
263
372
|
}
|
|
264
|
-
},
|
|
265
|
-
|
|
373
|
+
}, ke = () => {
|
|
374
|
+
h(`${_}/list`);
|
|
266
375
|
}, $ = (e) => {
|
|
267
376
|
if (!e) return "";
|
|
268
377
|
let t = new Date(e);
|
|
269
378
|
return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
379
|
+
}, Ae = async () => {
|
|
380
|
+
if (!m || m === "new") return;
|
|
381
|
+
let e = `${M.name || w?.name || "Tour"} Template`, t = window.prompt("Template name", e);
|
|
382
|
+
if (!t) return;
|
|
383
|
+
let n = window.prompt("Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)", "ONBOARDING") || "ONBOARDING";
|
|
384
|
+
try {
|
|
385
|
+
await k(m, {
|
|
386
|
+
name: t,
|
|
387
|
+
description: M.description,
|
|
388
|
+
category: n,
|
|
389
|
+
isPublic: !1
|
|
390
|
+
}), h(`${_}/templates`);
|
|
391
|
+
} catch {
|
|
392
|
+
a(v, "template.save", g);
|
|
393
|
+
}
|
|
394
|
+
}, je = async () => {
|
|
395
|
+
if (window.confirm(p("tourBuilder.seedVibeControls.confirm"))) {
|
|
396
|
+
V(!0), U(null), G(null);
|
|
397
|
+
try {
|
|
398
|
+
let e = await be.mutate({ mutation: ge }), t = _e(e);
|
|
399
|
+
if (t) throw Error(t);
|
|
400
|
+
let n = e.data?.seedVibeControlsUserTours;
|
|
401
|
+
if (!n) throw Error("Seed mutation returned no result.");
|
|
402
|
+
U(n);
|
|
403
|
+
} catch (e) {
|
|
404
|
+
let t = e instanceof Error ? e.message : p("tourBuilder.seedVibeControls.error");
|
|
405
|
+
G(t), v.emit("tours.api.failed", {
|
|
406
|
+
route: "/tours",
|
|
407
|
+
operation: "tour.seed_vibecontrols_user_tours",
|
|
408
|
+
errorMessage: t,
|
|
409
|
+
productId: g.productId,
|
|
410
|
+
workspaceId: g.workspaceId
|
|
411
|
+
}, { component: "microfe-tours" });
|
|
412
|
+
} finally {
|
|
413
|
+
V(!1);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
270
416
|
};
|
|
271
|
-
return /* @__PURE__ */
|
|
417
|
+
return /* @__PURE__ */ d("div", {
|
|
272
418
|
className: "space-y-4 sm:space-y-6 p-3 sm:p-6 max-w-4xl mx-auto",
|
|
273
|
-
children: [
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ d("div", {
|
|
421
|
+
className: "flex items-center gap-4",
|
|
422
|
+
children: [/* @__PURE__ */ u("button", {
|
|
423
|
+
onClick: ke,
|
|
424
|
+
className: "p-2 hover:bg-accent rounded-md",
|
|
425
|
+
"aria-label": p("tourBuilder.goBack"),
|
|
426
|
+
children: /* @__PURE__ */ u(re, { size: 20 })
|
|
427
|
+
}), /* @__PURE__ */ d("div", {
|
|
428
|
+
className: "flex-1",
|
|
429
|
+
children: [/* @__PURE__ */ u("h1", {
|
|
430
|
+
className: "text-xl sm:text-2xl font-bold text-foreground",
|
|
431
|
+
children: p(m && m !== "new" ? "tourBuilder.titleEdit" : "tourBuilder.titleCreate")
|
|
432
|
+
}), /* @__PURE__ */ u("p", {
|
|
433
|
+
className: "text-sm text-muted-foreground",
|
|
434
|
+
children: p("tourBuilder.subtitle")
|
|
435
|
+
})]
|
|
288
436
|
})]
|
|
289
|
-
})
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
437
|
+
}),
|
|
438
|
+
b ? /* @__PURE__ */ d("div", {
|
|
439
|
+
className: "rounded-md border border-border bg-card p-4 sm:p-6",
|
|
440
|
+
children: [
|
|
441
|
+
/* @__PURE__ */ d("div", {
|
|
442
|
+
className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
443
|
+
children: [/* @__PURE__ */ d("div", {
|
|
444
|
+
className: "space-y-1",
|
|
445
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
446
|
+
className: "text-lg font-semibold text-foreground",
|
|
447
|
+
children: p("tourBuilder.seedVibeControls.title")
|
|
448
|
+
}), /* @__PURE__ */ u("p", {
|
|
449
|
+
className: "text-sm text-muted-foreground",
|
|
450
|
+
children: p("tourBuilder.seedVibeControls.description")
|
|
451
|
+
})]
|
|
452
|
+
}), /* @__PURE__ */ d("button", {
|
|
453
|
+
type: "button",
|
|
454
|
+
onClick: () => void je(),
|
|
455
|
+
disabled: B || !C,
|
|
456
|
+
className: "inline-flex min-h-11 items-center justify-center gap-2 rounded-md border border-border bg-secondary px-4 py-2 text-sm font-medium text-secondary-foreground hover:bg-secondary/80 disabled:cursor-not-allowed disabled:opacity-50",
|
|
457
|
+
children: [/* @__PURE__ */ u(ue, { size: 18 }), p(B ? "tourBuilder.seedVibeControls.loading" : "tourBuilder.seedVibeControls.button")]
|
|
458
|
+
})]
|
|
459
|
+
}),
|
|
460
|
+
C ? null : /* @__PURE__ */ u("p", {
|
|
461
|
+
className: "mt-3 text-sm text-muted-foreground",
|
|
462
|
+
children: p("tourBuilder.seedVibeControls.permissionHint")
|
|
463
|
+
}),
|
|
464
|
+
W ? /* @__PURE__ */ u("p", {
|
|
465
|
+
className: "mt-3 text-sm text-destructive",
|
|
466
|
+
children: W
|
|
467
|
+
}) : null,
|
|
468
|
+
H ? /* @__PURE__ */ u("div", {
|
|
469
|
+
className: "mt-3 rounded-md border border-border bg-background p-3 text-sm text-muted-foreground",
|
|
470
|
+
children: p("tourBuilder.seedVibeControls.result", {
|
|
471
|
+
totalCount: H.totalCount,
|
|
472
|
+
productId: H.productId,
|
|
473
|
+
workspaceId: H.workspaceId,
|
|
474
|
+
createdCount: H.createdCount,
|
|
475
|
+
updatedCount: H.updatedCount
|
|
476
|
+
})
|
|
477
|
+
}) : null
|
|
478
|
+
]
|
|
479
|
+
}) : null,
|
|
480
|
+
/* @__PURE__ */ d("form", {
|
|
481
|
+
onSubmit: Oe,
|
|
482
|
+
className: "space-y-6",
|
|
483
|
+
children: [
|
|
484
|
+
/* @__PURE__ */ d("div", {
|
|
485
|
+
className: "border border-border rounded-md p-4 sm:p-6 bg-card",
|
|
486
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
487
|
+
className: "text-lg font-semibold mb-4",
|
|
488
|
+
children: p("tourBuilder.sectionBasicInfo")
|
|
489
|
+
}), /* @__PURE__ */ d("div", {
|
|
490
|
+
className: "space-y-4",
|
|
491
|
+
children: [
|
|
492
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
333
493
|
className: "block text-sm font-medium mb-2",
|
|
334
|
-
htmlFor: "
|
|
335
|
-
children:
|
|
336
|
-
}),
|
|
337
|
-
|
|
338
|
-
id: "product-id",
|
|
339
|
-
value: z ? "__custom__" : L.productId || "",
|
|
340
|
-
onChange: (e) => {
|
|
341
|
-
if (e.target.value === "__custom__") {
|
|
342
|
-
B(!0), R({
|
|
343
|
-
...L,
|
|
344
|
-
productId: "",
|
|
345
|
-
moduleId: void 0,
|
|
346
|
-
pageId: void 0
|
|
347
|
-
});
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
B(!1), H(!1), W(!1), R({
|
|
351
|
-
...L,
|
|
352
|
-
productId: e.target.value,
|
|
353
|
-
moduleId: void 0,
|
|
354
|
-
pageId: void 0
|
|
355
|
-
});
|
|
356
|
-
},
|
|
357
|
-
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
358
|
-
required: !0,
|
|
359
|
-
children: [
|
|
360
|
-
/* @__PURE__ */ p("option", {
|
|
361
|
-
value: "",
|
|
362
|
-
children: "Select product"
|
|
363
|
-
}),
|
|
364
|
-
I ? /* @__PURE__ */ p("option", {
|
|
365
|
-
disabled: !0,
|
|
366
|
-
children: "Loading products..."
|
|
367
|
-
}) : null,
|
|
368
|
-
K.map((e) => /* @__PURE__ */ m("option", {
|
|
369
|
-
value: e.slug,
|
|
370
|
-
children: [
|
|
371
|
-
e.name,
|
|
372
|
-
" (",
|
|
373
|
-
e.slug,
|
|
374
|
-
")"
|
|
375
|
-
]
|
|
376
|
-
}, e.id)),
|
|
377
|
-
me ? /* @__PURE__ */ m("option", {
|
|
378
|
-
value: L.productId,
|
|
379
|
-
children: ["Current: ", L.productId]
|
|
380
|
-
}) : null,
|
|
381
|
-
/* @__PURE__ */ p("option", {
|
|
382
|
-
value: "__custom__",
|
|
383
|
-
children: "Custom product slug"
|
|
384
|
-
})
|
|
385
|
-
]
|
|
386
|
-
}),
|
|
387
|
-
z ? /* @__PURE__ */ p("input", {
|
|
388
|
-
id: "product-id-custom",
|
|
494
|
+
htmlFor: "tour-name",
|
|
495
|
+
children: p("tourBuilder.labelName")
|
|
496
|
+
}), /* @__PURE__ */ u("input", {
|
|
497
|
+
id: "tour-name",
|
|
389
498
|
type: "text",
|
|
390
|
-
value:
|
|
391
|
-
onChange: (e) =>
|
|
392
|
-
...
|
|
393
|
-
|
|
394
|
-
moduleId: void 0,
|
|
395
|
-
pageId: void 0
|
|
499
|
+
value: M.name || "",
|
|
500
|
+
onChange: (e) => N({
|
|
501
|
+
...M,
|
|
502
|
+
name: e.target.value
|
|
396
503
|
}),
|
|
397
|
-
className: "
|
|
398
|
-
placeholder: "vibecontrols",
|
|
504
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
399
505
|
required: !0
|
|
400
|
-
})
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
506
|
+
})] }),
|
|
507
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
508
|
+
className: "block text-sm font-medium mb-2",
|
|
509
|
+
htmlFor: "tour-description",
|
|
510
|
+
children: p("tourBuilder.labelDescription")
|
|
511
|
+
}), /* @__PURE__ */ u("textarea", {
|
|
512
|
+
id: "tour-description",
|
|
513
|
+
value: M.description || "",
|
|
514
|
+
onChange: (e) => N({
|
|
515
|
+
...M,
|
|
516
|
+
description: e.target.value
|
|
517
|
+
}),
|
|
518
|
+
rows: 3,
|
|
519
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
520
|
+
})] }),
|
|
521
|
+
/* @__PURE__ */ d("div", { children: [
|
|
522
|
+
/* @__PURE__ */ u("label", {
|
|
406
523
|
className: "block text-sm font-medium mb-2",
|
|
407
|
-
htmlFor: "
|
|
408
|
-
children: "
|
|
524
|
+
htmlFor: "product-id",
|
|
525
|
+
children: p("tourBuilder.labelProductId")
|
|
409
526
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
id: "
|
|
412
|
-
value:
|
|
527
|
+
/* @__PURE__ */ d("select", {
|
|
528
|
+
id: "product-id",
|
|
529
|
+
value: P ? "__custom__" : M.productId || "",
|
|
413
530
|
onChange: (e) => {
|
|
414
531
|
if (e.target.value === "__custom__") {
|
|
415
|
-
|
|
416
|
-
...
|
|
417
|
-
|
|
532
|
+
F(!0), N({
|
|
533
|
+
...M,
|
|
534
|
+
productId: "",
|
|
535
|
+
moduleId: void 0,
|
|
418
536
|
pageId: void 0
|
|
419
537
|
});
|
|
420
538
|
return;
|
|
421
539
|
}
|
|
422
|
-
|
|
423
|
-
...
|
|
424
|
-
|
|
540
|
+
F(!1), L(!1), z(!1), N({
|
|
541
|
+
...M,
|
|
542
|
+
productId: e.target.value,
|
|
543
|
+
moduleId: void 0,
|
|
425
544
|
pageId: void 0
|
|
426
545
|
});
|
|
427
546
|
},
|
|
428
547
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
429
|
-
|
|
548
|
+
required: !0,
|
|
430
549
|
children: [
|
|
431
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ u("option", {
|
|
432
551
|
value: "",
|
|
433
|
-
children: "
|
|
552
|
+
children: "Select product"
|
|
434
553
|
}),
|
|
435
|
-
|
|
436
|
-
|
|
554
|
+
j ? /* @__PURE__ */ u("option", {
|
|
555
|
+
disabled: !0,
|
|
556
|
+
children: "Loading products..."
|
|
557
|
+
}) : null,
|
|
558
|
+
q.map((e) => /* @__PURE__ */ d("option", {
|
|
559
|
+
value: e.slug,
|
|
437
560
|
children: [
|
|
438
|
-
e.
|
|
561
|
+
e.name,
|
|
439
562
|
" (",
|
|
440
|
-
e.
|
|
563
|
+
e.slug,
|
|
441
564
|
")"
|
|
442
565
|
]
|
|
443
|
-
}, e.
|
|
444
|
-
|
|
445
|
-
value:
|
|
446
|
-
children: ["Current: ",
|
|
566
|
+
}, e.id)),
|
|
567
|
+
Te ? /* @__PURE__ */ d("option", {
|
|
568
|
+
value: M.productId,
|
|
569
|
+
children: ["Current: ", M.productId]
|
|
447
570
|
}) : null,
|
|
448
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ u("option", {
|
|
449
572
|
value: "__custom__",
|
|
450
|
-
children: "Custom
|
|
573
|
+
children: "Custom product slug"
|
|
451
574
|
})
|
|
452
575
|
]
|
|
453
576
|
}),
|
|
454
|
-
|
|
455
|
-
id: "
|
|
577
|
+
P ? /* @__PURE__ */ u("input", {
|
|
578
|
+
id: "product-id-custom",
|
|
456
579
|
type: "text",
|
|
457
|
-
value:
|
|
458
|
-
onChange: (e) =>
|
|
459
|
-
...
|
|
460
|
-
|
|
580
|
+
value: M.productId || "",
|
|
581
|
+
onChange: (e) => N({
|
|
582
|
+
...M,
|
|
583
|
+
productId: e.target.value,
|
|
584
|
+
moduleId: void 0,
|
|
461
585
|
pageId: void 0
|
|
462
586
|
}),
|
|
463
587
|
className: "mt-2 w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
464
|
-
placeholder: "vibecontrols"
|
|
588
|
+
placeholder: "vibecontrols",
|
|
589
|
+
required: !0
|
|
465
590
|
}) : null
|
|
466
|
-
] }),
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
591
|
+
] }),
|
|
592
|
+
/* @__PURE__ */ d("div", {
|
|
593
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
594
|
+
children: [/* @__PURE__ */ d("div", { children: [
|
|
595
|
+
/* @__PURE__ */ u("label", {
|
|
596
|
+
className: "block text-sm font-medium mb-2",
|
|
597
|
+
htmlFor: "module-id",
|
|
598
|
+
children: "Module ID"
|
|
599
|
+
}),
|
|
600
|
+
/* @__PURE__ */ d("select", {
|
|
601
|
+
id: "module-id",
|
|
602
|
+
value: I ? "__custom__" : M.moduleId || "",
|
|
603
|
+
onChange: (e) => {
|
|
604
|
+
if (e.target.value === "__custom__") {
|
|
605
|
+
L(!0), N({
|
|
606
|
+
...M,
|
|
607
|
+
moduleId: "",
|
|
608
|
+
pageId: void 0
|
|
609
|
+
});
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
L(!1), z(!1), N({
|
|
613
|
+
...M,
|
|
614
|
+
moduleId: e.target.value || void 0,
|
|
615
|
+
pageId: void 0
|
|
480
616
|
});
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
617
|
+
},
|
|
618
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
619
|
+
disabled: !M.productId,
|
|
620
|
+
children: [
|
|
621
|
+
/* @__PURE__ */ u("option", {
|
|
622
|
+
value: "",
|
|
623
|
+
children: "All modules"
|
|
624
|
+
}),
|
|
625
|
+
Y.map((e) => /* @__PURE__ */ d("option", {
|
|
626
|
+
value: e.moduleId,
|
|
627
|
+
children: [
|
|
628
|
+
e.label,
|
|
629
|
+
" (",
|
|
630
|
+
e.moduleId,
|
|
631
|
+
")"
|
|
632
|
+
]
|
|
633
|
+
}, e.moduleId)),
|
|
634
|
+
Ee ? /* @__PURE__ */ d("option", {
|
|
635
|
+
value: M.moduleId,
|
|
636
|
+
children: ["Current: ", M.moduleId]
|
|
637
|
+
}) : null,
|
|
638
|
+
/* @__PURE__ */ u("option", {
|
|
639
|
+
value: "__custom__",
|
|
640
|
+
children: "Custom module ID"
|
|
641
|
+
})
|
|
642
|
+
]
|
|
643
|
+
}),
|
|
644
|
+
I ? /* @__PURE__ */ u("input", {
|
|
645
|
+
id: "module-id-custom",
|
|
646
|
+
type: "text",
|
|
647
|
+
value: M.moduleId || "",
|
|
648
|
+
onChange: (e) => N({
|
|
649
|
+
...M,
|
|
650
|
+
moduleId: e.target.value || void 0,
|
|
651
|
+
pageId: void 0
|
|
494
652
|
}),
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}, e.pageId)),
|
|
504
|
-
ge ? /* @__PURE__ */ m("option", {
|
|
505
|
-
value: L.pageId,
|
|
506
|
-
children: ["Current: ", L.pageId]
|
|
507
|
-
}) : null,
|
|
508
|
-
/* @__PURE__ */ p("option", {
|
|
509
|
-
value: "__custom__",
|
|
510
|
-
children: "Custom page ID"
|
|
511
|
-
})
|
|
512
|
-
]
|
|
513
|
-
}),
|
|
514
|
-
U ? /* @__PURE__ */ p("input", {
|
|
515
|
-
id: "page-id-custom",
|
|
516
|
-
type: "text",
|
|
517
|
-
value: L.pageId || "",
|
|
518
|
-
onChange: (e) => R({
|
|
519
|
-
...L,
|
|
520
|
-
pageId: e.target.value || void 0
|
|
653
|
+
className: "mt-2 w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
654
|
+
placeholder: "vibecontrols"
|
|
655
|
+
}) : null
|
|
656
|
+
] }), /* @__PURE__ */ d("div", { children: [
|
|
657
|
+
/* @__PURE__ */ u("label", {
|
|
658
|
+
className: "block text-sm font-medium mb-2",
|
|
659
|
+
htmlFor: "page-id",
|
|
660
|
+
children: "Page ID"
|
|
521
661
|
}),
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
662
|
+
/* @__PURE__ */ d("select", {
|
|
663
|
+
id: "page-id",
|
|
664
|
+
value: R ? "__custom__" : M.pageId || "",
|
|
665
|
+
onChange: (e) => {
|
|
666
|
+
if (e.target.value === "__custom__") {
|
|
667
|
+
z(!0), N({
|
|
668
|
+
...M,
|
|
669
|
+
pageId: ""
|
|
670
|
+
});
|
|
671
|
+
return;
|
|
672
|
+
}
|
|
673
|
+
z(!1), N({
|
|
674
|
+
...M,
|
|
675
|
+
pageId: e.target.value || void 0
|
|
676
|
+
});
|
|
677
|
+
},
|
|
678
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
679
|
+
disabled: !M.productId,
|
|
680
|
+
children: [
|
|
681
|
+
/* @__PURE__ */ u("option", {
|
|
682
|
+
value: "",
|
|
683
|
+
children: "All pages"
|
|
684
|
+
}),
|
|
685
|
+
Z.map((e) => /* @__PURE__ */ d("option", {
|
|
686
|
+
value: e.pageId,
|
|
687
|
+
children: [
|
|
688
|
+
e.label,
|
|
689
|
+
" (",
|
|
690
|
+
e.pageId,
|
|
691
|
+
")"
|
|
692
|
+
]
|
|
693
|
+
}, e.pageId)),
|
|
694
|
+
De ? /* @__PURE__ */ d("option", {
|
|
695
|
+
value: M.pageId,
|
|
696
|
+
children: ["Current: ", M.pageId]
|
|
697
|
+
}) : null,
|
|
698
|
+
/* @__PURE__ */ u("option", {
|
|
699
|
+
value: "__custom__",
|
|
700
|
+
children: "Custom page ID"
|
|
701
|
+
})
|
|
702
|
+
]
|
|
703
|
+
}),
|
|
704
|
+
R ? /* @__PURE__ */ u("input", {
|
|
705
|
+
id: "page-id-custom",
|
|
706
|
+
type: "text",
|
|
707
|
+
value: M.pageId || "",
|
|
708
|
+
onChange: (e) => N({
|
|
709
|
+
...M,
|
|
710
|
+
pageId: e.target.value || void 0
|
|
711
|
+
}),
|
|
712
|
+
className: "mt-2 w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
713
|
+
placeholder: "agents"
|
|
714
|
+
}) : null
|
|
715
|
+
] })]
|
|
563
716
|
}),
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
/* @__PURE__ */
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
|
|
576
|
-
children:
|
|
577
|
-
})
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
children: y("tourBuilder.labelPriority")
|
|
592
|
-
}), /* @__PURE__ */ p("input", {
|
|
593
|
-
id: "priority",
|
|
594
|
-
type: "number",
|
|
595
|
-
min: "1",
|
|
596
|
-
max: "100",
|
|
597
|
-
value: L.priority || 50,
|
|
598
|
-
onChange: (e) => {
|
|
599
|
-
let t = Number.parseInt(e.target.value, 10) || 50;
|
|
600
|
-
R({
|
|
601
|
-
...L,
|
|
602
|
-
priority: t
|
|
603
|
-
});
|
|
604
|
-
},
|
|
605
|
-
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
606
|
-
})] }),
|
|
607
|
-
/* @__PURE__ */ m("div", {
|
|
608
|
-
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
609
|
-
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
717
|
+
/* @__PURE__ */ d("label", {
|
|
718
|
+
className: "flex items-center gap-3 cursor-pointer",
|
|
719
|
+
children: [/* @__PURE__ */ u("input", {
|
|
720
|
+
type: "checkbox",
|
|
721
|
+
checked: M.isActive ?? !0,
|
|
722
|
+
onChange: (e) => N({
|
|
723
|
+
...M,
|
|
724
|
+
isActive: e.target.checked
|
|
725
|
+
}),
|
|
726
|
+
className: "w-4 h-4 rounded"
|
|
727
|
+
}), /* @__PURE__ */ u("span", {
|
|
728
|
+
className: "text-sm font-medium",
|
|
729
|
+
children: "Active"
|
|
730
|
+
})]
|
|
731
|
+
})
|
|
732
|
+
]
|
|
733
|
+
})]
|
|
734
|
+
}),
|
|
735
|
+
/* @__PURE__ */ d("div", {
|
|
736
|
+
className: "border border-border rounded-md p-4 sm:p-6 bg-card",
|
|
737
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
738
|
+
className: "text-lg font-semibold mb-4",
|
|
739
|
+
children: p("tourBuilder.sectionTriggerSettings")
|
|
740
|
+
}), /* @__PURE__ */ d("div", {
|
|
741
|
+
className: "space-y-4",
|
|
742
|
+
children: [
|
|
743
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
610
744
|
className: "block text-sm font-medium mb-2",
|
|
611
|
-
htmlFor: "
|
|
612
|
-
children: "
|
|
613
|
-
}), /* @__PURE__ */
|
|
614
|
-
id: "
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
startDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
745
|
+
htmlFor: "trigger-type",
|
|
746
|
+
children: p("tourBuilder.labelTriggerType")
|
|
747
|
+
}), /* @__PURE__ */ d("select", {
|
|
748
|
+
id: "trigger-type",
|
|
749
|
+
value: M.triggerType || "MANUAL",
|
|
750
|
+
onChange: (e) => N({
|
|
751
|
+
...M,
|
|
752
|
+
triggerType: e.target.value
|
|
620
753
|
}),
|
|
621
|
-
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
622
|
-
|
|
754
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
|
|
755
|
+
children: [
|
|
756
|
+
/* @__PURE__ */ u("option", {
|
|
757
|
+
value: "MANUAL",
|
|
758
|
+
children: p("tourBuilder.triggerManual")
|
|
759
|
+
}),
|
|
760
|
+
/* @__PURE__ */ u("option", {
|
|
761
|
+
value: "AUTO_FIRST_VISIT",
|
|
762
|
+
children: p("tourBuilder.triggerAutoFirstVisit")
|
|
763
|
+
}),
|
|
764
|
+
/* @__PURE__ */ u("option", {
|
|
765
|
+
value: "AUTO_ALWAYS",
|
|
766
|
+
children: p("tourBuilder.triggerAutoAlways")
|
|
767
|
+
}),
|
|
768
|
+
/* @__PURE__ */ u("option", {
|
|
769
|
+
value: "ON_EVENT",
|
|
770
|
+
children: p("tourBuilder.triggerOnEvent")
|
|
771
|
+
}),
|
|
772
|
+
/* @__PURE__ */ u("option", {
|
|
773
|
+
value: "SCHEDULED",
|
|
774
|
+
children: p("tourBuilder.triggerScheduled")
|
|
775
|
+
})
|
|
776
|
+
]
|
|
777
|
+
})] }),
|
|
778
|
+
/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
623
779
|
className: "block text-sm font-medium mb-2",
|
|
624
|
-
htmlFor: "
|
|
625
|
-
children: "
|
|
626
|
-
}), /* @__PURE__ */
|
|
627
|
-
id: "
|
|
628
|
-
type: "
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
780
|
+
htmlFor: "priority",
|
|
781
|
+
children: p("tourBuilder.labelPriority")
|
|
782
|
+
}), /* @__PURE__ */ u("input", {
|
|
783
|
+
id: "priority",
|
|
784
|
+
type: "number",
|
|
785
|
+
min: "1",
|
|
786
|
+
max: "100",
|
|
787
|
+
value: M.priority || 50,
|
|
788
|
+
onChange: (e) => {
|
|
789
|
+
let t = Number.parseInt(e.target.value, 10) || 50;
|
|
790
|
+
N({
|
|
791
|
+
...M,
|
|
792
|
+
priority: t
|
|
793
|
+
});
|
|
794
|
+
},
|
|
634
795
|
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
635
|
-
})] })
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
children: [/* @__PURE__ */ p(f, {
|
|
666
|
-
permission: E ? i.TOUR_CREATE : i.TOUR_UPDATE,
|
|
667
|
-
children: /* @__PURE__ */ m("button", {
|
|
668
|
-
type: "submit",
|
|
669
|
-
disabled: j || !pe,
|
|
670
|
-
className: "flex-1 min-w-[200px] px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 flex items-center justify-center gap-2",
|
|
671
|
-
children: [/* @__PURE__ */ p(oe, { size: 20 }), y(j ? "tourBuilder.saving" : b && b !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
|
|
672
|
-
})
|
|
673
|
-
}), b && b !== "new" && /* @__PURE__ */ m(se, { children: [
|
|
674
|
-
/* @__PURE__ */ m("button", {
|
|
675
|
-
type: "button",
|
|
676
|
-
onClick: () => x(`${C}/${b}/steps`),
|
|
677
|
-
className: "px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/80 flex items-center gap-2",
|
|
678
|
-
children: [
|
|
679
|
-
/* @__PURE__ */ p(ae, { size: 20 }),
|
|
680
|
-
y("tourBuilder.editSteps"),
|
|
681
|
-
D?.steps && D.steps.length > 0 && /* @__PURE__ */ p("span", {
|
|
682
|
-
className: "ml-1 px-2 py-0.5 text-xs bg-primary/20 rounded-full",
|
|
683
|
-
children: D.steps.length
|
|
796
|
+
})] }),
|
|
797
|
+
/* @__PURE__ */ d("div", {
|
|
798
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
799
|
+
children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
800
|
+
className: "block text-sm font-medium mb-2",
|
|
801
|
+
htmlFor: "tour-start-date",
|
|
802
|
+
children: "Start Date"
|
|
803
|
+
}), /* @__PURE__ */ u("input", {
|
|
804
|
+
id: "tour-start-date",
|
|
805
|
+
type: "datetime-local",
|
|
806
|
+
value: $(M.startDate),
|
|
807
|
+
onChange: (e) => N({
|
|
808
|
+
...M,
|
|
809
|
+
startDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
810
|
+
}),
|
|
811
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
812
|
+
})] }), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("label", {
|
|
813
|
+
className: "block text-sm font-medium mb-2",
|
|
814
|
+
htmlFor: "tour-end-date",
|
|
815
|
+
children: "End Date"
|
|
816
|
+
}), /* @__PURE__ */ u("input", {
|
|
817
|
+
id: "tour-end-date",
|
|
818
|
+
type: "datetime-local",
|
|
819
|
+
value: $(M.endDate),
|
|
820
|
+
onChange: (e) => N({
|
|
821
|
+
...M,
|
|
822
|
+
endDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
|
|
823
|
+
}),
|
|
824
|
+
className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
|
|
825
|
+
})] })]
|
|
684
826
|
})
|
|
685
827
|
]
|
|
686
|
-
})
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
828
|
+
})]
|
|
829
|
+
}),
|
|
830
|
+
O && /* @__PURE__ */ d("div", {
|
|
831
|
+
className: "border border-destructive rounded-md p-4 bg-destructive/10",
|
|
832
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
833
|
+
className: "font-semibold text-destructive mb-2",
|
|
834
|
+
children: p("tourBuilder.errorTitle")
|
|
835
|
+
}), /* @__PURE__ */ u("p", {
|
|
836
|
+
className: "text-sm text-destructive",
|
|
837
|
+
children: O.message
|
|
838
|
+
})]
|
|
839
|
+
}),
|
|
840
|
+
D.length > 0 && /* @__PURE__ */ d("div", {
|
|
841
|
+
className: "border border-destructive rounded-md p-4 bg-destructive/10",
|
|
842
|
+
children: [/* @__PURE__ */ u("h3", {
|
|
843
|
+
className: "font-semibold text-destructive mb-2",
|
|
844
|
+
children: p("tourBuilder.validationErrorsTitle")
|
|
845
|
+
}), /* @__PURE__ */ u("ul", {
|
|
846
|
+
className: "list-disc list-inside space-y-1",
|
|
847
|
+
children: D.map((e, t) => /* @__PURE__ */ u("li", {
|
|
848
|
+
className: "text-sm text-destructive",
|
|
849
|
+
children: e.message
|
|
850
|
+
}, t))
|
|
851
|
+
})]
|
|
852
|
+
}),
|
|
853
|
+
/* @__PURE__ */ d("div", {
|
|
854
|
+
className: "flex flex-wrap gap-3",
|
|
855
|
+
children: [/* @__PURE__ */ u(l, {
|
|
856
|
+
permission: b ? i.TOUR_CREATE : i.TOUR_UPDATE,
|
|
857
|
+
children: /* @__PURE__ */ d("button", {
|
|
858
|
+
type: "submit",
|
|
859
|
+
disabled: E || !Se,
|
|
860
|
+
className: "flex-1 min-w-[200px] px-4 py-2 bg-primary text-primary-foreground rounded-md hover:bg-primary/90 disabled:opacity-50 flex items-center justify-center gap-2",
|
|
861
|
+
children: [/* @__PURE__ */ u(le, { size: 20 }), p(E ? "tourBuilder.saving" : m && m !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
|
|
862
|
+
})
|
|
863
|
+
}), m && m !== "new" && /* @__PURE__ */ d(de, { children: [
|
|
864
|
+
/* @__PURE__ */ d("button", {
|
|
865
|
+
type: "button",
|
|
866
|
+
onClick: () => h(`${_}/${m}/steps`),
|
|
867
|
+
className: "px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/80 flex items-center gap-2",
|
|
868
|
+
children: [
|
|
869
|
+
/* @__PURE__ */ u(ce, { size: 20 }),
|
|
870
|
+
p("tourBuilder.editSteps"),
|
|
871
|
+
w?.steps && w.steps.length > 0 && /* @__PURE__ */ u("span", {
|
|
872
|
+
className: "ml-1 px-2 py-0.5 text-xs bg-primary/20 rounded-full",
|
|
873
|
+
children: w.steps.length
|
|
874
|
+
})
|
|
875
|
+
]
|
|
876
|
+
}),
|
|
877
|
+
/* @__PURE__ */ d("button", {
|
|
878
|
+
type: "button",
|
|
879
|
+
onClick: () => h(`${_}/${m}/preview`),
|
|
880
|
+
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
881
|
+
children: [/* @__PURE__ */ u(oe, { size: 20 }), p("tourBuilder.preview")]
|
|
882
|
+
}),
|
|
883
|
+
/* @__PURE__ */ d("button", {
|
|
708
884
|
type: "button",
|
|
709
|
-
onClick:
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
885
|
+
onClick: () => h(`${_}/${m}/analytics`),
|
|
886
|
+
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
887
|
+
children: [/* @__PURE__ */ u(ie, { size: 20 }), p("tourBuilder.analytics")]
|
|
888
|
+
}),
|
|
889
|
+
/* @__PURE__ */ d("button", {
|
|
890
|
+
type: "button",
|
|
891
|
+
onClick: () => h(`${_}/${m}/schedule`),
|
|
892
|
+
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
|
|
893
|
+
children: [/* @__PURE__ */ u(ae, { size: 20 }), "Schedule"]
|
|
894
|
+
}),
|
|
895
|
+
/* @__PURE__ */ u(l, {
|
|
896
|
+
permission: i.TOUR_TEMPLATE_CREATE,
|
|
897
|
+
children: /* @__PURE__ */ d("button", {
|
|
898
|
+
type: "button",
|
|
899
|
+
onClick: Ae,
|
|
900
|
+
disabled: !xe,
|
|
901
|
+
className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2 disabled:opacity-50",
|
|
902
|
+
children: [/* @__PURE__ */ u(se, { size: 20 }), "Save as Template"]
|
|
903
|
+
})
|
|
728
904
|
})
|
|
729
|
-
})
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
905
|
+
] })]
|
|
906
|
+
})
|
|
907
|
+
]
|
|
908
|
+
})
|
|
909
|
+
]
|
|
734
910
|
});
|
|
735
911
|
}
|
|
736
912
|
//#endregion
|
|
737
|
-
export {
|
|
913
|
+
export { _ as TourBuilderPage };
|
|
738
914
|
|
|
739
915
|
//# sourceMappingURL=TourBuilderPage.js.map
|