@wyxos/vibe 3.1.10 → 3.1.12
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
|
@@ -341,12 +341,57 @@ function Ae(e, t, n) {
|
|
|
341
341
|
nextSequence: r.nextSequence
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
+
function je(e, t, n, r) {
|
|
345
|
+
let i = /* @__PURE__ */ new Map(), a = e.map((e) => ({
|
|
346
|
+
item: e,
|
|
347
|
+
matchIndex: null,
|
|
348
|
+
occurrenceKey: null
|
|
349
|
+
})), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = n;
|
|
350
|
+
for (let [e, n] of t.entries()) {
|
|
351
|
+
let t = i.get(n.id), r = {
|
|
352
|
+
index: e,
|
|
353
|
+
occurrenceKey: $(n)
|
|
354
|
+
};
|
|
355
|
+
t ? t.push(r) : i.set(n.id, [r]);
|
|
356
|
+
}
|
|
357
|
+
for (let e of a) {
|
|
358
|
+
let t = i.get(e.item.id)?.shift();
|
|
359
|
+
t && (e.matchIndex = t.index, e.occurrenceKey = t.occurrenceKey);
|
|
360
|
+
}
|
|
361
|
+
let l = [], u = null;
|
|
362
|
+
for (let e of a) l.push(u), e.matchIndex !== null && (u = e.matchIndex);
|
|
363
|
+
let d = Array(a.length).fill(null), f = null;
|
|
364
|
+
for (let e = a.length - 1; e >= 0; --e) d[e] = f, a[e].matchIndex !== null && (f = a[e].matchIndex);
|
|
365
|
+
for (let [e, n] of a.entries()) {
|
|
366
|
+
if (n.matchIndex !== null && n.occurrenceKey) {
|
|
367
|
+
o.set(n.matchIndex, Me(n.item, n.occurrenceKey));
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
let i = d[e] ?? (l[e] === null ? null : l[e] + 1) ?? (r === "leading" ? 0 : t.length), a = Me(n.item, `vibe-occurrence-${c += 1}`), u = s.get(i);
|
|
371
|
+
u ? u.push(a) : s.set(i, [a]);
|
|
372
|
+
}
|
|
373
|
+
let p = [];
|
|
374
|
+
for (let e = 0; e <= t.length; e += 1) {
|
|
375
|
+
let n = s.get(e);
|
|
376
|
+
n?.length && p.push(...n), !(e >= t.length) && p.push(o.get(e) ?? t[e]);
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
items: p,
|
|
380
|
+
nextSequence: c
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
function Me(e, t) {
|
|
384
|
+
return $(e) === t ? e : {
|
|
385
|
+
...e,
|
|
386
|
+
__vibeOccurrenceKey: t
|
|
387
|
+
};
|
|
388
|
+
}
|
|
344
389
|
//#endregion
|
|
345
390
|
//#region src/components/viewer-core/autoResolveState.ts
|
|
346
|
-
function
|
|
391
|
+
function Ne(e) {
|
|
347
392
|
return e instanceof DOMException && e.name === "AbortError" || e instanceof Error && (e.name === "AbortError" || e.name === "CanceledError") ? !0 : typeof e == "object" && !!e && "code" in e && e.code === "ERR_CANCELED";
|
|
348
393
|
}
|
|
349
|
-
function
|
|
394
|
+
function Pe(e) {
|
|
350
395
|
let t = Ae(e.nextItems, e.previousItems, e.sequence);
|
|
351
396
|
return {
|
|
352
397
|
bucket: {
|
|
@@ -358,7 +403,19 @@ function Me(e) {
|
|
|
358
403
|
nextSequence: t.nextSequence
|
|
359
404
|
};
|
|
360
405
|
}
|
|
361
|
-
function
|
|
406
|
+
function Fe(e) {
|
|
407
|
+
let t = je(e.nextItems, e.previousItems, e.sequence, e.edge);
|
|
408
|
+
return {
|
|
409
|
+
bucket: {
|
|
410
|
+
cursor: e.cursor,
|
|
411
|
+
items: t.items,
|
|
412
|
+
nextCursor: e.nextCursor,
|
|
413
|
+
previousCursor: e.previousCursor
|
|
414
|
+
},
|
|
415
|
+
nextSequence: t.nextSequence
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
function Ie(e, t, n, r) {
|
|
362
419
|
if (!e.length) return r ? null : {
|
|
363
420
|
buckets: [],
|
|
364
421
|
canceled: r,
|
|
@@ -371,8 +428,8 @@ function Ne(e, t, n, r) {
|
|
|
371
428
|
visibleCount: i.reduce((e, t) => e + De(t, n), 0)
|
|
372
429
|
};
|
|
373
430
|
}
|
|
374
|
-
function
|
|
375
|
-
let t =
|
|
431
|
+
function Le(e) {
|
|
432
|
+
let t = Pe({
|
|
376
433
|
cursor: e.initialState.cursor,
|
|
377
434
|
nextCursor: e.initialState.nextCursor ?? null,
|
|
378
435
|
nextItems: e.initialState.items,
|
|
@@ -386,28 +443,28 @@ function Pe(e) {
|
|
|
386
443
|
nextSequence: t.nextSequence
|
|
387
444
|
};
|
|
388
445
|
}
|
|
389
|
-
function
|
|
446
|
+
function Re(e, t) {
|
|
390
447
|
let n = e[Q(t, 0, Math.max(0, e.length - 1))];
|
|
391
448
|
return n ? $(n) : null;
|
|
392
449
|
}
|
|
393
|
-
function
|
|
450
|
+
function ze(e, t, n = null) {
|
|
394
451
|
if (!e.length) return 0;
|
|
395
452
|
let r = n ? e.findIndex((e) => $(e) === n) : -1;
|
|
396
453
|
return r >= 0 ? r : Q(t, 0, e.length - 1);
|
|
397
454
|
}
|
|
398
|
-
function
|
|
455
|
+
function Be(e, t, n) {
|
|
399
456
|
return e ? De(e, t) < n : !1;
|
|
400
457
|
}
|
|
401
458
|
//#endregion
|
|
402
459
|
//#region src/components/viewer-core/fillDelay.ts
|
|
403
|
-
var
|
|
404
|
-
function
|
|
460
|
+
var Ve = 2e3, He = 1e3, Ue = 100;
|
|
461
|
+
function We(e, t = Ve, n = He) {
|
|
405
462
|
return t + Math.max(0, e - 1) * n;
|
|
406
463
|
}
|
|
407
|
-
function
|
|
464
|
+
function Ge(e, t) {
|
|
408
465
|
return !Number.isFinite(e) || e == null || e < 0 ? t : Math.floor(e);
|
|
409
466
|
}
|
|
410
|
-
function
|
|
467
|
+
function Ke() {
|
|
411
468
|
let e = D(null), t = null, n = null, r = null;
|
|
412
469
|
function i(i = !1) {
|
|
413
470
|
if (t &&= (clearInterval(t), null), n &&= (clearTimeout(n), null), e.value = null, i && r) {
|
|
@@ -425,7 +482,7 @@ function Ue() {
|
|
|
425
482
|
let t = Math.max(0, a - (Date.now() - s));
|
|
426
483
|
e.value = t, t <= 0 && l();
|
|
427
484
|
};
|
|
428
|
-
t = setInterval(u,
|
|
485
|
+
t = setInterval(u, Ue), n = setTimeout(l, a), u();
|
|
429
486
|
}));
|
|
430
487
|
}
|
|
431
488
|
return {
|
|
@@ -436,8 +493,8 @@ function Ue() {
|
|
|
436
493
|
}
|
|
437
494
|
//#endregion
|
|
438
495
|
//#region src/components/viewer-core/useAutoResolveSource.ts
|
|
439
|
-
function
|
|
440
|
-
let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d =
|
|
496
|
+
function qe(e) {
|
|
497
|
+
let t = !!e.initialState?.items.length, n = D([]), r = D(0), a = D([]), o = D(!1), s = D(null), c = D(!t && typeof e.resolve == "function" ? "initializing" : "idle"), l = D(null), u = D(null), d = Ke(), f = d.remainingMs, p = D(null), m = D(!1), h = D(!0), g = D(!1), _ = /* @__PURE__ */ new Set(), v = null, y = null, b = 0, C = 0, w = i(() => Ge(e.fillDelayMs, Ve)), T = i(() => Ge(e.fillDelayStepMs, He)), E = i(() => typeof e.resolve == "function"), O = i(() => _e(e.pageSize)), k = i(() => we(n.value)), A = i(() => Te(k.value, e.removedIds.value)), j = i(() => r.value), M = i(() => ge(c.value) || m.value), N = i(() => Je(n.value, e.removedIds.value)), P = i(() => Ye(n.value, e.removedIds.value)), F = i(() => P.value?.nextCursor ?? null), I = i(() => o.value ? null : N.value?.previousCursor ?? null), R = i(() => !!F.value), z = i(() => !!I.value), B = i(() => E.value && n.value.length > 0), ee = i(() => Te(we(a.value), e.removedIds.value)), te = i(() => Oe(n.value, e.removedIds.value, j.value)), V = i(() => !A.value.length && !M.value && !!s.value);
|
|
441
498
|
L(() => A.value.length, (e) => {
|
|
442
499
|
if (e === 0) {
|
|
443
500
|
r.value = 0;
|
|
@@ -518,7 +575,7 @@ function We(e) {
|
|
|
518
575
|
b += 1, v?.abort(), v = null, d.clear(!0), _.clear(), s.value = null, l.value = null, u.value = null, p.value = null, a.value.length > 0 && (n.value = [...n.value, ...a.value], a.value = []), m.value = !1, o.value = !1, Z();
|
|
519
576
|
}
|
|
520
577
|
function ae() {
|
|
521
|
-
return
|
|
578
|
+
return Re(A.value, j.value);
|
|
522
579
|
}
|
|
523
580
|
function oe(e = null, t = {}) {
|
|
524
581
|
if (A.value.length === 0) {
|
|
@@ -536,7 +593,7 @@ function We(e) {
|
|
|
536
593
|
r.value = A.value.length;
|
|
537
594
|
return;
|
|
538
595
|
}
|
|
539
|
-
r.value =
|
|
596
|
+
r.value = ze(A.value, j.value, e);
|
|
540
597
|
}
|
|
541
598
|
function se() {
|
|
542
599
|
a.value.length > 0 && !ee.value.length && K();
|
|
@@ -598,19 +655,23 @@ function We(e) {
|
|
|
598
655
|
signal: o?.signal
|
|
599
656
|
});
|
|
600
657
|
if (a !== b) return Z(), null;
|
|
601
|
-
let s =
|
|
658
|
+
let s = Fe({
|
|
602
659
|
cursor: r.cursor,
|
|
660
|
+
edge: t,
|
|
603
661
|
nextCursor: i.nextPage,
|
|
604
662
|
nextItems: i.items,
|
|
605
663
|
previousCursor: i.previousPage ?? null,
|
|
606
|
-
previousItems: r.items
|
|
607
|
-
|
|
608
|
-
|
|
664
|
+
previousItems: r.items,
|
|
665
|
+
sequence: C
|
|
666
|
+
});
|
|
667
|
+
C = s.nextSequence;
|
|
668
|
+
let c = ae();
|
|
669
|
+
return n.value = ke(n.value, r.cursor, s.bucket), oe(c), Z(), {
|
|
609
670
|
followCursor: t === "leading" ? i.previousPage ?? null : i.nextPage,
|
|
610
671
|
itemsLoaded: i.items.length
|
|
611
672
|
};
|
|
612
673
|
} catch (e) {
|
|
613
|
-
return
|
|
674
|
+
return Ne(e) || a !== b ? (Z(), null) : (s.value = e instanceof Error ? e.message : "The viewer could not load items.", c.value = "failed", l.value = null, u.value = null, p.value = null, null);
|
|
614
675
|
} finally {
|
|
615
676
|
v === o && (v = null), _.delete(i);
|
|
616
677
|
}
|
|
@@ -619,8 +680,8 @@ function We(e) {
|
|
|
619
680
|
if (!e.resolve) return null;
|
|
620
681
|
let n = ++b, r = /* @__PURE__ */ new Set(), i = [], a = t.cursor, o = 0;
|
|
621
682
|
for (s.value = null, c.value = t.phase, l.value = null, u.value = null, p.value = null;;) {
|
|
622
|
-
if (n !== b) return
|
|
623
|
-
if (i.length > 0 && g.value) return
|
|
683
|
+
if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
684
|
+
if (i.length > 0 && g.value) return Ie(i, t.direction, e.removedIds.value, !1);
|
|
624
685
|
let f = ve(a);
|
|
625
686
|
if (r.has(f) || _.has(f)) break;
|
|
626
687
|
r.add(f), _.add(f);
|
|
@@ -632,7 +693,7 @@ function We(e) {
|
|
|
632
693
|
pageSize: O.value,
|
|
633
694
|
signal: m?.signal
|
|
634
695
|
});
|
|
635
|
-
if (n !== b) return
|
|
696
|
+
if (n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
636
697
|
let s = fe({
|
|
637
698
|
cursor: a,
|
|
638
699
|
nextCursor: r.nextPage,
|
|
@@ -647,21 +708,21 @@ function We(e) {
|
|
|
647
708
|
buckets: t.direction === "backward" ? [...i].reverse() : i,
|
|
648
709
|
visibleCount: f
|
|
649
710
|
};
|
|
650
|
-
if (g.value) return
|
|
711
|
+
if (g.value) return Ie(i, t.direction, e.removedIds.value, !1);
|
|
651
712
|
c.value = "filling", l.value = f, u.value = h, p.value = O.value, o += 1;
|
|
652
|
-
let _ =
|
|
653
|
-
if (await d.wait(_), n !== b) return
|
|
713
|
+
let _ = We(o, w.value, T.value);
|
|
714
|
+
if (await d.wait(_), n !== b) return Ie(i, t.direction, e.removedIds.value, !0);
|
|
654
715
|
a = h;
|
|
655
716
|
} catch (r) {
|
|
656
|
-
return
|
|
717
|
+
return Ne(r) || n !== b ? Ie(i, t.direction, e.removedIds.value, !0) : (s.value = r instanceof Error ? r.message : "The viewer could not load items.", c.value = "failed", l.value = null, u.value = null, p.value = null, null);
|
|
657
718
|
} finally {
|
|
658
719
|
v === m && (v = null), _.delete(f);
|
|
659
720
|
}
|
|
660
721
|
}
|
|
661
|
-
return
|
|
722
|
+
return Ie(i, t.direction, e.removedIds.value, !1);
|
|
662
723
|
}
|
|
663
724
|
function fe(e) {
|
|
664
|
-
let t =
|
|
725
|
+
let t = Pe({
|
|
665
726
|
cursor: e.cursor,
|
|
666
727
|
nextCursor: e.nextCursor,
|
|
667
728
|
nextItems: e.nextItems,
|
|
@@ -676,7 +737,7 @@ function We(e) {
|
|
|
676
737
|
}
|
|
677
738
|
function pe() {
|
|
678
739
|
if (!e.initialState || !e.initialState.items.length) return !1;
|
|
679
|
-
let t =
|
|
740
|
+
let t = Le({
|
|
680
741
|
initialState: e.initialState,
|
|
681
742
|
removedIds: e.removedIds.value,
|
|
682
743
|
sequence: C
|
|
@@ -687,7 +748,7 @@ function We(e) {
|
|
|
687
748
|
return c.value === "initializing";
|
|
688
749
|
}
|
|
689
750
|
function he(t) {
|
|
690
|
-
return
|
|
751
|
+
return Be(t === "leading" ? N.value : P.value, e.removedIds.value, O.value);
|
|
691
752
|
}
|
|
692
753
|
function ye() {
|
|
693
754
|
let t = n.value.findIndex((t) => De(t, e.removedIds.value) > 0);
|
|
@@ -735,10 +796,10 @@ function We(e) {
|
|
|
735
796
|
maybeCommitPendingAppendWhenFilteredOut: se
|
|
736
797
|
};
|
|
737
798
|
}
|
|
738
|
-
function
|
|
799
|
+
function Je(e, t) {
|
|
739
800
|
return e.find((e) => De(e, t) > 0) ?? e[0] ?? null;
|
|
740
801
|
}
|
|
741
|
-
function
|
|
802
|
+
function Ye(e, t) {
|
|
742
803
|
for (let n = e.length - 1; n >= 0; --n) {
|
|
743
804
|
let r = e[n];
|
|
744
805
|
if (De(r, t) > 0) return r;
|
|
@@ -747,8 +808,8 @@ function Ke(e, t) {
|
|
|
747
808
|
}
|
|
748
809
|
//#endregion
|
|
749
810
|
//#region src/components/viewer-core/useDataSource.ts
|
|
750
|
-
function
|
|
751
|
-
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = ye(), l =
|
|
811
|
+
function Xe(e, t) {
|
|
812
|
+
let { clearRemoved: n, getRemovedIds: r, remove: a, removedIds: o, restore: s, undo: c } = ye(), l = qe({
|
|
752
813
|
emit: t,
|
|
753
814
|
fillDelayMs: e.fillDelayMs,
|
|
754
815
|
fillDelayStepMs: e.fillDelayStepMs,
|
|
@@ -835,9 +896,9 @@ function qe(e, t) {
|
|
|
835
896
|
}
|
|
836
897
|
//#endregion
|
|
837
898
|
//#region src/components/viewer-core/useController.ts
|
|
838
|
-
var
|
|
839
|
-
function
|
|
840
|
-
let n =
|
|
899
|
+
var Ze = 1024;
|
|
900
|
+
function Qe(e, t) {
|
|
901
|
+
let n = Xe(e, t), r = T({
|
|
841
902
|
nextBoundaryLoadProgress: 0,
|
|
842
903
|
previousBoundaryLoadProgress: 0
|
|
843
904
|
}), a = D(0), o = D("list"), s = T({
|
|
@@ -861,7 +922,7 @@ function Ye(e, t) {
|
|
|
861
922
|
removedCount: 0,
|
|
862
923
|
removedIds: [],
|
|
863
924
|
surfaceMode: "list"
|
|
864
|
-
}), c = i(() => a.value >=
|
|
925
|
+
}), c = i(() => a.value >= Ze), l = i(() => c.value ? o.value : "fullscreen"), u = i(() => c.value && l.value === "fullscreen");
|
|
865
926
|
L(c, (e) => {
|
|
866
927
|
e && h();
|
|
867
928
|
}), L(() => e.surfaceMode, () => {
|
|
@@ -900,7 +961,7 @@ function Ye(e, t) {
|
|
|
900
961
|
!c.value || !e.surfaceMode || e.surfaceMode === o.value || (o.value = e.surfaceMode);
|
|
901
962
|
}
|
|
902
963
|
function g(e) {
|
|
903
|
-
r.nextBoundaryLoadProgress =
|
|
964
|
+
r.nextBoundaryLoadProgress = $e(e.nextBoundaryLoadProgress), r.previousBoundaryLoadProgress = $e(e.previousBoundaryLoadProgress);
|
|
904
965
|
}
|
|
905
966
|
return {
|
|
906
967
|
...n,
|
|
@@ -919,26 +980,26 @@ function Ye(e, t) {
|
|
|
919
980
|
unlockPageLoading: n.unlockPageLoading
|
|
920
981
|
};
|
|
921
982
|
}
|
|
922
|
-
function
|
|
983
|
+
function $e(e) {
|
|
923
984
|
return Math.min(Math.max(e, 0), 1);
|
|
924
985
|
}
|
|
925
986
|
//#endregion
|
|
926
987
|
//#region src/components/FullscreenMediaBar.vue?vue&type=script&setup=true&lang.ts
|
|
927
|
-
var
|
|
988
|
+
var et = {
|
|
928
989
|
"data-testid": "vibe-media-bar",
|
|
929
990
|
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]"
|
|
930
|
-
},
|
|
991
|
+
}, tt = { 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]" }, nt = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, rt = { class: "relative h-4 w-full" }, it = [
|
|
931
992
|
"max",
|
|
932
993
|
"value",
|
|
933
994
|
"disabled"
|
|
934
|
-
],
|
|
995
|
+
], at = { class: "text-[0.76rem] font-bold uppercase tracking-[0.18em] text-[#f7f1ea]/74" }, ot = ["data-layout"], st = {
|
|
935
996
|
key: 0,
|
|
936
997
|
"data-testid": "vibe-media-volume-popover",
|
|
937
998
|
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]"
|
|
938
|
-
},
|
|
999
|
+
}, ct = { class: "relative flex h-28 w-4 items-center justify-center" }, lt = ["value"], ut = { class: "flex items-center gap-3" }, dt = ["aria-label"], ft = {
|
|
939
1000
|
key: 0,
|
|
940
1001
|
class: "relative h-4 w-24"
|
|
941
|
-
},
|
|
1002
|
+
}, pt = ["value"], mt = /* @__PURE__ */ d({
|
|
942
1003
|
__name: "FullscreenMediaBar",
|
|
943
1004
|
props: {
|
|
944
1005
|
currentTime: {},
|
|
@@ -981,9 +1042,9 @@ var Ze = {
|
|
|
981
1042
|
function C(e, t, n) {
|
|
982
1043
|
return Math.min(Math.max(e, t), n);
|
|
983
1044
|
}
|
|
984
|
-
return (e, t) => (w(), s("div",
|
|
985
|
-
c("span",
|
|
986
|
-
c("div",
|
|
1045
|
+
return (e, t) => (w(), s("div", et, [c("div", tt, [
|
|
1046
|
+
c("span", nt, j(n.currentTimeLabel), 1),
|
|
1047
|
+
c("div", rt, [
|
|
987
1048
|
t[3] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
988
1049
|
c("div", {
|
|
989
1050
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -1000,16 +1061,16 @@ var Ze = {
|
|
|
1000
1061
|
disabled: n.duration <= 0,
|
|
1001
1062
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent disabled:cursor-default disabled:opacity-50",
|
|
1002
1063
|
onInput: t[0] ||= (e) => r("seek-input", e)
|
|
1003
|
-
}, null, 40,
|
|
1064
|
+
}, null, 40, it)
|
|
1004
1065
|
]),
|
|
1005
|
-
c("span",
|
|
1066
|
+
c("span", at, j(n.durationLabel), 1),
|
|
1006
1067
|
c("div", {
|
|
1007
1068
|
ref_key: "rootRef",
|
|
1008
1069
|
ref: l,
|
|
1009
1070
|
"data-testid": "vibe-media-volume",
|
|
1010
1071
|
"data-layout": n.volumeControlLayout,
|
|
1011
1072
|
class: "relative flex items-center justify-end"
|
|
1012
|
-
}, [d.value && u.value ? (w(), s("div",
|
|
1073
|
+
}, [d.value && u.value ? (w(), s("div", st, [c("div", ct, [
|
|
1013
1074
|
t[4] ||= c("div", { class: "absolute bottom-0 left-1/2 h-full w-px -translate-x-1/2 bg-white/12" }, null, -1),
|
|
1014
1075
|
c("div", {
|
|
1015
1076
|
class: "absolute bottom-0 left-1/2 w-px -translate-x-1/2 bg-[#f7f1ea]",
|
|
@@ -1026,8 +1087,8 @@ var Ze = {
|
|
|
1026
1087
|
value: f.value,
|
|
1027
1088
|
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",
|
|
1028
1089
|
onInput: t[1] ||= (e) => r("volume-input", e)
|
|
1029
|
-
}, null, 40,
|
|
1030
|
-
])])) : o("", !0), c("div",
|
|
1090
|
+
}, null, 40, lt)
|
|
1091
|
+
])])) : o("", !0), c("div", ut, [c("button", {
|
|
1031
1092
|
type: "button",
|
|
1032
1093
|
"data-testid": "vibe-media-volume-button",
|
|
1033
1094
|
"aria-label": g.value,
|
|
@@ -1036,7 +1097,7 @@ var Ze = {
|
|
|
1036
1097
|
}, [(w(), a(A(m.value), {
|
|
1037
1098
|
class: "h-4 w-4 stroke-[1.9]",
|
|
1038
1099
|
"aria-hidden": "true"
|
|
1039
|
-
}))], 8,
|
|
1100
|
+
}))], 8, dt), n.volumeControlLayout === "horizontal" ? (w(), s("div", ft, [
|
|
1040
1101
|
t[5] ||= c("div", { class: "absolute inset-x-0 top-1/2 h-px -translate-y-1/2 bg-white/12" }, null, -1),
|
|
1041
1102
|
c("div", {
|
|
1042
1103
|
class: "absolute left-0 top-1/2 h-px -translate-y-1/2 bg-[#f7f1ea]",
|
|
@@ -1053,24 +1114,24 @@ var Ze = {
|
|
|
1053
1114
|
value: f.value,
|
|
1054
1115
|
class: "vibe-media-slider absolute inset-0 z-10 h-4 w-full cursor-pointer bg-transparent",
|
|
1055
1116
|
onInput: t[2] ||= (e) => r("volume-input", e)
|
|
1056
|
-
}, null, 40,
|
|
1057
|
-
])) : o("", !0)])], 8,
|
|
1117
|
+
}, null, 40, pt)
|
|
1118
|
+
])) : o("", !0)])], 8, ot)
|
|
1058
1119
|
])]));
|
|
1059
1120
|
}
|
|
1060
|
-
}),
|
|
1121
|
+
}), ht = { class: "pointer-events-none absolute inset-0 z-[3] flex flex-col justify-between p-[clamp(1.25rem,2.6vw,2.25rem)]" }, gt = { class: "grid gap-4" }, _t = { class: "flex min-h-11 items-center justify-between gap-4" }, vt = { class: "min-w-0 flex flex-1 items-center gap-3" }, yt = {
|
|
1061
1122
|
key: 1,
|
|
1062
1123
|
"data-testid": "vibe-title",
|
|
1063
1124
|
class: "m-0 truncate text-left text-[0.82rem] leading-none tracking-[-0.04em] min-[721px]:text-[1.2rem]"
|
|
1064
|
-
},
|
|
1125
|
+
}, bt = { class: "pointer-events-auto flex shrink-0 items-center gap-2" }, xt = {
|
|
1065
1126
|
"data-testid": "vibe-pagination",
|
|
1066
1127
|
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]"
|
|
1067
|
-
},
|
|
1128
|
+
}, St = { class: "whitespace-nowrap" }, Ct = {
|
|
1068
1129
|
key: 1,
|
|
1069
1130
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
1070
|
-
},
|
|
1131
|
+
}, wt = {
|
|
1071
1132
|
key: 0,
|
|
1072
1133
|
class: "grid gap-2 max-[720px]:justify-items-start"
|
|
1073
|
-
},
|
|
1134
|
+
}, Tt = /* @__PURE__ */ d({
|
|
1074
1135
|
__name: "FullscreenHeader",
|
|
1075
1136
|
props: {
|
|
1076
1137
|
currentIndex: {},
|
|
@@ -1084,7 +1145,7 @@ var Ze = {
|
|
|
1084
1145
|
emits: ["back-to-list"],
|
|
1085
1146
|
setup(e, { emit: t }) {
|
|
1086
1147
|
let n = e, r = t;
|
|
1087
|
-
return (e, t) => (w(), s("div",
|
|
1148
|
+
return (e, t) => (w(), s("div", ht, [c("div", gt, [c("div", _t, [c("div", vt, [n.showBackToList ? (w(), s("button", {
|
|
1088
1149
|
key: 0,
|
|
1089
1150
|
type: "button",
|
|
1090
1151
|
"data-testid": "vibe-back-to-list",
|
|
@@ -1094,47 +1155,47 @@ var Ze = {
|
|
|
1094
1155
|
}, [u(N(re), {
|
|
1095
1156
|
class: "h-4 w-4 stroke-[2.2]",
|
|
1096
1157
|
"aria-hidden": "true"
|
|
1097
|
-
})])) : o("", !0), n.title ? (w(), s("h2",
|
|
1158
|
+
})])) : o("", !0), n.title ? (w(), s("h2", yt, j(n.title), 1)) : o("", !0)]), c("div", bt, [c("span", xt, [
|
|
1098
1159
|
n.loading ? (w(), a(N(oe), {
|
|
1099
1160
|
key: 0,
|
|
1100
1161
|
"data-testid": "vibe-pagination-spinner",
|
|
1101
1162
|
class: "h-3.5 w-3.5 animate-spin stroke-[1.9]",
|
|
1102
1163
|
"aria-hidden": "true"
|
|
1103
1164
|
})) : o("", !0),
|
|
1104
|
-
c("span",
|
|
1105
|
-
n.paginationDetail ? (w(), s("span",
|
|
1106
|
-
]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div",
|
|
1165
|
+
c("span", St, j(n.currentIndex + 1) + " / " + j(n.total), 1),
|
|
1166
|
+
n.paginationDetail ? (w(), s("span", Ct, j(n.paginationDetail), 1)) : o("", !0)
|
|
1167
|
+
]), k(e.$slots, "actions")])])]), n.showEndBadge ? (w(), s("div", wt, [...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)]));
|
|
1107
1168
|
}
|
|
1108
|
-
}),
|
|
1169
|
+
}), Et = {
|
|
1109
1170
|
image: ae,
|
|
1110
1171
|
video: Y,
|
|
1111
1172
|
audio: J,
|
|
1112
1173
|
other: ie
|
|
1113
|
-
},
|
|
1174
|
+
}, Dt = {
|
|
1114
1175
|
image: "Image",
|
|
1115
1176
|
video: "Video",
|
|
1116
1177
|
audio: "Audio",
|
|
1117
1178
|
other: "File"
|
|
1118
1179
|
};
|
|
1119
|
-
function
|
|
1120
|
-
return
|
|
1180
|
+
function Ot(e) {
|
|
1181
|
+
return Et[e];
|
|
1121
1182
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
1183
|
+
function kt(e) {
|
|
1184
|
+
return Dt[e];
|
|
1124
1185
|
}
|
|
1125
1186
|
//#endregion
|
|
1126
1187
|
//#region src/components/viewer-core/useAssetLoadQueue.ts
|
|
1127
|
-
var
|
|
1188
|
+
var At = {
|
|
1128
1189
|
maxGlobal: 10,
|
|
1129
1190
|
maxPerDomain: 4,
|
|
1130
1191
|
maxVideoPerDomain: 2
|
|
1131
1192
|
};
|
|
1132
|
-
function
|
|
1193
|
+
function jt(e = At) {
|
|
1133
1194
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = 0;
|
|
1134
1195
|
function i(e) {
|
|
1135
1196
|
let i = {
|
|
1136
1197
|
...e,
|
|
1137
|
-
domain:
|
|
1198
|
+
domain: Ft(e.url),
|
|
1138
1199
|
enqueuedAt: r,
|
|
1139
1200
|
id: `vibe-asset-load-${r += 1}`
|
|
1140
1201
|
};
|
|
@@ -1153,7 +1214,7 @@ function Ot(e = Dt) {
|
|
|
1153
1214
|
function a() {
|
|
1154
1215
|
if (n.size === 0) return;
|
|
1155
1216
|
let r = [...n.values()].sort((e, t) => {
|
|
1156
|
-
let n =
|
|
1217
|
+
let n = Nt(e) - Nt(t);
|
|
1157
1218
|
return n === 0 ? e.enqueuedAt - t.enqueuedAt : n;
|
|
1158
1219
|
});
|
|
1159
1220
|
for (let i of r) {
|
|
@@ -1169,13 +1230,14 @@ function Ot(e = Dt) {
|
|
|
1169
1230
|
}
|
|
1170
1231
|
}
|
|
1171
1232
|
function o(n) {
|
|
1233
|
+
if (!Pt(n)) return !1;
|
|
1172
1234
|
let r = [...t.values()].filter((e) => e.domain === n.domain);
|
|
1173
1235
|
return !(r.length >= e.maxPerDomain || n.assetType === "video" && r.filter((e) => e.assetType === "video").length >= e.maxVideoPerDomain);
|
|
1174
1236
|
}
|
|
1175
1237
|
return { request: i };
|
|
1176
1238
|
}
|
|
1177
|
-
var
|
|
1178
|
-
function
|
|
1239
|
+
var Mt = jt();
|
|
1240
|
+
function Nt(e) {
|
|
1179
1241
|
try {
|
|
1180
1242
|
let t = e.getPriority();
|
|
1181
1243
|
return Number.isFinite(t) ? t : Infinity;
|
|
@@ -1183,7 +1245,14 @@ function At(e) {
|
|
|
1183
1245
|
return Infinity;
|
|
1184
1246
|
}
|
|
1185
1247
|
}
|
|
1186
|
-
function
|
|
1248
|
+
function Pt(e) {
|
|
1249
|
+
try {
|
|
1250
|
+
return e.canGrant?.() ?? !0;
|
|
1251
|
+
} catch {
|
|
1252
|
+
return !1;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
function Ft(e) {
|
|
1187
1256
|
try {
|
|
1188
1257
|
return new URL(e).hostname || "local";
|
|
1189
1258
|
} catch {
|
|
@@ -1192,73 +1261,81 @@ function jt(e) {
|
|
|
1192
1261
|
}
|
|
1193
1262
|
//#endregion
|
|
1194
1263
|
//#region src/components/viewer-core/useFullscreenPreloadController.ts
|
|
1195
|
-
var
|
|
1264
|
+
var It = [
|
|
1265
|
+
-1,
|
|
1266
|
+
1,
|
|
1267
|
+
2
|
|
1268
|
+
], Lt = [-1, 1], Rt = {
|
|
1269
|
+
[-1]: 0,
|
|
1196
1270
|
1: 0,
|
|
1197
|
-
2: 1
|
|
1198
|
-
3: 2,
|
|
1199
|
-
[-1]: 3
|
|
1271
|
+
2: 1
|
|
1200
1272
|
};
|
|
1201
|
-
function
|
|
1202
|
-
let t = D({}), n =
|
|
1203
|
-
maxGlobal:
|
|
1204
|
-
maxPerDomain:
|
|
1205
|
-
maxVideoPerDomain:
|
|
1206
|
-
}), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
1273
|
+
function zt(e) {
|
|
1274
|
+
let t = D({}), n = jt({
|
|
1275
|
+
maxGlobal: 2,
|
|
1276
|
+
maxPerDomain: 2,
|
|
1277
|
+
maxVideoPerDomain: 2
|
|
1278
|
+
}), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
1207
1279
|
L([
|
|
1208
1280
|
e.active,
|
|
1209
1281
|
e.items,
|
|
1210
1282
|
e.resolvedActiveIndex
|
|
1211
1283
|
], () => {
|
|
1212
|
-
|
|
1284
|
+
m();
|
|
1213
1285
|
}, { immediate: !0 }), f() && C(() => {
|
|
1214
|
-
|
|
1286
|
+
p();
|
|
1215
1287
|
});
|
|
1216
|
-
function
|
|
1288
|
+
function c(n) {
|
|
1217
1289
|
if (!e.active.value) return !1;
|
|
1218
1290
|
let r = e.items.value[n];
|
|
1219
|
-
if (!r || !
|
|
1291
|
+
if (!r || !Ut(r)) return !1;
|
|
1220
1292
|
let i = e.getItemKey(r);
|
|
1221
|
-
return i ===
|
|
1293
|
+
return i === g() || !!t.value[i];
|
|
1222
1294
|
}
|
|
1223
|
-
function
|
|
1295
|
+
function l(e, t) {
|
|
1224
1296
|
if (t instanceof HTMLImageElement) {
|
|
1225
|
-
i.set(e, t),
|
|
1297
|
+
i.set(e, t), Vt(t) && b(e);
|
|
1226
1298
|
return;
|
|
1227
1299
|
}
|
|
1228
1300
|
i.delete(e);
|
|
1229
1301
|
}
|
|
1230
|
-
function
|
|
1302
|
+
function u(e, t) {
|
|
1231
1303
|
if (t instanceof HTMLMediaElement) {
|
|
1232
|
-
a.set(e, t),
|
|
1304
|
+
a.set(e, t), Ht(t) && b(e);
|
|
1233
1305
|
return;
|
|
1234
1306
|
}
|
|
1235
1307
|
a.delete(e);
|
|
1236
1308
|
}
|
|
1237
|
-
function
|
|
1309
|
+
function d(e) {
|
|
1310
|
+
o.add(e);
|
|
1238
1311
|
let t = r.get(e);
|
|
1239
|
-
|
|
1312
|
+
if (!t) {
|
|
1313
|
+
x();
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
t.lease.release(), r.delete(e);
|
|
1240
1317
|
}
|
|
1241
|
-
function
|
|
1318
|
+
function p() {
|
|
1242
1319
|
for (let e of r.values()) e.lease.release();
|
|
1243
|
-
r.clear(), t.value = {},
|
|
1320
|
+
r.clear(), t.value = {}, S();
|
|
1244
1321
|
}
|
|
1245
|
-
function
|
|
1322
|
+
function m() {
|
|
1246
1323
|
if (!e.active.value) {
|
|
1247
|
-
|
|
1324
|
+
p();
|
|
1248
1325
|
return;
|
|
1249
1326
|
}
|
|
1250
|
-
let
|
|
1251
|
-
for (let e of
|
|
1252
|
-
for (let e of Object.keys(t.value)) c.has(e) ||
|
|
1327
|
+
let o = h(), c = new Set(o.map((e) => e.key)), l = g();
|
|
1328
|
+
for (let e of s) e !== l && c.has(e) && w(e, !0);
|
|
1329
|
+
for (let e of Object.keys(t.value)) c.has(e) || w(e, !1);
|
|
1253
1330
|
for (let [e, t] of r.entries()) {
|
|
1254
1331
|
if (!c.has(e)) {
|
|
1255
1332
|
t.lease.release(), r.delete(e);
|
|
1256
1333
|
continue;
|
|
1257
1334
|
}
|
|
1258
|
-
let n =
|
|
1335
|
+
let n = o.find((t) => t.key === e);
|
|
1259
1336
|
n && (t.index = n.index);
|
|
1260
1337
|
}
|
|
1261
|
-
for (let e of
|
|
1338
|
+
for (let e of o) {
|
|
1262
1339
|
if (r.has(e.key) || t.value[e.key]) continue;
|
|
1263
1340
|
let o;
|
|
1264
1341
|
o = {
|
|
@@ -1266,55 +1343,57 @@ function Pt(e) {
|
|
|
1266
1343
|
key: e.key,
|
|
1267
1344
|
lease: n.request({
|
|
1268
1345
|
assetType: e.item.type === "image" ? "image" : "video",
|
|
1269
|
-
|
|
1346
|
+
canGrant: () => v(o.index),
|
|
1347
|
+
getPriority: () => _(o.index),
|
|
1270
1348
|
onGrant: () => {
|
|
1271
|
-
|
|
1349
|
+
w(e.key, !0), Bt(e.key, i, a) && d(e.key);
|
|
1272
1350
|
},
|
|
1273
1351
|
url: e.item.url
|
|
1274
1352
|
})
|
|
1275
1353
|
}, r.set(e.key, o);
|
|
1276
1354
|
}
|
|
1277
1355
|
for (let e of r.values()) e.lease.refresh();
|
|
1278
|
-
|
|
1279
|
-
}
|
|
1280
|
-
function m() {
|
|
1281
|
-
let n = e.resolvedActiveIndex.value, i = e.items.value.map((t, n) => Rt(t) ? {
|
|
1282
|
-
index: n,
|
|
1283
|
-
item: t,
|
|
1284
|
-
key: e.getItemKey(t)
|
|
1285
|
-
} : null).filter((e) => !!e), a = new Map(i.map((e) => [e.key, e])), o = /* @__PURE__ */ new Set(), s = [], c = (e) => {
|
|
1286
|
-
!e || o.has(e.key) || (o.add(e.key), s.push(e));
|
|
1287
|
-
}, l = /* @__PURE__ */ new Map();
|
|
1288
|
-
for (let e of Object.keys(t.value)) {
|
|
1289
|
-
let t = a.get(e);
|
|
1290
|
-
t && t.index > n && l.set(e, t);
|
|
1291
|
-
}
|
|
1292
|
-
for (let e of r.values()) {
|
|
1293
|
-
if (e.index <= n) continue;
|
|
1294
|
-
let t = a.get(e.key);
|
|
1295
|
-
t && l.set(e.key, t);
|
|
1296
|
-
}
|
|
1297
|
-
let u = [...l.values()].sort((e, t) => e.index - t.index);
|
|
1298
|
-
for (let e of u) c(e);
|
|
1299
|
-
let d = u.reduce((e, t) => Math.max(e, t.index), n), f = 0;
|
|
1300
|
-
for (let e of i) if (!(e.index <= d || o.has(e.key)) && (c(e), f += 1, f >= Mt)) break;
|
|
1301
|
-
return c(i.find((e) => e.index === n - 1)), s;
|
|
1356
|
+
S();
|
|
1302
1357
|
}
|
|
1303
1358
|
function h() {
|
|
1359
|
+
let t = e.resolvedActiveIndex.value;
|
|
1360
|
+
return It.map((e) => y(t + e)).filter((e) => !!e);
|
|
1361
|
+
}
|
|
1362
|
+
function g() {
|
|
1304
1363
|
let t = e.items.value[e.resolvedActiveIndex.value];
|
|
1305
|
-
return !e.active.value || !t || !
|
|
1364
|
+
return !e.active.value || !t || !Ut(t) ? null : e.getItemKey(t);
|
|
1365
|
+
}
|
|
1366
|
+
function _(t) {
|
|
1367
|
+
return e.active.value ? Rt[t - e.resolvedActiveIndex.value] ?? Infinity : Infinity;
|
|
1368
|
+
}
|
|
1369
|
+
function v(t) {
|
|
1370
|
+
return t - e.resolvedActiveIndex.value === 2 ? Lt.every((t) => {
|
|
1371
|
+
let n = y(e.resolvedActiveIndex.value + t);
|
|
1372
|
+
return n ? o.has(n.key) : !0;
|
|
1373
|
+
}) : !0;
|
|
1374
|
+
}
|
|
1375
|
+
function y(t) {
|
|
1376
|
+
let n = e.items.value[t];
|
|
1377
|
+
return !n || !Ut(n) ? null : {
|
|
1378
|
+
index: t,
|
|
1379
|
+
item: n,
|
|
1380
|
+
key: e.getItemKey(n)
|
|
1381
|
+
};
|
|
1306
1382
|
}
|
|
1307
|
-
function
|
|
1308
|
-
|
|
1383
|
+
function b(e) {
|
|
1384
|
+
d(e);
|
|
1309
1385
|
}
|
|
1310
|
-
function
|
|
1311
|
-
let
|
|
1386
|
+
function x() {
|
|
1387
|
+
for (let e of r.values()) e.lease.refresh();
|
|
1388
|
+
}
|
|
1389
|
+
function S() {
|
|
1390
|
+
let n = /* @__PURE__ */ new Set(), r = g();
|
|
1312
1391
|
r && n.add(r);
|
|
1313
1392
|
for (let e of Object.keys(t.value)) n.add(e);
|
|
1314
|
-
for (let t of
|
|
1315
|
-
|
|
1393
|
+
for (let t of s) n.has(t) || (o.delete(t), T(t), e.onResetAssetState(t));
|
|
1394
|
+
s = n;
|
|
1316
1395
|
}
|
|
1317
|
-
function
|
|
1396
|
+
function w(e, n) {
|
|
1318
1397
|
if (n) {
|
|
1319
1398
|
if (t.value[e]) return;
|
|
1320
1399
|
t.value = {
|
|
@@ -1327,7 +1406,7 @@ function Pt(e) {
|
|
|
1327
1406
|
let r = { ...t.value };
|
|
1328
1407
|
delete r[e], t.value = r;
|
|
1329
1408
|
}
|
|
1330
|
-
function
|
|
1409
|
+
function T(e) {
|
|
1331
1410
|
let t = i.get(e);
|
|
1332
1411
|
if (t) try {
|
|
1333
1412
|
t.removeAttribute("src"), t.src = "";
|
|
@@ -1344,33 +1423,33 @@ function Pt(e) {
|
|
|
1344
1423
|
}
|
|
1345
1424
|
}
|
|
1346
1425
|
return {
|
|
1347
|
-
clearBackgroundPreloads:
|
|
1348
|
-
registerImageElement:
|
|
1349
|
-
registerMediaElement:
|
|
1350
|
-
settleBackgroundPreload:
|
|
1351
|
-
shouldAttachSlideAsset:
|
|
1426
|
+
clearBackgroundPreloads: p,
|
|
1427
|
+
registerImageElement: l,
|
|
1428
|
+
registerMediaElement: u,
|
|
1429
|
+
settleBackgroundPreload: d,
|
|
1430
|
+
shouldAttachSlideAsset: c
|
|
1352
1431
|
};
|
|
1353
1432
|
}
|
|
1354
|
-
function
|
|
1433
|
+
function Bt(e, t, n) {
|
|
1355
1434
|
let r = t.get(e);
|
|
1356
|
-
if (r) return
|
|
1435
|
+
if (r) return Vt(r);
|
|
1357
1436
|
let i = n.get(e);
|
|
1358
|
-
return i ?
|
|
1437
|
+
return i ? Ht(i) : !1;
|
|
1359
1438
|
}
|
|
1360
|
-
function
|
|
1439
|
+
function Vt(e) {
|
|
1361
1440
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1362
1441
|
}
|
|
1363
|
-
function
|
|
1442
|
+
function Ht(e) {
|
|
1364
1443
|
let t = typeof HTMLMediaElement > "u" ? 1 : HTMLMediaElement.HAVE_METADATA;
|
|
1365
1444
|
return e.readyState >= t;
|
|
1366
1445
|
}
|
|
1367
|
-
function
|
|
1446
|
+
function Ut(e) {
|
|
1368
1447
|
return e.type === "image" || e.type === "video" || e.type === "audio";
|
|
1369
1448
|
}
|
|
1370
1449
|
//#endregion
|
|
1371
1450
|
//#region src/components/viewer-core/useFullscreenSurfaceMedia.ts
|
|
1372
|
-
function
|
|
1373
|
-
let t =
|
|
1451
|
+
function Wt(e) {
|
|
1452
|
+
let t = zt({
|
|
1374
1453
|
active: e.active,
|
|
1375
1454
|
getItemKey: r,
|
|
1376
1455
|
items: e.items,
|
|
@@ -1379,7 +1458,7 @@ function zt(e) {
|
|
|
1379
1458
|
});
|
|
1380
1459
|
function n(e, t) {
|
|
1381
1460
|
let n = t.title?.trim();
|
|
1382
|
-
return n ? `${e} ${n}` : `${e} ${
|
|
1461
|
+
return n ? `${e} ${n}` : `${e} ${kt(t.type).toLowerCase()}`;
|
|
1383
1462
|
}
|
|
1384
1463
|
function r(e) {
|
|
1385
1464
|
return $(e);
|
|
@@ -1427,11 +1506,11 @@ function zt(e) {
|
|
|
1427
1506
|
}
|
|
1428
1507
|
//#endregion
|
|
1429
1508
|
//#region src/components/viewer-core/slotContent.ts
|
|
1430
|
-
function
|
|
1509
|
+
function Gt(e) {
|
|
1431
1510
|
if (!Array.isArray(e)) return !1;
|
|
1432
1511
|
for (let t of e) {
|
|
1433
1512
|
if (Array.isArray(t)) {
|
|
1434
|
-
if (
|
|
1513
|
+
if (Gt(t)) return !0;
|
|
1435
1514
|
continue;
|
|
1436
1515
|
}
|
|
1437
1516
|
if (!h(t)) {
|
|
@@ -1442,20 +1521,20 @@ function Bt(e) {
|
|
|
1442
1521
|
if (t != null && t !== !1) return !0;
|
|
1443
1522
|
continue;
|
|
1444
1523
|
}
|
|
1445
|
-
if (!
|
|
1524
|
+
if (!Kt(t)) return !0;
|
|
1446
1525
|
}
|
|
1447
1526
|
return !1;
|
|
1448
1527
|
}
|
|
1449
|
-
function
|
|
1450
|
-
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !
|
|
1528
|
+
function Kt(r) {
|
|
1529
|
+
return r.type === e ? !0 : r.type === n ? typeof r.children == "string" ? r.children.trim().length === 0 : !0 : r.type === t ? !Gt(r.children) : !1;
|
|
1451
1530
|
}
|
|
1452
1531
|
//#endregion
|
|
1453
1532
|
//#region src/components/viewer-core/useSurfaceEmptyState.ts
|
|
1454
|
-
var
|
|
1455
|
-
function
|
|
1533
|
+
var qt = "no items available";
|
|
1534
|
+
function Jt(e) {
|
|
1456
1535
|
let t = i(() => e.loading.value || e.itemCount.value > 0 || e.emptyStateMode.value === "hidden" ? null : {
|
|
1457
1536
|
loading: !!e.loading.value,
|
|
1458
|
-
message:
|
|
1537
|
+
message: qt,
|
|
1459
1538
|
mode: e.emptyStateMode.value === "badge" ? "badge" : "inline",
|
|
1460
1539
|
surface: e.surface,
|
|
1461
1540
|
total: e.itemCount.value
|
|
@@ -1463,23 +1542,23 @@ function Ut(e) {
|
|
|
1463
1542
|
return {
|
|
1464
1543
|
emptyStateProps: t,
|
|
1465
1544
|
showBadgeEmptyState: i(() => t.value?.mode === "badge"),
|
|
1466
|
-
showCustomEmptyState: i(() =>
|
|
1545
|
+
showCustomEmptyState: i(() => Gt(n.value)),
|
|
1467
1546
|
showInlineEmptyState: i(() => t.value?.mode === "inline")
|
|
1468
1547
|
};
|
|
1469
1548
|
}
|
|
1470
1549
|
//#endregion
|
|
1471
1550
|
//#region src/components/viewer-core/format.ts
|
|
1472
|
-
function
|
|
1551
|
+
function Yt(e) {
|
|
1473
1552
|
if (!Number.isFinite(e) || e <= 0) return "0:00";
|
|
1474
1553
|
let t = Math.floor(e), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60), i = t % 60;
|
|
1475
1554
|
return n > 0 ? `${n}:${String(r).padStart(2, "0")}:${String(i).padStart(2, "0")}` : `${r}:${String(i).padStart(2, "0")}`;
|
|
1476
1555
|
}
|
|
1477
1556
|
//#endregion
|
|
1478
1557
|
//#region src/components/viewer-core/surfaceStatus.ts
|
|
1479
|
-
function
|
|
1558
|
+
function Xt(e) {
|
|
1480
1559
|
return e.phase ? e.phase : e.loading ? e.itemCount > 0 ? "loading" : "initializing" : "idle";
|
|
1481
1560
|
}
|
|
1482
|
-
function
|
|
1561
|
+
function Zt(e) {
|
|
1483
1562
|
return e.phase === "failed" ? {
|
|
1484
1563
|
kind: "failed",
|
|
1485
1564
|
message: e.errorMessage ?? (e.hasItems ? "The viewer could not load more items." : "The viewer could not load items.")
|
|
@@ -1502,7 +1581,7 @@ function Kt(e) {
|
|
|
1502
1581
|
}
|
|
1503
1582
|
//#endregion
|
|
1504
1583
|
//#region src/components/viewer-core/useActivation.ts
|
|
1505
|
-
function
|
|
1584
|
+
function Qt(e) {
|
|
1506
1585
|
let t = !1;
|
|
1507
1586
|
L(e.enabled, async (t) => {
|
|
1508
1587
|
if (n(t), t) {
|
|
@@ -1525,7 +1604,7 @@ function qt(e) {
|
|
|
1525
1604
|
}
|
|
1526
1605
|
//#endregion
|
|
1527
1606
|
//#region src/components/viewer-core/assetState.ts
|
|
1528
|
-
var
|
|
1607
|
+
var $t = {
|
|
1529
1608
|
currentTime: 0,
|
|
1530
1609
|
duration: 0,
|
|
1531
1610
|
errorKind: null,
|
|
@@ -1534,38 +1613,38 @@ var Jt = {
|
|
|
1534
1613
|
ready: !1,
|
|
1535
1614
|
volume: 1
|
|
1536
1615
|
};
|
|
1537
|
-
function
|
|
1538
|
-
return {
|
|
1616
|
+
function en() {
|
|
1617
|
+
return { ...$t };
|
|
1539
1618
|
}
|
|
1540
|
-
function
|
|
1619
|
+
function tn(e) {
|
|
1541
1620
|
return e.complete && !!(e.currentSrc || e.getAttribute("src"));
|
|
1542
1621
|
}
|
|
1543
|
-
function
|
|
1544
|
-
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 =
|
|
1622
|
+
function nn(e, t, n) {
|
|
1623
|
+
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 = rn(t, n);
|
|
1545
1624
|
}
|
|
1546
|
-
function
|
|
1625
|
+
function rn(e, t) {
|
|
1547
1626
|
return t === "error" || t === "loadstart" || t === "waiting" || t === "stalled" ? !1 : t === "canplay" || t === "canplaythrough" || t === "playing" ? !0 : e.readyState >= HTMLMediaElement.HAVE_CURRENT_DATA;
|
|
1548
1627
|
}
|
|
1549
1628
|
//#endregion
|
|
1550
1629
|
//#region src/components/viewer-core/loadError.ts
|
|
1551
|
-
var
|
|
1552
|
-
function
|
|
1630
|
+
var an = /* @__PURE__ */ new Map();
|
|
1631
|
+
function on(e) {
|
|
1553
1632
|
return e === "not-found" ? "404" : "Load error";
|
|
1554
1633
|
}
|
|
1555
|
-
function
|
|
1634
|
+
function sn(e) {
|
|
1556
1635
|
return e === "generic";
|
|
1557
1636
|
}
|
|
1558
|
-
function
|
|
1559
|
-
return
|
|
1637
|
+
function cn(e) {
|
|
1638
|
+
return ln(e).then((e) => e ?? "generic");
|
|
1560
1639
|
}
|
|
1561
|
-
function
|
|
1562
|
-
let t =
|
|
1640
|
+
function ln(e) {
|
|
1641
|
+
let t = an.get(e);
|
|
1563
1642
|
if (t) return t;
|
|
1564
|
-
let n =
|
|
1565
|
-
return
|
|
1643
|
+
let n = un(e);
|
|
1644
|
+
return an.set(e, n), n;
|
|
1566
1645
|
}
|
|
1567
|
-
async function
|
|
1568
|
-
if (!
|
|
1646
|
+
async function un(e) {
|
|
1647
|
+
if (!dn(e)) return null;
|
|
1569
1648
|
try {
|
|
1570
1649
|
let t = await fetch(e, { method: "HEAD" });
|
|
1571
1650
|
return t.ok ? null : t.status === 404 ? "not-found" : "generic";
|
|
@@ -1573,12 +1652,12 @@ async function an(e) {
|
|
|
1573
1652
|
return "generic";
|
|
1574
1653
|
}
|
|
1575
1654
|
}
|
|
1576
|
-
function
|
|
1655
|
+
function dn(e) {
|
|
1577
1656
|
return /^(https?:\/\/|\/)/i.test(e);
|
|
1578
1657
|
}
|
|
1579
1658
|
//#endregion
|
|
1580
1659
|
//#region src/components/viewer-core/mediaPlayback.ts
|
|
1581
|
-
function
|
|
1660
|
+
function fn(e) {
|
|
1582
1661
|
try {
|
|
1583
1662
|
let t = e.play();
|
|
1584
1663
|
t && typeof t.catch == "function" && t.catch(() => {});
|
|
@@ -1586,12 +1665,12 @@ function sn(e) {
|
|
|
1586
1665
|
}
|
|
1587
1666
|
//#endregion
|
|
1588
1667
|
//#region src/components/viewer-core/useMedia.ts
|
|
1589
|
-
function
|
|
1668
|
+
function pn(e) {
|
|
1590
1669
|
let t = D({}), n = D({}), r = D({}), a = D({}), o = D({}), 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(() => {
|
|
1591
1670
|
let t = /* @__PURE__ */ new Map();
|
|
1592
1671
|
for (let n of e.items.value) t.set($(n), n);
|
|
1593
1672
|
return t;
|
|
1594
|
-
}), p = i(() => d.value ? r.value[d.value] ??
|
|
1673
|
+
}), p = i(() => d.value ? r.value[d.value] ?? $t : $t), m = i(() => d.value ? p.value.duration : 0), h = i(() => m.value <= 0 ? 0 : mn(p.value.currentTime / m.value * 100, 0, 100)), g = i(() => u.value ? R(u.value) : null);
|
|
1595
1674
|
L(() => u.value, async () => {
|
|
1596
1675
|
await C();
|
|
1597
1676
|
}), L(() => e.itemCount.value, async () => {
|
|
@@ -1614,7 +1693,7 @@ function cn(e) {
|
|
|
1614
1693
|
c.delete(e);
|
|
1615
1694
|
}
|
|
1616
1695
|
function b(e, r) {
|
|
1617
|
-
r instanceof HTMLImageElement &&
|
|
1696
|
+
r instanceof HTMLImageElement && tn(r) && (t.value[e] = !0, n.value[e] = null, J(e, r.currentSrc || r.src || ie(e)));
|
|
1618
1697
|
}
|
|
1619
1698
|
function x() {
|
|
1620
1699
|
H(), a.value = {}, n.value = {}, t.value = {}, o.value = {}, r.value = {}, l.clear();
|
|
@@ -1636,14 +1715,14 @@ function cn(e) {
|
|
|
1636
1715
|
V(i, n);
|
|
1637
1716
|
continue;
|
|
1638
1717
|
}
|
|
1639
|
-
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0,
|
|
1718
|
+
i.muted = !1, i.loop = e.loopFullscreenVideo.value, i.playsInline = !0, fn(i), W(n, i);
|
|
1640
1719
|
}
|
|
1641
1720
|
for (let [e, n] of c.entries()) {
|
|
1642
1721
|
if (e !== t || r.value[e]?.errorKind) {
|
|
1643
1722
|
V(n, e);
|
|
1644
1723
|
continue;
|
|
1645
1724
|
}
|
|
1646
|
-
|
|
1725
|
+
fn(n), W(e, n);
|
|
1647
1726
|
}
|
|
1648
1727
|
}
|
|
1649
1728
|
function w(e, t) {
|
|
@@ -1661,7 +1740,7 @@ function cn(e) {
|
|
|
1661
1740
|
async function E(r, i) {
|
|
1662
1741
|
let a = Y(r) ?? e.activeItem.value;
|
|
1663
1742
|
t.value[r] = !1, n.value[r] = "generic";
|
|
1664
|
-
let o = await
|
|
1743
|
+
let o = await cn(i);
|
|
1665
1744
|
n.value[r] = o, a && e.onAssetError?.({
|
|
1666
1745
|
item: a,
|
|
1667
1746
|
occurrenceKey: r,
|
|
@@ -1679,7 +1758,7 @@ function cn(e) {
|
|
|
1679
1758
|
} catch {}
|
|
1680
1759
|
}
|
|
1681
1760
|
i.currentTime = 0, i.duration = 0, i.paused = !0, i.ready = !1, i.errorKind = "generic";
|
|
1682
|
-
let o = await
|
|
1761
|
+
let o = await cn(n);
|
|
1683
1762
|
i.errorKind = o, a && e.onAssetError?.({
|
|
1684
1763
|
item: a,
|
|
1685
1764
|
occurrenceKey: t,
|
|
@@ -1699,13 +1778,13 @@ function cn(e) {
|
|
|
1699
1778
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1700
1779
|
let r = Number.parseFloat(e.target.value);
|
|
1701
1780
|
if (!Number.isFinite(r)) return;
|
|
1702
|
-
let i =
|
|
1781
|
+
let i = mn(r, 0, m.value || 0);
|
|
1703
1782
|
ne(n, i, t), t.currentTime = i;
|
|
1704
1783
|
}
|
|
1705
1784
|
function M(e) {
|
|
1706
1785
|
let t = q(), n = d.value;
|
|
1707
1786
|
if (!t || !n || !(e.target instanceof HTMLInputElement)) return;
|
|
1708
|
-
let r =
|
|
1787
|
+
let r = mn(Number.parseFloat(e.target.value), 0, 1);
|
|
1709
1788
|
t.volume = r, t.muted = r <= 0, r > 0 && (o.value[n] = r), W(n, t);
|
|
1710
1789
|
}
|
|
1711
1790
|
function N() {
|
|
@@ -1726,10 +1805,10 @@ function cn(e) {
|
|
|
1726
1805
|
}
|
|
1727
1806
|
function z(e) {
|
|
1728
1807
|
let t = R(e);
|
|
1729
|
-
return t ?
|
|
1808
|
+
return t ? on(t) : null;
|
|
1730
1809
|
}
|
|
1731
1810
|
function B(e) {
|
|
1732
|
-
return
|
|
1811
|
+
return sn(R(e));
|
|
1733
1812
|
}
|
|
1734
1813
|
function ee(e) {
|
|
1735
1814
|
return `${e}:${a.value[e] ?? 0}`;
|
|
@@ -1756,17 +1835,17 @@ function cn(e) {
|
|
|
1756
1835
|
for (let [e, t] of c.entries()) V(t, e);
|
|
1757
1836
|
}
|
|
1758
1837
|
function U(e) {
|
|
1759
|
-
return r.value[e] || (r.value[e] =
|
|
1838
|
+
return r.value[e] || (r.value[e] = en()), r.value[e];
|
|
1760
1839
|
}
|
|
1761
1840
|
function W(e, t, n) {
|
|
1762
|
-
|
|
1841
|
+
nn(U(e), t, n), !t.muted && t.volume > 0 && (o.value[e] = t.volume);
|
|
1763
1842
|
}
|
|
1764
1843
|
function ne(e, t, n) {
|
|
1765
1844
|
let r = U(e);
|
|
1766
1845
|
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;
|
|
1767
1846
|
}
|
|
1768
1847
|
function G(e) {
|
|
1769
|
-
return
|
|
1848
|
+
return mn(o.value[e] ?? 1, 0, 1);
|
|
1770
1849
|
}
|
|
1771
1850
|
function K(e) {
|
|
1772
1851
|
return s.get(e) ?? c.get(e) ?? null;
|
|
@@ -1777,7 +1856,7 @@ function cn(e) {
|
|
|
1777
1856
|
function re(e) {
|
|
1778
1857
|
if (e) {
|
|
1779
1858
|
if (e.paused) {
|
|
1780
|
-
|
|
1859
|
+
fn(e);
|
|
1781
1860
|
return;
|
|
1782
1861
|
}
|
|
1783
1862
|
e.pause();
|
|
@@ -1831,10 +1910,10 @@ function cn(e) {
|
|
|
1831
1910
|
syncMediaPlayback: C
|
|
1832
1911
|
};
|
|
1833
1912
|
}
|
|
1834
|
-
function
|
|
1913
|
+
function mn(e, t, n) {
|
|
1835
1914
|
return Math.min(Math.max(e, t), n);
|
|
1836
1915
|
}
|
|
1837
|
-
function
|
|
1916
|
+
function hn(e, t, n = 2) {
|
|
1838
1917
|
return t <= 0 ? {
|
|
1839
1918
|
start: 0,
|
|
1840
1919
|
end: -1
|
|
@@ -1843,14 +1922,14 @@ function un(e, t, n = 2) {
|
|
|
1843
1922
|
end: Math.min(t - 1, e + n)
|
|
1844
1923
|
};
|
|
1845
1924
|
}
|
|
1846
|
-
function
|
|
1847
|
-
let r =
|
|
1925
|
+
function gn(e, t, n = 2) {
|
|
1926
|
+
let r = hn(t, e.length, n);
|
|
1848
1927
|
return r.end < r.start ? [] : e.slice(r.start, r.end + 1).map((e, t) => ({
|
|
1849
1928
|
item: e,
|
|
1850
1929
|
index: r.start + t
|
|
1851
1930
|
}));
|
|
1852
1931
|
}
|
|
1853
|
-
function
|
|
1932
|
+
function _n(e, t, n, r, i) {
|
|
1854
1933
|
return {
|
|
1855
1934
|
transform: `translate3d(0, ${(e - t) * n + r}px, 0)`,
|
|
1856
1935
|
transition: i ? "none" : "transform 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
@@ -1858,12 +1937,12 @@ function fn(e, t, n, r, i) {
|
|
|
1858
1937
|
}
|
|
1859
1938
|
//#endregion
|
|
1860
1939
|
//#region src/components/viewer-core/useViewer.ts
|
|
1861
|
-
function
|
|
1862
|
-
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(() =>
|
|
1940
|
+
function vn(e, t, n = {}) {
|
|
1941
|
+
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(() => Xt({
|
|
1863
1942
|
itemCount: r.value.length,
|
|
1864
1943
|
loading: s.value,
|
|
1865
1944
|
phase: e.phase
|
|
1866
|
-
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(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), T =
|
|
1945
|
+
})), f = i(() => !1), p = D(null), m = D(0), h = D(!1), g = D(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), T = pn({
|
|
1867
1946
|
items: r,
|
|
1868
1947
|
activeItem: C,
|
|
1869
1948
|
activeMediaItem: w,
|
|
@@ -1872,14 +1951,14 @@ function pn(e, t, n = {}) {
|
|
|
1872
1951
|
loopFullscreenVideo: l,
|
|
1873
1952
|
onAssetError: n.onAssetError,
|
|
1874
1953
|
onAssetLoad: n.onAssetLoad
|
|
1875
|
-
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() =>
|
|
1954
|
+
}), E = i(() => r.value.length > 0 && S.value === r.value.length - 1), O = i(() => Zt({
|
|
1876
1955
|
errorMessage: o.value,
|
|
1877
1956
|
hasItems: r.value.length > 0,
|
|
1878
1957
|
hasNextPage: c.value,
|
|
1879
1958
|
phase: d.value,
|
|
1880
1959
|
surface: "fullscreen"
|
|
1881
|
-
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() =>
|
|
1882
|
-
|
|
1960
|
+
})), k = i(() => O.value?.kind ?? null), A = i(() => O.value?.message ?? null), j = i(() => Math.min(96, g.value * .15 || 96)), M = i(() => hn(S.value, r.value.length)), N = i(() => gn(r.value, S.value));
|
|
1961
|
+
Qt({
|
|
1883
1962
|
enabled: _,
|
|
1884
1963
|
onDisable() {
|
|
1885
1964
|
H(), T.resetMediaState();
|
|
@@ -1957,7 +2036,7 @@ function pn(e, t, n = {}) {
|
|
|
1957
2036
|
return e.type === "audio";
|
|
1958
2037
|
}
|
|
1959
2038
|
function ie(e) {
|
|
1960
|
-
return
|
|
2039
|
+
return _n(e, S.value, g.value, m.value, h.value);
|
|
1961
2040
|
}
|
|
1962
2041
|
return {
|
|
1963
2042
|
activeItem: C,
|
|
@@ -1972,7 +2051,7 @@ function pn(e, t, n = {}) {
|
|
|
1972
2051
|
getAssetErrorKind: T.getAssetErrorKind,
|
|
1973
2052
|
getAssetErrorLabel: T.getAssetErrorLabel,
|
|
1974
2053
|
getAssetRenderKey: T.getAssetRenderKey,
|
|
1975
|
-
formatPlaybackTime:
|
|
2054
|
+
formatPlaybackTime: Yt,
|
|
1976
2055
|
getImageSource: T.getImageSource,
|
|
1977
2056
|
getSlideStyle: ie,
|
|
1978
2057
|
hasNextPage: c,
|
|
@@ -2016,21 +2095,21 @@ function pn(e, t, n = {}) {
|
|
|
2016
2095
|
}
|
|
2017
2096
|
//#endregion
|
|
2018
2097
|
//#region src/components/viewer-core/theme.ts
|
|
2019
|
-
var
|
|
2098
|
+
var yn = "bg-[linear-gradient(180deg,#0a0b10,#05060a)]", bn = "bg-[linear-gradient(180deg,#0b0c11,#06070b)]", xn = {
|
|
2020
2099
|
image: !0,
|
|
2021
2100
|
video: !0,
|
|
2022
2101
|
audio: !0,
|
|
2023
2102
|
other: !0
|
|
2024
2103
|
};
|
|
2025
|
-
function
|
|
2026
|
-
return
|
|
2104
|
+
function Sn(e) {
|
|
2105
|
+
return xn[e], yn;
|
|
2027
2106
|
}
|
|
2028
|
-
function
|
|
2029
|
-
return
|
|
2107
|
+
function Cn(e) {
|
|
2108
|
+
return xn[e], bn;
|
|
2030
2109
|
}
|
|
2031
2110
|
//#endregion
|
|
2032
2111
|
//#region src/components/viewer-core/dominantImageTone.ts
|
|
2033
|
-
function
|
|
2112
|
+
function wn(e) {
|
|
2034
2113
|
if (e.naturalWidth <= 0 || e.naturalHeight <= 0) return null;
|
|
2035
2114
|
let t = document.createElement("canvas"), n = t.getContext("2d", { willReadFrequently: !0 });
|
|
2036
2115
|
if (!n) return null;
|
|
@@ -2045,20 +2124,20 @@ function yn(e) {
|
|
|
2045
2124
|
r += d, i += s * d, a += c * d, o += l * d;
|
|
2046
2125
|
}
|
|
2047
2126
|
return r <= 0 ? null : {
|
|
2048
|
-
r:
|
|
2049
|
-
g:
|
|
2050
|
-
b:
|
|
2127
|
+
r: Tn(Math.round(i / r)),
|
|
2128
|
+
g: Tn(Math.round(a / r)),
|
|
2129
|
+
b: Tn(Math.round(o / r))
|
|
2051
2130
|
};
|
|
2052
2131
|
} catch {
|
|
2053
2132
|
return null;
|
|
2054
2133
|
}
|
|
2055
2134
|
}
|
|
2056
|
-
function
|
|
2135
|
+
function Tn(e) {
|
|
2057
2136
|
return Math.min(235, Math.max(26, e));
|
|
2058
2137
|
}
|
|
2059
2138
|
//#endregion
|
|
2060
2139
|
//#region src/components/viewer-core/useFullscreenDominantTone.ts
|
|
2061
|
-
function
|
|
2140
|
+
function En(e) {
|
|
2062
2141
|
let t = D({}), 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(() => {
|
|
2063
2142
|
if (!r.value) return;
|
|
2064
2143
|
let { r: e, g: t, b: n } = r.value;
|
|
@@ -2073,7 +2152,7 @@ function xn(e) {
|
|
|
2073
2152
|
});
|
|
2074
2153
|
function s(n, r) {
|
|
2075
2154
|
if (!e.showDominantImageTone.value) return;
|
|
2076
|
-
let i =
|
|
2155
|
+
let i = wn(r);
|
|
2077
2156
|
i && (t.value[n] = i);
|
|
2078
2157
|
}
|
|
2079
2158
|
return {
|
|
@@ -2084,7 +2163,7 @@ function xn(e) {
|
|
|
2084
2163
|
}
|
|
2085
2164
|
//#endregion
|
|
2086
2165
|
//#region src/components/SurfaceEmptyState.vue?vue&type=script&setup=true&lang.ts
|
|
2087
|
-
var
|
|
2166
|
+
var Dn = ["data-surface"], On = ["data-surface"], kn = /* @__PURE__ */ d({
|
|
2088
2167
|
inheritAttrs: !1,
|
|
2089
2168
|
__name: "SurfaceEmptyState",
|
|
2090
2169
|
props: {
|
|
@@ -2098,31 +2177,31 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2098
2177
|
"data-testid": "vibe-empty-state-inline",
|
|
2099
2178
|
"data-surface": e.surface,
|
|
2100
2179
|
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)]"]
|
|
2101
|
-
}), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16,
|
|
2180
|
+
}), [k(n.$slots, "default", {}, () => [c("p", { class: v(["m-0 text-[0.82rem] font-medium tracking-[0.08em]", e.surface === "grid" ? "text-[#f7f1ea]/58" : "text-[#f7f1ea]/64"]) }, j(e.message), 3)])], 16, Dn)) : (w(), s("div", g({ key: 1 }, N(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]"] }), [k(n.$slots, "default", {}, () => [c("span", {
|
|
2102
2181
|
"data-testid": "vibe-empty-state-badge",
|
|
2103
2182
|
"data-surface": e.surface,
|
|
2104
2183
|
class: v(["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"])
|
|
2105
|
-
}, j(e.message), 11,
|
|
2184
|
+
}, j(e.message), 11, On)])], 16));
|
|
2106
2185
|
}
|
|
2107
|
-
}),
|
|
2186
|
+
}), An = { class: "relative h-full min-h-0 overflow-hidden bg-[#05060a] text-[#f7f1ea]" }, jn = {
|
|
2108
2187
|
key: 0,
|
|
2109
2188
|
class: "relative h-full min-h-0"
|
|
2110
|
-
},
|
|
2189
|
+
}, Mn = [
|
|
2111
2190
|
"data-item-id",
|
|
2112
2191
|
"data-occurrence-key",
|
|
2113
2192
|
"data-index",
|
|
2114
2193
|
"data-active",
|
|
2115
2194
|
"aria-hidden"
|
|
2116
|
-
],
|
|
2195
|
+
], Nn = {
|
|
2117
2196
|
key: 0,
|
|
2118
2197
|
"data-testid": "vibe-asset-spinner",
|
|
2119
2198
|
class: "pointer-events-none absolute inset-0 z-[2] grid place-items-center"
|
|
2120
|
-
},
|
|
2199
|
+
}, Pn = { class: "inline-flex h-12 w-12 items-center justify-center rounded-full bg-black/45 shadow-[0_18px_40px_-18px_rgba(0,0,0,0.85)] backdrop-blur-[18px]" }, Fn = ["data-kind"], In = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/45 px-8 py-7 text-center backdrop-blur-[18px]" }, Ln = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Rn = ["onClick"], zn = [
|
|
2121
2200
|
"src",
|
|
2122
2201
|
"alt",
|
|
2123
2202
|
"onLoad",
|
|
2124
2203
|
"onError"
|
|
2125
|
-
],
|
|
2204
|
+
], Bn = [
|
|
2126
2205
|
"loop",
|
|
2127
2206
|
"src",
|
|
2128
2207
|
"preload",
|
|
@@ -2141,15 +2220,15 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2141
2220
|
"onStalled",
|
|
2142
2221
|
"onTimeupdate",
|
|
2143
2222
|
"onWaiting"
|
|
2144
|
-
],
|
|
2223
|
+
], Vn = { class: "relative grid aspect-square w-[clamp(320px,46vw,560px)] max-w-[calc(100vw-2.5rem)] place-items-center" }, Hn = [
|
|
2145
2224
|
"aria-label",
|
|
2146
2225
|
"disabled",
|
|
2147
2226
|
"onClick"
|
|
2148
|
-
],
|
|
2227
|
+
], Un = { 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]" }, Wn = { 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]" }, Gn = {
|
|
2149
2228
|
key: 0,
|
|
2150
2229
|
"data-testid": "vibe-asset-spinner",
|
|
2151
2230
|
class: "pointer-events-none absolute inset-0 z-[3] grid place-items-center"
|
|
2152
|
-
},
|
|
2231
|
+
}, Kn = { 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]" }, qn = ["data-kind"], Jn = { class: "m-0 text-[0.82rem] font-bold uppercase tracking-[0.28em] text-[#f7f1ea]/70" }, Yn = ["onClick"], Xn = [
|
|
2153
2232
|
"src",
|
|
2154
2233
|
"preload",
|
|
2155
2234
|
"onCanplay",
|
|
@@ -2165,26 +2244,26 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2165
2244
|
"onStalled",
|
|
2166
2245
|
"onTimeupdate",
|
|
2167
2246
|
"onWaiting"
|
|
2168
|
-
],
|
|
2247
|
+
], Zn = {
|
|
2169
2248
|
key: 2,
|
|
2170
2249
|
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"
|
|
2171
|
-
},
|
|
2250
|
+
}, Qn = { 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]" }, $n = {
|
|
2172
2251
|
key: 0,
|
|
2173
2252
|
"data-testid": "vibe-fullscreen-overlay",
|
|
2174
2253
|
class: "pointer-events-none absolute inset-0 z-[6]"
|
|
2175
|
-
},
|
|
2254
|
+
}, er = { class: "h-full w-full" }, tr = {
|
|
2176
2255
|
key: 1,
|
|
2177
2256
|
"data-testid": "vibe-forward-fill-placeholder",
|
|
2178
2257
|
class: "grid h-full min-h-0 place-items-center px-6 text-center"
|
|
2179
|
-
},
|
|
2258
|
+
}, nr = { class: "grid justify-items-center gap-4 border border-white/14 bg-black/40 px-8 py-7 backdrop-blur-[18px]" }, rr = { 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)]" }, ir = { class: "m-0 text-[0.78rem] font-bold uppercase tracking-[0.24em] text-[#f7f1ea]/72" }, ar = {
|
|
2180
2259
|
key: 0,
|
|
2181
2260
|
"data-testid": "vibe-fullscreen-aside",
|
|
2182
2261
|
class: "h-full min-h-0 overflow-hidden border-l border-white/10 bg-black/45 backdrop-blur-[18px]"
|
|
2183
|
-
},
|
|
2262
|
+
}, or = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, sr = {
|
|
2184
2263
|
key: 0,
|
|
2185
2264
|
"data-testid": "vibe-fullscreen-aside",
|
|
2186
2265
|
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]"
|
|
2187
|
-
},
|
|
2266
|
+
}, cr = { class: "h-full min-h-0 overflow-y-auto overscroll-y-contain" }, lr = 1280, ur = 768, dr = /* @__PURE__ */ d({
|
|
2188
2267
|
__name: "FullscreenSurface",
|
|
2189
2268
|
props: {
|
|
2190
2269
|
active: {
|
|
@@ -2236,23 +2315,23 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2236
2315
|
},
|
|
2237
2316
|
emits: ["back-to-list", "update:activeIndex"],
|
|
2238
2317
|
setup(e, { emit: n }) {
|
|
2239
|
-
let d = e, f = F(), m = n, h =
|
|
2318
|
+
let d = e, f = F(), m = n, h = vn(d, (e, t) => {
|
|
2240
2319
|
m("update:activeIndex", t);
|
|
2241
2320
|
}, {
|
|
2242
2321
|
enabled: M(d, "active"),
|
|
2243
2322
|
onAssetError: d.reportAssetError ?? void 0,
|
|
2244
2323
|
onAssetLoad: d.reportAssetLoad ?? void 0
|
|
2245
|
-
}), _ = D(typeof window > "u" ?
|
|
2324
|
+
}), _ = D(typeof window > "u" ? lr : window.innerWidth || lr), C = Wt({
|
|
2246
2325
|
active: M(d, "active"),
|
|
2247
2326
|
items: h.items,
|
|
2248
2327
|
resolvedActiveIndex: h.resolvedActiveIndex,
|
|
2249
2328
|
viewer: h
|
|
2250
|
-
}), T = i(() =>
|
|
2329
|
+
}), T = i(() => Sn(h.activeItem.value?.type ?? "image")), { activeSlideToneStyle: E, activeStageToneStyle: P, updateFromImageElement: I } = En({
|
|
2251
2330
|
activeItem: h.activeItem,
|
|
2252
2331
|
getItemKey: C.getItemKey,
|
|
2253
2332
|
isImageReady: h.isImageReady,
|
|
2254
2333
|
showDominantImageTone: M(d, "showDominantImageTone")
|
|
2255
|
-
}), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value <
|
|
2334
|
+
}), L = i(() => h.activeMediaItem.value && !h.activeAssetErrorKind.value ? "bottom-[5.8rem] max-[720px]:bottom-[7.4rem]" : "bottom-[1.8rem] max-[720px]:bottom-[1.3rem]"), R = i(() => !!h.activeMediaItem.value && !h.activeAssetErrorKind.value), B = i(() => _.value < ur ? "vertical" : "horizontal"), te = i(() => R.value ? "pb-[5.75rem] max-[720px]:pb-[7rem]" : ""), V = i(() => d.activeIndex >= d.items.length && (d.loading || d.hasNextPage)), H = i(() => d.hasNextPage ? "Loading more items" : h.statusMessage.value ?? "Loading more items"), U = i(() => {
|
|
2256
2335
|
let e = h.activeItem.value;
|
|
2257
2336
|
return e ? {
|
|
2258
2337
|
hasNextPage: d.hasNextPage,
|
|
@@ -2269,7 +2348,7 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2269
2348
|
}), K = i(() => !G.value || !f["fullscreen-status"] ? [] : f["fullscreen-status"](G.value)), q = i(() => ({
|
|
2270
2349
|
gridTemplateColumns: Y.value ? "minmax(0, 1fr) 22rem" : "minmax(0, 1fr) 0rem",
|
|
2271
2350
|
transition: "grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1)"
|
|
2272
|
-
})), re = i(() =>
|
|
2351
|
+
})), re = i(() => Gt(W.value)), J = i(() => Gt(ne.value)), Y = i(() => J.value && _.value >= lr), ie = i(() => J.value && !Y.value), ae = i(() => Gt(K.value)), { emptyStateProps: X, showBadgeEmptyState: ue, showCustomEmptyState: de, showInlineEmptyState: fe } = Jt({
|
|
2273
2352
|
emptyStateMode: M(d, "emptyStateMode"),
|
|
2274
2353
|
itemCount: i(() => d.items.length),
|
|
2275
2354
|
loading: M(d, "loading"),
|
|
@@ -2282,7 +2361,7 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2282
2361
|
window.removeEventListener("resize", Z);
|
|
2283
2362
|
});
|
|
2284
2363
|
function Z() {
|
|
2285
|
-
_.value = window.innerWidth ||
|
|
2364
|
+
_.value = window.innerWidth || lr;
|
|
2286
2365
|
}
|
|
2287
2366
|
function pe(e, t, n) {
|
|
2288
2367
|
C.settleBackgroundPreload(t), h.onImageLoad(t, n);
|
|
@@ -2322,7 +2401,7 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2322
2401
|
let r = n.play();
|
|
2323
2402
|
r && typeof r.catch == "function" && r.catch(() => {});
|
|
2324
2403
|
}
|
|
2325
|
-
return (e, n) => (w(), s("div",
|
|
2404
|
+
return (e, n) => (w(), s("div", An, [
|
|
2326
2405
|
c("div", {
|
|
2327
2406
|
class: v(["absolute inset-0 transition-[background] duration-200", T.value]),
|
|
2328
2407
|
style: b(N(P))
|
|
@@ -2339,7 +2418,7 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2339
2418
|
onPointerup: n[3] ||= (...e) => N(h).onPointerUp && N(h).onPointerUp(...e),
|
|
2340
2419
|
onPointercancel: n[4] ||= (...e) => N(h).onPointerCancel && N(h).onPointerCancel(...e),
|
|
2341
2420
|
onWheel: n[5] ||= (...e) => N(h).onWheel && N(h).onWheel(...e)
|
|
2342
|
-
}, [N(h).activeItem.value ? (w(), s("div",
|
|
2421
|
+
}, [N(h).activeItem.value ? (w(), s("div", jn, [
|
|
2343
2422
|
(w(!0), s(t, null, O(N(h).renderedItems.value, ({ item: r, index: i }) => (w(), s("article", {
|
|
2344
2423
|
key: N(C).getItemKey(r),
|
|
2345
2424
|
"data-testid": "vibe-slide",
|
|
@@ -2351,12 +2430,12 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2351
2430
|
class: v(["absolute inset-0 flex h-full min-h-full items-center justify-center will-change-transform", i === N(h).resolvedActiveIndex.value ? "pointer-events-auto" : "pointer-events-none"]),
|
|
2352
2431
|
style: b(N(h).getSlideStyle(i))
|
|
2353
2432
|
}, [c("div", {
|
|
2354
|
-
class: v(["absolute inset-0 opacity-85", N(
|
|
2433
|
+
class: v(["absolute inset-0 opacity-85", N(Cn)(r.type)]),
|
|
2355
2434
|
style: b(i === N(h).resolvedActiveIndex.value && r.type === "image" ? N(E) : void 0)
|
|
2356
2435
|
}, null, 6), N(h).isVisual(r) ? (w(), s("div", {
|
|
2357
2436
|
key: 0,
|
|
2358
2437
|
class: v(["relative z-[1] flex h-full w-full items-center justify-center overflow-hidden", i === N(h).resolvedActiveIndex.value ? te.value : ""])
|
|
2359
|
-
}, [N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2438
|
+
}, [N(C).isAssetLoading(i, r) ? (w(), s("div", Nn, [c("span", Pn, [u(N(oe), {
|
|
2360
2439
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2361
2440
|
"aria-hidden": "true"
|
|
2362
2441
|
})])])) : o("", !0), N(C).isAssetErrored(i, r) ? (w(), s("div", {
|
|
@@ -2364,19 +2443,19 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2364
2443
|
"data-testid": "vibe-asset-error",
|
|
2365
2444
|
"data-kind": N(C).getAssetErrorKind(r),
|
|
2366
2445
|
class: "grid h-full w-full place-items-center"
|
|
2367
|
-
}, [c("div",
|
|
2446
|
+
}, [c("div", In, [
|
|
2368
2447
|
u(N(le), {
|
|
2369
2448
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2370
2449
|
"aria-hidden": "true"
|
|
2371
2450
|
}),
|
|
2372
|
-
c("p",
|
|
2451
|
+
c("p", Ln, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2373
2452
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2374
2453
|
key: 0,
|
|
2375
2454
|
type: "button",
|
|
2376
2455
|
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",
|
|
2377
2456
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2378
|
-
}, " Retry ", 8,
|
|
2379
|
-
])], 8,
|
|
2457
|
+
}, " Retry ", 8, Rn)) : o("", !0)
|
|
2458
|
+
])], 8, Fn)) : r.type === "image" ? (w(), s("img", {
|
|
2380
2459
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2381
2460
|
src: N(C).getFullscreenImageSource(i, r),
|
|
2382
2461
|
alt: r.title ?? "",
|
|
@@ -2387,7 +2466,7 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2387
2466
|
ref: (e) => he(N(C).getItemKey(r), e),
|
|
2388
2467
|
onLoad: (e) => pe(e, N(C).getItemKey(r), r.url),
|
|
2389
2468
|
onError: (e) => me(N(C).getItemKey(r), r.url)
|
|
2390
|
-
}, null, 42,
|
|
2469
|
+
}, null, 42, zn)) : (w(), s("video", {
|
|
2391
2470
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2392
2471
|
class: v(["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", N(h).isMediaReady(N(C).getItemKey(r)) ? "opacity-100" : "opacity-0"]),
|
|
2393
2472
|
playsinline: "",
|
|
@@ -2411,10 +2490,10 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2411
2490
|
onStalled: (e) => Q(N(C).getItemKey(r), e),
|
|
2412
2491
|
onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
|
|
2413
2492
|
onWaiting: (e) => Q(N(C).getItemKey(r), e)
|
|
2414
|
-
}, null, 42,
|
|
2493
|
+
}, null, 42, Bn))], 2)) : N(h).isAudio(r) ? (w(), s("div", {
|
|
2415
2494
|
key: 1,
|
|
2416
2495
|
class: v(["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 === N(h).resolvedActiveIndex.value ? te.value : ""])
|
|
2417
|
-
}, [c("div",
|
|
2496
|
+
}, [c("div", Vn, [
|
|
2418
2497
|
c("button", {
|
|
2419
2498
|
type: "button",
|
|
2420
2499
|
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]",
|
|
@@ -2424,19 +2503,19 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2424
2503
|
}, [
|
|
2425
2504
|
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),
|
|
2426
2505
|
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),
|
|
2427
|
-
c("span",
|
|
2428
|
-
icon: N(
|
|
2506
|
+
c("span", Un, [k(e.$slots, "item-icon", {
|
|
2507
|
+
icon: N(Ot)(r.type),
|
|
2429
2508
|
item: r
|
|
2430
|
-
}, () => [(w(), a(A(N(
|
|
2509
|
+
}, () => [(w(), a(A(N(Ot)(r.type)), {
|
|
2431
2510
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2432
2511
|
"aria-hidden": "true"
|
|
2433
2512
|
}))])]),
|
|
2434
|
-
c("span",
|
|
2513
|
+
c("span", Wn, [(w(), a(A(N(h).mediaStates.value[N(C).getItemKey(r)]?.paused ?? !0 ? N(ce) : N(se)), {
|
|
2435
2514
|
class: "h-4 w-4 stroke-2",
|
|
2436
2515
|
"aria-hidden": "true"
|
|
2437
2516
|
}))])
|
|
2438
|
-
], 8,
|
|
2439
|
-
N(C).isAssetLoading(i, r) ? (w(), s("div",
|
|
2517
|
+
], 8, Hn),
|
|
2518
|
+
N(C).isAssetLoading(i, r) ? (w(), s("div", Gn, [c("span", Kn, [u(N(oe), {
|
|
2440
2519
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2441
2520
|
"aria-hidden": "true"
|
|
2442
2521
|
})])])) : o("", !0),
|
|
@@ -2449,14 +2528,14 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2449
2528
|
class: "h-7 w-7 stroke-[1.9] text-[#f7f1ea]/72",
|
|
2450
2529
|
"aria-hidden": "true"
|
|
2451
2530
|
}),
|
|
2452
|
-
c("p",
|
|
2531
|
+
c("p", Jn, j(N(C).getAssetErrorLabel(r)), 1),
|
|
2453
2532
|
N(h).canRetryAsset(N(C).getItemKey(r)) ? (w(), s("button", {
|
|
2454
2533
|
key: 0,
|
|
2455
2534
|
type: "button",
|
|
2456
2535
|
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",
|
|
2457
2536
|
onClick: ee((e) => N(h).retryAsset(N(C).getItemKey(r)), ["stop"])
|
|
2458
|
-
}, " Retry ", 8,
|
|
2459
|
-
], 8,
|
|
2537
|
+
}, " Retry ", 8, Yn)) : o("", !0)
|
|
2538
|
+
], 8, qn)], 64)) : o("", !0)
|
|
2460
2539
|
]), (w(), s("audio", {
|
|
2461
2540
|
key: N(h).getAssetRenderKey(N(C).getItemKey(r)),
|
|
2462
2541
|
src: N(C).getFullscreenMediaSource(i, r),
|
|
@@ -2477,15 +2556,15 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2477
2556
|
onStalled: (e) => Q(N(C).getItemKey(r), e),
|
|
2478
2557
|
onTimeupdate: (e) => Q(N(C).getItemKey(r), e),
|
|
2479
2558
|
onWaiting: (e) => Q(N(C).getItemKey(r), e)
|
|
2480
|
-
}, null, 40,
|
|
2481
|
-
icon: N(
|
|
2559
|
+
}, null, 40, Xn))], 2)) : (w(), s("div", Zn, [c("div", Qn, [k(e.$slots, "item-icon", {
|
|
2560
|
+
icon: N(Ot)(r.type),
|
|
2482
2561
|
item: r
|
|
2483
|
-
}, () => [(w(), a(A(N(
|
|
2562
|
+
}, () => [(w(), a(A(N(Ot)(r.type)), {
|
|
2484
2563
|
class: "h-6 w-6 stroke-[1.9]",
|
|
2485
2564
|
"aria-hidden": "true"
|
|
2486
|
-
}))])])]))], 14,
|
|
2487
|
-
U.value && f["fullscreen-overlay"] ? (w(), s("div",
|
|
2488
|
-
N(h).activeItem.value ? (w(), a(
|
|
2565
|
+
}))])])]))], 14, Mn))), 128)),
|
|
2566
|
+
U.value && f["fullscreen-overlay"] ? (w(), s("div", $n, [c("div", er, [k(e.$slots, "fullscreen-overlay", y(p(U.value)))])])) : o("", !0),
|
|
2567
|
+
N(h).activeItem.value ? (w(), a(Tt, {
|
|
2489
2568
|
key: 1,
|
|
2490
2569
|
"current-index": N(h).resolvedActiveIndex.value,
|
|
2491
2570
|
loading: d.loading,
|
|
@@ -2508,7 +2587,7 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2508
2587
|
"title",
|
|
2509
2588
|
"total"
|
|
2510
2589
|
])) : o("", !0),
|
|
2511
|
-
R.value ? (w(), a(
|
|
2590
|
+
R.value ? (w(), a(mt, {
|
|
2512
2591
|
key: 2,
|
|
2513
2592
|
"current-time": N(h).activeMediaState.value.currentTime,
|
|
2514
2593
|
"current-time-label": N(h).formatPlaybackTime(N(h).activeMediaState.value.currentTime),
|
|
@@ -2542,10 +2621,10 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2542
2621
|
"data-testid": "vibe-fullscreen-status-badge",
|
|
2543
2622
|
class: v(["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", G.value.kind === "end" ? "border-amber-300/35 text-amber-200" : G.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
2544
2623
|
}, j(G.value.message), 3))], 2)) : o("", !0)
|
|
2545
|
-
])) : V.value ? (w(), s("div",
|
|
2624
|
+
])) : V.value ? (w(), s("div", tr, [c("div", nr, [c("span", rr, [u(N(oe), {
|
|
2546
2625
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
2547
2626
|
"aria-hidden": "true"
|
|
2548
|
-
})]), c("p",
|
|
2627
|
+
})]), c("p", ir, j(H.value), 1)])])) : N(fe) && N(X) ? (w(), a(kn, {
|
|
2549
2628
|
key: 2,
|
|
2550
2629
|
message: N(X).message,
|
|
2551
2630
|
mode: N(X).mode,
|
|
@@ -2557,7 +2636,7 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2557
2636
|
"message",
|
|
2558
2637
|
"mode",
|
|
2559
2638
|
"surface"
|
|
2560
|
-
])) : o("", !0), N(ue) && N(X) ? (w(), a(
|
|
2639
|
+
])) : o("", !0), N(ue) && N(X) ? (w(), a(kn, {
|
|
2561
2640
|
key: 3,
|
|
2562
2641
|
message: N(X).message,
|
|
2563
2642
|
mode: N(X).mode,
|
|
@@ -2577,7 +2656,7 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2577
2656
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2578
2657
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2579
2658
|
}, {
|
|
2580
|
-
default: z(() => [Y.value && U.value ? (w(), s("aside",
|
|
2659
|
+
default: z(() => [Y.value && U.value ? (w(), s("aside", ar, [c("div", or, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
|
|
2581
2660
|
_: 3
|
|
2582
2661
|
})], 4),
|
|
2583
2662
|
u(r, {
|
|
@@ -2588,29 +2667,29 @@ var Sn = ["data-surface"], Cn = ["data-surface"], wn = /* @__PURE__ */ d({
|
|
|
2588
2667
|
"leave-from-class": "translate-x-0 opacity-100",
|
|
2589
2668
|
"leave-to-class": "translate-x-full opacity-0"
|
|
2590
2669
|
}, {
|
|
2591
|
-
default: z(() => [ie.value && U.value ? (w(), s("aside",
|
|
2670
|
+
default: z(() => [ie.value && U.value ? (w(), s("aside", sr, [c("div", cr, [k(e.$slots, "fullscreen-aside", y(p(U.value)))])])) : o("", !0)]),
|
|
2592
2671
|
_: 3
|
|
2593
2672
|
})
|
|
2594
2673
|
]));
|
|
2595
2674
|
}
|
|
2596
|
-
}),
|
|
2597
|
-
function
|
|
2675
|
+
}), fr = 1, pr = .5;
|
|
2676
|
+
function mr(e) {
|
|
2598
2677
|
if (e.type !== "image" && e.type !== "video") return {
|
|
2599
|
-
width:
|
|
2600
|
-
height:
|
|
2678
|
+
width: fr,
|
|
2679
|
+
height: fr,
|
|
2601
2680
|
source: "fallback"
|
|
2602
2681
|
};
|
|
2603
2682
|
let t = e.preview?.width, n = e.preview?.height;
|
|
2604
|
-
if (
|
|
2605
|
-
let r =
|
|
2683
|
+
if (xr(t) && xr(n)) {
|
|
2684
|
+
let r = Sr(e, t, n);
|
|
2606
2685
|
return {
|
|
2607
2686
|
width: r.width,
|
|
2608
2687
|
height: r.height,
|
|
2609
2688
|
source: "preview"
|
|
2610
2689
|
};
|
|
2611
2690
|
}
|
|
2612
|
-
if (
|
|
2613
|
-
let t =
|
|
2691
|
+
if (xr(e.width) && xr(e.height)) {
|
|
2692
|
+
let t = Sr(e, e.width, e.height);
|
|
2614
2693
|
return {
|
|
2615
2694
|
width: t.width,
|
|
2616
2695
|
height: t.height,
|
|
@@ -2618,31 +2697,31 @@ function lr(e) {
|
|
|
2618
2697
|
};
|
|
2619
2698
|
}
|
|
2620
2699
|
return {
|
|
2621
|
-
width:
|
|
2622
|
-
height:
|
|
2700
|
+
width: fr,
|
|
2701
|
+
height: fr,
|
|
2623
2702
|
source: "fallback"
|
|
2624
2703
|
};
|
|
2625
2704
|
}
|
|
2626
|
-
function
|
|
2705
|
+
function hr(e, t) {
|
|
2627
2706
|
return !e || e <= 0 || !t || t <= 0 ? 1 : Math.max(1, Math.floor(e / t));
|
|
2628
2707
|
}
|
|
2629
|
-
function
|
|
2708
|
+
function gr(e, t, n, r = 0) {
|
|
2630
2709
|
if (!e || e <= 0 || !t || t <= 0) return n;
|
|
2631
2710
|
let i = typeof r == "number" && r > 0 ? r : 0, a = e - Math.max(0, t - 1) * i;
|
|
2632
2711
|
return !a || a <= 0 ? n : a / t;
|
|
2633
2712
|
}
|
|
2634
|
-
function
|
|
2635
|
-
let n =
|
|
2713
|
+
function _r(e, t) {
|
|
2714
|
+
let n = mr(e);
|
|
2636
2715
|
return n.height / n.width * t;
|
|
2637
2716
|
}
|
|
2638
|
-
function
|
|
2717
|
+
function vr(e, t) {
|
|
2639
2718
|
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;
|
|
2640
2719
|
for (let c = 0; c < e.length; c += 1) {
|
|
2641
2720
|
let l = e[c];
|
|
2642
2721
|
o.set($(l), c);
|
|
2643
2722
|
let u = 0;
|
|
2644
2723
|
for (let e = 1; e < n.length; e += 1) n[e] < n[u] && (u = e);
|
|
2645
|
-
let d = u * (t.columnWidth + t.gapX), f = n[u], p =
|
|
2724
|
+
let d = u * (t.columnWidth + t.gapX), f = n[u], p = _r(l, t.columnWidth);
|
|
2646
2725
|
r[c] = {
|
|
2647
2726
|
x: d,
|
|
2648
2727
|
y: f
|
|
@@ -2661,7 +2740,7 @@ function pr(e, t) {
|
|
|
2661
2740
|
indexById: o
|
|
2662
2741
|
};
|
|
2663
2742
|
}
|
|
2664
|
-
function
|
|
2743
|
+
function yr(e) {
|
|
2665
2744
|
if (e.itemCount <= 0) return [];
|
|
2666
2745
|
if (e.viewportHeight <= 0) return Array.from({ length: e.itemCount }, (e, t) => t);
|
|
2667
2746
|
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();
|
|
@@ -2671,7 +2750,7 @@ function mr(e) {
|
|
|
2671
2750
|
}
|
|
2672
2751
|
return Array.from(a).sort((e, t) => e - t);
|
|
2673
2752
|
}
|
|
2674
|
-
function
|
|
2753
|
+
function br(e, t, n) {
|
|
2675
2754
|
let r = /* @__PURE__ */ new Map();
|
|
2676
2755
|
for (let i of e) {
|
|
2677
2756
|
let e = t.get($(i));
|
|
@@ -2681,11 +2760,11 @@ function hr(e, t, n) {
|
|
|
2681
2760
|
}
|
|
2682
2761
|
return r;
|
|
2683
2762
|
}
|
|
2684
|
-
function
|
|
2763
|
+
function xr(e) {
|
|
2685
2764
|
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2686
2765
|
}
|
|
2687
|
-
function
|
|
2688
|
-
return e.type !== "image" || n / t >=
|
|
2766
|
+
function Sr(e, t, n) {
|
|
2767
|
+
return e.type !== "image" || n / t >= pr ? {
|
|
2689
2768
|
width: t,
|
|
2690
2769
|
height: n
|
|
2691
2770
|
} : {
|
|
@@ -2695,21 +2774,21 @@ function _r(e, t, n) {
|
|
|
2695
2774
|
}
|
|
2696
2775
|
//#endregion
|
|
2697
2776
|
//#region src/components/viewer-core/useMasonryMotion.ts
|
|
2698
|
-
var
|
|
2699
|
-
function
|
|
2777
|
+
var Cr = 300, wr = 600, Tr = 40, Er = 300, Dr = 400;
|
|
2778
|
+
function Or(e, t) {
|
|
2700
2779
|
return t === "top" ? [...e].reverse() : e;
|
|
2701
2780
|
}
|
|
2702
|
-
function
|
|
2703
|
-
return e <= 0 ?
|
|
2781
|
+
function kr(e) {
|
|
2782
|
+
return e <= 0 ? wr : wr + Math.min((e - 1) * Tr, Dr);
|
|
2704
2783
|
}
|
|
2705
|
-
function
|
|
2706
|
-
return
|
|
2784
|
+
function Ar() {
|
|
2785
|
+
return Er;
|
|
2707
2786
|
}
|
|
2708
|
-
function
|
|
2787
|
+
function jr(e) {
|
|
2709
2788
|
let t = e.itemHeight > 0 ? e.itemHeight : e.columnWidth;
|
|
2710
2789
|
return e.direction === "top" ? e.scrollTop - t : e.scrollTop + e.viewportHeight + t;
|
|
2711
2790
|
}
|
|
2712
|
-
function
|
|
2791
|
+
function Mr(e) {
|
|
2713
2792
|
let t = D(/* @__PURE__ */ new Set()), n = D(/* @__PURE__ */ new Set()), r = D(/* @__PURE__ */ new Map()), a = D(/* @__PURE__ */ new Map()), o = D(/* @__PURE__ */ new Map()), s = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), l = D(/* @__PURE__ */ new Map()), u = D(/* @__PURE__ */ new Set()), d = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set(), p = i(() => Array.from(o.value.values()));
|
|
2714
2793
|
L(e.visibleIndices, (i) => {
|
|
2715
2794
|
if (!i.length) return;
|
|
@@ -2719,20 +2798,20 @@ function Dr(e) {
|
|
|
2719
2798
|
!r || !t.value.has(r) || d.has(r) || (d.add(r), o.push(r));
|
|
2720
2799
|
}
|
|
2721
2800
|
if (!o.length) return;
|
|
2722
|
-
let s =
|
|
2723
|
-
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e *
|
|
2724
|
-
r.value = c,
|
|
2801
|
+
let s = Or(o, a.value.get(o[0]) ?? "bottom"), c = new Map(r.value);
|
|
2802
|
+
for (let e = 0; e < s.length; e += 1) c.set(s[e], Math.min(e * Tr, Dr));
|
|
2803
|
+
r.value = c, Nr(() => {
|
|
2725
2804
|
let e = new Set(n.value);
|
|
2726
2805
|
for (let t of o) e.add(t);
|
|
2727
2806
|
n.value = e;
|
|
2728
|
-
}),
|
|
2807
|
+
}), Pr(() => {
|
|
2729
2808
|
let e = new Set(t.value);
|
|
2730
2809
|
for (let t of o) e.delete(t);
|
|
2731
2810
|
t.value = e, S(() => {
|
|
2732
2811
|
let e = new Set(n.value), t = new Map(r.value), i = new Map(a.value);
|
|
2733
2812
|
for (let n of o) e.delete(n), t.delete(n), i.delete(n), d.delete(n);
|
|
2734
2813
|
n.value = e, r.value = t, a.value = i;
|
|
2735
|
-
},
|
|
2814
|
+
}, kr(o.length));
|
|
2736
2815
|
});
|
|
2737
2816
|
}, { flush: "post" }), L(() => e.items.value.map((e) => $(e)), (e) => {
|
|
2738
2817
|
if (!e.length || !o.value.size) return;
|
|
@@ -2759,7 +2838,7 @@ function Dr(e) {
|
|
|
2759
2838
|
let e = $(t.item);
|
|
2760
2839
|
p.push(e), i.set(e, t), c.delete(e), l.delete(e), u.delete(e), f.delete(e), d.delete(e);
|
|
2761
2840
|
}
|
|
2762
|
-
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f,
|
|
2841
|
+
o.value = i, t.value = c, n.value = l, r.value = u, a.value = f, Nr(() => {
|
|
2763
2842
|
let e = new Set(s.value);
|
|
2764
2843
|
for (let t of p) e.add(t);
|
|
2765
2844
|
s.value = e;
|
|
@@ -2767,9 +2846,9 @@ function Dr(e) {
|
|
|
2767
2846
|
let e = new Map(o.value), t = new Set(s.value);
|
|
2768
2847
|
for (let n of p) e.delete(n), t.delete(n);
|
|
2769
2848
|
o.value = e, s.value = t;
|
|
2770
|
-
},
|
|
2849
|
+
}, Er);
|
|
2771
2850
|
}
|
|
2772
|
-
function g(t, n, r =
|
|
2851
|
+
function g(t, n, r = Cr) {
|
|
2773
2852
|
if (!t.size) return;
|
|
2774
2853
|
let i = /* @__PURE__ */ new Map(), a = [];
|
|
2775
2854
|
for (let [r, o] of t.entries()) {
|
|
@@ -2788,8 +2867,8 @@ function Dr(e) {
|
|
|
2788
2867
|
c.value = i, u.value = /* @__PURE__ */ new Set();
|
|
2789
2868
|
let o = new Map(l.value);
|
|
2790
2869
|
for (let e of a) o.set(e, r);
|
|
2791
|
-
l.value = o,
|
|
2792
|
-
u.value = new Set(a),
|
|
2870
|
+
l.value = o, Nr(() => {
|
|
2871
|
+
u.value = new Set(a), Nr(() => {
|
|
2793
2872
|
c.value = /* @__PURE__ */ new Map();
|
|
2794
2873
|
});
|
|
2795
2874
|
}), S(() => {
|
|
@@ -2800,8 +2879,8 @@ function Dr(e) {
|
|
|
2800
2879
|
}, r);
|
|
2801
2880
|
}
|
|
2802
2881
|
function _(e) {
|
|
2803
|
-
if (n.value.has(e)) return `transform ${
|
|
2804
|
-
if (u.value.has(e)) return `transform ${l.value.get(e) ??
|
|
2882
|
+
if (n.value.has(e)) return `transform ${wr}ms ease-out`;
|
|
2883
|
+
if (u.value.has(e)) return `transform ${l.value.get(e) ?? Cr}ms ease-out`;
|
|
2805
2884
|
}
|
|
2806
2885
|
function v(e) {
|
|
2807
2886
|
if (!n.value.has(e)) return;
|
|
@@ -2818,7 +2897,7 @@ function Dr(e) {
|
|
|
2818
2897
|
} : {
|
|
2819
2898
|
dx: 0,
|
|
2820
2899
|
dy: 0
|
|
2821
|
-
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ?
|
|
2900
|
+
}, u = s ? a.value.get(s) ?? "bottom" : "bottom", d = s && t.value.has(s) ? jr({
|
|
2822
2901
|
columnWidth: e.columnWidth.value,
|
|
2823
2902
|
direction: u,
|
|
2824
2903
|
itemHeight: o,
|
|
@@ -2832,14 +2911,14 @@ function Dr(e) {
|
|
|
2832
2911
|
if (!r) return {
|
|
2833
2912
|
opacity: "0",
|
|
2834
2913
|
transform: "translate3d(0, 0, 0) scale(0.96)",
|
|
2835
|
-
transition: `opacity ${
|
|
2914
|
+
transition: `opacity ${Er}ms ease-out, transform ${Er}ms ease-out`
|
|
2836
2915
|
};
|
|
2837
2916
|
let i = s.value.has(n);
|
|
2838
2917
|
return {
|
|
2839
2918
|
height: `${r.height}px`,
|
|
2840
2919
|
opacity: i ? "0" : "1",
|
|
2841
2920
|
transform: `translate3d(${r.position.x}px, ${r.position.y}px, 0) scale(${i ? "0.96" : "1"})`,
|
|
2842
|
-
transition: `opacity ${
|
|
2921
|
+
transition: `opacity ${Er}ms ease-out, transform ${Er}ms ease-out`,
|
|
2843
2922
|
width: `${e.columnWidth.value}px`
|
|
2844
2923
|
};
|
|
2845
2924
|
}
|
|
@@ -2860,28 +2939,28 @@ function Dr(e) {
|
|
|
2860
2939
|
playFlipMoveAnimation: g
|
|
2861
2940
|
};
|
|
2862
2941
|
}
|
|
2863
|
-
function
|
|
2942
|
+
function Nr(e) {
|
|
2864
2943
|
if (typeof requestAnimationFrame == "function") {
|
|
2865
2944
|
requestAnimationFrame(() => e());
|
|
2866
2945
|
return;
|
|
2867
2946
|
}
|
|
2868
2947
|
setTimeout(e, 0);
|
|
2869
2948
|
}
|
|
2870
|
-
function
|
|
2871
|
-
|
|
2949
|
+
function Pr(e) {
|
|
2950
|
+
Nr(() => Nr(e));
|
|
2872
2951
|
}
|
|
2873
2952
|
//#endregion
|
|
2874
2953
|
//#region src/components/viewer-core/masonryViewport.ts
|
|
2875
|
-
function
|
|
2954
|
+
function Fr(e, t) {
|
|
2876
2955
|
return e?.clientHeight || Math.round(e?.getBoundingClientRect().height ?? 0) || t || window.innerHeight || 1;
|
|
2877
2956
|
}
|
|
2878
|
-
function
|
|
2957
|
+
function Ir(e, t, n) {
|
|
2879
2958
|
return e?.clientWidth || Math.round(e?.getBoundingClientRect().width ?? 0) || t || window.innerWidth || n;
|
|
2880
2959
|
}
|
|
2881
|
-
function
|
|
2960
|
+
function Lr(e, t, n, r) {
|
|
2882
2961
|
return (e?.scrollHeight ?? r) - (t + n);
|
|
2883
2962
|
}
|
|
2884
|
-
function
|
|
2963
|
+
function Rr(e, t) {
|
|
2885
2964
|
return {
|
|
2886
2965
|
height: `${e}px`,
|
|
2887
2966
|
transform: `translate3d(0, ${t}px, 0)`
|
|
@@ -2889,8 +2968,8 @@ function Nr(e, t) {
|
|
|
2889
2968
|
}
|
|
2890
2969
|
//#endregion
|
|
2891
2970
|
//#region src/components/viewer-core/useEdgeBoundary.ts
|
|
2892
|
-
var
|
|
2893
|
-
function
|
|
2971
|
+
var zr = 250, Br = 1e3;
|
|
2972
|
+
function Vr(e) {
|
|
2894
2973
|
let t = D(!1), n = D(!1), r = D(0), i = D(0), a = D(!1), o = D(!1), s = 0, c = null;
|
|
2895
2974
|
x(() => {
|
|
2896
2975
|
y();
|
|
@@ -2906,7 +2985,7 @@ function Ir(e) {
|
|
|
2906
2985
|
function u(t) {
|
|
2907
2986
|
if (!b(t) || !e.isAtBoundary()) return;
|
|
2908
2987
|
let n = Date.now();
|
|
2909
|
-
n < s || (s = n +
|
|
2988
|
+
n < s || (s = n + zr, m());
|
|
2910
2989
|
}
|
|
2911
2990
|
function d() {
|
|
2912
2991
|
if (!g()) return;
|
|
@@ -2940,7 +3019,7 @@ function Ir(e) {
|
|
|
2940
3019
|
return e.hasPage.value && t.value && r.value > i.value && !e.interactionLocked?.value && !e.loading.value && !a.value && typeof e.requestPage.value == "function";
|
|
2941
3020
|
}
|
|
2942
3021
|
function _() {
|
|
2943
|
-
o.value = !1, v(
|
|
3022
|
+
o.value = !1, v(Br);
|
|
2944
3023
|
}
|
|
2945
3024
|
function v(e) {
|
|
2946
3025
|
y(), a.value = !0, c = setTimeout(() => {
|
|
@@ -2963,42 +3042,42 @@ function Ir(e) {
|
|
|
2963
3042
|
}
|
|
2964
3043
|
//#endregion
|
|
2965
3044
|
//#region src/components/viewer-core/useMasonryList.ts
|
|
2966
|
-
var
|
|
2967
|
-
function
|
|
2968
|
-
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth ||
|
|
3045
|
+
var Hr = 600, Ur = 24, Wr = 16, Gr = 300, Kr = 200, qr = 200, Jr = Ur + Wr, Yr = 200, Xr = 300, Zr = 24, Qr = 48, $r = 500, ei = 1e3;
|
|
3046
|
+
function ti(e) {
|
|
3047
|
+
let t = D(null), n = D(0), r = D(typeof window > "u" ? 0 : window.innerHeight || 0), a = D(typeof window > "u" ? 0 : window.innerWidth || Gr), o = D([]), s = D([]), c = D(/* @__PURE__ */ new Map()), l = D(0), u = D(/* @__PURE__ */ new Map()), d = D(null), f = D(null), p = D(!1), m = i(() => Math.max(Gr, a.value - Ur * 2)), h = i(() => hr(m.value, Gr)), g = i(() => gr(m.value, h.value, Gr, Wr)), v = i(() => ni(e.activeIndex.value, 0, Math.max(0, e.items.value.length - 1))), y = i(() => yr({
|
|
2969
3048
|
itemCount: e.items.value.length,
|
|
2970
3049
|
viewportHeight: r.value,
|
|
2971
3050
|
scrollTop: n.value,
|
|
2972
|
-
overscanPx:
|
|
2973
|
-
bucketPx:
|
|
3051
|
+
overscanPx: Kr,
|
|
3052
|
+
bucketPx: Hr,
|
|
2974
3053
|
buckets: c.value
|
|
2975
3054
|
})), b = i(() => y.value.map((t) => ({
|
|
2976
3055
|
item: e.items.value[t],
|
|
2977
3056
|
index: t
|
|
2978
3057
|
}))), C = i(() => {
|
|
2979
|
-
let e = l.value +
|
|
2980
|
-
return Math.max(e, t, r.value) +
|
|
2981
|
-
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() =>
|
|
3058
|
+
let e = l.value + Ur * 2, t = d.value ?? 0;
|
|
3059
|
+
return Math.max(e, t, r.value) + Yr;
|
|
3060
|
+
}), w = i(() => e.hasNextPage.value || e.allowExhaustedNextPageRefresh.value), T = i(() => ii({
|
|
2982
3061
|
active: e.active.value,
|
|
2983
3062
|
maxScrollTop: se(),
|
|
2984
3063
|
progressDistancePx: n.value,
|
|
2985
|
-
thresholdPx:
|
|
3064
|
+
thresholdPx: qr,
|
|
2986
3065
|
triggerEnabled: w.value
|
|
2987
|
-
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() =>
|
|
3066
|
+
})), E = i(() => e.items.value.length > 0 ? `${v.value + 1} / ${e.items.value.length}` : "0 / 0"), O = i(() => ri({
|
|
2988
3067
|
active: e.active.value,
|
|
2989
3068
|
maxScrollTop: se(),
|
|
2990
3069
|
progressDistancePx: n.value,
|
|
2991
|
-
thresholdPx:
|
|
3070
|
+
thresholdPx: Jr,
|
|
2992
3071
|
triggerEnabled: e.hasPreviousPage.value
|
|
2993
|
-
})), k = i(() => Math.max(0, r.value -
|
|
3072
|
+
})), k = i(() => Math.max(0, r.value - Zr * 2)), A = i(() => C.value > r.value + 1 && k.value > 0), j = i(() => {
|
|
2994
3073
|
if (!A.value) return 0;
|
|
2995
3074
|
let e = r.value / C.value * k.value;
|
|
2996
|
-
return Math.min(k.value, Math.max(
|
|
3075
|
+
return Math.min(k.value, Math.max(Qr, e));
|
|
2997
3076
|
}), M = i(() => {
|
|
2998
|
-
if (!A.value) return
|
|
3077
|
+
if (!A.value) return Zr;
|
|
2999
3078
|
let e = Math.max(0, C.value - r.value);
|
|
3000
|
-
return
|
|
3001
|
-
}), N =
|
|
3079
|
+
return Zr + Math.max(0, k.value - j.value) * (e > 0 ? ni(n.value / e, 0, 1) : 0);
|
|
3080
|
+
}), N = Mr({
|
|
3002
3081
|
items: e.items,
|
|
3003
3082
|
visibleIndices: y,
|
|
3004
3083
|
positions: o,
|
|
@@ -3007,27 +3086,27 @@ function Xr(e) {
|
|
|
3007
3086
|
columnWidth: g,
|
|
3008
3087
|
scrollTop: n,
|
|
3009
3088
|
viewportHeight: r
|
|
3010
|
-
}), P =
|
|
3089
|
+
}), P = Vr({
|
|
3011
3090
|
direction: "top",
|
|
3012
3091
|
getAnimationLockMs(e) {
|
|
3013
|
-
return Math.max(
|
|
3092
|
+
return Math.max($r, kr(e)) + ei;
|
|
3014
3093
|
},
|
|
3015
3094
|
hasPage: e.hasPreviousPage,
|
|
3016
3095
|
interactionLocked: p,
|
|
3017
3096
|
isAtBoundary() {
|
|
3018
|
-
return n.value <=
|
|
3097
|
+
return n.value <= Jr;
|
|
3019
3098
|
},
|
|
3020
3099
|
loading: e.loading,
|
|
3021
3100
|
requestPage: e.requestPreviousPage
|
|
3022
|
-
}), F =
|
|
3101
|
+
}), F = Vr({
|
|
3023
3102
|
direction: "bottom",
|
|
3024
3103
|
getAnimationLockMs(e) {
|
|
3025
|
-
return
|
|
3104
|
+
return kr(e) + ei;
|
|
3026
3105
|
},
|
|
3027
3106
|
hasPage: w,
|
|
3028
3107
|
interactionLocked: p,
|
|
3029
3108
|
isAtBoundary() {
|
|
3030
|
-
return oe() <=
|
|
3109
|
+
return oe() <= qr;
|
|
3031
3110
|
},
|
|
3032
3111
|
loading: e.loading,
|
|
3033
3112
|
requestPage: e.requestNextPage
|
|
@@ -3037,7 +3116,7 @@ function Xr(e) {
|
|
|
3037
3116
|
h,
|
|
3038
3117
|
g
|
|
3039
3118
|
], async ([t], [r = []]) => {
|
|
3040
|
-
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c =
|
|
3119
|
+
let i = t.map((e) => $(e)), a = r ?? [], s = a.map((e) => $(e)), c = br(a, u.value, o.value), l = X(a), d = new Set(s), f = new Set(i), p = t.filter((e) => !d.has($(e))), m = a.flatMap((e) => {
|
|
3041
3120
|
let t = $(e);
|
|
3042
3121
|
if (f.has(t)) return [];
|
|
3043
3122
|
let n = c.get(t), r = l.get(t);
|
|
@@ -3046,8 +3125,8 @@ function Xr(e) {
|
|
|
3046
3125
|
item: e,
|
|
3047
3126
|
position: n
|
|
3048
3127
|
}];
|
|
3049
|
-
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value >
|
|
3050
|
-
y && K(
|
|
3128
|
+
}), h = i.length > s.length && s.length > 0 && i[0] !== s[0], g = t.length === 0 && a.length > 0 && m.length > 0 && n.value > 0, y = m.length > 0 && n.value > Ur + Wr, b = h && n.value > Ur + Wr ? t[v.value] : null, x = b ? $(b) : null;
|
|
3129
|
+
y && K(Ar() + ei), g && G(), te(), m.length > 0 && N.markLeave(m), p.length > 0 && (N.markEnter(p, h ? "top" : "bottom"), h ? P.onItemsMutated(p.length) : F.onItemsMutated(p.length)), N.playFlipMoveAnimation(c, new Set(p.map((e) => $(e))), h ? $r : void 0), x ? (await _(), ne(x, c)) : e.active.value && s.length > 0 && re();
|
|
3051
3130
|
}, { immediate: !0 }), L([
|
|
3052
3131
|
() => e.pendingAppendItems.value.map((e) => $(e)),
|
|
3053
3132
|
h,
|
|
@@ -3064,7 +3143,7 @@ function Xr(e) {
|
|
|
3064
3143
|
}
|
|
3065
3144
|
if (i !== !1 || f.value == null) return;
|
|
3066
3145
|
await _();
|
|
3067
|
-
let o = Math.max(0, C.value - r.value), s =
|
|
3146
|
+
let o = Math.max(0, C.value - r.value), s = ni(f.value, 0, o);
|
|
3068
3147
|
a.scrollTop = s, n.value = s, P.syncBoundary(), F.syncBoundary();
|
|
3069
3148
|
}), L(() => e.loading.value, async (t) => {
|
|
3070
3149
|
!t && !e.pendingAppendItems.value.length && !z && !ee && (d.value = null), P.onLoadingChange(t), F.onLoadingChange(t), await _();
|
|
@@ -3076,16 +3155,16 @@ function Xr(e) {
|
|
|
3076
3155
|
I?.disconnect(), I = null, window.removeEventListener("resize", Y), de(), fe(), R &&= (cancelAnimationFrame(R), 0);
|
|
3077
3156
|
});
|
|
3078
3157
|
function te() {
|
|
3079
|
-
let t =
|
|
3158
|
+
let t = vr(e.items.value, {
|
|
3080
3159
|
columnCount: h.value,
|
|
3081
3160
|
columnWidth: g.value,
|
|
3082
|
-
gapX:
|
|
3083
|
-
gapY:
|
|
3084
|
-
bucketPx:
|
|
3161
|
+
gapX: Wr,
|
|
3162
|
+
gapY: Wr,
|
|
3163
|
+
bucketPx: Hr
|
|
3085
3164
|
});
|
|
3086
3165
|
o.value = t.positions.map((e) => ({
|
|
3087
|
-
x: e.x +
|
|
3088
|
-
y: e.y +
|
|
3166
|
+
x: e.x + Ur,
|
|
3167
|
+
y: e.y + Ur
|
|
3089
3168
|
})), s.value = t.heights, c.value = t.buckets, l.value = t.contentHeight, u.value = t.indexById;
|
|
3090
3169
|
}
|
|
3091
3170
|
function V() {
|
|
@@ -3110,7 +3189,7 @@ function Xr(e) {
|
|
|
3110
3189
|
let a = t.value, c = o.value[e], l = s.value[e];
|
|
3111
3190
|
if (!a || !c || !l) return;
|
|
3112
3191
|
let u = a.scrollTop, d = Math.max(0, C.value - r.value);
|
|
3113
|
-
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y -
|
|
3192
|
+
i === "center" ? u = c.y - (r.value - l) / 2 : c.y < a.scrollTop ? u = c.y - Ur : c.y + l > a.scrollTop + r.value && (u = c.y + l - r.value + Ur), a.scrollTop = ni(u, 0, d), n.value = a.scrollTop, q();
|
|
3114
3193
|
}
|
|
3115
3194
|
function ne(e, r) {
|
|
3116
3195
|
let i = t.value, a = r.get(e), s = u.value.get(e), c = s == null ? null : o.value[s];
|
|
@@ -3143,7 +3222,7 @@ function Xr(e) {
|
|
|
3143
3222
|
e.setActiveIndex(i);
|
|
3144
3223
|
}
|
|
3145
3224
|
function re() {
|
|
3146
|
-
let t = n.value <=
|
|
3225
|
+
let t = n.value <= Jr, r = oe() <= qr;
|
|
3147
3226
|
return t ? (e.setActiveIndex(0), !0) : r ? (e.setActiveIndex(Math.max(0, e.items.value.length - 1)), !0) : !1;
|
|
3148
3227
|
}
|
|
3149
3228
|
function J() {
|
|
@@ -3153,29 +3232,29 @@ function Xr(e) {
|
|
|
3153
3232
|
r.value = ie(), a.value = ae();
|
|
3154
3233
|
}
|
|
3155
3234
|
function ie() {
|
|
3156
|
-
return
|
|
3235
|
+
return Fr(t.value, r.value);
|
|
3157
3236
|
}
|
|
3158
3237
|
function ae() {
|
|
3159
|
-
return
|
|
3238
|
+
return Ir(t.value, a.value, Gr);
|
|
3160
3239
|
}
|
|
3161
3240
|
function oe() {
|
|
3162
|
-
return
|
|
3241
|
+
return Lr(t.value, n.value, r.value, C.value);
|
|
3163
3242
|
}
|
|
3164
3243
|
function se() {
|
|
3165
3244
|
let e = Math.max(t.value?.scrollHeight ?? 0, C.value);
|
|
3166
3245
|
return Math.max(0, e - r.value);
|
|
3167
3246
|
}
|
|
3168
3247
|
function ce() {
|
|
3169
|
-
return
|
|
3248
|
+
return Rr(j.value, M.value);
|
|
3170
3249
|
}
|
|
3171
3250
|
function le(e) {
|
|
3172
|
-
return e.length ?
|
|
3251
|
+
return e.length ? vr(e, {
|
|
3173
3252
|
columnCount: h.value,
|
|
3174
3253
|
columnWidth: g.value,
|
|
3175
|
-
gapX:
|
|
3176
|
-
gapY:
|
|
3177
|
-
bucketPx:
|
|
3178
|
-
}).contentHeight +
|
|
3254
|
+
gapX: Wr,
|
|
3255
|
+
gapY: Wr,
|
|
3256
|
+
bucketPx: Hr
|
|
3257
|
+
}).contentHeight + Ur * 2 : 0;
|
|
3179
3258
|
}
|
|
3180
3259
|
function X(e) {
|
|
3181
3260
|
let t = /* @__PURE__ */ new Map();
|
|
@@ -3197,7 +3276,7 @@ function Xr(e) {
|
|
|
3197
3276
|
} finally {
|
|
3198
3277
|
d.value = null, ee = !1;
|
|
3199
3278
|
}
|
|
3200
|
-
},
|
|
3279
|
+
}, Xr));
|
|
3201
3280
|
}
|
|
3202
3281
|
function de() {
|
|
3203
3282
|
z &&= (clearTimeout(z), null);
|
|
@@ -3224,27 +3303,27 @@ function Xr(e) {
|
|
|
3224
3303
|
scrollViewportRef: t
|
|
3225
3304
|
};
|
|
3226
3305
|
}
|
|
3227
|
-
function
|
|
3306
|
+
function ni(e, t, n) {
|
|
3228
3307
|
return Math.min(Math.max(e, t), n);
|
|
3229
3308
|
}
|
|
3230
|
-
function
|
|
3309
|
+
function ri(e) {
|
|
3231
3310
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3232
3311
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3233
|
-
return t <= 0 ? 1 :
|
|
3312
|
+
return t <= 0 ? 1 : ni(1 - (e.progressDistancePx - e.thresholdPx) / t, 0, 1);
|
|
3234
3313
|
}
|
|
3235
|
-
function
|
|
3314
|
+
function ii(e) {
|
|
3236
3315
|
if (!e.active || !e.triggerEnabled) return 0;
|
|
3237
3316
|
let t = Math.max(0, e.maxScrollTop - e.thresholdPx);
|
|
3238
|
-
return t <= 0 ? 1 :
|
|
3317
|
+
return t <= 0 ? 1 : ni(e.progressDistancePx / t, 0, 1);
|
|
3239
3318
|
}
|
|
3240
3319
|
//#endregion
|
|
3241
3320
|
//#region src/components/viewer-core/listCardAsset.ts
|
|
3242
|
-
function
|
|
3321
|
+
function ai(e) {
|
|
3243
3322
|
if (e) try {
|
|
3244
3323
|
e.removeAttribute("src"), e.src = "";
|
|
3245
3324
|
} catch {}
|
|
3246
3325
|
}
|
|
3247
|
-
function
|
|
3326
|
+
function oi(e) {
|
|
3248
3327
|
if (e) {
|
|
3249
3328
|
try {
|
|
3250
3329
|
e.currentTime = 0;
|
|
@@ -3255,12 +3334,12 @@ function ti(e) {
|
|
|
3255
3334
|
} catch {}
|
|
3256
3335
|
}
|
|
3257
3336
|
}
|
|
3258
|
-
function
|
|
3337
|
+
function si(e, t) {
|
|
3259
3338
|
if (t) return e.bottom > t.top && e.top < t.bottom;
|
|
3260
3339
|
let n = window.innerHeight || document.documentElement.clientHeight || 0;
|
|
3261
3340
|
return e.bottom > 0 && e.top < n;
|
|
3262
3341
|
}
|
|
3263
|
-
function
|
|
3342
|
+
function ci(e) {
|
|
3264
3343
|
if (!e) return null;
|
|
3265
3344
|
try {
|
|
3266
3345
|
return new URL(e, window.location.href).href;
|
|
@@ -3270,9 +3349,9 @@ function ri(e) {
|
|
|
3270
3349
|
}
|
|
3271
3350
|
//#endregion
|
|
3272
3351
|
//#region src/components/viewer-core/listPreview.ts
|
|
3273
|
-
var
|
|
3274
|
-
function
|
|
3275
|
-
let t =
|
|
3352
|
+
var li = /\.(avif|gif|jpe?g|png|svg|webp)(\?|#|$)/i, ui = /\.(m4v|mov|mp4|mpeg|ogg|ogv|webm)(\?|#|$)/i, di = /^(?:(?:https?:)?\/\/[^/]+)?\/api\/files\/[^/?#]+\/(?:preview|downloaded)(?:\?|#|$)/i;
|
|
3353
|
+
function fi(e) {
|
|
3354
|
+
let t = pi(e), n = t?.url, r = mr(e), i = e.title?.trim() || kt(e.type);
|
|
3276
3355
|
return t?.mediaType === "video" && typeof n == "string" ? {
|
|
3277
3356
|
kind: "video",
|
|
3278
3357
|
url: n,
|
|
@@ -3291,13 +3370,13 @@ function si(e) {
|
|
|
3291
3370
|
width: r.width,
|
|
3292
3371
|
height: r.height,
|
|
3293
3372
|
label: i
|
|
3294
|
-
} : typeof n == "string" &&
|
|
3373
|
+
} : typeof n == "string" && hi(e, n) ? {
|
|
3295
3374
|
kind: "video",
|
|
3296
3375
|
url: n,
|
|
3297
3376
|
width: r.width,
|
|
3298
3377
|
height: r.height,
|
|
3299
3378
|
label: i
|
|
3300
|
-
} : typeof n == "string" &&
|
|
3379
|
+
} : typeof n == "string" && mi(e, n) ? {
|
|
3301
3380
|
kind: "image",
|
|
3302
3381
|
url: n,
|
|
3303
3382
|
width: r.width,
|
|
@@ -3311,26 +3390,26 @@ function si(e) {
|
|
|
3311
3390
|
label: i
|
|
3312
3391
|
};
|
|
3313
3392
|
}
|
|
3314
|
-
function
|
|
3393
|
+
function pi(e) {
|
|
3315
3394
|
return e.preview?.url ? e.preview : typeof e.url != "string" || e.url.trim() === "" ? null : { url: e.url };
|
|
3316
3395
|
}
|
|
3317
|
-
function
|
|
3318
|
-
return e.type !== "image" || typeof t != "string" ? !1 :
|
|
3396
|
+
function mi(e, t) {
|
|
3397
|
+
return e.type !== "image" || typeof t != "string" ? !1 : li.test(t) || gi(t);
|
|
3319
3398
|
}
|
|
3320
|
-
function
|
|
3321
|
-
return e.type !== "video" || typeof t != "string" ? !1 :
|
|
3399
|
+
function hi(e, t) {
|
|
3400
|
+
return e.type !== "video" || typeof t != "string" ? !1 : ui.test(t) || _i(t);
|
|
3322
3401
|
}
|
|
3323
|
-
function
|
|
3402
|
+
function gi(e) {
|
|
3324
3403
|
return /^(https?:\/\/|\/\/|\/(?!\/)|\.{1,2}\/|blob:|data:)/i.test(e);
|
|
3325
3404
|
}
|
|
3326
|
-
function
|
|
3327
|
-
return
|
|
3405
|
+
function _i(e) {
|
|
3406
|
+
return di.test(e) || /^blob:/i.test(e) || /^data:video\//i.test(e);
|
|
3328
3407
|
}
|
|
3329
3408
|
//#endregion
|
|
3330
3409
|
//#region src/components/viewer-core/useListCardHealthCheck.ts
|
|
3331
|
-
function
|
|
3410
|
+
function vi(e) {
|
|
3332
3411
|
let t = D(null), n = i(() => {
|
|
3333
|
-
let t = typeof e.item.value.healthCheck?.url == "string" ?
|
|
3412
|
+
let t = typeof e.item.value.healthCheck?.url == "string" ? ci(e.item.value.healthCheck.url) : null;
|
|
3334
3413
|
return !t || t === e.attachedAssetUrl.value ? null : t;
|
|
3335
3414
|
}), r = null, a = 0, o = /* @__PURE__ */ new Map();
|
|
3336
3415
|
L(n, (e, n) => {
|
|
@@ -3362,7 +3441,7 @@ function pi(e) {
|
|
|
3362
3441
|
r.refresh();
|
|
3363
3442
|
return;
|
|
3364
3443
|
}
|
|
3365
|
-
r =
|
|
3444
|
+
r = Mt.request({
|
|
3366
3445
|
assetType: "probe",
|
|
3367
3446
|
getPriority: e.getPriority,
|
|
3368
3447
|
onGrant() {
|
|
@@ -3372,7 +3451,7 @@ function pi(e) {
|
|
|
3372
3451
|
return;
|
|
3373
3452
|
}
|
|
3374
3453
|
let i = ++a;
|
|
3375
|
-
|
|
3454
|
+
ln(r).then((s) => {
|
|
3376
3455
|
if (!(i !== a || n.value !== r)) {
|
|
3377
3456
|
if (o.set(r, s ?? null), !s) {
|
|
3378
3457
|
t.value = null;
|
|
@@ -3408,14 +3487,14 @@ function pi(e) {
|
|
|
3408
3487
|
}
|
|
3409
3488
|
//#endregion
|
|
3410
3489
|
//#region src/components/ListCard.vue?vue&type=script&setup=true&lang.ts
|
|
3411
|
-
var
|
|
3490
|
+
var yi = ["aria-label"], bi = {
|
|
3412
3491
|
key: 0,
|
|
3413
3492
|
"data-testid": "vibe-list-card-spinner",
|
|
3414
3493
|
class: "pointer-events-none absolute inset-0 z-[4] grid place-items-center bg-black/18"
|
|
3415
|
-
},
|
|
3494
|
+
}, xi = { 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]" }, Si = ["src", "alt"], Ci = ["src"], wi = ["data-kind"], Ti = { class: "grid justify-items-center gap-3 px-4 text-center" }, Ei = { class: "text-[0.68rem] font-bold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, Di = {
|
|
3416
3495
|
key: 4,
|
|
3417
3496
|
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))]"
|
|
3418
|
-
},
|
|
3497
|
+
}, Oi = { class: "inline-flex h-14 w-14 items-center justify-center border border-white/16 bg-black/20" }, ki = { class: "pointer-events-none absolute inset-0 z-[3]" }, Ai = /* @__PURE__ */ d({
|
|
3419
3498
|
__name: "ListCard",
|
|
3420
3499
|
props: {
|
|
3421
3500
|
active: {
|
|
@@ -3439,7 +3518,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3439
3518
|
},
|
|
3440
3519
|
emits: ["open"],
|
|
3441
3520
|
setup(e, { emit: t }) {
|
|
3442
|
-
let n = e, r = t, l = i(() =>
|
|
3521
|
+
let n = e, r = t, l = i(() => fi(n.item)), d = D(!1), f = D(!1), p = D(!1), m = D(l.value.kind === "fallback"), h = D(!1), g = D(null), _ = D(null), y = D(null), b = D(null), C = D(null), T = D(l.value.kind === "fallback"), E = i(() => T.value ? n.surfaceActive ? d.value ? l.value.url : null : l.value.url : null), O = i(() => n.surfaceActive && d.value && (l.value.kind === "image" || l.value.kind === "video") && !!l.value.url), M = i(() => l.value.kind === "image" && !!E.value), P = i(() => l.value.kind === "video" && !!E.value), F = vi({
|
|
3443
3522
|
attachedAssetUrl: E,
|
|
3444
3523
|
getPriority: X,
|
|
3445
3524
|
isInView: d,
|
|
@@ -3448,7 +3527,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3448
3527
|
loadErrorKind: g,
|
|
3449
3528
|
reportAssetError: n.reportAssetError,
|
|
3450
3529
|
surfaceActive: i(() => n.surfaceActive)
|
|
3451
|
-
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() =>
|
|
3530
|
+
}), I = i(() => F.errorKind.value ?? g.value), R = i(() => !!I.value), z = i(() => sn(I.value)), B = i(() => O.value && !g.value && (!T.value || !m.value)), te = null, V = null, H = /* @__PURE__ */ new Set();
|
|
3452
3531
|
L([E, () => l.value.kind], () => {
|
|
3453
3532
|
let e = l.value.kind === "fallback";
|
|
3454
3533
|
m.value = e, h.value = !1, g.value = null, e && (T.value = !0);
|
|
@@ -3489,7 +3568,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3489
3568
|
if (!ue(_.value)) return;
|
|
3490
3569
|
let e = E.value ?? n.item.url;
|
|
3491
3570
|
m.value = !1, g.value = "generic";
|
|
3492
|
-
let t = await
|
|
3571
|
+
let t = await cn(e);
|
|
3493
3572
|
g.value = t, n.reportAssetError?.({
|
|
3494
3573
|
item: n.item,
|
|
3495
3574
|
occurrenceKey: $(n.item),
|
|
@@ -3521,7 +3600,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3521
3600
|
V?.refresh();
|
|
3522
3601
|
return;
|
|
3523
3602
|
}
|
|
3524
|
-
V =
|
|
3603
|
+
V = Mt.request({
|
|
3525
3604
|
assetType: l.value.kind,
|
|
3526
3605
|
getPriority: X,
|
|
3527
3606
|
onGrant() {
|
|
@@ -3538,7 +3617,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3538
3617
|
return;
|
|
3539
3618
|
}
|
|
3540
3619
|
if (E.value && d.value && m.value) {
|
|
3541
|
-
e.muted = !0, e.loop = !0, e.playsInline = !0,
|
|
3620
|
+
e.muted = !0, e.loop = !0, e.playsInline = !0, fn(e);
|
|
3542
3621
|
return;
|
|
3543
3622
|
}
|
|
3544
3623
|
try {
|
|
@@ -3559,7 +3638,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3559
3638
|
d.value = !0;
|
|
3560
3639
|
return;
|
|
3561
3640
|
}
|
|
3562
|
-
d.value =
|
|
3641
|
+
d.value = si(e?.boundingClientRect ?? t.getBoundingClientRect(), e?.rootBounds ?? b.value?.getBoundingClientRect() ?? null);
|
|
3563
3642
|
}
|
|
3564
3643
|
function ie(e) {
|
|
3565
3644
|
if (!e) return;
|
|
@@ -3579,10 +3658,10 @@ var mi = ["aria-label"], hi = {
|
|
|
3579
3658
|
}), g.value = null, m.value = !1, T.value = !1, J(), K();
|
|
3580
3659
|
}
|
|
3581
3660
|
function se() {
|
|
3582
|
-
|
|
3661
|
+
ai(_.value);
|
|
3583
3662
|
}
|
|
3584
3663
|
function ce() {
|
|
3585
|
-
|
|
3664
|
+
oi(C.value);
|
|
3586
3665
|
}
|
|
3587
3666
|
function X() {
|
|
3588
3667
|
let e = y.value;
|
|
@@ -3596,8 +3675,8 @@ var mi = ["aria-label"], hi = {
|
|
|
3596
3675
|
return Math.abs((t.top + t.bottom) / 2 - n);
|
|
3597
3676
|
}
|
|
3598
3677
|
function ue(e) {
|
|
3599
|
-
let t =
|
|
3600
|
-
return !e || !t ? !1 :
|
|
3678
|
+
let t = ci(E.value);
|
|
3679
|
+
return !e || !t ? !1 : ci("currentSrc" in e && e.currentSrc || e.getAttribute("src")) === t;
|
|
3601
3680
|
}
|
|
3602
3681
|
function de() {
|
|
3603
3682
|
r("open");
|
|
@@ -3625,8 +3704,8 @@ var mi = ["aria-label"], hi = {
|
|
|
3625
3704
|
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]",
|
|
3626
3705
|
"aria-label": n.item.title || `Open item ${n.index + 1}`,
|
|
3627
3706
|
onClick: de
|
|
3628
|
-
}, null, 8,
|
|
3629
|
-
B.value ? (w(), s("div",
|
|
3707
|
+
}, null, 8, yi),
|
|
3708
|
+
B.value ? (w(), s("div", bi, [c("span", xi, [u(N(oe), {
|
|
3630
3709
|
class: "h-5 w-5 animate-spin stroke-[1.9] text-[#f7f1ea]/78",
|
|
3631
3710
|
"aria-hidden": "true"
|
|
3632
3711
|
})])])) : o("", !0),
|
|
@@ -3640,7 +3719,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3640
3719
|
class: v(["block h-full w-full object-cover transition-opacity duration-300", m.value ? "pointer-events-none opacity-100" : "pointer-events-none opacity-0"]),
|
|
3641
3720
|
onLoad: U,
|
|
3642
3721
|
onError: W
|
|
3643
|
-
}, null, 42,
|
|
3722
|
+
}, null, 42, Si)) : P.value && E.value && !R.value ? (w(), s("video", {
|
|
3644
3723
|
key: 2,
|
|
3645
3724
|
ref_key: "videoRef",
|
|
3646
3725
|
ref: C,
|
|
@@ -3656,31 +3735,31 @@ var mi = ["aria-label"], hi = {
|
|
|
3656
3735
|
onPlaying: ne,
|
|
3657
3736
|
onStalled: G,
|
|
3658
3737
|
onWaiting: G
|
|
3659
|
-
}, null, 42,
|
|
3738
|
+
}, null, 42, Ci)) : R.value ? (w(), s("div", {
|
|
3660
3739
|
key: 3,
|
|
3661
3740
|
"data-testid": "vibe-list-card-error",
|
|
3662
3741
|
"data-kind": I.value,
|
|
3663
3742
|
class: "pointer-events-none 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))]"
|
|
3664
|
-
}, [c("div",
|
|
3743
|
+
}, [c("div", Ti, [
|
|
3665
3744
|
u(N(le), {
|
|
3666
3745
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3667
3746
|
"aria-hidden": "true"
|
|
3668
3747
|
}),
|
|
3669
|
-
c("span",
|
|
3748
|
+
c("span", Ei, j(N(on)(I.value)), 1),
|
|
3670
3749
|
z.value ? (w(), s("button", {
|
|
3671
3750
|
key: 0,
|
|
3672
3751
|
type: "button",
|
|
3673
3752
|
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",
|
|
3674
3753
|
onClick: ee(ae, ["stop"])
|
|
3675
3754
|
}, " Retry ")) : o("", !0)
|
|
3676
|
-
])], 8,
|
|
3677
|
-
icon: N(
|
|
3755
|
+
])], 8, wi)) : (w(), s("div", Di, [c("div", Oi, [k(e.$slots, "item-icon", {
|
|
3756
|
+
icon: N(Ot)(n.item.type),
|
|
3678
3757
|
item: n.item
|
|
3679
|
-
}, () => [(w(), a(A(N(
|
|
3758
|
+
}, () => [(w(), a(A(N(Ot)(n.item.type)), {
|
|
3680
3759
|
class: "h-6 w-6 stroke-[1.8] text-[#f7f1ea]/78",
|
|
3681
3760
|
"aria-hidden": "true"
|
|
3682
3761
|
}))])])])),
|
|
3683
|
-
c("div",
|
|
3762
|
+
c("div", ki, [k(e.$slots, "grid-item-overlay", {
|
|
3684
3763
|
active: n.active,
|
|
3685
3764
|
focused: f.value,
|
|
3686
3765
|
hovered: p.value,
|
|
@@ -3690,24 +3769,24 @@ var mi = ["aria-label"], hi = {
|
|
|
3690
3769
|
})])
|
|
3691
3770
|
], 34));
|
|
3692
3771
|
}
|
|
3693
|
-
}),
|
|
3772
|
+
}), ji = { 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)]" }, Mi = { class: "pointer-events-none absolute inset-x-0 top-0 z-[2] flex justify-end p-6" }, Ni = {
|
|
3694
3773
|
"data-testid": "vibe-pagination",
|
|
3695
3774
|
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]"
|
|
3696
|
-
},
|
|
3775
|
+
}, Pi = { class: "whitespace-nowrap" }, Fi = {
|
|
3697
3776
|
key: 0,
|
|
3698
3777
|
class: "whitespace-nowrap border-l border-white/12 pl-2 text-[#f7f1ea]/56 min-[721px]:pl-3"
|
|
3699
|
-
},
|
|
3778
|
+
}, Ii = [
|
|
3700
3779
|
"data-active",
|
|
3701
3780
|
"data-index",
|
|
3702
3781
|
"data-item-id",
|
|
3703
3782
|
"data-occurrence-key"
|
|
3704
|
-
],
|
|
3783
|
+
], Li = ["data-item-id"], Ri = {
|
|
3705
3784
|
key: 0,
|
|
3706
3785
|
class: "pointer-events-none absolute inset-y-0 right-0 z-[3] hidden w-8 min-[1024px]:block"
|
|
3707
|
-
},
|
|
3786
|
+
}, zi = {
|
|
3708
3787
|
key: 1,
|
|
3709
3788
|
class: "pointer-events-none absolute inset-x-0 bottom-0 z-[2] px-5 pb-5 sm:px-6"
|
|
3710
|
-
},
|
|
3789
|
+
}, Bi = { class: "mx-auto flex w-full justify-center" }, Vi = /* @__PURE__ */ d({
|
|
3711
3790
|
__name: "ListSurface",
|
|
3712
3791
|
props: {
|
|
3713
3792
|
active: {
|
|
@@ -3768,7 +3847,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3768
3847
|
"update:activeIndex"
|
|
3769
3848
|
],
|
|
3770
3849
|
setup(e, { emit: n }) {
|
|
3771
|
-
let r = e, d = F(), f = n, p =
|
|
3850
|
+
let r = e, d = F(), f = n, p = ti({
|
|
3772
3851
|
active: M(r, "active"),
|
|
3773
3852
|
allowExhaustedNextPageRefresh: M(r, "allowExhaustedNextPageRefresh"),
|
|
3774
3853
|
items: M(r, "items"),
|
|
@@ -3784,11 +3863,11 @@ var mi = ["aria-label"], hi = {
|
|
|
3784
3863
|
setActiveIndex(e) {
|
|
3785
3864
|
f("update:activeIndex", e);
|
|
3786
3865
|
}
|
|
3787
|
-
}), m = i(() =>
|
|
3866
|
+
}), m = i(() => Xt({
|
|
3788
3867
|
itemCount: r.items.length,
|
|
3789
3868
|
loading: r.loading,
|
|
3790
3869
|
phase: r.phase
|
|
3791
|
-
})), h = i(() =>
|
|
3870
|
+
})), h = i(() => Zt({
|
|
3792
3871
|
errorMessage: r.errorMessage,
|
|
3793
3872
|
hasItems: r.items.length > 0,
|
|
3794
3873
|
hasNextPage: r.hasNextPage,
|
|
@@ -3801,7 +3880,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3801
3880
|
message: h.value.message,
|
|
3802
3881
|
paginationDetail: r.paginationDetail,
|
|
3803
3882
|
total: r.items.length
|
|
3804
|
-
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() =>
|
|
3883
|
+
}), x = i(() => !_.value || !d["grid-status"] ? [] : d["grid-status"](_.value)), S = i(() => Gt(x.value)), C = i(() => r.items.length + p.leavingItems.value.length), { emptyStateProps: T, showBadgeEmptyState: E, showCustomEmptyState: D, showInlineEmptyState: A } = Jt({
|
|
3805
3884
|
emptyStateMode: M(r, "emptyStateMode"),
|
|
3806
3885
|
itemCount: C,
|
|
3807
3886
|
loading: M(r, "loading"),
|
|
@@ -3813,8 +3892,8 @@ var mi = ["aria-label"], hi = {
|
|
|
3813
3892
|
nextBoundaryLoadProgress: e,
|
|
3814
3893
|
previousBoundaryLoadProgress: t
|
|
3815
3894
|
});
|
|
3816
|
-
}, { immediate: !0 }), (e, n) => (w(), s("div",
|
|
3817
|
-
c("div",
|
|
3895
|
+
}, { immediate: !0 }), (e, n) => (w(), s("div", ji, [
|
|
3896
|
+
c("div", Mi, [c("span", Ni, [c("span", Pi, j(N(p).paginationLabel.value), 1), r.paginationDetail ? (w(), s("span", Fi, j(r.paginationDetail), 1)) : o("", !0)])]),
|
|
3818
3897
|
c("div", {
|
|
3819
3898
|
ref: N(p).scrollViewportRef,
|
|
3820
3899
|
"data-testid": "vibe-list-scroll",
|
|
@@ -3835,7 +3914,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3835
3914
|
"data-occurrence-key": N($)(t),
|
|
3836
3915
|
class: "absolute will-change-transform",
|
|
3837
3916
|
style: b(N(p).getCardStyle(n))
|
|
3838
|
-
}, [u(
|
|
3917
|
+
}, [u(Ai, {
|
|
3839
3918
|
active: n === N(p).resolvedActiveIndex.value,
|
|
3840
3919
|
index: n,
|
|
3841
3920
|
item: t,
|
|
@@ -3859,14 +3938,14 @@ var mi = ["aria-label"], hi = {
|
|
|
3859
3938
|
"report-asset-load",
|
|
3860
3939
|
"surface-active",
|
|
3861
3940
|
"onOpen"
|
|
3862
|
-
])], 12,
|
|
3941
|
+
])], 12, Ii))), 128)),
|
|
3863
3942
|
(w(!0), s(t, null, O(N(p).leavingItems.value, (t) => (w(), s("article", {
|
|
3864
3943
|
key: `leaving-${N($)(t.item)}`,
|
|
3865
3944
|
"data-testid": "vibe-list-card-leaving",
|
|
3866
3945
|
"data-item-id": t.item.id,
|
|
3867
3946
|
class: "pointer-events-none absolute z-[2] will-change-[opacity,transform]",
|
|
3868
3947
|
style: b(N(p).getLeavingCardStyle(t.item))
|
|
3869
|
-
}, [u(
|
|
3948
|
+
}, [u(Ai, {
|
|
3870
3949
|
active: !1,
|
|
3871
3950
|
index: -1,
|
|
3872
3951
|
item: t.item,
|
|
@@ -3881,8 +3960,8 @@ var mi = ["aria-label"], hi = {
|
|
|
3881
3960
|
"item",
|
|
3882
3961
|
"report-asset-error",
|
|
3883
3962
|
"report-asset-load"
|
|
3884
|
-
])], 12,
|
|
3885
|
-
N(A) && N(T) ? (w(), a(
|
|
3963
|
+
])], 12, Li))), 128)),
|
|
3964
|
+
N(A) && N(T) ? (w(), a(kn, {
|
|
3886
3965
|
key: 0,
|
|
3887
3966
|
message: N(T).message,
|
|
3888
3967
|
mode: N(T).mode,
|
|
@@ -3896,12 +3975,12 @@ var mi = ["aria-label"], hi = {
|
|
|
3896
3975
|
"surface"
|
|
3897
3976
|
])) : o("", !0)
|
|
3898
3977
|
], 4)], 544),
|
|
3899
|
-
N(p).showScrollbar.value ? (w(), s("div",
|
|
3978
|
+
N(p).showScrollbar.value ? (w(), s("div", Ri, [n[2] ||= c("div", { class: "absolute bottom-6 right-3 top-6 w-px bg-white/8" }, null, -1), c("div", {
|
|
3900
3979
|
"data-testid": "vibe-list-scrollbar-thumb",
|
|
3901
3980
|
class: v(["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"]),
|
|
3902
3981
|
style: b(N(p).getScrollbarThumbStyle())
|
|
3903
3982
|
}, null, 6)])) : o("", !0),
|
|
3904
|
-
d["grid-footer"] ? (w(), s("div",
|
|
3983
|
+
d["grid-footer"] ? (w(), s("div", zi, [c("div", Bi, [k(e.$slots, "grid-footer")])])) : o("", !0),
|
|
3905
3984
|
_.value ? (w(), s("div", {
|
|
3906
3985
|
key: 2,
|
|
3907
3986
|
class: v(["pointer-events-none absolute inset-x-0 bottom-0 z-[3] flex justify-center px-6", d["grid-footer"] ? "pb-24" : "pb-6"])
|
|
@@ -3910,7 +3989,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3910
3989
|
"data-testid": "vibe-grid-status-badge",
|
|
3911
3990
|
class: v(["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]", _.value.kind === "end" ? "border-amber-300/35 text-amber-200" : _.value.kind === "failed" ? "border-rose-400/45 text-rose-100" : ""])
|
|
3912
3991
|
}, j(_.value.message), 3))], 2)) : o("", !0),
|
|
3913
|
-
N(E) && N(T) ? (w(), a(
|
|
3992
|
+
N(E) && N(T) ? (w(), a(kn, {
|
|
3914
3993
|
key: 3,
|
|
3915
3994
|
class: v(["z-[3]", d["grid-footer"] ? "pb-24" : "pb-6"]),
|
|
3916
3995
|
message: N(T).message,
|
|
@@ -3927,13 +4006,13 @@ var mi = ["aria-label"], hi = {
|
|
|
3927
4006
|
])) : o("", !0)
|
|
3928
4007
|
]));
|
|
3929
4008
|
}
|
|
3930
|
-
}),
|
|
4009
|
+
}), Hi = ["data-surface-mode"], Ui = {
|
|
3931
4010
|
key: 1,
|
|
3932
4011
|
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"
|
|
3933
|
-
},
|
|
4012
|
+
}, Wi = ["data-visible", "inert"], Gi = ["data-visible", "inert"], Ki = {
|
|
3934
4013
|
key: 3,
|
|
3935
4014
|
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"
|
|
3936
|
-
},
|
|
4015
|
+
}, qi = /* @__PURE__ */ d({
|
|
3937
4016
|
name: "VibeLayout",
|
|
3938
4017
|
__name: "Layout",
|
|
3939
4018
|
props: {
|
|
@@ -3958,7 +4037,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3958
4037
|
"update:surfaceMode"
|
|
3959
4038
|
],
|
|
3960
4039
|
setup(e, { expose: n, emit: i }) {
|
|
3961
|
-
let d = e, f = F(), m = i, h =
|
|
4040
|
+
let d = e, f = F(), m = i, h = Qe(d, m), g = fe((e) => {
|
|
3962
4041
|
m("asset-errors", e);
|
|
3963
4042
|
}), _ = Z((e) => {
|
|
3964
4043
|
m("asset-loads", e);
|
|
@@ -3987,7 +4066,7 @@ var mi = ["aria-label"], hi = {
|
|
|
3987
4066
|
type: "button",
|
|
3988
4067
|
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",
|
|
3989
4068
|
onClick: n[0] ||= (...e) => N(h).retryInitialLoad && N(h).retryInitialLoad(...e)
|
|
3990
|
-
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div",
|
|
4069
|
+
}, " Retry ")) : N(h).errorMessage.value && N(h).items.value.length > 0 ? (w(), s("div", Ui, j(N(h).errorMessage.value), 1)) : o("", !0), N(h).isDesktop.value ? (w(), s(t, { key: 2 }, [u(r, {
|
|
3991
4070
|
appear: "",
|
|
3992
4071
|
"enter-active-class": "transition-[opacity,transform] duration-300 ease-out",
|
|
3993
4072
|
"enter-from-class": "translate-y-3 opacity-0",
|
|
@@ -4001,7 +4080,7 @@ var mi = ["aria-label"], hi = {
|
|
|
4001
4080
|
"data-visible": N(h).surfaceMode.value === "list" ? "true" : "false",
|
|
4002
4081
|
inert: N(h).surfaceMode.value !== "list",
|
|
4003
4082
|
class: "absolute inset-0 z-[2]"
|
|
4004
|
-
}, [u(
|
|
4083
|
+
}, [u(Vi, {
|
|
4005
4084
|
active: N(h).surfaceMode.value === "list",
|
|
4006
4085
|
"allow-exhausted-next-page-refresh": N(h).canRefreshExhaustedNextPage.value,
|
|
4007
4086
|
items: N(h).items.value,
|
|
@@ -4071,7 +4150,7 @@ var mi = ["aria-label"], hi = {
|
|
|
4071
4150
|
"onBoundaryLoadProgress",
|
|
4072
4151
|
"onOpenFullscreen",
|
|
4073
4152
|
"onUpdate:activeIndex"
|
|
4074
|
-
])], 8,
|
|
4153
|
+
])], 8, Wi), [[I, N(h).surfaceMode.value === "list"]])]),
|
|
4075
4154
|
_: 3
|
|
4076
4155
|
}), u(r, {
|
|
4077
4156
|
appear: "",
|
|
@@ -4087,7 +4166,7 @@ var mi = ["aria-label"], hi = {
|
|
|
4087
4166
|
"data-visible": N(h).surfaceMode.value === "fullscreen" ? "true" : "false",
|
|
4088
4167
|
inert: N(h).surfaceMode.value !== "fullscreen",
|
|
4089
4168
|
class: "absolute inset-0 z-[3]"
|
|
4090
|
-
}, [u(
|
|
4169
|
+
}, [u(dr, {
|
|
4091
4170
|
items: N(h).items.value,
|
|
4092
4171
|
active: N(h).surfaceMode.value === "fullscreen",
|
|
4093
4172
|
"active-index": N(h).activeIndex.value,
|
|
@@ -4156,12 +4235,12 @@ var mi = ["aria-label"], hi = {
|
|
|
4156
4235
|
"show-back-to-list",
|
|
4157
4236
|
"onBackToList",
|
|
4158
4237
|
"onUpdate:activeIndex"
|
|
4159
|
-
])], 8,
|
|
4238
|
+
])], 8, Gi), [[I, N(h).surfaceMode.value === "fullscreen"]])]),
|
|
4160
4239
|
_: 3
|
|
4161
|
-
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div",
|
|
4240
|
+
})], 64)) : N(h).items.value.length === 0 && N(h).loading.value ? (w(), s("div", Ki, [u(N(oe), {
|
|
4162
4241
|
class: "size-10 animate-spin text-[#f7f1ea]/82",
|
|
4163
4242
|
"aria-hidden": "true"
|
|
4164
|
-
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(
|
|
4243
|
+
}), n[1] ||= c("p", { class: "m-0 text-[0.9rem] font-semibold uppercase tracking-[0.22em] text-[#f7f1ea]/72" }, " Loading... ", -1)])) : (w(), a(dr, {
|
|
4165
4244
|
key: 4,
|
|
4166
4245
|
items: N(h).items.value,
|
|
4167
4246
|
active: !0,
|
|
@@ -4229,10 +4308,10 @@ var mi = ["aria-label"], hi = {
|
|
|
4229
4308
|
"show-status-badges",
|
|
4230
4309
|
"onBackToList",
|
|
4231
4310
|
"onUpdate:activeIndex"
|
|
4232
|
-
]))], 8,
|
|
4311
|
+
]))], 8, Hi));
|
|
4233
4312
|
}
|
|
4234
|
-
}),
|
|
4235
|
-
e.component("VibeLayout",
|
|
4313
|
+
}), Ji = { install(e) {
|
|
4314
|
+
e.component("VibeLayout", qi);
|
|
4236
4315
|
} };
|
|
4237
4316
|
//#endregion
|
|
4238
|
-
export {
|
|
4317
|
+
export { qi as VibeLayout, Ji as VibePlugin, Ji as default };
|