@wyxos/vibe 2.1.7 → 2.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/index.cjs +1 -1
  2. package/lib/index.js +598 -583
  3. package/package.json +2 -1
package/lib/index.js CHANGED
@@ -1,8 +1,9 @@
1
- import { defineComponent as xe, ref as w, computed as I, onMounted as Ee, onUnmounted as St, createElementBlock as k, openBlock as S, normalizeStyle as $, createCommentVNode as j, createElementVNode as T, normalizeClass as vt, mergeDefaults as jt, useAttrs as Wt, shallowRef as mt, provide as Ut, watch as te, mergeProps as Gt, renderSlot as Kt, toDisplayString as ht, Fragment as gt, renderList as pt, createVNode as X, unref as ce, nextTick as yt, inject as Jt } from "vue";
2
- const Qt = {
1
+ import { defineComponent as Se, ref as p, computed as S, onMounted as He, onUnmounted as Pt, createElementBlock as I, openBlock as k, normalizeStyle as $, createCommentVNode as j, createElementVNode as T, normalizeClass as ht, mergeDefaults as Ut, useAttrs as Kt, shallowRef as gt, provide as Jt, watch as ne, mergeProps as Qt, renderSlot as Zt, toDisplayString as pt, Fragment as yt, renderList as wt, createVNode as X, unref as ce, nextTick as xt, inject as en } from "vue";
2
+ const tn = {
3
3
  mode: "default",
4
4
  pageSize: 20,
5
5
  backfillRequestDelayMs: 2e3,
6
+ enterStaggerMs: 40,
6
7
  page: 1,
7
8
  itemWidth: 300,
8
9
  prefetchThresholdPx: 200,
@@ -11,41 +12,41 @@ const Qt = {
11
12
  headerHeight: 0,
12
13
  footerHeight: 0,
13
14
  overscanPx: 600
14
- }, Zt = {
15
+ }, nn = {
15
16
  key: 0,
16
17
  "data-testid": "masonry-loader-spinner",
17
18
  class: "absolute inset-0 flex items-center justify-center"
18
- }, en = {
19
+ }, ln = {
19
20
  key: 1,
20
21
  "data-testid": "masonry-loader-error",
21
22
  class: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-3"
22
- }, tn = ["src", "width", "height", "alt"], nn = ["poster"], on = ["src"], wt = /* @__PURE__ */ xe({
23
+ }, an = ["src", "width", "height", "alt"], on = ["poster"], sn = ["src"], bt = /* @__PURE__ */ Se({
23
24
  __name: "MasonryLoader",
24
25
  props: {
25
26
  item: {},
26
27
  timeoutMs: { default: 15e3 }
27
28
  },
28
29
  emits: ["success", "error"],
29
- setup(o, { emit: g }) {
30
- const u = o, a = g, i = w(null), f = w(!1), c = w(!1), r = w(!1), v = w(0), m = I(() => {
30
+ setup(l, { emit: y }) {
31
+ const u = l, s = y, i = p(null), m = p(!1), c = p(!1), r = p(!1), h = p(0), g = S(() => {
31
32
  const _ = u.item?.width, P = u.item?.height;
32
33
  return { aspectRatio: `${_} / ${P}` };
33
- }), M = I(() => u.item?.type === "image");
34
- let F = null, B = null;
35
- function C() {
36
- B != null && (window.clearTimeout(B), B = null);
34
+ }), M = S(() => u.item?.type === "image");
35
+ let F = null, A = null;
36
+ function N() {
37
+ A != null && (window.clearTimeout(A), A = null);
37
38
  }
38
- function A() {
39
- C();
39
+ function E() {
40
+ N();
40
41
  const _ = typeof u.timeoutMs == "number" && Number.isFinite(u.timeoutMs) ? u.timeoutMs : 0;
41
- _ <= 0 || (B = window.setTimeout(() => {
42
- f.value && (c.value || r.value || W(new Error("timeout")));
42
+ _ <= 0 || (A = window.setTimeout(() => {
43
+ m.value && (c.value || r.value || W(new Error("timeout")));
43
44
  }, _));
44
45
  }
45
46
  function L() {
46
- f.value || (f.value = !0, c.value = !1, r.value = !1, A());
47
+ m.value || (m.value = !0, c.value = !1, r.value = !1, E());
47
48
  }
48
- Ee(() => {
49
+ He(() => {
49
50
  if (typeof IntersectionObserver > "u") {
50
51
  L();
51
52
  return;
@@ -60,25 +61,25 @@ const Qt = {
60
61
  },
61
62
  { threshold: [0, 0.5, 1] }
62
63
  ), i.value && F.observe(i.value);
63
- }), St(() => {
64
- F?.disconnect(), F = null, C();
64
+ }), Pt(() => {
65
+ F?.disconnect(), F = null, N();
65
66
  });
66
- function N() {
67
- c.value || (c.value = !0, r.value = !1, C(), a("success", u.item));
67
+ function C() {
68
+ c.value || (c.value = !0, r.value = !1, N(), s("success", u.item));
68
69
  }
69
70
  function W(_) {
70
- r.value || (c.value = !1, r.value = !0, C(), a("error", { item: u.item, error: _ }));
71
+ r.value || (c.value = !1, r.value = !0, N(), s("error", { item: u.item, error: _ }));
71
72
  }
72
- function D() {
73
- f.value && (c.value = !1, r.value = !1, v.value += 1, A());
73
+ function O() {
74
+ m.value && (c.value = !1, r.value = !1, h.value += 1, E());
74
75
  }
75
- return (_, P) => (S(), k("div", {
76
+ return (_, P) => (k(), I("div", {
76
77
  ref_key: "rootEl",
77
78
  ref: i,
78
79
  class: "relative bg-slate-100",
79
- style: $(m.value)
80
+ style: $(g.value)
80
81
  }, [
81
- f.value && !c.value && !r.value ? (S(), k("div", Zt, P[2] || (P[2] = [
82
+ m.value && !c.value && !r.value ? (k(), I("div", nn, P[2] || (P[2] = [
82
83
  T("svg", {
83
84
  class: "h-5 w-5 animate-spin text-slate-500",
84
85
  viewBox: "0 0 24 24",
@@ -99,18 +100,18 @@ const Qt = {
99
100
  d: "M4 12a8 8 0 0 1 8-8v4a4 4 0 0 0-4 4H4z"
100
101
  })
101
102
  ], -1)
102
- ]))) : f.value && r.value ? (S(), k("div", en, [
103
+ ]))) : m.value && r.value ? (k(), I("div", ln, [
103
104
  P[3] || (P[3] = T("p", { class: "text-center text-xs font-medium text-red-700" }, "Failed to load", -1)),
104
105
  T("button", {
105
106
  type: "button",
106
107
  "data-testid": "masonry-loader-retry",
107
108
  class: "inline-flex items-center rounded-md border border-slate-200 bg-white px-2 py-1 text-xs font-medium text-slate-700",
108
- onClick: D
109
+ onClick: O
109
110
  }, " Retry ")
110
111
  ])) : j("", !0),
111
- f.value && M.value && !r.value ? (S(), k("img", {
112
- key: u.item.id + ":img:" + v.value,
113
- class: vt([
112
+ m.value && M.value && !r.value ? (k(), I("img", {
113
+ key: u.item.id + ":img:" + h.value,
114
+ class: ht([
114
115
  "h-full w-full object-cover transition-opacity duration-300",
115
116
  c.value ? "opacity-100" : "opacity-0"
116
117
  ]),
@@ -119,73 +120,73 @@ const Qt = {
119
120
  height: u.item.height,
120
121
  loading: "lazy",
121
122
  alt: u.item.id,
122
- onLoad: N,
123
+ onLoad: C,
123
124
  onError: P[0] || (P[0] = (q) => W(q))
124
- }, null, 42, tn)) : f.value && !r.value ? (S(), k("video", {
125
- key: u.item.id + ":vid:" + v.value,
126
- class: vt([
125
+ }, null, 42, an)) : m.value && !r.value ? (k(), I("video", {
126
+ key: u.item.id + ":vid:" + h.value,
127
+ class: ht([
127
128
  "h-full w-full object-cover transition-opacity duration-300",
128
129
  c.value ? "opacity-100" : "opacity-0"
129
130
  ]),
130
131
  poster: u.item.preview,
131
132
  controls: "",
132
133
  preload: "metadata",
133
- onLoadedmetadata: N,
134
+ onLoadedmetadata: C,
134
135
  onError: P[1] || (P[1] = (q) => W(q))
135
136
  }, [
136
137
  T("source", {
137
138
  src: u.item.original,
138
139
  type: "video/mp4"
139
- }, null, 8, on)
140
- ], 42, nn)) : j("", !0)
140
+ }, null, 8, sn)
141
+ ], 42, on)) : j("", !0)
141
142
  ], 4));
142
143
  }
143
- }), Ft = Symbol("masonryItemRegistry");
144
- function ln(o, g) {
145
- return !o || o <= 0 || !g || g <= 0 ? 1 : Math.max(1, Math.floor(o / g));
144
+ }), Tt = Symbol("masonryItemRegistry");
145
+ function rn(l, y) {
146
+ return !l || l <= 0 || !y || y <= 0 ? 1 : Math.max(1, Math.floor(l / y));
146
147
  }
147
- function an(o, g, u, a = 0) {
148
- if (!o || o <= 0 || !g || g <= 0) return u;
149
- const i = typeof a == "number" && a > 0 ? a : 0, f = Math.max(0, g - 1) * i, c = o - f;
150
- return !c || c <= 0 ? u : c / g;
148
+ function un(l, y, u, s = 0) {
149
+ if (!l || l <= 0 || !y || y <= 0) return u;
150
+ const i = typeof s == "number" && s > 0 ? s : 0, m = Math.max(0, y - 1) * i, c = l - m;
151
+ return !c || c <= 0 ? u : c / y;
151
152
  }
152
- function sn(o, g) {
153
- const u = o?.width, a = o?.height;
154
- return typeof u == "number" && typeof a == "number" && u > 0 && a > 0 ? a / u * g : g;
153
+ function cn(l, y) {
154
+ const u = l?.width, s = l?.height;
155
+ return typeof u == "number" && typeof s == "number" && u > 0 && s > 0 ? s / u * y : y;
155
156
  }
156
- function Pt(o) {
157
- return Number.isFinite(o) && o > 0 ? Math.floor(o) : 1;
157
+ function _t(l) {
158
+ return Number.isFinite(l) && l > 0 ? Math.floor(l) : 1;
158
159
  }
159
- function Ne(o) {
160
- return Number.isFinite(o) && o > 0 ? Math.floor(o) : 0;
160
+ function Le(l) {
161
+ return Number.isFinite(l) && l > 0 ? Math.floor(l) : 0;
161
162
  }
162
- function rn(o) {
163
- async function g(a) {
164
- const i = Ne(a);
163
+ function fn(l) {
164
+ async function y(s) {
165
+ const i = Le(s);
165
166
  if (i <= 0) return;
166
- o.stats.value = {
167
- ...o.stats.value,
167
+ l.stats.value = {
168
+ ...l.stats.value,
168
169
  cooldownMsTotal: i,
169
170
  cooldownMsRemaining: i
170
171
  };
171
- const f = Date.now(), c = 100;
172
+ const m = Date.now(), c = 100;
172
173
  await new Promise((r) => {
173
- const v = setInterval(() => {
174
- const m = Date.now() - f, M = Math.max(0, i - m);
175
- o.stats.value = {
176
- ...o.stats.value,
174
+ const h = setInterval(() => {
175
+ const g = Date.now() - m, M = Math.max(0, i - g);
176
+ l.stats.value = {
177
+ ...l.stats.value,
177
178
  cooldownMsTotal: i,
178
179
  cooldownMsRemaining: M
179
- }, M <= 0 && (clearInterval(v), r());
180
+ }, M <= 0 && (clearInterval(h), r());
180
181
  }, c);
181
182
  });
182
183
  }
183
- async function u(a) {
184
- const i = Pt(o.getPageSize()), f = o.isEnabled(), c = Ne(o.getRequestDelayMs()), r = [];
185
- let v = 0;
186
- o.buffer.value.length && (v = o.buffer.value.length, r.push(...o.buffer.value), o.buffer.value = []), o.stats.value = {
187
- ...o.stats.value,
188
- enabled: f,
184
+ async function u(s) {
185
+ const i = _t(l.getPageSize()), m = l.isEnabled(), c = Le(l.getRequestDelayMs()), r = [];
186
+ let h = 0;
187
+ l.buffer.value.length && (h = l.buffer.value.length, r.push(...l.buffer.value), l.buffer.value = []), l.stats.value = {
188
+ ...l.stats.value,
189
+ enabled: m,
189
190
  isBackfillActive: !1,
190
191
  isRequestInFlight: !1,
191
192
  requestPage: null,
@@ -198,13 +199,13 @@ function rn(o) {
198
199
  pageSize: i,
199
200
  bufferSize: 0
200
201
  };
201
- const m = [];
202
- let M = a, F = 0, B = !1;
202
+ const g = [];
203
+ let M = s, F = 0, A = !1;
203
204
  for (; r.length < i && M != null; ) {
204
205
  const L = M;
205
- B && (o.stats.value = {
206
- ...o.stats.value,
207
- enabled: f,
206
+ A && (l.stats.value = {
207
+ ...l.stats.value,
208
+ enabled: m,
208
209
  isBackfillActive: !0,
209
210
  isRequestInFlight: !0,
210
211
  requestPage: L,
@@ -216,16 +217,16 @@ function rn(o) {
216
217
  cooldownMsRemaining: 0,
217
218
  pageSize: i
218
219
  });
219
- const N = await o.getContent(L);
220
- m.push(L), B && (o.stats.value = {
221
- ...o.stats.value,
222
- enabled: f,
220
+ const C = await l.getContent(L);
221
+ g.push(L), A && (l.stats.value = {
222
+ ...l.stats.value,
223
+ enabled: m,
223
224
  isBackfillActive: !0,
224
225
  isRequestInFlight: !1,
225
226
  requestPage: null
226
- }), F += N.items.length, o.markEnterFromLeft(N.items), r.push(...N.items), M = N.nextPage, !B && r.length < i && M != null ? (B = !0, o.stats.value = {
227
- ...o.stats.value,
228
- enabled: f,
227
+ }), F += C.items.length, l.markEnterFromLeft(C.items), r.push(...C.items), M = C.nextPage, !A && r.length < i && M != null ? (A = !0, l.stats.value = {
228
+ ...l.stats.value,
229
+ enabled: m,
229
230
  isBackfillActive: !0,
230
231
  isRequestInFlight: !1,
231
232
  requestPage: null,
@@ -236,20 +237,20 @@ function rn(o) {
236
237
  cooldownMsTotal: c,
237
238
  cooldownMsRemaining: 0,
238
239
  pageSize: i
239
- }) : B && (o.stats.value = {
240
- ...o.stats.value,
241
- enabled: f,
240
+ }) : A && (l.stats.value = {
241
+ ...l.stats.value,
242
+ enabled: m,
242
243
  isBackfillActive: !0,
243
244
  progress: {
244
245
  collected: Math.min(r.length, i),
245
246
  target: i
246
247
  }
247
- }), B && r.length < i && M != null && await g(c);
248
+ }), A && r.length < i && M != null && await y(c);
248
249
  }
249
- const C = r.slice(0, i), A = r.slice(i);
250
- return o.buffer.value = A, o.stats.value = {
251
- ...o.stats.value,
252
- enabled: f,
250
+ const N = r.slice(0, i), E = r.slice(i);
251
+ return l.buffer.value = E, l.stats.value = {
252
+ ...l.stats.value,
253
+ enabled: m,
253
254
  isBackfillActive: !1,
254
255
  isRequestInFlight: !1,
255
256
  requestPage: null,
@@ -260,79 +261,80 @@ function rn(o) {
260
261
  cooldownMsTotal: c,
261
262
  cooldownMsRemaining: 0,
262
263
  pageSize: i,
263
- bufferSize: A.length,
264
+ bufferSize: E.length,
264
265
  lastBatch: {
265
- startPage: a,
266
- pages: m,
267
- usedFromBuffer: v,
266
+ startPage: s,
267
+ pages: g,
268
+ usedFromBuffer: h,
268
269
  fetchedFromNetwork: F,
269
270
  collectedTotal: r.length,
270
- emitted: C.length,
271
- carried: A.length
271
+ emitted: N.length,
272
+ carried: E.length
272
273
  },
273
274
  totals: {
274
- pagesFetched: o.stats.value.totals.pagesFetched + m.length,
275
- itemsFetchedFromNetwork: o.stats.value.totals.itemsFetchedFromNetwork + F
275
+ pagesFetched: l.stats.value.totals.pagesFetched + g.length,
276
+ itemsFetchedFromNetwork: l.stats.value.totals.itemsFetchedFromNetwork + F
276
277
  }
277
- }, { batchItems: C, pages: m, nextPage: M };
278
+ }, { batchItems: N, pages: g, nextPage: M };
278
279
  }
279
280
  return { loadBackfillBatch: u };
280
281
  }
281
- function un(o) {
282
- const g = o.columnCount, u = o.columnWidth, a = o.gapX, i = o.gapY, f = o.headerHeight, c = o.footerHeight, r = o.bucketPx, v = Array.from({ length: g }, () => 0), m = new Array(o.items.length), M = new Array(o.items.length), F = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map();
283
- let C = 0;
284
- for (let A = 0; A < o.items.length; A += 1) {
285
- const L = o.items[A];
286
- L?.id && B.set(L.id, A);
287
- let N = 0;
288
- for (let H = 1; H < v.length; H += 1)
289
- v[H] < v[N] && (N = H);
290
- const W = N * (u + a), D = v[N], _ = sn(L, u) + f + c;
291
- m[A] = { x: W, y: D }, M[A] = _, v[N] = D + _ + i, C = Math.max(C, D + _);
292
- const P = Math.floor(D / r), q = Math.floor((D + _) / r);
282
+ function dn(l) {
283
+ const y = l.columnCount, u = l.columnWidth, s = l.gapX, i = l.gapY, m = l.headerHeight, c = l.footerHeight, r = l.bucketPx, h = Array.from({ length: y }, () => 0), g = new Array(l.items.length), M = new Array(l.items.length), F = /* @__PURE__ */ new Map(), A = /* @__PURE__ */ new Map();
284
+ let N = 0;
285
+ for (let E = 0; E < l.items.length; E += 1) {
286
+ const L = l.items[E];
287
+ L?.id && A.set(L.id, E);
288
+ let C = 0;
289
+ for (let H = 1; H < h.length; H += 1)
290
+ h[H] < h[C] && (C = H);
291
+ const W = C * (u + s), O = h[C], _ = cn(L, u) + m + c;
292
+ g[E] = { x: W, y: O }, M[E] = _, h[C] = O + _ + i, N = Math.max(N, O + _);
293
+ const P = Math.floor(O / r), q = Math.floor((O + _) / r);
293
294
  for (let H = P; H <= q; H += 1) {
294
- const ne = F.get(H);
295
- ne ? ne.push(A) : F.set(H, [A]);
295
+ const le = F.get(H);
296
+ le ? le.push(E) : F.set(H, [E]);
296
297
  }
297
298
  }
298
- return { positions: m, heights: M, buckets: F, contentHeight: C, indexById: B };
299
+ return { positions: g, heights: M, buckets: F, contentHeight: N, indexById: A };
299
300
  }
300
- function cn(o) {
301
- const g = o.itemCount;
302
- if (!g) return [];
303
- if (o.viewportHeight <= 0) return Array.from({ length: g }, (v, m) => m);
304
- const u = Math.max(0, o.scrollTop - o.overscanPx), a = o.scrollTop + o.viewportHeight + o.overscanPx, i = Math.floor(u / o.bucketPx), f = Math.floor(a / o.bucketPx), c = /* @__PURE__ */ new Set();
305
- for (let v = i; v <= f; v += 1) {
306
- const m = o.buckets.get(v);
307
- if (m)
308
- for (const M of m) c.add(M);
301
+ function vn(l) {
302
+ const y = l.itemCount;
303
+ if (!y) return [];
304
+ if (l.viewportHeight <= 0) return Array.from({ length: y }, (h, g) => g);
305
+ const u = Math.max(0, l.scrollTop - l.overscanPx), s = l.scrollTop + l.viewportHeight + l.overscanPx, i = Math.floor(u / l.bucketPx), m = Math.floor(s / l.bucketPx), c = /* @__PURE__ */ new Set();
306
+ for (let h = i; h <= m; h += 1) {
307
+ const g = l.buckets.get(h);
308
+ if (g)
309
+ for (const M of g) c.add(M);
309
310
  }
310
311
  const r = Array.from(c);
311
- return r.sort((v, m) => v - m), r;
312
+ return r.sort((h, g) => h - g), r;
312
313
  }
313
- const fn = { class: "hidden" }, dn = {
314
+ const mn = { class: "hidden" }, hn = {
314
315
  key: 0,
315
316
  class: "flex h-full items-center justify-center"
316
- }, vn = {
317
+ }, gn = {
317
318
  key: 1,
318
319
  class: "text-sm font-medium text-red-700"
319
- }, mn = { class: "relative" }, hn = {
320
+ }, pn = { class: "relative" }, yn = {
320
321
  key: 0,
321
322
  class: "pointer-events-auto absolute inset-0"
322
- }, gn = { class: "relative" }, pn = {
323
+ }, wn = { class: "relative" }, xn = {
323
324
  key: 0,
324
325
  class: "pointer-events-auto absolute inset-0"
325
- }, yn = { class: "mt-4 pb-2 text-center text-xs text-slate-600" }, wn = {
326
+ }, bn = { class: "mt-4 pb-2 text-center text-xs text-slate-600" }, Mn = {
326
327
  key: 0,
327
328
  class: "inline-flex items-center justify-center gap-2"
328
- }, xn = { key: 1 }, bn = { key: 2 }, xt = 100, Mn = 200, bt = 600, Mt = 300, It = 600, kt = 600, In = 5, kn = 1e3, Sn = /* @__PURE__ */ xe({
329
+ }, Sn = { key: 1 }, In = { key: 2 }, Mt = 100, kn = 200, St = 600, It = 300, kt = 600, Ft = 600, Fn = 400, Pn = 5, Tn = 1e3, _n = /* @__PURE__ */ Se({
329
330
  inheritAttrs: !1,
330
331
  __name: "Masonry",
331
- props: /* @__PURE__ */ jt({
332
+ props: /* @__PURE__ */ Ut({
332
333
  getContent: {},
333
334
  mode: {},
334
335
  pageSize: {},
335
336
  backfillRequestDelayMs: {},
337
+ enterStaggerMs: {},
336
338
  items: {},
337
339
  page: {},
338
340
  restoredPages: {},
@@ -343,10 +345,10 @@ const fn = { class: "hidden" }, dn = {
343
345
  headerHeight: {},
344
346
  footerHeight: {},
345
347
  overscanPx: {}
346
- }, Qt),
348
+ }, tn),
347
349
  emits: ["update:items", "preloaded", "failures"],
348
- setup(o, { expose: g, emit: u }) {
349
- const a = o, i = u, f = Wt(), c = xe({
350
+ setup(l, { expose: y, emit: u }) {
351
+ const s = l, i = u, m = Kt(), c = Se({
350
352
  name: "SlotRenderer",
351
353
  props: {
352
354
  slotFn: {
@@ -360,265 +362,275 @@ const fn = { class: "hidden" }, dn = {
360
362
  },
361
363
  setup(e) {
362
364
  return () => {
363
- const n = e.slotFn;
364
- return n ? n(e.slotProps) : null;
365
+ const t = e.slotFn;
366
+ return t ? t(e.slotProps) : null;
365
367
  };
366
368
  }
367
- }), r = mt(null);
368
- Ut(Ft, (e) => {
369
+ }), r = gt(null);
370
+ Jt(Tt, (e) => {
369
371
  r.value || (r.value = e);
370
372
  });
371
- const v = [], m = [];
373
+ const h = [], g = [];
372
374
  let M = null, F = null;
373
- function B() {
374
- if (!v.length) return;
375
- const e = v.splice(0, v.length);
375
+ function A() {
376
+ if (!h.length) return;
377
+ const e = h.splice(0, h.length);
376
378
  i("preloaded", e);
377
379
  }
378
- function C() {
379
- if (!m.length) return;
380
- const e = m.splice(0, m.length);
380
+ function N() {
381
+ if (!g.length) return;
382
+ const e = g.splice(0, g.length);
381
383
  i("failures", e);
382
384
  }
383
- function A() {
385
+ function E() {
384
386
  M || (M = setTimeout(() => {
385
- M = null, B();
386
- }, xt));
387
+ M = null, A();
388
+ }, Mt));
387
389
  }
388
390
  function L() {
389
391
  F || (F = setTimeout(() => {
390
- F = null, C();
391
- }, xt));
392
+ F = null, N();
393
+ }, Mt));
392
394
  }
393
- function N(e) {
394
- r.value?.onPreloaded?.(e), v.push(e), A();
395
+ function C(e) {
396
+ r.value?.onPreloaded?.(e), h.push(e), E();
395
397
  }
396
398
  function W(e) {
397
- r.value?.onFailed?.(e), m.push(e), L();
399
+ r.value?.onFailed?.(e), g.push(e), L();
398
400
  }
399
- Ee(() => {
401
+ He(() => {
400
402
  if (!r.value)
401
403
  throw new Error("[Masonry] Missing <MasonryItem> definition. Add <MasonryItem> as a child of <Masonry>.");
402
404
  });
403
- const D = I(() => {
404
- const { class: e, ...n } = f;
405
- return n;
406
- }), _ = w(null), P = w(0), q = w(0), H = w(0);
407
- let ne;
408
- const oe = I(() => a.gapX), Ce = I(() => a.gapY);
409
- function He(e) {
405
+ const O = S(() => {
406
+ const { class: e, ...t } = m;
407
+ return t;
408
+ }), _ = p(null), P = p(0), q = p(0), H = p(0);
409
+ let le;
410
+ const ae = S(() => s.gapX), ze = S(() => s.gapY);
411
+ function qe(e) {
410
412
  if (!e) return 0;
411
- const n = Math.max(0, oe.value);
412
- return Math.max(0, e.clientWidth - n);
413
+ const t = Math.max(0, ae.value);
414
+ return Math.max(0, e.clientWidth - t);
415
+ }
416
+ const oe = S(() => s.headerHeight), se = S(() => s.footerHeight), Ie = S(() => r.value?.header), ke = S(() => r.value?.footer), Fe = S(() => r.value?.overlay), De = S(() => !!Ie.value), Oe = S(() => !!ke.value), $e = S(() => !!Fe.value), Ve = S(() => {
417
+ if (oe.value > 0) return { height: `${oe.value}px` };
418
+ }), Ye = S(() => {
419
+ if (se.value > 0) return { height: `${se.value}px` };
420
+ }), fe = p([]), Pe = p([]), Xe = p(/* @__PURE__ */ new Map()), je = p(0), pe = p(/* @__PURE__ */ new Map());
421
+ function We(e) {
422
+ const t = typeof e == "number" && Number.isFinite(e) ? e : 0;
423
+ return rt.value + Math.max(0, t);
413
424
  }
414
- const le = I(() => a.headerHeight), ae = I(() => a.footerHeight), be = I(() => r.value?.header), Me = I(() => r.value?.footer), Ie = I(() => r.value?.overlay), Le = I(() => !!be.value), ze = I(() => !!Me.value), qe = I(() => !!Ie.value), Oe = I(() => {
415
- if (le.value > 0) return { height: `${le.value}px` };
416
- }), De = I(() => {
417
- if (ae.value > 0) return { height: `${ae.value}px` };
418
- }), fe = w([]), ke = w([]), $e = w(/* @__PURE__ */ new Map()), Ve = w(0), he = w(/* @__PURE__ */ new Map());
419
- function Ye(e) {
420
- const n = typeof e == "number" && Number.isFinite(e) ? e : 0;
421
- return lt.value + Math.max(0, n);
425
+ const G = p(/* @__PURE__ */ new Set()), U = p(/* @__PURE__ */ new Set()), ye = /* @__PURE__ */ new Set(), de = p(/* @__PURE__ */ new Map());
426
+ function Bt(e) {
427
+ return Number.isFinite(e) ? Math.max(0, Math.min(250, e)) : 0;
422
428
  }
423
- const U = w(/* @__PURE__ */ new Set()), se = w(/* @__PURE__ */ new Set()), ge = /* @__PURE__ */ new Set(), pe = w(/* @__PURE__ */ new Map()), V = w(/* @__PURE__ */ new Set()), Y = w([]);
424
- function Tt(e) {
425
- const n = pe.value.get(e);
426
- return n || { dx: 0, dy: 0 };
429
+ function At(e) {
430
+ if (!U.value.has(e)) return;
431
+ const t = de.value.get(e) ?? 0;
432
+ if (!(t <= 0))
433
+ return `${t}ms`;
427
434
  }
428
- function _t(e) {
429
- if (se.value.has(e)) return `transform ${It}ms ease-out`;
430
- if (V.value.has(e)) return `transform ${Mt}ms ease-out`;
435
+ const we = p(/* @__PURE__ */ new Map()), V = p(/* @__PURE__ */ new Set()), Y = p([]);
436
+ function Et(e) {
437
+ const t = we.value.get(e);
438
+ return t || { dx: 0, dy: 0 };
431
439
  }
432
- function Bt(e) {
433
- const t = d.value[e]?.id, l = fe.value[e] ?? { x: 0, y: 0 }, s = ke.value[e] ?? 0, h = s > 0 ? s : ve.value, p = l.x, x = t && U.value.has(t) ? Ye(h) : l.y, b = t ? Tt(t) : { dx: 0, dy: 0 };
434
- return `translate3d(${p + b.dx}px,${x + b.dy}px,0)`;
440
+ function Rt(e) {
441
+ if (U.value.has(e)) return `transform ${kt}ms ease-out`;
442
+ if (V.value.has(e)) return `transform ${It}ms ease-out`;
443
+ }
444
+ function Ct(e) {
445
+ const n = d.value[e]?.id, a = fe.value[e] ?? { x: 0, y: 0 }, o = Pe.value[e] ?? 0, f = o > 0 ? o : he.value, v = a.x, x = n && G.value.has(n) ? We(f) : a.y, b = n ? Et(n) : { dx: 0, dy: 0 };
446
+ return `translate3d(${v + b.dx}px,${x + b.dy}px,0)`;
435
447
  }
436
448
  function re(e) {
437
- (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (t) => setTimeout(() => t(0), 0))(() => e());
449
+ (typeof requestAnimationFrame == "function" ? requestAnimationFrame : (n) => setTimeout(() => n(0), 0))(() => e());
438
450
  }
439
- function At(e) {
451
+ function Nt(e) {
440
452
  re(() => re(e));
441
453
  }
442
- const Xe = /* @__PURE__ */ new Set();
443
- function je(e) {
454
+ const Ge = /* @__PURE__ */ new Set();
455
+ function Ue(e) {
444
456
  return typeof e == "number" && Number.isFinite(e) && e > 0;
445
457
  }
446
- function Se(e) {
458
+ function Te(e) {
447
459
  if (!Array.isArray(e) || e.length === 0) return;
448
- const n = new Set(U.value);
449
- let t = !1;
450
- for (const l of e) {
451
- const s = l?.id;
452
- if (s) {
453
- if (!Xe.has(s)) {
454
- const h = l?.width, p = l?.height;
455
- (!je(h) || !je(p)) && (Xe.add(s), console.warn(
456
- `[Masonry] Item "${s}" has invalid dimensions (width=${String(h)}, height=${String(
457
- p
460
+ const t = new Set(G.value);
461
+ let n = !1;
462
+ for (const a of e) {
463
+ const o = a?.id;
464
+ if (o) {
465
+ if (!Ge.has(o)) {
466
+ const f = a?.width, v = a?.height;
467
+ (!Ue(f) || !Ue(v)) && (Ge.add(o), console.warn(
468
+ `[Masonry] Item "${o}" has invalid dimensions (width=${String(f)}, height=${String(
469
+ v
458
470
  )}); layout expects { id, width, height }.`
459
471
  ));
460
472
  }
461
- n.has(s) || (n.add(s), t = !0);
473
+ t.has(o) || (t.add(o), n = !0);
462
474
  }
463
475
  }
464
- t && (U.value = n);
476
+ n && (G.value = t);
465
477
  }
466
- function We() {
478
+ function Ke() {
467
479
  const e = /* @__PURE__ */ new Map();
468
- for (const n of Ae.value) {
469
- const l = d.value[n]?.id;
470
- if (!l) continue;
471
- const s = fe.value[n];
472
- s && e.set(l, { x: s.x, y: s.y });
480
+ for (const t of Re.value) {
481
+ const a = d.value[t]?.id;
482
+ if (!a) continue;
483
+ const o = fe.value[t];
484
+ o && e.set(a, { x: o.x, y: o.y });
473
485
  }
474
486
  return e;
475
487
  }
476
- function Ue(e, n) {
488
+ function Je(e, t) {
477
489
  if (!e.size) return;
478
- const t = /* @__PURE__ */ new Map(), l = [];
479
- for (const [h, p] of e.entries()) {
480
- if (n?.has(h)) continue;
481
- const x = he.value.get(h);
490
+ const n = /* @__PURE__ */ new Map(), a = [];
491
+ for (const [f, v] of e.entries()) {
492
+ if (t?.has(f)) continue;
493
+ const x = pe.value.get(f);
482
494
  if (x == null) continue;
483
495
  const b = fe.value[x];
484
496
  if (!b) continue;
485
- const y = p.x - b.x, z = p.y - b.y;
486
- (y || z) && (t.set(h, { dx: y, dy: z }), l.push(h));
497
+ const w = v.x - b.x, z = v.y - b.y;
498
+ (w || z) && (n.set(f, { dx: w, dy: z }), a.push(f));
487
499
  }
488
- if (!t.size) return;
489
- pe.value = t;
490
- const s = new Set(V.value);
491
- for (const h of l) s.delete(h);
492
- V.value = s, re(() => {
493
- V.value = /* @__PURE__ */ new Set([...V.value, ...l]), re(() => {
494
- pe.value = /* @__PURE__ */ new Map();
500
+ if (!n.size) return;
501
+ we.value = n;
502
+ const o = new Set(V.value);
503
+ for (const f of a) o.delete(f);
504
+ V.value = o, re(() => {
505
+ V.value = /* @__PURE__ */ new Set([...V.value, ...a]), re(() => {
506
+ we.value = /* @__PURE__ */ new Map();
495
507
  });
496
508
  }), setTimeout(() => {
497
- const h = new Set(V.value);
498
- for (const p of l) h.delete(p);
499
- V.value = h;
500
- }, Mt);
509
+ const f = new Set(V.value);
510
+ for (const v of a) f.delete(v);
511
+ V.value = f;
512
+ }, It);
501
513
  }
502
- const G = w(!0), K = w(!1), ie = w("");
503
- let E = 0;
504
- function Ge(e) {
514
+ const K = p(!0), J = p(!1), ie = p("");
515
+ let R = 0;
516
+ function Qe(e) {
505
517
  return e instanceof Error && e.name === "AbortError";
506
518
  }
507
- function Ke() {
519
+ function Ze() {
508
520
  const e = new Error("aborted");
509
521
  return e.name = "AbortError", e;
510
522
  }
511
- function Rt(e) {
512
- return new Promise((n) => setTimeout(n, e));
523
+ function Ht(e) {
524
+ return new Promise((t) => setTimeout(t, e));
513
525
  }
514
- async function Je(e, n) {
515
- let t = 0;
526
+ async function et(e, t) {
527
+ let n = 0;
516
528
  for (; ; ) {
517
- if (n !== E) throw Ke();
529
+ if (t !== R) throw Ze();
518
530
  try {
519
- return await a.getContent(e);
520
- } catch (l) {
521
- if (n !== E) throw Ke();
522
- if (t >= In) throw l;
523
- t += 1, await Rt(t * kn);
531
+ return await s.getContent(e);
532
+ } catch (a) {
533
+ if (t !== R) throw Ze();
534
+ if (n >= Pn) throw a;
535
+ n += 1, await Ht(n * Tn);
524
536
  }
525
537
  }
526
538
  }
527
- const O = w([]), Qe = w([]), Fe = w([]), R = w(a.page), ye = w([]);
528
- let J = null, Q = null, we = 0;
529
- function Et(e) {
530
- let n = -1;
531
- for (const t of e) {
532
- const l = t?.originalIndex;
533
- de(l) && l > n && (n = l);
539
+ const D = p([]), tt = p([]), _e = p([]), B = p(s.page), xe = p([]);
540
+ let Q = null, Z = null, be = 0;
541
+ function Lt(e) {
542
+ let t = -1;
543
+ for (const n of e) {
544
+ const a = n?.originalIndex;
545
+ ve(a) && a > t && (t = a);
534
546
  }
535
- we = n + 1;
547
+ be = t + 1;
536
548
  }
537
549
  function ue(e) {
538
- for (const n of e)
539
- !n || typeof n != "object" || n.id && n.originalIndex == null && (n.originalIndex = we, we += 1);
550
+ for (const t of e)
551
+ !t || typeof t != "object" || t.id && t.originalIndex == null && (t.originalIndex = be, be += 1);
540
552
  }
541
- const Z = /* @__PURE__ */ new Map(), ee = [];
542
- function de(e) {
553
+ const ee = /* @__PURE__ */ new Map(), te = [];
554
+ function ve(e) {
543
555
  return typeof e == "number" && Number.isFinite(e);
544
556
  }
545
- function Nt(e, n) {
546
- if (!n.length) return e;
547
- const t = /* @__PURE__ */ new Set();
548
- for (const p of e) {
549
- const x = p?.id;
550
- x && t.add(x);
557
+ function zt(e, t) {
558
+ if (!t.length) return e;
559
+ const n = /* @__PURE__ */ new Set();
560
+ for (const v of e) {
561
+ const x = v?.id;
562
+ x && n.add(x);
551
563
  }
552
- const l = [];
553
- for (const p of n) {
554
- const x = p?.id;
555
- x && (t.has(x) || (l.push(p), t.add(x)));
564
+ const a = [];
565
+ for (const v of t) {
566
+ const x = v?.id;
567
+ x && (n.has(x) || (a.push(v), n.add(x)));
556
568
  }
557
- if (!l.length) return e;
558
- const s = l.slice().sort((p, x) => {
559
- const b = de(p.originalIndex) ? p.originalIndex : Number.POSITIVE_INFINITY, y = de(x.originalIndex) ? x.originalIndex : Number.POSITIVE_INFINITY;
560
- return b - y;
561
- }), h = e.slice();
562
- for (const p of s) {
563
- const x = p.originalIndex;
564
- if (!de(x)) {
565
- h.push(p);
569
+ if (!a.length) return e;
570
+ const o = a.slice().sort((v, x) => {
571
+ const b = ve(v.originalIndex) ? v.originalIndex : Number.POSITIVE_INFINITY, w = ve(x.originalIndex) ? x.originalIndex : Number.POSITIVE_INFINITY;
572
+ return b - w;
573
+ }), f = e.slice();
574
+ for (const v of o) {
575
+ const x = v.originalIndex;
576
+ if (!ve(x)) {
577
+ f.push(v);
566
578
  continue;
567
579
  }
568
- let b = 0, y = h.length;
569
- for (; b < y; ) {
570
- const z = b + y >> 1, me = h[z]?.originalIndex;
571
- (de(me) ? me : Number.POSITIVE_INFINITY) <= x ? b = z + 1 : y = z;
580
+ let b = 0, w = f.length;
581
+ for (; b < w; ) {
582
+ const z = b + w >> 1, ge = f[z]?.originalIndex;
583
+ (ve(ge) ? ge : Number.POSITIVE_INFINITY) <= x ? b = z + 1 : w = z;
572
584
  }
573
- h.splice(b, 0, p);
585
+ f.splice(b, 0, v);
574
586
  }
575
- return h;
587
+ return f;
576
588
  }
577
- async function Ze(e) {
589
+ async function nt(e) {
578
590
  if (!e.length) return;
579
- Se(e);
580
- const n = We();
581
- d.value = Nt(d.value, e), await yt(), Ue(n);
591
+ Te(e);
592
+ const t = Ke();
593
+ d.value = zt(d.value, e), await xt(), Je(t);
582
594
  }
583
- async function Ct(e) {
584
- const t = (Array.isArray(e) ? e : [e]).map(_e).filter(Boolean);
585
- if (!t.length) return;
586
- const l = [];
587
- for (const s of t) {
588
- const h = Z.get(s);
589
- h && l.push(h);
595
+ async function qt(e) {
596
+ const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
597
+ if (!n.length) return;
598
+ const a = [];
599
+ for (const o of n) {
600
+ const f = ee.get(o);
601
+ f && a.push(f);
590
602
  }
591
- if (l.length) {
592
- await Ze(l);
593
- for (const s of l)
594
- s?.id && Z.delete(s.id);
603
+ if (a.length) {
604
+ await nt(a);
605
+ for (const o of a)
606
+ o?.id && ee.delete(o.id);
595
607
  }
596
608
  }
597
- async function Ht() {
598
- const e = ee.pop();
609
+ async function Dt() {
610
+ const e = te.pop();
599
611
  if (!e?.length) return;
600
- const n = [];
601
- for (const t of e) {
602
- const l = Z.get(t);
603
- l && n.push(l);
612
+ const t = [];
613
+ for (const n of e) {
614
+ const a = ee.get(n);
615
+ a && t.push(a);
604
616
  }
605
- if (n.length) {
606
- await Ze(n);
607
- for (const t of n)
608
- t?.id && Z.delete(t.id);
617
+ if (t.length) {
618
+ await nt(t);
619
+ for (const n of t)
620
+ n?.id && ee.delete(n.id);
609
621
  }
610
622
  }
611
- function Lt(e) {
612
- const t = (Array.isArray(e) ? e : [e]).map(_e).filter(Boolean);
613
- if (!t.length) return;
614
- const l = new Set(t);
615
- for (const s of l) Z.delete(s);
616
- for (let s = ee.length - 1; s >= 0; s -= 1) {
617
- const p = ee[s].filter((x) => !l.has(x));
618
- p.length ? ee[s] = p : ee.splice(s, 1);
623
+ function Ot(e) {
624
+ const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
625
+ if (!n.length) return;
626
+ const a = new Set(n);
627
+ for (const o of a) ee.delete(o);
628
+ for (let o = te.length - 1; o >= 0; o -= 1) {
629
+ const v = te[o].filter((x) => !a.has(x));
630
+ v.length ? te[o] = v : te.splice(o, 1);
619
631
  }
620
632
  }
621
- const Pe = mt({
633
+ const Be = gt({
622
634
  enabled: !1,
623
635
  isBackfillActive: !1,
624
636
  isRequestInFlight: !1,
@@ -636,208 +648,218 @@ const fn = { class: "hidden" }, dn = {
636
648
  pagesFetched: 0,
637
649
  itemsFetchedFromNetwork: 0
638
650
  }
639
- }), et = rn({
640
- getContent: (e) => Je(e, E),
641
- markEnterFromLeft: Se,
642
- buffer: ye,
643
- stats: Pe,
644
- isEnabled: () => a.mode === "backfill",
645
- getPageSize: () => a.pageSize,
646
- getRequestDelayMs: () => a.backfillRequestDelayMs
647
- }), Te = I(() => a.items !== void 0);
648
- te(
649
- () => a.items,
651
+ }), lt = fn({
652
+ getContent: (e) => et(e, R),
653
+ markEnterFromLeft: Te,
654
+ buffer: xe,
655
+ stats: Be,
656
+ isEnabled: () => s.mode === "backfill",
657
+ getPageSize: () => s.pageSize,
658
+ getRequestDelayMs: () => s.backfillRequestDelayMs
659
+ }), Me = S(() => s.items !== void 0);
660
+ ne(
661
+ () => s.items,
650
662
  (e) => {
651
- Te.value && (Fe.value = Array.isArray(e) ? e : []);
663
+ Me.value && (_e.value = Array.isArray(e) ? e : []);
652
664
  },
653
665
  { immediate: !0 }
654
666
  );
655
- const d = I({
667
+ const d = S({
656
668
  get() {
657
- return Te.value ? Fe.value : Qe.value;
669
+ return Me.value ? _e.value : tt.value;
658
670
  },
659
671
  set(e) {
660
- Te.value ? (Fe.value = e, i("update:items", e)) : Qe.value = e;
672
+ Me.value ? (_e.value = e, i("update:items", e)) : tt.value = e;
661
673
  }
662
- });
663
- async function tt(e) {
664
- const n = await Je(e, E);
665
- return ue(n.items), Se(n.items), { items: n.items, nextPage: n.nextPage };
674
+ }), me = p(!1);
675
+ async function at(e) {
676
+ const t = await et(e, R);
677
+ return ue(t.items), Te(t.items), { items: t.items, nextPage: t.nextPage };
666
678
  }
667
- function _e(e) {
679
+ function Ae(e) {
668
680
  return e ? typeof e == "string" ? e : e?.id : null;
669
681
  }
670
- async function nt(e) {
671
- const t = (Array.isArray(e) ? e : [e]).map(_e).filter(Boolean);
672
- if (!t.length) return;
673
- const l = new Set(t), s = [];
674
- for (const b of l) {
675
- const y = he.value.get(b);
676
- if (y == null) continue;
677
- const z = d.value[y];
678
- z && (Z.set(b, z), s.push(b));
682
+ async function ot(e) {
683
+ const n = (Array.isArray(e) ? e : [e]).map(Ae).filter(Boolean);
684
+ if (!n.length) return;
685
+ const a = new Set(n), o = [];
686
+ for (const b of a) {
687
+ const w = pe.value.get(b);
688
+ if (w == null) continue;
689
+ const z = d.value[w];
690
+ z && (ee.set(b, z), o.push(b));
679
691
  }
680
- s.length && ee.push(s);
681
- const h = We(), p = ve.value, x = [];
682
- for (const b of l) {
683
- const y = he.value.get(b);
684
- if (y == null) continue;
685
- const z = d.value[y];
692
+ o.length && te.push(o);
693
+ const f = Ke(), v = he.value, x = [];
694
+ for (const b of a) {
695
+ const w = pe.value.get(b);
696
+ if (w == null) continue;
697
+ const z = d.value[w];
686
698
  if (!z) continue;
687
- const me = fe.value[y] ?? { x: 0, y: 0 }, dt = ke.value[y] ?? p;
699
+ const ge = fe.value[w] ?? { x: 0, y: 0 }, mt = Pe.value[w] ?? v;
688
700
  x.push({
689
701
  id: b,
690
702
  item: z,
691
- fromX: me.x,
692
- fromY: me.y,
693
- width: p,
694
- height: dt,
703
+ fromX: ge.x,
704
+ fromY: ge.y,
705
+ width: v,
706
+ height: mt,
695
707
  leaving: !0
696
708
  });
697
709
  }
698
710
  if (x.length && (Y.value = [...Y.value, ...x]), d.value = d.value.filter((b) => {
699
- const y = b?.id;
700
- return !y || !l.has(y);
701
- }), await yt(), Ue(h, l), x.length) {
702
- const b = new Set(x.map((y) => y.id));
711
+ const w = b?.id;
712
+ return !w || !a.has(w);
713
+ }), await xt(), Je(f, a), x.length) {
714
+ const b = new Set(x.map((w) => w.id));
703
715
  re(() => {
704
716
  Y.value = Y.value.map(
705
- (y) => b.has(y.id) ? { ...y, leaving: !1 } : y
717
+ (w) => b.has(w.id) ? { ...w, leaving: !1 } : w
706
718
  ), setTimeout(() => {
707
- Y.value = Y.value.filter((y) => !b.has(y.id));
708
- }, kt);
719
+ Y.value = Y.value.filter((w) => !b.has(w.id));
720
+ }, Ft);
709
721
  });
710
722
  }
711
723
  }
712
- async function Be(e) {
713
- return nt(e);
724
+ async function Ee(e) {
725
+ return ot(e);
714
726
  }
715
- function zt() {
716
- E += 1, J = null, Q = null, G.value = !1, K.value = !1;
727
+ function $t() {
728
+ R += 1, Q = null, Z = null, K.value = !1, J.value = !1;
717
729
  }
718
- g({
719
- remove: nt,
720
- restore: Ct,
721
- undo: Ht,
722
- forget: Lt,
723
- loadNextPage: at,
724
- cancel: zt,
730
+ y({
731
+ remove: ot,
732
+ restore: qt,
733
+ undo: Dt,
734
+ forget: Ot,
735
+ loadNextPage: it,
736
+ cancel: $t,
725
737
  get pagesLoaded() {
726
- return O.value;
738
+ return D.value;
727
739
  },
728
740
  set pagesLoaded(e) {
729
- O.value = e;
741
+ D.value = e;
730
742
  },
731
743
  get nextPage() {
732
- return R.value;
744
+ return B.value;
733
745
  },
734
746
  set nextPage(e) {
735
- R.value = e;
747
+ B.value = e;
736
748
  },
737
749
  get isLoading() {
738
- return G.value || K.value;
750
+ return K.value || J.value;
739
751
  },
740
752
  get hasReachedEnd() {
741
- return a.mode !== "backfill" ? R.value == null : R.value == null && ye.value.length === 0;
753
+ return s.mode !== "backfill" ? B.value == null : B.value == null && xe.value.length === 0;
742
754
  },
743
755
  get backfillStats() {
744
- return Pe.value;
756
+ return Be.value;
745
757
  }
746
758
  });
747
- function ot() {
748
- const e = un({
759
+ function st() {
760
+ const e = dn({
749
761
  items: d.value,
750
- columnCount: Re.value,
751
- columnWidth: ve.value,
752
- gapX: oe.value,
753
- gapY: Ce.value,
754
- headerHeight: le.value,
755
- footerHeight: ae.value,
756
- bucketPx: bt
762
+ columnCount: Ne.value,
763
+ columnWidth: he.value,
764
+ gapX: ae.value,
765
+ gapY: ze.value,
766
+ headerHeight: oe.value,
767
+ footerHeight: se.value,
768
+ bucketPx: St
757
769
  });
758
- fe.value = e.positions, ke.value = e.heights, $e.value = e.buckets, Ve.value = e.contentHeight, he.value = e.indexById;
770
+ fe.value = e.positions, Pe.value = e.heights, Xe.value = e.buckets, je.value = e.contentHeight, pe.value = e.indexById;
759
771
  }
760
- const lt = I(() => Math.max(Ve.value, q.value) + Mn), Ae = I(() => cn({
772
+ const rt = S(() => Math.max(je.value, q.value) + kn), Re = S(() => vn({
761
773
  itemCount: d.value.length,
762
774
  viewportHeight: q.value,
763
775
  scrollTop: H.value,
764
- overscanPx: a.overscanPx,
765
- bucketPx: bt,
766
- buckets: $e.value
776
+ overscanPx: s.overscanPx,
777
+ bucketPx: St,
778
+ buckets: Xe.value
767
779
  }));
768
- te(
769
- Ae,
780
+ ne(
781
+ Re,
770
782
  (e) => {
771
783
  if (!e?.length) return;
772
- const n = [];
773
- for (const t of e) {
774
- const l = d.value[t]?.id;
775
- l && U.value.has(l) && (ge.has(l) || (ge.add(l), n.push(l)));
784
+ const t = [];
785
+ for (const a of e) {
786
+ const o = d.value[a]?.id;
787
+ o && G.value.has(o) && (ye.has(o) || (ye.add(o), t.push(o)));
788
+ }
789
+ if (!t.length) return;
790
+ const n = t.length > 1 ? Bt(s.enterStaggerMs) : 0;
791
+ if (n > 0) {
792
+ const a = new Map(de.value);
793
+ for (let o = 0; o < t.length; o += 1) {
794
+ const f = t[o], v = Math.min(o * n, Fn);
795
+ a.set(f, v);
796
+ }
797
+ de.value = a;
776
798
  }
777
- n.length && (re(() => {
778
- const t = new Set(se.value);
779
- for (const l of n) t.add(l);
780
- se.value = t;
781
- }), At(() => {
782
- const t = new Set(U.value);
783
- for (const l of n) t.delete(l);
784
- U.value = t, setTimeout(() => {
785
- const l = new Set(se.value);
786
- for (const s of n)
787
- l.delete(s), ge.delete(s);
788
- se.value = l;
789
- }, It);
790
- }));
799
+ re(() => {
800
+ const a = new Set(U.value);
801
+ for (const o of t) a.add(o);
802
+ U.value = a;
803
+ }), Nt(() => {
804
+ const a = new Set(G.value);
805
+ for (const o of t) a.delete(o);
806
+ G.value = a, setTimeout(() => {
807
+ const o = new Set(U.value), f = new Map(de.value);
808
+ for (const v of t)
809
+ o.delete(v), ye.delete(v), f.delete(v);
810
+ U.value = o, de.value = f;
811
+ }, kt);
812
+ });
791
813
  },
792
814
  { flush: "post" }
793
815
  );
794
- async function at() {
795
- if (J) return J;
796
- if (G.value || K.value || a.mode !== "backfill" && R.value == null || a.mode === "backfill" && R.value == null && ye.value.length === 0)
816
+ async function it() {
817
+ if (Q) return Q;
818
+ if (K.value || J.value || s.mode !== "backfill" && B.value == null || s.mode === "backfill" && B.value == null && xe.value.length === 0)
797
819
  return;
798
- const e = E;
799
- let n = null;
800
- return n = (async () => {
820
+ const e = R;
821
+ let t = null;
822
+ return t = (async () => {
801
823
  try {
802
- if (K.value = !0, ie.value = "", a.mode === "backfill") {
803
- const s = await et.loadBackfillBatch(R.value);
804
- if (e !== E) return;
805
- s.pages.length && (O.value = [...O.value, ...s.pages]), ue(s.batchItems), d.value = [...d.value, ...s.batchItems], R.value = s.nextPage;
824
+ if (J.value = !0, ie.value = "", s.mode === "backfill") {
825
+ const o = await lt.loadBackfillBatch(B.value);
826
+ if (e !== R) return;
827
+ o.pages.length && (D.value = [...D.value, ...o.pages]), ue(o.batchItems), d.value = [...d.value, ...o.batchItems], B.value = o.nextPage;
806
828
  return;
807
829
  }
808
- const t = R.value;
809
- if (t == null) return;
810
- const l = await tt(t);
811
- if (e !== E) return;
812
- O.value = [...O.value, t], ue(l.items), d.value = [...d.value, ...l.items], R.value = l.nextPage;
813
- } catch (t) {
814
- if (e !== E || Ge(t)) return;
815
- ie.value = t instanceof Error ? t.message : String(t);
830
+ const n = B.value;
831
+ if (n == null) return;
832
+ const a = await at(n);
833
+ if (e !== R) return;
834
+ D.value = [...D.value, n], ue(a.items), d.value = [...d.value, ...a.items], B.value = a.nextPage;
835
+ } catch (n) {
836
+ if (e !== R || Qe(n)) return;
837
+ ie.value = n instanceof Error ? n.message : String(n);
816
838
  } finally {
817
- e === E && (K.value = !1), J === n && (J = null);
839
+ e === R && (J.value = !1), Q === t && (Q = null);
818
840
  }
819
- })(), J = n, n;
841
+ })(), Q = t, t;
820
842
  }
821
- function qt() {
843
+ function Vt() {
822
844
  const e = _.value;
823
845
  if (!e) return;
824
- H.value = e.scrollTop, q.value = e.clientHeight, e.scrollHeight - (e.scrollTop + e.clientHeight) <= a.prefetchThresholdPx && at();
846
+ H.value = e.scrollTop, q.value = e.clientHeight, e.scrollHeight - (e.scrollTop + e.clientHeight) <= s.prefetchThresholdPx && it();
825
847
  }
826
- function st() {
848
+ function ut() {
827
849
  return _.value;
828
850
  }
829
- function rt(e) {
830
- P.value = He(e), q.value = e.clientHeight;
851
+ function ct(e) {
852
+ P.value = qe(e), q.value = e.clientHeight;
831
853
  }
832
- function Ot() {
833
- typeof ResizeObserver > "u" || (ne = new ResizeObserver(() => {
834
- const e = st();
835
- e && rt(e);
854
+ function Yt() {
855
+ typeof ResizeObserver > "u" || (le = new ResizeObserver(() => {
856
+ const e = ut();
857
+ e && ct(e);
836
858
  }));
837
859
  }
838
- function Dt() {
860
+ function Xt() {
839
861
  return {
840
- enabled: a.mode === "backfill",
862
+ enabled: s.mode === "backfill",
841
863
  isBackfillActive: !1,
842
864
  isRequestInFlight: !1,
843
865
  requestPage: null,
@@ -846,8 +868,8 @@ const fn = { class: "hidden" }, dn = {
846
868
  target: 0
847
869
  },
848
870
  cooldownMsRemaining: 0,
849
- cooldownMsTotal: Ne(a.backfillRequestDelayMs),
850
- pageSize: Pt(a.pageSize),
871
+ cooldownMsTotal: Le(s.backfillRequestDelayMs),
872
+ pageSize: _t(s.pageSize),
851
873
  bufferSize: 0,
852
874
  lastBatch: null,
853
875
  totals: {
@@ -856,128 +878,120 @@ const fn = { class: "hidden" }, dn = {
856
878
  }
857
879
  };
858
880
  }
859
- function it() {
860
- E += 1, J = null, Q = null, we = 0, Z.clear(), ee.length = 0, U.value = /* @__PURE__ */ new Set(), se.value = /* @__PURE__ */ new Set(), ge.clear(), pe.value = /* @__PURE__ */ new Map(), V.value = /* @__PURE__ */ new Set(), Y.value = [], O.value = [], R.value = null, ye.value = [], Pe.value = Dt(), G.value = !0, K.value = !1, ie.value = "";
861
- }
862
- function ut(e) {
863
- it(), d.value = [], R.value = e;
881
+ function ft() {
882
+ R += 1, Q = null, Z = null, be = 0, ee.clear(), te.length = 0, G.value = /* @__PURE__ */ new Set(), U.value = /* @__PURE__ */ new Set(), ye.clear(), we.value = /* @__PURE__ */ new Map(), V.value = /* @__PURE__ */ new Set(), Y.value = [], D.value = [], B.value = null, xe.value = [], Be.value = Xt(), K.value = !0, J.value = !1, ie.value = "";
864
883
  }
865
- function $t(e) {
866
- const n = Array.isArray(e) ? e : [e], t = [], l = /* @__PURE__ */ new Set();
867
- for (const s of n) {
868
- if (s == null) continue;
869
- const h = typeof s == "string" ? `s:${s}` : `n:${String(s)}`;
870
- l.has(h) || (l.add(h), t.push(s));
871
- }
872
- return t;
884
+ function dt(e) {
885
+ ft(), d.value = [], B.value = e;
873
886
  }
874
- function Vt(e) {
875
- const n = [];
876
- for (const t of e) {
877
- if (typeof t == "number" && Number.isFinite(t)) {
878
- n.push(t);
879
- continue;
880
- }
881
- if (typeof t == "string") {
882
- const l = Number.parseInt(t, 10);
883
- Number.isFinite(l) && n.push(l);
884
- }
887
+ function jt(e) {
888
+ const t = Array.isArray(e) ? e : [e], n = [], a = /* @__PURE__ */ new Set();
889
+ for (const o of t) {
890
+ if (o == null) continue;
891
+ const f = typeof o == "string" ? `s:${o}` : `n:${String(o)}`;
892
+ a.has(f) || (a.add(f), n.push(o));
885
893
  }
886
- return n.length ? Math.max(...n) + 1 : null;
894
+ return n;
887
895
  }
888
- function ct(e) {
889
- it();
890
- const n = $t(e);
891
- O.value = n, R.value = typeof a.page == "string" ? a.page : Vt(n), G.value = !1, Et(d.value), ue(d.value);
896
+ function Ce(e) {
897
+ ft(), D.value = e ? jt(e) : [], B.value = s.page, K.value = !1, Lt(d.value), ue(d.value);
892
898
  }
893
- async function ft(e) {
894
- if (Q) return Q;
895
- const n = E;
896
- let t = null;
897
- return t = (async () => {
899
+ async function vt(e) {
900
+ if (Z) return Z;
901
+ const t = R;
902
+ let n = null;
903
+ return n = (async () => {
898
904
  try {
899
- if (a.mode === "backfill") {
900
- const l = await et.loadBackfillBatch(e);
901
- if (n !== E) return;
902
- O.value = l.pages.length ? l.pages : [e], ue(l.batchItems), d.value = l.batchItems, R.value = l.nextPage;
905
+ if (s.mode === "backfill") {
906
+ const a = await lt.loadBackfillBatch(e);
907
+ if (t !== R) return;
908
+ D.value = a.pages.length ? a.pages : [e], ue(a.batchItems), d.value = a.batchItems, B.value = a.nextPage;
903
909
  } else {
904
- const l = await tt(e);
905
- if (n !== E) return;
906
- O.value = [e], ue(l.items), d.value = l.items, R.value = l.nextPage;
910
+ const a = await at(e);
911
+ if (t !== R) return;
912
+ D.value = [e], ue(a.items), d.value = a.items, B.value = a.nextPage;
907
913
  }
908
- } catch (l) {
909
- if (n !== E || Ge(l)) return;
910
- ie.value = l instanceof Error ? l.message : String(l);
914
+ } catch (a) {
915
+ if (t !== R || Qe(a)) return;
916
+ ie.value = a instanceof Error ? a.message : String(a);
911
917
  } finally {
912
- n === E && (G.value = !1), Q === t && (Q = null);
918
+ t === R && (K.value = !1), Z === n && (Z = null);
913
919
  }
914
- })(), Q = t, t;
920
+ })(), Z = n, n;
915
921
  }
916
- function Yt() {
917
- const e = st();
918
- e && (rt(e), H.value = e.scrollTop, ne?.observe(e));
922
+ function Wt() {
923
+ const e = ut();
924
+ e && (ct(e), H.value = e.scrollTop, le?.observe(e));
919
925
  }
920
- Ee(async () => {
921
- if (Ot(), Yt(), a.restoredPages != null) {
922
- ct(a.restoredPages);
926
+ He(async () => {
927
+ if (Yt(), Wt(), s.restoredPages != null) {
928
+ me.value = !0, Ce(s.restoredPages);
923
929
  return;
924
930
  }
925
- ut(a.page), await ft(a.page);
926
- }), St(() => {
927
- ne?.disconnect(), M && (clearTimeout(M), M = null), F && (clearTimeout(F), F = null), B(), C();
928
- }), te(
929
- () => a.page,
931
+ if (Me.value && d.value.length > 0) {
932
+ me.value = !0, Ce();
933
+ return;
934
+ }
935
+ me.value = !1, dt(s.page), await vt(s.page);
936
+ }), Pt(() => {
937
+ le?.disconnect(), M && (clearTimeout(M), M = null), F && (clearTimeout(F), F = null), A(), N();
938
+ }), ne(
939
+ () => s.page,
930
940
  async (e) => {
931
- a.restoredPages == null && (ut(e), await ft(e));
941
+ if (me.value) {
942
+ B.value = e;
943
+ return;
944
+ }
945
+ dt(e), await vt(e);
932
946
  }
933
- ), te(
934
- () => a.restoredPages,
947
+ ), ne(
948
+ () => s.restoredPages,
935
949
  (e) => {
936
- e && ct(e);
950
+ e && (me.value = !0, Ce(e));
937
951
  }
938
- ), te(
939
- oe,
952
+ ), ne(
953
+ ae,
940
954
  () => {
941
955
  const e = _.value;
942
- e && (P.value = He(e));
956
+ e && (P.value = qe(e));
943
957
  },
944
958
  { immediate: !1 }
945
959
  );
946
- const Re = I(() => ln(P.value, a.itemWidth)), ve = I(
947
- () => an(P.value, Re.value, a.itemWidth, oe.value)
960
+ const Ne = S(() => rn(P.value, s.itemWidth)), he = S(
961
+ () => un(P.value, Ne.value, s.itemWidth, ae.value)
948
962
  );
949
- te(
950
- [Re, ve, oe, Ce, le, ae],
963
+ ne(
964
+ [Ne, he, ae, ze, oe, se],
951
965
  () => {
952
- ot();
966
+ st();
953
967
  },
954
968
  { immediate: !0 }
955
- ), te(
969
+ ), ne(
956
970
  // Performance note: this component targets very large arrays (e.g. 10k items).
957
971
  // Avoid deep watchers over items; rebuild layout only when the list structure
958
972
  // changes (new array reference or length change). This keeps metadata-only
959
973
  // updates (e.g. reactions) cheap.
960
974
  () => [d.value, d.value.length],
961
- () => ot(),
975
+ () => st(),
962
976
  { immediate: !0 }
963
977
  );
964
- const Xt = I(() => [
978
+ const Gt = S(() => [
965
979
  "mt-8 flex min-h-0 flex-1 flex-col rounded-2xl border border-slate-200/70 bg-white/70 p-5 shadow-sm backdrop-blur",
966
- f.class
980
+ m.class
967
981
  ]);
968
- return (e, n) => (S(), k("section", Gt(D.value, { class: Xt.value }), [
969
- T("div", fn, [
970
- Kt(e.$slots, "default")
982
+ return (e, t) => (k(), I("section", Qt(O.value, { class: Gt.value }), [
983
+ T("div", mn, [
984
+ Zt(e.$slots, "default")
971
985
  ]),
972
986
  T("div", {
973
987
  ref_key: "scrollViewportRef",
974
988
  ref: _,
975
989
  "data-testid": "items-scroll-container",
976
990
  class: "mt-4 min-h-0 flex-1 overflow-auto",
977
- style: $({ paddingRight: oe.value + "px" }),
978
- onScroll: qt
991
+ style: $({ paddingRight: ae.value + "px" }),
992
+ onScroll: Vt
979
993
  }, [
980
- G.value ? (S(), k("div", dn, n[0] || (n[0] = [
994
+ K.value ? (k(), I("div", hn, t[0] || (t[0] = [
981
995
  T("div", { class: "inline-flex items-center gap-3 text-sm text-slate-600" }, [
982
996
  T("svg", {
983
997
  class: "h-5 w-5 animate-spin text-slate-500",
@@ -1001,107 +1015,108 @@ const fn = { class: "hidden" }, dn = {
1001
1015
  ]),
1002
1016
  T("span", null, "Loading…")
1003
1017
  ], -1)
1004
- ]))) : ie.value ? (S(), k("p", vn, "Error: " + ht(ie.value), 1)) : (S(), k("div", {
1018
+ ]))) : ie.value ? (k(), I("p", gn, "Error: " + pt(ie.value), 1)) : (k(), I("div", {
1005
1019
  key: 2,
1006
1020
  class: "relative",
1007
- style: $({ height: lt.value + "px" })
1021
+ style: $({ height: rt.value + "px" })
1008
1022
  }, [
1009
- (S(!0), k(gt, null, pt(Ae.value, (t) => (S(), k("article", {
1010
- key: d.value[t].id,
1023
+ (k(!0), I(yt, null, wt(Re.value, (n) => (k(), I("article", {
1024
+ key: d.value[n].id,
1011
1025
  "data-testid": "item-card",
1012
1026
  class: "absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
1013
1027
  style: $({
1014
- width: ve.value + "px",
1015
- transition: _t(d.value[t].id),
1016
- transform: Bt(t)
1028
+ width: he.value + "px",
1029
+ transition: Rt(d.value[n].id),
1030
+ transitionDelay: At(d.value[n].id),
1031
+ transform: Ct(n)
1017
1032
  })
1018
1033
  }, [
1019
- Le.value || le.value > 0 ? (S(), k("div", {
1034
+ De.value || oe.value > 0 ? (k(), I("div", {
1020
1035
  key: 0,
1021
1036
  "data-testid": "item-header-container",
1022
1037
  class: "w-full",
1023
- style: $(Oe.value)
1038
+ style: $(Ve.value)
1024
1039
  }, [
1025
1040
  X(ce(c), {
1026
- "slot-fn": be.value,
1027
- "slot-props": { item: d.value[t], remove: () => Be(d.value[t]) }
1041
+ "slot-fn": Ie.value,
1042
+ "slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
1028
1043
  }, null, 8, ["slot-fn", "slot-props"])
1029
1044
  ], 4)) : j("", !0),
1030
- T("div", mn, [
1031
- X(wt, {
1032
- item: d.value[t],
1033
- onSuccess: N,
1045
+ T("div", pn, [
1046
+ X(bt, {
1047
+ item: d.value[n],
1048
+ onSuccess: C,
1034
1049
  onError: W
1035
1050
  }, null, 8, ["item"]),
1036
- qe.value ? (S(), k("div", hn, [
1051
+ $e.value ? (k(), I("div", yn, [
1037
1052
  X(ce(c), {
1038
- "slot-fn": Ie.value,
1039
- "slot-props": { item: d.value[t], remove: () => Be(d.value[t]) }
1053
+ "slot-fn": Fe.value,
1054
+ "slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
1040
1055
  }, null, 8, ["slot-fn", "slot-props"])
1041
1056
  ])) : j("", !0)
1042
1057
  ]),
1043
- ze.value || ae.value > 0 ? (S(), k("div", {
1058
+ Oe.value || se.value > 0 ? (k(), I("div", {
1044
1059
  key: 1,
1045
1060
  "data-testid": "item-footer-container",
1046
1061
  class: "w-full",
1047
- style: $(De.value)
1062
+ style: $(Ye.value)
1048
1063
  }, [
1049
1064
  X(ce(c), {
1050
- "slot-fn": Me.value,
1051
- "slot-props": { item: d.value[t], remove: () => Be(d.value[t]) }
1065
+ "slot-fn": ke.value,
1066
+ "slot-props": { item: d.value[n], remove: () => Ee(d.value[n]) }
1052
1067
  }, null, 8, ["slot-fn", "slot-props"])
1053
1068
  ], 4)) : j("", !0)
1054
1069
  ], 4))), 128)),
1055
- (S(!0), k(gt, null, pt(Y.value, (t) => (S(), k("article", {
1056
- key: t.id + ":leaving",
1070
+ (k(!0), I(yt, null, wt(Y.value, (n) => (k(), I("article", {
1071
+ key: n.id + ":leaving",
1057
1072
  "data-testid": "item-card-leaving",
1058
1073
  class: "pointer-events-none absolute overflow-hidden rounded-xl border border-slate-200/60 bg-white shadow-sm",
1059
1074
  style: $({
1060
- width: t.width + "px",
1061
- transition: "transform " + kt + "ms ease-out",
1062
- transform: t.leaving ? "translate3d(" + t.fromX + "px," + t.fromY + "px,0)" : "translate3d(" + t.fromX + "px," + Ye(t.height) + "px,0)"
1075
+ width: n.width + "px",
1076
+ transition: "transform " + Ft + "ms ease-out",
1077
+ transform: n.leaving ? "translate3d(" + n.fromX + "px," + n.fromY + "px,0)" : "translate3d(" + n.fromX + "px," + We(n.height) + "px,0)"
1063
1078
  })
1064
1079
  }, [
1065
- Le.value || le.value > 0 ? (S(), k("div", {
1080
+ De.value || oe.value > 0 ? (k(), I("div", {
1066
1081
  key: 0,
1067
1082
  "data-testid": "item-header-container",
1068
1083
  class: "w-full",
1069
- style: $(Oe.value)
1084
+ style: $(Ve.value)
1070
1085
  }, [
1071
1086
  X(ce(c), {
1072
- "slot-fn": be.value,
1073
- "slot-props": { item: t.item, remove: () => {
1087
+ "slot-fn": Ie.value,
1088
+ "slot-props": { item: n.item, remove: () => {
1074
1089
  } }
1075
1090
  }, null, 8, ["slot-fn", "slot-props"])
1076
1091
  ], 4)) : j("", !0),
1077
- T("div", gn, [
1078
- X(wt, {
1079
- item: t.item
1092
+ T("div", wn, [
1093
+ X(bt, {
1094
+ item: n.item
1080
1095
  }, null, 8, ["item"]),
1081
- qe.value ? (S(), k("div", pn, [
1096
+ $e.value ? (k(), I("div", xn, [
1082
1097
  X(ce(c), {
1083
- "slot-fn": Ie.value,
1084
- "slot-props": { item: t.item, remove: () => {
1098
+ "slot-fn": Fe.value,
1099
+ "slot-props": { item: n.item, remove: () => {
1085
1100
  } }
1086
1101
  }, null, 8, ["slot-fn", "slot-props"])
1087
1102
  ])) : j("", !0)
1088
1103
  ]),
1089
- ze.value || ae.value > 0 ? (S(), k("div", {
1104
+ Oe.value || se.value > 0 ? (k(), I("div", {
1090
1105
  key: 1,
1091
1106
  "data-testid": "item-footer-container",
1092
1107
  class: "w-full",
1093
- style: $(De.value)
1108
+ style: $(Ye.value)
1094
1109
  }, [
1095
1110
  X(ce(c), {
1096
- "slot-fn": Me.value,
1097
- "slot-props": { item: t.item, remove: () => {
1111
+ "slot-fn": ke.value,
1112
+ "slot-props": { item: n.item, remove: () => {
1098
1113
  } }
1099
1114
  }, null, 8, ["slot-fn", "slot-props"])
1100
1115
  ], 4)) : j("", !0)
1101
1116
  ], 4))), 128))
1102
1117
  ], 4)),
1103
- T("div", yn, [
1104
- K.value ? (S(), k("span", wn, n[1] || (n[1] = [
1118
+ T("div", bn, [
1119
+ J.value ? (k(), I("span", Mn, t[1] || (t[1] = [
1105
1120
  T("svg", {
1106
1121
  class: "h-4 w-4 animate-spin text-slate-500",
1107
1122
  viewBox: "0 0 24 24",
@@ -1123,40 +1138,40 @@ const fn = { class: "hidden" }, dn = {
1123
1138
  })
1124
1139
  ], -1),
1125
1140
  T("span", null, "Loading more…", -1)
1126
- ]))) : R.value == null ? (S(), k("span", xn, "End of list")) : (S(), k("span", bn, "Scroll to load page " + ht(R.value), 1))
1141
+ ]))) : B.value == null ? (k(), I("span", Sn, "End of list")) : (k(), I("span", In, "Scroll to load page " + pt(B.value), 1))
1127
1142
  ])
1128
1143
  ], 36)
1129
1144
  ], 16));
1130
1145
  }
1131
- }), Fn = xe({
1146
+ }), Bn = Se({
1132
1147
  name: "MasonryItem",
1133
- setup(o, { slots: g, attrs: u }) {
1134
- const a = Jt(Ft, null);
1135
- if (!a)
1148
+ setup(l, { slots: y, attrs: u }) {
1149
+ const s = en(Tt, null);
1150
+ if (!s)
1136
1151
  return () => null;
1137
- const i = u.onPreloaded, f = u.onFailed, c = g.overlay, r = g.default;
1138
- return a({
1139
- header: g.header,
1152
+ const i = u.onPreloaded, m = u.onFailed, c = y.overlay, r = y.default;
1153
+ return s({
1154
+ header: y.header,
1140
1155
  overlay: c ?? r,
1141
- footer: g.footer,
1142
- onPreloaded: typeof i == "function" ? i : Array.isArray(i) ? (v) => {
1143
- for (const m of i)
1144
- typeof m == "function" && m(v);
1156
+ footer: y.footer,
1157
+ onPreloaded: typeof i == "function" ? i : Array.isArray(i) ? (h) => {
1158
+ for (const g of i)
1159
+ typeof g == "function" && g(h);
1145
1160
  } : void 0,
1146
- onFailed: typeof f == "function" ? f : Array.isArray(f) ? (v) => {
1147
- for (const m of f)
1148
- typeof m == "function" && m(v);
1161
+ onFailed: typeof m == "function" ? m : Array.isArray(m) ? (h) => {
1162
+ for (const g of m)
1163
+ typeof g == "function" && g(h);
1149
1164
  } : void 0
1150
1165
  }), () => null;
1151
1166
  }
1152
- }), Tn = {
1153
- install(o) {
1154
- o.component("Masonry", Sn), o.component("MasonryItem", Fn);
1167
+ }), En = {
1168
+ install(l) {
1169
+ l.component("Masonry", _n), l.component("MasonryItem", Bn);
1155
1170
  }
1156
1171
  };
1157
1172
  export {
1158
- Sn as Masonry,
1159
- Fn as MasonryItem,
1160
- Tn as VibePlugin,
1161
- Qt as masonryDefaults
1173
+ _n as Masonry,
1174
+ Bn as MasonryItem,
1175
+ En as VibePlugin,
1176
+ tn as masonryDefaults
1162
1177
  };