@burdenoff/microfe-export 2026.525.3 → 2026.529.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.
@@ -2,19 +2,20 @@ import { useExport as e } from "../providers/ExportProvider.js";
2
2
  import { useAvailableEntities as t, useCreateExportJob as n, useExportTemplates as r } from "../hooks/useExportQueries.js";
3
3
  import { cn as i } from "../utils/cn.js";
4
4
  import { getFormatDisplayName as a } from "../constants/enums.js";
5
- import { tWithFallback as o } from "../utils/i18n.js";
6
- import { PageLayout as ee } from "../components/PageLayout.js";
7
- import { useEffect as te, useRef as s, useState as c } from "react";
8
- import { ArrowLeft as l, ArrowRight as u, Building2 as d, CalendarRange as ne, CheckCircle2 as f, Download as p, FileJson as m, FileSpreadsheet as h, Loader2 as g, Lock as _, Package as re, User as v, Users as y } from "lucide-react";
5
+ import { tWithFallback as ee } from "../utils/i18n.js";
6
+ import { PageLayout as te } from "../components/PageLayout.js";
7
+ import { isExportEntityDisabled as o } from "../utils/disabledModules.js";
8
+ import { useEffect as ne, useRef as s, useState as c } from "react";
9
+ import { ArrowLeft as l, ArrowRight as u, Building2 as d, CalendarRange as re, CheckCircle2 as f, Download as p, FileJson as m, FileSpreadsheet as h, Loader2 as g, Lock as _, Package as ie, User as v, Users as y } from "lucide-react";
9
10
  import { usePermission as b } from "@burdenoff/fe-libs/shared/providers/shell";
10
- import { useSearchParams as x } from "react-router-dom";
11
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
12
- import { useI18n as w } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
+ import { useSearchParams as ae } from "react-router-dom";
12
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
13
+ import { useI18n as oe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
14
  //#region src/export/pages/CreateExportPage.tsx
14
- var T = ["CSV", "JSON"], ie = {
15
+ var C = ["CSV", "JSON"], se = {
15
16
  CSV: h,
16
17
  JSON: m
17
- }, ae = [
18
+ }, w = [
18
19
  {
19
20
  value: "INDIVIDUAL",
20
21
  label: "My Data Only",
@@ -34,65 +35,65 @@ var T = ["CSV", "JSON"], ie = {
34
35
  Icon: d
35
36
  }
36
37
  ];
37
- function E() {
38
- let { basePath: d = "/", navigate: m, organizationId: h } = e(), { t: v } = w(), y = (e, t, n) => o(v, e, t, n), { createJob: E, isPending: D } = n(), { data: O } = t(), { data: k } = r(), [A] = x(), j = b("export:workspace:admin"), oe = b("export:org:admin"), [M, N] = c("entities"), [P, F] = c([]), [I, L] = c(""), [R, z] = c("CSV"), [B, V] = c("INDIVIDUAL"), [H, U] = c(A.get("templateId") ?? void 0), [W, G] = c(""), [K, se] = c(""), [q, J] = c(null), Y = s(null);
39
- te(() => {
40
- let e = A.get("templateId");
41
- if (!e || !k?.length || Y.current === e) return;
42
- let t = k.find((t) => t.id === e);
38
+ function T() {
39
+ let { basePath: d = "/", navigate: m, organizationId: h } = e(), { t: v } = oe(), y = (e, t, n) => ee(v, e, t, n), { createJob: T, isPending: E } = n(), { data: ce } = t(), { data: D } = r(), [O] = ae(), k = b("export:workspace:admin"), le = b("export:org:admin"), [A, j] = c("entities"), [M, N] = c([]), [P, F] = c(""), [I, L] = c("CSV"), [R, z] = c("INDIVIDUAL"), [B, V] = c(O.get("templateId") ?? void 0), [H, U] = c(""), [W, ue] = c(""), [G, K] = c(null), q = s(null);
40
+ ne(() => {
41
+ let e = O.get("templateId");
42
+ if (!e || !D?.length || q.current === e) return;
43
+ let t = D.find((t) => t.id === e);
43
44
  if (!t) return;
44
- Y.current = e, U(t.id), F(t.entityTypes ?? []);
45
+ q.current = e, V(t.id), N((t.entityTypes ?? []).filter((e) => !o(e)));
45
46
  let n = t.format?.toUpperCase();
46
- n && T.includes(n) && z(n), t.name && L(t.name);
47
- }, [A, k]);
48
- let ce = () => {
49
- M === "options" ? N("entities") : M === "review" ? N("options") : m?.(d);
50
- }, X = () => {
51
- if (M === "entities") {
52
- if (P.length === 0) {
53
- J(y("export.create.errors.selectEntity", "Please select at least one entity type to export"));
47
+ n && C.includes(n) && L(n), t.name && F(t.name);
48
+ }, [O, D]);
49
+ let de = () => {
50
+ A === "options" ? j("entities") : A === "review" ? j("options") : m?.(d);
51
+ }, fe = () => {
52
+ if (A === "entities") {
53
+ if (M.length === 0) {
54
+ K(y("export.create.errors.selectEntity", "Please select at least one entity type to export"));
54
55
  return;
55
56
  }
56
- J(null), N("options");
57
- } else if (M === "options") {
58
- if (!I.trim()) {
59
- J(y("export.create.errors.exportNameRequired", "Please provide a name for this export"));
57
+ K(null), j("options");
58
+ } else if (A === "options") {
59
+ if (!P.trim()) {
60
+ K(y("export.create.errors.exportNameRequired", "Please provide a name for this export"));
60
61
  return;
61
62
  }
62
- J(null), N("review");
63
+ K(null), j("review");
63
64
  }
64
- }, le = async () => {
65
+ }, pe = async () => {
65
66
  try {
66
- J(null), await E({
67
- name: I,
68
- entityTypes: P,
69
- format: R,
70
- exportScope: B,
71
- organizationId: B === "ORG_ADMIN" ? h : void 0,
72
- templateId: H,
73
- dateRangeStart: W ? new Date(W).toISOString() : null,
74
- dateRangeEnd: K ? new Date(K).toISOString() : null
67
+ K(null), await T({
68
+ name: P,
69
+ entityTypes: M,
70
+ format: I,
71
+ exportScope: R,
72
+ organizationId: R === "ORG_ADMIN" ? h : void 0,
73
+ templateId: B,
74
+ dateRangeStart: H ? new Date(H).toISOString() : null,
75
+ dateRangeEnd: W ? new Date(W).toISOString() : null
75
76
  }), m?.(d);
76
77
  } catch (e) {
77
- J(e instanceof Error ? e.message : y("export.create.errors.createFailed", "Failed to create export"));
78
+ K(e instanceof Error ? e.message : y("export.create.errors.createFailed", "Failed to create export"));
78
79
  }
79
- }, ue = (e) => {
80
- F((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
81
- }, Z = (e) => {
80
+ }, me = (e) => {
81
+ o(e) || N((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
82
+ }, J = (e) => {
82
83
  switch (e) {
83
84
  case "INDIVIDUAL": return y("export.create.scope.individual.label", "My Data Only");
84
85
  case "WORKSPACE_ADMIN": return y("export.create.scope.workspaceAdmin.label", "All Workspace Data");
85
86
  case "ORG_ADMIN": return y("export.create.scope.orgAdmin.label", "All Organization Data");
86
87
  default: return e;
87
88
  }
88
- }, de = (e) => {
89
+ }, he = (e) => {
89
90
  switch (e) {
90
91
  case "INDIVIDUAL": return y("export.create.scope.individual.description", "Export data you personally created across selected modules.");
91
92
  case "WORKSPACE_ADMIN": return y("export.create.scope.workspaceAdmin.description", "Export all data in this workspace regardless of who created it. Requires workspace admin access.");
92
93
  case "ORG_ADMIN": return y("export.create.scope.orgAdmin.description", "Export data from every workspace in your organization. Requires org-admin access.");
93
94
  default: return "";
94
95
  }
95
- }, Q = {
96
+ }, Y = {
96
97
  users: {
97
98
  label: y("export.create.entities.users.label", "Users"),
98
99
  description: y("export.create.entities.users.description", "Workspace members and profiles")
@@ -125,294 +126,325 @@ function E() {
125
126
  label: y("export.create.entities.calendar.label", "Calendar Events"),
126
127
  description: y("export.create.entities.calendar.description", "Events and bookings")
127
128
  }
128
- }, $ = O.filter((e) => e.enabled !== !1);
129
- return /* @__PURE__ */ C(ee, {
129
+ }, X = ce.filter((e) => e.enabled !== !1), Z = X.filter((e) => !o(e.entityType)), Q = X.filter((e) => o(e.entityType)), $ = (e, t) => {
130
+ let n = !t && M.includes(e.entityType);
131
+ return /* @__PURE__ */ S("button", {
132
+ type: "button",
133
+ onClick: () => me(e.entityType),
134
+ disabled: t,
135
+ "aria-disabled": t,
136
+ title: t ? y("export.create.select.unavailableHint", "Export for this product isn't available yet") : void 0,
137
+ className: i("text-left border-2 rounded-xl p-4 transition-all duration-200", t ? "border-border/30 opacity-50 cursor-not-allowed" : n ? "border-primary bg-primary/5 shadow-md" : "border-border/50 hover:border-primary/30 hover:shadow-sm"),
138
+ children: [
139
+ /* @__PURE__ */ S("div", {
140
+ className: "flex items-center justify-between mb-2 gap-2",
141
+ children: [/* @__PURE__ */ x("h3", {
142
+ className: "font-semibold",
143
+ children: Y[e.entityType]?.label ?? e.displayName
144
+ }), t ? /* @__PURE__ */ x("span", {
145
+ className: "shrink-0 text-xs font-medium px-2 py-0.5 rounded-full bg-muted text-muted-foreground",
146
+ children: y("export.create.select.unavailable", "Unavailable")
147
+ }) : n && /* @__PURE__ */ x(f, {
148
+ size: 18,
149
+ className: "text-primary"
150
+ })]
151
+ }),
152
+ /* @__PURE__ */ x("p", {
153
+ className: "text-sm text-muted-foreground",
154
+ children: Y[e.entityType]?.description ?? e.description
155
+ }),
156
+ e.estimatedSize && /* @__PURE__ */ S("p", {
157
+ className: "text-xs text-muted-foreground mt-2",
158
+ children: ["~", e.estimatedSize]
159
+ })
160
+ ]
161
+ }, e.entityType);
162
+ };
163
+ return /* @__PURE__ */ S(te, {
130
164
  showHeader: !1,
131
165
  children: [
132
- /* @__PURE__ */ S("div", {
166
+ /* @__PURE__ */ x("div", {
133
167
  className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border/50 p-6 shadow-sm",
134
- children: /* @__PURE__ */ C("div", {
168
+ children: /* @__PURE__ */ S("div", {
135
169
  className: "relative z-10 flex items-center gap-4",
136
- children: [/* @__PURE__ */ S("button", {
170
+ children: [/* @__PURE__ */ x("button", {
171
+ type: "button",
137
172
  onClick: () => m?.(d),
138
173
  className: "p-2.5 hover:bg-accent rounded-lg transition-all duration-200 hover:scale-110",
139
174
  "aria-label": y("export.create.actions.backToDashboard", "Back to export dashboard"),
140
- children: /* @__PURE__ */ S(l, { size: 20 })
141
- }), /* @__PURE__ */ C("div", {
175
+ children: /* @__PURE__ */ x(l, { size: 20 })
176
+ }), /* @__PURE__ */ S("div", {
142
177
  className: "flex items-center gap-3",
143
- children: [/* @__PURE__ */ S("div", {
178
+ children: [/* @__PURE__ */ x("div", {
144
179
  className: "p-2.5 rounded-lg bg-primary/10 backdrop-blur-sm",
145
- children: /* @__PURE__ */ S(p, {
180
+ children: /* @__PURE__ */ x(p, {
146
181
  size: 24,
147
182
  className: "text-primary"
148
183
  })
149
- }), /* @__PURE__ */ S("h1", {
184
+ }), /* @__PURE__ */ x("h1", {
150
185
  className: "text-2xl sm:text-3xl font-bold",
151
186
  children: y("export.create.title", "New Export")
152
187
  })]
153
188
  })]
154
189
  })
155
190
  }),
156
- /* @__PURE__ */ S("div", {
191
+ /* @__PURE__ */ x("div", {
157
192
  className: "flex items-center gap-2 justify-center flex-wrap",
158
193
  children: [
159
194
  "entities",
160
195
  "options",
161
196
  "review"
162
- ].map((e, t) => /* @__PURE__ */ C("div", {
197
+ ].map((e, t) => /* @__PURE__ */ S("div", {
163
198
  className: "flex items-center gap-2",
164
- children: [t > 0 && /* @__PURE__ */ S(u, {
199
+ children: [t > 0 && /* @__PURE__ */ x(u, {
165
200
  size: 18,
166
201
  className: "text-muted-foreground"
167
- }), /* @__PURE__ */ C("div", {
168
- className: i("flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200", M === e ? "bg-primary text-primary-foreground border-primary shadow-md scale-105" : "bg-muted/50 text-muted-foreground border-border/50"),
169
- children: [/* @__PURE__ */ S("div", {
170
- className: "flex items-center justify-center w-6 h-6 rounded-full bg-background/20 font-bold",
202
+ }), /* @__PURE__ */ S("div", {
203
+ className: i("flex items-center gap-2 px-4 py-2.5 rounded-lg text-sm font-medium border-2 transition-all duration-200", A === e ? "bg-primary text-primary-foreground border-primary shadow-md scale-105" : "bg-muted/50 text-muted-foreground border-border/50"),
204
+ children: [/* @__PURE__ */ x("div", {
205
+ className: "flex items-center justify-center size-6 rounded-full bg-background/20 font-bold",
171
206
  children: t + 1
172
- }), /* @__PURE__ */ S("span", {
207
+ }), /* @__PURE__ */ x("span", {
173
208
  className: "hidden sm:inline capitalize",
174
209
  children: e === "entities" ? y("export.create.steps.entities", "Select Data") : e === "options" ? y("export.create.steps.options", "Options") : y("export.create.steps.review", "Review")
175
210
  })]
176
211
  })]
177
212
  }, e))
178
213
  }),
179
- q && /* @__PURE__ */ S("div", {
214
+ G && /* @__PURE__ */ x("div", {
180
215
  className: "border-2 border-border-default rounded-xl bg-status-error-bg-subtle p-4 text-status-error-text text-sm",
181
- children: q
216
+ children: G
182
217
  }),
183
- M === "entities" && /* @__PURE__ */ C("div", {
218
+ A === "entities" && /* @__PURE__ */ S("div", {
184
219
  className: "space-y-4",
185
220
  children: [
186
- /* @__PURE__ */ S("h2", {
221
+ /* @__PURE__ */ x("h2", {
187
222
  className: "text-lg font-bold",
188
223
  children: y("export.create.select.title", "Select data to export")
189
224
  }),
190
- /* @__PURE__ */ S("p", {
225
+ /* @__PURE__ */ x("p", {
191
226
  className: "text-sm text-muted-foreground",
192
227
  children: y("export.create.select.description", "Choose which entity types to include in your export.")
193
228
  }),
194
- $.length === 0 ? /* @__PURE__ */ S("div", {
229
+ X.length === 0 ? /* @__PURE__ */ x("div", {
195
230
  className: "border-2 border-border rounded-xl bg-muted/30 p-6 text-sm text-muted-foreground",
196
231
  children: y("export.create.select.empty", "No exportable entity types are configured for this workspace yet.")
197
232
  }) : /* @__PURE__ */ S("div", {
198
- className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
199
- children: $.map((e) => {
200
- let t = P.includes(e.entityType);
201
- return /* @__PURE__ */ C("button", {
202
- onClick: () => ue(e.entityType),
203
- className: i("text-left border-2 rounded-xl p-4 transition-all duration-200", t ? "border-primary bg-primary/5 shadow-md" : "border-border/50 hover:border-primary/30 hover:shadow-sm"),
233
+ className: "space-y-6",
234
+ children: [Z.length > 0 && /* @__PURE__ */ x("div", {
235
+ className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
236
+ children: Z.map((e) => $(e, !1))
237
+ }), Q.length > 0 && /* @__PURE__ */ S("div", {
238
+ className: "space-y-3",
239
+ children: [/* @__PURE__ */ S("div", {
240
+ className: "flex items-center gap-3",
204
241
  children: [
205
- /* @__PURE__ */ C("div", {
206
- className: "flex items-center justify-between mb-2",
207
- children: [/* @__PURE__ */ S("h3", {
208
- className: "font-semibold",
209
- children: Q[e.entityType]?.label ?? e.displayName
210
- }), t && /* @__PURE__ */ S(f, {
211
- size: 18,
212
- className: "text-primary"
213
- })]
214
- }),
215
- /* @__PURE__ */ S("p", {
216
- className: "text-sm text-muted-foreground",
217
- children: Q[e.entityType]?.description ?? e.description
242
+ /* @__PURE__ */ x("div", { className: "h-px flex-1 bg-border/60" }),
243
+ /* @__PURE__ */ x("span", {
244
+ className: "text-xs font-medium uppercase tracking-wide text-muted-foreground",
245
+ children: y("export.create.select.unavailableSection", "Not available yet")
218
246
  }),
219
- e.estimatedSize && /* @__PURE__ */ C("p", {
220
- className: "text-xs text-muted-foreground mt-2",
221
- children: ["~", e.estimatedSize]
222
- })
247
+ /* @__PURE__ */ x("div", { className: "h-px flex-1 bg-border/60" })
223
248
  ]
224
- }, e.entityType);
225
- })
249
+ }), /* @__PURE__ */ x("div", {
250
+ className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",
251
+ children: Q.map((e) => $(e, !0))
252
+ })]
253
+ })]
226
254
  })
227
255
  ]
228
256
  }),
229
- M === "options" && /* @__PURE__ */ S("div", {
257
+ A === "options" && /* @__PURE__ */ x("div", {
230
258
  className: "space-y-6",
231
- children: /* @__PURE__ */ C("div", {
259
+ children: /* @__PURE__ */ S("div", {
232
260
  className: "border-2 border-border/50 rounded-xl p-6 space-y-5",
233
261
  children: [
234
- /* @__PURE__ */ S("h2", {
262
+ /* @__PURE__ */ x("h2", {
235
263
  className: "text-lg font-bold",
236
264
  children: y("export.create.options.title", "Export Options")
237
265
  }),
238
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
266
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
239
267
  className: "block text-sm font-semibold mb-2",
240
268
  children: y("export.create.options.scope", "Export Scope")
241
- }), /* @__PURE__ */ S("div", {
269
+ }), /* @__PURE__ */ x("div", {
242
270
  className: "grid grid-cols-1 sm:grid-cols-3 gap-3",
243
- children: ae.map(({ value: e, Icon: t }) => {
244
- let n = e === "WORKSPACE_ADMIN" && !j || e === "ORG_ADMIN" && !oe;
245
- return /* @__PURE__ */ C("button", {
271
+ children: w.map(({ value: e, Icon: t }) => {
272
+ let n = e === "WORKSPACE_ADMIN" && !k || e === "ORG_ADMIN" && !le;
273
+ return /* @__PURE__ */ S("button", {
246
274
  type: "button",
247
- onClick: () => !n && V(e),
275
+ onClick: () => !n && z(e),
248
276
  disabled: n,
249
- className: i("text-left border-2 rounded-xl p-4 transition-all duration-200", B === e ? "border-primary bg-primary/5 shadow-md" : n ? "border-border/30 opacity-50 cursor-not-allowed" : "border-border/50 hover:border-primary/30 hover:shadow-sm"),
277
+ className: i("text-left border-2 rounded-xl p-4 transition-all duration-200", R === e ? "border-primary bg-primary/5 shadow-md" : n ? "border-border/30 opacity-50 cursor-not-allowed" : "border-border/50 hover:border-primary/30 hover:shadow-sm"),
250
278
  title: n ? e === "WORKSPACE_ADMIN" ? "Workspace admin access required" : "Organization admin access required" : void 0,
251
279
  children: [
252
- /* @__PURE__ */ C("div", {
280
+ /* @__PURE__ */ S("div", {
253
281
  className: "flex items-center justify-between mb-2",
254
282
  children: [
255
- /* @__PURE__ */ S(t, {
283
+ /* @__PURE__ */ x(t, {
256
284
  size: 18,
257
- className: B === e ? "text-primary" : n ? "text-muted-foreground/50" : "text-muted-foreground"
285
+ className: R === e ? "text-primary" : n ? "text-muted-foreground/50" : "text-muted-foreground"
258
286
  }),
259
- B === e && /* @__PURE__ */ S(f, {
287
+ R === e && /* @__PURE__ */ x(f, {
260
288
  size: 16,
261
289
  className: "text-primary"
262
290
  }),
263
- n && /* @__PURE__ */ S(_, {
291
+ n && /* @__PURE__ */ x(_, {
264
292
  size: 14,
265
293
  className: "text-muted-foreground/50"
266
294
  })
267
295
  ]
268
296
  }),
269
- /* @__PURE__ */ S("p", {
297
+ /* @__PURE__ */ x("p", {
270
298
  className: "font-semibold text-sm",
271
- children: Z(e)
299
+ children: J(e)
272
300
  }),
273
- /* @__PURE__ */ S("p", {
301
+ /* @__PURE__ */ x("p", {
274
302
  className: "text-xs text-muted-foreground mt-1",
275
- children: de(e)
303
+ children: he(e)
276
304
  })
277
305
  ]
278
306
  }, e);
279
307
  })
280
308
  })] }),
281
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
309
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("label", {
282
310
  htmlFor: "exportName",
283
311
  className: "block text-sm font-semibold mb-2",
284
312
  children: [
285
313
  y("export.create.options.name", "Export Name"),
286
314
  " ",
287
- /* @__PURE__ */ S("span", {
315
+ /* @__PURE__ */ x("span", {
288
316
  className: "text-status-error-text",
289
317
  children: "*"
290
318
  })
291
319
  ]
292
- }), /* @__PURE__ */ S("input", {
320
+ }), /* @__PURE__ */ x("input", {
293
321
  type: "text",
294
322
  id: "exportName",
295
- value: I,
296
- onChange: (e) => L(e.target.value),
323
+ "aria-label": y("export.create.options.name", "Export Name"),
324
+ value: P,
325
+ onChange: (e) => F(e.target.value),
297
326
  className: "w-full px-4 py-2.5 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary transition-all duration-200",
298
327
  placeholder: y("export.create.options.namePlaceholder", "e.g., Monthly User Export")
299
328
  })] }),
300
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
329
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
301
330
  className: "block text-sm font-semibold mb-2",
302
331
  children: y("export.create.options.outputFormat", "Output Format")
303
- }), /* @__PURE__ */ S("div", {
332
+ }), /* @__PURE__ */ x("div", {
304
333
  className: "grid grid-cols-2 gap-3",
305
- children: T.map((e) => {
306
- let t = ie[e];
307
- return /* @__PURE__ */ C("button", {
308
- onClick: () => z(e),
309
- className: i("flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200", R === e ? "border-primary bg-primary/5" : "border-border/50 hover:border-primary/30"),
310
- children: [/* @__PURE__ */ S(t, {
334
+ children: C.map((e) => {
335
+ let t = se[e];
336
+ return /* @__PURE__ */ S("button", {
337
+ type: "button",
338
+ onClick: () => L(e),
339
+ className: i("flex items-center gap-3 border-2 rounded-lg p-3 transition-all duration-200", I === e ? "border-primary bg-primary/5" : "border-border/50 hover:border-primary/30"),
340
+ children: [/* @__PURE__ */ x(t, {
311
341
  size: 18,
312
- className: R === e ? "text-primary" : "text-muted-foreground"
313
- }), /* @__PURE__ */ S("span", {
342
+ className: I === e ? "text-primary" : "text-muted-foreground"
343
+ }), /* @__PURE__ */ x("span", {
314
344
  className: "font-medium text-sm",
315
345
  children: a(e)
316
346
  })]
317
347
  }, e);
318
348
  })
319
349
  })] }),
320
- /* @__PURE__ */ C("div", { children: [
321
- /* @__PURE__ */ S("label", {
350
+ /* @__PURE__ */ S("div", { children: [
351
+ /* @__PURE__ */ x("label", {
322
352
  className: "block text-sm font-semibold mb-2",
323
353
  children: y("export.create.options.archiveFormat", "Archive Format")
324
354
  }),
325
- /* @__PURE__ */ S("div", {
355
+ /* @__PURE__ */ x("div", {
326
356
  className: "flex gap-3",
327
- children: /* @__PURE__ */ C("div", {
357
+ children: /* @__PURE__ */ S("div", {
328
358
  className: i("flex items-center gap-2 border-2 rounded-lg px-4 py-2 border-primary bg-primary/5"),
329
- children: [/* @__PURE__ */ S(re, {
359
+ children: [/* @__PURE__ */ x(ie, {
330
360
  size: 16,
331
361
  className: "text-primary"
332
- }), /* @__PURE__ */ S("span", {
362
+ }), /* @__PURE__ */ x("span", {
333
363
  className: "font-medium text-sm",
334
364
  children: "ZIP"
335
365
  })]
336
366
  })
337
367
  }),
338
- /* @__PURE__ */ S("p", {
368
+ /* @__PURE__ */ x("p", {
339
369
  className: "text-xs text-muted-foreground mt-1.5",
340
370
  children: y("export.create.options.archiveDescription", "Exports are packaged as ZIP archives.")
341
371
  })
342
372
  ] }),
343
- /* @__PURE__ */ C("div", { children: [
344
- /* @__PURE__ */ S("label", {
373
+ /* @__PURE__ */ S("div", { children: [
374
+ /* @__PURE__ */ x("label", {
345
375
  className: "block text-sm font-semibold mb-2",
346
- children: /* @__PURE__ */ C("span", {
376
+ children: /* @__PURE__ */ S("span", {
347
377
  className: "inline-flex items-center gap-1.5",
348
378
  children: [
349
- /* @__PURE__ */ S(ne, { size: 15 }),
379
+ /* @__PURE__ */ x(re, { size: 15 }),
350
380
  y("export.create.options.dateRange", "Date Range"),
351
381
  " ",
352
- /* @__PURE__ */ S("span", {
382
+ /* @__PURE__ */ x("span", {
353
383
  className: "font-normal text-muted-foreground",
354
384
  children: y("export.create.shared.optional", "(optional)")
355
385
  })
356
386
  ]
357
387
  })
358
388
  }),
359
- /* @__PURE__ */ C("div", {
389
+ /* @__PURE__ */ S("div", {
360
390
  className: "grid grid-cols-1 sm:grid-cols-2 gap-3",
361
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
391
+ children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
362
392
  htmlFor: "dateFrom",
363
393
  className: "block text-xs text-muted-foreground mb-1",
364
394
  children: y("export.create.options.dateFrom", "From")
365
- }), /* @__PURE__ */ S("input", {
395
+ }), /* @__PURE__ */ x("input", {
366
396
  type: "date",
367
397
  id: "dateFrom",
368
- value: W,
369
- onChange: (e) => G(e.target.value),
398
+ "aria-label": y("export.create.options.dateFrom", "From"),
399
+ value: H,
400
+ onChange: (e) => U(e.target.value),
370
401
  className: "w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
371
- })] }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("label", {
402
+ })] }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
372
403
  htmlFor: "dateTo",
373
404
  className: "block text-xs text-muted-foreground mb-1",
374
405
  children: y("export.create.options.dateTo", "To")
375
- }), /* @__PURE__ */ S("input", {
406
+ }), /* @__PURE__ */ x("input", {
376
407
  type: "date",
377
408
  id: "dateTo",
378
- value: K,
379
- min: W,
380
- onChange: (e) => se(e.target.value),
409
+ "aria-label": y("export.create.options.dateTo", "To"),
410
+ value: W,
411
+ min: H,
412
+ onChange: (e) => ue(e.target.value),
381
413
  className: "w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary text-sm"
382
414
  })] })]
383
415
  }),
384
- /* @__PURE__ */ S("p", {
416
+ /* @__PURE__ */ x("p", {
385
417
  className: "text-xs text-muted-foreground mt-1.5",
386
418
  children: y("export.create.options.dateRangeDescription", "Leave blank to export all data regardless of date.")
387
419
  })
388
420
  ] }),
389
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("label", {
421
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("label", {
390
422
  className: "block text-sm font-semibold mb-2",
391
423
  children: [
392
424
  y("export.create.options.basedOnTemplate", "Based on Template"),
393
425
  " ",
394
- /* @__PURE__ */ S("span", {
426
+ /* @__PURE__ */ x("span", {
395
427
  className: "font-normal text-muted-foreground",
396
428
  children: y("export.create.shared.optional", "(optional)")
397
429
  })
398
430
  ]
399
- }), k.length > 0 ? /* @__PURE__ */ C("select", {
400
- value: H ?? "",
401
- onChange: (e) => U(e.target.value || void 0),
431
+ }), D.length > 0 ? /* @__PURE__ */ S("select", {
432
+ value: B ?? "",
433
+ onChange: (e) => V(e.target.value || void 0),
402
434
  className: "w-full px-3 py-2 border-2 border-border rounded-lg bg-background focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary",
403
- children: [/* @__PURE__ */ S("option", {
435
+ children: [/* @__PURE__ */ x("option", {
404
436
  value: "",
405
437
  children: y("export.create.options.noTemplate", "No template")
406
- }), k.map((e) => /* @__PURE__ */ S("option", {
438
+ }), D.map((e) => /* @__PURE__ */ x("option", {
407
439
  value: e.id,
408
440
  children: e.name
409
441
  }, e.id))]
410
- }) : /* @__PURE__ */ C("p", {
442
+ }) : /* @__PURE__ */ S("p", {
411
443
  className: "text-sm text-muted-foreground",
412
444
  children: [
413
445
  y("export.create.options.noTemplates", "No templates yet."),
414
446
  " ",
415
- /* @__PURE__ */ S("button", {
447
+ /* @__PURE__ */ x("button", {
416
448
  type: "button",
417
449
  onClick: () => m?.(d + "/templates"),
418
450
  className: "text-primary underline-offset-2 hover:underline",
@@ -425,53 +457,53 @@ function E() {
425
457
  ]
426
458
  })
427
459
  }),
428
- M === "review" && /* @__PURE__ */ S("div", {
460
+ A === "review" && /* @__PURE__ */ x("div", {
429
461
  className: "space-y-6",
430
- children: /* @__PURE__ */ C("div", {
462
+ children: /* @__PURE__ */ S("div", {
431
463
  className: "border-2 border-primary/50 rounded-xl bg-primary/5 p-6 space-y-4",
432
- children: [/* @__PURE__ */ C("h2", {
464
+ children: [/* @__PURE__ */ S("h2", {
433
465
  className: "text-lg font-bold flex items-center gap-2",
434
- children: [/* @__PURE__ */ S(f, {
466
+ children: [/* @__PURE__ */ x(f, {
435
467
  size: 20,
436
468
  className: "text-primary"
437
469
  }), y("export.create.review.title", "Review Export")]
438
- }), /* @__PURE__ */ S("dl", {
470
+ }), /* @__PURE__ */ x("dl", {
439
471
  className: "space-y-3 text-sm",
440
472
  children: [
441
473
  {
442
474
  label: y("export.create.review.fields.name", "Name"),
443
- value: I
475
+ value: P
444
476
  },
445
477
  {
446
478
  label: y("export.create.review.fields.scope", "Scope"),
447
- value: Z(B)
479
+ value: J(R)
448
480
  },
449
481
  {
450
482
  label: y("export.create.review.fields.entityTypes", "Entity Types"),
451
- value: P.join(", ")
483
+ value: M.join(", ")
452
484
  },
453
485
  {
454
486
  label: y("export.create.review.fields.format", "Format"),
455
- value: a(R)
487
+ value: a(I)
456
488
  },
457
489
  {
458
490
  label: y("export.create.review.fields.archive", "Archive"),
459
491
  value: "ZIP"
460
492
  },
461
- ...W || K ? [{
493
+ ...H || W ? [{
462
494
  label: y("export.create.review.fields.dateRange", "Date Range"),
463
- value: [W || "—", K || "—"].join(" → ")
495
+ value: [H || "—", W || "—"].join(" → ")
464
496
  }] : [],
465
- ...H ? [{
497
+ ...B ? [{
466
498
  label: y("export.create.review.fields.template", "Template"),
467
- value: k.find((e) => e.id === H)?.name ?? H
499
+ value: D.find((e) => e.id === B)?.name ?? B
468
500
  }] : []
469
- ].map(({ label: e, value: t }) => /* @__PURE__ */ C("div", {
501
+ ].map(({ label: e, value: t }) => /* @__PURE__ */ S("div", {
470
502
  className: "flex flex-col sm:flex-row sm:justify-between gap-1",
471
- children: [/* @__PURE__ */ S("dt", {
503
+ children: [/* @__PURE__ */ x("dt", {
472
504
  className: "text-muted-foreground",
473
505
  children: e
474
- }), /* @__PURE__ */ S("dd", {
506
+ }), /* @__PURE__ */ x("dd", {
475
507
  className: "font-semibold sm:text-right break-words",
476
508
  children: t
477
509
  })]
@@ -479,30 +511,33 @@ function E() {
479
511
  })]
480
512
  })
481
513
  }),
482
- /* @__PURE__ */ C("div", {
514
+ /* @__PURE__ */ S("div", {
483
515
  className: "flex flex-col sm:flex-row gap-3 pt-2",
484
- children: [/* @__PURE__ */ S("button", {
485
- onClick: ce,
516
+ children: [/* @__PURE__ */ x("button", {
517
+ type: "button",
518
+ onClick: de,
486
519
  className: "px-6 py-3 border-2 border-border/50 rounded-lg hover:bg-accent hover:border-primary/30 transition-all duration-200 font-medium",
487
- children: M === "entities" ? y("export.create.actions.cancel", "Cancel") : y("export.create.actions.back", "Back")
488
- }), M === "review" ? /* @__PURE__ */ C("button", {
489
- onClick: le,
490
- disabled: D,
520
+ children: A === "entities" ? y("export.create.actions.cancel", "Cancel") : y("export.create.actions.back", "Back")
521
+ }), A === "review" ? /* @__PURE__ */ S("button", {
522
+ type: "button",
523
+ onClick: pe,
524
+ disabled: E,
491
525
  className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all duration-200 hover:scale-105 font-bold shadow-lg disabled:opacity-50 disabled:cursor-not-allowed",
492
- children: [D ? /* @__PURE__ */ S(g, {
526
+ children: [E ? /* @__PURE__ */ x(g, {
493
527
  size: 18,
494
528
  className: "animate-spin"
495
- }) : /* @__PURE__ */ S(p, { size: 18 }), y("export.create.actions.startExport", "Start Export")]
496
- }) : /* @__PURE__ */ C("button", {
497
- onClick: X,
529
+ }) : /* @__PURE__ */ x(p, { size: 18 }), y("export.create.actions.startExport", "Start Export")]
530
+ }) : /* @__PURE__ */ S("button", {
531
+ type: "button",
532
+ onClick: fe,
498
533
  className: "flex-1 inline-flex items-center justify-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all duration-200 hover:scale-105 font-bold shadow-lg",
499
- children: [y("export.create.actions.next", "Next"), /* @__PURE__ */ S(u, { size: 18 })]
534
+ children: [y("export.create.actions.next", "Next"), /* @__PURE__ */ x(u, { size: 18 })]
500
535
  })]
501
536
  })
502
537
  ]
503
538
  });
504
539
  }
505
540
  //#endregion
506
- export { E as CreateExportPage };
541
+ export { T as CreateExportPage };
507
542
 
508
543
  //# sourceMappingURL=CreateExportPage.js.map