@wyxos/vibe 3.0.5 → 3.0.6

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,12 +1,12 @@
1
- import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, isVNode as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, reactive as C, readonly as w, ref as T, renderList as E, renderSlot as D, resolveDynamicComponent as O, toDisplayString as k, toRef as A, unref as j, useSlots as M, vShow as N, watch as P, watchEffect as F, withCtx as I, withDirectives as L, withModifiers as ee } from "vue";
1
+ import { Comment as e, Fragment as t, Text as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createSlots as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, isVNode as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeProps as v, normalizeStyle as y, onBeforeUnmount as b, onMounted as x, openBlock as S, reactive as C, readonly as w, ref as T, renderList as E, renderSlot as D, resolveDynamicComponent as O, toDisplayString as k, toRef as A, unref as j, useAttrs as M, useSlots as N, vShow as P, watch as F, watchEffect as I, withCtx as L, withDirectives as R, withModifiers as z } from "vue";
2
2
  //#region node_modules/lucide-vue-next/dist/esm/shared/src/utils/hasA11yProp.js
3
- var R = (e) => {
3
+ var B = (e) => {
4
4
  for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
5
5
  return !1;
6
- }, z = (e) => e === "", B = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), V = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), H = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), U = (e) => {
7
- let t = H(e);
6
+ }, V = (e) => e === "", H = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), U = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), W = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), G = (e) => {
7
+ let t = W(e);
8
8
  return t.charAt(0).toUpperCase() + t.slice(1);
9
- }, W = {
9
+ }, K = {
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
11
  width: 24,
12
12
  height: 24,
@@ -16,27 +16,27 @@ var R = (e) => {
16
16
  "stroke-width": 2,
17
17
  "stroke-linecap": "round",
18
18
  "stroke-linejoin": "round"
19
- }, G = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = W.width, color: s = W.stroke, ...c }, { slots: l }) => p("svg", {
20
- ...W,
19
+ }, q = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = K.width, color: s = K.stroke, ...c }, { slots: l }) => p("svg", {
20
+ ...K,
21
21
  ...c,
22
22
  width: o,
23
23
  height: o,
24
24
  stroke: s,
25
- "stroke-width": z(n) || z(r) || n === !0 || r === !0 ? Number(i || a || W["stroke-width"]) * 24 / Number(o) : i || a || W["stroke-width"],
26
- class: B("lucide", c.class, ...e ? [`lucide-${V(U(e))}-icon`, `lucide-${V(e)}`] : ["lucide-icon"]),
27
- ...!l.default && !R(c) && { "aria-hidden": "true" }
28
- }, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), K = (e, t) => (n, { slots: r, attrs: i }) => p(G, {
25
+ "stroke-width": V(n) || V(r) || n === !0 || r === !0 ? Number(i || a || K["stroke-width"]) * 24 / Number(o) : i || a || K["stroke-width"],
26
+ class: H("lucide", c.class, ...e ? [`lucide-${U(G(e))}-icon`, `lucide-${U(e)}`] : ["lucide-icon"]),
27
+ ...!l.default && !B(c) && { "aria-hidden": "true" }
28
+ }, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), J = (e, t) => (n, { slots: r, attrs: i }) => p(q, {
29
29
  ...i,
30
30
  ...n,
31
31
  iconNode: t,
32
32
  name: e
33
- }, r), q = K("arrow-left", [["path", {
33
+ }, r), Y = J("arrow-left", [["path", {
34
34
  d: "m12 19-7-7 7-7",
35
35
  key: "1l729n"
36
36
  }], ["path", {
37
37
  d: "M19 12H5",
38
38
  key: "x3x0zl"
39
- }]]), J = K("audio-lines", [
39
+ }]]), X = J("audio-lines", [
40
40
  ["path", {
41
41
  d: "M2 10v3",
42
42
  key: "1fnikh"
@@ -61,7 +61,7 @@ var R = (e) => {
61
61
  d: "M22 10v3",
62
62
  key: "154ddg"
63
63
  }]
64
- ]), te = K("clapperboard", [
64
+ ]), ee = J("clapperboard", [
65
65
  ["path", {
66
66
  d: "m12.296 3.464 3.02 3.956",
67
67
  key: "qash78"
@@ -78,13 +78,13 @@ var R = (e) => {
78
78
  d: "m6.18 5.276 3.1 3.899",
79
79
  key: "zjj9t3"
80
80
  }]
81
- ]), Y = K("file", [["path", {
81
+ ]), te = J("file", [["path", {
82
82
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
83
83
  key: "1oefj6"
84
84
  }], ["path", {
85
85
  d: "M14 2v5a1 1 0 0 0 1 1h5",
86
86
  key: "wfsgrz"
87
- }]]), ne = K("image-plus", [
87
+ }]]), ne = J("image-plus", [
88
88
  ["path", {
89
89
  d: "M16 5h6",
90
90
  key: "1vod17"
@@ -107,10 +107,10 @@ var R = (e) => {
107
107
  r: "2",
108
108
  key: "af1f0g"
109
109
  }]
110
- ]), re = K("loader-circle", [["path", {
110
+ ]), re = J("loader-circle", [["path", {
111
111
  d: "M21 12a9 9 0 1 1-6.219-8.56",
112
112
  key: "13zald"
113
- }]]), ie = K("pause", [["rect", {
113
+ }]]), ie = J("pause", [["rect", {
114
114
  x: "14",
115
115
  y: "3",
116
116
  width: "5",
@@ -124,10 +124,10 @@ var R = (e) => {
124
124
  height: "18",
125
125
  rx: "1",
126
126
  key: "1wsw3u"
127
- }]]), ae = K("play", [["path", {
127
+ }]]), ae = J("play", [["path", {
128
128
  d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
129
129
  key: "10ikf1"
130
- }]]), oe = K("triangle-alert", [
130
+ }]]), oe = J("triangle-alert", [
131
131
  ["path", {
132
132
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
133
133
  key: "wmoenq"
@@ -141,10 +141,10 @@ var R = (e) => {
141
141
  key: "p32p05"
142
142
  }]
143
143
  ]);
144
- function se(e, t = 150) {
144
+ function Z(e, t = 150) {
145
145
  return ce(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}|${e.kind}`, t);
146
146
  }
147
- function X(e, t = 150) {
147
+ function se(e, t = 150) {
148
148
  return ce(e, (e) => `${e.surface}|${e.occurrenceKey}|${e.url}`, t);
149
149
  }
150
150
  function ce(e, t, n) {
@@ -171,29 +171,29 @@ function ce(e, t, n) {
171
171
  }
172
172
  //#endregion
173
173
  //#region src/components/viewer-core/dom.ts
174
- function Z(e) {
174
+ function Q(e) {
175
175
  return e instanceof HTMLElement && [
176
176
  "INPUT",
177
177
  "TEXTAREA",
178
178
  "SELECT"
179
179
  ].includes(e.tagName);
180
180
  }
181
- function Q(e) {
181
+ function le(e) {
182
182
  return e instanceof HTMLElement && !!e.closest("[data-swipe-lock], input, textarea, select, a");
183
183
  }
184
184
  //#endregion
185
185
  //#region src/components/viewer-core/removalState.ts
186
- function le() {
186
+ function ue() {
187
187
  let e = T(/* @__PURE__ */ new Set()), t = T([]);
188
188
  function n(n) {
189
- let r = ue(n).filter((t) => !e.value.has(t));
189
+ let r = de(n).filter((t) => !e.value.has(t));
190
190
  if (!r.length) return { ids: [] };
191
191
  let i = new Set(e.value);
192
192
  for (let e of r) i.add(e);
193
193
  return e.value = i, t.value = [...t.value, r], { ids: r };
194
194
  }
195
195
  function r(t) {
196
- let n = ue(t).filter((t) => e.value.has(t));
196
+ let n = de(t).filter((t) => e.value.has(t));
197
197
  if (!n.length) return { ids: [] };
198
198
  let r = new Set(e.value);
199
199
  for (let e of n) r.delete(e);
@@ -224,18 +224,18 @@ function le() {
224
224
  undo: i
225
225
  };
226
226
  }
227
- function ue(e) {
227
+ function de(e) {
228
228
  let t = Array.isArray(e) ? e : [e];
229
229
  return Array.from(new Set(t.filter((e) => typeof e == "string" && e.length > 0)));
230
230
  }
231
231
  //#endregion
232
232
  //#region src/components/viewer-core/itemIdentity.ts
233
- var de = "__vibeOccurrenceKey";
233
+ var fe = "__vibeOccurrenceKey";
234
234
  function $(e) {
235
- let t = e[de];
235
+ let t = e[fe];
236
236
  return typeof t == "string" && t.length > 0 ? t : e.id;
237
237
  }
238
- function fe(e, t, n) {
238
+ function pe(e, t, n) {
239
239
  let r = /* @__PURE__ */ new Map(), i = [], a = n;
240
240
  for (let e of t) {
241
241
  let t = r.get(e.id), n = $(e);
@@ -243,73 +243,73 @@ function fe(e, t, n) {
243
243
  }
244
244
  for (let t of e) {
245
245
  let e = r.get(t.id)?.shift() ?? `vibe-occurrence-${a += 1}`;
246
- i.push(pe(t, e));
246
+ i.push(me(t, e));
247
247
  }
248
248
  return {
249
249
  items: i,
250
250
  nextSequence: a
251
251
  };
252
252
  }
253
- function pe(e, t) {
253
+ function me(e, t) {
254
254
  return $(e) === t ? e : {
255
255
  ...e,
256
- [de]: t
256
+ [fe]: t
257
257
  };
258
258
  }
259
259
  //#endregion
260
260
  //#region src/components/viewer-core/autoBuckets.ts
261
- function me(e) {
261
+ function he(e) {
262
262
  return e.flatMap((e) => e.items);
263
263
  }
264
- function he(e, t) {
265
- return t.size ? e.filter((e) => !t.has(e.id)) : e;
266
- }
267
264
  function ge(e, t) {
268
- return he(e.items, t);
265
+ return t.size ? e.filter((e) => !t.has(e.id)) : e;
269
266
  }
270
267
  function _e(e, t) {
271
- return ge(e, t).length;
268
+ return ge(e.items, t);
269
+ }
270
+ function ve(e, t) {
271
+ return _e(e, t).length;
272
272
  }
273
- function ve(e, t, n) {
273
+ function ye(e, t, n) {
274
274
  if (n < 0) return null;
275
275
  let r = 0;
276
276
  for (let i of e) {
277
- let e = ge(i, t), a = r + e.length;
277
+ let e = _e(i, t), a = r + e.length;
278
278
  if (n < a) return i.cursor;
279
279
  r = a;
280
280
  }
281
281
  return null;
282
282
  }
283
- function ye(e, t, n) {
283
+ function be(e, t, n) {
284
284
  let r = [...e], i = r.findIndex((e) => e.cursor === t);
285
285
  return i >= 0 && r.splice(i, 1, n), r;
286
286
  }
287
- function be(e, t, n) {
288
- let r = fe(e, t, n);
287
+ function xe(e, t, n) {
288
+ let r = pe(e, t, n);
289
289
  return {
290
290
  items: r.items,
291
291
  nextSequence: r.nextSequence
292
292
  };
293
293
  }
294
- function xe(e) {
294
+ function Se(e) {
295
295
  return e === "filling" || e === "initializing" || e === "loading" || e === "refreshing";
296
296
  }
297
- function Se(e) {
297
+ function Ce(e) {
298
298
  return !e || !Number.isFinite(e) || e < 1 ? 25 : Math.floor(e);
299
299
  }
300
- function Ce(e) {
300
+ function we(e) {
301
301
  return e ?? "__vibe_initial_cursor__";
302
302
  }
303
- function we(e, t, n) {
303
+ function Te(e, t, n) {
304
304
  return Math.min(Math.max(e, t), n);
305
305
  }
306
306
  //#endregion
307
307
  //#region src/components/viewer-core/autoResolveState.ts
308
- function Te(e) {
308
+ function Ee(e) {
309
309
  return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && (e.name === "AbortError" || e.name === "CanceledError") ? !0 : typeof e == "object" && !!e && "code" in e && e.code === "ERR_CANCELED";
310
310
  }
311
- function Ee(e) {
312
- let t = be(e.nextItems, e.previousItems, e.sequence);
311
+ function De(e) {
312
+ let t = xe(e.nextItems, e.previousItems, e.sequence);
313
313
  return {
314
314
  bucket: {
315
315
  cursor: e.cursor,
@@ -320,7 +320,7 @@ function Ee(e) {
320
320
  nextSequence: t.nextSequence
321
321
  };
322
322
  }
323
- function De(e, t, n, r) {
323
+ function Oe(e, t, n, r) {
324
324
  if (!e.length) return r ? null : {
325
325
  buckets: [],
326
326
  canceled: r,
@@ -330,46 +330,46 @@ function De(e, t, n, r) {
330
330
  return {
331
331
  buckets: i,
332
332
  canceled: r,
333
- visibleCount: i.reduce((e, t) => e + _e(t, n), 0)
333
+ visibleCount: i.reduce((e, t) => e + ve(t, n), 0)
334
334
  };
335
335
  }
336
- function Oe(e) {
337
- let t = Ee({
336
+ function ke(e) {
337
+ let t = De({
338
338
  cursor: e.initialState.cursor,
339
339
  nextCursor: e.initialState.nextCursor ?? null,
340
340
  nextItems: e.initialState.items,
341
341
  previousCursor: e.initialState.previousCursor ?? null,
342
342
  previousItems: [],
343
343
  sequence: e.sequence
344
- }), n = he(t.bucket.items, e.removedIds);
344
+ }), n = ge(t.bucket.items, e.removedIds);
345
345
  return {
346
- activeIndex: we(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
346
+ activeIndex: Te(e.initialState.activeIndex ?? 0, 0, Math.max(0, n.length - 1)),
347
347
  buckets: [t.bucket],
348
348
  nextSequence: t.nextSequence
349
349
  };
350
350
  }
351
- function ke(e, t) {
352
- let n = e[we(t, 0, Math.max(0, e.length - 1))];
351
+ function Ae(e, t) {
352
+ let n = e[Te(t, 0, Math.max(0, e.length - 1))];
353
353
  return n ? $(n) : null;
354
354
  }
355
- function Ae(e, t, n = null) {
355
+ function je(e, t, n = null) {
356
356
  if (!e.length) return 0;
357
357
  let r = n ? e.findIndex((e) => $(e) === n) : -1;
358
- return r >= 0 ? r : we(t, 0, e.length - 1);
358
+ return r >= 0 ? r : Te(t, 0, e.length - 1);
359
359
  }
360
- function je(e, t, n) {
361
- return e ? _e(e, t) < n : !1;
360
+ function Me(e, t, n) {
361
+ return e ? ve(e, t) < n : !1;
362
362
  }
363
363
  //#endregion
364
364
  //#region src/components/viewer-core/fillDelay.ts
365
- var Me = 2e3, Ne = 1e3, Pe = 100;
366
- function Fe(e, t = Me, n = Ne) {
365
+ var Ne = 2e3, Pe = 1e3, Fe = 100;
366
+ function Ie(e, t = Ne, n = Pe) {
367
367
  return t + Math.max(0, e - 1) * n;
368
368
  }
369
- function Ie(e, t) {
369
+ function Le(e, t) {
370
370
  return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
371
371
  }
372
- function Le() {
372
+ function Re() {
373
373
  let e = T(null), t = null, n = null, r = null;
374
374
  function i(i = !1) {
375
375
  if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
@@ -387,7 +387,7 @@ function Le() {
387
387
  let t = Math.max(0, a - (Date.now() - s));
388
388
  e.value = t, t <= 0 && l();
389
389
  };
390
- t = setInterval(u, Pe), n = setTimeout(l, a), u();
390
+ t = setInterval(u, Fe), n = setTimeout(l, a), u();
391
391
  }));
392
392
  }
393
393
  return {
@@ -398,258 +398,282 @@ function Le() {
398
398
  }
399
399
  //#endregion
400
400
  //#region src/components/viewer-core/useAutoResolveSource.ts
401
- function Re(e) {
402
- let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(null), s = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), c = T(null), l = Le(), u = l.remainingMs, d = T(null), f = T(!1), p = T(!0), m = /* @__PURE__ */ new Set(), h = null, g = null, _ = 0, v = 0, y = i(() => Ie(e.fillDelayMs, Me)), S = i(() => Ie(e.fillDelayStepMs, Ne)), C = i(() => typeof e.resolve == "function"), w = i(() => e.mode ?? "dynamic"), E = i(() => Se(e.pageSize)), D = i(() => me(n.value)), O = i(() => he(D.value, e.removedIds.value)), k = i(() => r.value), A = i(() => xe(s.value) || f.value), j = i(() => n.value[0] ?? null), M = i(() => n.value[n.value.length - 1] ?? null), N = i(() => M.value?.nextCursor ?? null), F = i(() => j.value?.previousCursor ?? null), I = i(() => !!N.value), L = i(() => !!F.value), ee = i(() => C.value && n.value.length > 0), R = i(() => he(me(a.value), e.removedIds.value)), z = i(() => ve(n.value, e.removedIds.value, k.value)), B = i(() => !O.value.length && !A.value && !!o.value);
403
- P(() => O.value.length, (e) => {
401
+ function ze(e) {
402
+ let t = !!e.initialState?.items.length, n = T([]), r = T(0), a = T([]), o = T(!1), s = T(null), c = T(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = T(null), u = Re(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = /* @__PURE__ */ new Set(), g = null, _ = null, v = 0, y = 0, S = i(() => Le(e.fillDelayMs, Ne)), C = i(() => Le(e.fillDelayStepMs, Pe)), w = i(() => typeof e.resolve == "function"), E = i(() => e.mode ?? "dynamic"), D = i(() => Ce(e.pageSize)), O = i(() => he(n.value)), k = i(() => ge(O.value, e.removedIds.value)), A = i(() => r.value), j = i(() => Se(c.value) || p.value), M = i(() => Be(n.value, e.removedIds.value)), N = i(() => Ve(n.value, e.removedIds.value)), P = i(() => N.value?.nextCursor ?? null), I = i(() => o.value ? null : M.value?.previousCursor ?? null), L = i(() => !!P.value), R = i(() => !!I.value), z = i(() => w.value && n.value.length > 0), B = i(() => ge(he(a.value), e.removedIds.value)), V = i(() => ye(n.value, e.removedIds.value, A.value)), H = i(() => !k.value.length && !j.value && !!s.value);
403
+ F(() => k.value.length, (e) => {
404
404
  if (e === 0) {
405
405
  r.value = 0;
406
406
  return;
407
407
  }
408
- r.value > e - 1 && (r.value = e - 1);
409
- }), P(() => r.value, () => {
410
- p.value && ie();
408
+ o.value &&= (fe(), !1), r.value > e - 1 && (r.value = e - 1);
409
+ }), F(() => r.value, () => {
410
+ m.value && ie();
411
411
  }), x(() => {
412
- Q() || e.resolve && V();
412
+ le() || e.resolve && U();
413
413
  }), b(() => {
414
- h?.abort(), h = null, l.clear(!0);
414
+ g?.abort(), g = null, u.clear(!0);
415
415
  });
416
- async function V() {
417
- g = V;
418
- let t = await X({
419
- continueUntilFilled: w.value === "dynamic",
416
+ async function U() {
417
+ _ = U;
418
+ let t = await se({
419
+ continueUntilFilled: E.value === "dynamic",
420
420
  cursor: e.initialCursor ?? null,
421
421
  direction: "forward",
422
422
  phase: "initializing"
423
423
  });
424
- t && (n.value = t.buckets, r.value = 0, Z());
424
+ t && (n.value = t.buckets, r.value = 0, Q());
425
425
  }
426
- async function H() {
427
- if (!A.value) {
428
- if (!I.value) return ee.value ? se("trailing") : void 0;
429
- if (w.value === "static" && ue("trailing")) return se("trailing");
430
- await ae(N.value);
426
+ async function W() {
427
+ if (!j.value) {
428
+ if (!L.value) return z.value ? Z("trailing") : void 0;
429
+ if (E.value === "static" && de("trailing")) return Z("trailing");
430
+ await ae(P.value);
431
431
  }
432
432
  }
433
- async function U() {
434
- if (!(!L.value || A.value)) {
435
- if (w.value === "static" && ue("leading")) return se("leading");
436
- await oe(F.value);
433
+ async function G() {
434
+ if (!(!R.value || j.value)) {
435
+ if (E.value === "static" && de("leading")) return Z("leading");
436
+ await oe(I.value);
437
437
  }
438
438
  }
439
- async function W() {
440
- if (B.value) {
441
- if (n.value = [], r.value = 0, a.value = [], o.value = null, s.value = C.value ? "initializing" : "idle", c.value = null, d.value = null, f.value = !1, m.clear(), h?.abort(), h = null, l.clear(!0), Q()) {
442
- Z();
439
+ async function K() {
440
+ if (H.value) {
441
+ if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = w.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, h.clear(), g?.abort(), g = null, u.clear(!0), le()) {
442
+ Q();
443
443
  return;
444
444
  }
445
- await V();
445
+ await U();
446
446
  }
447
447
  }
448
- async function G() {
449
- if (B.value) return W();
450
- s.value !== "failed" || !g || (o.value = null, await g());
448
+ async function q() {
449
+ if (H.value) return K();
450
+ c.value !== "failed" || !_ || (s.value = null, await _());
451
451
  }
452
- async function K() {
453
- if (!a.value.length) return f.value = !1, Z();
454
- n.value = [...n.value, ...a.value], a.value = [], f.value = !1, Z();
452
+ async function J() {
453
+ if (!a.value.length) return p.value = !1, Q();
454
+ n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
455
455
  }
456
- function q(t) {
457
- let n = O.value;
456
+ function Y(t) {
457
+ let n = k.value;
458
458
  if (!n.length) return;
459
- let i = we(t, 0, n.length - 1);
459
+ let i = Te(t, 0, n.length - 1);
460
460
  i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
461
461
  }
462
- function J(e) {
463
- p.value = e;
462
+ function X(e) {
463
+ m.value = e;
464
464
  }
465
- function te() {
466
- _ += 1, h?.abort(), h = null, l.clear(!0), m.clear(), o.value = null, c.value = null, d.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), f.value = !1, Z();
465
+ function ee() {
466
+ v += 1, g?.abort(), g = null, u.clear(!0), h.clear(), s.value = null, l.value = null, f.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), p.value = !1, o.value = !1, Q();
467
467
  }
468
- function Y() {
469
- return ke(O.value, k.value);
468
+ function te() {
469
+ return Ae(k.value, A.value);
470
470
  }
471
471
  function ne(e = null) {
472
- r.value = Ae(O.value, k.value, e);
472
+ if (k.value.length === 0) {
473
+ r.value = 0, n.value.length > 0 && (o.value = !0);
474
+ return;
475
+ }
476
+ r.value = je(k.value, A.value, e);
473
477
  }
474
478
  function re() {
475
- a.value.length > 0 && !R.value.length && K();
479
+ a.value.length > 0 && !B.value.length && J();
476
480
  }
477
481
  async function ie() {
478
- !O.value.length || le() || (L.value && r.value < 3 && await U(), I.value && r.value >= O.value.length - 3 && await H());
482
+ !k.value.length || ue() || (R.value && r.value < 3 && await G(), L.value && r.value >= k.value.length - 3 && await W());
479
483
  }
480
484
  async function ae(e) {
481
- g = async () => {
485
+ _ = async () => {
482
486
  await ae(e);
483
487
  };
484
- let t = await X({
485
- continueUntilFilled: w.value === "dynamic",
488
+ let t = await se({
489
+ continueUntilFilled: E.value === "dynamic",
486
490
  cursor: e,
487
491
  direction: "forward",
488
492
  phase: "loading"
489
493
  });
490
494
  if (t) {
491
- if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], f.value = !1, Z();
492
- if (a.value = t.buckets, !R.value.length) return n.value = [...n.value, ...a.value], a.value = [], f.value = !1, Z();
493
- f.value = !0;
495
+ if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1, Q();
496
+ if (a.value = t.buckets, !B.value.length) return n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
497
+ p.value = !0;
494
498
  }
495
499
  }
496
500
  async function oe(e) {
497
- g = async () => {
501
+ _ = async () => {
498
502
  await oe(e);
499
503
  };
500
- let t = await X({
501
- continueUntilFilled: w.value === "dynamic",
504
+ let t = await se({
505
+ continueUntilFilled: E.value === "dynamic",
502
506
  cursor: e,
503
507
  direction: "backward",
504
508
  phase: "loading"
505
509
  });
506
510
  if (!t) return;
507
- let r = Y();
508
- n.value = [...t.buckets, ...n.value], ne(r), Z();
511
+ let r = te();
512
+ n.value = [...t.buckets, ...n.value], ne(r), Q();
509
513
  }
510
- async function se(t) {
511
- if (g = async () => {
512
- await se(t);
514
+ async function Z(t) {
515
+ if (_ = async () => {
516
+ await Z(t);
513
517
  }, !e.resolve) return;
514
- let r = t === "leading" ? j.value : M.value;
518
+ let r = t === "leading" ? M.value : N.value;
515
519
  if (!r) return;
516
- let i = Ce(r.cursor);
517
- if (m.has(i)) return;
518
- m.add(i), o.value = null, s.value = "refreshing", c.value = null, d.value = null;
519
- let a = ++_, l = typeof AbortController > "u" ? null : new AbortController();
520
- h = l;
520
+ let i = we(r.cursor);
521
+ if (h.has(i)) return;
522
+ h.add(i), s.value = null, c.value = "refreshing", l.value = null, f.value = null;
523
+ let a = ++v, o = typeof AbortController > "u" ? null : new AbortController();
524
+ g = o;
521
525
  try {
522
526
  let t = await e.resolve({
523
527
  cursor: r.cursor,
524
- pageSize: E.value,
525
- signal: l?.signal
528
+ pageSize: D.value,
529
+ signal: o?.signal
526
530
  });
527
- if (a !== _) return Z();
531
+ if (a !== v) return Q();
528
532
  let i = ce({
529
533
  cursor: r.cursor,
530
534
  nextCursor: t.nextPage,
531
535
  nextItems: t.items,
532
536
  previousCursor: t.previousPage ?? null,
533
537
  previousItems: r.items
534
- }), o = Y();
535
- n.value = ye(n.value, r.cursor, i), ne(o), Z();
538
+ }), s = te();
539
+ n.value = be(n.value, r.cursor, i), ne(s), Q();
536
540
  } catch (e) {
537
- if (Te(e) || a !== _) {
538
- Z();
541
+ if (Ee(e) || a !== v) {
542
+ Q();
539
543
  return;
540
544
  }
541
- o.value = e instanceof Error ? e.message : "The viewer could not load items.", s.value = "failed", c.value = null, d.value = null;
545
+ s.value = e instanceof Error ? e.message : "The viewer could not load items.", c.value = "failed", l.value = null, f.value = null;
542
546
  } finally {
543
- h === l && (h = null), m.delete(i);
547
+ g === o && (g = null), h.delete(i);
544
548
  }
545
549
  }
546
- async function X(t) {
550
+ async function se(t) {
547
551
  if (!e.resolve) return null;
548
- let n = ++_, r = /* @__PURE__ */ new Set(), i = [], a = t.cursor, u = 0;
549
- for (o.value = null, s.value = t.phase, c.value = null, d.value = null;;) {
550
- if (n !== _) return De(i, t.direction, e.removedIds.value, !0);
551
- let f = Ce(a);
552
- if (r.has(f) || m.has(f)) break;
553
- r.add(f), m.add(f);
552
+ let n = ++v, r = /* @__PURE__ */ new Set(), i = [], a = t.cursor, o = 0;
553
+ for (s.value = null, c.value = t.phase, l.value = null, f.value = null;;) {
554
+ if (n !== v) return Oe(i, t.direction, e.removedIds.value, !0);
555
+ let d = we(a);
556
+ if (r.has(d) || h.has(d)) break;
557
+ r.add(d), h.add(d);
554
558
  let p = typeof AbortController > "u" ? null : new AbortController();
555
- h = p;
559
+ g = p;
556
560
  try {
557
561
  let r = await e.resolve({
558
562
  cursor: a,
559
- pageSize: E.value,
563
+ pageSize: D.value,
560
564
  signal: p?.signal
561
565
  });
562
- if (n !== _) return De(i, t.direction, e.removedIds.value, !0);
563
- let o = ce({
566
+ if (n !== v) return Oe(i, t.direction, e.removedIds.value, !0);
567
+ let s = ce({
564
568
  cursor: a,
565
569
  nextCursor: r.nextPage,
566
570
  nextItems: r.items,
567
571
  previousCursor: r.previousPage ?? null,
568
572
  previousItems: []
569
573
  });
570
- i.push(o);
571
- let f = i.reduce((t, n) => t + _e(n, e.removedIds.value), 0), m = t.direction === "forward" ? o.nextCursor : o.previousCursor;
572
- if (!t.continueUntilFilled || f >= E.value || !m) return {
574
+ i.push(s);
575
+ let d = i.reduce((t, n) => t + ve(n, e.removedIds.value), 0), m = t.direction === "forward" ? s.nextCursor : s.previousCursor;
576
+ if (!t.continueUntilFilled || d >= D.value || !m) return {
573
577
  canceled: !1,
574
578
  buckets: t.direction === "backward" ? [...i].reverse() : i,
575
- visibleCount: f
579
+ visibleCount: d
576
580
  };
577
- s.value = "filling", c.value = f, d.value = E.value, u += 1;
578
- let h = Fe(u, y.value, S.value);
579
- if (await l.wait(h), n !== _) return De(i, t.direction, e.removedIds.value, !0);
581
+ c.value = "filling", l.value = d, f.value = D.value, o += 1;
582
+ let h = Ie(o, S.value, C.value);
583
+ if (await u.wait(h), n !== v) return Oe(i, t.direction, e.removedIds.value, !0);
580
584
  a = m;
581
585
  } catch (r) {
582
- return Te(r) || n !== _ ? De(i, t.direction, e.removedIds.value, !0) : (o.value = r instanceof Error ? r.message : "The viewer could not load items.", s.value = "failed", c.value = null, d.value = null, null);
586
+ return Ee(r) || n !== v ? Oe(i, t.direction, e.removedIds.value, !0) : (s.value = r instanceof Error ? r.message : "The viewer could not load items.", c.value = "failed", l.value = null, f.value = null, null);
583
587
  } finally {
584
- h === p && (h = null), m.delete(f);
588
+ g === p && (g = null), h.delete(d);
585
589
  }
586
590
  }
587
- return De(i, t.direction, e.removedIds.value, !1);
591
+ return Oe(i, t.direction, e.removedIds.value, !1);
588
592
  }
589
593
  function ce(e) {
590
- let t = Ee({
594
+ let t = De({
591
595
  cursor: e.cursor,
592
596
  nextCursor: e.nextCursor,
593
597
  nextItems: e.nextItems,
594
598
  previousCursor: e.previousCursor,
595
599
  previousItems: e.previousItems,
596
- sequence: v
600
+ sequence: y
597
601
  });
598
- return v = t.nextSequence, t.bucket;
599
- }
600
- function Z() {
601
- s.value = "idle", c.value = null, d.value = null, l.clear();
602
+ return y = t.nextSequence, t.bucket;
602
603
  }
603
604
  function Q() {
605
+ c.value = "idle", l.value = null, f.value = null, u.clear();
606
+ }
607
+ function le() {
604
608
  if (!e.initialState || !e.initialState.items.length) return !1;
605
- let t = Oe({
609
+ let t = ke({
606
610
  initialState: e.initialState,
607
611
  removedIds: e.removedIds.value,
608
- sequence: v
612
+ sequence: y
609
613
  });
610
- return n.value = t.buckets, r.value = t.activeIndex, v = t.nextSequence, o.value = null, a.value = [], f.value = !1, !0;
614
+ return n.value = t.buckets, r.value = t.activeIndex, y = t.nextSequence, o.value = !1, s.value = null, a.value = [], p.value = !1, !0;
611
615
  }
612
- function le() {
613
- return s.value === "initializing";
616
+ function ue() {
617
+ return c.value === "initializing";
614
618
  }
615
- function ue(t) {
616
- return je(t === "leading" ? j.value : M.value, e.removedIds.value, E.value);
619
+ function de(t) {
620
+ return Me(t === "leading" ? M.value : N.value, e.removedIds.value, D.value);
621
+ }
622
+ function fe() {
623
+ let t = n.value.findIndex((t) => ve(t, e.removedIds.value) > 0);
624
+ if (t < 0) return;
625
+ let r = t;
626
+ for (let i = n.value.length - 1; i >= t; --i) if (ve(n.value[i], e.removedIds.value) > 0) {
627
+ r = i;
628
+ break;
629
+ }
630
+ n.value = n.value.slice(t, r + 1);
617
631
  }
618
632
  return {
619
- activeIndex: k,
620
- canRetryInitialLoad: B,
621
- cancel: te,
622
- canRefreshTrailingBoundary: ee,
623
- commitPendingAppend: K,
624
- currentCursor: z,
625
- errorMessage: o,
626
- fillCollectedCount: c,
627
- fillDelayRemainingMs: u,
628
- fillTargetCount: d,
629
- hasNextPage: I,
630
- hasPreviousPage: L,
631
- items: O,
632
- loading: A,
633
- mode: w,
634
- nextCursor: N,
635
- pendingAppendItems: R,
636
- phase: s,
637
- prefetchNextPage: H,
638
- prefetchPreviousPage: U,
639
- previousCursor: F,
640
- retryInitialLoad: W,
641
- retry: G,
642
- setActiveIndex: q,
643
- setAutoPrefetchEnabled: J,
633
+ activeIndex: A,
634
+ canRetryInitialLoad: H,
635
+ cancel: ee,
636
+ canRefreshTrailingBoundary: z,
637
+ commitPendingAppend: J,
638
+ currentCursor: V,
639
+ errorMessage: s,
640
+ fillCollectedCount: l,
641
+ fillDelayRemainingMs: d,
642
+ fillTargetCount: f,
643
+ hasNextPage: L,
644
+ hasPreviousPage: R,
645
+ items: k,
646
+ loading: j,
647
+ mode: E,
648
+ nextCursor: P,
649
+ pendingAppendItems: B,
650
+ phase: c,
651
+ prefetchNextPage: W,
652
+ prefetchPreviousPage: G,
653
+ previousCursor: I,
654
+ retryInitialLoad: K,
655
+ retry: q,
656
+ setActiveIndex: Y,
657
+ setAutoPrefetchEnabled: X,
644
658
  syncActiveIndexAfterVisibilityChange: ne,
645
- getActiveOccurrenceKey: Y,
659
+ getActiveOccurrenceKey: te,
646
660
  maybeCommitPendingAppendWhenFilteredOut: re
647
661
  };
648
662
  }
663
+ function Be(e, t) {
664
+ return e.find((e) => ve(e, t) > 0) ?? e[0] ?? null;
665
+ }
666
+ function Ve(e, t) {
667
+ for (let n = e.length - 1; n >= 0; --n) {
668
+ let r = e[n];
669
+ if (ve(r, t) > 0) return r;
670
+ }
671
+ return e[e.length - 1] ?? null;
672
+ }
649
673
  //#endregion
650
674
  //#region src/components/viewer-core/useDataSource.ts
651
- function ze(e, t) {
652
- let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = le(), l = Re({
675
+ function He(e, t) {
676
+ let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = ue(), l = ze({
653
677
  emit: t,
654
678
  fillDelayMs: e.fillDelayMs,
655
679
  fillDelayStepMs: e.fillDelayStepMs,
@@ -734,9 +758,9 @@ function ze(e, t) {
734
758
  }
735
759
  //#endregion
736
760
  //#region src/components/viewer-core/useController.ts
737
- var Be = 1024;
738
- function Ve(e, t) {
739
- let n = ze(e, t), r = T(0), a = T("list"), o = C({
761
+ var Ue = 1024;
762
+ function We(e, t) {
763
+ let n = He(e, t), r = T(0), a = T("list"), o = C({
740
764
  activeIndex: 0,
741
765
  currentCursor: null,
742
766
  errorMessage: null,
@@ -754,16 +778,18 @@ function Ve(e, t) {
754
778
  removedCount: 0,
755
779
  removedIds: [],
756
780
  surfaceMode: "list"
757
- }), s = i(() => r.value >= Be), c = i(() => s.value ? a.value : "fullscreen"), l = i(() => s.value && c.value === "fullscreen");
758
- P(s, (e) => {
781
+ }), s = i(() => r.value >= Ue), c = i(() => s.value ? a.value : "fullscreen"), l = i(() => s.value && c.value === "fullscreen");
782
+ F(s, (e) => {
759
783
  e && m();
760
- }), P(() => e.surfaceMode, () => {
784
+ }), F(() => e.surfaceMode, () => {
761
785
  m();
762
- }), P([c, () => n.pendingAppendItems.value.length], ([e, t]) => {
786
+ }), F([c, () => n.pendingAppendItems.value.length], ([e, t]) => {
763
787
  e === "list" || t <= 0 || n.commitPendingAppend();
764
- }), P(c, (e) => {
788
+ }), F(() => n.items.value.length, (e) => {
789
+ !s.value || e > 0 || a.value === "list" || (a.value = "list", t("update:surfaceMode", "list"));
790
+ }), F(c, (e) => {
765
791
  n.setAutoPrefetchEnabled(e === "fullscreen");
766
- }, { immediate: !0 }), F(() => {
792
+ }, { immediate: !0 }), I(() => {
767
793
  o.activeIndex = n.activeIndex.value, o.currentCursor = n.currentCursor.value, o.errorMessage = n.errorMessage.value, o.fillCollectedCount = n.fillCollectedCount.value, o.fillDelayRemainingMs = n.fillDelayRemainingMs.value, o.fillTargetCount = n.fillTargetCount.value, o.hasNextPage = n.hasNextPage.value, o.hasPreviousPage = n.hasPreviousPage.value, o.itemCount = n.items.value.length, o.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", o.mode = n.mode.value, o.nextCursor = n.nextCursor.value, o.phase = n.phase.value, o.previousCursor = n.previousCursor.value, o.removedCount = n.removedCount.value, o.removedIds = n.getRemovedIds(), o.surfaceMode = c.value;
768
794
  }), x(() => {
769
795
  p(), m(), window.addEventListener("keydown", f), window.addEventListener("resize", p);
@@ -777,7 +803,7 @@ function Ve(e, t) {
777
803
  !s.value || a.value === "list" || (a.value = "list", t("update:surfaceMode", "list"));
778
804
  }
779
805
  function f(e) {
780
- e.defaultPrevented || e.key !== "Escape" || !s.value || c.value !== "fullscreen" || Z(e.target) || (e.preventDefault(), d());
806
+ e.defaultPrevented || e.key !== "Escape" || !s.value || c.value !== "fullscreen" || Q(e.target) || (e.preventDefault(), d());
781
807
  }
782
808
  function p() {
783
809
  r.value = window.innerWidth || 0;
@@ -801,14 +827,14 @@ function Ve(e, t) {
801
827
  }
802
828
  //#endregion
803
829
  //#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
804
- var He = {
830
+ var Ge = {
805
831
  "data-testid": "vibe-media-bar",
806
832
  class: "absolute inset-x-0 bottom-0 z-[5] bg-[linear-gradient(180deg,transparent,rgba(0,0,0,0.42)_24%,rgba(0,0,0,0.78))] px-[clamp(1rem,2.6vw,2.25rem)] pt-4 pb-[1.15rem]"
807
- }, Ue = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, We = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ge = { class: "relative h-4 w-full" }, Ke = [
833
+ }, Ke = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, qe = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Je = { class: "relative h-4 w-full" }, Ye = [
808
834
  "max",
809
835
  "value",
810
836
  "disabled"
811
- ], qe = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Je = /* @__PURE__ */ d({
837
+ ], Xe = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ze = /* @__PURE__ */ d({
812
838
  __name: "FullscreenMediaBar",
813
839
  props: {
814
840
  currentTime: {},
@@ -820,9 +846,9 @@ var He = {
820
846
  emits: ["seek-input"],
821
847
  setup(e, { emit: t }) {
822
848
  let n = e, r = t;
823
- return (e, t) => (S(), s("div", He, [c("div", Ue, [
824
- c("span", We, k(n.currentTimeLabel), 1),
825
- c("div", Ge, [
849
+ return (e, t) => (S(), s("div", Ge, [c("div", Ke, [
850
+ c("span", qe, k(n.currentTimeLabel), 1),
851
+ c("div", Je, [
826
852
  t[1] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
827
853
  c("div", {
828
854
  class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
@@ -839,25 +865,25 @@ var He = {
839
865
  disabled: n.duration <= 0,
840
866
  class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
841
867
  onInput: t[0] ||= (e) => r("seek-input", e)
842
- }, null, 40, Ke)
868
+ }, null, 40, Ye)
843
869
  ]),
844
- c("span", qe, k(n.durationLabel), 1)
870
+ c("span", Xe, k(n.durationLabel), 1)
845
871
  ])]));
846
872
  }
847
- }), Ye = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, Xe = { class: "grid gap-4" }, Ze = { class: "flex min-h-11 items-center justify-between gap-4" }, Qe = { class: "min-w-0 flex flex-1 items-center gap-3" }, $e = {
873
+ }), Qe = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, $e = { class: "grid gap-4" }, et = { class: "flex min-h-11 items-center justify-between gap-4" }, tt = { class: "min-w-0 flex flex-1 items-center gap-3" }, nt = {
848
874
  key: 1,
849
875
  "data-testid": "vibe-title",
850
876
  class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
851
- }, et = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, tt = {
877
+ }, rt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, it = {
852
878
  "data-testid": "vibe-pagination",
853
879
  class: "inline-flex shrink-0 items-center gap-2 whitespace-nowrap border border-white/14 bg-black/40 px-3 py-2 text-[0.63rem] font-bold uppercase tracking-[0.12em] text-[#f7f1ea]/72 backdrop-blur-[18px] min-[721px]:gap-3 min-[721px]:px-4 min-[721px]:py-3 min-[721px]:text-[0.74rem] min-[721px]:tracking-[0.2em]"
854
- }, nt = { class: "whitespace-nowrap" }, rt = {
880
+ }, at = { class: "whitespace-nowrap" }, ot = {
855
881
  key: 0,
856
882
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
857
- }, it = {
883
+ }, st = {
858
884
  key: 0,
859
885
  class: "grid gap-2 max-[720px]:justify-items-start"
860
- }, at = /* @__PURE__ */ d({
886
+ }, ct = /* @__PURE__ */ d({
861
887
  __name: "FullscreenHeader",
862
888
  props: {
863
889
  currentIndex: {},
@@ -870,32 +896,136 @@ var He = {
870
896
  emits: ["back-to-list"],
871
897
  setup(e, { emit: t }) {
872
898
  let n = e, r = t;
873
- return (e, t) => (S(), s("div", Ye, [c("div", Xe, [c("div", Ze, [c("div", Qe, [n.showBackToList ? (S(), s("button", {
899
+ return (e, t) => (S(), s("div", Qe, [c("div", $e, [c("div", et, [c("div", tt, [n.showBackToList ? (S(), s("button", {
874
900
  key: 0,
875
901
  type: "button",
876
902
  "data-testid": "vibe-back-to-list",
877
903
  class: "pointer-events-auto inline-flex h-11 w-11 shrink-0 items-center justify-center border border-white/14 bg-black/40 text-[#f7f1ea]/78 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/55",
878
904
  "aria-label": "Back to list",
879
905
  onClick: t[0] ||= (e) => r("back-to-list")
880
- }, [u(j(q), {
906
+ }, [u(j(Y), {
881
907
  class: "h-4 w-4 stroke-[2.2]",
882
908
  "aria-hidden": "true"
883
- })])) : o("", !0), n.title ? (S(), s("h2", $e, k(n.title), 1)) : o("", !0)]), c("div", et, [c("span", tt, [c("span", nt, k(n.currentIndex + 1) + " / " + k(n.total), 1), n.paginationDetail ? (S(), s("span", rt, k(n.paginationDetail), 1)) : o("", !0)]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", it, [...t[1] ||= [c("span", { class: "inline-flex items-center border border-amber-300/35 bg-black/40 px-4 py-3 text-[0.74rem] font-bold uppercase tracking-[0.2em] text-amber-200 backdrop-blur-[18px]" }, " End reached ", -1)]])) : o("", !0)]));
909
+ })])) : o("", !0), n.title ? (S(), s("h2", nt, k(n.title), 1)) : o("", !0)]), c("div", rt, [c("span", it, [c("span", at, k(n.currentIndex + 1) + " / " + k(n.total), 1), n.paginationDetail ? (S(), s("span", ot, k(n.paginationDetail), 1)) : o("", !0)]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", st, [...t[1] ||= [c("span", { class: "inline-flex items-center border border-amber-300/35 bg-black/40 px-4 py-3 text-[0.74rem] font-bold uppercase tracking-[0.2em] text-amber-200 backdrop-blur-[18px]" }, " End reached ", -1)]])) : o("", !0)]));
910
+ }
911
+ }), lt = {
912
+ image: ne,
913
+ video: ee,
914
+ audio: X,
915
+ other: te
916
+ }, ut = {
917
+ image: "Image",
918
+ video: "Video",
919
+ audio: "Audio",
920
+ other: "File"
921
+ };
922
+ function dt(e) {
923
+ return lt[e];
924
+ }
925
+ function ft(e) {
926
+ return ut[e];
927
+ }
928
+ //#endregion
929
+ //#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
930
+ var pt = 2;
931
+ function mt(e) {
932
+ function t(e, t) {
933
+ let n = t.title?.trim();
934
+ return n ? `${e} ${n}` : `${e} ${ft(t.type).toLowerCase()}`;
935
+ }
936
+ function n(e) {
937
+ return $(e);
884
938
  }
885
- });
939
+ function r(t) {
940
+ let n = e.resolvedActiveIndex.value;
941
+ return !!e.active.value && t >= n && t <= n + pt;
942
+ }
943
+ function i(t, i) {
944
+ let a = n(i);
945
+ return !r(t) || t !== e.resolvedActiveIndex.value || e.viewer.getAssetErrorKind(a) ? !1 : i.type === "image" ? !e.viewer.isImageReady(a) : i.type === "video" || i.type === "audio" ? !e.viewer.isMediaReady(a) : !1;
946
+ }
947
+ function a(t) {
948
+ return e.viewer.getAssetErrorKind(n(t));
949
+ }
950
+ function o(t) {
951
+ return e.viewer.getAssetErrorLabel(n(t)) ?? "Load error";
952
+ }
953
+ function s(t, n) {
954
+ return r(t) && t === e.resolvedActiveIndex.value && !!a(n);
955
+ }
956
+ function c(t, n) {
957
+ return r(t) ? e.viewer.getImageSource(n) : void 0;
958
+ }
959
+ function l(e, t) {
960
+ return r(e) ? t.url : void 0;
961
+ }
962
+ return {
963
+ getAssetErrorKind: a,
964
+ getAssetErrorLabel: o,
965
+ getFullscreenImageSource: c,
966
+ getFullscreenMediaSource: l,
967
+ getItemKey: n,
968
+ getMediaActionLabel: t,
969
+ isAssetErrored: s,
970
+ isAssetLoading: i,
971
+ shouldPreloadSlideAsset: r
972
+ };
973
+ }
974
+ //#endregion
975
+ //#region src/components/viewer-core/slotContent.ts
976
+ function ht(e) {
977
+ if (!Array.isArray(e)) return !1;
978
+ for (let t of e) {
979
+ if (Array.isArray(t)) {
980
+ if (ht(t)) return !0;
981
+ continue;
982
+ }
983
+ if (!m(t)) {
984
+ if (typeof t == "string") {
985
+ if (t.trim().length > 0) return !0;
986
+ continue;
987
+ }
988
+ if (t != null && t !== !1) return !0;
989
+ continue;
990
+ }
991
+ if (!gt(t)) return !0;
992
+ }
993
+ return !1;
994
+ }
995
+ function gt(r) {
996
+ return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !ht(r.children) : !1;
997
+ }
998
+ //#endregion
999
+ //#region src/components/viewer-core/useSurfaceEmptyState.ts
1000
+ var _t = "no items available";
1001
+ function vt(e) {
1002
+ let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
1003
+ loading: !!e.loading.value,
1004
+ message: _t,
1005
+ mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
1006
+ surface: e.surface,
1007
+ total: e.itemCount.value
1008
+ }), n = i(() => !t.value || !e.renderSlot ? [] : e.renderSlot(t.value));
1009
+ return {
1010
+ emptyStateProps: t,
1011
+ showBadgeEmptyState: i(() => t.value?.mode === "badge"),
1012
+ showCustomEmptyState: i(() => ht(n.value)),
1013
+ showInlineEmptyState: i(() => t.value?.mode === "inline")
1014
+ };
1015
+ }
886
1016
  //#endregion
887
1017
  //#region src/components/viewer-core/format.ts
888
- function ot(e) {
1018
+ function yt(e) {
889
1019
  if (!Number.isFinite(e) || e <= 0) return "0:00";
890
1020
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
891
1021
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
892
1022
  }
893
1023
  //#endregion
894
1024
  //#region src/components/viewer-core/surfaceStatus.ts
895
- function st(e) {
1025
+ function bt(e) {
896
1026
  return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
897
1027
  }
898
- function ct(e) {
1028
+ function xt(e) {
899
1029
  return e.phase === "failed" ? {
900
1030
  kind: "failed",
901
1031
  message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
@@ -918,9 +1048,9 @@ function ct(e) {
918
1048
  }
919
1049
  //#endregion
920
1050
  //#region src/components/viewer-core/useActivation.ts
921
- function lt(e) {
1051
+ function St(e) {
922
1052
  let t = !1;
923
- P(e.enabled, async (t) => {
1053
+ F(e.enabled, async (t) => {
924
1054
  if (n(t), t) {
925
1055
  e.onResize(), await e.onEnable();
926
1056
  return;
@@ -941,42 +1071,42 @@ function lt(e) {
941
1071
  }
942
1072
  //#endregion
943
1073
  //#region src/components/viewer-core/assetState.ts
944
- var ut = {
1074
+ var Ct = {
945
1075
  currentTime: 0,
946
1076
  duration: 0,
947
1077
  errorKind: null,
948
1078
  paused: !0,
949
1079
  ready: !1
950
1080
  };
951
- function dt() {
952
- return { ...ut };
1081
+ function wt() {
1082
+ return { ...Ct };
953
1083
  }
954
- function ft(e) {
1084
+ function Tt(e) {
955
1085
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
956
1086
  }
957
- function pt(e, t, n) {
958
- e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.paused = t.paused, n && n !== "error" && (e.errorKind = null), e.ready = mt(t, n);
1087
+ function Et(e, t, n) {
1088
+ e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.paused = t.paused, n && n !== "error" && (e.errorKind = null), e.ready = Dt(t, n);
959
1089
  }
960
- function mt(e, t) {
1090
+ function Dt(e, t) {
961
1091
  return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
962
1092
  }
963
1093
  //#endregion
964
1094
  //#region src/components/viewer-core/loadError.ts
965
- var ht = /* @__PURE__ */ new Map();
966
- function gt(e) {
1095
+ var Ot = /* @__PURE__ */ new Map();
1096
+ function kt(e) {
967
1097
  return e === "not-found" ? "404" : "Load error";
968
1098
  }
969
- function _t(e) {
1099
+ function At(e) {
970
1100
  return e === "generic";
971
1101
  }
972
- function vt(e) {
973
- let t = ht.get(e);
1102
+ function jt(e) {
1103
+ let t = Ot.get(e);
974
1104
  if (t) return t;
975
- let n = yt(e);
976
- return ht.set(e, n), n;
1105
+ let n = Mt(e);
1106
+ return Ot.set(e, n), n;
977
1107
  }
978
- async function yt(e) {
979
- if (!bt(e)) return "generic";
1108
+ async function Mt(e) {
1109
+ if (!Nt(e)) return "generic";
980
1110
  try {
981
1111
  let t = await fetch(e, { method: "HEAD" });
982
1112
  if (!t.ok && t.status === 404) return "not-found";
@@ -985,12 +1115,12 @@ async function yt(e) {
985
1115
  }
986
1116
  return "generic";
987
1117
  }
988
- function bt(e) {
1118
+ function Nt(e) {
989
1119
  return /^(https?:\/\/|\/)/i.test(e);
990
1120
  }
991
1121
  //#endregion
992
1122
  //#region src/components/viewer-core/mediaPlayback.ts
993
- function xt(e) {
1123
+ function Pt(e) {
994
1124
  try {
995
1125
  let t = e.play();
996
1126
  t && typeof t.catch == "function" && t.catch(() => {});
@@ -998,75 +1128,75 @@ function xt(e) {
998
1128
  }
999
1129
  //#endregion
1000
1130
  //#region src/components/viewer-core/useMedia.ts
1001
- function St(e) {
1131
+ function Ft(e) {
1002
1132
  let t = T({}), n = T({}), r = T({}), a = T({}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), l = i(() => e.activeItem.value ? $(e.activeItem.value) : null), u = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), d = i(() => {
1003
1133
  let t = /* @__PURE__ */ new Map();
1004
1134
  for (let n of e.items.value) t.set($(n), n);
1005
1135
  return t;
1006
- }), f = i(() => u.value ? r.value[u.value] ?? ut : ut), p = i(() => u.value ? f.value.duration : 0), m = i(() => p.value <= 0 ? 0 : Ct(f.value.currentTime / p.value * 100, 0, 100)), h = i(() => l.value ? N(l.value) : null);
1007
- P(() => l.value, async () => {
1136
+ }), f = i(() => u.value ? r.value[u.value] ?? Ct : Ct), p = i(() => u.value ? f.value.duration : 0), m = i(() => p.value <= 0 ? 0 : It(f.value.currentTime / p.value * 100, 0, 100)), h = i(() => l.value ? N(l.value) : null);
1137
+ F(() => l.value, async () => {
1008
1138
  await x();
1009
- }), P(() => e.itemCount.value, async () => {
1139
+ }), F(() => e.itemCount.value, async () => {
1010
1140
  await x();
1011
1141
  });
1012
1142
  function _(e, t) {
1013
1143
  if (t instanceof HTMLVideoElement) {
1014
- o.set(e, t), V(e, t);
1144
+ o.set(e, t), H(e, t);
1015
1145
  return;
1016
1146
  }
1017
1147
  o.delete(e);
1018
1148
  }
1019
1149
  function v(e, t) {
1020
1150
  if (t instanceof HTMLAudioElement) {
1021
- s.set(e, t), V(e, t);
1151
+ s.set(e, t), H(e, t);
1022
1152
  return;
1023
1153
  }
1024
1154
  s.delete(e);
1025
1155
  }
1026
1156
  function y(e, r) {
1027
- r instanceof HTMLImageElement && ft(r) && (t.value[e] = !0, n.value[e] = null, K(e, r.currentSrc || r.src || J(e)));
1157
+ r instanceof HTMLImageElement && Tt(r) && (t.value[e] = !0, n.value[e] = null, q(e, r.currentSrc || r.src || Y(e)));
1028
1158
  }
1029
1159
  function b() {
1030
- z(), a.value = {}, n.value = {}, t.value = {}, r.value = {}, c.clear();
1160
+ B(), a.value = {}, n.value = {}, t.value = {}, r.value = {}, c.clear();
1031
1161
  }
1032
1162
  async function x() {
1033
1163
  if (!e.isEnabled.value) {
1034
- z();
1164
+ B();
1035
1165
  return;
1036
1166
  }
1037
1167
  await g();
1038
1168
  let t = l.value;
1039
1169
  for (let [e, n] of o.entries()) {
1040
1170
  if (e !== t || r.value[e]?.errorKind) {
1041
- R(n, e);
1171
+ z(n, e);
1042
1172
  continue;
1043
1173
  }
1044
- n.muted = !0, n.loop = !1, n.playsInline = !0, xt(n), V(e, n);
1174
+ n.muted = !0, n.loop = !1, n.playsInline = !0, Pt(n), H(e, n);
1045
1175
  }
1046
1176
  for (let [e, n] of s.entries()) {
1047
1177
  if (e !== t || r.value[e]?.errorKind) {
1048
- R(n, e);
1178
+ z(n, e);
1049
1179
  continue;
1050
1180
  }
1051
- xt(n), V(e, n);
1181
+ Pt(n), H(e, n);
1052
1182
  }
1053
1183
  }
1054
1184
  function S(e, t) {
1055
1185
  let n = t.currentTarget instanceof HTMLMediaElement ? t.currentTarget : t.target instanceof HTMLMediaElement ? t.target : null;
1056
1186
  if (n) {
1057
1187
  let i = r.value[e]?.ready ?? !1;
1058
- V(e, n, t.type);
1188
+ H(e, n, t.type);
1059
1189
  let a = r.value[e]?.ready ?? !1;
1060
- !i && a && K(e, n.currentSrc || n.src || J(e));
1190
+ !i && a && q(e, n.currentSrc || n.src || Y(e));
1061
1191
  }
1062
1192
  }
1063
1193
  function C(e, r) {
1064
- t.value[e] = !0, n.value[e] = null, K(e, r);
1194
+ t.value[e] = !0, n.value[e] = null, q(e, r);
1065
1195
  }
1066
1196
  async function w(r, i) {
1067
- let a = q(r) ?? e.activeItem.value;
1197
+ let a = J(r) ?? e.activeItem.value;
1068
1198
  t.value[r] = !1, n.value[r] = "generic";
1069
- let o = await vt(i);
1199
+ let o = await jt(i);
1070
1200
  n.value[r] = o, a && e.onAssetError?.({
1071
1201
  item: a,
1072
1202
  occurrenceKey: r,
@@ -1076,7 +1206,7 @@ function St(e) {
1076
1206
  });
1077
1207
  }
1078
1208
  async function E(t, n) {
1079
- let r = U(t), i = B(t), a = q(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1209
+ let r = W(t), i = V(t), a = J(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1080
1210
  if (r) {
1081
1211
  r.pause();
1082
1212
  try {
@@ -1084,7 +1214,7 @@ function St(e) {
1084
1214
  } catch {}
1085
1215
  }
1086
1216
  i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
1087
- let o = await vt(n);
1217
+ let o = await jt(n);
1088
1218
  i.errorKind = o, a && e.onAssetError?.({
1089
1219
  item: a,
1090
1220
  occurrenceKey: t,
@@ -1094,18 +1224,18 @@ function St(e) {
1094
1224
  });
1095
1225
  }
1096
1226
  function D(e, t, n) {
1097
- e.button !== 0 || Date.now() < n || G(o.get(t) ?? null);
1227
+ e.button !== 0 || Date.now() < n || K(o.get(t) ?? null);
1098
1228
  }
1099
1229
  function O(e, t, n) {
1100
- e.button !== 0 || Date.now() < n || G(U(t));
1230
+ e.button !== 0 || Date.now() < n || K(W(t));
1101
1231
  }
1102
1232
  function k(e) {
1103
- let t = W(), n = u.value;
1233
+ let t = G(), n = u.value;
1104
1234
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1105
1235
  let r = Number.parseFloat(e.target.value);
1106
1236
  if (!Number.isFinite(r)) return;
1107
- let i = Ct(r, 0, p.value || 0);
1108
- H(n, i, t), t.currentTime = i;
1237
+ let i = It(r, 0, p.value || 0);
1238
+ U(n, i, t), t.currentTime = i;
1109
1239
  }
1110
1240
  function A(e) {
1111
1241
  return !!t.value[e] && !n.value[e];
@@ -1119,64 +1249,64 @@ function St(e) {
1119
1249
  function N(e) {
1120
1250
  return n.value[e] ?? r.value[e]?.errorKind ?? null;
1121
1251
  }
1122
- function F(e) {
1252
+ function P(e) {
1123
1253
  let t = N(e);
1124
- return t ? gt(t) : null;
1254
+ return t ? kt(t) : null;
1125
1255
  }
1126
1256
  function I(e) {
1127
- return _t(N(e));
1257
+ return At(N(e));
1128
1258
  }
1129
1259
  function L(e) {
1130
1260
  return `${e}:${a.value[e] ?? 0}`;
1131
1261
  }
1132
- async function ee(e) {
1262
+ async function R(e) {
1133
1263
  if (!I(e)) return;
1134
1264
  t.value[e] = !1, n.value[e] = null;
1135
- let r = B(e);
1265
+ let r = V(e);
1136
1266
  r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
1137
- let i = U(e);
1138
- i && R(i, e), c.forEach((t) => {
1267
+ let i = W(e);
1268
+ i && z(i, e), c.forEach((t) => {
1139
1269
  t.startsWith(`${e}|`) && c.delete(t);
1140
1270
  }), a.value[e] = (a.value[e] ?? 0) + 1, await g(), await x();
1141
1271
  }
1142
- function R(e, t) {
1272
+ function z(e, t) {
1143
1273
  e.pause();
1144
1274
  try {
1145
1275
  e.currentTime = 0;
1146
1276
  } catch {}
1147
- V(t, e);
1148
- }
1149
- function z() {
1150
- for (let [e, t] of o.entries()) R(t, e);
1151
- for (let [e, t] of s.entries()) R(t, e);
1277
+ H(t, e);
1152
1278
  }
1153
- function B(e) {
1154
- return r.value[e] || (r.value[e] = dt()), r.value[e];
1279
+ function B() {
1280
+ for (let [e, t] of o.entries()) z(t, e);
1281
+ for (let [e, t] of s.entries()) z(t, e);
1155
1282
  }
1156
- function V(e, t, n) {
1157
- pt(B(e), t, n);
1283
+ function V(e) {
1284
+ return r.value[e] || (r.value[e] = wt()), r.value[e];
1158
1285
  }
1159
1286
  function H(e, t, n) {
1160
- let r = B(e);
1287
+ Et(V(e), t, n);
1288
+ }
1289
+ function U(e, t, n) {
1290
+ let r = V(e);
1161
1291
  r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.paused = n.paused;
1162
1292
  }
1163
- function U(e) {
1293
+ function W(e) {
1164
1294
  return o.get(e) ?? s.get(e) ?? null;
1165
1295
  }
1166
- function W() {
1167
- return u.value ? U(u.value) : null;
1296
+ function G() {
1297
+ return u.value ? W(u.value) : null;
1168
1298
  }
1169
- function G(e) {
1299
+ function K(e) {
1170
1300
  if (e) {
1171
1301
  if (e.paused) {
1172
- xt(e);
1302
+ Pt(e);
1173
1303
  return;
1174
1304
  }
1175
1305
  e.pause();
1176
1306
  }
1177
1307
  }
1178
- function K(t, n) {
1179
- let r = q(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1308
+ function q(t, n) {
1309
+ let r = J(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1180
1310
  if (!r || !n) return;
1181
1311
  let i = `${t}|${n}`;
1182
1312
  c.has(i) || (c.add(i), e.onAssetLoad?.({
@@ -1186,11 +1316,11 @@ function St(e) {
1186
1316
  url: n
1187
1317
  }));
1188
1318
  }
1189
- function q(e) {
1319
+ function J(e) {
1190
1320
  return d.value.get(e) ?? null;
1191
1321
  }
1192
- function J(e) {
1193
- return q(e)?.url ?? null;
1322
+ function Y(e) {
1323
+ return J(e)?.url ?? null;
1194
1324
  }
1195
1325
  return {
1196
1326
  activeAssetErrorKind: h,
@@ -1198,7 +1328,7 @@ function St(e) {
1198
1328
  activeMediaProgress: m,
1199
1329
  activeMediaState: f,
1200
1330
  getAssetErrorKind: N,
1201
- getAssetErrorLabel: F,
1331
+ getAssetErrorLabel: P,
1202
1332
  getAssetRenderKey: L,
1203
1333
  getImageSource: M,
1204
1334
  isImageReady: A,
@@ -1216,14 +1346,14 @@ function St(e) {
1216
1346
  registerImageElement: y,
1217
1347
  registerVideoElement: _,
1218
1348
  resetMediaState: b,
1219
- retryAsset: ee,
1349
+ retryAsset: R,
1220
1350
  syncMediaPlayback: x
1221
1351
  };
1222
1352
  }
1223
- function Ct(e, t, n) {
1353
+ function It(e, t, n) {
1224
1354
  return Math.min(Math.max(e, t), n);
1225
1355
  }
1226
- function wt(e, t, n = 2) {
1356
+ function Lt(e, t, n = 2) {
1227
1357
  return t <= 0 ? {
1228
1358
  start: 0,
1229
1359
  end: -1
@@ -1232,14 +1362,14 @@ function wt(e, t, n = 2) {
1232
1362
  end: Math.min(t - 1, e + n)
1233
1363
  };
1234
1364
  }
1235
- function Tt(e, t, n = 2) {
1236
- let r = wt(t, e.length, n);
1365
+ function Rt(e, t, n = 2) {
1366
+ let r = Lt(t, e.length, n);
1237
1367
  return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
1238
1368
  item: e,
1239
1369
  index: r.start + t
1240
1370
  }));
1241
1371
  }
1242
- function Et(e, t, n, r, i) {
1372
+ function zt(e, t, n, r, i) {
1243
1373
  return {
1244
1374
  transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
1245
1375
  transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
@@ -1247,12 +1377,12 @@ function Et(e, t, n, r, i) {
1247
1377
  }
1248
1378
  //#endregion
1249
1379
  //#region src/components/viewer-core/useViewer.ts
1250
- function Dt(e, t, n = {}) {
1251
- let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.paginationDetail ?? null), u = i(() => st({
1380
+ function Bt(e, t, n = {}) {
1381
+ let r = i(() => e.items), a = i(() => e.activeIndex ?? 0), o = i(() => e.errorMessage ?? null), s = i(() => e.loading ?? !1), c = i(() => e.hasNextPage ?? !1), l = i(() => e.paginationDetail ?? null), u = i(() => bt({
1252
1382
  itemCount: r.value.length,
1253
1383
  loading: s.value,
1254
1384
  phase: e.phase
1255
- })), d = i(() => !1), f = T(null), p = T(0), m = T(!1), h = T(1), g = n.enabled ?? i(() => !0), _ = null, v = 0, y = 0, b = 0, x = i(() => r.value.length === 0 ? 0 : N(a.value, 0, r.value.length - 1)), S = i(() => r.value[x.value] ?? null), C = i(() => S.value?.type === "audio" || S.value?.type === "video" ? S.value : null), w = St({
1385
+ })), d = i(() => !1), f = T(null), p = T(0), m = T(!1), h = T(1), g = n.enabled ?? i(() => !0), _ = null, v = 0, y = 0, b = 0, x = i(() => r.value.length === 0 ? 0 : N(a.value, 0, r.value.length - 1)), S = i(() => r.value[x.value] ?? null), C = i(() => S.value?.type === "audio" || S.value?.type === "video" ? S.value : null), w = Ft({
1256
1386
  items: r,
1257
1387
  activeItem: S,
1258
1388
  activeMediaItem: C,
@@ -1260,22 +1390,22 @@ function Dt(e, t, n = {}) {
1260
1390
  itemCount: i(() => r.value.length),
1261
1391
  onAssetError: n.onAssetError,
1262
1392
  onAssetLoad: n.onAssetLoad
1263
- }), E = i(() => r.value.length > 0 && x.value === r.value.length - 1), D = i(() => ct({
1393
+ }), E = i(() => r.value.length > 0 && x.value === r.value.length - 1), D = i(() => xt({
1264
1394
  errorMessage: o.value,
1265
1395
  hasItems: r.value.length > 0,
1266
1396
  hasNextPage: c.value,
1267
1397
  phase: u.value,
1268
1398
  surface: "fullscreen"
1269
- })), O = i(() => D.value?.kind ?? null), k = i(() => D.value?.message ?? null), A = i(() => Math.min(96, h.value * .15 || 96)), j = i(() => wt(x.value, r.value.length)), M = i(() => Tt(r.value, x.value));
1270
- lt({
1399
+ })), O = i(() => D.value?.kind ?? null), k = i(() => D.value?.message ?? null), A = i(() => Math.min(96, h.value * .15 || 96)), j = i(() => Lt(x.value, r.value.length)), M = i(() => Rt(r.value, x.value));
1400
+ St({
1271
1401
  enabled: g,
1272
1402
  onDisable() {
1273
- H(), w.resetMediaState();
1403
+ U(), w.resetMediaState();
1274
1404
  },
1275
1405
  onEnable() {
1276
1406
  return w.syncMediaPlayback();
1277
1407
  },
1278
- onKeydown: W,
1408
+ onKeydown: G,
1279
1409
  onResize: P
1280
1410
  });
1281
1411
  function N(e, t, n) {
@@ -1296,50 +1426,50 @@ function Dt(e, t, n = {}) {
1296
1426
  let t = e > 0, n = e < 0;
1297
1427
  return t && !F(-1) || n && !F(1) ? e * .24 : e;
1298
1428
  }
1299
- function ee(e) {
1300
- !g.value || r.value.length === 0 || e.pointerType === "mouse" || Q(e.target) || (_ = e.pointerId, v = e.clientY, p.value = 0, m.value = !0, f.value?.setPointerCapture?.(e.pointerId));
1301
- }
1302
1429
  function R(e) {
1303
- !g.value || !m.value || _ !== e.pointerId || (p.value = L(e.clientY - v));
1430
+ !g.value || r.value.length === 0 || e.pointerType === "mouse" || le(e.target) || (_ = e.pointerId, v = e.clientY, p.value = 0, m.value = !0, f.value?.setPointerCapture?.(e.pointerId));
1304
1431
  }
1305
1432
  function z(e) {
1306
- !g.value || _ !== e.pointerId || (f.value?.releasePointerCapture?.(e.pointerId), V());
1433
+ !g.value || !m.value || _ !== e.pointerId || (p.value = L(e.clientY - v));
1307
1434
  }
1308
1435
  function B(e) {
1309
1436
  !g.value || _ !== e.pointerId || (f.value?.releasePointerCapture?.(e.pointerId), H());
1310
1437
  }
1311
- function V() {
1312
- Math.abs(p.value) >= A.value && (b = Date.now() + 250, I(p.value < 0 ? 1 : -1)), H();
1438
+ function V(e) {
1439
+ !g.value || _ !== e.pointerId || (f.value?.releasePointerCapture?.(e.pointerId), U());
1313
1440
  }
1314
1441
  function H() {
1442
+ Math.abs(p.value) >= A.value && (b = Date.now() + 250, I(p.value < 0 ? 1 : -1)), U();
1443
+ }
1444
+ function U() {
1315
1445
  p.value = 0, m.value = !1, _ = null;
1316
1446
  }
1317
- function U(e) {
1318
- if (!g.value || r.value.length === 0 || m.value || Q(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
1447
+ function W(e) {
1448
+ if (!g.value || r.value.length === 0 || m.value || le(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
1319
1449
  e.preventDefault();
1320
1450
  let t = Date.now();
1321
1451
  t < y || (y = t + 400, I(e.deltaY > 0 ? 1 : -1));
1322
1452
  }
1323
- function W(e) {
1324
- !g.value || r.value.length === 0 || Z(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), I(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), I(-1)));
1453
+ function G(e) {
1454
+ !g.value || r.value.length === 0 || Q(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), I(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), I(-1)));
1325
1455
  }
1326
- function G(e, t) {
1456
+ function K(e, t) {
1327
1457
  w.onVideoClick(e, t, b);
1328
1458
  }
1329
- function K(e, t) {
1459
+ function q(e, t) {
1330
1460
  w.onAudioCoverClick(e, t, b);
1331
1461
  }
1332
- function q(e) {
1462
+ function J(e) {
1333
1463
  w.onMediaSeekInput(e);
1334
1464
  }
1335
- function J(e) {
1465
+ function Y(e) {
1336
1466
  return e.type === "image" || e.type === "video";
1337
1467
  }
1338
- function te(e) {
1468
+ function X(e) {
1339
1469
  return e.type === "audio";
1340
1470
  }
1341
- function Y(e) {
1342
- return Et(e, x.value, h.value, p.value, m.value);
1471
+ function ee(e) {
1472
+ return zt(e, x.value, h.value, p.value, m.value);
1343
1473
  }
1344
1474
  return {
1345
1475
  activeItem: S,
@@ -1354,30 +1484,30 @@ function Dt(e, t, n = {}) {
1354
1484
  getAssetErrorKind: w.getAssetErrorKind,
1355
1485
  getAssetErrorLabel: w.getAssetErrorLabel,
1356
1486
  getAssetRenderKey: w.getAssetRenderKey,
1357
- formatPlaybackTime: ot,
1487
+ formatPlaybackTime: yt,
1358
1488
  getImageSource: w.getImageSource,
1359
- getSlideStyle: Y,
1489
+ getSlideStyle: ee,
1360
1490
  hasNextPage: c,
1361
1491
  isAtEnd: E,
1362
- isAudio: te,
1363
- isVisual: J,
1492
+ isAudio: X,
1493
+ isVisual: Y,
1364
1494
  items: r,
1365
1495
  loading: s,
1366
1496
  mediaStates: w.mediaStates,
1367
1497
  isImageReady: w.isImageReady,
1368
1498
  isMediaReady: w.isMediaReady,
1369
- onAudioCoverClick: K,
1499
+ onAudioCoverClick: q,
1370
1500
  onImageError: w.onImageError,
1371
1501
  onImageLoad: w.onImageLoad,
1372
1502
  onMediaEvent: w.onMediaEvent,
1373
1503
  onMediaError: w.onMediaError,
1374
- onMediaSeekInput: q,
1375
- onPointerCancel: B,
1376
- onPointerDown: ee,
1377
- onPointerMove: R,
1378
- onPointerUp: z,
1379
- onVideoClick: G,
1380
- onWheel: U,
1504
+ onMediaSeekInput: J,
1505
+ onPointerCancel: V,
1506
+ onPointerDown: R,
1507
+ onPointerMove: z,
1508
+ onPointerUp: B,
1509
+ onVideoClick: K,
1510
+ onWheel: W,
1381
1511
  registerAudioElement: w.registerAudioElement,
1382
1512
  registerImageElement: w.registerImageElement,
1383
1513
  registerVideoElement: w.registerVideoElement,
@@ -1394,88 +1524,65 @@ function Dt(e, t, n = {}) {
1394
1524
  };
1395
1525
  }
1396
1526
  //#endregion
1397
- //#region src/components/viewer-core/media.ts
1398
- var Ot = {
1399
- image: ne,
1400
- video: te,
1401
- audio: J,
1402
- other: Y
1403
- }, kt = {
1404
- image: "Image",
1405
- video: "Video",
1406
- audio: "Audio",
1407
- other: "File"
1408
- };
1409
- function At(e) {
1410
- return Ot[e];
1411
- }
1412
- function jt(e) {
1413
- return kt[e];
1414
- }
1415
- //#endregion
1416
- //#region src/components/viewer-core/slotContent.ts
1417
- function Mt(e) {
1418
- if (!Array.isArray(e)) return !1;
1419
- for (let t of e) {
1420
- if (Array.isArray(t)) {
1421
- if (Mt(t)) return !0;
1422
- continue;
1423
- }
1424
- if (!m(t)) {
1425
- if (typeof t == "string") {
1426
- if (t.trim().length > 0) return !0;
1427
- continue;
1428
- }
1429
- if (t != null && t !== !1) return !0;
1430
- continue;
1431
- }
1432
- if (!Nt(t)) return !0;
1433
- }
1434
- return !1;
1435
- }
1436
- function Nt(r) {
1437
- return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Mt(r.children) : !1;
1438
- }
1439
- //#endregion
1440
1527
  //#region src/components/viewer-core/theme.ts
1441
- var Pt = {
1528
+ var Vt = {
1442
1529
  image: "bg-[radial-gradient(circle_at_top_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
1443
1530
  video: "bg-[radial-gradient(circle_at_top_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
1444
1531
  audio: "bg-[radial-gradient(circle_at_top_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
1445
1532
  other: "bg-[radial-gradient(circle_at_top_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
1446
- }, Ft = {
1533
+ }, Ht = {
1447
1534
  image: "bg-[radial-gradient(circle_at_center,rgba(251,191,36,0.4)_0,transparent_42%),linear-gradient(180deg,#120d08,#050507)]",
1448
1535
  video: "bg-[radial-gradient(circle_at_center,rgba(56,189,248,0.38)_0,transparent_42%),linear-gradient(180deg,#07111c,#050608)]",
1449
1536
  audio: "bg-[radial-gradient(circle_at_center,rgba(16,185,129,0.32)_0,transparent_42%),linear-gradient(180deg,#06120f,#040506)]",
1450
1537
  other: "bg-[radial-gradient(circle_at_center,rgba(148,163,184,0.28)_0,transparent_42%),linear-gradient(180deg,#0d0c10,#040506)]"
1451
1538
  };
1452
- function It(e) {
1453
- return Pt[e];
1539
+ function Ut(e) {
1540
+ return Vt[e];
1454
1541
  }
1455
- function Lt(e) {
1456
- return Ft[e];
1542
+ function Wt(e) {
1543
+ return Ht[e];
1457
1544
  }
1458
1545
  //#endregion
1459
- //#region src/components/FullscreenSurface.vue?vue&type=script&setup=true&lang.ts
1460
- var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, zt = {
1546
+ //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
1547
+ var Gt = ["data-surface"], Kt = ["data-surface"], qt = /* @__PURE__ */ d({
1548
+ inheritAttrs: !1,
1549
+ __name: "SurfaceEmptyState",
1550
+ props: {
1551
+ message: {},
1552
+ mode: {},
1553
+ surface: {}
1554
+ },
1555
+ setup(e) {
1556
+ let t = M();
1557
+ return (n, r) => e.mode === "inline" ? (S(), s("div", h({ key: 0 }, j(t), {
1558
+ "data-testid": "vibe-empty-state-inline",
1559
+ "data-surface": e.surface,
1560
+ class: ["pointer-events-none absolute z-[4] text-center", e.surface === "grid" ? "inset-x-0 top-[clamp(6rem,22vh,11rem)] flex justify-center px-6" : "inset-0 grid place-items-center px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)]"]
1561
+ }), [D(n.$slots, "default", {}, () => [c("p", { class: _(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, k(e.message), 3)])], 16, Gt)) : (S(), s("div", h({ key: 1 }, j(t), { class: ["pointer-events-none absolute z-[4]", e.surface === "grid" ? "inset-x-0 bottom-0 flex justify-center px-6" : "bottom-[1.8rem] left-1/2 -translate-x-1/2 max-[720px]:bottom-[1.3rem]"] }), [D(n.$slots, "default", {}, () => [c("span", {
1562
+ "data-testid": "vibe-empty-state-badge",
1563
+ "data-surface": e.surface,
1564
+ class: _(["inline-flex items-center border border-white/14 backdrop-blur-[18px]", e.surface === "grid" ? "bg-black/55 px-4 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/72" : "w-auto bg-black/40 px-5 py-3 text-[0.82rem] font-medium tracking-[0.08em] text-[#f7f1ea]/74 max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center"])
1565
+ }, k(e.message), 11, Kt)])], 16));
1566
+ }
1567
+ }), Jt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, Yt = {
1461
1568
  key: 0,
1462
1569
  class: "relative h-full min-h-0"
1463
- }, Bt = [
1570
+ }, Xt = [
1464
1571
  "data-item-id",
1465
1572
  "data-occurrence-key",
1466
1573
  "data-index",
1467
1574
  "data-active",
1468
1575
  "aria-hidden"
1469
- ], Vt = {
1576
+ ], Zt = {
1470
1577
  key: 0,
1471
1578
  "data-testid": "vibe-asset-spinner",
1472
1579
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
1473
- }, Ht = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Ut = ["data-kind"], Wt = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Gt = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Kt = ["onClick"], qt = [
1580
+ }, Qt = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, $t = ["data-kind"], en = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, tn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, nn = ["onClick"], rn = [
1474
1581
  "src",
1475
1582
  "alt",
1476
1583
  "onLoad",
1477
1584
  "onError"
1478
- ], Jt = [
1585
+ ], an = [
1479
1586
  "src",
1480
1587
  "preload",
1481
1588
  "onClick",
@@ -1492,15 +1599,15 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1492
1599
  "onStalled",
1493
1600
  "onTimeupdate",
1494
1601
  "onWaiting"
1495
- ], Yt = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Xt = [
1602
+ ], on = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, sn = [
1496
1603
  "aria-label",
1497
1604
  "disabled",
1498
1605
  "onClick"
1499
- ], Zt = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, Qt = { class: "pointer-events-none absolute bottom-4 right-4 inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 backdrop-blur-[18px]" }, $t = {
1606
+ ], cn = { class: "relative z-[1] inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-emerald-500/12 p-4 backdrop-blur-[20px]" }, ln = { class: "pointer-events-none absolute bottom-4 right-4 inline-flex h-10 w-10 items-center justify-center border border-white/14 bg-black/50 backdrop-blur-[18px]" }, un = {
1500
1607
  key: 0,
1501
1608
  "data-testid": "vibe-asset-spinner",
1502
1609
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
1503
- }, en = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, tn = ["data-kind"], nn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, rn = ["onClick"], an = [
1610
+ }, dn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, fn = ["data-kind"], pn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, mn = ["onClick"], hn = [
1504
1611
  "src",
1505
1612
  "preload",
1506
1613
  "onCanplay",
@@ -1516,21 +1623,21 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1516
1623
  "onStalled",
1517
1624
  "onTimeupdate",
1518
1625
  "onWaiting"
1519
- ], on = {
1626
+ ], gn = {
1520
1627
  key: 2,
1521
1628
  class: "relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
1522
- }, sn = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, cn = {
1629
+ }, _n = { class: "inline-flex min-h-[4.25rem] min-w-[4.25rem] items-center justify-center border border-white/18 bg-white/8 p-4 backdrop-blur-[20px]" }, vn = {
1523
1630
  key: 0,
1524
1631
  class: "pointer-events-none absolute inset-0 z-[4]"
1525
- }, ln = { class: "h-full w-full" }, un = {
1632
+ }, yn = { class: "h-full w-full" }, bn = {
1526
1633
  key: 0,
1527
1634
  "data-testid": "vibe-fullscreen-aside",
1528
1635
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
1529
- }, dn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, fn = {
1636
+ }, xn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Sn = {
1530
1637
  key: 0,
1531
1638
  "data-testid": "vibe-fullscreen-aside",
1532
1639
  class: "absolute inset-y-0 right-0 z-[6] w-full max-w-[22rem] overflow-hidden border-l border-white/10 bg-black/82 backdrop-blur-[18px]"
1533
- }, pn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, mn = 1280, hn = 2, gn = /* @__PURE__ */ d({
1640
+ }, Cn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, wn = 1280, Tn = /* @__PURE__ */ d({
1534
1641
  __name: "FullscreenSurface",
1535
1642
  props: {
1536
1643
  active: {
@@ -1538,6 +1645,7 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1538
1645
  default: !0
1539
1646
  },
1540
1647
  activeIndex: { default: 0 },
1648
+ emptyStateMode: { default: "inline" },
1541
1649
  errorMessage: { default: null },
1542
1650
  hasNextPage: {
1543
1651
  type: Boolean,
@@ -1573,13 +1681,17 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1573
1681
  },
1574
1682
  emits: ["back-to-list", "update:activeIndex"],
1575
1683
  setup(e, { emit: n }) {
1576
- let d = e, p = M(), m = n, g = Dt(d, (e, t) => {
1684
+ let d = e, p = N(), m = n, g = Bt(d, (e, t) => {
1577
1685
  m("update:activeIndex", t);
1578
1686
  }, {
1579
1687
  enabled: A(d, "active"),
1580
1688
  onAssetError: d.reportAssetError ?? void 0,
1581
1689
  onAssetLoad: d.reportAssetLoad ?? void 0
1582
- }), C = T(typeof window > "u" ? mn : window.innerWidth || mn), w = i(() => It(g.activeItem.value?.type ?? "image")), N = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), P = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), F = i(() => P.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), L = i(() => {
1690
+ }), C = T(typeof window > "u" ? wn : window.innerWidth || wn), w = mt({
1691
+ active: A(d, "active"),
1692
+ resolvedActiveIndex: g.resolvedActiveIndex,
1693
+ viewer: g
1694
+ }), M = i(() => Ut(g.activeItem.value?.type ?? "image")), P = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), F = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), I = i(() => F.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), R = i(() => {
1583
1695
  let e = g.activeItem.value;
1584
1696
  return e ? {
1585
1697
  hasNextPage: d.hasNextPage,
@@ -1589,57 +1701,33 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1589
1701
  paginationDetail: d.paginationDetail,
1590
1702
  total: d.items.length
1591
1703
  } : null;
1592
- }), R = i(() => !L.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](L.value)), z = i(() => !L.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](L.value)), B = i(() => !d.showStatusBadges || !L.value || !g.statusKind.value || !g.statusMessage.value ? null : {
1593
- ...L.value,
1704
+ }), B = i(() => !R.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](R.value)), V = i(() => !R.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](R.value)), H = i(() => !d.showStatusBadges || !R.value || !g.statusKind.value || !g.statusMessage.value ? null : {
1705
+ ...R.value,
1594
1706
  kind: g.statusKind.value,
1595
1707
  message: g.statusMessage.value
1596
- }), V = i(() => !B.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](B.value)), H = i(() => ({
1597
- gridTemplateColumns: G.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
1708
+ }), U = i(() => !H.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](H.value)), W = i(() => ({
1709
+ gridTemplateColumns: q.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
1598
1710
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
1599
- })), U = i(() => Mt(R.value)), W = i(() => Mt(z.value)), G = i(() => W.value && C.value >= mn), K = i(() => W.value && !G.value), q = i(() => Mt(V.value));
1711
+ })), G = i(() => ht(B.value)), K = i(() => ht(V.value)), q = i(() => K.value && C.value >= wn), J = i(() => K.value && !q.value), Y = i(() => ht(U.value)), { emptyStateProps: X, showBadgeEmptyState: ee, showCustomEmptyState: te, showInlineEmptyState: ne } = vt({
1712
+ emptyStateMode: A(d, "emptyStateMode"),
1713
+ itemCount: i(() => d.items.length),
1714
+ loading: A(d, "loading"),
1715
+ renderSlot: p["empty-state"],
1716
+ surface: "fullscreen"
1717
+ });
1600
1718
  x(() => {
1601
- window.addEventListener("resize", le);
1719
+ window.addEventListener("resize", Z);
1602
1720
  }), b(() => {
1603
- window.removeEventListener("resize", le);
1721
+ window.removeEventListener("resize", Z);
1604
1722
  });
1605
- function J(e, t) {
1606
- let n = t.title?.trim();
1607
- return n ? `${e} ${n}` : `${e} ${jt(t.type).toLowerCase()}`;
1608
- }
1609
- function te(e, t) {
1610
- let n = Q(t);
1611
- return !X(e) || e !== g.resolvedActiveIndex.value || g.getAssetErrorKind(n) ? !1 : t.type === "image" ? !g.isImageReady(n) : t.type === "video" || t.type === "audio" ? !g.isMediaReady(n) : !1;
1612
- }
1613
- function Y(e) {
1614
- return g.getAssetErrorKind(Q(e));
1615
- }
1616
- function ne(e) {
1617
- return g.getAssetErrorLabel(Q(e)) ?? "Load error";
1618
- }
1619
- function se(e, t) {
1620
- return X(e) && e === g.resolvedActiveIndex.value && !!Y(t);
1621
- }
1622
- function X(e) {
1623
- let t = g.resolvedActiveIndex.value;
1624
- return d.active && e >= t && e <= t + hn;
1625
- }
1626
- function ce(e, t) {
1627
- return X(e) ? g.getImageSource(t) : void 0;
1628
- }
1629
- function Z(e, t) {
1630
- return X(e) ? t.url : void 0;
1631
- }
1632
- function Q(e) {
1633
- return $(e);
1634
- }
1635
- function le() {
1636
- C.value = window.innerWidth || mn;
1723
+ function Z() {
1724
+ C.value = window.innerWidth || wn;
1637
1725
  }
1638
- return (e, n) => (S(), s("div", Rt, [
1639
- c("div", { class: _(["absolute inset-0 transition-[background] duration-200", w.value]) }, null, 2),
1726
+ return (e, n) => (S(), s("div", Jt, [
1727
+ c("div", { class: _(["absolute inset-0 transition-[background] duration-200", M.value]) }, null, 2),
1640
1728
  c("div", {
1641
1729
  class: "relative z-[1] grid h-full min-h-0",
1642
- style: y(H.value)
1730
+ style: y(W.value)
1643
1731
  }, [c("div", {
1644
1732
  ref: "viewer.stageRef",
1645
1733
  "data-testid": "vibe-stage",
@@ -1649,148 +1737,148 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1649
1737
  onPointerup: n[3] ||= (...e) => j(g).onPointerUp && j(g).onPointerUp(...e),
1650
1738
  onPointercancel: n[4] ||= (...e) => j(g).onPointerCancel && j(g).onPointerCancel(...e),
1651
1739
  onWheel: n[5] ||= (...e) => j(g).onWheel && j(g).onWheel(...e)
1652
- }, [j(g).items.value.length > 0 ? (S(), s("div", zt, [
1740
+ }, [j(g).items.value.length > 0 ? (S(), s("div", Yt, [
1653
1741
  (S(!0), s(t, null, E(j(g).renderedItems.value, ({ item: r, index: i }) => (S(), s("article", {
1654
- key: Q(r),
1742
+ key: j(w).getItemKey(r),
1655
1743
  "data-testid": "vibe-slide",
1656
1744
  "data-item-id": r.id,
1657
- "data-occurrence-key": Q(r),
1745
+ "data-occurrence-key": j(w).getItemKey(r),
1658
1746
  "data-index": i,
1659
1747
  "data-active": i === j(g).resolvedActiveIndex.value,
1660
1748
  "aria-hidden": i === j(g).resolvedActiveIndex.value ? "false" : "true",
1661
1749
  class: _(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === j(g).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
1662
1750
  style: y(j(g).getSlideStyle(i))
1663
- }, [c("div", { class: _(["absolute inset-0 opacity-85", j(Lt)(r.type)]) }, null, 2), j(g).isVisual(r) ? (S(), s("div", {
1751
+ }, [c("div", { class: _(["absolute inset-0 opacity-85", j(Wt)(r.type)]) }, null, 2), j(g).isVisual(r) ? (S(), s("div", {
1664
1752
  key: 0,
1665
- class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? F.value : ""])
1666
- }, [te(i, r) ? (S(), s("div", Vt, [c("span", Ht, [u(j(re), {
1753
+ class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? I.value : ""])
1754
+ }, [j(w).isAssetLoading(i, r) ? (S(), s("div", Zt, [c("span", Qt, [u(j(re), {
1667
1755
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
1668
1756
  "aria-hidden": "true"
1669
- })])])) : o("", !0), se(i, r) ? (S(), s("div", {
1757
+ })])])) : o("", !0), j(w).isAssetErrored(i, r) ? (S(), s("div", {
1670
1758
  key: 1,
1671
1759
  "data-testid": "vibe-asset-error",
1672
- "data-kind": Y(r),
1760
+ "data-kind": j(w).getAssetErrorKind(r),
1673
1761
  class: "grid h-full w-full place-items-center"
1674
- }, [c("div", Wt, [
1762
+ }, [c("div", en, [
1675
1763
  u(j(oe), {
1676
1764
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
1677
1765
  "aria-hidden": "true"
1678
1766
  }),
1679
- c("p", Gt, k(ne(r)), 1),
1680
- j(g).canRetryAsset(Q(r)) ? (S(), s("button", {
1767
+ c("p", tn, k(j(w).getAssetErrorLabel(r)), 1),
1768
+ j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
1681
1769
  key: 0,
1682
1770
  type: "button",
1683
1771
  class: "inline-flex items-center justify-center border border-white/14 bg-black/35 px-4 py-2 text-[0.64rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
1684
- onClick: ee((e) => j(g).retryAsset(Q(r)), ["stop"])
1685
- }, " Retry ", 8, Kt)) : o("", !0)
1686
- ])], 8, Ut)) : r.type === "image" ? (S(), s("img", {
1687
- key: j(g).getAssetRenderKey(Q(r)),
1688
- src: ce(i, r),
1772
+ onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
1773
+ }, " Retry ", 8, nn)) : o("", !0)
1774
+ ])], 8, $t)) : r.type === "image" ? (S(), s("img", {
1775
+ key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1776
+ src: j(w).getFullscreenImageSource(i, r),
1689
1777
  alt: r.title ?? "",
1690
1778
  draggable: "false",
1691
- class: _(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isImageReady(Q(r)) ? "opacity-100" : "opacity-0"]),
1779
+ class: _(["block h-auto max-h-full w-auto max-w-full object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isImageReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
1692
1780
  ref_for: !0,
1693
- ref: (e) => j(g).registerImageElement(Q(r), e),
1694
- onLoad: (e) => j(g).onImageLoad(Q(r), r.url),
1695
- onError: (e) => j(g).onImageError(Q(r), r.url)
1696
- }, null, 42, qt)) : (S(), s("video", {
1697
- key: j(g).getAssetRenderKey(Q(r)),
1698
- class: _(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isMediaReady(Q(r)) ? "opacity-100" : "opacity-0"]),
1781
+ ref: (e) => j(g).registerImageElement(j(w).getItemKey(r), e),
1782
+ onLoad: (e) => j(g).onImageLoad(j(w).getItemKey(r), r.url),
1783
+ onError: (e) => j(g).onImageError(j(w).getItemKey(r), r.url)
1784
+ }, null, 42, rn)) : (S(), s("video", {
1785
+ key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1786
+ class: _(["block h-auto max-h-full w-auto max-w-full cursor-pointer object-contain shadow-[0_40px_120px_-60px_rgba(0,0,0,0.9)] transition-opacity duration-300", j(g).isMediaReady(j(w).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
1699
1787
  playsinline: "",
1700
1788
  muted: "",
1701
- src: Z(i, r),
1702
- preload: X(i) ? "metadata" : "none",
1789
+ src: j(w).getFullscreenMediaSource(i, r),
1790
+ preload: j(w).shouldPreloadSlideAsset(i) ? "metadata" : "none",
1703
1791
  ref_for: !0,
1704
- ref: (e) => j(g).registerVideoElement(Q(r), e),
1705
- onClick: ee((e) => j(g).onVideoClick(e, Q(r)), ["stop"]),
1706
- onCanplay: (e) => j(g).onMediaEvent(Q(r), e),
1707
- onDurationchange: (e) => j(g).onMediaEvent(Q(r), e),
1708
- onError: (e) => j(g).onMediaError(Q(r), r.url),
1709
- onLoadstart: (e) => j(g).onMediaEvent(Q(r), e),
1710
- onLoadedmetadata: (e) => j(g).onMediaEvent(Q(r), e),
1711
- onPause: (e) => j(g).onMediaEvent(Q(r), e),
1712
- onPlay: (e) => j(g).onMediaEvent(Q(r), e),
1713
- onPlaying: (e) => j(g).onMediaEvent(Q(r), e),
1714
- onSeeking: (e) => j(g).onMediaEvent(Q(r), e),
1715
- onSeeked: (e) => j(g).onMediaEvent(Q(r), e),
1716
- onStalled: (e) => j(g).onMediaEvent(Q(r), e),
1717
- onTimeupdate: (e) => j(g).onMediaEvent(Q(r), e),
1718
- onWaiting: (e) => j(g).onMediaEvent(Q(r), e)
1719
- }, null, 42, Jt))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
1792
+ ref: (e) => j(g).registerVideoElement(j(w).getItemKey(r), e),
1793
+ onClick: z((e) => j(g).onVideoClick(e, j(w).getItemKey(r)), ["stop"]),
1794
+ onCanplay: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1795
+ onDurationchange: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1796
+ onError: (e) => j(g).onMediaError(j(w).getItemKey(r), r.url),
1797
+ onLoadstart: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1798
+ onLoadedmetadata: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1799
+ onPause: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1800
+ onPlay: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1801
+ onPlaying: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1802
+ onSeeking: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1803
+ onSeeked: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1804
+ onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1805
+ onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1806
+ onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
1807
+ }, null, 42, an))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
1720
1808
  key: 1,
1721
- class: _(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === j(g).resolvedActiveIndex.value ? F.value : ""])
1722
- }, [c("div", Yt, [
1809
+ class: _(["relative z-[1] grid w-full max-w-[1100px] justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center", i === j(g).resolvedActiveIndex.value ? I.value : ""])
1810
+ }, [c("div", on, [
1723
1811
  c("button", {
1724
1812
  type: "button",
1725
1813
  class: "relative grid h-full w-full place-items-center border border-white/12 bg-[linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02)),radial-gradient(circle_at_center,rgba(16,185,129,0.14),transparent_58%)] text-[#f7f1ea] transition-[border-color,background] duration-200 hover:border-white/30 hover:bg-[linear-gradient(180deg,rgba(255,255,255,0.07),rgba(255,255,255,0.03)),radial-gradient(circle_at_center,rgba(16,185,129,0.18),transparent_58%)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
1726
- "aria-label": j(g).mediaStates.value[Q(r)]?.paused ?? !0 ? J("Play", r) : J("Pause", r),
1727
- disabled: !!Y(r),
1728
- onClick: (e) => j(g).onAudioCoverClick(e, Q(r))
1814
+ "aria-label": j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(w).getMediaActionLabel("Play", r) : j(w).getMediaActionLabel("Pause", r),
1815
+ disabled: !!j(w).getAssetErrorKind(r),
1816
+ onClick: (e) => j(g).onAudioCoverClick(e, j(w).getItemKey(r))
1729
1817
  }, [
1730
1818
  n[6] ||= c("span", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(16,185,129,0.16),transparent_66%)]" }, null, -1),
1731
1819
  n[7] ||= c("span", { class: "pointer-events-none absolute h-[clamp(220px,30vw,360px)] w-[clamp(220px,30vw,360px)] border border-white/8 bg-[radial-gradient(circle,rgba(255,255,255,0.08),transparent_62%)]" }, null, -1),
1732
- c("span", Zt, [D(e.$slots, "item-icon", {
1733
- icon: j(At)(r.type),
1820
+ c("span", cn, [D(e.$slots, "item-icon", {
1821
+ icon: j(dt)(r.type),
1734
1822
  item: r
1735
- }, () => [(S(), a(O(j(At)(r.type)), {
1823
+ }, () => [(S(), a(O(j(dt)(r.type)), {
1736
1824
  class: "h-6 w-6 stroke-[1.9]",
1737
1825
  "aria-hidden": "true"
1738
1826
  }))])]),
1739
- c("span", Qt, [(S(), a(O(j(g).mediaStates.value[Q(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
1827
+ c("span", ln, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
1740
1828
  class: "h-4 w-4 stroke-2",
1741
1829
  "aria-hidden": "true"
1742
1830
  }))])
1743
- ], 8, Xt),
1744
- te(i, r) ? (S(), s("div", $t, [c("span", en, [u(j(re), {
1831
+ ], 8, sn),
1832
+ j(w).isAssetLoading(i, r) ? (S(), s("div", un, [c("span", dn, [u(j(re), {
1745
1833
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
1746
1834
  "aria-hidden": "true"
1747
1835
  })])])) : o("", !0),
1748
- Y(r) ? (S(), s(t, { key: 1 }, [n[8] ||= c("div", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(239,68,68,0.12),transparent_66%)]" }, null, -1), c("div", {
1836
+ j(w).getAssetErrorKind(r) ? (S(), s(t, { key: 1 }, [n[8] ||= c("div", { class: "pointer-events-none absolute inset-0 border border-white/8 bg-[radial-gradient(circle,rgba(239,68,68,0.12),transparent_66%)]" }, null, -1), c("div", {
1749
1837
  "data-testid": "vibe-asset-error",
1750
- "data-kind": Y(r),
1838
+ "data-kind": j(w).getAssetErrorKind(r),
1751
1839
  class: "relative z-[1] grid justify-items-center gap-4"
1752
1840
  }, [
1753
1841
  u(j(oe), {
1754
1842
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
1755
1843
  "aria-hidden": "true"
1756
1844
  }),
1757
- c("p", nn, k(ne(r)), 1),
1758
- j(g).canRetryAsset(Q(r)) ? (S(), s("button", {
1845
+ c("p", pn, k(j(w).getAssetErrorLabel(r)), 1),
1846
+ j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
1759
1847
  key: 0,
1760
1848
  type: "button",
1761
1849
  class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-4 py-2 text-[0.64rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
1762
- onClick: ee((e) => j(g).retryAsset(Q(r)), ["stop"])
1763
- }, " Retry ", 8, rn)) : o("", !0)
1764
- ], 8, tn)], 64)) : o("", !0)
1850
+ onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
1851
+ }, " Retry ", 8, mn)) : o("", !0)
1852
+ ], 8, fn)], 64)) : o("", !0)
1765
1853
  ]), (S(), s("audio", {
1766
- key: j(g).getAssetRenderKey(Q(r)),
1767
- src: Z(i, r),
1768
- preload: X(i) ? "metadata" : "none",
1854
+ key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
1855
+ src: j(w).getFullscreenMediaSource(i, r),
1856
+ preload: j(w).shouldPreloadSlideAsset(i) ? "metadata" : "none",
1769
1857
  class: "pointer-events-none absolute h-px w-px opacity-0",
1770
1858
  ref_for: !0,
1771
- ref: (e) => j(g).registerAudioElement(Q(r), e),
1772
- onCanplay: (e) => j(g).onMediaEvent(Q(r), e),
1773
- onDurationchange: (e) => j(g).onMediaEvent(Q(r), e),
1774
- onError: (e) => j(g).onMediaError(Q(r), r.url),
1775
- onLoadstart: (e) => j(g).onMediaEvent(Q(r), e),
1776
- onLoadedmetadata: (e) => j(g).onMediaEvent(Q(r), e),
1777
- onPause: (e) => j(g).onMediaEvent(Q(r), e),
1778
- onPlay: (e) => j(g).onMediaEvent(Q(r), e),
1779
- onPlaying: (e) => j(g).onMediaEvent(Q(r), e),
1780
- onSeeking: (e) => j(g).onMediaEvent(Q(r), e),
1781
- onSeeked: (e) => j(g).onMediaEvent(Q(r), e),
1782
- onStalled: (e) => j(g).onMediaEvent(Q(r), e),
1783
- onTimeupdate: (e) => j(g).onMediaEvent(Q(r), e),
1784
- onWaiting: (e) => j(g).onMediaEvent(Q(r), e)
1785
- }, null, 40, an))], 2)) : (S(), s("div", on, [c("div", sn, [D(e.$slots, "item-icon", {
1786
- icon: j(At)(r.type),
1859
+ ref: (e) => j(g).registerAudioElement(j(w).getItemKey(r), e),
1860
+ onCanplay: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1861
+ onDurationchange: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1862
+ onError: (e) => j(g).onMediaError(j(w).getItemKey(r), r.url),
1863
+ onLoadstart: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1864
+ onLoadedmetadata: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1865
+ onPause: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1866
+ onPlay: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1867
+ onPlaying: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1868
+ onSeeking: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1869
+ onSeeked: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1870
+ onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1871
+ onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
1872
+ onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
1873
+ }, null, 40, hn))], 2)) : (S(), s("div", gn, [c("div", _n, [D(e.$slots, "item-icon", {
1874
+ icon: j(dt)(r.type),
1787
1875
  item: r
1788
- }, () => [(S(), a(O(j(At)(r.type)), {
1876
+ }, () => [(S(), a(O(j(dt)(r.type)), {
1789
1877
  class: "h-6 w-6 stroke-[1.9]",
1790
1878
  "aria-hidden": "true"
1791
- }))])])]))], 14, Bt))), 128)),
1792
- L.value && p["fullscreen-overlay"] ? (S(), s("div", cn, [c("div", ln, [D(e.$slots, "fullscreen-overlay", v(f(L.value)))])])) : o("", !0),
1793
- j(g).activeItem.value ? (S(), a(at, {
1879
+ }))])])]))], 14, Xt))), 128)),
1880
+ R.value && p["fullscreen-overlay"] ? (S(), s("div", vn, [c("div", yn, [D(e.$slots, "fullscreen-overlay", v(f(R.value)))])])) : o("", !0),
1881
+ j(g).activeItem.value ? (S(), a(ct, {
1794
1882
  key: 1,
1795
1883
  "current-index": j(g).resolvedActiveIndex.value,
1796
1884
  "pagination-detail": j(g).paginationDetail.value,
@@ -1799,9 +1887,9 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1799
1887
  title: j(g).activeItem.value.title ?? null,
1800
1888
  total: j(g).items.value.length,
1801
1889
  onBackToList: n[0] ||= (e) => m("back-to-list")
1802
- }, l({ _: 2 }, [U.value && L.value ? {
1890
+ }, l({ _: 2 }, [G.value && R.value ? {
1803
1891
  name: "actions",
1804
- fn: I(() => [D(e.$slots, "fullscreen-header-actions", v(f(L.value)))]),
1892
+ fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(R.value)))]),
1805
1893
  key: "0"
1806
1894
  } : void 0]), 1032, [
1807
1895
  "current-index",
@@ -1811,7 +1899,7 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1811
1899
  "title",
1812
1900
  "total"
1813
1901
  ])) : o("", !0),
1814
- P.value ? (S(), a(Je, {
1902
+ F.value ? (S(), a(Ze, {
1815
1903
  key: 2,
1816
1904
  "current-time": j(g).activeMediaState.value.currentTime,
1817
1905
  "current-time-label": j(g).formatPlaybackTime(j(g).activeMediaState.value.currentTime),
@@ -1827,14 +1915,38 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1827
1915
  "progress",
1828
1916
  "onSeekInput"
1829
1917
  ])) : o("", !0),
1830
- B.value ? (S(), s("div", {
1918
+ H.value ? (S(), s("div", {
1831
1919
  key: 3,
1832
- class: _(["absolute left-1/2 z-[4] -translate-x-1/2", N.value])
1833
- }, [q.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, B.value))) : (S(), s("div", {
1920
+ class: _(["absolute left-1/2 z-[4] -translate-x-1/2", P.value])
1921
+ }, [Y.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, H.value))) : (S(), s("div", {
1834
1922
  key: 1,
1835
1923
  "data-testid": "vibe-fullscreen-status-badge",
1836
- class: _(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", B.value.kind === "end" ? "border-amber-300/35 text-amber-200" : B.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
1837
- }, k(B.value.message), 3))], 2)) : o("", !0)
1924
+ class: _(["inline-flex w-auto items-center border border-white/14 bg-black/40 px-5 py-3 text-[0.75rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74 backdrop-blur-[18px] max-[720px]:w-[calc(100%-2.5rem)] max-[720px]:justify-center", H.value.kind === "end" ? "border-amber-300/35 text-amber-200" : H.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
1925
+ }, k(H.value.message), 3))], 2)) : o("", !0)
1926
+ ])) : j(ne) && j(X) ? (S(), a(qt, {
1927
+ key: 1,
1928
+ message: j(X).message,
1929
+ mode: j(X).mode,
1930
+ surface: j(X).surface
1931
+ }, {
1932
+ default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(X)))) : o("", !0)]),
1933
+ _: 3
1934
+ }, 8, [
1935
+ "message",
1936
+ "mode",
1937
+ "surface"
1938
+ ])) : o("", !0), j(ee) && j(X) ? (S(), a(qt, {
1939
+ key: 2,
1940
+ message: j(X).message,
1941
+ mode: j(X).mode,
1942
+ surface: j(X).surface
1943
+ }, {
1944
+ default: L(() => [j(te) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(X)))) : o("", !0)]),
1945
+ _: 3
1946
+ }, 8, [
1947
+ "message",
1948
+ "mode",
1949
+ "surface"
1838
1950
  ])) : o("", !0)], 544), u(r, {
1839
1951
  "enter-active-class": "transform-gpu transition-all duration-320 ease-out",
1840
1952
  "enter-from-class": "translate-x-full opacity-0",
@@ -1843,7 +1955,7 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1843
1955
  "leave-from-class": "translate-x-0 opacity-100",
1844
1956
  "leave-to-class": "translate-x-full opacity-0"
1845
1957
  }, {
1846
- default: I(() => [G.value && L.value ? (S(), s("aside", un, [c("div", dn, [D(e.$slots, "fullscreen-aside", v(f(L.value)))])])) : o("", !0)]),
1958
+ default: L(() => [q.value && R.value ? (S(), s("aside", bn, [c("div", xn, [D(e.$slots, "fullscreen-aside", v(f(R.value)))])])) : o("", !0)]),
1847
1959
  _: 3
1848
1960
  })], 4),
1849
1961
  u(r, {
@@ -1854,29 +1966,29 @@ var Rt = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f
1854
1966
  "leave-from-class": "translate-x-0 opacity-100",
1855
1967
  "leave-to-class": "translate-x-full opacity-0"
1856
1968
  }, {
1857
- default: I(() => [K.value && L.value ? (S(), s("aside", fn, [c("div", pn, [D(e.$slots, "fullscreen-aside", v(f(L.value)))])])) : o("", !0)]),
1969
+ default: L(() => [J.value && R.value ? (S(), s("aside", Sn, [c("div", Cn, [D(e.$slots, "fullscreen-aside", v(f(R.value)))])])) : o("", !0)]),
1858
1970
  _: 3
1859
1971
  })
1860
1972
  ]));
1861
1973
  }
1862
- }), _n = 1, vn = .5;
1863
- function yn(e) {
1974
+ }), En = 1, Dn = .5;
1975
+ function On(e) {
1864
1976
  if (e.type !== "image" && e.type !== "video") return {
1865
- width: _n,
1866
- height: _n,
1977
+ width: En,
1978
+ height: En,
1867
1979
  source: "fallback"
1868
1980
  };
1869
1981
  let t = e.preview?.width, n = e.preview?.height;
1870
- if (En(t) && En(n)) {
1871
- let r = Dn(e, t, n);
1982
+ if (Fn(t) && Fn(n)) {
1983
+ let r = In(e, t, n);
1872
1984
  return {
1873
1985
  width: r.width,
1874
1986
  height: r.height,
1875
1987
  source: "preview"
1876
1988
  };
1877
1989
  }
1878
- if (En(e.width) && En(e.height)) {
1879
- let t = Dn(e, e.width, e.height);
1990
+ if (Fn(e.width) && Fn(e.height)) {
1991
+ let t = In(e, e.width, e.height);
1880
1992
  return {
1881
1993
  width: t.width,
1882
1994
  height: t.height,
@@ -1884,31 +1996,31 @@ function yn(e) {
1884
1996
  };
1885
1997
  }
1886
1998
  return {
1887
- width: _n,
1888
- height: _n,
1999
+ width: En,
2000
+ height: En,
1889
2001
  source: "fallback"
1890
2002
  };
1891
2003
  }
1892
- function bn(e, t) {
2004
+ function kn(e, t) {
1893
2005
  return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
1894
2006
  }
1895
- function xn(e, t, n, r = 0) {
2007
+ function An(e, t, n, r = 0) {
1896
2008
  if (!e || e <= 0 || !t || t <= 0) return n;
1897
2009
  let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
1898
2010
  return !a || a <= 0 ? n : a / t;
1899
2011
  }
1900
- function Sn(e, t) {
1901
- let n = yn(e);
2012
+ function jn(e, t) {
2013
+ let n = On(e);
1902
2014
  return n.height / n.width * t;
1903
2015
  }
1904
- function Cn(e, t) {
2016
+ function Mn(e, t) {
1905
2017
  let n = Array.from({ length: t.columnCount }, () => 0), r = Array(e.length), i = Array(e.length), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = 0;
1906
2018
  for (let c = 0; c < e.length; c += 1) {
1907
2019
  let l = e[c];
1908
2020
  o.set($(l), c);
1909
2021
  let u = 0;
1910
2022
  for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
1911
- let d = u * (t.columnWidth + t.gapX), f = n[u], p = Sn(l, t.columnWidth);
2023
+ let d = u * (t.columnWidth + t.gapX), f = n[u], p = jn(l, t.columnWidth);
1912
2024
  r[c] = {
1913
2025
  x: d,
1914
2026
  y: f
@@ -1927,7 +2039,7 @@ function Cn(e, t) {
1927
2039
  indexById: o
1928
2040
  };
1929
2041
  }
1930
- function wn(e) {
2042
+ function Nn(e) {
1931
2043
  if (e.itemCount <= 0) return [];
1932
2044
  if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
1933
2045
  let t = Math.max(0, e.scrollTop - e.overscanPx), n = e.scrollTop + e.viewportHeight + e.overscanPx, r = Math.floor(t / e.bucketPx), i = Math.floor(n / e.bucketPx), a = /* @__PURE__ */ new Set();
@@ -1937,7 +2049,7 @@ function wn(e) {
1937
2049
  }
1938
2050
  return Array.from(a).sort((e, t) => e - t);
1939
2051
  }
1940
- function Tn(e, t, n) {
2052
+ function Pn(e, t, n) {
1941
2053
  let r = /* @__PURE__ */ new Map();
1942
2054
  for (let i of e) {
1943
2055
  let e = t.get($(i));
@@ -1947,11 +2059,11 @@ function Tn(e, t, n) {
1947
2059
  }
1948
2060
  return r;
1949
2061
  }
1950
- function En(e) {
2062
+ function Fn(e) {
1951
2063
  return typeof e == "number" && Number.isFinite(e) && e > 0;
1952
2064
  }
1953
- function Dn(e, t, n) {
1954
- return e.type !== "image" || n / t >= vn ? {
2065
+ function In(e, t, n) {
2066
+ return e.type !== "image" || n / t >= Dn ? {
1955
2067
  width: t,
1956
2068
  height: n
1957
2069
  } : {
@@ -1961,149 +2073,193 @@ function Dn(e, t, n) {
1961
2073
  }
1962
2074
  //#endregion
1963
2075
  //#region src/components/viewer-core/useMasonryMotion.ts
1964
- var On = 300, kn = 600, An = 40, jn = 400;
1965
- function Mn(e, t) {
2076
+ var Ln = 300, Rn = 600, zn = 40, Bn = 300, Vn = 400;
2077
+ function Hn(e, t) {
1966
2078
  return t === "top" ? [...e].reverse() : e;
1967
2079
  }
1968
- function Nn(e) {
1969
- return e <= 0 ? kn : kn + Math.min((e - 1) * An, jn);
2080
+ function Un(e) {
2081
+ return e <= 0 ? Rn : Rn + Math.min((e - 1) * zn, Vn);
2082
+ }
2083
+ function Wn() {
2084
+ return Bn;
1970
2085
  }
1971
- function Pn(e) {
2086
+ function Gn(e) {
1972
2087
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
1973
2088
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
1974
2089
  }
1975
- function Fn(e) {
1976
- let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), i = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
1977
- P(e.visibleIndices, (a) => {
1978
- if (!a.length) return;
2090
+ function Kn(e) {
2091
+ let t = T(/* @__PURE__ */ new Set()), n = T(/* @__PURE__ */ new Set()), r = T(/* @__PURE__ */ new Map()), a = T(/* @__PURE__ */ new Map()), o = T(/* @__PURE__ */ new Map()), s = T(/* @__PURE__ */ new Set()), c = T(/* @__PURE__ */ new Map()), l = T(/* @__PURE__ */ new Map()), u = T(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
2092
+ F(e.visibleIndices, (i) => {
2093
+ if (!i.length) return;
1979
2094
  let o = [];
1980
- for (let n of a) {
2095
+ for (let n of i) {
1981
2096
  let r = e.items.value[n] ? $(e.items.value[n]) : null;
1982
- !r || !t.value.has(r) || c.has(r) || (c.add(r), o.push(r));
2097
+ !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
1983
2098
  }
1984
2099
  if (!o.length) return;
1985
- let s = Mn(o, i.value.get(o[0]) ?? "bottom"), l = new Map(r.value);
1986
- for (let e = 0; e < s.length; e += 1) l.set(s[e], Math.min(e * An, jn));
1987
- r.value = l, In(() => {
2100
+ let s = Hn(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2101
+ for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * zn, Vn));
2102
+ r.value = c, qn(() => {
1988
2103
  let e = new Set(n.value);
1989
2104
  for (let t of o) e.add(t);
1990
2105
  n.value = e;
1991
- }), Ln(() => {
2106
+ }), Jn(() => {
1992
2107
  let e = new Set(t.value);
1993
2108
  for (let t of o) e.delete(t);
1994
- t.value = e, h(() => {
1995
- let e = new Set(n.value), t = new Map(r.value), a = new Map(i.value);
1996
- for (let n of o) e.delete(n), t.delete(n), a.delete(n), c.delete(n);
1997
- n.value = e, r.value = t, i.value = a;
1998
- }, Nn(o.length));
2109
+ t.value = e, S(() => {
2110
+ let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
2111
+ for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
2112
+ n.value = e, r.value = t, a.value = i;
2113
+ }, Un(o.length));
1999
2114
  });
2000
- }, { flush: "post" }), b(() => {
2001
- for (let e of l) clearTimeout(e);
2002
- l.clear();
2115
+ }, { flush: "post" }), F(() => e.items.value.map((e) => $(e)), (e) => {
2116
+ if (!e.length || !o.value.size) return;
2117
+ let t = new Set(e), n = null, r = null;
2118
+ for (let e of o.value.keys()) t.has(e) && (n ||= new Map(o.value), r ||= new Set(s.value), n.delete(e), r.delete(e));
2119
+ n && (o.value = n), r && (s.value = r);
2120
+ }), b(() => {
2121
+ for (let e of f) clearTimeout(e);
2122
+ f.clear();
2003
2123
  });
2004
- function u(e, n = "bottom") {
2124
+ function m(e, n = "bottom") {
2005
2125
  if (!e.length) return;
2006
- let r = new Set(t.value), a = new Map(i.value);
2126
+ let r = new Set(t.value), i = new Map(a.value);
2007
2127
  for (let t of e) {
2008
2128
  let e = $(t);
2009
- r.add(e), a.set(e, n);
2129
+ r.add(e), i.set(e, n);
2010
2130
  }
2011
- t.value = r, i.value = a;
2131
+ t.value = r, a.value = i;
2012
2132
  }
2013
- function d(t, n, r = On) {
2133
+ function h(e) {
2134
+ if (!e.length) return;
2135
+ let i = new Map(o.value), c = new Set(t.value), l = new Set(n.value), u = new Map(r.value), f = new Map(a.value), p = [];
2136
+ for (let t of e) {
2137
+ let e = $(t.item);
2138
+ p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
2139
+ }
2140
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, qn(() => {
2141
+ let e = new Set(s.value);
2142
+ for (let t of p) e.add(t);
2143
+ s.value = e;
2144
+ }), S(() => {
2145
+ let e = new Map(o.value), t = new Set(s.value);
2146
+ for (let n of p) e.delete(n), t.delete(n);
2147
+ o.value = e, s.value = t;
2148
+ }, Bn);
2149
+ }
2150
+ function g(t, n, r = Ln) {
2014
2151
  if (!t.size) return;
2015
- let i = /* @__PURE__ */ new Map(), c = [];
2016
- for (let [r, a] of t.entries()) {
2152
+ let i = /* @__PURE__ */ new Map(), a = [];
2153
+ for (let [r, o] of t.entries()) {
2017
2154
  if (n?.has(r)) continue;
2018
2155
  let t = e.indexById.value.get(r);
2019
2156
  if (t == null) continue;
2020
- let o = e.positions.value[t];
2021
- if (!o) continue;
2022
- let s = a.x - o.x, l = a.y - o.y;
2023
- !s && !l || (i.set(r, {
2024
- dx: s,
2157
+ let s = e.positions.value[t];
2158
+ if (!s) continue;
2159
+ let c = o.x - s.x, l = o.y - s.y;
2160
+ !c && !l || (i.set(r, {
2161
+ dx: c,
2025
2162
  dy: l
2026
- }), c.push(r));
2163
+ }), a.push(r));
2027
2164
  }
2028
2165
  if (!i.size) return;
2029
- a.value = i, s.value = /* @__PURE__ */ new Set();
2030
- let l = new Map(o.value);
2031
- for (let e of c) l.set(e, r);
2032
- o.value = l, In(() => {
2033
- s.value = new Set(c), In(() => {
2034
- a.value = /* @__PURE__ */ new Map();
2166
+ c.value = i, u.value = /* @__PURE__ */ new Set();
2167
+ let o = new Map(l.value);
2168
+ for (let e of a) o.set(e, r);
2169
+ l.value = o, qn(() => {
2170
+ u.value = new Set(a), qn(() => {
2171
+ c.value = /* @__PURE__ */ new Map();
2035
2172
  });
2036
- }), h(() => {
2037
- s.value = /* @__PURE__ */ new Set();
2038
- let e = new Map(o.value);
2039
- for (let t of c) e.delete(t);
2040
- o.value = e;
2173
+ }), S(() => {
2174
+ u.value = /* @__PURE__ */ new Set();
2175
+ let e = new Map(l.value);
2176
+ for (let t of a) e.delete(t);
2177
+ l.value = e;
2041
2178
  }, r);
2042
2179
  }
2043
- function f(e) {
2044
- if (n.value.has(e)) return `transform ${kn}ms ease-out`;
2045
- if (s.value.has(e)) return `transform ${o.value.get(e) ?? On}ms ease-out`;
2180
+ function _(e) {
2181
+ if (n.value.has(e)) return `transform ${Rn}ms ease-out`;
2182
+ if (u.value.has(e)) return `transform ${l.value.get(e) ?? Ln}ms ease-out`;
2046
2183
  }
2047
- function p(e) {
2184
+ function v(e) {
2048
2185
  if (!n.value.has(e)) return;
2049
2186
  let t = r.value.get(e) ?? 0;
2050
2187
  return t > 0 ? `${t}ms` : void 0;
2051
2188
  }
2052
- function m(n) {
2053
- let r = e.items.value[n], o = e.positions.value[n] ?? {
2189
+ function y(n) {
2190
+ let r = e.items.value[n], i = e.positions.value[n] ?? {
2054
2191
  x: 0,
2055
2192
  y: 0
2056
- }, s = e.heights.value[n] ?? e.columnWidth.value, c = r ? $(r) : null, l = c ? a.value.get(c) ?? {
2193
+ }, o = e.heights.value[n] ?? e.columnWidth.value, s = r ? $(r) : null, l = s ? c.value.get(s) ?? {
2057
2194
  dx: 0,
2058
2195
  dy: 0
2059
2196
  } : {
2060
2197
  dx: 0,
2061
2198
  dy: 0
2062
- }, u = c ? i.value.get(c) ?? "bottom" : "bottom", d = c && t.value.has(c) ? Pn({
2199
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? Gn({
2063
2200
  columnWidth: e.columnWidth.value,
2064
2201
  direction: u,
2065
- itemHeight: s,
2202
+ itemHeight: o,
2066
2203
  scrollTop: e.scrollTop.value,
2067
2204
  viewportHeight: e.viewportHeight.value
2068
- }) : o.y;
2069
- return `translate3d(${o.x + l.dx}px, ${d + l.dy}px, 0)`;
2205
+ }) : i.y;
2206
+ return `translate3d(${i.x + l.dx}px, ${d + l.dy}px, 0)`;
2070
2207
  }
2071
- function h(e, t) {
2208
+ function x(t) {
2209
+ let n = $(t), r = o.value.get(n);
2210
+ if (!r) return {
2211
+ opacity: "0",
2212
+ transform: "translate3d(0, 0, 0) scale(0.96)",
2213
+ transition: `opacity ${Bn}ms ease-out, transform ${Bn}ms ease-out`
2214
+ };
2215
+ let i = s.value.has(n);
2216
+ return {
2217
+ height: `${r.height}px`,
2218
+ opacity: i ? "0" : "1",
2219
+ transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
2220
+ transition: `opacity ${Bn}ms ease-out, transform ${Bn}ms ease-out`,
2221
+ width: `${e.columnWidth.value}px`
2222
+ };
2223
+ }
2224
+ function S(e, t) {
2072
2225
  let n = setTimeout(() => {
2073
- l.delete(n), e();
2226
+ f.delete(n), e();
2074
2227
  }, t);
2075
- l.add(n);
2228
+ f.add(n);
2076
2229
  }
2077
2230
  return {
2078
- getCardTransform: m,
2079
- getCardTransition: f,
2080
- getCardTransitionDelay: p,
2081
- markEnter: u,
2082
- playFlipMoveAnimation: d
2231
+ getCardTransform: y,
2232
+ getCardTransition: _,
2233
+ getCardTransitionDelay: v,
2234
+ getLeavingCardStyle: x,
2235
+ leavingItems: p,
2236
+ markEnter: m,
2237
+ markLeave: h,
2238
+ playFlipMoveAnimation: g
2083
2239
  };
2084
2240
  }
2085
- function In(e) {
2241
+ function qn(e) {
2086
2242
  if (typeof requestAnimationFrame == "function") {
2087
2243
  requestAnimationFrame(() => e());
2088
2244
  return;
2089
2245
  }
2090
2246
  setTimeout(e, 0);
2091
2247
  }
2092
- function Ln(e) {
2093
- In(() => In(e));
2248
+ function Jn(e) {
2249
+ qn(() => qn(e));
2094
2250
  }
2095
2251
  //#endregion
2096
2252
  //#region src/components/viewer-core/masonryViewport.ts
2097
- function Rn(e, t) {
2253
+ function Yn(e, t) {
2098
2254
  return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
2099
2255
  }
2100
- function zn(e, t, n) {
2256
+ function Xn(e, t, n) {
2101
2257
  return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
2102
2258
  }
2103
- function Bn(e, t, n, r) {
2259
+ function Zn(e, t, n, r) {
2104
2260
  return (e?.scrollHeight ?? r) - (t + n);
2105
2261
  }
2106
- function Vn(e, t) {
2262
+ function Qn(e, t) {
2107
2263
  return {
2108
2264
  height: `${e}px`,
2109
2265
  transform: `translate3d(0, ${t}px, 0)`
@@ -2111,8 +2267,8 @@ function Vn(e, t) {
2111
2267
  }
2112
2268
  //#endregion
2113
2269
  //#region src/components/viewer-core/useEdgeBoundary.ts
2114
- var Hn = 250, Un = 1e3;
2115
- function Wn(e) {
2270
+ var $n = 250, er = 1e3;
2271
+ function tr(e) {
2116
2272
  let t = T(!1), n = T(!1), r = T(0), i = T(0), a = T(!1), o = T(!1), s = 0, c = null;
2117
2273
  b(() => {
2118
2274
  y();
@@ -2128,7 +2284,7 @@ function Wn(e) {
2128
2284
  function u(t) {
2129
2285
  if (!x(t) || !e.isAtBoundary()) return;
2130
2286
  let n = Date.now();
2131
- n < s || (s = n + Hn, m());
2287
+ n < s || (s = n + $n, m());
2132
2288
  }
2133
2289
  function d() {
2134
2290
  if (!g()) return;
@@ -2156,13 +2312,13 @@ function Wn(e) {
2156
2312
  h() && (r.value += 1);
2157
2313
  }
2158
2314
  function h() {
2159
- return e.hasPage.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2315
+ return e.hasPage.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2160
2316
  }
2161
2317
  function g() {
2162
- return e.hasPage.value && t.value && r.value > i.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2318
+ return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2163
2319
  }
2164
2320
  function _() {
2165
- o.value = !1, v(Un);
2321
+ o.value = !1, v(er);
2166
2322
  }
2167
2323
  function v(e) {
2168
2324
  y(), a.value = !0, c = setTimeout(() => {
@@ -2185,76 +2341,87 @@ function Wn(e) {
2185
2341
  }
2186
2342
  //#endregion
2187
2343
  //#region src/components/viewer-core/useMasonryList.ts
2188
- var Gn = 600, Kn = 24, qn = 16, Jn = 300, Yn = 200, Xn = 200, Zn = 200, Qn = 300, $n = 24, er = 48, tr = 500, nr = 1e3;
2189
- function rr(e) {
2190
- let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || Jn), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = i(() => Math.max(Jn, a.value - Kn * 2)), m = i(() => bn(p.value, Jn)), h = i(() => xn(p.value, m.value, Jn, qn)), _ = i(() => ir(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), v = i(() => wn({
2344
+ var nr = 600, rr = 24, ir = 16, ar = 300, or = 200, sr = 200, cr = 200, lr = 300, ur = 24, dr = 48, fr = 500, pr = 1e3;
2345
+ function mr(e) {
2346
+ let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || ar), o = T([]), s = T([]), c = T(/* @__PURE__ */ new Map()), l = T(0), u = T(/* @__PURE__ */ new Map()), d = T(null), f = T(null), p = T(!1), m = i(() => Math.max(ar, a.value - rr * 2)), h = i(() => kn(m.value, ar)), _ = i(() => An(m.value, h.value, ar, ir)), v = i(() => hr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => Nn({
2191
2347
  itemCount: e.items.value.length,
2192
2348
  viewportHeight: r.value,
2193
2349
  scrollTop: n.value,
2194
- overscanPx: Yn,
2195
- bucketPx: Gn,
2350
+ overscanPx: or,
2351
+ bucketPx: nr,
2196
2352
  buckets: c.value
2197
- })), y = i(() => v.value.map((t) => ({
2353
+ })), S = i(() => y.value.map((t) => ({
2198
2354
  item: e.items.value[t],
2199
2355
  index: t
2200
- }))), S = i(() => {
2201
- let e = l.value + Kn * 2, t = d.value ?? 0;
2202
- return Math.max(e, t, r.value) + Zn;
2203
- }), C = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), w = i(() => `${_.value + 1} / ${e.items.value.length}`), E = i(() => Math.max(0, r.value - $n * 2)), D = i(() => S.value > r.value + 1 && E.value > 0), O = i(() => {
2204
- if (!D.value) return 0;
2205
- let e = r.value / S.value * E.value;
2206
- return Math.min(E.value, Math.max(er, e));
2207
- }), k = i(() => {
2208
- if (!D.value) return $n;
2209
- let e = Math.max(0, S.value - r.value);
2210
- return $n + Math.max(0, E.value - O.value) * (e > 0 ? ir(n.value / e, 0, 1) : 0);
2211
- }), A = Fn({
2356
+ }))), C = i(() => {
2357
+ let e = l.value + rr * 2, t = d.value ?? 0;
2358
+ return Math.max(e, t, r.value) + cr;
2359
+ }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), D = i(() => Math.max(0, r.value - ur * 2)), O = i(() => C.value > r.value + 1 && D.value > 0), k = i(() => {
2360
+ if (!O.value) return 0;
2361
+ let e = r.value / C.value * D.value;
2362
+ return Math.min(D.value, Math.max(dr, e));
2363
+ }), A = i(() => {
2364
+ if (!O.value) return ur;
2365
+ let e = Math.max(0, C.value - r.value);
2366
+ return ur + Math.max(0, D.value - k.value) * (e > 0 ? hr(n.value / e, 0, 1) : 0);
2367
+ }), j = Kn({
2212
2368
  items: e.items,
2213
- visibleIndices: v,
2369
+ visibleIndices: y,
2214
2370
  positions: o,
2215
2371
  heights: s,
2216
2372
  indexById: u,
2217
- columnWidth: h,
2373
+ columnWidth: _,
2218
2374
  scrollTop: n,
2219
2375
  viewportHeight: r
2220
- }), j = Wn({
2376
+ }), M = tr({
2221
2377
  direction: "top",
2222
2378
  getAnimationLockMs(e) {
2223
- return Math.max(tr, Nn(e)) + nr;
2379
+ return Math.max(fr, Un(e)) + pr;
2224
2380
  },
2225
2381
  hasPage: e.hasPreviousPage,
2382
+ interactionLocked: p,
2226
2383
  isAtBoundary() {
2227
- return n.value <= Kn + qn;
2384
+ return n.value <= rr + ir;
2228
2385
  },
2229
2386
  loading: e.loading,
2230
2387
  requestPage: e.requestPreviousPage
2231
- }), M = Wn({
2388
+ }), N = tr({
2232
2389
  direction: "bottom",
2233
2390
  getAnimationLockMs(e) {
2234
- return Nn(e) + nr;
2391
+ return Un(e) + pr;
2235
2392
  },
2236
- hasPage: C,
2393
+ hasPage: w,
2394
+ interactionLocked: p,
2237
2395
  isAtBoundary() {
2238
- return te() <= Xn;
2396
+ return re() <= sr;
2239
2397
  },
2240
2398
  loading: e.loading,
2241
2399
  requestPage: e.requestNextPage
2242
- }), N = null, F = 0, I = null, L = !1;
2243
- P([
2244
- () => e.items.value.map((e) => $(e)),
2245
- m,
2246
- h
2400
+ }), P = null, I = 0, L = null, R = null, z = !1;
2401
+ F([
2402
+ () => e.items.value,
2403
+ h,
2404
+ _
2247
2405
  ], async ([t], [r = []]) => {
2248
- let i = Tn(e.items.value, u.value, o.value), a = new Set(r), s = e.items.value.filter((e) => !a.has($(e))), c = t.length > r.length && r.length > 0 && t[0] !== r[0], l = c && n.value > Kn + qn ? e.items.value[_.value] : null, d = l ? $(l) : null;
2249
- ee(), s.length > 0 && (A.markEnter(s, c ? "top" : "bottom"), c ? j.onItemsMutated(s.length) : M.onItemsMutated(s.length)), A.playFlipMoveAnimation(i, new Set(s.map((e) => $(e))), c ? tr : void 0), d ? (await g(), H(d, i)) : e.active.value && r.length > 0 && W();
2250
- }, { immediate: !0 }), P([
2406
+ let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = Pn(a, u.value, o.value), l = oe(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
2407
+ let t = $(e);
2408
+ if (f.has(t)) return [];
2409
+ let n = c.get(t), r = l.get(t);
2410
+ return !n || r == null ? [] : [{
2411
+ height: r,
2412
+ item: e,
2413
+ position: n
2414
+ }];
2415
+ }), h = i.length > s.length && s.length > 0 && i[0] !== s[0], _ = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = h && n.value > rr + ir ? t[v.value] : null, b = y ? $(y) : null;
2416
+ _ && (q(Wn()), K()), B(), m.length > 0 && j.markLeave(m), p.length > 0 && (j.markEnter(p, h ? "top" : "bottom"), h ? M.onItemsMutated(p.length) : N.onItemsMutated(p.length)), j.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? fr : void 0), b ? (await g(), G(b, c)) : e.active.value && s.length > 0 && Y();
2417
+ }, { immediate: !0 }), F([
2251
2418
  () => e.pendingAppendItems.value.map((e) => $(e)),
2252
- m,
2253
2419
  h,
2420
+ _,
2254
2421
  r
2255
2422
  ], ([t]) => {
2256
- ie(), t.length && (d.value = ne([...e.items.value, ...e.pendingAppendItems.value]), re());
2257
- }, { immediate: !0 }), P(() => e.active.value, async (e, i) => {
2423
+ se(), t.length && (d.value = ae([...e.items.value, ...e.pendingAppendItems.value]), Z());
2424
+ }, { immediate: !0 }), F(() => e.active.value, async (e, i) => {
2258
2425
  let a = t.value;
2259
2426
  if (!a) return;
2260
2427
  if (!e) {
@@ -2263,64 +2430,77 @@ function rr(e) {
2263
2430
  }
2264
2431
  if (i !== !1 || f.value == null) return;
2265
2432
  await g();
2266
- let o = Math.max(0, S.value - r.value), s = ir(f.value, 0, o);
2267
- a.scrollTop = s, n.value = s, j.syncBoundary(), M.syncBoundary();
2268
- }), P(() => e.loading.value, async (t) => {
2269
- !t && !e.pendingAppendItems.value.length && !I && !L && (d.value = null), j.onLoadingChange(t), M.onLoadingChange(t), await g();
2433
+ let o = Math.max(0, C.value - r.value), s = hr(f.value, 0, o);
2434
+ a.scrollTop = s, n.value = s, M.syncBoundary(), N.syncBoundary();
2435
+ }), F(() => e.loading.value, async (t) => {
2436
+ !t && !e.pendingAppendItems.value.length && !L && !z && (d.value = null), M.onLoadingChange(t), N.onLoadingChange(t), await g();
2270
2437
  }), x(async () => {
2271
- K(), await g(), _.value > 0 ? V(_.value, "center") : U(), j.syncBoundary(), M.syncBoundary(), typeof ResizeObserver < "u" ? (N = new ResizeObserver(() => {
2272
- K();
2273
- }), t.value && N.observe(t.value)) : window.addEventListener("resize", K);
2438
+ ee(), await g(), v.value > 0 ? W(v.value, "center") : J(), M.syncBoundary(), N.syncBoundary(), typeof ResizeObserver < "u" ? (P = new ResizeObserver(() => {
2439
+ ee();
2440
+ }), t.value && P.observe(t.value)) : window.addEventListener("resize", ee);
2274
2441
  }), b(() => {
2275
- N?.disconnect(), N = null, window.removeEventListener("resize", K), ie(), F &&= (cancelAnimationFrame(F), 0);
2442
+ P?.disconnect(), P = null, window.removeEventListener("resize", ee), se(), ce(), I &&= (cancelAnimationFrame(I), 0);
2276
2443
  });
2277
- function ee() {
2278
- let t = Cn(e.items.value, {
2279
- columnCount: m.value,
2280
- columnWidth: h.value,
2281
- gapX: qn,
2282
- gapY: qn,
2283
- bucketPx: Gn
2444
+ function B() {
2445
+ let t = Mn(e.items.value, {
2446
+ columnCount: h.value,
2447
+ columnWidth: _.value,
2448
+ gapX: ir,
2449
+ gapY: ir,
2450
+ bucketPx: nr
2284
2451
  });
2285
2452
  o.value = t.positions.map((e) => ({
2286
- x: e.x + Kn,
2287
- y: e.y + Kn
2453
+ x: e.x + rr,
2454
+ y: e.y + rr
2288
2455
  })), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
2289
2456
  }
2290
- function R() {
2291
- e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = q(), j.syncBoundary(), M.syncBoundary(), G(), !W() && (F ||= requestAnimationFrame(() => {
2292
- F = 0, U();
2457
+ function V() {
2458
+ e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = te(), M.syncBoundary(), N.syncBoundary(), X(), !Y() && (I ||= requestAnimationFrame(() => {
2459
+ I = 0, J();
2293
2460
  })));
2294
2461
  }
2295
- function z(t) {
2296
- e.active.value && (j.onWheel(t), M.onWheel(t), G());
2462
+ function H(t) {
2463
+ e.active.value && (M.onWheel(t), N.onWheel(t), X());
2297
2464
  }
2298
- function B(t) {
2465
+ function U(t) {
2299
2466
  let n = e.items.value[t], r = n ? $(n) : "";
2300
2467
  return {
2301
- height: `${s.value[t] ?? h.value}px`,
2302
- width: `${h.value}px`,
2303
- transition: r ? A.getCardTransition(r) : void 0,
2304
- transitionDelay: r ? A.getCardTransitionDelay(r) : void 0,
2305
- transform: A.getCardTransform(t)
2468
+ height: `${s.value[t] ?? _.value}px`,
2469
+ width: `${_.value}px`,
2470
+ transition: r ? j.getCardTransition(r) : void 0,
2471
+ transitionDelay: r ? j.getCardTransitionDelay(r) : void 0,
2472
+ transform: j.getCardTransform(t)
2306
2473
  };
2307
2474
  }
2308
- function V(e, i) {
2475
+ function W(e, i) {
2309
2476
  let a = t.value, c = o.value[e], l = s.value[e];
2310
2477
  if (!a || !c || !l) return;
2311
- let u = a.scrollTop, d = Math.max(0, S.value - r.value);
2312
- i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Kn : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Kn), a.scrollTop = ir(u, 0, d), n.value = a.scrollTop, U();
2478
+ let u = a.scrollTop, d = Math.max(0, C.value - r.value);
2479
+ i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - rr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + rr), a.scrollTop = hr(u, 0, d), n.value = a.scrollTop, J();
2313
2480
  }
2314
- function H(e, r) {
2481
+ function G(e, r) {
2315
2482
  let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
2316
2483
  if (!i || !a || !c) return;
2317
2484
  let l = c.y - a.y;
2318
2485
  i.scrollTop += l, n.value = i.scrollTop;
2319
2486
  }
2320
- function U() {
2321
- if (!v.value.length || W()) return;
2322
- let t = n.value + r.value / 2, i = _.value, a = Infinity;
2323
- for (let e of v.value) {
2487
+ function K() {
2488
+ let e = t.value;
2489
+ if (!e) {
2490
+ n.value = 0;
2491
+ return;
2492
+ }
2493
+ e.scrollTop = 0, n.value = 0, M.syncBoundary(), N.syncBoundary();
2494
+ }
2495
+ function q(e) {
2496
+ ce(), p.value = !0, R = setTimeout(() => {
2497
+ R = null, p.value = !1;
2498
+ }, Math.max(0, e));
2499
+ }
2500
+ function J() {
2501
+ if (!y.value.length || Y()) return;
2502
+ let t = n.value + r.value / 2, i = v.value, a = Infinity;
2503
+ for (let e of y.value) {
2324
2504
  let n = o.value[e], r = s.value[e];
2325
2505
  if (!n || !r) continue;
2326
2506
  let c = n.y + r / 2, l = Math.abs(c - t);
@@ -2328,78 +2508,93 @@ function rr(e) {
2328
2508
  }
2329
2509
  e.setActiveIndex(i);
2330
2510
  }
2331
- function W() {
2332
- let t = n.value <= Kn + qn, r = te() <= Xn;
2511
+ function Y() {
2512
+ let t = n.value <= rr + ir, r = re() <= sr;
2333
2513
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
2334
2514
  }
2335
- function G() {
2336
- j.maybeRequestPage(), M.maybeRequestPage();
2337
- }
2338
- function K() {
2339
- r.value = q(), a.value = J();
2340
- }
2341
- function q() {
2342
- return Rn(t.value, r.value);
2515
+ function X() {
2516
+ M.maybeRequestPage(), N.maybeRequestPage();
2343
2517
  }
2344
- function J() {
2345
- return zn(t.value, a.value, Jn);
2518
+ function ee() {
2519
+ r.value = te(), a.value = ne();
2346
2520
  }
2347
2521
  function te() {
2348
- return Bn(t.value, n.value, r.value, S.value);
2349
- }
2350
- function Y() {
2351
- return Vn(O.value, k.value);
2522
+ return Yn(t.value, r.value);
2352
2523
  }
2353
- function ne(e) {
2354
- return e.length ? Cn(e, {
2355
- columnCount: m.value,
2356
- columnWidth: h.value,
2357
- gapX: qn,
2358
- gapY: qn,
2359
- bucketPx: Gn
2360
- }).contentHeight + Kn * 2 : 0;
2524
+ function ne() {
2525
+ return Xn(t.value, a.value, ar);
2361
2526
  }
2362
2527
  function re() {
2528
+ return Zn(t.value, n.value, r.value, C.value);
2529
+ }
2530
+ function ie() {
2531
+ return Qn(k.value, A.value);
2532
+ }
2533
+ function ae(e) {
2534
+ return e.length ? Mn(e, {
2535
+ columnCount: h.value,
2536
+ columnWidth: _.value,
2537
+ gapX: ir,
2538
+ gapY: ir,
2539
+ bucketPx: nr
2540
+ }).contentHeight + rr * 2 : 0;
2541
+ }
2542
+ function oe(e) {
2543
+ let t = /* @__PURE__ */ new Map();
2544
+ for (let n of e) {
2545
+ let e = $(n), r = u.value.get(e);
2546
+ if (r == null) continue;
2547
+ let i = s.value[r];
2548
+ i != null && t.set(e, i);
2549
+ }
2550
+ return t;
2551
+ }
2552
+ function Z() {
2363
2553
  let t = e.commitPendingAppend.value;
2364
- typeof t == "function" && (I = setTimeout(async () => {
2365
- I = null, L = !0;
2554
+ typeof t == "function" && (L = setTimeout(async () => {
2555
+ L = null, z = !0;
2366
2556
  try {
2367
2557
  if (!e.pendingAppendItems.value.length) return;
2368
2558
  await t(), await g(), await g();
2369
2559
  } finally {
2370
- d.value = null, L = !1;
2560
+ d.value = null, z = !1;
2371
2561
  }
2372
- }, Qn));
2562
+ }, lr));
2373
2563
  }
2374
- function ie() {
2375
- I &&= (clearTimeout(I), null);
2564
+ function se() {
2565
+ L &&= (clearTimeout(L), null);
2566
+ }
2567
+ function ce() {
2568
+ R && (clearTimeout(R), R = null, p.value = !1);
2376
2569
  }
2377
2570
  return {
2378
- columnWidth: h,
2379
- containerHeight: S,
2380
- getCardStyle: B,
2381
- getScrollbarThumbStyle: Y,
2382
- onScroll: R,
2383
- onWheel: z,
2384
- paginationLabel: w,
2385
- renderedItems: y,
2386
- resolvedActiveIndex: _,
2387
- scrollToIndex: V,
2388
- showScrollbar: D,
2571
+ columnWidth: _,
2572
+ containerHeight: C,
2573
+ getCardStyle: U,
2574
+ getLeavingCardStyle: j.getLeavingCardStyle,
2575
+ getScrollbarThumbStyle: ie,
2576
+ leavingItems: j.leavingItems,
2577
+ onScroll: V,
2578
+ onWheel: H,
2579
+ paginationLabel: E,
2580
+ renderedItems: S,
2581
+ resolvedActiveIndex: v,
2582
+ scrollToIndex: W,
2583
+ showScrollbar: O,
2389
2584
  scrollViewportRef: t
2390
2585
  };
2391
2586
  }
2392
- function ir(e, t, n) {
2587
+ function hr(e, t, n) {
2393
2588
  return Math.min(Math.max(e, t), n);
2394
2589
  }
2395
2590
  //#endregion
2396
2591
  //#region src/components/viewer-core/listCardAsset.ts
2397
- function ar(e) {
2592
+ function gr(e) {
2398
2593
  if (e) try {
2399
2594
  e.removeAttribute("src"), e.src = "";
2400
2595
  } catch {}
2401
2596
  }
2402
- function or(e) {
2597
+ function _r(e) {
2403
2598
  if (e) {
2404
2599
  try {
2405
2600
  e.currentTime = 0;
@@ -2410,12 +2605,12 @@ function or(e) {
2410
2605
  } catch {}
2411
2606
  }
2412
2607
  }
2413
- function sr(e, t) {
2608
+ function vr(e, t) {
2414
2609
  if (t) return e.bottom > t.top && e.top < t.bottom;
2415
2610
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
2416
2611
  return e.bottom > 0 && e.top < n;
2417
2612
  }
2418
- function cr(e) {
2613
+ function yr(e) {
2419
2614
  if (!e) return null;
2420
2615
  try {
2421
2616
  return new URL(e, window.location.href).href;
@@ -2425,22 +2620,22 @@ function cr(e) {
2425
2620
  }
2426
2621
  //#endregion
2427
2622
  //#region src/components/viewer-core/listPreview.ts
2428
- var lr = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ur = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
2429
- function dr(e) {
2430
- let t = e.preview?.url ?? e.url, n = yn(e), r = e.title?.trim() || jt(e.type);
2623
+ var br = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, xr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
2624
+ function Sr(e) {
2625
+ let t = e.preview?.url ?? e.url, n = On(e), r = e.title?.trim() || ft(e.type);
2431
2626
  return e.type !== "image" && e.type !== "video" ? {
2432
2627
  kind: "fallback",
2433
2628
  url: null,
2434
2629
  width: n.width,
2435
2630
  height: n.height,
2436
2631
  label: r
2437
- } : pr(e, t) ? {
2632
+ } : wr(e, t) ? {
2438
2633
  kind: "video",
2439
2634
  url: t,
2440
2635
  width: n.width,
2441
2636
  height: n.height,
2442
2637
  label: r
2443
- } : fr(e, t) ? {
2638
+ } : Cr(e, t) ? {
2444
2639
  kind: "image",
2445
2640
  url: t,
2446
2641
  width: n.width,
@@ -2454,28 +2649,28 @@ function dr(e) {
2454
2649
  label: r
2455
2650
  };
2456
2651
  }
2457
- function fr(e, t) {
2458
- return e.type !== "image" || typeof t != "string" ? !1 : lr.test(t) || mr(t);
2652
+ function Cr(e, t) {
2653
+ return e.type !== "image" || typeof t != "string" ? !1 : br.test(t) || Tr(t);
2459
2654
  }
2460
- function pr(e, t) {
2461
- return e.type === "video" && typeof t == "string" && ur.test(t);
2655
+ function wr(e, t) {
2656
+ return e.type === "video" && typeof t == "string" && xr.test(t);
2462
2657
  }
2463
- function mr(e) {
2658
+ function Tr(e) {
2464
2659
  return /^https?:\/\//i.test(e);
2465
2660
  }
2466
2661
  //#endregion
2467
2662
  //#region src/components/viewer-core/useAssetLoadQueue.ts
2468
- var hr = {
2663
+ var Er = {
2469
2664
  maxGlobal: 10,
2470
2665
  maxPerDomain: 4,
2471
2666
  maxVideoPerDomain: 2
2472
2667
  };
2473
- function gr(e = hr) {
2668
+ function Dr(e = Er) {
2474
2669
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
2475
2670
  function i(e) {
2476
2671
  let i = {
2477
2672
  ...e,
2478
- domain: yr(e.url),
2673
+ domain: Ar(e.url),
2479
2674
  enqueuedAt: r,
2480
2675
  id: `vibe-asset-load-${r += 1}`
2481
2676
  };
@@ -2494,7 +2689,7 @@ function gr(e = hr) {
2494
2689
  function a() {
2495
2690
  if (n.size === 0) return;
2496
2691
  let r = [...n.values()].sort((e, t) => {
2497
- let n = vr(e) - vr(t);
2692
+ let n = kr(e) - kr(t);
2498
2693
  return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
2499
2694
  });
2500
2695
  for (let i of r) {
@@ -2515,8 +2710,8 @@ function gr(e = hr) {
2515
2710
  }
2516
2711
  return { request: i };
2517
2712
  }
2518
- var _r = gr();
2519
- function vr(e) {
2713
+ var Or = Dr();
2714
+ function kr(e) {
2520
2715
  try {
2521
2716
  let t = e.getPriority();
2522
2717
  return Number.isFinite(t) ? t : Infinity;
@@ -2524,7 +2719,7 @@ function vr(e) {
2524
2719
  return Infinity;
2525
2720
  }
2526
2721
  }
2527
- function yr(e) {
2722
+ function Ar(e) {
2528
2723
  try {
2529
2724
  return new URL(e).hostname || "local";
2530
2725
  } catch {
@@ -2533,14 +2728,14 @@ function yr(e) {
2533
2728
  }
2534
2729
  //#endregion
2535
2730
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
2536
- var br = ["aria-label"], xr = {
2731
+ var jr = ["aria-label"], Mr = {
2537
2732
  key: 0,
2538
2733
  "data-testid": "vibe-list-card-spinner",
2539
2734
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
2540
- }, Sr = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Cr = ["src", "alt"], wr = ["src"], Tr = ["data-kind"], Er = { class: "grid justify-items-center gap-3 px-4 text-center" }, Dr = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Or = {
2735
+ }, Nr = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Pr = ["src", "alt"], Fr = ["src"], Ir = ["data-kind"], Lr = { class: "grid justify-items-center gap-3 px-4 text-center" }, Rr = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, zr = {
2541
2736
  key: 4,
2542
2737
  class: "grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(255,255,255,0.08),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
2543
- }, kr = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Ar = { class: "pointer-events-none absolute inset-0 z-[3]" }, jr = /* @__PURE__ */ d({
2738
+ }, Br = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, Vr = { class: "pointer-events-none absolute inset-0 z-[3]" }, Hr = /* @__PURE__ */ d({
2544
2739
  __name: "ListCard",
2545
2740
  props: {
2546
2741
  active: {
@@ -2564,89 +2759,89 @@ var br = ["aria-label"], xr = {
2564
2759
  },
2565
2760
  emits: ["open"],
2566
2761
  setup(e, { emit: t }) {
2567
- let n = e, r = t, l = i(() => dr(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), F = i(() => !!h.value), I = i(() => _t(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, z = null, B = /* @__PURE__ */ new Set();
2568
- P([E, () => l.value.kind], () => {
2762
+ let n = e, r = t, l = i(() => Sr(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(null), g = T(null), v = T(null), y = T(null), C = T(null), w = T(l.value.kind === "fallback"), E = i(() => w.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), A = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), N = i(() => l.value.kind === "video" && !!E.value), P = i(() => !!h.value), I = i(() => At(h.value)), L = i(() => A.value && !h.value && (!w.value || !m.value)), R = null, B = null, V = /* @__PURE__ */ new Set();
2763
+ F([E, () => l.value.kind], () => {
2569
2764
  let e = l.value.kind === "fallback";
2570
2765
  m.value = e, h.value = null, e && (w.value = !0);
2571
- }), P(A, () => {
2572
- G();
2573
- }), P([
2766
+ }), F(A, () => {
2767
+ K();
2768
+ }), F([
2574
2769
  d,
2575
2770
  m,
2576
2771
  E
2577
2772
  ], () => {
2578
- K();
2579
- }), P(() => n.surfaceActive, (e) => {
2773
+ q();
2774
+ }), F(() => n.surfaceActive, (e) => {
2580
2775
  if (!e) {
2581
- J(), K();
2776
+ Y(), q();
2582
2777
  return;
2583
2778
  }
2584
2779
  requestAnimationFrame(() => {
2585
- te(), G(), K();
2780
+ X(), K(), q();
2586
2781
  });
2587
2782
  }), x(() => {
2588
2783
  if (!v.value || typeof IntersectionObserver > "u") {
2589
- y.value = null, d.value = !0, G();
2784
+ y.value = null, d.value = !0, K();
2590
2785
  return;
2591
2786
  }
2592
2787
  y.value = v.value.closest("[data-testid=\"vibe-list-scroll\"]"), R = new IntersectionObserver((e) => {
2593
- for (let t of e) t.target === v.value && (n.surfaceActive && te(t), G(), K());
2788
+ for (let t of e) t.target === v.value && (n.surfaceActive && X(t), K(), q());
2594
2789
  }, {
2595
2790
  root: y.value,
2596
2791
  threshold: [0, 1]
2597
2792
  }), R.observe(v.value);
2598
2793
  }), b(() => {
2599
- q(), R?.disconnect(), R = null;
2794
+ J(), R?.disconnect(), R = null;
2600
2795
  });
2601
- function V() {
2602
- X(g.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), J());
2796
+ function H() {
2797
+ Z(g.value) && (m.value = !0, h.value = null, ee(E.value ?? n.item.url), Y());
2603
2798
  }
2604
- async function H() {
2605
- if (!X(g.value)) return;
2799
+ async function U() {
2800
+ if (!Z(g.value)) return;
2606
2801
  let e = E.value ?? n.item.url;
2607
2802
  m.value = !1, h.value = "generic";
2608
- let t = await vt(e);
2803
+ let t = await jt(e);
2609
2804
  h.value = t, n.reportAssetError?.({
2610
2805
  item: n.item,
2611
2806
  occurrenceKey: $(n.item),
2612
2807
  url: e,
2613
2808
  kind: t,
2614
2809
  surface: "grid"
2615
- }), J();
2616
- }
2617
- function U() {
2618
- X(C.value) && (m.value = !0, h.value = null, Y(E.value ?? n.item.url), J(), K());
2810
+ }), Y();
2619
2811
  }
2620
2812
  function W() {
2621
- X(C.value) && (m.value = !1);
2813
+ Z(C.value) && (m.value = !0, h.value = null, ee(E.value ?? n.item.url), Y(), q());
2622
2814
  }
2623
2815
  function G() {
2816
+ Z(C.value) && (m.value = !1);
2817
+ }
2818
+ function K() {
2624
2819
  if (l.value.kind === "fallback") {
2625
- q(!1);
2820
+ J(!1);
2626
2821
  return;
2627
2822
  }
2628
2823
  if (!n.surfaceActive) {
2629
- J();
2824
+ Y();
2630
2825
  return;
2631
2826
  }
2632
2827
  if (!A.value) {
2633
- q();
2828
+ J();
2634
2829
  return;
2635
2830
  }
2636
- if (w.value || z) {
2637
- z?.refresh();
2831
+ if (w.value || B) {
2832
+ B?.refresh();
2638
2833
  return;
2639
2834
  }
2640
- z = _r.request({
2835
+ B = Or.request({
2641
2836
  assetType: l.value.kind,
2642
- getPriority: se,
2837
+ getPriority: ae,
2643
2838
  onGrant() {
2644
2839
  w.value = !0, m.value = !1, h.value = null;
2645
2840
  },
2646
2841
  url: l.value.url ?? n.item.url
2647
2842
  });
2648
2843
  }
2649
- function K() {
2844
+ function q() {
2650
2845
  let e = C.value;
2651
2846
  if (!(!e || l.value.kind !== "video")) {
2652
2847
  if (h.value) {
@@ -2654,7 +2849,7 @@ var br = ["aria-label"], xr = {
2654
2849
  return;
2655
2850
  }
2656
2851
  if (E.value && d.value && m.value) {
2657
- e.muted = !0, e.loop = !0, e.playsInline = !0, xt(e);
2852
+ e.muted = !0, e.loop = !0, e.playsInline = !0, Pt(e);
2658
2853
  return;
2659
2854
  }
2660
2855
  try {
@@ -2663,44 +2858,44 @@ var br = ["aria-label"], xr = {
2663
2858
  e.pause();
2664
2859
  }
2665
2860
  }
2666
- function q(e = !0) {
2667
- w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (ie(), ae()), J();
2861
+ function J(e = !0) {
2862
+ w.value = l.value.kind === "fallback", h.value = null, m.value = l.value.kind === "fallback", e && (ne(), ie()), Y();
2668
2863
  }
2669
- function J() {
2670
- z?.release(), z = null;
2864
+ function Y() {
2865
+ B?.release(), B = null;
2671
2866
  }
2672
- function te(e) {
2867
+ function X(e) {
2673
2868
  let t = v.value;
2674
2869
  if (!t) {
2675
2870
  d.value = !0;
2676
2871
  return;
2677
2872
  }
2678
- d.value = sr(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
2873
+ d.value = vr(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? y.value?.getBoundingClientRect() ?? null);
2679
2874
  }
2680
- function Y(e) {
2875
+ function ee(e) {
2681
2876
  if (!e) return;
2682
2877
  let t = $(n.item), r = `${t}|${e}`;
2683
- B.has(r) || (B.add(r), n.reportAssetLoad?.({
2878
+ V.has(r) || (V.add(r), n.reportAssetLoad?.({
2684
2879
  item: n.item,
2685
2880
  occurrenceKey: t,
2686
2881
  surface: "grid",
2687
2882
  url: e
2688
2883
  }));
2689
2884
  }
2690
- function ne() {
2885
+ function te() {
2691
2886
  if (!I.value) return;
2692
2887
  let e = $(n.item);
2693
- B.forEach((t) => {
2694
- t.startsWith(`${e}|`) && B.delete(t);
2695
- }), h.value = null, m.value = !1, w.value = !1, J(), G();
2888
+ V.forEach((t) => {
2889
+ t.startsWith(`${e}|`) && V.delete(t);
2890
+ }), h.value = null, m.value = !1, w.value = !1, Y(), K();
2891
+ }
2892
+ function ne() {
2893
+ gr(g.value);
2696
2894
  }
2697
2895
  function ie() {
2698
- ar(g.value);
2896
+ _r(C.value);
2699
2897
  }
2700
2898
  function ae() {
2701
- or(C.value);
2702
- }
2703
- function se() {
2704
2899
  let e = v.value;
2705
2900
  if (!e) return Infinity;
2706
2901
  let t = e.getBoundingClientRect();
@@ -2711,14 +2906,14 @@ var br = ["aria-label"], xr = {
2711
2906
  let n = window.innerHeight / 2;
2712
2907
  return Math.abs((t.top + t.bottom) / 2 - n);
2713
2908
  }
2714
- function X(e) {
2715
- let t = cr(E.value);
2716
- return !e || !t ? !1 : cr("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
2909
+ function Z(e) {
2910
+ let t = yr(E.value);
2911
+ return !e || !t ? !1 : yr("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
2717
2912
  }
2718
- function ce() {
2913
+ function se() {
2719
2914
  r("open");
2720
2915
  }
2721
- function Z() {
2916
+ function ce() {
2722
2917
  f.value = !0;
2723
2918
  }
2724
2919
  function Q(e) {
@@ -2730,7 +2925,7 @@ var br = ["aria-label"], xr = {
2730
2925
  ref: v,
2731
2926
  "data-testid": "vibe-list-card-inner",
2732
2927
  class: _(["group relative h-full w-full overflow-hidden border bg-[#0a0b0f] text-[#f7f1ea] transition-[border-color,transform] duration-300", n.active ? "border-white/28" : "border-white/12 hover:border-white/24"]),
2733
- onFocusin: Z,
2928
+ onFocusin: ce,
2734
2929
  onFocusout: Q,
2735
2930
  onPointerenter: t[0] ||= (e) => p.value = !0,
2736
2931
  onPointerleave: t[1] ||= (e) => p.value = !1
@@ -2740,13 +2935,13 @@ var br = ["aria-label"], xr = {
2740
2935
  "data-testid": "vibe-list-card-open",
2741
2936
  class: "absolute inset-0 z-[1] block h-full w-full cursor-pointer text-left focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#f7f1ea]",
2742
2937
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
2743
- onClick: ce
2744
- }, null, 8, br),
2745
- L.value ? (S(), s("div", xr, [c("span", Sr, [u(j(re), {
2938
+ onClick: se
2939
+ }, null, 8, jr),
2940
+ L.value ? (S(), s("div", Mr, [c("span", Nr, [u(j(re), {
2746
2941
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2747
2942
  "aria-hidden": "true"
2748
2943
  })])])) : o("", !0),
2749
- M.value && E.value && !F.value ? (S(), s("img", {
2944
+ M.value && E.value && !P.value ? (S(), s("img", {
2750
2945
  key: 1,
2751
2946
  ref_key: "imageRef",
2752
2947
  ref: g,
@@ -2754,9 +2949,9 @@ var br = ["aria-label"], xr = {
2754
2949
  alt: l.value.label,
2755
2950
  draggable: "false",
2756
2951
  class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
2757
- onLoad: V,
2758
- onError: H
2759
- }, null, 42, Cr)) : N.value && E.value && !F.value ? (S(), s("video", {
2952
+ onLoad: H,
2953
+ onError: U
2954
+ }, null, 42, Pr)) : N.value && E.value && !P.value ? (S(), s("video", {
2760
2955
  key: 2,
2761
2956
  ref_key: "videoRef",
2762
2957
  ref: C,
@@ -2766,64 +2961,64 @@ var br = ["aria-label"], xr = {
2766
2961
  playsinline: "",
2767
2962
  preload: "metadata",
2768
2963
  class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
2769
- onCanplay: U,
2770
- onError: H,
2771
- onLoadstart: W,
2772
- onPlaying: U,
2773
- onStalled: W,
2774
- onWaiting: W
2775
- }, null, 42, wr)) : F.value ? (S(), s("div", {
2964
+ onCanplay: W,
2965
+ onError: U,
2966
+ onLoadstart: G,
2967
+ onPlaying: W,
2968
+ onStalled: G,
2969
+ onWaiting: G
2970
+ }, null, 42, Fr)) : P.value ? (S(), s("div", {
2776
2971
  key: 3,
2777
2972
  "data-testid": "vibe-list-card-error",
2778
2973
  "data-kind": h.value,
2779
2974
  class: "relative z-[2] grid h-full w-full place-items-center bg-[radial-gradient(circle_at_center,rgba(239,68,68,0.12),transparent_65%),linear-gradient(180deg,rgba(255,255,255,0.04),rgba(255,255,255,0.02))]"
2780
- }, [c("div", Er, [
2975
+ }, [c("div", Lr, [
2781
2976
  u(j(oe), {
2782
2977
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
2783
2978
  "aria-hidden": "true"
2784
2979
  }),
2785
- c("span", Dr, k(j(gt)(h.value)), 1),
2980
+ c("span", Rr, k(j(kt)(h.value)), 1),
2786
2981
  I.value ? (S(), s("button", {
2787
2982
  key: 0,
2788
2983
  type: "button",
2789
2984
  class: "pointer-events-auto inline-flex items-center justify-center border border-white/14 bg-black/35 px-3 py-2 text-[0.62rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/82 backdrop-blur-[18px] transition hover:border-white/28 hover:bg-black/50",
2790
- onClick: ee(ne, ["stop"])
2985
+ onClick: z(te, ["stop"])
2791
2986
  }, " Retry ")) : o("", !0)
2792
- ])], 8, Tr)) : (S(), s("div", Or, [c("div", kr, [D(e.$slots, "item-icon", {
2793
- icon: j(At)(n.item.type),
2987
+ ])], 8, Ir)) : (S(), s("div", zr, [c("div", Br, [D(e.$slots, "item-icon", {
2988
+ icon: j(dt)(n.item.type),
2794
2989
  item: n.item
2795
- }, () => [(S(), a(O(j(At)(n.item.type)), {
2990
+ }, () => [(S(), a(O(j(dt)(n.item.type)), {
2796
2991
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
2797
2992
  "aria-hidden": "true"
2798
2993
  }))])])])),
2799
- c("div", Ar, [D(e.$slots, "grid-item-overlay", {
2994
+ c("div", Vr, [D(e.$slots, "grid-item-overlay", {
2800
2995
  active: n.active,
2801
2996
  focused: f.value,
2802
2997
  hovered: p.value,
2803
2998
  index: n.index,
2804
2999
  item: n.item,
2805
- openFullscreen: ce
3000
+ openFullscreen: se
2806
3001
  })])
2807
3002
  ], 34));
2808
3003
  }
2809
- }), Mr = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, Nr = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Pr = {
3004
+ }), Ur = { class: "relative h-full min-h-0 bg-[radial-gradient(circle_at_top_center,rgba(255,255,255,0.04),transparent_28%),linear-gradient(180deg,#06070b,#05060a)]" }, Wr = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Gr = {
2810
3005
  "data-testid": "vibe-pagination",
2811
3006
  class: "inline-flex shrink-0 items-center gap-2 whitespace-nowrap border border-white/14 bg-black/40 px-3 py-2 text-[0.63rem] font-bold uppercase tracking-[0.12em] text-[#f7f1ea]/72 backdrop-blur-[18px] min-[721px]:gap-3 min-[721px]:px-4 min-[721px]:py-3 min-[721px]:text-[0.74rem] min-[721px]:tracking-[0.2em]"
2812
- }, Fr = { class: "whitespace-nowrap" }, Ir = {
3007
+ }, Kr = { class: "whitespace-nowrap" }, qr = {
2813
3008
  key: 0,
2814
3009
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
2815
- }, Lr = [
3010
+ }, Jr = [
2816
3011
  "data-active",
2817
3012
  "data-index",
2818
3013
  "data-item-id",
2819
3014
  "data-occurrence-key"
2820
- ], Rr = {
3015
+ ], Yr = ["data-item-id"], Xr = {
2821
3016
  key: 0,
2822
3017
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
2823
- }, zr = {
3018
+ }, Zr = {
2824
3019
  key: 1,
2825
3020
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
2826
- }, Br = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, Vr = /* @__PURE__ */ d({
3021
+ }, Qr = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, $r = /* @__PURE__ */ d({
2827
3022
  __name: "ListSurface",
2828
3023
  props: {
2829
3024
  active: {
@@ -2839,6 +3034,7 @@ var br = ["aria-label"], xr = {
2839
3034
  type: [Function, null],
2840
3035
  default: null
2841
3036
  },
3037
+ emptyStateMode: { default: "inline" },
2842
3038
  errorMessage: { default: null },
2843
3039
  hasNextPage: {
2844
3040
  type: Boolean,
@@ -2879,7 +3075,7 @@ var br = ["aria-label"], xr = {
2879
3075
  },
2880
3076
  emits: ["open-fullscreen", "update:activeIndex"],
2881
3077
  setup(e, { emit: n }) {
2882
- let r = e, a = M(), d = n, f = rr({
3078
+ let r = e, d = N(), f = n, p = mr({
2883
3079
  active: A(r, "active"),
2884
3080
  allowExhaustedNextPageRefresh: A(r, "allowExhaustedNextPageRefresh"),
2885
3081
  items: A(r, "items"),
@@ -2893,98 +3089,157 @@ var br = ["aria-label"], xr = {
2893
3089
  requestNextPage: A(r, "requestNextPage"),
2894
3090
  requestPreviousPage: A(r, "requestPreviousPage"),
2895
3091
  setActiveIndex(e) {
2896
- d("update:activeIndex", e);
3092
+ f("update:activeIndex", e);
2897
3093
  }
2898
- }), p = i(() => st({
3094
+ }), m = i(() => bt({
2899
3095
  itemCount: r.items.length,
2900
3096
  loading: r.loading,
2901
3097
  phase: r.phase
2902
- })), m = i(() => ct({
3098
+ })), g = i(() => xt({
2903
3099
  errorMessage: r.errorMessage,
2904
3100
  hasItems: r.items.length > 0,
2905
3101
  hasNextPage: r.hasNextPage,
2906
- phase: p.value,
3102
+ phase: m.value,
2907
3103
  surface: "grid"
2908
- })), g = i(() => !r.showStatusBadges || !m.value ? null : {
2909
- activeIndex: f.resolvedActiveIndex.value,
2910
- kind: m.value.kind,
3104
+ })), b = i(() => !r.showStatusBadges || !g.value ? null : {
3105
+ activeIndex: p.resolvedActiveIndex.value,
3106
+ kind: g.value.kind,
2911
3107
  loading: r.loading,
2912
- message: m.value.message,
3108
+ message: g.value.message,
2913
3109
  paginationDetail: r.paginationDetail,
2914
3110
  total: r.items.length
2915
- }), b = i(() => !g.value || !a["grid-status"] ? [] : a["grid-status"](g.value)), x = i(() => Mt(b.value));
2916
- return (e, n) => (S(), s("div", Mr, [
2917
- c("div", Nr, [c("span", Pr, [c("span", Fr, k(j(f).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", Ir, k(r.paginationDetail), 1)) : o("", !0)])]),
3111
+ }), x = i(() => !b.value || !d["grid-status"] ? [] : d["grid-status"](b.value)), C = i(() => ht(x.value)), w = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: O, showCustomEmptyState: M, showInlineEmptyState: P } = vt({
3112
+ emptyStateMode: A(r, "emptyStateMode"),
3113
+ itemCount: w,
3114
+ loading: A(r, "loading"),
3115
+ renderSlot: d["empty-state"],
3116
+ surface: "grid"
3117
+ });
3118
+ return (e, n) => (S(), s("div", Ur, [
3119
+ c("div", Wr, [c("span", Gr, [c("span", Kr, k(j(p).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", qr, k(r.paginationDetail), 1)) : o("", !0)])]),
2918
3120
  c("div", {
2919
- ref: j(f).scrollViewportRef,
3121
+ ref: j(p).scrollViewportRef,
2920
3122
  "data-testid": "vibe-list-scroll",
2921
3123
  class: "h-full min-h-0 overflow-y-auto overflow-x-hidden [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
2922
- onScroll: n[0] ||= (...e) => j(f).onScroll && j(f).onScroll(...e),
2923
- onWheel: n[1] ||= (...e) => j(f).onWheel && j(f).onWheel(...e)
3124
+ onScroll: n[0] ||= (...e) => j(p).onScroll && j(p).onScroll(...e),
3125
+ onWheel: n[1] ||= (...e) => j(p).onWheel && j(p).onWheel(...e)
2924
3126
  }, [c("div", {
2925
3127
  "data-testid": "vibe-list-content",
2926
3128
  class: "relative",
2927
- style: y({ height: `${j(f).containerHeight.value}px` })
2928
- }, [(S(!0), s(t, null, E(j(f).renderedItems.value, ({ item: t, index: n }) => (S(), s("article", {
2929
- key: j($)(t),
2930
- "data-testid": "vibe-list-card",
2931
- "data-active": n === j(f).resolvedActiveIndex.value ? "true" : "false",
2932
- "data-index": n,
2933
- "data-item-id": t.id,
2934
- "data-occurrence-key": j($)(t),
2935
- class: "absolute will-change-transform",
2936
- style: y(j(f).getCardStyle(n))
2937
- }, [u(jr, {
2938
- active: n === j(f).resolvedActiveIndex.value,
2939
- index: n,
2940
- item: t,
2941
- "report-asset-error": r.reportAssetError,
2942
- "report-asset-load": r.reportAssetLoad,
2943
- "surface-active": r.active,
2944
- onOpen: (e) => d("open-fullscreen", n)
2945
- }, l({ _: 2 }, [a["grid-item-overlay"] ? {
2946
- name: "grid-item-overlay",
2947
- fn: I((t) => [D(e.$slots, "grid-item-overlay", h({ ref_for: !0 }, t))]),
2948
- key: "0"
2949
- } : void 0, a["item-icon"] ? {
2950
- name: "item-icon",
2951
- fn: I((t) => [D(e.$slots, "item-icon", h({ ref_for: !0 }, t))]),
2952
- key: "1"
2953
- } : void 0]), 1032, [
2954
- "active",
2955
- "index",
2956
- "item",
2957
- "report-asset-error",
2958
- "report-asset-load",
2959
- "surface-active",
2960
- "onOpen"
2961
- ])], 12, Lr))), 128))], 4)], 544),
2962
- j(f).showScrollbar.value ? (S(), s("div", Rr, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3129
+ style: y({ height: `${j(p).containerHeight.value}px` })
3130
+ }, [
3131
+ (S(!0), s(t, null, E(j(p).renderedItems.value, ({ item: t, index: n }) => (S(), s("article", {
3132
+ key: j($)(t),
3133
+ "data-testid": "vibe-list-card",
3134
+ "data-active": n === j(p).resolvedActiveIndex.value ? "true" : "false",
3135
+ "data-index": n,
3136
+ "data-item-id": t.id,
3137
+ "data-occurrence-key": j($)(t),
3138
+ class: "absolute will-change-transform",
3139
+ style: y(j(p).getCardStyle(n))
3140
+ }, [u(Hr, {
3141
+ active: n === j(p).resolvedActiveIndex.value,
3142
+ index: n,
3143
+ item: t,
3144
+ "report-asset-error": r.reportAssetError,
3145
+ "report-asset-load": r.reportAssetLoad,
3146
+ "surface-active": r.active,
3147
+ onOpen: (e) => f("open-fullscreen", n)
3148
+ }, l({ _: 2 }, [d["grid-item-overlay"] ? {
3149
+ name: "grid-item-overlay",
3150
+ fn: L((t) => [D(e.$slots, "grid-item-overlay", h({ ref_for: !0 }, t))]),
3151
+ key: "0"
3152
+ } : void 0, d["item-icon"] ? {
3153
+ name: "item-icon",
3154
+ fn: L((t) => [D(e.$slots, "item-icon", h({ ref_for: !0 }, t))]),
3155
+ key: "1"
3156
+ } : void 0]), 1032, [
3157
+ "active",
3158
+ "index",
3159
+ "item",
3160
+ "report-asset-error",
3161
+ "report-asset-load",
3162
+ "surface-active",
3163
+ "onOpen"
3164
+ ])], 12, Jr))), 128)),
3165
+ (S(!0), s(t, null, E(j(p).leavingItems.value, (t) => (S(), s("article", {
3166
+ key: `leaving-${j($)(t.item)}`,
3167
+ "data-testid": "vibe-list-card-leaving",
3168
+ "data-item-id": t.item.id,
3169
+ class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
3170
+ style: y(j(p).getLeavingCardStyle(t.item))
3171
+ }, [u(Hr, {
3172
+ active: !1,
3173
+ index: -1,
3174
+ item: t.item,
3175
+ "report-asset-error": r.reportAssetError,
3176
+ "report-asset-load": r.reportAssetLoad,
3177
+ "surface-active": !1
3178
+ }, l({ _: 2 }, [d["item-icon"] ? {
3179
+ name: "item-icon",
3180
+ fn: L((t) => [D(e.$slots, "item-icon", h({ ref_for: !0 }, t))]),
3181
+ key: "0"
3182
+ } : void 0]), 1032, [
3183
+ "item",
3184
+ "report-asset-error",
3185
+ "report-asset-load"
3186
+ ])], 12, Yr))), 128)),
3187
+ j(P) && j(T) ? (S(), a(qt, {
3188
+ key: 0,
3189
+ message: j(T).message,
3190
+ mode: j(T).mode,
3191
+ surface: j(T).surface
3192
+ }, {
3193
+ default: L(() => [j(M) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(T)))) : o("", !0)]),
3194
+ _: 3
3195
+ }, 8, [
3196
+ "message",
3197
+ "mode",
3198
+ "surface"
3199
+ ])) : o("", !0)
3200
+ ], 4)], 544),
3201
+ j(p).showScrollbar.value ? (S(), s("div", Xr, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
2963
3202
  "data-testid": "vibe-list-scrollbar-thumb",
2964
3203
  class: _(["absolute right-[0.625rem] w-1 bg-white/34 transition-[height,transform,background-color,opacity] duration-300 ease-out", r.loading ? "bg-white/52" : "bg-white/34"]),
2965
- style: y(j(f).getScrollbarThumbStyle())
3204
+ style: y(j(p).getScrollbarThumbStyle())
2966
3205
  }, null, 6)])) : o("", !0),
2967
- a["grid-footer"] ? (S(), s("div", zr, [c("div", Br, [D(e.$slots, "grid-footer")])])) : o("", !0),
2968
- g.value ? (S(), s("div", {
3206
+ d["grid-footer"] ? (S(), s("div", Zr, [c("div", Qr, [D(e.$slots, "grid-footer")])])) : o("", !0),
3207
+ b.value ? (S(), s("div", {
2969
3208
  key: 2,
2970
- class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", a["grid-footer"] ? "pb-24" : "pb-6"])
2971
- }, [x.value ? D(e.$slots, "grid-status", v(h({ key: 0 }, g.value))) : (S(), s("span", {
3209
+ class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
3210
+ }, [C.value ? D(e.$slots, "grid-status", v(h({ key: 0 }, b.value))) : (S(), s("span", {
2972
3211
  key: 1,
2973
3212
  "data-testid": "vibe-grid-status-badge",
2974
- class: _(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", g.value.kind === "end" ? "border-amber-300/35 text-amber-200" : g.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2975
- }, k(g.value.message), 3))], 2)) : o("", !0)
3213
+ class: _(["inline-flex items-center border border-white/14 bg-black/55 px-4 py-3 text-[0.7rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/72 backdrop-blur-[18px]", b.value.kind === "end" ? "border-amber-300/35 text-amber-200" : b.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
3214
+ }, k(b.value.message), 3))], 2)) : o("", !0),
3215
+ j(O) && j(T) ? (S(), a(qt, {
3216
+ key: 3,
3217
+ class: _(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
3218
+ message: j(T).message,
3219
+ mode: j(T).mode,
3220
+ surface: j(T).surface
3221
+ }, {
3222
+ default: L(() => [j(M) ? D(e.$slots, "empty-state", v(h({ key: 0 }, j(T)))) : o("", !0)]),
3223
+ _: 3
3224
+ }, 8, [
3225
+ "class",
3226
+ "message",
3227
+ "mode",
3228
+ "surface"
3229
+ ])) : o("", !0)
2976
3230
  ]));
2977
3231
  }
2978
- }), Hr = ["data-surface-mode"], Ur = {
3232
+ }), ei = ["data-surface-mode"], ti = {
2979
3233
  key: 1,
2980
3234
  class: "absolute left-5 top-5 z-30 border border-amber-400/45 bg-black/35 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-amber-100 backdrop-blur"
2981
- }, Wr = {
2982
- key: 2,
3235
+ }, ni = ["data-visible", "inert"], ri = ["data-visible", "inert"], ii = {
3236
+ key: 3,
2983
3237
  class: "relative z-[1] grid h-full w-full content-center justify-items-center gap-6 px-[clamp(2rem,4vw,3rem)] py-[clamp(2rem,4vw,3rem)] text-center"
2984
- }, Gr = ["data-visible", "inert"], Kr = ["data-visible", "inert"], qr = /* @__PURE__ */ d({
3238
+ }, ai = /* @__PURE__ */ d({
2985
3239
  name: "VibeLayout",
2986
3240
  __name: "Layout",
2987
3241
  props: {
3242
+ emptyStateMode: {},
2988
3243
  fillDelayMs: {},
2989
3244
  fillDelayStepMs: {},
2990
3245
  initialCursor: {},
@@ -3004,9 +3259,9 @@ var br = ["aria-label"], xr = {
3004
3259
  "update:surfaceMode"
3005
3260
  ],
3006
3261
  setup(e, { expose: n, emit: i }) {
3007
- let d = e, p = M(), m = i, h = Ve(d, m), g = se((e) => {
3262
+ let d = e, p = N(), m = i, h = We(d, m), g = Z((e) => {
3008
3263
  m("asset-errors", e);
3009
- }), _ = X((e) => {
3264
+ }), _ = se((e) => {
3010
3265
  m("asset-loads", e);
3011
3266
  });
3012
3267
  return b(() => {
@@ -3031,14 +3286,7 @@ var br = ["aria-label"], xr = {
3031
3286
  type: "button",
3032
3287
  class: "absolute left-5 top-5 z-30 inline-flex items-center border border-rose-400/55 bg-rose-500/18 px-4 py-2 text-xs font-medium uppercase tracking-[0.24em] text-white backdrop-blur transition hover:bg-rose-500/28",
3033
3288
  onClick: n[0] ||= (...e) => j(h).retryInitialLoad && j(h).retryInitialLoad(...e)
3034
- }, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", Ur, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).items.value.length === 0 ? (S(), s("div", Wr, [j(h).loading.value ? (S(), s(t, { key: 0 }, [u(j(re), {
3035
- class: "size-10 animate-spin text-[#f7f1ea]/82",
3036
- "aria-hidden": "true"
3037
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)], 64)) : (S(), s(t, { key: 1 }, [
3038
- n[2] ||= c("p", { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/68" }, " Viewer ready ", -1),
3039
- n[3] ||= c("h2", { class: "m-0 text-[clamp(2rem,4.4vw,3.6rem)] leading-[0.95] tracking-[-0.05em]" }, " No items available ", -1),
3040
- n[4] ||= c("p", { class: "m-0 text-[clamp(0.98rem,1.3vw,1.12rem)] leading-[1.8] text-[#f7f1ea]/70" }, " Attach items to VibeLayout to turn this screen into the viewer. ", -1)
3041
- ], 64))])) : j(h).isDesktop.value ? (S(), s(t, { key: 3 }, [u(r, {
3289
+ }, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", ti, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).isDesktop.value ? (S(), s(t, { key: 2 }, [u(r, {
3042
3290
  appear: "",
3043
3291
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
3044
3292
  "enter-from-class": "translate-y-3 opacity-0",
@@ -3047,12 +3295,12 @@ var br = ["aria-label"], xr = {
3047
3295
  "leave-from-class": "translate-y-0 opacity-100",
3048
3296
  "leave-to-class": "translate-y-3 opacity-0"
3049
3297
  }, {
3050
- default: I(() => [L(c("div", {
3298
+ default: L(() => [R(c("div", {
3051
3299
  "data-testid": "vibe-list-surface",
3052
3300
  "data-visible": j(h).surfaceMode.value === "list" ? "true" : "false",
3053
3301
  inert: j(h).surfaceMode.value !== "list",
3054
3302
  class: "absolute inset-0 z-[2]"
3055
- }, [u(Vr, {
3303
+ }, [u($r, {
3056
3304
  active: j(h).surfaceMode.value === "list",
3057
3305
  "allow-exhausted-next-page-refresh": j(h).canRefreshExhaustedNextPage.value,
3058
3306
  items: j(h).items.value,
@@ -3069,29 +3317,35 @@ var br = ["aria-label"], xr = {
3069
3317
  "report-asset-load": j(_).report,
3070
3318
  "request-next-page": j(h).prefetchNextPage,
3071
3319
  "request-previous-page": j(h).prefetchPreviousPage,
3320
+ "empty-state-mode": d.emptyStateMode,
3072
3321
  "show-status-badges": d.showStatusBadges ?? !0,
3073
3322
  onOpenFullscreen: j(h).openFullscreen,
3074
3323
  "onUpdate:activeIndex": j(h).setActiveIndex
3075
3324
  }, l({ _: 2 }, [
3325
+ p["empty-state"] ? {
3326
+ name: "empty-state",
3327
+ fn: L((t) => [D(e.$slots, "empty-state", v(f(t)))]),
3328
+ key: "0"
3329
+ } : void 0,
3076
3330
  p["grid-footer"] ? {
3077
3331
  name: "grid-footer",
3078
- fn: I(() => [D(e.$slots, "grid-footer")]),
3079
- key: "0"
3332
+ fn: L(() => [D(e.$slots, "grid-footer")]),
3333
+ key: "1"
3080
3334
  } : void 0,
3081
3335
  p["grid-item-overlay"] ? {
3082
3336
  name: "grid-item-overlay",
3083
- fn: I((t) => [D(e.$slots, "grid-item-overlay", v(f(t)))]),
3084
- key: "1"
3337
+ fn: L((t) => [D(e.$slots, "grid-item-overlay", v(f(t)))]),
3338
+ key: "2"
3085
3339
  } : void 0,
3086
3340
  p["grid-status"] ? {
3087
3341
  name: "grid-status",
3088
- fn: I((t) => [D(e.$slots, "grid-status", v(f(t)))]),
3089
- key: "2"
3342
+ fn: L((t) => [D(e.$slots, "grid-status", v(f(t)))]),
3343
+ key: "3"
3090
3344
  } : void 0,
3091
3345
  p["item-icon"] ? {
3092
3346
  name: "item-icon",
3093
- fn: I((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3094
- key: "3"
3347
+ fn: L((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3348
+ key: "4"
3095
3349
  } : void 0
3096
3350
  ]), 1032, [
3097
3351
  "active",
@@ -3110,10 +3364,11 @@ var br = ["aria-label"], xr = {
3110
3364
  "report-asset-load",
3111
3365
  "request-next-page",
3112
3366
  "request-previous-page",
3367
+ "empty-state-mode",
3113
3368
  "show-status-badges",
3114
3369
  "onOpenFullscreen",
3115
3370
  "onUpdate:activeIndex"
3116
- ])], 8, Gr), [[N, j(h).surfaceMode.value === "list"]])]),
3371
+ ])], 8, ni), [[P, j(h).surfaceMode.value === "list"]])]),
3117
3372
  _: 3
3118
3373
  }), u(r, {
3119
3374
  appear: "",
@@ -3124,12 +3379,12 @@ var br = ["aria-label"], xr = {
3124
3379
  "leave-from-class": "translate-y-0 opacity-100",
3125
3380
  "leave-to-class": "-translate-y-3 opacity-0"
3126
3381
  }, {
3127
- default: I(() => [L(c("div", {
3382
+ default: L(() => [R(c("div", {
3128
3383
  "data-testid": "vibe-fullscreen-surface",
3129
3384
  "data-visible": j(h).surfaceMode.value === "fullscreen" ? "true" : "false",
3130
3385
  inert: j(h).surfaceMode.value !== "fullscreen",
3131
3386
  class: "absolute inset-0 z-[3]"
3132
- }, [u(gn, {
3387
+ }, [u(Tn, {
3133
3388
  items: j(h).items.value,
3134
3389
  active: j(h).surfaceMode.value === "fullscreen",
3135
3390
  "active-index": j(h).activeIndex.value,
@@ -3140,36 +3395,42 @@ var br = ["aria-label"], xr = {
3140
3395
  phase: j(h).phase.value,
3141
3396
  "report-asset-error": j(g).report,
3142
3397
  "report-asset-load": j(_).report,
3398
+ "empty-state-mode": d.emptyStateMode,
3143
3399
  "show-end-badge": d.showEndBadge ?? !0,
3144
3400
  "show-status-badges": d.showStatusBadges ?? !0,
3145
3401
  "show-back-to-list": j(h).showBackToList.value,
3146
3402
  onBackToList: j(h).returnToList,
3147
3403
  "onUpdate:activeIndex": j(h).setActiveIndex
3148
3404
  }, l({ _: 2 }, [
3405
+ p["empty-state"] ? {
3406
+ name: "empty-state",
3407
+ fn: L((t) => [D(e.$slots, "empty-state", v(f(t)))]),
3408
+ key: "0"
3409
+ } : void 0,
3149
3410
  p["fullscreen-overlay"] ? {
3150
3411
  name: "fullscreen-overlay",
3151
- fn: I((t) => [D(e.$slots, "fullscreen-overlay", v(f(t)))]),
3152
- key: "0"
3412
+ fn: L((t) => [D(e.$slots, "fullscreen-overlay", v(f(t)))]),
3413
+ key: "1"
3153
3414
  } : void 0,
3154
3415
  p["fullscreen-aside"] ? {
3155
3416
  name: "fullscreen-aside",
3156
- fn: I((t) => [D(e.$slots, "fullscreen-aside", v(f(t)))]),
3157
- key: "1"
3417
+ fn: L((t) => [D(e.$slots, "fullscreen-aside", v(f(t)))]),
3418
+ key: "2"
3158
3419
  } : void 0,
3159
3420
  p["fullscreen-header-actions"] ? {
3160
3421
  name: "fullscreen-header-actions",
3161
- fn: I((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
3162
- key: "2"
3422
+ fn: L((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
3423
+ key: "3"
3163
3424
  } : void 0,
3164
3425
  p["fullscreen-status"] ? {
3165
3426
  name: "fullscreen-status",
3166
- fn: I((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
3167
- key: "3"
3427
+ fn: L((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
3428
+ key: "4"
3168
3429
  } : void 0,
3169
3430
  p["item-icon"] ? {
3170
3431
  name: "item-icon",
3171
- fn: I((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3172
- key: "4"
3432
+ fn: L((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3433
+ key: "5"
3173
3434
  } : void 0
3174
3435
  ]), 1032, [
3175
3436
  "items",
@@ -3182,14 +3443,18 @@ var br = ["aria-label"], xr = {
3182
3443
  "phase",
3183
3444
  "report-asset-error",
3184
3445
  "report-asset-load",
3446
+ "empty-state-mode",
3185
3447
  "show-end-badge",
3186
3448
  "show-status-badges",
3187
3449
  "show-back-to-list",
3188
3450
  "onBackToList",
3189
3451
  "onUpdate:activeIndex"
3190
- ])], 8, Kr), [[N, j(h).surfaceMode.value === "fullscreen"]])]),
3452
+ ])], 8, ri), [[P, j(h).surfaceMode.value === "fullscreen"]])]),
3191
3453
  _: 3
3192
- })], 64)) : (S(), a(gn, {
3454
+ })], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", ii, [u(j(re), {
3455
+ class: "size-10 animate-spin text-[#f7f1ea]/82",
3456
+ "aria-hidden": "true"
3457
+ }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(Tn, {
3193
3458
  key: 4,
3194
3459
  items: j(h).items.value,
3195
3460
  active: !0,
@@ -3201,36 +3466,42 @@ var br = ["aria-label"], xr = {
3201
3466
  phase: j(h).phase.value,
3202
3467
  "report-asset-error": j(g).report,
3203
3468
  "report-asset-load": j(_).report,
3469
+ "empty-state-mode": d.emptyStateMode,
3204
3470
  "show-end-badge": d.showEndBadge ?? !0,
3205
3471
  "show-status-badges": d.showStatusBadges ?? !0,
3206
3472
  "show-back-to-list": !1,
3207
3473
  onBackToList: j(h).returnToList,
3208
3474
  "onUpdate:activeIndex": j(h).setActiveIndex
3209
3475
  }, l({ _: 2 }, [
3476
+ p["empty-state"] ? {
3477
+ name: "empty-state",
3478
+ fn: L((t) => [D(e.$slots, "empty-state", v(f(t)))]),
3479
+ key: "0"
3480
+ } : void 0,
3210
3481
  p["fullscreen-overlay"] ? {
3211
3482
  name: "fullscreen-overlay",
3212
- fn: I((t) => [D(e.$slots, "fullscreen-overlay", v(f(t)))]),
3213
- key: "0"
3483
+ fn: L((t) => [D(e.$slots, "fullscreen-overlay", v(f(t)))]),
3484
+ key: "1"
3214
3485
  } : void 0,
3215
3486
  p["fullscreen-aside"] ? {
3216
3487
  name: "fullscreen-aside",
3217
- fn: I((t) => [D(e.$slots, "fullscreen-aside", v(f(t)))]),
3218
- key: "1"
3488
+ fn: L((t) => [D(e.$slots, "fullscreen-aside", v(f(t)))]),
3489
+ key: "2"
3219
3490
  } : void 0,
3220
3491
  p["fullscreen-header-actions"] ? {
3221
3492
  name: "fullscreen-header-actions",
3222
- fn: I((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
3223
- key: "2"
3493
+ fn: L((t) => [D(e.$slots, "fullscreen-header-actions", v(f(t)))]),
3494
+ key: "3"
3224
3495
  } : void 0,
3225
3496
  p["fullscreen-status"] ? {
3226
3497
  name: "fullscreen-status",
3227
- fn: I((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
3228
- key: "3"
3498
+ fn: L((t) => [D(e.$slots, "fullscreen-status", v(f(t)))]),
3499
+ key: "4"
3229
3500
  } : void 0,
3230
3501
  p["item-icon"] ? {
3231
3502
  name: "item-icon",
3232
- fn: I((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3233
- key: "4"
3503
+ fn: L((t) => [D(e.$slots, "item-icon", v(f(t)))]),
3504
+ key: "5"
3234
3505
  } : void 0
3235
3506
  ]), 1032, [
3236
3507
  "items",
@@ -3242,14 +3513,15 @@ var br = ["aria-label"], xr = {
3242
3513
  "phase",
3243
3514
  "report-asset-error",
3244
3515
  "report-asset-load",
3516
+ "empty-state-mode",
3245
3517
  "show-end-badge",
3246
3518
  "show-status-badges",
3247
3519
  "onBackToList",
3248
3520
  "onUpdate:activeIndex"
3249
- ]))], 8, Hr));
3521
+ ]))], 8, ei));
3250
3522
  }
3251
- }), Jr = { install(e) {
3252
- e.component("VibeLayout", qr);
3523
+ }), oi = { install(e) {
3524
+ e.component("VibeLayout", ai);
3253
3525
  } };
3254
3526
  //#endregion
3255
- export { qr as VibeLayout, Jr as VibePlugin, Jr as default };
3527
+ export { ai as VibeLayout, oi as VibePlugin, oi as default };