@wyxos/vibe 5.17.1 → 5.17.2
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/components/ReelEntrySpinner.vue.d.ts +3 -0
- package/lib/components/useReelEntryReveal.d.ts +10 -0
- package/lib/core/feed.d.ts +1 -0
- package/lib/core/mediaPreview.d.ts +2 -2
- package/lib/index.cjs +2 -2
- package/lib/index.js +746 -681
- package/lib/style.css +1 -1
- package/package.json +11 -14
- package/README.md +0 -845
package/lib/index.js
CHANGED
|
@@ -28,7 +28,7 @@ function R(e) {
|
|
|
28
28
|
width: e.width
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function ee(e, t) {
|
|
32
32
|
if (t === "preview" && e.preview) {
|
|
33
33
|
let t = I(e.type, e.src) === "audio" ? I(e.preview.type, e.preview.src) : e.preview.type ?? e.type;
|
|
34
34
|
return {
|
|
@@ -41,43 +41,43 @@ function z(e, t) {
|
|
|
41
41
|
type: e.mobile.type ?? e.type
|
|
42
42
|
} : R(e);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function z(e) {
|
|
45
45
|
let t = e.preview;
|
|
46
46
|
return !t?.src || t.src === e.src || I(t.type, t.src) !== "image" ? null : {
|
|
47
47
|
...t,
|
|
48
48
|
type: "image"
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function te(e, t) {
|
|
52
52
|
return I(e.type, e.src) === "audio" ? t === "mobile" && e.mobile && I(e.mobile.type, e.mobile.src) === "audio" ? {
|
|
53
53
|
...e.mobile,
|
|
54
54
|
type: "audio"
|
|
55
55
|
} : {
|
|
56
56
|
...R(e),
|
|
57
57
|
type: "audio"
|
|
58
|
-
} :
|
|
58
|
+
} : ee(e, t);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function B(e) {
|
|
61
61
|
return [e, ...e.items];
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function V(e, t) {
|
|
64
64
|
return Math.min(e.items.length, Math.max(0, t));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function H(e, t) {
|
|
67
|
+
return B(e)[V(e, t)] ?? e;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function U(e, t) {
|
|
70
70
|
return `${String(e)}:${t}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/core/runtime.ts
|
|
74
|
-
function
|
|
74
|
+
function W(e) {
|
|
75
75
|
return r(() => Object.freeze([...e.items]));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return n(
|
|
77
|
+
function G(e, t, n) {
|
|
78
|
+
return n(ne(e, t.value)), O(() => ne(e, t.value), n, { flush: "post" });
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ne(e, t = [...e.items]) {
|
|
81
81
|
return {
|
|
82
82
|
activeReelPostId: e.activeReelPostId,
|
|
83
83
|
autoScroll: { ...e.autoScroll },
|
|
@@ -107,17 +107,17 @@ function te(e, t = [...e.items]) {
|
|
|
107
107
|
}
|
|
108
108
|
//#endregion
|
|
109
109
|
//#region src/components/GalleryFooter.vue?vue&type=script&setup=true&lang.ts
|
|
110
|
-
var
|
|
110
|
+
var K = {
|
|
111
111
|
key: 0,
|
|
112
112
|
class: "gallery-footer"
|
|
113
|
-
},
|
|
113
|
+
}, q = {
|
|
114
114
|
key: 0,
|
|
115
115
|
class: "load-more-status",
|
|
116
116
|
role: "status"
|
|
117
|
-
},
|
|
117
|
+
}, re = ["disabled"], ie = {
|
|
118
118
|
key: 2,
|
|
119
119
|
class: "end-feed"
|
|
120
|
-
},
|
|
120
|
+
}, ae = ["disabled"], J = /* @__PURE__ */ d({
|
|
121
121
|
__name: "GalleryFooter",
|
|
122
122
|
props: {
|
|
123
123
|
canRetryEnd: { type: Boolean },
|
|
@@ -133,14 +133,14 @@ var q = {
|
|
|
133
133
|
function i() {
|
|
134
134
|
n.loadMoreLocked || (n.hasNext ? r("loadMore") : r("retryEnd"));
|
|
135
135
|
}
|
|
136
|
-
return (t, n) => e.isLoading || e.hasError || e.hasNext && e.showLoadMore || !e.hasNext && e.canRetryEnd ? (b(), s("footer",
|
|
136
|
+
return (t, n) => e.isLoading || e.hasError || e.hasNext && e.showLoadMore || !e.hasNext && e.canRetryEnd ? (b(), s("footer", K, [e.isLoading ? (b(), s("p", q, " Loading more… ")) : e.hasError || e.hasNext && e.showLoadMore ? (b(), s("button", {
|
|
137
137
|
key: 1,
|
|
138
138
|
"data-test": "load-more",
|
|
139
139
|
class: "load-more-button",
|
|
140
140
|
type: "button",
|
|
141
141
|
disabled: e.loadMoreLocked,
|
|
142
142
|
onClick: i
|
|
143
|
-
}, T(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9,
|
|
143
|
+
}, T(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9, re)) : (b(), s("div", ie, [n[1] ||= c("p", {
|
|
144
144
|
class: "end-feed-message",
|
|
145
145
|
role: "status"
|
|
146
146
|
}, " You've reached the end. ", -1), c("button", {
|
|
@@ -149,7 +149,7 @@ var q = {
|
|
|
149
149
|
type: "button",
|
|
150
150
|
disabled: e.loadMoreLocked,
|
|
151
151
|
onClick: n[0] ||= (e) => t.$emit("retryEnd")
|
|
152
|
-
}, " Check for more ", 8,
|
|
152
|
+
}, " Check for more ", 8, ae)]))])) : o("", !0);
|
|
153
153
|
}
|
|
154
154
|
}), oe = /* @__PURE__ */ d({
|
|
155
155
|
__name: "FeedFooter",
|
|
@@ -188,7 +188,7 @@ var q = {
|
|
|
188
188
|
"can-retry-end",
|
|
189
189
|
"show-load-more",
|
|
190
190
|
"state"
|
|
191
|
-
])) : (b(), a(
|
|
191
|
+
])) : (b(), a(J, {
|
|
192
192
|
key: 1,
|
|
193
193
|
"can-retry-end": e.canRetryEnd,
|
|
194
194
|
"has-error": e.hasError,
|
|
@@ -246,22 +246,22 @@ var q = {
|
|
|
246
246
|
])) : o("", !0)], 8, se));
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
|
-
function
|
|
249
|
+
function ue(e, t = 240) {
|
|
250
250
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= t;
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region src/core/masonry.ts
|
|
254
|
-
function
|
|
254
|
+
function Y(e) {
|
|
255
255
|
let t = e.preview?.width ?? e.width, n = e.preview?.height ?? e.height;
|
|
256
256
|
return !t || !n || t <= 0 || n <= 0 ? 1 : n / t;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function X(e) {
|
|
259
259
|
return e.reduce((t, n, r) => n < e[t] ? r : t, 0);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function de(e) {
|
|
262
262
|
return Math.max(0, e.containerHeight) + Math.max(0, e.gap);
|
|
263
263
|
}
|
|
264
|
-
var
|
|
264
|
+
var Z = .8, fe = .5;
|
|
265
265
|
function pe(e, t, n) {
|
|
266
266
|
let r = Math.max(0, n.viewportHeight);
|
|
267
267
|
if (r === 0) return [];
|
|
@@ -269,7 +269,7 @@ function pe(e, t, n) {
|
|
|
269
269
|
return t.filter((t) => {
|
|
270
270
|
let n = e[t];
|
|
271
271
|
if (!n || n.height <= 0) return !1;
|
|
272
|
-
let o = Math.max(0, Math.min(n.y + n.height, a) - Math.max(n.y, i)), s = n.height <= r ? n.height : r *
|
|
272
|
+
let o = Math.max(0, Math.min(n.y + n.height, a) - Math.max(n.y, i)), s = n.height <= r ? n.height : r * Z;
|
|
273
273
|
return o + fe >= s;
|
|
274
274
|
});
|
|
275
275
|
}
|
|
@@ -284,7 +284,7 @@ function Q(e, t) {
|
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
function me(e, t, n) {
|
|
287
|
-
let r =
|
|
287
|
+
let r = X(t), i = n.itemWidth * Y(e) + n.additionalHeight, a = {
|
|
288
288
|
x: r * (n.itemWidth + n.gap),
|
|
289
289
|
y: t[r],
|
|
290
290
|
width: n.itemWidth,
|
|
@@ -597,12 +597,12 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
597
597
|
function R(e) {
|
|
598
598
|
!o.value || e.pointerId !== d || (e.currentTarget.releasePointerCapture?.(e.pointerId), d = null, o.value = !1, C && (C = !1, M("content")), k());
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function ee(e) {
|
|
601
601
|
if (!E.value) return;
|
|
602
602
|
let n = t.scrollElement?.clientHeight ?? 0, r = t.scrollElement?.scrollTop ?? 0, i = e.key === "ArrowUp" ? r - Fe : e.key === "ArrowDown" ? r + Fe : e.key === "PageUp" ? r - n : e.key === "PageDown" ? r + n : e.key === "Home" ? 0 : e.key === "End" ? a.value.maximumScrollPosition : null;
|
|
603
603
|
i !== null && (e.preventDefault(), A(), P(i));
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function z(e) {
|
|
606
606
|
if (S?.disconnect(), !(typeof ResizeObserver > "u")) {
|
|
607
607
|
S = new ResizeObserver(() => M("content"));
|
|
608
608
|
for (let t of e.children) S.observe(t);
|
|
@@ -611,8 +611,8 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
611
611
|
return O(() => t.scrollElement, (e, t) => {
|
|
612
612
|
t?.removeEventListener("scroll", N), x?.disconnect(), x = null, S?.disconnect(), S = null, T?.disconnect(), T = null, e?.addEventListener("scroll", N, { passive: !0 }), e && typeof ResizeObserver < "u" && (T = new ResizeObserver(() => {
|
|
613
613
|
A(), M("resize");
|
|
614
|
-
}), T.observe(e),
|
|
615
|
-
|
|
614
|
+
}), T.observe(e), z(e)), e && typeof MutationObserver < "u" && (x = new MutationObserver(() => {
|
|
615
|
+
z(e), M("content");
|
|
616
616
|
}), x.observe(e, { childList: !0 })), m(() => M("resize"));
|
|
617
617
|
}, { immediate: !0 }), O(() => t.contentSize, () => {
|
|
618
618
|
m(() => M("content"));
|
|
@@ -640,7 +640,7 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
640
640
|
role: "scrollbar",
|
|
641
641
|
style: _(D.value),
|
|
642
642
|
tabindex: E.value ? 0 : -1,
|
|
643
|
-
onKeydown:
|
|
643
|
+
onKeydown: ee,
|
|
644
644
|
onPointercancel: R,
|
|
645
645
|
onPointerdown: I,
|
|
646
646
|
onPointermove: L,
|
|
@@ -753,22 +753,18 @@ var Me = ["aria-hidden"], Ne = [
|
|
|
753
753
|
y2: "15",
|
|
754
754
|
key: "5ykzw1"
|
|
755
755
|
}]
|
|
756
|
-
])
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
500: "Server error"
|
|
762
|
-
};
|
|
763
|
-
function tt(e) {
|
|
764
|
-
return e.match(/\/demo-errors\/(401|403|404|419|500)\//)?.[1] ?? "Error";
|
|
756
|
+
]);
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region src/core/mediaPreview.ts
|
|
759
|
+
function et(e) {
|
|
760
|
+
return "Error";
|
|
765
761
|
}
|
|
766
|
-
function
|
|
767
|
-
return
|
|
762
|
+
function tt(e) {
|
|
763
|
+
return "Preview unavailable";
|
|
768
764
|
}
|
|
769
765
|
//#endregion
|
|
770
766
|
//#region src/components/CardRegion.vue
|
|
771
|
-
var
|
|
767
|
+
var nt = /* @__PURE__ */ d({
|
|
772
768
|
__name: "CardRegion",
|
|
773
769
|
props: {
|
|
774
770
|
index: {},
|
|
@@ -783,7 +779,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
783
779
|
total: {}
|
|
784
780
|
},
|
|
785
781
|
setup(e) {
|
|
786
|
-
let t = e, n = r(() =>
|
|
782
|
+
let t = e, n = r(() => V(t.item, t.mediaIndex)), i = r(() => B(t.item)), o = r(() => H(t.item, n.value)), c = r(() => ({
|
|
787
783
|
height: `${t.region.height}px`,
|
|
788
784
|
paddingBlock: t.style?.paddingY === void 0 ? void 0 : `${t.style.paddingY}px`,
|
|
789
785
|
paddingInline: t.style?.paddingX === void 0 ? void 0 : `${t.style.paddingX}px`
|
|
@@ -815,7 +811,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
815
811
|
"total"
|
|
816
812
|
]))], 38));
|
|
817
813
|
}
|
|
818
|
-
}),
|
|
814
|
+
}), rt = ["aria-busy", "aria-label"], it = { class: "media-error-code" }, at = ["disabled"], ot = /* @__PURE__ */ d({
|
|
819
815
|
__name: "MediaError",
|
|
820
816
|
props: {
|
|
821
817
|
component: {},
|
|
@@ -850,7 +846,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
850
846
|
"retrying",
|
|
851
847
|
"status"
|
|
852
848
|
]))], 32)) : (b(), s(e, { key: 1 }, [
|
|
853
|
-
c("strong",
|
|
849
|
+
c("strong", it, T(t.status), 1),
|
|
854
850
|
c("span", null, T(t.label), 1),
|
|
855
851
|
c("button", {
|
|
856
852
|
"data-test": "media-retry",
|
|
@@ -859,26 +855,26 @@ var rt = /* @__PURE__ */ d({
|
|
|
859
855
|
disabled: t.retrying,
|
|
860
856
|
onClick: j(o, ["stop"]),
|
|
861
857
|
onKeydown: r[2] ||= j(() => {}, ["stop"])
|
|
862
|
-
}, T(t.retrying ? "Retrying…" : "Retry"), 41,
|
|
863
|
-
], 64))], 8,
|
|
858
|
+
}, T(t.retrying ? "Retrying…" : "Retry"), 41, at)
|
|
859
|
+
], 64))], 8, rt));
|
|
864
860
|
}
|
|
865
|
-
}),
|
|
861
|
+
}), st = ["aria-label"], ct = [
|
|
866
862
|
"max",
|
|
867
863
|
"value",
|
|
868
864
|
"aria-label",
|
|
869
865
|
"aria-valuetext",
|
|
870
866
|
"disabled"
|
|
871
|
-
],
|
|
867
|
+
], lt = {
|
|
872
868
|
key: 0,
|
|
873
869
|
class: "media-controls-row"
|
|
874
|
-
},
|
|
870
|
+
}, ut = ["aria-label", "title"], dt = { class: "media-controls-audio" }, ft = ["aria-label", "title"], pt = [
|
|
875
871
|
"value",
|
|
876
872
|
"aria-label",
|
|
877
873
|
"aria-valuetext"
|
|
878
|
-
],
|
|
874
|
+
], mt = {
|
|
879
875
|
class: "media-control-time",
|
|
880
876
|
"aria-live": "off"
|
|
881
|
-
},
|
|
877
|
+
}, ht = /* @__PURE__ */ d({
|
|
882
878
|
__name: "MediaControls",
|
|
883
879
|
props: {
|
|
884
880
|
currentTime: {},
|
|
@@ -931,7 +927,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
931
927
|
"aria-valuetext": `${u(v.value)} of ${u(p.value)}`,
|
|
932
928
|
disabled: p.value <= 0,
|
|
933
929
|
onInput: n[0] ||= (e) => i("seek", d(e))
|
|
934
|
-
}, null, 44,
|
|
930
|
+
}, null, 44, ct), e.layout === "reel" ? (b(), s("div", lt, [
|
|
935
931
|
c("button", {
|
|
936
932
|
type: "button",
|
|
937
933
|
class: "media-control-button media-control-playback",
|
|
@@ -946,8 +942,8 @@ var rt = /* @__PURE__ */ d({
|
|
|
946
942
|
key: 1,
|
|
947
943
|
size: 18,
|
|
948
944
|
fill: "currentColor"
|
|
949
|
-
}))], 8,
|
|
950
|
-
c("div",
|
|
945
|
+
}))], 8, ut),
|
|
946
|
+
c("div", dt, [c("button", {
|
|
951
947
|
type: "button",
|
|
952
948
|
class: "media-control-button",
|
|
953
949
|
"aria-label": e.muted ? `Unmute ${m.value}` : `Mute ${m.value}`,
|
|
@@ -959,7 +955,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
959
955
|
})) : (b(), a(E(Qe), {
|
|
960
956
|
key: 1,
|
|
961
957
|
size: 18
|
|
962
|
-
}))], 8,
|
|
958
|
+
}))], 8, ft), c("input", {
|
|
963
959
|
class: "media-control-range media-control-volume",
|
|
964
960
|
type: "range",
|
|
965
961
|
min: "0",
|
|
@@ -970,15 +966,15 @@ var rt = /* @__PURE__ */ d({
|
|
|
970
966
|
"aria-label": `${g.value} volume`,
|
|
971
967
|
"aria-valuetext": `${Math.round(e.volume * 100)} percent`,
|
|
972
968
|
onInput: n[3] ||= (e) => i("volumeChange", d(e))
|
|
973
|
-
}, null, 44,
|
|
974
|
-
c("output",
|
|
975
|
-
])) : o("", !0)], 42,
|
|
969
|
+
}, null, 44, pt)]),
|
|
970
|
+
c("output", mt, T(u(v.value)) + " / " + T(u(p.value)), 1)
|
|
971
|
+
])) : o("", !0)], 42, st));
|
|
976
972
|
}
|
|
977
|
-
}),
|
|
973
|
+
}), gt = {
|
|
978
974
|
key: 0,
|
|
979
975
|
class: "media-card-overlay-host",
|
|
980
976
|
"data-test": "media-card-overlay"
|
|
981
|
-
},
|
|
977
|
+
}, _t = /* @__PURE__ */ d({
|
|
982
978
|
__name: "MediaContextOverlay",
|
|
983
979
|
props: {
|
|
984
980
|
item: {},
|
|
@@ -988,7 +984,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
988
984
|
mediaSource: {}
|
|
989
985
|
},
|
|
990
986
|
setup(e) {
|
|
991
|
-
return (t, n) => e.mediaCard?.overlay?.component ? (b(), s("div",
|
|
987
|
+
return (t, n) => e.mediaCard?.overlay?.component ? (b(), s("div", gt, [(b(), a(C(e.mediaCard.overlay.component), {
|
|
992
988
|
item: e.item,
|
|
993
989
|
"media-index": e.mediaIndex,
|
|
994
990
|
"media-item": e.mediaItem,
|
|
@@ -1000,26 +996,26 @@ var rt = /* @__PURE__ */ d({
|
|
|
1000
996
|
"media-source"
|
|
1001
997
|
]))])) : o("", !0);
|
|
1002
998
|
}
|
|
1003
|
-
}),
|
|
1004
|
-
function
|
|
999
|
+
}), vt = 40, yt = 160, bt = 24;
|
|
1000
|
+
function xt(e) {
|
|
1005
1001
|
let t = w("next"), n = null, r = 0, i = !1, a = null, o = null;
|
|
1006
1002
|
function s(n, r) {
|
|
1007
|
-
let i =
|
|
1003
|
+
let i = B(e.item()).length, a = (n + i) % i;
|
|
1008
1004
|
a !== e.mediaIndex() && (t.value = n < e.mediaIndex() ? "previous" : "next", e.onChange(a), r?.detail && r.detail > 0 && r.currentTarget?.blur());
|
|
1009
1005
|
}
|
|
1010
1006
|
function c() {
|
|
1011
1007
|
r = 0, i = !1, n !== null && clearTimeout(n), n = null;
|
|
1012
1008
|
}
|
|
1013
1009
|
function l() {
|
|
1014
|
-
n !== null && clearTimeout(n), n = setTimeout(c,
|
|
1010
|
+
n !== null && clearTimeout(n), n = setTimeout(c, yt);
|
|
1015
1011
|
}
|
|
1016
1012
|
function u(e, t, n) {
|
|
1017
1013
|
return t === 1 ? e * 16 : t === 2 ? e * n : e;
|
|
1018
1014
|
}
|
|
1019
1015
|
function d(t) {
|
|
1020
|
-
if (
|
|
1016
|
+
if (B(e.item()).length <= 1) return;
|
|
1021
1017
|
let n = t.currentTarget, a = u(t.deltaX, t.deltaMode, n?.clientWidth || 1);
|
|
1022
|
-
if (a === 0 || (t.preventDefault(), l(), i) || (r += a, Math.abs(r) <
|
|
1018
|
+
if (a === 0 || (t.preventDefault(), l(), i) || (r += a, Math.abs(r) < bt)) return;
|
|
1023
1019
|
let o = Math.sign(r);
|
|
1024
1020
|
r = 0, i = !0, s(e.mediaIndex() + o);
|
|
1025
1021
|
}
|
|
@@ -1031,7 +1027,7 @@ function St(e) {
|
|
|
1031
1027
|
let n = t.changedTouches[0];
|
|
1032
1028
|
if (a === null || o === null || !n) return;
|
|
1033
1029
|
let r = a - n.clientX, i = o - n.clientY;
|
|
1034
|
-
a = null, o = null, !(Math.abs(r) <= Math.abs(i)) && (Math.abs(r) <
|
|
1030
|
+
a = null, o = null, !(Math.abs(r) <= Math.abs(i)) && (Math.abs(r) < vt || s(e.mediaIndex() + Math.sign(r)));
|
|
1035
1031
|
}
|
|
1036
1032
|
return v(c), {
|
|
1037
1033
|
change: s,
|
|
@@ -1041,14 +1037,14 @@ function St(e) {
|
|
|
1041
1037
|
onWheel: d
|
|
1042
1038
|
};
|
|
1043
1039
|
}
|
|
1044
|
-
var
|
|
1045
|
-
function
|
|
1040
|
+
var St = /* @__PURE__ */ new Map(), Ct = [], wt = 0, Tt = 0;
|
|
1041
|
+
function Et(e, t) {
|
|
1046
1042
|
return `${t ? "timed" : "image"}:${e}`;
|
|
1047
1043
|
}
|
|
1048
|
-
function
|
|
1049
|
-
let r =
|
|
1044
|
+
function Dt(e, t, n) {
|
|
1045
|
+
let r = B(e);
|
|
1050
1046
|
if (r.length < 2) return [];
|
|
1051
|
-
let i =
|
|
1047
|
+
let i = V(e, t), a = [];
|
|
1052
1048
|
for (let e = 1; e < r.length; e += 1) {
|
|
1053
1049
|
let t = i + e, n = i - e;
|
|
1054
1050
|
t < r.length && a.push(t), n >= 0 && a.push(n);
|
|
@@ -1057,9 +1053,9 @@ function Ot(e, t, n) {
|
|
|
1057
1053
|
return a.flatMap((e) => {
|
|
1058
1054
|
let t = r[e];
|
|
1059
1055
|
if (!t) return [];
|
|
1060
|
-
let i = I(t.type, t.src) === "audio" ?
|
|
1056
|
+
let i = I(t.type, t.src) === "audio" ? z(t) : ee(t, n);
|
|
1061
1057
|
if (!i) return [];
|
|
1062
|
-
let a = L(i.type, i.src), s =
|
|
1058
|
+
let a = L(i.type, i.src), s = Et(i.src, a);
|
|
1063
1059
|
return o.has(s) ? [] : (o.add(s), [{
|
|
1064
1060
|
key: s,
|
|
1065
1061
|
src: i.src,
|
|
@@ -1067,22 +1063,22 @@ function Ot(e, t, n) {
|
|
|
1067
1063
|
}]);
|
|
1068
1064
|
});
|
|
1069
1065
|
}
|
|
1070
|
-
function
|
|
1066
|
+
function Ot(e) {
|
|
1071
1067
|
let t = e.element;
|
|
1072
1068
|
e.element = null, t && (t instanceof HTMLVideoElement ? (t.pause(), t.removeAttribute("src"), t.load()) : t.removeAttribute("src"));
|
|
1073
1069
|
}
|
|
1074
|
-
function
|
|
1075
|
-
|
|
1076
|
-
let t =
|
|
1077
|
-
t >= 0 &&
|
|
1070
|
+
function kt(e) {
|
|
1071
|
+
St.delete(e.key);
|
|
1072
|
+
let t = Ct.indexOf(e);
|
|
1073
|
+
t >= 0 && Ct.splice(t, 1), e.cancel?.(), e.cancel = null, Ot(e);
|
|
1078
1074
|
}
|
|
1079
|
-
function
|
|
1080
|
-
e.state = "loading",
|
|
1075
|
+
function At(e) {
|
|
1076
|
+
e.state = "loading", wt += 1, e.timed && (Tt += 1);
|
|
1081
1077
|
let t = !1, n = () => void 0, r = (r) => {
|
|
1082
|
-
t || (t = !0, n(), --
|
|
1078
|
+
t || (t = !0, n(), --wt, e.timed && --Tt, e.cancel = null, e.state = r, r === "failed" && Ot(e), e.refs === 0 && kt(e), jt());
|
|
1083
1079
|
};
|
|
1084
1080
|
if (e.cancel = () => {
|
|
1085
|
-
t || (t = !0, n(), --
|
|
1081
|
+
t || (t = !0, n(), --wt, e.timed && --Tt, Ot(e), jt());
|
|
1086
1082
|
}, e.timed) {
|
|
1087
1083
|
let t = document.createElement("video"), i = () => r("ready"), a = () => r("failed");
|
|
1088
1084
|
n = () => {
|
|
@@ -1101,38 +1097,38 @@ function jt(e) {
|
|
|
1101
1097
|
i.removeEventListener("load", a), i.removeEventListener("error", o);
|
|
1102
1098
|
}, i.addEventListener("load", a, { once: !0 }), i.addEventListener("error", o, { once: !0 }), i.decoding = "async", i.fetchPriority = "low", i.src = e.src, e.element = i;
|
|
1103
1099
|
}
|
|
1104
|
-
function
|
|
1105
|
-
for (;
|
|
1106
|
-
let e =
|
|
1100
|
+
function jt() {
|
|
1101
|
+
for (; wt < 6;) {
|
|
1102
|
+
let e = Ct.findIndex((e) => e.refs > 0 && e.state === "queued" && (!e.timed || Tt < 2));
|
|
1107
1103
|
if (e < 0) return;
|
|
1108
|
-
let [t] =
|
|
1109
|
-
t &&
|
|
1104
|
+
let [t] = Ct.splice(e, 1);
|
|
1105
|
+
t && At(t);
|
|
1110
1106
|
}
|
|
1111
1107
|
}
|
|
1112
|
-
function
|
|
1113
|
-
let t =
|
|
1108
|
+
function Mt(e) {
|
|
1109
|
+
let t = St.get(e.key);
|
|
1114
1110
|
t || (t = {
|
|
1115
1111
|
...e,
|
|
1116
1112
|
cancel: null,
|
|
1117
1113
|
element: null,
|
|
1118
1114
|
refs: 0,
|
|
1119
1115
|
state: "queued"
|
|
1120
|
-
},
|
|
1116
|
+
}, St.set(t.key, t), Ct.push(t)), t.refs += 1, jt();
|
|
1121
1117
|
let n = !1;
|
|
1122
1118
|
return () => {
|
|
1123
|
-
n || (n = !0, --t.refs, t.refs === 0 &&
|
|
1119
|
+
n || (n = !0, --t.refs, t.refs === 0 && kt(t));
|
|
1124
1120
|
};
|
|
1125
1121
|
}
|
|
1126
1122
|
//#endregion
|
|
1127
1123
|
//#region src/components/useVisiblePostPreload.ts
|
|
1128
|
-
function
|
|
1129
|
-
let t = r(() => e.layout() === "masonry" && e.inViewport() && e.mediaReady() && e.mediaCard()?.feedPreload === "visible-post"), n = r(() => t.value ?
|
|
1124
|
+
function Nt(e) {
|
|
1125
|
+
let t = r(() => e.layout() === "masonry" && e.inViewport() && e.mediaReady() && e.mediaCard()?.feedPreload === "visible-post"), n = r(() => t.value ? Dt(e.item(), e.mediaIndex(), e.mediaSource()) : []), i = /* @__PURE__ */ new Map();
|
|
1130
1126
|
function a() {
|
|
1131
1127
|
let e = new Map(n.value.map((e) => [e.key, e]));
|
|
1132
1128
|
i.forEach((t, n) => {
|
|
1133
1129
|
e.has(n) || (t(), i.delete(n));
|
|
1134
1130
|
}), n.value.forEach((e) => {
|
|
1135
|
-
i.has(e.key) || i.set(e.key,
|
|
1131
|
+
i.has(e.key) || i.set(e.key, Mt(e));
|
|
1136
1132
|
});
|
|
1137
1133
|
}
|
|
1138
1134
|
O(() => n.value.map(({ key: e }) => e).join("\n"), a, { immediate: !0 }), v(() => {
|
|
@@ -1141,7 +1137,7 @@ function Pt(e) {
|
|
|
1141
1137
|
}
|
|
1142
1138
|
//#endregion
|
|
1143
1139
|
//#region src/components/useMediaLoading.ts
|
|
1144
|
-
function
|
|
1140
|
+
function Pt(e) {
|
|
1145
1141
|
let t = r(() => L(e.mediaType(), e.mediaSource())), n = r(() => e.layout() === "masonry" && e.fetchPriority() === "low" ? "lazy" : "eager"), i = r(() => e.layout() === "reel" && !e.active() ? "none" : e.fetchPriority() === "high" ? "auto" : e.layout() === "masonry" ? "none" : "metadata");
|
|
1146
1142
|
return O(i, (t, n) => {
|
|
1147
1143
|
n !== "none" || t === "none" || m(() => {
|
|
@@ -1156,7 +1152,7 @@ function Ft(e) {
|
|
|
1156
1152
|
}
|
|
1157
1153
|
//#endregion
|
|
1158
1154
|
//#region src/components/useMediaReadiness.ts
|
|
1159
|
-
function
|
|
1155
|
+
function Ft(e) {
|
|
1160
1156
|
let t = w(null), n = w(null), i = w(0), a = w(0), o = w(!0), s = w(!1), c = w(!1), l = null, u = !1, d = !1, f = !1, p = r(() => c.value || s.value ? "error" : o.value ? "loading" : e.previewState());
|
|
1161
1157
|
function h() {
|
|
1162
1158
|
l !== null && clearTimeout(l), l = null;
|
|
@@ -1217,30 +1213,30 @@ function It(e) {
|
|
|
1217
1213
|
}
|
|
1218
1214
|
//#endregion
|
|
1219
1215
|
//#region src/core/reelAudio.ts
|
|
1220
|
-
var
|
|
1216
|
+
var It = {
|
|
1221
1217
|
lastAudibleVolume: 1,
|
|
1222
1218
|
muted: !1,
|
|
1223
1219
|
volume: 1
|
|
1224
1220
|
};
|
|
1225
|
-
function
|
|
1221
|
+
function Lt(e, t) {
|
|
1226
1222
|
return typeof e == "number" && Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : t;
|
|
1227
1223
|
}
|
|
1228
|
-
function
|
|
1229
|
-
let n =
|
|
1224
|
+
function Rt(e, t = It) {
|
|
1225
|
+
let n = Lt(e?.volume, t.volume), r = Lt(e?.lastAudibleVolume, n > 0 ? n : t.lastAudibleVolume);
|
|
1230
1226
|
return {
|
|
1231
|
-
lastAudibleVolume: r > 0 ? r :
|
|
1227
|
+
lastAudibleVolume: r > 0 ? r : It.lastAudibleVolume,
|
|
1232
1228
|
muted: typeof e?.muted == "boolean" ? e.muted : n === 0 || t.muted,
|
|
1233
1229
|
volume: n
|
|
1234
1230
|
};
|
|
1235
1231
|
}
|
|
1236
1232
|
//#endregion
|
|
1237
1233
|
//#region src/components/useMediaCardAudio.ts
|
|
1238
|
-
function
|
|
1239
|
-
let t =
|
|
1234
|
+
function zt(e) {
|
|
1235
|
+
let t = Rt(e.reelAudioState()), n = e.layout() === "reel" && e.reelAudioState(), r = w(n ? t.muted : e.mediaCard()?.videoMuted ?? e.layout() === "masonry"), i = w(n ? t.volume : 1), a = n ? t.lastAudibleVolume : 1;
|
|
1240
1236
|
function o() {
|
|
1241
1237
|
let t = e.mediaElement.value, n = e.reelAudioState();
|
|
1242
1238
|
if (!t || e.layout() !== "reel" || !n) return;
|
|
1243
|
-
let o =
|
|
1239
|
+
let o = Rt(n);
|
|
1244
1240
|
a = o.lastAudibleVolume, i.value = o.volume, r.value = o.muted, t.volume = o.volume, t.muted = e.active() === !1 ? !0 : o.muted;
|
|
1245
1241
|
}
|
|
1246
1242
|
function s(e, t) {
|
|
@@ -1248,7 +1244,7 @@ function Bt(e) {
|
|
|
1248
1244
|
}
|
|
1249
1245
|
function c(t) {
|
|
1250
1246
|
if (e.layout() !== "reel") return;
|
|
1251
|
-
let n =
|
|
1247
|
+
let n = Rt({
|
|
1252
1248
|
lastAudibleVolume: a,
|
|
1253
1249
|
muted: t.muted,
|
|
1254
1250
|
volume: t.volume
|
|
@@ -1283,7 +1279,7 @@ function Bt(e) {
|
|
|
1283
1279
|
}
|
|
1284
1280
|
//#endregion
|
|
1285
1281
|
//#region src/components/useReelVideoActivity.ts
|
|
1286
|
-
function
|
|
1282
|
+
function Bt(e) {
|
|
1287
1283
|
let t = r(() => e.layout() === "reel" ? e.active() === !0 : e.inViewport()), n = r(() => t.value ? e.mediaIsMuted.value : !0);
|
|
1288
1284
|
function i() {
|
|
1289
1285
|
if (!t.value) {
|
|
@@ -1317,18 +1313,18 @@ function Vt(e) {
|
|
|
1317
1313
|
}
|
|
1318
1314
|
//#endregion
|
|
1319
1315
|
//#region src/components/useTimedMediaCard.ts
|
|
1320
|
-
function
|
|
1316
|
+
function Vt(e) {
|
|
1321
1317
|
return Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
1322
1318
|
}
|
|
1323
|
-
function
|
|
1324
|
-
let t = w(0), n = w(0), r = w(!1), { apply: i, setVolume: a, sync: o, toggleMute: s, videoIsMuted: c, videoVolume: l } =
|
|
1319
|
+
function Ht(e) {
|
|
1320
|
+
let t = w(0), n = w(0), r = w(!1), { apply: i, setVolume: a, sync: o, toggleMute: s, videoIsMuted: c, videoVolume: l } = zt({
|
|
1325
1321
|
active: e.active,
|
|
1326
1322
|
layout: e.layout,
|
|
1327
1323
|
mediaCard: e.mediaCard,
|
|
1328
1324
|
mediaElement: e.mediaElement,
|
|
1329
1325
|
onChange: e.onAudioChange,
|
|
1330
1326
|
reelAudioState: e.reelAudioState
|
|
1331
|
-
}), { effectiveMuted: u, onPlaying: d, playbackAllowed: f } =
|
|
1327
|
+
}), { effectiveMuted: u, onPlaying: d, playbackAllowed: f } = Bt({
|
|
1332
1328
|
active: e.active,
|
|
1333
1329
|
inViewport: e.inViewport,
|
|
1334
1330
|
layout: e.layout,
|
|
@@ -1338,7 +1334,7 @@ function Ut(e) {
|
|
|
1338
1334
|
});
|
|
1339
1335
|
function p(r) {
|
|
1340
1336
|
let i = r?.currentTarget ?? e.mediaElement.value;
|
|
1341
|
-
i && (t.value =
|
|
1337
|
+
i && (t.value = Vt(i.currentTime), n.value = Vt(i.duration), o(i, f.value));
|
|
1342
1338
|
}
|
|
1343
1339
|
function m(t) {
|
|
1344
1340
|
i(), p(t), e.onReady(t);
|
|
@@ -1348,7 +1344,7 @@ function Ut(e) {
|
|
|
1348
1344
|
}
|
|
1349
1345
|
function g(n) {
|
|
1350
1346
|
let r = e.mediaElement.value;
|
|
1351
|
-
!r || !Number.isFinite(n) || (r.currentTime = Math.min(
|
|
1347
|
+
!r || !Number.isFinite(n) || (r.currentTime = Math.min(Vt(r.duration), Math.max(0, n)), t.value = r.currentTime);
|
|
1352
1348
|
}
|
|
1353
1349
|
async function _() {
|
|
1354
1350
|
let t = e.mediaElement.value;
|
|
@@ -1386,7 +1382,7 @@ function Ut(e) {
|
|
|
1386
1382
|
}
|
|
1387
1383
|
//#endregion
|
|
1388
1384
|
//#region src/components/MediaCard.vue?vue&type=script&setup=true&lang.ts
|
|
1389
|
-
var
|
|
1385
|
+
var Ut = [
|
|
1390
1386
|
"data-post-id",
|
|
1391
1387
|
"data-media-index",
|
|
1392
1388
|
"aria-hidden",
|
|
@@ -1394,19 +1390,19 @@ var Wt = [
|
|
|
1394
1390
|
"inert",
|
|
1395
1391
|
"role",
|
|
1396
1392
|
"tabindex"
|
|
1397
|
-
],
|
|
1393
|
+
], Wt = { class: "media-card-content" }, Gt = ["data-media-direction"], Kt = ["data-media-index"], qt = {
|
|
1398
1394
|
key: 0,
|
|
1399
1395
|
"data-test": "media-loading",
|
|
1400
1396
|
class: "media-loading",
|
|
1401
1397
|
"aria-hidden": "true"
|
|
1402
|
-
},
|
|
1398
|
+
}, Jt = [
|
|
1403
1399
|
"data-source-generation",
|
|
1404
1400
|
"src",
|
|
1405
1401
|
"autoplay",
|
|
1406
1402
|
"loop",
|
|
1407
1403
|
"muted",
|
|
1408
1404
|
"preload"
|
|
1409
|
-
],
|
|
1405
|
+
], Yt = ["aria-label", "disabled"], Xt = [
|
|
1410
1406
|
"data-cover-identity",
|
|
1411
1407
|
"data-source-generation",
|
|
1412
1408
|
"src",
|
|
@@ -1414,11 +1410,11 @@ var Wt = [
|
|
|
1414
1410
|
"height",
|
|
1415
1411
|
"fetchpriority",
|
|
1416
1412
|
"loading"
|
|
1417
|
-
],
|
|
1413
|
+
], Zt = {
|
|
1418
1414
|
key: 1,
|
|
1419
1415
|
class: "media-audio-fallback",
|
|
1420
1416
|
"aria-hidden": "true"
|
|
1421
|
-
},
|
|
1417
|
+
}, Qt = [
|
|
1422
1418
|
"data-source-generation",
|
|
1423
1419
|
"src",
|
|
1424
1420
|
"width",
|
|
@@ -1427,14 +1423,14 @@ var Wt = [
|
|
|
1427
1423
|
"loop",
|
|
1428
1424
|
"muted",
|
|
1429
1425
|
"preload"
|
|
1430
|
-
],
|
|
1426
|
+
], $t = [
|
|
1431
1427
|
"data-source-generation",
|
|
1432
1428
|
"src",
|
|
1433
1429
|
"width",
|
|
1434
1430
|
"height",
|
|
1435
1431
|
"fetchpriority",
|
|
1436
1432
|
"loading"
|
|
1437
|
-
],
|
|
1433
|
+
], en = ["aria-label"], tn = ["aria-label"], nn = ["aria-label"], rn = /* @__PURE__ */ d({
|
|
1438
1434
|
__name: "MediaCard",
|
|
1439
1435
|
props: {
|
|
1440
1436
|
active: { type: Boolean },
|
|
@@ -1474,7 +1470,7 @@ var Wt = [
|
|
|
1474
1470
|
function f(e = !1, t = "pointer") {
|
|
1475
1471
|
e && d("activate", t);
|
|
1476
1472
|
}
|
|
1477
|
-
let p = r(() =>
|
|
1473
|
+
let p = r(() => B(l.item)), g = r(() => V(l.item, l.mediaIndex)), v = r(() => H(l.item, g.value)), y = r(() => ee(v.value, l.mediaSource ?? "preview")), x = r(() => I(v.value.type, v.value.src)), S = r(() => x.value === "audio"), C = r(() => te(v.value, l.mediaSource ?? "preview")), T = r(() => S.value ? C.value : y.value), D = r(() => T.value.src), M = r(() => I(T.value.type, T.value.src)), N = r(() => y.value.width), P = r(() => y.value.height), F = r(() => z(v.value)), L = r(() => `${l.item.postId}:${g.value}:${F.value?.src ?? ""}`), R = w(!1), U = r(() => R.value ? null : F.value), { effectivePreviewState: W, failSourceAttempt: G, imageElement: ne, markSourceReady: K, noteSourceActivity: q, retrySource: re, retrying: ie, sourceGeneration: ae, mediaElement: J } = Ft({
|
|
1478
1474
|
identity: () => `${l.item.postId}:${g.value}:${l.mediaSource ?? "preview"}:${D.value}:${M.value ?? ""}`,
|
|
1479
1475
|
mediaIndex: () => g.value,
|
|
1480
1476
|
onError: (e, t) => {
|
|
@@ -1489,43 +1485,43 @@ var Wt = [
|
|
|
1489
1485
|
onReady: (e) => d("ready", e),
|
|
1490
1486
|
previewState: () => l.previewState
|
|
1491
1487
|
});
|
|
1492
|
-
|
|
1488
|
+
Nt({
|
|
1493
1489
|
inViewport: () => l.inViewport === !0,
|
|
1494
1490
|
item: () => l.item,
|
|
1495
1491
|
layout: () => l.layout,
|
|
1496
1492
|
mediaCard: () => l.mediaCard,
|
|
1497
1493
|
mediaIndex: () => g.value,
|
|
1498
|
-
mediaReady: () =>
|
|
1494
|
+
mediaReady: () => W.value === "ready",
|
|
1499
1495
|
mediaSource: () => l.mediaSource ?? "preview"
|
|
1500
1496
|
});
|
|
1501
|
-
let { currentTime: oe, duration: se, effectiveMuted: ce, isMuted: le, isPlaying:
|
|
1497
|
+
let { currentTime: oe, duration: se, effectiveMuted: ce, isMuted: le, isPlaying: ue, onEnded: Y, onLoadedMetadata: X, onPlaying: de, playbackAllowed: Z, seek: fe, setVolume: pe, sync: Q, toggleMute: me, togglePlayback: he, volume: ge } = Ht({
|
|
1502
1498
|
active: () => l.active,
|
|
1503
1499
|
inViewport: () => l.inViewport === !0,
|
|
1504
1500
|
layout: () => l.layout,
|
|
1505
1501
|
mediaCard: () => l.mediaCard,
|
|
1506
|
-
mediaElement:
|
|
1502
|
+
mediaElement: J,
|
|
1507
1503
|
onAudioChange: (e) => d("reelAudioChange", e),
|
|
1508
1504
|
onEnded: () => d("ended", g.value),
|
|
1509
|
-
onReady:
|
|
1505
|
+
onReady: K,
|
|
1510
1506
|
reelAudioState: () => l.reelAudioState
|
|
1511
1507
|
}), _e = r(() => l.interactive && !!(l.cardHeader || l.cardFooter));
|
|
1512
1508
|
function ve(e) {
|
|
1513
1509
|
return e.detail === 0 ? "keyboard" : "pointer";
|
|
1514
1510
|
}
|
|
1515
|
-
let { change: ye, direction: be, onTouchEnd: xe, onTouchStart: Se, onWheel: Ce } =
|
|
1511
|
+
let { change: ye, direction: be, onTouchEnd: xe, onTouchStart: Se, onWheel: Ce } = xt({
|
|
1516
1512
|
item: () => l.item,
|
|
1517
1513
|
layout: () => l.layout,
|
|
1518
1514
|
mediaIndex: () => g.value,
|
|
1519
1515
|
onChange: (e) => d("mediaChange", e)
|
|
1520
|
-
}), { imageLoading: we, mediaIsTimed: Te, timedMediaPreload: Ee } =
|
|
1516
|
+
}), { imageLoading: we, mediaIsTimed: Te, timedMediaPreload: Ee } = Pt({
|
|
1521
1517
|
active: () => l.active,
|
|
1522
1518
|
fetchPriority: () => l.fetchPriority,
|
|
1523
1519
|
layout: () => l.layout,
|
|
1524
1520
|
mediaSource: () => D.value,
|
|
1525
1521
|
mediaType: () => M.value,
|
|
1526
|
-
mediaElement:
|
|
1527
|
-
playbackAllowed: () =>
|
|
1528
|
-
}), De = r(() => l.layout === "reel" && l.stationaryReelControls === !0), Oe = r(() => Te.value && (!S.value || l.layout === "reel") &&
|
|
1522
|
+
mediaElement: J,
|
|
1523
|
+
playbackAllowed: () => Z.value
|
|
1524
|
+
}), De = r(() => l.layout === "reel" && l.stationaryReelControls === !0), Oe = r(() => Te.value && (!S.value || l.layout === "reel") && W.value === "ready" && (!De.value || !!(l.active && l.reelControlsTarget))), ke = r(() => `${l.item.postId}:${g.value}:${D.value}`);
|
|
1529
1525
|
function Ae(e) {
|
|
1530
1526
|
l.layout === "reel" && (e.stopPropagation(), he());
|
|
1531
1527
|
}
|
|
@@ -1534,35 +1530,35 @@ var Wt = [
|
|
|
1534
1530
|
mediaIndex: g.value,
|
|
1535
1531
|
source: "preview",
|
|
1536
1532
|
src: F.value?.src ?? ""
|
|
1537
|
-
}), R.value = !0, l.layout === "masonry" &&
|
|
1533
|
+
}), R.value = !0, l.layout === "masonry" && K());
|
|
1538
1534
|
}
|
|
1539
1535
|
return O(L, () => {
|
|
1540
1536
|
R.value = !1;
|
|
1541
1537
|
}), O([
|
|
1542
1538
|
S,
|
|
1543
1539
|
() => l.layout,
|
|
1544
|
-
|
|
1540
|
+
U
|
|
1545
1541
|
], ([e, t, n]) => {
|
|
1546
|
-
e && t === "masonry" && !n && m(() =>
|
|
1542
|
+
e && t === "masonry" && !n && m(() => K());
|
|
1547
1543
|
}, { immediate: !0 }), (r, i) => (b(), s("article", {
|
|
1548
1544
|
"data-post-id": e.item.postId,
|
|
1549
1545
|
"data-media-index": g.value,
|
|
1550
1546
|
class: h(["media-card", {
|
|
1551
1547
|
"media-card--entering": e.entering,
|
|
1552
1548
|
"media-card--leaving": e.leaving,
|
|
1553
|
-
"media-card--error": E(
|
|
1549
|
+
"media-card--error": E(W) === "error",
|
|
1554
1550
|
"media-card--transparent-chrome": e.mediaCard?.header?.background === "transparent" || e.mediaCard?.footer?.background === "transparent" || e.cardHeader?.background === "transparent" || e.cardFooter?.background === "transparent"
|
|
1555
1551
|
}]),
|
|
1556
1552
|
style: _(e.itemStyle),
|
|
1557
1553
|
"aria-hidden": e.leaving || void 0,
|
|
1558
|
-
"aria-busy": E(
|
|
1554
|
+
"aria-busy": E(W) === "loading" || E(ie),
|
|
1559
1555
|
inert: e.leaving || void 0,
|
|
1560
1556
|
role: e.interactive && !e.leaving && !_e.value ? "button" : void 0,
|
|
1561
1557
|
tabindex: e.interactive && !e.leaving && !_e.value ? 0 : void 0,
|
|
1562
1558
|
onClick: i[34] ||= (t) => f(e.interactive && !_e.value, ve(t)),
|
|
1563
1559
|
onKeydown: [i[35] ||= A((t) => f(e.interactive && !_e.value, "keyboard"), ["enter"]), i[36] ||= A(j((t) => f(e.interactive && !_e.value, "keyboard"), ["prevent"]), ["space"])]
|
|
1564
|
-
}, [c("div",
|
|
1565
|
-
e.cardHeader ? (b(), a(
|
|
1560
|
+
}, [c("div", Wt, [
|
|
1561
|
+
e.cardHeader ? (b(), a(nt, {
|
|
1566
1562
|
key: 0,
|
|
1567
1563
|
index: e.index,
|
|
1568
1564
|
item: e.item,
|
|
@@ -1593,21 +1589,21 @@ var Wt = [
|
|
|
1593
1589
|
onTouchendPassive: i[33] ||= (...e) => E(xe) && E(xe)(...e)
|
|
1594
1590
|
}, [
|
|
1595
1591
|
u(n, {
|
|
1596
|
-
css: !E(
|
|
1592
|
+
css: !E(ie),
|
|
1597
1593
|
name: `media-slide-${E(be)}`
|
|
1598
1594
|
}, {
|
|
1599
1595
|
default: k(() => [(b(), s("div", {
|
|
1600
|
-
key: `${e.item.postId}:${v.value.src}:${e.mediaSource ?? "preview"}:${E(
|
|
1596
|
+
key: `${e.item.postId}:${v.value.src}:${e.mediaSource ?? "preview"}:${E(ae)}`,
|
|
1601
1597
|
class: "media-card-frame",
|
|
1602
1598
|
"data-media-index": g.value
|
|
1603
1599
|
}, [
|
|
1604
|
-
E(
|
|
1600
|
+
E(W) === "loading" ? (b(), s("div", qt, [...i[37] ||= [c("span", { class: "media-loading-shimmer" }, null, -1)]])) : E(W) === "error" ? (b(), a(ot, {
|
|
1605
1601
|
key: 1,
|
|
1606
1602
|
component: e.mediaCard?.error?.component,
|
|
1607
|
-
label: E(
|
|
1608
|
-
retrying: E(
|
|
1609
|
-
status: E(
|
|
1610
|
-
onRetry: E(
|
|
1603
|
+
label: E(tt)(D.value),
|
|
1604
|
+
retrying: E(ie),
|
|
1605
|
+
status: E(et)(D.value),
|
|
1606
|
+
onRetry: E(re)
|
|
1611
1607
|
}, null, 8, [
|
|
1612
1608
|
"component",
|
|
1613
1609
|
"label",
|
|
@@ -1618,85 +1614,85 @@ var Wt = [
|
|
|
1618
1614
|
S.value && e.layout === "reel" ? (b(), s("audio", {
|
|
1619
1615
|
key: 2,
|
|
1620
1616
|
ref_key: "mediaElement",
|
|
1621
|
-
ref:
|
|
1622
|
-
"data-source-generation": E(
|
|
1617
|
+
ref: J,
|
|
1618
|
+
"data-source-generation": E(ae),
|
|
1623
1619
|
class: "media-audio-element",
|
|
1624
1620
|
src: D.value,
|
|
1625
|
-
autoplay: E(
|
|
1621
|
+
autoplay: E(Z),
|
|
1626
1622
|
loop: !e.advanceOnMediaEnd,
|
|
1627
1623
|
muted: E(ce),
|
|
1628
1624
|
preload: E(Ee),
|
|
1629
|
-
onLoadedmetadata: i[0] ||= (...e) => E(
|
|
1630
|
-
onProgress: i[1] ||= (...e) => E(
|
|
1631
|
-
onLoadeddata: i[2] ||= (...e) => E(
|
|
1632
|
-
onCanplay: i[3] ||= (...e) => E(
|
|
1625
|
+
onLoadedmetadata: i[0] ||= (...e) => E(X) && E(X)(...e),
|
|
1626
|
+
onProgress: i[1] ||= (...e) => E(q) && E(q)(...e),
|
|
1627
|
+
onLoadeddata: i[2] ||= (...e) => E(q) && E(q)(...e),
|
|
1628
|
+
onCanplay: i[3] ||= (...e) => E(q) && E(q)(...e),
|
|
1633
1629
|
onDurationchange: i[4] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1634
1630
|
onTimeupdate: i[5] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1635
1631
|
onVolumechange: i[6] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1636
|
-
onPlaying: i[7] ||= (...e) => E(
|
|
1637
|
-
onPause: i[8] ||= (e) =>
|
|
1638
|
-
onEnded: i[9] ||= (...e) => E(
|
|
1639
|
-
onError: i[10] ||= (...e) => E(
|
|
1640
|
-
}, null, 40,
|
|
1632
|
+
onPlaying: i[7] ||= (...e) => E(de) && E(de)(...e),
|
|
1633
|
+
onPause: i[8] ||= (e) => ue.value = !1,
|
|
1634
|
+
onEnded: i[9] ||= (...e) => E(Y) && E(Y)(...e),
|
|
1635
|
+
onError: i[10] ||= (...e) => E(G) && E(G)(...e)
|
|
1636
|
+
}, null, 40, Jt)) : o("", !0),
|
|
1641
1637
|
S.value ? (b(), s("button", {
|
|
1642
1638
|
key: 3,
|
|
1643
1639
|
type: "button",
|
|
1644
|
-
class: h(["media-audio-artwork media-preview", { "media-preview--ready": E(
|
|
1645
|
-
"aria-label": e.layout === "reel" ? E(
|
|
1640
|
+
class: h(["media-audio-artwork media-preview", { "media-preview--ready": E(W) === "ready" }]),
|
|
1641
|
+
"aria-label": e.layout === "reel" ? E(ue) ? "Pause audio" : "Play audio" : "Audio",
|
|
1646
1642
|
disabled: e.layout !== "reel",
|
|
1647
1643
|
onClick: Ae
|
|
1648
|
-
}, [
|
|
1644
|
+
}, [U.value ? (b(), s("img", {
|
|
1649
1645
|
key: L.value,
|
|
1650
1646
|
"data-cover-identity": L.value,
|
|
1651
|
-
"data-source-generation": E(
|
|
1647
|
+
"data-source-generation": E(ae),
|
|
1652
1648
|
class: "media-audio-cover",
|
|
1653
|
-
src:
|
|
1654
|
-
width:
|
|
1655
|
-
height:
|
|
1649
|
+
src: U.value.src,
|
|
1650
|
+
width: U.value.width ?? void 0,
|
|
1651
|
+
height: U.value.height ?? void 0,
|
|
1656
1652
|
fetchpriority: e.fetchPriority,
|
|
1657
1653
|
alt: "",
|
|
1658
1654
|
decoding: "async",
|
|
1659
1655
|
loading: E(we),
|
|
1660
|
-
onLoad: i[11] ||= (t) => e.layout === "masonry" && E(
|
|
1656
|
+
onLoad: i[11] ||= (t) => e.layout === "masonry" && E(K)(t),
|
|
1661
1657
|
onError: je
|
|
1662
|
-
}, null, 40,
|
|
1658
|
+
}, null, 40, Xt)) : (b(), s("span", Zt, [u(E(Ye), {
|
|
1663
1659
|
size: 64,
|
|
1664
1660
|
"stroke-width": 1.5
|
|
1665
|
-
})]))], 10,
|
|
1661
|
+
})]))], 10, Yt)) : E(Te) ? (b(), s("video", {
|
|
1666
1662
|
key: 4,
|
|
1667
1663
|
ref_key: "mediaElement",
|
|
1668
|
-
ref:
|
|
1669
|
-
"data-source-generation": E(
|
|
1664
|
+
ref: J,
|
|
1665
|
+
"data-source-generation": E(ae),
|
|
1670
1666
|
class: h(["media-preview", {
|
|
1671
|
-
"media-preview--ready": E(
|
|
1667
|
+
"media-preview--ready": E(W) === "ready",
|
|
1672
1668
|
"media-preview--reel-video": e.layout === "reel"
|
|
1673
1669
|
}]),
|
|
1674
1670
|
src: D.value,
|
|
1675
1671
|
width: N.value ?? void 0,
|
|
1676
1672
|
height: P.value ?? void 0,
|
|
1677
|
-
autoplay: E(
|
|
1673
|
+
autoplay: E(Z),
|
|
1678
1674
|
loop: !e.advanceOnMediaEnd,
|
|
1679
1675
|
muted: E(ce),
|
|
1680
1676
|
playsinline: "",
|
|
1681
1677
|
preload: E(Ee),
|
|
1682
|
-
onLoadedmetadata: i[12] ||= (...e) => E(
|
|
1683
|
-
onProgress: i[13] ||= (...e) => E(
|
|
1684
|
-
onLoadeddata: i[14] ||= (...e) => E(
|
|
1685
|
-
onCanplay: i[15] ||= (...e) => E(
|
|
1678
|
+
onLoadedmetadata: i[12] ||= (...e) => E(X) && E(X)(...e),
|
|
1679
|
+
onProgress: i[13] ||= (...e) => E(q) && E(q)(...e),
|
|
1680
|
+
onLoadeddata: i[14] ||= (...e) => E(q) && E(q)(...e),
|
|
1681
|
+
onCanplay: i[15] ||= (...e) => E(q) && E(q)(...e),
|
|
1686
1682
|
onDurationchange: i[16] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1687
1683
|
onTimeupdate: i[17] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1688
1684
|
onVolumechange: i[18] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1689
|
-
onPlaying: i[19] ||= (...e) => E(
|
|
1690
|
-
onPause: i[20] ||= (e) =>
|
|
1691
|
-
onEnded: i[21] ||= (...e) => E(
|
|
1685
|
+
onPlaying: i[19] ||= (...e) => E(de) && E(de)(...e),
|
|
1686
|
+
onPause: i[20] ||= (e) => ue.value = !1,
|
|
1687
|
+
onEnded: i[21] ||= (...e) => E(Y) && E(Y)(...e),
|
|
1692
1688
|
onClick: Ae,
|
|
1693
|
-
onError: i[22] ||= (...e) => E(
|
|
1694
|
-
}, null, 42,
|
|
1689
|
+
onError: i[22] ||= (...e) => E(G) && E(G)(...e)
|
|
1690
|
+
}, null, 42, Qt)) : S.value ? o("", !0) : (b(), s("img", {
|
|
1695
1691
|
key: 5,
|
|
1696
1692
|
ref_key: "imageElement",
|
|
1697
|
-
ref:
|
|
1698
|
-
"data-source-generation": E(
|
|
1699
|
-
class: h(["media-preview", { "media-preview--ready": E(
|
|
1693
|
+
ref: ne,
|
|
1694
|
+
"data-source-generation": E(ae),
|
|
1695
|
+
class: h(["media-preview", { "media-preview--ready": E(W) === "ready" }]),
|
|
1700
1696
|
src: D.value,
|
|
1701
1697
|
width: N.value ?? void 0,
|
|
1702
1698
|
height: P.value ?? void 0,
|
|
@@ -1704,13 +1700,13 @@ var Wt = [
|
|
|
1704
1700
|
alt: "",
|
|
1705
1701
|
decoding: "async",
|
|
1706
1702
|
loading: E(we),
|
|
1707
|
-
onLoad: i[23] ||= (...e) => E(
|
|
1708
|
-
onError: i[24] ||= (...e) => E(
|
|
1709
|
-
}, null, 42,
|
|
1710
|
-
], 8,
|
|
1703
|
+
onLoad: i[23] ||= (...e) => E(K) && E(K)(...e),
|
|
1704
|
+
onError: i[24] ||= (...e) => E(G) && E(G)(...e)
|
|
1705
|
+
}, null, 42, $t))
|
|
1706
|
+
], 8, Kt))]),
|
|
1711
1707
|
_: 1
|
|
1712
1708
|
}, 8, ["css", "name"]),
|
|
1713
|
-
u(
|
|
1709
|
+
u(_t, {
|
|
1714
1710
|
item: e.item,
|
|
1715
1711
|
"media-card": e.mediaCard,
|
|
1716
1712
|
"media-index": g.value,
|
|
@@ -1730,7 +1726,7 @@ var Wt = [
|
|
|
1730
1726
|
name: "vibe-reel-media-controls",
|
|
1731
1727
|
css: De.value
|
|
1732
1728
|
}, {
|
|
1733
|
-
default: k(() => [Oe.value ? (b(), a(
|
|
1729
|
+
default: k(() => [Oe.value ? (b(), a(ht, {
|
|
1734
1730
|
key: ke.value,
|
|
1735
1731
|
"current-time": E(oe),
|
|
1736
1732
|
"data-control-post-id": De.value ? e.item.postId : void 0,
|
|
@@ -1738,7 +1734,7 @@ var Wt = [
|
|
|
1738
1734
|
layout: e.layout,
|
|
1739
1735
|
"media-type": S.value ? "audio" : "video",
|
|
1740
1736
|
muted: E(le),
|
|
1741
|
-
playing: E(
|
|
1737
|
+
playing: E(ue),
|
|
1742
1738
|
volume: E(ge),
|
|
1743
1739
|
onSeek: E(fe),
|
|
1744
1740
|
onToggleMute: E(me),
|
|
@@ -1770,13 +1766,13 @@ var Wt = [
|
|
|
1770
1766
|
"aria-label": `Previous media for post ${e.item.postId}`,
|
|
1771
1767
|
onClick: i[25] ||= j((e) => E(ye)(g.value - 1, e), ["stop"]),
|
|
1772
1768
|
onKeydown: i[26] ||= j(() => {}, ["stop"])
|
|
1773
|
-
}, [u(E(qe), { size: 20 })], 40,
|
|
1769
|
+
}, [u(E(qe), { size: 20 })], 40, en), c("button", {
|
|
1774
1770
|
type: "button",
|
|
1775
1771
|
class: "media-carousel-control media-carousel-control--next",
|
|
1776
1772
|
"aria-label": `Next media for post ${e.item.postId}`,
|
|
1777
1773
|
onClick: i[27] ||= j((e) => E(ye)(g.value + 1, e), ["stop"]),
|
|
1778
1774
|
onKeydown: i[28] ||= j(() => {}, ["stop"])
|
|
1779
|
-
}, [u(E(Je), { size: 20 })], 40,
|
|
1775
|
+
}, [u(E(Je), { size: 20 })], 40, tn)], 2)) : o("", !0),
|
|
1780
1776
|
_e.value ? (b(), s("button", {
|
|
1781
1777
|
key: 1,
|
|
1782
1778
|
class: "media-card-activator",
|
|
@@ -1784,9 +1780,9 @@ var Wt = [
|
|
|
1784
1780
|
"aria-label": `Open post ${e.item.postId}`,
|
|
1785
1781
|
onClick: i[29] ||= j((e) => r.$emit("activate", ve(e)), ["stop"]),
|
|
1786
1782
|
onKeydown: i[30] ||= j(() => {}, ["stop"])
|
|
1787
|
-
}, null, 40,
|
|
1788
|
-
], 42,
|
|
1789
|
-
e.cardFooter ? (b(), a(
|
|
1783
|
+
}, null, 40, nn)) : o("", !0)
|
|
1784
|
+
], 42, Gt),
|
|
1785
|
+
e.cardFooter ? (b(), a(nt, {
|
|
1790
1786
|
key: 1,
|
|
1791
1787
|
index: e.index,
|
|
1792
1788
|
item: e.item,
|
|
@@ -1809,17 +1805,17 @@ var Wt = [
|
|
|
1809
1805
|
"style",
|
|
1810
1806
|
"total"
|
|
1811
1807
|
])) : o("", !0)
|
|
1812
|
-
])], 46,
|
|
1808
|
+
])], 46, Ut));
|
|
1813
1809
|
}
|
|
1814
1810
|
});
|
|
1815
1811
|
//#endregion
|
|
1816
1812
|
//#region src/components/useMasonryMediaVisibility.ts
|
|
1817
|
-
function
|
|
1813
|
+
function an(e) {
|
|
1818
1814
|
function t(t) {
|
|
1819
1815
|
return t.flatMap((t) => {
|
|
1820
1816
|
let n = e.items()[t];
|
|
1821
1817
|
if (!n) return [];
|
|
1822
|
-
let r = e.mediaIndices().get(n.postId) ?? 0, i =
|
|
1818
|
+
let r = e.mediaIndices().get(n.postId) ?? 0, i = U(n.postId, r);
|
|
1823
1819
|
return e.previewStates().get(i) === "ready" ? [{
|
|
1824
1820
|
key: i,
|
|
1825
1821
|
mediaIndex: r,
|
|
@@ -1843,8 +1839,8 @@ function on(e) {
|
|
|
1843
1839
|
}
|
|
1844
1840
|
//#endregion
|
|
1845
1841
|
//#region src/components/useSettledMasonryFeedLayout.ts
|
|
1846
|
-
var
|
|
1847
|
-
function
|
|
1842
|
+
var on = 1500;
|
|
1843
|
+
function sn(e) {
|
|
1848
1844
|
let t = w(0), n = 0, i = null, a = 0, o = 0, s = null, c = 0, l = null, u = null, d = 0;
|
|
1849
1845
|
function f() {
|
|
1850
1846
|
s !== null && (cancelAnimationFrame(s), s = null);
|
|
@@ -1864,7 +1860,7 @@ function cn(e) {
|
|
|
1864
1860
|
minColumnWidth: e.minColumnWidth.value
|
|
1865
1861
|
}, r, a, {
|
|
1866
1862
|
throughIndex: e.packThroughIndex(),
|
|
1867
|
-
untilIndex: a +
|
|
1863
|
+
untilIndex: a + on
|
|
1868
1864
|
}), n, a, r), t.value += 1;
|
|
1869
1865
|
}));
|
|
1870
1866
|
}
|
|
@@ -1909,10 +1905,10 @@ function cn(e) {
|
|
|
1909
1905
|
}
|
|
1910
1906
|
//#endregion
|
|
1911
1907
|
//#region src/components/MasonryFeed.vue?vue&type=script&setup=true&lang.ts
|
|
1912
|
-
var
|
|
1908
|
+
var cn = { class: "masonry-feed-shell" }, ln = ["aria-hidden", "inert"], un = {
|
|
1913
1909
|
key: 0,
|
|
1914
1910
|
class: "masonry-feed-status-overlay"
|
|
1915
|
-
},
|
|
1911
|
+
}, dn = 6, fn = 12, pn = 250, mn = /* @__PURE__ */ d({
|
|
1916
1912
|
__name: "MasonryFeed",
|
|
1917
1913
|
props: {
|
|
1918
1914
|
enteringPostIds: {},
|
|
@@ -1951,51 +1947,51 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1951
1947
|
"visible"
|
|
1952
1948
|
],
|
|
1953
1949
|
setup(t, { expose: n, emit: i }) {
|
|
1954
|
-
let l = 0, d = t, f = i, p = w(null), m = `vibe-masonry-${D()}`, g = w(null), y = w(0), x = w(
|
|
1950
|
+
let l = 0, d = t, f = i, p = w(null), m = `vibe-masonry-${D()}`, g = w(null), y = w(0), x = w(dn), C = w(0), T = w(0), k = w(0), A = w([]), j = w([]), M = w([]), N = 0, P = null, F = null, I = null, L = null, R = r(() => ({
|
|
1955
1951
|
additionalHeight: (d.cardHeader?.height ?? 0) + (d.cardFooter?.height ?? 0),
|
|
1956
1952
|
gap: x.value,
|
|
1957
1953
|
minColumnWidth: De(d.masonry)
|
|
1958
|
-
})),
|
|
1959
|
-
function
|
|
1954
|
+
})), ee = [];
|
|
1955
|
+
function z() {
|
|
1960
1956
|
let e = N - k.value + C.value + Oe(d.masonry, C.value), t = M.value.reduce((e, t) => {
|
|
1961
|
-
let n =
|
|
1957
|
+
let n = ee[t];
|
|
1962
1958
|
return n ? Math.max(e, n.y + n.height) : e;
|
|
1963
1959
|
}, 0);
|
|
1964
1960
|
return Math.max(e, t);
|
|
1965
1961
|
}
|
|
1966
|
-
function
|
|
1962
|
+
function te() {
|
|
1967
1963
|
return M.value.reduce((e, t) => Math.max(e, t), -1);
|
|
1968
1964
|
}
|
|
1969
|
-
let
|
|
1965
|
+
let B = sn({
|
|
1970
1966
|
additionalHeight: r(() => R.value.additionalHeight),
|
|
1971
1967
|
gap: x,
|
|
1972
1968
|
items: () => d.items,
|
|
1973
1969
|
minColumnWidth: r(() => R.value.minColumnWidth),
|
|
1974
|
-
packThroughIndex:
|
|
1975
|
-
packUntilBottom:
|
|
1970
|
+
packThroughIndex: te,
|
|
1971
|
+
packUntilBottom: z,
|
|
1976
1972
|
width: y
|
|
1977
|
-
}),
|
|
1978
|
-
throughIndex:
|
|
1979
|
-
untilBottom:
|
|
1980
|
-
})),
|
|
1981
|
-
let e =
|
|
1973
|
+
}), V = B.layout, H = B.viewportIndex, W = r(() => d.leavingPostIds.size === 0 ? null : ye(d.items, y.value, R.value, V.value, (e) => d.leavingPostIds.has(d.items[e].postId), {
|
|
1974
|
+
throughIndex: te(),
|
|
1975
|
+
untilBottom: z()
|
|
1976
|
+
})), G = r(() => {
|
|
1977
|
+
let e = W.value;
|
|
1982
1978
|
return e ? {
|
|
1983
1979
|
columns: e.columns,
|
|
1984
1980
|
height: e.height,
|
|
1985
1981
|
items: e.items
|
|
1986
|
-
} :
|
|
1987
|
-
}),
|
|
1988
|
-
let e =
|
|
1989
|
-
return e ? we(e.items, e.retainedIndices,
|
|
1990
|
-
}),
|
|
1991
|
-
let t = d.items[e], n =
|
|
1982
|
+
} : V.value;
|
|
1983
|
+
}), ne = r(() => {
|
|
1984
|
+
let e = W.value;
|
|
1985
|
+
return e ? we(e.items, e.retainedIndices, H.value, e.fromIndex) : null;
|
|
1986
|
+
}), K = r(() => (V.value, Math.max(T.value, B.reservedHeight(), d.leavingPostIds.size === 0 ? G.value.height : V.value.height))), q = r(() => ({ height: `${K.value}px` })), re = r(() => !d.infiniteScroll || C.value > 0 && k.value + G.value.height <= C.value + 1), ie = r(() => new Set(j.value)), ae = r(() => M.value.flatMap((e) => {
|
|
1987
|
+
let t = d.items[e], n = G.value.items[e];
|
|
1992
1988
|
return !t || !n || n.width <= 0 || n.height <= 0 ? [] : [{
|
|
1993
|
-
fetchPriority:
|
|
1989
|
+
fetchPriority: ie.value.has(e) ? "high" : "low",
|
|
1994
1990
|
index: e,
|
|
1995
1991
|
item: t
|
|
1996
1992
|
}];
|
|
1997
1993
|
}));
|
|
1998
|
-
function
|
|
1994
|
+
function J(e, t) {
|
|
1999
1995
|
return [...new Set([...e, ...t])].sort((e, t) => e - t);
|
|
2000
1996
|
}
|
|
2001
1997
|
function se(e, t) {
|
|
@@ -2005,11 +2001,11 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2005
2001
|
let t = {
|
|
2006
2002
|
scrollTop: N - k.value,
|
|
2007
2003
|
viewportHeight: C.value
|
|
2008
|
-
}, n =
|
|
2004
|
+
}, n = ne.value, r = Ee(n ?? H.value, {
|
|
2009
2005
|
...t,
|
|
2010
2006
|
overscan: e
|
|
2011
2007
|
}).indices;
|
|
2012
|
-
return
|
|
2008
|
+
return J(r, d.leavingPostIds.size === 0 ? [] : Ee(H.value, {
|
|
2013
2009
|
...t,
|
|
2014
2010
|
overscan: e
|
|
2015
2011
|
}).indices.filter((e) => {
|
|
@@ -2020,7 +2016,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2020
2016
|
function le() {
|
|
2021
2017
|
let e = ce(0), t = ce(Oe(d.masonry, C.value));
|
|
2022
2018
|
se(j.value, e) || (j.value = e);
|
|
2023
|
-
let n = pe(
|
|
2019
|
+
let n = pe(G.value.items, e.filter((e) => {
|
|
2024
2020
|
let t = d.items[e];
|
|
2025
2021
|
return t && !d.leavingPostIds.has(t.postId);
|
|
2026
2022
|
}), {
|
|
@@ -2029,7 +2025,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2029
2025
|
});
|
|
2030
2026
|
se(A.value, n) || (A.value = n), se(M.value, t) || (M.value = t);
|
|
2031
2027
|
}
|
|
2032
|
-
function
|
|
2028
|
+
function Y() {
|
|
2033
2029
|
if (L !== null) return;
|
|
2034
2030
|
L = -1;
|
|
2035
2031
|
let e = requestAnimationFrame(() => {
|
|
@@ -2037,7 +2033,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2037
2033
|
});
|
|
2038
2034
|
L !== null && (L = e);
|
|
2039
2035
|
}
|
|
2040
|
-
|
|
2036
|
+
an({
|
|
2041
2037
|
fullyVisibleIndices: () => A.value,
|
|
2042
2038
|
items: () => d.items,
|
|
2043
2039
|
mediaIndices: () => d.mediaIndices,
|
|
@@ -2046,11 +2042,11 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2046
2042
|
previewStates: () => d.previewStates,
|
|
2047
2043
|
visibleIndices: () => j.value
|
|
2048
2044
|
});
|
|
2049
|
-
function
|
|
2050
|
-
let t =
|
|
2045
|
+
function X(e) {
|
|
2046
|
+
let t = G.value.items[e], n = d.items[e]?.postId;
|
|
2051
2047
|
if (!t || t.width <= 0 || t.height <= 0) return {};
|
|
2052
|
-
let r = n !== void 0 && d.enteringPostIds.has(n), i = n !== void 0 && d.leavingPostIds.has(n), a = r || i ?
|
|
2053
|
-
containerHeight: Math.max(T.value,
|
|
2048
|
+
let r = n !== void 0 && d.enteringPostIds.has(n), i = n !== void 0 && d.leavingPostIds.has(n), a = r || i ? de({
|
|
2049
|
+
containerHeight: Math.max(T.value, V.value.height),
|
|
2054
2050
|
gap: x.value
|
|
2055
2051
|
}) : 0, o = n === void 0 ? 0 : i ? d.removalDelays.get(n) ?? 0 : r ? d.entryDelays.get(n) ?? 0 : 0;
|
|
2056
2052
|
return {
|
|
@@ -2060,7 +2056,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2060
2056
|
transform: `translate3d(${t.x}px, ${t.y + a}px, 0)`
|
|
2061
2057
|
};
|
|
2062
2058
|
}
|
|
2063
|
-
function
|
|
2059
|
+
function Z() {
|
|
2064
2060
|
let e = p.value;
|
|
2065
2061
|
if (!e) return;
|
|
2066
2062
|
N = e.scrollTop, C.value = e.clientHeight;
|
|
@@ -2071,18 +2067,18 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2071
2067
|
}
|
|
2072
2068
|
function fe(e) {
|
|
2073
2069
|
let t = e.ownerDocument.documentElement.clientWidth;
|
|
2074
|
-
y.value = e.clientWidth, x.value = Math.min(
|
|
2070
|
+
y.value = e.clientWidth, x.value = Math.min(fn, Math.max(dn, t * .0075)), Z();
|
|
2075
2071
|
}
|
|
2076
2072
|
function Q(e) {
|
|
2077
2073
|
let t = e.currentTarget;
|
|
2078
|
-
t && (N = t.scrollTop,
|
|
2074
|
+
t && (N = t.scrollTop, B.ensurePackedThrough(z()), Y(), Date.now() >= l && !d.loadMoreLocked && d.infiniteScroll && ue(t, d.masonry?.loadMoreThresholdPx) && f("loadMore"));
|
|
2079
2075
|
}
|
|
2080
2076
|
function me() {
|
|
2081
2077
|
let e = p.value;
|
|
2082
|
-
Date.now() >= l && !d.loadMoreLocked && e &&
|
|
2078
|
+
Date.now() >= l && !d.loadMoreLocked && e && ue(e, d.masonry?.loadMoreThresholdPx) && f("loadMore");
|
|
2083
2079
|
}
|
|
2084
2080
|
O(() => d.items.length, (e, t) => {
|
|
2085
|
-
e > 0 && e < t && (l = Date.now() +
|
|
2081
|
+
e > 0 && e < t && (l = Date.now() + pn);
|
|
2086
2082
|
});
|
|
2087
2083
|
function he() {
|
|
2088
2084
|
return p.value;
|
|
@@ -2095,19 +2091,19 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2095
2091
|
}));
|
|
2096
2092
|
}), P.observe(e)));
|
|
2097
2093
|
}), O(p, (e) => {
|
|
2098
|
-
F?.disconnect(), F = null, e && (
|
|
2099
|
-
}), O(
|
|
2100
|
-
|
|
2094
|
+
F?.disconnect(), F = null, e && (Z(), !(typeof ResizeObserver > "u") && (F = new ResizeObserver(Z), F.observe(e)));
|
|
2095
|
+
}), O(G, (e) => {
|
|
2096
|
+
ee = e.items;
|
|
2101
2097
|
}, { flush: "sync" }), O([
|
|
2102
|
-
|
|
2103
|
-
|
|
2098
|
+
V,
|
|
2099
|
+
G,
|
|
2104
2100
|
() => d.masonry
|
|
2105
2101
|
], le, { flush: "post" }), v(() => {
|
|
2106
2102
|
P?.disconnect(), F?.disconnect(), I !== null && cancelAnimationFrame(I), L !== null && cancelAnimationFrame(L);
|
|
2107
2103
|
}), n({
|
|
2108
2104
|
getScrollElement: he,
|
|
2109
2105
|
loadIfNearBottom: me
|
|
2110
|
-
}), (n, r) => (b(), s("div",
|
|
2106
|
+
}), (n, r) => (b(), s("div", cn, [
|
|
2111
2107
|
c("main", {
|
|
2112
2108
|
id: m,
|
|
2113
2109
|
ref_key: "galleryElement",
|
|
@@ -2121,9 +2117,9 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2121
2117
|
ref_key: "masonryElement",
|
|
2122
2118
|
ref: g,
|
|
2123
2119
|
class: h(["masonry", { "masonry--ready": y.value > 0 }]),
|
|
2124
|
-
style: _(
|
|
2120
|
+
style: _(q.value),
|
|
2125
2121
|
"aria-label": "Media gallery"
|
|
2126
|
-
}, [(b(!0), s(e, null, S(
|
|
2122
|
+
}, [(b(!0), s(e, null, S(ae.value, ({ fetchPriority: e, item: n, index: r }) => (b(), a(rn, {
|
|
2127
2123
|
key: n.postId,
|
|
2128
2124
|
class: "masonry-item",
|
|
2129
2125
|
entering: t.enteringPostIds.has(n.postId),
|
|
@@ -2132,15 +2128,15 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2132
2128
|
"card-footer": t.cardFooter,
|
|
2133
2129
|
"card-header": t.cardHeader,
|
|
2134
2130
|
"media-card": t.mediaCard,
|
|
2135
|
-
"in-viewport":
|
|
2131
|
+
"in-viewport": ie.value.has(r),
|
|
2136
2132
|
index: r,
|
|
2137
2133
|
item: n,
|
|
2138
|
-
"item-style":
|
|
2134
|
+
"item-style": X(r),
|
|
2139
2135
|
interactive: "",
|
|
2140
2136
|
layout: "masonry",
|
|
2141
2137
|
"loaded-count": t.items.length,
|
|
2142
2138
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2143
|
-
"preview-state": t.previewStates.get(E(
|
|
2139
|
+
"preview-state": t.previewStates.get(E(U)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2144
2140
|
total: t.total,
|
|
2145
2141
|
onActivate: (e) => f("activate", n.postId, e),
|
|
2146
2142
|
onMediaChange: (e) => f("mediaChange", n.postId, e),
|
|
@@ -2172,8 +2168,8 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2172
2168
|
class: "masonry-bottom-space",
|
|
2173
2169
|
"aria-hidden": "true",
|
|
2174
2170
|
style: _({ flex: `0 0 ${t.masonry.bottomSpacePx}px` })
|
|
2175
|
-
}, null, 4)) : o("", !0)], 42,
|
|
2176
|
-
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext &&
|
|
2171
|
+
}, null, 4)) : o("", !0)], 42, ln),
|
|
2172
|
+
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext && re.value || !t.hasNext && t.canRetryEnd ? (b(), s("div", un, [u(oe, {
|
|
2177
2173
|
actions: t.feedFooterActions,
|
|
2178
2174
|
"can-retry-end": t.canRetryEnd,
|
|
2179
2175
|
"feed-footer": t.feedFooter,
|
|
@@ -2181,7 +2177,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2181
2177
|
"has-next": t.hasNext,
|
|
2182
2178
|
"is-loading": t.isLoadingMore,
|
|
2183
2179
|
"load-more-locked": t.loadMoreLocked,
|
|
2184
|
-
"show-load-more":
|
|
2180
|
+
"show-load-more": re.value,
|
|
2185
2181
|
state: t.state,
|
|
2186
2182
|
onLoadMore: r[0] ||= (e) => f("loadMore"),
|
|
2187
2183
|
onRetryEnd: r[1] ||= (e) => f("retryEnd")
|
|
@@ -2197,7 +2193,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2197
2193
|
"state"
|
|
2198
2194
|
])])) : o("", !0),
|
|
2199
2195
|
u(Le, {
|
|
2200
|
-
"content-size":
|
|
2196
|
+
"content-size": G.value.height,
|
|
2201
2197
|
"controls-id": m,
|
|
2202
2198
|
"scroll-element": p.value,
|
|
2203
2199
|
suspended: t.suspended
|
|
@@ -2208,28 +2204,27 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2208
2204
|
])
|
|
2209
2205
|
]));
|
|
2210
2206
|
}
|
|
2211
|
-
}),
|
|
2212
|
-
function
|
|
2207
|
+
}), hn = 300;
|
|
2208
|
+
function gn(e, t, n) {
|
|
2213
2209
|
let r = e.scrollTop;
|
|
2214
2210
|
if (n || Math.abs(r - t) <= 1) return e.scrollTop = t, Promise.resolve();
|
|
2215
2211
|
e.setAttribute("data-transitioning", "");
|
|
2216
|
-
let i = performance.now()
|
|
2212
|
+
let i = performance.now();
|
|
2217
2213
|
return new Promise((n) => {
|
|
2218
|
-
let
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
requestAnimationFrame(o);
|
|
2214
|
+
let a = (o) => {
|
|
2215
|
+
let s = Math.max(0, o - i), c = Math.min(1, s / hn), l = 1 - (1 - c) ** 3;
|
|
2216
|
+
if (e.scrollTop = r + (t - r) * l, c < 1) {
|
|
2217
|
+
requestAnimationFrame(a);
|
|
2223
2218
|
return;
|
|
2224
2219
|
}
|
|
2225
2220
|
e.removeAttribute("data-transitioning"), e.scrollTop = t, n();
|
|
2226
2221
|
};
|
|
2227
|
-
requestAnimationFrame(
|
|
2222
|
+
requestAnimationFrame(a);
|
|
2228
2223
|
});
|
|
2229
2224
|
}
|
|
2230
2225
|
//#endregion
|
|
2231
2226
|
//#region src/components/ReelAutoAdvanceProgress.vue?vue&type=script&setup=true&lang.ts
|
|
2232
|
-
var
|
|
2227
|
+
var _n = ["aria-label"], vn = /* @__PURE__ */ d({
|
|
2233
2228
|
__name: "ReelAutoAdvanceProgress",
|
|
2234
2229
|
props: {
|
|
2235
2230
|
durationMs: {},
|
|
@@ -2247,9 +2242,9 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2247
2242
|
class: "reel-auto-advance-progress",
|
|
2248
2243
|
style: _(a.value),
|
|
2249
2244
|
onAnimationend: n[0] ||= (e) => i("complete")
|
|
2250
|
-
}, null, 36)], 8,
|
|
2245
|
+
}, null, 36)], 8, _n));
|
|
2251
2246
|
}
|
|
2252
|
-
}),
|
|
2247
|
+
}), yn = { class: "reel-viewport" }, bn = ["data-active-post-id", "data-active-media-index"], xn = ["role", "data-status"], Sn = ["disabled"], Cn = 300, wn = 250, Tn = /* @__PURE__ */ d({
|
|
2253
2248
|
__name: "ReelFeed",
|
|
2254
2249
|
props: {
|
|
2255
2250
|
initialPostId: {},
|
|
@@ -2299,10 +2294,10 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2299
2294
|
}), F = r(() => u.items[x.value]?.postId), I = r(() => u.items[x.value]), R = r(() => {
|
|
2300
2295
|
let e = F.value;
|
|
2301
2296
|
return e === void 0 ? 0 : u.mediaIndices.get(e) ?? 0;
|
|
2302
|
-
}),
|
|
2297
|
+
}), ee = r(() => {
|
|
2303
2298
|
let e = F.value;
|
|
2304
|
-
return e === void 0 ? "loading" : u.previewStates.get(
|
|
2305
|
-
}),
|
|
2299
|
+
return e === void 0 ? "loading" : u.previewStates.get(U(e, R.value)) ?? "loading";
|
|
2300
|
+
}), z = r(() => I.value ? H(I.value, R.value) : null), V = r(() => z.value ? te(z.value, u.mediaSource ?? "preview") : null), W = r(() => ee.value === "ready" && !!(V.value && L(V.value.type, V.value.src))), G = r(() => [
|
|
2306
2301
|
F.value,
|
|
2307
2302
|
R.value,
|
|
2308
2303
|
u.items.length,
|
|
@@ -2310,14 +2305,14 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2310
2305
|
u.reelAutoAdvance.enabled,
|
|
2311
2306
|
u.reelAutoAdvance.includePostItems,
|
|
2312
2307
|
u.reelAutoAdvance.intervalMs
|
|
2313
|
-
].join(":")),
|
|
2314
|
-
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && R.value <
|
|
2308
|
+
].join(":")), ne = r(() => {
|
|
2309
|
+
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && R.value < B(e).length - 1), n = u.reelAutoAdvance.intervalMs / 1e3;
|
|
2315
2310
|
return `Auto advance to the next ${t ? "post item" : "post"} in ${n}s`;
|
|
2316
|
-
}),
|
|
2317
|
-
function
|
|
2311
|
+
}), K = r(() => u.reelAutoAdvance.enabled && u.reelForward.status === "idle" && I.value !== void 0 && ee.value !== "loading" && !W.value), q = r(() => !u.infiniteScroll || u.items.length <= 1), re = r(() => u.reelForward.status === "end" && u.hasNext && !u.infiniteScroll && !u.loadMoreLocked), ie = r(() => u.reelForward.status === "loading" ? "Loading the next media…" : u.reelForward.status === "error" ? "Unable to load the next media." : re.value ? "Load the next page to continue." : "You reached the end of this feed.");
|
|
2312
|
+
function ae(e) {
|
|
2318
2313
|
return { gridRow: `${e + 1}` };
|
|
2319
2314
|
}
|
|
2320
|
-
function
|
|
2315
|
+
function J(e) {
|
|
2321
2316
|
let t = k || e.clientHeight;
|
|
2322
2317
|
return t <= 0 || u.items.length === 0 ? 0 : Math.min(u.items.length - 1, Math.max(0, Math.round(e.scrollTop / t)));
|
|
2323
2318
|
}
|
|
@@ -2325,11 +2320,11 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2325
2320
|
let t = e.currentTarget;
|
|
2326
2321
|
if (!t) return;
|
|
2327
2322
|
let n = k || t.clientHeight, r = Math.max(0, u.items.length - 1) * n;
|
|
2328
|
-
C.value = u.items.length > 0 && t.scrollTop > r + 1, D.value
|
|
2323
|
+
C.value = u.items.length > 0 && t.scrollTop > r + 1, !D.value && !t.hasAttribute("data-transitioning") && (x.value = J(t)), Date.now() >= l && !u.loadMoreLocked && u.infiniteScroll && ue(t) && d("loadMore");
|
|
2329
2324
|
}
|
|
2330
2325
|
function ce() {
|
|
2331
2326
|
let e = f.value;
|
|
2332
|
-
e && (C.value = !1,
|
|
2327
|
+
e && (C.value = !1, X(!0), k = e.clientHeight, e.scrollTop = x.value * k, j !== null && cancelAnimationFrame(j), j = requestAnimationFrame(() => {
|
|
2333
2328
|
e.scrollTop = x.value * e.clientHeight, k = e.clientHeight, j = null;
|
|
2334
2329
|
}), le());
|
|
2335
2330
|
}
|
|
@@ -2337,28 +2332,28 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2337
2332
|
M !== null && clearTimeout(M), M = setTimeout(() => {
|
|
2338
2333
|
M = null;
|
|
2339
2334
|
let e = f.value;
|
|
2340
|
-
e && (k = e.clientHeight, e.scrollTop = x.value * k),
|
|
2335
|
+
e && (k = e.clientHeight, e.scrollTop = x.value * k), X(!1);
|
|
2341
2336
|
}, 120);
|
|
2342
2337
|
}
|
|
2343
|
-
function
|
|
2344
|
-
|
|
2338
|
+
function Y() {
|
|
2339
|
+
X(!0);
|
|
2345
2340
|
let e = f.value;
|
|
2346
2341
|
e && (k = e.clientHeight, e.scrollTop = x.value * k), le();
|
|
2347
2342
|
}
|
|
2348
|
-
function
|
|
2343
|
+
function X(e) {
|
|
2349
2344
|
D.value = e, f.value?.toggleAttribute("data-resizing", e);
|
|
2350
2345
|
}
|
|
2351
|
-
function
|
|
2346
|
+
function de() {
|
|
2352
2347
|
let e = f.value;
|
|
2353
|
-
Date.now() >= l && !u.loadMoreLocked && e &&
|
|
2348
|
+
Date.now() >= l && !u.loadMoreLocked && e && ue(e) && d("loadMore");
|
|
2354
2349
|
}
|
|
2355
2350
|
O(() => u.items.length, (e, t) => {
|
|
2356
|
-
e > 0 && e < t && (l = Date.now() +
|
|
2351
|
+
e > 0 && e < t && (l = Date.now() + wn);
|
|
2357
2352
|
});
|
|
2358
|
-
function
|
|
2353
|
+
function Z(e) {
|
|
2359
2354
|
let t = I.value;
|
|
2360
2355
|
if (!t) return !1;
|
|
2361
|
-
let n =
|
|
2356
|
+
let n = B(t).length;
|
|
2362
2357
|
if (n <= 1) return !1;
|
|
2363
2358
|
let r = (R.value + e + n) % n;
|
|
2364
2359
|
return d("mediaChange", t.postId, r), !0;
|
|
@@ -2378,7 +2373,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2378
2373
|
let t = f.value;
|
|
2379
2374
|
if (!t) return Promise.resolve();
|
|
2380
2375
|
let n = e * (k || t.clientHeight);
|
|
2381
|
-
return x.value = e,
|
|
2376
|
+
return x.value = e, gn(t, n, Q());
|
|
2382
2377
|
}
|
|
2383
2378
|
function he(e) {
|
|
2384
2379
|
me(e);
|
|
@@ -2388,13 +2383,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2388
2383
|
return t < 0 || t === x.value ? !1 : (await me(t), !0);
|
|
2389
2384
|
}
|
|
2390
2385
|
async function _e(e) {
|
|
2391
|
-
return
|
|
2386
|
+
return Z(e) ? (Q() || await new Promise((e) => setTimeout(e, Cn)), !0) : !1;
|
|
2392
2387
|
}
|
|
2393
2388
|
function ve() {
|
|
2394
2389
|
if (!u.reelAutoAdvance.enabled) return;
|
|
2395
2390
|
let e = I.value;
|
|
2396
2391
|
if (!e) return;
|
|
2397
|
-
if (u.reelAutoAdvance.includePostItems && R.value <
|
|
2392
|
+
if (u.reelAutoAdvance.includePostItems && R.value < B(e).length - 1) {
|
|
2398
2393
|
d("mediaChange", e.postId, R.value + 1);
|
|
2399
2394
|
return;
|
|
2400
2395
|
}
|
|
@@ -2406,7 +2401,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2406
2401
|
u.reelAutoAdvance.includePostItems && (u.mediaIndices.get(n.postId) ?? 0) !== 0 && d("mediaChange", n.postId, 0), he(t);
|
|
2407
2402
|
}
|
|
2408
2403
|
function ye(e, t) {
|
|
2409
|
-
!u.reelAutoAdvance.enabled || e !== F.value || t !== R.value || !
|
|
2404
|
+
!u.reelAutoAdvance.enabled || e !== F.value || t !== R.value || !W.value || ve();
|
|
2410
2405
|
}
|
|
2411
2406
|
return O(f, (e) => {
|
|
2412
2407
|
A?.disconnect(), A = null, e && (k = e.clientHeight, !(typeof ResizeObserver > "u") && (A = new ResizeObserver(ce), A.observe(e)));
|
|
@@ -2416,14 +2411,14 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2416
2411
|
}), O(F, (e) => {
|
|
2417
2412
|
e !== void 0 && d("activeChange", e);
|
|
2418
2413
|
}, { immediate: !0 }), y(() => {
|
|
2419
|
-
window.addEventListener("resize",
|
|
2414
|
+
window.addEventListener("resize", Y), window.addEventListener("orientationchange", Y), g >= 0 && m(ce);
|
|
2420
2415
|
}), v(() => {
|
|
2421
|
-
window.removeEventListener("resize",
|
|
2416
|
+
window.removeEventListener("resize", Y), window.removeEventListener("orientationchange", Y), A?.disconnect(), j !== null && cancelAnimationFrame(j), M !== null && clearTimeout(M);
|
|
2422
2417
|
}), n({
|
|
2423
2418
|
activeIndex: x,
|
|
2424
2419
|
activePostId: F,
|
|
2425
|
-
changeActiveMedia:
|
|
2426
|
-
loadIfNearBottom:
|
|
2420
|
+
changeActiveMedia: Z,
|
|
2421
|
+
loadIfNearBottom: de,
|
|
2427
2422
|
moveActivePost: fe,
|
|
2428
2423
|
navigateToItem: pe,
|
|
2429
2424
|
transitionActiveMedia: _e,
|
|
@@ -2435,7 +2430,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2435
2430
|
}]),
|
|
2436
2431
|
"data-layout-mode": "reel"
|
|
2437
2432
|
}, [
|
|
2438
|
-
t.cardHeader && I.value && t.reelForward.status === "idle" ? (b(), a(
|
|
2433
|
+
t.cardHeader && I.value && t.reelForward.status === "idle" ? (b(), a(nt, {
|
|
2439
2434
|
key: 0,
|
|
2440
2435
|
index: x.value,
|
|
2441
2436
|
item: I.value,
|
|
@@ -2457,7 +2452,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2457
2452
|
"style",
|
|
2458
2453
|
"total"
|
|
2459
2454
|
])) : o("", !0),
|
|
2460
|
-
c("div",
|
|
2455
|
+
c("div", yn, [c("div", {
|
|
2461
2456
|
ref_key: "galleryElement",
|
|
2462
2457
|
ref: f,
|
|
2463
2458
|
class: "gallery-shell reel-feed",
|
|
@@ -2469,7 +2464,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2469
2464
|
class: "reel-track",
|
|
2470
2465
|
style: _(N.value),
|
|
2471
2466
|
"aria-label": "Media gallery"
|
|
2472
|
-
}, [(b(!0), s(e, null, S(P.value, ({ fetchPriority: e, item: n, index: i }) => (b(), a(
|
|
2467
|
+
}, [(b(!0), s(e, null, S(P.value, ({ fetchPriority: e, item: n, index: i }) => (b(), a(rn, {
|
|
2473
2468
|
key: n.postId,
|
|
2474
2469
|
active: i === x.value && !C.value,
|
|
2475
2470
|
"advance-on-media-end": u.reelAutoAdvance.enabled && i === x.value,
|
|
@@ -2478,13 +2473,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2478
2473
|
"fetch-priority": e,
|
|
2479
2474
|
index: i,
|
|
2480
2475
|
item: n,
|
|
2481
|
-
"item-style":
|
|
2476
|
+
"item-style": ae(i),
|
|
2482
2477
|
"media-card": t.mediaCard,
|
|
2483
2478
|
layout: "reel",
|
|
2484
2479
|
"loaded-count": t.items.length,
|
|
2485
2480
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2486
2481
|
"media-source": t.mediaSource,
|
|
2487
|
-
"preview-state": t.previewStates.get(E(
|
|
2482
|
+
"preview-state": t.previewStates.get(E(U)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2488
2483
|
"reel-controls-target": p.value,
|
|
2489
2484
|
"reel-audio-state": t.reelAudioState,
|
|
2490
2485
|
"stationary-reel-controls": "",
|
|
@@ -2520,13 +2515,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2520
2515
|
class: "reel-forward-status",
|
|
2521
2516
|
role: t.reelForward.status === "error" ? "alert" : "status",
|
|
2522
2517
|
"data-status": t.reelForward.status
|
|
2523
|
-
}, [c("p", null, T(
|
|
2518
|
+
}, [c("p", null, T(ie.value), 1), t.reelForward.status === "error" || t.reelForward.status === "end" ? (b(), s("button", {
|
|
2524
2519
|
key: 0,
|
|
2525
2520
|
class: "reel-forward-retry",
|
|
2526
2521
|
type: "button",
|
|
2527
2522
|
disabled: t.loadMoreLocked,
|
|
2528
2523
|
onClick: r[0] ||= (e) => d("retryForward")
|
|
2529
|
-
}, T(
|
|
2524
|
+
}, T(re.value ? "Load more" : "Retry"), 9, Sn)) : o("", !0)], 8, xn)), t.reelForward.status === "idle" ? (b(), a(oe, {
|
|
2530
2525
|
key: 2,
|
|
2531
2526
|
actions: t.feedFooterActions,
|
|
2532
2527
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -2535,7 +2530,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2535
2530
|
"has-next": t.hasNext,
|
|
2536
2531
|
"is-loading": t.isLoadingMore,
|
|
2537
2532
|
"load-more-locked": t.loadMoreLocked,
|
|
2538
|
-
"show-load-more":
|
|
2533
|
+
"show-load-more": q.value,
|
|
2539
2534
|
state: t.state,
|
|
2540
2535
|
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2541
2536
|
onRetryEnd: r[3] ||= (e) => d("retryEnd")
|
|
@@ -2549,13 +2544,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2549
2544
|
"load-more-locked",
|
|
2550
2545
|
"show-load-more",
|
|
2551
2546
|
"state"
|
|
2552
|
-
])) : o("", !0)], 40,
|
|
2547
|
+
])) : o("", !0)], 40, bn), c("div", {
|
|
2553
2548
|
ref_key: "reelControlsElement",
|
|
2554
2549
|
ref: p,
|
|
2555
2550
|
class: "reel-media-controls-host",
|
|
2556
2551
|
"data-test": "reel-media-controls-host"
|
|
2557
2552
|
}, null, 512)]),
|
|
2558
|
-
t.cardFooter && I.value && t.reelForward.status === "idle" ? (b(), a(
|
|
2553
|
+
t.cardFooter && I.value && t.reelForward.status === "idle" ? (b(), a(nt, {
|
|
2559
2554
|
key: 1,
|
|
2560
2555
|
index: x.value,
|
|
2561
2556
|
item: I.value,
|
|
@@ -2577,26 +2572,27 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2577
2572
|
"style",
|
|
2578
2573
|
"total"
|
|
2579
2574
|
])) : o("", !0),
|
|
2580
|
-
|
|
2581
|
-
key:
|
|
2575
|
+
K.value ? (b(), a(vn, {
|
|
2576
|
+
key: G.value,
|
|
2582
2577
|
"duration-ms": t.reelAutoAdvance.intervalMs,
|
|
2583
|
-
label:
|
|
2578
|
+
label: ne.value,
|
|
2584
2579
|
onComplete: ve
|
|
2585
2580
|
}, null, 8, ["duration-ms", "label"])) : o("", !0)
|
|
2586
2581
|
], 2));
|
|
2587
2582
|
}
|
|
2588
|
-
}),
|
|
2583
|
+
}), En = ["data-info-sheet-open", "data-info-sheet-mode"], Dn = ["aria-hidden", "inert"], On = {
|
|
2589
2584
|
key: 0,
|
|
2590
2585
|
class: "reel-info-sheet-layer",
|
|
2591
2586
|
"data-test": "reel-info-sheet"
|
|
2592
|
-
},
|
|
2587
|
+
}, kn = [
|
|
2593
2588
|
"role",
|
|
2594
2589
|
"aria-modal",
|
|
2595
2590
|
"tabindex",
|
|
2596
2591
|
"data-active-post-id"
|
|
2597
|
-
],
|
|
2592
|
+
], An = /* @__PURE__ */ d({
|
|
2598
2593
|
__name: "ReelLayout",
|
|
2599
2594
|
props: {
|
|
2595
|
+
entryPending: { type: Boolean },
|
|
2600
2596
|
forwardIndex: { default: null },
|
|
2601
2597
|
forwardItem: { default: null },
|
|
2602
2598
|
infoSheet: {},
|
|
@@ -2655,9 +2651,9 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2655
2651
|
item: e,
|
|
2656
2652
|
layout: "reel",
|
|
2657
2653
|
loadedCount: l.items.length,
|
|
2658
|
-
mediaCount:
|
|
2654
|
+
mediaCount: B(e).length,
|
|
2659
2655
|
mediaIndex: D.value,
|
|
2660
|
-
mediaItem:
|
|
2656
|
+
mediaItem: H(e, D.value),
|
|
2661
2657
|
mediaSource: l.mediaSource ?? "preview",
|
|
2662
2658
|
origin: l.origin,
|
|
2663
2659
|
total: l.total
|
|
@@ -2684,13 +2680,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2684
2680
|
function R(e) {
|
|
2685
2681
|
return p.value?.transitionActivePost(e) ?? Promise.resolve(!1);
|
|
2686
2682
|
}
|
|
2687
|
-
function
|
|
2683
|
+
function ee(e, t) {
|
|
2688
2684
|
d("error", e, t);
|
|
2689
2685
|
}
|
|
2690
|
-
function
|
|
2686
|
+
function z(e, t) {
|
|
2691
2687
|
d("mediaChange", e, t);
|
|
2692
2688
|
}
|
|
2693
|
-
function
|
|
2689
|
+
function te(e, t) {
|
|
2694
2690
|
d("ready", e, t);
|
|
2695
2691
|
}
|
|
2696
2692
|
return O(() => ({
|
|
@@ -2721,8 +2717,8 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2721
2717
|
}, [c("div", {
|
|
2722
2718
|
class: "reel-layout-main",
|
|
2723
2719
|
"aria-hidden": e.infoSheetOverlay && A.value || void 0,
|
|
2724
|
-
inert: e.infoSheetOverlay && A.value || void 0
|
|
2725
|
-
}, [u(
|
|
2720
|
+
inert: e.entryPending || e.infoSheetOverlay && A.value || void 0
|
|
2721
|
+
}, [u(Tn, {
|
|
2726
2722
|
ref_key: "reelFeed",
|
|
2727
2723
|
ref: p,
|
|
2728
2724
|
"can-retry-end": e.canRetryEnd,
|
|
@@ -2747,11 +2743,11 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2747
2743
|
state: e.state,
|
|
2748
2744
|
total: e.total,
|
|
2749
2745
|
onActiveChange: r[0] ||= (e) => d("activeChange", e),
|
|
2750
|
-
onError:
|
|
2746
|
+
onError: ee,
|
|
2751
2747
|
onMediaError: r[1] ||= (e, t) => d("mediaError", e, t),
|
|
2752
2748
|
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2753
|
-
onMediaChange:
|
|
2754
|
-
onReady:
|
|
2749
|
+
onMediaChange: z,
|
|
2750
|
+
onReady: te,
|
|
2755
2751
|
onRetryEnd: r[3] ||= (e) => d("retryEnd"),
|
|
2756
2752
|
onRetryForward: r[4] ||= (e) => d("retryForward"),
|
|
2757
2753
|
onReelAudioChange: r[5] ||= (e) => d("reelAudioChange", e)
|
|
@@ -2777,8 +2773,8 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2777
2773
|
"reel-forward",
|
|
2778
2774
|
"state",
|
|
2779
2775
|
"total"
|
|
2780
|
-
])], 8,
|
|
2781
|
-
default: k(() => [A.value && e.infoSheet && j.value ? (b(), s("div",
|
|
2776
|
+
])], 8, Dn), u(n, { name: "vibe-info-sheet" }, {
|
|
2777
|
+
default: k(() => [A.value && e.infoSheet && j.value ? (b(), s("div", On, [c("aside", {
|
|
2782
2778
|
ref_key: "sheetElement",
|
|
2783
2779
|
ref: _,
|
|
2784
2780
|
class: "reel-info-sheet",
|
|
@@ -2787,17 +2783,32 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2787
2783
|
"aria-modal": e.infoSheetOverlay ? "true" : void 0,
|
|
2788
2784
|
tabindex: e.infoSheetOverlay ? -1 : void 0,
|
|
2789
2785
|
"data-active-post-id": T.value?.postId
|
|
2790
|
-
}, [(b(), a(C(e.infoSheet.component), g(f(j.value)), null, 16))], 8,
|
|
2786
|
+
}, [(b(), a(C(e.infoSheet.component), g(f(j.value)), null, 16))], 8, kn)])) : o("", !0)]),
|
|
2791
2787
|
_: 1
|
|
2792
|
-
})], 10,
|
|
2793
|
-
}
|
|
2794
|
-
})
|
|
2788
|
+
})], 10, En));
|
|
2789
|
+
}
|
|
2790
|
+
}), jn = (e, t) => {
|
|
2791
|
+
let n = e.__vccOpts || e;
|
|
2792
|
+
for (let [e, r] of t) n[e] = r;
|
|
2793
|
+
return n;
|
|
2794
|
+
}, Mn = {}, Nn = {
|
|
2795
|
+
class: "vibe-reel-entry-spinner",
|
|
2796
|
+
role: "status",
|
|
2797
|
+
"aria-label": "Loading media"
|
|
2798
|
+
};
|
|
2799
|
+
function Pn(e, t) {
|
|
2800
|
+
return b(), s("div", Nn, [...t[0] ||= [c("span", {
|
|
2801
|
+
class: "vibe-reel-entry-spinner-ring",
|
|
2802
|
+
"aria-hidden": "true"
|
|
2803
|
+
}, null, -1)]]);
|
|
2804
|
+
}
|
|
2805
|
+
var Fn = /* @__PURE__ */ jn(Mn, [["render", Pn]]);
|
|
2795
2806
|
//#endregion
|
|
2796
2807
|
//#region src/core/mediaLifecycle.ts
|
|
2797
|
-
function
|
|
2808
|
+
function In(e, t, n, r, i) {
|
|
2798
2809
|
let a = e.items.findIndex((e) => e.postId === t), o = e.items[a];
|
|
2799
2810
|
if (!o) return null;
|
|
2800
|
-
let s =
|
|
2811
|
+
let s = V(o, n), c = H(o, s);
|
|
2801
2812
|
return {
|
|
2802
2813
|
item: o,
|
|
2803
2814
|
layout: r,
|
|
@@ -2810,7 +2821,7 @@ function Mn(e, t, n, r, i) {
|
|
|
2810
2821
|
postIndex: a
|
|
2811
2822
|
};
|
|
2812
2823
|
}
|
|
2813
|
-
function
|
|
2824
|
+
function Ln(e, t) {
|
|
2814
2825
|
O(() => {
|
|
2815
2826
|
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null;
|
|
2816
2827
|
return {
|
|
@@ -2820,23 +2831,23 @@ function Nn(e, t) {
|
|
|
2820
2831
|
};
|
|
2821
2832
|
}, (n, r) => {
|
|
2822
2833
|
if (n.postId === null || n.postId === r?.postId && n.mediaIndex === r.mediaIndex && n.origin === r.origin) return;
|
|
2823
|
-
let i =
|
|
2834
|
+
let i = In(e, n.postId, n.mediaIndex, "reel", n.origin);
|
|
2824
2835
|
i && t(i);
|
|
2825
2836
|
}, { flush: "sync" });
|
|
2826
2837
|
}
|
|
2827
2838
|
//#endregion
|
|
2828
2839
|
//#region src/components/useMediaLifecycle.ts
|
|
2829
|
-
function
|
|
2830
|
-
let n = /* @__PURE__ */ new Set(), i = w(/* @__PURE__ */ new Map()), a = w(/* @__PURE__ */ new Map()), o = w(/* @__PURE__ */ new Map()), s = () => e.reelMediaSource === "preview" ? i : e.reelMediaSource === "mobile" ? o : a, c = r(() => s().value), l = /* @__PURE__ */ new Set();
|
|
2840
|
+
function Rn(e, t) {
|
|
2841
|
+
let n = /* @__PURE__ */ new Set(), i = w(/* @__PURE__ */ new Map()), a = w(/* @__PURE__ */ new Map()), o = w(/* @__PURE__ */ new Map()), s = () => e.reelOrigin === "masonry" ? a : e.reelMediaSource === "preview" ? i : e.reelMediaSource === "mobile" ? o : a, c = r(() => s().value), l = /* @__PURE__ */ new Set();
|
|
2831
2842
|
function u() {
|
|
2832
2843
|
n.clear(), l.clear(), i.value = /* @__PURE__ */ new Map(), a.value = /* @__PURE__ */ new Map(), o.value = /* @__PURE__ */ new Map();
|
|
2833
2844
|
}
|
|
2834
2845
|
function d(e, t, n, r) {
|
|
2835
|
-
let i =
|
|
2846
|
+
let i = U(t, n);
|
|
2836
2847
|
e.value.get(i) !== r && (e.value = new Map(e.value).set(i, r));
|
|
2837
2848
|
}
|
|
2838
2849
|
function f(t, n, r, i) {
|
|
2839
|
-
return
|
|
2850
|
+
return In(e, t, n, r, i);
|
|
2840
2851
|
}
|
|
2841
2852
|
function p(e, n, r, i) {
|
|
2842
2853
|
let a = f(e, n, r, i);
|
|
@@ -2862,13 +2873,13 @@ function Pn(e, t) {
|
|
|
2862
2873
|
d(s(), t, n, "ready"), p(t, n, "reel", e.reelOrigin ?? "reel");
|
|
2863
2874
|
}
|
|
2864
2875
|
function y(e, n) {
|
|
2865
|
-
let r =
|
|
2876
|
+
let r = U(e, n);
|
|
2866
2877
|
if (l.has(r)) return;
|
|
2867
2878
|
let i = f(e, n, "masonry", null);
|
|
2868
2879
|
i && (l.add(r), t.visible(i));
|
|
2869
2880
|
}
|
|
2870
2881
|
function b(e, r, i, a) {
|
|
2871
|
-
let o = [i,
|
|
2882
|
+
let o = [i, U(e, r)].join(":");
|
|
2872
2883
|
if (n.has(o)) return;
|
|
2873
2884
|
let s = f(e, r, i, a);
|
|
2874
2885
|
s && (n.add(o), t.fullyVisible(s));
|
|
@@ -2876,13 +2887,13 @@ function Pn(e, t) {
|
|
|
2876
2887
|
function x(e, t) {
|
|
2877
2888
|
b(e, t, "masonry", null);
|
|
2878
2889
|
}
|
|
2879
|
-
return
|
|
2890
|
+
return Ln(e, t.reelChange), O(() => {
|
|
2880
2891
|
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null, n = t === null ? 0 : e.mediaIndices.get(t) ?? 0;
|
|
2881
2892
|
return {
|
|
2882
2893
|
mediaIndex: n,
|
|
2883
2894
|
origin: e.reelOrigin ?? "reel",
|
|
2884
2895
|
postId: t,
|
|
2885
|
-
ready: t !== null && c.value.get(
|
|
2896
|
+
ready: t !== null && c.value.get(U(t, n)) === "ready"
|
|
2886
2897
|
};
|
|
2887
2898
|
}, (e, t) => {
|
|
2888
2899
|
e.postId === null || !e.ready || t?.ready && t.postId === e.postId && t.mediaIndex === e.mediaIndex && t.origin === e.origin || b(e.postId, e.mediaIndex, "reel", e.origin);
|
|
@@ -2902,66 +2913,111 @@ function Pn(e, t) {
|
|
|
2902
2913
|
}
|
|
2903
2914
|
//#endregion
|
|
2904
2915
|
//#region src/core/reelEscapeStack.ts
|
|
2905
|
-
var
|
|
2906
|
-
function
|
|
2907
|
-
return
|
|
2908
|
-
let t =
|
|
2909
|
-
t >= 0 &&
|
|
2916
|
+
var zn = [];
|
|
2917
|
+
function Bn(e) {
|
|
2918
|
+
return zn.push(e), () => {
|
|
2919
|
+
let t = zn.indexOf(e);
|
|
2920
|
+
t >= 0 && zn.splice(t, 1);
|
|
2910
2921
|
};
|
|
2911
2922
|
}
|
|
2912
|
-
function
|
|
2923
|
+
function Vn(e) {
|
|
2913
2924
|
if (!e.isActive()) return !1;
|
|
2914
|
-
let t =
|
|
2915
|
-
|
|
2925
|
+
let t = zn.filter((e) => e.isActive()), n = e.element();
|
|
2926
|
+
if (n !== null && t.some((t) => {
|
|
2916
2927
|
if (t === e) return !1;
|
|
2917
2928
|
let r = t.element();
|
|
2918
2929
|
return r !== null && n.contains(r);
|
|
2919
|
-
})
|
|
2930
|
+
})) return !1;
|
|
2931
|
+
let r = t.filter((e) => {
|
|
2920
2932
|
let n = e.element();
|
|
2921
2933
|
return n === null || !t.some((t) => {
|
|
2922
2934
|
if (t === e) return !1;
|
|
2923
2935
|
let r = t.element();
|
|
2924
2936
|
return r !== null && n.contains(r);
|
|
2925
2937
|
});
|
|
2926
|
-
})
|
|
2938
|
+
});
|
|
2939
|
+
return (r.filter((e) => e.element()?.contains(document.activeElement)).at(-1) ?? r.at(-1)) === e;
|
|
2927
2940
|
}
|
|
2928
2941
|
//#endregion
|
|
2929
2942
|
//#region src/components/useReelKeyboard.ts
|
|
2930
|
-
function
|
|
2943
|
+
function Hn(e) {
|
|
2931
2944
|
let t = {
|
|
2932
2945
|
element: e.element,
|
|
2933
2946
|
isActive: () => e.state.layout === "reel" || e.state.reelOrigin === "masonry"
|
|
2934
2947
|
}, n = null;
|
|
2935
2948
|
function r(n) {
|
|
2936
|
-
|
|
2937
|
-
|
|
2949
|
+
if (n.defaultPrevented) return;
|
|
2950
|
+
let r = n.target, i = r instanceof Element ? r.closest("dialog, [role=\"dialog\"], [role=\"alertdialog\"]") : null;
|
|
2951
|
+
if (n.key === "Escape" && i && !e.element()?.contains(i)) return;
|
|
2952
|
+
let a = t.isActive();
|
|
2953
|
+
if (n.key === "Escape" && a && !Vn(t)) return;
|
|
2938
2954
|
if (n.key === "Escape" && e.state.reelOrigin === "masonry") {
|
|
2939
2955
|
n.preventDefault(), e.state.reelInfoSheetOverlay && e.state.reelInfoSheet.enabled && e.setReelInfoSheet(!1), e.closeMasonryReel();
|
|
2940
2956
|
return;
|
|
2941
2957
|
}
|
|
2942
|
-
if (n.key === "Escape" &&
|
|
2958
|
+
if (n.key === "Escape" && a && e.state.reelInfoSheet.enabled) {
|
|
2943
2959
|
n.preventDefault(), e.setReelInfoSheet(!1);
|
|
2944
2960
|
return;
|
|
2945
2961
|
}
|
|
2946
|
-
if (n.
|
|
2947
|
-
let i = n.target;
|
|
2948
|
-
if (i instanceof HTMLElement && (i.isContentEditable || [
|
|
2962
|
+
if (n.altKey || n.ctrlKey || n.metaKey || n.shiftKey || e.isReelLeaving() || !a || r instanceof HTMLElement && (r.isContentEditable || [
|
|
2949
2963
|
"INPUT",
|
|
2950
2964
|
"SELECT",
|
|
2951
2965
|
"TEXTAREA"
|
|
2952
|
-
].includes(
|
|
2953
|
-
let
|
|
2954
|
-
|
|
2966
|
+
].includes(r.tagName))) return;
|
|
2967
|
+
let o = n.key === "ArrowLeft" ? -1 : n.key === "ArrowRight" ? 1 : 0;
|
|
2968
|
+
o !== 0 && e.reelRenderer()?.changeActiveMedia?.(o) && n.preventDefault();
|
|
2955
2969
|
}
|
|
2956
2970
|
y(() => {
|
|
2957
|
-
n =
|
|
2971
|
+
n = Bn(t), window.addEventListener("keydown", r);
|
|
2958
2972
|
}), v(() => {
|
|
2959
2973
|
window.removeEventListener("keydown", r), n?.(), n = null;
|
|
2960
2974
|
});
|
|
2961
2975
|
}
|
|
2962
2976
|
//#endregion
|
|
2977
|
+
//#region src/components/useReelEntryReveal.ts
|
|
2978
|
+
function Un(e, t) {
|
|
2979
|
+
let n = w("waiting"), i = typeof matchMedia == "function" ? matchMedia("(prefers-reduced-motion: reduce)") : null, a = !1, o = null, s = r(() => {
|
|
2980
|
+
let t = e.items.find((t) => t.postId === e.activeReelPostId);
|
|
2981
|
+
if (!t) return null;
|
|
2982
|
+
let n = e.mediaIndices.get(t.postId) ?? 0, r = H(t, n);
|
|
2983
|
+
return JSON.stringify([
|
|
2984
|
+
t.postId,
|
|
2985
|
+
n,
|
|
2986
|
+
r.src,
|
|
2987
|
+
r.type
|
|
2988
|
+
]);
|
|
2989
|
+
});
|
|
2990
|
+
function c() {
|
|
2991
|
+
if (e.reelOrigin !== "masonry" || !a || n.value !== "waiting" || s.value === null || o !== s.value) return;
|
|
2992
|
+
let r = t.value?.querySelector(".reel-layout-main");
|
|
2993
|
+
r && (getComputedStyle(r).opacity, n.value = i?.matches ? "ready" : "revealing");
|
|
2994
|
+
}
|
|
2995
|
+
function l(t, n) {
|
|
2996
|
+
e.reelOrigin !== "masonry" || t !== e.activeReelPostId || n !== (e.mediaIndices.get(t) ?? 0) || (o = s.value, m(c));
|
|
2997
|
+
}
|
|
2998
|
+
function u() {
|
|
2999
|
+
a = !0, c();
|
|
3000
|
+
}
|
|
3001
|
+
function d(e) {
|
|
3002
|
+
e.target instanceof HTMLElement && e.target.matches(".reel-layout-main") && e.propertyName === "opacity" && n.value === "revealing" && (n.value = "ready");
|
|
3003
|
+
}
|
|
3004
|
+
function f() {
|
|
3005
|
+
i?.matches && n.value === "revealing" && (n.value = "ready");
|
|
3006
|
+
}
|
|
3007
|
+
return O(() => e.reelOrigin, (e) => {
|
|
3008
|
+
e === "masonry" && (a = !1, o = null, n.value = "waiting");
|
|
3009
|
+
}, { flush: "sync" }), O(s, () => {
|
|
3010
|
+
o = null, n.value === "revealing" && (n.value = "waiting");
|
|
3011
|
+
}, { flush: "sync" }), y(() => i?.addEventListener("change", f)), v(() => i?.removeEventListener("change", f)), {
|
|
3012
|
+
phase: n,
|
|
3013
|
+
finishSlide: u,
|
|
3014
|
+
finishFade: d,
|
|
3015
|
+
markSettled: l
|
|
3016
|
+
};
|
|
3017
|
+
}
|
|
3018
|
+
//#endregion
|
|
2963
3019
|
//#region src/components/VibeSurface.vue?vue&type=script&setup=true&lang.ts
|
|
2964
|
-
var
|
|
3020
|
+
var Wn = ["data-reel-entry"], Gn = 35, Kn = 420, qn = /* @__PURE__ */ d({
|
|
2965
3021
|
__name: "VibeSurface",
|
|
2966
3022
|
props: {
|
|
2967
3023
|
canRetryEnd: { type: Boolean },
|
|
@@ -2991,69 +3047,69 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
2991
3047
|
"retryForward"
|
|
2992
3048
|
],
|
|
2993
3049
|
setup(t, { expose: i, emit: c }) {
|
|
2994
|
-
let l = t, d = c, f = w(null), p = w(null), h = w(null), g = w(null), _ = w(!1), y = w(/* @__PURE__ */ new Set()), x = w(/* @__PURE__ */ new Map()), S = w(/* @__PURE__ */ new Set()), C = w(/* @__PURE__ */ new Map()), T = r(() => Object.freeze([...l.state.items])), D = r(() =>
|
|
3050
|
+
let l = t, d = c, f = w(null), p = w(null), h = w(null), g = w(null), _ = w(!1), y = w(/* @__PURE__ */ new Set()), x = w(/* @__PURE__ */ new Map()), S = w(/* @__PURE__ */ new Set()), C = w(/* @__PURE__ */ new Map()), T = r(() => Object.freeze([...l.state.items])), D = r(() => ne(l.state, T.value)), { markMediaError: A, markMasonryFullyVisible: j, markMasonryVisible: M, markPreviewError: N, markPreviewReady: P, markReelError: F, markReelReady: I, originalStates: L, previewStates: R, reelStates: ee, resetMediaLifecycle: z } = Rn(l.state, {
|
|
2995
3051
|
error: (e) => d("mediaError", e),
|
|
2996
3052
|
fullyVisible: (e) => d("mediaFullyVisible", e),
|
|
2997
3053
|
ready: (e) => d("mediaReady", e),
|
|
2998
3054
|
reelChange: (e) => d("reelMediaChange", e),
|
|
2999
3055
|
visible: (e) => d("mediaVisible", e)
|
|
3000
|
-
}),
|
|
3001
|
-
function
|
|
3056
|
+
}), { phase: te, finishSlide: H, finishFade: U, markSettled: W } = Un(l.state, h), G = new Set(l.state.items.map((e) => e.postId)), K = null, q = null, re = !1;
|
|
3057
|
+
function ie() {
|
|
3002
3058
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3003
3059
|
}
|
|
3004
|
-
function
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3060
|
+
function ae() {
|
|
3061
|
+
K !== null && cancelAnimationFrame(K), K = requestAnimationFrame(() => {
|
|
3062
|
+
K = requestAnimationFrame(() => {
|
|
3063
|
+
K = null, y.value = /* @__PURE__ */ new Set();
|
|
3008
3064
|
});
|
|
3009
3065
|
});
|
|
3010
3066
|
}
|
|
3011
3067
|
function J(e, t) {
|
|
3012
3068
|
let n = l.state.items.find((t) => t.postId === e);
|
|
3013
3069
|
if (!n) return;
|
|
3014
|
-
let r =
|
|
3070
|
+
let r = V(n, t);
|
|
3015
3071
|
(l.state.mediaIndices.get(e) ?? 0) !== r && (l.state.mediaIndices = new Map(l.state.mediaIndices).set(e, r));
|
|
3016
3072
|
}
|
|
3017
|
-
async function
|
|
3073
|
+
async function oe() {
|
|
3018
3074
|
await m(), (l.state.layout === "reel" || l.state.reelOrigin === "masonry" ? p.value : f.value)?.loadIfNearBottom();
|
|
3019
3075
|
}
|
|
3020
|
-
function
|
|
3076
|
+
function se(e) {
|
|
3021
3077
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.changeActiveMedia?.(e) ?? !1;
|
|
3022
3078
|
}
|
|
3023
|
-
function
|
|
3079
|
+
function ce(e) {
|
|
3024
3080
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.moveActivePost?.(e) ?? !1;
|
|
3025
3081
|
}
|
|
3026
|
-
function
|
|
3082
|
+
function ue(e) {
|
|
3027
3083
|
if (!(l.state.layout === "reel" || l.state.reelOrigin === "masonry") || l.state.isLoading) return "reel-inactive";
|
|
3028
3084
|
let t = l.state.items.find((t) => t.postId === e.postId);
|
|
3029
3085
|
if (!t) return "not-found";
|
|
3030
|
-
let n =
|
|
3086
|
+
let n = B(t).findIndex((t) => t.mediaId === e.mediaId);
|
|
3031
3087
|
return n < 0 ? "not-found" : p.value?.navigateToItem?.(e.postId, n) ? "navigated" : "reel-inactive";
|
|
3032
3088
|
}
|
|
3033
|
-
function
|
|
3089
|
+
function Y() {
|
|
3034
3090
|
return l.state.layout !== "masonry" || l.state.reelOrigin === "masonry" ? null : f.value?.getScrollElement?.() ?? null;
|
|
3035
3091
|
}
|
|
3036
|
-
function
|
|
3037
|
-
|
|
3092
|
+
function X(e, t) {
|
|
3093
|
+
q = e, re = t === "keyboard", d("openReel", e), m(() => h.value?.focus());
|
|
3038
3094
|
}
|
|
3039
|
-
function
|
|
3095
|
+
function de(e) {
|
|
3040
3096
|
let t = g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [];
|
|
3041
3097
|
return Array.from(t).find((t) => t.dataset.postId === String(e)) ?? null;
|
|
3042
3098
|
}
|
|
3043
|
-
function
|
|
3044
|
-
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null ||
|
|
3099
|
+
function Z(e, t) {
|
|
3100
|
+
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null || ie()) return 0;
|
|
3045
3101
|
let n = [...new Set(e)], r = new Set(Array.from(g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [], (e) => e.dataset.postId)), i = n.filter((e) => r.has(String(e)));
|
|
3046
3102
|
if (i.length === 0) return 0;
|
|
3047
|
-
let a = new Map(C.value), o = t?.staggerMs ??
|
|
3103
|
+
let a = new Map(C.value), o = t?.staggerMs ?? Gn;
|
|
3048
3104
|
return i.forEach((e, t) => {
|
|
3049
3105
|
a.set(e, t * o);
|
|
3050
|
-
}), y.value = new Set([...y.value].filter((e) => !i.includes(e))), S.value = new Set([...S.value, ...n]), C.value = a,
|
|
3106
|
+
}), y.value = new Set([...y.value].filter((e) => !i.includes(e))), S.value = new Set([...S.value, ...n]), C.value = a, Kn + (i.length - 1) * o;
|
|
3051
3107
|
}
|
|
3052
|
-
function
|
|
3108
|
+
function fe() {
|
|
3053
3109
|
S.value = /* @__PURE__ */ new Set(), C.value = /* @__PURE__ */ new Map();
|
|
3054
3110
|
}
|
|
3055
|
-
async function
|
|
3056
|
-
if (t.aborted ||
|
|
3111
|
+
async function pe(e, t) {
|
|
3112
|
+
if (t.aborted || Z(e, { staggerMs: 0 }) === 0 || (await m(), t.aborted)) return;
|
|
3057
3113
|
let n = g.value?.querySelectorAll(".masonry-feed .media-card--leaving") ?? [], r = Array.from(n).flatMap((e) => (getComputedStyle(e).opacity, e.getAnimations?.().filter((e) => e.effect?.getTiming().iterations !== Infinity) ?? []));
|
|
3058
3114
|
await new Promise((e) => {
|
|
3059
3115
|
let n = () => {
|
|
@@ -3062,23 +3118,23 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3062
3118
|
t.addEventListener("abort", n, { once: !0 }), t.aborted ? n() : Promise.allSettled(r.map((e) => e.finished)).then(n);
|
|
3063
3119
|
});
|
|
3064
3120
|
}
|
|
3065
|
-
function
|
|
3066
|
-
let n =
|
|
3121
|
+
function Q(e, t) {
|
|
3122
|
+
let n = de(e), r = n?.querySelector(".media-card-activator") ?? n;
|
|
3067
3123
|
r && (r.classList.toggle("media-card-focus-silent", !t), t || r.addEventListener("blur", () => {
|
|
3068
3124
|
r.classList.remove("media-card-focus-silent");
|
|
3069
3125
|
}, { once: !0 }), r?.focus({ preventScroll: !0 }));
|
|
3070
3126
|
}
|
|
3071
|
-
function
|
|
3072
|
-
l.state.reelOrigin === "masonry" && (
|
|
3127
|
+
function me() {
|
|
3128
|
+
l.state.reelOrigin === "masonry" && (q ??= l.state.activeReelPostId, _.value = !0, d("closeReel"));
|
|
3073
3129
|
}
|
|
3074
|
-
function
|
|
3075
|
-
let e =
|
|
3076
|
-
_.value = !1,
|
|
3077
|
-
e !== null &&
|
|
3130
|
+
function he() {
|
|
3131
|
+
let e = q, t = re;
|
|
3132
|
+
_.value = !1, q = null, re = !1, m(() => {
|
|
3133
|
+
e !== null && Q(e, t);
|
|
3078
3134
|
});
|
|
3079
3135
|
}
|
|
3080
|
-
return
|
|
3081
|
-
closeMasonryReel:
|
|
3136
|
+
return Hn({
|
|
3137
|
+
closeMasonryReel: me,
|
|
3082
3138
|
element: () => g.value,
|
|
3083
3139
|
isReelLeaving: () => _.value,
|
|
3084
3140
|
reelRenderer: () => p.value,
|
|
@@ -3088,34 +3144,34 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3088
3144
|
let e = l.state.items;
|
|
3089
3145
|
return [e, e.length];
|
|
3090
3146
|
}, ([e]) => {
|
|
3091
|
-
let t = e.map((e) => e.postId), n = t.filter((e) => !
|
|
3092
|
-
if (
|
|
3147
|
+
let t = e.map((e) => e.postId), n = t.filter((e) => !G.has(e)), r = new Set(t);
|
|
3148
|
+
if (G = new Set(t), S.value = new Set([...S.value].filter((e) => r.has(e))), C.value = new Map([...C.value].filter(([e]) => r.has(e))), n.length === 0 || ie()) return;
|
|
3093
3149
|
let i = /* @__PURE__ */ new Map();
|
|
3094
3150
|
t.forEach((e) => {
|
|
3095
3151
|
let t = x.value.get(e);
|
|
3096
3152
|
t !== void 0 && i.set(e, t);
|
|
3097
3153
|
}), n.forEach((e, t) => {
|
|
3098
|
-
i.set(e, t *
|
|
3099
|
-
}), x.value = i, y.value = new Set([...y.value, ...n]),
|
|
3154
|
+
i.set(e, t * Gn);
|
|
3155
|
+
}), x.value = i, y.value = new Set([...y.value, ...n]), ae();
|
|
3100
3156
|
}, { flush: "sync" }), v(() => {
|
|
3101
|
-
|
|
3157
|
+
K !== null && cancelAnimationFrame(K);
|
|
3102
3158
|
}), i({
|
|
3103
|
-
animateItemRemoval:
|
|
3104
|
-
cancelItemRemoval:
|
|
3105
|
-
changeActiveReelMedia:
|
|
3106
|
-
getAutoScrollElement:
|
|
3107
|
-
loadIfNearBottom:
|
|
3108
|
-
moveActiveReelPost:
|
|
3109
|
-
navigateToReelItem:
|
|
3110
|
-
resetMediaLifecycle:
|
|
3111
|
-
startItemRemoval:
|
|
3159
|
+
animateItemRemoval: pe,
|
|
3160
|
+
cancelItemRemoval: fe,
|
|
3161
|
+
changeActiveReelMedia: se,
|
|
3162
|
+
getAutoScrollElement: Y,
|
|
3163
|
+
loadIfNearBottom: oe,
|
|
3164
|
+
moveActiveReelPost: ce,
|
|
3165
|
+
navigateToReelItem: ue,
|
|
3166
|
+
resetMediaLifecycle: z,
|
|
3167
|
+
startItemRemoval: Z,
|
|
3112
3168
|
transitionActiveReelMedia: (e) => p.value?.transitionActiveMedia?.(e) ?? Promise.resolve(!1),
|
|
3113
3169
|
transitionActiveReelPost: (e) => p.value?.transitionActivePost?.(e) ?? Promise.resolve(!1)
|
|
3114
3170
|
}), (r, i) => (b(), s("div", {
|
|
3115
3171
|
ref_key: "surfaceElement",
|
|
3116
3172
|
ref: g,
|
|
3117
3173
|
class: "vibe-surface"
|
|
3118
|
-
}, [t.state.layout === "reel" && (t.state.items.length > 0 || t.state.reelForward.status !== "idle") ? (b(), a(
|
|
3174
|
+
}, [t.state.layout === "reel" && (t.state.items.length > 0 || t.state.reelForward.status !== "idle") ? (b(), a(An, {
|
|
3119
3175
|
key: 0,
|
|
3120
3176
|
ref_key: "reelRenderer",
|
|
3121
3177
|
ref: p,
|
|
@@ -3140,7 +3196,7 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3140
3196
|
"info-sheet-overlay": t.state.reelInfoSheetOverlay,
|
|
3141
3197
|
"next-page-error": !!t.state.nextPageError,
|
|
3142
3198
|
origin: "reel",
|
|
3143
|
-
"preview-states": E(
|
|
3199
|
+
"preview-states": E(ee),
|
|
3144
3200
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3145
3201
|
"reel-audio-state": t.reelAudioState,
|
|
3146
3202
|
"reel-forward": t.state.reelForward,
|
|
@@ -3169,7 +3225,7 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3169
3225
|
"can-retry-end",
|
|
3170
3226
|
"feed-footer",
|
|
3171
3227
|
"state"
|
|
3172
|
-
])) : (b(), s(e, { key: 2 }, [u(
|
|
3228
|
+
])) : (b(), s(e, { key: 2 }, [u(mn, {
|
|
3173
3229
|
ref_key: "masonryRenderer",
|
|
3174
3230
|
ref: f,
|
|
3175
3231
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -3194,7 +3250,7 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3194
3250
|
suspended: t.state.reelOrigin === "masonry" || _.value,
|
|
3195
3251
|
state: D.value,
|
|
3196
3252
|
total: t.state.total,
|
|
3197
|
-
onActivate:
|
|
3253
|
+
onActivate: X,
|
|
3198
3254
|
onError: E(N),
|
|
3199
3255
|
onMediaError: i[9] ||= (e, t) => E(A)(e, t, "masonry"),
|
|
3200
3256
|
onFullyVisible: E(j),
|
|
@@ -3205,20 +3261,25 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3205
3261
|
onVisible: E(M)
|
|
3206
3262
|
}, null, 8, /* @__PURE__ */ "can-retry-end.entering-post-ids.entry-delays.leaving-post-ids.removal-delays.card-footer.card-header.feed-footer.feed-footer-actions.media-card.masonry.has-next.infinite-scroll.is-loading-more.items.load-more-locked.media-indices.next-page-error.preview-states.suspended.state.total.onError.onFullyVisible.onReady.onVisible".split(".")), u(n, {
|
|
3207
3263
|
name: "vibe-reel-viewer",
|
|
3208
|
-
|
|
3264
|
+
onAfterEnter: E(H),
|
|
3265
|
+
onAfterLeave: he
|
|
3209
3266
|
}, {
|
|
3210
3267
|
default: k(() => [t.state.reelOrigin === "masonry" ? (b(), s("section", {
|
|
3211
3268
|
key: 0,
|
|
3212
3269
|
ref_key: "reelOverlay",
|
|
3213
3270
|
ref: h,
|
|
3214
3271
|
class: "vibe-reel-overlay",
|
|
3272
|
+
"data-reel-entry": E(te),
|
|
3215
3273
|
role: "dialog",
|
|
3216
3274
|
"aria-label": "Media viewer",
|
|
3217
3275
|
"aria-modal": "true",
|
|
3218
|
-
tabindex: "-1"
|
|
3219
|
-
|
|
3276
|
+
tabindex: "-1",
|
|
3277
|
+
onTransitionend: i[21] ||= (...e) => E(U) && E(U)(...e),
|
|
3278
|
+
onTransitioncancel: i[22] ||= (...e) => E(U) && E(U)(...e)
|
|
3279
|
+
}, [u(An, {
|
|
3220
3280
|
ref_key: "reelRenderer",
|
|
3221
3281
|
ref: p,
|
|
3282
|
+
"entry-pending": E(te) !== "ready",
|
|
3222
3283
|
"can-retry-end": t.canRetryEnd,
|
|
3223
3284
|
"card-footer": t.cardFooter,
|
|
3224
3285
|
"card-header": t.cardHeader,
|
|
@@ -3248,22 +3309,26 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3248
3309
|
total: t.state.total,
|
|
3249
3310
|
onActiveChange: i[12] ||= (e) => d("activeReelChange", e),
|
|
3250
3311
|
onCloseInfoSheet: i[13] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3251
|
-
onError:
|
|
3252
|
-
|
|
3253
|
-
|
|
3312
|
+
onError: i[14] ||= (e, t) => {
|
|
3313
|
+
E(F)(e, t), E(W)(e, t);
|
|
3314
|
+
},
|
|
3315
|
+
onMediaError: i[15] ||= (e, t) => E(A)(e, t, "reel"),
|
|
3316
|
+
onLoadMore: i[16] ||= (e) => d("loadMore"),
|
|
3254
3317
|
onMediaChange: J,
|
|
3255
|
-
onReady:
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3318
|
+
onReady: i[17] ||= (e, t) => {
|
|
3319
|
+
E(I)(e, t), E(W)(e, t);
|
|
3320
|
+
},
|
|
3321
|
+
onRetryEnd: i[18] ||= (e) => d("retryEnd"),
|
|
3322
|
+
onRetryForward: i[19] ||= (e) => d("retryForward"),
|
|
3323
|
+
onReelAudioChange: i[20] ||= (e) => d("reelAudioChange", e)
|
|
3324
|
+
}, null, 8, /* @__PURE__ */ "entry-pending.can-retry-end.card-footer.card-header.feed-footer.feed-footer-actions.forward-index.forward-item.media-card.has-next.infinite-scroll.initial-post-id.info-sheet.info-sheet-enabled.info-sheet-overlay.is-loading-more.items.load-more-locked.media-indices.next-page-error.preview-states.reel-auto-advance.reel-audio-state.reel-forward.state.total".split(".")), E(te) === "waiting" ? (b(), a(Fn, { key: 0 })) : o("", !0)], 40, Wn)) : o("", !0)]),
|
|
3260
3325
|
_: 1
|
|
3261
|
-
})], 64))], 512));
|
|
3326
|
+
}, 8, ["onAfterEnter"])], 64))], 512));
|
|
3262
3327
|
}
|
|
3263
3328
|
});
|
|
3264
3329
|
//#endregion
|
|
3265
3330
|
//#region src/core/page.ts
|
|
3266
|
-
function
|
|
3331
|
+
function Jn(e) {
|
|
3267
3332
|
if (!e || typeof e != "object" || !Array.isArray(e.items)) throw TypeError("Vibe loadPage must resolve to a page with an items array.");
|
|
3268
3333
|
if (e.current !== void 0 && e.current !== null && typeof e.current != "string" && typeof e.current != "number") throw TypeError("Vibe page current must be a string, number, null, or undefined.");
|
|
3269
3334
|
if (e.next !== null && typeof e.next != "string" && typeof e.next != "number") throw TypeError("Vibe page next must be a string, number, or null.");
|
|
@@ -3274,22 +3339,22 @@ function $(e, t) {
|
|
|
3274
3339
|
let n = new Set(e.map((e) => e.postId));
|
|
3275
3340
|
return [...e, ...t.filter((e) => n.has(e.postId) ? !1 : (n.add(e.postId), !0))];
|
|
3276
3341
|
}
|
|
3277
|
-
function
|
|
3342
|
+
function Yn(e) {
|
|
3278
3343
|
return `${typeof e}:${String(e)}`;
|
|
3279
3344
|
}
|
|
3280
|
-
function
|
|
3281
|
-
return e.mediaId === void 0 ? `source:${e.src}\u0000${e.preview?.src ?? ""}` : `id:${
|
|
3345
|
+
function Xn(e) {
|
|
3346
|
+
return e.mediaId === void 0 ? `source:${e.src}\u0000${e.preview?.src ?? ""}` : `id:${Yn(e.mediaId)}`;
|
|
3282
3347
|
}
|
|
3283
|
-
function
|
|
3284
|
-
let n = [...e], r = new Map(e.map((e, t) => [
|
|
3348
|
+
function Zn(e, t) {
|
|
3349
|
+
let n = [...e], r = new Map(e.map((e, t) => [Yn(e.postId), t]));
|
|
3285
3350
|
return t.forEach((e) => {
|
|
3286
|
-
let t =
|
|
3351
|
+
let t = Yn(e.postId), i = r.get(t);
|
|
3287
3352
|
if (i === void 0) {
|
|
3288
3353
|
r.set(t, n.length), n.push(e);
|
|
3289
3354
|
return;
|
|
3290
3355
|
}
|
|
3291
|
-
let a = n[i], o = new Set([a, ...a.items].map(
|
|
3292
|
-
let t =
|
|
3356
|
+
let a = n[i], o = new Set([a, ...a.items].map(Xn)), s = [e, ...e.items].filter((e) => {
|
|
3357
|
+
let t = Xn(e);
|
|
3293
3358
|
return o.has(t) ? !1 : (o.add(t), !0);
|
|
3294
3359
|
});
|
|
3295
3360
|
s.length > 0 && (n[i] = {
|
|
@@ -3298,14 +3363,14 @@ function Gn(e, t) {
|
|
|
3298
3363
|
});
|
|
3299
3364
|
}), n;
|
|
3300
3365
|
}
|
|
3301
|
-
function
|
|
3366
|
+
function Qn(e) {
|
|
3302
3367
|
return Object.prototype.hasOwnProperty.call(e, "current") ? e.current ?? null : e.next;
|
|
3303
3368
|
}
|
|
3304
3369
|
//#endregion
|
|
3305
3370
|
//#region src/core/appendPage.ts
|
|
3306
|
-
function
|
|
3307
|
-
let i =
|
|
3308
|
-
t.items =
|
|
3371
|
+
function $n(e, t, n, r) {
|
|
3372
|
+
let i = Jn(e), a = n.filterItems(i.items), o = Qn(i);
|
|
3373
|
+
t.items = Zn(t.items, a), t.next = i.next, i.total !== void 0 && (t.total = i.total), r(o), n.recordPages([{
|
|
3309
3374
|
contributionIds: a.map(({ postId: e }) => e),
|
|
3310
3375
|
cursor: o,
|
|
3311
3376
|
next: i.next,
|
|
@@ -3314,32 +3379,32 @@ function qn(e, t, n, r) {
|
|
|
3314
3379
|
}
|
|
3315
3380
|
//#endregion
|
|
3316
3381
|
//#region src/core/requestDelay.ts
|
|
3317
|
-
var
|
|
3382
|
+
var er = 2e3, tr = 1e4, nr = 250, rr = {
|
|
3318
3383
|
delayRemainingMs: null,
|
|
3319
3384
|
nextRequestAt: null
|
|
3320
3385
|
};
|
|
3321
|
-
function
|
|
3386
|
+
function ir(e, t) {
|
|
3322
3387
|
return e === void 0 ? t : Math.floor(e);
|
|
3323
3388
|
}
|
|
3324
|
-
function
|
|
3389
|
+
function ar(e, t) {
|
|
3325
3390
|
for (let [n, r] of [["delayStepMs", e.delayStepMs], ["delayMaxMs", e.delayMaxMs]]) if (r !== void 0 && (!Number.isFinite(r) || r < 0)) throw TypeError(`Vibe ${t} ${n} must be a non-negative number.`);
|
|
3326
3391
|
}
|
|
3327
|
-
function
|
|
3328
|
-
let n =
|
|
3392
|
+
function or(e, t = {}) {
|
|
3393
|
+
let n = ir(t.delayStepMs, er), r = ir(t.delayMaxMs, tr);
|
|
3329
3394
|
return Math.min(Math.max(0, e) * n, r);
|
|
3330
3395
|
}
|
|
3331
|
-
function
|
|
3332
|
-
if (e == null || !Number.isFinite(e)) return { ...
|
|
3396
|
+
function sr(e) {
|
|
3397
|
+
if (e == null || !Number.isFinite(e)) return { ...rr };
|
|
3333
3398
|
let t = Math.max(0, Math.floor(e - Date.now()));
|
|
3334
3399
|
return t > 0 ? {
|
|
3335
3400
|
delayRemainingMs: t,
|
|
3336
3401
|
nextRequestAt: e
|
|
3337
|
-
} : { ...
|
|
3402
|
+
} : { ...rr };
|
|
3338
3403
|
}
|
|
3339
|
-
async function
|
|
3404
|
+
async function cr({ delayMs: e, onChange: t, signal: n }) {
|
|
3340
3405
|
if (n.aborted) throw new DOMException("Aborted", "AbortError");
|
|
3341
3406
|
if (e <= 0) {
|
|
3342
|
-
t({ ...
|
|
3407
|
+
t({ ...rr });
|
|
3343
3408
|
return;
|
|
3344
3409
|
}
|
|
3345
3410
|
let r = Date.now() + e;
|
|
@@ -3347,9 +3412,9 @@ async function nr({ delayMs: e, onChange: t, signal: n }) {
|
|
|
3347
3412
|
delayRemainingMs: e,
|
|
3348
3413
|
nextRequestAt: r
|
|
3349
3414
|
}), await new Promise((i, a) => {
|
|
3350
|
-
let o = !1, s = setInterval(f,
|
|
3415
|
+
let o = !1, s = setInterval(f, nr), c = setTimeout(() => u(), e);
|
|
3351
3416
|
function l() {
|
|
3352
|
-
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...
|
|
3417
|
+
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...rr });
|
|
3353
3418
|
}
|
|
3354
3419
|
function u(e) {
|
|
3355
3420
|
o || (o = !0, l(), e ? a(e) : i());
|
|
@@ -3358,42 +3423,42 @@ async function nr({ delayMs: e, onChange: t, signal: n }) {
|
|
|
3358
3423
|
u(new DOMException("Aborted", "AbortError"));
|
|
3359
3424
|
}
|
|
3360
3425
|
function f() {
|
|
3361
|
-
let e =
|
|
3426
|
+
let e = sr(r);
|
|
3362
3427
|
t(e), e.delayRemainingMs === null && u();
|
|
3363
3428
|
}
|
|
3364
3429
|
n.addEventListener("abort", d, { once: !0 });
|
|
3365
3430
|
});
|
|
3366
3431
|
}
|
|
3367
|
-
var
|
|
3432
|
+
var lr = class {
|
|
3368
3433
|
interval = null;
|
|
3369
3434
|
constructor(e) {
|
|
3370
3435
|
this.onChange = e;
|
|
3371
3436
|
}
|
|
3372
3437
|
clear() {
|
|
3373
|
-
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...
|
|
3438
|
+
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...rr });
|
|
3374
3439
|
}
|
|
3375
3440
|
sync(e) {
|
|
3376
3441
|
this.clear();
|
|
3377
|
-
let t =
|
|
3442
|
+
let t = sr(e);
|
|
3378
3443
|
this.onChange(t), t.delayRemainingMs !== null && (this.interval = setInterval(() => {
|
|
3379
|
-
let t =
|
|
3444
|
+
let t = sr(e);
|
|
3380
3445
|
this.onChange(t), t.delayRemainingMs === null && this.clear();
|
|
3381
|
-
},
|
|
3446
|
+
}, nr));
|
|
3382
3447
|
}
|
|
3383
3448
|
};
|
|
3384
|
-
function
|
|
3449
|
+
function ur(e, t = !0) {
|
|
3385
3450
|
return e.maxAdditionalPages === "unlimited" ? Infinity : (e.maxAdditionalPages ?? 10) + (t ? 1 : 0);
|
|
3386
3451
|
}
|
|
3387
|
-
function
|
|
3452
|
+
function dr(e) {
|
|
3388
3453
|
return `${typeof e}:${String(e)}`;
|
|
3389
3454
|
}
|
|
3390
|
-
function
|
|
3455
|
+
function fr(e, t) {
|
|
3391
3456
|
if (!Number.isInteger(e) || e <= 0) throw TypeError(`Vibe ${t} must be a positive integer.`);
|
|
3392
3457
|
}
|
|
3393
|
-
function
|
|
3458
|
+
function pr(e) {
|
|
3394
3459
|
if (!e) return;
|
|
3395
|
-
if (
|
|
3396
|
-
|
|
3460
|
+
if (fr(e.pageSize, "autofill pageSize"), e.strategy === "frontend") {
|
|
3461
|
+
ar(e, "frontend autofill");
|
|
3397
3462
|
let t = e.maxAdditionalPages;
|
|
3398
3463
|
if (t !== void 0 && t !== "unlimited" && (!Number.isInteger(t) || t < 0)) throw TypeError("Vibe autofill maxAdditionalPages must be a non-negative integer or \"unlimited\".");
|
|
3399
3464
|
return;
|
|
@@ -3405,7 +3470,7 @@ function sr(e) {
|
|
|
3405
3470
|
if (t.pageSize !== e.pageSize) throw TypeError("Vibe backend autofill initialSession pageSize must match autofill pageSize.");
|
|
3406
3471
|
}
|
|
3407
3472
|
}
|
|
3408
|
-
function
|
|
3473
|
+
function mr(e, t, n = !0) {
|
|
3409
3474
|
if (!e) return {
|
|
3410
3475
|
cycleId: null,
|
|
3411
3476
|
delayRemainingMs: null,
|
|
@@ -3422,7 +3487,7 @@ function cr(e, t, n = !0) {
|
|
|
3422
3487
|
status: "idle",
|
|
3423
3488
|
strategy: null
|
|
3424
3489
|
};
|
|
3425
|
-
let r = e.strategy === "backend" ? t ?? (n ? e.initialSession : void 0) : void 0, i = r?.received ?? 0, a =
|
|
3490
|
+
let r = e.strategy === "backend" ? t ?? (n ? e.initialSession : void 0) : void 0, i = r?.received ?? 0, a = sr(r?.nextRequestAt);
|
|
3426
3491
|
return {
|
|
3427
3492
|
cycleId: r?.cycleId ?? null,
|
|
3428
3493
|
...a,
|
|
@@ -3439,7 +3504,7 @@ function cr(e, t, n = !0) {
|
|
|
3439
3504
|
strategy: e.strategy
|
|
3440
3505
|
};
|
|
3441
3506
|
}
|
|
3442
|
-
function
|
|
3507
|
+
function hr(e) {
|
|
3443
3508
|
return [
|
|
3444
3509
|
"cancelling",
|
|
3445
3510
|
"filling",
|
|
@@ -3447,9 +3512,9 @@ function lr(e) {
|
|
|
3447
3512
|
"waiting"
|
|
3448
3513
|
].includes(e.status);
|
|
3449
3514
|
}
|
|
3450
|
-
async function
|
|
3515
|
+
async function gr(e, t, n) {
|
|
3451
3516
|
let r = t.autofill;
|
|
3452
|
-
if (!
|
|
3517
|
+
if (!hr(r) || !r.cycleId) return;
|
|
3453
3518
|
let i = {
|
|
3454
3519
|
cycleId: r.cycleId,
|
|
3455
3520
|
feedKey: r.feedKey ?? "",
|
|
@@ -3462,16 +3527,16 @@ async function ur(e, t, n) {
|
|
|
3462
3527
|
throw r.error = e, r.status = "error", e;
|
|
3463
3528
|
}
|
|
3464
3529
|
}
|
|
3465
|
-
function
|
|
3530
|
+
function _r(e, t, n) {
|
|
3466
3531
|
return e?.strategy === "backend" && t.feedKey === e.feedKey && t.sessionId === n.sessionId;
|
|
3467
3532
|
}
|
|
3468
|
-
async function
|
|
3469
|
-
let f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = r ??
|
|
3533
|
+
async function vr({ existingItems: e, initialCursor: t, loadPage: n, maximumRequests: r, onCollection: i, onDelayChange: a, onProgress: o, options: s, receivedOffset: c = 0, requestOffset: l = 0, shouldPause: u = () => !1, signal: d }) {
|
|
3534
|
+
let f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = r ?? ur(s), g = t, _ = t, v = t, y = 0, b = [], x;
|
|
3470
3535
|
for (; y < h;) {
|
|
3471
|
-
let e =
|
|
3536
|
+
let e = dr(g);
|
|
3472
3537
|
if (m.has(e)) throw Error("Vibe autofill received a repeated cursor.");
|
|
3473
|
-
if (m.add(e), await
|
|
3474
|
-
delayMs:
|
|
3538
|
+
if (m.add(e), await cr({
|
|
3539
|
+
delayMs: or(l + y, s),
|
|
3475
3540
|
onChange: a,
|
|
3476
3541
|
signal: d
|
|
3477
3542
|
}), y > 0 && u()) return {
|
|
@@ -3485,7 +3550,7 @@ async function fr({ existingItems: e, initialCursor: t, loadPage: n, maximumRequ
|
|
|
3485
3550
|
status: "paused",
|
|
3486
3551
|
total: x
|
|
3487
3552
|
};
|
|
3488
|
-
let t =
|
|
3553
|
+
let t = Jn(await n({
|
|
3489
3554
|
cursor: g,
|
|
3490
3555
|
signal: d
|
|
3491
3556
|
}));
|
|
@@ -3542,12 +3607,12 @@ async function fr({ existingItems: e, initialCursor: t, loadPage: n, maximumRequ
|
|
|
3542
3607
|
}
|
|
3543
3608
|
//#endregion
|
|
3544
3609
|
//#region src/core/autofillController.ts
|
|
3545
|
-
var
|
|
3610
|
+
var yr = class {
|
|
3546
3611
|
collection = null;
|
|
3547
3612
|
cycle = 0;
|
|
3548
3613
|
delayCountdown;
|
|
3549
3614
|
constructor(e) {
|
|
3550
|
-
this.context = e, this.delayCountdown = new
|
|
3615
|
+
this.context = e, this.delayCountdown = new lr((t) => Object.assign(e.state.autofill, t)), this.syncCountdown();
|
|
3551
3616
|
}
|
|
3552
3617
|
beginCycle() {
|
|
3553
3618
|
let { options: e, state: t } = this.context;
|
|
@@ -3555,14 +3620,14 @@ var pr = class {
|
|
|
3555
3620
|
this.clear();
|
|
3556
3621
|
let n = `vibe-autofill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
3557
3622
|
return t.autofill = {
|
|
3558
|
-
...
|
|
3623
|
+
...mr(e, void 0, !1),
|
|
3559
3624
|
cycleId: n,
|
|
3560
3625
|
status: "filling"
|
|
3561
3626
|
}, n;
|
|
3562
3627
|
}
|
|
3563
3628
|
async cancel() {
|
|
3564
3629
|
let { cancelRequest: e, options: t, state: n } = this.context;
|
|
3565
|
-
await
|
|
3630
|
+
await gr(t, n, e), this.commitCollection();
|
|
3566
3631
|
}
|
|
3567
3632
|
captureCollection(e, t) {
|
|
3568
3633
|
t && (this.collection = e);
|
|
@@ -3590,30 +3655,30 @@ var pr = class {
|
|
|
3590
3655
|
requests: r.requests
|
|
3591
3656
|
}), !0) : !1;
|
|
3592
3657
|
}
|
|
3593
|
-
},
|
|
3594
|
-
function
|
|
3658
|
+
}, br = 100;
|
|
3659
|
+
function xr(e, t) {
|
|
3595
3660
|
if (!Number.isFinite(t) || t <= 0) throw TypeError(`Vibe ${e} must be a positive number.`);
|
|
3596
3661
|
}
|
|
3597
|
-
function
|
|
3662
|
+
function Sr(e, t, n) {
|
|
3598
3663
|
return Math.min(n, Math.max(t, e));
|
|
3599
3664
|
}
|
|
3600
|
-
function
|
|
3665
|
+
function Cr(e) {
|
|
3601
3666
|
if (!e) return;
|
|
3602
3667
|
let t = e.minSpeedPxPerSecond ?? 20, n = e.maxSpeedPxPerSecond ?? 240;
|
|
3603
|
-
if (
|
|
3604
|
-
e.speedPxPerSecond !== void 0 &&
|
|
3668
|
+
if (xr("autoScroll.minSpeedPxPerSecond", t), xr("autoScroll.maxSpeedPxPerSecond", n), t > n) throw TypeError("Vibe autoScroll.minSpeedPxPerSecond cannot exceed maxSpeedPxPerSecond.");
|
|
3669
|
+
e.speedPxPerSecond !== void 0 && xr("autoScroll.speedPxPerSecond", e.speedPxPerSecond);
|
|
3605
3670
|
}
|
|
3606
|
-
function
|
|
3671
|
+
function wr(e) {
|
|
3607
3672
|
let t = e?.minSpeedPxPerSecond ?? 20, n = e?.maxSpeedPxPerSecond ?? 240;
|
|
3608
3673
|
return {
|
|
3609
3674
|
enabled: e?.enabled ?? !1,
|
|
3610
3675
|
maxSpeedPxPerSecond: n,
|
|
3611
3676
|
minSpeedPxPerSecond: t,
|
|
3612
3677
|
paused: !1,
|
|
3613
|
-
speedPxPerSecond:
|
|
3678
|
+
speedPxPerSecond: Sr(e?.speedPxPerSecond ?? 80, t, n)
|
|
3614
3679
|
};
|
|
3615
3680
|
}
|
|
3616
|
-
var
|
|
3681
|
+
var Tr = class {
|
|
3617
3682
|
frame = null;
|
|
3618
3683
|
lastTimestamp = null;
|
|
3619
3684
|
mounted = !1;
|
|
@@ -3633,9 +3698,9 @@ var yr = class {
|
|
|
3633
3698
|
this.options.state.enabled && (this.options.state.paused = e, this.lastTimestamp = null, e ? this.cancelFrame() : this.schedule());
|
|
3634
3699
|
}
|
|
3635
3700
|
setSpeed(e) {
|
|
3636
|
-
|
|
3701
|
+
xr("auto-scroll speed", e);
|
|
3637
3702
|
let t = this.options.state;
|
|
3638
|
-
t.speedPxPerSecond =
|
|
3703
|
+
t.speedPxPerSecond = Sr(e, t.minSpeedPxPerSecond, t.maxSpeedPxPerSecond);
|
|
3639
3704
|
}
|
|
3640
3705
|
tick = (e) => {
|
|
3641
3706
|
this.frame = null;
|
|
@@ -3647,7 +3712,7 @@ var yr = class {
|
|
|
3647
3712
|
return;
|
|
3648
3713
|
}
|
|
3649
3714
|
if (this.lastTimestamp !== null) {
|
|
3650
|
-
let r = Math.min(
|
|
3715
|
+
let r = Math.min(br, Math.max(0, e - this.lastTimestamp)), i = Math.max(0, n.scrollHeight - n.clientHeight);
|
|
3651
3716
|
n.scrollTop = Math.min(i, n.scrollTop + t.speedPxPerSecond * r / 1e3);
|
|
3652
3717
|
}
|
|
3653
3718
|
this.lastTimestamp = e, this.schedule();
|
|
@@ -3661,13 +3726,13 @@ var yr = class {
|
|
|
3661
3726
|
};
|
|
3662
3727
|
//#endregion
|
|
3663
3728
|
//#region src/core/backendAutofill.ts
|
|
3664
|
-
async function
|
|
3729
|
+
async function Er(e, t, n, r) {
|
|
3665
3730
|
let i = await e.onUnderfilled(n);
|
|
3666
3731
|
if (!r()) return;
|
|
3667
3732
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend autofill requires a sessionId.");
|
|
3668
3733
|
let a = Math.max(n.received, i.received ?? n.received);
|
|
3669
3734
|
Object.assign(t.autofill, {
|
|
3670
|
-
...
|
|
3735
|
+
...sr(i.nextRequestAt),
|
|
3671
3736
|
missing: Math.max(0, e.pageSize - a),
|
|
3672
3737
|
received: a,
|
|
3673
3738
|
sequence: i.sequence ?? 0,
|
|
@@ -3675,19 +3740,19 @@ async function br(e, t, n, r) {
|
|
|
3675
3740
|
status: "waiting"
|
|
3676
3741
|
});
|
|
3677
3742
|
}
|
|
3678
|
-
function
|
|
3743
|
+
function Dr(e, t) {
|
|
3679
3744
|
["complete", "exhausted"].includes(t.status) && t.items && (e.items = $(e.items, t.items)), t.next !== void 0 && (e.next = t.next), t.total !== void 0 && (e.total = t.total);
|
|
3680
3745
|
}
|
|
3681
|
-
function
|
|
3746
|
+
function Or(e, t, n) {
|
|
3682
3747
|
let r = t.autofill;
|
|
3683
|
-
return !
|
|
3748
|
+
return !_r(e, n, r) || n.sequence <= r.sequence || ["cancelled", "cancelling"].includes(r.status) || ["complete", "exhausted"].includes(n.status) && n.next === void 0 ? !1 : (Dr(t, n), Object.assign(r, sr(n.status === "waiting" ? n.nextRequestAt : null)), r.error = n.error ?? null, r.missing = Math.max(0, (r.pageSize ?? 0) - n.received), r.received = n.received, n.requests !== void 0 && (r.requests = n.requests), r.sequence = n.sequence, r.status = n.status, !0);
|
|
3684
3749
|
}
|
|
3685
|
-
function
|
|
3686
|
-
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill =
|
|
3750
|
+
function kr(e, t, n) {
|
|
3751
|
+
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill = mr(e, n), Dr(t, n), !0);
|
|
3687
3752
|
}
|
|
3688
3753
|
//#endregion
|
|
3689
3754
|
//#region src/core/backlogRestore.ts
|
|
3690
|
-
async function
|
|
3755
|
+
async function Ar(e, t, n) {
|
|
3691
3756
|
if (!e) return;
|
|
3692
3757
|
let r = new AbortController();
|
|
3693
3758
|
n(r);
|
|
@@ -3702,7 +3767,7 @@ async function wr(e, t, n) {
|
|
|
3702
3767
|
}
|
|
3703
3768
|
//#endregion
|
|
3704
3769
|
//#region src/core/initialAutofill.ts
|
|
3705
|
-
async function
|
|
3770
|
+
async function jr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r, onPages: i, options: a, signal: o, state: s }) {
|
|
3706
3771
|
let c = a.autofill;
|
|
3707
3772
|
if (!c) return;
|
|
3708
3773
|
let l = s.items.length;
|
|
@@ -3715,7 +3780,7 @@ async function Tr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3715
3780
|
return;
|
|
3716
3781
|
}
|
|
3717
3782
|
if (c.strategy === "backend") {
|
|
3718
|
-
await
|
|
3783
|
+
await Er(c, s, {
|
|
3719
3784
|
cycleId: e,
|
|
3720
3785
|
feedKey: c.feedKey,
|
|
3721
3786
|
items: [...s.items],
|
|
@@ -3732,11 +3797,11 @@ async function Tr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3732
3797
|
s.autofill.status = "exhausted";
|
|
3733
3798
|
return;
|
|
3734
3799
|
}
|
|
3735
|
-
let u = await
|
|
3800
|
+
let u = await vr({
|
|
3736
3801
|
existingItems: s.items,
|
|
3737
3802
|
initialCursor: s.next,
|
|
3738
3803
|
loadPage: a.loadPage,
|
|
3739
|
-
maximumRequests:
|
|
3804
|
+
maximumRequests: ur(c, !1),
|
|
3740
3805
|
onCollection: n,
|
|
3741
3806
|
onDelayChange: (e) => {
|
|
3742
3807
|
t() && Object.assign(s.autofill, e);
|
|
@@ -3759,13 +3824,13 @@ async function Tr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3759
3824
|
}
|
|
3760
3825
|
//#endregion
|
|
3761
3826
|
//#region src/core/fill.ts
|
|
3762
|
-
function
|
|
3827
|
+
function Mr(e) {
|
|
3763
3828
|
return "items" in e ? { items: e.items } : "pages" in e ? { pages: e.pages } : { until: "end" };
|
|
3764
3829
|
}
|
|
3765
|
-
function
|
|
3830
|
+
function Nr(e) {
|
|
3766
3831
|
return `${typeof e}:${String(e)}`;
|
|
3767
3832
|
}
|
|
3768
|
-
function
|
|
3833
|
+
function Pr(e) {
|
|
3769
3834
|
if (!e || typeof e != "object") throw TypeError("Vibe fill target must be an object.");
|
|
3770
3835
|
if ("pages" in e) {
|
|
3771
3836
|
if (!Number.isInteger(e.pages) || e.pages <= 0) throw TypeError("Vibe fill pages must be a positive integer.");
|
|
@@ -3778,21 +3843,21 @@ function Or(e) {
|
|
|
3778
3843
|
if ("until" in e && e.until === "end") return { until: "end" };
|
|
3779
3844
|
throw TypeError("Vibe fill target must be { items }, { pages }, or { until: 'end' }.");
|
|
3780
3845
|
}
|
|
3781
|
-
function
|
|
3846
|
+
function Fr(e) {
|
|
3782
3847
|
if (!e) return;
|
|
3783
3848
|
if (e.strategy === "frontend") {
|
|
3784
|
-
|
|
3849
|
+
ar(e, "frontend fill");
|
|
3785
3850
|
return;
|
|
3786
3851
|
}
|
|
3787
3852
|
if (!e.feedKey.trim()) throw TypeError("Vibe backend fill requires a feedKey.");
|
|
3788
3853
|
let t = e.initialSession;
|
|
3789
3854
|
if (t) {
|
|
3790
3855
|
if (t.feedKey !== e.feedKey) throw TypeError("Vibe backend fill initialSession feedKey must match fill feedKey.");
|
|
3791
|
-
|
|
3856
|
+
Pr(t.target);
|
|
3792
3857
|
}
|
|
3793
3858
|
}
|
|
3794
|
-
function
|
|
3795
|
-
let r = e?.strategy === "backend" && n ? e.initialSession : void 0, i = t ?? r, a =
|
|
3859
|
+
function Ir(e, t, n = !0) {
|
|
3860
|
+
let r = e?.strategy === "backend" && n ? e.initialSession : void 0, i = t ?? r, a = sr(i?.nextRequestAt);
|
|
3796
3861
|
return {
|
|
3797
3862
|
completedPages: i?.completedPages ?? 0,
|
|
3798
3863
|
cycleId: i?.cycleId ?? null,
|
|
@@ -3805,10 +3870,10 @@ function Ar(e, t, n = !0) {
|
|
|
3805
3870
|
sessionId: i?.sessionId ?? null,
|
|
3806
3871
|
status: i?.status ?? "idle",
|
|
3807
3872
|
strategy: e?.strategy ?? null,
|
|
3808
|
-
target: i ?
|
|
3873
|
+
target: i ? Mr(i.target) : null
|
|
3809
3874
|
};
|
|
3810
3875
|
}
|
|
3811
|
-
function
|
|
3876
|
+
function Lr(e) {
|
|
3812
3877
|
return [
|
|
3813
3878
|
"cancelling",
|
|
3814
3879
|
"filling",
|
|
@@ -3816,7 +3881,7 @@ function jr(e) {
|
|
|
3816
3881
|
"waiting"
|
|
3817
3882
|
].includes(e.status);
|
|
3818
3883
|
}
|
|
3819
|
-
async function
|
|
3884
|
+
async function Rr({ existingItems: e, getLoadedItemCount: t, initialCursor: n, loadPage: r, onCollection: i = () => void 0, onDelayChange: a, onProgress: o, options: s, shouldPause: c = () => !1, signal: l, target: u }) {
|
|
3820
3885
|
let d = [], f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = 0, g = n, _ = n, v = n, y = 0, b, x = () => t?.() ?? p.length;
|
|
3821
3886
|
if ("items" in u && x() >= u.items) return {
|
|
3822
3887
|
completedPages: h,
|
|
@@ -3828,10 +3893,10 @@ async function Mr({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3828
3893
|
status: "complete"
|
|
3829
3894
|
};
|
|
3830
3895
|
for (; v !== null;) {
|
|
3831
|
-
let e =
|
|
3896
|
+
let e = Nr(g);
|
|
3832
3897
|
if (m.has(e)) throw Error("Vibe fill received a repeated cursor.");
|
|
3833
|
-
if (m.add(e), await
|
|
3834
|
-
delayMs:
|
|
3898
|
+
if (m.add(e), await cr({
|
|
3899
|
+
delayMs: or(h, s),
|
|
3835
3900
|
onChange: a,
|
|
3836
3901
|
signal: l
|
|
3837
3902
|
}), h > 0 && c()) return {
|
|
@@ -3844,7 +3909,7 @@ async function Mr({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3844
3909
|
status: "paused",
|
|
3845
3910
|
total: b
|
|
3846
3911
|
};
|
|
3847
|
-
let t =
|
|
3912
|
+
let t = Jn(await r({
|
|
3848
3913
|
cursor: g,
|
|
3849
3914
|
signal: l
|
|
3850
3915
|
}));
|
|
@@ -3912,12 +3977,12 @@ async function Mr({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3912
3977
|
}
|
|
3913
3978
|
//#endregion
|
|
3914
3979
|
//#region src/core/backendFill.ts
|
|
3915
|
-
async function
|
|
3980
|
+
async function zr(e, t, n, r) {
|
|
3916
3981
|
let i = await e.onStart(n);
|
|
3917
3982
|
if (r()) {
|
|
3918
3983
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend fill requires a sessionId.");
|
|
3919
3984
|
Object.assign(t.fill, {
|
|
3920
|
-
...
|
|
3985
|
+
...sr(i.nextRequestAt),
|
|
3921
3986
|
completedPages: i.completedPages ?? 0,
|
|
3922
3987
|
received: i.received ?? 0,
|
|
3923
3988
|
sequence: i.sequence ?? 0,
|
|
@@ -3926,23 +3991,23 @@ async function Nr(e, t, n, r) {
|
|
|
3926
3991
|
});
|
|
3927
3992
|
}
|
|
3928
3993
|
}
|
|
3929
|
-
function
|
|
3994
|
+
function Br(e, t, n) {
|
|
3930
3995
|
return e?.strategy === "backend" && n.feedKey === e.feedKey && n.sessionId === t.fill.sessionId;
|
|
3931
3996
|
}
|
|
3932
|
-
function
|
|
3997
|
+
function Vr(e) {
|
|
3933
3998
|
return Number.isInteger(e.completedPages) && e.completedPages >= 0 && Number.isInteger(e.received) && e.received >= 0 && Number.isInteger(e.sequence) && e.sequence >= 0;
|
|
3934
3999
|
}
|
|
3935
|
-
function
|
|
4000
|
+
function Hr(e, t) {
|
|
3936
4001
|
if (!["complete", "exhausted"].includes(t.status)) return !0;
|
|
3937
4002
|
let n = e.fill.target;
|
|
3938
4003
|
return !n || !Array.isArray(t.items) || t.next === void 0 || t.lastCursor === void 0 ? !1 : t.status === "exhausted" ? "pages" in n && t.completedPages < n.pages && t.next === null : "pages" in n ? t.completedPages === n.pages : t.next === null;
|
|
3939
4004
|
}
|
|
3940
|
-
function
|
|
4005
|
+
function Ur(e, t, n) {
|
|
3941
4006
|
t.total !== void 0 && (e.total = t.total), ["complete", "exhausted"].includes(t.status) && (e.items = $(e.items, t.items ?? []), e.next = t.next ?? null, n(t.lastCursor ?? null));
|
|
3942
4007
|
}
|
|
3943
|
-
function
|
|
3944
|
-
return !
|
|
3945
|
-
...
|
|
4008
|
+
function Wr(e, t, n, r) {
|
|
4009
|
+
return !Br(e, t, n) || !Vr(n) || n.sequence <= t.fill.sequence || ["cancelled", "cancelling"].includes(t.fill.status) || !Hr(t, n) ? !1 : (Ur(t, n, r), Object.assign(t.fill, {
|
|
4010
|
+
...sr(n.status === "waiting" ? n.nextRequestAt : null),
|
|
3946
4011
|
completedPages: n.completedPages,
|
|
3947
4012
|
error: n.error ?? null,
|
|
3948
4013
|
received: n.received,
|
|
@@ -3950,45 +4015,45 @@ function Rr(e, t, n, r) {
|
|
|
3950
4015
|
status: n.status
|
|
3951
4016
|
}), !0);
|
|
3952
4017
|
}
|
|
3953
|
-
function
|
|
4018
|
+
function Gr(e, t, n, r) {
|
|
3954
4019
|
if (e?.strategy !== "backend" || n.feedKey !== e.feedKey) return !1;
|
|
3955
4020
|
let i = t.fill;
|
|
3956
|
-
return t.fill =
|
|
4021
|
+
return t.fill = Ir(e, n), !Vr(n) || !Hr(t, n) ? (t.fill = i, !1) : (Ur(t, n, r), !0);
|
|
3957
4022
|
}
|
|
3958
4023
|
//#endregion
|
|
3959
4024
|
//#region src/core/fillController.ts
|
|
3960
|
-
var
|
|
4025
|
+
var Kr = class {
|
|
3961
4026
|
abortController = null;
|
|
3962
4027
|
cycle = 0;
|
|
3963
4028
|
delayCountdown;
|
|
3964
4029
|
requestVersion = 0;
|
|
3965
4030
|
collection = null;
|
|
3966
4031
|
constructor(e) {
|
|
3967
|
-
this.options = e, this.delayCountdown = new
|
|
4032
|
+
this.options = e, this.delayCountdown = new lr((e) => {
|
|
3968
4033
|
Object.assign(this.options.state.fill, e);
|
|
3969
4034
|
}), this.syncBackendCountdown();
|
|
3970
4035
|
}
|
|
3971
4036
|
isActive() {
|
|
3972
|
-
return
|
|
4037
|
+
return Lr(this.options.state.fill);
|
|
3973
4038
|
}
|
|
3974
4039
|
applyUpdate(e) {
|
|
3975
|
-
let t =
|
|
4040
|
+
let t = Wr(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
3976
4041
|
return t && this.syncBackendCountdown(), t;
|
|
3977
4042
|
}
|
|
3978
4043
|
restoreSession(e) {
|
|
3979
|
-
let t =
|
|
4044
|
+
let t = Gr(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
3980
4045
|
return t && this.syncBackendCountdown(), t;
|
|
3981
4046
|
}
|
|
3982
4047
|
async start(e, t = {}) {
|
|
3983
4048
|
let n = this.options.fill;
|
|
3984
4049
|
if (!n) throw Error("Vibe fill is not configured.");
|
|
3985
4050
|
if (this.isActive()) throw Error("Vibe fill is already active.");
|
|
3986
|
-
let r =
|
|
4051
|
+
let r = Pr(e), i = Pr(t.target ?? r), a = t.progressOffset ?? {
|
|
3987
4052
|
completedPages: 0,
|
|
3988
4053
|
received: 0
|
|
3989
4054
|
}, o = t.cycleId ?? `vibe-fill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
3990
4055
|
if (this.options.state.fill = {
|
|
3991
|
-
...
|
|
4056
|
+
...Ir(n, void 0, !1),
|
|
3992
4057
|
completedPages: a.completedPages,
|
|
3993
4058
|
cycleId: o,
|
|
3994
4059
|
received: a.received,
|
|
@@ -4001,7 +4066,7 @@ var Br = class {
|
|
|
4001
4066
|
let s = ++this.requestVersion, c = new AbortController();
|
|
4002
4067
|
this.abortController = c;
|
|
4003
4068
|
try {
|
|
4004
|
-
n.strategy === "frontend" ? await this.startFrontend(n, r, c, s, t.prepareFrontend !== !1, a) : (await
|
|
4069
|
+
n.strategy === "frontend" ? await this.startFrontend(n, r, c, s, t.prepareFrontend !== !1, a) : (await zr(n, this.options.state, {
|
|
4005
4070
|
cycleId: o,
|
|
4006
4071
|
feedKey: n.feedKey,
|
|
4007
4072
|
items: [...this.options.state.items],
|
|
@@ -4019,7 +4084,7 @@ var Br = class {
|
|
|
4019
4084
|
}
|
|
4020
4085
|
async cancel() {
|
|
4021
4086
|
let { fill: e, state: t } = this.options;
|
|
4022
|
-
if (!
|
|
4087
|
+
if (!Lr(t.fill) || !t.fill.cycleId) return;
|
|
4023
4088
|
let n = {
|
|
4024
4089
|
cycleId: t.fill.cycleId,
|
|
4025
4090
|
feedKey: t.fill.feedKey ?? "",
|
|
@@ -4063,7 +4128,7 @@ var Br = class {
|
|
|
4063
4128
|
});
|
|
4064
4129
|
}
|
|
4065
4130
|
reset() {
|
|
4066
|
-
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill =
|
|
4131
|
+
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill = Ir(this.options.fill, void 0, !1), this.collection = null;
|
|
4067
4132
|
}
|
|
4068
4133
|
destroy() {
|
|
4069
4134
|
this.abortLocalRequest(), this.delayCountdown.clear();
|
|
@@ -4098,7 +4163,7 @@ var Br = class {
|
|
|
4098
4163
|
s.fill.status = "until" in t ? "complete" : "exhausted";
|
|
4099
4164
|
return;
|
|
4100
4165
|
}
|
|
4101
|
-
let c = await
|
|
4166
|
+
let c = await Rr({
|
|
4102
4167
|
existingItems: s.items,
|
|
4103
4168
|
getLoadedItemCount: () => s.items.length,
|
|
4104
4169
|
initialCursor: s.next,
|
|
@@ -4150,7 +4215,7 @@ var Br = class {
|
|
|
4150
4215
|
};
|
|
4151
4216
|
//#endregion
|
|
4152
4217
|
//#region src/core/fillReconciliation.ts
|
|
4153
|
-
async function
|
|
4218
|
+
async function qr({ controller: e, isCurrent: t, loadPage: n, onDelayChange: r, pauseWhenManual: i = !1, setLastCursor: a, signal: o, state: s }) {
|
|
4154
4219
|
if (!e.needsReconciliation(s.items)) return "skipped";
|
|
4155
4220
|
let c = await e.reconcile({
|
|
4156
4221
|
existingItems: s.items,
|
|
@@ -4163,7 +4228,7 @@ async function Vr({ controller: e, isCurrent: t, loadPage: n, onDelayChange: r,
|
|
|
4163
4228
|
}
|
|
4164
4229
|
//#endregion
|
|
4165
4230
|
//#region src/core/feedFooter.ts
|
|
4166
|
-
function
|
|
4231
|
+
function Jr(e) {
|
|
4167
4232
|
return {
|
|
4168
4233
|
cancelAutofill: () => e.cancelAutofill(),
|
|
4169
4234
|
loadMore: () => e.loadNext(),
|
|
@@ -4175,46 +4240,46 @@ function Hr(e) {
|
|
|
4175
4240
|
retryFill: () => e.retryFill()
|
|
4176
4241
|
};
|
|
4177
4242
|
}
|
|
4178
|
-
function
|
|
4243
|
+
function Yr(e) {
|
|
4179
4244
|
if (!Number.isFinite(e) || e <= 0) throw TypeError("Vibe reelAutoAdvance.intervalMs must be a positive number.");
|
|
4180
4245
|
}
|
|
4181
|
-
function
|
|
4182
|
-
e?.intervalMs !== void 0 &&
|
|
4246
|
+
function Xr(e) {
|
|
4247
|
+
e?.intervalMs !== void 0 && Yr(e.intervalMs);
|
|
4183
4248
|
}
|
|
4184
|
-
function
|
|
4249
|
+
function Zr(e) {
|
|
4185
4250
|
return {
|
|
4186
4251
|
enabled: e?.enabled ?? !1,
|
|
4187
4252
|
includePostItems: e?.includePostItems ?? !1,
|
|
4188
4253
|
intervalMs: e?.intervalMs ?? 5e3
|
|
4189
4254
|
};
|
|
4190
4255
|
}
|
|
4191
|
-
function
|
|
4256
|
+
function Qr(e, t) {
|
|
4192
4257
|
if (typeof t == "boolean") {
|
|
4193
4258
|
e.enabled = t;
|
|
4194
4259
|
return;
|
|
4195
4260
|
}
|
|
4196
|
-
|
|
4261
|
+
Xr(t), t.enabled !== void 0 && (e.enabled = t.enabled), t.includePostItems !== void 0 && (e.includePostItems = t.includePostItems), t.intervalMs !== void 0 && (e.intervalMs = t.intervalMs);
|
|
4197
4262
|
}
|
|
4198
4263
|
//#endregion
|
|
4199
4264
|
//#region src/core/reelInfoSheet.ts
|
|
4200
|
-
function
|
|
4265
|
+
function $r(e) {
|
|
4201
4266
|
return { enabled: e?.enabled ?? !1 };
|
|
4202
4267
|
}
|
|
4203
|
-
function
|
|
4268
|
+
function ei(e, t, n) {
|
|
4204
4269
|
if (n && !t) throw Error("Vibe cannot enable reelInfoSheet without a configured component.");
|
|
4205
4270
|
e.enabled = n;
|
|
4206
4271
|
}
|
|
4207
4272
|
//#endregion
|
|
4208
4273
|
//#region src/core/initialRuntimeState.ts
|
|
4209
|
-
function
|
|
4274
|
+
function ti(e, t) {
|
|
4210
4275
|
let n = e.initialPage;
|
|
4211
4276
|
return {
|
|
4212
4277
|
activeReelPostId: null,
|
|
4213
|
-
autoScroll:
|
|
4214
|
-
autofill:
|
|
4278
|
+
autoScroll: wr(e.autoScroll),
|
|
4279
|
+
autofill: mr(e.autofill),
|
|
4215
4280
|
current: n?.current ?? null,
|
|
4216
4281
|
error: null,
|
|
4217
|
-
fill:
|
|
4282
|
+
fill: Ir(e.fill),
|
|
4218
4283
|
infiniteScroll: e.infiniteScroll ?? !0,
|
|
4219
4284
|
isLoading: !n,
|
|
4220
4285
|
isLoadingMore: !1,
|
|
@@ -4225,14 +4290,14 @@ function Yr(e, t) {
|
|
|
4225
4290
|
next: n?.next ?? null,
|
|
4226
4291
|
nextPageError: null,
|
|
4227
4292
|
phoneMode: !1,
|
|
4228
|
-
reelAutoAdvance:
|
|
4293
|
+
reelAutoAdvance: Zr(e.reelAutoAdvance),
|
|
4229
4294
|
reelForward: {
|
|
4230
4295
|
error: null,
|
|
4231
4296
|
status: "idle"
|
|
4232
4297
|
},
|
|
4233
4298
|
reelForwardIndex: null,
|
|
4234
4299
|
reelForwardItem: null,
|
|
4235
|
-
reelInfoSheet:
|
|
4300
|
+
reelInfoSheet: $r(e.reelInfoSheet),
|
|
4236
4301
|
reelInfoSheetOverlay: !1,
|
|
4237
4302
|
reelMediaSource: "original",
|
|
4238
4303
|
reelOrigin: null,
|
|
@@ -4241,21 +4306,21 @@ function Yr(e, t) {
|
|
|
4241
4306
|
}
|
|
4242
4307
|
//#endregion
|
|
4243
4308
|
//#region src/core/options.ts
|
|
4244
|
-
function
|
|
4309
|
+
function ni(e, t) {
|
|
4245
4310
|
if (t) {
|
|
4246
4311
|
if (!Number.isFinite(t.height) || t.height <= 0) throw TypeError(`Vibe ${e} height must be a positive number.`);
|
|
4247
4312
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe ${e} background must be "default" or "transparent".`);
|
|
4248
4313
|
}
|
|
4249
4314
|
}
|
|
4250
|
-
function
|
|
4315
|
+
function ri(e, t) {
|
|
4251
4316
|
if (t) {
|
|
4252
4317
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe mediaCard ${e} background must be "default" or "transparent".`);
|
|
4253
4318
|
for (let [n, r] of [["paddingX", t.paddingX], ["paddingY", t.paddingY]]) if (r !== void 0 && (!Number.isFinite(r) || r < 0)) throw TypeError(`Vibe mediaCard ${e} ${n} must be a non-negative number.`);
|
|
4254
4319
|
}
|
|
4255
4320
|
}
|
|
4256
|
-
function
|
|
4257
|
-
if (
|
|
4258
|
-
if (
|
|
4321
|
+
function ii(e) {
|
|
4322
|
+
if (Cr(e.autoScroll), ni("cardHeader", e.cardHeader), ni("cardFooter", e.cardFooter), ri("header", e.mediaCard?.header), ri("footer", e.mediaCard?.footer), e.mediaCard?.feedPreload !== void 0 && e.mediaCard.feedPreload !== "none" && e.mediaCard.feedPreload !== "visible-post") throw TypeError("Vibe mediaCard feedPreload must be \"none\" or \"visible-post\".");
|
|
4323
|
+
if (pr(e.autofill), Fr(e.fill), ke(e.masonry), Xr(e.reelAutoAdvance), e.removalReconciliation) {
|
|
4259
4324
|
if (!Number.isInteger(e.removalReconciliation.pageSize) || e.removalReconciliation.pageSize <= 0) throw TypeError("Vibe removalReconciliation pageSize must be a positive integer.");
|
|
4260
4325
|
let t = e.removalReconciliation.maxReplayPages ?? 5;
|
|
4261
4326
|
if (!Number.isInteger(t) || t <= 0) throw TypeError("Vibe removalReconciliation maxReplayPages must be a positive integer.");
|
|
@@ -4270,7 +4335,7 @@ function Qr(e) {
|
|
|
4270
4335
|
if (e.fill?.strategy === "frontend" && !e.loadPage) throw TypeError("Vibe frontend fill requires loadPage.");
|
|
4271
4336
|
if (e.fill?.strategy === "backend" && e.fill.initialSession && !e.initialPage) throw TypeError("Vibe backend fill restoration requires initialPage.");
|
|
4272
4337
|
}
|
|
4273
|
-
function
|
|
4338
|
+
function ai(e) {
|
|
4274
4339
|
if (typeof e != "string") return e;
|
|
4275
4340
|
if (typeof document > "u") throw Error("Vibe cannot resolve a selector without a document.");
|
|
4276
4341
|
let t = document.querySelector(e);
|
|
@@ -4279,7 +4344,7 @@ function $r(e) {
|
|
|
4279
4344
|
}
|
|
4280
4345
|
//#endregion
|
|
4281
4346
|
//#region src/core/pageRequest.ts
|
|
4282
|
-
async function
|
|
4347
|
+
async function oi({ append: e, autofillController: t, cursor: n, isCurrent: r, loadPage: i, onLastCursor: a, onPages: o, options: s, signal: c, state: l }) {
|
|
4283
4348
|
let u = s.autofill, d = e && u?.strategy === "frontend" && (l.autofill.status === "paused" || l.autofill.status === "error"), f = d ? {
|
|
4284
4349
|
received: l.autofill.received,
|
|
4285
4350
|
requests: l.autofill.requests
|
|
@@ -4291,11 +4356,11 @@ async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4291
4356
|
let m = !1;
|
|
4292
4357
|
try {
|
|
4293
4358
|
if (u?.strategy === "frontend") {
|
|
4294
|
-
let s = await
|
|
4359
|
+
let s = await vr({
|
|
4295
4360
|
existingItems: e ? l.items : [],
|
|
4296
4361
|
initialCursor: n,
|
|
4297
4362
|
loadPage: i,
|
|
4298
|
-
maximumRequests: f ? Math.max(0,
|
|
4363
|
+
maximumRequests: f ? Math.max(0, ur(u) - f.requests) : void 0,
|
|
4299
4364
|
onCollection: (e) => t.captureCollection(e, r()),
|
|
4300
4365
|
onDelayChange: (e) => {
|
|
4301
4366
|
r() && Object.assign(l.autofill, e);
|
|
@@ -4318,7 +4383,7 @@ async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4318
4383
|
}), o(s.pages), t.clearCollection();
|
|
4319
4384
|
return;
|
|
4320
4385
|
}
|
|
4321
|
-
let s =
|
|
4386
|
+
let s = Jn(await i({
|
|
4322
4387
|
cursor: n,
|
|
4323
4388
|
signal: c
|
|
4324
4389
|
}));
|
|
@@ -4338,7 +4403,7 @@ async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4338
4403
|
l.autofill.status = "complete";
|
|
4339
4404
|
return;
|
|
4340
4405
|
}
|
|
4341
|
-
await
|
|
4406
|
+
await Er(u, l, {
|
|
4342
4407
|
cycleId: p,
|
|
4343
4408
|
feedKey: u.feedKey,
|
|
4344
4409
|
items: h.slice(d.length),
|
|
@@ -4360,7 +4425,7 @@ async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4360
4425
|
}
|
|
4361
4426
|
//#endregion
|
|
4362
4427
|
//#region src/core/pageReplacement.ts
|
|
4363
|
-
var
|
|
4428
|
+
var si = class {
|
|
4364
4429
|
controller = null;
|
|
4365
4430
|
constructor(e) {
|
|
4366
4431
|
this.options = e;
|
|
@@ -4372,7 +4437,7 @@ var ti = class {
|
|
|
4372
4437
|
this.controller?.abort(), this.controller = null, this.options.surface()?.cancelItemRemoval();
|
|
4373
4438
|
}
|
|
4374
4439
|
async replace(e, t) {
|
|
4375
|
-
let n =
|
|
4440
|
+
let n = Jn(e);
|
|
4376
4441
|
this.cancel();
|
|
4377
4442
|
let r = new AbortController();
|
|
4378
4443
|
this.controller = r;
|
|
@@ -4392,7 +4457,7 @@ var ti = class {
|
|
|
4392
4457
|
let e = this.options.surface()?.getAutoScrollElement();
|
|
4393
4458
|
e && (e.scrollTop = 0);
|
|
4394
4459
|
}
|
|
4395
|
-
e.mediaIndices = new Map(a.map((t) => [t.postId,
|
|
4460
|
+
e.mediaIndices = new Map(a.map((t) => [t.postId, V(t, e.mediaIndices.get(t.postId) ?? 0)])), e.activeReelPostId !== null && !o.has(String(e.activeReelPostId)) && (e.activeReelPostId = null, e.reelOrigin = null), e.items = a, e.next = n.next, e.total = n.total ?? null, e.error = null, e.nextPageError = null, this.options.commit({
|
|
4396
4461
|
...n,
|
|
4397
4462
|
items: a
|
|
4398
4463
|
});
|
|
@@ -4403,7 +4468,7 @@ var ti = class {
|
|
|
4403
4468
|
};
|
|
4404
4469
|
//#endregion
|
|
4405
4470
|
//#region src/core/loadingLock.ts
|
|
4406
|
-
function
|
|
4471
|
+
function ci(e, t, n) {
|
|
4407
4472
|
if (e.loadMoreLocked !== t && (e.loadMoreLocked = t, !t)) {
|
|
4408
4473
|
if (e.fill.status === "paused" && e.fill.target) {
|
|
4409
4474
|
n.resumeFill();
|
|
@@ -4419,16 +4484,16 @@ function ni(e, t, n) {
|
|
|
4419
4484
|
}
|
|
4420
4485
|
//#endregion
|
|
4421
4486
|
//#region src/core/removalReconciliationController.ts
|
|
4422
|
-
function
|
|
4487
|
+
function li(e) {
|
|
4423
4488
|
return `${typeof e}:${String(e)}`;
|
|
4424
4489
|
}
|
|
4425
|
-
function
|
|
4490
|
+
function ui(e) {
|
|
4426
4491
|
return `${typeof e}:${String(e)}`;
|
|
4427
4492
|
}
|
|
4428
|
-
function
|
|
4493
|
+
function di(e) {
|
|
4429
4494
|
return e.map(({ postId: e }) => e);
|
|
4430
4495
|
}
|
|
4431
|
-
var
|
|
4496
|
+
var fi = class {
|
|
4432
4497
|
delay;
|
|
4433
4498
|
enabled;
|
|
4434
4499
|
maxReplayPages;
|
|
@@ -4447,7 +4512,7 @@ var oi = class {
|
|
|
4447
4512
|
e.status === "complete" && (this.pages = [...this.pages.slice(0, e.replaceFrom), ...e.pages].slice(-this.maxReplayPages), this.pending = null);
|
|
4448
4513
|
}
|
|
4449
4514
|
filterItems(e) {
|
|
4450
|
-
return this.tombstones.size === 0 ? [...e] : e.filter(({ postId: e }) => !this.tombstones.has(
|
|
4515
|
+
return this.tombstones.size === 0 ? [...e] : e.filter(({ postId: e }) => !this.tombstones.has(li(e)));
|
|
4451
4516
|
}
|
|
4452
4517
|
needsReconciliation(e) {
|
|
4453
4518
|
return this.pending !== null || this.findUnderfilledPage(e) >= 0;
|
|
@@ -4460,45 +4525,45 @@ var oi = class {
|
|
|
4460
4525
|
}
|
|
4461
4526
|
recordInitialPage(e) {
|
|
4462
4527
|
e && this.recordPages([{
|
|
4463
|
-
contributionIds:
|
|
4464
|
-
cursor:
|
|
4528
|
+
contributionIds: di(e.items),
|
|
4529
|
+
cursor: Qn(e),
|
|
4465
4530
|
next: e.next,
|
|
4466
|
-
returnedIds:
|
|
4531
|
+
returnedIds: di(e.items)
|
|
4467
4532
|
}]);
|
|
4468
4533
|
}
|
|
4469
4534
|
remove(e) {
|
|
4470
|
-
e.forEach((e) => this.tombstones.add(
|
|
4535
|
+
e.forEach((e) => this.tombstones.add(li(e)));
|
|
4471
4536
|
}
|
|
4472
4537
|
reset() {
|
|
4473
4538
|
this.pages = [], this.pending = null, this.tombstones.clear();
|
|
4474
4539
|
}
|
|
4475
4540
|
restore(e) {
|
|
4476
|
-
e.forEach((e) => this.tombstones.delete(
|
|
4541
|
+
e.forEach((e) => this.tombstones.delete(li(e)));
|
|
4477
4542
|
}
|
|
4478
4543
|
async reconcile({ existingItems: e, loadPage: t, onDelayChange: n = () => void 0, shouldPause: r = () => !1, signal: i }) {
|
|
4479
4544
|
let a = this.pending ?? this.createSession(e);
|
|
4480
4545
|
for (this.pending = a; a.remainingRequests > 0;) {
|
|
4481
|
-
let e =
|
|
4546
|
+
let e = ui(a.cursor);
|
|
4482
4547
|
if (a.seenCursors.has(e)) throw Error("Vibe removal reconciliation received a repeated cursor.");
|
|
4483
|
-
if (await
|
|
4484
|
-
delayMs:
|
|
4548
|
+
if (await cr({
|
|
4549
|
+
delayMs: or(a.pages.length, this.delay),
|
|
4485
4550
|
onChange: n,
|
|
4486
4551
|
signal: i
|
|
4487
4552
|
}), a.pages.length > 0 && r()) return this.result(a, "paused");
|
|
4488
|
-
let o =
|
|
4553
|
+
let o = Jn(await t({
|
|
4489
4554
|
cursor: a.cursor,
|
|
4490
4555
|
signal: i
|
|
4491
4556
|
}));
|
|
4492
4557
|
a.seenCursors.add(e);
|
|
4493
4558
|
let s = this.filterItems(o.items), c = [];
|
|
4494
4559
|
if (s.forEach((e) => {
|
|
4495
|
-
let t =
|
|
4560
|
+
let t = li(e.postId);
|
|
4496
4561
|
a.attributed.has(t) || (a.attributed.add(t), c.push(e.postId)), a.appended.has(t) || (a.appended.add(t), a.items.push(e));
|
|
4497
4562
|
}), a.pages.push({
|
|
4498
4563
|
contributionIds: c,
|
|
4499
4564
|
cursor: a.cursor,
|
|
4500
4565
|
next: o.next,
|
|
4501
|
-
returnedIds:
|
|
4566
|
+
returnedIds: di(s)
|
|
4502
4567
|
}), a.lastCursor = a.cursor, a.next = o.next, --a.remainingRequests, o.total !== void 0 && (a.total = o.total), a.next === null ? a.remainingRequests = 0 : a.cursor = a.next, a.remainingRequests > 0 && r()) return this.result(a, "paused");
|
|
4503
4568
|
}
|
|
4504
4569
|
return this.result(a, "complete");
|
|
@@ -4506,9 +4571,9 @@ var oi = class {
|
|
|
4506
4571
|
createSession(e) {
|
|
4507
4572
|
let t = this.findUnderfilledPage(e), n = t < 0 ? [] : this.pages.slice(t), r = n[0];
|
|
4508
4573
|
if (!r) throw Error("Vibe has no underfilled provider page to reconcile.");
|
|
4509
|
-
let i = new Set(n.flatMap(({ contributionIds: e }) => e.map(
|
|
4574
|
+
let i = new Set(n.flatMap(({ contributionIds: e }) => e.map(li))), a = new Set(e.map(({ postId: e }) => li(e)).filter((e) => !i.has(e)));
|
|
4510
4575
|
return {
|
|
4511
|
-
appended: new Set(e.map(({ postId: e }) =>
|
|
4576
|
+
appended: new Set(e.map(({ postId: e }) => li(e))),
|
|
4512
4577
|
attributed: new Set(a),
|
|
4513
4578
|
cursor: r.cursor,
|
|
4514
4579
|
items: [],
|
|
@@ -4533,11 +4598,11 @@ var oi = class {
|
|
|
4533
4598
|
}
|
|
4534
4599
|
findUnderfilledPage(e) {
|
|
4535
4600
|
if (!this.enabled || this.pages.length === 0) return -1;
|
|
4536
|
-
let t = new Set(e.map(({ postId: e }) =>
|
|
4537
|
-
return this.pages.findIndex(({ contributionIds: e }) => e.filter((e) => t.has(
|
|
4601
|
+
let t = new Set(e.map(({ postId: e }) => li(e)));
|
|
4602
|
+
return this.pages.findIndex(({ contributionIds: e }) => e.filter((e) => t.has(li(e))).length < this.pageSize);
|
|
4538
4603
|
}
|
|
4539
4604
|
recordPage(e) {
|
|
4540
|
-
let t =
|
|
4605
|
+
let t = ui(e.cursor), n = this.pages.findIndex(({ cursor: e }) => ui(e) === t);
|
|
4541
4606
|
n >= 0 && (this.pages = this.pages.slice(0, n)), this.pages.push({
|
|
4542
4607
|
...e,
|
|
4543
4608
|
contributionIds: [...e.contributionIds],
|
|
@@ -4547,7 +4612,7 @@ var oi = class {
|
|
|
4547
4612
|
};
|
|
4548
4613
|
//#endregion
|
|
4549
4614
|
//#region src/core/activeItemRemoval.ts
|
|
4550
|
-
function
|
|
4615
|
+
function pi(e, t, n, r, i) {
|
|
4551
4616
|
let a = new Set(t.map(({ item: e }) => e.postId));
|
|
4552
4617
|
if (e.activeReelPostId === null || !a.has(e.activeReelPostId)) return;
|
|
4553
4618
|
let o = e.items[Math.max(n, 0)];
|
|
@@ -4560,7 +4625,7 @@ function si(e, t, n, r, i) {
|
|
|
4560
4625
|
}
|
|
4561
4626
|
//#endregion
|
|
4562
4627
|
//#region src/core/exactMediaRemovalController.ts
|
|
4563
|
-
function
|
|
4628
|
+
function mi(e, t) {
|
|
4564
4629
|
let [n, ...r] = t;
|
|
4565
4630
|
if (!n) throw Error("Vibe items must contain at least one media asset.");
|
|
4566
4631
|
return {
|
|
@@ -4569,10 +4634,10 @@ function ci(e, t) {
|
|
|
4569
4634
|
items: r
|
|
4570
4635
|
};
|
|
4571
4636
|
}
|
|
4572
|
-
function
|
|
4637
|
+
function hi(e) {
|
|
4573
4638
|
if (!Number.isInteger(e.mediaIndex) || e.mediaIndex < 0) throw TypeError("Vibe mediaIndex must be a non-negative integer.");
|
|
4574
4639
|
}
|
|
4575
|
-
var
|
|
4640
|
+
var gi = class {
|
|
4576
4641
|
generation = 0;
|
|
4577
4642
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
4578
4643
|
state;
|
|
@@ -4580,10 +4645,10 @@ var ui = class {
|
|
|
4580
4645
|
this.options = e, this.state = e.state;
|
|
4581
4646
|
}
|
|
4582
4647
|
remove(e) {
|
|
4583
|
-
|
|
4648
|
+
hi(e);
|
|
4584
4649
|
let t = this.state.items.findIndex(({ postId: t }) => t === e.postId), n = this.state.items[t];
|
|
4585
4650
|
if (!n) return null;
|
|
4586
|
-
let r = [...
|
|
4651
|
+
let r = [...B(n)], i = r[e.mediaIndex];
|
|
4587
4652
|
if (!i) return null;
|
|
4588
4653
|
let a = Object.freeze({
|
|
4589
4654
|
media: i,
|
|
@@ -4597,7 +4662,7 @@ var ui = class {
|
|
|
4597
4662
|
restored: !1
|
|
4598
4663
|
});
|
|
4599
4664
|
let o = this.state.mediaIndices.get(n.postId) ?? 0, s = this.isReelOpen() && this.state.activeReelPostId === n.postId, c = s && o === e.mediaIndex;
|
|
4600
|
-
return r.splice(e.mediaIndex, 1), r.length > 0 ? (this.state.items[t] =
|
|
4665
|
+
return r.splice(e.mediaIndex, 1), r.length > 0 ? (this.state.items[t] = mi(n, r), this.updateMediaIndexAfterRemoval(n.postId, e.mediaIndex, c), a) : (this.state.items.splice(t, 1), this.options.onPostRemoved(n.postId), this.state.mediaIndices.delete(n.postId), s && this.advanceFromRemovedPost(a, n), a);
|
|
4601
4666
|
}
|
|
4602
4667
|
reset() {
|
|
4603
4668
|
this.generation += 1;
|
|
@@ -4622,32 +4687,32 @@ var ui = class {
|
|
|
4622
4687
|
return this.state.layout === "reel" || this.state.reelOrigin === "masonry";
|
|
4623
4688
|
}
|
|
4624
4689
|
restoreIntoPost(e, t) {
|
|
4625
|
-
let n = this.state.items[e], r = [...
|
|
4626
|
-
if (r.splice(i, 0, t.media), this.state.items[e] =
|
|
4690
|
+
let n = this.state.items[e], r = [...B(n)], i = Math.min(t.mediaIndex, r.length);
|
|
4691
|
+
if (r.splice(i, 0, t.media), this.state.items[e] = mi(n, r), this.state.activeReelPostId !== t.postId) return;
|
|
4627
4692
|
let a = this.state.mediaIndices.get(t.postId) ?? 0;
|
|
4628
4693
|
a >= i && this.state.mediaIndices.set(t.postId, a + 1);
|
|
4629
4694
|
}
|
|
4630
4695
|
updateMediaIndexAfterRemoval(e, t, n) {
|
|
4631
4696
|
let r = this.state.items.find((t) => t.postId === e);
|
|
4632
4697
|
if (!r) return;
|
|
4633
|
-
let i =
|
|
4698
|
+
let i = B(r).length, a = this.state.mediaIndices.get(e) ?? 0, o = a;
|
|
4634
4699
|
n ? o = t < i ? t : 0 : t < a && (o = a - 1), this.state.mediaIndices.set(e, Math.min(o, i - 1));
|
|
4635
4700
|
}
|
|
4636
4701
|
};
|
|
4637
4702
|
//#endregion
|
|
4638
4703
|
//#region src/core/itemPlacement.ts
|
|
4639
|
-
function
|
|
4704
|
+
function _i(e, t) {
|
|
4640
4705
|
let n = new Set(t);
|
|
4641
4706
|
return e.flatMap((e, t) => n.has(e.postId) ? [{
|
|
4642
4707
|
index: t,
|
|
4643
4708
|
item: e
|
|
4644
4709
|
}] : []);
|
|
4645
4710
|
}
|
|
4646
|
-
function
|
|
4711
|
+
function vi(e, t) {
|
|
4647
4712
|
let n = new Set(t.map(({ item: e }) => e.postId));
|
|
4648
4713
|
return e.filter((e) => !n.has(e.postId));
|
|
4649
4714
|
}
|
|
4650
|
-
function
|
|
4715
|
+
function yi(e, t) {
|
|
4651
4716
|
t.forEach(({ index: e }) => {
|
|
4652
4717
|
if (!Number.isInteger(e) || e < 0) throw Error("Vibe item restore indexes must be non-negative integers.");
|
|
4653
4718
|
});
|
|
@@ -4658,7 +4723,7 @@ function pi(e, t) {
|
|
|
4658
4723
|
}
|
|
4659
4724
|
//#endregion
|
|
4660
4725
|
//#region src/core/itemRemovalController.ts
|
|
4661
|
-
var
|
|
4726
|
+
var bi = 20, xi = class {
|
|
4662
4727
|
generation = 0;
|
|
4663
4728
|
historyLimit;
|
|
4664
4729
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
@@ -4667,7 +4732,7 @@ var mi = 20, hi = class {
|
|
|
4667
4732
|
itemOrder;
|
|
4668
4733
|
stopItemsWatcher;
|
|
4669
4734
|
constructor(e) {
|
|
4670
|
-
this.options = e, this.historyLimit = e.historyLimit ??
|
|
4735
|
+
this.options = e, this.historyLimit = e.historyLimit ?? bi, this.state = e.state, this.itemOrder = this.state.items.map(({ postId: e }) => e), this.stopItemsWatcher = O(() => this.state.items, (e) => this.appendUnknownItems(e), { flush: "sync" });
|
|
4671
4736
|
}
|
|
4672
4737
|
destroy() {
|
|
4673
4738
|
this.reset(), this.stopItemsWatcher();
|
|
@@ -4681,7 +4746,7 @@ var mi = 20, hi = class {
|
|
|
4681
4746
|
let a = this.options.startRemoval(i, t);
|
|
4682
4747
|
if (a > 0 && await new Promise((e) => setTimeout(e, a)), this.metadata.get(r)?.generation !== this.generation) return r;
|
|
4683
4748
|
let o = this.state.items.findIndex((e) => e.postId === this.state.activeReelPostId), s = new Set(n.map(({ item: e }) => e.postId)), c = o < 0 ? 0 : this.state.items.slice(0, o).filter(({ postId: e }) => s.has(e)).length, l = Math.max(o - c, 0);
|
|
4684
|
-
return this.state.items =
|
|
4749
|
+
return this.state.items = vi(this.state.items, n), this.options.onItemsRemoved(r, n, l), this.record(r), r;
|
|
4685
4750
|
}
|
|
4686
4751
|
reset() {
|
|
4687
4752
|
this.generation += 1, this.history = [], this.itemOrder = [];
|
|
@@ -4692,7 +4757,7 @@ var mi = 20, hi = class {
|
|
|
4692
4757
|
this.restoreRemoval(t);
|
|
4693
4758
|
return;
|
|
4694
4759
|
}
|
|
4695
|
-
let n = new Set(this.state.items.map(({ postId: e }) => e)), r = e.filter(({ item: e }) => n.has(e.postId) ? !1 : (n.add(e.postId), !0)), i =
|
|
4760
|
+
let n = new Set(this.state.items.map(({ postId: e }) => e)), r = e.filter(({ item: e }) => n.has(e.postId) ? !1 : (n.add(e.postId), !0)), i = yi(this.state.items, r);
|
|
4696
4761
|
this.registerExternalPlacements(r), this.state.items = i, r.length > 0 && this.options.onRemovalRestored(r);
|
|
4697
4762
|
}
|
|
4698
4763
|
restoreRemoval(e) {
|
|
@@ -4718,7 +4783,7 @@ var mi = 20, hi = class {
|
|
|
4718
4783
|
}
|
|
4719
4784
|
collectOrderedPlacements(e) {
|
|
4720
4785
|
let t = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
4721
|
-
return
|
|
4786
|
+
return _i(this.state.items, e).map((e) => ({
|
|
4722
4787
|
index: t.get(e.item.postId) ?? e.index,
|
|
4723
4788
|
item: e.item
|
|
4724
4789
|
}));
|
|
@@ -4749,7 +4814,7 @@ var mi = 20, hi = class {
|
|
|
4749
4814
|
let r = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
4750
4815
|
return this.state.items = [...this.state.items, ...n].sort((e, t) => (r.get(e.postId) ?? 2 ** 53 - 1) - (r.get(t.postId) ?? 2 ** 53 - 1)), !0;
|
|
4751
4816
|
}
|
|
4752
|
-
},
|
|
4817
|
+
}, Si = class {
|
|
4753
4818
|
forward = null;
|
|
4754
4819
|
forwardPromise = null;
|
|
4755
4820
|
forwardVersion = 0;
|
|
@@ -4845,7 +4910,7 @@ var mi = 20, hi = class {
|
|
|
4845
4910
|
}
|
|
4846
4911
|
}
|
|
4847
4912
|
}
|
|
4848
|
-
},
|
|
4913
|
+
}, Ci = class {
|
|
4849
4914
|
generation = 0;
|
|
4850
4915
|
pending = Promise.resolve();
|
|
4851
4916
|
constructor(e) {
|
|
@@ -4862,7 +4927,7 @@ var mi = 20, hi = class {
|
|
|
4862
4927
|
if (!n) return;
|
|
4863
4928
|
let r = t.mediaIndices.get(e.postId) ?? 0;
|
|
4864
4929
|
if (e.mediaIndex === r) {
|
|
4865
|
-
if (
|
|
4930
|
+
if (B(n).length > 1) {
|
|
4866
4931
|
await this.options.transitionMedia(1);
|
|
4867
4932
|
return;
|
|
4868
4933
|
}
|
|
@@ -4895,24 +4960,24 @@ var mi = 20, hi = class {
|
|
|
4895
4960
|
};
|
|
4896
4961
|
//#endregion
|
|
4897
4962
|
//#region src/core/removalControllers.ts
|
|
4898
|
-
function
|
|
4899
|
-
let t = new
|
|
4963
|
+
function wi(e) {
|
|
4964
|
+
let t = new Si(e), n = new Ci({
|
|
4900
4965
|
state: e.state,
|
|
4901
4966
|
transitionMedia: (t) => e.surface()?.transitionActiveReelMedia(t) ?? Promise.resolve(!1),
|
|
4902
4967
|
transitionPost: (t) => e.surface()?.transitionActiveReelPost(t) ?? Promise.resolve(!1)
|
|
4903
4968
|
});
|
|
4904
4969
|
return {
|
|
4905
|
-
exactMediaRemoval: new
|
|
4970
|
+
exactMediaRemoval: new gi({
|
|
4906
4971
|
onActivate: e.onActivate,
|
|
4907
4972
|
onPostRemoved: (t) => e.onItemsRemoved([t]),
|
|
4908
4973
|
onPostRestored: (t) => e.onItemsRestored([t]),
|
|
4909
4974
|
reelForward: t,
|
|
4910
4975
|
state: e.state
|
|
4911
4976
|
}),
|
|
4912
|
-
itemRemoval: new
|
|
4977
|
+
itemRemoval: new xi({
|
|
4913
4978
|
historyLimit: e.historyLimit,
|
|
4914
4979
|
onItemsRemoved: (n, r, i) => {
|
|
4915
|
-
e.onItemsRemoved(r.map(({ item: e }) => e.postId)),
|
|
4980
|
+
e.onItemsRemoved(r.map(({ item: e }) => e.postId)), pi(e.state, r, i, e.onActivate, (e, r) => t.start(n, e, r));
|
|
4916
4981
|
},
|
|
4917
4982
|
onRemovalRestored: (n) => {
|
|
4918
4983
|
e.onItemsRestored(n.map(({ item: e }) => e.postId));
|
|
@@ -4927,17 +4992,17 @@ function vi(e) {
|
|
|
4927
4992
|
reelRemoval: n
|
|
4928
4993
|
};
|
|
4929
4994
|
}
|
|
4930
|
-
var
|
|
4931
|
-
function
|
|
4995
|
+
var Ti = 1.5;
|
|
4996
|
+
function Ei(e) {
|
|
4932
4997
|
let t = Math.min(e.screenWidth, e.screenHeight);
|
|
4933
4998
|
if (t > 0 && t < 600) return !0;
|
|
4934
|
-
let n = Math.min(e.viewportWidth, e.viewportHeight), r = t >= n *
|
|
4999
|
+
let n = Math.min(e.viewportWidth, e.viewportHeight), r = t >= n * Ti;
|
|
4935
5000
|
return !e.hasHover && n > 0 && n < 600 && r;
|
|
4936
5001
|
}
|
|
4937
|
-
function
|
|
4938
|
-
return
|
|
5002
|
+
function Di(e) {
|
|
5003
|
+
return Ei(e) ? "reel" : "masonry";
|
|
4939
5004
|
}
|
|
4940
|
-
function
|
|
5005
|
+
function Oi(e) {
|
|
4941
5006
|
let t = e.ownerDocument.defaultView, n = e.ownerDocument.documentElement;
|
|
4942
5007
|
return {
|
|
4943
5008
|
hasHover: typeof t?.matchMedia == "function" && t.matchMedia("(hover: hover)").matches,
|
|
@@ -4947,15 +5012,15 @@ function Si(e) {
|
|
|
4947
5012
|
viewportWidth: n.clientWidth
|
|
4948
5013
|
};
|
|
4949
5014
|
}
|
|
4950
|
-
function
|
|
4951
|
-
return
|
|
5015
|
+
function ki(e) {
|
|
5016
|
+
return Ei(Oi(e));
|
|
4952
5017
|
}
|
|
4953
|
-
function
|
|
4954
|
-
return
|
|
5018
|
+
function Ai(e) {
|
|
5019
|
+
return Di(Oi(e));
|
|
4955
5020
|
}
|
|
4956
5021
|
//#endregion
|
|
4957
5022
|
//#region src/core/responsiveLayoutController.ts
|
|
4958
|
-
var
|
|
5023
|
+
var ji = class {
|
|
4959
5024
|
layoutMode;
|
|
4960
5025
|
resizeObserver = null;
|
|
4961
5026
|
target = null;
|
|
@@ -4980,13 +5045,13 @@ var Ti = class {
|
|
|
4980
5045
|
}
|
|
4981
5046
|
handleResponsiveLayout = () => {
|
|
4982
5047
|
if (!this.target) return;
|
|
4983
|
-
let e =
|
|
4984
|
-
this.state.phoneMode =
|
|
5048
|
+
let e = Ai(this.target);
|
|
5049
|
+
this.state.phoneMode = ki(this.target), this.state.reelInfoSheetOverlay = this.state.phoneMode, this.state.reelMediaSource = this.state.phoneMode ? "mobile" : "original", this.layoutMode === "responsive" && this.applyLayout(e);
|
|
4985
5050
|
};
|
|
4986
|
-
},
|
|
5051
|
+
}, Mi = class {
|
|
4987
5052
|
state;
|
|
4988
5053
|
constructor(e) {
|
|
4989
|
-
this.options = e, this.state = x(
|
|
5054
|
+
this.options = e, this.state = x(Rt({
|
|
4990
5055
|
...e.initialReelAudioState,
|
|
4991
5056
|
muted: e.initialReelAudioState?.muted ?? e.mediaCard?.videoMuted ?? !1
|
|
4992
5057
|
}));
|
|
@@ -4995,9 +5060,9 @@ var Ti = class {
|
|
|
4995
5060
|
return { ...this.state };
|
|
4996
5061
|
}
|
|
4997
5062
|
set(e, t = !1) {
|
|
4998
|
-
Object.assign(this.state,
|
|
5063
|
+
Object.assign(this.state, Rt(e, this.state)), t && this.options.onReelAudioStateChange?.(this.get());
|
|
4999
5064
|
}
|
|
5000
|
-
},
|
|
5065
|
+
}, Ni = class {
|
|
5001
5066
|
routedReelPostId = null;
|
|
5002
5067
|
reelRouteIsActive = !1;
|
|
5003
5068
|
constructor(e, t) {
|
|
@@ -5027,30 +5092,30 @@ var Ti = class {
|
|
|
5027
5092
|
};
|
|
5028
5093
|
//#endregion
|
|
5029
5094
|
//#region src/core/updateItems.ts
|
|
5030
|
-
function
|
|
5095
|
+
function Pi(e) {
|
|
5031
5096
|
return String(e);
|
|
5032
5097
|
}
|
|
5033
|
-
function
|
|
5034
|
-
let n =
|
|
5098
|
+
function Fi(e, t) {
|
|
5099
|
+
let n = B(t).length;
|
|
5035
5100
|
(e.mediaIndices.get(t.postId) ?? 0) >= n && e.mediaIndices.set(t.postId, Math.max(0, n - 1));
|
|
5036
5101
|
}
|
|
5037
|
-
function
|
|
5102
|
+
function Ii(e, t) {
|
|
5038
5103
|
let n = /* @__PURE__ */ new Map();
|
|
5039
|
-
if (t.forEach((e) => n.set(
|
|
5104
|
+
if (t.forEach((e) => n.set(Pi(e.postId), e)), n.size === 0) return [];
|
|
5040
5105
|
let r = [], i = e.items.map((t) => {
|
|
5041
|
-
let i = n.get(
|
|
5106
|
+
let i = n.get(Pi(t.postId));
|
|
5042
5107
|
if (!i) return t;
|
|
5043
5108
|
let a = {
|
|
5044
5109
|
...i,
|
|
5045
5110
|
postId: t.postId
|
|
5046
5111
|
};
|
|
5047
|
-
return
|
|
5112
|
+
return Fi(e, a), e.reelForwardItem && Pi(e.reelForwardItem.postId) === Pi(t.postId) && (e.reelForwardItem = a), r.push(t.postId), a;
|
|
5048
5113
|
});
|
|
5049
5114
|
return r.length > 0 && (e.items = i), r;
|
|
5050
5115
|
}
|
|
5051
5116
|
//#endregion
|
|
5052
5117
|
//#region src/core/createVibe.ts
|
|
5053
|
-
var
|
|
5118
|
+
var Li = class {
|
|
5054
5119
|
app = null;
|
|
5055
5120
|
autoScroll;
|
|
5056
5121
|
autofillController;
|
|
@@ -5074,25 +5139,25 @@ var ji = class {
|
|
|
5074
5139
|
state;
|
|
5075
5140
|
pageReplacement;
|
|
5076
5141
|
constructor(e) {
|
|
5077
|
-
this.options = e,
|
|
5142
|
+
this.options = e, ii(e);
|
|
5078
5143
|
let t = e.layout ?? "masonry";
|
|
5079
|
-
this.state = x(
|
|
5144
|
+
this.state = x(ti(e, t)), this.reelAudio = new Mi(e), this.lastLoadedCursor = e.initialPage ? Qn(e.initialPage) : null, this.notificationItems = W(this.state), this.autoScroll = new Tr({
|
|
5080
5145
|
getScrollElement: () => this.surface?.getAutoScrollElement() ?? null,
|
|
5081
5146
|
state: this.state.autoScroll
|
|
5082
|
-
}), this.autofillController = new
|
|
5147
|
+
}), this.autofillController = new yr({
|
|
5083
5148
|
cancelRequest: () => this.cancelRequest(!this.pageReplacement?.isActive()),
|
|
5084
5149
|
onLastCursor: (e) => this.setCurrentCursor(e),
|
|
5085
5150
|
onPages: (e) => this.removalReconciliation.recordPages(e),
|
|
5086
5151
|
options: e.autofill,
|
|
5087
5152
|
state: this.state
|
|
5088
|
-
}), this.removalReconciliation = new
|
|
5153
|
+
}), this.removalReconciliation = new fi(e), this.removalReconciliation.recordInitialPage(e.initialPage), this.fillController = new Kr({
|
|
5089
5154
|
filterItems: (e) => this.removalReconciliation.filterItems(e),
|
|
5090
5155
|
fill: e.fill,
|
|
5091
5156
|
loadPage: e.loadPage ? (e) => this.loadFilteredPage(e) : void 0,
|
|
5092
5157
|
needsFrontendPreparation: () => this.removalReconciliation.needsReconciliation(this.state.items),
|
|
5093
5158
|
onLastCursor: (e) => this.setCurrentCursor(e),
|
|
5094
5159
|
onPages: (e) => this.removalReconciliation.recordPages(e),
|
|
5095
|
-
prepareFrontend: ({ isCurrent: t, onDelayChange: n, signal: r }) =>
|
|
5160
|
+
prepareFrontend: ({ isCurrent: t, onDelayChange: n, signal: r }) => qr({
|
|
5096
5161
|
controller: this.removalReconciliation,
|
|
5097
5162
|
isCurrent: t,
|
|
5098
5163
|
loadPage: e.loadPage,
|
|
@@ -5102,8 +5167,8 @@ var ji = class {
|
|
|
5102
5167
|
state: this.state
|
|
5103
5168
|
}),
|
|
5104
5169
|
state: this.state
|
|
5105
|
-
}), this.routing = new
|
|
5106
|
-
let n =
|
|
5170
|
+
}), this.routing = new Ni(e.routing, this.state);
|
|
5171
|
+
let n = wi({
|
|
5107
5172
|
historyLimit: e.removalHistoryLimit,
|
|
5108
5173
|
onActivate: (e) => this.setActiveReelPost(e),
|
|
5109
5174
|
onCloseReel: () => this.closeMasonryReel(),
|
|
@@ -5113,29 +5178,29 @@ var ji = class {
|
|
|
5113
5178
|
state: this.state,
|
|
5114
5179
|
surface: () => this.surface
|
|
5115
5180
|
});
|
|
5116
|
-
this.exactMediaRemoval = n.exactMediaRemoval, this.itemRemoval = n.itemRemoval, this.reelForward = n.reelForward, this.reelRemoval = n.reelRemoval, this.pageReplacement = new
|
|
5181
|
+
this.exactMediaRemoval = n.exactMediaRemoval, this.itemRemoval = n.itemRemoval, this.reelForward = n.reelForward, this.reelRemoval = n.reelRemoval, this.pageReplacement = new si({
|
|
5117
5182
|
state: this.state,
|
|
5118
5183
|
surface: () => this.surface,
|
|
5119
5184
|
prepare: async () => {
|
|
5120
|
-
this.cancelRequest(!1),
|
|
5185
|
+
this.cancelRequest(!1), hr(this.state.autofill) && await this.cancelAutofill(), this.fillController.isActive() && await this.cancelFill();
|
|
5121
5186
|
},
|
|
5122
5187
|
commit: (e) => {
|
|
5123
|
-
this.resetFeedVisit(), this.setCurrentCursor(
|
|
5188
|
+
this.resetFeedVisit(), this.setCurrentCursor(Qn(e)), this.removalReconciliation.recordInitialPage(e), this.state.reelOrigin === null && this.routing.syncFeed();
|
|
5124
5189
|
}
|
|
5125
|
-
}), this.responsiveLayout = new
|
|
5190
|
+
}), this.responsiveLayout = new ji(t, this.state, () => {
|
|
5126
5191
|
this.routing.syncFeed();
|
|
5127
5192
|
}), this.startStateNotifications();
|
|
5128
5193
|
}
|
|
5129
5194
|
async mount() {
|
|
5130
5195
|
if (this.app) throw Error("Vibe is already mounted.");
|
|
5131
5196
|
this.startStateNotifications();
|
|
5132
|
-
let e =
|
|
5133
|
-
this.responsiveLayout.mount(e), this.app = i(
|
|
5197
|
+
let e = ai(this.options.target);
|
|
5198
|
+
this.responsiveLayout.mount(e), this.app = i(qn, {
|
|
5134
5199
|
canRetryEnd: !!this.options.loadPage,
|
|
5135
5200
|
cardFooter: this.options.cardFooter,
|
|
5136
5201
|
cardHeader: this.options.cardHeader,
|
|
5137
5202
|
feedFooter: this.options.feedFooter,
|
|
5138
|
-
feedFooterActions:
|
|
5203
|
+
feedFooterActions: Jr(this),
|
|
5139
5204
|
mediaCard: this.options.mediaCard,
|
|
5140
5205
|
masonry: this.options.masonry,
|
|
5141
5206
|
onMediaFullyVisible: this.options.onMediaFullyVisible,
|
|
@@ -5162,7 +5227,7 @@ var ji = class {
|
|
|
5162
5227
|
onRetryForward: () => {
|
|
5163
5228
|
this.retryReelForward();
|
|
5164
5229
|
}
|
|
5165
|
-
}), this.surface = this.app.mount(e), this.autoScroll.mount(), await
|
|
5230
|
+
}), this.surface = this.app.mount(e), this.autoScroll.mount(), await Ar(this.options.restoreBacklog, (e) => this.appendPage(e), (e) => {
|
|
5166
5231
|
this.restoreController = e;
|
|
5167
5232
|
}), !this.options.initialPage && this.state.items.length === 0 ? await this.reload() : this.options.autofill && this.state.autofill.status === "idle" && !this.fillController.isActive() && !this.state.loadMoreLocked && await this.startInitialAutofill();
|
|
5168
5233
|
}
|
|
@@ -5170,7 +5235,7 @@ var ji = class {
|
|
|
5170
5235
|
this.restoreController?.abort(), this.restoreController = null, this.autoScroll.destroy(), this.fillController.destroy(), this.cancelRequest(), this.reelForward.reset(), this.reelRemoval.reset(), this.exactMediaRemoval.reset(), this.itemRemoval.destroy(), this.removalReconciliation.reset(), this.responsiveLayout.destroy(), this.stopStateWatcher?.(), this.stopStateWatcher = null, this.app?.unmount(), this.app = null, this.surface = null;
|
|
5171
5236
|
}
|
|
5172
5237
|
getState() {
|
|
5173
|
-
return
|
|
5238
|
+
return ne(this.state);
|
|
5174
5239
|
}
|
|
5175
5240
|
getReelAudioState() {
|
|
5176
5241
|
return this.reelAudio.get();
|
|
@@ -5197,7 +5262,7 @@ var ji = class {
|
|
|
5197
5262
|
return this.itemRemoval.restoreRemoval(e);
|
|
5198
5263
|
}
|
|
5199
5264
|
updateItems(e) {
|
|
5200
|
-
return
|
|
5265
|
+
return Ii(this.state, e);
|
|
5201
5266
|
}
|
|
5202
5267
|
retryReelForward() {
|
|
5203
5268
|
return this.reelForward.retry();
|
|
@@ -5236,7 +5301,7 @@ var ji = class {
|
|
|
5236
5301
|
this.autoScroll.setSpeed(e);
|
|
5237
5302
|
}
|
|
5238
5303
|
applyAutofillUpdate(e) {
|
|
5239
|
-
let t =
|
|
5304
|
+
let t = Or(this.options.autofill, this.state, e);
|
|
5240
5305
|
return t && this.autofillController.syncCountdown(), t;
|
|
5241
5306
|
}
|
|
5242
5307
|
cancelAutofill() {
|
|
@@ -5247,7 +5312,7 @@ var ji = class {
|
|
|
5247
5312
|
await this.cancelFill();
|
|
5248
5313
|
return;
|
|
5249
5314
|
}
|
|
5250
|
-
if (
|
|
5315
|
+
if (hr(this.state.autofill)) {
|
|
5251
5316
|
await this.cancelAutofill();
|
|
5252
5317
|
return;
|
|
5253
5318
|
}
|
|
@@ -5260,12 +5325,12 @@ var ji = class {
|
|
|
5260
5325
|
}
|
|
5261
5326
|
async fill(e) {
|
|
5262
5327
|
if (!(this.state.loadMoreLocked || this.pageReplacement.isActive())) {
|
|
5263
|
-
if (this.pendingRequest ||
|
|
5328
|
+
if (this.pendingRequest || hr(this.state.autofill)) throw Error("Vibe cannot fill while another page operation is active.");
|
|
5264
5329
|
await this.fillController.start(e);
|
|
5265
5330
|
}
|
|
5266
5331
|
}
|
|
5267
5332
|
restoreAutofillSession(e) {
|
|
5268
|
-
let t =
|
|
5333
|
+
let t = kr(this.options.autofill, this.state, e);
|
|
5269
5334
|
return t && this.autofillController.syncCountdown(), t;
|
|
5270
5335
|
}
|
|
5271
5336
|
restoreFillSession(e) {
|
|
@@ -5275,7 +5340,7 @@ var ji = class {
|
|
|
5275
5340
|
return this.startLoadMore(() => this.loadNextSequence());
|
|
5276
5341
|
}
|
|
5277
5342
|
appendPage(e) {
|
|
5278
|
-
|
|
5343
|
+
$n(e, this.state, this.removalReconciliation, (e) => this.setCurrentCursor(e));
|
|
5279
5344
|
}
|
|
5280
5345
|
replenishAfterRemoval(e = !0) {
|
|
5281
5346
|
return this.startLoadMore(() => this.replenishAfterRemovalSequence(e));
|
|
@@ -5283,7 +5348,7 @@ var ji = class {
|
|
|
5283
5348
|
async startLoadMore(e) {
|
|
5284
5349
|
if (this.pageReplacement.isActive()) return;
|
|
5285
5350
|
if (this.pendingRequest) return this.pendingRequest;
|
|
5286
|
-
if (this.state.loadMoreLocked ||
|
|
5351
|
+
if (this.state.loadMoreLocked || hr(this.state.autofill) || this.fillController.isActive() || !this.options.loadPage || this.state.next === null && !this.removalReconciliation.needsReconciliation(this.state.items)) return;
|
|
5287
5352
|
this.state.isLoadingMore = !0, this.state.nextPageError = null;
|
|
5288
5353
|
let t = e();
|
|
5289
5354
|
return this.pendingRequest = t, t.finally(() => {
|
|
@@ -5301,15 +5366,15 @@ var ji = class {
|
|
|
5301
5366
|
}
|
|
5302
5367
|
async replaceFeed(e, t) {
|
|
5303
5368
|
if (!this.options.loadPage) throw Error(`Vibe cannot ${t} without loadPage.`);
|
|
5304
|
-
return
|
|
5369
|
+
return hr(this.state.autofill) && await this.cancelAutofill(), this.fillController.isActive() && await this.cancelFill(), this.cancelRequest(), this.resetFeedVisit(), this.surface?.resetMediaLifecycle(), this.state.error = null, this.state.current = null, this.state.isLoading = !0, this.state.items = [], this.state.next = null, this.state.nextPageError = null, this.state.total = null, this.startRequest(e, !1);
|
|
5305
5370
|
}
|
|
5306
5371
|
resetFeedVisit() {
|
|
5307
|
-
this.state.autofill =
|
|
5372
|
+
this.state.autofill = mr(this.options.autofill, void 0, !1), this.fillController.reset(), this.reelForward.reset(), this.reelRemoval.reset(), this.exactMediaRemoval.reset(), this.itemRemoval.reset(), this.removalReconciliation.reset();
|
|
5308
5373
|
}
|
|
5309
5374
|
async loadFilteredPage(e) {
|
|
5310
5375
|
let t = this.options.loadPage;
|
|
5311
5376
|
if (!t) throw Error("Vibe cannot load a page without loadPage.");
|
|
5312
|
-
let n =
|
|
5377
|
+
let n = Jn(await t(e));
|
|
5313
5378
|
return {
|
|
5314
5379
|
...n,
|
|
5315
5380
|
items: this.removalReconciliation.filterItems(n.items)
|
|
@@ -5329,7 +5394,7 @@ var ji = class {
|
|
|
5329
5394
|
let n = ++this.requestVersion, r = new AbortController();
|
|
5330
5395
|
this.abortController = r;
|
|
5331
5396
|
try {
|
|
5332
|
-
let i = await
|
|
5397
|
+
let i = await qr({
|
|
5333
5398
|
controller: this.removalReconciliation,
|
|
5334
5399
|
isCurrent: () => n === this.requestVersion,
|
|
5335
5400
|
loadPage: t,
|
|
@@ -5349,14 +5414,14 @@ var ji = class {
|
|
|
5349
5414
|
async retryEnd() {
|
|
5350
5415
|
if (!this.pageReplacement.isActive()) {
|
|
5351
5416
|
if (this.pendingRequest) return this.pendingRequest;
|
|
5352
|
-
if (!this.state.loadMoreLocked && !(
|
|
5417
|
+
if (!this.state.loadMoreLocked && !(hr(this.state.autofill) || this.fillController.isActive()) && !(this.state.next !== null || !this.options.loadPage)) return this.state.isLoadingMore = !0, this.state.nextPageError = null, this.startRequest(this.lastLoadedCursor, !0);
|
|
5353
5418
|
}
|
|
5354
5419
|
}
|
|
5355
5420
|
setInfiniteScroll(e) {
|
|
5356
5421
|
this.state.infiniteScroll = e, e && m(() => this.surface?.loadIfNearBottom());
|
|
5357
5422
|
}
|
|
5358
5423
|
setLoadMoreLocked(e) {
|
|
5359
|
-
|
|
5424
|
+
ci(this.state, e, {
|
|
5360
5425
|
getPending: () => this.pendingRequest,
|
|
5361
5426
|
hasPendingSession: () => this.removalReconciliation.hasPendingSession(),
|
|
5362
5427
|
loadNext: () => this.loadNext(),
|
|
@@ -5369,10 +5434,10 @@ var ji = class {
|
|
|
5369
5434
|
this.state.total = e;
|
|
5370
5435
|
}
|
|
5371
5436
|
setReelAutoAdvance(e) {
|
|
5372
|
-
|
|
5437
|
+
Qr(this.state.reelAutoAdvance, e);
|
|
5373
5438
|
}
|
|
5374
5439
|
setReelInfoSheet(e) {
|
|
5375
|
-
|
|
5440
|
+
ei(this.state.reelInfoSheet, this.options.reelInfoSheet, e);
|
|
5376
5441
|
}
|
|
5377
5442
|
setLayout(e) {
|
|
5378
5443
|
this.responsiveLayout.setLayout(e);
|
|
@@ -5392,7 +5457,7 @@ var ji = class {
|
|
|
5392
5457
|
async fetchPage(e, t) {
|
|
5393
5458
|
if (!this.options.loadPage) return;
|
|
5394
5459
|
let n = ++this.requestVersion, r = new AbortController();
|
|
5395
|
-
this.abortController = r, await
|
|
5460
|
+
this.abortController = r, await oi({
|
|
5396
5461
|
append: t,
|
|
5397
5462
|
autofillController: this.autofillController,
|
|
5398
5463
|
cursor: e,
|
|
@@ -5414,7 +5479,7 @@ var ji = class {
|
|
|
5414
5479
|
startInitialAutofill() {
|
|
5415
5480
|
let e = ++this.requestVersion, t = new AbortController(), n = this.autofillController.beginCycle();
|
|
5416
5481
|
this.abortController = t, this.state.isLoadingMore = !0;
|
|
5417
|
-
let r =
|
|
5482
|
+
let r = jr({
|
|
5418
5483
|
cycleId: n,
|
|
5419
5484
|
isCurrent: () => e === this.requestVersion,
|
|
5420
5485
|
onCollection: (t) => this.autofillController.captureCollection(t, e === this.requestVersion),
|
|
@@ -5432,11 +5497,11 @@ var ji = class {
|
|
|
5432
5497
|
}
|
|
5433
5498
|
startStateNotifications() {
|
|
5434
5499
|
let e = this.options.onStateChange;
|
|
5435
|
-
!e || this.stopStateWatcher || (this.stopStateWatcher =
|
|
5500
|
+
!e || this.stopStateWatcher || (this.stopStateWatcher = G(this.state, this.notificationItems, e));
|
|
5436
5501
|
}
|
|
5437
5502
|
setCurrentCursor(e) {
|
|
5438
5503
|
this.lastLoadedCursor = this.state.current = e;
|
|
5439
5504
|
}
|
|
5440
|
-
},
|
|
5505
|
+
}, Ri = (e) => new Li(e);
|
|
5441
5506
|
//#endregion
|
|
5442
|
-
export {
|
|
5507
|
+
export { Ri as createVibe };
|