@wyxos/vibe 1.6.28 → 1.6.29

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/lib/index.js CHANGED
@@ -1,22 +1,22 @@
1
- import { nextTick as C, ref as F, computed as Q, defineComponent as Xe, onMounted as Ge, onUnmounted as qe, watch as te, createElementBlock as U, openBlock as _, createCommentVNode as ae, createElementVNode as G, normalizeStyle as he, renderSlot as J, normalizeClass as ie, withModifiers as Re, toDisplayString as Ee, unref as q, Fragment as Ce, renderList as Oe, createVNode as Le, withCtx as ve, mergeProps as fe, TransitionGroup as Pt } from "vue";
2
- let ke = null;
3
- function It() {
4
- if (ke != null) return ke;
1
+ import { nextTick as C, ref as D, computed as Q, defineComponent as Ge, onMounted as qe, onUnmounted as Je, watch as ae, createElementBlock as U, openBlock as _, createCommentVNode as ne, createElementVNode as X, normalizeStyle as he, renderSlot as K, normalizeClass as ie, withModifiers as Ce, toDisplayString as He, unref as J, Fragment as Oe, renderList as Ae, createVNode as ke, withCtx as ve, mergeProps as fe, TransitionGroup as Lt } from "vue";
2
+ let Se = null;
3
+ function kt() {
4
+ if (Se != null) return Se;
5
5
  const e = document.createElement("div");
6
6
  e.style.visibility = "hidden", e.style.overflow = "scroll", e.style.msOverflowStyle = "scrollbar", e.style.width = "100px", e.style.height = "100px", document.body.appendChild(e);
7
- const l = document.createElement("div");
8
- l.style.width = "100%", e.appendChild(l);
9
- const i = e.offsetWidth - l.offsetWidth;
10
- return document.body.removeChild(e), ke = i, i;
7
+ const n = document.createElement("div");
8
+ n.style.width = "100%", e.appendChild(n);
9
+ const s = e.offsetWidth - n.offsetWidth;
10
+ return document.body.removeChild(e), Se = s, s;
11
11
  }
12
- function Ae(e, l, i, a = {}) {
12
+ function Ve(e, n, s, a = {}) {
13
13
  const {
14
- gutterX: g = 0,
15
- gutterY: d = 0,
16
- header: v = 0,
17
- footer: o = 0,
18
- paddingLeft: s = 0,
19
- paddingRight: w = 0,
14
+ gutterX: h = 0,
15
+ gutterY: g = 0,
16
+ header: f = 0,
17
+ footer: l = 0,
18
+ paddingLeft: i = 0,
19
+ paddingRight: M = 0,
20
20
  sizes: t = {
21
21
  base: 1,
22
22
  sm: 2,
@@ -25,195 +25,195 @@ function Ae(e, l, i, a = {}) {
25
25
  xl: 5,
26
26
  "2xl": 6
27
27
  },
28
- placement: x = "masonry"
28
+ placement: T = "masonry"
29
29
  } = a;
30
- let T = 0, y = 0;
30
+ let I = 0, x = 0;
31
31
  try {
32
- if (l && l.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
33
- const k = window.getComputedStyle(l);
34
- T = parseFloat(k.paddingLeft) || 0, y = parseFloat(k.paddingRight) || 0;
32
+ if (n && n.nodeType === 1 && typeof window < "u" && window.getComputedStyle) {
33
+ const k = window.getComputedStyle(n);
34
+ I = parseFloat(k.paddingLeft) || 0, x = parseFloat(k.paddingRight) || 0;
35
35
  }
36
36
  } catch {
37
37
  }
38
- const h = (s || 0) + T, P = (w || 0) + y, I = l.offsetWidth - l.clientWidth, f = I > 0 ? I + 2 : It() + 2, r = l.offsetWidth - f - h - P, u = g * (i - 1), L = Math.floor((r - u) / i), M = e.map((k) => {
39
- const B = k.width, R = k.height;
40
- return Math.round(L * R / B) + o + v;
38
+ const m = (i || 0) + I, L = (M || 0) + x, S = n.offsetWidth - n.clientWidth, d = S > 0 ? S + 2 : kt() + 2, c = n.offsetWidth - d - m - L, r = h * (s - 1), b = Math.floor((c - r) / s), P = e.map((k) => {
39
+ const H = k.width, W = k.height;
40
+ return Math.round(b * W / H) + l + f;
41
41
  });
42
- if (x === "sequential-balanced") {
43
- const k = M.length;
42
+ if (T === "sequential-balanced") {
43
+ const k = P.length;
44
44
  if (k === 0) return [];
45
- const B = (b, E, O) => b + (E > 0 ? d : 0) + O;
46
- let R = Math.max(...M), $ = M.reduce((b, E) => b + E, 0) + d * Math.max(0, k - 1);
47
- const W = (b) => {
48
- let E = 1, O = 0, ne = 0;
49
- for (let X = 0; X < k; X++) {
50
- const Z = M[X], K = B(O, ne, Z);
51
- if (K <= b)
52
- O = K, ne++;
53
- else if (E++, O = Z, ne = 1, Z > b || E > i) return !1;
45
+ const H = (w, F, B) => w + (F > 0 ? g : 0) + B;
46
+ let W = Math.max(...P), E = P.reduce((w, F) => w + F, 0) + g * Math.max(0, k - 1);
47
+ const N = (w) => {
48
+ let F = 1, B = 0, j = 0;
49
+ for (let q = 0; q < k; q++) {
50
+ const le = P[q], G = H(B, j, le);
51
+ if (G <= w)
52
+ B = G, j++;
53
+ else if (F++, B = le, j = 1, le > w || F > s) return !1;
54
54
  }
55
- return E <= i;
55
+ return F <= s;
56
56
  };
57
- for (; R < $; ) {
58
- const b = Math.floor((R + $) / 2);
59
- W(b) ? $ = b : R = b + 1;
57
+ for (; W < E; ) {
58
+ const w = Math.floor((W + E) / 2);
59
+ N(w) ? E = w : W = w + 1;
60
60
  }
61
- const H = $, n = new Array(i).fill(0);
62
- let p = i - 1, S = 0, z = 0;
63
- for (let b = k - 1; b >= 0; b--) {
64
- const E = M[b], O = b < p;
65
- !(B(S, z, E) <= H) || O ? (n[p] = b + 1, p--, S = E, z = 1) : (S = B(S, z, E), z++);
61
+ const Z = E, o = new Array(s).fill(0);
62
+ let v = s - 1, y = 0, R = 0;
63
+ for (let w = k - 1; w >= 0; w--) {
64
+ const F = P[w], B = w < v;
65
+ !(H(y, R, F) <= Z) || B ? (o[v] = w + 1, v--, y = F, R = 1) : (y = H(y, R, F), R++);
66
66
  }
67
- n[0] = 0;
68
- const V = [], Y = new Array(i).fill(0);
69
- for (let b = 0; b < i; b++) {
70
- const E = n[b], O = b + 1 < i ? n[b + 1] : k, ne = b * (L + g);
71
- for (let X = E; X < O; X++) {
72
- const K = {
73
- ...e[X],
74
- columnWidth: L,
67
+ o[0] = 0;
68
+ const O = [], V = new Array(s).fill(0);
69
+ for (let w = 0; w < s; w++) {
70
+ const F = o[w], B = w + 1 < s ? o[w + 1] : k, j = w * (b + h);
71
+ for (let q = F; q < B; q++) {
72
+ const G = {
73
+ ...e[q],
74
+ columnWidth: b,
75
75
  imageHeight: 0,
76
76
  columnHeight: 0,
77
77
  left: 0,
78
78
  top: 0
79
79
  };
80
- K.imageHeight = M[X] - (o + v), K.columnHeight = M[X], K.left = ne, K.top = Y[b], Y[b] += K.columnHeight + (X + 1 < O ? d : 0), V.push(K);
80
+ G.imageHeight = P[q] - (l + f), G.columnHeight = P[q], G.left = j, G.top = V[w], V[w] += G.columnHeight + (q + 1 < B ? g : 0), O.push(G);
81
81
  }
82
82
  }
83
- return V;
83
+ return O;
84
84
  }
85
- const m = new Array(i).fill(0), N = [];
85
+ const p = new Array(s).fill(0), z = [];
86
86
  for (let k = 0; k < e.length; k++) {
87
- const B = e[k], R = {
88
- ...B,
87
+ const H = e[k], W = {
88
+ ...H,
89
89
  columnWidth: 0,
90
90
  imageHeight: 0,
91
91
  columnHeight: 0,
92
92
  left: 0,
93
93
  top: 0
94
- }, $ = m.indexOf(Math.min(...m)), W = B.width, H = B.height;
95
- R.columnWidth = L, R.left = $ * (L + g), R.imageHeight = Math.round(L * H / W), R.columnHeight = R.imageHeight + o + v, R.top = m[$], m[$] += R.columnHeight + d, N.push(R);
94
+ }, E = p.indexOf(Math.min(...p)), N = H.width, Z = H.height;
95
+ W.columnWidth = b, W.left = E * (b + h), W.imageHeight = Math.round(b * Z / N), W.columnHeight = W.imageHeight + l + f, W.top = p[E], p[E] += W.columnHeight + g, z.push(W);
96
96
  }
97
- return N;
97
+ return z;
98
98
  }
99
- var Lt = typeof global == "object" && global && global.Object === Object && global, kt = typeof self == "object" && self && self.Object === Object && self, Je = Lt || kt || Function("return this")(), we = Je.Symbol, Ke = Object.prototype, St = Ke.hasOwnProperty, Et = Ke.toString, de = we ? we.toStringTag : void 0;
100
- function Ht(e) {
101
- var l = St.call(e, de), i = e[de];
99
+ var St = typeof global == "object" && global && global.Object === Object && global, Et = typeof self == "object" && self && self.Object === Object && self, Ke = St || Et || Function("return this")(), we = Ke.Symbol, Qe = Object.prototype, Ht = Qe.hasOwnProperty, $t = Qe.toString, de = we ? we.toStringTag : void 0;
100
+ function Dt(e) {
101
+ var n = Ht.call(e, de), s = e[de];
102
102
  try {
103
103
  e[de] = void 0;
104
104
  var a = !0;
105
105
  } catch {
106
106
  }
107
- var g = Et.call(e);
108
- return a && (l ? e[de] = i : delete e[de]), g;
107
+ var h = $t.call(e);
108
+ return a && (n ? e[de] = s : delete e[de]), h;
109
109
  }
110
- var $t = Object.prototype, Nt = $t.toString;
111
- function zt(e) {
112
- return Nt.call(e);
113
- }
114
- var Dt = "[object Null]", Bt = "[object Undefined]", Ve = we ? we.toStringTag : void 0;
115
- function Wt(e) {
116
- return e == null ? e === void 0 ? Bt : Dt : Ve && Ve in Object(e) ? Ht(e) : zt(e);
110
+ var Nt = Object.prototype, zt = Nt.toString;
111
+ function Bt(e) {
112
+ return zt.call(e);
117
113
  }
114
+ var Wt = "[object Null]", Rt = "[object Undefined]", je = we ? we.toStringTag : void 0;
118
115
  function Ft(e) {
119
- return e != null && typeof e == "object";
116
+ return e == null ? e === void 0 ? Rt : Wt : je && je in Object(e) ? Dt(e) : Bt(e);
120
117
  }
121
- var Rt = "[object Symbol]";
122
118
  function Ct(e) {
123
- return typeof e == "symbol" || Ft(e) && Wt(e) == Rt;
119
+ return e != null && typeof e == "object";
124
120
  }
125
- var Ot = /\s/;
121
+ var Ot = "[object Symbol]";
126
122
  function At(e) {
127
- for (var l = e.length; l-- && Ot.test(e.charAt(l)); )
128
- ;
129
- return l;
123
+ return typeof e == "symbol" || Ct(e) && Ft(e) == Ot;
130
124
  }
131
- var Vt = /^\s+/;
125
+ var Vt = /\s/;
132
126
  function jt(e) {
133
- return e && e.slice(0, At(e) + 1).replace(Vt, "");
127
+ for (var n = e.length; n-- && Vt.test(e.charAt(n)); )
128
+ ;
129
+ return n;
134
130
  }
135
- function He(e) {
136
- var l = typeof e;
137
- return e != null && (l == "object" || l == "function");
131
+ var Yt = /^\s+/;
132
+ function Ut(e) {
133
+ return e && e.slice(0, jt(e) + 1).replace(Yt, "");
138
134
  }
139
- var je = NaN, Yt = /^[-+]0x[0-9a-f]+$/i, Ut = /^0b[01]+$/i, _t = /^0o[0-7]+$/i, Xt = parseInt;
140
- function Ye(e) {
135
+ function $e(e) {
136
+ var n = typeof e;
137
+ return e != null && (n == "object" || n == "function");
138
+ }
139
+ var Ye = NaN, _t = /^[-+]0x[0-9a-f]+$/i, Xt = /^0b[01]+$/i, Gt = /^0o[0-7]+$/i, qt = parseInt;
140
+ function Ue(e) {
141
141
  if (typeof e == "number")
142
142
  return e;
143
- if (Ct(e))
144
- return je;
145
- if (He(e)) {
146
- var l = typeof e.valueOf == "function" ? e.valueOf() : e;
147
- e = He(l) ? l + "" : l;
143
+ if (At(e))
144
+ return Ye;
145
+ if ($e(e)) {
146
+ var n = typeof e.valueOf == "function" ? e.valueOf() : e;
147
+ e = $e(n) ? n + "" : n;
148
148
  }
149
149
  if (typeof e != "string")
150
150
  return e === 0 ? e : +e;
151
- e = jt(e);
152
- var i = Ut.test(e);
153
- return i || _t.test(e) ? Xt(e.slice(2), i ? 2 : 8) : Yt.test(e) ? je : +e;
151
+ e = Ut(e);
152
+ var s = Xt.test(e);
153
+ return s || Gt.test(e) ? qt(e.slice(2), s ? 2 : 8) : _t.test(e) ? Ye : +e;
154
154
  }
155
- var Se = function() {
156
- return Je.Date.now();
157
- }, Gt = "Expected a function", qt = Math.max, Jt = Math.min;
158
- function Ue(e, l, i) {
159
- var a, g, d, v, o, s, w = 0, t = !1, x = !1, T = !0;
155
+ var Ee = function() {
156
+ return Ke.Date.now();
157
+ }, Jt = "Expected a function", Kt = Math.max, Qt = Math.min;
158
+ function _e(e, n, s) {
159
+ var a, h, g, f, l, i, M = 0, t = !1, T = !1, I = !0;
160
160
  if (typeof e != "function")
161
- throw new TypeError(Gt);
162
- l = Ye(l) || 0, He(i) && (t = !!i.leading, x = "maxWait" in i, d = x ? qt(Ye(i.maxWait) || 0, l) : d, T = "trailing" in i ? !!i.trailing : T);
163
- function y(m) {
164
- var N = a, k = g;
165
- return a = g = void 0, w = m, v = e.apply(k, N), v;
161
+ throw new TypeError(Jt);
162
+ n = Ue(n) || 0, $e(s) && (t = !!s.leading, T = "maxWait" in s, g = T ? Kt(Ue(s.maxWait) || 0, n) : g, I = "trailing" in s ? !!s.trailing : I);
163
+ function x(p) {
164
+ var z = a, k = h;
165
+ return a = h = void 0, M = p, f = e.apply(k, z), f;
166
166
  }
167
- function h(m) {
168
- return w = m, o = setTimeout(f, l), t ? y(m) : v;
167
+ function m(p) {
168
+ return M = p, l = setTimeout(d, n), t ? x(p) : f;
169
169
  }
170
- function P(m) {
171
- var N = m - s, k = m - w, B = l - N;
172
- return x ? Jt(B, d - k) : B;
170
+ function L(p) {
171
+ var z = p - i, k = p - M, H = n - z;
172
+ return T ? Qt(H, g - k) : H;
173
173
  }
174
- function I(m) {
175
- var N = m - s, k = m - w;
176
- return s === void 0 || N >= l || N < 0 || x && k >= d;
174
+ function S(p) {
175
+ var z = p - i, k = p - M;
176
+ return i === void 0 || z >= n || z < 0 || T && k >= g;
177
177
  }
178
- function f() {
179
- var m = Se();
180
- if (I(m))
181
- return r(m);
182
- o = setTimeout(f, P(m));
178
+ function d() {
179
+ var p = Ee();
180
+ if (S(p))
181
+ return c(p);
182
+ l = setTimeout(d, L(p));
183
183
  }
184
- function r(m) {
185
- return o = void 0, T && a ? y(m) : (a = g = void 0, v);
184
+ function c(p) {
185
+ return l = void 0, I && a ? x(p) : (a = h = void 0, f);
186
186
  }
187
- function u() {
188
- o !== void 0 && clearTimeout(o), w = 0, a = s = g = o = void 0;
187
+ function r() {
188
+ l !== void 0 && clearTimeout(l), M = 0, a = i = h = l = void 0;
189
189
  }
190
- function L() {
191
- return o === void 0 ? v : r(Se());
190
+ function b() {
191
+ return l === void 0 ? f : c(Ee());
192
192
  }
193
- function M() {
194
- var m = Se(), N = I(m);
195
- if (a = arguments, g = this, s = m, N) {
196
- if (o === void 0)
197
- return h(s);
198
- if (x)
199
- return clearTimeout(o), o = setTimeout(f, l), y(s);
193
+ function P() {
194
+ var p = Ee(), z = S(p);
195
+ if (a = arguments, h = this, i = p, z) {
196
+ if (l === void 0)
197
+ return m(i);
198
+ if (T)
199
+ return clearTimeout(l), l = setTimeout(d, n), x(i);
200
200
  }
201
- return o === void 0 && (o = setTimeout(f, l)), v;
201
+ return l === void 0 && (l = setTimeout(d, n)), f;
202
202
  }
203
- return M.cancel = u, M.flush = L, M;
203
+ return P.cancel = r, P.flush = b, P;
204
204
  }
205
- function se(e, l) {
206
- const i = l ?? (typeof window < "u" ? window.innerWidth : 1024), a = e.sizes;
207
- return i >= 1536 && a["2xl"] ? a["2xl"] : i >= 1280 && a.xl ? a.xl : i >= 1024 && a.lg ? a.lg : i >= 768 && a.md ? a.md : i >= 640 && a.sm ? a.sm : a.base;
205
+ function se(e, n) {
206
+ const s = n ?? (typeof window < "u" ? window.innerWidth : 1024), a = e.sizes;
207
+ return s >= 1536 && a["2xl"] ? a["2xl"] : s >= 1280 && a.xl ? a.xl : s >= 1024 && a.lg ? a.lg : s >= 768 && a.md ? a.md : s >= 640 && a.sm ? a.sm : a.base;
208
208
  }
209
- function Kt(e) {
210
- const l = e ?? (typeof window < "u" ? window.innerWidth : 1024);
211
- return l >= 1536 ? "2xl" : l >= 1280 ? "xl" : l >= 1024 ? "lg" : l >= 768 ? "md" : l >= 640 ? "sm" : "base";
209
+ function Zt(e) {
210
+ const n = e ?? (typeof window < "u" ? window.innerWidth : 1024);
211
+ return n >= 1536 ? "2xl" : n >= 1280 ? "xl" : n >= 1024 ? "lg" : n >= 768 ? "md" : n >= 640 ? "sm" : "base";
212
212
  }
213
- function Qt(e) {
214
- return e.reduce((i, a) => Math.max(i, a.top + a.columnHeight), 0) + 500;
213
+ function ea(e) {
214
+ return e.reduce((s, a) => Math.max(s, a.top + a.columnHeight), 0) + 500;
215
215
  }
216
- function Zt(e) {
216
+ function ta(e) {
217
217
  return {
218
218
  transform: `translate3d(${e.left}px, ${e.top}px, 0)`,
219
219
  top: "0px",
@@ -222,706 +222,712 @@ function Zt(e) {
222
222
  height: `${e.columnHeight}px`
223
223
  };
224
224
  }
225
- function ea(e, l = 0) {
225
+ function aa(e, n = 0) {
226
226
  return {
227
- style: Zt(e),
227
+ style: ta(e),
228
228
  "data-top": e.top,
229
229
  "data-left": e.left,
230
230
  "data-id": `${e.page}-${e.id}`,
231
- "data-index": l
231
+ "data-index": n
232
232
  };
233
233
  }
234
- function $e(e, l) {
235
- if (!e.length || l <= 0)
236
- return new Array(Math.max(1, l)).fill(0);
237
- const a = Array.from(new Set(e.map((v) => v.left))).sort((v, o) => v - o).slice(0, l), g = /* @__PURE__ */ new Map();
238
- for (let v = 0; v < a.length; v++) g.set(a[v], v);
239
- const d = new Array(a.length).fill(0);
240
- for (const v of e) {
241
- const o = g.get(v.left);
242
- o != null && (d[o] = Math.max(d[o], v.top + v.columnHeight));
234
+ function De(e, n) {
235
+ if (!e.length || n <= 0)
236
+ return new Array(Math.max(1, n)).fill(0);
237
+ const a = Array.from(new Set(e.map((f) => f.left))).sort((f, l) => f - l).slice(0, n), h = /* @__PURE__ */ new Map();
238
+ for (let f = 0; f < a.length; f++) h.set(a[f], f);
239
+ const g = new Array(a.length).fill(0);
240
+ for (const f of e) {
241
+ const l = h.get(f.left);
242
+ l != null && (g[l] = Math.max(g[l], f.top + f.columnHeight));
243
243
  }
244
- for (; d.length < l; ) d.push(0);
245
- return d;
244
+ for (; g.length < n; ) g.push(0);
245
+ return g;
246
246
  }
247
- function ta(e, l) {
248
- let i = 0, a = 0;
249
- const g = 1e3;
250
- function d(t, x) {
251
- var h;
252
- const T = (h = e.container) == null ? void 0 : h.value;
253
- if (T) {
254
- const P = T.scrollTop, I = T.clientHeight;
255
- i = P - g, a = P + I + g;
247
+ function na(e, n) {
248
+ let s = 0, a = 0;
249
+ const h = 1e3;
250
+ function g(t, T) {
251
+ var m;
252
+ const I = (m = e.container) == null ? void 0 : m.value;
253
+ if (I) {
254
+ const L = I.scrollTop, S = I.clientHeight;
255
+ s = L - h, a = L + S + h;
256
256
  }
257
- return t + x >= i && t <= a;
257
+ return t + T >= s && t <= a;
258
258
  }
259
- function v(t, x) {
260
- var u;
261
- const T = parseInt(t.dataset.left || "0", 10), y = parseInt(t.dataset.top || "0", 10), h = parseInt(t.dataset.index || "0", 10), P = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
262
- if ((u = l == null ? void 0 : l.virtualizing) != null && u.value) {
263
- t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), t.style.transition = "", x();
259
+ function f(t, T) {
260
+ var r;
261
+ const I = parseInt(t.dataset.left || "0", 10), x = parseInt(t.dataset.top || "0", 10), m = parseInt(t.dataset.index || "0", 10), L = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
262
+ if ((r = n == null ? void 0 : n.virtualizing) != null && r.value) {
263
+ t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${I}px, ${x}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), t.style.transition = "", T();
264
264
  return;
265
265
  }
266
- if (!d(y, P)) {
267
- t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`, t.style.transition = "none", x();
266
+ if (!g(x, L)) {
267
+ t.style.opacity = "1", t.style.transform = `translate3d(${I}px, ${x}px, 0) scale(1)`, t.style.transition = "none", T();
268
268
  return;
269
269
  }
270
- const I = Math.min(h * 20, 160), f = t.style.getPropertyValue("--masonry-opacity-delay");
271
- t.style.setProperty("--masonry-opacity-delay", `${I}ms`), t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${y}px, 0) scale(1)`;
272
- const r = () => {
273
- f ? t.style.setProperty("--masonry-opacity-delay", f) : t.style.removeProperty("--masonry-opacity-delay"), t.removeEventListener("transitionend", r), x();
270
+ const S = Math.min(m * 20, 160), d = t.style.getPropertyValue("--masonry-opacity-delay");
271
+ t.style.setProperty("--masonry-opacity-delay", `${S}ms`), t.style.opacity = "1", t.style.transform = `translate3d(${I}px, ${x}px, 0) scale(1)`;
272
+ const c = () => {
273
+ d ? t.style.setProperty("--masonry-opacity-delay", d) : t.style.removeProperty("--masonry-opacity-delay"), t.removeEventListener("transitionend", c), T();
274
274
  };
275
- t.addEventListener("transitionend", r);
275
+ t.addEventListener("transitionend", c);
276
276
  }
277
- function o(t) {
278
- var y;
279
- const x = parseInt(t.dataset.left || "0", 10), T = parseInt(t.dataset.top || "0", 10);
280
- if ((y = l == null ? void 0 : l.virtualizing) != null && y.value) {
281
- t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay");
277
+ function l(t) {
278
+ var x;
279
+ const T = parseInt(t.dataset.left || "0", 10), I = parseInt(t.dataset.top || "0", 10);
280
+ if ((x = n == null ? void 0 : n.virtualizing) != null && x.value) {
281
+ t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${I}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay");
282
282
  return;
283
283
  }
284
- t.style.opacity = "0", t.style.transform = `translate3d(${x}px, ${T + 10}px, 0) scale(0.985)`;
284
+ t.style.opacity = "0", t.style.transform = `translate3d(${T}px, ${I + 10}px, 0) scale(0.985)`;
285
285
  }
286
- function s(t) {
287
- var h;
288
- const x = parseInt(t.dataset.left || "0", 10), T = parseInt(t.dataset.top || "0", 10), y = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
289
- if (!((h = l == null ? void 0 : l.virtualizing) != null && h.value)) {
290
- if (!d(T, y)) {
286
+ function i(t) {
287
+ var m;
288
+ const T = parseInt(t.dataset.left || "0", 10), I = parseInt(t.dataset.top || "0", 10), x = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
289
+ if (!((m = n == null ? void 0 : n.virtualizing) != null && m.value)) {
290
+ if (!g(I, x)) {
291
291
  t.style.transition = "none";
292
292
  return;
293
293
  }
294
- t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${x}px, ${T}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), t.style.transition = "";
294
+ t.style.transition = "none", t.style.opacity = "1", t.style.transform = `translate3d(${T}px, ${I}px, 0) scale(1)`, t.style.removeProperty("--masonry-opacity-delay"), t.style.transition = "";
295
295
  }
296
296
  }
297
- function w(t, x) {
298
- var M;
299
- const T = parseInt(t.dataset.left || "0", 10), y = parseInt(t.dataset.top || "0", 10), h = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
300
- if ((M = l == null ? void 0 : l.virtualizing) != null && M.value) {
301
- x();
297
+ function M(t, T) {
298
+ var P;
299
+ const I = parseInt(t.dataset.left || "0", 10), x = parseInt(t.dataset.top || "0", 10), m = t.offsetHeight || parseInt(getComputedStyle(t).height || "200", 10) || 200;
300
+ if ((P = n == null ? void 0 : n.virtualizing) != null && P.value) {
301
+ T();
302
302
  return;
303
303
  }
304
- if (!d(y, h)) {
305
- t.style.transition = "none", t.style.opacity = "0", x();
304
+ if (!g(x, m)) {
305
+ t.style.transition = "none", t.style.opacity = "0", T();
306
306
  return;
307
307
  }
308
- const P = typeof (l == null ? void 0 : l.leaveDurationMs) == "number" ? l.leaveDurationMs : Number.NaN;
309
- let I = Number.isFinite(P) && P > 0 ? P : Number.NaN;
310
- if (!Number.isFinite(I)) {
311
- const N = getComputedStyle(t).getPropertyValue("--masonry-leave-duration") || "", k = parseFloat(N);
312
- I = Number.isFinite(k) && k > 0 ? k : 200;
308
+ const L = typeof (n == null ? void 0 : n.leaveDurationMs) == "number" ? n.leaveDurationMs : Number.NaN;
309
+ let S = Number.isFinite(L) && L > 0 ? L : Number.NaN;
310
+ if (!Number.isFinite(S)) {
311
+ const z = getComputedStyle(t).getPropertyValue("--masonry-leave-duration") || "", k = parseFloat(z);
312
+ S = Number.isFinite(k) && k > 0 ? k : 200;
313
313
  }
314
- const f = t.style.transitionDuration, r = () => {
315
- t.removeEventListener("transitionend", u), clearTimeout(L), t.style.transitionDuration = f || "";
316
- }, u = (m) => {
317
- (!m || m.target === t) && (r(), x());
318
- }, L = setTimeout(() => {
319
- r(), x();
320
- }, I + 100);
321
- t.style.transitionDuration = `${I}ms`, t.style.opacity = "0", t.style.transform = `translate3d(${T}px, ${y + 10}px, 0) scale(0.985)`, t.addEventListener("transitionend", u);
314
+ const d = t.style.transitionDuration, c = () => {
315
+ t.removeEventListener("transitionend", r), clearTimeout(b), t.style.transitionDuration = d || "";
316
+ }, r = (p) => {
317
+ (!p || p.target === t) && (c(), T());
318
+ }, b = setTimeout(() => {
319
+ c(), T();
320
+ }, S + 100);
321
+ t.style.transitionDuration = `${S}ms`, t.style.opacity = "0", t.style.transform = `translate3d(${I}px, ${x + 10}px, 0) scale(0.985)`, t.addEventListener("transitionend", r);
322
322
  }
323
323
  return {
324
- onEnter: v,
325
- onBeforeEnter: o,
326
- onBeforeLeave: s,
327
- onLeave: w
324
+ onEnter: f,
325
+ onBeforeEnter: l,
326
+ onBeforeLeave: i,
327
+ onLeave: M
328
328
  };
329
329
  }
330
- function aa({
330
+ function la({
331
331
  container: e,
332
- masonry: l,
333
- columns: i,
332
+ masonry: n,
333
+ columns: s,
334
334
  containerHeight: a,
335
- isLoading: g,
336
- pageSize: d,
337
- refreshLayout: v,
338
- setItemsRaw: o,
339
- loadNext: s,
340
- loadThresholdPx: w
335
+ isLoading: h,
336
+ pageSize: g,
337
+ refreshLayout: f,
338
+ setItemsRaw: l,
339
+ loadNext: i,
340
+ loadThresholdPx: M
341
341
  }) {
342
342
  let t = 0;
343
- async function x(T, y = !1) {
343
+ async function T(I, x = !1) {
344
344
  if (!e.value) return;
345
- const h = T ?? $e(l.value, i.value), P = h.length ? Math.max(...h) : 0, I = e.value.scrollTop + e.value.clientHeight, f = e.value.scrollTop > t + 1;
345
+ const m = I ?? De(n.value, s.value), L = m.length ? Math.max(...m) : 0, S = e.value.scrollTop + e.value.clientHeight, d = e.value.scrollTop > t + 1;
346
346
  t = e.value.scrollTop;
347
- const r = typeof w == "number" ? w : 200, u = r >= 0 ? Math.max(0, P - r) : Math.max(0, P + r);
348
- if (I >= u && (f || y) && !g.value) {
349
- await s(), await C();
347
+ const c = typeof M == "number" ? M : 200, r = c >= 0 ? Math.max(0, L - c) : Math.max(0, L + c);
348
+ if (S >= r && (d || x) && !h.value) {
349
+ await i(), await C();
350
350
  return;
351
351
  }
352
352
  }
353
353
  return {
354
- handleScroll: x
354
+ handleScroll: T
355
355
  };
356
356
  }
357
- function na(e) {
358
- const { useSwipeMode: l, masonry: i, isLoading: a, loadNext: g, loadPage: d, paginationHistory: v } = e, o = F(0), s = F(0), w = F(!1), t = F(0), x = F(0), T = F(null), y = Q(() => {
359
- if (!l.value || i.value.length === 0) return null;
360
- const $ = Math.max(0, Math.min(o.value, i.value.length - 1));
361
- return i.value[$] || null;
362
- }), h = Q(() => {
363
- if (!l.value || !y.value) return null;
364
- const $ = o.value + 1;
365
- return $ >= i.value.length ? null : i.value[$] || null;
366
- }), P = Q(() => {
367
- if (!l.value || !y.value) return null;
368
- const $ = o.value - 1;
369
- return $ < 0 ? null : i.value[$] || null;
357
+ function oa(e) {
358
+ const { useSwipeMode: n, masonry: s, isLoading: a, loadNext: h, loadPage: g, paginationHistory: f } = e, l = D(0), i = D(0), M = D(!1), t = D(0), T = D(0), I = D(null), x = Q(() => {
359
+ if (!n.value || s.value.length === 0) return null;
360
+ const E = Math.max(0, Math.min(l.value, s.value.length - 1));
361
+ return s.value[E] || null;
362
+ }), m = Q(() => {
363
+ if (!n.value || !x.value) return null;
364
+ const E = l.value + 1;
365
+ return E >= s.value.length ? null : s.value[E] || null;
366
+ }), L = Q(() => {
367
+ if (!n.value || !x.value) return null;
368
+ const E = l.value - 1;
369
+ return E < 0 ? null : s.value[E] || null;
370
370
  });
371
- function I() {
372
- if (!T.value) return;
373
- const $ = T.value.clientHeight;
374
- s.value = -o.value * $;
371
+ function S() {
372
+ if (!I.value) return;
373
+ const E = I.value.clientHeight;
374
+ i.value = -l.value * E;
375
375
  }
376
- function f() {
377
- if (!h.value) {
378
- g();
376
+ function d() {
377
+ if (!m.value) {
378
+ h();
379
379
  return;
380
380
  }
381
- o.value++, I(), o.value >= i.value.length - 5 && g();
381
+ l.value++, S(), l.value >= s.value.length - 5 && h();
382
382
  }
383
- function r() {
384
- P.value && (o.value--, I());
383
+ function c() {
384
+ L.value && (l.value--, S());
385
385
  }
386
- function u($) {
387
- l.value && (w.value = !0, t.value = $.touches[0].clientY, x.value = s.value, $.preventDefault());
386
+ function r(E) {
387
+ n.value && (M.value = !0, t.value = E.touches[0].clientY, T.value = i.value, E.preventDefault());
388
388
  }
389
- function L($) {
390
- if (!l.value || !w.value) return;
391
- const W = $.touches[0].clientY - t.value;
392
- s.value = x.value + W, $.preventDefault();
389
+ function b(E) {
390
+ if (!n.value || !M.value) return;
391
+ const N = E.touches[0].clientY - t.value;
392
+ i.value = T.value + N, E.preventDefault();
393
393
  }
394
- function M($) {
395
- if (!l.value || !w.value) return;
396
- w.value = !1;
397
- const W = s.value - x.value;
398
- Math.abs(W) > 100 ? W > 0 && P.value ? r() : W < 0 && h.value ? f() : I() : I(), $.preventDefault();
394
+ function P(E) {
395
+ if (!n.value || !M.value) return;
396
+ M.value = !1;
397
+ const N = i.value - T.value;
398
+ Math.abs(N) > 100 ? N > 0 && L.value ? c() : N < 0 && m.value ? d() : S() : S(), E.preventDefault();
399
399
  }
400
- function m($) {
401
- l.value && (w.value = !0, t.value = $.clientY, x.value = s.value, $.preventDefault());
400
+ function p(E) {
401
+ n.value && (M.value = !0, t.value = E.clientY, T.value = i.value, E.preventDefault());
402
402
  }
403
- function N($) {
404
- if (!l.value || !w.value) return;
405
- const W = $.clientY - t.value;
406
- s.value = x.value + W, $.preventDefault();
403
+ function z(E) {
404
+ if (!n.value || !M.value) return;
405
+ const N = E.clientY - t.value;
406
+ i.value = T.value + N, E.preventDefault();
407
407
  }
408
- function k($) {
409
- if (!l.value || !w.value) return;
410
- w.value = !1;
411
- const W = s.value - x.value;
412
- Math.abs(W) > 100 ? W > 0 && P.value ? r() : W < 0 && h.value ? f() : I() : I(), $.preventDefault();
408
+ function k(E) {
409
+ if (!n.value || !M.value) return;
410
+ M.value = !1;
411
+ const N = i.value - T.value;
412
+ Math.abs(N) > 100 ? N > 0 && L.value ? c() : N < 0 && m.value ? d() : S() : S(), E.preventDefault();
413
413
  }
414
- function B() {
415
- !l.value && o.value > 0 && (o.value = 0, s.value = 0), l.value && i.value.length === 0 && !a.value && d(v.value[0]), l.value && I();
414
+ function H() {
415
+ !n.value && l.value > 0 && (l.value = 0, i.value = 0), n.value && s.value.length === 0 && !a.value && g(f.value[0]), n.value && S();
416
416
  }
417
- function R() {
418
- o.value = 0, s.value = 0, w.value = !1;
417
+ function W() {
418
+ l.value = 0, i.value = 0, M.value = !1;
419
419
  }
420
420
  return {
421
421
  // State
422
- currentSwipeIndex: o,
423
- swipeOffset: s,
424
- isDragging: w,
425
- swipeContainer: T,
422
+ currentSwipeIndex: l,
423
+ swipeOffset: i,
424
+ isDragging: M,
425
+ swipeContainer: I,
426
426
  // Computed
427
- currentItem: y,
428
- nextItem: h,
429
- previousItem: P,
427
+ currentItem: x,
428
+ nextItem: m,
429
+ previousItem: L,
430
430
  // Functions
431
- handleTouchStart: u,
432
- handleTouchMove: L,
433
- handleTouchEnd: M,
434
- handleMouseDown: m,
435
- handleMouseMove: N,
431
+ handleTouchStart: r,
432
+ handleTouchMove: b,
433
+ handleTouchEnd: P,
434
+ handleMouseDown: p,
435
+ handleMouseMove: z,
436
436
  handleMouseUp: k,
437
- goToNextItem: f,
438
- goToPreviousItem: r,
439
- snapToCurrentItem: I,
440
- handleWindowResize: B,
441
- reset: R
437
+ goToNextItem: d,
438
+ goToPreviousItem: c,
439
+ snapToCurrentItem: S,
440
+ handleWindowResize: H,
441
+ reset: W
442
442
  };
443
443
  }
444
444
  function ge(e) {
445
445
  return e instanceof Error ? e : new Error(String(e));
446
446
  }
447
- function la(e) {
447
+ function ra(e) {
448
448
  const {
449
- getPage: l,
450
- context: i,
449
+ getPage: n,
450
+ context: s,
451
451
  masonry: a,
452
- isLoading: g,
453
- hasReachedEnd: d,
454
- loadError: v,
455
- currentPage: o,
456
- paginationHistory: s,
457
- refreshLayout: w,
452
+ isLoading: h,
453
+ hasReachedEnd: g,
454
+ loadError: f,
455
+ currentPage: l,
456
+ paginationHistory: i,
457
+ refreshLayout: M,
458
458
  retryMaxAttempts: t,
459
- retryInitialDelayMs: x,
460
- retryBackoffStepMs: T,
461
- mode: y,
462
- backfillDelayMs: h,
463
- backfillMaxCalls: P,
464
- pageSize: I,
465
- emits: f
466
- } = e, r = F(!1);
467
- let u = !1;
468
- function L(H) {
469
- return a.value.filter((n) => n.page === H).length;
459
+ retryInitialDelayMs: T,
460
+ retryBackoffStepMs: I,
461
+ mode: x,
462
+ backfillDelayMs: m,
463
+ backfillMaxCalls: L,
464
+ pageSize: S,
465
+ emits: d
466
+ } = e, c = typeof x == "string" ? D(x) : x, r = D(!1);
467
+ let b = !1;
468
+ function P(o) {
469
+ return a.value.filter((v) => v.page === o).length;
470
470
  }
471
- function M(H, n) {
472
- return new Promise((p) => {
473
- const S = Math.max(0, H | 0), z = Date.now();
474
- n(S, S);
471
+ function p(o, v) {
472
+ return new Promise((y) => {
473
+ const R = Math.max(0, o | 0), O = Date.now();
474
+ v(R, R);
475
475
  const V = setInterval(() => {
476
476
  if (r.value) {
477
- clearInterval(V), p();
477
+ clearInterval(V), y();
478
478
  return;
479
479
  }
480
- const Y = Date.now() - z, b = Math.max(0, S - Y);
481
- n(b, S), b <= 0 && (clearInterval(V), p());
480
+ const w = Date.now() - O, F = Math.max(0, R - w);
481
+ v(F, R), F <= 0 && (clearInterval(V), y());
482
482
  }, 100);
483
483
  });
484
484
  }
485
- async function m(H) {
486
- let n = 0;
487
- const p = t;
488
- let S = x;
485
+ async function z(o) {
486
+ let v = 0;
487
+ const y = t;
488
+ let R = T;
489
489
  for (; ; )
490
490
  try {
491
- const z = await H();
492
- return n > 0 && f("retry:stop", { attempt: n, success: !0 }), z;
493
- } catch (z) {
494
- if (n++, n > p)
495
- throw f("retry:stop", { attempt: n - 1, success: !1 }), z;
496
- f("retry:start", { attempt: n, max: p, totalMs: S }), await M(S, (V, Y) => {
497
- f("retry:tick", { attempt: n, remainingMs: V, totalMs: Y });
498
- }), S += T;
491
+ const O = await o();
492
+ return v > 0 && d("retry:stop", { attempt: v, success: !0 }), O;
493
+ } catch (O) {
494
+ if (v++, v > y)
495
+ throw d("retry:stop", { attempt: v - 1, success: !1 }), O;
496
+ d("retry:start", { attempt: v, max: y, totalMs: R }), await p(R, (V, w) => {
497
+ d("retry:tick", { attempt: v, remainingMs: V, totalMs: w });
498
+ }), R += I;
499
499
  }
500
500
  }
501
- async function N(H) {
501
+ async function k(o) {
502
502
  try {
503
- const n = await m(() => l(H, i == null ? void 0 : i.value)), p = [...a.value, ...n.items];
504
- return a.value = p, await C(), await C(), await C(), w(p), n;
505
- } catch (n) {
506
- throw n;
503
+ const v = await z(() => n(o, s == null ? void 0 : s.value)), y = [...a.value, ...v.items];
504
+ return a.value = y, await C(), await C(), await C(), M(y), v;
505
+ } catch (v) {
506
+ throw v;
507
507
  }
508
508
  }
509
- async function k(H, n = !1) {
510
- if (!n && y !== "backfill" || u || r.value || d.value) return;
511
- const p = (H || 0) + (I || 0);
512
- if (!I || I <= 0) return;
513
- if (s.value[s.value.length - 1] == null) {
514
- d.value = !0;
509
+ async function H(o, v = !1) {
510
+ if (!v && c.value !== "backfill" || b || r.value || g.value) return;
511
+ const y = (o || 0) + (S || 0);
512
+ if (!S || S <= 0) return;
513
+ if (i.value[i.value.length - 1] == null) {
514
+ g.value = !0;
515
515
  return;
516
516
  }
517
- if (!(a.value.length >= p)) {
518
- u = !0, g.value || (g.value = !0, f("loading:start"));
517
+ if (!(a.value.length >= y)) {
518
+ b = !0, h.value || (h.value = !0, d("loading:start"));
519
519
  try {
520
- let z = 0;
521
- const V = o.value, Y = s.value[s.value.length - 1];
522
- for (f("backfill:start", {
523
- target: p,
520
+ let O = 0;
521
+ const V = l.value, w = i.value[i.value.length - 1];
522
+ for (d("backfill:start", {
523
+ target: y,
524
524
  fetched: a.value.length,
525
- calls: z,
525
+ calls: O,
526
526
  currentPage: V,
527
- nextPage: Y
528
- }); a.value.length < p && z < P && s.value[s.value.length - 1] != null && !r.value && !d.value && u; ) {
529
- const O = o.value, ne = s.value[s.value.length - 1];
530
- if (await M(h, (Z, K) => {
531
- f("backfill:tick", {
527
+ nextPage: w
528
+ }); a.value.length < y && O < L && i.value[i.value.length - 1] != null && !r.value && !g.value && b; ) {
529
+ const j = l.value, q = i.value[i.value.length - 1];
530
+ if (await p(m, (G, be) => {
531
+ d("backfill:tick", {
532
532
  fetched: a.value.length,
533
- target: p,
534
- calls: z,
535
- remainingMs: Z,
536
- totalMs: K,
537
- currentPage: O,
538
- nextPage: ne
533
+ target: y,
534
+ calls: O,
535
+ remainingMs: G,
536
+ totalMs: be,
537
+ currentPage: j,
538
+ nextPage: q
539
539
  });
540
- }), r.value || !u) break;
541
- const X = s.value[s.value.length - 1];
542
- if (X == null) {
543
- d.value = !0;
540
+ }), r.value || !b) break;
541
+ const le = i.value[i.value.length - 1];
542
+ if (le == null) {
543
+ g.value = !0;
544
544
  break;
545
545
  }
546
546
  try {
547
- if (r.value || !u) break;
548
- const Z = await N(X);
549
- if (r.value || !u) break;
550
- v.value = null, o.value = X, s.value.push(Z.nextPage), Z.nextPage == null && (d.value = !0);
551
- } catch (Z) {
552
- if (r.value || !u) break;
553
- v.value = ge(Z);
547
+ if (r.value || !b) break;
548
+ const G = await k(le);
549
+ if (r.value || !b) break;
550
+ f.value = null, l.value = le, i.value.push(G.nextPage), G.nextPage == null && (g.value = !0);
551
+ } catch (G) {
552
+ if (r.value || !b) break;
553
+ f.value = ge(G);
554
554
  }
555
- z++;
555
+ O++;
556
556
  }
557
- const b = o.value, E = s.value[s.value.length - 1];
558
- f("backfill:stop", {
557
+ const F = l.value, B = i.value[i.value.length - 1];
558
+ d("backfill:stop", {
559
559
  fetched: a.value.length,
560
- calls: z,
561
- currentPage: b,
562
- nextPage: E
560
+ calls: O,
561
+ currentPage: F,
562
+ nextPage: B
563
563
  });
564
564
  } finally {
565
- u = !1, g.value = !1;
566
- const z = o.value, V = s.value[s.value.length - 1];
567
- f("loading:stop", {
565
+ b = !1, h.value = !1;
566
+ const O = l.value, V = i.value[i.value.length - 1];
567
+ d("loading:stop", {
568
568
  fetched: a.value.length,
569
- currentPage: z,
569
+ currentPage: O,
570
570
  nextPage: V
571
571
  });
572
572
  }
573
573
  }
574
574
  }
575
- async function B(H) {
576
- if (!g.value) {
577
- r.value = !1, g.value || (g.value = !0, f("loading:start")), d.value = !1, v.value = null;
575
+ async function W(o) {
576
+ if (!h.value) {
577
+ r.value = !1, h.value || (h.value = !0, d("loading:start")), g.value = !1, f.value = null;
578
578
  try {
579
- const n = a.value.length;
579
+ const v = a.value.length;
580
580
  if (r.value) return;
581
- const p = await N(H);
582
- return r.value ? void 0 : (v.value = null, o.value = H, s.value.push(p.nextPage), p.nextPage == null && (d.value = !0), await k(n), p);
583
- } catch (n) {
584
- throw v.value = ge(n), n;
581
+ const y = await k(o);
582
+ return r.value ? void 0 : (f.value = null, l.value = o, i.value.push(y.nextPage), y.nextPage == null && (g.value = !0), await H(v), y);
583
+ } catch (v) {
584
+ throw f.value = ge(v), v;
585
585
  } finally {
586
- g.value = !1;
586
+ h.value = !1;
587
+ const v = l.value, y = i.value[i.value.length - 1];
588
+ d("loading:stop", {
589
+ fetched: a.value.length,
590
+ currentPage: v,
591
+ nextPage: y
592
+ });
587
593
  }
588
594
  }
589
595
  }
590
- async function R() {
591
- if (!g.value && !d.value) {
592
- r.value = !1, g.value || (g.value = !0, f("loading:start")), v.value = null;
596
+ async function E() {
597
+ if (!h.value && !g.value) {
598
+ r.value = !1, h.value || (h.value = !0, d("loading:start")), f.value = null;
593
599
  try {
594
- const H = a.value.length;
600
+ const o = a.value.length;
595
601
  if (r.value) return;
596
- if (y === "refresh" && o.value != null && L(o.value) < I) {
597
- const z = await m(() => l(o.value, i == null ? void 0 : i.value));
602
+ if (c.value === "refresh" && l.value != null && P(l.value) < S) {
603
+ const O = await z(() => n(l.value, s == null ? void 0 : s.value));
598
604
  if (r.value) return;
599
- const V = [...a.value], Y = z.items.filter((E) => !E || E.id == null || E.page == null ? !1 : !V.some((O) => O && O.id === E.id && O.page === E.page));
600
- if (Y.length > 0) {
601
- const E = [...a.value, ...Y];
602
- a.value = E, await C(), await C(), await C(), w(E);
605
+ const V = [...a.value], w = O.items.filter((B) => !B || B.id == null || B.page == null ? !1 : !V.some((j) => j && j.id === B.id && j.page === B.page));
606
+ if (w.length > 0) {
607
+ const B = [...a.value, ...w];
608
+ a.value = B, await C(), await C(), await C(), M(B);
603
609
  }
604
- if (v.value = null, Y.length === 0) {
605
- const E = s.value[s.value.length - 1];
606
- if (E == null) {
607
- d.value = !0;
610
+ if (f.value = null, w.length === 0) {
611
+ const B = i.value[i.value.length - 1];
612
+ if (B == null) {
613
+ g.value = !0;
608
614
  return;
609
615
  }
610
- const O = await N(E);
611
- return r.value ? void 0 : (v.value = null, o.value = E, s.value.push(O.nextPage), O.nextPage == null && (d.value = !0), await k(H), O);
616
+ const j = await k(B);
617
+ return r.value ? void 0 : (f.value = null, l.value = B, i.value.push(j.nextPage), j.nextPage == null && (g.value = !0), await H(o), j);
612
618
  }
613
- if (L(o.value) >= I) {
614
- const E = s.value[s.value.length - 1];
615
- if (E == null) {
616
- d.value = !0;
619
+ if (P(l.value) >= S) {
620
+ const B = i.value[i.value.length - 1];
621
+ if (B == null) {
622
+ g.value = !0;
617
623
  return;
618
624
  }
619
- const O = await N(E);
620
- return r.value ? void 0 : (v.value = null, o.value = E, s.value.push(O.nextPage), O.nextPage == null && (d.value = !0), await k(H), O);
625
+ const j = await k(B);
626
+ return r.value ? void 0 : (f.value = null, l.value = B, i.value.push(j.nextPage), j.nextPage == null && (g.value = !0), await H(o), j);
621
627
  } else
622
- return z;
628
+ return O;
623
629
  }
624
- const n = s.value[s.value.length - 1];
625
- if (n == null) {
626
- d.value = !0;
630
+ const v = i.value[i.value.length - 1];
631
+ if (v == null) {
632
+ g.value = !0;
627
633
  return;
628
634
  }
629
- const p = await N(n);
630
- return r.value ? void 0 : (v.value = null, o.value = n, s.value.push(p.nextPage), p.nextPage == null && (d.value = !0), await k(H), p);
631
- } catch (H) {
632
- throw v.value = ge(H), H;
635
+ const y = await k(v);
636
+ return r.value ? void 0 : (f.value = null, l.value = v, i.value.push(y.nextPage), y.nextPage == null && (g.value = !0), await H(o), y);
637
+ } catch (o) {
638
+ throw f.value = ge(o), o;
633
639
  } finally {
634
- g.value = !1;
635
- const H = o.value, n = s.value[s.value.length - 1];
636
- f("loading:stop", {
640
+ h.value = !1;
641
+ const o = l.value, v = i.value[i.value.length - 1];
642
+ d("loading:stop", {
637
643
  fetched: a.value.length,
638
- currentPage: H,
639
- nextPage: n
644
+ currentPage: o,
645
+ nextPage: v
640
646
  });
641
647
  }
642
648
  }
643
649
  }
644
- async function $() {
645
- if (!g.value) {
646
- r.value = !1, g.value = !0, f("loading:start");
650
+ async function N() {
651
+ if (!h.value) {
652
+ r.value = !1, h.value = !0, d("loading:start");
647
653
  try {
648
- const H = o.value;
649
- if (H == null) {
650
- console.warn("[Masonry] No current page to refresh - currentPage:", o.value, "paginationHistory:", s.value);
654
+ const o = l.value;
655
+ if (o == null) {
656
+ console.warn("[Masonry] No current page to refresh - currentPage:", l.value, "paginationHistory:", i.value);
651
657
  return;
652
658
  }
653
- a.value = [], d.value = !1, v.value = null, s.value = [H];
654
- const n = await N(H);
659
+ a.value = [], g.value = !1, f.value = null, i.value = [o];
660
+ const v = await k(o);
655
661
  if (r.value) return;
656
- v.value = null, o.value = H, s.value.push(n.nextPage), n.nextPage == null && (d.value = !0);
657
- const p = a.value.length;
658
- return await k(p), n;
659
- } catch (H) {
660
- throw v.value = ge(H), H;
662
+ f.value = null, l.value = o, i.value.push(v.nextPage), v.nextPage == null && (g.value = !0);
663
+ const y = a.value.length;
664
+ return await H(y), v;
665
+ } catch (o) {
666
+ throw f.value = ge(o), o;
661
667
  } finally {
662
- g.value = !1;
663
- const H = o.value, n = s.value[s.value.length - 1];
664
- f("loading:stop", {
668
+ h.value = !1;
669
+ const o = l.value, v = i.value[i.value.length - 1];
670
+ d("loading:stop", {
665
671
  fetched: a.value.length,
666
- currentPage: H,
667
- nextPage: n
672
+ currentPage: o,
673
+ nextPage: v
668
674
  });
669
675
  }
670
676
  }
671
677
  }
672
- function W() {
673
- const H = u;
674
- r.value = !0, g.value = !1, u = !1;
675
- const n = o.value, p = s.value[s.value.length - 1];
676
- H && f("backfill:stop", {
678
+ function Z() {
679
+ const o = b;
680
+ r.value = !0, h.value = !1, b = !1;
681
+ const v = l.value, y = i.value[i.value.length - 1];
682
+ o && d("backfill:stop", {
677
683
  fetched: a.value.length,
678
684
  calls: 0,
679
685
  cancelled: !0,
680
- currentPage: n,
681
- nextPage: p
682
- }), f("loading:stop", {
686
+ currentPage: v,
687
+ nextPage: y
688
+ }), d("loading:stop", {
683
689
  fetched: a.value.length,
684
- currentPage: n,
685
- nextPage: p
690
+ currentPage: v,
691
+ nextPage: y
686
692
  });
687
693
  }
688
694
  return {
689
- loadPage: B,
690
- loadNext: R,
691
- refreshCurrentPage: $,
692
- cancelLoad: W,
693
- maybeBackfillToTarget: k,
694
- getContent: N
695
+ loadPage: W,
696
+ loadNext: E,
697
+ refreshCurrentPage: N,
698
+ cancelLoad: Z,
699
+ maybeBackfillToTarget: H,
700
+ getContent: k
695
701
  };
696
702
  }
697
- function oa(e) {
703
+ function ia(e) {
698
704
  const {
699
- masonry: l,
700
- useSwipeMode: i,
705
+ masonry: n,
706
+ useSwipeMode: s,
701
707
  refreshLayout: a,
702
- loadNext: g,
703
- maybeBackfillToTarget: d,
704
- paginationHistory: v
708
+ loadNext: h,
709
+ maybeBackfillToTarget: g,
710
+ paginationHistory: f
705
711
  } = e;
706
- let o = /* @__PURE__ */ new Set(), s = null, w = !1;
712
+ let l = /* @__PURE__ */ new Set(), i = null, M = !1;
707
713
  async function t() {
708
- if (o.size === 0 || w) return;
709
- w = !0;
710
- const f = Array.from(o);
711
- o.clear(), s = null, await T(f), w = !1;
714
+ if (l.size === 0 || M) return;
715
+ M = !0;
716
+ const d = Array.from(l);
717
+ l.clear(), i = null, await I(d), M = !1;
712
718
  }
713
- async function x(f) {
714
- o.add(f), s && clearTimeout(s), s = setTimeout(() => {
719
+ async function T(d) {
720
+ l.add(d), i && clearTimeout(i), i = setTimeout(() => {
715
721
  t();
716
722
  }, 16);
717
723
  }
718
- async function T(f) {
719
- if (!f || f.length === 0) return;
720
- const r = new Set(f.map((L) => L.id)), u = l.value.filter((L) => !r.has(L.id));
721
- if (l.value = u, await C(), u.length === 0 && v.value.length > 0) {
724
+ async function I(d) {
725
+ if (!d || d.length === 0) return;
726
+ const c = new Set(d.map((b) => b.id)), r = n.value.filter((b) => !c.has(b.id));
727
+ if (n.value = r, await C(), r.length === 0 && f.value.length > 0) {
722
728
  try {
723
- await g(), await d(0, !0);
729
+ await h(), await g(0, !0);
724
730
  } catch {
725
731
  }
726
732
  return;
727
733
  }
728
- await C(), await C(), a(u);
734
+ await C(), await C(), a(r);
729
735
  }
730
- async function y(f) {
731
- !f || f.length === 0 || (f.forEach((r) => o.add(r)), s && clearTimeout(s), s = setTimeout(() => {
736
+ async function x(d) {
737
+ !d || d.length === 0 || (d.forEach((c) => l.add(c)), i && clearTimeout(i), i = setTimeout(() => {
732
738
  t();
733
739
  }, 16));
734
740
  }
735
- async function h(f, r) {
736
- if (!f) return;
737
- const u = l.value;
738
- if (u.findIndex((N) => N.id === f.id) !== -1) return;
739
- const M = [...u], m = Math.min(r, M.length);
740
- M.splice(m, 0, f), l.value = M, await C(), i.value || (await C(), await C(), a(M));
741
+ async function m(d, c) {
742
+ if (!d) return;
743
+ const r = n.value;
744
+ if (r.findIndex((z) => z.id === d.id) !== -1) return;
745
+ const P = [...r], p = Math.min(c, P.length);
746
+ P.splice(p, 0, d), n.value = P, await C(), s.value || (await C(), await C(), a(P));
741
747
  }
742
- async function P(f, r) {
743
- var $;
744
- if (!f || f.length === 0) return;
745
- if (!r || r.length !== f.length) {
748
+ async function L(d, c) {
749
+ var E;
750
+ if (!d || d.length === 0) return;
751
+ if (!c || c.length !== d.length) {
746
752
  console.warn("[Masonry] restoreMany: items and indices arrays must have the same length");
747
753
  return;
748
754
  }
749
- const u = l.value, L = new Set(u.map((W) => W.id)), M = [];
750
- for (let W = 0; W < f.length; W++)
751
- L.has(($ = f[W]) == null ? void 0 : $.id) || M.push({ item: f[W], index: r[W] });
752
- if (M.length === 0) return;
753
- const m = /* @__PURE__ */ new Map();
754
- for (const { item: W, index: H } of M)
755
- m.set(H, W);
756
- const N = M.length > 0 ? Math.max(...M.map(({ index: W }) => W)) : -1, k = Math.max(u.length - 1, N), B = [];
757
- let R = 0;
758
- for (let W = 0; W <= k; W++)
759
- m.has(W) ? B.push(m.get(W)) : R < u.length && (B.push(u[R]), R++);
760
- for (; R < u.length; )
761
- B.push(u[R]), R++;
762
- l.value = B, await C(), i.value || (await C(), await C(), a(B));
755
+ const r = n.value, b = new Set(r.map((N) => N.id)), P = [];
756
+ for (let N = 0; N < d.length; N++)
757
+ b.has((E = d[N]) == null ? void 0 : E.id) || P.push({ item: d[N], index: c[N] });
758
+ if (P.length === 0) return;
759
+ const p = /* @__PURE__ */ new Map();
760
+ for (const { item: N, index: Z } of P)
761
+ p.set(Z, N);
762
+ const z = P.length > 0 ? Math.max(...P.map(({ index: N }) => N)) : -1, k = Math.max(r.length - 1, z), H = [];
763
+ let W = 0;
764
+ for (let N = 0; N <= k; N++)
765
+ p.has(N) ? H.push(p.get(N)) : W < r.length && (H.push(r[W]), W++);
766
+ for (; W < r.length; )
767
+ H.push(r[W]), W++;
768
+ n.value = H, await C(), s.value || (await C(), await C(), a(H));
763
769
  }
764
- async function I() {
765
- l.value = [];
770
+ async function S() {
771
+ n.value = [];
766
772
  }
767
773
  return {
768
- remove: x,
769
- removeMany: y,
770
- restore: h,
771
- restoreMany: P,
772
- removeAll: I
774
+ remove: T,
775
+ removeMany: x,
776
+ restore: m,
777
+ restoreMany: L,
778
+ removeAll: S
773
779
  };
774
780
  }
775
- function ra(e) {
781
+ function sa(e) {
776
782
  const {
777
- masonry: l,
778
- useSwipeMode: i,
783
+ masonry: n,
784
+ useSwipeMode: s,
779
785
  container: a,
780
- columns: g,
781
- containerWidth: d,
782
- masonryContentHeight: v,
783
- layout: o,
784
- fixedDimensions: s,
785
- checkItemDimensions: w
786
+ columns: h,
787
+ containerWidth: g,
788
+ masonryContentHeight: f,
789
+ layout: l,
790
+ fixedDimensions: i,
791
+ checkItemDimensions: M
786
792
  } = e;
787
793
  let t = [];
788
- function x(P) {
789
- const I = Qt(P);
790
- let f = 0;
794
+ function T(L) {
795
+ const S = ea(L);
796
+ let d = 0;
791
797
  if (a.value) {
792
- const { scrollTop: r, clientHeight: u } = a.value;
793
- f = r + u + 100;
798
+ const { scrollTop: c, clientHeight: r } = a.value;
799
+ d = c + r + 100;
794
800
  }
795
- v.value = Math.max(I, f);
801
+ f.value = Math.max(S, d);
796
802
  }
797
- function T(P) {
798
- var u, L;
799
- if (i.value) {
800
- l.value = P;
803
+ function I(L) {
804
+ var r, b;
805
+ if (s.value) {
806
+ n.value = L;
801
807
  return;
802
808
  }
803
- if (l.value = P, !a.value) return;
804
- if (w(P, "refreshLayout"), P.length > 1e3 && t.length > P.length && t.length - P.length < 100) {
805
- let M = !0;
806
- for (let m = 0; m < P.length; m++)
807
- if (((u = P[m]) == null ? void 0 : u.id) !== ((L = t[m]) == null ? void 0 : L.id)) {
808
- M = !1;
809
+ if (n.value = L, !a.value) return;
810
+ if (M(L, "refreshLayout"), L.length > 1e3 && t.length > L.length && t.length - L.length < 100) {
811
+ let P = !0;
812
+ for (let p = 0; p < L.length; p++)
813
+ if (((r = L[p]) == null ? void 0 : r.id) !== ((b = t[p]) == null ? void 0 : b.id)) {
814
+ P = !1;
809
815
  break;
810
816
  }
811
- if (M) {
812
- const m = P.map((N, k) => ({
817
+ if (P) {
818
+ const p = L.map((z, k) => ({
813
819
  ...t[k],
814
820
  originalIndex: k
815
821
  }));
816
- x(m), l.value = m, t = m;
822
+ T(p), n.value = p, t = p;
817
823
  return;
818
824
  }
819
825
  }
820
- const f = P.map((M, m) => ({
821
- ...M,
822
- originalIndex: m
823
- })), r = a.value;
824
- if (s.value && s.value.width !== void 0) {
825
- const M = r.style.width, m = r.style.boxSizing;
826
- r.style.boxSizing = "border-box", r.style.width = `${s.value.width}px`, r.offsetWidth;
827
- const N = Ae(f, r, g.value, o.value);
828
- r.style.width = M, r.style.boxSizing = m, x(N), l.value = N, t = N;
826
+ const d = L.map((P, p) => ({
827
+ ...P,
828
+ originalIndex: p
829
+ })), c = a.value;
830
+ if (i.value && i.value.width !== void 0) {
831
+ const P = c.style.width, p = c.style.boxSizing;
832
+ c.style.boxSizing = "border-box", c.style.width = `${i.value.width}px`, c.offsetWidth;
833
+ const z = Ve(d, c, h.value, l.value);
834
+ c.style.width = P, c.style.boxSizing = p, T(z), n.value = z, t = z;
829
835
  } else {
830
- const M = Ae(f, r, g.value, o.value);
831
- x(M), l.value = M, t = M;
836
+ const P = Ve(d, c, h.value, l.value);
837
+ T(P), n.value = P, t = P;
832
838
  }
833
839
  }
834
- function y(P, I) {
835
- s.value = P, P && (P.width !== void 0 && (d.value = P.width), !i.value && a.value && l.value.length > 0 && C(() => {
836
- g.value = se(o.value, d.value), T(l.value), I && I();
840
+ function x(L, S) {
841
+ i.value = L, L && (L.width !== void 0 && (g.value = L.width), !s.value && a.value && n.value.length > 0 && C(() => {
842
+ h.value = se(l.value, g.value), I(n.value), S && S();
837
843
  }));
838
844
  }
839
- function h() {
840
- g.value = se(o.value, d.value), T(l.value);
845
+ function m() {
846
+ h.value = se(l.value, g.value), I(n.value);
841
847
  }
842
848
  return {
843
- refreshLayout: T,
844
- setFixedDimensions: y,
845
- onResize: h,
846
- calculateHeight: x
849
+ refreshLayout: I,
850
+ setFixedDimensions: x,
851
+ onResize: m,
852
+ calculateHeight: T
847
853
  };
848
854
  }
849
- function ia(e) {
855
+ function ua(e) {
850
856
  const {
851
- masonry: l,
852
- container: i,
857
+ masonry: n,
858
+ container: s,
853
859
  columns: a,
854
- virtualBufferPx: g,
855
- loadThresholdPx: d
856
- } = e, v = F(e.handleScroll), o = F(0), s = F(0), w = g, t = F(!1), x = F({
860
+ virtualBufferPx: h,
861
+ loadThresholdPx: g
862
+ } = e, f = D(e.handleScroll), l = D(0), i = D(0), M = h, t = D(!1), T = D({
857
863
  distanceToTrigger: 0,
858
864
  isNearTrigger: !1
859
- }), T = Q(() => {
860
- const I = o.value - w, f = o.value + s.value + w, r = l.value;
861
- return !r || r.length === 0 ? [] : r.filter((L) => {
862
- if (typeof L.top != "number" || typeof L.columnHeight != "number")
865
+ }), I = Q(() => {
866
+ const S = l.value - M, d = l.value + i.value + M, c = n.value;
867
+ return !c || c.length === 0 ? [] : c.filter((b) => {
868
+ if (typeof b.top != "number" || typeof b.columnHeight != "number")
863
869
  return !0;
864
- const M = L.top;
865
- return L.top + L.columnHeight >= I && M <= f;
870
+ const P = b.top;
871
+ return b.top + b.columnHeight >= S && P <= d;
866
872
  });
867
873
  });
868
- function y(I) {
869
- if (!i.value) return;
870
- const { scrollTop: f, clientHeight: r } = i.value, u = f + r, L = I ?? $e(l.value, a.value), M = L.length ? Math.max(...L) : 0, m = typeof d == "number" ? d : 200, N = m >= 0 ? Math.max(0, M - m) : Math.max(0, M + m), k = Math.max(0, N - u), B = k <= 100;
871
- x.value = {
874
+ function x(S) {
875
+ if (!s.value) return;
876
+ const { scrollTop: d, clientHeight: c } = s.value, r = d + c, b = S ?? De(n.value, a.value), P = b.length ? Math.max(...b) : 0, p = typeof g == "number" ? g : 200, z = p >= 0 ? Math.max(0, P - p) : Math.max(0, P + p), k = Math.max(0, z - r), H = k <= 100;
877
+ T.value = {
872
878
  distanceToTrigger: Math.round(k),
873
- isNearTrigger: B
879
+ isNearTrigger: H
874
880
  };
875
881
  }
876
- async function h() {
877
- if (i.value) {
878
- const f = i.value.scrollTop, r = i.value.clientHeight || window.innerHeight, u = r > 0 ? r : window.innerHeight;
879
- o.value = f, s.value = u;
882
+ async function m() {
883
+ if (s.value) {
884
+ const d = s.value.scrollTop, c = s.value.clientHeight || window.innerHeight, r = c > 0 ? c : window.innerHeight;
885
+ l.value = d, i.value = r;
880
886
  }
881
887
  t.value = !0, await C(), await C(), t.value = !1;
882
- const I = $e(l.value, a.value);
883
- v.value(I), y(I);
888
+ const S = De(n.value, a.value);
889
+ f.value(S), x(S);
884
890
  }
885
- function P() {
886
- o.value = 0, s.value = 0, t.value = !1, x.value = {
891
+ function L() {
892
+ l.value = 0, i.value = 0, t.value = !1, T.value = {
887
893
  distanceToTrigger: 0,
888
894
  isNearTrigger: !1
889
895
  };
890
896
  }
891
897
  return {
892
- viewportTop: o,
893
- viewportHeight: s,
898
+ viewportTop: l,
899
+ viewportHeight: i,
894
900
  virtualizing: t,
895
- scrollProgress: x,
896
- visibleMasonry: T,
897
- updateScrollProgress: y,
898
- updateViewport: h,
899
- reset: P,
900
- handleScroll: v
901
+ scrollProgress: T,
902
+ visibleMasonry: I,
903
+ updateScrollProgress: x,
904
+ updateViewport: m,
905
+ reset: L,
906
+ handleScroll: f
901
907
  };
902
908
  }
903
- function sa(e) {
904
- const { masonry: l } = e, i = F(/* @__PURE__ */ new Set());
905
- function a(v) {
906
- return typeof v == "number" && v > 0 && Number.isFinite(v);
909
+ function ca(e) {
910
+ const { masonry: n } = e, s = D(/* @__PURE__ */ new Set());
911
+ function a(f) {
912
+ return typeof f == "number" && f > 0 && Number.isFinite(f);
907
913
  }
908
- function g(v, o) {
914
+ function h(f, l) {
909
915
  try {
910
- if (!Array.isArray(v) || v.length === 0) return;
911
- const s = v.filter((t) => !a(t == null ? void 0 : t.width) || !a(t == null ? void 0 : t.height));
912
- if (s.length === 0) return;
913
- const w = [];
914
- for (const t of s) {
915
- const x = (t == null ? void 0 : t.id) ?? `idx:${l.value.indexOf(t)}`;
916
- i.value.has(x) || (i.value.add(x), w.push(x));
916
+ if (!Array.isArray(f) || f.length === 0) return;
917
+ const i = f.filter((t) => !a(t == null ? void 0 : t.width) || !a(t == null ? void 0 : t.height));
918
+ if (i.length === 0) return;
919
+ const M = [];
920
+ for (const t of i) {
921
+ const T = (t == null ? void 0 : t.id) ?? `idx:${n.value.indexOf(t)}`;
922
+ s.value.has(T) || (s.value.add(T), M.push(T));
917
923
  }
918
- if (w.length > 0) {
919
- const t = w.slice(0, 10);
924
+ if (M.length > 0) {
925
+ const t = M.slice(0, 10);
920
926
  console.warn(
921
927
  "[Masonry] Items missing width/height detected:",
922
928
  {
923
- context: o,
924
- count: w.length,
929
+ context: l,
930
+ count: M.length,
925
931
  sampleIds: t,
926
932
  hint: "Ensure each item has positive width and height. Consider providing fallbacks (e.g., 512x512) at the data layer."
927
933
  }
@@ -930,28 +936,28 @@ function sa(e) {
930
936
  } catch {
931
937
  }
932
938
  }
933
- function d() {
934
- i.value.clear();
939
+ function g() {
940
+ s.value.clear();
935
941
  }
936
942
  return {
937
- checkItemDimensions: g,
938
- invalidDimensionIds: i,
939
- reset: d
943
+ checkItemDimensions: h,
944
+ invalidDimensionIds: s,
945
+ reset: g
940
946
  };
941
947
  }
942
- const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full rounded-xl overflow-hidden shadow-sm transition-all duration-300 bg-white relative" }, va = {
948
+ const va = { class: "flex-1 relative min-h-0" }, fa = { class: "w-full h-full rounded-xl overflow-hidden shadow-sm transition-all duration-300 bg-white relative" }, da = {
943
949
  key: 0,
944
950
  class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-100 text-slate-400 text-sm p-4 text-center"
945
- }, fa = {
951
+ }, ga = {
946
952
  key: 1,
947
953
  class: "relative w-full h-full"
948
- }, da = ["src"], ga = ["src", "autoplay", "controls"], ha = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, ma = {
954
+ }, ha = ["src"], ma = ["src", "autoplay", "controls"], pa = { class: "w-12 h-12 rounded-full bg-white/80 backdrop-blur-sm flex items-center justify-center shadow-sm" }, ya = {
949
955
  key: 3,
950
956
  class: "absolute bottom-2 left-1/2 transform -translate-x-1/2 flex items-center justify-center z-10"
951
- }, pa = {
957
+ }, wa = {
952
958
  key: 4,
953
959
  class: "absolute inset-0 flex flex-col items-center justify-center bg-slate-50 text-slate-400 text-sm p-4 text-center"
954
- }, xe = /* @__PURE__ */ Xe({
960
+ }, xe = /* @__PURE__ */ Ge({
955
961
  __name: "MasonryItem",
956
962
  props: {
957
963
  item: {},
@@ -965,307 +971,307 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
965
971
  preloadThreshold: { default: 1 }
966
972
  },
967
973
  emits: ["preload:success", "preload:error", "mouse-enter", "mouse-leave", "in-view", "in-view-and-loaded"],
968
- setup(e, { emit: l }) {
969
- const i = e, a = l, g = F(!1), d = F(!1), v = F(null), o = F(!1), s = F(!1), w = F(null), t = F(!1), x = F(!1), T = F(!1), y = F(!1), h = F(!1), P = F(null), I = F(null);
970
- let f = null;
971
- const r = Q(() => {
972
- var n;
973
- return i.type ?? ((n = i.item) == null ? void 0 : n.type) ?? "image";
974
- }), u = Q(() => {
975
- var n;
976
- return i.notFound ?? ((n = i.item) == null ? void 0 : n.notFound) ?? !1;
977
- }), L = Q(() => !!i.inSwipeMode);
978
- function M(n, p) {
979
- const S = n === "image" ? g.value : o.value;
980
- x.value && S && !T.value && (T.value = !0, a("in-view-and-loaded", { item: i.item, type: n, src: p }));
974
+ setup(e, { emit: n }) {
975
+ const s = e, a = n, h = D(!1), g = D(!1), f = D(null), l = D(!1), i = D(!1), M = D(null), t = D(!1), T = D(!1), I = D(!1), x = D(!1), m = D(!1), L = D(null), S = D(null);
976
+ let d = null;
977
+ const c = Q(() => {
978
+ var o;
979
+ return s.type ?? ((o = s.item) == null ? void 0 : o.type) ?? "image";
980
+ }), r = Q(() => {
981
+ var o;
982
+ return s.notFound ?? ((o = s.item) == null ? void 0 : o.notFound) ?? !1;
983
+ }), b = Q(() => !!s.inSwipeMode);
984
+ function P(o, v) {
985
+ const y = o === "image" ? h.value : l.value;
986
+ T.value && y && !I.value && (I.value = !0, a("in-view-and-loaded", { item: s.item, type: o, src: v }));
981
987
  }
982
- function m(n) {
983
- a("mouse-enter", { item: i.item, type: n });
988
+ function p(o) {
989
+ a("mouse-enter", { item: s.item, type: o });
984
990
  }
985
- function N(n) {
986
- a("mouse-leave", { item: i.item, type: n });
991
+ function z(o) {
992
+ a("mouse-leave", { item: s.item, type: o });
987
993
  }
988
- function k(n) {
989
- if (L.value) return;
990
- const p = n.target;
991
- p && (p.paused ? p.play() : p.pause());
994
+ function k(o) {
995
+ if (b.value) return;
996
+ const v = o.target;
997
+ v && (v.paused ? v.play() : v.pause());
992
998
  }
993
- function B(n) {
994
- const p = n.target;
995
- p && (L.value || p.play(), m("video"));
999
+ function H(o) {
1000
+ const v = o.target;
1001
+ v && (b.value || v.play(), p("video"));
996
1002
  }
997
- function R(n) {
998
- const p = n.target;
999
- p && (L.value || p.pause(), N("video"));
1003
+ function W(o) {
1004
+ const v = o.target;
1005
+ v && (b.value || v.pause(), z("video"));
1000
1006
  }
1001
- function $(n) {
1002
- return new Promise((p, S) => {
1003
- if (!n) {
1004
- const b = new Error("No image source provided");
1005
- a("preload:error", { item: i.item, type: "image", src: n, error: b }), S(b);
1007
+ function E(o) {
1008
+ return new Promise((v, y) => {
1009
+ if (!o) {
1010
+ const w = new Error("No image source provided");
1011
+ a("preload:error", { item: s.item, type: "image", src: o, error: w }), y(w);
1006
1012
  return;
1007
1013
  }
1008
- const z = new Image(), V = Date.now(), Y = 300;
1009
- z.onload = () => {
1010
- const b = Date.now() - V, E = Math.max(0, Y - b);
1014
+ const R = new Image(), O = Date.now(), V = 300;
1015
+ R.onload = () => {
1016
+ const w = Date.now() - O, F = Math.max(0, V - w);
1011
1017
  setTimeout(async () => {
1012
- g.value = !0, d.value = !1, y.value = !1, await C(), await new Promise((O) => setTimeout(O, 100)), h.value = !0, a("preload:success", { item: i.item, type: "image", src: n }), M("image", n), p();
1013
- }, E);
1014
- }, z.onerror = () => {
1015
- d.value = !0, g.value = !1, y.value = !1;
1016
- const b = new Error("Failed to load image");
1017
- a("preload:error", { item: i.item, type: "image", src: n, error: b }), S(b);
1018
- }, z.src = n;
1018
+ h.value = !0, g.value = !1, x.value = !1, await C(), await new Promise((B) => setTimeout(B, 100)), m.value = !0, a("preload:success", { item: s.item, type: "image", src: o }), P("image", o), v();
1019
+ }, F);
1020
+ }, R.onerror = () => {
1021
+ g.value = !0, h.value = !1, x.value = !1;
1022
+ const w = new Error("Failed to load image");
1023
+ a("preload:error", { item: s.item, type: "image", src: o, error: w }), y(w);
1024
+ }, R.src = o;
1019
1025
  });
1020
1026
  }
1021
- function W(n) {
1022
- return new Promise((p, S) => {
1023
- if (!n) {
1024
- const b = new Error("No video source provided");
1025
- a("preload:error", { item: i.item, type: "video", src: n, error: b }), S(b);
1027
+ function N(o) {
1028
+ return new Promise((v, y) => {
1029
+ if (!o) {
1030
+ const w = new Error("No video source provided");
1031
+ a("preload:error", { item: s.item, type: "video", src: o, error: w }), y(w);
1026
1032
  return;
1027
1033
  }
1028
- const z = document.createElement("video"), V = Date.now(), Y = 300;
1029
- z.preload = "metadata", z.muted = !0, z.onloadedmetadata = () => {
1030
- const b = Date.now() - V, E = Math.max(0, Y - b);
1034
+ const R = document.createElement("video"), O = Date.now(), V = 300;
1035
+ R.preload = "metadata", R.muted = !0, R.onloadedmetadata = () => {
1036
+ const w = Date.now() - O, F = Math.max(0, V - w);
1031
1037
  setTimeout(async () => {
1032
- o.value = !0, s.value = !1, y.value = !1, await C(), await new Promise((O) => setTimeout(O, 100)), h.value = !0, a("preload:success", { item: i.item, type: "video", src: n }), M("video", n), p();
1033
- }, E);
1034
- }, z.onerror = () => {
1035
- s.value = !0, o.value = !1, y.value = !1;
1036
- const b = new Error("Failed to load video");
1037
- a("preload:error", { item: i.item, type: "video", src: n, error: b }), S(b);
1038
- }, z.src = n;
1038
+ l.value = !0, i.value = !1, x.value = !1, await C(), await new Promise((B) => setTimeout(B, 100)), m.value = !0, a("preload:success", { item: s.item, type: "video", src: o }), P("video", o), v();
1039
+ }, F);
1040
+ }, R.onerror = () => {
1041
+ i.value = !0, l.value = !1, x.value = !1;
1042
+ const w = new Error("Failed to load video");
1043
+ a("preload:error", { item: s.item, type: "video", src: o, error: w }), y(w);
1044
+ }, R.src = o;
1039
1045
  });
1040
1046
  }
1041
- async function H() {
1042
- var p;
1043
- if (!t.value || y.value || u.value || r.value === "video" && o.value || r.value === "image" && g.value)
1047
+ async function Z() {
1048
+ var v;
1049
+ if (!t.value || x.value || r.value || c.value === "video" && l.value || c.value === "image" && h.value)
1044
1050
  return;
1045
- const n = (p = i.item) == null ? void 0 : p.src;
1046
- if (n)
1047
- if (y.value = !0, h.value = !1, r.value === "video") {
1048
- w.value = n, o.value = !1, s.value = !1;
1051
+ const o = (v = s.item) == null ? void 0 : v.src;
1052
+ if (o)
1053
+ if (x.value = !0, m.value = !1, c.value === "video") {
1054
+ M.value = o, l.value = !1, i.value = !1;
1049
1055
  try {
1050
- await W(n);
1056
+ await N(o);
1051
1057
  } catch {
1052
1058
  }
1053
1059
  } else {
1054
- v.value = n, g.value = !1, d.value = !1;
1060
+ f.value = o, h.value = !1, g.value = !1;
1055
1061
  try {
1056
- await $(n);
1062
+ await E(o);
1057
1063
  } catch {
1058
1064
  }
1059
1065
  }
1060
1066
  }
1061
- return Ge(async () => {
1062
- if (!P.value) return;
1063
- const n = [i.preloadThreshold, 1].filter((S, z, V) => V.indexOf(S) === z).sort((S, z) => S - z);
1064
- f = new IntersectionObserver(
1065
- (S) => {
1066
- S.forEach((z) => {
1067
- const V = z.intersectionRatio, Y = V >= 1, b = V >= i.preloadThreshold;
1068
- if (Y && !x.value) {
1069
- x.value = !0, a("in-view", { item: i.item, type: r.value });
1070
- const E = r.value === "image" ? v.value : w.value, O = r.value === "image" ? g.value : o.value;
1071
- E && O && M(r.value, E);
1067
+ return qe(async () => {
1068
+ if (!L.value) return;
1069
+ const o = [s.preloadThreshold, 1].filter((y, R, O) => O.indexOf(y) === R).sort((y, R) => y - R);
1070
+ d = new IntersectionObserver(
1071
+ (y) => {
1072
+ y.forEach((R) => {
1073
+ const O = R.intersectionRatio, V = O >= 1, w = O >= s.preloadThreshold;
1074
+ if (V && !T.value) {
1075
+ T.value = !0, a("in-view", { item: s.item, type: c.value });
1076
+ const F = c.value === "image" ? f.value : M.value, B = c.value === "image" ? h.value : l.value;
1077
+ F && B && P(c.value, F);
1072
1078
  }
1073
- b && !t.value ? (t.value = !0, H()) : z.isIntersecting;
1079
+ w && !t.value ? (t.value = !0, Z()) : R.isIntersecting;
1074
1080
  });
1075
1081
  },
1076
1082
  {
1077
1083
  // Trigger at both preloadThreshold and 1.0 (fully in view)
1078
- threshold: n
1084
+ threshold: o
1079
1085
  }
1080
- ), f.observe(P.value), await C(), await C(), await C(), p(), setTimeout(() => {
1081
- p();
1086
+ ), d.observe(L.value), await C(), await C(), await C(), v(), setTimeout(() => {
1087
+ v();
1082
1088
  }, 100);
1083
- function p() {
1084
- if (!P.value || x.value) return;
1085
- const S = P.value.getBoundingClientRect(), z = window.innerHeight, V = window.innerWidth;
1086
- if (S.top >= 0 && S.bottom <= z && S.left >= 0 && S.right <= V && S.height > 0 && S.width > 0) {
1087
- x.value = !0, a("in-view", { item: i.item, type: r.value });
1088
- const b = r.value === "image" ? v.value : w.value, E = r.value === "image" ? g.value : o.value;
1089
- b && E && M(r.value, b);
1089
+ function v() {
1090
+ if (!L.value || T.value) return;
1091
+ const y = L.value.getBoundingClientRect(), R = window.innerHeight, O = window.innerWidth;
1092
+ if (y.top >= 0 && y.bottom <= R && y.left >= 0 && y.right <= O && y.height > 0 && y.width > 0) {
1093
+ T.value = !0, a("in-view", { item: s.item, type: c.value });
1094
+ const w = c.value === "image" ? f.value : M.value, F = c.value === "image" ? h.value : l.value;
1095
+ w && F && P(c.value, w);
1090
1096
  }
1091
1097
  }
1092
- }), qe(() => {
1093
- f && (f.disconnect(), f = null);
1094
- }), te(
1098
+ }), Je(() => {
1099
+ d && (d.disconnect(), d = null);
1100
+ }), ae(
1095
1101
  () => {
1096
- var n;
1097
- return (n = i.item) == null ? void 0 : n.src;
1102
+ var o;
1103
+ return (o = s.item) == null ? void 0 : o.src;
1098
1104
  },
1099
- async (n) => {
1100
- if (!(!n || u.value)) {
1101
- if (r.value === "video") {
1102
- if (n !== w.value && (o.value = !1, s.value = !1, w.value = n, t.value)) {
1103
- y.value = !0;
1105
+ async (o) => {
1106
+ if (!(!o || r.value)) {
1107
+ if (c.value === "video") {
1108
+ if (o !== M.value && (l.value = !1, i.value = !1, M.value = o, t.value)) {
1109
+ x.value = !0;
1104
1110
  try {
1105
- await W(n);
1111
+ await N(o);
1106
1112
  } catch {
1107
1113
  }
1108
1114
  }
1109
- } else if (n !== v.value && (g.value = !1, d.value = !1, v.value = n, t.value)) {
1110
- y.value = !0;
1115
+ } else if (o !== f.value && (h.value = !1, g.value = !1, f.value = o, t.value)) {
1116
+ x.value = !0;
1111
1117
  try {
1112
- await $(n);
1118
+ await E(o);
1113
1119
  } catch {
1114
1120
  }
1115
1121
  }
1116
1122
  }
1117
1123
  }
1118
- ), te(
1119
- () => i.isActive,
1120
- (n) => {
1121
- !L.value || !I.value || (n ? I.value.play() : I.value.pause());
1124
+ ), ae(
1125
+ () => s.isActive,
1126
+ (o) => {
1127
+ !b.value || !S.value || (o ? S.value.play() : S.value.pause());
1122
1128
  }
1123
- ), (n, p) => (_(), U("div", {
1129
+ ), (o, v) => (_(), U("div", {
1124
1130
  ref_key: "containerRef",
1125
- ref: P,
1131
+ ref: L,
1126
1132
  class: "relative w-full h-full flex flex-col"
1127
1133
  }, [
1128
- n.headerHeight > 0 ? (_(), U("div", {
1134
+ o.headerHeight > 0 ? (_(), U("div", {
1129
1135
  key: 0,
1130
1136
  class: "relative z-10",
1131
- style: he({ height: `${n.headerHeight}px` })
1137
+ style: he({ height: `${o.headerHeight}px` })
1132
1138
  }, [
1133
- J(n.$slots, "header", {
1134
- item: n.item,
1135
- remove: n.remove,
1136
- imageLoaded: g.value,
1137
- imageError: d.value,
1138
- videoLoaded: o.value,
1139
- videoError: s.value,
1140
- showNotFound: u.value,
1141
- isLoading: y.value,
1142
- mediaType: r.value,
1143
- isFullyInView: x.value
1139
+ K(o.$slots, "header", {
1140
+ item: o.item,
1141
+ remove: o.remove,
1142
+ imageLoaded: h.value,
1143
+ imageError: g.value,
1144
+ videoLoaded: l.value,
1145
+ videoError: i.value,
1146
+ showNotFound: r.value,
1147
+ isLoading: x.value,
1148
+ mediaType: c.value,
1149
+ isFullyInView: T.value
1144
1150
  })
1145
- ], 4)) : ae("", !0),
1146
- G("div", ua, [
1147
- J(n.$slots, "default", {
1148
- item: n.item,
1149
- remove: n.remove,
1150
- imageLoaded: g.value,
1151
- imageError: d.value,
1152
- videoLoaded: o.value,
1153
- videoError: s.value,
1154
- showNotFound: u.value,
1155
- isLoading: y.value,
1156
- mediaType: r.value,
1157
- imageSrc: v.value,
1158
- videoSrc: w.value,
1159
- showMedia: h.value,
1160
- isFullyInView: x.value
1151
+ ], 4)) : ne("", !0),
1152
+ X("div", va, [
1153
+ K(o.$slots, "default", {
1154
+ item: o.item,
1155
+ remove: o.remove,
1156
+ imageLoaded: h.value,
1157
+ imageError: g.value,
1158
+ videoLoaded: l.value,
1159
+ videoError: i.value,
1160
+ showNotFound: r.value,
1161
+ isLoading: x.value,
1162
+ mediaType: c.value,
1163
+ imageSrc: f.value,
1164
+ videoSrc: M.value,
1165
+ showMedia: m.value,
1166
+ isFullyInView: T.value
1161
1167
  }, () => [
1162
- G("div", ca, [
1163
- u.value ? (_(), U("div", va, p[3] || (p[3] = [
1164
- G("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
1165
- G("span", { class: "font-medium" }, "Not Found", -1),
1166
- G("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
1167
- ]))) : (_(), U("div", fa, [
1168
- r.value === "image" && v.value ? (_(), U("img", {
1168
+ X("div", fa, [
1169
+ r.value ? (_(), U("div", da, v[3] || (v[3] = [
1170
+ X("i", { class: "fas fa-search text-3xl mb-3 opacity-50" }, null, -1),
1171
+ X("span", { class: "font-medium" }, "Not Found", -1),
1172
+ X("span", { class: "text-xs mt-1 opacity-75" }, "This item could not be located", -1)
1173
+ ]))) : (_(), U("div", ga, [
1174
+ c.value === "image" && f.value ? (_(), U("img", {
1169
1175
  key: 0,
1170
- src: v.value,
1176
+ src: f.value,
1171
1177
  class: ie([
1172
1178
  "w-full h-full object-cover transition-opacity duration-700 ease-in-out",
1173
- g.value && h.value ? "opacity-100" : "opacity-0"
1179
+ h.value && m.value ? "opacity-100" : "opacity-0"
1174
1180
  ]),
1175
1181
  style: { position: "absolute", top: "0", left: "0" },
1176
1182
  loading: "lazy",
1177
1183
  decoding: "async",
1178
1184
  alt: "",
1179
- onMouseenter: p[0] || (p[0] = (S) => m("image")),
1180
- onMouseleave: p[1] || (p[1] = (S) => N("image"))
1181
- }, null, 42, da)) : ae("", !0),
1182
- r.value === "video" && w.value ? (_(), U("video", {
1185
+ onMouseenter: v[0] || (v[0] = (y) => p("image")),
1186
+ onMouseleave: v[1] || (v[1] = (y) => z("image"))
1187
+ }, null, 42, ha)) : ne("", !0),
1188
+ c.value === "video" && M.value ? (_(), U("video", {
1183
1189
  key: 1,
1184
1190
  ref_key: "videoEl",
1185
- ref: I,
1186
- src: w.value,
1191
+ ref: S,
1192
+ src: M.value,
1187
1193
  class: ie([
1188
1194
  "w-full h-full object-cover transition-opacity duration-700 ease-in-out",
1189
- o.value && h.value ? "opacity-100" : "opacity-0"
1195
+ l.value && m.value ? "opacity-100" : "opacity-0"
1190
1196
  ]),
1191
1197
  style: { position: "absolute", top: "0", left: "0" },
1192
1198
  muted: "",
1193
1199
  loop: "",
1194
1200
  playsinline: "",
1195
- autoplay: L.value && i.isActive,
1196
- controls: L.value,
1197
- onClick: Re(k, ["stop"]),
1198
- onTouchend: Re(k, ["stop", "prevent"]),
1199
- onMouseenter: B,
1200
- onMouseleave: R,
1201
- onError: p[2] || (p[2] = (S) => s.value = !0)
1202
- }, null, 42, ga)) : ae("", !0),
1203
- !g.value && !o.value && !d.value && !s.value ? (_(), U("div", {
1201
+ autoplay: b.value && s.isActive,
1202
+ controls: b.value,
1203
+ onClick: Ce(k, ["stop"]),
1204
+ onTouchend: Ce(k, ["stop", "prevent"]),
1205
+ onMouseenter: H,
1206
+ onMouseleave: W,
1207
+ onError: v[2] || (v[2] = (y) => i.value = !0)
1208
+ }, null, 42, ma)) : ne("", !0),
1209
+ !h.value && !l.value && !g.value && !i.value ? (_(), U("div", {
1204
1210
  key: 2,
1205
1211
  class: ie([
1206
1212
  "absolute inset-0 bg-slate-100 flex items-center justify-center transition-opacity duration-500",
1207
- h.value ? "opacity-0 pointer-events-none" : "opacity-100"
1213
+ m.value ? "opacity-0 pointer-events-none" : "opacity-100"
1208
1214
  ])
1209
1215
  }, [
1210
- G("div", ha, [
1211
- J(n.$slots, "placeholder-icon", { mediaType: r.value }, () => [
1212
- G("i", {
1213
- class: ie(r.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
1216
+ X("div", pa, [
1217
+ K(o.$slots, "placeholder-icon", { mediaType: c.value }, () => [
1218
+ X("i", {
1219
+ class: ie(c.value === "video" ? "fas fa-video text-xl text-slate-400" : "fas fa-image text-xl text-slate-400")
1214
1220
  }, null, 2)
1215
1221
  ])
1216
1222
  ])
1217
- ], 2)) : ae("", !0),
1218
- y.value ? (_(), U("div", ma, p[4] || (p[4] = [
1219
- G("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
1220
- G("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
1223
+ ], 2)) : ne("", !0),
1224
+ x.value ? (_(), U("div", ya, v[4] || (v[4] = [
1225
+ X("div", { class: "bg-white/90 backdrop-blur-sm rounded-full px-3 py-1.5 shadow-sm" }, [
1226
+ X("div", { class: "animate-spin rounded-full h-4 w-4 border-b-2 border-blue-500" })
1221
1227
  ], -1)
1222
- ]))) : ae("", !0),
1223
- r.value === "image" && d.value || r.value === "video" && s.value ? (_(), U("div", pa, [
1224
- G("i", {
1225
- class: ie(r.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
1228
+ ]))) : ne("", !0),
1229
+ c.value === "image" && g.value || c.value === "video" && i.value ? (_(), U("div", wa, [
1230
+ X("i", {
1231
+ class: ie(c.value === "video" ? "fas fa-video text-2xl mb-2 opacity-50" : "fas fa-image text-2xl mb-2 opacity-50")
1226
1232
  }, null, 2),
1227
- G("span", null, "Failed to load " + Ee(r.value), 1)
1228
- ])) : ae("", !0)
1233
+ X("span", null, "Failed to load " + He(c.value), 1)
1234
+ ])) : ne("", !0)
1229
1235
  ]))
1230
1236
  ])
1231
1237
  ])
1232
1238
  ]),
1233
- n.footerHeight > 0 ? (_(), U("div", {
1239
+ o.footerHeight > 0 ? (_(), U("div", {
1234
1240
  key: 1,
1235
1241
  class: "relative z-10",
1236
- style: he({ height: `${n.footerHeight}px` })
1242
+ style: he({ height: `${o.footerHeight}px` })
1237
1243
  }, [
1238
- J(n.$slots, "footer", {
1239
- item: n.item,
1240
- remove: n.remove,
1241
- imageLoaded: g.value,
1242
- imageError: d.value,
1243
- videoLoaded: o.value,
1244
- videoError: s.value,
1245
- showNotFound: u.value,
1246
- isLoading: y.value,
1247
- mediaType: r.value,
1248
- isFullyInView: x.value
1244
+ K(o.$slots, "footer", {
1245
+ item: o.item,
1246
+ remove: o.remove,
1247
+ imageLoaded: h.value,
1248
+ imageError: g.value,
1249
+ videoLoaded: l.value,
1250
+ videoError: i.value,
1251
+ showNotFound: r.value,
1252
+ isLoading: x.value,
1253
+ mediaType: c.value,
1254
+ isFullyInView: T.value
1249
1255
  })
1250
- ], 4)) : ae("", !0)
1256
+ ], 4)) : ne("", !0)
1251
1257
  ], 512));
1252
1258
  }
1253
- }), ya = {
1259
+ }), xa = {
1254
1260
  key: 0,
1255
1261
  class: "w-full h-full flex items-center justify-center"
1256
- }, wa = { class: "w-full h-full flex items-center justify-center p-4" }, xa = { class: "w-full h-full max-w-full max-h-full relative" }, ba = {
1262
+ }, ba = { class: "w-full h-full flex items-center justify-center p-4" }, Ma = { class: "w-full h-full max-w-full max-h-full relative" }, Ta = {
1257
1263
  key: 0,
1258
1264
  class: "w-full py-8 text-center"
1259
- }, Ma = {
1265
+ }, Pa = {
1260
1266
  key: 1,
1261
1267
  class: "w-full py-8 text-center"
1262
- }, Ta = { class: "text-red-500 dark:text-red-400" }, Pa = {
1268
+ }, Ia = { class: "text-red-500 dark:text-red-400" }, La = {
1263
1269
  key: 0,
1264
1270
  class: "w-full py-8 text-center"
1265
- }, Ia = {
1271
+ }, ka = {
1266
1272
  key: 1,
1267
1273
  class: "w-full py-8 text-center"
1268
- }, La = { class: "text-red-500 dark:text-red-400" }, ka = /* @__PURE__ */ Xe({
1274
+ }, Sa = { class: "text-red-500 dark:text-red-400" }, Ea = /* @__PURE__ */ Ge({
1269
1275
  __name: "Masonry",
1270
1276
  props: {
1271
1277
  getPage: {
@@ -1390,8 +1396,8 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1390
1396
  "item:mouse-leave",
1391
1397
  "update:context"
1392
1398
  ],
1393
- setup(e, { expose: l, emit: i }) {
1394
- const a = e, g = {
1399
+ setup(e, { expose: n, emit: s }) {
1400
+ const a = e, h = {
1395
1401
  sizes: { base: 1, sm: 2, md: 3, lg: 4, xl: 5, "2xl": 6 },
1396
1402
  gutterX: 10,
1397
1403
  gutterY: 10,
@@ -1400,337 +1406,342 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1400
1406
  paddingLeft: 0,
1401
1407
  paddingRight: 0,
1402
1408
  placement: "masonry"
1403
- }, d = Q(() => {
1404
- var c;
1409
+ }, g = Q(() => {
1410
+ var u;
1405
1411
  return {
1406
- ...g,
1412
+ ...h,
1407
1413
  ...a.layout,
1408
1414
  sizes: {
1409
- ...g.sizes,
1410
- ...((c = a.layout) == null ? void 0 : c.sizes) || {}
1415
+ ...h.sizes,
1416
+ ...((u = a.layout) == null ? void 0 : u.sizes) || {}
1411
1417
  }
1412
1418
  };
1413
- }), v = F(null), o = F(typeof window < "u" ? window.innerWidth : 1024), s = F(typeof window < "u" ? window.innerHeight : 768), w = F(null);
1419
+ }), f = D(null), l = D(typeof window < "u" ? window.innerWidth : 1024), i = D(typeof window < "u" ? window.innerHeight : 768), M = D(null);
1414
1420
  let t = null;
1415
- function x(c) {
1421
+ function T(u) {
1416
1422
  return {
1417
1423
  sm: 640,
1418
1424
  md: 768,
1419
1425
  lg: 1024,
1420
1426
  xl: 1280,
1421
1427
  "2xl": 1536
1422
- }[c] || 768;
1428
+ }[u] || 768;
1423
1429
  }
1424
- const T = Q(() => {
1430
+ const I = Q(() => {
1425
1431
  if (a.layoutMode === "masonry") return !1;
1426
1432
  if (a.layoutMode === "swipe") return !0;
1427
- const c = typeof a.mobileBreakpoint == "string" ? x(a.mobileBreakpoint) : a.mobileBreakpoint;
1428
- return o.value < c;
1429
- }), y = i, h = Q({
1433
+ const u = typeof a.mobileBreakpoint == "string" ? T(a.mobileBreakpoint) : a.mobileBreakpoint;
1434
+ return l.value < u;
1435
+ }), x = s, m = Q({
1430
1436
  get: () => a.items,
1431
- set: (c) => y("update:items", c)
1432
- }), P = Q({
1437
+ set: (u) => x("update:items", u)
1438
+ }), L = Q({
1433
1439
  get: () => a.context,
1434
- set: (c) => y("update:context", c)
1440
+ set: (u) => x("update:context", u)
1435
1441
  });
1436
- function I(c) {
1437
- P.value = c;
1442
+ function S(u) {
1443
+ L.value = u;
1438
1444
  }
1439
- const f = Q(() => {
1440
- const c = h.value;
1441
- return (c == null ? void 0 : c.length) ?? 0;
1442
- }), r = F(7), u = F(null), L = F([]), M = F(null), m = F(!1), N = F(0), k = F(!1), B = F(null), R = F(!1), $ = Q(() => Kt(o.value)), W = sa({
1443
- masonry: h
1444
- }), { checkItemDimensions: H, reset: n } = W, p = ra({
1445
- masonry: h,
1446
- useSwipeMode: T,
1447
- container: u,
1448
- columns: r,
1449
- containerWidth: o,
1450
- masonryContentHeight: N,
1451
- layout: d,
1452
- fixedDimensions: w,
1453
- checkItemDimensions: H
1454
- }), { refreshLayout: S, setFixedDimensions: z, onResize: V } = p, Y = ia({
1455
- masonry: h,
1456
- container: u,
1457
- columns: r,
1445
+ const d = Q(() => {
1446
+ const u = m.value;
1447
+ return (u == null ? void 0 : u.length) ?? 0;
1448
+ }), c = D(7), r = D(null), b = D([]), P = D(null), p = D(!1), z = D(0), k = D(!1), H = D(null), W = D(!1), E = Q(() => Zt(l.value)), N = ca({
1449
+ masonry: m
1450
+ }), { checkItemDimensions: Z, reset: o } = N, v = sa({
1451
+ masonry: m,
1452
+ useSwipeMode: I,
1453
+ container: r,
1454
+ columns: c,
1455
+ containerWidth: l,
1456
+ masonryContentHeight: z,
1457
+ layout: g,
1458
+ fixedDimensions: M,
1459
+ checkItemDimensions: Z
1460
+ }), { refreshLayout: y, setFixedDimensions: R, onResize: O } = v, V = ua({
1461
+ masonry: m,
1462
+ container: r,
1463
+ columns: c,
1458
1464
  virtualBufferPx: a.virtualBufferPx,
1459
1465
  loadThresholdPx: a.loadThresholdPx,
1460
1466
  handleScroll: () => {
1461
1467
  }
1462
1468
  // Will be set after pagination is initialized
1463
- }), { viewportTop: b, viewportHeight: E, virtualizing: O, visibleMasonry: ne, updateScrollProgress: X, updateViewport: Z, reset: K } = Y, { onEnter: Qe, onBeforeEnter: Ze, onBeforeLeave: et, onLeave: tt } = ta(
1464
- { container: u },
1465
- { leaveDurationMs: a.leaveDurationMs, virtualizing: O }
1466
- ), at = Qe, nt = Ze, lt = et, ot = tt, rt = la({
1469
+ }), { viewportTop: w, viewportHeight: F, virtualizing: B, visibleMasonry: j, updateScrollProgress: q, updateViewport: le, reset: G } = V, { onEnter: be, onBeforeEnter: Ze, onBeforeLeave: et, onLeave: tt } = na(
1470
+ { container: r },
1471
+ { leaveDurationMs: a.leaveDurationMs, virtualizing: B }
1472
+ ), at = be, nt = Ze, lt = et, ot = tt, rt = Q(() => a.mode), it = ra({
1467
1473
  getPage: a.getPage,
1468
- context: P,
1469
- masonry: h,
1470
- isLoading: m,
1474
+ context: L,
1475
+ masonry: m,
1476
+ isLoading: p,
1471
1477
  hasReachedEnd: k,
1472
- loadError: B,
1473
- currentPage: M,
1474
- paginationHistory: L,
1475
- refreshLayout: S,
1478
+ loadError: H,
1479
+ currentPage: P,
1480
+ paginationHistory: b,
1481
+ refreshLayout: y,
1476
1482
  retryMaxAttempts: a.retryMaxAttempts,
1477
1483
  retryInitialDelayMs: a.retryInitialDelayMs,
1478
1484
  retryBackoffStepMs: a.retryBackoffStepMs,
1479
- mode: a.mode,
1485
+ mode: rt,
1480
1486
  backfillDelayMs: a.backfillDelayMs,
1481
1487
  backfillMaxCalls: a.backfillMaxCalls,
1482
1488
  pageSize: a.pageSize,
1483
- emits: y
1484
- }), { loadPage: be, loadNext: me, refreshCurrentPage: it, cancelLoad: Me, maybeBackfillToTarget: st } = rt, ee = na({
1485
- useSwipeMode: T,
1486
- masonry: h,
1487
- isLoading: m,
1489
+ emits: x
1490
+ }), { loadPage: Me, loadNext: me, refreshCurrentPage: st, cancelLoad: Te, maybeBackfillToTarget: ut } = it, ee = oa({
1491
+ useSwipeMode: I,
1492
+ masonry: m,
1493
+ isLoading: p,
1488
1494
  loadNext: me,
1489
- loadPage: be,
1490
- paginationHistory: L
1491
- }), { handleScroll: ut } = aa({
1492
- container: u,
1493
- masonry: h,
1494
- columns: r,
1495
- containerHeight: N,
1496
- isLoading: m,
1495
+ loadPage: Me,
1496
+ paginationHistory: b
1497
+ }), { handleScroll: ct } = la({
1498
+ container: r,
1499
+ masonry: m,
1500
+ columns: c,
1501
+ containerHeight: z,
1502
+ isLoading: p,
1497
1503
  pageSize: a.pageSize,
1498
- refreshLayout: S,
1499
- setItemsRaw: (c) => {
1500
- h.value = c;
1504
+ refreshLayout: y,
1505
+ setItemsRaw: (u) => {
1506
+ m.value = u;
1501
1507
  },
1502
1508
  loadNext: me,
1503
1509
  loadThresholdPx: a.loadThresholdPx
1504
1510
  });
1505
- Y.handleScroll.value = ut;
1506
- const ct = oa({
1507
- masonry: h,
1508
- useSwipeMode: T,
1509
- refreshLayout: S,
1511
+ V.handleScroll.value = ct;
1512
+ const vt = ia({
1513
+ masonry: m,
1514
+ useSwipeMode: I,
1515
+ refreshLayout: y,
1510
1516
  loadNext: me,
1511
- maybeBackfillToTarget: st,
1512
- paginationHistory: L
1513
- }), { remove: ue, removeMany: vt, restore: ft, restoreMany: dt, removeAll: gt } = ct;
1514
- function ht(c) {
1515
- z(c, X), !c && v.value && (o.value = v.value.clientWidth, s.value = v.value.clientHeight);
1517
+ maybeBackfillToTarget: ut,
1518
+ paginationHistory: b
1519
+ }), { remove: ue, removeMany: ft, restore: dt, restoreMany: gt, removeAll: ht } = vt;
1520
+ function mt(u) {
1521
+ R(u, q), !u && f.value && (l.value = f.value.clientWidth, i.value = f.value.clientHeight);
1516
1522
  }
1517
- l({
1523
+ n({
1518
1524
  // Cancels any ongoing load operations (page loads, backfills, etc.)
1519
- cancelLoad: Me,
1525
+ cancelLoad: Te,
1520
1526
  // Opaque caller context passed through to getPage(page, context). Useful for including filters, service selection, tabId, etc.
1521
- context: P,
1527
+ context: L,
1522
1528
  // Container height (wrapper element) in pixels
1523
- containerHeight: s,
1529
+ containerHeight: i,
1524
1530
  // Container width (wrapper element) in pixels
1525
- containerWidth: o,
1531
+ containerWidth: l,
1526
1532
  // Current Tailwind breakpoint name (base, sm, md, lg, xl, 2xl) based on containerWidth
1527
- currentBreakpoint: $,
1533
+ currentBreakpoint: E,
1528
1534
  // Current page number or cursor being displayed
1529
- currentPage: M,
1535
+ currentPage: P,
1530
1536
  // Completely destroys the component, clearing all state and resetting to initial state
1531
- destroy: Mt,
1537
+ destroy: Pt,
1532
1538
  // Boolean indicating if the end of the list has been reached (no more pages to load)
1533
1539
  hasReachedEnd: k,
1534
1540
  // Initializes the component with items, page, and next page cursor. Use this for manual init mode.
1535
- initialize: Tt,
1541
+ initialize: It,
1536
1542
  // Boolean indicating if the component has been initialized (first content has loaded)
1537
- isInitialized: R,
1543
+ isInitialized: W,
1538
1544
  // Boolean indicating if a page load or backfill operation is currently in progress
1539
- isLoading: m,
1545
+ isLoading: p,
1540
1546
  // Error object if the last load operation failed, null otherwise
1541
- loadError: B,
1547
+ loadError: H,
1542
1548
  // Loads the next page of items asynchronously
1543
1549
  loadNext: me,
1544
1550
  // Loads a specific page number or cursor asynchronously
1545
- loadPage: be,
1551
+ loadPage: Me,
1546
1552
  // Array tracking pagination history (pages/cursors that have been loaded)
1547
- paginationHistory: L,
1553
+ paginationHistory: b,
1548
1554
  // Refreshes the current page by clearing items and reloading from the current page
1549
- refreshCurrentPage: it,
1555
+ refreshCurrentPage: st,
1550
1556
  // Recalculates the layout positions for all items. Call this after manually modifying items.
1551
- refreshLayout: S,
1557
+ refreshLayout: y,
1552
1558
  // Removes a single item from the masonry
1553
1559
  remove: ue,
1554
1560
  // Removes all items from the masonry
1555
- removeAll: gt,
1561
+ removeAll: ht,
1562
+ // Clears all items and pagination history (useful when applying filters)
1563
+ clear: Mt,
1556
1564
  // Removes multiple items from the masonry in a single operation
1557
- removeMany: vt,
1565
+ removeMany: ft,
1558
1566
  // Resets the component to initial state (clears items, resets pagination, scrolls to top)
1559
- reset: bt,
1567
+ reset: Tt,
1560
1568
  // Restores a single item at its original index (useful for undo operations)
1561
- restore: ft,
1569
+ restore: dt,
1562
1570
  // Restores multiple items at their original indices (useful for undo operations)
1563
- restoreMany: dt,
1571
+ restoreMany: gt,
1564
1572
  // Scrolls the container to a specific position
1565
- scrollTo: wt,
1573
+ scrollTo: xt,
1566
1574
  // Scrolls the container to the top
1567
- scrollToTop: yt,
1575
+ scrollToTop: wt,
1568
1576
  // Sets the opaque caller context (alternative to v-model:context)
1569
- setContext: I,
1577
+ setContext: S,
1570
1578
  // Sets fixed dimensions for the container, overriding ResizeObserver. Pass null to restore automatic sizing.
1571
- setFixedDimensions: ht,
1579
+ setFixedDimensions: mt,
1572
1580
  // Computed property returning the total number of items currently in the masonry
1573
- totalItems: Q(() => h.value.length)
1581
+ totalItems: Q(() => m.value.length)
1574
1582
  });
1575
- const ce = ee.currentSwipeIndex, pe = ee.swipeOffset, ye = ee.isDragging, oe = ee.swipeContainer, Ne = ee.handleTouchStart, ze = ee.handleTouchMove, De = ee.handleTouchEnd, Be = ee.handleMouseDown, Te = ee.handleMouseMove, Pe = ee.handleMouseUp, Ie = ee.snapToCurrentItem;
1576
- function mt(c) {
1577
- const D = f.value, j = typeof c == "string" ? parseInt(c, 10) : c;
1578
- return D > 0 ? `${j * (100 / D)}%` : "0%";
1583
+ const ce = ee.currentSwipeIndex, pe = ee.swipeOffset, ye = ee.isDragging, oe = ee.swipeContainer, Ne = ee.handleTouchStart, ze = ee.handleTouchMove, Be = ee.handleTouchEnd, We = ee.handleMouseDown, Pe = ee.handleMouseMove, Ie = ee.handleMouseUp, Le = ee.snapToCurrentItem;
1584
+ function pt(u) {
1585
+ const $ = d.value, Y = typeof u == "string" ? parseInt(u, 10) : u;
1586
+ return $ > 0 ? `${Y * (100 / $)}%` : "0%";
1579
1587
  }
1580
- function pt() {
1581
- const c = f.value;
1582
- return c > 0 ? `${100 / c}%` : "0%";
1588
+ function yt() {
1589
+ const u = d.value;
1590
+ return u > 0 ? `${100 / u}%` : "0%";
1583
1591
  }
1584
- function yt(c) {
1585
- u.value && u.value.scrollTo({
1592
+ function wt(u) {
1593
+ r.value && r.value.scrollTo({
1586
1594
  top: 0,
1587
- behavior: (c == null ? void 0 : c.behavior) ?? "smooth",
1588
- ...c
1595
+ behavior: (u == null ? void 0 : u.behavior) ?? "smooth",
1596
+ ...u
1589
1597
  });
1590
1598
  }
1591
- function wt(c) {
1592
- u.value && (u.value.scrollTo({
1593
- top: c.top ?? u.value.scrollTop,
1594
- left: c.left ?? u.value.scrollLeft,
1595
- behavior: c.behavior ?? "auto"
1596
- }), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight));
1597
- }
1598
- function xt() {
1599
- V(), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight);
1599
+ function xt(u) {
1600
+ r.value && (r.value.scrollTo({
1601
+ top: u.top ?? r.value.scrollTop,
1602
+ left: u.left ?? r.value.scrollLeft,
1603
+ behavior: u.behavior ?? "auto"
1604
+ }), r.value && (w.value = r.value.scrollTop, F.value = r.value.clientHeight || window.innerHeight));
1600
1605
  }
1601
1606
  function bt() {
1602
- Me(), u.value && u.value.scrollTo({
1607
+ O(), r.value && (w.value = r.value.scrollTop, F.value = r.value.clientHeight);
1608
+ }
1609
+ function Mt() {
1610
+ m.value = [], b.value = [];
1611
+ }
1612
+ function Tt() {
1613
+ Te(), r.value && r.value.scrollTo({
1603
1614
  top: 0,
1604
1615
  behavior: "smooth"
1605
- }), h.value = [], s.value = 0, M.value = a.loadAtPage, L.value = [a.loadAtPage], k.value = !1, B.value = null, R.value = !1, K();
1616
+ }), m.value = [], i.value = 0, P.value = a.loadAtPage, b.value = [a.loadAtPage], k.value = !1, H.value = null, W.value = !1, G();
1606
1617
  }
1607
- function Mt() {
1608
- Me(), h.value = [], N.value = 0, M.value = null, L.value = [], k.value = !1, B.value = null, m.value = !1, R.value = !1, ce.value = 0, pe.value = 0, ye.value = !1, K(), n(), u.value && u.value.scrollTo({
1618
+ function Pt() {
1619
+ Te(), m.value = [], z.value = 0, P.value = null, b.value = [], k.value = !1, H.value = null, p.value = !1, W.value = !1, ce.value = 0, pe.value = 0, ye.value = !1, G(), o(), r.value && r.value.scrollTo({
1609
1620
  top: 0,
1610
1621
  behavior: "auto"
1611
1622
  // Instant scroll for destroy
1612
1623
  });
1613
1624
  }
1614
- const re = Ue(async () => {
1615
- T.value || await Z();
1616
- }, 200), We = Ue(xt, 200);
1625
+ const re = _e(async () => {
1626
+ I.value || await le();
1627
+ }, 200), Re = _e(bt, 200);
1617
1628
  function Fe() {
1618
1629
  ee.handleWindowResize();
1619
1630
  }
1620
- async function Tt(c, D, j) {
1621
- M.value = D, L.value = [D], j != null && L.value.push(j), k.value = j === null, H(c, "initialize");
1622
- const le = h.value, A = le.length === 0 ? c : [...le, ...c];
1623
- h.value = A, await C(), T.value ? ce.value === 0 && h.value.length > 0 && (pe.value = 0) : (await C(), await C(), S(A), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight), C(() => {
1624
- u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight || window.innerHeight, X());
1625
- })), c && c.length > 0 && (R.value = !0);
1631
+ async function It(u, $, Y) {
1632
+ P.value = $, b.value = [$], Y != null && b.value.push(Y), k.value = Y === null, Z(u, "initialize");
1633
+ const te = m.value, A = te.length === 0 ? u : [...te, ...u];
1634
+ m.value = A, await C(), I.value ? ce.value === 0 && m.value.length > 0 && (pe.value = 0) : (await C(), await C(), y(A), r.value && (w.value = r.value.scrollTop, F.value = r.value.clientHeight || window.innerHeight), C(() => {
1635
+ r.value && (w.value = r.value.scrollTop, F.value = r.value.clientHeight || window.innerHeight, q());
1636
+ })), u && u.length > 0 && (W.value = !0);
1626
1637
  }
1627
- return te(
1628
- d,
1638
+ return ae(
1639
+ g,
1629
1640
  () => {
1630
- T.value || u.value && (r.value = se(d.value, o.value), S(h.value));
1641
+ I.value || r.value && (c.value = se(g.value, l.value), y(m.value));
1631
1642
  },
1632
1643
  { deep: !0 }
1633
- ), te(() => a.layoutMode, () => {
1634
- w.value && w.value.width !== void 0 ? o.value = w.value.width : v.value && (o.value = v.value.clientWidth);
1635
- }), te(u, (c) => {
1636
- c && !T.value ? (c.removeEventListener("scroll", re), c.addEventListener("scroll", re, { passive: !0 })) : c && c.removeEventListener("scroll", re);
1637
- }, { immediate: !0 }), te(
1638
- () => h.value.length,
1639
- (c, D) => {
1640
- a.init === "manual" && !R.value && c > 0 && D === 0 && (R.value = !0);
1644
+ ), ae(() => a.layoutMode, () => {
1645
+ M.value && M.value.width !== void 0 ? l.value = M.value.width : f.value && (l.value = f.value.clientWidth);
1646
+ }), ae(r, (u) => {
1647
+ u && !I.value ? (u.removeEventListener("scroll", re), u.addEventListener("scroll", re, { passive: !0 })) : u && u.removeEventListener("scroll", re);
1648
+ }, { immediate: !0 }), ae(
1649
+ () => m.value.length,
1650
+ (u, $) => {
1651
+ a.init === "manual" && !W.value && u > 0 && $ === 0 && (W.value = !0);
1641
1652
  },
1642
1653
  { immediate: !1 }
1643
- ), te(T, (c, D) => {
1644
- D === void 0 && c === !1 || C(() => {
1645
- c ? (document.addEventListener("mousemove", Te), document.addEventListener("mouseup", Pe), u.value && u.value.removeEventListener("scroll", re), ce.value = 0, pe.value = 0, h.value.length > 0 && Ie()) : (document.removeEventListener("mousemove", Te), document.removeEventListener("mouseup", Pe), u.value && v.value && (w.value && w.value.width !== void 0 ? o.value = w.value.width : o.value = v.value.clientWidth, u.value.removeEventListener("scroll", re), u.value.addEventListener("scroll", re, { passive: !0 }), h.value.length > 0 && (r.value = se(d.value, o.value), S(h.value), b.value = u.value.scrollTop, E.value = u.value.clientHeight, X())));
1654
+ ), ae(I, (u, $) => {
1655
+ $ === void 0 && u === !1 || C(() => {
1656
+ u ? (document.addEventListener("mousemove", Pe), document.addEventListener("mouseup", Ie), r.value && r.value.removeEventListener("scroll", re), ce.value = 0, pe.value = 0, m.value.length > 0 && Le()) : (document.removeEventListener("mousemove", Pe), document.removeEventListener("mouseup", Ie), r.value && f.value && (M.value && M.value.width !== void 0 ? l.value = M.value.width : l.value = f.value.clientWidth, r.value.removeEventListener("scroll", re), r.value.addEventListener("scroll", re, { passive: !0 }), m.value.length > 0 && (c.value = se(g.value, l.value), y(m.value), w.value = r.value.scrollTop, F.value = r.value.clientHeight, q())));
1646
1657
  });
1647
- }, { immediate: !0 }), te(oe, (c) => {
1648
- c && (c.addEventListener("touchstart", Ne, { passive: !1 }), c.addEventListener("touchmove", ze, { passive: !1 }), c.addEventListener("touchend", De), c.addEventListener("mousedown", Be));
1649
- }), te(() => h.value.length, (c, D) => {
1650
- T.value && c > 0 && D === 0 && (ce.value = 0, C(() => Ie()));
1651
- }), te(v, (c) => {
1652
- t && (t.disconnect(), t = null), c && typeof ResizeObserver < "u" ? (t = new ResizeObserver((D) => {
1653
- if (!w.value)
1654
- for (const j of D) {
1655
- const le = j.contentRect.width, A = j.contentRect.height;
1656
- o.value !== le && (o.value = le), s.value !== A && (s.value = A);
1658
+ }, { immediate: !0 }), ae(oe, (u) => {
1659
+ u && (u.addEventListener("touchstart", Ne, { passive: !1 }), u.addEventListener("touchmove", ze, { passive: !1 }), u.addEventListener("touchend", Be), u.addEventListener("mousedown", We));
1660
+ }), ae(() => m.value.length, (u, $) => {
1661
+ I.value && u > 0 && $ === 0 && (ce.value = 0, C(() => Le()));
1662
+ }), ae(f, (u) => {
1663
+ t && (t.disconnect(), t = null), u && typeof ResizeObserver < "u" ? (t = new ResizeObserver(($) => {
1664
+ if (!M.value)
1665
+ for (const Y of $) {
1666
+ const te = Y.contentRect.width, A = Y.contentRect.height;
1667
+ l.value !== te && (l.value = te), i.value !== A && (i.value = A);
1657
1668
  }
1658
- }), t.observe(c), w.value || (o.value = c.clientWidth, s.value = c.clientHeight)) : c && (w.value || (o.value = c.clientWidth, s.value = c.clientHeight));
1659
- }, { immediate: !0 }), te(o, (c, D) => {
1660
- c !== D && c > 0 && !T.value && u.value && h.value.length > 0 && C(() => {
1661
- r.value = se(d.value, c), S(h.value), X();
1669
+ }), t.observe(u), M.value || (l.value = u.clientWidth, i.value = u.clientHeight)) : u && (M.value || (l.value = u.clientWidth, i.value = u.clientHeight));
1670
+ }, { immediate: !0 }), ae(l, (u, $) => {
1671
+ u !== $ && u > 0 && !I.value && r.value && m.value.length > 0 && C(() => {
1672
+ c.value = se(g.value, u), y(m.value), q();
1662
1673
  });
1663
- }), Ge(async () => {
1674
+ }), qe(async () => {
1664
1675
  try {
1665
- await C(), v.value && !t && (o.value = v.value.clientWidth, s.value = v.value.clientHeight), T.value || (r.value = se(d.value, o.value), u.value && (b.value = u.value.scrollTop, E.value = u.value.clientHeight));
1666
- const c = a.loadAtPage;
1667
- if (a.init === "auto" && L.value.length === 0 && (L.value = [c]), a.init === "auto") {
1668
- R.value = !0, await C();
1676
+ await C(), f.value && !t && (l.value = f.value.clientWidth, i.value = f.value.clientHeight), I.value || (c.value = se(g.value, l.value), r.value && (w.value = r.value.scrollTop, F.value = r.value.clientHeight));
1677
+ const u = a.loadAtPage;
1678
+ if (a.init === "auto" && b.value.length === 0 && (b.value = [u]), a.init === "auto") {
1679
+ W.value = !0, await C();
1669
1680
  try {
1670
- await be(c);
1681
+ await Me(u);
1671
1682
  } catch {
1672
1683
  }
1673
1684
  }
1674
- T.value ? C(() => Ie()) : X();
1675
- } catch (c) {
1676
- B.value || (console.error("Error during component initialization:", c), B.value = ge(c)), m.value = !1;
1685
+ I.value ? C(() => Le()) : q();
1686
+ } catch (u) {
1687
+ H.value || (console.error("Error during component initialization:", u), H.value = ge(u)), p.value = !1;
1677
1688
  }
1678
- window.addEventListener("resize", We), window.addEventListener("resize", Fe);
1679
- }), qe(() => {
1680
- var c;
1681
- t && (t.disconnect(), t = null), (c = u.value) == null || c.removeEventListener("scroll", re), window.removeEventListener("resize", We), window.removeEventListener("resize", Fe), oe.value && (oe.value.removeEventListener("touchstart", Ne), oe.value.removeEventListener("touchmove", ze), oe.value.removeEventListener("touchend", De), oe.value.removeEventListener("mousedown", Be)), document.removeEventListener("mousemove", Te), document.removeEventListener("mouseup", Pe);
1682
- }), (c, D) => (_(), U("div", {
1689
+ window.addEventListener("resize", Re), window.addEventListener("resize", Fe);
1690
+ }), Je(() => {
1691
+ var u;
1692
+ t && (t.disconnect(), t = null), (u = r.value) == null || u.removeEventListener("scroll", re), window.removeEventListener("resize", Re), window.removeEventListener("resize", Fe), oe.value && (oe.value.removeEventListener("touchstart", Ne), oe.value.removeEventListener("touchmove", ze), oe.value.removeEventListener("touchend", Be), oe.value.removeEventListener("mousedown", We)), document.removeEventListener("mousemove", Pe), document.removeEventListener("mouseup", Ie);
1693
+ }), (u, $) => (_(), U("div", {
1683
1694
  ref_key: "wrapper",
1684
- ref: v,
1695
+ ref: f,
1685
1696
  class: "w-full h-full flex flex-col relative"
1686
1697
  }, [
1687
- R.value ? T.value ? (_(), U("div", {
1698
+ W.value ? I.value ? (_(), U("div", {
1688
1699
  key: 1,
1689
- class: ie(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": a.forceMotion, "cursor-grab": !q(ye), "cursor-grabbing": q(ye) }]),
1700
+ class: ie(["overflow-hidden w-full flex-1 swipe-container touch-none select-none", { "force-motion": a.forceMotion, "cursor-grab": !J(ye), "cursor-grabbing": J(ye) }]),
1690
1701
  ref_key: "swipeContainer",
1691
1702
  ref: oe,
1692
1703
  style: { height: "100%", "max-height": "100%", position: "relative" }
1693
1704
  }, [
1694
- G("div", {
1705
+ X("div", {
1695
1706
  class: "relative w-full",
1696
1707
  style: he({
1697
- transform: `translateY(${q(pe)}px)`,
1698
- transition: q(ye) ? "none" : `transform ${e.transitionDurationMs}ms ${e.transitionEasing}`,
1699
- height: `${f.value * 100}%`
1708
+ transform: `translateY(${J(pe)}px)`,
1709
+ transition: J(ye) ? "none" : `transform ${e.transitionDurationMs}ms ${e.transitionEasing}`,
1710
+ height: `${d.value * 100}%`
1700
1711
  })
1701
1712
  }, [
1702
- (_(!0), U(Ce, null, Oe(h.value, (j, le) => (_(), U("div", {
1703
- key: `${j.page}-${j.id}`,
1713
+ (_(!0), U(Oe, null, Ae(m.value, (Y, te) => (_(), U("div", {
1714
+ key: `${Y.page}-${Y.id}`,
1704
1715
  class: "absolute top-0 left-0 w-full",
1705
1716
  style: he({
1706
- top: mt(le),
1707
- height: pt()
1717
+ top: pt(te),
1718
+ height: yt()
1708
1719
  })
1709
1720
  }, [
1710
- G("div", wa, [
1711
- G("div", xa, [
1712
- J(c.$slots, "default", {
1713
- item: j,
1714
- remove: q(ue),
1715
- index: j.originalIndex ?? h.value.indexOf(j)
1721
+ X("div", ba, [
1722
+ X("div", Ma, [
1723
+ K(u.$slots, "default", {
1724
+ item: Y,
1725
+ remove: J(ue),
1726
+ index: Y.originalIndex ?? te
1716
1727
  }, () => [
1717
- Le(xe, {
1718
- item: j,
1719
- remove: q(ue),
1720
- "header-height": d.value.header,
1721
- "footer-height": d.value.footer,
1728
+ ke(xe, {
1729
+ item: Y,
1730
+ remove: J(ue),
1731
+ "header-height": g.value.header,
1732
+ "footer-height": g.value.footer,
1722
1733
  "in-swipe-mode": !0,
1723
- "is-active": le === q(ce),
1724
- "onPreload:success": D[0] || (D[0] = (A) => y("item:preload:success", A)),
1725
- "onPreload:error": D[1] || (D[1] = (A) => y("item:preload:error", A)),
1726
- onMouseEnter: D[2] || (D[2] = (A) => y("item:mouse-enter", A)),
1727
- onMouseLeave: D[3] || (D[3] = (A) => y("item:mouse-leave", A))
1734
+ "is-active": te === J(ce),
1735
+ "onPreload:success": $[0] || ($[0] = (A) => x("item:preload:success", A)),
1736
+ "onPreload:error": $[1] || ($[1] = (A) => x("item:preload:error", A)),
1737
+ onMouseEnter: $[2] || ($[2] = (A) => x("item:mouse-enter", A)),
1738
+ onMouseLeave: $[3] || ($[3] = (A) => x("item:mouse-leave", A))
1728
1739
  }, {
1729
1740
  header: ve((A) => [
1730
- J(c.$slots, "item-header", fe({ ref_for: !0 }, A), void 0, !0)
1741
+ K(u.$slots, "item-header", fe({ ref_for: !0 }, A), void 0, !0)
1731
1742
  ]),
1732
1743
  footer: ve((A) => [
1733
- J(c.$slots, "item-footer", fe({ ref_for: !0 }, A), void 0, !0)
1744
+ K(u.$slots, "item-footer", fe({ ref_for: !0 }, A), void 0, !0)
1734
1745
  ]),
1735
1746
  _: 2
1736
1747
  }, 1032, ["item", "remove", "header-height", "footer-height", "is-active"])
@@ -1739,62 +1750,62 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1739
1750
  ])
1740
1751
  ], 4))), 128))
1741
1752
  ], 4),
1742
- k.value && h.value.length > 0 ? (_(), U("div", ba, [
1743
- J(c.$slots, "end-message", {}, () => [
1744
- D[9] || (D[9] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1753
+ k.value && m.value.length > 0 ? (_(), U("div", Ta, [
1754
+ K(u.$slots, "end-message", {}, () => [
1755
+ $[9] || ($[9] = X("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1745
1756
  ], !0)
1746
- ])) : ae("", !0),
1747
- B.value && h.value.length > 0 ? (_(), U("div", Ma, [
1748
- J(c.$slots, "error-message", { error: B.value }, () => [
1749
- G("p", Ta, "Failed to load content: " + Ee(B.value.message), 1)
1757
+ ])) : ne("", !0),
1758
+ H.value && m.value.length > 0 ? (_(), U("div", Pa, [
1759
+ K(u.$slots, "error-message", { error: H.value }, () => [
1760
+ X("p", Ia, "Failed to load content: " + He(H.value.message), 1)
1750
1761
  ], !0)
1751
- ])) : ae("", !0)
1762
+ ])) : ne("", !0)
1752
1763
  ], 2)) : (_(), U("div", {
1753
1764
  key: 2,
1754
1765
  class: ie(["overflow-auto w-full flex-1 masonry-container", { "force-motion": a.forceMotion }]),
1755
1766
  ref_key: "container",
1756
- ref: u
1767
+ ref: r
1757
1768
  }, [
1758
- G("div", {
1769
+ X("div", {
1759
1770
  class: "relative",
1760
- style: he({ height: `${N.value}px`, "--masonry-duration": `${e.transitionDurationMs}ms`, "--masonry-leave-duration": `${e.leaveDurationMs}ms`, "--masonry-ease": e.transitionEasing })
1771
+ style: he({ height: `${z.value}px`, "--masonry-duration": `${e.transitionDurationMs}ms`, "--masonry-leave-duration": `${e.leaveDurationMs}ms`, "--masonry-ease": e.transitionEasing })
1761
1772
  }, [
1762
- Le(Pt, {
1773
+ ke(Lt, {
1763
1774
  name: "masonry",
1764
1775
  css: !1,
1765
- onEnter: q(at),
1766
- onBeforeEnter: q(nt),
1767
- onLeave: q(ot),
1768
- onBeforeLeave: q(lt)
1776
+ onEnter: J(at),
1777
+ onBeforeEnter: J(nt),
1778
+ onLeave: J(ot),
1779
+ onBeforeLeave: J(lt)
1769
1780
  }, {
1770
1781
  default: ve(() => [
1771
- (_(!0), U(Ce, null, Oe(q(ne), (j, le) => (_(), U("div", fe({
1772
- key: `${j.page}-${j.id}`,
1782
+ (_(!0), U(Oe, null, Ae(J(j), (Y, te) => (_(), U("div", fe({
1783
+ key: `${Y.page}-${Y.id}`,
1773
1784
  class: "absolute masonry-item",
1774
1785
  ref_for: !0
1775
- }, q(ea)(j, le)), [
1776
- J(c.$slots, "default", {
1777
- item: j,
1778
- remove: q(ue),
1779
- index: j.originalIndex ?? h.value.indexOf(j)
1786
+ }, J(aa)(Y, te)), [
1787
+ K(u.$slots, "default", {
1788
+ item: Y,
1789
+ remove: J(ue),
1790
+ index: Y.originalIndex ?? te
1780
1791
  }, () => [
1781
- Le(xe, {
1782
- item: j,
1783
- remove: q(ue),
1784
- "header-height": d.value.header,
1785
- "footer-height": d.value.footer,
1792
+ ke(xe, {
1793
+ item: Y,
1794
+ remove: J(ue),
1795
+ "header-height": g.value.header,
1796
+ "footer-height": g.value.footer,
1786
1797
  "in-swipe-mode": !1,
1787
1798
  "is-active": !1,
1788
- "onPreload:success": D[4] || (D[4] = (A) => y("item:preload:success", A)),
1789
- "onPreload:error": D[5] || (D[5] = (A) => y("item:preload:error", A)),
1790
- onMouseEnter: D[6] || (D[6] = (A) => y("item:mouse-enter", A)),
1791
- onMouseLeave: D[7] || (D[7] = (A) => y("item:mouse-leave", A))
1799
+ "onPreload:success": $[4] || ($[4] = (A) => x("item:preload:success", A)),
1800
+ "onPreload:error": $[5] || ($[5] = (A) => x("item:preload:error", A)),
1801
+ onMouseEnter: $[6] || ($[6] = (A) => x("item:mouse-enter", A)),
1802
+ onMouseLeave: $[7] || ($[7] = (A) => x("item:mouse-leave", A))
1792
1803
  }, {
1793
1804
  header: ve((A) => [
1794
- J(c.$slots, "item-header", fe({ ref_for: !0 }, A), void 0, !0)
1805
+ K(u.$slots, "item-header", fe({ ref_for: !0 }, A), void 0, !0)
1795
1806
  ]),
1796
1807
  footer: ve((A) => [
1797
- J(c.$slots, "item-footer", fe({ ref_for: !0 }, A), void 0, !0)
1808
+ K(u.$slots, "item-footer", fe({ ref_for: !0 }, A), void 0, !0)
1798
1809
  ]),
1799
1810
  _: 2
1800
1811
  }, 1032, ["item", "remove", "header-height", "footer-height"])
@@ -1804,35 +1815,35 @@ const ua = { class: "flex-1 relative min-h-0" }, ca = { class: "w-full h-full ro
1804
1815
  _: 3
1805
1816
  }, 8, ["onEnter", "onBeforeEnter", "onLeave", "onBeforeLeave"])
1806
1817
  ], 4),
1807
- k.value && h.value.length > 0 ? (_(), U("div", Pa, [
1808
- J(c.$slots, "end-message", {}, () => [
1809
- D[10] || (D[10] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1818
+ k.value && m.value.length > 0 ? (_(), U("div", La, [
1819
+ K(u.$slots, "end-message", {}, () => [
1820
+ $[10] || ($[10] = X("p", { class: "text-gray-500 dark:text-gray-400" }, "You've reached the end", -1))
1810
1821
  ], !0)
1811
- ])) : ae("", !0),
1812
- B.value && h.value.length > 0 ? (_(), U("div", Ia, [
1813
- J(c.$slots, "error-message", { error: B.value }, () => [
1814
- G("p", La, "Failed to load content: " + Ee(B.value.message), 1)
1822
+ ])) : ne("", !0),
1823
+ H.value && m.value.length > 0 ? (_(), U("div", ka, [
1824
+ K(u.$slots, "error-message", { error: H.value }, () => [
1825
+ X("p", Sa, "Failed to load content: " + He(H.value.message), 1)
1815
1826
  ], !0)
1816
- ])) : ae("", !0)
1817
- ], 2)) : (_(), U("div", ya, [
1818
- J(c.$slots, "loading-message", {}, () => [
1819
- D[8] || (D[8] = G("p", { class: "text-gray-500 dark:text-gray-400" }, "Waiting for content to load...", -1))
1827
+ ])) : ne("", !0)
1828
+ ], 2)) : (_(), U("div", xa, [
1829
+ K(u.$slots, "loading-message", {}, () => [
1830
+ $[8] || ($[8] = X("p", { class: "text-gray-500 dark:text-gray-400" }, "Waiting for content to load...", -1))
1820
1831
  ], !0)
1821
1832
  ]))
1822
1833
  ], 512));
1823
1834
  }
1824
- }), Sa = (e, l) => {
1825
- const i = e.__vccOpts || e;
1826
- for (const [a, g] of l)
1827
- i[a] = g;
1828
- return i;
1829
- }, _e = /* @__PURE__ */ Sa(ka, [["__scopeId", "data-v-a7ad9844"]]), Ha = {
1835
+ }), Ha = (e, n) => {
1836
+ const s = e.__vccOpts || e;
1837
+ for (const [a, h] of n)
1838
+ s[a] = h;
1839
+ return s;
1840
+ }, Xe = /* @__PURE__ */ Ha(Ea, [["__scopeId", "data-v-3ebb00d9"]]), Da = {
1830
1841
  install(e) {
1831
- e.component("WyxosMasonry", _e), e.component("WMasonry", _e), e.component("WyxosMasonryItem", xe), e.component("WMasonryItem", xe);
1842
+ e.component("WyxosMasonry", Xe), e.component("WMasonry", Xe), e.component("WyxosMasonryItem", xe), e.component("WMasonryItem", xe);
1832
1843
  }
1833
1844
  };
1834
1845
  export {
1835
- _e as Masonry,
1846
+ Xe as Masonry,
1836
1847
  xe as MasonryItem,
1837
- Ha as default
1848
+ Da as default
1838
1849
  };