@velastack/patterns 0.0.6 → 0.0.7

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.
@@ -1,15 +1,15 @@
1
- import re from "prettier";
2
- import ae from "prettier-plugin-svelte";
3
- function oe(t) {
1
+ import Qt from "prettier";
2
+ import te from "prettier-plugin-svelte";
3
+ function ee(t) {
4
4
  return t.language === "ts" || t.language === "svelte" || t.path.endsWith(".json");
5
5
  }
6
- async function se(t) {
7
- if (!oe(t))
6
+ async function ne(t) {
7
+ if (!ee(t))
8
8
  return t;
9
9
  try {
10
- const e = await re.format(t.content, {
10
+ const e = await Qt.format(t.content, {
11
11
  filepath: t.path,
12
- plugins: [ae]
12
+ plugins: [te]
13
13
  });
14
14
  return {
15
15
  ...t,
@@ -20,7 +20,7 @@ async function se(t) {
20
20
  }
21
21
  }
22
22
  async function ct(t) {
23
- return Promise.all(t.map((e) => se(e)));
23
+ return Promise.all(t.map((e) => ne(e)));
24
24
  }
25
25
  async function k(t) {
26
26
  const [e, n] = await Promise.all([
@@ -37,8 +37,8 @@ function mt(t, e) {
37
37
  var n = Object.keys(t);
38
38
  if (Object.getOwnPropertySymbols) {
39
39
  var r = Object.getOwnPropertySymbols(t);
40
- e && (r = r.filter(function(a) {
41
- return Object.getOwnPropertyDescriptor(t, a).enumerable;
40
+ e && (r = r.filter(function(o) {
41
+ return Object.getOwnPropertyDescriptor(t, o).enumerable;
42
42
  })), n.push.apply(n, r);
43
43
  }
44
44
  return n;
@@ -47,21 +47,21 @@ function ut(t) {
47
47
  for (var e = 1; e < arguments.length; e++) {
48
48
  var n = arguments[e] != null ? arguments[e] : {};
49
49
  e % 2 ? mt(Object(n), !0).forEach(function(r) {
50
- ie(t, r, n[r]);
50
+ re(t, r, n[r]);
51
51
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : mt(Object(n)).forEach(function(r) {
52
52
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
53
53
  });
54
54
  }
55
55
  return t;
56
56
  }
57
- function ie(t, e, n) {
58
- return e = le(e), e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
57
+ function re(t, e, n) {
58
+ return e = ae(e), e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
59
59
  }
60
- function le(t) {
61
- var e = ce(t, "string");
60
+ function ae(t) {
61
+ var e = oe(t, "string");
62
62
  return typeof e == "symbol" ? e : String(e);
63
63
  }
64
- function ce(t, e) {
64
+ function oe(t, e) {
65
65
  if (typeof t != "object" || t === null) return t;
66
66
  var n = t[Symbol.toPrimitive];
67
67
  if (n !== void 0) {
@@ -71,20 +71,20 @@ function ce(t, e) {
71
71
  }
72
72
  return (e === "string" ? String : Number)(t);
73
73
  }
74
- const p = zt({});
75
- function zt(t) {
76
- return e.withOptions = (n) => zt(ut(ut({}, t), n)), e;
74
+ const p = Rt({});
75
+ function Rt(t) {
76
+ return e.withOptions = (n) => Rt(ut(ut({}, t), n)), e;
77
77
  function e(n, ...r) {
78
- const a = typeof n == "string" ? [n] : n.raw, {
78
+ const o = typeof n == "string" ? [n] : n.raw, {
79
79
  alignValues: s = !1,
80
80
  escapeSpecialCharacters: i = Array.isArray(n),
81
- trimWhitespace: o = !0
81
+ trimWhitespace: a = !0
82
82
  } = t;
83
83
  let c = "";
84
- for (let f = 0; f < a.length; f++) {
85
- let g = a[f];
84
+ for (let f = 0; f < o.length; f++) {
85
+ let g = o[f];
86
86
  if (i && (g = g.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{")), c += g, f < r.length) {
87
- const x = s ? me(r[f], c) : r[f];
87
+ const x = s ? se(r[f], c) : r[f];
88
88
  c += x;
89
89
  }
90
90
  }
@@ -103,7 +103,7 @@ function zt(t) {
103
103
  c = m.map((g) => g[0] === " " || g[0] === " " ? g.slice(f) : g).join(`
104
104
  `);
105
105
  }
106
- return o && (c = c.trim()), i && (c = c.replace(/\\n/g, `
106
+ return a && (c = c.trim()), i && (c = c.replace(/\\n/g, `
107
107
  `).replace(/\\t/g, " ").replace(/\\r/g, "\r").replace(/\\v/g, "\v").replace(/\\b/g, "\b").replace(/\\f/g, "\f").replace(/\\0/g, "\0").replace(/\\x([\da-fA-F]{2})/g, (f, g) => String.fromCharCode(parseInt(g, 16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g, (f, g) => String.fromCodePoint(parseInt(g, 16))).replace(/\\u([\da-fA-F]{4})/g, (f, g) => String.fromCharCode(parseInt(g, 16)))), typeof Bun < "u" && (c = c.replace(
108
108
  // Matches e.g. \\u{1f60a} or \\u5F1F
109
109
  /\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,
@@ -115,20 +115,20 @@ function zt(t) {
115
115
  )), c;
116
116
  }
117
117
  }
118
- function me(t, e) {
118
+ function se(t, e) {
119
119
  if (typeof t != "string" || !t.includes(`
120
120
  `))
121
121
  return t;
122
122
  const r = e.slice(e.lastIndexOf(`
123
123
  `) + 1).match(/^(\s+)/);
124
124
  if (r) {
125
- const a = r[1];
125
+ const o = r[1];
126
126
  return t.replace(/\n/g, `
127
- ${a}`);
127
+ ${o}`);
128
128
  }
129
129
  return t;
130
130
  }
131
- function Dt(t, e) {
131
+ function Et(t, e) {
132
132
  return t.startsWith(e) ? t.slice(e.length) : t.replace(/^\.\//, "");
133
133
  }
134
134
  function j(t) {
@@ -147,7 +147,7 @@ function pt(t) {
147
147
  }
148
148
  );
149
149
  }
150
- const ue = {
150
+ const ie = {
151
151
  text: ["form", "input"],
152
152
  number: ["form", "input"],
153
153
  email: ["form", "input"],
@@ -162,7 +162,7 @@ const ue = {
162
162
  url: ["form", "input"],
163
163
  editor: ["form", "textarea"],
164
164
  autodate: ["form", "input"]
165
- }, pe = {
165
+ }, le = {
166
166
  form: ['import * as Form from "$lib/components/ui/form";'],
167
167
  "file-form": ['import * as FileForm from "$lib/components/ui/file-form";'],
168
168
  multiselect: [
@@ -176,13 +176,13 @@ const ue = {
176
176
  geopoint: ['import { GeopointInput } from "$lib/components/ui/geopoint";'],
177
177
  button: ['import { Button } from "$lib/components/ui/button";']
178
178
  };
179
- function R(t) {
179
+ function M(t) {
180
180
  return `$formData.${t.name}`;
181
181
  }
182
182
  function L(t) {
183
183
  return t.inputProps ? Object.entries(t.inputProps).flatMap(([e, n]) => n == null || n === !1 ? [] : n === !0 ? [` ${e}`] : [` ${e}=${JSON.stringify(String(n))}`]).join("") : "";
184
184
  }
185
- function P(t) {
185
+ function R(t) {
186
186
  return t.labelAside ? p`
187
187
  <div class="flex justify-between">
188
188
  <Form.Label>${t.title}</Form.Label>
@@ -190,68 +190,68 @@ function P(t) {
190
190
  </div>
191
191
  ` : `<Form.Label>${t.title}</Form.Label>`;
192
192
  }
193
- function z(t, e) {
193
+ function I(t, e) {
194
194
  const n = t.required ? " required" : "";
195
195
  return p`
196
196
  <Form.Field {form} name="${t.name}" class="col-span-1">
197
197
  <Form.Control>
198
198
  {#snippet children({ props })}
199
- ${P(t)}
200
- <Input {...props} type="${e}" bind:value={${R(t)}}${n}${L(t)} />
199
+ ${R(t)}
200
+ <Input {...props} type="${e}" bind:value={${M(t)}}${n}${L(t)} />
201
201
  {/snippet}
202
202
  </Form.Control>
203
203
  <Form.FieldErrors class="contents text-destructive" />
204
204
  </Form.Field>
205
205
  `;
206
206
  }
207
- function de(t) {
207
+ function ce(t) {
208
208
  const e = t.required ? " required" : "";
209
209
  return p`
210
210
  <Form.Field {form} name="${t.name}" class="col-span-2">
211
211
  <Form.Control>
212
212
  {#snippet children({ props })}
213
- ${P(t)}
214
- <Textarea {...props} bind:value={${R(t)}}${e}${L(t)} />
213
+ ${R(t)}
214
+ <Textarea {...props} bind:value={${M(t)}}${e}${L(t)} />
215
215
  {/snippet}
216
216
  </Form.Control>
217
217
  <Form.FieldErrors class="contents text-destructive" />
218
218
  </Form.Field>
219
219
  `;
220
220
  }
221
- function fe(t) {
221
+ function me(t) {
222
222
  const e = t.required ? " required" : "";
223
223
  return p`
224
224
  <Form.Field {form} name="${t.name}" class="col-span-1 flex items-start space-x-2">
225
225
  <Form.Control>
226
226
  {#snippet children({ props })}
227
- <Checkbox {...props} bind:checked={${R(t)}}${e}${L(t)} />
228
- ${P(t)}
227
+ <Checkbox {...props} bind:checked={${M(t)}}${e}${L(t)} />
228
+ ${R(t)}
229
229
  {/snippet}
230
230
  </Form.Control>
231
231
  <Form.FieldErrors class="contents text-destructive" />
232
232
  </Form.Field>
233
233
  `;
234
234
  }
235
- function he(t) {
235
+ function ue(t) {
236
236
  return p`
237
237
  <Form.Field {form} name="${t.name}" class="col-span-1">
238
238
  <Form.Control>
239
239
  {#snippet children({ props })}
240
- ${P(t)}
241
- <GeopointInput {...props} bind:value={${R(t)}} />
240
+ ${R(t)}
241
+ <GeopointInput {...props} bind:value={${M(t)}} />
242
242
  {/snippet}
243
243
  </Form.Control>
244
244
  <Form.FieldErrors class="contents text-destructive" />
245
245
  </Form.Field>
246
246
  `;
247
247
  }
248
- function ge(t) {
248
+ function pe(t) {
249
249
  const e = t.required ? " required" : "", n = t.maxSelect > 1 ? "Multiple" : "Single";
250
250
  return p`
251
251
  <FileForm.Field {form} name="${t.name}" class="col-span-1">
252
252
  <Form.Control>
253
253
  {#snippet children({ props })}
254
- ${P(t)}
254
+ ${R(t)}
255
255
  <FileForm.${n}>
256
256
  {#snippet display({ file, filename, onremove })}
257
257
  <div class="flex gap-2 justify-between items-center">
@@ -272,8 +272,8 @@ function ge(t) {
272
272
  </FileForm.Field>
273
273
  `;
274
274
  }
275
- function be(t) {
276
- const e = t.maxSelect > 1 ? "multiple" : "single", n = t.required ? " required" : "", r = t.maxSelect > 1 ? "Select options" : "Select an option", a = t.options.map(
275
+ function de(t) {
276
+ const e = t.maxSelect > 1 ? "multiple" : "single", n = t.required ? " required" : "", r = t.maxSelect > 1 ? "Select options" : "Select an option", o = t.options.map(
277
277
  (s) => `<MultiSelect.Item value=${JSON.stringify(s.value)} label={${t.name}Labels[${JSON.stringify(s.value)}].label} />`
278
278
  ).join(`
279
279
  `);
@@ -281,9 +281,9 @@ function be(t) {
281
281
  <MultiSelect.Field {form} type="${e}" name="${t.name}"${n} class="col-span-1">
282
282
  <Form.Control>
283
283
  {#snippet children({ props })}
284
- ${P(t)}
284
+ ${R(t)}
285
285
  <MultiSelect.Trigger class="w-full justify-between">
286
- <MultiSelect.Input bind:value={${R(t)}} placeholder="${r}" {...props}>
286
+ <MultiSelect.Input bind:value={${M(t)}} placeholder="${r}" {...props}>
287
287
  {#snippet children({ selected })}
288
288
  <div class="flex flex-wrap gap-1">
289
289
  {#each selected as value}
@@ -301,7 +301,7 @@ function be(t) {
301
301
  <Command.Input autofocus placeholder="Search..." />
302
302
  <Command.Empty>No options found</Command.Empty>
303
303
  <Command.Group>
304
- ${a}
304
+ ${o}
305
305
  </Command.Group>
306
306
  </Command.Root>
307
307
  </MultiSelect.Content>
@@ -310,15 +310,15 @@ function be(t) {
310
310
  </MultiSelect.Field>
311
311
  `;
312
312
  }
313
- function ve(t) {
314
- const e = t.maxSelect > 1 ? "multiple" : "single", n = t.maxSelect > 1 ? `Select ${t.relatedModel.pluralDisplayName.toLowerCase()}` : `Select ${t.relatedModel.displayName.toLowerCase()}`, r = `Search ${t.relatedModel.pluralDisplayName.toLowerCase()}...`, a = `No ${t.relatedModel.pluralDisplayName.toLowerCase()} found`, s = t.relatedModel.name, i = t.relatedModel.pluralName;
313
+ function fe(t) {
314
+ const e = t.maxSelect > 1 ? "multiple" : "single", n = t.maxSelect > 1 ? `Select ${t.relatedModel.pluralDisplayName.toLowerCase()}` : `Select ${t.relatedModel.displayName.toLowerCase()}`, r = `Search ${t.relatedModel.pluralDisplayName.toLowerCase()}...`, o = `No ${t.relatedModel.pluralDisplayName.toLowerCase()} found`, s = t.relatedModel.name, i = t.relatedModel.pluralName;
315
315
  return p`
316
316
  <MultiSelect.Field {form} type="${e}" name="${t.name}" class="col-span-1">
317
317
  <Form.Control>
318
318
  {#snippet children({ props })}
319
319
  <Form.Label>${t.title}</Form.Label>
320
320
  <MultiSelect.Trigger class="w-full justify-between">
321
- <MultiSelect.Input bind:value={${R(t)}} placeholder="${n}" {...props}>
321
+ <MultiSelect.Input bind:value={${M(t)}} placeholder="${n}" {...props}>
322
322
  {#snippet children({ selected })}
323
323
  <div class="flex flex-wrap gap-1">
324
324
  {#each selected as value}
@@ -335,7 +335,7 @@ function ve(t) {
335
335
  <MultiSelect.Content class="p-0">
336
336
  <Command.Root>
337
337
  <Command.Input autofocus placeholder="${r}" />
338
- <Command.Empty>${a}</Command.Empty>
338
+ <Command.Empty>${o}</Command.Empty>
339
339
  <Command.Group>
340
340
  {#each data.${i} as ${s}}
341
341
  <MultiSelect.Item value={${s}.id} label={${s}.${t.displayField}} />
@@ -348,13 +348,13 @@ function ve(t) {
348
348
  </MultiSelect.Field>
349
349
  `;
350
350
  }
351
- function we(t) {
351
+ function he(t) {
352
352
  return p`
353
353
  <Form.Field {form} name="${t.name}" class="col-span-1">
354
354
  <Form.Control>
355
355
  {#snippet children({ props })}
356
- ${P(t)}
357
- <Input {...props} type="text" value={${R(t)}}${L(t)} readonly />
356
+ ${R(t)}
357
+ <Input {...props} type="text" value={${M(t)}}${L(t)} readonly />
358
358
  {/snippet}
359
359
  </Form.Control>
360
360
  <Form.FieldErrors class="contents text-destructive" />
@@ -364,37 +364,37 @@ function we(t) {
364
364
  function et(t) {
365
365
  switch (t.type) {
366
366
  case "text":
367
- return z(t, "text");
367
+ return I(t, "text");
368
368
  case "number":
369
- return z(t, "number");
369
+ return I(t, "number");
370
370
  case "date":
371
- return z(t, "date");
371
+ return I(t, "date");
372
372
  case "email":
373
- return z(t, "email");
373
+ return I(t, "email");
374
374
  case "password":
375
- return z(t, "password");
375
+ return I(t, "password");
376
376
  case "url":
377
- return z(t, "url");
377
+ return I(t, "url");
378
378
  case "autodate":
379
- return we(t);
379
+ return he(t);
380
380
  case "editor":
381
381
  case "json":
382
- return de(t);
382
+ return ce(t);
383
383
  case "bool":
384
- return fe(t);
384
+ return me(t);
385
385
  case "geoPoint":
386
- return he(t);
386
+ return ue(t);
387
387
  case "file":
388
- return ge(t);
388
+ return pe(t);
389
389
  case "select":
390
- return be(t);
390
+ return de(t);
391
391
  case "relation":
392
- return ve(t);
392
+ return fe(t);
393
393
  default:
394
394
  return t;
395
395
  }
396
396
  }
397
- function At(t) {
397
+ function Tt(t) {
398
398
  const e = t.options.map(
399
399
  (n) => p`
400
400
  ${JSON.stringify(n.value)}: {
@@ -411,13 +411,13 @@ function At(t) {
411
411
  `;
412
412
  }
413
413
  function O(t) {
414
- const e = t.flatMap((n) => ue[n.type]);
414
+ const e = t.flatMap((n) => ie[n.type]);
415
415
  return [...new Set(e)];
416
416
  }
417
417
  function nt(t) {
418
- return [...new Set(t.flatMap((e) => pe[e]))];
418
+ return [...new Set(t.flatMap((e) => le[e]))];
419
419
  }
420
- function M(t, e) {
420
+ function P(t, e) {
421
421
  return `data.${t.name}.${e.name}`;
422
422
  }
423
423
  function J(t, e, n) {
@@ -428,8 +428,8 @@ function J(t, e, n) {
428
428
  </div>
429
429
  `;
430
430
  }
431
- function ye(t, e) {
432
- const n = M(t, e), r = `<p class="text-muted-foreground">{new Date(${n}).toLocaleDateString()}</p>`, a = e.required ? r : p`
431
+ function ge(t, e) {
432
+ const n = P(t, e), r = `<p class="text-muted-foreground">{new Date(${n}).toLocaleDateString()}</p>`, o = e.required ? r : p`
433
433
  {#if ${n}}
434
434
  ${r}
435
435
  {/if}
@@ -437,16 +437,16 @@ function ye(t, e) {
437
437
  return p`
438
438
  <div class="space-y-2">
439
439
  <h3 class="font-medium leading-none">${e.title}</h3>
440
- ${a}
440
+ ${o}
441
441
  </div>
442
442
  `;
443
443
  }
444
- function xe(t, e) {
445
- const n = M(t, e), r = p`
444
+ function be(t, e) {
445
+ const n = P(t, e), r = p`
446
446
  <a href={${n}} target="_blank" rel="noopener noreferrer">
447
447
  {${n}}
448
448
  </a>
449
- `, a = e.required ? r : p`
449
+ `, o = e.required ? r : p`
450
450
  {#if ${n}}
451
451
  ${r}
452
452
  {/if}
@@ -455,13 +455,13 @@ function xe(t, e) {
455
455
  <div class="space-y-2">
456
456
  <h3 class="font-medium leading-none">${e.title}</h3>
457
457
  <p class="text-muted-foreground">
458
- ${a}
458
+ ${o}
459
459
  </p>
460
460
  </div>
461
461
  `;
462
462
  }
463
- function $e(t, e) {
464
- const n = M(t, e);
463
+ function ve(t, e) {
464
+ const n = P(t, e);
465
465
  if (e.maxSelect > 1)
466
466
  return p`
467
467
  <div class="space-y-2">
@@ -471,7 +471,7 @@ function $e(t, e) {
471
471
  {/each}
472
472
  </div>
473
473
  `;
474
- const r = `<Badge variant="outline" class="mr-1">{${e.name}Labels[${n}].label}</Badge>`, a = e.required ? r : p`
474
+ const r = `<Badge variant="outline" class="mr-1">{${e.name}Labels[${n}].label}</Badge>`, o = e.required ? r : p`
475
475
  {#if ${n}}
476
476
  ${r}
477
477
  {/if}
@@ -479,12 +479,12 @@ function $e(t, e) {
479
479
  return p`
480
480
  <div class="space-y-2">
481
481
  <h3 class="font-medium leading-none">${e.title}</h3>
482
- ${a}
482
+ ${o}
483
483
  </div>
484
484
  `;
485
485
  }
486
- function Fe(t, e) {
487
- const n = M(t, e);
486
+ function we(t, e) {
487
+ const n = P(t, e);
488
488
  return e.maxSelect > 1 ? p`
489
489
  <div class="space-y-2">
490
490
  <h3 class="font-medium leading-none">${e.title}</h3>
@@ -529,11 +529,11 @@ function Fe(t, e) {
529
529
  </div>
530
530
  `;
531
531
  }
532
- function Ce(t) {
532
+ function ye(t) {
533
533
  return `/${t.relatedModel.routeSegment}`;
534
534
  }
535
- function _e(t, e) {
536
- const n = `data.${t.name}.expand?.${e.name}`, r = Ce(e);
535
+ function xe(t, e) {
536
+ const n = `data.${t.name}.expand?.${e.name}`, r = ye(e);
537
537
  return e.maxSelect > 1 ? p`
538
538
  <div class="space-y-2">
539
539
  <h3 class="font-medium leading-none">${e.title}</h3>
@@ -560,8 +560,8 @@ function _e(t, e) {
560
560
  </div>
561
561
  `;
562
562
  }
563
- function Se(t, e) {
564
- const n = M(t, e), r = p`
563
+ function $e(t, e) {
564
+ const n = P(t, e), r = p`
565
565
  {#await import("$lib/components/ui/leaflet/leaflet.svelte")}
566
566
  <div class="h-56.25 w-full bg-input rounded-md"></div>
567
567
  {:then { default: Leaflet }}
@@ -570,7 +570,7 @@ function Se(t, e) {
570
570
  <p class="text-muted-foreground">
571
571
  {${n}?.lat.toFixed(6)}, {${n}?.lon.toFixed(6)}
572
572
  </p>
573
- `, a = e.required ? r : p`
573
+ `, o = e.required ? r : p`
574
574
  {#if ${n}}
575
575
  ${r}
576
576
  {/if}
@@ -578,17 +578,17 @@ function Se(t, e) {
578
578
  return p`
579
579
  <div class="space-y-2">
580
580
  <h3 class="font-medium leading-none">${e.title}</h3>
581
- ${a}
581
+ ${o}
582
582
  </div>
583
583
  `;
584
584
  }
585
- function ke(t, e) {
585
+ function Fe(t, e) {
586
586
  switch (e.type) {
587
587
  case "text":
588
588
  case "number":
589
589
  case "email":
590
590
  case "editor":
591
- return J(t, e, `{${M(t, e)}}`);
591
+ return J(t, e, `{${P(t, e)}}`);
592
592
  case "password":
593
593
  return p`
594
594
  <div class="space-y-2">
@@ -602,31 +602,31 @@ function ke(t, e) {
602
602
  return J(
603
603
  t,
604
604
  e,
605
- `{${M(t, e)} ? "Yes" : "No"}`
605
+ `{${P(t, e)} ? "Yes" : "No"}`
606
606
  );
607
607
  case "date":
608
608
  case "autodate":
609
- return ye(t, e);
609
+ return ge(t, e);
610
610
  case "url":
611
- return xe(t, e);
611
+ return be(t, e);
612
612
  case "select":
613
- return $e(t, e);
613
+ return ve(t, e);
614
614
  case "file":
615
- return Fe(t, e);
615
+ return we(t, e);
616
616
  case "json":
617
- return J(t, e, `{JSON.stringify(${M(t, e)})}`);
617
+ return J(t, e, `{JSON.stringify(${P(t, e)})}`);
618
618
  case "geoPoint":
619
- return Se(t, e);
619
+ return $e(t, e);
620
620
  case "relation":
621
- return _e(t, e);
621
+ return xe(t, e);
622
622
  default:
623
623
  return e;
624
624
  }
625
625
  }
626
- const Me = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), Re = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Pe = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), Ee = /[^\p{L}\d]+/giu, dt = "$1\0$2", ft = "";
627
- function Nt(t) {
626
+ const Ce = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), _e = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), Se = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), ke = /[^\p{L}\d]+/giu, dt = "$1\0$2", ft = "";
627
+ function zt(t) {
628
628
  let e = t.trim();
629
- e = e.replace(Me, dt).replace(Re, dt), e = e.replace(Ee, "\0");
629
+ e = e.replace(Ce, dt).replace(_e, dt), e = e.replace(ke, "\0");
630
630
  let n = 0, r = e.length;
631
631
  for (; e.charAt(n) === "\0"; )
632
632
  n++;
@@ -636,38 +636,38 @@ function Nt(t) {
636
636
  r--;
637
637
  return e.slice(n, r).split(/\0/g);
638
638
  }
639
- function Ie(t) {
640
- const e = Nt(t);
639
+ function Pe(t) {
640
+ const e = zt(t);
641
641
  for (let n = 0; n < e.length; n++) {
642
- const r = e[n], a = Pe.exec(r);
643
- if (a) {
644
- const s = a.index + (a[1] ?? a[2]).length;
642
+ const r = e[n], o = Se.exec(r);
643
+ if (o) {
644
+ const s = o.index + (o[1] ?? o[2]).length;
645
645
  e.splice(n, 1, r.slice(0, s), r.slice(s));
646
646
  }
647
647
  }
648
648
  return e;
649
649
  }
650
- function Bt(t, e) {
651
- const [n, r, a] = G(t, e);
652
- return n + r.map(H(e == null ? void 0 : e.locale)).join((e == null ? void 0 : e.delimiter) ?? " ") + a;
650
+ function It(t, e) {
651
+ const [n, r, o] = G(t, e);
652
+ return n + r.map(H(e == null ? void 0 : e.locale)).join((e == null ? void 0 : e.delimiter) ?? " ") + o;
653
653
  }
654
654
  function N(t, e) {
655
- const [n, r, a] = G(t, e), s = H(e == null ? void 0 : e.locale), i = at(e == null ? void 0 : e.locale), o = jt(s, i);
656
- return n + r.map((c, m) => m === 0 ? s(c) : o(c, m)).join("") + a;
655
+ const [n, r, o] = G(t, e), s = H(e == null ? void 0 : e.locale), i = at(e == null ? void 0 : e.locale), a = At(s, i);
656
+ return n + r.map((c, m) => m === 0 ? s(c) : a(c, m)).join("") + o;
657
657
  }
658
- function Te(t, e) {
659
- const [n, r, a] = G(t, e), s = H(e == null ? void 0 : e.locale), i = at(e == null ? void 0 : e.locale), o = jt(s, i);
660
- return n + r.map(o).join("") + a;
658
+ function Me(t, e) {
659
+ const [n, r, o] = G(t, e), s = H(e == null ? void 0 : e.locale), i = at(e == null ? void 0 : e.locale), a = At(s, i);
660
+ return n + r.map(a).join("") + o;
661
661
  }
662
662
  function rt(t, e) {
663
- const [n, r, a] = G(t, e), s = H(e == null ? void 0 : e.locale), i = at(e == null ? void 0 : e.locale);
664
- return n + r.map(Ae(s, i)).join(" ") + a;
663
+ const [n, r, o] = G(t, e), s = H(e == null ? void 0 : e.locale), i = at(e == null ? void 0 : e.locale);
664
+ return n + r.map(Te(s, i)).join(" ") + o;
665
665
  }
666
- function ze(t, e) {
667
- return Bt(t, { delimiter: "-", ...e });
666
+ function Re(t, e) {
667
+ return It(t, { delimiter: "-", ...e });
668
668
  }
669
- function De(t, e) {
670
- return Bt(t, { delimiter: "_", ...e });
669
+ function Ee(t, e) {
670
+ return It(t, { delimiter: "_", ...e });
671
671
  }
672
672
  function H(t) {
673
673
  return t === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(t);
@@ -675,29 +675,29 @@ function H(t) {
675
675
  function at(t) {
676
676
  return (e) => e.toLocaleUpperCase(t);
677
677
  }
678
- function Ae(t, e) {
678
+ function Te(t, e) {
679
679
  return (n) => `${e(n[0])}${t(n.slice(1))}`;
680
680
  }
681
- function jt(t, e) {
681
+ function At(t, e) {
682
682
  return (n, r) => {
683
- const a = n[0];
684
- return (r > 0 && a >= "0" && a <= "9" ? "_" + a : e(a)) + t(n.slice(1));
683
+ const o = n[0];
684
+ return (r > 0 && o >= "0" && o <= "9" ? "_" + o : e(o)) + t(n.slice(1));
685
685
  };
686
686
  }
687
687
  function G(t, e = {}) {
688
- const n = e.split ?? (e.separateNumbers ? Ie : Nt), r = e.prefixCharacters ?? ft, a = e.suffixCharacters ?? ft;
688
+ const n = e.split ?? (e.separateNumbers ? Pe : zt), r = e.prefixCharacters ?? ft, o = e.suffixCharacters ?? ft;
689
689
  let s = 0, i = t.length;
690
690
  for (; s < t.length; ) {
691
- const o = t.charAt(s);
692
- if (!r.includes(o))
691
+ const a = t.charAt(s);
692
+ if (!r.includes(a))
693
693
  break;
694
694
  s++;
695
695
  }
696
696
  for (; i > s; ) {
697
- const o = i - 1, c = t.charAt(o);
698
- if (!a.includes(c))
697
+ const a = i - 1, c = t.charAt(a);
698
+ if (!o.includes(c))
699
699
  break;
700
- i = o;
700
+ i = a;
701
701
  }
702
702
  return [
703
703
  t.slice(0, s),
@@ -705,20 +705,20 @@ function G(t, e = {}) {
705
705
  t.slice(i)
706
706
  ];
707
707
  }
708
- function Ne(t) {
708
+ function ze(t) {
709
709
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
710
710
  }
711
- function Be(t) {
711
+ function Ie(t) {
712
712
  throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
713
713
  }
714
- var V = { exports: {} }, je = V.exports, ht;
715
- function Le() {
714
+ var V = { exports: {} }, Ae = V.exports, ht;
715
+ function De() {
716
716
  return ht || (ht = 1, (function(t, e) {
717
717
  (function(n, r) {
718
- typeof Be == "function" ? t.exports = r() : n.pluralize = r();
719
- })(je, function() {
720
- var n = [], r = [], a = {}, s = {}, i = {};
721
- function o(l) {
718
+ typeof Ie == "function" ? t.exports = r() : n.pluralize = r();
719
+ })(Ae, function() {
720
+ var n = [], r = [], o = {}, s = {}, i = {};
721
+ function a(l) {
722
722
  return typeof l == "string" ? new RegExp("^" + l + "$", "i") : l;
723
723
  }
724
724
  function c(l, d) {
@@ -736,7 +736,7 @@ function Le() {
736
736
  });
737
737
  }
738
738
  function f(l, d, w) {
739
- if (!l.length || a.hasOwnProperty(l))
739
+ if (!l.length || o.hasOwnProperty(l))
740
740
  return d;
741
741
  for (var $ = w.length; $--; ) {
742
742
  var F = w[$];
@@ -752,8 +752,8 @@ function Le() {
752
752
  }
753
753
  function x(l, d, w, $) {
754
754
  return function(F) {
755
- var I = F.toLowerCase();
756
- return d.hasOwnProperty(I) ? !0 : l.hasOwnProperty(I) ? !1 : f(I, I, w) === I;
755
+ var T = F.toLowerCase();
756
+ return d.hasOwnProperty(T) ? !0 : l.hasOwnProperty(T) ? !1 : f(T, T, w) === T;
757
757
  };
758
758
  }
759
759
  function u(l, d, w) {
@@ -777,12 +777,12 @@ function Le() {
777
777
  i,
778
778
  r
779
779
  ), u.addPluralRule = function(l, d) {
780
- n.push([o(l), d]);
780
+ n.push([a(l), d]);
781
781
  }, u.addSingularRule = function(l, d) {
782
- r.push([o(l), d]);
782
+ r.push([a(l), d]);
783
783
  }, u.addUncountableRule = function(l) {
784
784
  if (typeof l == "string") {
785
- a[l.toLowerCase()] = !0;
785
+ o[l.toLowerCase()] = !0;
786
786
  return;
787
787
  }
788
788
  u.addPluralRule(l, "$0"), u.addSingularRule(l, "$0");
@@ -1011,8 +1011,8 @@ function Le() {
1011
1011
  });
1012
1012
  })(V)), V.exports;
1013
1013
  }
1014
- var Oe = Le();
1015
- const S = /* @__PURE__ */ Ne(Oe), Pa = "data", Ea = "migrations", qe = "(app)", Ue = /* @__PURE__ */ new Set([
1014
+ var Ne = De();
1015
+ const S = /* @__PURE__ */ ze(Ne), $a = "data", Fa = "migrations", Be = "(app)", je = /* @__PURE__ */ new Set([
1016
1016
  "break",
1017
1017
  "case",
1018
1018
  "catch",
@@ -1064,7 +1064,7 @@ const S = /* @__PURE__ */ Ne(Oe), Pa = "data", Ea = "migrations", qe = "(app)",
1064
1064
  "async",
1065
1065
  "arguments",
1066
1066
  "constructor"
1067
- ]), Ve = {
1067
+ ]), Le = {
1068
1068
  function: "fn",
1069
1069
  interface: "iface",
1070
1070
  type: "type_",
@@ -1114,7 +1114,7 @@ const S = /* @__PURE__ */ Ne(Oe), Pa = "data", Ea = "migrations", qe = "(app)",
1114
1114
  constructor: "ctor"
1115
1115
  };
1116
1116
  function Z(t) {
1117
- return Ue.has(t) ? Ve[t] ?? `${t}_` : t;
1117
+ return je.has(t) ? Le[t] ?? `${t}_` : t;
1118
1118
  }
1119
1119
  function K(t) {
1120
1120
  if (!/^[a-zA-Z][a-zA-Z0-9-_/]*$/.test(t))
@@ -1122,24 +1122,24 @@ function K(t) {
1122
1122
  "Model path must start with a letter and contain only alphanumeric characters, dash, slash, or underscore"
1123
1123
  );
1124
1124
  }
1125
- function He(t) {
1126
- return t.features.auth ? `src/routes/${qe}` : "src/routes";
1125
+ function Oe(t) {
1126
+ return t.features.auth ? `src/routes/${Be}` : "src/routes";
1127
1127
  }
1128
1128
  function E(t, e) {
1129
- const n = t.split("/"), r = n[n.length - 1], a = n.slice(0, -1), s = S.singular(rt(r)), i = S.plural(s), o = N(s), c = ze(i), m = [...a, c].join("/");
1129
+ const n = t.split("/"), r = n[n.length - 1], o = n.slice(0, -1), s = S.singular(rt(r)), i = S.plural(s), a = N(s), c = Re(i), m = [...o, c].join("/");
1130
1130
  return {
1131
- name: Z(o),
1131
+ name: Z(a),
1132
1132
  pluralName: Z(N(i)),
1133
- typeName: Te(s),
1134
- tableName: De(i),
1133
+ typeName: Me(s),
1134
+ tableName: Ee(i),
1135
1135
  displayName: s,
1136
1136
  pluralDisplayName: i,
1137
- schemaName: `${Z(o)}Schema`,
1137
+ schemaName: `${Z(a)}Schema`,
1138
1138
  routeSegment: m,
1139
- routesDir: He(e)
1139
+ routesDir: Oe(e)
1140
1140
  };
1141
1141
  }
1142
- function Ge(t) {
1142
+ function qe(t) {
1143
1143
  const e = `${t.routesDir}/${t.routeSegment}`;
1144
1144
  return {
1145
1145
  list: e,
@@ -1148,7 +1148,7 @@ function Ge(t) {
1148
1148
  edit: `${e}/[id]/edit`
1149
1149
  };
1150
1150
  }
1151
- function Ke(t) {
1151
+ function Ue(t) {
1152
1152
  const e = `/${t.routeSegment}`;
1153
1153
  return {
1154
1154
  list: e,
@@ -1157,7 +1157,7 @@ function Ke(t) {
1157
1157
  edit: `${e}/[id]/edit`
1158
1158
  };
1159
1159
  }
1160
- const We = [
1160
+ const Ve = [
1161
1161
  "title",
1162
1162
  "name",
1163
1163
  "label",
@@ -1191,24 +1191,24 @@ const We = [
1191
1191
  "url",
1192
1192
  "id"
1193
1193
  ];
1194
- function Xe(t) {
1195
- for (const e of We)
1194
+ function He(t) {
1195
+ for (const e of Ve)
1196
1196
  if (t.some((n) => n.name === e))
1197
1197
  return e;
1198
1198
  return "id";
1199
1199
  }
1200
- function Ye(t) {
1200
+ function Ge(t) {
1201
1201
  return t.map((e) => e.name).filter((e) => !e.startsWith("_"));
1202
1202
  }
1203
- function Je(t) {
1203
+ function Ke(t) {
1204
1204
  return Object.fromEntries(t.map((e) => [e.name, e.id]));
1205
1205
  }
1206
- function Lt(t) {
1206
+ function Dt(t) {
1207
1207
  return Object.fromEntries(
1208
- t.map((e) => [e.name, Xe(e.fields)])
1208
+ t.map((e) => [e.name, He(e.fields)])
1209
1209
  );
1210
1210
  }
1211
- const Ze = [
1211
+ const We = [
1212
1212
  "user",
1213
1213
  "owner",
1214
1214
  "created_by",
@@ -1217,7 +1217,7 @@ const Ze = [
1217
1217
  "account",
1218
1218
  "creator"
1219
1219
  ];
1220
- function D(t) {
1220
+ function A(t) {
1221
1221
  return t.toLowerCase();
1222
1222
  }
1223
1223
  function gt(t) {
@@ -1228,15 +1228,15 @@ function gt(t) {
1228
1228
  operator: "="
1229
1229
  };
1230
1230
  }
1231
- function Qe(t, e, n = {}) {
1232
- const r = new Set((n.authCollections ?? ["users"]).map(D)), a = new Set(
1233
- (n.userFieldHints ?? Ze).map(D)
1234
- ), s = n.maxDepth ?? 8, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1231
+ function Xe(t, e, n = {}) {
1232
+ const r = new Set((n.authCollections ?? ["users"]).map(A)), o = new Set(
1233
+ (n.userFieldHints ?? We).map(A)
1234
+ ), s = n.maxDepth ?? 8, i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
1235
1235
  for (const b of t)
1236
- i.set(b.name, b), o.set(b.id, b);
1236
+ i.set(b.name, b), a.set(b.id, b);
1237
1237
  if (!i.has(e))
1238
1238
  return gt(e);
1239
- if (r.has(D(e)))
1239
+ if (r.has(A(e)))
1240
1240
  return {
1241
1241
  rule: "@request.auth.id = id",
1242
1242
  ownershipChainCollections: [e],
@@ -1244,8 +1244,8 @@ function Qe(t, e, n = {}) {
1244
1244
  operator: "="
1245
1245
  };
1246
1246
  function c(b) {
1247
- const v = D(b);
1248
- return v === "user" ? 50 : a.has(v) ? 20 : 0;
1247
+ const v = A(b);
1248
+ return v === "user" ? 50 : o.has(v) ? 20 : 0;
1249
1249
  }
1250
1250
  function m(b) {
1251
1251
  const v = i.get(b);
@@ -1253,19 +1253,19 @@ function Qe(t, e, n = {}) {
1253
1253
  const C = [];
1254
1254
  for (const y of v.fields) {
1255
1255
  if (y.type !== "relation" || !y.collectionId) continue;
1256
- const T = o.get(y.collectionId);
1257
- T && C.push({
1256
+ const z = a.get(y.collectionId);
1257
+ z && C.push({
1258
1258
  from: b,
1259
1259
  fieldName: y.name,
1260
- to: T.name,
1260
+ to: z.name,
1261
1261
  isMulti: !!(y.maxSelect && y.maxSelect > 1),
1262
1262
  hintScore: c(y.name)
1263
1263
  });
1264
1264
  }
1265
- return C.sort((y, T) => y.fieldName.localeCompare(T.fieldName)), C;
1265
+ return C.sort((y, z) => y.fieldName.localeCompare(z.fieldName)), C;
1266
1266
  }
1267
1267
  function h(b) {
1268
- return r.has(D(b));
1268
+ return r.has(A(b));
1269
1269
  }
1270
1270
  function f(b) {
1271
1271
  if (b.length === 0) return !1;
@@ -1274,8 +1274,8 @@ function Qe(t, e, n = {}) {
1274
1274
  return h(b[b.length - 1].to);
1275
1275
  }
1276
1276
  function g(b) {
1277
- const v = b[b.length - 1], C = v.isMulti ? 1 : 0, y = b.every((Y) => !Y.isMulti) ? 1 : 0, T = b.reduce((Y, ne) => Y + ne.hintScore, 0), ee = D(v.fieldName) === "user" ? 1 : 0;
1278
- return 100 * b.length + 50 * C - 40 * ee - 15 * y - T;
1277
+ const v = b[b.length - 1], C = v.isMulti ? 1 : 0, y = b.every((Y) => !Y.isMulti) ? 1 : 0, z = b.reduce((Y, Zt) => Y + Zt.hintScore, 0), Jt = A(v.fieldName) === "user" ? 1 : 0;
1278
+ return 100 * b.length + 50 * C - 40 * Jt - 15 * y - z;
1279
1279
  }
1280
1280
  function x(b) {
1281
1281
  return b.map((v) => `${v.from}.${v.fieldName}->${v.to}`).join("|");
@@ -1297,18 +1297,18 @@ function Qe(t, e, n = {}) {
1297
1297
  const C = g(b) - g(v);
1298
1298
  return C !== 0 ? C : x(b).localeCompare(x(v));
1299
1299
  });
1300
- const w = u[0], $ = w.map((b) => b.fieldName), F = [e, ...w.map((b) => b.to)], lt = w[w.length - 1].isMulti ? "?=" : "=", Qt = $.join("."), te = n.includeRootPrefix ? (n.rootPrefix ?? e) + "." : "";
1300
+ const w = u[0], $ = w.map((b) => b.fieldName), F = [e, ...w.map((b) => b.to)], lt = w[w.length - 1].isMulti ? "?=" : "=", Xt = $.join("."), Yt = n.includeRootPrefix ? (n.rootPrefix ?? e) + "." : "";
1301
1301
  return {
1302
- rule: `@request.auth.id ${lt} ${te}${Qt}.id`,
1302
+ rule: `@request.auth.id ${lt} ${Yt}${Xt}.id`,
1303
1303
  ownershipChainCollections: F,
1304
1304
  ownershipChainFields: $,
1305
1305
  operator: lt
1306
1306
  };
1307
1307
  }
1308
- function tn(t) {
1308
+ function Ye(t) {
1309
1309
  let e = null, n = !1, r = 0;
1310
- for (let a = 0; a < t.length; a++) {
1311
- const s = t[a];
1310
+ for (let o = 0; o < t.length; o++) {
1311
+ const s = t[o];
1312
1312
  if (n) {
1313
1313
  n = !1;
1314
1314
  continue;
@@ -1334,7 +1334,7 @@ function tn(t) {
1334
1334
  continue;
1335
1335
  }
1336
1336
  if (s === ":" && r === 0)
1337
- return [t.slice(0, a), t.slice(a + 1)];
1337
+ return [t.slice(0, o), t.slice(o + 1)];
1338
1338
  }
1339
1339
  return [t, ""];
1340
1340
  }
@@ -1345,62 +1345,62 @@ function bt(t) {
1345
1345
  function vt(t) {
1346
1346
  let e = -1, n = null, r = !1;
1347
1347
  for (let i = 0; i < t.length; i++) {
1348
- const o = t[i];
1348
+ const a = t[i];
1349
1349
  if (r) {
1350
1350
  r = !1;
1351
1351
  continue;
1352
1352
  }
1353
1353
  if (n) {
1354
- if (o === "\\") {
1354
+ if (a === "\\") {
1355
1355
  r = !0;
1356
1356
  continue;
1357
1357
  }
1358
- o === n && (n = null);
1358
+ a === n && (n = null);
1359
1359
  continue;
1360
1360
  }
1361
- if (o === '"' || o === "'") {
1362
- n = o;
1361
+ if (a === '"' || a === "'") {
1362
+ n = a;
1363
1363
  continue;
1364
1364
  }
1365
- if (o === ":") {
1365
+ if (a === ":") {
1366
1366
  e = i;
1367
1367
  break;
1368
1368
  }
1369
1369
  }
1370
- let a, s;
1371
- return e >= 0 ? (a = t.slice(0, e).trim(), s = t.slice(e + 1).trim()) : (a = t.trim(), s = a), { label: bt(s), value: bt(a) };
1370
+ let o, s;
1371
+ return e >= 0 ? (o = t.slice(0, e).trim(), s = t.slice(e + 1).trim()) : (o = t.trim(), s = o), { label: bt(s), value: bt(o) };
1372
1372
  }
1373
- function en(t) {
1373
+ function Je(t) {
1374
1374
  const e = [];
1375
- let n = "", r = null, a = !1;
1375
+ let n = "", r = null, o = !1;
1376
1376
  for (let i = 0; i < t.length; i++) {
1377
- const o = t[i];
1378
- if (a) {
1379
- n += o, a = !1;
1377
+ const a = t[i];
1378
+ if (o) {
1379
+ n += a, o = !1;
1380
1380
  continue;
1381
1381
  }
1382
1382
  if (r) {
1383
- if (o === "\\") {
1384
- a = !0, n += o;
1383
+ if (a === "\\") {
1384
+ o = !0, n += a;
1385
1385
  continue;
1386
1386
  }
1387
- if (o === r) {
1388
- r = null, n += o;
1387
+ if (a === r) {
1388
+ r = null, n += a;
1389
1389
  continue;
1390
1390
  }
1391
- n += o;
1391
+ n += a;
1392
1392
  continue;
1393
1393
  }
1394
- if (o === '"' || o === "'") {
1395
- r = o, n += o;
1394
+ if (a === '"' || a === "'") {
1395
+ r = a, n += a;
1396
1396
  continue;
1397
1397
  }
1398
- if (o === ",") {
1398
+ if (a === ",") {
1399
1399
  const c = n.trim();
1400
1400
  c.length > 0 && e.push(vt(c)), n = "";
1401
1401
  continue;
1402
1402
  }
1403
- n += o;
1403
+ n += a;
1404
1404
  }
1405
1405
  const s = n.trim();
1406
1406
  return s.length > 0 && e.push(vt(s)), e;
@@ -1418,12 +1418,12 @@ const wt = {
1418
1418
  datetime: "date",
1419
1419
  timestamp: "date"
1420
1420
  };
1421
- function nn(t) {
1421
+ function Ze(t) {
1422
1422
  const e = t.endsWith("!");
1423
1423
  let n = e ? t.slice(0, -1) : t, r = [];
1424
1424
  if (n.startsWith("select(") && n.endsWith(")")) {
1425
- const a = n.slice(7, -1);
1426
- r = en(a), n = "select";
1425
+ const o = n.slice(7, -1);
1426
+ r = Je(o), n = "select";
1427
1427
  }
1428
1428
  return n === "files" ? { type: "file", required: e, selectOptions: r } : (n in wt && (n = wt[n]), { type: n, required: e, selectOptions: r });
1429
1429
  }
@@ -1431,11 +1431,11 @@ function yt(t) {
1431
1431
  const e = S.singular(t), n = S.plural(e);
1432
1432
  return t === n ? 99 : 1;
1433
1433
  }
1434
- function q(t, e, n, r, a, s) {
1435
- const i = E(e, s), o = S.singular(t), c = S.plural(o);
1434
+ function q(t, e, n, r, o, s) {
1435
+ const i = E(e, s), a = S.singular(t), c = S.plural(a);
1436
1436
  return {
1437
1437
  collectionId: r[e],
1438
- displayField: a[e] ?? "id",
1438
+ displayField: o[e] ?? "id",
1439
1439
  relatedModel: i,
1440
1440
  singularRelationName: N(
1441
1441
  `${n.displayName} ${i.displayName}`
@@ -1446,22 +1446,22 @@ function q(t, e, n, r, a, s) {
1446
1446
  maxSelect: t === c ? 999 : 1
1447
1447
  };
1448
1448
  }
1449
- function rn(t, e, n, r, a) {
1450
- const s = rt(t), { type: i, required: o, selectOptions: c } = e, m = Ye(r), h = Je(r), f = Lt(r), g = m.map((u) => S.singular(u));
1451
- if (a.features.auth && i === "current_user" && h.users) {
1449
+ function Qe(t, e, n, r, o) {
1450
+ const s = rt(t), { type: i, required: a, selectOptions: c } = e, m = Ge(r), h = Ke(r), f = Dt(r), g = m.map((u) => S.singular(u));
1451
+ if (o.features.auth && i === "current_user" && h.users) {
1452
1452
  const u = q(
1453
1453
  t,
1454
1454
  "users",
1455
1455
  n,
1456
1456
  h,
1457
1457
  f,
1458
- a
1458
+ o
1459
1459
  );
1460
1460
  return {
1461
1461
  type: "relation",
1462
1462
  name: t,
1463
1463
  title: s,
1464
- required: o,
1464
+ required: a,
1465
1465
  collectionId: u.collectionId,
1466
1466
  maxSelect: 1,
1467
1467
  displayField: u.displayField,
@@ -1477,14 +1477,14 @@ function rn(t, e, n, r, a) {
1477
1477
  throw new Error(
1478
1478
  `Invalid autodate field: ${t}. Must be one of created/created_at/updated/updated_at.`
1479
1479
  );
1480
- return { type: "autodate", name: t, title: s, required: o, onCreate: u, onUpdate: l };
1480
+ return { type: "autodate", name: t, title: s, required: a, onCreate: u, onUpdate: l };
1481
1481
  }
1482
1482
  if (i === "select")
1483
1483
  return {
1484
1484
  type: "select",
1485
1485
  name: t,
1486
1486
  title: s,
1487
- required: o,
1487
+ required: a,
1488
1488
  maxSelect: yt(t),
1489
1489
  options: c
1490
1490
  };
@@ -1493,7 +1493,7 @@ function rn(t, e, n, r, a) {
1493
1493
  type: "file",
1494
1494
  name: t,
1495
1495
  title: s,
1496
- required: o,
1496
+ required: a,
1497
1497
  maxSelect: yt(t)
1498
1498
  };
1499
1499
  if (i === "relation") {
@@ -1508,13 +1508,13 @@ function rn(t, e, n, r, a) {
1508
1508
  n,
1509
1509
  h,
1510
1510
  f,
1511
- a
1511
+ o
1512
1512
  );
1513
1513
  return {
1514
1514
  type: "relation",
1515
1515
  name: t,
1516
1516
  title: s,
1517
- required: o,
1517
+ required: a,
1518
1518
  ...d,
1519
1519
  isCurrentUser: !1
1520
1520
  };
@@ -1526,13 +1526,13 @@ function rn(t, e, n, r, a) {
1526
1526
  n,
1527
1527
  h,
1528
1528
  f,
1529
- a
1529
+ o
1530
1530
  );
1531
1531
  return {
1532
1532
  type: "relation",
1533
1533
  name: t,
1534
1534
  title: s,
1535
- required: o,
1535
+ required: a,
1536
1536
  ...u,
1537
1537
  isCurrentUser: !1
1538
1538
  };
@@ -1546,13 +1546,13 @@ function rn(t, e, n, r, a) {
1546
1546
  n,
1547
1547
  h,
1548
1548
  f,
1549
- a
1549
+ o
1550
1550
  );
1551
1551
  return {
1552
1552
  type: "relation",
1553
1553
  name: t,
1554
1554
  title: s,
1555
- required: o,
1555
+ required: a,
1556
1556
  collectionId: l.collectionId,
1557
1557
  displayField: l.displayField,
1558
1558
  relatedModel: l.relatedModel,
@@ -1579,7 +1579,7 @@ function rn(t, e, n, r, a) {
1579
1579
  "select",
1580
1580
  "file",
1581
1581
  "relation",
1582
- ...a.features.auth ? ["current_user"] : [],
1582
+ ...o.features.auth ? ["current_user"] : [],
1583
1583
  ...m
1584
1584
  ])
1585
1585
  ];
@@ -1598,31 +1598,31 @@ function rn(t, e, n, r, a) {
1598
1598
  throw new Error(
1599
1599
  `Invalid field type: ${i}. Valid types are: ${x.join(", ").replace("relation", "references")}`
1600
1600
  );
1601
- return { type: i, name: t, title: s, required: o };
1601
+ return { type: i, name: t, title: s, required: a };
1602
1602
  }
1603
- function an(t, e, n, r) {
1604
- const a = [];
1603
+ function tn(t, e, n, r) {
1604
+ const o = [];
1605
1605
  for (const i of t) {
1606
- const [o, c] = tn(i);
1607
- if (!o || !c)
1606
+ const [a, c] = Ye(i);
1607
+ if (!a || !c)
1608
1608
  throw new Error(
1609
1609
  `Invalid field format: ${i}. Expected format: name:type or name:type!`
1610
1610
  );
1611
- if (!/^[a-zA-Z][a-zA-Z0-9]*$/.test(o))
1611
+ if (!/^[a-zA-Z][a-zA-Z0-9]*$/.test(a))
1612
1612
  throw new Error(
1613
- `Invalid field name: ${o}. Must start with a letter and contain only alphanumeric characters`
1613
+ `Invalid field name: ${a}. Must start with a letter and contain only alphanumeric characters`
1614
1614
  );
1615
- const m = nn(c);
1616
- a.push(rn(o, m, e, n, r));
1615
+ const m = Ze(c);
1616
+ o.push(Qe(a, m, e, n, r));
1617
1617
  }
1618
- const s = r.features.auth ? Qe(
1618
+ const s = r.features.auth ? Xe(
1619
1619
  [
1620
1620
  ...n,
1621
1621
  {
1622
1622
  id: "new",
1623
1623
  name: e.tableName,
1624
1624
  type: "base",
1625
- fields: a.map((i) => ({
1625
+ fields: o.map((i) => ({
1626
1626
  name: i.name,
1627
1627
  type: i.type,
1628
1628
  collectionId: i.type === "relation" ? i.collectionId : void 0,
@@ -1632,20 +1632,20 @@ function an(t, e, n, r) {
1632
1632
  ],
1633
1633
  e.tableName
1634
1634
  ) : void 0;
1635
- return { fields: a, auth: s };
1635
+ return { fields: o, auth: s };
1636
1636
  }
1637
1637
  async function W(t, e, n) {
1638
1638
  let r;
1639
1639
  if (n.env === "runtime") {
1640
- const { getCollections: a } = await import("./env.runtime-wPrXEoHB.js");
1641
- r = await a();
1640
+ const { getCollections: o } = await import("./env.runtime-C0w1qoWl.js");
1641
+ r = await o();
1642
1642
  } else {
1643
- const { getPreviewCollections: a } = await import("./env.preview-HlXZOEL4.js");
1644
- r = a(n);
1643
+ const { getPreviewCollections: o } = await import("./env.preview-HlXZOEL4.js");
1644
+ r = o(n);
1645
1645
  }
1646
- return an(t, e, r, n);
1646
+ return tn(t, e, r, n);
1647
1647
  }
1648
- const on = "2024-01-01T00:00:00.000Z";
1648
+ const en = "2024-01-01T00:00:00.000Z";
1649
1649
  class B {
1650
1650
  constructor(e) {
1651
1651
  this.expression = e;
@@ -1659,7 +1659,7 @@ function Q(t) {
1659
1659
  ([n, r]) => `${JSON.stringify(n)}: ${tt(r)}`
1660
1660
  ).join(", ")} }`;
1661
1661
  }
1662
- function sn(t) {
1662
+ function nn(t) {
1663
1663
  switch (t) {
1664
1664
  case "text":
1665
1665
  case "number":
@@ -1695,11 +1695,11 @@ function sn(t) {
1695
1695
  return;
1696
1696
  }
1697
1697
  }
1698
- function A(t, e) {
1698
+ function D(t, e) {
1699
1699
  return t.replace("[id]", `\${${e}}`);
1700
1700
  }
1701
- function Ot(t, e, n) {
1702
- var r, a, s;
1701
+ function Nt(t, e, n) {
1702
+ var r, o, s;
1703
1703
  switch (t.type) {
1704
1704
  case "text":
1705
1705
  case "editor":
@@ -1709,7 +1709,7 @@ function Ot(t, e, n) {
1709
1709
  case "bool":
1710
1710
  return !0;
1711
1711
  case "date":
1712
- return on;
1712
+ return en;
1713
1713
  case "email":
1714
1714
  return `test-${t.name}@example.com`;
1715
1715
  case "password":
@@ -1721,7 +1721,7 @@ function Ot(t, e, n) {
1721
1721
  case "geoPoint":
1722
1722
  return n.forForm ? JSON.stringify({ lat: 40.7128, lon: -74.006 }) : { lat: 40.7128, lon: -74.006 };
1723
1723
  case "select": {
1724
- const i = ((a = (r = t.options) == null ? void 0 : r[0]) == null ? void 0 : a.value) ?? "default";
1724
+ const i = ((o = (r = t.options) == null ? void 0 : r[0]) == null ? void 0 : o.value) ?? "default";
1725
1725
  return t.maxSelect && t.maxSelect > 1 ? [i] : i;
1726
1726
  }
1727
1727
  case "relation": {
@@ -1739,69 +1739,69 @@ function Ot(t, e, n) {
1739
1739
  }
1740
1740
  function xt(t, e, n) {
1741
1741
  const r = {};
1742
- for (const a of t) {
1743
- if (a.type === "file" || a.type === "autodate")
1742
+ for (const o of t) {
1743
+ if (o.type === "file" || o.type === "autodate")
1744
1744
  continue;
1745
- if (n.authEnabled && a.type === "relation" && a.isCurrentUser) {
1746
- n.forForm || (r[a.name] = new B("context.user.id"));
1745
+ if (n.authEnabled && o.type === "relation" && o.isCurrentUser) {
1746
+ n.forForm || (r[o.name] = new B("context.user.id"));
1747
1747
  continue;
1748
1748
  }
1749
- const s = Ot(a, e, n);
1750
- s !== void 0 && (r[a.name] = s);
1749
+ const s = Nt(o, e, n);
1750
+ s !== void 0 && (r[o.name] = s);
1751
1751
  }
1752
1752
  return r;
1753
1753
  }
1754
- function ln(t, e, n) {
1755
- var a;
1754
+ function rn(t, e, n) {
1755
+ var o;
1756
1756
  const r = {};
1757
1757
  for (const s of t) {
1758
1758
  if (s.system || s.name === "id")
1759
1759
  continue;
1760
- const i = sn(s.type);
1760
+ const i = nn(s.type);
1761
1761
  if (!i || i === "file" || i === "autodate" || i === "relation" && !s.collectionId)
1762
1762
  continue;
1763
- let o;
1763
+ let a;
1764
1764
  if (i === "relation")
1765
- o = s.collectionId ? new B(
1765
+ a = s.collectionId ? new B(
1766
1766
  e[s.collectionId] ?? '"missing-relation-id"'
1767
1767
  ) : void 0;
1768
1768
  else if (i === "select") {
1769
- const c = ((a = s.values) == null ? void 0 : a[0]) ?? "default";
1770
- o = (s.maxSelect ?? 1) > 1 ? [c] : c;
1769
+ const c = ((o = s.values) == null ? void 0 : o[0]) ?? "default";
1770
+ a = (s.maxSelect ?? 1) > 1 ? [c] : c;
1771
1771
  } else
1772
- o = Ot(
1772
+ a = Nt(
1773
1773
  { name: s.name, type: i },
1774
1774
  e,
1775
1775
  { forForm: !1, authEnabled: n.features.auth }
1776
1776
  );
1777
- o !== void 0 && (r[s.name] = o);
1777
+ a !== void 0 && (r[s.name] = a);
1778
1778
  }
1779
1779
  return r;
1780
1780
  }
1781
- function cn(t) {
1781
+ function an(t) {
1782
1782
  t.email = new B(
1783
1783
  "`test-${Math.random().toString(36).slice(2)}@example.com`"
1784
1784
  ), t.password = "password", t.passwordConfirm = "password";
1785
1785
  }
1786
- function mn(t, e) {
1786
+ function on(t, e) {
1787
1787
  if (!t)
1788
1788
  return [];
1789
- const n = new Map(e.map((o) => [o.id, o])), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), s = [], i = (o) => {
1790
- if (r.has(o) || a.has(o))
1789
+ const n = new Map(e.map((a) => [a.id, a])), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = [], i = (a) => {
1790
+ if (r.has(a) || o.has(a))
1791
1791
  return;
1792
- const c = n.get(o);
1792
+ const c = n.get(a);
1793
1793
  if (c) {
1794
- a.add(o);
1794
+ o.add(a);
1795
1795
  for (const m of c.fields)
1796
1796
  m.type !== "relation" || !m.collectionId || i(m.collectionId);
1797
- a.delete(o), r.add(o), s.push(c);
1797
+ o.delete(a), r.add(a), s.push(c);
1798
1798
  }
1799
1799
  };
1800
- for (const o of t.fields)
1801
- o.type !== "relation" || !o.collectionId || i(o.collectionId);
1800
+ for (const a of t.fields)
1801
+ a.type !== "relation" || !a.collectionId || i(a.collectionId);
1802
1802
  return s;
1803
1803
  }
1804
- function un(t, e) {
1804
+ function sn(t, e) {
1805
1805
  if (!e.has(t))
1806
1806
  return e.add(t), t;
1807
1807
  let n = 2;
@@ -1810,7 +1810,7 @@ function un(t, e) {
1810
1810
  const r = `${t}${n}`;
1811
1811
  return e.add(r), r;
1812
1812
  }
1813
- function pn(t, e) {
1813
+ function ln(t, e) {
1814
1814
  return {
1815
1815
  id: `generated-${t.tableName}`,
1816
1816
  name: t.tableName,
@@ -1832,25 +1832,25 @@ function pn(t, e) {
1832
1832
  } : { name: n.name, type: n.type })
1833
1833
  };
1834
1834
  }
1835
- function qt(t, e, n, r) {
1836
- const a = r.find((l) => l.name === t.tableName) ?? pn(t, e), s = mn(a, r).filter(
1835
+ function Bt(t, e, n, r) {
1836
+ const o = r.find((l) => l.name === t.tableName) ?? ln(t, e), s = on(o, r).filter(
1837
1837
  (l) => !(n.features.auth && l.name === "users")
1838
- ), i = {}, o = [], c = /* @__PURE__ */ new Set();
1838
+ ), i = {}, a = [], c = /* @__PURE__ */ new Set();
1839
1839
  for (const l of s) {
1840
- const d = un(E(l.name, n).name, c);
1841
- o.push({ varName: d, collection: l }), i[l.id] = `${d}.id`;
1840
+ const d = sn(E(l.name, n).name, c);
1841
+ a.push({ varName: d, collection: l }), i[l.id] = `${d}.id`;
1842
1842
  }
1843
- const m = o.length ? `${o.map((l) => `let ${l.varName}: { id: string };`).join(`
1843
+ const m = a.length ? `${a.map((l) => `let ${l.varName}: { id: string };`).join(`
1844
1844
  `)}
1845
1845
 
1846
- ` : "", h = o.map(({ varName: l, collection: d }) => {
1847
- const w = ln(
1846
+ ` : "", h = a.map(({ varName: l, collection: d }) => {
1847
+ const w = rn(
1848
1848
  d.fields,
1849
1849
  i,
1850
1850
  n
1851
1851
  );
1852
- return d.type === "auth" && cn(w), `${l} = await context.admin.collection("${d.name}").create(${Q(w)});`;
1853
- }), f = o.slice().reverse().map(
1852
+ return d.type === "auth" && an(w), `${l} = await context.admin.collection("${d.name}").create(${Q(w)});`;
1853
+ }), f = a.slice().reverse().map(
1854
1854
  ({ varName: l, collection: d }) => `await context.admin.collection("${d.name}").delete(${l}.id);`
1855
1855
  ), g = n.features.auth ? "context.agent" : "context.request", x = n.features.auth ? `await context.agent.authenticateUser();
1856
1856
  ` : "";
@@ -1885,8 +1885,8 @@ function qt(t, e, n, r) {
1885
1885
  )
1886
1886
  };
1887
1887
  }
1888
- function dn(t, e, n, r, a) {
1889
- const { declarations: s, setupSection: i, requestAgent: o, modelDbData: c, modelFormData: m } = qt(t, n, r, a);
1888
+ function cn(t, e, n, r, o) {
1889
+ const { declarations: s, setupSection: i, requestAgent: a, modelDbData: c, modelFormData: m } = Bt(t, n, r, o);
1890
1890
  return p`
1891
1891
  import { afterEach, beforeEach, describe, expect, it } from "vitest";
1892
1892
 
@@ -1895,24 +1895,24 @@ function dn(t, e, n, r, a) {
1895
1895
 
1896
1896
  describe("GET ${e.list}", () => {
1897
1897
  it("should return a 200 status code", async (context) => {
1898
- const response = await ${o}.get("${e.list}");
1898
+ const response = await ${a}.get("${e.list}");
1899
1899
  expect(response.status).toBe(200);
1900
1900
  });
1901
1901
  });
1902
1902
 
1903
1903
  describe("GET ${e.new}", () => {
1904
1904
  it("should return a 200 status code", async (context) => {
1905
- const response = await ${o}.get("${e.new}");
1905
+ const response = await ${a}.get("${e.new}");
1906
1906
  expect(response.status).toBe(200);
1907
1907
  });
1908
1908
  });
1909
1909
 
1910
1910
  describe("POST ${e.new}", () => {
1911
1911
  it("should create a new ${t.displayName.toLowerCase()}", async (context) => {
1912
- const response = await ${o}.post("${e.new}").type("form").send(${m});
1912
+ const response = await ${a}.post("${e.new}").type("form").send(${m});
1913
1913
  expect(response.body.status).toBe(303);
1914
1914
 
1915
- const response2 = await ${o}.get(response.body.location);
1915
+ const response2 = await ${a}.get(response.body.location);
1916
1916
  expect(response2.status).toBe(200);
1917
1917
  });
1918
1918
  });
@@ -1920,12 +1920,12 @@ function dn(t, e, n, r, a) {
1920
1920
  describe("GET ${e.show}", () => {
1921
1921
  it("should return a 200 status code", async (context) => {
1922
1922
  const { id } = await context.admin.collection("${t.tableName}").create(${c});
1923
- const response = await ${o}.get(\`${A(e.show, "id")}\`);
1923
+ const response = await ${a}.get(\`${D(e.show, "id")}\`);
1924
1924
  expect(response.status).toBe(200);
1925
1925
  });
1926
1926
 
1927
1927
  it("should return a 404 status code", async (context) => {
1928
- const response = await ${o}.get("${e.show.replace("[id]", "non-existent")}");
1928
+ const response = await ${a}.get("${e.show.replace("[id]", "non-existent")}");
1929
1929
  expect(response.status).toBe(404);
1930
1930
  });
1931
1931
  });
@@ -1933,10 +1933,10 @@ function dn(t, e, n, r, a) {
1933
1933
  describe("POST ${e.show}", () => {
1934
1934
  it("should delete a ${t.displayName.toLowerCase()}", async (context) => {
1935
1935
  const { id } = await context.admin.collection("${t.tableName}").create(${c});
1936
- const response = await ${o}.post(\`${A(e.show, "id")}\`).type("form");
1936
+ const response = await ${a}.post(\`${D(e.show, "id")}\`).type("form");
1937
1937
  expect(response.body.status).toBe(303);
1938
1938
 
1939
- const response2 = await ${o}.get(\`${A(e.show, "id")}\`);
1939
+ const response2 = await ${a}.get(\`${D(e.show, "id")}\`);
1940
1940
  expect(response2.status).toBe(404);
1941
1941
  });
1942
1942
  });
@@ -1944,7 +1944,7 @@ function dn(t, e, n, r, a) {
1944
1944
  describe("GET ${e.edit}", () => {
1945
1945
  it("should return a 200 status code", async (context) => {
1946
1946
  const { id } = await context.admin.collection("${t.tableName}").create(${c});
1947
- const response = await ${o}.get(\`${A(e.edit, "id")}\`);
1947
+ const response = await ${a}.get(\`${D(e.edit, "id")}\`);
1948
1948
  expect(response.status).toBe(200);
1949
1949
  });
1950
1950
  });
@@ -1952,19 +1952,19 @@ function dn(t, e, n, r, a) {
1952
1952
  describe("POST ${e.edit}", () => {
1953
1953
  it("should update a ${t.displayName.toLowerCase()}", async (context) => {
1954
1954
  const { id } = await context.admin.collection("${t.tableName}").create(${c});
1955
- const response = await ${o}
1956
- .post(\`${A(e.edit, "id")}\`)
1955
+ const response = await ${a}
1956
+ .post(\`${D(e.edit, "id")}\`)
1957
1957
  .type("form")
1958
1958
  .send(${m});
1959
1959
  expect(response.body.status).toBe(303);
1960
- expect(response.body.location).toBe(\`${A(e.show, "id")}\`);
1960
+ expect(response.body.location).toBe(\`${D(e.show, "id")}\`);
1961
1961
  });
1962
1962
  });
1963
1963
  });
1964
1964
  `;
1965
1965
  }
1966
- function fn(t, e, n, r, a) {
1967
- const { declarations: s, setupSection: i, requestAgent: o, modelFormData: c } = qt(t, n, r, a);
1966
+ function mn(t, e, n, r, o) {
1967
+ const { declarations: s, setupSection: i, requestAgent: a, modelFormData: c } = Bt(t, n, r, o);
1968
1968
  return p`
1969
1969
  import { afterEach, beforeEach, describe, expect, it } from "vitest";
1970
1970
 
@@ -1973,52 +1973,46 @@ function fn(t, e, n, r, a) {
1973
1973
 
1974
1974
  describe("GET ${e}", () => {
1975
1975
  it("should return a 200 status code", async (context) => {
1976
- const response = await ${o}.get("${e}");
1976
+ const response = await ${a}.get("${e}");
1977
1977
  expect(response.status).toBe(200);
1978
1978
  });
1979
1979
  });
1980
1980
 
1981
1981
  describe("POST ${e}", () => {
1982
1982
  it("should submit the form successfully", async (context) => {
1983
- const response = await ${o}.post("${e}").type("form").send(${c});
1983
+ const response = await ${a}.post("${e}").type("form").send(${c});
1984
1984
  expect(response.body.status).toBe(200);
1985
1985
  });
1986
1986
  });
1987
1987
  });
1988
1988
  `;
1989
1989
  }
1990
- var $t = Object.freeze, hn = Object.defineProperty, gn = (t, e) => $t(hn(t, "raw", { value: $t(t.slice()) })), Ft;
1991
- const Ct = 2, bn = 3;
1992
- function vn(t, e) {
1993
- const n = t.replace(/^\/+|\/+$/g, ""), r = `${e}/${n}`, a = `/${n}`;
1990
+ var $t = Object.freeze, un = Object.defineProperty, pn = (t, e) => $t(un(t, "raw", { value: $t(t.slice()) })), Ft;
1991
+ function dn(t, e) {
1992
+ const n = t.replace(/^\/+|\/+$/g, ""), r = `${e}/${n}`, o = `/${n}`;
1994
1993
  return {
1995
1994
  pagePath: `${r}/new`,
1996
- pageUrl: `${a}/new`
1995
+ pageUrl: `${o}/new`
1997
1996
  };
1998
1997
  }
1999
- function wn(t) {
2000
- if (t.length <= Ct)
2001
- throw new Error(
2002
- "Invalid command arguments. Expected: generate form <model> <fields...>"
2003
- );
2004
- const [e, n] = t;
2005
- if (e !== "generate" || n !== "form")
1998
+ function fn(t) {
1999
+ const [e, ...n] = t;
2000
+ if (!e)
2006
2001
  throw new Error(
2007
- `Invalid command "${t.join(" ")}". Expected to start with "generate form".`
2002
+ "Invalid command arguments. Expected: <model> <fields...>"
2008
2003
  );
2009
- const r = t[Ct], a = t.slice(bn);
2010
- if (a.length === 0)
2004
+ if (n.length === 0)
2011
2005
  throw new Error("At least one field definition is required.");
2012
- return { modelPath: r, fields: a };
2006
+ return { modelPath: e, fields: n };
2013
2007
  }
2014
- function Ut(t) {
2008
+ function jt(t) {
2015
2009
  return t.some((e) => e.type === "file");
2016
2010
  }
2017
- function yn(t) {
2011
+ function hn(t) {
2018
2012
  return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t) ? t : `'${t}'`;
2019
2013
  }
2020
- function _t(t) {
2021
- const e = t.type === "select" ? `[${t.options.map((a) => JSON.stringify(a.value)).join(", ")}]` : "";
2014
+ function Ct(t) {
2015
+ const e = t.type === "select" ? `[${t.options.map((o) => JSON.stringify(o.value)).join(", ")}]` : "";
2022
2016
  let n;
2023
2017
  switch (t.type) {
2024
2018
  case "text":
@@ -2073,13 +2067,13 @@ function _t(t) {
2073
2067
  }
2074
2068
  return ["text"].includes(t.type) ? t.required ? `${n}.nonempty()` : `${n}.optional()` : t.required || t.type === "geoPoint" ? n : t.type === "file" && t.maxSelect <= 1 ? `${n}.optional().default("")` : `${n}.optional()`;
2075
2069
  }
2076
- function xn(t) {
2070
+ function gn(t) {
2077
2071
  const e = [];
2078
2072
  for (const n of t) {
2079
2073
  if (n.type === "file" && n.maxSelect > 1) {
2080
2074
  e.push({
2081
2075
  name: n.name,
2082
- schema: _t({ ...n, required: !1 })
2076
+ schema: Ct({ ...n, required: !1 })
2083
2077
  }), e.push({
2084
2078
  name: `${n.name}+`,
2085
2079
  schema: "z.instanceof(File).array().optional()"
@@ -2089,12 +2083,12 @@ function xn(t) {
2089
2083
  });
2090
2084
  continue;
2091
2085
  }
2092
- e.push({ name: n.name, schema: _t(n) });
2086
+ e.push({ name: n.name, schema: Ct(n) });
2093
2087
  }
2094
2088
  return e;
2095
2089
  }
2096
- function $n(t, e) {
2097
- const n = xn(e).map((r) => `${yn(r.name)}: ${r.schema}`).join(`,
2090
+ function bn(t, e) {
2091
+ const n = gn(e).map((r) => `${hn(r.name)}: ${r.schema}`).join(`,
2098
2092
  `);
2099
2093
  return p`
2100
2094
  import { z } from "zod/v3";
@@ -2104,7 +2098,7 @@ function $n(t, e) {
2104
2098
  });
2105
2099
  `;
2106
2100
  }
2107
- function Fn(t, e) {
2101
+ function vn(t, e) {
2108
2102
  const n = O(e), r = [
2109
2103
  'import { untrack } from "svelte";',
2110
2104
  'import { superForm } from "sveltekit-superforms";',
@@ -2114,10 +2108,10 @@ function Fn(t, e) {
2114
2108
  ];
2115
2109
  return [...new Set(r)];
2116
2110
  }
2117
- function Cn(t, e) {
2111
+ function wn(t, e) {
2118
2112
  const r = e.filter(
2119
- (a) => a.type === "select"
2120
- ).map((a) => At(a)).join(`
2113
+ (o) => o.type === "select"
2114
+ ).map((o) => Tt(o)).join(`
2121
2115
 
2122
2116
  `);
2123
2117
  return p`
@@ -2130,11 +2124,11 @@ function Cn(t, e) {
2130
2124
  const { form: formData } = form;
2131
2125
  `;
2132
2126
  }
2133
- function _n(t, e) {
2134
- const n = Fn(t, e).join(`
2135
- `), r = Cn(t, e), a = e.map((i) => et(i)).join(`
2136
- `), s = Ut(e) ? ' enctype="multipart/form-data"' : "";
2137
- return p(Ft || (Ft = gn([`
2127
+ function yn(t, e) {
2128
+ const n = vn(t, e).join(`
2129
+ `), r = wn(t, e), o = e.map((i) => et(i)).join(`
2130
+ `), s = jt(e) ? ' enctype="multipart/form-data"' : "";
2131
+ return p(Ft || (Ft = pn([`
2138
2132
  <script lang="ts">
2139
2133
  `, `
2140
2134
 
@@ -2157,10 +2151,10 @@ function _n(t, e) {
2157
2151
  </form>
2158
2152
  </div>
2159
2153
  </section>
2160
- `])), n, r, t.displayName, s, a);
2154
+ `])), n, r, t.displayName, s, o);
2161
2155
  }
2162
- function Sn(t, e) {
2163
- const n = Ut(e), r = p`
2156
+ function xn(t, e) {
2157
+ const n = jt(e), r = p`
2164
2158
  import { fail, superValidate${n ? ", withFiles" : ""} } from "sveltekit-superforms";
2165
2159
  import { zod } from "sveltekit-superforms/adapters";
2166
2160
  import { ${t.schemaName} } from "$lib/schemas/${t.name}";
@@ -2196,17 +2190,17 @@ function U(t, e) {
2196
2190
  content: e
2197
2191
  };
2198
2192
  }
2199
- async function kn(t) {
2200
- const { modelPath: e, fields: n } = wn(t.argv);
2193
+ async function $n(t) {
2194
+ const { modelPath: e, fields: n } = fn(t.argv);
2201
2195
  K(e);
2202
- const r = E(e, t), s = (await W(n, r, t)).fields, { pagePath: i, pageUrl: o } = vn(e, r.routesDir), c = t.env === "runtime" ? await (await import("./env.runtime-wPrXEoHB.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), m = [
2203
- U(`${i}/+page.svelte`, _n(r, s)),
2204
- U(`${i}/+page.server.ts`, Sn(r, s)),
2196
+ const r = E(e, t), s = (await W(n, r, t)).fields, { pagePath: i, pageUrl: a } = dn(e, r.routesDir), c = t.env === "runtime" ? await (await import("./env.runtime-C0w1qoWl.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), m = [
2197
+ U(`${i}/+page.svelte`, yn(r, s)),
2198
+ U(`${i}/+page.server.ts`, xn(r, s)),
2205
2199
  U(
2206
2200
  `${i}/server.test.ts`,
2207
- fn(r, o, s, t, c)
2201
+ mn(r, a, s, t, c)
2208
2202
  ),
2209
- U(`src/lib/schemas/${r.name}.ts`, $n(r, s))
2203
+ U(`src/lib/schemas/${r.name}.ts`, bn(r, s))
2210
2204
  ], h = O(s);
2211
2205
  return {
2212
2206
  creates: m,
@@ -2217,16 +2211,16 @@ async function kn(t) {
2217
2211
  collections: []
2218
2212
  };
2219
2213
  }
2220
- const Mn = "generate-form";
2221
- async function Rn(t) {
2222
- const e = await kn(t);
2214
+ const Fn = "generate-form";
2215
+ async function Cn(t) {
2216
+ const e = await $n(t);
2223
2217
  if (t.env !== "runtime")
2224
2218
  return k(e);
2225
2219
  const { writeResult: n } = await import("./write-result-DG5OAbe1.js");
2226
2220
  return n(await k(e), t);
2227
2221
  }
2228
- const Pn = {
2229
- slug: Mn,
2222
+ const _n = {
2223
+ slug: Fn,
2230
2224
  title: "Generate a form",
2231
2225
  summary: "Generates a form.",
2232
2226
  categories: ["forms"],
@@ -2237,8 +2231,8 @@ const Pn = {
2237
2231
  argv: ["contact", "name:text", "email:email", "message:editor"]
2238
2232
  },
2239
2233
  baseline: "velastack",
2240
- generate: Rn
2241
- }, En = ["text"], In = {
2234
+ generate: Cn
2235
+ }, Sn = ["text"], kn = {
2242
2236
  string: "text",
2243
2237
  boolean: "bool",
2244
2238
  geopoint: "geoPoint",
@@ -2265,11 +2259,11 @@ const Pn = {
2265
2259
  geoPoint: "geoPoint",
2266
2260
  relation: "relation"
2267
2261
  };
2268
- function Tn(t) {
2262
+ function Pn(t) {
2269
2263
  return /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t) ? t : `'${t}'`;
2270
2264
  }
2271
- function zn(t, e) {
2272
- const n = t.type === "select" ? `[${(t.options ?? []).map((a) => JSON.stringify(a.value)).join(", ")}]` : "";
2265
+ function Mn(t, e) {
2266
+ const n = t.type === "select" ? `[${(t.options ?? []).map((o) => JSON.stringify(o.value)).join(", ")}]` : "";
2273
2267
  let r;
2274
2268
  switch (t.type) {
2275
2269
  case "text":
@@ -2327,57 +2321,57 @@ function zn(t, e) {
2327
2321
  default:
2328
2322
  return t.type;
2329
2323
  }
2330
- return En.includes(t.type) ? t.required ? `${r}.nonempty()` : `${r}.optional()` : t.required || t.type === "geoPoint" ? r : t.type === "file" && (t.maxSelect ?? 1) <= 1 ? `${r}.optional().default("")` : `${r}.optional()`;
2324
+ return Sn.includes(t.type) ? t.required ? `${r}.nonempty()` : `${r}.optional()` : t.required || t.type === "geoPoint" ? r : t.type === "file" && (t.maxSelect ?? 1) <= 1 ? `${r}.optional().default("")` : `${r}.optional()`;
2331
2325
  }
2332
2326
  function ot(t, e, n) {
2333
2327
  const r = [];
2334
2328
  n.includeModelFields && (r.push({ name: "id", type: "text", required: !1 }), r.push({ name: "collectionId", type: "text", required: !1 }));
2335
- for (const o of e) {
2336
- if (o.type === "file" && o.maxSelect > 1) {
2337
- r.push({ ...o, required: !1 }), r.push({ name: `${o.name}+`, type: "file", required: !1, maxSelect: 999 }), r.push({ name: `${o.name}-`, type: "file", required: !1, maxSelect: 999 });
2329
+ for (const a of e) {
2330
+ if (a.type === "file" && a.maxSelect > 1) {
2331
+ r.push({ ...a, required: !1 }), r.push({ name: `${a.name}+`, type: "file", required: !1, maxSelect: 999 }), r.push({ name: `${a.name}-`, type: "file", required: !1, maxSelect: 999 });
2338
2332
  continue;
2339
2333
  }
2340
- r.push(o);
2334
+ r.push(a);
2341
2335
  }
2342
- const a = r.map((o) => `${Tn(o.name)}: ${zn(o, n)}`).join(`,
2336
+ const o = r.map((a) => `${Pn(a.name)}: ${Mn(a, n)}`).join(`,
2343
2337
  `), s = n.includeModelFields ? `
2344
2338
  import type { Schemas } from "pocketbase-svelte";` : "", i = n.includeModelFields ? ` satisfies Schemas["${t.tableName}"]` : "";
2345
2339
  return p`
2346
2340
  import { z } from "zod/v3";${s}
2347
2341
 
2348
2342
  export const ${t.schemaName} = z.object({
2349
- ${a}
2343
+ ${o}
2350
2344
  })${i};
2351
2345
  `;
2352
2346
  }
2353
- function Dn(t) {
2354
- const e = In[t];
2347
+ function Rn(t) {
2348
+ const e = kn[t];
2355
2349
  if (!e)
2356
2350
  throw new Error(`Unsupported collection field type "${t}" when generating from collection`);
2357
2351
  return e;
2358
2352
  }
2359
2353
  function st(t, e, n) {
2360
- const r = e.find((o) => o.name === t.tableName);
2354
+ const r = e.find((a) => a.name === t.tableName);
2361
2355
  if (!r)
2362
2356
  throw new Error(`Collection "${t.tableName}" not found`);
2363
- const a = Lt(e), s = new Map(e.map((o) => [o.id, o])), i = [];
2364
- for (const o of r.fields) {
2365
- if (o.name === "id" || o.system)
2357
+ const o = Dt(e), s = new Map(e.map((a) => [a.id, a])), i = [];
2358
+ for (const a of r.fields) {
2359
+ if (a.name === "id" || a.system)
2366
2360
  continue;
2367
- const c = Dn(o.type), m = !!o.required, h = rt(o.name);
2361
+ const c = Rn(a.type), m = !!a.required, h = rt(a.name);
2368
2362
  if (c === "relation") {
2369
- const f = o.collectionId ? s.get(o.collectionId) : void 0;
2363
+ const f = a.collectionId ? s.get(a.collectionId) : void 0;
2370
2364
  if (!f)
2371
2365
  continue;
2372
2366
  const g = E(f.name, n);
2373
2367
  i.push({
2374
- name: o.name,
2368
+ name: a.name,
2375
2369
  title: h,
2376
2370
  type: "relation",
2377
2371
  required: m,
2378
2372
  collectionId: f.id,
2379
- maxSelect: o.maxSelect ?? 1,
2380
- displayField: a[f.name] ?? "id",
2373
+ maxSelect: a.maxSelect ?? 1,
2374
+ displayField: o[f.name] ?? "id",
2381
2375
  relatedModel: g,
2382
2376
  singularRelationName: N(
2383
2377
  `${t.displayName} ${g.displayName}`
@@ -2385,62 +2379,62 @@ function st(t, e, n) {
2385
2379
  pluralRelationName: N(
2386
2380
  `${t.displayName} ${g.pluralDisplayName}`
2387
2381
  ),
2388
- isCurrentUser: n.features.auth && f.name === "users" && /user|owner|author/i.test(o.name)
2382
+ isCurrentUser: n.features.auth && f.name === "users" && /user|owner|author/i.test(a.name)
2389
2383
  });
2390
2384
  continue;
2391
2385
  }
2392
2386
  if (c === "select") {
2393
2387
  i.push({
2394
- name: o.name,
2388
+ name: a.name,
2395
2389
  title: h,
2396
2390
  type: "select",
2397
2391
  required: m,
2398
- maxSelect: o.maxSelect ?? 1,
2399
- options: (o.values ?? []).map((f) => ({ label: f, value: f }))
2392
+ maxSelect: a.maxSelect ?? 1,
2393
+ options: (a.values ?? []).map((f) => ({ label: f, value: f }))
2400
2394
  });
2401
2395
  continue;
2402
2396
  }
2403
2397
  if (c === "file") {
2404
2398
  i.push({
2405
- name: o.name,
2399
+ name: a.name,
2406
2400
  title: h,
2407
2401
  type: "file",
2408
2402
  required: m,
2409
- maxSelect: o.maxSelect ?? 1
2403
+ maxSelect: a.maxSelect ?? 1
2410
2404
  });
2411
2405
  continue;
2412
2406
  }
2413
2407
  if (c === "autodate") {
2414
2408
  i.push({
2415
- name: o.name,
2409
+ name: a.name,
2416
2410
  title: h,
2417
2411
  type: "autodate",
2418
2412
  required: m,
2419
- onCreate: o.onCreate ?? o.name.includes("create"),
2420
- onUpdate: o.onUpdate ?? o.name.includes("update")
2413
+ onCreate: a.onCreate ?? a.name.includes("create"),
2414
+ onUpdate: a.onUpdate ?? a.name.includes("update")
2421
2415
  });
2422
2416
  continue;
2423
2417
  }
2424
2418
  i.push({
2425
- name: o.name,
2419
+ name: a.name,
2426
2420
  title: h,
2427
2421
  type: c,
2428
2422
  required: m
2429
2423
  });
2430
2424
  }
2431
- return i.filter((o) => o.name !== "id");
2425
+ return i.filter((a) => a.name !== "id");
2432
2426
  }
2433
- function Vt(t) {
2427
+ function Lt(t) {
2434
2428
  const e = t.filter((n) => n.type === "relation").map((n) => n.name);
2435
2429
  return e.length > 0 ? e.join(",") : void 0;
2436
2430
  }
2437
- function Ht(t) {
2431
+ function Ot(t) {
2438
2432
  const e = /* @__PURE__ */ new Set(), n = [];
2439
2433
  for (const r of t)
2440
2434
  r.type === "relation" && (e.has(r.relatedModel.tableName) || (e.add(r.relatedModel.tableName), n.push(r.relatedModel)));
2441
2435
  return n;
2442
2436
  }
2443
- function An(t) {
2437
+ function En(t) {
2444
2438
  const e = {
2445
2439
  name: t.name,
2446
2440
  type: t.type,
@@ -2463,7 +2457,7 @@ function An(t) {
2463
2457
  onUpdate: t.onUpdate
2464
2458
  } : e;
2465
2459
  }
2466
- function Gt(t, e, n) {
2460
+ function qt(t, e, n) {
2467
2461
  const r = n ? {
2468
2462
  listRule: n.rule,
2469
2463
  viewRule: n.rule,
@@ -2475,71 +2469,65 @@ function Gt(t, e, n) {
2475
2469
  name: t.tableName,
2476
2470
  type: "base",
2477
2471
  ...r,
2478
- fields: e.map(An)
2472
+ fields: e.map(En)
2479
2473
  };
2480
2474
  }
2481
- const St = 2, Nn = 3;
2482
- function Bn(t) {
2483
- if (t.length <= St)
2484
- throw new Error(
2485
- "Invalid command arguments. Expected: generate resource <model> [fields...]"
2486
- );
2487
- const [e, n] = t;
2488
- if (e !== "generate" || n !== "resource")
2475
+ function Tn(t) {
2476
+ const [e, ...n] = t;
2477
+ if (!e)
2489
2478
  throw new Error(
2490
- `Invalid command "${t.join(" ")}". Expected to start with "generate resource".`
2479
+ "Invalid command arguments. Expected: <model> [fields...]"
2491
2480
  );
2492
- const r = t[St], a = t.slice(Nn);
2493
- return { modelPath: r, fields: a };
2481
+ return { modelPath: e, fields: n };
2494
2482
  }
2495
- function jn(t, e) {
2483
+ function zn(t, e) {
2496
2484
  return {
2497
2485
  path: t,
2498
2486
  language: j(t),
2499
2487
  content: e
2500
2488
  };
2501
2489
  }
2502
- async function Ln(t, e, n) {
2490
+ async function In(t, e, n) {
2503
2491
  K(e);
2504
2492
  const r = E(e, t);
2505
2493
  if (n.length > 0) {
2506
2494
  const i = await W(n, r, t);
2507
2495
  return { model: r, fields: i.fields, auth: i.auth, shouldCreateCollection: !0 };
2508
2496
  }
2509
- const a = t.env === "runtime" ? await (await import("./env.runtime-wPrXEoHB.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), s = st(r, a, t);
2497
+ const o = t.env === "runtime" ? await (await import("./env.runtime-C0w1qoWl.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), s = st(r, o, t);
2510
2498
  return { model: r, fields: s, auth: void 0, shouldCreateCollection: !1 };
2511
2499
  }
2512
- async function On(t) {
2513
- const { modelPath: e, fields: n } = Bn(t.argv), { model: r, fields: a, auth: s, shouldCreateCollection: i } = await Ln(
2500
+ async function An(t) {
2501
+ const { modelPath: e, fields: n } = Tn(t.argv), { model: r, fields: o, auth: s, shouldCreateCollection: i } = await In(
2514
2502
  t,
2515
2503
  e,
2516
2504
  n
2517
- ), o = `src/lib/schemas/${r.name}.ts`, c = ot(r, a, {
2505
+ ), a = `src/lib/schemas/${r.name}.ts`, c = ot(r, o, {
2518
2506
  includeModelFields: !0,
2519
2507
  forForm: !0
2520
2508
  });
2521
2509
  return {
2522
- creates: [jn(o, c)],
2510
+ creates: [zn(a, c)],
2523
2511
  modifies: [],
2524
2512
  deletes: [],
2525
2513
  components: [],
2526
2514
  packages: [],
2527
- collections: i ? [Gt(r, a, s)] : []
2515
+ collections: i ? [qt(r, o, s)] : []
2528
2516
  };
2529
2517
  }
2530
- const qn = "generate-resource";
2531
- async function Un(t) {
2532
- const e = await On(t);
2518
+ const Dn = "generate-resource";
2519
+ async function Nn(t) {
2520
+ const e = await An(t);
2533
2521
  if (t.env !== "runtime")
2534
2522
  return k(e);
2535
- const { createCollections: n } = await import("./collections-Q0--CN0k.js"), r = await n(e.collections, t), a = {
2523
+ const { createCollections: n } = await import("./collections-BaY_bexm.js"), r = await n(e.collections, t), o = {
2536
2524
  ...e,
2537
2525
  creates: [...e.creates, ...r]
2538
2526
  }, { writeResult: s } = await import("./write-result-DG5OAbe1.js");
2539
- return s(await k(a), t);
2527
+ return s(await k(o), t);
2540
2528
  }
2541
- const Vn = {
2542
- slug: qn,
2529
+ const Bn = {
2530
+ slug: Dn,
2543
2531
  title: "Generate a resource",
2544
2532
  summary: "Generates model schema resources.",
2545
2533
  categories: ["data"],
@@ -2550,22 +2538,16 @@ const Vn = {
2550
2538
  argv: ["contact", "name:text", "email:email"]
2551
2539
  },
2552
2540
  baseline: "velastack",
2553
- generate: Un
2541
+ generate: Nn
2554
2542
  };
2555
- var kt = Object.freeze, Hn = Object.defineProperty, X = (t, e) => kt(Hn(t, "raw", { value: kt(e || t.slice()) })), Mt, Rt, Pt, Et;
2556
- const It = 2, Gn = 3;
2557
- function Kn(t) {
2558
- if (t.length <= It)
2559
- throw new Error(
2560
- "Invalid command arguments. Expected: generate scaffold <model> [fields...]"
2561
- );
2562
- const [e, n] = t;
2563
- if (e !== "generate" || n !== "scaffold")
2543
+ var _t = Object.freeze, jn = Object.defineProperty, X = (t, e) => _t(jn(t, "raw", { value: _t(e || t.slice()) })), St, kt, Pt, Mt;
2544
+ function Ln(t) {
2545
+ const [e, ...n] = t;
2546
+ if (!e)
2564
2547
  throw new Error(
2565
- `Invalid command "${t.join(" ")}". Expected to start with "generate scaffold".`
2548
+ "Invalid command arguments. Expected: <model> [fields...]"
2566
2549
  );
2567
- const r = t[It], a = t.slice(Gn);
2568
- return { modelPath: r, fields: a };
2550
+ return { modelPath: e, fields: n };
2569
2551
  }
2570
2552
  function _(t, e) {
2571
2553
  return {
@@ -2574,32 +2556,32 @@ function _(t, e) {
2574
2556
  content: e
2575
2557
  };
2576
2558
  }
2577
- function Kt(t) {
2559
+ function Ut(t) {
2578
2560
  return t.some((e) => e.type === "file");
2579
2561
  }
2580
- function Wt(t) {
2562
+ function Vt(t) {
2581
2563
  return [...new Set(t.filter(Boolean))];
2582
2564
  }
2583
2565
  function it(t) {
2584
2566
  return t.filter(
2585
2567
  (e) => e.type === "select"
2586
- ).map((e) => At(e)).join(`
2568
+ ).map((e) => Tt(e)).join(`
2587
2569
 
2588
2570
  `);
2589
2571
  }
2590
- function Xt(t, e) {
2591
- return Ht(t).map(
2572
+ function Ht(t, e) {
2573
+ return Ot(t).map(
2592
2574
  (n) => `const ${n.pluralName} = await ${e}.collection("${n.tableName}").getFullList();`
2593
2575
  ).join(`
2594
2576
  `);
2595
2577
  }
2596
- function Yt(t) {
2597
- return Ht(t).map((e) => e.pluralName).join(", ");
2578
+ function Gt(t) {
2579
+ return Ot(t).map((e) => e.pluralName).join(", ");
2598
2580
  }
2599
- function Wn(t) {
2581
+ function On(t) {
2600
2582
  return t.features.auth ? "locals.pb" : "locals.admin";
2601
2583
  }
2602
- function Jt(t, e, n = !1) {
2584
+ function Kt(t, e, n = !1) {
2603
2585
  const r = it(e);
2604
2586
  return p`
2605
2587
  ${r}
@@ -2612,8 +2594,8 @@ function Jt(t, e, n = !1) {
2612
2594
  const { form: formData } = form;
2613
2595
  `;
2614
2596
  }
2615
- function Xn(t, e, n) {
2616
- const r = n.some((o) => o.type === "select"), a = Wt([
2597
+ function qn(t, e, n) {
2598
+ const r = n.some((a) => a.type === "select"), o = Vt([
2617
2599
  'import { untrack } from "svelte";',
2618
2600
  'import { superForm } from "sveltekit-superforms";',
2619
2601
  'import { zodClient } from "sveltekit-superforms/adapters";',
@@ -2624,9 +2606,9 @@ function Xn(t, e, n) {
2624
2606
  'import * as Form from "$lib/components/ui/form";',
2625
2607
  r ? 'import type { Models } from "pocketbase-svelte";' : ""
2626
2608
  ]).join(`
2627
- `), s = n.map((o) => et(o)).join(`
2628
- `), i = Kt(n) ? ' enctype="multipart/form-data"' : "";
2629
- return p(Mt || (Mt = X([`
2609
+ `), s = n.map((a) => et(a)).join(`
2610
+ `), i = Ut(n) ? ' enctype="multipart/form-data"' : "";
2611
+ return p(St || (St = X([`
2630
2612
  <script lang="ts">
2631
2613
  `, `
2632
2614
  `, `
@@ -2653,10 +2635,10 @@ function Xn(t, e, n) {
2653
2635
  </form>
2654
2636
  </div>
2655
2637
  </section>
2656
- `])), a, Jt(t, n), t.displayName.toLowerCase(), e.list, i, s, e.list);
2638
+ `])), o, Kt(t, n), t.displayName.toLowerCase(), e.list, i, s, e.list);
2657
2639
  }
2658
- function Yn(t, e, n) {
2659
- const r = n.some((o) => o.type === "select"), a = Wt([
2640
+ function Un(t, e, n) {
2641
+ const r = n.some((a) => a.type === "select"), o = Vt([
2660
2642
  'import { untrack } from "svelte";',
2661
2643
  'import { superForm } from "sveltekit-superforms";',
2662
2644
  'import { zodClient } from "sveltekit-superforms/adapters";',
@@ -2667,9 +2649,9 @@ function Yn(t, e, n) {
2667
2649
  'import * as Form from "$lib/components/ui/form";',
2668
2650
  r ? 'import type { Models } from "pocketbase-svelte";' : ""
2669
2651
  ]).join(`
2670
- `), s = n.map((o) => et(o)).join(`
2671
- `), i = Kt(n) ? ' enctype="multipart/form-data"' : "";
2672
- return p(Rt || (Rt = X([`
2652
+ `), s = n.map((a) => et(a)).join(`
2653
+ `), i = Ut(n) ? ' enctype="multipart/form-data"' : "";
2654
+ return p(kt || (kt = X([`
2673
2655
  <script lang="ts">
2674
2656
  `, `
2675
2657
  `, `
@@ -2723,20 +2705,20 @@ function Yn(t, e, n) {
2723
2705
  </form>
2724
2706
  </div>
2725
2707
  </section>
2726
- `])), a, Jt(t, n, !0), t.displayName.toLowerCase(), e.list, i, s, e.list);
2708
+ `])), o, Kt(t, n, !0), t.displayName.toLowerCase(), e.list, i, s, e.list);
2727
2709
  }
2728
- function Jn(t, e, n) {
2729
- const r = n.some((o) => o.type === "select"), a = r ? `${it(n)}` : "", s = n.map((o) => {
2710
+ function Vn(t, e, n) {
2711
+ const r = n.some((a) => a.type === "select"), o = r ? `${it(n)}` : "", s = n.map((a) => {
2730
2712
  let c = "{ getValue }", m = "{ value: getValue() }";
2731
- return o.type === "relation" && (c = "{ getValue, row }", m = `{ value: getValue(), expanded: row.original.expand?.${o.name}, displayField: "${o.displayField}" }`), o.type === "select" && (m = `{ value: getValue(), options: ${o.name}Labels }`), o.type === "file" && (c = "{ getValue, row }", m = "{ value: getValue(), collectionId: row.original.collectionId, id: row.original.id }"), p`
2732
- columnHelper.accessor("${o.name}", {
2733
- header: ({ column }) => renderComponent(ColumnHeader, { column, title: "${o.title}" }),
2734
- cell: (${c}) => renderComponent(Cells.${o.type.charAt(0).toUpperCase() + o.type.slice(1)}Cell, ${m})
2713
+ return a.type === "relation" && (c = "{ getValue, row }", m = `{ value: getValue(), expanded: row.original.expand?.${a.name}, displayField: "${a.displayField}" }`), a.type === "select" && (m = `{ value: getValue(), options: ${a.name}Labels }`), a.type === "file" && (c = "{ getValue, row }", m = "{ value: getValue(), collectionId: row.original.collectionId, id: row.original.id }"), p`
2714
+ columnHelper.accessor("${a.name}", {
2715
+ header: ({ column }) => renderComponent(ColumnHeader, { column, title: "${a.title}" }),
2716
+ cell: (${c}) => renderComponent(Cells.${a.type.charAt(0).toUpperCase() + a.type.slice(1)}Cell, ${m})
2735
2717
  })
2736
2718
  `;
2737
2719
  }).join(`,
2738
- `), i = n.filter((o) => o.type === "select").map(
2739
- (o) => `<FacetedFilter column={table.getColumn("${o.name}")!} title="${o.title}" options={Object.values(${o.name}Labels)} />`
2720
+ `), i = n.filter((a) => a.type === "select").map(
2721
+ (a) => `<FacetedFilter column={table.getColumn("${a.name}")!} title="${a.title}" options={Object.values(${a.name}Labels)} />`
2740
2722
  ).join(`
2741
2723
  `);
2742
2724
  return p(Pt || (Pt = X([`
@@ -3113,21 +3095,21 @@ function Jn(t, e, n) {
3113
3095
  <Pagination {table} />
3114
3096
  </div>
3115
3097
  </section>
3116
- `])), r ? 'import { FacetedFilter } from "$lib/components/ui/faceted-filter";' : "", a, t.tableName, s, n.length > 0 ? "," : "", e.list, e.list, e.list, t.pluralName, t.pluralDisplayName, e.new, t.displayName.toLowerCase(), t.pluralDisplayName.toLowerCase(), i, e.new, t.displayName.toLowerCase());
3098
+ `])), r ? 'import { FacetedFilter } from "$lib/components/ui/faceted-filter";' : "", o, t.tableName, s, n.length > 0 ? "," : "", e.list, e.list, e.list, t.pluralName, t.pluralDisplayName, e.new, t.displayName.toLowerCase(), t.pluralDisplayName.toLowerCase(), i, e.new, t.displayName.toLowerCase());
3117
3099
  }
3118
- function Zn(t, e, n) {
3119
- const r = Vt(e), a = r ? `{ expand: "${r}" }` : "";
3100
+ function Hn(t, e, n) {
3101
+ const r = Lt(e), o = r ? `{ expand: "${r}" }` : "";
3120
3102
  return p`
3121
3103
  export const load = async ({ locals }) => {
3122
- const ${t.pluralName} = await ${n}.collection("${t.tableName}").getFullList(${a});
3104
+ const ${t.pluralName} = await ${n}.collection("${t.tableName}").getFullList(${o});
3123
3105
  return { ${t.pluralName} };
3124
3106
  };
3125
3107
  `;
3126
3108
  }
3127
- function Qn(t, e, n, r, a) {
3128
- const s = Xt(n, r), i = Yt(n), o = i ? `, ${i}` : "", c = n.find(
3109
+ function Gn(t, e, n, r, o) {
3110
+ const s = Ht(n, r), i = Gt(n), a = i ? `, ${i}` : "", c = n.find(
3129
3111
  (h) => h.type === "relation" && h.isCurrentUser
3130
- ), m = a && c ? p`
3112
+ ), m = o && c ? p`
3131
3113
  {
3132
3114
  ...form.data,
3133
3115
  ${c.name}: locals.pb.authStore.record?.id
@@ -3142,7 +3124,7 @@ function Qn(t, e, n, r, a) {
3142
3124
 
3143
3125
  export const load = async ({ locals }) => {
3144
3126
  ${s}
3145
- return { form: await superValidate(zod(${t.schemaName}))${o} };
3127
+ return { form: await superValidate(zod(${t.schemaName}))${a} };
3146
3128
  };
3147
3129
 
3148
3130
  export const actions = {
@@ -3166,8 +3148,8 @@ function Qn(t, e, n, r, a) {
3166
3148
  };
3167
3149
  `;
3168
3150
  }
3169
- function tr(t, e, n, r) {
3170
- const a = Vt(n), s = a ? `, { expand: "${a}" }` : "";
3151
+ function Kn(t, e, n, r) {
3152
+ const o = Lt(n), s = o ? `, { expand: "${o}" }` : "";
3171
3153
  return p`
3172
3154
  import { error, redirect } from "@sveltejs/kit";
3173
3155
 
@@ -3188,17 +3170,17 @@ function tr(t, e, n, r) {
3188
3170
  };
3189
3171
  `;
3190
3172
  }
3191
- function er(t, e, n) {
3192
- const r = n.some((m) => m.type === "select"), a = n.some((m) => m.type === "relation"), s = n.some((m) => m.type === "file"), i = [
3173
+ function Wn(t, e, n) {
3174
+ const r = n.some((m) => m.type === "select"), o = n.some((m) => m.type === "relation"), s = n.some((m) => m.type === "file"), i = [
3193
3175
  'import { Button } from "$lib/components/ui/button";',
3194
3176
  'import ArrowLeftIcon from "@lucide/svelte/icons/arrow-left";',
3195
- r || a ? 'import { Badge } from "$lib/components/ui/badge";' : "",
3196
- a ? 'import CircleArrowRightIcon from "@lucide/svelte/icons/circle-arrow-right";' : "",
3177
+ r || o ? 'import { Badge } from "$lib/components/ui/badge";' : "",
3178
+ o ? 'import CircleArrowRightIcon from "@lucide/svelte/icons/circle-arrow-right";' : "",
3197
3179
  s ? 'import FileIcon from "@lucide/svelte/icons/file";' : ""
3198
3180
  ].filter(Boolean).join(`
3199
- `), o = it(n), c = n.map((m) => ke(t, m)).join(`
3181
+ `), a = it(n), c = n.map((m) => Fe(t, m)).join(`
3200
3182
  `);
3201
- return p(Et || (Et = X([`
3183
+ return p(Mt || (Mt = X([`
3202
3184
  <script lang="ts">
3203
3185
  `, `
3204
3186
  `, `
@@ -3230,10 +3212,10 @@ function er(t, e, n) {
3230
3212
  </div>
3231
3213
  </div>
3232
3214
  </section>
3233
- `])), i, o, t.displayName, e.list, c, e.list, t.name);
3215
+ `])), i, a, t.displayName, e.list, c, e.list, t.name);
3234
3216
  }
3235
- function nr(t, e, n, r) {
3236
- const a = Xt(n, r), s = Yt(n), i = s ? `, ${s}` : "";
3217
+ function Xn(t, e, n, r) {
3218
+ const o = Ht(n, r), s = Gt(n), i = s ? `, ${s}` : "";
3237
3219
  return p`
3238
3220
  import { error, fail, redirect } from "@sveltejs/kit";
3239
3221
  import { setPocketbaseErrors, setDefaultData } from "@velastack/pocketbase";
@@ -3248,7 +3230,7 @@ function nr(t, e, n, r) {
3248
3230
  } catch {
3249
3231
  throw error(404, "Not found");
3250
3232
  }
3251
- ${a}
3233
+ ${o}
3252
3234
  return { form: await superValidate(${t.name}, zod(${t.schemaName}))${i} };
3253
3235
  };
3254
3236
 
@@ -3274,9 +3256,9 @@ function nr(t, e, n, r) {
3274
3256
  };
3275
3257
  `;
3276
3258
  }
3277
- async function rr(t, e, n) {
3259
+ async function Yn(t, e, n) {
3278
3260
  K(e);
3279
- const r = E(e, t), a = t.env === "runtime" ? await (await import("./env.runtime-wPrXEoHB.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t);
3261
+ const r = E(e, t), o = t.env === "runtime" ? await (await import("./env.runtime-C0w1qoWl.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t);
3280
3262
  if (n.length > 0) {
3281
3263
  const i = await W(n, r, t);
3282
3264
  return {
@@ -3284,61 +3266,61 @@ async function rr(t, e, n) {
3284
3266
  fields: i.fields,
3285
3267
  auth: i.auth,
3286
3268
  shouldCreateCollection: !0,
3287
- collections: a
3269
+ collections: o
3288
3270
  };
3289
3271
  }
3290
- const s = st(r, a, t);
3272
+ const s = st(r, o, t);
3291
3273
  return {
3292
3274
  model: r,
3293
3275
  fields: s,
3294
3276
  auth: void 0,
3295
3277
  shouldCreateCollection: !1,
3296
- collections: a
3278
+ collections: o
3297
3279
  };
3298
3280
  }
3299
- async function ar(t) {
3300
- const { modelPath: e, fields: n } = Kn(t.argv), { model: r, fields: a, auth: s, shouldCreateCollection: i, collections: o } = await rr(t, e, n), c = Ge(r), m = Ke(r), h = Wn(t), f = a.filter(
3281
+ async function Jn(t) {
3282
+ const { modelPath: e, fields: n } = Ln(t.argv), { model: r, fields: o, auth: s, shouldCreateCollection: i, collections: a } = await Yn(t, e, n), c = qe(r), m = Ue(r), h = On(t), f = o.filter(
3301
3283
  (u) => !(u.type === "relation" && u.isCurrentUser)
3302
3284
  ), g = [
3303
3285
  _(
3304
3286
  `src/lib/schemas/${r.name}.ts`,
3305
- ot(r, a, {
3287
+ ot(r, o, {
3306
3288
  includeModelFields: !0,
3307
3289
  forForm: !0
3308
3290
  })
3309
3291
  ),
3310
3292
  _(
3311
3293
  `${c.list}/+page.server.ts`,
3312
- Zn(r, f, h)
3294
+ Hn(r, f, h)
3313
3295
  ),
3314
3296
  _(
3315
3297
  `${c.list}/+page.svelte`,
3316
- Jn(r, m, f)
3298
+ Vn(r, m, f)
3317
3299
  ),
3318
3300
  _(
3319
3301
  `${c.new}/+page.server.ts`,
3320
- Qn(r, m, f, h, t.features.auth)
3302
+ Gn(r, m, f, h, t.features.auth)
3321
3303
  ),
3322
- _(`${c.new}/+page.svelte`, Xn(r, m, f)),
3304
+ _(`${c.new}/+page.svelte`, qn(r, m, f)),
3323
3305
  _(
3324
3306
  `${c.show}/+page.server.ts`,
3325
- tr(r, m, f, h)
3307
+ Kn(r, m, f, h)
3326
3308
  ),
3327
3309
  _(
3328
3310
  `${c.show}/+page.svelte`,
3329
- er(r, m, f)
3311
+ Wn(r, m, f)
3330
3312
  ),
3331
3313
  _(
3332
3314
  `${c.edit}/+page.server.ts`,
3333
- nr(r, m, f, h)
3315
+ Xn(r, m, f, h)
3334
3316
  ),
3335
3317
  _(
3336
3318
  `${c.edit}/+page.svelte`,
3337
- Yn(r, m, f)
3319
+ Un(r, m, f)
3338
3320
  ),
3339
3321
  _(
3340
3322
  `${c.list}/server.test.ts`,
3341
- dn(r, m, a, t, o)
3323
+ cn(r, m, o, t, a)
3342
3324
  )
3343
3325
  ], x = [
3344
3326
  ...O(f),
@@ -3364,22 +3346,22 @@ async function ar(t) {
3364
3346
  deletes: [],
3365
3347
  components: [...new Set(x)],
3366
3348
  packages: [],
3367
- collections: i ? [Gt(r, a, s)] : []
3349
+ collections: i ? [qt(r, o, s)] : []
3368
3350
  };
3369
3351
  }
3370
- const or = "generate-scaffold";
3371
- async function sr(t) {
3372
- const e = await ar(t);
3352
+ const Zn = "generate-scaffold";
3353
+ async function Qn(t) {
3354
+ const e = await Jn(t);
3373
3355
  if (t.env !== "runtime")
3374
3356
  return k(e);
3375
- const { createCollections: n } = await import("./collections-Q0--CN0k.js"), r = await n(e.collections, t), a = {
3357
+ const { createCollections: n } = await import("./collections-BaY_bexm.js"), r = await n(e.collections, t), o = {
3376
3358
  ...e,
3377
3359
  creates: [...e.creates, ...r]
3378
3360
  }, { writeResult: s } = await import("./write-result-DG5OAbe1.js");
3379
- return s(await k(a), t);
3361
+ return s(await k(o), t);
3380
3362
  }
3381
- const ir = {
3382
- slug: or,
3363
+ const tr = {
3364
+ slug: Zn,
3383
3365
  title: "Generate a scaffold",
3384
3366
  summary: "Generates CRUD routes and schema.",
3385
3367
  categories: ["data", "forms"],
@@ -3390,49 +3372,44 @@ const ir = {
3390
3372
  argv: ["contact", "name:text", "email:email"]
3391
3373
  },
3392
3374
  baseline: "velastack",
3393
- generate: sr
3394
- }, Tt = 2, lr = 3;
3395
- function cr(t) {
3396
- if (t.length <= Tt)
3397
- throw new Error(
3398
- "Invalid command arguments. Expected: generate schema <model> [fields...]"
3399
- );
3400
- const [e, n] = t;
3401
- if (e !== "generate" || n !== "schema")
3375
+ generate: Qn
3376
+ };
3377
+ function er(t) {
3378
+ const [e, ...n] = t;
3379
+ if (!e)
3402
3380
  throw new Error(
3403
- `Invalid command "${t.join(" ")}". Expected to start with "generate schema".`
3381
+ "Invalid command arguments. Expected: <model> [fields...]"
3404
3382
  );
3405
- const r = t[Tt], a = t.slice(lr);
3406
- return { modelPath: r, fields: a };
3383
+ return { modelPath: e, fields: n };
3407
3384
  }
3408
- function mr(t, e) {
3385
+ function nr(t, e) {
3409
3386
  return {
3410
3387
  path: t,
3411
3388
  language: j(t),
3412
3389
  content: e
3413
3390
  };
3414
3391
  }
3415
- async function ur(t, e, n) {
3392
+ async function rr(t, e, n) {
3416
3393
  K(e);
3417
3394
  const r = E(e, t);
3418
3395
  if (n.length > 0) {
3419
3396
  const i = await W(n, r, t);
3420
3397
  return { model: r, fields: i.fields, includeModelFields: !1 };
3421
3398
  }
3422
- const a = t.env === "runtime" ? await (await import("./env.runtime-wPrXEoHB.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), s = st(r, a, t);
3399
+ const o = t.env === "runtime" ? await (await import("./env.runtime-C0w1qoWl.js")).getCollections() : (await import("./env.preview-HlXZOEL4.js")).getPreviewCollections(t), s = st(r, o, t);
3423
3400
  return { model: r, fields: s, includeModelFields: !0 };
3424
3401
  }
3425
- async function pr(t) {
3426
- const { modelPath: e, fields: n } = cr(t.argv), { model: r, fields: a, includeModelFields: s } = await ur(
3402
+ async function ar(t) {
3403
+ const { modelPath: e, fields: n } = er(t.argv), { model: r, fields: o, includeModelFields: s } = await rr(
3427
3404
  t,
3428
3405
  e,
3429
3406
  n
3430
- ), i = `src/lib/schemas/${r.name}.ts`, o = ot(r, a, {
3407
+ ), i = `src/lib/schemas/${r.name}.ts`, a = ot(r, o, {
3431
3408
  includeModelFields: s,
3432
3409
  forForm: !0
3433
3410
  });
3434
3411
  return {
3435
- creates: [mr(i, o)],
3412
+ creates: [nr(i, a)],
3436
3413
  modifies: [],
3437
3414
  deletes: [],
3438
3415
  components: [],
@@ -3440,16 +3417,16 @@ async function pr(t) {
3440
3417
  collections: []
3441
3418
  };
3442
3419
  }
3443
- const dr = "generate-schema";
3444
- async function fr(t) {
3445
- const e = await pr(t);
3420
+ const or = "generate-schema";
3421
+ async function sr(t) {
3422
+ const e = await ar(t);
3446
3423
  if (t.env !== "runtime")
3447
3424
  return k(e);
3448
3425
  const { writeResult: n } = await import("./write-result-DG5OAbe1.js");
3449
3426
  return n(await k(e), t);
3450
3427
  }
3451
- const hr = {
3452
- slug: dr,
3428
+ const ir = {
3429
+ slug: or,
3453
3430
  title: "Generate a schema",
3454
3431
  summary: "Generates a zod schema.",
3455
3432
  categories: ["data"],
@@ -3460,8 +3437,8 @@ const hr = {
3460
3437
  argv: ["contact", "name:text", "email:email"]
3461
3438
  },
3462
3439
  baseline: "velastack",
3463
- generate: fr
3464
- }, gr = `<script lang="ts" module>
3440
+ generate: sr
3441
+ }, lr = `<script lang="ts" module>
3465
3442
  import HomeIcon from '@lucide/svelte/icons/home';
3466
3443
 
3467
3444
  let data = {
@@ -3517,7 +3494,7 @@ const hr = {
3517
3494
  <NavUser {user} />
3518
3495
  </Sidebar.Footer>
3519
3496
  </Sidebar.Root>
3520
- `, br = `<script lang="ts">
3497
+ `, cr = `<script lang="ts">
3521
3498
  import type { Component } from 'svelte';
3522
3499
  import * as Sidebar from '$lib/components/ui/sidebar';
3523
3500
  import { page } from '$app/state';
@@ -3557,7 +3534,7 @@ const hr = {
3557
3534
  {/each}
3558
3535
  </Sidebar.Menu>
3559
3536
  </Sidebar.Group>
3560
- `, vr = `<script lang="ts" module>
3537
+ `, mr = `<script lang="ts" module>
3561
3538
  import Settings2Icon from '@lucide/svelte/icons/settings-2';
3562
3539
 
3563
3540
  let data = {
@@ -3676,7 +3653,7 @@ const hr = {
3676
3653
  </DropdownMenu.Root>
3677
3654
  </Sidebar.MenuItem>
3678
3655
  </Sidebar.Menu>
3679
- `, wr = `<script lang="ts">
3656
+ `, ur = `<script lang="ts">
3680
3657
  import { cn } from '$lib/utils';
3681
3658
  import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
3682
3659
  import { DropdownMenu as DropdownMenuPrimitive } from 'bits-ui';
@@ -3704,7 +3681,7 @@ const hr = {
3704
3681
  {@render children?.()}
3705
3682
  </div>
3706
3683
  {/if}
3707
- `, yr = `<script lang="ts">
3684
+ `, pr = `<script lang="ts">
3708
3685
  import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
3709
3686
  import { getContext } from 'svelte';
3710
3687
  import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
@@ -3720,7 +3697,7 @@ const hr = {
3720
3697
  {:else}
3721
3698
  {@render children?.()}
3722
3699
  {/if}
3723
- `, xr = `<script lang="ts">
3700
+ `, dr = `<script lang="ts">
3724
3701
  import { goto } from '$app/navigation';
3725
3702
  import * as DropdownMenu from '$lib/components/ui/dropdown-menu';
3726
3703
  import { Button } from '$lib/components/ui/button';
@@ -3756,7 +3733,7 @@ const hr = {
3756
3733
  {@render children?.()}
3757
3734
  </Button>
3758
3735
  {/if}
3759
- `, $r = `<script lang="ts">
3736
+ `, fr = `<script lang="ts">
3760
3737
  import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
3761
3738
  import { getContext } from 'svelte';
3762
3739
  import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
@@ -3770,7 +3747,7 @@ const hr = {
3770
3747
  {@render children?.()}
3771
3748
  </DropdownMenu.Label>
3772
3749
  {/if}
3773
- `, Fr = `<script lang="ts">
3750
+ `, hr = `<script lang="ts">
3774
3751
  import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
3775
3752
  import { getContext } from 'svelte';
3776
3753
  import { AUTH_MENU_CONTEXT_KEY, type AuthMenuContext } from './context.js';
@@ -3782,7 +3759,7 @@ const hr = {
3782
3759
  {#if isDesktop}
3783
3760
  <DropdownMenu.Separator {...restProps} />
3784
3761
  {/if}
3785
- `, Cr = `<script lang="ts">
3762
+ `, gr = `<script lang="ts">
3786
3763
  import { cn } from '$lib/utils';
3787
3764
  import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
3788
3765
  import { getContext } from 'svelte';
@@ -3796,7 +3773,7 @@ const hr = {
3796
3773
  {#if isDesktop}
3797
3774
  <DropdownMenu.Trigger class={cn('inline-flex', className)} {...restProps} />
3798
3775
  {/if}
3799
- `, _r = `<script lang="ts">
3776
+ `, br = `<script lang="ts">
3800
3777
  import { page } from '$app/state';
3801
3778
  import { browser } from '$app/environment';
3802
3779
  import { onMount, setContext } from 'svelte';
@@ -3842,12 +3819,12 @@ const hr = {
3842
3819
  {:else}
3843
3820
  {@render guest?.()}
3844
3821
  {/if}
3845
- `, Sr = `export type AuthMenuContext = {
3822
+ `, vr = `export type AuthMenuContext = {
3846
3823
  isDesktop: boolean;
3847
3824
  };
3848
3825
 
3849
3826
  export const AUTH_MENU_CONTEXT_KEY = Symbol('auth-menu-context');
3850
- `, kr = `import Root from './auth-menu.svelte';
3827
+ `, wr = `import Root from './auth-menu.svelte';
3851
3828
  import Content from './auth-menu-content.svelte';
3852
3829
  import Trigger from './auth-menu-trigger.svelte';
3853
3830
  import Group from './auth-menu-group.svelte';
@@ -3856,12 +3833,12 @@ import Separator from './auth-menu-separator.svelte';
3856
3833
  import Item from './auth-menu-item.svelte';
3857
3834
 
3858
3835
  export { Root, Content, Trigger, Group, Label, Separator, Item };
3859
- `, Mr = `import { z } from 'zod/v3';
3836
+ `, yr = `import { z } from 'zod/v3';
3860
3837
 
3861
3838
  export const changeEmailSchema = z.object({
3862
3839
  email: z.string().email()
3863
3840
  });
3864
- `, Rr = `import { z } from 'zod/v3';
3841
+ `, xr = `import { z } from 'zod/v3';
3865
3842
 
3866
3843
  export const changePasswordSchema = z
3867
3844
  .object({
@@ -3872,16 +3849,16 @@ export const changePasswordSchema = z
3872
3849
  message: "Passwords don't match",
3873
3850
  path: ['passwordConfirm']
3874
3851
  });
3875
- `, Pr = `import { z } from 'zod/v3';
3852
+ `, $r = `import { z } from 'zod/v3';
3876
3853
  export const confirmEmailChangeSchema = z.object({
3877
3854
  password: z.string()
3878
3855
  });
3879
- `, Er = `import { z } from 'zod/v3';
3856
+ `, Fr = `import { z } from 'zod/v3';
3880
3857
  export const confirmResetSchema = z.object({
3881
3858
  password: z.string(),
3882
3859
  passwordConfirm: z.string()
3883
3860
  });
3884
- `, Ir = `import { z } from 'zod/v3';
3861
+ `, Cr = `import { z } from 'zod/v3';
3885
3862
 
3886
3863
  const otpSchema = z.object({
3887
3864
  type: z.literal('otp'),
@@ -3900,35 +3877,35 @@ const oAuth2Schema = z.object({
3900
3877
  });
3901
3878
 
3902
3879
  export const loginSchema = z.discriminatedUnion('type', [otpSchema, passwordSchema, oAuth2Schema]);
3903
- `, Tr = `import { z } from 'zod/v3';
3880
+ `, _r = `import { z } from 'zod/v3';
3904
3881
  export const otpSchema = z.object({
3905
3882
  otp: z.string()
3906
3883
  });
3907
- `, zr = `import { z } from 'zod/v3';
3884
+ `, Sr = `import { z } from 'zod/v3';
3908
3885
 
3909
3886
  export const profileSchema = z.object({
3910
3887
  name: z.string().optional(),
3911
3888
  avatar: z.union([z.instanceof(File), z.string()]).optional(),
3912
3889
  emailVisibility: z.boolean().optional()
3913
3890
  });
3914
- `, Dr = `import { z } from 'zod/v3';
3891
+ `, kr = `import { z } from 'zod/v3';
3915
3892
  export const resetSchema = z.object({
3916
3893
  email: z.string().email()
3917
3894
  });
3918
- `, Ar = `import { z } from 'zod/v3';
3895
+ `, Pr = `import { z } from 'zod/v3';
3919
3896
 
3920
3897
  export const signupSchema = z.object({
3921
3898
  email: z.string().email(),
3922
3899
  password: z.string(),
3923
3900
  passwordConfirm: z.string()
3924
3901
  });
3925
- `, Nr = `export const load = ({ locals }) => {
3902
+ `, Mr = `export const load = ({ locals }) => {
3926
3903
  const user = locals.pb.authStore.record!;
3927
3904
  const breadcrumbs = [{ title: 'Home', url: '/dashboard' }];
3928
3905
 
3929
3906
  return { user, breadcrumbs };
3930
3907
  };
3931
- `, Br = `<script lang="ts">
3908
+ `, Rr = `<script lang="ts">
3932
3909
  import * as Sidebar from '$lib/components/ui/sidebar';
3933
3910
  import { Separator } from '$lib/components/ui/separator';
3934
3911
  import AppSidebar from '$lib/components/app-sidebar.svelte';
@@ -3978,7 +3955,7 @@ export const signupSchema = z.object({
3978
3955
  background-color: var(--color-sidebar);
3979
3956
  }
3980
3957
  </style>
3981
- `, jr = "", Lr = `import { describe, it, expect } from 'vitest';
3958
+ `, Er = "", Tr = `import { describe, it, expect } from 'vitest';
3982
3959
  import type { Match } from '@velastack/pocketbase';
3983
3960
  import type { RouteId } from './$types';
3984
3961
 
@@ -3995,14 +3972,14 @@ describe('dashboard', () => {
3995
3972
  expect(response.status).toBe(200);
3996
3973
  });
3997
3974
  });
3998
- `, Or = `export const load = async ({ parent }) => {
3975
+ `, zr = `export const load = async ({ parent }) => {
3999
3976
  const { breadcrumbs } = await parent();
4000
3977
 
4001
3978
  return {
4002
3979
  breadcrumbs: [...breadcrumbs, { title: 'Settings', url: '/settings' }]
4003
3980
  };
4004
3981
  };
4005
- `, qr = `import { superValidate, fail, withFiles } from 'sveltekit-superforms';
3982
+ `, Ir = `import { superValidate, fail, withFiles } from 'sveltekit-superforms';
4006
3983
  import { zod } from 'sveltekit-superforms/adapters';
4007
3984
  import { setFlash } from 'sveltekit-flash-message/server';
4008
3985
  import { profileSchema } from '$lib/schemas/profile';
@@ -4071,7 +4048,7 @@ export const actions = {
4071
4048
  return {};
4072
4049
  }
4073
4050
  };
4074
- `, Ur = `<script lang="ts">
4051
+ `, Ar = `<script lang="ts">
4075
4052
  import { untrack } from 'svelte';
4076
4053
  import { superForm } from 'sveltekit-superforms';
4077
4054
  import { zodClient } from 'sveltekit-superforms/adapters';
@@ -4349,7 +4326,7 @@ export const actions = {
4349
4326
  </form>
4350
4327
  </div>
4351
4328
  </div>
4352
- `, Vr = `import { fail, superValidate } from 'sveltekit-superforms';
4329
+ `, Dr = `import { fail, superValidate } from 'sveltekit-superforms';
4353
4330
  import { zod } from 'sveltekit-superforms/adapters';
4354
4331
  import { confirmEmailChangeSchema } from '$lib/schemas/confirmEmailChange';
4355
4332
  import { redirect } from '@sveltejs/kit';
@@ -4376,7 +4353,7 @@ export const actions = {
4376
4353
  return redirect(303, '/login');
4377
4354
  }
4378
4355
  };
4379
- `, Hr = `<script lang="ts">
4356
+ `, Nr = `<script lang="ts">
4380
4357
  import { untrack } from 'svelte';
4381
4358
  import { Button } from '$lib/components/ui/button';
4382
4359
  import * as Card from '$lib/components/ui/card';
@@ -4444,7 +4421,7 @@ export const actions = {
4444
4421
  </div>
4445
4422
  </div>
4446
4423
  </div>
4447
- `, Gr = `import { describe, it, expect } from 'vitest';
4424
+ `, Br = `import { describe, it, expect } from 'vitest';
4448
4425
  import type { Match } from '@velastack/pocketbase';
4449
4426
  import type { RouteId } from './$types';
4450
4427
 
@@ -4456,7 +4433,7 @@ describe('GET /confirm-email-change/[token]', () => {
4456
4433
  expect(response.status).toBe(200);
4457
4434
  });
4458
4435
  });
4459
- `, Kr = `import { fail, superValidate } from 'sveltekit-superforms';
4436
+ `, jr = `import { fail, superValidate } from 'sveltekit-superforms';
4460
4437
  import { zod } from 'sveltekit-superforms/adapters';
4461
4438
  import { confirmResetSchema } from '$lib/schemas/confirmReset';
4462
4439
  import { redirect } from '@sveltejs/kit';
@@ -4485,7 +4462,7 @@ export const actions = {
4485
4462
  return redirect(303, '/login');
4486
4463
  }
4487
4464
  };
4488
- `, Wr = `<script lang="ts">
4465
+ `, Lr = `<script lang="ts">
4489
4466
  import { untrack } from 'svelte';
4490
4467
  import { Button } from '$lib/components/ui/button';
4491
4468
  import * as Card from '$lib/components/ui/card';
@@ -4569,7 +4546,7 @@ export const actions = {
4569
4546
  </div>
4570
4547
  </div>
4571
4548
  </div>
4572
- `, Xr = `import { describe, it, expect } from 'vitest';
4549
+ `, Or = `import { describe, it, expect } from 'vitest';
4573
4550
  import type { Match } from '@velastack/pocketbase';
4574
4551
  import type { RouteId } from './$types';
4575
4552
 
@@ -4579,7 +4556,7 @@ describe('GET /confirm-reset/[token]', () => {
4579
4556
  expect(response.status).toBe(200);
4580
4557
  });
4581
4558
  });
4582
- `, Yr = `import { redirect } from '@sveltejs/kit';
4559
+ `, qr = `import { redirect } from '@sveltejs/kit';
4583
4560
  import { setFlash } from 'sveltekit-flash-message/server';
4584
4561
 
4585
4562
  export const GET = async ({ params, locals, cookies }) => {
@@ -4598,7 +4575,7 @@ export const GET = async ({ params, locals, cookies }) => {
4598
4575
  setFlash({ type: 'toast', message }, cookies);
4599
4576
  redirect(303, redirectPath);
4600
4577
  };
4601
- `, Jr = `import { describe, it, expect } from 'vitest';
4578
+ `, Ur = `import { describe, it, expect } from 'vitest';
4602
4579
  import type { Match } from '@velastack/pocketbase';
4603
4580
  import type { RouteId } from './$types';
4604
4581
 
@@ -4611,7 +4588,7 @@ describe('GET /confirm-verification/[token]', () => {
4611
4588
  expect(response.headers['location']).toBe('/login');
4612
4589
  });
4613
4590
  });
4614
- `, Zr = `import { fail, superValidate, message } from 'sveltekit-superforms';
4591
+ `, Vr = `import { fail, superValidate, message } from 'sveltekit-superforms';
4615
4592
  import { zod } from 'sveltekit-superforms/adapters';
4616
4593
  import { loginSchema } from '$lib/schemas/login';
4617
4594
  import { redirect } from '@sveltejs/kit';
@@ -4672,7 +4649,7 @@ export const actions = {
4672
4649
  redirect(303, redirectUrl);
4673
4650
  }
4674
4651
  };
4675
- `, Qr = `<script lang="ts">
4652
+ `, Hr = `<script lang="ts">
4676
4653
  import { untrack } from 'svelte';
4677
4654
  import { Button } from '$lib/components/ui/button';
4678
4655
  import * as Card from '$lib/components/ui/card';
@@ -4855,7 +4832,7 @@ export const actions = {
4855
4832
  </div>
4856
4833
  </div>
4857
4834
  </div>
4858
- `, ta = `import { describe, it, expect } from 'vitest';
4835
+ `, Gr = `import { describe, it, expect } from 'vitest';
4859
4836
  import * as devalue from 'devalue';
4860
4837
  import type { Match } from '@velastack/pocketbase';
4861
4838
  import type { RouteId } from './$types';
@@ -4902,14 +4879,14 @@ describe('POST /login', () => {
4902
4879
  expect(data.form.message.text).toBe('Failed to authenticate.');
4903
4880
  });
4904
4881
  });
4905
- `, ea = `import { redirect } from '@sveltejs/kit';
4882
+ `, Kr = `import { redirect } from '@sveltejs/kit';
4906
4883
 
4907
4884
  export const POST = ({ cookies, locals }) => {
4908
4885
  locals.pb.authStore.clear();
4909
4886
  locals.pb.authStore.clearCookie(cookies);
4910
4887
  throw redirect(303, '/');
4911
4888
  };
4912
- `, na = `import { describe, it, expect } from 'vitest';
4889
+ `, Wr = `import { describe, it, expect } from 'vitest';
4913
4890
  import type { Match } from '@velastack/pocketbase';
4914
4891
  import type { RouteId } from './$types';
4915
4892
 
@@ -4921,7 +4898,7 @@ describe('POST /logout', () => {
4921
4898
  expect(response.headers.location).toBe('/');
4922
4899
  });
4923
4900
  });
4924
- `, ra = `import { fail, message, superValidate } from 'sveltekit-superforms';
4901
+ `, Xr = `import { fail, message, superValidate } from 'sveltekit-superforms';
4925
4902
  import { zod } from 'sveltekit-superforms/adapters';
4926
4903
  import { otpSchema } from '$lib/schemas/otp';
4927
4904
  import { redirect } from '@sveltejs/kit';
@@ -4962,7 +4939,7 @@ export const actions = {
4962
4939
  redirect(303, redirectUrl);
4963
4940
  }
4964
4941
  };
4965
- `, aa = `<script lang="ts">
4942
+ `, Yr = `<script lang="ts">
4966
4943
  import { untrack } from 'svelte';
4967
4944
  import { Button } from '$lib/components/ui/button';
4968
4945
  import * as Card from '$lib/components/ui/card';
@@ -5028,7 +5005,7 @@ export const actions = {
5028
5005
  </div>
5029
5006
  </div>
5030
5007
  </div>
5031
- `, oa = `import { describe, it, expect } from 'vitest';
5008
+ `, Jr = `import { describe, it, expect } from 'vitest';
5032
5009
  import type { Match } from '@velastack/pocketbase';
5033
5010
  import type { RouteId } from './$types';
5034
5011
 
@@ -5048,7 +5025,7 @@ describe('POST /otp/[token]', () => {
5048
5025
  expect(response.body.status).toBe(400);
5049
5026
  });
5050
5027
  });
5051
- `, sa = `import { fail, superValidate } from 'sveltekit-superforms';
5028
+ `, Zr = `import { fail, superValidate } from 'sveltekit-superforms';
5052
5029
  import { zod } from 'sveltekit-superforms/adapters';
5053
5030
  import { resetSchema } from '$lib/schemas/reset';
5054
5031
  import { redirect } from '@sveltejs/kit';
@@ -5076,7 +5053,7 @@ export const actions = {
5076
5053
  return { form };
5077
5054
  }
5078
5055
  };
5079
- `, ia = `<script lang="ts">
5056
+ `, Qr = `<script lang="ts">
5080
5057
  import { untrack } from 'svelte';
5081
5058
  import { Button } from '$lib/components/ui/button';
5082
5059
  import * as Card from '$lib/components/ui/card';
@@ -5143,7 +5120,7 @@ export const actions = {
5143
5120
  </div>
5144
5121
  </div>
5145
5122
  </div>
5146
- `, la = `import { describe, it, expect } from 'vitest';
5123
+ `, ta = `import { describe, it, expect } from 'vitest';
5147
5124
  import type { Match } from '@velastack/pocketbase';
5148
5125
  import type { RouteId } from './$types';
5149
5126
 
@@ -5163,7 +5140,7 @@ describe('POST /reset', () => {
5163
5140
  expect(response.body.status).toBe(200);
5164
5141
  });
5165
5142
  });
5166
- `, ca = `import { redirect } from '@sveltejs/kit';
5143
+ `, ea = `import { redirect } from '@sveltejs/kit';
5167
5144
  import { fail, superValidate } from 'sveltekit-superforms';
5168
5145
  import { zod } from 'sveltekit-superforms/adapters';
5169
5146
  import { setFlash } from 'sveltekit-flash-message/server';
@@ -5219,7 +5196,7 @@ export const actions = {
5219
5196
  return redirect(303, redirectUrl);
5220
5197
  }
5221
5198
  };
5222
- `, ma = `<script lang="ts">
5199
+ `, na = `<script lang="ts">
5223
5200
  import { untrack } from 'svelte';
5224
5201
  import { Button } from '$lib/components/ui/button';
5225
5202
  import * as Card from '$lib/components/ui/card';
@@ -5386,7 +5363,7 @@ export const actions = {
5386
5363
  </div>
5387
5364
  </div>
5388
5365
  </div>
5389
- `, ua = `import { describe, it, expect } from 'vitest';
5366
+ `, ra = `import { describe, it, expect } from 'vitest';
5390
5367
  import type { Match } from '@velastack/pocketbase';
5391
5368
  import * as devalue from 'devalue';
5392
5369
  import type { RouteId } from './$types';
@@ -5442,67 +5419,67 @@ describe('POST /signup', () => {
5442
5419
  expect(data.form.errors.email[0]).toBe('Value must be unique.');
5443
5420
  });
5444
5421
  });
5445
- `, pa = /* @__PURE__ */ Object.assign({
5446
- "./creates/src/lib/components/app-sidebar.svelte": gr,
5447
- "./creates/src/lib/components/nav-main.svelte": br,
5448
- "./creates/src/lib/components/nav-user.svelte": vr,
5449
- "./creates/src/lib/components/ui/auth-menu/auth-menu-content.svelte": wr,
5450
- "./creates/src/lib/components/ui/auth-menu/auth-menu-group.svelte": yr,
5451
- "./creates/src/lib/components/ui/auth-menu/auth-menu-item.svelte": xr,
5452
- "./creates/src/lib/components/ui/auth-menu/auth-menu-label.svelte": $r,
5453
- "./creates/src/lib/components/ui/auth-menu/auth-menu-separator.svelte": Fr,
5454
- "./creates/src/lib/components/ui/auth-menu/auth-menu-trigger.svelte": Cr,
5455
- "./creates/src/lib/components/ui/auth-menu/auth-menu.svelte": _r,
5456
- "./creates/src/lib/components/ui/auth-menu/context.ts": Sr,
5457
- "./creates/src/lib/components/ui/auth-menu/index.ts": kr,
5458
- "./creates/src/lib/schemas/changeEmail.ts": Mr,
5459
- "./creates/src/lib/schemas/changePassword.ts": Rr,
5460
- "./creates/src/lib/schemas/confirmEmailChange.ts": Pr,
5461
- "./creates/src/lib/schemas/confirmReset.ts": Er,
5462
- "./creates/src/lib/schemas/login.ts": Ir,
5463
- "./creates/src/lib/schemas/otp.ts": Tr,
5464
- "./creates/src/lib/schemas/profile.ts": zr,
5465
- "./creates/src/lib/schemas/reset.ts": Dr,
5466
- "./creates/src/lib/schemas/signup.ts": Ar,
5467
- "./creates/src/routes/(app)/+layout.server.ts": Nr,
5468
- "./creates/src/routes/(app)/+layout.svelte": Br,
5469
- "./creates/src/routes/(app)/dashboard/+page.svelte": jr,
5470
- "./creates/src/routes/(app)/dashboard/server.test.ts": Lr,
5471
- "./creates/src/routes/(app)/settings/+layout.server.ts": Or,
5472
- "./creates/src/routes/(app)/settings/+page.server.ts": qr,
5473
- "./creates/src/routes/(app)/settings/+page.svelte": Ur,
5474
- "./creates/src/routes/(public)/confirm-email-change/[token]/+page.server.ts": Vr,
5475
- "./creates/src/routes/(public)/confirm-email-change/[token]/+page.svelte": Hr,
5476
- "./creates/src/routes/(public)/confirm-email-change/[token]/server.test.ts": Gr,
5477
- "./creates/src/routes/(public)/confirm-reset/[token]/+page.server.ts": Kr,
5478
- "./creates/src/routes/(public)/confirm-reset/[token]/+page.svelte": Wr,
5479
- "./creates/src/routes/(public)/confirm-reset/[token]/server.test.ts": Xr,
5480
- "./creates/src/routes/(public)/confirm-verification/[token]/+server.ts": Yr,
5481
- "./creates/src/routes/(public)/confirm-verification/[token]/server.test.ts": Jr,
5482
- "./creates/src/routes/(public)/login/+page.server.ts": Zr,
5483
- "./creates/src/routes/(public)/login/+page.svelte": Qr,
5484
- "./creates/src/routes/(public)/login/server.test.ts": ta,
5485
- "./creates/src/routes/(public)/logout/+server.ts": ea,
5486
- "./creates/src/routes/(public)/logout/server.test.ts": na,
5487
- "./creates/src/routes/(public)/otp/[token]/+page.server.ts": ra,
5488
- "./creates/src/routes/(public)/otp/[token]/+page.svelte": aa,
5489
- "./creates/src/routes/(public)/otp/[token]/server.test.ts": oa,
5490
- "./creates/src/routes/(public)/reset/+page.server.ts": sa,
5491
- "./creates/src/routes/(public)/reset/+page.svelte": ia,
5492
- "./creates/src/routes/(public)/reset/server.test.ts": la,
5493
- "./creates/src/routes/(public)/signup/+page.server.ts": ca,
5494
- "./creates/src/routes/(public)/signup/+page.svelte": ma,
5495
- "./creates/src/routes/(public)/signup/server.test.ts": ua
5496
- }), da = "./creates/";
5497
- async function fa(t) {
5498
- const e = Object.entries(pa).map(([a, s]) => {
5499
- const i = Dt(a, da);
5422
+ `, aa = /* @__PURE__ */ Object.assign({
5423
+ "./creates/src/lib/components/app-sidebar.svelte": lr,
5424
+ "./creates/src/lib/components/nav-main.svelte": cr,
5425
+ "./creates/src/lib/components/nav-user.svelte": mr,
5426
+ "./creates/src/lib/components/ui/auth-menu/auth-menu-content.svelte": ur,
5427
+ "./creates/src/lib/components/ui/auth-menu/auth-menu-group.svelte": pr,
5428
+ "./creates/src/lib/components/ui/auth-menu/auth-menu-item.svelte": dr,
5429
+ "./creates/src/lib/components/ui/auth-menu/auth-menu-label.svelte": fr,
5430
+ "./creates/src/lib/components/ui/auth-menu/auth-menu-separator.svelte": hr,
5431
+ "./creates/src/lib/components/ui/auth-menu/auth-menu-trigger.svelte": gr,
5432
+ "./creates/src/lib/components/ui/auth-menu/auth-menu.svelte": br,
5433
+ "./creates/src/lib/components/ui/auth-menu/context.ts": vr,
5434
+ "./creates/src/lib/components/ui/auth-menu/index.ts": wr,
5435
+ "./creates/src/lib/schemas/changeEmail.ts": yr,
5436
+ "./creates/src/lib/schemas/changePassword.ts": xr,
5437
+ "./creates/src/lib/schemas/confirmEmailChange.ts": $r,
5438
+ "./creates/src/lib/schemas/confirmReset.ts": Fr,
5439
+ "./creates/src/lib/schemas/login.ts": Cr,
5440
+ "./creates/src/lib/schemas/otp.ts": _r,
5441
+ "./creates/src/lib/schemas/profile.ts": Sr,
5442
+ "./creates/src/lib/schemas/reset.ts": kr,
5443
+ "./creates/src/lib/schemas/signup.ts": Pr,
5444
+ "./creates/src/routes/(app)/+layout.server.ts": Mr,
5445
+ "./creates/src/routes/(app)/+layout.svelte": Rr,
5446
+ "./creates/src/routes/(app)/dashboard/+page.svelte": Er,
5447
+ "./creates/src/routes/(app)/dashboard/server.test.ts": Tr,
5448
+ "./creates/src/routes/(app)/settings/+layout.server.ts": zr,
5449
+ "./creates/src/routes/(app)/settings/+page.server.ts": Ir,
5450
+ "./creates/src/routes/(app)/settings/+page.svelte": Ar,
5451
+ "./creates/src/routes/(public)/confirm-email-change/[token]/+page.server.ts": Dr,
5452
+ "./creates/src/routes/(public)/confirm-email-change/[token]/+page.svelte": Nr,
5453
+ "./creates/src/routes/(public)/confirm-email-change/[token]/server.test.ts": Br,
5454
+ "./creates/src/routes/(public)/confirm-reset/[token]/+page.server.ts": jr,
5455
+ "./creates/src/routes/(public)/confirm-reset/[token]/+page.svelte": Lr,
5456
+ "./creates/src/routes/(public)/confirm-reset/[token]/server.test.ts": Or,
5457
+ "./creates/src/routes/(public)/confirm-verification/[token]/+server.ts": qr,
5458
+ "./creates/src/routes/(public)/confirm-verification/[token]/server.test.ts": Ur,
5459
+ "./creates/src/routes/(public)/login/+page.server.ts": Vr,
5460
+ "./creates/src/routes/(public)/login/+page.svelte": Hr,
5461
+ "./creates/src/routes/(public)/login/server.test.ts": Gr,
5462
+ "./creates/src/routes/(public)/logout/+server.ts": Kr,
5463
+ "./creates/src/routes/(public)/logout/server.test.ts": Wr,
5464
+ "./creates/src/routes/(public)/otp/[token]/+page.server.ts": Xr,
5465
+ "./creates/src/routes/(public)/otp/[token]/+page.svelte": Yr,
5466
+ "./creates/src/routes/(public)/otp/[token]/server.test.ts": Jr,
5467
+ "./creates/src/routes/(public)/reset/+page.server.ts": Zr,
5468
+ "./creates/src/routes/(public)/reset/+page.svelte": Qr,
5469
+ "./creates/src/routes/(public)/reset/server.test.ts": ta,
5470
+ "./creates/src/routes/(public)/signup/+page.server.ts": ea,
5471
+ "./creates/src/routes/(public)/signup/+page.svelte": na,
5472
+ "./creates/src/routes/(public)/signup/server.test.ts": ra
5473
+ }), oa = "./creates/";
5474
+ async function sa(t) {
5475
+ const e = Object.entries(aa).map(([o, s]) => {
5476
+ const i = Et(o, oa);
5500
5477
  return {
5501
5478
  path: i,
5502
5479
  language: j(i),
5503
5480
  content: s
5504
5481
  };
5505
- }).sort((a, s) => a.path.localeCompare(s.path)), n = [
5482
+ }).sort((o, s) => o.path.localeCompare(s.path)), n = [
5506
5483
  "sidebar",
5507
5484
  "breadcrumb",
5508
5485
  "separator",
@@ -5587,7 +5564,7 @@ async function fa(t) {
5587
5564
  ]
5588
5565
  };
5589
5566
  }
5590
- const ha = `/// <reference path="../pb_data/types.d.ts" />
5567
+ const ia = `/// <reference path="../pb_data/types.d.ts" />
5591
5568
  migrate(
5592
5569
  (app) => {
5593
5570
  const collection = new Collection({
@@ -5773,7 +5750,7 @@ migrate(
5773
5750
  return app.delete(collection);
5774
5751
  }
5775
5752
  );
5776
- `, ga = `/// <reference path="../pb_data/types.d.ts" />
5753
+ `, la = `/// <reference path="../pb_data/types.d.ts" />
5777
5754
  migrate(
5778
5755
  (app) => {
5779
5756
  const collection = app.findCollectionByNameOrId('_pb_users_auth_');
@@ -5828,7 +5805,7 @@ migrate(
5828
5805
  return app.save(collection);
5829
5806
  }
5830
5807
  );
5831
- `, ba = `import {
5808
+ `, ca = `import {
5832
5809
  POCKETBASE_URL,
5833
5810
  POCKETBASE_SUPERUSER_EMAIL,
5834
5811
  POCKETBASE_SUPERUSER_PASSWORD
@@ -5841,7 +5818,7 @@ export const handle = handlePocketbase({
5841
5818
  superuserPassword: POCKETBASE_SUPERUSER_PASSWORD,
5842
5819
  auth: { protectedRoutes: ['/(app)'] }
5843
5820
  });
5844
- `, va = `<script lang="ts">
5821
+ `, ma = `<script lang="ts">
5845
5822
  import { toggleMode } from 'mode-watcher';
5846
5823
  import * as Navbar from '$lib/components/ui/navbar';
5847
5824
  import { Button } from '$lib/components/ui/button';
@@ -5943,26 +5920,26 @@ export const handle = handlePocketbase({
5943
5920
  @apply container mx-auto max-w-7xl px-4 py-8 w-full;
5944
5921
  }
5945
5922
  </style>
5946
- `, wa = `import { loadFlash } from "sveltekit-flash-message/server";
5923
+ `, ua = `import { loadFlash } from "sveltekit-flash-message/server";
5947
5924
 
5948
5925
  export const load = loadFlash(async ({ locals }) => {
5949
5926
  return {
5950
5927
  user: locals.pb.authStore.record,
5951
5928
  };
5952
5929
  });
5953
- `, ya = /* @__PURE__ */ Object.assign({
5954
- "./preview-modifies/migrations/1776099881_created_oauth_accounts.js": ha,
5955
- "./preview-modifies/migrations/1776099881_updated_users.js": ga,
5956
- "./preview-modifies/src/hooks.server.ts": ba,
5957
- "./preview-modifies/src/routes/(public)/root-layout.svelte": va,
5958
- "./preview-modifies/src/routes/+layout.server.ts": wa
5959
- }), xa = "./preview-modifies/";
5960
- async function $a(t) {
5961
- const e = Object.entries(ya).map(([n, r]) => {
5962
- const a = Dt(n, xa);
5930
+ `, pa = /* @__PURE__ */ Object.assign({
5931
+ "./preview-modifies/migrations/1776099881_created_oauth_accounts.js": ia,
5932
+ "./preview-modifies/migrations/1776099881_updated_users.js": la,
5933
+ "./preview-modifies/src/hooks.server.ts": ca,
5934
+ "./preview-modifies/src/routes/(public)/root-layout.svelte": ma,
5935
+ "./preview-modifies/src/routes/+layout.server.ts": ua
5936
+ }), da = "./preview-modifies/";
5937
+ async function fa(t) {
5938
+ const e = Object.entries(pa).map(([n, r]) => {
5939
+ const o = Et(n, da);
5963
5940
  return {
5964
- path: a,
5965
- language: j(a),
5941
+ path: o,
5942
+ language: j(o),
5966
5943
  content: r
5967
5944
  };
5968
5945
  }).sort((n, r) => n.path.localeCompare(r.path));
@@ -5975,18 +5952,18 @@ async function $a(t) {
5975
5952
  collections: []
5976
5953
  };
5977
5954
  }
5978
- const Fa = "enable-auth";
5979
- async function Ca(t) {
5980
- const e = await fa(t);
5955
+ const ha = "enable-auth";
5956
+ async function ga(t) {
5957
+ const e = await sa(t);
5981
5958
  if (t.env === "preview") {
5982
- const s = await $a();
5959
+ const s = await fa();
5983
5960
  return k(pt([e, s]));
5984
5961
  }
5985
- const { generate: n } = await import("./generate.runtime-BT46R-FS.js"), r = await n(t), { writeResult: a } = await import("./write-result-DG5OAbe1.js");
5986
- return a(await k(pt([e, r])), t);
5962
+ const { generate: n } = await import("./generate.runtime-vKonp83V.js"), r = await n(t), { writeResult: o } = await import("./write-result-DG5OAbe1.js");
5963
+ return o(await k(pt([e, r])), t);
5987
5964
  }
5988
- const _a = {
5989
- slug: Fa,
5965
+ const ba = {
5966
+ slug: ha,
5990
5967
  title: "Enable authentication",
5991
5968
  summary: "Enables authentication.",
5992
5969
  categories: ["authentication"],
@@ -6004,26 +5981,26 @@ const _a = {
6004
5981
  argv: []
6005
5982
  },
6006
5983
  baseline: "velastack",
6007
- generate: Ca
6008
- }, Zt = [
6009
- Pn,
6010
- hr,
6011
- Vn,
5984
+ generate: ga
5985
+ }, Wt = [
5986
+ _n,
6012
5987
  ir,
6013
- _a
6014
- ], Sa = Zt.reduce(
5988
+ Bn,
5989
+ tr,
5990
+ ba
5991
+ ], va = Wt.reduce(
6015
5992
  (t, e) => (t[e.slug] = e, t),
6016
5993
  {}
6017
- ), Ia = {
5994
+ ), Ca = {
6018
5995
  version: "0.1.0",
6019
- patterns: Zt,
6020
- bySlug: Sa
5996
+ patterns: Wt,
5997
+ bySlug: va
6021
5998
  };
6022
5999
  export {
6023
- Pa as D,
6024
- Ea as M,
6000
+ $a as D,
6001
+ Fa as M,
6025
6002
  p as d,
6026
- Ia as i,
6003
+ Ca as i,
6027
6004
  j as l
6028
6005
  };
6029
- //# sourceMappingURL=index-CbDX3h_c.js.map
6006
+ //# sourceMappingURL=index-CDgw5XzM.js.map