@burdenoff/microfe-tours 2026.519.1 → 2026.523.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.
Files changed (52) hide show
  1. package/dist/index.js +2 -1
  2. package/dist/tours/ToursAdminRoot.d.ts.map +1 -1
  3. package/dist/tours/ToursAdminRoot.js +23 -20
  4. package/dist/tours/ToursAdminRoot.js.map +1 -1
  5. package/dist/tours/ToursUserRoot.d.ts.map +1 -1
  6. package/dist/tours/ToursUserRoot.js +25 -22
  7. package/dist/tours/ToursUserRoot.js.map +1 -1
  8. package/dist/tours/hooks/useMediaLibrary.js +3 -3
  9. package/dist/tours/hooks/useTourBuilder.js +10 -10
  10. package/dist/tours/hooks/useTourLifecycle.js +3 -3
  11. package/dist/tours/i18n.d.ts +5 -1
  12. package/dist/tours/i18n.d.ts.map +1 -1
  13. package/dist/tours/i18n.js +4 -0
  14. package/dist/tours/i18n.js.map +1 -1
  15. package/dist/tours/index.d.ts +1 -0
  16. package/dist/tours/index.d.ts.map +1 -1
  17. package/dist/tours/index.js +1 -0
  18. package/dist/tours/pages/AnalyticsDashboardPage.d.ts.map +1 -1
  19. package/dist/tours/pages/AnalyticsDashboardPage.js +5 -5
  20. package/dist/tours/pages/AnalyticsDashboardPage.js.map +1 -1
  21. package/dist/tours/pages/MediaLibraryPage.d.ts.map +1 -1
  22. package/dist/tours/pages/MediaLibraryPage.js +97 -96
  23. package/dist/tours/pages/MediaLibraryPage.js.map +1 -1
  24. package/dist/tours/pages/SchedulerPage.d.ts.map +1 -1
  25. package/dist/tours/pages/SchedulerPage.js +129 -126
  26. package/dist/tours/pages/SchedulerPage.js.map +1 -1
  27. package/dist/tours/pages/StepEditorPage.d.ts.map +1 -1
  28. package/dist/tours/pages/StepEditorPage.js +133 -128
  29. package/dist/tours/pages/StepEditorPage.js.map +1 -1
  30. package/dist/tours/pages/SystemAnalyticsPage.d.ts.map +1 -1
  31. package/dist/tours/pages/SystemAnalyticsPage.js +3 -3
  32. package/dist/tours/pages/SystemAnalyticsPage.js.map +1 -1
  33. package/dist/tours/pages/TemplateLibraryPage.d.ts.map +1 -1
  34. package/dist/tours/pages/TemplateLibraryPage.js +97 -94
  35. package/dist/tours/pages/TemplateLibraryPage.js.map +1 -1
  36. package/dist/tours/pages/TourBuilderPage.d.ts.map +1 -1
  37. package/dist/tours/pages/TourBuilderPage.js +232 -230
  38. package/dist/tours/pages/TourBuilderPage.js.map +1 -1
  39. package/dist/tours/pages/TourPreviewPage.d.ts.map +1 -1
  40. package/dist/tours/pages/TourPreviewPage.js +20 -18
  41. package/dist/tours/pages/TourPreviewPage.js.map +1 -1
  42. package/dist/tours/pages/ToursListPage.js +14 -14
  43. package/dist/tours/pages/ToursListPage.js.map +1 -1
  44. package/dist/tours/store/toursStore.d.ts +1 -0
  45. package/dist/tours/store/toursStore.d.ts.map +1 -1
  46. package/dist/tours/store/toursStore.js +14 -0
  47. package/dist/tours/store/toursStore.js.map +1 -1
  48. package/dist/tours/telemetry.d.ts +9 -0
  49. package/dist/tours/telemetry.d.ts.map +1 -0
  50. package/dist/tours/telemetry.js +19 -0
  51. package/dist/tours/telemetry.js.map +1 -0
  52. package/package.json +1 -1
@@ -4,14 +4,16 @@ 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
6
  import { useToursI18n as a } from "../i18n.js";
7
- import { useTourBuilder as o } from "../hooks/useTourBuilder.js";
8
- import { useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
9
- import { PermissionGate as d } from "@burdenoff/fe-libs/shared/components";
10
- import { ArrowLeft as f, BarChart3 as p, Calendar as ee, Eye as te, LayoutTemplate as ne, ListOrdered as m, Save as h } from "lucide-react";
11
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
12
- import { useNavigate as re, useParams as ie } from "react-router-dom";
7
+ import { emitToursApiFailed as o } from "../telemetry.js";
8
+ import { useTourBuilder as s } from "../hooks/useTourBuilder.js";
9
+ import { useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
10
+ import { PermissionGate as f } from "@burdenoff/fe-libs/shared/components";
11
+ import { ArrowLeft as ee, BarChart3 as te, Calendar as ne, Eye as re, LayoutTemplate as ie, ListOrdered as ae, Save as oe } from "lucide-react";
12
+ import { Fragment as se, jsx as p, jsxs as m } from "react/jsx-runtime";
13
+ import { useNavigate as h, useParams as g } from "react-router-dom";
14
+ import { useEventBus as _ } from "@burdenoff/fe-libs/shared/events";
13
15
  //#region src/tours/pages/TourBuilderPage.tsx
14
- var y = 250, b = [
16
+ var v = 250, y = [
15
17
  {
16
18
  productId: "vibecontrols",
17
19
  moduleId: "dashboard",
@@ -169,38 +171,38 @@ var y = 250, b = [
169
171
  isModuleHome: !0
170
172
  }
171
173
  ];
172
- function x(e) {
174
+ function b(e) {
173
175
  return e?.trim() || void 0;
174
176
  }
175
- function S(e) {
176
- let t = x(e);
177
- return t ? b.filter((e) => e.productId === t) : [];
177
+ function x(e) {
178
+ let t = b(e);
179
+ return t ? y.filter((e) => e.productId === t) : [];
178
180
  }
179
- function C(e) {
181
+ function ce(e) {
180
182
  let t = /* @__PURE__ */ new Map();
181
- for (let n of S(e)) (!t.get(n.moduleId) || n.isModuleHome) && t.set(n.moduleId, {
183
+ for (let n of x(e)) (!t.get(n.moduleId) || n.isModuleHome) && t.set(n.moduleId, {
182
184
  moduleId: n.moduleId,
183
185
  label: n.moduleLabel,
184
186
  path: n.path
185
187
  });
186
188
  return [...t.values()];
187
189
  }
188
- function w(e, t) {
189
- let n = x(t);
190
- return n ? S(e).filter((e) => e.moduleId === n).map((e) => ({
190
+ function le(e, t) {
191
+ let n = b(t);
192
+ return n ? x(e).filter((e) => e.moduleId === n).map((e) => ({
191
193
  pageId: e.pageId,
192
194
  label: e.pageLabel,
193
195
  path: e.path
194
196
  })) : [];
195
197
  }
196
- function T() {
197
- let { tr: b } = a(), { tourId: x } = ie(), S = re(), { basePath: T = "/" } = e(), { hasPermission: E } = r(), D = !x || x === "new", O = E(i.TOUR_CREATE), ae = E(i.TOUR_UPDATE), oe = E(i.TOUR_TEMPLATE_CREATE), se = D ? O : ae, { tour: k, loadTour: A, createTour: ce, updateTour: j, saving: M, validationErrors: N, error: P } = o(x), { saveAsTemplate: F } = n(), { data: I, loading: L } = t({
198
+ function S() {
199
+ let { tr: y } = a(), { tourId: b } = g(), x = h(), S = e(), { basePath: C = "/" } = S, w = _(), { hasPermission: T } = r(), E = !b || b === "new", ue = T(i.TOUR_CREATE), de = T(i.TOUR_UPDATE), fe = T(i.TOUR_TEMPLATE_CREATE), pe = E ? ue : de, { tour: D, loadTour: O, createTour: k, updateTour: A, saving: j, validationErrors: M, error: N } = s(b), { saveAsTemplate: P } = n(), { data: F, loading: I } = t({
198
200
  variables: {
199
- limit: y,
201
+ limit: v,
200
202
  offset: 0
201
203
  },
202
204
  fetchPolicy: "cache-and-network"
203
- }), [R, z] = u({
205
+ }), [L, R] = d({
204
206
  name: "",
205
207
  description: "",
206
208
  productId: "",
@@ -213,140 +215,140 @@ function T() {
213
215
  displayOrder: 1,
214
216
  startDate: "",
215
217
  endDate: ""
216
- }), [B, V] = u(!1), [H, U] = u(!1), [W, G] = u(!1), K = l(!1), q = c(() => [...I?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [I]), J = c(() => new Set(q.map((e) => e.slug)), [q]), Y = c(() => C(R.productId), [R.productId]), X = c(() => new Set(Y.map((e) => e.moduleId)), [Y]), Z = c(() => w(R.productId, R.moduleId), [R.moduleId, R.productId]), Q = c(() => new Set(Z.map((e) => e.pageId)), [Z]);
217
- s(() => {
218
- x && x !== "new" && (K.current = !1, A(x));
219
- }, [x, A]), s(() => {
220
- k && !K.current && (z(k), K.current = !0);
221
- }, [k]), s(() => {
222
- if (!R.productId || L) {
223
- V(!1);
218
+ }), [z, B] = d(!1), [V, H] = d(!1), [U, W] = d(!1), G = u(!1), K = l(() => [...F?.platformProducts.items ?? []].sort((e, t) => e.name.localeCompare(t.name)), [F]), q = l(() => new Set(K.map((e) => e.slug)), [K]), J = l(() => ce(L.productId), [L.productId]), Y = l(() => new Set(J.map((e) => e.moduleId)), [J]), X = l(() => le(L.productId, L.moduleId), [L.moduleId, L.productId]), Z = l(() => new Set(X.map((e) => e.pageId)), [X]);
219
+ c(() => {
220
+ b && b !== "new" && (G.current = !1, O(b));
221
+ }, [b, O]), c(() => {
222
+ D && !G.current && (R(D), G.current = !0);
223
+ }, [D]), c(() => {
224
+ if (!L.productId || I) {
225
+ B(!1);
224
226
  return;
225
227
  }
226
- V(q.length > 0 && !J.has(R.productId));
228
+ B(K.length > 0 && !q.has(L.productId));
227
229
  }, [
228
- R.productId,
229
- J,
230
- q.length,
231
- L
232
- ]), s(() => {
233
- if (!R.productId || !R.moduleId) {
234
- U(!1);
230
+ L.productId,
231
+ q,
232
+ K.length,
233
+ I
234
+ ]), c(() => {
235
+ if (!L.productId || !L.moduleId) {
236
+ H(!1);
235
237
  return;
236
238
  }
237
- U(Y.length === 0 || !X.has(R.moduleId));
239
+ H(J.length === 0 || !Y.has(L.moduleId));
238
240
  }, [
239
- R.moduleId,
240
- R.productId,
241
- X,
242
- Y.length
243
- ]), s(() => {
244
- if (!R.productId || !R.pageId) {
245
- G(!1);
241
+ L.moduleId,
242
+ L.productId,
243
+ Y,
244
+ J.length
245
+ ]), c(() => {
246
+ if (!L.productId || !L.pageId) {
247
+ W(!1);
246
248
  return;
247
249
  }
248
- G(Z.length === 0 || !Q.has(R.pageId));
250
+ W(X.length === 0 || !Z.has(L.pageId));
249
251
  }, [
250
- R.pageId,
251
- R.productId,
252
- Q,
253
- Z.length
252
+ L.pageId,
253
+ L.productId,
254
+ Z,
255
+ X.length
254
256
  ]);
255
- let le = !!(R.productId && !B && !J.has(R.productId)), ue = !!(R.moduleId && !H && !X.has(R.moduleId)), de = !!(R.pageId && !W && !Q.has(R.pageId)), fe = async (e) => {
257
+ let me = !!(L.productId && !z && !q.has(L.productId)), he = !!(L.moduleId && !V && !Y.has(L.moduleId)), ge = !!(L.pageId && !U && !Z.has(L.pageId)), _e = async (e) => {
256
258
  e.preventDefault();
257
259
  try {
258
- x && x !== "new" ? await j(x, R) : await ce(R);
259
- } catch (e) {
260
- console.error("Failed to save tour:", e);
260
+ b && b !== "new" ? await A(b, L) : await k(L);
261
+ } catch {
262
+ o(w, "tour.save", S);
261
263
  }
262
- }, pe = () => {
263
- S(`${T}/list`);
264
+ }, Q = () => {
265
+ x(`${C}/list`);
264
266
  }, $ = (e) => {
265
267
  if (!e) return "";
266
268
  let t = new Date(e);
267
269
  return Number.isNaN(t.getTime()) ? "" : (/* @__PURE__ */ new Date(t.getTime() - t.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
268
270
  };
269
- return /* @__PURE__ */ v("div", {
271
+ return /* @__PURE__ */ m("div", {
270
272
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6 max-w-4xl mx-auto",
271
- children: [/* @__PURE__ */ v("div", {
273
+ children: [/* @__PURE__ */ m("div", {
272
274
  className: "flex items-center gap-4",
273
- children: [/* @__PURE__ */ _("button", {
274
- onClick: pe,
275
+ children: [/* @__PURE__ */ p("button", {
276
+ onClick: Q,
275
277
  className: "p-2 hover:bg-accent rounded-md",
276
- "aria-label": b("tourBuilder.goBack"),
277
- children: /* @__PURE__ */ _(f, { size: 20 })
278
- }), /* @__PURE__ */ v("div", {
278
+ "aria-label": y("tourBuilder.goBack"),
279
+ children: /* @__PURE__ */ p(ee, { size: 20 })
280
+ }), /* @__PURE__ */ m("div", {
279
281
  className: "flex-1",
280
- children: [/* @__PURE__ */ _("h1", {
282
+ children: [/* @__PURE__ */ p("h1", {
281
283
  className: "text-xl sm:text-2xl font-bold text-foreground",
282
- children: b(x && x !== "new" ? "tourBuilder.titleEdit" : "tourBuilder.titleCreate")
283
- }), /* @__PURE__ */ _("p", {
284
+ children: y(b && b !== "new" ? "tourBuilder.titleEdit" : "tourBuilder.titleCreate")
285
+ }), /* @__PURE__ */ p("p", {
284
286
  className: "text-sm text-muted-foreground",
285
- children: b("tourBuilder.subtitle")
287
+ children: y("tourBuilder.subtitle")
286
288
  })]
287
289
  })]
288
- }), /* @__PURE__ */ v("form", {
289
- onSubmit: fe,
290
+ }), /* @__PURE__ */ m("form", {
291
+ onSubmit: _e,
290
292
  className: "space-y-6",
291
293
  children: [
292
- /* @__PURE__ */ v("div", {
294
+ /* @__PURE__ */ m("div", {
293
295
  className: "border border-border rounded-md p-4 sm:p-6 bg-card",
294
- children: [/* @__PURE__ */ _("h2", {
296
+ children: [/* @__PURE__ */ p("h2", {
295
297
  className: "text-lg font-semibold mb-4",
296
- children: b("tourBuilder.sectionBasicInfo")
297
- }), /* @__PURE__ */ v("div", {
298
+ children: y("tourBuilder.sectionBasicInfo")
299
+ }), /* @__PURE__ */ m("div", {
298
300
  className: "space-y-4",
299
301
  children: [
300
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
302
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
301
303
  className: "block text-sm font-medium mb-2",
302
304
  htmlFor: "tour-name",
303
- children: b("tourBuilder.labelName")
304
- }), /* @__PURE__ */ _("input", {
305
+ children: y("tourBuilder.labelName")
306
+ }), /* @__PURE__ */ p("input", {
305
307
  id: "tour-name",
306
308
  type: "text",
307
- value: R.name || "",
308
- onChange: (e) => z({
309
- ...R,
309
+ value: L.name || "",
310
+ onChange: (e) => R({
311
+ ...L,
310
312
  name: e.target.value
311
313
  }),
312
314
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
313
315
  required: !0
314
316
  })] }),
315
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
317
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
316
318
  className: "block text-sm font-medium mb-2",
317
319
  htmlFor: "tour-description",
318
- children: b("tourBuilder.labelDescription")
319
- }), /* @__PURE__ */ _("textarea", {
320
+ children: y("tourBuilder.labelDescription")
321
+ }), /* @__PURE__ */ p("textarea", {
320
322
  id: "tour-description",
321
- value: R.description || "",
322
- onChange: (e) => z({
323
- ...R,
323
+ value: L.description || "",
324
+ onChange: (e) => R({
325
+ ...L,
324
326
  description: e.target.value
325
327
  }),
326
328
  rows: 3,
327
329
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
328
330
  })] }),
329
- /* @__PURE__ */ v("div", { children: [
330
- /* @__PURE__ */ _("label", {
331
+ /* @__PURE__ */ m("div", { children: [
332
+ /* @__PURE__ */ p("label", {
331
333
  className: "block text-sm font-medium mb-2",
332
334
  htmlFor: "product-id",
333
- children: b("tourBuilder.labelProductId")
335
+ children: y("tourBuilder.labelProductId")
334
336
  }),
335
- /* @__PURE__ */ v("select", {
337
+ /* @__PURE__ */ m("select", {
336
338
  id: "product-id",
337
- value: B ? "__custom__" : R.productId || "",
339
+ value: z ? "__custom__" : L.productId || "",
338
340
  onChange: (e) => {
339
341
  if (e.target.value === "__custom__") {
340
- V(!0), z({
341
- ...R,
342
+ B(!0), R({
343
+ ...L,
342
344
  productId: "",
343
345
  moduleId: void 0,
344
346
  pageId: void 0
345
347
  });
346
348
  return;
347
349
  }
348
- V(!1), U(!1), G(!1), z({
349
- ...R,
350
+ B(!1), H(!1), W(!1), R({
351
+ ...L,
350
352
  productId: e.target.value,
351
353
  moduleId: void 0,
352
354
  pageId: void 0
@@ -355,15 +357,15 @@ function T() {
355
357
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
356
358
  required: !0,
357
359
  children: [
358
- /* @__PURE__ */ _("option", {
360
+ /* @__PURE__ */ p("option", {
359
361
  value: "",
360
362
  children: "Select product"
361
363
  }),
362
- L ? /* @__PURE__ */ _("option", {
364
+ I ? /* @__PURE__ */ p("option", {
363
365
  disabled: !0,
364
366
  children: "Loading products..."
365
367
  }) : null,
366
- q.map((e) => /* @__PURE__ */ v("option", {
368
+ K.map((e) => /* @__PURE__ */ m("option", {
367
369
  value: e.slug,
368
370
  children: [
369
371
  e.name,
@@ -372,22 +374,22 @@ function T() {
372
374
  ")"
373
375
  ]
374
376
  }, e.id)),
375
- le ? /* @__PURE__ */ v("option", {
376
- value: R.productId,
377
- children: ["Current: ", R.productId]
377
+ me ? /* @__PURE__ */ m("option", {
378
+ value: L.productId,
379
+ children: ["Current: ", L.productId]
378
380
  }) : null,
379
- /* @__PURE__ */ _("option", {
381
+ /* @__PURE__ */ p("option", {
380
382
  value: "__custom__",
381
383
  children: "Custom product slug"
382
384
  })
383
385
  ]
384
386
  }),
385
- B ? /* @__PURE__ */ _("input", {
387
+ z ? /* @__PURE__ */ p("input", {
386
388
  id: "product-id-custom",
387
389
  type: "text",
388
- value: R.productId || "",
389
- onChange: (e) => z({
390
- ...R,
390
+ value: L.productId || "",
391
+ onChange: (e) => R({
392
+ ...L,
391
393
  productId: e.target.value,
392
394
  moduleId: void 0,
393
395
  pageId: void 0
@@ -397,40 +399,40 @@ function T() {
397
399
  required: !0
398
400
  }) : null
399
401
  ] }),
400
- /* @__PURE__ */ v("div", {
402
+ /* @__PURE__ */ m("div", {
401
403
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
402
- children: [/* @__PURE__ */ v("div", { children: [
403
- /* @__PURE__ */ _("label", {
404
+ children: [/* @__PURE__ */ m("div", { children: [
405
+ /* @__PURE__ */ p("label", {
404
406
  className: "block text-sm font-medium mb-2",
405
407
  htmlFor: "module-id",
406
408
  children: "Module ID"
407
409
  }),
408
- /* @__PURE__ */ v("select", {
410
+ /* @__PURE__ */ m("select", {
409
411
  id: "module-id",
410
- value: H ? "__custom__" : R.moduleId || "",
412
+ value: V ? "__custom__" : L.moduleId || "",
411
413
  onChange: (e) => {
412
414
  if (e.target.value === "__custom__") {
413
- U(!0), z({
414
- ...R,
415
+ H(!0), R({
416
+ ...L,
415
417
  moduleId: "",
416
418
  pageId: void 0
417
419
  });
418
420
  return;
419
421
  }
420
- U(!1), G(!1), z({
421
- ...R,
422
+ H(!1), W(!1), R({
423
+ ...L,
422
424
  moduleId: e.target.value || void 0,
423
425
  pageId: void 0
424
426
  });
425
427
  },
426
428
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
427
- disabled: !R.productId,
429
+ disabled: !L.productId,
428
430
  children: [
429
- /* @__PURE__ */ _("option", {
431
+ /* @__PURE__ */ p("option", {
430
432
  value: "",
431
433
  children: "All modules"
432
434
  }),
433
- Y.map((e) => /* @__PURE__ */ v("option", {
435
+ J.map((e) => /* @__PURE__ */ m("option", {
434
436
  value: e.moduleId,
435
437
  children: [
436
438
  e.label,
@@ -439,58 +441,58 @@ function T() {
439
441
  ")"
440
442
  ]
441
443
  }, e.moduleId)),
442
- ue ? /* @__PURE__ */ v("option", {
443
- value: R.moduleId,
444
- children: ["Current: ", R.moduleId]
444
+ he ? /* @__PURE__ */ m("option", {
445
+ value: L.moduleId,
446
+ children: ["Current: ", L.moduleId]
445
447
  }) : null,
446
- /* @__PURE__ */ _("option", {
448
+ /* @__PURE__ */ p("option", {
447
449
  value: "__custom__",
448
450
  children: "Custom module ID"
449
451
  })
450
452
  ]
451
453
  }),
452
- H ? /* @__PURE__ */ _("input", {
454
+ V ? /* @__PURE__ */ p("input", {
453
455
  id: "module-id-custom",
454
456
  type: "text",
455
- value: R.moduleId || "",
456
- onChange: (e) => z({
457
- ...R,
457
+ value: L.moduleId || "",
458
+ onChange: (e) => R({
459
+ ...L,
458
460
  moduleId: e.target.value || void 0,
459
461
  pageId: void 0
460
462
  }),
461
463
  className: "mt-2 w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
462
464
  placeholder: "vibecontrols"
463
465
  }) : null
464
- ] }), /* @__PURE__ */ v("div", { children: [
465
- /* @__PURE__ */ _("label", {
466
+ ] }), /* @__PURE__ */ m("div", { children: [
467
+ /* @__PURE__ */ p("label", {
466
468
  className: "block text-sm font-medium mb-2",
467
469
  htmlFor: "page-id",
468
470
  children: "Page ID"
469
471
  }),
470
- /* @__PURE__ */ v("select", {
472
+ /* @__PURE__ */ m("select", {
471
473
  id: "page-id",
472
- value: W ? "__custom__" : R.pageId || "",
474
+ value: U ? "__custom__" : L.pageId || "",
473
475
  onChange: (e) => {
474
476
  if (e.target.value === "__custom__") {
475
- G(!0), z({
476
- ...R,
477
+ W(!0), R({
478
+ ...L,
477
479
  pageId: ""
478
480
  });
479
481
  return;
480
482
  }
481
- G(!1), z({
482
- ...R,
483
+ W(!1), R({
484
+ ...L,
483
485
  pageId: e.target.value || void 0
484
486
  });
485
487
  },
486
488
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
487
- disabled: !R.productId,
489
+ disabled: !L.productId,
488
490
  children: [
489
- /* @__PURE__ */ _("option", {
491
+ /* @__PURE__ */ p("option", {
490
492
  value: "",
491
493
  children: "All pages"
492
494
  }),
493
- Z.map((e) => /* @__PURE__ */ v("option", {
495
+ X.map((e) => /* @__PURE__ */ m("option", {
494
496
  value: e.pageId,
495
497
  children: [
496
498
  e.label,
@@ -499,22 +501,22 @@ function T() {
499
501
  ")"
500
502
  ]
501
503
  }, e.pageId)),
502
- de ? /* @__PURE__ */ v("option", {
503
- value: R.pageId,
504
- children: ["Current: ", R.pageId]
504
+ ge ? /* @__PURE__ */ m("option", {
505
+ value: L.pageId,
506
+ children: ["Current: ", L.pageId]
505
507
  }) : null,
506
- /* @__PURE__ */ _("option", {
508
+ /* @__PURE__ */ p("option", {
507
509
  value: "__custom__",
508
510
  children: "Custom page ID"
509
511
  })
510
512
  ]
511
513
  }),
512
- W ? /* @__PURE__ */ _("input", {
514
+ U ? /* @__PURE__ */ p("input", {
513
515
  id: "page-id-custom",
514
516
  type: "text",
515
- value: R.pageId || "",
516
- onChange: (e) => z({
517
- ...R,
517
+ value: L.pageId || "",
518
+ onChange: (e) => R({
519
+ ...L,
518
520
  pageId: e.target.value || void 0
519
521
  }),
520
522
  className: "mt-2 w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
@@ -522,17 +524,17 @@ function T() {
522
524
  }) : null
523
525
  ] })]
524
526
  }),
525
- /* @__PURE__ */ v("label", {
527
+ /* @__PURE__ */ m("label", {
526
528
  className: "flex items-center gap-3 cursor-pointer",
527
- children: [/* @__PURE__ */ _("input", {
529
+ children: [/* @__PURE__ */ p("input", {
528
530
  type: "checkbox",
529
- checked: R.isActive ?? !0,
530
- onChange: (e) => z({
531
- ...R,
531
+ checked: L.isActive ?? !0,
532
+ onChange: (e) => R({
533
+ ...L,
532
534
  isActive: e.target.checked
533
535
  }),
534
536
  className: "w-4 h-4 rounded"
535
- }), /* @__PURE__ */ _("span", {
537
+ }), /* @__PURE__ */ p("span", {
536
538
  className: "text-sm font-medium",
537
539
  children: "Active"
538
540
  })]
@@ -540,93 +542,93 @@ function T() {
540
542
  ]
541
543
  })]
542
544
  }),
543
- /* @__PURE__ */ v("div", {
545
+ /* @__PURE__ */ m("div", {
544
546
  className: "border border-border rounded-md p-4 sm:p-6 bg-card",
545
- children: [/* @__PURE__ */ _("h2", {
547
+ children: [/* @__PURE__ */ p("h2", {
546
548
  className: "text-lg font-semibold mb-4",
547
- children: b("tourBuilder.sectionTriggerSettings")
548
- }), /* @__PURE__ */ v("div", {
549
+ children: y("tourBuilder.sectionTriggerSettings")
550
+ }), /* @__PURE__ */ m("div", {
549
551
  className: "space-y-4",
550
552
  children: [
551
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
553
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
552
554
  className: "block text-sm font-medium mb-2",
553
555
  htmlFor: "trigger-type",
554
- children: b("tourBuilder.labelTriggerType")
555
- }), /* @__PURE__ */ v("select", {
556
+ children: y("tourBuilder.labelTriggerType")
557
+ }), /* @__PURE__ */ m("select", {
556
558
  id: "trigger-type",
557
- value: R.triggerType || "MANUAL",
558
- onChange: (e) => z({
559
- ...R,
559
+ value: L.triggerType || "MANUAL",
560
+ onChange: (e) => R({
561
+ ...L,
560
562
  triggerType: e.target.value
561
563
  }),
562
564
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground",
563
565
  children: [
564
- /* @__PURE__ */ _("option", {
566
+ /* @__PURE__ */ p("option", {
565
567
  value: "MANUAL",
566
- children: b("tourBuilder.triggerManual")
568
+ children: y("tourBuilder.triggerManual")
567
569
  }),
568
- /* @__PURE__ */ _("option", {
570
+ /* @__PURE__ */ p("option", {
569
571
  value: "AUTO_FIRST_VISIT",
570
- children: b("tourBuilder.triggerAutoFirstVisit")
572
+ children: y("tourBuilder.triggerAutoFirstVisit")
571
573
  }),
572
- /* @__PURE__ */ _("option", {
574
+ /* @__PURE__ */ p("option", {
573
575
  value: "AUTO_ALWAYS",
574
- children: b("tourBuilder.triggerAutoAlways")
576
+ children: y("tourBuilder.triggerAutoAlways")
575
577
  }),
576
- /* @__PURE__ */ _("option", {
578
+ /* @__PURE__ */ p("option", {
577
579
  value: "ON_EVENT",
578
- children: b("tourBuilder.triggerOnEvent")
580
+ children: y("tourBuilder.triggerOnEvent")
579
581
  }),
580
- /* @__PURE__ */ _("option", {
582
+ /* @__PURE__ */ p("option", {
581
583
  value: "SCHEDULED",
582
- children: b("tourBuilder.triggerScheduled")
584
+ children: y("tourBuilder.triggerScheduled")
583
585
  })
584
586
  ]
585
587
  })] }),
586
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
588
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
587
589
  className: "block text-sm font-medium mb-2",
588
590
  htmlFor: "priority",
589
- children: b("tourBuilder.labelPriority")
590
- }), /* @__PURE__ */ _("input", {
591
+ children: y("tourBuilder.labelPriority")
592
+ }), /* @__PURE__ */ p("input", {
591
593
  id: "priority",
592
594
  type: "number",
593
595
  min: "1",
594
596
  max: "100",
595
- value: R.priority || 50,
597
+ value: L.priority || 50,
596
598
  onChange: (e) => {
597
599
  let t = Number.parseInt(e.target.value, 10) || 50;
598
- z({
599
- ...R,
600
+ R({
601
+ ...L,
600
602
  priority: t
601
603
  });
602
604
  },
603
605
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
604
606
  })] }),
605
- /* @__PURE__ */ v("div", {
607
+ /* @__PURE__ */ m("div", {
606
608
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
607
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
609
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
608
610
  className: "block text-sm font-medium mb-2",
609
611
  htmlFor: "tour-start-date",
610
612
  children: "Start Date"
611
- }), /* @__PURE__ */ _("input", {
613
+ }), /* @__PURE__ */ p("input", {
612
614
  id: "tour-start-date",
613
615
  type: "datetime-local",
614
- value: $(R.startDate),
615
- onChange: (e) => z({
616
- ...R,
616
+ value: $(L.startDate),
617
+ onChange: (e) => R({
618
+ ...L,
617
619
  startDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
618
620
  }),
619
621
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
620
- })] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
622
+ })] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
621
623
  className: "block text-sm font-medium mb-2",
622
624
  htmlFor: "tour-end-date",
623
625
  children: "End Date"
624
- }), /* @__PURE__ */ _("input", {
626
+ }), /* @__PURE__ */ p("input", {
625
627
  id: "tour-end-date",
626
628
  type: "datetime-local",
627
- value: $(R.endDate),
628
- onChange: (e) => z({
629
- ...R,
629
+ value: $(L.endDate),
630
+ onChange: (e) => R({
631
+ ...L,
630
632
  endDate: e.target.value ? new Date(e.target.value).toISOString() : void 0
631
633
  }),
632
634
  className: "w-full px-3 py-2 border border-border rounded-md bg-background text-foreground"
@@ -635,94 +637,94 @@ function T() {
635
637
  ]
636
638
  })]
637
639
  }),
638
- P && /* @__PURE__ */ v("div", {
640
+ N && /* @__PURE__ */ m("div", {
639
641
  className: "border border-destructive rounded-md p-4 bg-destructive/10",
640
- children: [/* @__PURE__ */ _("h3", {
642
+ children: [/* @__PURE__ */ p("h3", {
641
643
  className: "font-semibold text-destructive mb-2",
642
- children: b("tourBuilder.errorTitle")
643
- }), /* @__PURE__ */ _("p", {
644
+ children: y("tourBuilder.errorTitle")
645
+ }), /* @__PURE__ */ p("p", {
644
646
  className: "text-sm text-destructive",
645
- children: P.message
647
+ children: N.message
646
648
  })]
647
649
  }),
648
- N.length > 0 && /* @__PURE__ */ v("div", {
650
+ M.length > 0 && /* @__PURE__ */ m("div", {
649
651
  className: "border border-destructive rounded-md p-4 bg-destructive/10",
650
- children: [/* @__PURE__ */ _("h3", {
652
+ children: [/* @__PURE__ */ p("h3", {
651
653
  className: "font-semibold text-destructive mb-2",
652
- children: b("tourBuilder.validationErrorsTitle")
653
- }), /* @__PURE__ */ _("ul", {
654
+ children: y("tourBuilder.validationErrorsTitle")
655
+ }), /* @__PURE__ */ p("ul", {
654
656
  className: "list-disc list-inside space-y-1",
655
- children: N.map((e, t) => /* @__PURE__ */ _("li", {
657
+ children: M.map((e, t) => /* @__PURE__ */ p("li", {
656
658
  className: "text-sm text-destructive",
657
659
  children: e.message
658
660
  }, t))
659
661
  })]
660
662
  }),
661
- /* @__PURE__ */ v("div", {
663
+ /* @__PURE__ */ m("div", {
662
664
  className: "flex flex-wrap gap-3",
663
- children: [/* @__PURE__ */ _(d, {
664
- permission: D ? i.TOUR_CREATE : i.TOUR_UPDATE,
665
- children: /* @__PURE__ */ v("button", {
665
+ children: [/* @__PURE__ */ p(f, {
666
+ permission: E ? i.TOUR_CREATE : i.TOUR_UPDATE,
667
+ children: /* @__PURE__ */ m("button", {
666
668
  type: "submit",
667
- disabled: M || !se,
669
+ disabled: j || !pe,
668
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",
669
- children: [/* @__PURE__ */ _(h, { size: 20 }), b(M ? "tourBuilder.saving" : x && x !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
671
+ children: [/* @__PURE__ */ p(oe, { size: 20 }), y(j ? "tourBuilder.saving" : b && b !== "new" ? "tourBuilder.updateTour" : "tourBuilder.createAndAddSteps")]
670
672
  })
671
- }), x && x !== "new" && /* @__PURE__ */ v(g, { children: [
672
- /* @__PURE__ */ v("button", {
673
+ }), b && b !== "new" && /* @__PURE__ */ m(se, { children: [
674
+ /* @__PURE__ */ m("button", {
673
675
  type: "button",
674
- onClick: () => S(`${T}/${x}/steps`),
676
+ onClick: () => x(`${C}/${b}/steps`),
675
677
  className: "px-4 py-2 bg-secondary text-secondary-foreground rounded-md hover:bg-secondary/80 flex items-center gap-2",
676
678
  children: [
677
- /* @__PURE__ */ _(m, { size: 20 }),
678
- b("tourBuilder.editSteps"),
679
- k?.steps && k.steps.length > 0 && /* @__PURE__ */ _("span", {
679
+ /* @__PURE__ */ p(ae, { size: 20 }),
680
+ y("tourBuilder.editSteps"),
681
+ D?.steps && D.steps.length > 0 && /* @__PURE__ */ p("span", {
680
682
  className: "ml-1 px-2 py-0.5 text-xs bg-primary/20 rounded-full",
681
- children: k.steps.length
683
+ children: D.steps.length
682
684
  })
683
685
  ]
684
686
  }),
685
- /* @__PURE__ */ v("button", {
687
+ /* @__PURE__ */ m("button", {
686
688
  type: "button",
687
- onClick: () => S(`${T}/${x}/preview`),
689
+ onClick: () => x(`${C}/${b}/preview`),
688
690
  className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
689
- children: [/* @__PURE__ */ _(te, { size: 20 }), b("tourBuilder.preview")]
691
+ children: [/* @__PURE__ */ p(re, { size: 20 }), y("tourBuilder.preview")]
690
692
  }),
691
- /* @__PURE__ */ v("button", {
693
+ /* @__PURE__ */ m("button", {
692
694
  type: "button",
693
- onClick: () => S(`${T}/${x}/analytics`),
695
+ onClick: () => x(`${C}/${b}/analytics`),
694
696
  className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
695
- children: [/* @__PURE__ */ _(p, { size: 20 }), b("tourBuilder.analytics")]
697
+ children: [/* @__PURE__ */ p(te, { size: 20 }), y("tourBuilder.analytics")]
696
698
  }),
697
- /* @__PURE__ */ v("button", {
699
+ /* @__PURE__ */ m("button", {
698
700
  type: "button",
699
- onClick: () => S(`${T}/${x}/schedule`),
701
+ onClick: () => x(`${C}/${b}/schedule`),
700
702
  className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2",
701
- children: [/* @__PURE__ */ _(ee, { size: 20 }), "Schedule"]
703
+ children: [/* @__PURE__ */ p(ne, { size: 20 }), "Schedule"]
702
704
  }),
703
- /* @__PURE__ */ _(d, {
705
+ /* @__PURE__ */ p(f, {
704
706
  permission: i.TOUR_TEMPLATE_CREATE,
705
- children: /* @__PURE__ */ v("button", {
707
+ children: /* @__PURE__ */ m("button", {
706
708
  type: "button",
707
709
  onClick: async () => {
708
- if (!x || x === "new") return;
709
- let e = `${R.name || k?.name || "Tour"} Template`, t = window.prompt("Template name", e);
710
+ if (!b || b === "new") return;
711
+ let e = `${L.name || D?.name || "Tour"} Template`, t = window.prompt("Template name", e);
710
712
  if (!t) return;
711
713
  let n = window.prompt("Template category (ONBOARDING, FEATURE_ANNOUNCEMENT, HELP, CUSTOM)", "ONBOARDING") || "ONBOARDING";
712
714
  try {
713
- await F(x, {
715
+ await P(b, {
714
716
  name: t,
715
- description: R.description,
717
+ description: L.description,
716
718
  category: n,
717
719
  isPublic: !1
718
- }), S(`${T}/templates`);
719
- } catch (e) {
720
- console.error("Failed to save template:", e);
720
+ }), x(`${C}/templates`);
721
+ } catch {
722
+ o(w, "template.save", S);
721
723
  }
722
724
  },
723
- disabled: !oe,
725
+ disabled: !fe,
724
726
  className: "px-4 py-2 border border-border rounded-md hover:bg-accent flex items-center gap-2 disabled:opacity-50",
725
- children: [/* @__PURE__ */ _(ne, { size: 20 }), "Save as Template"]
727
+ children: [/* @__PURE__ */ p(ie, { size: 20 }), "Save as Template"]
726
728
  })
727
729
  })
728
730
  ] })]
@@ -732,6 +734,6 @@ function T() {
732
734
  });
733
735
  }
734
736
  //#endregion
735
- export { T as TourBuilderPage };
737
+ export { S as TourBuilderPage };
736
738
 
737
739
  //# sourceMappingURL=TourBuilderPage.js.map