@wyxos/vibe 3.0.16 → 3.1.1

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
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 ee = (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
- }, B = (e) => e === "", V = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), te = (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(), ee = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), U = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), W = (e) => {
7
+ let t = U(e);
8
8
  return t.charAt(0).toUpperCase() + t.slice(1);
9
- }, W = {
9
+ }, G = {
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
11
  width: 24,
12
12
  height: 24,
@@ -16,27 +16,27 @@ var ee = (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
+ }, K = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = G.width, color: s = G.stroke, ...c }, { slots: l }) => p("svg", {
20
+ ...G,
21
21
  ...c,
22
22
  width: o,
23
23
  height: o,
24
24
  stroke: s,
25
- "stroke-width": B(n) || B(r) || n === !0 || r === !0 ? Number(i || a || W["stroke-width"]) * 24 / Number(o) : i || a || W["stroke-width"],
26
- class: V("lucide", c.class, ...e ? [`lucide-${te(U(e))}-icon`, `lucide-${te(e)}`] : ["lucide-icon"]),
27
- ...!l.default && !ee(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 || G["stroke-width"]) * 24 / Number(o) : i || a || G["stroke-width"],
26
+ class: H("lucide", c.class, ...e ? [`lucide-${ee(W(e))}-icon`, `lucide-${ee(e)}`] : ["lucide-icon"]),
27
+ ...!l.default && !B(c) && { "aria-hidden": "true" }
28
+ }, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), q = (e, t) => (n, { slots: r, attrs: i }) => p(K, {
29
29
  ...i,
30
30
  ...n,
31
31
  iconNode: t,
32
32
  name: e
33
- }, r), q = K("arrow-left", [["path", {
33
+ }, r), te = q("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
+ }]]), J = q("audio-lines", [
40
40
  ["path", {
41
41
  d: "M2 10v3",
42
42
  key: "1fnikh"
@@ -61,7 +61,7 @@ var ee = (e) => {
61
61
  d: "M22 10v3",
62
62
  key: "154ddg"
63
63
  }]
64
- ]), Y = K("clapperboard", [
64
+ ]), ne = q("clapperboard", [
65
65
  ["path", {
66
66
  d: "m12.296 3.464 3.02 3.956",
67
67
  key: "qash78"
@@ -78,13 +78,13 @@ var ee = (e) => {
78
78
  d: "m6.18 5.276 3.1 3.899",
79
79
  key: "zjj9t3"
80
80
  }]
81
- ]), X = K("file", [["path", {
81
+ ]), Y = q("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
+ }]]), X = q("image-plus", [
88
88
  ["path", {
89
89
  d: "M16 5h6",
90
90
  key: "1vod17"
@@ -107,10 +107,10 @@ var ee = (e) => {
107
107
  r: "2",
108
108
  key: "af1f0g"
109
109
  }]
110
- ]), re = K("loader-circle", [["path", {
110
+ ]), re = q("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 = q("pause", [["rect", {
114
114
  x: "14",
115
115
  y: "3",
116
116
  width: "5",
@@ -124,10 +124,10 @@ var ee = (e) => {
124
124
  height: "18",
125
125
  rx: "1",
126
126
  key: "1wsw3u"
127
- }]]), ae = K("play", [["path", {
127
+ }]]), ae = q("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 = q("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"
@@ -140,13 +140,13 @@ var ee = (e) => {
140
140
  d: "M12 17h.01",
141
141
  key: "p32p05"
142
142
  }]
143
- ]), se = K("volume-1", [["path", {
143
+ ]), se = q("volume-1", [["path", {
144
144
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
145
145
  key: "uqj9uw"
146
146
  }], ["path", {
147
147
  d: "M16 9a5 5 0 0 1 0 6",
148
148
  key: "1q6k2b"
149
- }]]), ce = K("volume-2", [
149
+ }]]), ce = q("volume-2", [
150
150
  ["path", {
151
151
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
152
152
  key: "uqj9uw"
@@ -159,7 +159,7 @@ var ee = (e) => {
159
159
  d: "M19.364 18.364a9 9 0 0 0 0-12.728",
160
160
  key: "ijwkga"
161
161
  }]
162
- ]), Z = K("volume-x", [
162
+ ]), Z = q("volume-x", [
163
163
  ["path", {
164
164
  d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
165
165
  key: "uqj9uw"
@@ -437,7 +437,7 @@ function Ve() {
437
437
  //#endregion
438
438
  //#region src/components/viewer-core/useAutoResolveSource.ts
439
439
  function He(e) {
440
- 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 = Ve(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = T(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, S = 0, C = i(() => Be(e.fillDelayMs, Ie)), w = i(() => Be(e.fillDelayStepMs, Le)), E = i(() => typeof e.resolve == "function"), D = i(() => e.mode ?? "dynamic"), O = i(() => me(e.pageSize)), k = i(() => Se(n.value)), A = i(() => Ce(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => pe(c.value) || p.value), N = i(() => Ue(n.value, e.removedIds.value)), P = i(() => We(n.value, e.removedIds.value)), I = i(() => P.value?.nextCursor ?? null), L = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!I.value), z = i(() => !!L.value), ee = i(() => E.value && n.value.length > 0), B = i(() => Ce(Se(a.value), e.removedIds.value)), V = i(() => Ee(n.value, e.removedIds.value, j.value)), te = i(() => !A.value.length && !M.value && !!s.value);
440
+ 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 = Ve(), d = u.remainingMs, f = T(null), p = T(!1), m = T(!0), h = T(!1), g = /* @__PURE__ */ new Set(), _ = null, v = null, y = 0, S = 0, C = i(() => Be(e.fillDelayMs, Ie)), w = i(() => Be(e.fillDelayStepMs, Le)), E = i(() => typeof e.resolve == "function"), D = i(() => e.mode ?? "dynamic"), O = i(() => me(e.pageSize)), k = i(() => Se(n.value)), A = i(() => Ce(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => pe(c.value) || p.value), N = i(() => Ue(n.value, e.removedIds.value)), P = i(() => We(n.value, e.removedIds.value)), I = i(() => P.value?.nextCursor ?? null), L = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!I.value), z = i(() => !!L.value), B = i(() => E.value && n.value.length > 0), V = i(() => Ce(Se(a.value), e.removedIds.value)), H = i(() => Ee(n.value, e.removedIds.value, j.value)), ee = i(() => !A.value.length && !M.value && !!s.value);
441
441
  F(() => A.value.length, (e) => {
442
442
  if (e === 0) {
443
443
  r.value = 0;
@@ -447,12 +447,12 @@ function He(e) {
447
447
  }), F(() => r.value, () => {
448
448
  m.value && se();
449
449
  }), x(() => {
450
- fe() || e.resolve && H();
450
+ fe() || e.resolve && U();
451
451
  }), b(() => {
452
452
  _?.abort(), _ = null, u.clear(!0);
453
453
  });
454
- async function H() {
455
- v = H;
454
+ async function U() {
455
+ v = U;
456
456
  let t = await ue({
457
457
  continueUntilFilled: D.value === "dynamic",
458
458
  cursor: e.initialCursor ?? null,
@@ -461,33 +461,33 @@ function He(e) {
461
461
  });
462
462
  t && (n.value = t.buckets, r.value = 0, Q());
463
463
  }
464
- async function U() {
464
+ async function W() {
465
465
  if (!(h.value || M.value)) {
466
- if (!R.value) return ee.value ? le("trailing") : void 0;
466
+ if (!R.value) return B.value ? le("trailing") : void 0;
467
467
  if (D.value === "static" && ve("trailing")) return le("trailing");
468
468
  await ce(I.value);
469
469
  }
470
470
  }
471
- async function W() {
471
+ async function G() {
472
472
  if (!(h.value || !z.value || M.value)) {
473
473
  if (D.value === "static" && ve("leading")) return le("leading");
474
474
  await Z(L.value);
475
475
  }
476
476
  }
477
- async function G() {
478
- if (te.value) {
477
+ async function K() {
478
+ if (ee.value) {
479
479
  if (n.value = [], r.value = 0, a.value = [], o.value = !1, s.value = null, c.value = E.value ? "initializing" : "idle", l.value = null, f.value = null, p.value = !1, g.clear(), _?.abort(), _ = null, u.clear(!0), fe()) {
480
480
  Q();
481
481
  return;
482
482
  }
483
- await H();
483
+ await U();
484
484
  }
485
485
  }
486
- async function K() {
487
- if (te.value) return G();
486
+ async function q() {
487
+ if (ee.value) return K();
488
488
  h.value || c.value !== "failed" || !v || (s.value = null, await v());
489
489
  }
490
- async function q() {
490
+ async function te() {
491
491
  if (!a.value.length) return p.value = !1, Q();
492
492
  n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
493
493
  }
@@ -497,13 +497,13 @@ function He(e) {
497
497
  let i = ge(t, 0, n.length - 1);
498
498
  i !== r.value && (r.value = i, e.emit("update:activeIndex", i));
499
499
  }
500
- function Y(e) {
500
+ function ne(e) {
501
501
  m.value = e;
502
502
  }
503
- function X() {
503
+ function Y() {
504
504
  h.value = !0, u.clear(!0);
505
505
  }
506
- function ne() {
506
+ function X() {
507
507
  h.value = !1;
508
508
  }
509
509
  function re() {
@@ -531,15 +531,15 @@ function He(e) {
531
531
  r.value = Pe(A.value, j.value, e);
532
532
  }
533
533
  function oe() {
534
- a.value.length > 0 && !B.value.length && q();
534
+ a.value.length > 0 && !V.value.length && te();
535
535
  }
536
536
  async function se() {
537
537
  if (!(!m.value || _e())) {
538
538
  if (!A.value.length) {
539
- R.value && await U();
539
+ R.value && await W();
540
540
  return;
541
541
  }
542
- z.value && r.value < 3 && await W(), R.value && r.value >= A.value.length - 3 && await U();
542
+ z.value && r.value < 3 && await G(), R.value && r.value >= A.value.length - 3 && await W();
543
543
  }
544
544
  }
545
545
  async function ce(e) {
@@ -554,7 +554,7 @@ function He(e) {
554
554
  });
555
555
  if (t) {
556
556
  if (t.canceled) return n.value = [...n.value, ...t.buckets], a.value = [], p.value = !1, Q();
557
- if (a.value = t.buckets, !B.value.length) return n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
557
+ if (a.value = t.buckets, !V.value.length) return n.value = [...n.value, ...a.value], a.value = [], p.value = !1, Q();
558
558
  p.value = !0;
559
559
  }
560
560
  }
@@ -694,11 +694,11 @@ function He(e) {
694
694
  }
695
695
  return {
696
696
  activeIndex: j,
697
- canRetryInitialLoad: te,
697
+ canRetryInitialLoad: ee,
698
698
  cancel: re,
699
- canRefreshTrailingBoundary: ee,
700
- commitPendingAppend: q,
701
- currentCursor: V,
699
+ canRefreshTrailingBoundary: B,
700
+ commitPendingAppend: te,
701
+ currentCursor: H,
702
702
  errorMessage: s,
703
703
  fillCollectedCount: l,
704
704
  fillDelayRemainingMs: d,
@@ -708,22 +708,22 @@ function He(e) {
708
708
  isAutoPrefetchEnabled: m,
709
709
  isPageLoadingLocked: h,
710
710
  items: A,
711
- lockPageLoading: X,
711
+ lockPageLoading: Y,
712
712
  loading: M,
713
713
  mode: D,
714
714
  maybePrefetchAround: se,
715
715
  nextCursor: I,
716
- pendingAppendItems: B,
716
+ pendingAppendItems: V,
717
717
  phase: c,
718
- prefetchNextPage: U,
719
- prefetchPreviousPage: W,
718
+ prefetchNextPage: W,
719
+ prefetchPreviousPage: G,
720
720
  previousCursor: L,
721
- retryInitialLoad: G,
722
- retry: K,
721
+ retryInitialLoad: K,
722
+ retry: q,
723
723
  setActiveIndex: J,
724
- setAutoPrefetchEnabled: Y,
724
+ setAutoPrefetchEnabled: ne,
725
725
  syncActiveIndexAfterVisibilityChange: ae,
726
- unlockPageLoading: ne,
726
+ unlockPageLoading: X,
727
727
  getActiveOccurrenceKey: ie,
728
728
  maybeCommitPendingAppendWhenFilteredOut: oe
729
729
  };
@@ -831,7 +831,10 @@ function Ge(e, t) {
831
831
  //#region src/components/viewer-core/useController.ts
832
832
  var Ke = 1024;
833
833
  function qe(e, t) {
834
- let n = Ge(e, t), r = T(0), a = T("list"), o = C({
834
+ let n = Ge(e, t), r = C({
835
+ nextBoundaryLoadProgress: 0,
836
+ previousBoundaryLoadProgress: 0
837
+ }), a = T(0), o = T("list"), s = C({
835
838
  activeIndex: 0,
836
839
  currentCursor: null,
837
840
  errorMessage: null,
@@ -843,19 +846,21 @@ function qe(e, t) {
843
846
  itemCount: 0,
844
847
  loadState: "loaded",
845
848
  mode: "dynamic",
849
+ nextBoundaryLoadProgress: 0,
846
850
  nextCursor: null,
847
851
  pageLoadingLocked: !1,
848
852
  phase: "idle",
853
+ previousBoundaryLoadProgress: 0,
849
854
  previousCursor: null,
850
855
  removedCount: 0,
851
856
  removedIds: [],
852
857
  surfaceMode: "list"
853
- }), s = i(() => r.value >= Ke), c = i(() => s.value ? a.value : "fullscreen"), l = i(() => s.value && c.value === "fullscreen");
854
- F(s, (e) => {
855
- e && m();
858
+ }), c = i(() => a.value >= Ke), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
859
+ F(c, (e) => {
860
+ e && h();
856
861
  }), F(() => e.surfaceMode, () => {
857
- m();
858
- }), F([c, () => n.pendingAppendItems.value.length], ([e, t]) => {
862
+ h();
863
+ }), F([l, () => n.pendingAppendItems.value.length], ([e, t]) => {
859
864
  e === "list" || t <= 0 || n.commitPendingAppend();
860
865
  }), F([
861
866
  () => n.items.value.length,
@@ -863,64 +868,71 @@ function qe(e, t) {
863
868
  () => n.hasNextPage.value,
864
869
  () => n.pendingAppendItems.value.length
865
870
  ], ([e, n, r, i]) => {
866
- !s.value || e > 0 || a.value === "list" || n || r || i > 0 || (a.value = "list", t("update:surfaceMode", "list"));
867
- }), F(c, (e) => {
871
+ !c.value || e > 0 || o.value === "list" || n || r || i > 0 || (o.value = "list", t("update:surfaceMode", "list"));
872
+ }), F(l, (e) => {
868
873
  n.setAutoPrefetchEnabled(e === "fullscreen");
869
874
  }, { immediate: !0 }), I(() => {
870
- 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.pageLoadingLocked = n.isPageLoadingLocked.value, o.phase = n.phase.value, o.previousCursor = n.previousCursor.value, o.removedCount = n.removedCount.value, o.removedIds = n.getRemovedIds(), o.surfaceMode = c.value;
875
+ s.activeIndex = n.activeIndex.value, s.currentCursor = n.currentCursor.value, s.errorMessage = n.errorMessage.value, s.fillCollectedCount = n.fillCollectedCount.value, s.fillDelayRemainingMs = n.fillDelayRemainingMs.value, s.fillTargetCount = n.fillTargetCount.value, s.hasNextPage = n.hasNextPage.value, s.hasPreviousPage = n.hasPreviousPage.value, s.itemCount = n.items.value.length, s.loadState = n.loading.value ? "loading" : n.errorMessage.value ? "failed" : "loaded", s.mode = n.mode.value, s.nextBoundaryLoadProgress = r.nextBoundaryLoadProgress, s.nextCursor = n.nextCursor.value, s.pageLoadingLocked = n.isPageLoadingLocked.value, s.phase = n.phase.value, s.previousBoundaryLoadProgress = r.previousBoundaryLoadProgress, s.previousCursor = n.previousCursor.value, s.removedCount = n.removedCount.value, s.removedIds = n.getRemovedIds(), s.surfaceMode = l.value;
871
876
  }), x(() => {
872
- p(), m(), window.addEventListener("keydown", f), window.addEventListener("resize", p);
877
+ m(), h(), window.addEventListener("keydown", p), window.addEventListener("resize", m);
873
878
  }), b(() => {
874
- window.removeEventListener("keydown", f), window.removeEventListener("resize", p);
879
+ window.removeEventListener("keydown", p), window.removeEventListener("resize", m);
875
880
  });
876
- function u(e) {
877
- n.setActiveIndex(e), s.value && a.value !== "fullscreen" && (a.value = "fullscreen", t("update:surfaceMode", "fullscreen"));
878
- }
879
- function d() {
880
- !s.value || a.value === "list" || (a.value = "list", t("update:surfaceMode", "list"));
881
+ function d(e) {
882
+ n.setActiveIndex(e), c.value && o.value !== "fullscreen" && (o.value = "fullscreen", t("update:surfaceMode", "fullscreen"));
881
883
  }
882
- function f(e) {
883
- e.defaultPrevented || e.key !== "Escape" || !s.value || c.value !== "fullscreen" || Q(e.target) || (e.preventDefault(), d());
884
+ function f() {
885
+ !c.value || o.value === "list" || (o.value = "list", t("update:surfaceMode", "list"));
884
886
  }
885
- function p() {
886
- r.value = window.innerWidth || 0;
887
+ function p(e) {
888
+ e.defaultPrevented || e.key !== "Escape" || !c.value || l.value !== "fullscreen" || Q(e.target) || (e.preventDefault(), f());
887
889
  }
888
890
  function m() {
889
- !s.value || !e.surfaceMode || e.surfaceMode === a.value || (a.value = e.surfaceMode);
891
+ a.value = window.innerWidth || 0;
892
+ }
893
+ function h() {
894
+ !c.value || !e.surfaceMode || e.surfaceMode === o.value || (o.value = e.surfaceMode);
895
+ }
896
+ function g(e) {
897
+ r.nextBoundaryLoadProgress = Je(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = Je(e.previousBoundaryLoadProgress);
890
898
  }
891
899
  return {
892
900
  ...n,
893
901
  cancel: n.cancel,
894
- isDesktop: s,
902
+ isDesktop: c,
895
903
  lockPageLoading: n.lockPageLoading,
896
904
  loadNext: n.loadNext,
897
905
  loadPrevious: n.loadPrevious,
898
- openFullscreen: u,
899
- returnToList: d,
906
+ openFullscreen: d,
907
+ returnToList: f,
900
908
  retry: n.retry,
901
- showBackToList: l,
902
- status: w(o),
903
- surfaceMode: c,
909
+ setBoundaryLoadProgress: g,
910
+ showBackToList: u,
911
+ status: w(s),
912
+ surfaceMode: l,
904
913
  unlockPageLoading: n.unlockPageLoading
905
914
  };
906
915
  }
916
+ function Je(e) {
917
+ return Math.min(Math.max(e, 0), 1);
918
+ }
907
919
  //#endregion
908
920
  //#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
909
- var Je = {
921
+ var Ye = {
910
922
  "data-testid": "vibe-media-bar",
911
923
  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]"
912
- }, Ye = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, Xe = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Ze = { class: "relative h-4 w-full" }, Qe = [
924
+ }, Xe = { class: "grid grid-cols-[auto_minmax(0,1fr)_auto_auto] items-center gap-3 border-t border-white/12 bg-black/70 px-4 py-3 backdrop-blur-[18px]" }, Ze = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, Qe = { class: "relative h-4 w-full" }, $e = [
913
925
  "max",
914
926
  "value",
915
927
  "disabled"
916
- ], $e = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, et = ["data-layout"], tt = {
928
+ ], et = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, tt = ["data-layout"], nt = {
917
929
  key: 0,
918
930
  "data-testid": "vibe-media-volume-popover",
919
931
  class: "absolute bottom-[calc(100%+0.8rem)] right-0 grid justify-items-center gap-3 border border-white/12 bg-black/82 px-3 py-4 shadow-[0_20px_50px_-20px_rgba(0,0,0,0.85)] backdrop-blur-[18px]"
920
- }, nt = { class: "relative flex h-28 w-4 items-center justify-center" }, rt = ["value"], it = { class: "flex items-center gap-3" }, at = ["aria-label"], ot = {
932
+ }, rt = { class: "relative flex h-28 w-4 items-center justify-center" }, it = ["value"], at = { class: "flex items-center gap-3" }, ot = ["aria-label"], st = {
921
933
  key: 0,
922
934
  class: "relative h-4 w-24"
923
- }, st = ["value"], ct = /* @__PURE__ */ d({
935
+ }, ct = ["value"], lt = /* @__PURE__ */ d({
924
936
  __name: "FullscreenMediaBar",
925
937
  props: {
926
938
  currentTime: {},
@@ -963,9 +975,9 @@ var Je = {
963
975
  function w(e, t, n) {
964
976
  return Math.min(Math.max(e, t), n);
965
977
  }
966
- return (e, t) => (S(), s("div", Je, [c("div", Ye, [
967
- c("span", Xe, k(n.currentTimeLabel), 1),
968
- c("div", Ze, [
978
+ return (e, t) => (S(), s("div", Ye, [c("div", Xe, [
979
+ c("span", Ze, k(n.currentTimeLabel), 1),
980
+ c("div", Qe, [
969
981
  t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
970
982
  c("div", {
971
983
  class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
@@ -982,16 +994,16 @@ var Je = {
982
994
  disabled: n.duration <= 0,
983
995
  class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
984
996
  onInput: t[0] ||= (e) => r("seek-input", e)
985
- }, null, 40, Qe)
997
+ }, null, 40, $e)
986
998
  ]),
987
- c("span", $e, k(n.durationLabel), 1),
999
+ c("span", et, k(n.durationLabel), 1),
988
1000
  c("div", {
989
1001
  ref_key: "rootRef",
990
1002
  ref: l,
991
1003
  "data-testid": "vibe-media-volume",
992
1004
  "data-layout": n.volumeControlLayout,
993
1005
  class: "relative flex items-center justify-end"
994
- }, [d.value && u.value ? (S(), s("div", tt, [c("div", nt, [
1006
+ }, [d.value && u.value ? (S(), s("div", nt, [c("div", rt, [
995
1007
  t[4] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
996
1008
  c("div", {
997
1009
  class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
@@ -1008,8 +1020,8 @@ var Je = {
1008
1020
  value: f.value,
1009
1021
  class: "vibe-media-slider absolute left-1/2 top-1/2 h-4 w-28 -translate-x-1/2 -translate-y-1/2 -rotate-90 bg-transparent",
1010
1022
  onInput: t[1] ||= (e) => r("volume-input", e)
1011
- }, null, 40, rt)
1012
- ])])) : o("", !0), c("div", it, [c("button", {
1023
+ }, null, 40, it)
1024
+ ])])) : o("", !0), c("div", at, [c("button", {
1013
1025
  type: "button",
1014
1026
  "data-testid": "vibe-media-volume-button",
1015
1027
  "aria-label": g.value,
@@ -1018,7 +1030,7 @@ var Je = {
1018
1030
  }, [(S(), a(O(m.value), {
1019
1031
  class: "h-4 w-4 stroke-[1.9]",
1020
1032
  "aria-hidden": "true"
1021
- }))], 8, at), n.volumeControlLayout === "horizontal" ? (S(), s("div", ot, [
1033
+ }))], 8, ot), n.volumeControlLayout === "horizontal" ? (S(), s("div", st, [
1022
1034
  t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
1023
1035
  c("div", {
1024
1036
  class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
@@ -1035,24 +1047,24 @@ var Je = {
1035
1047
  value: f.value,
1036
1048
  class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
1037
1049
  onInput: t[2] ||= (e) => r("volume-input", e)
1038
- }, null, 40, st)
1039
- ])) : o("", !0)])], 8, et)
1050
+ }, null, 40, ct)
1051
+ ])) : o("", !0)])], 8, tt)
1040
1052
  ])]));
1041
1053
  }
1042
- }), lt = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, ut = { class: "grid gap-4" }, dt = { class: "flex min-h-11 items-center justify-between gap-4" }, ft = { class: "min-w-0 flex flex-1 items-center gap-3" }, pt = {
1054
+ }), ut = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, dt = { class: "grid gap-4" }, ft = { class: "flex min-h-11 items-center justify-between gap-4" }, pt = { class: "min-w-0 flex flex-1 items-center gap-3" }, mt = {
1043
1055
  key: 1,
1044
1056
  "data-testid": "vibe-title",
1045
1057
  class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
1046
- }, mt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, ht = {
1058
+ }, ht = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, gt = {
1047
1059
  "data-testid": "vibe-pagination",
1048
1060
  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]"
1049
- }, gt = { class: "whitespace-nowrap" }, _t = {
1061
+ }, _t = { class: "whitespace-nowrap" }, vt = {
1050
1062
  key: 1,
1051
1063
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
1052
- }, vt = {
1064
+ }, yt = {
1053
1065
  key: 0,
1054
1066
  class: "grid gap-2 max-[720px]:justify-items-start"
1055
- }, yt = /* @__PURE__ */ d({
1067
+ }, bt = /* @__PURE__ */ d({
1056
1068
  __name: "FullscreenHeader",
1057
1069
  props: {
1058
1070
  currentIndex: {},
@@ -1066,58 +1078,58 @@ var Je = {
1066
1078
  emits: ["back-to-list"],
1067
1079
  setup(e, { emit: t }) {
1068
1080
  let n = e, r = t;
1069
- return (e, t) => (S(), s("div", lt, [c("div", ut, [c("div", dt, [c("div", ft, [n.showBackToList ? (S(), s("button", {
1081
+ return (e, t) => (S(), s("div", ut, [c("div", dt, [c("div", ft, [c("div", pt, [n.showBackToList ? (S(), s("button", {
1070
1082
  key: 0,
1071
1083
  type: "button",
1072
1084
  "data-testid": "vibe-back-to-list",
1073
1085
  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",
1074
1086
  "aria-label": "Back to list",
1075
1087
  onClick: t[0] ||= (e) => r("back-to-list")
1076
- }, [u(j(q), {
1088
+ }, [u(j(te), {
1077
1089
  class: "h-4 w-4 stroke-[2.2]",
1078
1090
  "aria-hidden": "true"
1079
- })])) : o("", !0), n.title ? (S(), s("h2", pt, k(n.title), 1)) : o("", !0)]), c("div", mt, [c("span", ht, [
1091
+ })])) : o("", !0), n.title ? (S(), s("h2", mt, k(n.title), 1)) : o("", !0)]), c("div", ht, [c("span", gt, [
1080
1092
  n.loading ? (S(), a(j(re), {
1081
1093
  key: 0,
1082
1094
  "data-testid": "vibe-pagination-spinner",
1083
1095
  class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
1084
1096
  "aria-hidden": "true"
1085
1097
  })) : o("", !0),
1086
- c("span", gt, k(n.currentIndex + 1) + " / " + k(n.total), 1),
1087
- n.paginationDetail ? (S(), s("span", _t, k(n.paginationDetail), 1)) : o("", !0)
1088
- ]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", vt, [...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)]));
1098
+ c("span", _t, k(n.currentIndex + 1) + " / " + k(n.total), 1),
1099
+ n.paginationDetail ? (S(), s("span", vt, k(n.paginationDetail), 1)) : o("", !0)
1100
+ ]), D(e.$slots, "actions")])])]), n.showEndBadge ? (S(), s("div", yt, [...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)]));
1089
1101
  }
1090
- }), bt = {
1091
- image: ne,
1092
- video: Y,
1102
+ }), xt = {
1103
+ image: X,
1104
+ video: ne,
1093
1105
  audio: J,
1094
- other: X
1095
- }, xt = {
1106
+ other: Y
1107
+ }, St = {
1096
1108
  image: "Image",
1097
1109
  video: "Video",
1098
1110
  audio: "Audio",
1099
1111
  other: "File"
1100
1112
  };
1101
- function St(e) {
1102
- return bt[e];
1103
- }
1104
1113
  function Ct(e) {
1105
1114
  return xt[e];
1106
1115
  }
1116
+ function wt(e) {
1117
+ return St[e];
1118
+ }
1107
1119
  //#endregion
1108
1120
  //#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
1109
- var wt = 1, Tt = 2;
1110
- function Et(e) {
1121
+ var Tt = 1, Et = 2;
1122
+ function Dt(e) {
1111
1123
  function t(e, t) {
1112
1124
  let n = t.title?.trim();
1113
- return n ? `${e} ${n}` : `${e} ${Ct(t.type).toLowerCase()}`;
1125
+ return n ? `${e} ${n}` : `${e} ${wt(t.type).toLowerCase()}`;
1114
1126
  }
1115
1127
  function n(e) {
1116
1128
  return $(e);
1117
1129
  }
1118
1130
  function r(t) {
1119
1131
  let n = e.resolvedActiveIndex.value;
1120
- return !!e.active.value && t >= n - wt && t <= n + Tt;
1132
+ return !!e.active.value && t >= n - Tt && t <= n + Et;
1121
1133
  }
1122
1134
  function i(t, i) {
1123
1135
  let a = n(i);
@@ -1152,11 +1164,11 @@ function Et(e) {
1152
1164
  }
1153
1165
  //#endregion
1154
1166
  //#region src/components/viewer-core/slotContent.ts
1155
- function Dt(e) {
1167
+ function Ot(e) {
1156
1168
  if (!Array.isArray(e)) return !1;
1157
1169
  for (let t of e) {
1158
1170
  if (Array.isArray(t)) {
1159
- if (Dt(t)) return !0;
1171
+ if (Ot(t)) return !0;
1160
1172
  continue;
1161
1173
  }
1162
1174
  if (!m(t)) {
@@ -1167,20 +1179,20 @@ function Dt(e) {
1167
1179
  if (t != null && t !== !1) return !0;
1168
1180
  continue;
1169
1181
  }
1170
- if (!Ot(t)) return !0;
1182
+ if (!kt(t)) return !0;
1171
1183
  }
1172
1184
  return !1;
1173
1185
  }
1174
- function Ot(r) {
1175
- return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Dt(r.children) : !1;
1186
+ function kt(r) {
1187
+ return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Ot(r.children) : !1;
1176
1188
  }
1177
1189
  //#endregion
1178
1190
  //#region src/components/viewer-core/useSurfaceEmptyState.ts
1179
- var kt = "no items available";
1180
- function At(e) {
1191
+ var At = "no items available";
1192
+ function jt(e) {
1181
1193
  let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
1182
1194
  loading: !!e.loading.value,
1183
- message: kt,
1195
+ message: At,
1184
1196
  mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
1185
1197
  surface: e.surface,
1186
1198
  total: e.itemCount.value
@@ -1188,23 +1200,23 @@ function At(e) {
1188
1200
  return {
1189
1201
  emptyStateProps: t,
1190
1202
  showBadgeEmptyState: i(() => t.value?.mode === "badge"),
1191
- showCustomEmptyState: i(() => Dt(n.value)),
1203
+ showCustomEmptyState: i(() => Ot(n.value)),
1192
1204
  showInlineEmptyState: i(() => t.value?.mode === "inline")
1193
1205
  };
1194
1206
  }
1195
1207
  //#endregion
1196
1208
  //#region src/components/viewer-core/format.ts
1197
- function jt(e) {
1209
+ function Mt(e) {
1198
1210
  if (!Number.isFinite(e) || e <= 0) return "0:00";
1199
1211
  let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
1200
1212
  return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
1201
1213
  }
1202
1214
  //#endregion
1203
1215
  //#region src/components/viewer-core/surfaceStatus.ts
1204
- function Mt(e) {
1216
+ function Nt(e) {
1205
1217
  return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
1206
1218
  }
1207
- function Nt(e) {
1219
+ function Pt(e) {
1208
1220
  return e.phase === "failed" ? {
1209
1221
  kind: "failed",
1210
1222
  message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
@@ -1227,7 +1239,7 @@ function Nt(e) {
1227
1239
  }
1228
1240
  //#endregion
1229
1241
  //#region src/components/viewer-core/useActivation.ts
1230
- function Pt(e) {
1242
+ function Ft(e) {
1231
1243
  let t = !1;
1232
1244
  F(e.enabled, async (t) => {
1233
1245
  if (n(t), t) {
@@ -1250,7 +1262,7 @@ function Pt(e) {
1250
1262
  }
1251
1263
  //#endregion
1252
1264
  //#region src/components/viewer-core/assetState.ts
1253
- var Ft = {
1265
+ var It = {
1254
1266
  currentTime: 0,
1255
1267
  duration: 0,
1256
1268
  errorKind: null,
@@ -1259,35 +1271,35 @@ var Ft = {
1259
1271
  ready: !1,
1260
1272
  volume: 1
1261
1273
  };
1262
- function It() {
1263
- return { ...Ft };
1274
+ function Lt() {
1275
+ return { ...It };
1264
1276
  }
1265
- function Lt(e) {
1277
+ function Rt(e) {
1266
1278
  return e.complete && !!(e.currentSrc || e.getAttribute("src"));
1267
1279
  }
1268
- function Rt(e, t, n) {
1269
- e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = zt(t, n);
1280
+ function zt(e, t, n) {
1281
+ e.currentTime = Number.isFinite(t.currentTime) ? t.currentTime : 0, e.duration = Number.isFinite(t.duration) ? t.duration : 0, e.muted = t.muted, e.paused = t.paused, e.volume = Number.isFinite(t.volume) ? t.volume : e.volume, n && n !== "error" && (e.errorKind = null), e.ready = Bt(t, n);
1270
1282
  }
1271
- function zt(e, t) {
1283
+ function Bt(e, t) {
1272
1284
  return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
1273
1285
  }
1274
1286
  //#endregion
1275
1287
  //#region src/components/viewer-core/loadError.ts
1276
- var Bt = /* @__PURE__ */ new Map();
1277
- function Vt(e) {
1288
+ var Vt = /* @__PURE__ */ new Map();
1289
+ function Ht(e) {
1278
1290
  return e === "not-found" ? "404" : "Load error";
1279
1291
  }
1280
- function Ht(e) {
1292
+ function Ut(e) {
1281
1293
  return e === "generic";
1282
1294
  }
1283
- function Ut(e) {
1284
- let t = Bt.get(e);
1295
+ function Wt(e) {
1296
+ let t = Vt.get(e);
1285
1297
  if (t) return t;
1286
- let n = Wt(e);
1287
- return Bt.set(e, n), n;
1298
+ let n = Gt(e);
1299
+ return Vt.set(e, n), n;
1288
1300
  }
1289
- async function Wt(e) {
1290
- if (!Gt(e)) return "generic";
1301
+ async function Gt(e) {
1302
+ if (!Kt(e)) return "generic";
1291
1303
  try {
1292
1304
  let t = await fetch(e, { method: "HEAD" });
1293
1305
  if (!t.ok && t.status === 404) return "not-found";
@@ -1296,12 +1308,12 @@ async function Wt(e) {
1296
1308
  }
1297
1309
  return "generic";
1298
1310
  }
1299
- function Gt(e) {
1311
+ function Kt(e) {
1300
1312
  return /^(https?:\/\/|\/)/i.test(e);
1301
1313
  }
1302
1314
  //#endregion
1303
1315
  //#region src/components/viewer-core/mediaPlayback.ts
1304
- function Kt(e) {
1316
+ function qt(e) {
1305
1317
  try {
1306
1318
  let t = e.play();
1307
1319
  t && typeof t.catch == "function" && t.catch(() => {});
@@ -1309,12 +1321,12 @@ function Kt(e) {
1309
1321
  }
1310
1322
  //#endregion
1311
1323
  //#region src/components/viewer-core/useMedia.ts
1312
- function qt(e) {
1324
+ function Jt(e) {
1313
1325
  let t = T({}), n = T({}), r = T({}), a = T({}), o = T({}), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = i(() => e.activeItem.value ? $(e.activeItem.value) : null), d = i(() => e.activeMediaItem.value ? $(e.activeMediaItem.value) : null), f = i(() => {
1314
1326
  let t = /* @__PURE__ */ new Map();
1315
1327
  for (let n of e.items.value) t.set($(n), n);
1316
1328
  return t;
1317
- }), p = i(() => d.value ? r.value[d.value] ?? Ft : Ft), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : Jt(p.value.currentTime / m.value * 100, 0, 100)), _ = i(() => u.value ? L(u.value) : null);
1329
+ }), p = i(() => d.value ? r.value[d.value] ?? It : It), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : Yt(p.value.currentTime / m.value * 100, 0, 100)), _ = i(() => u.value ? L(u.value) : null);
1318
1330
  F(() => u.value, async () => {
1319
1331
  await S();
1320
1332
  }), F(() => e.itemCount.value, async () => {
@@ -1324,62 +1336,62 @@ function qt(e) {
1324
1336
  });
1325
1337
  function v(e, t) {
1326
1338
  if (t instanceof HTMLVideoElement) {
1327
- s.set(e, t), U(e, t);
1339
+ s.set(e, t), W(e, t);
1328
1340
  return;
1329
1341
  }
1330
1342
  s.delete(e);
1331
1343
  }
1332
1344
  function y(e, t) {
1333
1345
  if (t instanceof HTMLAudioElement) {
1334
- c.set(e, t), U(e, t);
1346
+ c.set(e, t), W(e, t);
1335
1347
  return;
1336
1348
  }
1337
1349
  c.delete(e);
1338
1350
  }
1339
1351
  function b(e, r) {
1340
- r instanceof HTMLImageElement && Lt(r) && (t.value[e] = !0, n.value[e] = null, Y(e, r.currentSrc || r.src || ne(e)));
1352
+ r instanceof HTMLImageElement && Rt(r) && (t.value[e] = !0, n.value[e] = null, ne(e, r.currentSrc || r.src || X(e)));
1341
1353
  }
1342
1354
  function x() {
1343
- te(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
1355
+ ee(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
1344
1356
  }
1345
1357
  async function S() {
1346
1358
  if (!e.isEnabled.value) {
1347
- te();
1359
+ ee();
1348
1360
  return;
1349
1361
  }
1350
1362
  await g();
1351
1363
  let t = u.value;
1352
1364
  for (let [n, i] of s.entries()) {
1353
1365
  if (n !== t || r.value[n]?.errorKind) {
1354
- V(i, n);
1366
+ H(i, n);
1355
1367
  continue;
1356
1368
  }
1357
- i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, Kt(i), U(n, i);
1369
+ i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, qt(i), W(n, i);
1358
1370
  }
1359
1371
  for (let [e, n] of c.entries()) {
1360
1372
  if (e !== t || r.value[e]?.errorKind) {
1361
- V(n, e);
1373
+ H(n, e);
1362
1374
  continue;
1363
1375
  }
1364
- Kt(n), U(e, n);
1376
+ qt(n), W(e, n);
1365
1377
  }
1366
1378
  }
1367
1379
  function C(e, t) {
1368
1380
  let n = t.currentTarget instanceof HTMLMediaElement ? t.currentTarget : t.target instanceof HTMLMediaElement ? t.target : null;
1369
1381
  if (n) {
1370
1382
  let i = r.value[e]?.ready ?? !1;
1371
- U(e, n, t.type);
1383
+ W(e, n, t.type);
1372
1384
  let a = r.value[e]?.ready ?? !1;
1373
- !i && a && Y(e, n.currentSrc || n.src || ne(e));
1385
+ !i && a && ne(e, n.currentSrc || n.src || X(e));
1374
1386
  }
1375
1387
  }
1376
1388
  function w(e, r) {
1377
- t.value[e] = !0, n.value[e] = null, Y(e, r);
1389
+ t.value[e] = !0, n.value[e] = null, ne(e, r);
1378
1390
  }
1379
1391
  async function E(r, i) {
1380
- let a = X(r) ?? e.activeItem.value;
1392
+ let a = Y(r) ?? e.activeItem.value;
1381
1393
  t.value[r] = !1, n.value[r] = "generic";
1382
- let o = await Ut(i);
1394
+ let o = await Wt(i);
1383
1395
  n.value[r] = o, a && e.onAssetError?.({
1384
1396
  item: a,
1385
1397
  occurrenceKey: r,
@@ -1389,7 +1401,7 @@ function qt(e) {
1389
1401
  });
1390
1402
  }
1391
1403
  async function D(t, n) {
1392
- let r = K(t), i = H(t), a = X(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1404
+ let r = q(t), i = U(t), a = Y(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1393
1405
  if (r) {
1394
1406
  r.pause();
1395
1407
  try {
@@ -1397,7 +1409,7 @@ function qt(e) {
1397
1409
  } catch {}
1398
1410
  }
1399
1411
  i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
1400
- let o = await Ut(n);
1412
+ let o = await Wt(n);
1401
1413
  i.errorKind = o, a && e.onAssetError?.({
1402
1414
  item: a,
1403
1415
  occurrenceKey: t,
@@ -1410,25 +1422,25 @@ function qt(e) {
1410
1422
  e.button !== 0 || Date.now() < n || J(s.get(t) ?? null);
1411
1423
  }
1412
1424
  function k(e, t, n) {
1413
- e.button !== 0 || Date.now() < n || J(K(t));
1425
+ e.button !== 0 || Date.now() < n || J(q(t));
1414
1426
  }
1415
1427
  function A(e) {
1416
- let t = q(), n = d.value;
1428
+ let t = te(), n = d.value;
1417
1429
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1418
1430
  let r = Number.parseFloat(e.target.value);
1419
1431
  if (!Number.isFinite(r)) return;
1420
- let i = Jt(r, 0, m.value || 0);
1421
- W(n, i, t), t.currentTime = i;
1432
+ let i = Yt(r, 0, m.value || 0);
1433
+ G(n, i, t), t.currentTime = i;
1422
1434
  }
1423
1435
  function j(e) {
1424
- let t = q(), n = d.value;
1436
+ let t = te(), n = d.value;
1425
1437
  if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
1426
- let r = Jt(Number.parseFloat(e.target.value), 0, 1);
1427
- t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), U(n, t);
1438
+ let r = Yt(Number.parseFloat(e.target.value), 0, 1);
1439
+ t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
1428
1440
  }
1429
1441
  function M() {
1430
- let e = q(), t = d.value;
1431
- !e || !t || (e.muted || e.volume <= 0 ? (e.volume = G(t), e.muted = !1, o.value[t] = e.volume) : (o.value[t] = e.volume, e.muted = !0), U(t, e));
1442
+ let e = te(), t = d.value;
1443
+ !e || !t || (e.muted || e.volume <= 0 ? (e.volume = K(t), e.muted = !1, o.value[t] = e.volume) : (o.value[t] = e.volume, e.muted = !0), W(t, e));
1432
1444
  }
1433
1445
  function N(e) {
1434
1446
  return !!t.value[e] && !n.value[e];
@@ -1444,65 +1456,65 @@ function qt(e) {
1444
1456
  }
1445
1457
  function R(e) {
1446
1458
  let t = L(e);
1447
- return t ? Vt(t) : null;
1459
+ return t ? Ht(t) : null;
1448
1460
  }
1449
1461
  function z(e) {
1450
- return Ht(L(e));
1462
+ return Ut(L(e));
1451
1463
  }
1452
- function ee(e) {
1464
+ function B(e) {
1453
1465
  return `${e}:${a.value[e] ?? 0}`;
1454
1466
  }
1455
- async function B(e) {
1467
+ async function V(e) {
1456
1468
  if (!z(e)) return;
1457
1469
  t.value[e] = !1, n.value[e] = null;
1458
- let r = H(e);
1470
+ let r = U(e);
1459
1471
  r.currentTime = 0, r.duration = 0, r.paused = !0, r.ready = !1, r.errorKind = null;
1460
- let i = K(e);
1461
- i && V(i, e), l.forEach((t) => {
1472
+ let i = q(e);
1473
+ i && H(i, e), l.forEach((t) => {
1462
1474
  t.startsWith(`${e}|`) && l.delete(t);
1463
1475
  }), a.value[e] = (a.value[e] ?? 0) + 1, await g(), await S();
1464
1476
  }
1465
- function V(e, t) {
1477
+ function H(e, t) {
1466
1478
  e.pause();
1467
1479
  try {
1468
1480
  e.currentTime = 0;
1469
1481
  } catch {}
1470
- U(t, e);
1471
- }
1472
- function te() {
1473
- for (let [e, t] of s.entries()) V(t, e);
1474
- for (let [e, t] of c.entries()) V(t, e);
1482
+ W(t, e);
1475
1483
  }
1476
- function H(e) {
1477
- return r.value[e] || (r.value[e] = It()), r.value[e];
1484
+ function ee() {
1485
+ for (let [e, t] of s.entries()) H(t, e);
1486
+ for (let [e, t] of c.entries()) H(t, e);
1478
1487
  }
1479
- function U(e, t, n) {
1480
- Rt(H(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
1488
+ function U(e) {
1489
+ return r.value[e] || (r.value[e] = Lt()), r.value[e];
1481
1490
  }
1482
1491
  function W(e, t, n) {
1483
- let r = H(e);
1484
- r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.muted = n.muted, r.paused = n.paused, r.volume = Number.isFinite(n.volume) ? n.volume : r.volume;
1492
+ zt(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
1485
1493
  }
1486
- function G(e) {
1487
- return Jt(o.value[e] ?? 1, 0, 1);
1494
+ function G(e, t, n) {
1495
+ let r = U(e);
1496
+ r.currentTime = t, r.duration = Number.isFinite(n.duration) ? n.duration : r.duration, r.muted = n.muted, r.paused = n.paused, r.volume = Number.isFinite(n.volume) ? n.volume : r.volume;
1488
1497
  }
1489
1498
  function K(e) {
1499
+ return Yt(o.value[e] ?? 1, 0, 1);
1500
+ }
1501
+ function q(e) {
1490
1502
  return s.get(e) ?? c.get(e) ?? null;
1491
1503
  }
1492
- function q() {
1493
- return d.value ? K(d.value) : null;
1504
+ function te() {
1505
+ return d.value ? q(d.value) : null;
1494
1506
  }
1495
1507
  function J(e) {
1496
1508
  if (e) {
1497
1509
  if (e.paused) {
1498
- Kt(e);
1510
+ qt(e);
1499
1511
  return;
1500
1512
  }
1501
1513
  e.pause();
1502
1514
  }
1503
1515
  }
1504
- function Y(t, n) {
1505
- let r = X(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1516
+ function ne(t, n) {
1517
+ let r = Y(t) ?? e.activeMediaItem.value ?? e.activeItem.value;
1506
1518
  if (!r || !n) return;
1507
1519
  let i = `${t}|${n}`;
1508
1520
  l.has(i) || (l.add(i), e.onAssetLoad?.({
@@ -1512,11 +1524,11 @@ function qt(e) {
1512
1524
  url: n
1513
1525
  }));
1514
1526
  }
1515
- function X(e) {
1527
+ function Y(e) {
1516
1528
  return f.value.get(e) ?? null;
1517
1529
  }
1518
- function ne(e) {
1519
- return X(e)?.url ?? null;
1530
+ function X(e) {
1531
+ return Y(e)?.url ?? null;
1520
1532
  }
1521
1533
  return {
1522
1534
  activeAssetErrorKind: _,
@@ -1525,7 +1537,7 @@ function qt(e) {
1525
1537
  activeMediaState: p,
1526
1538
  getAssetErrorKind: L,
1527
1539
  getAssetErrorLabel: R,
1528
- getAssetRenderKey: ee,
1540
+ getAssetRenderKey: B,
1529
1541
  getImageSource: I,
1530
1542
  isImageReady: N,
1531
1543
  isMediaReady: P,
@@ -1544,14 +1556,14 @@ function qt(e) {
1544
1556
  registerImageElement: b,
1545
1557
  registerVideoElement: v,
1546
1558
  resetMediaState: x,
1547
- retryAsset: B,
1559
+ retryAsset: V,
1548
1560
  syncMediaPlayback: S
1549
1561
  };
1550
1562
  }
1551
- function Jt(e, t, n) {
1563
+ function Yt(e, t, n) {
1552
1564
  return Math.min(Math.max(e, t), n);
1553
1565
  }
1554
- function Yt(e, t, n = 2) {
1566
+ function Xt(e, t, n = 2) {
1555
1567
  return t <= 0 ? {
1556
1568
  start: 0,
1557
1569
  end: -1
@@ -1560,14 +1572,14 @@ function Yt(e, t, n = 2) {
1560
1572
  end: Math.min(t - 1, e + n)
1561
1573
  };
1562
1574
  }
1563
- function Xt(e, t, n = 2) {
1564
- let r = Yt(t, e.length, n);
1575
+ function Zt(e, t, n = 2) {
1576
+ let r = Xt(t, e.length, n);
1565
1577
  return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
1566
1578
  item: e,
1567
1579
  index: r.start + t
1568
1580
  }));
1569
1581
  }
1570
- function Zt(e, t, n, r, i) {
1582
+ function Qt(e, t, n, r, i) {
1571
1583
  return {
1572
1584
  transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
1573
1585
  transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
@@ -1575,12 +1587,12 @@ function Zt(e, t, n, r, i) {
1575
1587
  }
1576
1588
  //#endregion
1577
1589
  //#region src/components/viewer-core/useViewer.ts
1578
- function Qt(e, t, n = {}) {
1579
- 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.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => Mt({
1590
+ function $t(e, t, n = {}) {
1591
+ 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.loopFullscreenVideo ?? !0), u = i(() => e.paginationDetail ?? null), d = i(() => Nt({
1580
1592
  itemCount: r.value.length,
1581
1593
  loading: s.value,
1582
1594
  phase: e.phase
1583
- })), f = i(() => !1), p = T(null), m = T(0), h = T(!1), g = T(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), E = qt({
1595
+ })), f = i(() => !1), p = T(null), m = T(0), h = T(!1), g = T(1), _ = n.enabled ?? i(() => !0), v = null, y = 0, b = 0, x = 0, S = i(() => r.value.length === 0 ? 0 : P(a.value, 0, r.value.length - 1)), C = i(() => r.value[S.value] ?? null), w = i(() => C.value?.type === "audio" || C.value?.type === "video" ? C.value : null), E = Jt({
1584
1596
  items: r,
1585
1597
  activeItem: C,
1586
1598
  activeMediaItem: w,
@@ -1589,22 +1601,22 @@ function Qt(e, t, n = {}) {
1589
1601
  loopFullscreenVideo: l,
1590
1602
  onAssetError: n.onAssetError,
1591
1603
  onAssetLoad: n.onAssetLoad
1592
- }), D = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Nt({
1604
+ }), D = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Pt({
1593
1605
  errorMessage: o.value,
1594
1606
  hasItems: r.value.length > 0,
1595
1607
  hasNextPage: c.value,
1596
1608
  phase: d.value,
1597
1609
  surface: "fullscreen"
1598
- })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => Yt(S.value, r.value.length)), N = i(() => Xt(r.value, S.value));
1599
- Pt({
1610
+ })), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => Xt(S.value, r.value.length)), N = i(() => Zt(r.value, S.value));
1611
+ Ft({
1600
1612
  enabled: _,
1601
1613
  onDisable() {
1602
- H(), E.resetMediaState();
1614
+ U(), E.resetMediaState();
1603
1615
  },
1604
1616
  onEnable() {
1605
1617
  return E.syncMediaPlayback();
1606
1618
  },
1607
- onKeydown: W,
1619
+ onKeydown: G,
1608
1620
  onResize: F
1609
1621
  });
1610
1622
  function P(e, t, n) {
@@ -1628,53 +1640,53 @@ function Qt(e, t, n = {}) {
1628
1640
  function z(e) {
1629
1641
  !_.value || r.value.length === 0 || e.pointerType === "mouse" || fe(e.target) || (v = e.pointerId, y = e.clientY, m.value = 0, h.value = !0, p.value?.setPointerCapture?.(e.pointerId));
1630
1642
  }
1631
- function ee(e) {
1632
- !_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
1633
- }
1634
1643
  function B(e) {
1635
- !_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), te());
1644
+ !_.value || !h.value || v !== e.pointerId || (m.value = R(e.clientY - y));
1636
1645
  }
1637
1646
  function V(e) {
1638
- !_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), H());
1647
+ !_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), ee());
1639
1648
  }
1640
- function te() {
1641
- Math.abs(m.value) >= j.value && (x = Date.now() + 250, L(m.value < 0 ? 1 : -1)), H();
1649
+ function H(e) {
1650
+ !_.value || v !== e.pointerId || (p.value?.releasePointerCapture?.(e.pointerId), U());
1642
1651
  }
1643
- function H() {
1652
+ function ee() {
1653
+ Math.abs(m.value) >= j.value && (x = Date.now() + 250, L(m.value < 0 ? 1 : -1)), U();
1654
+ }
1655
+ function U() {
1644
1656
  m.value = 0, h.value = !1, v = null;
1645
1657
  }
1646
- function U(e) {
1658
+ function W(e) {
1647
1659
  if (!_.value || r.value.length === 0 || h.value || fe(e.target) || Math.abs(e.deltaY) < Math.max(Math.abs(e.deltaX), 24)) return;
1648
1660
  e.preventDefault();
1649
1661
  let t = Date.now();
1650
1662
  t < b || (b = t + 400, L(e.deltaY > 0 ? 1 : -1));
1651
1663
  }
1652
- function W(e) {
1664
+ function G(e) {
1653
1665
  !_.value || r.value.length === 0 || Q(e.target) || ((e.key === "ArrowDown" || e.key === "PageDown") && (e.preventDefault(), L(1)), (e.key === "ArrowUp" || e.key === "PageUp") && (e.preventDefault(), L(-1)));
1654
1666
  }
1655
- function G(e, t) {
1667
+ function K(e, t) {
1656
1668
  E.onVideoClick(e, t, x);
1657
1669
  }
1658
- function K(e, t) {
1670
+ function q(e, t) {
1659
1671
  E.onAudioCoverClick(e, t, x);
1660
1672
  }
1661
- function q(e) {
1673
+ function te(e) {
1662
1674
  E.onMediaSeekInput(e);
1663
1675
  }
1664
1676
  function J(e) {
1665
1677
  E.onMediaVolumeInput(e);
1666
1678
  }
1667
- function Y() {
1679
+ function ne() {
1668
1680
  E.onMediaVolumeToggle();
1669
1681
  }
1670
- function X(e) {
1682
+ function Y(e) {
1671
1683
  return e.type === "image" || e.type === "video";
1672
1684
  }
1673
- function ne(e) {
1685
+ function X(e) {
1674
1686
  return e.type === "audio";
1675
1687
  }
1676
1688
  function re(e) {
1677
- return Zt(e, S.value, g.value, m.value, h.value);
1689
+ return Qt(e, S.value, g.value, m.value, h.value);
1678
1690
  }
1679
1691
  return {
1680
1692
  activeItem: C,
@@ -1689,32 +1701,32 @@ function Qt(e, t, n = {}) {
1689
1701
  getAssetErrorKind: E.getAssetErrorKind,
1690
1702
  getAssetErrorLabel: E.getAssetErrorLabel,
1691
1703
  getAssetRenderKey: E.getAssetRenderKey,
1692
- formatPlaybackTime: jt,
1704
+ formatPlaybackTime: Mt,
1693
1705
  getImageSource: E.getImageSource,
1694
1706
  getSlideStyle: re,
1695
1707
  hasNextPage: c,
1696
1708
  isAtEnd: D,
1697
- isAudio: ne,
1698
- isVisual: X,
1709
+ isAudio: X,
1710
+ isVisual: Y,
1699
1711
  items: r,
1700
1712
  loading: s,
1701
1713
  mediaStates: E.mediaStates,
1702
1714
  isImageReady: E.isImageReady,
1703
1715
  isMediaReady: E.isMediaReady,
1704
- onAudioCoverClick: K,
1716
+ onAudioCoverClick: q,
1705
1717
  onImageError: E.onImageError,
1706
1718
  onImageLoad: E.onImageLoad,
1707
1719
  onMediaEvent: E.onMediaEvent,
1708
1720
  onMediaError: E.onMediaError,
1709
- onMediaSeekInput: q,
1721
+ onMediaSeekInput: te,
1710
1722
  onMediaVolumeInput: J,
1711
- onMediaVolumeToggle: Y,
1712
- onPointerCancel: V,
1723
+ onMediaVolumeToggle: ne,
1724
+ onPointerCancel: H,
1713
1725
  onPointerDown: z,
1714
- onPointerMove: ee,
1715
- onPointerUp: B,
1716
- onVideoClick: G,
1717
- onWheel: U,
1726
+ onPointerMove: B,
1727
+ onPointerUp: V,
1728
+ onVideoClick: K,
1729
+ onWheel: W,
1718
1730
  registerAudioElement: E.registerAudioElement,
1719
1731
  registerImageElement: E.registerImageElement,
1720
1732
  registerVideoElement: E.registerVideoElement,
@@ -1732,21 +1744,21 @@ function Qt(e, t, n = {}) {
1732
1744
  }
1733
1745
  //#endregion
1734
1746
  //#region src/components/viewer-core/theme.ts
1735
- var $t = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", en = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", tn = {
1747
+ var en = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", tn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", nn = {
1736
1748
  image: !0,
1737
1749
  video: !0,
1738
1750
  audio: !0,
1739
1751
  other: !0
1740
1752
  };
1741
- function nn(e) {
1742
- return tn[e], $t;
1743
- }
1744
1753
  function rn(e) {
1745
- return tn[e], en;
1754
+ return nn[e], en;
1755
+ }
1756
+ function an(e) {
1757
+ return nn[e], tn;
1746
1758
  }
1747
1759
  //#endregion
1748
1760
  //#region src/components/viewer-core/dominantImageTone.ts
1749
- function an(e) {
1761
+ function on(e) {
1750
1762
  if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
1751
1763
  let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
1752
1764
  if (!n) return null;
@@ -1761,20 +1773,20 @@ function an(e) {
1761
1773
  r += d, i += s * d, a += c * d, o += l * d;
1762
1774
  }
1763
1775
  return r <= 0 ? null : {
1764
- r: on(Math.round(i / r)),
1765
- g: on(Math.round(a / r)),
1766
- b: on(Math.round(o / r))
1776
+ r: sn(Math.round(i / r)),
1777
+ g: sn(Math.round(a / r)),
1778
+ b: sn(Math.round(o / r))
1767
1779
  };
1768
1780
  } catch {
1769
1781
  return null;
1770
1782
  }
1771
1783
  }
1772
- function on(e) {
1784
+ function sn(e) {
1773
1785
  return Math.min(235, Math.max(26, e));
1774
1786
  }
1775
1787
  //#endregion
1776
1788
  //#region src/components/viewer-core/useFullscreenDominantTone.ts
1777
- function sn(e) {
1789
+ function cn(e) {
1778
1790
  let t = T({}), n = i(() => e.activeItem.value ? e.getItemKey(e.activeItem.value) : null), r = i(() => !e.showDominantImageTone.value || e.activeItem.value?.type !== "image" || !n.value || !e.isImageReady(n.value) ? null : t.value[n.value] ?? null), a = i(() => {
1779
1791
  if (!r.value) return;
1780
1792
  let { r: e, g: t, b: n } = r.value;
@@ -1789,7 +1801,7 @@ function sn(e) {
1789
1801
  });
1790
1802
  function s(n, r) {
1791
1803
  if (!e.showDominantImageTone.value) return;
1792
- let i = an(r);
1804
+ let i = on(r);
1793
1805
  i && (t.value[n] = i);
1794
1806
  }
1795
1807
  return {
@@ -1800,7 +1812,7 @@ function sn(e) {
1800
1812
  }
1801
1813
  //#endregion
1802
1814
  //#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
1803
- var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
1815
+ var ln = ["data-surface"], un = ["data-surface"], dn = /* @__PURE__ */ d({
1804
1816
  inheritAttrs: !1,
1805
1817
  __name: "SurfaceEmptyState",
1806
1818
  props: {
@@ -1814,31 +1826,31 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
1814
1826
  "data-testid": "vibe-empty-state-inline",
1815
1827
  "data-surface": e.surface,
1816
1828
  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)]"]
1817
- }), [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, cn)) : (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", {
1829
+ }), [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, ln)) : (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", {
1818
1830
  "data-testid": "vibe-empty-state-badge",
1819
1831
  "data-surface": e.surface,
1820
1832
  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"])
1821
- }, k(e.message), 11, ln)])], 16));
1833
+ }, k(e.message), 11, un)])], 16));
1822
1834
  }
1823
- }), dn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, fn = {
1835
+ }), fn = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, pn = {
1824
1836
  key: 0,
1825
1837
  class: "relative h-full min-h-0"
1826
- }, pn = [
1838
+ }, mn = [
1827
1839
  "data-item-id",
1828
1840
  "data-occurrence-key",
1829
1841
  "data-index",
1830
1842
  "data-active",
1831
1843
  "aria-hidden"
1832
- ], mn = {
1844
+ ], hn = {
1833
1845
  key: 0,
1834
1846
  "data-testid": "vibe-asset-spinner",
1835
1847
  class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
1836
- }, hn = { 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]" }, gn = ["data-kind"], _n = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, vn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, yn = ["onClick"], bn = [
1848
+ }, gn = { 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]" }, _n = ["data-kind"], vn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, yn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, bn = ["onClick"], xn = [
1837
1849
  "src",
1838
1850
  "alt",
1839
1851
  "onLoad",
1840
1852
  "onError"
1841
- ], xn = [
1853
+ ], Sn = [
1842
1854
  "loop",
1843
1855
  "src",
1844
1856
  "preload",
@@ -1856,15 +1868,15 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
1856
1868
  "onStalled",
1857
1869
  "onTimeupdate",
1858
1870
  "onWaiting"
1859
- ], Sn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Cn = [
1871
+ ], Cn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, wn = [
1860
1872
  "aria-label",
1861
1873
  "disabled",
1862
1874
  "onClick"
1863
- ], wn = { 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]" }, Tn = { 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]" }, En = {
1875
+ ], Tn = { 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]" }, En = { 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]" }, Dn = {
1864
1876
  key: 0,
1865
1877
  "data-testid": "vibe-asset-spinner",
1866
1878
  class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
1867
- }, 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]" }, On = ["data-kind"], kn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, An = ["onClick"], jn = [
1879
+ }, On = { 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]" }, kn = ["data-kind"], An = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, jn = ["onClick"], Mn = [
1868
1880
  "src",
1869
1881
  "preload",
1870
1882
  "onCanplay",
@@ -1880,25 +1892,25 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
1880
1892
  "onStalled",
1881
1893
  "onTimeupdate",
1882
1894
  "onWaiting"
1883
- ], Mn = {
1895
+ ], Nn = {
1884
1896
  key: 2,
1885
1897
  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"
1886
- }, Nn = { 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]" }, Pn = {
1898
+ }, Pn = { 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]" }, Fn = {
1887
1899
  key: 0,
1888
1900
  class: "pointer-events-none absolute inset-0 z-[4]"
1889
- }, Fn = { class: "h-full w-full" }, In = {
1901
+ }, In = { class: "h-full w-full" }, Ln = {
1890
1902
  key: 1,
1891
1903
  "data-testid": "vibe-forward-fill-placeholder",
1892
1904
  class: "grid h-full min-h-0 place-items-center px-6 text-center"
1893
- }, Ln = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, Rn = { 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)]" }, zn = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, Bn = {
1905
+ }, Rn = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, zn = { 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)]" }, Bn = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, Vn = {
1894
1906
  key: 0,
1895
1907
  "data-testid": "vibe-fullscreen-aside",
1896
1908
  class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
1897
- }, Vn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Hn = {
1909
+ }, Hn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Un = {
1898
1910
  key: 0,
1899
1911
  "data-testid": "vibe-fullscreen-aside",
1900
1912
  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]"
1901
- }, Un = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Wn = 1280, Gn = 768, Kn = /* @__PURE__ */ d({
1913
+ }, Wn = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, Gn = 1280, Kn = 768, qn = /* @__PURE__ */ d({
1902
1914
  __name: "FullscreenSurface",
1903
1915
  props: {
1904
1916
  active: {
@@ -1950,22 +1962,22 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
1950
1962
  },
1951
1963
  emits: ["back-to-list", "update:activeIndex"],
1952
1964
  setup(e, { emit: n }) {
1953
- let d = e, p = N(), m = n, g = Qt(d, (e, t) => {
1965
+ let d = e, p = N(), m = n, g = $t(d, (e, t) => {
1954
1966
  m("update:activeIndex", t);
1955
1967
  }, {
1956
1968
  enabled: A(d, "active"),
1957
1969
  onAssetError: d.reportAssetError ?? void 0,
1958
1970
  onAssetLoad: d.reportAssetLoad ?? void 0
1959
- }), C = T(typeof window > "u" ? Wn : window.innerWidth || Wn), w = Et({
1971
+ }), C = T(typeof window > "u" ? Gn : window.innerWidth || Gn), w = Dt({
1960
1972
  active: A(d, "active"),
1961
1973
  resolvedActiveIndex: g.resolvedActiveIndex,
1962
1974
  viewer: g
1963
- }), M = i(() => nn(g.activeItem.value?.type ?? "image")), { activeSlideToneStyle: P, activeStageToneStyle: F, updateFromImageElement: I } = sn({
1975
+ }), M = i(() => rn(g.activeItem.value?.type ?? "image")), { activeSlideToneStyle: P, activeStageToneStyle: F, updateFromImageElement: I } = cn({
1964
1976
  activeItem: g.activeItem,
1965
1977
  getItemKey: w.getItemKey,
1966
1978
  isImageReady: g.isImageReady,
1967
1979
  showDominantImageTone: A(d, "showDominantImageTone")
1968
- }), R = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), ee = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), B = i(() => C.value < Gn ? "vertical" : "horizontal"), V = i(() => ee.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), te = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : g.statusMessage.value ?? "Loading more items"), U = i(() => {
1980
+ }), R = i(() => g.activeMediaItem.value && !g.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), B = i(() => !!g.activeMediaItem.value && !g.activeAssetErrorKind.value), V = i(() => C.value < Kn ? "vertical" : "horizontal"), H = i(() => B.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), ee = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), U = i(() => d.hasNextPage ? "Loading more items" : g.statusMessage.value ?? "Loading more items"), W = i(() => {
1969
1981
  let e = g.activeItem.value;
1970
1982
  return e ? {
1971
1983
  hasNextPage: d.hasNextPage,
@@ -1975,14 +1987,14 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
1975
1987
  paginationDetail: d.paginationDetail,
1976
1988
  total: d.items.length
1977
1989
  } : null;
1978
- }), W = i(() => !U.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](U.value)), G = i(() => !U.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](U.value)), K = i(() => !d.showStatusBadges || !U.value || !g.statusKind.value || !g.statusMessage.value ? null : {
1979
- ...U.value,
1990
+ }), G = i(() => !W.value || !p["fullscreen-header-actions"] ? [] : p["fullscreen-header-actions"](W.value)), K = i(() => !W.value || !p["fullscreen-aside"] ? [] : p["fullscreen-aside"](W.value)), q = i(() => !d.showStatusBadges || !W.value || !g.statusKind.value || !g.statusMessage.value ? null : {
1991
+ ...W.value,
1980
1992
  kind: g.statusKind.value,
1981
1993
  message: g.statusMessage.value
1982
- }), q = i(() => !K.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](K.value)), J = i(() => ({
1983
- gridTemplateColumns: ne.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
1994
+ }), te = i(() => !q.value || !p["fullscreen-status"] ? [] : p["fullscreen-status"](q.value)), J = i(() => ({
1995
+ gridTemplateColumns: X.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
1984
1996
  transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
1985
- })), Y = i(() => Dt(W.value)), X = i(() => Dt(G.value)), ne = i(() => X.value && C.value >= Wn), se = i(() => X.value && !ne.value), ce = i(() => Dt(q.value)), { emptyStateProps: Z, showBadgeEmptyState: le, showCustomEmptyState: ue, showInlineEmptyState: de } = At({
1997
+ })), ne = i(() => Ot(G.value)), Y = i(() => Ot(K.value)), X = i(() => Y.value && C.value >= Gn), se = i(() => Y.value && !X.value), ce = i(() => Ot(te.value)), { emptyStateProps: Z, showBadgeEmptyState: le, showCustomEmptyState: ue, showInlineEmptyState: de } = jt({
1986
1998
  emptyStateMode: A(d, "emptyStateMode"),
1987
1999
  itemCount: i(() => d.items.length),
1988
2000
  loading: A(d, "loading"),
@@ -1995,7 +2007,7 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
1995
2007
  window.removeEventListener("resize", Q);
1996
2008
  });
1997
2009
  function Q() {
1998
- C.value = window.innerWidth || Wn;
2010
+ C.value = window.innerWidth || Gn;
1999
2011
  }
2000
2012
  function fe(e, t, n) {
2001
2013
  g.onImageLoad(t, n);
@@ -2008,7 +2020,7 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2008
2020
  function me(e, t) {
2009
2021
  I(e, t);
2010
2022
  }
2011
- return (e, n) => (S(), s("div", dn, [
2023
+ return (e, n) => (S(), s("div", fn, [
2012
2024
  c("div", {
2013
2025
  class: _(["absolute inset-0 transition-[background] duration-200", M.value]),
2014
2026
  style: y(j(F))
@@ -2025,7 +2037,7 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2025
2037
  onPointerup: n[3] ||= (...e) => j(g).onPointerUp && j(g).onPointerUp(...e),
2026
2038
  onPointercancel: n[4] ||= (...e) => j(g).onPointerCancel && j(g).onPointerCancel(...e),
2027
2039
  onWheel: n[5] ||= (...e) => j(g).onWheel && j(g).onWheel(...e)
2028
- }, [j(g).activeItem.value ? (S(), s("div", fn, [
2040
+ }, [j(g).activeItem.value ? (S(), s("div", pn, [
2029
2041
  (S(!0), s(t, null, E(j(g).renderedItems.value, ({ item: r, index: i }) => (S(), s("article", {
2030
2042
  key: j(w).getItemKey(r),
2031
2043
  "data-testid": "vibe-slide",
@@ -2037,12 +2049,12 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2037
2049
  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"]),
2038
2050
  style: y(j(g).getSlideStyle(i))
2039
2051
  }, [c("div", {
2040
- class: _(["absolute inset-0 opacity-85", j(rn)(r.type)]),
2052
+ class: _(["absolute inset-0 opacity-85", j(an)(r.type)]),
2041
2053
  style: y(i === j(g).resolvedActiveIndex.value && r.type === "image" ? j(P) : void 0)
2042
2054
  }, null, 6), j(g).isVisual(r) ? (S(), s("div", {
2043
2055
  key: 0,
2044
- class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? V.value : ""])
2045
- }, [j(w).isAssetLoading(i, r) ? (S(), s("div", mn, [c("span", hn, [u(j(re), {
2056
+ class: _(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === j(g).resolvedActiveIndex.value ? H.value : ""])
2057
+ }, [j(w).isAssetLoading(i, r) ? (S(), s("div", hn, [c("span", gn, [u(j(re), {
2046
2058
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2047
2059
  "aria-hidden": "true"
2048
2060
  })])])) : o("", !0), j(w).isAssetErrored(i, r) ? (S(), s("div", {
@@ -2050,19 +2062,19 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2050
2062
  "data-testid": "vibe-asset-error",
2051
2063
  "data-kind": j(w).getAssetErrorKind(r),
2052
2064
  class: "grid h-full w-full place-items-center"
2053
- }, [c("div", _n, [
2065
+ }, [c("div", vn, [
2054
2066
  u(j(oe), {
2055
2067
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2056
2068
  "aria-hidden": "true"
2057
2069
  }),
2058
- c("p", vn, k(j(w).getAssetErrorLabel(r)), 1),
2070
+ c("p", yn, k(j(w).getAssetErrorLabel(r)), 1),
2059
2071
  j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
2060
2072
  key: 0,
2061
2073
  type: "button",
2062
2074
  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",
2063
2075
  onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
2064
- }, " Retry ", 8, yn)) : o("", !0)
2065
- ])], 8, gn)) : r.type === "image" ? (S(), s("img", {
2076
+ }, " Retry ", 8, bn)) : o("", !0)
2077
+ ])], 8, _n)) : r.type === "image" ? (S(), s("img", {
2066
2078
  key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
2067
2079
  src: j(w).getFullscreenImageSource(i, r),
2068
2080
  alt: r.title ?? "",
@@ -2073,7 +2085,7 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2073
2085
  ref: (e) => pe(j(w).getItemKey(r), e),
2074
2086
  onLoad: (e) => fe(e, j(w).getItemKey(r), r.url),
2075
2087
  onError: (e) => j(g).onImageError(j(w).getItemKey(r), r.url)
2076
- }, null, 42, bn)) : (S(), s("video", {
2088
+ }, null, 42, xn)) : (S(), s("video", {
2077
2089
  key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
2078
2090
  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"]),
2079
2091
  playsinline: "",
@@ -2096,10 +2108,10 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2096
2108
  onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
2097
2109
  onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
2098
2110
  onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
2099
- }, null, 42, xn))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
2111
+ }, null, 42, Sn))], 2)) : j(g).isAudio(r) ? (S(), s("div", {
2100
2112
  key: 1,
2101
- 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 ? V.value : ""])
2102
- }, [c("div", Sn, [
2113
+ 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 ? H.value : ""])
2114
+ }, [c("div", Cn, [
2103
2115
  c("button", {
2104
2116
  type: "button",
2105
2117
  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]",
@@ -2109,19 +2121,19 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2109
2121
  }, [
2110
2122
  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),
2111
2123
  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),
2112
- c("span", wn, [D(e.$slots, "item-icon", {
2113
- icon: j(St)(r.type),
2124
+ c("span", Tn, [D(e.$slots, "item-icon", {
2125
+ icon: j(Ct)(r.type),
2114
2126
  item: r
2115
- }, () => [(S(), a(O(j(St)(r.type)), {
2127
+ }, () => [(S(), a(O(j(Ct)(r.type)), {
2116
2128
  class: "h-6 w-6 stroke-[1.9]",
2117
2129
  "aria-hidden": "true"
2118
2130
  }))])]),
2119
- c("span", Tn, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
2131
+ c("span", En, [(S(), a(O(j(g).mediaStates.value[j(w).getItemKey(r)]?.paused ?? !0 ? j(ae) : j(ie)), {
2120
2132
  class: "h-4 w-4 stroke-2",
2121
2133
  "aria-hidden": "true"
2122
2134
  }))])
2123
- ], 8, Cn),
2124
- j(w).isAssetLoading(i, r) ? (S(), s("div", En, [c("span", Dn, [u(j(re), {
2135
+ ], 8, wn),
2136
+ j(w).isAssetLoading(i, r) ? (S(), s("div", Dn, [c("span", On, [u(j(re), {
2125
2137
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2126
2138
  "aria-hidden": "true"
2127
2139
  })])])) : o("", !0),
@@ -2134,14 +2146,14 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2134
2146
  class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
2135
2147
  "aria-hidden": "true"
2136
2148
  }),
2137
- c("p", kn, k(j(w).getAssetErrorLabel(r)), 1),
2149
+ c("p", An, k(j(w).getAssetErrorLabel(r)), 1),
2138
2150
  j(g).canRetryAsset(j(w).getItemKey(r)) ? (S(), s("button", {
2139
2151
  key: 0,
2140
2152
  type: "button",
2141
2153
  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",
2142
2154
  onClick: z((e) => j(g).retryAsset(j(w).getItemKey(r)), ["stop"])
2143
- }, " Retry ", 8, An)) : o("", !0)
2144
- ], 8, On)], 64)) : o("", !0)
2155
+ }, " Retry ", 8, jn)) : o("", !0)
2156
+ ], 8, kn)], 64)) : o("", !0)
2145
2157
  ]), (S(), s("audio", {
2146
2158
  key: j(g).getAssetRenderKey(j(w).getItemKey(r)),
2147
2159
  src: j(w).getFullscreenMediaSource(i, r),
@@ -2162,15 +2174,15 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2162
2174
  onStalled: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
2163
2175
  onTimeupdate: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e),
2164
2176
  onWaiting: (e) => j(g).onMediaEvent(j(w).getItemKey(r), e)
2165
- }, null, 40, jn))], 2)) : (S(), s("div", Mn, [c("div", Nn, [D(e.$slots, "item-icon", {
2166
- icon: j(St)(r.type),
2177
+ }, null, 40, Mn))], 2)) : (S(), s("div", Nn, [c("div", Pn, [D(e.$slots, "item-icon", {
2178
+ icon: j(Ct)(r.type),
2167
2179
  item: r
2168
- }, () => [(S(), a(O(j(St)(r.type)), {
2180
+ }, () => [(S(), a(O(j(Ct)(r.type)), {
2169
2181
  class: "h-6 w-6 stroke-[1.9]",
2170
2182
  "aria-hidden": "true"
2171
- }))])])]))], 14, pn))), 128)),
2172
- U.value && p["fullscreen-overlay"] ? (S(), s("div", Pn, [c("div", Fn, [D(e.$slots, "fullscreen-overlay", v(f(U.value)))])])) : o("", !0),
2173
- j(g).activeItem.value ? (S(), a(yt, {
2183
+ }))])])]))], 14, mn))), 128)),
2184
+ W.value && p["fullscreen-overlay"] ? (S(), s("div", Fn, [c("div", In, [D(e.$slots, "fullscreen-overlay", v(f(W.value)))])])) : o("", !0),
2185
+ j(g).activeItem.value ? (S(), a(bt, {
2174
2186
  key: 1,
2175
2187
  "current-index": j(g).resolvedActiveIndex.value,
2176
2188
  loading: d.loading,
@@ -2180,9 +2192,9 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2180
2192
  title: j(g).activeItem.value.title ?? null,
2181
2193
  total: j(g).items.value.length,
2182
2194
  onBackToList: n[0] ||= (e) => m("back-to-list")
2183
- }, l({ _: 2 }, [Y.value && U.value ? {
2195
+ }, l({ _: 2 }, [ne.value && W.value ? {
2184
2196
  name: "actions",
2185
- fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(U.value)))]),
2197
+ fn: L(() => [D(e.$slots, "fullscreen-header-actions", v(f(W.value)))]),
2186
2198
  key: "0"
2187
2199
  } : void 0]), 1032, [
2188
2200
  "current-index",
@@ -2193,7 +2205,7 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2193
2205
  "title",
2194
2206
  "total"
2195
2207
  ])) : o("", !0),
2196
- ee.value ? (S(), a(ct, {
2208
+ B.value ? (S(), a(lt, {
2197
2209
  key: 2,
2198
2210
  "current-time": j(g).activeMediaState.value.currentTime,
2199
2211
  "current-time-label": j(g).formatPlaybackTime(j(g).activeMediaState.value.currentTime),
@@ -2202,7 +2214,7 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2202
2214
  muted: j(g).activeMediaState.value.muted,
2203
2215
  progress: j(g).activeMediaProgress.value,
2204
2216
  volume: j(g).activeMediaState.value.volume,
2205
- "volume-control-layout": B.value,
2217
+ "volume-control-layout": V.value,
2206
2218
  onSeekInput: j(g).onMediaSeekInput,
2207
2219
  onVolumeInput: j(g).onMediaVolumeInput,
2208
2220
  onVolumeToggle: j(g).onMediaVolumeToggle
@@ -2219,18 +2231,18 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2219
2231
  "onVolumeInput",
2220
2232
  "onVolumeToggle"
2221
2233
  ])) : o("", !0),
2222
- K.value ? (S(), s("div", {
2234
+ q.value ? (S(), s("div", {
2223
2235
  key: 3,
2224
2236
  class: _(["absolute left-1/2 z-[4] -translate-x-1/2", R.value])
2225
- }, [ce.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, K.value))) : (S(), s("div", {
2237
+ }, [ce.value ? D(e.$slots, "fullscreen-status", v(h({ key: 0 }, q.value))) : (S(), s("div", {
2226
2238
  key: 1,
2227
2239
  "data-testid": "vibe-fullscreen-status-badge",
2228
- 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", K.value.kind === "end" ? "border-amber-300/35 text-amber-200" : K.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2229
- }, k(K.value.message), 3))], 2)) : o("", !0)
2230
- ])) : te.value ? (S(), s("div", In, [c("div", Ln, [c("span", Rn, [u(j(re), {
2240
+ 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", q.value.kind === "end" ? "border-amber-300/35 text-amber-200" : q.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
2241
+ }, k(q.value.message), 3))], 2)) : o("", !0)
2242
+ ])) : ee.value ? (S(), s("div", Ln, [c("div", Rn, [c("span", zn, [u(j(re), {
2231
2243
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
2232
2244
  "aria-hidden": "true"
2233
- })]), c("p", zn, k(H.value), 1)])])) : j(de) && j(Z) ? (S(), a(un, {
2245
+ })]), c("p", Bn, k(U.value), 1)])])) : j(de) && j(Z) ? (S(), a(dn, {
2234
2246
  key: 2,
2235
2247
  message: j(Z).message,
2236
2248
  mode: j(Z).mode,
@@ -2242,7 +2254,7 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2242
2254
  "message",
2243
2255
  "mode",
2244
2256
  "surface"
2245
- ])) : o("", !0), j(le) && j(Z) ? (S(), a(un, {
2257
+ ])) : o("", !0), j(le) && j(Z) ? (S(), a(dn, {
2246
2258
  key: 3,
2247
2259
  message: j(Z).message,
2248
2260
  mode: j(Z).mode,
@@ -2262,7 +2274,7 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2262
2274
  "leave-from-class": "translate-x-0 opacity-100",
2263
2275
  "leave-to-class": "translate-x-full opacity-0"
2264
2276
  }, {
2265
- default: L(() => [ne.value && U.value ? (S(), s("aside", Bn, [c("div", Vn, [D(e.$slots, "fullscreen-aside", v(f(U.value)))])])) : o("", !0)]),
2277
+ default: L(() => [X.value && W.value ? (S(), s("aside", Vn, [c("div", Hn, [D(e.$slots, "fullscreen-aside", v(f(W.value)))])])) : o("", !0)]),
2266
2278
  _: 3
2267
2279
  })], 4),
2268
2280
  u(r, {
@@ -2273,29 +2285,29 @@ var cn = ["data-surface"], ln = ["data-surface"], un = /* @__PURE__ */ d({
2273
2285
  "leave-from-class": "translate-x-0 opacity-100",
2274
2286
  "leave-to-class": "translate-x-full opacity-0"
2275
2287
  }, {
2276
- default: L(() => [se.value && U.value ? (S(), s("aside", Hn, [c("div", Un, [D(e.$slots, "fullscreen-aside", v(f(U.value)))])])) : o("", !0)]),
2288
+ default: L(() => [se.value && W.value ? (S(), s("aside", Un, [c("div", Wn, [D(e.$slots, "fullscreen-aside", v(f(W.value)))])])) : o("", !0)]),
2277
2289
  _: 3
2278
2290
  })
2279
2291
  ]));
2280
2292
  }
2281
- }), qn = 1, Jn = .5;
2282
- function Yn(e) {
2293
+ }), Jn = 1, Yn = .5;
2294
+ function Xn(e) {
2283
2295
  if (e.type !== "image" && e.type !== "video") return {
2284
- width: qn,
2285
- height: qn,
2296
+ width: Jn,
2297
+ height: Jn,
2286
2298
  source: "fallback"
2287
2299
  };
2288
2300
  let t = e.preview?.width, n = e.preview?.height;
2289
- if (nr(t) && nr(n)) {
2290
- let r = rr(e, t, n);
2301
+ if (rr(t) && rr(n)) {
2302
+ let r = ir(e, t, n);
2291
2303
  return {
2292
2304
  width: r.width,
2293
2305
  height: r.height,
2294
2306
  source: "preview"
2295
2307
  };
2296
2308
  }
2297
- if (nr(e.width) && nr(e.height)) {
2298
- let t = rr(e, e.width, e.height);
2309
+ if (rr(e.width) && rr(e.height)) {
2310
+ let t = ir(e, e.width, e.height);
2299
2311
  return {
2300
2312
  width: t.width,
2301
2313
  height: t.height,
@@ -2303,31 +2315,31 @@ function Yn(e) {
2303
2315
  };
2304
2316
  }
2305
2317
  return {
2306
- width: qn,
2307
- height: qn,
2318
+ width: Jn,
2319
+ height: Jn,
2308
2320
  source: "fallback"
2309
2321
  };
2310
2322
  }
2311
- function Xn(e, t) {
2323
+ function Zn(e, t) {
2312
2324
  return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
2313
2325
  }
2314
- function Zn(e, t, n, r = 0) {
2326
+ function Qn(e, t, n, r = 0) {
2315
2327
  if (!e || e <= 0 || !t || t <= 0) return n;
2316
2328
  let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
2317
2329
  return !a || a <= 0 ? n : a / t;
2318
2330
  }
2319
- function Qn(e, t) {
2320
- let n = Yn(e);
2331
+ function $n(e, t) {
2332
+ let n = Xn(e);
2321
2333
  return n.height / n.width * t;
2322
2334
  }
2323
- function $n(e, t) {
2335
+ function er(e, t) {
2324
2336
  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;
2325
2337
  for (let c = 0; c < e.length; c += 1) {
2326
2338
  let l = e[c];
2327
2339
  o.set($(l), c);
2328
2340
  let u = 0;
2329
2341
  for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
2330
- let d = u * (t.columnWidth + t.gapX), f = n[u], p = Qn(l, t.columnWidth);
2342
+ let d = u * (t.columnWidth + t.gapX), f = n[u], p = $n(l, t.columnWidth);
2331
2343
  r[c] = {
2332
2344
  x: d,
2333
2345
  y: f
@@ -2346,7 +2358,7 @@ function $n(e, t) {
2346
2358
  indexById: o
2347
2359
  };
2348
2360
  }
2349
- function er(e) {
2361
+ function tr(e) {
2350
2362
  if (e.itemCount <= 0) return [];
2351
2363
  if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
2352
2364
  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();
@@ -2356,7 +2368,7 @@ function er(e) {
2356
2368
  }
2357
2369
  return Array.from(a).sort((e, t) => e - t);
2358
2370
  }
2359
- function tr(e, t, n) {
2371
+ function nr(e, t, n) {
2360
2372
  let r = /* @__PURE__ */ new Map();
2361
2373
  for (let i of e) {
2362
2374
  let e = t.get($(i));
@@ -2366,11 +2378,11 @@ function tr(e, t, n) {
2366
2378
  }
2367
2379
  return r;
2368
2380
  }
2369
- function nr(e) {
2381
+ function rr(e) {
2370
2382
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2371
2383
  }
2372
- function rr(e, t, n) {
2373
- return e.type !== "image" || n / t >= Jn ? {
2384
+ function ir(e, t, n) {
2385
+ return e.type !== "image" || n / t >= Yn ? {
2374
2386
  width: t,
2375
2387
  height: n
2376
2388
  } : {
@@ -2380,21 +2392,21 @@ function rr(e, t, n) {
2380
2392
  }
2381
2393
  //#endregion
2382
2394
  //#region src/components/viewer-core/useMasonryMotion.ts
2383
- var ir = 300, ar = 600, or = 40, sr = 300, cr = 400;
2384
- function lr(e, t) {
2395
+ var ar = 300, or = 600, sr = 40, cr = 300, lr = 400;
2396
+ function ur(e, t) {
2385
2397
  return t === "top" ? [...e].reverse() : e;
2386
2398
  }
2387
- function ur(e) {
2388
- return e <= 0 ? ar : ar + Math.min((e - 1) * or, cr);
2399
+ function dr(e) {
2400
+ return e <= 0 ? or : or + Math.min((e - 1) * sr, lr);
2389
2401
  }
2390
- function dr() {
2391
- return sr;
2402
+ function fr() {
2403
+ return cr;
2392
2404
  }
2393
- function fr(e) {
2405
+ function pr(e) {
2394
2406
  let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
2395
2407
  return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
2396
2408
  }
2397
- function pr(e) {
2409
+ function mr(e) {
2398
2410
  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()));
2399
2411
  F(e.visibleIndices, (i) => {
2400
2412
  if (!i.length) return;
@@ -2404,20 +2416,20 @@ function pr(e) {
2404
2416
  !r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
2405
2417
  }
2406
2418
  if (!o.length) return;
2407
- let s = lr(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2408
- for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * or, cr));
2409
- r.value = c, mr(() => {
2419
+ let s = ur(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
2420
+ for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * sr, lr));
2421
+ r.value = c, hr(() => {
2410
2422
  let e = new Set(n.value);
2411
2423
  for (let t of o) e.add(t);
2412
2424
  n.value = e;
2413
- }), hr(() => {
2425
+ }), gr(() => {
2414
2426
  let e = new Set(t.value);
2415
2427
  for (let t of o) e.delete(t);
2416
2428
  t.value = e, S(() => {
2417
2429
  let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
2418
2430
  for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
2419
2431
  n.value = e, r.value = t, a.value = i;
2420
- }, ur(o.length));
2432
+ }, dr(o.length));
2421
2433
  });
2422
2434
  }, { flush: "post" }), F(() => e.items.value.map((e) => $(e)), (e) => {
2423
2435
  if (!e.length || !o.value.size) return;
@@ -2444,7 +2456,7 @@ function pr(e) {
2444
2456
  let e = $(t.item);
2445
2457
  p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
2446
2458
  }
2447
- o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, mr(() => {
2459
+ o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, hr(() => {
2448
2460
  let e = new Set(s.value);
2449
2461
  for (let t of p) e.add(t);
2450
2462
  s.value = e;
@@ -2452,9 +2464,9 @@ function pr(e) {
2452
2464
  let e = new Map(o.value), t = new Set(s.value);
2453
2465
  for (let n of p) e.delete(n), t.delete(n);
2454
2466
  o.value = e, s.value = t;
2455
- }, sr);
2467
+ }, cr);
2456
2468
  }
2457
- function g(t, n, r = ir) {
2469
+ function g(t, n, r = ar) {
2458
2470
  if (!t.size) return;
2459
2471
  let i = /* @__PURE__ */ new Map(), a = [];
2460
2472
  for (let [r, o] of t.entries()) {
@@ -2473,8 +2485,8 @@ function pr(e) {
2473
2485
  c.value = i, u.value = /* @__PURE__ */ new Set();
2474
2486
  let o = new Map(l.value);
2475
2487
  for (let e of a) o.set(e, r);
2476
- l.value = o, mr(() => {
2477
- u.value = new Set(a), mr(() => {
2488
+ l.value = o, hr(() => {
2489
+ u.value = new Set(a), hr(() => {
2478
2490
  c.value = /* @__PURE__ */ new Map();
2479
2491
  });
2480
2492
  }), S(() => {
@@ -2485,8 +2497,8 @@ function pr(e) {
2485
2497
  }, r);
2486
2498
  }
2487
2499
  function _(e) {
2488
- if (n.value.has(e)) return `transform ${ar}ms ease-out`;
2489
- if (u.value.has(e)) return `transform ${l.value.get(e) ?? ir}ms ease-out`;
2500
+ if (n.value.has(e)) return `transform ${or}ms ease-out`;
2501
+ if (u.value.has(e)) return `transform ${l.value.get(e) ?? ar}ms ease-out`;
2490
2502
  }
2491
2503
  function v(e) {
2492
2504
  if (!n.value.has(e)) return;
@@ -2503,7 +2515,7 @@ function pr(e) {
2503
2515
  } : {
2504
2516
  dx: 0,
2505
2517
  dy: 0
2506
- }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? fr({
2518
+ }, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? pr({
2507
2519
  columnWidth: e.columnWidth.value,
2508
2520
  direction: u,
2509
2521
  itemHeight: o,
@@ -2517,14 +2529,14 @@ function pr(e) {
2517
2529
  if (!r) return {
2518
2530
  opacity: "0",
2519
2531
  transform: "translate3d(0, 0, 0) scale(0.96)",
2520
- transition: `opacity ${sr}ms ease-out, transform ${sr}ms ease-out`
2532
+ transition: `opacity ${cr}ms ease-out, transform ${cr}ms ease-out`
2521
2533
  };
2522
2534
  let i = s.value.has(n);
2523
2535
  return {
2524
2536
  height: `${r.height}px`,
2525
2537
  opacity: i ? "0" : "1",
2526
2538
  transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
2527
- transition: `opacity ${sr}ms ease-out, transform ${sr}ms ease-out`,
2539
+ transition: `opacity ${cr}ms ease-out, transform ${cr}ms ease-out`,
2528
2540
  width: `${e.columnWidth.value}px`
2529
2541
  };
2530
2542
  }
@@ -2545,28 +2557,28 @@ function pr(e) {
2545
2557
  playFlipMoveAnimation: g
2546
2558
  };
2547
2559
  }
2548
- function mr(e) {
2560
+ function hr(e) {
2549
2561
  if (typeof requestAnimationFrame == "function") {
2550
2562
  requestAnimationFrame(() => e());
2551
2563
  return;
2552
2564
  }
2553
2565
  setTimeout(e, 0);
2554
2566
  }
2555
- function hr(e) {
2556
- mr(() => mr(e));
2567
+ function gr(e) {
2568
+ hr(() => hr(e));
2557
2569
  }
2558
2570
  //#endregion
2559
2571
  //#region src/components/viewer-core/masonryViewport.ts
2560
- function gr(e, t) {
2572
+ function _r(e, t) {
2561
2573
  return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
2562
2574
  }
2563
- function _r(e, t, n) {
2575
+ function vr(e, t, n) {
2564
2576
  return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
2565
2577
  }
2566
- function vr(e, t, n, r) {
2578
+ function yr(e, t, n, r) {
2567
2579
  return (e?.scrollHeight ?? r) - (t + n);
2568
2580
  }
2569
- function yr(e, t) {
2581
+ function br(e, t) {
2570
2582
  return {
2571
2583
  height: `${e}px`,
2572
2584
  transform: `translate3d(0, ${t}px, 0)`
@@ -2574,8 +2586,8 @@ function yr(e, t) {
2574
2586
  }
2575
2587
  //#endregion
2576
2588
  //#region src/components/viewer-core/useEdgeBoundary.ts
2577
- var br = 250, xr = 1e3;
2578
- function Sr(e) {
2589
+ var xr = 250, Sr = 1e3;
2590
+ function Cr(e) {
2579
2591
  let t = T(!1), n = T(!1), r = T(0), i = T(0), a = T(!1), o = T(!1), s = 0, c = null;
2580
2592
  b(() => {
2581
2593
  y();
@@ -2591,7 +2603,7 @@ function Sr(e) {
2591
2603
  function u(t) {
2592
2604
  if (!x(t) || !e.isAtBoundary()) return;
2593
2605
  let n = Date.now();
2594
- n < s || (s = n + br, m());
2606
+ n < s || (s = n + xr, m());
2595
2607
  }
2596
2608
  function d() {
2597
2609
  if (!g()) return;
@@ -2625,7 +2637,7 @@ function Sr(e) {
2625
2637
  return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
2626
2638
  }
2627
2639
  function _() {
2628
- o.value = !1, v(xr);
2640
+ o.value = !1, v(Sr);
2629
2641
  }
2630
2642
  function v(e) {
2631
2643
  y(), a.value = !0, c = setTimeout(() => {
@@ -2648,30 +2660,42 @@ function Sr(e) {
2648
2660
  }
2649
2661
  //#endregion
2650
2662
  //#region src/components/viewer-core/useMasonryList.ts
2651
- var Cr = 600, wr = 24, Tr = 16, Er = 300, Dr = 200, Or = 200, kr = 200, Ar = 300, jr = 24, Mr = 48, Nr = 500, Pr = 1e3;
2652
- function Fr(e) {
2653
- let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || Er), 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(Er, a.value - wr * 2)), h = i(() => Xn(m.value, Er)), _ = i(() => Zn(m.value, h.value, Er, Tr)), v = i(() => Ir(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => er({
2663
+ var wr = 600, Tr = 24, Er = 16, Dr = 300, Or = 200, kr = 200, Ar = Tr + Er, jr = 200, Mr = 300, Nr = 24, Pr = 48, Fr = 500, Ir = 1e3;
2664
+ function Lr(e) {
2665
+ let t = T(null), n = T(0), r = T(typeof window > "u" ? 0 : window.innerHeight || 0), a = T(typeof window > "u" ? 0 : window.innerWidth || Dr), 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(Dr, a.value - Tr * 2)), h = i(() => Zn(m.value, Dr)), _ = i(() => Qn(m.value, h.value, Dr, Er)), v = i(() => Rr(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => tr({
2654
2666
  itemCount: e.items.value.length,
2655
2667
  viewportHeight: r.value,
2656
2668
  scrollTop: n.value,
2657
- overscanPx: Dr,
2658
- bucketPx: Cr,
2669
+ overscanPx: Or,
2670
+ bucketPx: wr,
2659
2671
  buckets: c.value
2660
2672
  })), S = i(() => y.value.map((t) => ({
2661
2673
  item: e.items.value[t],
2662
2674
  index: t
2663
2675
  }))), C = i(() => {
2664
- let e = l.value + wr * 2, t = d.value ?? 0;
2665
- return Math.max(e, t, r.value) + kr;
2666
- }), 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 - jr * 2)), O = i(() => C.value > r.value + 1 && D.value > 0), k = i(() => {
2667
- if (!O.value) return 0;
2668
- let e = r.value / C.value * D.value;
2669
- return Math.min(D.value, Math.max(Mr, e));
2670
- }), A = i(() => {
2671
- if (!O.value) return jr;
2676
+ let e = l.value + Tr * 2, t = d.value ?? 0;
2677
+ return Math.max(e, t, r.value) + jr;
2678
+ }), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), E = i(() => Br({
2679
+ active: e.active.value,
2680
+ maxScrollTop: oe(),
2681
+ progressDistancePx: n.value,
2682
+ thresholdPx: kr,
2683
+ triggerEnabled: w.value
2684
+ })), D = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => zr({
2685
+ active: e.active.value,
2686
+ maxScrollTop: oe(),
2687
+ progressDistancePx: n.value,
2688
+ thresholdPx: Ar,
2689
+ triggerEnabled: e.hasPreviousPage.value
2690
+ })), k = i(() => Math.max(0, r.value - Nr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
2691
+ if (!A.value) return 0;
2692
+ let e = r.value / C.value * k.value;
2693
+ return Math.min(k.value, Math.max(Pr, e));
2694
+ }), M = i(() => {
2695
+ if (!A.value) return Nr;
2672
2696
  let e = Math.max(0, C.value - r.value);
2673
- return jr + Math.max(0, D.value - k.value) * (e > 0 ? Ir(n.value / e, 0, 1) : 0);
2674
- }), j = pr({
2697
+ return Nr + Math.max(0, k.value - j.value) * (e > 0 ? Rr(n.value / e, 0, 1) : 0);
2698
+ }), N = mr({
2675
2699
  items: e.items,
2676
2700
  visibleIndices: y,
2677
2701
  positions: o,
@@ -2680,37 +2704,37 @@ function Fr(e) {
2680
2704
  columnWidth: _,
2681
2705
  scrollTop: n,
2682
2706
  viewportHeight: r
2683
- }), M = Sr({
2707
+ }), P = Cr({
2684
2708
  direction: "top",
2685
2709
  getAnimationLockMs(e) {
2686
- return Math.max(Nr, ur(e)) + Pr;
2710
+ return Math.max(Fr, dr(e)) + Ir;
2687
2711
  },
2688
2712
  hasPage: e.hasPreviousPage,
2689
2713
  interactionLocked: p,
2690
2714
  isAtBoundary() {
2691
- return n.value <= wr + Tr;
2715
+ return n.value <= Ar;
2692
2716
  },
2693
2717
  loading: e.loading,
2694
2718
  requestPage: e.requestPreviousPage
2695
- }), N = Sr({
2719
+ }), I = Cr({
2696
2720
  direction: "bottom",
2697
2721
  getAnimationLockMs(e) {
2698
- return ur(e) + Pr;
2722
+ return dr(e) + Ir;
2699
2723
  },
2700
2724
  hasPage: w,
2701
2725
  interactionLocked: p,
2702
2726
  isAtBoundary() {
2703
- return re() <= Or;
2727
+ return ae() <= kr;
2704
2728
  },
2705
2729
  loading: e.loading,
2706
2730
  requestPage: e.requestNextPage
2707
- }), P = null, I = 0, L = null, R = null, z = !1;
2731
+ }), L = null, R = 0, z = null, B = null, V = !1;
2708
2732
  F([
2709
2733
  () => e.items.value,
2710
2734
  h,
2711
2735
  _
2712
2736
  ], async ([t], [r = []]) => {
2713
- let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = tr(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) => {
2737
+ let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = nr(a, u.value, o.value), l = Z(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
2714
2738
  let t = $(e);
2715
2739
  if (f.has(t)) return [];
2716
2740
  let n = c.get(t), r = l.get(t);
@@ -2719,15 +2743,15 @@ function Fr(e) {
2719
2743
  item: e,
2720
2744
  position: n
2721
2745
  }];
2722
- }), 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 = m.length > 0 && n.value > wr + Tr, b = h && n.value > wr + Tr ? t[v.value] : null, x = b ? $(b) : null;
2723
- y && G(dr() + Pr), _ && W(), ee(), 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 ? Nr : void 0), x ? (await g(), U(x, c)) : e.active.value && s.length > 0 && q();
2746
+ }), 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 = m.length > 0 && n.value > Tr + Er, b = h && n.value > Tr + Er ? t[v.value] : null, x = b ? $(b) : null;
2747
+ y && te(fr() + Ir), _ && q(), H(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : I.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? Fr : void 0), x ? (await g(), K(x, c)) : e.active.value && s.length > 0 && ne();
2724
2748
  }, { immediate: !0 }), F([
2725
2749
  () => e.pendingAppendItems.value.map((e) => $(e)),
2726
2750
  h,
2727
2751
  _,
2728
2752
  r
2729
2753
  ], ([t]) => {
2730
- ce(), t.length && (d.value = ae([...e.items.value, ...e.pendingAppendItems.value]), se());
2754
+ ue(), t.length && (d.value = ce([...e.items.value, ...e.pendingAppendItems.value]), le());
2731
2755
  }, { immediate: !0 }), F(() => e.active.value, async (e, i) => {
2732
2756
  let a = t.value;
2733
2757
  if (!a) return;
@@ -2737,75 +2761,75 @@ function Fr(e) {
2737
2761
  }
2738
2762
  if (i !== !1 || f.value == null) return;
2739
2763
  await g();
2740
- let o = Math.max(0, C.value - r.value), s = Ir(f.value, 0, o);
2741
- a.scrollTop = s, n.value = s, M.syncBoundary(), N.syncBoundary();
2764
+ let o = Math.max(0, C.value - r.value), s = Rr(f.value, 0, o);
2765
+ a.scrollTop = s, n.value = s, P.syncBoundary(), I.syncBoundary();
2742
2766
  }), F(() => e.loading.value, async (t) => {
2743
- !t && !e.pendingAppendItems.value.length && !L && !z && (d.value = null), M.onLoadingChange(t), N.onLoadingChange(t), await g();
2767
+ !t && !e.pendingAppendItems.value.length && !z && !V && (d.value = null), P.onLoadingChange(t), I.onLoadingChange(t), await g();
2744
2768
  }), x(async () => {
2745
- Y(), await g(), v.value > 0 ? H(v.value, "center") : K(), M.syncBoundary(), N.syncBoundary(), typeof ResizeObserver < "u" ? (P = new ResizeObserver(() => {
2746
- Y();
2747
- }), t.value && P.observe(t.value)) : window.addEventListener("resize", Y);
2769
+ X(), await g(), v.value > 0 ? G(v.value, "center") : J(), P.syncBoundary(), I.syncBoundary(), typeof ResizeObserver < "u" ? (L = new ResizeObserver(() => {
2770
+ X();
2771
+ }), t.value && L.observe(t.value)) : window.addEventListener("resize", X);
2748
2772
  }), b(() => {
2749
- P?.disconnect(), P = null, window.removeEventListener("resize", Y), ce(), Z(), I &&= (cancelAnimationFrame(I), 0);
2773
+ L?.disconnect(), L = null, window.removeEventListener("resize", X), ue(), de(), R &&= (cancelAnimationFrame(R), 0);
2750
2774
  });
2751
- function ee() {
2752
- let t = $n(e.items.value, {
2775
+ function H() {
2776
+ let t = er(e.items.value, {
2753
2777
  columnCount: h.value,
2754
2778
  columnWidth: _.value,
2755
- gapX: Tr,
2756
- gapY: Tr,
2757
- bucketPx: Cr
2779
+ gapX: Er,
2780
+ gapY: Er,
2781
+ bucketPx: wr
2758
2782
  });
2759
2783
  o.value = t.positions.map((e) => ({
2760
- x: e.x + wr,
2761
- y: e.y + wr
2784
+ x: e.x + Tr,
2785
+ y: e.y + Tr
2762
2786
  })), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
2763
2787
  }
2764
- function B() {
2765
- e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = X(), M.syncBoundary(), N.syncBoundary(), J(), !q() && (I ||= requestAnimationFrame(() => {
2766
- I = 0, K();
2788
+ function ee() {
2789
+ e.active.value && (n.value = t.value?.scrollTop ?? 0, r.value = re(), P.syncBoundary(), I.syncBoundary(), Y(), !ne() && (R ||= requestAnimationFrame(() => {
2790
+ R = 0, J();
2767
2791
  })));
2768
2792
  }
2769
- function V(t) {
2770
- e.active.value && (M.onWheel(t), N.onWheel(t), J());
2793
+ function U(t) {
2794
+ e.active.value && (P.onWheel(t), I.onWheel(t), Y());
2771
2795
  }
2772
- function te(t) {
2796
+ function W(t) {
2773
2797
  let n = e.items.value[t], r = n ? $(n) : "";
2774
2798
  return {
2775
2799
  height: `${s.value[t] ?? _.value}px`,
2776
2800
  width: `${_.value}px`,
2777
- transition: r ? j.getCardTransition(r) : void 0,
2778
- transitionDelay: r ? j.getCardTransitionDelay(r) : void 0,
2779
- transform: j.getCardTransform(t)
2801
+ transition: r ? N.getCardTransition(r) : void 0,
2802
+ transitionDelay: r ? N.getCardTransitionDelay(r) : void 0,
2803
+ transform: N.getCardTransform(t)
2780
2804
  };
2781
2805
  }
2782
- function H(e, i) {
2806
+ function G(e, i) {
2783
2807
  let a = t.value, c = o.value[e], l = s.value[e];
2784
2808
  if (!a || !c || !l) return;
2785
2809
  let u = a.scrollTop, d = Math.max(0, C.value - r.value);
2786
- i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - wr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + wr), a.scrollTop = Ir(u, 0, d), n.value = a.scrollTop, K();
2810
+ i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Tr : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Tr), a.scrollTop = Rr(u, 0, d), n.value = a.scrollTop, J();
2787
2811
  }
2788
- function U(e, r) {
2812
+ function K(e, r) {
2789
2813
  let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
2790
2814
  if (!i || !a || !c) return;
2791
2815
  let l = c.y - a.y;
2792
2816
  i.scrollTop += l, n.value = i.scrollTop;
2793
2817
  }
2794
- function W() {
2818
+ function q() {
2795
2819
  let e = t.value;
2796
2820
  if (!e) {
2797
2821
  n.value = 0;
2798
2822
  return;
2799
2823
  }
2800
- e.scrollTop = 0, n.value = 0, M.syncBoundary(), N.syncBoundary();
2824
+ e.scrollTop = 0, n.value = 0, P.syncBoundary(), I.syncBoundary();
2801
2825
  }
2802
- function G(e) {
2803
- Z(), p.value = !0, R = setTimeout(() => {
2804
- R = null, p.value = !1;
2826
+ function te(e) {
2827
+ de(), p.value = !0, B = setTimeout(() => {
2828
+ B = null, p.value = !1;
2805
2829
  }, Math.max(0, e));
2806
2830
  }
2807
- function K() {
2808
- if (!y.value.length || q()) return;
2831
+ function J() {
2832
+ if (!y.value.length || ne()) return;
2809
2833
  let t = n.value + r.value / 2, i = v.value, a = Infinity;
2810
2834
  for (let e of y.value) {
2811
2835
  let n = o.value[e], r = s.value[e];
@@ -2815,38 +2839,42 @@ function Fr(e) {
2815
2839
  }
2816
2840
  e.setActiveIndex(i);
2817
2841
  }
2818
- function q() {
2819
- let t = n.value <= wr + Tr, r = re() <= Or;
2842
+ function ne() {
2843
+ let t = n.value <= Ar, r = ae() <= kr;
2820
2844
  return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
2821
2845
  }
2822
- function J() {
2823
- M.maybeRequestPage(), N.maybeRequestPage();
2824
- }
2825
2846
  function Y() {
2826
- r.value = X(), a.value = ne();
2847
+ P.maybeRequestPage(), I.maybeRequestPage();
2827
2848
  }
2828
2849
  function X() {
2829
- return gr(t.value, r.value);
2830
- }
2831
- function ne() {
2832
- return _r(t.value, a.value, Er);
2850
+ r.value = re(), a.value = ie();
2833
2851
  }
2834
2852
  function re() {
2835
- return vr(t.value, n.value, r.value, C.value);
2853
+ return _r(t.value, r.value);
2836
2854
  }
2837
2855
  function ie() {
2838
- return yr(k.value, A.value);
2856
+ return vr(t.value, a.value, Dr);
2857
+ }
2858
+ function ae() {
2859
+ return yr(t.value, n.value, r.value, C.value);
2860
+ }
2861
+ function oe() {
2862
+ let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
2863
+ return Math.max(0, e - r.value);
2839
2864
  }
2840
- function ae(e) {
2841
- return e.length ? $n(e, {
2865
+ function se() {
2866
+ return br(j.value, M.value);
2867
+ }
2868
+ function ce(e) {
2869
+ return e.length ? er(e, {
2842
2870
  columnCount: h.value,
2843
2871
  columnWidth: _.value,
2844
- gapX: Tr,
2845
- gapY: Tr,
2846
- bucketPx: Cr
2847
- }).contentHeight + wr * 2 : 0;
2872
+ gapX: Er,
2873
+ gapY: Er,
2874
+ bucketPx: wr
2875
+ }).contentHeight + Tr * 2 : 0;
2848
2876
  }
2849
- function oe(e) {
2877
+ function Z(e) {
2850
2878
  let t = /* @__PURE__ */ new Map();
2851
2879
  for (let n of e) {
2852
2880
  let e = $(n), r = u.value.get(e);
@@ -2856,52 +2884,64 @@ function Fr(e) {
2856
2884
  }
2857
2885
  return t;
2858
2886
  }
2859
- function se() {
2887
+ function le() {
2860
2888
  let t = e.commitPendingAppend.value;
2861
- typeof t == "function" && (L = setTimeout(async () => {
2862
- L = null, z = !0;
2889
+ typeof t == "function" && (z = setTimeout(async () => {
2890
+ z = null, V = !0;
2863
2891
  try {
2864
2892
  if (!e.pendingAppendItems.value.length) return;
2865
2893
  await t(), await g(), await g();
2866
2894
  } finally {
2867
- d.value = null, z = !1;
2895
+ d.value = null, V = !1;
2868
2896
  }
2869
- }, Ar));
2897
+ }, Mr));
2870
2898
  }
2871
- function ce() {
2872
- L &&= (clearTimeout(L), null);
2899
+ function ue() {
2900
+ z &&= (clearTimeout(z), null);
2873
2901
  }
2874
- function Z() {
2875
- R && (clearTimeout(R), R = null, p.value = !1);
2902
+ function de() {
2903
+ B && (clearTimeout(B), B = null, p.value = !1);
2876
2904
  }
2877
2905
  return {
2878
2906
  columnWidth: _,
2879
2907
  containerHeight: C,
2880
- getCardStyle: te,
2881
- getLeavingCardStyle: j.getLeavingCardStyle,
2882
- getScrollbarThumbStyle: ie,
2883
- leavingItems: j.leavingItems,
2884
- onScroll: B,
2885
- onWheel: V,
2886
- paginationLabel: E,
2908
+ getCardStyle: W,
2909
+ getLeavingCardStyle: N.getLeavingCardStyle,
2910
+ getScrollbarThumbStyle: se,
2911
+ leavingItems: N.leavingItems,
2912
+ nextBoundaryLoadProgress: E,
2913
+ onScroll: ee,
2914
+ onWheel: U,
2915
+ paginationLabel: D,
2916
+ previousBoundaryLoadProgress: O,
2887
2917
  renderedItems: S,
2888
2918
  resolvedActiveIndex: v,
2889
- scrollToIndex: H,
2890
- showScrollbar: O,
2919
+ scrollToIndex: G,
2920
+ showScrollbar: A,
2891
2921
  scrollViewportRef: t
2892
2922
  };
2893
2923
  }
2894
- function Ir(e, t, n) {
2924
+ function Rr(e, t, n) {
2895
2925
  return Math.min(Math.max(e, t), n);
2896
2926
  }
2927
+ function zr(e) {
2928
+ if (!e.active || !e.triggerEnabled) return 0;
2929
+ let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
2930
+ return t <= 0 ? 1 : Rr(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
2931
+ }
2932
+ function Br(e) {
2933
+ if (!e.active || !e.triggerEnabled) return 0;
2934
+ let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
2935
+ return t <= 0 ? 1 : Rr(e.progressDistancePx / t, 0, 1);
2936
+ }
2897
2937
  //#endregion
2898
2938
  //#region src/components/viewer-core/listCardAsset.ts
2899
- function Lr(e) {
2939
+ function Vr(e) {
2900
2940
  if (e) try {
2901
2941
  e.removeAttribute("src"), e.src = "";
2902
2942
  } catch {}
2903
2943
  }
2904
- function Rr(e) {
2944
+ function Hr(e) {
2905
2945
  if (e) {
2906
2946
  try {
2907
2947
  e.currentTime = 0;
@@ -2912,12 +2952,12 @@ function Rr(e) {
2912
2952
  } catch {}
2913
2953
  }
2914
2954
  }
2915
- function zr(e, t) {
2955
+ function Ur(e, t) {
2916
2956
  if (t) return e.bottom > t.top && e.top < t.bottom;
2917
2957
  let n = window.innerHeight || document.documentElement.clientHeight || 0;
2918
2958
  return e.bottom > 0 && e.top < n;
2919
2959
  }
2920
- function Br(e) {
2960
+ function Wr(e) {
2921
2961
  if (!e) return null;
2922
2962
  try {
2923
2963
  return new URL(e, window.location.href).href;
@@ -2927,57 +2967,75 @@ function Br(e) {
2927
2967
  }
2928
2968
  //#endregion
2929
2969
  //#region src/components/viewer-core/listPreview.ts
2930
- var Vr = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, Hr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i;
2931
- function Ur(e) {
2932
- let t = e.preview?.url ?? e.url, n = Yn(e), r = e.title?.trim() || Ct(e.type);
2933
- return e.type !== "image" && e.type !== "video" ? {
2970
+ var Gr = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, Kr = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, qr = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
2971
+ function Jr(e) {
2972
+ let t = Yr(e), n = t?.url, r = Xn(e), i = e.title?.trim() || wt(e.type);
2973
+ return t?.mediaType === "video" && typeof n == "string" ? {
2974
+ kind: "video",
2975
+ url: n,
2976
+ width: r.width,
2977
+ height: r.height,
2978
+ label: i
2979
+ } : t?.mediaType === "image" && typeof n == "string" ? {
2980
+ kind: "image",
2981
+ url: n,
2982
+ width: r.width,
2983
+ height: r.height,
2984
+ label: i
2985
+ } : e.type !== "image" && e.type !== "video" ? {
2934
2986
  kind: "fallback",
2935
2987
  url: null,
2936
- width: n.width,
2937
- height: n.height,
2938
- label: r
2939
- } : Gr(e, t) ? {
2988
+ width: r.width,
2989
+ height: r.height,
2990
+ label: i
2991
+ } : typeof n == "string" && Zr(e, n) ? {
2940
2992
  kind: "video",
2941
- url: t,
2942
- width: n.width,
2943
- height: n.height,
2944
- label: r
2945
- } : Wr(e, t) ? {
2993
+ url: n,
2994
+ width: r.width,
2995
+ height: r.height,
2996
+ label: i
2997
+ } : typeof n == "string" && Xr(e, n) ? {
2946
2998
  kind: "image",
2947
- url: t,
2948
- width: n.width,
2949
- height: n.height,
2950
- label: r
2999
+ url: n,
3000
+ width: r.width,
3001
+ height: r.height,
3002
+ label: i
2951
3003
  } : {
2952
3004
  kind: "fallback",
2953
3005
  url: null,
2954
- width: n.width,
2955
- height: n.height,
2956
- label: r
3006
+ width: r.width,
3007
+ height: r.height,
3008
+ label: i
2957
3009
  };
2958
3010
  }
2959
- function Wr(e, t) {
2960
- return e.type !== "image" || typeof t != "string" ? !1 : Vr.test(t) || Kr(t);
3011
+ function Yr(e) {
3012
+ return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
3013
+ }
3014
+ function Xr(e, t) {
3015
+ return e.type !== "image" || typeof t != "string" ? !1 : Gr.test(t) || Qr(t);
2961
3016
  }
2962
- function Gr(e, t) {
2963
- return e.type === "video" && typeof t == "string" && Hr.test(t);
3017
+ function Zr(e, t) {
3018
+ return e.type !== "video" || typeof t != "string" ? !1 : Kr.test(t) || $r(t);
2964
3019
  }
2965
- function Kr(e) {
3020
+ function Qr(e) {
2966
3021
  return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
2967
3022
  }
3023
+ function $r(e) {
3024
+ return qr.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
3025
+ }
2968
3026
  //#endregion
2969
3027
  //#region src/components/viewer-core/useAssetLoadQueue.ts
2970
- var qr = {
3028
+ var ei = {
2971
3029
  maxGlobal: 10,
2972
3030
  maxPerDomain: 4,
2973
3031
  maxVideoPerDomain: 2
2974
3032
  };
2975
- function Jr(e = qr) {
3033
+ function ti(e = ei) {
2976
3034
  let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
2977
3035
  function i(e) {
2978
3036
  let i = {
2979
3037
  ...e,
2980
- domain: Zr(e.url),
3038
+ domain: ii(e.url),
2981
3039
  enqueuedAt: r,
2982
3040
  id: `vibe-asset-load-${r += 1}`
2983
3041
  };
@@ -2996,7 +3054,7 @@ function Jr(e = qr) {
2996
3054
  function a() {
2997
3055
  if (n.size === 0) return;
2998
3056
  let r = [...n.values()].sort((e, t) => {
2999
- let n = Xr(e) - Xr(t);
3057
+ let n = ri(e) - ri(t);
3000
3058
  return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
3001
3059
  });
3002
3060
  for (let i of r) {
@@ -3017,8 +3075,8 @@ function Jr(e = qr) {
3017
3075
  }
3018
3076
  return { request: i };
3019
3077
  }
3020
- var Yr = Jr();
3021
- function Xr(e) {
3078
+ var ni = ti();
3079
+ function ri(e) {
3022
3080
  try {
3023
3081
  let t = e.getPriority();
3024
3082
  return Number.isFinite(t) ? t : Infinity;
@@ -3026,7 +3084,7 @@ function Xr(e) {
3026
3084
  return Infinity;
3027
3085
  }
3028
3086
  }
3029
- function Zr(e) {
3087
+ function ii(e) {
3030
3088
  try {
3031
3089
  return new URL(e).hostname || "local";
3032
3090
  } catch {
@@ -3035,14 +3093,14 @@ function Zr(e) {
3035
3093
  }
3036
3094
  //#endregion
3037
3095
  //#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
3038
- var Qr = ["aria-label"], $r = {
3096
+ var ai = ["aria-label"], oi = {
3039
3097
  key: 0,
3040
3098
  "data-testid": "vibe-list-card-spinner",
3041
3099
  class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
3042
- }, ei = { 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]" }, ti = ["src", "alt"], ni = ["src"], ri = ["data-kind"], ii = { class: "grid justify-items-center gap-3 px-4 text-center" }, ai = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, oi = {
3100
+ }, si = { 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]" }, ci = ["src", "alt"], li = ["src"], ui = ["data-kind"], di = { class: "grid justify-items-center gap-3 px-4 text-center" }, fi = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, pi = {
3043
3101
  key: 4,
3044
3102
  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))]"
3045
- }, si = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, ci = { class: "pointer-events-none absolute inset-0 z-[3]" }, li = /* @__PURE__ */ d({
3103
+ }, mi = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, hi = { class: "pointer-events-none absolute inset-0 z-[3]" }, gi = /* @__PURE__ */ d({
3046
3104
  __name: "ListCard",
3047
3105
  props: {
3048
3106
  active: {
@@ -3066,48 +3124,48 @@ var Qr = ["aria-label"], $r = {
3066
3124
  },
3067
3125
  emits: ["open"],
3068
3126
  setup(e, { emit: t }) {
3069
- let n = e, r = t, l = i(() => Ur(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(!1), g = T(null), v = T(null), y = T(null), C = T(null), w = T(null), E = T(l.value.kind === "fallback"), A = i(() => E.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), M = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), N = i(() => l.value.kind === "image" && !!A.value), P = i(() => l.value.kind === "video" && !!A.value), I = i(() => !!g.value), L = i(() => Ht(g.value)), R = i(() => M.value && !g.value && (!E.value || !m.value)), ee = null, B = null, V = /* @__PURE__ */ new Set();
3127
+ let n = e, r = t, l = i(() => Jr(n.item)), d = T(!1), f = T(!1), p = T(!1), m = T(l.value.kind === "fallback"), h = T(!1), g = T(null), v = T(null), y = T(null), C = T(null), w = T(null), E = T(l.value.kind === "fallback"), A = i(() => E.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), M = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), N = i(() => l.value.kind === "image" && !!A.value), P = i(() => l.value.kind === "video" && !!A.value), I = i(() => !!g.value), L = i(() => Ut(g.value)), R = i(() => M.value && !g.value && (!E.value || !m.value)), B = null, V = null, H = /* @__PURE__ */ new Set();
3070
3128
  F([A, () => l.value.kind], () => {
3071
3129
  let e = l.value.kind === "fallback";
3072
3130
  m.value = e, h.value = !1, g.value = null, e && (E.value = !0);
3073
3131
  }), F(M, () => {
3074
- G();
3132
+ K();
3075
3133
  }), F([
3076
3134
  d,
3077
3135
  m,
3078
3136
  A
3079
3137
  ], () => {
3080
- K();
3138
+ q();
3081
3139
  }), F(() => n.surfaceActive, (e) => {
3082
3140
  if (!e) {
3083
- J(), K();
3141
+ J(), q();
3084
3142
  return;
3085
3143
  }
3086
3144
  requestAnimationFrame(() => {
3087
- Y(), G(), K();
3145
+ ne(), K(), q();
3088
3146
  });
3089
3147
  }), x(() => {
3090
3148
  if (!y.value || typeof IntersectionObserver > "u") {
3091
- C.value = null, d.value = !0, G();
3149
+ C.value = null, d.value = !0, K();
3092
3150
  return;
3093
3151
  }
3094
- C.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"), ee = new IntersectionObserver((e) => {
3095
- for (let t of e) t.target === y.value && (n.surfaceActive && Y(t), G(), K());
3152
+ C.value = y.value.closest("[data-testid=\"vibe-list-scroll\"]"), B = new IntersectionObserver((e) => {
3153
+ for (let t of e) t.target === y.value && (n.surfaceActive && ne(t), K(), q());
3096
3154
  }, {
3097
3155
  root: C.value,
3098
3156
  threshold: [0, 1]
3099
- }), ee.observe(y.value);
3157
+ }), B.observe(y.value);
3100
3158
  }), b(() => {
3101
- q(), ee?.disconnect(), ee = null;
3159
+ te(), B?.disconnect(), B = null;
3102
3160
  });
3103
- function te() {
3104
- ce(v.value) && (m.value = !0, g.value = null, X(A.value ?? n.item.url), J());
3161
+ function ee() {
3162
+ ce(v.value) && (m.value = !0, g.value = null, Y(A.value ?? n.item.url), J());
3105
3163
  }
3106
- async function H() {
3164
+ async function U() {
3107
3165
  if (!ce(v.value)) return;
3108
3166
  let e = A.value ?? n.item.url;
3109
3167
  m.value = !1, g.value = "generic";
3110
- let t = await Ut(e);
3168
+ let t = await Wt(e);
3111
3169
  g.value = t, n.reportAssetError?.({
3112
3170
  item: n.item,
3113
3171
  occurrenceKey: $(n.item),
@@ -3116,15 +3174,15 @@ var Qr = ["aria-label"], $r = {
3116
3174
  surface: "grid"
3117
3175
  }), J();
3118
3176
  }
3119
- function U() {
3120
- ce(w.value) && (h.value = !0, m.value = !0, g.value = null, X(A.value ?? n.item.url), J(), K());
3121
- }
3122
3177
  function W() {
3123
- ce(w.value) && (h.value || (m.value = !1));
3178
+ ce(w.value) && (h.value = !0, m.value = !0, g.value = null, Y(A.value ?? n.item.url), J(), q());
3124
3179
  }
3125
3180
  function G() {
3181
+ ce(w.value) && (h.value || (m.value = !1));
3182
+ }
3183
+ function K() {
3126
3184
  if (l.value.kind === "fallback") {
3127
- q(!1);
3185
+ te(!1);
3128
3186
  return;
3129
3187
  }
3130
3188
  if (!n.surfaceActive) {
@@ -3132,14 +3190,14 @@ var Qr = ["aria-label"], $r = {
3132
3190
  return;
3133
3191
  }
3134
3192
  if (!M.value) {
3135
- q();
3193
+ te();
3136
3194
  return;
3137
3195
  }
3138
- if (E.value || B) {
3139
- B?.refresh();
3196
+ if (E.value || V) {
3197
+ V?.refresh();
3140
3198
  return;
3141
3199
  }
3142
- B = Yr.request({
3200
+ V = ni.request({
3143
3201
  assetType: l.value.kind,
3144
3202
  getPriority: se,
3145
3203
  onGrant() {
@@ -3148,7 +3206,7 @@ var Qr = ["aria-label"], $r = {
3148
3206
  url: l.value.url ?? n.item.url
3149
3207
  });
3150
3208
  }
3151
- function K() {
3209
+ function q() {
3152
3210
  let e = w.value;
3153
3211
  if (!(!e || l.value.kind !== "video")) {
3154
3212
  if (g.value) {
@@ -3156,7 +3214,7 @@ var Qr = ["aria-label"], $r = {
3156
3214
  return;
3157
3215
  }
3158
3216
  if (A.value && d.value && m.value) {
3159
- e.muted = !0, e.loop = !0, e.playsInline = !0, Kt(e);
3217
+ e.muted = !0, e.loop = !0, e.playsInline = !0, qt(e);
3160
3218
  return;
3161
3219
  }
3162
3220
  try {
@@ -3165,42 +3223,42 @@ var Qr = ["aria-label"], $r = {
3165
3223
  e.pause();
3166
3224
  }
3167
3225
  }
3168
- function q(e = !0) {
3226
+ function te(e = !0) {
3169
3227
  E.value = l.value.kind === "fallback", g.value = null, m.value = l.value.kind === "fallback", e && (ie(), ae()), J();
3170
3228
  }
3171
3229
  function J() {
3172
- B?.release(), B = null;
3230
+ V?.release(), V = null;
3173
3231
  }
3174
- function Y(e) {
3232
+ function ne(e) {
3175
3233
  let t = y.value;
3176
3234
  if (!t) {
3177
3235
  d.value = !0;
3178
3236
  return;
3179
3237
  }
3180
- d.value = zr(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? C.value?.getBoundingClientRect() ?? null);
3238
+ d.value = Ur(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? C.value?.getBoundingClientRect() ?? null);
3181
3239
  }
3182
- function X(e) {
3240
+ function Y(e) {
3183
3241
  if (!e) return;
3184
3242
  let t = $(n.item), r = `${t}|${e}`;
3185
- V.has(r) || (V.add(r), n.reportAssetLoad?.({
3243
+ H.has(r) || (H.add(r), n.reportAssetLoad?.({
3186
3244
  item: n.item,
3187
3245
  occurrenceKey: t,
3188
3246
  surface: "grid",
3189
3247
  url: e
3190
3248
  }));
3191
3249
  }
3192
- function ne() {
3250
+ function X() {
3193
3251
  if (!L.value) return;
3194
3252
  let e = $(n.item);
3195
- V.forEach((t) => {
3196
- t.startsWith(`${e}|`) && V.delete(t);
3197
- }), g.value = null, m.value = !1, E.value = !1, J(), G();
3253
+ H.forEach((t) => {
3254
+ t.startsWith(`${e}|`) && H.delete(t);
3255
+ }), g.value = null, m.value = !1, E.value = !1, J(), K();
3198
3256
  }
3199
3257
  function ie() {
3200
- Lr(v.value);
3258
+ Vr(v.value);
3201
3259
  }
3202
3260
  function ae() {
3203
- Rr(w.value);
3261
+ Hr(w.value);
3204
3262
  }
3205
3263
  function se() {
3206
3264
  let e = y.value;
@@ -3214,8 +3272,8 @@ var Qr = ["aria-label"], $r = {
3214
3272
  return Math.abs((t.top + t.bottom) / 2 - n);
3215
3273
  }
3216
3274
  function ce(e) {
3217
- let t = Br(A.value);
3218
- return !e || !t ? !1 : Br("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3275
+ let t = Wr(A.value);
3276
+ return !e || !t ? !1 : Wr("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
3219
3277
  }
3220
3278
  function Z() {
3221
3279
  r("open");
@@ -3243,8 +3301,8 @@ var Qr = ["aria-label"], $r = {
3243
3301
  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]",
3244
3302
  "aria-label": n.item.title || `Open item ${n.index + 1}`,
3245
3303
  onClick: Z
3246
- }, null, 8, Qr),
3247
- R.value ? (S(), s("div", $r, [c("span", ei, [u(j(re), {
3304
+ }, null, 8, ai),
3305
+ R.value ? (S(), s("div", oi, [c("span", si, [u(j(re), {
3248
3306
  class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
3249
3307
  "aria-hidden": "true"
3250
3308
  })])])) : o("", !0),
@@ -3256,9 +3314,9 @@ var Qr = ["aria-label"], $r = {
3256
3314
  alt: l.value.label,
3257
3315
  draggable: "false",
3258
3316
  class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
3259
- onLoad: te,
3260
- onError: H
3261
- }, null, 42, ti)) : P.value && A.value && !I.value ? (S(), s("video", {
3317
+ onLoad: ee,
3318
+ onError: U
3319
+ }, null, 42, ci)) : P.value && A.value && !I.value ? (S(), s("video", {
3262
3320
  key: 2,
3263
3321
  ref_key: "videoRef",
3264
3322
  ref: w,
@@ -3268,37 +3326,37 @@ var Qr = ["aria-label"], $r = {
3268
3326
  playsinline: "",
3269
3327
  preload: "metadata",
3270
3328
  class: _(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
3271
- onCanplay: U,
3272
- onError: H,
3273
- onLoadstart: W,
3274
- onPlaying: U,
3275
- onStalled: W,
3276
- onWaiting: W
3277
- }, null, 42, ni)) : I.value ? (S(), s("div", {
3329
+ onCanplay: W,
3330
+ onError: U,
3331
+ onLoadstart: G,
3332
+ onPlaying: W,
3333
+ onStalled: G,
3334
+ onWaiting: G
3335
+ }, null, 42, li)) : I.value ? (S(), s("div", {
3278
3336
  key: 3,
3279
3337
  "data-testid": "vibe-list-card-error",
3280
3338
  "data-kind": g.value,
3281
3339
  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))]"
3282
- }, [c("div", ii, [
3340
+ }, [c("div", di, [
3283
3341
  u(j(oe), {
3284
3342
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3285
3343
  "aria-hidden": "true"
3286
3344
  }),
3287
- c("span", ai, k(j(Vt)(g.value)), 1),
3345
+ c("span", fi, k(j(Ht)(g.value)), 1),
3288
3346
  L.value ? (S(), s("button", {
3289
3347
  key: 0,
3290
3348
  type: "button",
3291
3349
  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",
3292
- onClick: z(ne, ["stop"])
3350
+ onClick: z(X, ["stop"])
3293
3351
  }, " Retry ")) : o("", !0)
3294
- ])], 8, ri)) : (S(), s("div", oi, [c("div", si, [D(e.$slots, "item-icon", {
3295
- icon: j(St)(n.item.type),
3352
+ ])], 8, ui)) : (S(), s("div", pi, [c("div", mi, [D(e.$slots, "item-icon", {
3353
+ icon: j(Ct)(n.item.type),
3296
3354
  item: n.item
3297
- }, () => [(S(), a(O(j(St)(n.item.type)), {
3355
+ }, () => [(S(), a(O(j(Ct)(n.item.type)), {
3298
3356
  class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
3299
3357
  "aria-hidden": "true"
3300
3358
  }))])])])),
3301
- c("div", ci, [D(e.$slots, "grid-item-overlay", {
3359
+ c("div", hi, [D(e.$slots, "grid-item-overlay", {
3302
3360
  active: n.active,
3303
3361
  focused: f.value,
3304
3362
  hovered: p.value,
@@ -3308,24 +3366,24 @@ var Qr = ["aria-label"], $r = {
3308
3366
  })])
3309
3367
  ], 34));
3310
3368
  }
3311
- }), ui = { 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)]" }, di = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, fi = {
3369
+ }), _i = { 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)]" }, vi = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, yi = {
3312
3370
  "data-testid": "vibe-pagination",
3313
3371
  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]"
3314
- }, pi = { class: "whitespace-nowrap" }, mi = {
3372
+ }, bi = { class: "whitespace-nowrap" }, xi = {
3315
3373
  key: 0,
3316
3374
  class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
3317
- }, hi = [
3375
+ }, Si = [
3318
3376
  "data-active",
3319
3377
  "data-index",
3320
3378
  "data-item-id",
3321
3379
  "data-occurrence-key"
3322
- ], gi = ["data-item-id"], _i = {
3380
+ ], Ci = ["data-item-id"], wi = {
3323
3381
  key: 0,
3324
3382
  class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
3325
- }, vi = {
3383
+ }, Ti = {
3326
3384
  key: 1,
3327
3385
  class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
3328
- }, yi = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, bi = /* @__PURE__ */ d({
3386
+ }, Ei = { class: "mx-auto flex w-full max-w-[1600px] justify-center" }, Di = /* @__PURE__ */ d({
3329
3387
  __name: "ListSurface",
3330
3388
  props: {
3331
3389
  active: {
@@ -3380,9 +3438,13 @@ var Qr = ["aria-label"], $r = {
3380
3438
  default: !0
3381
3439
  }
3382
3440
  },
3383
- emits: ["open-fullscreen", "update:activeIndex"],
3441
+ emits: [
3442
+ "boundary-load-progress",
3443
+ "open-fullscreen",
3444
+ "update:activeIndex"
3445
+ ],
3384
3446
  setup(e, { emit: n }) {
3385
- let r = e, d = N(), f = n, p = Fr({
3447
+ let r = e, d = N(), f = n, p = Lr({
3386
3448
  active: A(r, "active"),
3387
3449
  allowExhaustedNextPageRefresh: A(r, "allowExhaustedNextPageRefresh"),
3388
3450
  items: A(r, "items"),
@@ -3398,11 +3460,11 @@ var Qr = ["aria-label"], $r = {
3398
3460
  setActiveIndex(e) {
3399
3461
  f("update:activeIndex", e);
3400
3462
  }
3401
- }), m = i(() => Mt({
3463
+ }), m = i(() => Nt({
3402
3464
  itemCount: r.items.length,
3403
3465
  loading: r.loading,
3404
3466
  phase: r.phase
3405
- })), g = i(() => Nt({
3467
+ })), g = i(() => Pt({
3406
3468
  errorMessage: r.errorMessage,
3407
3469
  hasItems: r.items.length > 0,
3408
3470
  hasNextPage: r.hasNextPage,
@@ -3415,15 +3477,20 @@ var Qr = ["aria-label"], $r = {
3415
3477
  message: g.value.message,
3416
3478
  paginationDetail: r.paginationDetail,
3417
3479
  total: r.items.length
3418
- }), x = i(() => !b.value || !d["grid-status"] ? [] : d["grid-status"](b.value)), C = i(() => Dt(x.value)), w = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: O, showCustomEmptyState: M, showInlineEmptyState: P } = At({
3480
+ }), x = i(() => !b.value || !d["grid-status"] ? [] : d["grid-status"](b.value)), C = i(() => Ot(x.value)), w = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: O, showCustomEmptyState: M, showInlineEmptyState: P } = jt({
3419
3481
  emptyStateMode: A(r, "emptyStateMode"),
3420
3482
  itemCount: w,
3421
3483
  loading: A(r, "loading"),
3422
3484
  renderSlot: d["empty-state"],
3423
3485
  surface: "grid"
3424
3486
  });
3425
- return (e, n) => (S(), s("div", ui, [
3426
- c("div", di, [c("span", fi, [c("span", pi, k(j(p).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", mi, k(r.paginationDetail), 1)) : o("", !0)])]),
3487
+ return F([p.nextBoundaryLoadProgress, p.previousBoundaryLoadProgress], ([e, t]) => {
3488
+ f("boundary-load-progress", {
3489
+ nextBoundaryLoadProgress: e,
3490
+ previousBoundaryLoadProgress: t
3491
+ });
3492
+ }, { immediate: !0 }), (e, n) => (S(), s("div", _i, [
3493
+ c("div", vi, [c("span", yi, [c("span", bi, k(j(p).paginationLabel.value), 1), r.paginationDetail ? (S(), s("span", xi, k(r.paginationDetail), 1)) : o("", !0)])]),
3427
3494
  c("div", {
3428
3495
  ref: j(p).scrollViewportRef,
3429
3496
  "data-testid": "vibe-list-scroll",
@@ -3444,7 +3511,7 @@ var Qr = ["aria-label"], $r = {
3444
3511
  "data-occurrence-key": j($)(t),
3445
3512
  class: "absolute will-change-transform",
3446
3513
  style: y(j(p).getCardStyle(n))
3447
- }, [u(li, {
3514
+ }, [u(gi, {
3448
3515
  active: n === j(p).resolvedActiveIndex.value,
3449
3516
  index: n,
3450
3517
  item: t,
@@ -3468,14 +3535,14 @@ var Qr = ["aria-label"], $r = {
3468
3535
  "report-asset-load",
3469
3536
  "surface-active",
3470
3537
  "onOpen"
3471
- ])], 12, hi))), 128)),
3538
+ ])], 12, Si))), 128)),
3472
3539
  (S(!0), s(t, null, E(j(p).leavingItems.value, (t) => (S(), s("article", {
3473
3540
  key: `leaving-${j($)(t.item)}`,
3474
3541
  "data-testid": "vibe-list-card-leaving",
3475
3542
  "data-item-id": t.item.id,
3476
3543
  class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
3477
3544
  style: y(j(p).getLeavingCardStyle(t.item))
3478
- }, [u(li, {
3545
+ }, [u(gi, {
3479
3546
  active: !1,
3480
3547
  index: -1,
3481
3548
  item: t.item,
@@ -3490,8 +3557,8 @@ var Qr = ["aria-label"], $r = {
3490
3557
  "item",
3491
3558
  "report-asset-error",
3492
3559
  "report-asset-load"
3493
- ])], 12, gi))), 128)),
3494
- j(P) && j(T) ? (S(), a(un, {
3560
+ ])], 12, Ci))), 128)),
3561
+ j(P) && j(T) ? (S(), a(dn, {
3495
3562
  key: 0,
3496
3563
  message: j(T).message,
3497
3564
  mode: j(T).mode,
@@ -3505,12 +3572,12 @@ var Qr = ["aria-label"], $r = {
3505
3572
  "surface"
3506
3573
  ])) : o("", !0)
3507
3574
  ], 4)], 544),
3508
- j(p).showScrollbar.value ? (S(), s("div", _i, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3575
+ j(p).showScrollbar.value ? (S(), s("div", wi, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
3509
3576
  "data-testid": "vibe-list-scrollbar-thumb",
3510
3577
  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"]),
3511
3578
  style: y(j(p).getScrollbarThumbStyle())
3512
3579
  }, null, 6)])) : o("", !0),
3513
- d["grid-footer"] ? (S(), s("div", vi, [c("div", yi, [D(e.$slots, "grid-footer")])])) : o("", !0),
3580
+ d["grid-footer"] ? (S(), s("div", Ti, [c("div", Ei, [D(e.$slots, "grid-footer")])])) : o("", !0),
3514
3581
  b.value ? (S(), s("div", {
3515
3582
  key: 2,
3516
3583
  class: _(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
@@ -3519,7 +3586,7 @@ var Qr = ["aria-label"], $r = {
3519
3586
  "data-testid": "vibe-grid-status-badge",
3520
3587
  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" : ""])
3521
3588
  }, k(b.value.message), 3))], 2)) : o("", !0),
3522
- j(O) && j(T) ? (S(), a(un, {
3589
+ j(O) && j(T) ? (S(), a(dn, {
3523
3590
  key: 3,
3524
3591
  class: _(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
3525
3592
  message: j(T).message,
@@ -3536,13 +3603,13 @@ var Qr = ["aria-label"], $r = {
3536
3603
  ])) : o("", !0)
3537
3604
  ]));
3538
3605
  }
3539
- }), xi = ["data-surface-mode"], Si = {
3606
+ }), Oi = ["data-surface-mode"], ki = {
3540
3607
  key: 1,
3541
3608
  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"
3542
- }, Ci = ["data-visible", "inert"], wi = ["data-visible", "inert"], Ti = {
3609
+ }, Ai = ["data-visible", "inert"], ji = ["data-visible", "inert"], Mi = {
3543
3610
  key: 3,
3544
3611
  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"
3545
- }, Ei = /* @__PURE__ */ d({
3612
+ }, Ni = /* @__PURE__ */ d({
3546
3613
  name: "VibeLayout",
3547
3614
  __name: "Layout",
3548
3615
  props: {
@@ -3597,7 +3664,7 @@ var Qr = ["aria-label"], $r = {
3597
3664
  type: "button",
3598
3665
  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",
3599
3666
  onClick: n[0] ||= (...e) => j(h).retryInitialLoad && j(h).retryInitialLoad(...e)
3600
- }, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", Si, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).isDesktop.value ? (S(), s(t, { key: 2 }, [u(r, {
3667
+ }, " Retry ")) : j(h).errorMessage.value && j(h).items.value.length > 0 ? (S(), s("div", ki, k(j(h).errorMessage.value), 1)) : o("", !0), j(h).isDesktop.value ? (S(), s(t, { key: 2 }, [u(r, {
3601
3668
  appear: "",
3602
3669
  "enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
3603
3670
  "enter-from-class": "translate-y-3 opacity-0",
@@ -3611,7 +3678,7 @@ var Qr = ["aria-label"], $r = {
3611
3678
  "data-visible": j(h).surfaceMode.value === "list" ? "true" : "false",
3612
3679
  inert: j(h).surfaceMode.value !== "list",
3613
3680
  class: "absolute inset-0 z-[2]"
3614
- }, [u(bi, {
3681
+ }, [u(Di, {
3615
3682
  active: j(h).surfaceMode.value === "list",
3616
3683
  "allow-exhausted-next-page-refresh": j(h).canRefreshExhaustedNextPage.value,
3617
3684
  items: j(h).items.value,
@@ -3630,6 +3697,7 @@ var Qr = ["aria-label"], $r = {
3630
3697
  "request-previous-page": j(h).prefetchPreviousPage,
3631
3698
  "empty-state-mode": d.emptyStateMode,
3632
3699
  "show-status-badges": d.showStatusBadges ?? !0,
3700
+ onBoundaryLoadProgress: j(h).setBoundaryLoadProgress,
3633
3701
  onOpenFullscreen: j(h).openFullscreen,
3634
3702
  "onUpdate:activeIndex": j(h).setActiveIndex
3635
3703
  }, l({ _: 2 }, [
@@ -3677,9 +3745,10 @@ var Qr = ["aria-label"], $r = {
3677
3745
  "request-previous-page",
3678
3746
  "empty-state-mode",
3679
3747
  "show-status-badges",
3748
+ "onBoundaryLoadProgress",
3680
3749
  "onOpenFullscreen",
3681
3750
  "onUpdate:activeIndex"
3682
- ])], 8, Ci), [[P, j(h).surfaceMode.value === "list"]])]),
3751
+ ])], 8, Ai), [[P, j(h).surfaceMode.value === "list"]])]),
3683
3752
  _: 3
3684
3753
  }), u(r, {
3685
3754
  appear: "",
@@ -3695,7 +3764,7 @@ var Qr = ["aria-label"], $r = {
3695
3764
  "data-visible": j(h).surfaceMode.value === "fullscreen" ? "true" : "false",
3696
3765
  inert: j(h).surfaceMode.value !== "fullscreen",
3697
3766
  class: "absolute inset-0 z-[3]"
3698
- }, [u(Kn, {
3767
+ }, [u(qn, {
3699
3768
  items: j(h).items.value,
3700
3769
  active: j(h).surfaceMode.value === "fullscreen",
3701
3770
  "active-index": j(h).activeIndex.value,
@@ -3764,12 +3833,12 @@ var Qr = ["aria-label"], $r = {
3764
3833
  "show-back-to-list",
3765
3834
  "onBackToList",
3766
3835
  "onUpdate:activeIndex"
3767
- ])], 8, wi), [[P, j(h).surfaceMode.value === "fullscreen"]])]),
3836
+ ])], 8, ji), [[P, j(h).surfaceMode.value === "fullscreen"]])]),
3768
3837
  _: 3
3769
- })], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", Ti, [u(j(re), {
3838
+ })], 64)) : j(h).items.value.length === 0 && j(h).loading.value ? (S(), s("div", Mi, [u(j(re), {
3770
3839
  class: "size-10 animate-spin text-[#f7f1ea]/82",
3771
3840
  "aria-hidden": "true"
3772
- }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(Kn, {
3841
+ }), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (S(), a(qn, {
3773
3842
  key: 4,
3774
3843
  items: j(h).items.value,
3775
3844
  active: !0,
@@ -3837,10 +3906,10 @@ var Qr = ["aria-label"], $r = {
3837
3906
  "show-status-badges",
3838
3907
  "onBackToList",
3839
3908
  "onUpdate:activeIndex"
3840
- ]))], 8, xi));
3909
+ ]))], 8, Oi));
3841
3910
  }
3842
- }), Di = { install(e) {
3843
- e.component("VibeLayout", Ei);
3911
+ }), Pi = { install(e) {
3912
+ e.component("VibeLayout", Ni);
3844
3913
  } };
3845
3914
  //#endregion
3846
- export { Ei as VibeLayout, Di as VibePlugin, Di as default };
3915
+ export { Ni as VibeLayout, Pi as VibePlugin, Pi as default };