@seedprotocol/react 0.4.15 → 0.4.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,72 +1,71 @@
1
- import Te, { useState as w, useRef as _, useMemo as D, useEffect as I, useCallback as x } from "react";
2
- import { flushSync as ce } from "react-dom";
3
- import { getClient as ye, ClientManagerState as F, BaseDb as W, Item as Ne, getAddressesForItemsFilter as Ve, seeds as A, getVersionData as Ke, createNewItem as je, ItemProperty as ne, metadata as T, appState as de, Schema as me, schemas as G, loadAllSchemasFromDb as We, SEED_PROTOCOL_SCHEMA_NAME as Je, Model as se, models as ie, modelSchemas as ge, ModelProperty as ue, properties as Z, getPropertySchema as ke, getSchemaNameFromId as Ge, BaseFileManager as j, eventEmitter as V, client as Ye } from "@seedprotocol/sdk";
4
- import { orderBy as Xe, debounce as $e, startCase as De } from "lodash-es";
1
+ import Te, { useState as w, useRef as F, useMemo as D, useEffect as I, useCallback as x, useLayoutEffect as Ve } from "react";
2
+ import { flushSync as de } from "react-dom";
3
+ import { getClient as me, ClientManagerState as C, BaseDb as W, Item as Ne, getAddressesForItemsFilter as Ke, seeds as A, getVersionData as je, createNewItem as We, ItemProperty as se, metadata as T, appState as ue, Schema as he, schemas as Y, loadAllSchemasFromDb as Ge, SEED_PROTOCOL_SCHEMA_NAME as Je, Model as oe, models as ae, modelSchemas as ge, ModelProperty as fe, properties as ee, getPropertySchema as ke, getSchemaNameFromId as Ye, BaseFileManager as j, eventEmitter as K, client as Xe } from "@seedprotocol/sdk";
4
+ import { orderBy as Ze, debounce as $e, startCase as _e } from "lodash-es";
5
5
  import J from "debug";
6
6
  import { useSelector as we } from "@xstate/react";
7
- import { or as ee, isNull as ae, eq as O, inArray as _e, sql as Ze, isNotNull as Ie, and as Ee, gt as et, like as Be, desc as tt } from "drizzle-orm";
8
- import { toSnakeCase as rt } from "drizzle-orm/casing";
9
- import { useQueryClient as Y, useQuery as X, QueryClient as nt, QueryClientProvider as st } from "@tanstack/react-query";
10
- import ot from "pluralize";
11
- import { jsxs as $, jsx as S } from "react/jsx-runtime";
12
- const H = () => {
13
- const r = ye().getService();
14
- return we(r, (n) => n.value === F.IDLE);
7
+ import { or as te, isNull as le, eq as O, inArray as De, sql as et, isNotNull as Ie, and as Ee, gt as tt, like as Be, desc as rt } from "drizzle-orm";
8
+ import { toSnakeCase as nt } from "drizzle-orm/casing";
9
+ import { useQueryClient as X, useQuery as Z, QueryClient as st, QueryClientProvider as ot } from "@tanstack/react-query";
10
+ import it from "pluralize";
11
+ import { jsxs as U, jsx as S } from "react/jsx-runtime";
12
+ const z = () => {
13
+ const r = me().getService();
14
+ return we(r, (n) => n.value === C.IDLE);
15
15
  };
16
- function oe(e) {
17
- const [r, t] = w(void 0), n = _(null), i = _(void 0), c = H(), o = D(() => {
18
- if (!c || !e)
16
+ function ie(e) {
17
+ const [r, t] = w(void 0), n = F(null), i = z(), a = D(() => {
18
+ if (!i || !e)
19
19
  return null;
20
20
  try {
21
21
  return W.liveQuery(e);
22
- } catch (l) {
23
- return console.error("[useLiveQuery] Failed to create live query:", l), null;
22
+ } catch (o) {
23
+ return console.error("[useLiveQuery] Failed to create live query:", o), null;
24
24
  }
25
- }, [e, c]);
25
+ }, [e, i]);
26
26
  return I(() => {
27
- if (n.current && (n.current.unsubscribe(), n.current = null), !o)
27
+ if (n.current && (n.current.unsubscribe(), n.current = null), !a)
28
28
  return;
29
- const l = o.subscribe({
30
- next: (a) => {
31
- const s = i.current, d = s ? JSON.stringify(s) : "undefined", u = a ? JSON.stringify(a) : "undefined";
32
- d === u && s !== void 0 || (i.current = a, t(a));
29
+ const o = a.subscribe({
30
+ next: (l) => {
31
+ t(l !== void 0 ? [...l] : void 0);
33
32
  },
34
- error: (a) => {
35
- console.error("[useLiveQuery] Error:", a);
33
+ error: (l) => {
34
+ console.error("[useLiveQuery] Error:", l);
36
35
  }
37
36
  });
38
- return n.current = l, () => {
37
+ return n.current = o, () => {
39
38
  n.current && (n.current.unsubscribe(), n.current = null);
40
39
  };
41
- }, [o]), r;
40
+ }, [a]), r;
42
41
  }
43
- const fe = J("seedSdk:react:item"), Kt = ({ modelName: e, seedLocalId: r, seedUid: t }) => {
44
- const [n, i] = w(), [c, o] = w(!!(r || t)), [l, a] = w(null), s = _(void 0), d = _(!1), u = H(), f = _(e), h = _(r), b = _(t), v = D(() => u ? !!(h.current || b.current) : !1, [u, r, t]), p = x(async () => {
42
+ const pe = J("seedSdk:react:item"), jt = ({ modelName: e, seedLocalId: r, seedUid: t }) => {
43
+ const [n, i] = w(), [a, o] = w(!!(r || t)), [l, c] = w(null), s = F(void 0), d = F(!1), u = z(), f = F(e), h = F(r), b = F(t), v = D(() => u ? !!(h.current || b.current) : !1, [u, r, t]), p = x(async () => {
45
44
  if (!!!(u && (h.current || b.current))) {
46
- i(void 0), o(!1), a(null);
45
+ i(void 0), o(!1), c(null);
47
46
  return;
48
47
  }
49
48
  try {
50
- a(null);
49
+ c(null);
51
50
  const m = await Ne.find({
52
51
  modelName: f.current,
53
52
  seedLocalId: h.current,
54
53
  seedUid: b.current
55
54
  });
56
55
  if (!m) {
57
- fe("[useItem] [loadItem] no item found", f.current, h.current), i((E) => E && (E.seedLocalId && E.seedLocalId === h.current || E.seedUid && E.seedUid === b.current) ? E : void 0), o(!1), a(null);
56
+ pe("[useItem] [loadItem] no item found", f.current, h.current), i((E) => E && (E.seedLocalId && E.seedLocalId === h.current || E.seedUid && E.seedUid === b.current) ? E : void 0), o(!1), c(null);
58
57
  return;
59
58
  }
60
- i(m), o(!1), a(null);
59
+ i(m), o(!1), c(null);
61
60
  } catch (m) {
62
- fe("[useItem] Error loading item:", m), i(void 0), o(!1), a(m);
61
+ pe("[useItem] Error loading item:", m), i(void 0), o(!1), c(m);
63
62
  }
64
63
  }, [u]);
65
64
  return I(() => {
66
65
  f.current = e, h.current = r, b.current = t;
67
66
  }, [e, r, t]), I(() => {
68
67
  if (!v) {
69
- !r && !t && (i(void 0), o(!1), a(null));
68
+ !r && !t && (i(void 0), o(!1), c(null));
70
69
  return;
71
70
  }
72
71
  p();
@@ -77,43 +76,43 @@ const fe = J("seedSdk:react:item"), Kt = ({ modelName: e, seedLocalId: r, seedUi
77
76
  }
78
77
  s.current?.unsubscribe(), d.current = !1;
79
78
  const m = n.getService().subscribe((E) => {
80
- E && typeof E == "object" && "value" in E && (E.value === "idle" ? (d.current = !0, o(!1), a(null)) : E.value === "error" ? (a(new Error("Item service error")), o(!1)) : d.current && o(!0));
79
+ E && typeof E == "object" && "value" in E && (E.value === "idle" ? (d.current = !0, o(!1), c(null)) : E.value === "error" ? (c(new Error("Item service error")), o(!1)) : d.current && o(!0));
81
80
  });
82
81
  return s.current = m, () => {
83
82
  s.current?.unsubscribe(), s.current = void 0;
84
83
  };
85
84
  }, [n]), {
86
85
  item: n,
87
- isLoading: c,
86
+ isLoading: a,
88
87
  error: l
89
88
  };
90
- }, it = (e, r, t, n) => ["seed", "items", e ?? null, r ?? !1, t ?? !1, n ?? null], jt = ({
89
+ }, at = (e, r, t, n) => ["seed", "items", e ?? null, r ?? !1, t ?? !1, n ?? null], Wt = ({
91
90
  modelName: e,
92
91
  deleted: r = !1,
93
92
  includeEas: t = !1,
94
93
  addressFilter: n
95
94
  }) => {
96
- const i = H(), c = Y(), o = _(void 0), l = _([]), a = _(/* @__PURE__ */ new Set()), [s, d] = w(null);
95
+ const i = z(), a = X(), o = F(void 0), l = F([]), c = F(/* @__PURE__ */ new Set()), [s, d] = w(null);
97
96
  I(() => {
98
97
  if (n !== "owned" && n !== "watched") {
99
98
  d(null);
100
99
  return;
101
100
  }
102
101
  let m = !1;
103
- return Ve(n).then((E) => {
102
+ return Ke(n).then((E) => {
104
103
  m || d(E);
105
104
  }), () => {
106
105
  m = !0;
107
106
  };
108
107
  }, [n]);
109
108
  const u = D(
110
- () => it(e, r, t, n),
109
+ () => at(e, r, t, n),
111
110
  [e, r, t, n]
112
111
  ), {
113
112
  data: f = [],
114
113
  isLoading: h,
115
114
  error: b
116
- } = X({
115
+ } = Z({
117
116
  queryKey: u,
118
117
  queryFn: () => Ne.all(e, r, { waitForReady: !0, includeEas: t, addressFilter: n }),
119
118
  enabled: i
@@ -123,25 +122,25 @@ const fe = J("seedSdk:react:item"), Kt = ({ modelName: e, seedLocalId: r, seedUi
123
122
  if (!v || (n === "owned" || n === "watched") && s === null)
124
123
  return null;
125
124
  const m = [];
126
- t || m.push(ee(ae(A.uid), O(A.uid, ""))), e && m.push(O(A.type, rt(e))), n === "owned" ? s && s.length > 0 && m.push(
127
- ee(
128
- _e(A.publisher, s),
129
- ae(A.publisher)
125
+ t || m.push(te(le(A.uid), O(A.uid, ""))), e && m.push(O(A.type, nt(e))), n === "owned" ? s && s.length > 0 && m.push(
126
+ te(
127
+ De(A.publisher, s),
128
+ le(A.publisher)
130
129
  )
131
- ) : n === "watched" && (s && s.length > 0 ? m.push(_e(A.publisher, s)) : m.push(Ze`1=0`)), r ? m.push(
132
- ee(
130
+ ) : n === "watched" && (s && s.length > 0 ? m.push(De(A.publisher, s)) : m.push(et`1=0`)), r ? m.push(
131
+ te(
133
132
  Ie(A._markedForDeletion),
134
133
  O(A._markedForDeletion, 1)
135
134
  )
136
135
  ) : (m.push(
137
- ee(
138
- ae(A._markedForDeletion),
136
+ te(
137
+ le(A._markedForDeletion),
139
138
  O(A._markedForDeletion, 0)
140
139
  )
141
140
  ), m.push(
142
- ee(ae(A.revokedAt), O(A.revokedAt, 0))
141
+ te(le(A.revokedAt), O(A.revokedAt, 0))
143
142
  ));
144
- const E = Ke();
143
+ const E = je();
145
144
  return v.with(E).select({
146
145
  localId: A.localId,
147
146
  uid: A.uid,
@@ -150,31 +149,31 @@ const fe = J("seedSdk:react:item"), Kt = ({ modelName: e, seedLocalId: r, seedUi
150
149
  createdAt: A.createdAt,
151
150
  attestationCreatedAt: A.attestationCreatedAt,
152
151
  _markedForDeletion: A._markedForDeletion
153
- }).from(A).leftJoin(E, O(A.localId, E.seedLocalId)).where(Ee(et(E.versionsCount, 0), ...m)).groupBy(A.localId);
154
- }, [v, i, e, r, t, n, s]), y = oe(p);
152
+ }).from(A).leftJoin(E, O(A.localId, E.seedLocalId)).where(Ee(tt(E.versionsCount, 0), ...m)).groupBy(A.localId);
153
+ }, [v, i, e, r, t, n, s]), y = ie(p);
155
154
  return I(() => {
156
155
  if (!i || !y) return;
157
156
  const m = /* @__PURE__ */ new Set();
158
- for (const N of y) {
159
- const M = N.localId || N.uid;
160
- M && m.add(M);
157
+ for (const R of y) {
158
+ const N = R.localId || R.uid;
159
+ N && m.add(N);
161
160
  }
162
161
  const E = /* @__PURE__ */ new Set();
163
- for (const N of l.current) {
164
- const M = N.seedLocalId || N.seedUid;
165
- M && E.add(M);
162
+ for (const R of l.current) {
163
+ const N = R.seedLocalId || R.seedUid;
164
+ N && E.add(N);
166
165
  }
167
166
  if (m.size === 0 && E.size > 0) return;
168
- const g = a.current;
169
- if (g.size === m.size && [...g].every((N) => m.has(N)))
167
+ const g = c.current;
168
+ if (g.size === m.size && [...g].every((R) => m.has(R)))
170
169
  return;
171
- if (o.current = y, E.size === m.size && [...E].every((N) => m.has(N))) {
172
- a.current = new Set(m);
170
+ if (o.current = y, E.size === m.size && [...E].every((R) => m.has(R))) {
171
+ c.current = new Set(m);
173
172
  return;
174
173
  }
175
- a.current = new Set(m), c.invalidateQueries({ queryKey: u });
176
- }, [i, y, c, u]), {
177
- items: Xe(
174
+ c.current = new Set(m), a.invalidateQueries({ queryKey: u });
175
+ }, [i, y, a, u]), {
176
+ items: Ze(
178
177
  f,
179
178
  [
180
179
  (m) => m.lastVersionPublishedAt || m.attestationCreatedAt || m.createdAt
@@ -184,21 +183,21 @@ const fe = J("seedSdk:react:item"), Kt = ({ modelName: e, seedLocalId: r, seedUi
184
183
  isLoading: h,
185
184
  error: b
186
185
  };
187
- }, Wt = () => {
186
+ }, Gt = () => {
188
187
  const [e, r] = w(!1), [t, n] = w(null), i = x(() => n(null), []);
189
188
  return {
190
189
  createItem: x(
191
190
  async (o, l) => {
192
191
  if (e) {
193
- fe("[useCreateItem] [createItem] already creating item, skipping");
192
+ pe("[useCreateItem] [createItem] already creating item, skipping");
194
193
  return;
195
194
  }
196
- n(null), ce(() => r(!0));
195
+ n(null), de(() => r(!0));
197
196
  try {
198
- const a = l ?? {}, { seedLocalId: s } = await je({ modelName: o, ...a });
197
+ const c = l ?? {}, { seedLocalId: s } = await We({ modelName: o, ...c });
199
198
  return await Ne.find({ modelName: o, seedLocalId: s }) ?? void 0;
200
- } catch (a) {
201
- fe("[useCreateItem] Error creating item:", a), n(a instanceof Error ? a : new Error(String(a)));
199
+ } catch (c) {
200
+ pe("[useCreateItem] Error creating item:", c), n(c instanceof Error ? c : new Error(String(c)));
202
201
  return;
203
202
  } finally {
204
203
  queueMicrotask(() => r(!1));
@@ -211,8 +210,8 @@ const fe = J("seedSdk:react:item"), Kt = ({ modelName: e, seedLocalId: r, seedUi
211
210
  resetError: i
212
211
  };
213
212
  }, Jt = () => {
214
- const [e, r] = w(null), [t, n] = w(!1), [i, c] = w(null), o = _(void 0), l = x(() => c(null), []), a = x((s) => {
215
- s && (r(s), c(null), s.publish().catch(() => {
213
+ const [e, r] = w(null), [t, n] = w(!1), [i, a] = w(null), o = F(void 0), l = x(() => a(null), []), c = x((s) => {
214
+ s && (r(s), a(null), s.publish().catch(() => {
216
215
  }));
217
216
  }, []);
218
217
  return I(() => {
@@ -225,94 +224,100 @@ const fe = J("seedSdk:react:item"), Kt = ({ modelName: e, seedLocalId: r, seedUi
225
224
  const v = b?.value, p = b?.context;
226
225
  n(v === "publishing");
227
226
  const y = p?._publishError;
228
- c(y ? new Error(y.message) : null);
227
+ a(y ? new Error(y.message) : null);
229
228
  });
230
229
  o.current = d;
231
230
  const u = s.getSnapshot();
232
231
  n(u?.value === "publishing");
233
232
  const h = u?.context?._publishError;
234
- return c(h ? new Error(h.message) : null), () => {
233
+ return a(h ? new Error(h.message) : null), () => {
235
234
  o.current?.unsubscribe(), o.current = void 0;
236
235
  };
237
236
  }, [e]), {
238
- publishItem: a,
237
+ publishItem: c,
239
238
  isLoading: t,
240
239
  error: i,
241
240
  resetError: l
242
241
  };
243
- }, pe = J("seedSdk:react:property"), re = J("seedSdk:react:itemProperties");
242
+ }, ye = J("seedSdk:react:property"), ne = J("seedSdk:react:itemProperties");
244
243
  function Ue(e, r) {
245
- const t = H(), [n, i] = w(void 0), [c, o] = w(!1), [l, a] = w(null), s = _(void 0), [, d] = w(0), f = typeof e == "object" && e != null ? e : null, h = f?.itemId, b = f?.seedLocalId, v = f?.seedUid, p = f?.propertyName, y = typeof e == "string" ? e : h !== void 0 && h !== "" ? h : void 0, E = p ?? (typeof e == "string" ? r : void 0), g = D(() => {
246
- const M = y !== void 0 && y !== "" ? y : b, q = y !== void 0 && y !== "" ? void 0 : v;
247
- return (M != null || q != null) && E != null && E !== "" ? {
244
+ const t = z(), [n, i] = w(void 0), [a, o] = w(!1), [l, c] = w(null), s = F(void 0), [, d] = w(0), f = typeof e == "object" && e != null ? e : null, h = f?.itemId, b = f?.seedLocalId, v = f?.seedUid, p = f?.propertyName, y = typeof e == "string" ? e : h !== void 0 && h !== "" ? h : void 0, E = p ?? (typeof e == "string" ? r : void 0), g = D(() => {
245
+ const N = y !== void 0 && y !== "" ? y : b, H = y !== void 0 && y !== "" ? void 0 : v;
246
+ return (N != null || H != null) && E != null && E !== "" ? {
248
247
  type: "identifiers",
249
- seedLocalId: M ?? void 0,
250
- seedUid: q,
248
+ seedLocalId: N ?? void 0,
249
+ seedUid: H,
251
250
  propertyName: E
252
251
  } : null;
253
252
  }, [y, E, b, v]);
254
253
  D(() => g ? !!((g.seedLocalId || g.seedUid) && g.propertyName) : !1, [g]);
255
- const z = D(() => !t || !g ? !1 : !!((g.seedLocalId || g.seedUid) && g.propertyName), [t, g]), N = x(async () => {
254
+ const B = D(() => !t || !g ? !1 : !!((g.seedLocalId || g.seedUid) && g.propertyName), [t, g]);
255
+ Ve(() => {
256
+ B && o(!0);
257
+ }, [B]);
258
+ const R = x(async () => {
256
259
  if (!t || !g) {
257
- i(void 0), o(!1), a(null);
260
+ i(void 0), o(!1), c(null);
258
261
  return;
259
262
  }
260
263
  try {
261
- o(!0), a(null);
262
- const M = g.seedLocalId, q = g.seedUid;
263
- if (!M && !q) {
264
- i(void 0), o(!1), a(null);
264
+ o(!0), c(null);
265
+ const N = g.seedLocalId, H = g.seedUid;
266
+ if (!N && !H) {
267
+ i(void 0), o(!1), c(null);
265
268
  return;
266
269
  }
267
- const K = await ne.find({
270
+ const Q = await se.find({
268
271
  propertyName: g.propertyName,
269
- seedLocalId: M,
270
- seedUid: q
272
+ seedLocalId: N,
273
+ seedUid: H
271
274
  });
272
- if (!K) {
273
- pe(
274
- `[useItemProperty] [updateItemProperty] no property found for Item.${M || q}.${g.propertyName}`
275
- ), i(void 0), o(!1), a(null);
275
+ if (!Q) {
276
+ ye(
277
+ `[useItemProperty] [updateItemProperty] no property found for Item.${N || H}.${g.propertyName}`
278
+ ), i(void 0), o(!1), c(null);
276
279
  return;
277
280
  }
278
- i(K), o(!1), a(null);
279
- } catch (M) {
280
- pe("[useItemProperty] Error updating item property:", M), i(void 0), o(!1), a(M);
281
+ i(Q), o(!1), c(null);
282
+ } catch (N) {
283
+ ye("[useItemProperty] Error updating item property:", N), i(void 0), o(!1), c(N);
281
284
  }
282
285
  }, [t, g]);
283
286
  return I(() => {
284
- if (!z) {
285
- i(void 0), o(!1), a(null);
287
+ if (!B) {
288
+ i(void 0), o(!1), c(null);
286
289
  return;
287
290
  }
288
- n && g && n.propertyName === g.propertyName && (g.seedLocalId != null && n.seedLocalId === g.seedLocalId || g.seedUid != null && n.seedUid === g.seedUid) || N();
289
- }, [z, N, n, g]), I(() => {
291
+ n && g && n.propertyName === g.propertyName && (g.seedLocalId != null && n.seedLocalId === g.seedLocalId || g.seedUid != null && n.seedUid === g.seedUid) || R();
292
+ }, [B, R, n, g]), I(() => {
290
293
  if (!n) {
291
294
  s.current?.unsubscribe(), s.current = void 0;
292
295
  return;
293
296
  }
294
297
  s.current?.unsubscribe();
295
- let M = 0, q = !1;
296
- const K = 50, L = n.getService().subscribe((C) => {
297
- if (C && typeof C == "object" && "value" in C && C.value === "idle") {
298
- o(!1), a(null), q || (q = !0, d((Q) => Q + 1));
298
+ let N = 0, H = !1, Q;
299
+ const L = 50, k = n.getService().subscribe((_) => {
300
+ if (_ && typeof _ == "object" && "value" in _ && _.value === "idle") {
301
+ o(!1), c(null);
302
+ const M = _.context, G = JSON.stringify([M.renderValue, M.propertyValue]);
303
+ (!H || G !== Q) && (H = !0, Q = G, d((re) => re + 1));
299
304
  return;
300
305
  }
301
- q = !1;
302
- const B = Date.now();
303
- B - M >= K && (M = B, d((Q) => Q + 1));
306
+ H = !1, Q = void 0;
307
+ const V = Date.now();
308
+ V - N >= L && (N = V, d((M) => M + 1));
304
309
  });
305
- return s.current = L, () => {
310
+ return s.current = k, () => {
306
311
  s.current?.unsubscribe(), s.current = void 0;
307
312
  };
308
313
  }, [n]), {
309
314
  property: n,
310
- isLoading: c,
315
+ isLoading: a,
311
316
  error: l
312
317
  };
313
318
  }
314
- function Gt(e, r = 300) {
315
- const t = "itemId" in e ? e.itemId : void 0, n = "seedLocalId" in e ? e.seedLocalId : void 0, i = "seedUid" in e ? e.seedUid : void 0, c = e.propertyName, o = D(() => t ? { seedLocalId: t, propertyName: c } : { seedLocalId: n, seedUid: i, propertyName: c }, [t, n, i, c]), { property: l, isLoading: a, error: s } = Ue(o), d = _(""), u = D(
319
+ function Yt(e, r = 300) {
320
+ const t = "itemId" in e ? e.itemId : void 0, n = "seedLocalId" in e ? e.seedLocalId : void 0, i = "seedUid" in e ? e.seedUid : void 0, a = e.propertyName, o = D(() => t ? { seedLocalId: t, propertyName: a } : { seedLocalId: n, seedUid: i, propertyName: a }, [t, n, i, a]), { property: l, isLoading: c, error: s } = Ue(o), d = F(""), u = D(
316
321
  () => $e((h) => {
317
322
  h.getService().send({
318
323
  type: "save",
@@ -335,49 +340,49 @@ function Gt(e, r = 300) {
335
340
  return {
336
341
  property: l,
337
342
  setValue: f,
338
- isLoading: a,
343
+ isLoading: c,
339
344
  error: s
340
345
  };
341
346
  }
342
- async function at(e, r) {
347
+ async function lt(e, r) {
343
348
  if (!e && !r) return [];
344
349
  const t = W.getAppDb();
345
350
  if (!t) return [];
346
- const n = await ne.all(
351
+ const n = await se.all(
347
352
  { seedLocalId: e ?? void 0, seedUid: r ?? void 0 },
348
353
  { waitForReady: !0 }
349
- ), i = [...n], c = /* @__PURE__ */ new Set();
350
- for (const a of n)
351
- a.propertyName && c.add(a.propertyName);
354
+ ), i = [...n], a = /* @__PURE__ */ new Set();
355
+ for (const c of n)
356
+ c.propertyName && a.add(c.propertyName);
352
357
  let o;
353
358
  if (n.length > 0) {
354
- const a = n[0];
355
- o = a.modelName ?? a.modelType, o && typeof o == "string" && (o = De(o));
359
+ const c = n[0];
360
+ o = c.modelName ?? c.modelType, o && typeof o == "string" && (o = _e(o));
356
361
  }
357
362
  if (!o) {
358
- const a = await t.select({ type: A.type }).from(A).where(r ? O(A.uid, r) : O(A.localId, e)).limit(1);
359
- a.length > 0 && a[0].type && (o = De(a[0].type));
363
+ const c = await t.select({ type: A.type }).from(A).where(r ? O(A.uid, r) : O(A.localId, e)).limit(1);
364
+ c.length > 0 && c[0].type && (o = _e(c[0].type));
360
365
  }
361
366
  const l = [];
362
367
  if (o)
363
368
  try {
364
- const { Model: a } = await import("@seedprotocol/sdk"), s = await a.getByNameAsync(o);
369
+ const { Model: c } = await import("@seedprotocol/sdk"), s = await c.getByNameAsync(o);
365
370
  if (s?.properties)
366
371
  for (const d of s.properties)
367
372
  d.name && l.push(d.name);
368
- } catch (a) {
369
- re(`[useItemProperties] Error getting ModelProperties for ${o}:`, a);
373
+ } catch (c) {
374
+ ne(`[useItemProperties] Error getting ModelProperties for ${o}:`, c);
370
375
  }
371
376
  if (o && l.length > 0) {
372
- const a = n.length > 0 ? n[0].seedLocalId ?? e : e, s = n.length > 0 ? n[0].seedUid ?? r : r;
377
+ const c = n.length > 0 ? n[0].seedLocalId ?? e : e, s = n.length > 0 ? n[0].seedUid ?? r : r;
373
378
  for (const d of l)
374
- if (!c.has(d))
379
+ if (!a.has(d))
375
380
  try {
376
- const u = ne.create(
381
+ const u = se.create(
377
382
  {
378
383
  propertyName: d,
379
384
  modelName: o,
380
- seedLocalId: a || void 0,
385
+ seedLocalId: c || void 0,
381
386
  seedUid: s || void 0,
382
387
  propertyValue: null
383
388
  },
@@ -385,62 +390,62 @@ async function at(e, r) {
385
390
  );
386
391
  u && i.push(u);
387
392
  } catch (u) {
388
- pe(`[useItemProperties] Error creating ItemProperty for missing property ${d}:`, u);
393
+ ye(`[useItemProperties] Error creating ItemProperty for missing property ${d}:`, u);
389
394
  }
390
395
  }
391
396
  if (e || r) {
392
- const a = await t.select({ createdAt: A.createdAt }).from(A).where(r ? O(A.uid, r) : O(A.localId, e)).limit(1);
393
- if (a.length > 0 && a[0].createdAt) {
397
+ const c = await t.select({ createdAt: A.createdAt }).from(A).where(r ? O(A.uid, r) : O(A.localId, e)).limit(1);
398
+ if (c.length > 0 && c[0].createdAt) {
394
399
  const s = "createdAt";
395
400
  if (!i.some((u) => u.propertyName === s) && o)
396
401
  try {
397
- const u = n.length > 0 ? n[0].seedLocalId ?? e : e, f = n.length > 0 ? n[0].seedUid ?? r : r, h = ne.create(
402
+ const u = n.length > 0 ? n[0].seedLocalId ?? e : e, f = n.length > 0 ? n[0].seedUid ?? r : r, h = se.create(
398
403
  {
399
404
  propertyName: s,
400
405
  modelName: o,
401
406
  seedLocalId: u || void 0,
402
407
  seedUid: f || void 0,
403
- propertyValue: a[0].createdAt.toString()
408
+ propertyValue: c[0].createdAt.toString()
404
409
  },
405
410
  { waitForReady: !1 }
406
411
  );
407
412
  h && i.push(h);
408
413
  } catch (u) {
409
- pe("[useItemProperties] Error creating createdAt ItemProperty:", u);
414
+ ye("[useItemProperties] Error creating createdAt ItemProperty:", u);
410
415
  }
411
416
  }
412
417
  }
413
418
  return i;
414
419
  }
415
- function Yt(e) {
416
- const r = H(), t = Y(), n = _(void 0), i = D(() => typeof e == "string" ? { type: "itemId", itemId: e } : typeof e == "object" ? {
420
+ function Xt(e) {
421
+ const r = z(), t = X(), n = F(void 0), i = D(() => typeof e == "string" ? { type: "itemId", itemId: e } : typeof e == "object" ? {
417
422
  type: "identifiers",
418
423
  seedLocalId: e.seedLocalId,
419
424
  seedUid: e.seedUid
420
- } : null, [e]), c = D(() => {
425
+ } : null, [e]), a = D(() => {
421
426
  if (i)
422
427
  return i.type === "itemId" ? i.itemId : i.seedLocalId;
423
428
  }, [i]), o = D(() => {
424
429
  if (!(!i || i.type === "itemId"))
425
430
  return i.seedUid;
426
- }, [i]), l = c ?? o ?? "", a = D(
431
+ }, [i]), l = a ?? o ?? "", c = D(
427
432
  () => ["seed", "itemProperties", l],
428
433
  [l]
429
434
  ), {
430
435
  data: s = [],
431
436
  isLoading: d,
432
437
  error: u
433
- } = X({
434
- queryKey: a,
435
- queryFn: () => at(c, o),
438
+ } = Z({
439
+ queryKey: c,
440
+ queryFn: () => lt(a, o),
436
441
  enabled: r && !!l
437
442
  }), f = D(() => {
438
- if (!r || !c && !o)
439
- return re("[useItemProperties] Query: returning null (not ready or no identifiers)"), null;
443
+ if (!r || !a && !o)
444
+ return ne("[useItemProperties] Query: returning null (not ready or no identifiers)"), null;
440
445
  const v = W.getAppDb();
441
446
  if (!v)
442
- return re("[useItemProperties] Query: returning null (no db)"), null;
443
- re(`[useItemProperties] Query: creating query for seedLocalId=${c}, seedUid=${o}`);
447
+ return ne("[useItemProperties] Query: returning null (no db)"), null;
448
+ ne(`[useItemProperties] Query: creating query for seedLocalId=${a}, seedUid=${o}`);
444
449
  const p = o ? v.select({
445
450
  propertyName: T.propertyName,
446
451
  propertyValue: T.propertyValue,
@@ -455,7 +460,7 @@ function Yt(e) {
455
460
  O(T.seedUid, o),
456
461
  Ie(T.propertyName)
457
462
  )
458
- ) : c ? v.select({
463
+ ) : a ? v.select({
459
464
  propertyName: T.propertyName,
460
465
  propertyValue: T.propertyValue,
461
466
  seedLocalId: T.seedLocalId,
@@ -466,12 +471,12 @@ function Yt(e) {
466
471
  attestationCreatedAt: T.attestationCreatedAt
467
472
  }).from(T).where(
468
473
  Ee(
469
- O(T.seedLocalId, c),
474
+ O(T.seedLocalId, a),
470
475
  Ie(T.propertyName)
471
476
  )
472
477
  ) : null;
473
- return re("[useItemProperties] Query: created query object", { queryType: o ? "seedUid" : "seedLocalId" }), p;
474
- }, [r, c, o]), h = oe(f), b = D(() => {
478
+ return ne("[useItemProperties] Query: created query object", { queryType: o ? "seedUid" : "seedLocalId" }), p;
479
+ }, [r, a, o]), h = ie(f), b = D(() => {
475
480
  if (!h || h.length === 0)
476
481
  return [];
477
482
  const v = /* @__PURE__ */ new Map();
@@ -488,7 +493,7 @@ function Yt(e) {
488
493
  return Array.from(v.values());
489
494
  }, [h]);
490
495
  return I(() => {
491
- if (!r || !c && !o || b === void 0) return;
496
+ if (!r || !a && !o || b === void 0) return;
492
497
  const v = JSON.stringify(
493
498
  b.map((p) => ({
494
499
  propertyName: p.propertyName,
@@ -497,36 +502,36 @@ function Yt(e) {
497
502
  seedUid: p.seedUid
498
503
  })).sort((p, y) => (p.propertyName || "").localeCompare(y.propertyName || ""))
499
504
  );
500
- n.current !== v && (n.current = v, b.length > 0 && t.invalidateQueries({ queryKey: a }));
501
- }, [r, b, s, c, o, t, a]), I(() => {
505
+ n.current !== v && (n.current = v, b.length > 0 && t.invalidateQueries({ queryKey: c }));
506
+ }, [r, b, s, a, o, t, c]), I(() => {
502
507
  n.current = void 0;
503
- }, [c, o]), {
508
+ }, [a, o]), {
504
509
  properties: s,
505
510
  isLoading: d,
506
511
  error: u
507
512
  };
508
513
  }
509
- const Xt = () => {
510
- const e = _(void 0), [r, t] = w(!1), [n, i] = w(null), c = x(() => i(null), []), o = x((l) => {
514
+ const Zt = () => {
515
+ const e = F(void 0), [r, t] = w(!1), [n, i] = w(null), a = x(() => i(null), []), o = x((l) => {
511
516
  if (!l.propertyName || !l.seedLocalId && !l.seedUid || !l.modelName) {
512
517
  const d = new Error("seedLocalId or seedUid, propertyName, and modelName are required");
513
518
  i(d);
514
519
  return;
515
520
  }
516
521
  i(null), t(!0), e.current?.unsubscribe(), e.current = void 0;
517
- const a = ne.create(l, { waitForReady: !1 });
518
- if (!a) {
522
+ const c = se.create(l, { waitForReady: !1 });
523
+ if (!c) {
519
524
  i(new Error("Failed to create item property")), t(!1);
520
525
  return;
521
526
  }
522
- const s = a.getService().subscribe((d) => {
527
+ const s = c.getService().subscribe((d) => {
523
528
  if (d?.value === "error") {
524
529
  const u = d.context?._loadingError?.error ?? new Error("Failed to create item property");
525
530
  i(u instanceof Error ? u : new Error(String(u))), t(!1);
526
531
  }
527
532
  d?.value === "idle" && (i(null), t(!1));
528
533
  });
529
- return e.current = s, a;
534
+ return e.current = s, c;
530
535
  }, []);
531
536
  return I(() => () => {
532
537
  e.current?.unsubscribe(), e.current = void 0;
@@ -534,9 +539,9 @@ const Xt = () => {
534
539
  create: o,
535
540
  isLoading: r,
536
541
  error: n,
537
- resetError: c
542
+ resetError: a
538
543
  };
539
- }, Zt = () => {
544
+ }, er = () => {
540
545
  const [e, r] = w(null), [t, n] = w({
541
546
  isLoading: !1,
542
547
  error: null
@@ -554,21 +559,21 @@ const Xt = () => {
554
559
  });
555
560
  };
556
561
  l();
557
- const a = o.subscribe(l);
558
- return () => a.unsubscribe();
562
+ const c = o.subscribe(l);
563
+ return () => c.unsubscribe();
559
564
  }, [e]);
560
565
  const i = x(async (o) => {
561
566
  o && (r(o), await o.destroy());
562
- }, []), c = x(() => {
567
+ }, []), a = x(() => {
563
568
  e && e.getService().send({ type: "clearDestroyError" });
564
569
  }, [e]);
565
570
  return {
566
571
  destroy: i,
567
572
  isLoading: t.isLoading,
568
573
  error: t.error,
569
- resetError: c
574
+ resetError: a
570
575
  };
571
- }, Le = J("seedSdk:react:services"), lt = ["idle", "ready", "done", "success", "initialized"], Oe = (e) => {
576
+ }, Le = J("seedSdk:react:services"), ct = ["idle", "ready", "done", "success", "initialized"], Oe = (e) => {
572
577
  let r = "actor";
573
578
  const t = e;
574
579
  return e && t.uniqueKey && (r = t.uniqueKey), e && !t.uniqueKey && t.logic && t.logic.config && (r = Ae(e)), r;
@@ -587,24 +592,24 @@ const Xt = () => {
587
592
  let i;
588
593
  try {
589
594
  i = e.getSnapshot();
590
- } catch (c) {
591
- return Le("Error:", c), n;
595
+ } catch (a) {
596
+ return Le("Error:", a), n;
592
597
  }
593
598
  if (i) {
594
- const c = i.context;
595
- c && c.dbName && (n = c.dbName), c && c.modelNamePlural && (n = c.modelNamePlural), c && c.modelName && (n = ot(c.modelName.toLowerCase()));
599
+ const a = i.context;
600
+ a && a.dbName && (n = a.dbName), a && a.modelNamePlural && (n = a.modelNamePlural), a && a.modelName && (n = it(a.modelName.toLowerCase()));
596
601
  }
597
602
  return n;
598
- }, er = (e) => {
603
+ }, tr = (e) => {
599
604
  const [r, t] = w(0), n = (o) => {
600
605
  let l = 0;
601
- const a = o;
602
- if (a.logic?.states) {
606
+ const c = o;
607
+ if (c.logic?.states) {
603
608
  const s = [], d = [];
604
- for (const [h, b] of Object.entries(a.logic.states))
609
+ for (const [h, b] of Object.entries(c.logic.states))
605
610
  b.tags?.includes("loading") && (s.push(h), d.push(b));
606
611
  const u = d.length, f = Fe(o);
607
- if (f && lt.includes(f))
612
+ if (f && ct.includes(f))
608
613
  return 0;
609
614
  f && (l = s.indexOf(f) / u * 100);
610
615
  }
@@ -617,17 +622,17 @@ const Xt = () => {
617
622
  clearInterval(o);
618
623
  return;
619
624
  }
620
- t((a) => a + 1);
625
+ t((c) => c + 1);
621
626
  },
622
627
  [e]
623
- ), c = x(() => {
628
+ ), a = x(() => {
624
629
  const o = setInterval(() => {
625
630
  i(o);
626
631
  }, 1e3);
627
632
  return o;
628
633
  }, [i, e]);
629
634
  return I(() => {
630
- const o = c();
635
+ const o = a();
631
636
  return () => clearInterval(o);
632
637
  }, []), {
633
638
  name: Oe(e),
@@ -636,49 +641,49 @@ const Xt = () => {
636
641
  percentComplete: n(e),
637
642
  uniqueKey: Ae(e)
638
643
  };
639
- }, ct = () => {
640
- const [e, r] = w(!1), { internalStatus: t } = ft();
644
+ }, dt = () => {
645
+ const [e, r] = w(!1), { internalStatus: t } = pt();
641
646
  return I(() => {
642
647
  t === "ready" && r(!0);
643
648
  }, [t]), I(() => {
644
649
  t === "ready" && r(!0);
645
650
  }, []), e;
646
- }, tr = () => {
647
- const [e, r] = w(!1), t = dt(), { services: n, percentComplete: i } = ut(), c = x(async () => {
651
+ }, rr = () => {
652
+ const [e, r] = w(!1), t = ut(), { services: n, percentComplete: i } = ft(), a = x(async () => {
648
653
  for (const l of n) {
649
- const a = Ae(l);
654
+ const c = Ae(l);
650
655
  Le(
651
- `would save to db with snapshot__${a}:`,
656
+ `would save to db with snapshot__${c}:`,
652
657
  JSON.stringify(l.getPersistedSnapshot())
653
658
  );
654
659
  }
655
660
  }, [n]), o = x(async () => {
656
661
  const l = W.getAppDb();
657
- return l ? await l.select().from(de).where(Be(de.key, "snapshot__%")) : [];
662
+ return l ? await l.select().from(ue).where(Be(ue.key, "snapshot__%")) : [];
658
663
  }, []);
659
664
  I(() => !t || e ? void 0 : ((async () => {
660
- const a = await o();
661
- Le("persistedSnapshots:", a), r(!0);
665
+ const c = await o();
666
+ Le("persistedSnapshots:", c), r(!0);
662
667
  })(), () => {
663
- c();
668
+ a();
664
669
  }), [t, e]);
665
- }, dt = () => {
666
- const [e, r] = w(!1), t = ct();
670
+ }, ut = () => {
671
+ const [e, r] = w(!1), t = dt();
667
672
  return I(() => {
668
673
  t && (async () => {
669
- const c = await W.getAppDb().select().from(de).where(Be(de.key, "snapshot__%"));
670
- c && c.length > 0 && r(!0);
674
+ const a = await W.getAppDb().select().from(ue).where(Be(ue.key, "snapshot__%"));
675
+ a && a.length > 0 && r(!0);
671
676
  })();
672
677
  }, [t]), e;
673
- }, ut = () => {
678
+ }, ft = () => {
674
679
  const [e, r] = w([]), [t, n] = w(5);
675
680
  return I(() => {
676
- const c = ye().getService(), o = c;
681
+ const a = me().getService(), o = a;
677
682
  o.uniqueKey = "clientManager", r([o]);
678
- const l = c.subscribe((a) => {
679
- const s = a.value;
683
+ const l = a.subscribe((c) => {
684
+ const s = c.value;
680
685
  let d = 0;
681
- s === F.IDLE ? d = 100 : s === F.ADD_MODELS_TO_DB ? d = 90 : s === F.ADD_MODELS_TO_STORE ? d = 80 : s === F.PROCESS_SCHEMA_FILES ? d = 70 : s === F.SAVE_CONFIG ? d = 60 : s === F.DB_INIT ? d = 50 : s === F.FILE_SYSTEM_INIT ? d = 30 : s === F.PLATFORM_CLASSES_INIT && (d = 10), n(d);
686
+ s === C.IDLE ? d = 100 : s === C.ADD_MODELS_TO_DB ? d = 90 : s === C.ADD_MODELS_TO_STORE ? d = 80 : s === C.PROCESS_SCHEMA_FILES ? d = 70 : s === C.SAVE_CONFIG ? d = 60 : s === C.DB_INIT ? d = 50 : s === C.FILE_SYSTEM_INIT ? d = 30 : s === C.PLATFORM_CLASSES_INIT && (d = 10), n(d);
682
687
  });
683
688
  return () => {
684
689
  l.unsubscribe();
@@ -687,10 +692,10 @@ const Xt = () => {
687
692
  services: e,
688
693
  percentComplete: t
689
694
  };
690
- }, ft = () => {
691
- const r = ye().getService(), t = we(r, (i) => i.value), n = we(r, (i) => {
692
- const c = i.value;
693
- return c === F.DB_INIT || c === F.SAVE_CONFIG || c === F.PROCESS_SCHEMA_FILES || c === F.ADD_MODELS_TO_STORE || c === F.ADD_MODELS_TO_DB || c === F.IDLE ? "ready" : c;
695
+ }, pt = () => {
696
+ const r = me().getService(), t = we(r, (i) => i.value), n = we(r, (i) => {
697
+ const a = i.value;
698
+ return a === C.DB_INIT || a === C.SAVE_CONFIG || a === C.PROCESS_SCHEMA_FILES || a === C.ADD_MODELS_TO_STORE || a === C.ADD_MODELS_TO_DB || a === C.IDLE ? "ready" : a;
694
699
  });
695
700
  return {
696
701
  status: t,
@@ -698,21 +703,21 @@ const Xt = () => {
698
703
  };
699
704
  };
700
705
  J("seedSdk:react:db");
701
- const rr = () => {
706
+ const nr = () => {
702
707
  const [e, r] = w(!1), t = x(() => {
703
708
  e || r(!0);
704
709
  }, []);
705
710
  return I(() => {
706
711
  let n;
707
712
  return (async () => {
708
- const o = ye().getService(), l = o.getSnapshot().value;
709
- if (l === F.DB_INIT || l === F.SAVE_CONFIG || l === F.PROCESS_SCHEMA_FILES || l === F.ADD_MODELS_TO_STORE || l === F.ADD_MODELS_TO_DB || l === F.IDLE) {
713
+ const o = me().getService(), l = o.getSnapshot().value;
714
+ if (l === C.DB_INIT || l === C.SAVE_CONFIG || l === C.PROCESS_SCHEMA_FILES || l === C.ADD_MODELS_TO_STORE || l === C.ADD_MODELS_TO_DB || l === C.IDLE) {
710
715
  t();
711
716
  return;
712
717
  }
713
- n = o.subscribe((a) => {
714
- const s = a.value;
715
- (s === F.DB_INIT || s === F.SAVE_CONFIG || s === F.PROCESS_SCHEMA_FILES || s === F.ADD_MODELS_TO_STORE || s === F.ADD_MODELS_TO_DB || s === F.IDLE) && (t(), n?.unsubscribe());
718
+ n = o.subscribe((c) => {
719
+ const s = c.value;
720
+ (s === C.DB_INIT || s === C.SAVE_CONFIG || s === C.PROCESS_SCHEMA_FILES || s === C.ADD_MODELS_TO_STORE || s === C.ADD_MODELS_TO_DB || s === C.IDLE) && (t(), n?.unsubscribe());
716
721
  });
717
722
  })(), () => {
718
723
  n && n.unsubscribe();
@@ -720,24 +725,24 @@ const rr = () => {
720
725
  }, []), {
721
726
  dbsAreReady: e
722
727
  };
723
- }, qe = J("seedSdk:react:schema"), pt = (e) => {
724
- const [r, t] = w(null), [n, i] = w(!!e), [c, o] = w(null), l = _(null), a = H(), s = x((d) => {
728
+ }, qe = J("seedSdk:react:schema"), yt = (e) => {
729
+ const [r, t] = w(null), [n, i] = w(!!e), [a, o] = w(null), l = F(null), c = z(), s = x((d) => {
725
730
  i(!0), o(null);
726
731
  try {
727
- const u = me.create(d, {
732
+ const u = he.create(d, {
728
733
  waitForReady: !1
729
734
  });
730
735
  t(u);
731
736
  const f = u.getService();
732
- f.getSnapshot().value === "idle" ? (ce(() => i(!1)), o(null)) : i(!0), l.current = f.subscribe((v) => {
733
- v.value === "idle" ? (ce(() => i(!1)), o(null)) : i(!0);
737
+ f.getSnapshot().value === "idle" ? (de(() => i(!1)), o(null)) : i(!0), l.current = f.subscribe((v) => {
738
+ v.value === "idle" ? (de(() => i(!1)), o(null)) : i(!0);
734
739
  });
735
740
  } catch (u) {
736
741
  return qe("[useSchema] Error creating schema:", u), o(u), t(null), i(!1), null;
737
742
  }
738
743
  }, []);
739
744
  return I(() => {
740
- if (l.current && (l.current.unsubscribe(), l.current = null), !a) {
745
+ if (l.current && (l.current.unsubscribe(), l.current = null), !c) {
741
746
  t(null), o(null), i(!1);
742
747
  return;
743
748
  }
@@ -748,23 +753,23 @@ const rr = () => {
748
753
  return s(e), () => {
749
754
  l.current && (l.current.unsubscribe(), l.current = null);
750
755
  };
751
- }, [e, a, s]), {
756
+ }, [e, c, s]), {
752
757
  schema: r,
753
758
  isLoading: n,
754
- error: c
759
+ error: a
755
760
  };
756
- }, be = ["seed", "schemas"], nr = () => {
757
- const e = H(), r = Y(), t = _(void 0), n = _([]), {
761
+ }, be = ["seed", "schemas"], sr = () => {
762
+ const e = z(), r = X(), t = F(void 0), n = F([]), {
758
763
  data: i = [],
759
- isLoading: c,
764
+ isLoading: a,
760
765
  error: o
761
- } = X({
766
+ } = Z({
762
767
  queryKey: be,
763
- queryFn: () => me.all({ waitForReady: !0 }),
768
+ queryFn: () => he.all({ waitForReady: !0 }),
764
769
  enabled: e
765
770
  });
766
771
  n.current = i;
767
- const l = e ? W.getAppDb() : null, a = D(() => l ? l.select().from(G).orderBy(G.name, tt(G.version)) : null, [l, e]), s = oe(a);
772
+ const l = e ? W.getAppDb() : null, c = D(() => l ? l.select().from(Y).orderBy(Y.name, rt(Y.version)) : null, [l, e]), s = ie(c);
768
773
  return I(() => {
769
774
  if (typeof BroadcastChannel > "u") return;
770
775
  const d = new BroadcastChannel("seed-schemas-invalidate"), u = () => {
@@ -797,22 +802,22 @@ const rr = () => {
797
802
  !v && p && r.invalidateQueries({ queryKey: be });
798
803
  }, [e, s, r]), {
799
804
  schemas: i,
800
- isLoading: c,
805
+ isLoading: a,
801
806
  error: o
802
807
  };
803
- }, sr = () => {
804
- const e = _(null), [r, t] = w(!1), [n, i] = w(null), c = x(() => i(null), []), o = x((l) => {
808
+ }, or = () => {
809
+ const e = F(null), [r, t] = w(!1), [n, i] = w(null), a = x(() => i(null), []), o = x((l) => {
805
810
  i(null), t(!0), e.current?.unsubscribe(), e.current = null;
806
- const a = me.create(l, {
811
+ const c = he.create(l, {
807
812
  waitForReady: !1
808
- }), s = a.getService().subscribe((d) => {
813
+ }), s = c.getService().subscribe((d) => {
809
814
  if (d.value === "error") {
810
815
  const u = d.context._loadingError?.error;
811
816
  i(u instanceof Error ? u : new Error("Failed to create schema")), t(!1);
812
817
  }
813
818
  d.value === "idle" && (i(null), t(!1));
814
819
  });
815
- return e.current = s, a;
820
+ return e.current = s, c;
816
821
  }, []);
817
822
  return I(() => () => {
818
823
  e.current?.unsubscribe(), e.current = null;
@@ -820,9 +825,9 @@ const rr = () => {
820
825
  createSchema: o,
821
826
  isLoading: r,
822
827
  error: n,
823
- resetError: c
828
+ resetError: a
824
829
  };
825
- }, or = () => {
830
+ }, ir = () => {
826
831
  const [e, r] = w(null), [t, n] = w({
827
832
  isLoading: !1,
828
833
  error: null
@@ -840,63 +845,63 @@ const rr = () => {
840
845
  });
841
846
  };
842
847
  l();
843
- const a = o.subscribe(l);
844
- return () => a.unsubscribe();
848
+ const c = o.subscribe(l);
849
+ return () => c.unsubscribe();
845
850
  }, [e]);
846
851
  const i = x(async (o) => {
847
852
  o && (r(o), await o.destroy());
848
- }, []), c = x(() => {
853
+ }, []), a = x(() => {
849
854
  e && e.getService().send({ type: "clearDestroyError" });
850
855
  }, [e]);
851
856
  return {
852
857
  destroy: i,
853
858
  isLoading: t.isLoading,
854
859
  error: t.error,
855
- resetError: c
860
+ resetError: a
856
861
  };
857
- }, ir = () => {
858
- const [e, r] = w(), t = _(/* @__PURE__ */ new Map()), n = H(), i = x(async () => {
862
+ }, ar = () => {
863
+ const [e, r] = w(), t = F(/* @__PURE__ */ new Map()), n = z(), i = x(async () => {
859
864
  if (n)
860
865
  try {
861
- const c = await We(), o = /* @__PURE__ */ new Set();
862
- for (const a of c) {
863
- const s = a.schema.metadata?.name;
866
+ const a = await Ge(), o = /* @__PURE__ */ new Set();
867
+ for (const c of a) {
868
+ const s = c.schema.metadata?.name;
864
869
  s && o.add(s);
865
870
  }
866
871
  const l = /* @__PURE__ */ new Map();
867
- for (const a of o)
868
- if (t.current.has(a)) {
869
- const s = t.current.get(a);
870
- l.set(a, s);
872
+ for (const c of o)
873
+ if (t.current.has(c)) {
874
+ const s = t.current.get(c);
875
+ l.set(c, s);
871
876
  } else {
872
- const s = me.create(a, {
877
+ const s = he.create(c, {
873
878
  waitForReady: !1
874
879
  });
875
- l.set(a, s);
880
+ l.set(c, s);
876
881
  }
877
- for (const [a, s] of t.current.entries())
878
- o.has(a) || s.unload();
882
+ for (const [c, s] of t.current.entries())
883
+ o.has(c) || s.unload();
879
884
  t.current = l, r(Array.from(l.values()));
880
- } catch (c) {
881
- qe("Error fetching all schema versions from database:", c), r(null);
885
+ } catch (a) {
886
+ qe("Error fetching all schema versions from database:", a), r(null);
882
887
  }
883
888
  }, [n]);
884
889
  return I(() => {
885
890
  n && i();
886
891
  }, [n, i]), I(() => () => {
887
- t.current.forEach((c) => {
888
- c.unload();
892
+ t.current.forEach((a) => {
893
+ a.unload();
889
894
  }), t.current.clear();
890
895
  }, []), e;
891
- }, ar = () => pt(Je), yt = (e) => ["seed", "models", e], Ce = /* @__PURE__ */ new Map(), mt = (e) => {
892
- const r = H(), t = Y(), n = _([]), i = D(() => yt(e), [e]), {
893
- data: c = [],
896
+ }, lr = () => yt(Je), mt = (e) => ["seed", "models", e], Ce = /* @__PURE__ */ new Map(), ht = (e) => {
897
+ const r = z(), t = X(), n = F([]), i = D(() => mt(e), [e]), {
898
+ data: a = [],
894
899
  isLoading: o,
895
900
  error: l
896
- } = X({
901
+ } = Z({
897
902
  queryKey: i,
898
903
  queryFn: async () => {
899
- const p = t.getQueryData(i), y = await se.all(e, { waitForReady: !1 });
904
+ const p = t.getQueryData(i), y = await oe.all(e, { waitForReady: !1 });
900
905
  if (Array.isArray(p) && p.length > 0 && Array.isArray(y) && y.length === 0)
901
906
  return [...p];
902
907
  if (Array.isArray(y) && y.length === 0) {
@@ -907,9 +912,9 @@ const rr = () => {
907
912
  return y;
908
913
  },
909
914
  enabled: r && !!e
910
- }), a = e && typeof e == "string" ? e : "";
911
- c.length > 0 && Ce.set(a, c);
912
- const s = n.current.length > 0 ? n.current : Ce.get(a), d = e ? c.length > 0 ? c : s?.length ? s : c : c;
915
+ }), c = e && typeof e == "string" ? e : "";
916
+ a.length > 0 && Ce.set(c, a);
917
+ const s = n.current.length > 0 ? n.current : Ce.get(c), d = e ? a.length > 0 ? a : s?.length ? s : a : a;
913
918
  n.current = d, I(() => {
914
919
  if (!e || typeof BroadcastChannel > "u") return;
915
920
  const p = new BroadcastChannel("seed-models-invalidate"), y = (m) => {
@@ -920,16 +925,16 @@ const rr = () => {
920
925
  p.removeEventListener("message", y), p.close();
921
926
  };
922
927
  }, [e, t, i]);
923
- const u = _(null), f = _(null);
928
+ const u = F(null), f = F(null);
924
929
  function h() {
925
930
  const p = W.getAppDb();
926
931
  return !p || !e ? null : p.select({
927
- modelFileId: ie.schemaFileId,
928
- modelName: ie.name
929
- }).from(G).innerJoin(ge, O(G.id, ge.schemaId)).innerJoin(ie, O(ge.modelId, ie.id)).where(
930
- ee(
931
- O(G.schemaFileId, e),
932
- O(G.name, e)
932
+ modelFileId: ae.schemaFileId,
933
+ modelName: ae.name
934
+ }).from(Y).innerJoin(ge, O(Y.id, ge.schemaId)).innerJoin(ae, O(ge.modelId, ae.id)).where(
935
+ te(
936
+ O(Y.schemaFileId, e),
937
+ O(Y.name, e)
933
938
  )
934
939
  );
935
940
  }
@@ -940,13 +945,13 @@ const rr = () => {
940
945
  return f.current;
941
946
  const m = h();
942
947
  return m ? (u.current = p, f.current = m, m) : null;
943
- }, [e, r]), v = oe(b);
948
+ }, [e, r]), v = ie(b);
944
949
  return I(() => {
945
950
  if (!r || !v || !e) return;
946
951
  const p = /* @__PURE__ */ new Set();
947
952
  for (const g of n.current) {
948
- const z = g.id || g.modelFileId;
949
- z ? p.add(z) : g.modelName && p.add(g.modelName);
953
+ const B = g.id || g.modelFileId;
954
+ B ? p.add(B) : g.modelName && p.add(g.modelName);
950
955
  }
951
956
  const y = /* @__PURE__ */ new Set();
952
957
  for (const g of v)
@@ -958,20 +963,20 @@ const rr = () => {
958
963
  isLoading: o,
959
964
  error: l
960
965
  };
961
- }, ht = (e, r) => {
962
- const t = H(), [n, i] = w(void 0), [c, o] = w(!1), [l, a] = w(null), s = _(void 0), [, d] = w(0), u = r == null;
966
+ }, gt = (e, r) => {
967
+ const t = z(), [n, i] = w(void 0), [a, o] = w(!1), [l, c] = w(null), s = F(void 0), [, d] = w(0), u = r == null;
963
968
  if (D(() => t ? u ? !!e : !!(e && r) : !1, [t, u, e, r]), I(() => {
964
969
  if (!t || !u || !e) {
965
- i(void 0), o(!1), a(null);
970
+ i(void 0), o(!1), c(null);
966
971
  return;
967
972
  }
968
973
  (async () => {
969
974
  try {
970
- o(!0), a(null);
971
- const y = await se.createById(e);
972
- i(y || void 0), o(!1), a(null);
975
+ o(!0), c(null);
976
+ const y = await oe.createById(e);
977
+ i(y || void 0), o(!1), c(null);
973
978
  } catch (y) {
974
- console.error("[useModel] Error looking up model by ID:", y), i(void 0), o(!1), a(y);
979
+ console.error("[useModel] Error looking up model by ID:", y), i(void 0), o(!1), c(y);
975
980
  }
976
981
  })();
977
982
  }, [t, u, e]), I(() => {
@@ -989,10 +994,10 @@ const rr = () => {
989
994
  }, [u, n]), u)
990
995
  return {
991
996
  model: n,
992
- isLoading: c,
997
+ isLoading: a,
993
998
  error: l
994
999
  };
995
- const { models: f, isLoading: h, error: b } = mt(e), v = D(() => {
1000
+ const { models: f, isLoading: h, error: b } = ht(e), v = D(() => {
996
1001
  if (r)
997
1002
  return f.find((p) => (p.modelName ?? p.name) === r);
998
1003
  }, [f, r]);
@@ -1013,11 +1018,11 @@ const rr = () => {
1013
1018
  isLoading: h,
1014
1019
  error: b
1015
1020
  };
1016
- }, lr = () => {
1017
- const e = _(void 0), [r, t] = w(!1), [n, i] = w(null), c = x(() => i(null), []), o = x(
1018
- (l, a, s) => {
1021
+ }, cr = () => {
1022
+ const e = F(void 0), [r, t] = w(!1), [n, i] = w(null), a = x(() => i(null), []), o = x(
1023
+ (l, c, s) => {
1019
1024
  i(null), t(!0), e.current?.unsubscribe(), e.current = void 0;
1020
- const d = se.create(a, l, {
1025
+ const d = oe.create(c, l, {
1021
1026
  ...s,
1022
1027
  waitForReady: !1
1023
1028
  }), u = d.getService().subscribe((f) => {
@@ -1035,9 +1040,9 @@ const rr = () => {
1035
1040
  create: o,
1036
1041
  isLoading: r,
1037
1042
  error: n,
1038
- resetError: c
1043
+ resetError: a
1039
1044
  };
1040
- }, cr = () => {
1045
+ }, dr = () => {
1041
1046
  const [e, r] = w(null), [t, n] = w({
1042
1047
  isLoading: !1,
1043
1048
  error: null
@@ -1055,24 +1060,24 @@ const rr = () => {
1055
1060
  });
1056
1061
  };
1057
1062
  l();
1058
- const a = o.subscribe(l);
1059
- return () => a.unsubscribe();
1063
+ const c = o.subscribe(l);
1064
+ return () => c.unsubscribe();
1060
1065
  }, [e]);
1061
1066
  const i = x(async (o) => {
1062
1067
  o && (r(o), await o.destroy());
1063
- }, []), c = x(() => {
1068
+ }, []), a = x(() => {
1064
1069
  e && e.getService().send({ type: "clearDestroyError" });
1065
1070
  }, [e]);
1066
1071
  return {
1067
1072
  destroy: i,
1068
1073
  isLoading: t.isLoading,
1069
1074
  error: t.error,
1070
- resetError: c
1075
+ resetError: a
1071
1076
  };
1072
1077
  };
1073
1078
  J("seedSdk:browser:react:modelProperty");
1074
- const dr = (e, r) => {
1075
- const { model: t } = ht(e, r);
1079
+ const ur = (e, r) => {
1080
+ const { model: t } = gt(e, r);
1076
1081
  D(() => {
1077
1082
  if (t)
1078
1083
  try {
@@ -1081,7 +1086,7 @@ const dr = (e, r) => {
1081
1086
  return;
1082
1087
  }
1083
1088
  }, [t]);
1084
- const n = H(), i = Y(), c = D(() => {
1089
+ const n = z(), i = X(), a = D(() => {
1085
1090
  if (!t) return null;
1086
1091
  try {
1087
1092
  return t._getSnapshotContext()._dbId;
@@ -1092,101 +1097,101 @@ const dr = (e, r) => {
1092
1097
  () => ["seed", "modelProperties", o ?? ""],
1093
1098
  [o]
1094
1099
  ), {
1095
- data: a = [],
1100
+ data: c = [],
1096
1101
  isLoading: s,
1097
1102
  error: d
1098
- } = X({
1103
+ } = Z({
1099
1104
  queryKey: l,
1100
- queryFn: () => ue.all(o, { waitForReady: !0 }),
1105
+ queryFn: () => fe.all(o, { waitForReady: !0 }),
1101
1106
  enabled: n && !!o
1102
- }), u = n ? W.getAppDb() : null, f = D(() => !u || !c ? null : u.select({
1103
- id: Z.id,
1104
- name: Z.name,
1105
- dataType: Z.dataType,
1106
- schemaFileId: Z.schemaFileId
1107
- }).from(Z).where(O(Z.modelId, c)), [u, n, c]), h = oe(f), b = _([]);
1108
- b.current = a, I(() => {
1109
- if (!o || a.length > 0 || !i || !l) return;
1107
+ }), u = n ? W.getAppDb() : null, f = D(() => !u || !a ? null : u.select({
1108
+ id: ee.id,
1109
+ name: ee.name,
1110
+ dataType: ee.dataType,
1111
+ schemaFileId: ee.schemaFileId
1112
+ }).from(ee).where(O(ee.modelId, a)), [u, n, a]), h = ie(f), b = F([]);
1113
+ b.current = c, I(() => {
1114
+ if (!o || c.length > 0 || !i || !l) return;
1110
1115
  const y = [400, 1200, 2500].map(
1111
1116
  (m) => setTimeout(() => {
1112
1117
  i.invalidateQueries({ queryKey: l });
1113
1118
  }, m)
1114
1119
  );
1115
1120
  return () => y.forEach((m) => clearTimeout(m));
1116
- }, [o, a.length, i, l]), I(() => {
1121
+ }, [o, c.length, i, l]), I(() => {
1117
1122
  if (!n || !t?.id || !h || !l) return;
1118
1123
  const p = /* @__PURE__ */ new Set();
1119
1124
  for (const g of b.current) {
1120
- const N = g._getSnapshotContext()?.id;
1121
- N ? p.add(N) : g.name && p.add(g.name);
1125
+ const R = g._getSnapshotContext()?.id;
1126
+ R ? p.add(R) : g.name && p.add(g.name);
1122
1127
  }
1123
1128
  const y = /* @__PURE__ */ new Set();
1124
1129
  for (const g of h)
1125
1130
  g.schemaFileId ? y.add(g.schemaFileId) : g.name && y.add(g.name);
1126
1131
  !(p.size === y.size && (p.size === 0 || [...p].every((g) => y.has(g)))) && (p.size > 0 || y.size > 0) && i.invalidateQueries({ queryKey: l });
1127
1132
  }, [n, h, t?.id, i, l]);
1128
- const v = s && a.length === 0;
1133
+ const v = s && c.length === 0;
1129
1134
  return {
1130
- modelProperties: a,
1135
+ modelProperties: c,
1131
1136
  isLoading: v,
1132
1137
  error: d
1133
1138
  };
1134
- }, gt = async (e, r) => {
1135
- const t = await se.createById(e);
1139
+ }, bt = async (e, r) => {
1140
+ const t = await oe.createById(e);
1136
1141
  if (!t)
1137
1142
  return;
1138
1143
  const n = t.modelName ?? t.name;
1139
1144
  if (n)
1140
1145
  return ke(n, r);
1141
1146
  };
1142
- function ur(e, r, t) {
1143
- const n = D(() => t != null ? !!(e && r && t) : r != null ? !!(e && r) : !!e, [e, r, t]), [i, c] = w(void 0), [o, l] = w(n), [a, s] = w(null), d = _(void 0), u = H(), f = D(() => t != null ? { type: "schemaId", schemaId: e, modelName: r, propertyName: t } : r != null ? { type: "modelFileId", modelFileId: e, propertyName: r } : { type: "propertyFileId", propertyFileId: e }, [e, r, t]), h = D(() => u ? f.type === "propertyFileId" ? !!f.propertyFileId : f.type === "modelFileId" ? !!(f.modelFileId && f.propertyName) : !!(f.schemaId && f.modelName && f.propertyName) : !1, [u, f]), b = x(async () => {
1147
+ function fr(e, r, t) {
1148
+ const n = D(() => t != null ? !!(e && r && t) : r != null ? !!(e && r) : !!e, [e, r, t]), [i, a] = w(void 0), [o, l] = w(n), [c, s] = w(null), d = F(void 0), u = z(), f = D(() => t != null ? { type: "schemaId", schemaId: e, modelName: r, propertyName: t } : r != null ? { type: "modelFileId", modelFileId: e, propertyName: r } : { type: "propertyFileId", propertyFileId: e }, [e, r, t]), h = D(() => u ? f.type === "propertyFileId" ? !!f.propertyFileId : f.type === "modelFileId" ? !!(f.modelFileId && f.propertyName) : !!(f.schemaId && f.modelName && f.propertyName) : !1, [u, f]), b = x(async () => {
1144
1149
  if (!u) {
1145
- c(void 0), l(!1), s(null);
1150
+ a(void 0), l(!1), s(null);
1146
1151
  return;
1147
1152
  }
1148
1153
  let p, y;
1149
1154
  try {
1150
1155
  if (l(!0), s(null), f.type === "propertyFileId") {
1151
1156
  if (!f.propertyFileId) {
1152
- c(void 0), l(!1), s(null);
1157
+ a(void 0), l(!1), s(null);
1153
1158
  return;
1154
1159
  }
1155
- const m = await ue.createById(f.propertyFileId);
1156
- m ? (c(m), l(!1), s(null)) : (c(void 0), l(!1), s(null));
1160
+ const m = await fe.createById(f.propertyFileId);
1161
+ m ? (a(m), l(!1), s(null)) : (a(void 0), l(!1), s(null));
1157
1162
  return;
1158
1163
  } else if (f.type === "modelFileId") {
1159
1164
  if (!f.modelFileId || !f.propertyName) {
1160
- c(void 0), l(!1), s(null);
1165
+ a(void 0), l(!1), s(null);
1161
1166
  return;
1162
1167
  }
1163
- p = await gt(f.modelFileId, f.propertyName);
1164
- const m = await se.createById(f.modelFileId);
1168
+ p = await bt(f.modelFileId, f.propertyName);
1169
+ const m = await oe.createById(f.modelFileId);
1165
1170
  y = m?.modelName ?? m?.name;
1166
1171
  } else {
1167
1172
  if (!f.schemaId || !f.modelName || !f.propertyName) {
1168
- c(void 0), l(!1), s(null);
1173
+ a(void 0), l(!1), s(null);
1169
1174
  return;
1170
1175
  }
1171
1176
  p = await ke(f.modelName, f.propertyName), y = f.modelName;
1172
1177
  }
1173
1178
  if (p && y) {
1174
- const m = ue.create(
1179
+ const m = fe.create(
1175
1180
  { ...p, modelName: y },
1176
1181
  { waitForReady: !1 }
1177
1182
  ), E = m instanceof Promise ? await m : m;
1178
- ce(() => {
1179
- c(E), l(!1), s(null);
1183
+ de(() => {
1184
+ a(E), l(!1), s(null);
1180
1185
  });
1181
1186
  } else
1182
- c(void 0), l(!1), s(null);
1187
+ a(void 0), l(!1), s(null);
1183
1188
  } catch (m) {
1184
- console.error("[useModelProperty] Error updating model property:", m), c(void 0), l(!1), s(m);
1189
+ console.error("[useModelProperty] Error updating model property:", m), a(void 0), l(!1), s(m);
1185
1190
  }
1186
1191
  }, [u, f.type, f.propertyFileId, f.modelFileId, f.propertyName, f.schemaId, f.modelName]);
1187
1192
  I(() => {
1188
1193
  if (!h) {
1189
- c(void 0), l(!1), s(null);
1194
+ a(void 0), l(!1), s(null);
1190
1195
  return;
1191
1196
  }
1192
1197
  b();
@@ -1205,18 +1210,18 @@ function ur(e, r, t) {
1205
1210
  }, [i, b, v]), {
1206
1211
  modelProperty: i,
1207
1212
  isLoading: o,
1208
- error: a
1213
+ error: c
1209
1214
  };
1210
1215
  }
1211
- const fr = () => {
1212
- const e = _(void 0), [r, t] = w(!1), [n, i] = w(null), c = x(() => i(null), []), o = x(
1213
- (l, a, s) => {
1214
- if (i(null), t(!0), e.current?.unsubscribe(), e.current = void 0, !a || !s.name || !s.dataType) {
1216
+ const pr = () => {
1217
+ const e = F(void 0), [r, t] = w(!1), [n, i] = w(null), a = x(() => i(null), []), o = x(
1218
+ (l, c, s) => {
1219
+ if (i(null), t(!0), e.current?.unsubscribe(), e.current = void 0, !c || !s.name || !s.dataType) {
1215
1220
  const h = new Error("modelName, property name and dataType are required");
1216
1221
  throw i(h), t(!1), h;
1217
1222
  }
1218
- const d = Ge(l) ?? l, u = ue.create(
1219
- { ...s, modelName: a },
1223
+ const d = Ye(l) ?? l, u = fe.create(
1224
+ { ...s, modelName: c },
1220
1225
  { waitForReady: !1, schemaName: d }
1221
1226
  ), f = u.getService().subscribe((h) => {
1222
1227
  if (h.value === "error") {
@@ -1235,9 +1240,9 @@ const fr = () => {
1235
1240
  create: o,
1236
1241
  isLoading: r,
1237
1242
  error: n,
1238
- resetError: c
1243
+ resetError: a
1239
1244
  };
1240
- }, pr = () => {
1245
+ }, yr = () => {
1241
1246
  const [e, r] = w(null), [t, n] = w({
1242
1247
  isLoading: !1,
1243
1248
  error: null
@@ -1255,21 +1260,21 @@ const fr = () => {
1255
1260
  });
1256
1261
  };
1257
1262
  l();
1258
- const a = o.subscribe(l);
1259
- return () => a.unsubscribe();
1263
+ const c = o.subscribe(l);
1264
+ return () => c.unsubscribe();
1260
1265
  }, [e]);
1261
1266
  const i = x(async (o) => {
1262
1267
  o && (r(o), await o.destroy());
1263
- }, []), c = x(() => {
1268
+ }, []), a = x(() => {
1264
1269
  e && e.getService().send({ type: "clearDestroyError" });
1265
1270
  }, [e]);
1266
1271
  return {
1267
1272
  destroy: i,
1268
1273
  isLoading: t.isLoading,
1269
1274
  error: t.error,
1270
- resetError: c
1275
+ resetError: a
1271
1276
  };
1272
- }, yr = () => {
1277
+ }, mr = () => {
1273
1278
  const [e, r] = w(null), [t, n] = w({
1274
1279
  isLoading: !1,
1275
1280
  error: null
@@ -1287,77 +1292,77 @@ const fr = () => {
1287
1292
  });
1288
1293
  };
1289
1294
  l();
1290
- const a = o.subscribe(l);
1291
- return () => a.unsubscribe();
1295
+ const c = o.subscribe(l);
1296
+ return () => c.unsubscribe();
1292
1297
  }, [e]);
1293
1298
  const i = x(async (o) => {
1294
1299
  o && (r(o), await o.destroy());
1295
- }, []), c = x(() => {
1300
+ }, []), a = x(() => {
1296
1301
  e && e.getService().send({ type: "clearDestroyError" });
1297
1302
  }, [e]);
1298
1303
  return {
1299
1304
  deleteItem: i,
1300
1305
  isLoading: t.isLoading,
1301
1306
  error: t.error,
1302
- resetError: c
1307
+ resetError: a
1303
1308
  };
1304
1309
  }, ve = ["seed", "imageFiles"];
1305
- function mr() {
1306
- const e = H(), r = Y(), {
1310
+ function hr() {
1311
+ const e = z(), r = X(), {
1307
1312
  data: t = [],
1308
1313
  isLoading: n,
1309
1314
  error: i,
1310
- refetch: c
1311
- } = X({
1315
+ refetch: a
1316
+ } = Z({
1312
1317
  queryKey: ve,
1313
1318
  queryFn: () => j.listImageFiles(),
1314
1319
  enabled: e
1315
1320
  });
1316
1321
  return I(() => {
1317
- const o = (a) => {
1318
- a.includes("/images/") && r.invalidateQueries({ queryKey: ve });
1322
+ const o = (c) => {
1323
+ c.includes("/images/") && r.invalidateQueries({ queryKey: ve });
1319
1324
  }, l = () => {
1320
1325
  r.invalidateQueries({ queryKey: ve });
1321
1326
  };
1322
- return V.on("file-saved", o), V.on("fs.downloadAll.success", l), () => {
1323
- V.off("file-saved", o), V.off("fs.downloadAll.success", l);
1327
+ return K.on("file-saved", o), K.on("fs.downloadAll.success", l), () => {
1328
+ K.off("file-saved", o), K.off("fs.downloadAll.success", l);
1324
1329
  };
1325
1330
  }, [r]), {
1326
1331
  imageFiles: t,
1327
1332
  isLoading: n,
1328
1333
  error: i instanceof Error ? i : null,
1329
- refetch: c
1334
+ refetch: a
1330
1335
  };
1331
1336
  }
1332
- const bt = ["seed", "files"];
1333
- function hr(e = "files") {
1334
- const r = H(), t = Y(), n = D(() => [...bt, e], [e]), {
1337
+ const vt = ["seed", "files"];
1338
+ function gr(e = "files") {
1339
+ const r = z(), t = X(), n = D(() => [...vt, e], [e]), {
1335
1340
  data: i = [],
1336
- isLoading: c,
1341
+ isLoading: a,
1337
1342
  error: o,
1338
1343
  refetch: l
1339
- } = X({
1344
+ } = Z({
1340
1345
  queryKey: n,
1341
1346
  queryFn: () => j.listFiles(e),
1342
1347
  enabled: r
1343
1348
  });
1344
1349
  return I(() => {
1345
- const a = (d) => {
1350
+ const c = (d) => {
1346
1351
  d.includes(`/${e}/`) && t.invalidateQueries({ queryKey: n });
1347
1352
  }, s = () => {
1348
1353
  t.invalidateQueries({ queryKey: n });
1349
1354
  };
1350
- return V.on("file-saved", a), V.on("fs.downloadAll.success", s), () => {
1351
- V.off("file-saved", a), V.off("fs.downloadAll.success", s);
1355
+ return K.on("file-saved", c), K.on("fs.downloadAll.success", s), () => {
1356
+ K.off("file-saved", c), K.off("fs.downloadAll.success", s);
1352
1357
  };
1353
1358
  }, [t, e, n]), {
1354
1359
  files: i,
1355
- isLoading: c,
1360
+ isLoading: a,
1356
1361
  error: o instanceof Error ? o : null,
1357
1362
  refetch: l
1358
1363
  };
1359
1364
  }
1360
- const vt = {
1365
+ const St = {
1361
1366
  queries: {
1362
1367
  networkMode: "offlineFirst",
1363
1368
  gcTime: 1e3 * 60 * 60 * 24,
@@ -1367,9 +1372,9 @@ const vt = {
1367
1372
  }
1368
1373
  };
1369
1374
  function ze() {
1370
- return { ...vt };
1375
+ return { ...St };
1371
1376
  }
1372
- function St(e) {
1377
+ function wt(e) {
1373
1378
  const r = ze();
1374
1379
  return e ? {
1375
1380
  queries: {
@@ -1382,20 +1387,20 @@ function St(e) {
1382
1387
  }
1383
1388
  } : r;
1384
1389
  }
1385
- function wt(e) {
1390
+ function It(e) {
1386
1391
  const r = ze(), { defaultOptions: t, ...n } = e ?? {};
1387
- return new nt({
1392
+ return new st({
1388
1393
  ...n,
1389
- defaultOptions: t ? St(t) : r
1394
+ defaultOptions: t ? wt(t) : r
1390
1395
  });
1391
1396
  }
1392
1397
  let xe = null;
1393
- function gr(e) {
1398
+ function br(e) {
1394
1399
  const r = xe?.(e);
1395
1400
  return typeof window < "u" && window.__SEED_INVALIDATE_ITEM_PROPERTIES__ && window.__SEED_INVALIDATE_ITEM_PROPERTIES__(e), Promise.resolve(r).then(() => {
1396
1401
  });
1397
1402
  }
1398
- function It({ queryClient: e }) {
1403
+ function Et({ queryClient: e }) {
1399
1404
  return I(() => {
1400
1405
  const r = (n) => {
1401
1406
  const i = ["seed", "itemProperties", n];
@@ -1406,14 +1411,14 @@ function It({ queryClient: e }) {
1406
1411
  const i = n?.seedLocalId ?? n?.seedUid;
1407
1412
  i && r(i);
1408
1413
  };
1409
- return V.on("itemProperty.saved", t), () => {
1410
- V.off("itemProperty.saved", t), xe = null, typeof window < "u" && (window.__SEED_INVALIDATE_ITEM_PROPERTIES__ = null);
1414
+ return K.on("itemProperty.saved", t), () => {
1415
+ K.off("itemProperty.saved", t), xe = null, typeof window < "u" && (window.__SEED_INVALIDATE_ITEM_PROPERTIES__ = null);
1411
1416
  };
1412
1417
  }, [e]), null;
1413
1418
  }
1414
- function br({ children: e, queryClient: r, queryClientRef: t }) {
1419
+ function vr({ children: e, queryClient: r, queryClientRef: t }) {
1415
1420
  const n = D(
1416
- () => r ?? wt(),
1421
+ () => r ?? It(),
1417
1422
  [r]
1418
1423
  );
1419
1424
  if (t && (t.current = n, typeof window < "u")) {
@@ -1424,12 +1429,12 @@ function br({ children: e, queryClient: r, queryClientRef: t }) {
1424
1429
  } catch {
1425
1430
  }
1426
1431
  }
1427
- return /* @__PURE__ */ $(st, { client: n, children: [
1428
- /* @__PURE__ */ S(It, { queryClient: n }),
1432
+ return /* @__PURE__ */ U(ot, { client: n, children: [
1433
+ /* @__PURE__ */ S(Et, { queryClient: n }),
1429
1434
  e
1430
1435
  ] });
1431
1436
  }
1432
- function Et() {
1437
+ function Lt() {
1433
1438
  return /* @__PURE__ */ S(
1434
1439
  "div",
1435
1440
  {
@@ -1444,15 +1449,15 @@ function Et() {
1444
1449
  }
1445
1450
  );
1446
1451
  }
1447
- function vr({
1452
+ function Sr({
1448
1453
  initConfig: e,
1449
1454
  schema: r,
1450
1455
  loadingComponent: t,
1451
1456
  wrapperClassName: n,
1452
1457
  loadingClassName: i,
1453
- children: c
1458
+ children: a
1454
1459
  }) {
1455
- const o = H();
1460
+ const o = z();
1456
1461
  I(() => {
1457
1462
  const u = r ? {
1458
1463
  ...e,
@@ -1461,9 +1466,9 @@ function vr({
1461
1466
  schema: r
1462
1467
  }
1463
1468
  } : e;
1464
- Ye.init(u);
1469
+ Xe.init(u);
1465
1470
  }, [e, r]);
1466
- const l = t ?? /* @__PURE__ */ S(Et, {}), a = n ? void 0 : { position: "relative", display: "flex", height: "100vh", width: "100vw" }, s = {
1471
+ const l = t ?? /* @__PURE__ */ S(Lt, {}), c = n ? void 0 : { position: "relative", display: "flex", height: "100vh", width: "100vw" }, s = {
1467
1472
  display: o ? "none" : "flex",
1468
1473
  ...!i && {
1469
1474
  position: "absolute",
@@ -1473,7 +1478,7 @@ function vr({
1473
1478
  justifyContent: "center"
1474
1479
  }
1475
1480
  };
1476
- return /* @__PURE__ */ $("div", { className: n, style: a, children: [
1481
+ return /* @__PURE__ */ U("div", { className: n, style: c, children: [
1477
1482
  /* @__PURE__ */ S(
1478
1483
  "div",
1479
1484
  {
@@ -1487,29 +1492,29 @@ function vr({
1487
1492
  flex: 1,
1488
1493
  display: o ? "flex" : "none",
1489
1494
  flexDirection: "column"
1490
- }, children: c })
1495
+ }, children: a })
1491
1496
  ] });
1492
1497
  }
1493
1498
  async function He(e, r = "") {
1494
1499
  const t = [];
1495
1500
  try {
1496
1501
  for await (const [n, i] of e.entries()) {
1497
- const c = r ? `${r}/${n}` : n;
1502
+ const a = r ? `${r}/${n}` : n;
1498
1503
  if (i.kind === "file")
1499
1504
  try {
1500
1505
  const o = await i.getFile();
1501
1506
  t.push({
1502
1507
  name: n,
1503
- path: c,
1508
+ path: a,
1504
1509
  size: o.size,
1505
1510
  type: o.type || "application/octet-stream",
1506
1511
  lastModified: o.lastModified
1507
1512
  });
1508
1513
  } catch (o) {
1509
- console.warn(`Failed to read file ${c}:`, o);
1514
+ console.warn(`Failed to read file ${a}:`, o);
1510
1515
  }
1511
1516
  else if (i.kind === "directory") {
1512
- const o = await He(i, c);
1517
+ const o = await He(i, a);
1513
1518
  t.push(...o);
1514
1519
  }
1515
1520
  }
@@ -1518,9 +1523,9 @@ async function He(e, r = "") {
1518
1523
  }
1519
1524
  return t;
1520
1525
  }
1521
- function Lt(e = {}) {
1522
- const { rootPath: r } = e, [t, n] = w([]), [i, c] = w(!0), [o, l] = w(null), a = x(async () => {
1523
- c(!0), l(null);
1526
+ function xt(e = {}) {
1527
+ const { rootPath: r } = e, [t, n] = w([]), [i, a] = w(!0), [o, l] = w(null), c = x(async () => {
1528
+ a(!0), l(null);
1524
1529
  try {
1525
1530
  let d = await navigator.storage.getDirectory();
1526
1531
  if (r) {
@@ -1535,14 +1540,14 @@ function Lt(e = {}) {
1535
1540
  "Failed to access OPFS: " + (s instanceof Error ? s.message : String(s))
1536
1541
  ), console.error("OPFS access error:", s);
1537
1542
  } finally {
1538
- c(!1);
1543
+ a(!1);
1539
1544
  }
1540
1545
  }, [r]);
1541
1546
  return I(() => {
1542
- a();
1543
- }, [a]), { files: t, isLoading: i, error: o, refetch: a };
1547
+ c();
1548
+ }, [c]), { files: t, isLoading: i, error: o, refetch: c };
1544
1549
  }
1545
- const Pe = () => /* @__PURE__ */ S("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", style: { width: 20, height: 20 }, children: /* @__PURE__ */ S("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" }) }), xt = () => /* @__PURE__ */ S("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", style: { width: 48, height: 48 }, children: /* @__PURE__ */ S("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.25 12.75V12a2.25 2.25 0 012.25-2.25h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z" }) }), Nt = () => /* @__PURE__ */ S("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", style: { width: 20, height: 20 }, children: /* @__PURE__ */ S("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" }) }), Re = () => /* @__PURE__ */ S("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", style: { width: 20, height: 20 }, children: /* @__PURE__ */ S("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }), At = () => /* @__PURE__ */ $(
1550
+ const Pe = () => /* @__PURE__ */ S("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", style: { width: 20, height: 20 }, children: /* @__PURE__ */ S("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" }) }), Nt = () => /* @__PURE__ */ S("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", style: { width: 48, height: 48 }, children: /* @__PURE__ */ S("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.25 12.75V12a2.25 2.25 0 012.25-2.25h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z" }) }), At = () => /* @__PURE__ */ S("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", style: { width: 20, height: 20 }, children: /* @__PURE__ */ S("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" }) }), Re = () => /* @__PURE__ */ S("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", style: { width: 20, height: 20 }, children: /* @__PURE__ */ S("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" }) }), _t = () => /* @__PURE__ */ U(
1546
1551
  "svg",
1547
1552
  {
1548
1553
  xmlns: "http://www.w3.org/2000/svg",
@@ -1578,10 +1583,10 @@ function Dt(e) {
1578
1583
  const r = 1024, t = ["Bytes", "KB", "MB", "GB"], n = Math.floor(Math.log(e) / Math.log(r));
1579
1584
  return Math.round(e / Math.pow(r, n) * 100) / 100 + " " + t[n];
1580
1585
  }
1581
- function _t(e) {
1586
+ function Ft(e) {
1582
1587
  return new Date(e).toLocaleString();
1583
1588
  }
1584
- async function Ft(e, r) {
1589
+ async function Ct(e, r) {
1585
1590
  const t = e.path.split("/").filter(Boolean);
1586
1591
  if (t.length === 0) throw new Error("Invalid file path");
1587
1592
  let n = r;
@@ -1594,12 +1599,12 @@ async function Me(e, r) {
1594
1599
  const t = e.split("/").filter(Boolean);
1595
1600
  if (t.length === 0) throw new Error("Invalid file path");
1596
1601
  let n = r;
1597
- for (let c = 0; c < t.length - 1; c++)
1598
- n = await n.getDirectoryHandle(t[c]);
1602
+ for (let a = 0; a < t.length - 1; a++)
1603
+ n = await n.getDirectoryHandle(t[a]);
1599
1604
  const i = t[t.length - 1];
1600
1605
  await n.removeEntry(i);
1601
1606
  }
1602
- const Ct = {
1607
+ const Pt = {
1603
1608
  light: {
1604
1609
  title: "text-gray-900",
1605
1610
  description: "text-gray-500",
@@ -1644,7 +1649,7 @@ const Ct = {
1644
1649
  actionButton: "text-gray-400 hover:text-indigo-400",
1645
1650
  deleteButton: "text-gray-400 hover:text-red-500"
1646
1651
  }
1647
- }, R = {
1652
+ }, P = {
1648
1653
  container: { padding: "2rem 0" },
1649
1654
  header: {
1650
1655
  display: "flex",
@@ -1663,23 +1668,23 @@ const Ct = {
1663
1668
  errorBox: "rounded-md border p-4 mt-4",
1664
1669
  emptyState: "text-center py-12"
1665
1670
  };
1666
- function Sr({
1671
+ function wr({
1667
1672
  rootPath: e,
1668
1673
  filter: r,
1669
1674
  onBeforeDelete: t,
1670
1675
  onAfterDelete: n,
1671
1676
  onDownload: i,
1672
- title: c = "Files",
1677
+ title: a = "Files",
1673
1678
  description: o = "Browse and download all files stored in the Origin Private File System (OPFS).",
1674
1679
  theme: l = "dark",
1675
- className: a
1680
+ className: c
1676
1681
  }) {
1677
- const s = Ct[l], { files: d, isLoading: u, error: f, refetch: h } = Lt({ rootPath: e }), b = r ? d.filter(r) : d, [v, p] = w(/* @__PURE__ */ new Set()), y = _(null), m = b.length > 0 && v.size === b.length, E = v.size > 0 && v.size < b.length, g = (L) => {
1678
- p((C) => {
1679
- const P = new Set(C);
1680
- return P.has(L) ? P.delete(L) : P.add(L), P;
1682
+ const s = Pt[l], { files: d, isLoading: u, error: f, refetch: h } = xt({ rootPath: e }), b = r ? d.filter(r) : d, [v, p] = w(/* @__PURE__ */ new Set()), y = F(null), m = b.length > 0 && v.size === b.length, E = v.size > 0 && v.size < b.length, g = (L) => {
1683
+ p((k) => {
1684
+ const _ = new Set(k);
1685
+ return _.has(L) ? _.delete(L) : _.add(L), _;
1681
1686
  });
1682
- }, z = () => {
1687
+ }, B = () => {
1683
1688
  p(
1684
1689
  v.size === b.length ? /* @__PURE__ */ new Set() : new Set(b.map((L) => L.path))
1685
1690
  );
@@ -1689,88 +1694,88 @@ function Sr({
1689
1694
  }, [b.length]), I(() => {
1690
1695
  y.current && (y.current.indeterminate = E);
1691
1696
  }, [E]);
1692
- const N = async (L, C = !1) => {
1697
+ const R = async (L, k = !1) => {
1693
1698
  try {
1694
- const P = await navigator.storage.getDirectory(), B = await Ft(L, P);
1699
+ const _ = await navigator.storage.getDirectory(), q = await Ct(L, _);
1695
1700
  if (i)
1696
- await i(L, B);
1701
+ await i(L, q);
1697
1702
  else {
1698
- const Q = URL.createObjectURL(B), U = document.createElement("a");
1699
- U.href = Q, U.download = L.name, document.body.appendChild(U), U.click(), document.body.removeChild(U), URL.revokeObjectURL(Q);
1703
+ const V = URL.createObjectURL(q), M = document.createElement("a");
1704
+ M.href = V, M.download = L.name, document.body.appendChild(M), M.click(), document.body.removeChild(M), URL.revokeObjectURL(V);
1700
1705
  }
1701
- } catch (P) {
1702
- const B = "Failed to download file: " + (P instanceof Error ? P.message : String(P));
1703
- throw C || alert(B), P;
1706
+ } catch (_) {
1707
+ const q = "Failed to download file: " + (_ instanceof Error ? _.message : String(_));
1708
+ throw k || alert(q), _;
1704
1709
  }
1705
- }, M = async (L) => {
1710
+ }, N = async (L) => {
1706
1711
  if (!(t && !await t(L)) && confirm(`Are you sure you want to delete "${L.name}"? This action cannot be undone.`))
1707
1712
  try {
1708
- const C = await navigator.storage.getDirectory();
1709
- await Me(L.path, C), await h(), await n?.([L.path]);
1710
- } catch (C) {
1711
- alert("Failed to delete file: " + (C instanceof Error ? C.message : String(C)));
1713
+ const k = await navigator.storage.getDirectory();
1714
+ await Me(L.path, k), await h(), await n?.([L.path]);
1715
+ } catch (k) {
1716
+ alert("Failed to delete file: " + (k instanceof Error ? k.message : String(k)));
1712
1717
  }
1713
- }, q = async () => {
1718
+ }, H = async () => {
1714
1719
  if (v.size === 0) return;
1715
- const L = b.filter((P) => v.has(P.path)), C = [];
1716
- for (const P of L)
1720
+ const L = b.filter((_) => v.has(_.path)), k = [];
1721
+ for (const _ of L)
1717
1722
  try {
1718
- await N(P, !0), await new Promise((B) => setTimeout(B, 100));
1719
- } catch (B) {
1720
- C.push(`${P.name}: ${B instanceof Error ? B.message : String(B)}`);
1723
+ await R(_, !0), await new Promise((q) => setTimeout(q, 100));
1724
+ } catch (q) {
1725
+ k.push(`${_.name}: ${q instanceof Error ? q.message : String(q)}`);
1721
1726
  }
1722
- C.length > 0 && alert(`Some downloads failed:
1723
- ${C.join(`
1727
+ k.length > 0 && alert(`Some downloads failed:
1728
+ ${k.join(`
1724
1729
  `)}`);
1725
- }, K = async () => {
1730
+ }, Q = async () => {
1726
1731
  if (v.size === 0) return;
1727
- const L = b.filter((U) => v.has(U.path)), C = L.map((U) => U.name).join(", ");
1732
+ const L = b.filter((M) => v.has(M.path)), k = L.map((M) => M.name).join(", ");
1728
1733
  if (!confirm(
1729
1734
  `Are you sure you want to delete ${v.size} file(s)?
1730
1735
 
1731
- Files: ${C}
1736
+ Files: ${k}
1732
1737
 
1733
1738
  This action cannot be undone.`
1734
1739
  ))
1735
1740
  return;
1736
- const P = await navigator.storage.getDirectory(), B = [], Q = [];
1737
- for (const U of L)
1738
- if (!(t && !await t(U)))
1741
+ const _ = await navigator.storage.getDirectory(), q = [], V = [];
1742
+ for (const M of L)
1743
+ if (!(t && !await t(M)))
1739
1744
  try {
1740
- await Me(U.path, P), B.push(U.path);
1741
- } catch (te) {
1742
- Q.push(`${U.name}: ${te instanceof Error ? te.message : String(te)}`);
1745
+ await Me(M.path, _), q.push(M.path);
1746
+ } catch (G) {
1747
+ V.push(`${M.name}: ${G instanceof Error ? G.message : String(G)}`);
1743
1748
  }
1744
- p(/* @__PURE__ */ new Set()), await h(), B.length > 0 && await n?.(B), Q.length > 0 && alert(`Some deletions failed:
1745
- ${Q.join(`
1749
+ p(/* @__PURE__ */ new Set()), await h(), q.length > 0 && await n?.(q), V.length > 0 && alert(`Some deletions failed:
1750
+ ${V.join(`
1746
1751
  `)}`);
1747
1752
  };
1748
- return /* @__PURE__ */ $("div", { className: a, style: R.container, children: [
1753
+ return /* @__PURE__ */ U("div", { className: c, style: P.container, children: [
1749
1754
  /* @__PURE__ */ S("style", { children: "@keyframes opfs-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}" }),
1750
- /* @__PURE__ */ $("div", { style: R.header, children: [
1751
- /* @__PURE__ */ $("div", { style: { flex: 1, minWidth: 0 }, children: [
1752
- /* @__PURE__ */ S("h1", { style: R.title, className: s.title, children: c }),
1753
- /* @__PURE__ */ S("p", { style: R.description, className: s.description, children: o })
1755
+ /* @__PURE__ */ U("div", { style: P.header, children: [
1756
+ /* @__PURE__ */ U("div", { style: { flex: 1, minWidth: 0 }, children: [
1757
+ /* @__PURE__ */ S("h1", { style: P.title, className: s.title, children: a }),
1758
+ /* @__PURE__ */ S("p", { style: P.description, className: s.description, children: o })
1754
1759
  ] }),
1755
- /* @__PURE__ */ S("button", { type: "button", onClick: h, className: R.button, children: "Refresh" })
1760
+ /* @__PURE__ */ S("button", { type: "button", onClick: h, className: P.button, children: "Refresh" })
1756
1761
  ] }),
1757
- v.size > 0 && /* @__PURE__ */ $(
1762
+ v.size > 0 && /* @__PURE__ */ U(
1758
1763
  "div",
1759
1764
  {
1760
1765
  className: `mt-4 flex items-center justify-between rounded-lg border px-4 py-3 ${s.batchBar}`,
1761
1766
  children: [
1762
- /* @__PURE__ */ $("span", { className: `text-sm font-medium ${s.batchText}`, children: [
1767
+ /* @__PURE__ */ U("span", { className: `text-sm font-medium ${s.batchText}`, children: [
1763
1768
  v.size,
1764
1769
  " file",
1765
1770
  v.size === 1 ? "" : "s",
1766
1771
  " selected"
1767
1772
  ] }),
1768
- /* @__PURE__ */ $("div", { className: "flex items-center gap-3", children: [
1769
- /* @__PURE__ */ S("button", { onClick: q, className: R.button, children: /* @__PURE__ */ $("span", { className: "inline-flex items-center gap-2", children: [
1773
+ /* @__PURE__ */ U("div", { className: "flex items-center gap-3", children: [
1774
+ /* @__PURE__ */ S("button", { onClick: H, className: P.button, children: /* @__PURE__ */ U("span", { className: "inline-flex items-center gap-2", children: [
1770
1775
  /* @__PURE__ */ S(Pe, {}),
1771
1776
  " Download All"
1772
1777
  ] }) }),
1773
- /* @__PURE__ */ S("button", { onClick: K, className: R.buttonDanger, children: /* @__PURE__ */ $("span", { className: "inline-flex items-center gap-2", children: [
1778
+ /* @__PURE__ */ S("button", { onClick: Q, className: P.buttonDanger, children: /* @__PURE__ */ U("span", { className: "inline-flex items-center gap-2", children: [
1774
1779
  /* @__PURE__ */ S(Re, {}),
1775
1780
  " Delete All"
1776
1781
  ] }) }),
@@ -1786,43 +1791,43 @@ ${Q.join(`
1786
1791
  ]
1787
1792
  }
1788
1793
  ),
1789
- /* @__PURE__ */ S("div", { className: "mt-8", children: u ? /* @__PURE__ */ $("div", { className: "flex justify-center items-center py-12 gap-3", children: [
1790
- /* @__PURE__ */ S("span", { style: { animation: "opfs-spin 1s linear infinite" }, children: /* @__PURE__ */ S(At, {}) }),
1794
+ /* @__PURE__ */ S("div", { className: "mt-8", children: u ? /* @__PURE__ */ U("div", { className: "flex justify-center items-center py-12 gap-3", children: [
1795
+ /* @__PURE__ */ S("span", { style: { animation: "opfs-spin 1s linear infinite" }, children: /* @__PURE__ */ S(_t, {}) }),
1791
1796
  /* @__PURE__ */ S("span", { className: s.loadingText, children: "Loading files..." })
1792
- ] }) : f ? /* @__PURE__ */ $("div", { className: `${R.errorBox} ${s.errorBox}`, children: [
1797
+ ] }) : f ? /* @__PURE__ */ U("div", { className: `${P.errorBox} ${s.errorBox}`, children: [
1793
1798
  /* @__PURE__ */ S("h3", { className: `m-0 text-sm font-medium ${s.errorTitle}`, children: "Error" }),
1794
1799
  /* @__PURE__ */ S("div", { className: `mt-2 text-sm ${s.errorText}`, children: f })
1795
- ] }) : b.length === 0 ? /* @__PURE__ */ $("div", { className: R.emptyState, children: [
1796
- /* @__PURE__ */ S("span", { className: s.emptyIcon, children: /* @__PURE__ */ S(xt, {}) }),
1800
+ ] }) : b.length === 0 ? /* @__PURE__ */ U("div", { className: P.emptyState, children: [
1801
+ /* @__PURE__ */ S("span", { className: s.emptyIcon, children: /* @__PURE__ */ S(Nt, {}) }),
1797
1802
  /* @__PURE__ */ S("h3", { className: `mt-2 text-sm font-semibold ${s.emptyTitle}`, children: "No files" }),
1798
1803
  /* @__PURE__ */ S("p", { className: `mt-1 text-sm ${s.emptyText}`, children: "No files found in OPFS." })
1799
- ] }) : /* @__PURE__ */ S("div", { className: "overflow-x-auto", children: /* @__PURE__ */ $("table", { className: R.table, children: [
1800
- /* @__PURE__ */ S("thead", { children: /* @__PURE__ */ $("tr", { className: s.tableBorder, children: [
1801
- /* @__PURE__ */ S("th", { className: `${R.tableHeader} w-10 ${s.tableHeader}`, children: /* @__PURE__ */ S(
1804
+ ] }) : /* @__PURE__ */ S("div", { className: "overflow-x-auto", children: /* @__PURE__ */ U("table", { className: P.table, children: [
1805
+ /* @__PURE__ */ S("thead", { children: /* @__PURE__ */ U("tr", { className: s.tableBorder, children: [
1806
+ /* @__PURE__ */ S("th", { className: `${P.tableHeader} w-10 ${s.tableHeader}`, children: /* @__PURE__ */ S(
1802
1807
  "input",
1803
1808
  {
1804
1809
  ref: y,
1805
1810
  type: "checkbox",
1806
1811
  checked: m,
1807
- onChange: z,
1812
+ onChange: B,
1808
1813
  "aria-label": "Select all"
1809
1814
  }
1810
1815
  ) }),
1811
- /* @__PURE__ */ S("th", { className: `${R.tableHeader} ${s.tableHeader}`, children: "Name" }),
1812
- /* @__PURE__ */ S("th", { className: `${R.tableHeader} ${s.tableHeader}`, children: "Path" }),
1813
- /* @__PURE__ */ S("th", { className: `${R.tableHeader} ${s.tableHeader}`, children: "Size" }),
1814
- /* @__PURE__ */ S("th", { className: `${R.tableHeader} ${s.tableHeader}`, children: "Type" }),
1815
- /* @__PURE__ */ S("th", { className: `${R.tableHeader} ${s.tableHeader}`, children: "Modified" }),
1816
+ /* @__PURE__ */ S("th", { className: `${P.tableHeader} ${s.tableHeader}`, children: "Name" }),
1817
+ /* @__PURE__ */ S("th", { className: `${P.tableHeader} ${s.tableHeader}`, children: "Path" }),
1818
+ /* @__PURE__ */ S("th", { className: `${P.tableHeader} ${s.tableHeader}`, children: "Size" }),
1819
+ /* @__PURE__ */ S("th", { className: `${P.tableHeader} ${s.tableHeader}`, children: "Type" }),
1820
+ /* @__PURE__ */ S("th", { className: `${P.tableHeader} ${s.tableHeader}`, children: "Modified" }),
1816
1821
  /* @__PURE__ */ S(
1817
1822
  "th",
1818
1823
  {
1819
- className: `${R.tableHeader} w-24 ${s.tableHeader}`,
1824
+ className: `${P.tableHeader} w-24 ${s.tableHeader}`,
1820
1825
  "aria-label": "Actions"
1821
1826
  }
1822
1827
  )
1823
1828
  ] }) }),
1824
- /* @__PURE__ */ S("tbody", { className: `divide-y ${s.tableBorder}`, children: b.map((L) => /* @__PURE__ */ $("tr", { className: s.tableRow, children: [
1825
- /* @__PURE__ */ S("td", { className: `${R.tableCell} ${s.tableCell}`, children: /* @__PURE__ */ S(
1829
+ /* @__PURE__ */ S("tbody", { className: `divide-y ${s.tableBorder}`, children: b.map((L) => /* @__PURE__ */ U("tr", { className: s.tableRow, children: [
1830
+ /* @__PURE__ */ S("td", { className: `${P.tableCell} ${s.tableCell}`, children: /* @__PURE__ */ S(
1826
1831
  "input",
1827
1832
  {
1828
1833
  type: "checkbox",
@@ -1831,20 +1836,20 @@ ${Q.join(`
1831
1836
  "aria-label": `Select ${L.name}`
1832
1837
  }
1833
1838
  ) }),
1834
- /* @__PURE__ */ S("td", { className: `${R.tableCell} ${s.tableCell}`, children: /* @__PURE__ */ $("span", { className: "flex items-center gap-2", children: [
1835
- /* @__PURE__ */ S(Nt, {}),
1839
+ /* @__PURE__ */ S("td", { className: `${P.tableCell} ${s.tableCell}`, children: /* @__PURE__ */ U("span", { className: "flex items-center gap-2", children: [
1840
+ /* @__PURE__ */ S(At, {}),
1836
1841
  L.name
1837
1842
  ] }) }),
1838
- /* @__PURE__ */ S("td", { className: `${R.tableCell} ${s.tableCellMuted}`, children: /* @__PURE__ */ S("code", { className: `text-xs px-2 py-1 rounded border ${s.codeBlock}`, children: L.path }) }),
1839
- /* @__PURE__ */ S("td", { className: `${R.tableCell} ${s.tableCellMuted}`, children: Dt(L.size) }),
1840
- /* @__PURE__ */ S("td", { className: `${R.tableCell} ${s.tableCellMuted}`, children: L.type }),
1841
- /* @__PURE__ */ S("td", { className: `${R.tableCell} ${s.tableCellMuted}`, children: _t(L.lastModified) }),
1842
- /* @__PURE__ */ S("td", { className: R.tableCell, children: /* @__PURE__ */ $("div", { className: "flex gap-2 justify-end", children: [
1843
+ /* @__PURE__ */ S("td", { className: `${P.tableCell} ${s.tableCellMuted}`, children: /* @__PURE__ */ S("code", { className: `text-xs px-2 py-1 rounded border ${s.codeBlock}`, children: L.path }) }),
1844
+ /* @__PURE__ */ S("td", { className: `${P.tableCell} ${s.tableCellMuted}`, children: Dt(L.size) }),
1845
+ /* @__PURE__ */ S("td", { className: `${P.tableCell} ${s.tableCellMuted}`, children: L.type }),
1846
+ /* @__PURE__ */ S("td", { className: `${P.tableCell} ${s.tableCellMuted}`, children: Ft(L.lastModified) }),
1847
+ /* @__PURE__ */ S("td", { className: P.tableCell, children: /* @__PURE__ */ U("div", { className: "flex gap-2 justify-end", children: [
1843
1848
  /* @__PURE__ */ S(
1844
1849
  "button",
1845
1850
  {
1846
1851
  type: "button",
1847
- onClick: () => N(L),
1852
+ onClick: () => R(L),
1848
1853
  title: "Download",
1849
1854
  className: `p-1.5 rounded cursor-pointer bg-transparent border-0 transition-colors ${s.actionButton}`,
1850
1855
  children: /* @__PURE__ */ S(Pe, {})
@@ -1854,7 +1859,7 @@ ${Q.join(`
1854
1859
  "button",
1855
1860
  {
1856
1861
  type: "button",
1857
- onClick: () => M(L),
1862
+ onClick: () => N(L),
1858
1863
  title: "Delete",
1859
1864
  className: `p-1.5 rounded cursor-pointer bg-transparent border-0 transition-colors ${s.deleteButton}`,
1860
1865
  children: /* @__PURE__ */ S(Re, {})
@@ -1865,65 +1870,71 @@ ${Q.join(`
1865
1870
  ] }) }) })
1866
1871
  ] });
1867
1872
  }
1868
- const Se = J("seedSdk:react:SeedImage"), le = /* @__PURE__ */ new Map(), Qe = (e) => {
1873
+ const Se = J("seedSdk:react:SeedImage"), ce = /* @__PURE__ */ new Map(), Qe = (e) => {
1869
1874
  const r = /^(.*[\/\\])?([^\/\\]+?)(\.[^.\/\\]*)?$/, t = e.match(r);
1870
1875
  return t && t[2] ? t[2] : e;
1871
1876
  };
1872
- function Pt(e) {
1877
+ function Rt(e) {
1873
1878
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1874
1879
  }
1875
- function Rt(e, r) {
1876
- const t = new RegExp(`^${Pt(r)}$`), n = Qe(e);
1880
+ function Mt(e, r) {
1881
+ const t = new RegExp(`^${Rt(r)}$`), n = Qe(e);
1877
1882
  return t.test(n);
1878
1883
  }
1879
- const Mt = ({ imageProperty: e, width: r, filename: t, ...n }) => {
1880
- const [i, c] = w(), [o, l] = w(), { property: a } = Ue({
1884
+ const Tt = ({ imageProperty: e, width: r, filename: t, ...n }) => {
1885
+ const [i, a] = w(), [o, l] = w(), { property: c } = Ue({
1881
1886
  propertyName: e.propertyName,
1882
1887
  seedLocalId: e.seedLocalId,
1883
1888
  seedUid: e.seedUid
1884
- }), s = e ?? a, d = t ?? s?.refResolvedValue ?? s?.value, u = s?.value, f = typeof u == "string" ? u : d, h = u != null && (u instanceof File || u instanceof Blob), [b, v] = w(null), p = Te.useRef(null);
1889
+ }), s = e ?? c, d = t ?? s?.refResolvedValue ?? s?.value, u = s?.value, f = typeof u == "string" ? u : d, h = u != null && (u instanceof File || u instanceof Blob), [b, v] = w(null), p = Te.useRef(null);
1885
1890
  I(() => {
1886
1891
  if (h && (u instanceof File || u instanceof Blob))
1887
1892
  return p.current || (p.current = URL.createObjectURL(u), v(p.current)), () => {
1888
1893
  p.current && (URL.revokeObjectURL(p.current), p.current = null), v(null);
1889
1894
  };
1890
1895
  p.current = null, v(null);
1891
- }, [h, u]), I(() => !d || u && ((N) => typeof N == "string" && N.startsWith("blob:"))(u) || b ? void 0 : ((async () => {
1892
- try {
1893
- const N = s?.localStoragePath ? s.localStoragePath : `${j.getFilesPath("images")}/${d}`;
1894
- if (await j.pathExists(N)) {
1895
- const q = await j.getContentUrlFromPath(N);
1896
- q && l(q);
1896
+ }, [h, u]), I(() => {
1897
+ if (!d || u && ((N) => typeof N == "string" && N.startsWith("blob:"))(u) || b) return;
1898
+ let B = !1;
1899
+ return (async () => {
1900
+ try {
1901
+ const N = s?.localStoragePath ? s.localStoragePath : `${j.getFilesPath("images")}/${d}`;
1902
+ if (await j.pathExists(N)) {
1903
+ const Q = await j.getContentUrlFromPath(N);
1904
+ !B && Q && l(Q);
1905
+ }
1906
+ } catch (N) {
1907
+ Se("_getOriginalContentUrl error", N);
1897
1908
  }
1898
- } catch (N) {
1899
- Se("_getOriginalContentUrl error", N);
1900
- }
1901
- })(), () => l(void 0)), [d, u, b, s?.localStoragePath]), I(() => {
1909
+ })(), () => {
1910
+ B = !0;
1911
+ };
1912
+ }, [d, u, b, s?.localStoragePath]), I(() => {
1902
1913
  if (!r || !d)
1903
1914
  return;
1904
1915
  (async () => {
1905
1916
  try {
1906
- const z = await j.getFs(), N = s?.localStoragePath ? s.localStoragePath.split("/").slice(0, -1).join("/") : j.getFilesPath("images"), K = z.readdirSync(N, { withFileTypes: !0 }).filter((k) => k.isDirectory()).map((k) => parseInt(k.name)), L = K.reduce((k, he) => Math.abs(he - r) < Math.abs(k - r) ? he : k, K[0]), C = Qe(d), P = `${C}-${L}`;
1907
- if (le.has(P))
1917
+ const B = await j.getFs(), R = s?.localStoragePath ? s.localStoragePath.split("/").slice(0, -1).join("/") : j.getFilesPath("images"), Q = B.readdirSync(R, { withFileTypes: !0 }).filter(($) => $.isDirectory()).map(($) => parseInt($.name)), L = Q.reduce(($, re) => Math.abs(re - r) < Math.abs($ - r) ? re : $, Q[0]), k = Qe(d), _ = `${k}-${L}`;
1918
+ if (ce.has(_))
1908
1919
  try {
1909
- const k = le.get(P);
1910
- if (k && (await fetch(k)).ok) {
1911
- c(k);
1920
+ const $ = ce.get(_);
1921
+ if ($ && (await fetch($)).ok) {
1922
+ a($);
1912
1923
  return;
1913
1924
  }
1914
- } catch (k) {
1915
- Se("error", k), le.delete(P);
1925
+ } catch ($) {
1926
+ Se("error", $), ce.delete(_);
1916
1927
  }
1917
- const Q = z.readdirSync(`${N}/${L}`, { withFileTypes: !0 }).find((k) => k.name ? Rt(k.name, C) : !1);
1918
- if (!Q)
1928
+ const V = B.readdirSync(`${R}/${L}`, { withFileTypes: !0 }).find(($) => $.name ? Mt($.name, k) : !1);
1929
+ if (!V)
1919
1930
  return;
1920
- const U = `${N}/${L}/${Q?.name}`;
1921
- if (await j.pathExists(U)) {
1922
- const k = await j.getContentUrlFromPath(U);
1923
- k && (le.set(P, k), c(k));
1931
+ const M = `${R}/${L}/${V?.name}`;
1932
+ if (await j.pathExists(M)) {
1933
+ const $ = await j.getContentUrlFromPath(M);
1934
+ $ && (ce.set(_, $), a($));
1924
1935
  }
1925
- } catch (z) {
1926
- Se("_getSizedContentUrl error", z);
1936
+ } catch (B) {
1937
+ Se("_getSizedContentUrl error", B);
1927
1938
  }
1928
1939
  })();
1929
1940
  }, [s, r, f, d]);
@@ -1932,57 +1943,57 @@ const Mt = ({ imageProperty: e, width: r, filename: t, ...n }) => {
1932
1943
  return null;
1933
1944
  const E = i || o || b || (y(f) ? f : void 0) || "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
1934
1945
  return /* @__PURE__ */ S("img", { src: E, alt: n.alt || e.propertyName || "Image", ...n });
1935
- }, wr = Te.memo(
1936
- Mt,
1946
+ }, Ir = Te.memo(
1947
+ Tt,
1937
1948
  (e, r) => e.imageProperty === r.imageProperty && e.width === r.width && e.filename === r.filename
1938
1949
  );
1939
1950
  export {
1940
- bt as FILES_QUERY_KEY_PREFIX,
1941
- Sr as OPFSFilesManager,
1942
- vr as SeedClientGate,
1943
- wr as SeedImage,
1944
- br as SeedProvider,
1945
- wt as createSeedQueryClient,
1951
+ vt as FILES_QUERY_KEY_PREFIX,
1952
+ wr as OPFSFilesManager,
1953
+ Sr as SeedClientGate,
1954
+ Ir as SeedImage,
1955
+ vr as SeedProvider,
1956
+ It as createSeedQueryClient,
1946
1957
  ze as getSeedQueryDefaultOptions,
1947
1958
  Oe as getServiceName,
1948
1959
  Ae as getServiceUniqueKey,
1949
1960
  Fe as getServiceValue,
1950
- gr as invalidateItemPropertiesForItem,
1951
- St as mergeSeedQueryDefaults,
1952
- ir as useAllSchemaVersions,
1953
- Wt as useCreateItem,
1954
- Xt as useCreateItemProperty,
1955
- lr as useCreateModel,
1956
- fr as useCreateModelProperty,
1957
- sr as useCreateSchema,
1958
- rr as useDbsAreReady,
1959
- Gt as useDebouncedItemProperty,
1960
- yr as useDeleteItem,
1961
- Zt as useDestroyItemProperty,
1962
- cr as useDestroyModel,
1963
- pr as useDestroyModelProperty,
1964
- or as useDestroySchema,
1965
- hr as useFiles,
1966
- ft as useGlobalServiceStatus,
1967
- dt as useHasSavedSnapshots,
1968
- mr as useImageFiles,
1969
- ct as useIsDbReady,
1970
- Kt as useItem,
1971
- Yt as useItemProperties,
1961
+ br as invalidateItemPropertiesForItem,
1962
+ wt as mergeSeedQueryDefaults,
1963
+ ar as useAllSchemaVersions,
1964
+ Gt as useCreateItem,
1965
+ Zt as useCreateItemProperty,
1966
+ cr as useCreateModel,
1967
+ pr as useCreateModelProperty,
1968
+ or as useCreateSchema,
1969
+ nr as useDbsAreReady,
1970
+ Yt as useDebouncedItemProperty,
1971
+ mr as useDeleteItem,
1972
+ er as useDestroyItemProperty,
1973
+ dr as useDestroyModel,
1974
+ yr as useDestroyModelProperty,
1975
+ ir as useDestroySchema,
1976
+ gr as useFiles,
1977
+ pt as useGlobalServiceStatus,
1978
+ ut as useHasSavedSnapshots,
1979
+ hr as useImageFiles,
1980
+ dt as useIsDbReady,
1981
+ jt as useItem,
1982
+ Xt as useItemProperties,
1972
1983
  Ue as useItemProperty,
1973
- jt as useItems,
1974
- oe as useLiveQuery,
1975
- ht as useModel,
1976
- dr as useModelProperties,
1977
- ur as useModelProperty,
1978
- mt as useModels,
1979
- Lt as useOPFSFiles,
1980
- tr as usePersistedSnapshots,
1984
+ Wt as useItems,
1985
+ ie as useLiveQuery,
1986
+ gt as useModel,
1987
+ ur as useModelProperties,
1988
+ fr as useModelProperty,
1989
+ ht as useModels,
1990
+ xt as useOPFSFiles,
1991
+ rr as usePersistedSnapshots,
1981
1992
  Jt as usePublishItem,
1982
- pt as useSchema,
1983
- nr as useSchemas,
1984
- ar as useSeedProtocolSchema,
1985
- er as useService,
1986
- ut as useServices
1993
+ yt as useSchema,
1994
+ sr as useSchemas,
1995
+ lr as useSeedProtocolSchema,
1996
+ tr as useService,
1997
+ ft as useServices
1987
1998
  };
1988
1999
  //# sourceMappingURL=index.js.map