@wyxos/vibe 5.14.0 → 5.15.0
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/MasonryFeed.vue.d.ts +3 -0
- package/lib/components/MediaCard.vue.d.ts +3 -0
- package/lib/components/ReelFeed.vue.d.ts +3 -0
- package/lib/components/ReelLayout.vue.d.ts +3 -0
- package/lib/components/VibeSurface.vue.d.ts +3 -1
- package/lib/components/useMediaLifecycle.d.ts +4 -1
- package/lib/components/useMediaReadiness.d.ts +2 -2
- package/lib/core/mediaFailure.d.ts +6 -0
- package/lib/index.cjs +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +388 -346
- package/lib/types.d.ts +3 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -48,7 +48,7 @@ function B(e) {
|
|
|
48
48
|
type: "image"
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function ee(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"
|
|
@@ -57,27 +57,27 @@ function V(e, t) {
|
|
|
57
57
|
type: "audio"
|
|
58
58
|
} : z(e, t);
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function V(e) {
|
|
61
61
|
return [e, ...e.items];
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function H(e, t) {
|
|
64
64
|
return Math.min(e.items.length, Math.max(0, t));
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function U(e, t) {
|
|
67
|
+
return V(e)[H(e, t)] ?? e;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function W(e, t) {
|
|
70
70
|
return `${String(e)}:${t}`;
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/core/runtime.ts
|
|
74
|
-
function
|
|
74
|
+
function G(e) {
|
|
75
75
|
return r(() => Object.freeze([...e.items]));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return n(
|
|
77
|
+
function K(e, t, n) {
|
|
78
|
+
return n(te(e, t.value)), O(() => te(e, t.value), n, { flush: "post" });
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function te(e, t = [...e.items]) {
|
|
81
81
|
return {
|
|
82
82
|
activeReelPostId: e.activeReelPostId,
|
|
83
83
|
autoScroll: { ...e.autoScroll },
|
|
@@ -107,17 +107,17 @@ function J(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 q = {
|
|
111
111
|
key: 0,
|
|
112
112
|
class: "gallery-footer"
|
|
113
|
-
},
|
|
113
|
+
}, J = {
|
|
114
114
|
key: 0,
|
|
115
115
|
class: "load-more-status",
|
|
116
116
|
role: "status"
|
|
117
|
-
},
|
|
117
|
+
}, ne = ["disabled"], re = {
|
|
118
118
|
key: 2,
|
|
119
119
|
class: "end-feed"
|
|
120
|
-
},
|
|
120
|
+
}, ie = ["disabled"], ae = /* @__PURE__ */ d({
|
|
121
121
|
__name: "GalleryFooter",
|
|
122
122
|
props: {
|
|
123
123
|
canRetryEnd: { type: Boolean },
|
|
@@ -133,14 +133,14 @@ var Y = {
|
|
|
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", q, [e.isLoading ? (b(), s("p", J, " 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, ne)) : (b(), s("div", re, [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,9 +149,9 @@ var Y = {
|
|
|
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, ie)]))])) : o("", !0);
|
|
153
153
|
}
|
|
154
|
-
}),
|
|
154
|
+
}), oe = /* @__PURE__ */ d({
|
|
155
155
|
__name: "FeedFooter",
|
|
156
156
|
props: {
|
|
157
157
|
actions: {},
|
|
@@ -188,7 +188,7 @@ var Y = {
|
|
|
188
188
|
"can-retry-end",
|
|
189
189
|
"show-load-more",
|
|
190
190
|
"state"
|
|
191
|
-
])) : (b(), a(
|
|
191
|
+
])) : (b(), a(ae, {
|
|
192
192
|
key: 1,
|
|
193
193
|
"can-retry-end": e.canRetryEnd,
|
|
194
194
|
"has-error": e.hasError,
|
|
@@ -207,7 +207,7 @@ var Y = {
|
|
|
207
207
|
"show-load-more"
|
|
208
208
|
]));
|
|
209
209
|
}
|
|
210
|
-
}),
|
|
210
|
+
}), se = ["role"], ce = { class: "gallery-status" }, le = /* @__PURE__ */ d({
|
|
211
211
|
__name: "FeedStatus",
|
|
212
212
|
props: {
|
|
213
213
|
actions: {},
|
|
@@ -221,7 +221,7 @@ var Y = {
|
|
|
221
221
|
return (n, u) => (b(), s("main", {
|
|
222
222
|
class: "gallery-shell",
|
|
223
223
|
role: r.state.error ? "alert" : r.state.isLoading || r.state.isLoadingMore ? "status" : void 0
|
|
224
|
-
}, [c("p",
|
|
224
|
+
}, [c("p", ce, [r.state.error ? (b(), s(e, { key: 0 }, [l(" Unable to load media. ")], 64)) : r.state.isLoading || r.state.isLoadingMore ? (b(), s(e, { key: 1 }, [l(" Loading media… ")], 64)) : (b(), s(e, { key: 2 }, [l(" No media found. ")], 64))]), t.feedFooter ? (b(), a(oe, {
|
|
225
225
|
key: 0,
|
|
226
226
|
actions: t.actions,
|
|
227
227
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -243,26 +243,26 @@ var Y = {
|
|
|
243
243
|
"is-loading",
|
|
244
244
|
"load-more-locked",
|
|
245
245
|
"state"
|
|
246
|
-
])) : o("", !0)], 8,
|
|
246
|
+
])) : o("", !0)], 8, se));
|
|
247
247
|
}
|
|
248
248
|
});
|
|
249
|
-
function
|
|
249
|
+
function Y(e) {
|
|
250
250
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= 240;
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region src/core/masonry.ts
|
|
254
|
-
function
|
|
254
|
+
function X(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 Z(e) {
|
|
259
259
|
return e.reduce((t, n, r) => n < e[t] ? r : t, 0);
|
|
260
260
|
}
|
|
261
261
|
function ue(e) {
|
|
262
262
|
return Math.max(0, e.containerHeight) + Math.max(0, e.gap);
|
|
263
263
|
}
|
|
264
264
|
var de = .8, fe = .5;
|
|
265
|
-
function
|
|
265
|
+
function pe(e, t, n) {
|
|
266
266
|
let r = Math.max(0, n.viewportHeight);
|
|
267
267
|
if (r === 0) return [];
|
|
268
268
|
let i = n.scrollTop, a = i + r;
|
|
@@ -273,7 +273,7 @@ function Q(e, t, n) {
|
|
|
273
273
|
return o + fe >= s;
|
|
274
274
|
});
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function Q(e, t) {
|
|
277
277
|
if (e <= 0) return null;
|
|
278
278
|
let n = Math.max(0, t.gap), r = Number.isFinite(t.additionalHeight) ? Math.max(0, t.additionalHeight ?? 0) : 0, i = Math.max(1, t.minColumnWidth), a = Math.max(1, Math.floor((e + n) / (i + n)));
|
|
279
279
|
return {
|
|
@@ -284,7 +284,7 @@ function pe(e, t) {
|
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
286
|
function me(e, t, n) {
|
|
287
|
-
let r =
|
|
287
|
+
let r = Z(t), i = n.itemWidth * X(e) + n.additionalHeight, a = {
|
|
288
288
|
x: r * (n.itemWidth + n.gap),
|
|
289
289
|
y: t[r],
|
|
290
290
|
width: n.itemWidth,
|
|
@@ -303,7 +303,7 @@ function ge(e, t) {
|
|
|
303
303
|
return e.length === 0 ? 0 : Math.max(0, Math.max(...e) - t);
|
|
304
304
|
}
|
|
305
305
|
function _e(e, t, n) {
|
|
306
|
-
let r =
|
|
306
|
+
let r = Q(t, n);
|
|
307
307
|
if (!r || e.length === 0) return {
|
|
308
308
|
columns: 0,
|
|
309
309
|
height: 0,
|
|
@@ -317,7 +317,7 @@ function _e(e, t, n) {
|
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
function ve(e, t, n, r, i, a) {
|
|
320
|
-
let o =
|
|
320
|
+
let o = Q(t, n);
|
|
321
321
|
if (!o || e.length === 0) return {
|
|
322
322
|
columns: 0,
|
|
323
323
|
height: 0,
|
|
@@ -333,7 +333,7 @@ function ve(e, t, n, r, i, a) {
|
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
335
|
function ye(e, t, n, r, i, a) {
|
|
336
|
-
let o =
|
|
336
|
+
let o = Q(t, n);
|
|
337
337
|
if (!o || e.length === 0) return {
|
|
338
338
|
columns: 0,
|
|
339
339
|
fromIndex: 0,
|
|
@@ -779,7 +779,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
779
779
|
total: {}
|
|
780
780
|
},
|
|
781
781
|
setup(e) {
|
|
782
|
-
let t = e, n = r(() =>
|
|
782
|
+
let t = e, n = r(() => H(t.item, t.mediaIndex)), i = r(() => V(t.item)), o = r(() => U(t.item, n.value)), c = r(() => ({
|
|
783
783
|
height: `${t.region.height}px`,
|
|
784
784
|
paddingBlock: t.style?.paddingY === void 0 ? void 0 : `${t.style.paddingY}px`,
|
|
785
785
|
paddingInline: t.style?.paddingX === void 0 ? void 0 : `${t.style.paddingX}px`
|
|
@@ -997,7 +997,7 @@ var rt = /* @__PURE__ */ d({
|
|
|
997
997
|
function St(e) {
|
|
998
998
|
let t = w("next"), n = null, r = 0, i = !1, a = null, o = null;
|
|
999
999
|
function s(n, r) {
|
|
1000
|
-
let i =
|
|
1000
|
+
let i = V(e.item()).length, a = (n + i) % i;
|
|
1001
1001
|
a !== e.mediaIndex() && (t.value = n < e.mediaIndex() ? "previous" : "next", e.onChange(a), r?.detail && r.detail > 0 && r.currentTarget?.blur());
|
|
1002
1002
|
}
|
|
1003
1003
|
function c() {
|
|
@@ -1010,7 +1010,7 @@ function St(e) {
|
|
|
1010
1010
|
return t === 1 ? e * 16 : t === 2 ? e * n : e;
|
|
1011
1011
|
}
|
|
1012
1012
|
function d(t) {
|
|
1013
|
-
if (
|
|
1013
|
+
if (V(e.item()).length <= 1) return;
|
|
1014
1014
|
let n = t.currentTarget, a = u(t.deltaX, t.deltaMode, n?.clientWidth || 1);
|
|
1015
1015
|
if (a === 0 || (t.preventDefault(), l(), i) || (r += a, Math.abs(r) < xt)) return;
|
|
1016
1016
|
let o = Math.sign(r);
|
|
@@ -1039,9 +1039,9 @@ function Dt(e, t) {
|
|
|
1039
1039
|
return `${t ? "timed" : "image"}:${e}`;
|
|
1040
1040
|
}
|
|
1041
1041
|
function Ot(e, t, n) {
|
|
1042
|
-
let r =
|
|
1042
|
+
let r = V(e);
|
|
1043
1043
|
if (r.length < 2) return [];
|
|
1044
|
-
let i =
|
|
1044
|
+
let i = H(e, t), a = [];
|
|
1045
1045
|
for (let e = 1; e < r.length; e += 1) {
|
|
1046
1046
|
let t = i + e, n = i - e;
|
|
1047
1047
|
t < r.length && a.push(t), n >= 0 && a.push(n);
|
|
@@ -1147,56 +1147,59 @@ function Ft(e) {
|
|
|
1147
1147
|
//#endregion
|
|
1148
1148
|
//#region src/components/useMediaReadiness.ts
|
|
1149
1149
|
function It(e) {
|
|
1150
|
-
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 = r(() => c.value || s.value ? "error" : o.value ? "loading" : e.previewState());
|
|
1151
|
-
function
|
|
1150
|
+
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());
|
|
1151
|
+
function h() {
|
|
1152
1152
|
l !== null && clearTimeout(l), l = null;
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function g(e) {
|
|
1155
1155
|
return Number(e.currentTarget.dataset.sourceGeneration) === i.value;
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1158
|
-
|
|
1157
|
+
function _() {
|
|
1158
|
+
h(), l = setTimeout(() => x(), 15e3);
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1161
|
-
t && !
|
|
1160
|
+
function y(t) {
|
|
1161
|
+
t && !g(t) || (h(), o.value = !1, s.value = !1, c.value = !1, e.onReady(e.mediaIndex()));
|
|
1162
1162
|
}
|
|
1163
|
-
function
|
|
1163
|
+
function b() {
|
|
1164
|
+
if (f) return;
|
|
1164
1165
|
let e = t.value;
|
|
1165
1166
|
if (e?.complete) {
|
|
1166
|
-
e.naturalWidth > 0 ?
|
|
1167
|
+
e.naturalWidth > 0 ? y() : x(void 0, !0);
|
|
1167
1168
|
return;
|
|
1168
1169
|
}
|
|
1169
1170
|
let r = n.value;
|
|
1170
1171
|
if (r && r.readyState >= HTMLMediaElement.HAVE_METADATA) {
|
|
1171
|
-
|
|
1172
|
+
y();
|
|
1172
1173
|
return;
|
|
1173
1174
|
}
|
|
1174
|
-
|
|
1175
|
+
_();
|
|
1175
1176
|
}
|
|
1176
|
-
function
|
|
1177
|
-
if (!(t && !
|
|
1178
|
-
if (
|
|
1179
|
-
a.value = 1, i.value += 1, o.value = !0, m(
|
|
1177
|
+
function x(t, n = !1) {
|
|
1178
|
+
if (!f && !(t && !g(t)) && !(s.value && !c.value && (!t || d))) {
|
|
1179
|
+
if (h(), !t && a.value === 0) {
|
|
1180
|
+
a.value = 1, i.value += 1, o.value = !0, m(b);
|
|
1180
1181
|
return;
|
|
1181
1182
|
}
|
|
1182
|
-
o.value = !1, s.value = !0, c.value = !1, e.onError(e.mediaIndex());
|
|
1183
|
+
o.value = !1, s.value = !0, c.value = !1, d = !!t || n, e.onError(e.mediaIndex(), d);
|
|
1183
1184
|
}
|
|
1184
1185
|
}
|
|
1185
|
-
function
|
|
1186
|
-
c.value ||
|
|
1186
|
+
function S() {
|
|
1187
|
+
c.value || p.value !== "error" || (d = !1, a.value = 0, s.value = !0, o.value = !0, c.value = !0, i.value += 1, m(b));
|
|
1187
1188
|
}
|
|
1188
|
-
function
|
|
1189
|
-
|
|
1189
|
+
function C(e) {
|
|
1190
|
+
g(e) && o.value && _();
|
|
1190
1191
|
}
|
|
1191
1192
|
return O(e.identity, () => {
|
|
1192
|
-
|
|
1193
|
-
}, { immediate: !0 }), v(
|
|
1194
|
-
|
|
1195
|
-
|
|
1193
|
+
h(), i.value += 1, d = !1, a.value = 0, o.value = u || e.previewState() === "loading", s.value = !1, c.value = !1, u = !0, m(b);
|
|
1194
|
+
}, { immediate: !0 }), v(() => {
|
|
1195
|
+
f = !0, h();
|
|
1196
|
+
}), {
|
|
1197
|
+
effectivePreviewState: p,
|
|
1198
|
+
failSourceAttempt: x,
|
|
1196
1199
|
imageElement: t,
|
|
1197
|
-
markSourceReady:
|
|
1198
|
-
noteSourceActivity:
|
|
1199
|
-
retrySource:
|
|
1200
|
+
markSourceReady: y,
|
|
1201
|
+
noteSourceActivity: C,
|
|
1202
|
+
retrySource: S,
|
|
1200
1203
|
retrying: c,
|
|
1201
1204
|
sourceGeneration: i,
|
|
1202
1205
|
mediaElement: n
|
|
@@ -1394,6 +1397,8 @@ var Wt = [
|
|
|
1394
1397
|
"muted",
|
|
1395
1398
|
"preload"
|
|
1396
1399
|
], Xt = ["aria-label", "disabled"], Zt = [
|
|
1400
|
+
"data-cover-identity",
|
|
1401
|
+
"data-source-generation",
|
|
1397
1402
|
"src",
|
|
1398
1403
|
"width",
|
|
1399
1404
|
"height",
|
|
@@ -1449,6 +1454,7 @@ var Wt = [
|
|
|
1449
1454
|
"activate",
|
|
1450
1455
|
"ended",
|
|
1451
1456
|
"error",
|
|
1457
|
+
"mediaError",
|
|
1452
1458
|
"mediaChange",
|
|
1453
1459
|
"ready",
|
|
1454
1460
|
"reelAudioChange"
|
|
@@ -1458,10 +1464,18 @@ var Wt = [
|
|
|
1458
1464
|
function f(e = !1, t = "pointer") {
|
|
1459
1465
|
e && d("activate", t);
|
|
1460
1466
|
}
|
|
1461
|
-
let p = r(() =>
|
|
1467
|
+
let p = r(() => V(l.item)), g = r(() => H(l.item, l.mediaIndex)), v = r(() => U(l.item, g.value)), y = r(() => z(v.value, l.mediaSource ?? "preview")), x = r(() => I(v.value.type, v.value.src)), S = r(() => x.value === "audio"), C = r(() => ee(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(() => B(v.value)), L = r(() => `${l.item.postId}:${g.value}:${F.value?.src ?? ""}`), R = w(!1), W = r(() => R.value ? null : F.value), { effectivePreviewState: G, failSourceAttempt: K, imageElement: te, markSourceReady: q, noteSourceActivity: J, retrySource: ne, retrying: re, sourceGeneration: ie, mediaElement: ae } = It({
|
|
1462
1468
|
identity: () => `${l.item.postId}:${g.value}:${l.mediaSource ?? "preview"}:${D.value}:${M.value ?? ""}`,
|
|
1463
1469
|
mediaIndex: () => g.value,
|
|
1464
|
-
onError: (e) =>
|
|
1470
|
+
onError: (e, t) => {
|
|
1471
|
+
if (d("error", e), !t) return;
|
|
1472
|
+
let n = l.mediaSource ?? "preview";
|
|
1473
|
+
d("mediaError", {
|
|
1474
|
+
mediaIndex: e,
|
|
1475
|
+
source: n === "preview" && !S.value && v.value.preview ? "preview" : n === "mobile" && D.value === v.value.mobile?.src ? "mobile" : "original",
|
|
1476
|
+
src: D.value
|
|
1477
|
+
});
|
|
1478
|
+
},
|
|
1465
1479
|
onReady: (e) => d("ready", e),
|
|
1466
1480
|
previewState: () => l.previewState
|
|
1467
1481
|
});
|
|
@@ -1474,47 +1488,51 @@ var Wt = [
|
|
|
1474
1488
|
mediaReady: () => G.value === "ready",
|
|
1475
1489
|
mediaSource: () => l.mediaSource ?? "preview"
|
|
1476
1490
|
});
|
|
1477
|
-
let { currentTime:
|
|
1491
|
+
let { currentTime: oe, duration: se, effectiveMuted: ce, isMuted: le, isPlaying: Y, onEnded: X, onLoadedMetadata: Z, onPlaying: ue, playbackAllowed: de, seek: fe, setVolume: pe, sync: Q, toggleMute: me, togglePlayback: he, volume: ge } = Ut({
|
|
1478
1492
|
active: () => l.active,
|
|
1479
1493
|
inViewport: () => l.inViewport === !0,
|
|
1480
1494
|
layout: () => l.layout,
|
|
1481
1495
|
mediaCard: () => l.mediaCard,
|
|
1482
|
-
mediaElement:
|
|
1496
|
+
mediaElement: ae,
|
|
1483
1497
|
onAudioChange: (e) => d("reelAudioChange", e),
|
|
1484
1498
|
onEnded: () => d("ended", g.value),
|
|
1485
|
-
onReady:
|
|
1499
|
+
onReady: q,
|
|
1486
1500
|
reelAudioState: () => l.reelAudioState
|
|
1487
|
-
}),
|
|
1488
|
-
function
|
|
1501
|
+
}), _e = r(() => l.interactive && !!(l.cardHeader || l.cardFooter));
|
|
1502
|
+
function ve(e) {
|
|
1489
1503
|
return e.detail === 0 ? "keyboard" : "pointer";
|
|
1490
1504
|
}
|
|
1491
|
-
let { change:
|
|
1505
|
+
let { change: ye, direction: be, onTouchEnd: xe, onTouchStart: Se, onWheel: Ce } = St({
|
|
1492
1506
|
item: () => l.item,
|
|
1493
1507
|
layout: () => l.layout,
|
|
1494
1508
|
mediaIndex: () => g.value,
|
|
1495
1509
|
onChange: (e) => d("mediaChange", e)
|
|
1496
|
-
}), { imageLoading:
|
|
1510
|
+
}), { imageLoading: we, mediaIsTimed: Te, timedMediaPreload: Ee } = Ft({
|
|
1497
1511
|
active: () => l.active,
|
|
1498
1512
|
fetchPriority: () => l.fetchPriority,
|
|
1499
1513
|
layout: () => l.layout,
|
|
1500
1514
|
mediaSource: () => D.value,
|
|
1501
1515
|
mediaType: () => M.value,
|
|
1502
|
-
mediaElement:
|
|
1503
|
-
}),
|
|
1504
|
-
function
|
|
1505
|
-
l.layout === "reel" && (e.stopPropagation(),
|
|
1516
|
+
mediaElement: ae
|
|
1517
|
+
}), De = r(() => l.layout === "reel" && l.stationaryReelControls === !0), Oe = r(() => Te.value && (!S.value || l.layout === "reel") && G.value === "ready" && (!De.value || !!(l.active && l.reelControlsTarget))), ke = r(() => `${l.item.postId}:${g.value}:${D.value}`);
|
|
1518
|
+
function Ae(e) {
|
|
1519
|
+
l.layout === "reel" && (e.stopPropagation(), he());
|
|
1506
1520
|
}
|
|
1507
|
-
function
|
|
1508
|
-
L.value
|
|
1521
|
+
function je(e) {
|
|
1522
|
+
e.currentTarget.dataset.coverIdentity !== L.value || R.value || (d("mediaError", {
|
|
1523
|
+
mediaIndex: g.value,
|
|
1524
|
+
source: "preview",
|
|
1525
|
+
src: F.value?.src ?? ""
|
|
1526
|
+
}), R.value = !0, l.layout === "masonry" && q());
|
|
1509
1527
|
}
|
|
1510
|
-
return O(
|
|
1511
|
-
|
|
1528
|
+
return O(L, () => {
|
|
1529
|
+
R.value = !1;
|
|
1512
1530
|
}), O([
|
|
1513
1531
|
S,
|
|
1514
1532
|
() => l.layout,
|
|
1515
|
-
|
|
1533
|
+
W
|
|
1516
1534
|
], ([e, t, n]) => {
|
|
1517
|
-
e && t === "masonry" && !n && m(() =>
|
|
1535
|
+
e && t === "masonry" && !n && m(() => q());
|
|
1518
1536
|
}, { immediate: !0 }), (r, i) => (b(), s("article", {
|
|
1519
1537
|
"data-post-id": e.item.postId,
|
|
1520
1538
|
"data-media-index": g.value,
|
|
@@ -1526,12 +1544,12 @@ var Wt = [
|
|
|
1526
1544
|
}]),
|
|
1527
1545
|
style: _(e.itemStyle),
|
|
1528
1546
|
"aria-hidden": e.leaving || void 0,
|
|
1529
|
-
"aria-busy": E(G) === "loading" || E(
|
|
1547
|
+
"aria-busy": E(G) === "loading" || E(re),
|
|
1530
1548
|
inert: e.leaving || void 0,
|
|
1531
|
-
role: e.interactive && !e.leaving && !
|
|
1532
|
-
tabindex: e.interactive && !e.leaving && !
|
|
1533
|
-
onClick: i[34] ||= (t) => f(e.interactive && !
|
|
1534
|
-
onKeydown: [i[35] ||= A((t) => f(e.interactive && !
|
|
1549
|
+
role: e.interactive && !e.leaving && !_e.value ? "button" : void 0,
|
|
1550
|
+
tabindex: e.interactive && !e.leaving && !_e.value ? 0 : void 0,
|
|
1551
|
+
onClick: i[34] ||= (t) => f(e.interactive && !_e.value, ve(t)),
|
|
1552
|
+
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"])]
|
|
1535
1553
|
}, [c("div", Gt, [
|
|
1536
1554
|
e.cardHeader ? (b(), a(rt, {
|
|
1537
1555
|
key: 0,
|
|
@@ -1558,17 +1576,17 @@ var Wt = [
|
|
|
1558
1576
|
])) : o("", !0),
|
|
1559
1577
|
c("div", {
|
|
1560
1578
|
class: h(["media-card-media", { "media-card-media--carousel": e.layout === "reel" && p.value.length > 1 }]),
|
|
1561
|
-
"data-media-direction": E(
|
|
1562
|
-
onWheel: i[31] ||= (...e) => E(
|
|
1563
|
-
onTouchstartPassive: i[32] ||= (...e) => E(
|
|
1564
|
-
onTouchendPassive: i[33] ||= (...e) => E(
|
|
1579
|
+
"data-media-direction": E(be),
|
|
1580
|
+
onWheel: i[31] ||= (...e) => E(Ce) && E(Ce)(...e),
|
|
1581
|
+
onTouchstartPassive: i[32] ||= (...e) => E(Se) && E(Se)(...e),
|
|
1582
|
+
onTouchendPassive: i[33] ||= (...e) => E(xe) && E(xe)(...e)
|
|
1565
1583
|
}, [
|
|
1566
1584
|
u(n, {
|
|
1567
|
-
css: !E(
|
|
1568
|
-
name: `media-slide-${E(
|
|
1585
|
+
css: !E(re),
|
|
1586
|
+
name: `media-slide-${E(be)}`
|
|
1569
1587
|
}, {
|
|
1570
1588
|
default: k(() => [(b(), s("div", {
|
|
1571
|
-
key: `${e.item.postId}:${v.value.src}:${e.mediaSource ?? "preview"}:${E(
|
|
1589
|
+
key: `${e.item.postId}:${v.value.src}:${e.mediaSource ?? "preview"}:${E(ie)}`,
|
|
1572
1590
|
class: "media-card-frame",
|
|
1573
1591
|
"data-media-index": g.value
|
|
1574
1592
|
}, [
|
|
@@ -1576,9 +1594,9 @@ var Wt = [
|
|
|
1576
1594
|
key: 1,
|
|
1577
1595
|
component: e.mediaCard?.error?.component,
|
|
1578
1596
|
label: E(nt)(D.value),
|
|
1579
|
-
retrying: E(
|
|
1597
|
+
retrying: E(re),
|
|
1580
1598
|
status: E(tt)(D.value),
|
|
1581
|
-
onRetry: E(
|
|
1599
|
+
onRetry: E(ne)
|
|
1582
1600
|
}, null, 8, [
|
|
1583
1601
|
"component",
|
|
1584
1602
|
"label",
|
|
@@ -1589,53 +1607,55 @@ var Wt = [
|
|
|
1589
1607
|
S.value && e.layout === "reel" ? (b(), s("audio", {
|
|
1590
1608
|
key: 2,
|
|
1591
1609
|
ref_key: "mediaElement",
|
|
1592
|
-
ref:
|
|
1593
|
-
"data-source-generation": E(
|
|
1610
|
+
ref: ae,
|
|
1611
|
+
"data-source-generation": E(ie),
|
|
1594
1612
|
class: "media-audio-element",
|
|
1595
1613
|
src: D.value,
|
|
1596
|
-
autoplay: E(
|
|
1614
|
+
autoplay: E(de),
|
|
1597
1615
|
loop: !e.advanceOnMediaEnd,
|
|
1598
|
-
muted: E(
|
|
1599
|
-
preload: E(
|
|
1616
|
+
muted: E(ce),
|
|
1617
|
+
preload: E(Ee),
|
|
1600
1618
|
onLoadedmetadata: i[0] ||= (...e) => E(Z) && E(Z)(...e),
|
|
1601
|
-
onProgress: i[1] ||= (...e) => E(
|
|
1602
|
-
onLoadeddata: i[2] ||= (...e) => E(
|
|
1603
|
-
onCanplay: i[3] ||= (...e) => E(
|
|
1619
|
+
onProgress: i[1] ||= (...e) => E(J) && E(J)(...e),
|
|
1620
|
+
onLoadeddata: i[2] ||= (...e) => E(J) && E(J)(...e),
|
|
1621
|
+
onCanplay: i[3] ||= (...e) => E(J) && E(J)(...e),
|
|
1604
1622
|
onDurationchange: i[4] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1605
1623
|
onTimeupdate: i[5] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1606
1624
|
onVolumechange: i[6] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1607
|
-
onPlaying: i[7] ||= (...e) => E(
|
|
1608
|
-
onPause: i[8] ||= (e) =>
|
|
1609
|
-
onEnded: i[9] ||= (...e) => E(
|
|
1625
|
+
onPlaying: i[7] ||= (...e) => E(ue) && E(ue)(...e),
|
|
1626
|
+
onPause: i[8] ||= (e) => Y.value = !1,
|
|
1627
|
+
onEnded: i[9] ||= (...e) => E(X) && E(X)(...e),
|
|
1610
1628
|
onError: i[10] ||= (...e) => E(K) && E(K)(...e)
|
|
1611
1629
|
}, null, 40, Yt)) : o("", !0),
|
|
1612
1630
|
S.value ? (b(), s("button", {
|
|
1613
1631
|
key: 3,
|
|
1614
1632
|
type: "button",
|
|
1615
1633
|
class: h(["media-audio-artwork media-preview", { "media-preview--ready": E(G) === "ready" }]),
|
|
1616
|
-
"aria-label": e.layout === "reel" ? E(
|
|
1634
|
+
"aria-label": e.layout === "reel" ? E(Y) ? "Pause audio" : "Play audio" : "Audio",
|
|
1617
1635
|
disabled: e.layout !== "reel",
|
|
1618
|
-
onClick:
|
|
1619
|
-
}, [
|
|
1620
|
-
key:
|
|
1636
|
+
onClick: Ae
|
|
1637
|
+
}, [W.value ? (b(), s("img", {
|
|
1638
|
+
key: L.value,
|
|
1639
|
+
"data-cover-identity": L.value,
|
|
1640
|
+
"data-source-generation": E(ie),
|
|
1621
1641
|
class: "media-audio-cover",
|
|
1622
|
-
src:
|
|
1623
|
-
width:
|
|
1624
|
-
height:
|
|
1642
|
+
src: W.value.src,
|
|
1643
|
+
width: W.value.width ?? void 0,
|
|
1644
|
+
height: W.value.height ?? void 0,
|
|
1625
1645
|
fetchpriority: e.fetchPriority,
|
|
1626
1646
|
alt: "",
|
|
1627
1647
|
decoding: "async",
|
|
1628
|
-
loading: E(
|
|
1629
|
-
onLoad: i[11] ||= (t) => e.layout === "masonry" && E(
|
|
1630
|
-
onError:
|
|
1648
|
+
loading: E(we),
|
|
1649
|
+
onLoad: i[11] ||= (t) => e.layout === "masonry" && E(q)(t),
|
|
1650
|
+
onError: je
|
|
1631
1651
|
}, null, 40, Zt)) : (b(), s("span", Qt, [u(E(Ye), {
|
|
1632
1652
|
size: 64,
|
|
1633
1653
|
"stroke-width": 1.5
|
|
1634
|
-
})]))], 10, Xt)) : E(
|
|
1654
|
+
})]))], 10, Xt)) : E(Te) ? (b(), s("video", {
|
|
1635
1655
|
key: 4,
|
|
1636
1656
|
ref_key: "mediaElement",
|
|
1637
|
-
ref:
|
|
1638
|
-
"data-source-generation": E(
|
|
1657
|
+
ref: ae,
|
|
1658
|
+
"data-source-generation": E(ie),
|
|
1639
1659
|
class: h(["media-preview", {
|
|
1640
1660
|
"media-preview--ready": E(G) === "ready",
|
|
1641
1661
|
"media-preview--reel-video": e.layout === "reel"
|
|
@@ -1643,28 +1663,28 @@ var Wt = [
|
|
|
1643
1663
|
src: D.value,
|
|
1644
1664
|
width: N.value ?? void 0,
|
|
1645
1665
|
height: P.value ?? void 0,
|
|
1646
|
-
autoplay: E(
|
|
1666
|
+
autoplay: E(de),
|
|
1647
1667
|
loop: !e.advanceOnMediaEnd,
|
|
1648
|
-
muted: E(
|
|
1668
|
+
muted: E(ce),
|
|
1649
1669
|
playsinline: "",
|
|
1650
|
-
preload: E(
|
|
1670
|
+
preload: E(Ee),
|
|
1651
1671
|
onLoadedmetadata: i[12] ||= (...e) => E(Z) && E(Z)(...e),
|
|
1652
|
-
onProgress: i[13] ||= (...e) => E(
|
|
1653
|
-
onLoadeddata: i[14] ||= (...e) => E(
|
|
1654
|
-
onCanplay: i[15] ||= (...e) => E(
|
|
1672
|
+
onProgress: i[13] ||= (...e) => E(J) && E(J)(...e),
|
|
1673
|
+
onLoadeddata: i[14] ||= (...e) => E(J) && E(J)(...e),
|
|
1674
|
+
onCanplay: i[15] ||= (...e) => E(J) && E(J)(...e),
|
|
1655
1675
|
onDurationchange: i[16] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1656
1676
|
onTimeupdate: i[17] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1657
1677
|
onVolumechange: i[18] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1658
|
-
onPlaying: i[19] ||= (...e) => E(
|
|
1659
|
-
onPause: i[20] ||= (e) =>
|
|
1660
|
-
onEnded: i[21] ||= (...e) => E(
|
|
1661
|
-
onClick:
|
|
1678
|
+
onPlaying: i[19] ||= (...e) => E(ue) && E(ue)(...e),
|
|
1679
|
+
onPause: i[20] ||= (e) => Y.value = !1,
|
|
1680
|
+
onEnded: i[21] ||= (...e) => E(X) && E(X)(...e),
|
|
1681
|
+
onClick: Ae,
|
|
1662
1682
|
onError: i[22] ||= (...e) => E(K) && E(K)(...e)
|
|
1663
1683
|
}, null, 42, $t)) : S.value ? o("", !0) : (b(), s("img", {
|
|
1664
1684
|
key: 5,
|
|
1665
1685
|
ref_key: "imageElement",
|
|
1666
|
-
ref:
|
|
1667
|
-
"data-source-generation": E(
|
|
1686
|
+
ref: te,
|
|
1687
|
+
"data-source-generation": E(ie),
|
|
1668
1688
|
class: h(["media-preview", { "media-preview--ready": E(G) === "ready" }]),
|
|
1669
1689
|
src: D.value,
|
|
1670
1690
|
width: N.value ?? void 0,
|
|
@@ -1672,8 +1692,8 @@ var Wt = [
|
|
|
1672
1692
|
fetchpriority: e.fetchPriority,
|
|
1673
1693
|
alt: "",
|
|
1674
1694
|
decoding: "async",
|
|
1675
|
-
loading: E(
|
|
1676
|
-
onLoad: i[23] ||= (...e) => E(
|
|
1695
|
+
loading: E(we),
|
|
1696
|
+
onLoad: i[23] ||= (...e) => E(q) && E(q)(...e),
|
|
1677
1697
|
onError: i[24] ||= (...e) => E(K) && E(K)(...e)
|
|
1678
1698
|
}, null, 42, en))
|
|
1679
1699
|
], 8, qt))]),
|
|
@@ -1693,26 +1713,26 @@ var Wt = [
|
|
|
1693
1713
|
"media-source"
|
|
1694
1714
|
]),
|
|
1695
1715
|
(b(), a(t, {
|
|
1696
|
-
disabled: !
|
|
1716
|
+
disabled: !De.value || !e.reelControlsTarget,
|
|
1697
1717
|
to: e.reelControlsTarget ?? "body"
|
|
1698
1718
|
}, [u(n, {
|
|
1699
1719
|
name: "vibe-reel-media-controls",
|
|
1700
|
-
css:
|
|
1720
|
+
css: De.value
|
|
1701
1721
|
}, {
|
|
1702
|
-
default: k(() => [
|
|
1703
|
-
key:
|
|
1704
|
-
"current-time": E(
|
|
1705
|
-
"data-control-post-id":
|
|
1706
|
-
duration: E(
|
|
1722
|
+
default: k(() => [Oe.value ? (b(), a(gt, {
|
|
1723
|
+
key: ke.value,
|
|
1724
|
+
"current-time": E(oe),
|
|
1725
|
+
"data-control-post-id": De.value ? e.item.postId : void 0,
|
|
1726
|
+
duration: E(se),
|
|
1707
1727
|
layout: e.layout,
|
|
1708
1728
|
"media-type": S.value ? "audio" : "video",
|
|
1709
|
-
muted: E(
|
|
1710
|
-
playing: E(
|
|
1711
|
-
volume: E(
|
|
1712
|
-
onSeek: E(
|
|
1713
|
-
onToggleMute: E(
|
|
1714
|
-
onTogglePlayback: E(
|
|
1715
|
-
onVolumeChange: E(
|
|
1729
|
+
muted: E(le),
|
|
1730
|
+
playing: E(Y),
|
|
1731
|
+
volume: E(ge),
|
|
1732
|
+
onSeek: E(fe),
|
|
1733
|
+
onToggleMute: E(me),
|
|
1734
|
+
onTogglePlayback: E(he),
|
|
1735
|
+
onVolumeChange: E(pe)
|
|
1716
1736
|
}, null, 8, [
|
|
1717
1737
|
"current-time",
|
|
1718
1738
|
"data-control-post-id",
|
|
@@ -1737,21 +1757,21 @@ var Wt = [
|
|
|
1737
1757
|
type: "button",
|
|
1738
1758
|
class: "media-carousel-control media-carousel-control--previous",
|
|
1739
1759
|
"aria-label": `Previous media for post ${e.item.postId}`,
|
|
1740
|
-
onClick: i[25] ||= j((e) => E(
|
|
1760
|
+
onClick: i[25] ||= j((e) => E(ye)(g.value - 1, e), ["stop"]),
|
|
1741
1761
|
onKeydown: i[26] ||= j(() => {}, ["stop"])
|
|
1742
1762
|
}, [u(E(qe), { size: 20 })], 40, tn), c("button", {
|
|
1743
1763
|
type: "button",
|
|
1744
1764
|
class: "media-carousel-control media-carousel-control--next",
|
|
1745
1765
|
"aria-label": `Next media for post ${e.item.postId}`,
|
|
1746
|
-
onClick: i[27] ||= j((e) => E(
|
|
1766
|
+
onClick: i[27] ||= j((e) => E(ye)(g.value + 1, e), ["stop"]),
|
|
1747
1767
|
onKeydown: i[28] ||= j(() => {}, ["stop"])
|
|
1748
1768
|
}, [u(E(Je), { size: 20 })], 40, nn)], 2)) : o("", !0),
|
|
1749
|
-
|
|
1769
|
+
_e.value ? (b(), s("button", {
|
|
1750
1770
|
key: 1,
|
|
1751
1771
|
class: "media-card-activator",
|
|
1752
1772
|
type: "button",
|
|
1753
1773
|
"aria-label": `Open post ${e.item.postId}`,
|
|
1754
|
-
onClick: i[29] ||= j((e) => r.$emit("activate",
|
|
1774
|
+
onClick: i[29] ||= j((e) => r.$emit("activate", ve(e)), ["stop"]),
|
|
1755
1775
|
onKeydown: i[30] ||= j(() => {}, ["stop"])
|
|
1756
1776
|
}, null, 40, rn)) : o("", !0)
|
|
1757
1777
|
], 42, Kt),
|
|
@@ -1788,7 +1808,7 @@ function on(e) {
|
|
|
1788
1808
|
return t.flatMap((t) => {
|
|
1789
1809
|
let n = e.items()[t];
|
|
1790
1810
|
if (!n) return [];
|
|
1791
|
-
let r = e.mediaIndices().get(n.postId) ?? 0, i =
|
|
1811
|
+
let r = e.mediaIndices().get(n.postId) ?? 0, i = W(n.postId, r);
|
|
1792
1812
|
return e.previewStates().get(i) === "ready" ? [{
|
|
1793
1813
|
key: i,
|
|
1794
1814
|
mediaIndex: r,
|
|
@@ -1911,6 +1931,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1911
1931
|
emits: [
|
|
1912
1932
|
"activate",
|
|
1913
1933
|
"error",
|
|
1934
|
+
"mediaError",
|
|
1914
1935
|
"fullyVisible",
|
|
1915
1936
|
"loadMore",
|
|
1916
1937
|
"mediaChange",
|
|
@@ -1931,53 +1952,53 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1931
1952
|
}, 0);
|
|
1932
1953
|
return Math.max(e, t);
|
|
1933
1954
|
}
|
|
1934
|
-
function
|
|
1955
|
+
function ee() {
|
|
1935
1956
|
return M.value.reduce((e, t) => Math.max(e, t), -1);
|
|
1936
1957
|
}
|
|
1937
|
-
let
|
|
1958
|
+
let V = cn({
|
|
1938
1959
|
additionalHeight: r(() => R.value.additionalHeight),
|
|
1939
1960
|
gap: x,
|
|
1940
1961
|
items: () => d.items,
|
|
1941
1962
|
minColumnWidth: r(() => R.value.minColumnWidth),
|
|
1942
|
-
packThroughIndex:
|
|
1963
|
+
packThroughIndex: ee,
|
|
1943
1964
|
packUntilBottom: B,
|
|
1944
1965
|
width: y
|
|
1945
|
-
}),
|
|
1946
|
-
throughIndex:
|
|
1966
|
+
}), H = V.layout, U = V.viewportIndex, G = r(() => d.leavingPostIds.size === 0 ? null : ye(d.items, y.value, R.value, H.value, (e) => d.leavingPostIds.has(d.items[e].postId), {
|
|
1967
|
+
throughIndex: ee(),
|
|
1947
1968
|
untilBottom: B()
|
|
1948
|
-
})),
|
|
1949
|
-
let e =
|
|
1969
|
+
})), K = r(() => {
|
|
1970
|
+
let e = G.value;
|
|
1950
1971
|
return e ? {
|
|
1951
1972
|
columns: e.columns,
|
|
1952
1973
|
height: e.height,
|
|
1953
1974
|
items: e.items
|
|
1954
|
-
} :
|
|
1955
|
-
}),
|
|
1956
|
-
let e =
|
|
1957
|
-
return e ? we(e.items, e.retainedIndices,
|
|
1958
|
-
}),
|
|
1959
|
-
let t = d.items[e], n =
|
|
1975
|
+
} : H.value;
|
|
1976
|
+
}), te = r(() => {
|
|
1977
|
+
let e = G.value;
|
|
1978
|
+
return e ? we(e.items, e.retainedIndices, U.value, e.fromIndex) : null;
|
|
1979
|
+
}), q = r(() => (H.value, Math.max(T.value, V.reservedHeight(), d.leavingPostIds.size === 0 ? K.value.height : H.value.height))), J = r(() => ({ height: `${q.value}px` })), ne = r(() => !d.infiniteScroll || C.value > 0 && k.value + K.value.height <= C.value + 1), re = r(() => new Set(j.value)), ie = r(() => M.value.flatMap((e) => {
|
|
1980
|
+
let t = d.items[e], n = K.value.items[e];
|
|
1960
1981
|
return !t || !n || n.width <= 0 || n.height <= 0 ? [] : [{
|
|
1961
|
-
fetchPriority:
|
|
1982
|
+
fetchPriority: re.value.has(e) ? "high" : "low",
|
|
1962
1983
|
index: e,
|
|
1963
1984
|
item: t
|
|
1964
1985
|
}];
|
|
1965
1986
|
}));
|
|
1966
|
-
function
|
|
1987
|
+
function ae(e, t) {
|
|
1967
1988
|
return [...new Set([...e, ...t])].sort((e, t) => e - t);
|
|
1968
1989
|
}
|
|
1969
|
-
function
|
|
1990
|
+
function se(e, t) {
|
|
1970
1991
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
1971
1992
|
}
|
|
1972
|
-
function
|
|
1993
|
+
function ce(e) {
|
|
1973
1994
|
let t = {
|
|
1974
1995
|
scrollTop: N - k.value,
|
|
1975
1996
|
viewportHeight: C.value
|
|
1976
|
-
}, n =
|
|
1997
|
+
}, n = te.value, r = Ee(n ?? U.value, {
|
|
1977
1998
|
...t,
|
|
1978
1999
|
overscan: e
|
|
1979
2000
|
}).indices;
|
|
1980
|
-
return
|
|
2001
|
+
return ae(r, d.leavingPostIds.size === 0 ? [] : Ee(U.value, {
|
|
1981
2002
|
...t,
|
|
1982
2003
|
overscan: e
|
|
1983
2004
|
}).indices.filter((e) => {
|
|
@@ -1985,23 +2006,23 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
1985
2006
|
return t !== void 0 && d.leavingPostIds.has(t.postId);
|
|
1986
2007
|
}));
|
|
1987
2008
|
}
|
|
1988
|
-
function
|
|
1989
|
-
let e =
|
|
1990
|
-
|
|
1991
|
-
let n =
|
|
2009
|
+
function le() {
|
|
2010
|
+
let e = ce(0), t = ce(Oe(d.masonry, C.value));
|
|
2011
|
+
se(j.value, e) || (j.value = e);
|
|
2012
|
+
let n = pe(K.value.items, e.filter((e) => {
|
|
1992
2013
|
let t = d.items[e];
|
|
1993
2014
|
return t && !d.leavingPostIds.has(t.postId);
|
|
1994
2015
|
}), {
|
|
1995
2016
|
scrollTop: N - k.value,
|
|
1996
2017
|
viewportHeight: C.value
|
|
1997
2018
|
});
|
|
1998
|
-
|
|
2019
|
+
se(A.value, n) || (A.value = n), se(M.value, t) || (M.value = t);
|
|
1999
2020
|
}
|
|
2000
|
-
function
|
|
2021
|
+
function X() {
|
|
2001
2022
|
if (L !== null) return;
|
|
2002
2023
|
L = -1;
|
|
2003
2024
|
let e = requestAnimationFrame(() => {
|
|
2004
|
-
L = null,
|
|
2025
|
+
L = null, le();
|
|
2005
2026
|
});
|
|
2006
2027
|
L !== null && (L = e);
|
|
2007
2028
|
}
|
|
@@ -2014,11 +2035,11 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2014
2035
|
previewStates: () => d.previewStates,
|
|
2015
2036
|
visibleIndices: () => j.value
|
|
2016
2037
|
});
|
|
2017
|
-
function
|
|
2018
|
-
let t =
|
|
2038
|
+
function Z(e) {
|
|
2039
|
+
let t = K.value.items[e], n = d.items[e]?.postId;
|
|
2019
2040
|
if (!t || t.width <= 0 || t.height <= 0) return {};
|
|
2020
2041
|
let r = n !== void 0 && d.enteringPostIds.has(n), i = n !== void 0 && d.leavingPostIds.has(n), a = r || i ? ue({
|
|
2021
|
-
containerHeight: Math.max(T.value,
|
|
2042
|
+
containerHeight: Math.max(T.value, H.value.height),
|
|
2022
2043
|
gap: x.value
|
|
2023
2044
|
}) : 0, o = n === void 0 ? 0 : i ? d.removalDelays.get(n) ?? 0 : r ? d.entryDelays.get(n) ?? 0 : 0;
|
|
2024
2045
|
return {
|
|
@@ -2035,19 +2056,19 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2035
2056
|
let t = e.ownerDocument.defaultView?.getComputedStyle(e), n = (Number.parseFloat(t?.paddingTop ?? "") || 0) + (Number.parseFloat(t?.paddingBottom ?? "") || 0);
|
|
2036
2057
|
T.value = Math.max(0, e.clientHeight - n);
|
|
2037
2058
|
let r = g.value;
|
|
2038
|
-
r && (k.value = r.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop,
|
|
2059
|
+
r && (k.value = r.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop, le());
|
|
2039
2060
|
}
|
|
2040
2061
|
function fe(e) {
|
|
2041
2062
|
let t = e.ownerDocument.documentElement.clientWidth;
|
|
2042
2063
|
y.value = e.clientWidth, x.value = Math.min(pn, Math.max(fn, t * .0075)), de();
|
|
2043
2064
|
}
|
|
2044
|
-
function
|
|
2065
|
+
function Q(e) {
|
|
2045
2066
|
let t = e.currentTarget;
|
|
2046
|
-
t && (N = t.scrollTop,
|
|
2067
|
+
t && (N = t.scrollTop, V.ensurePackedThrough(B()), X(), Date.now() >= l && !d.loadMoreLocked && d.infiniteScroll && Y(t) && f("loadMore"));
|
|
2047
2068
|
}
|
|
2048
2069
|
function me() {
|
|
2049
2070
|
let e = p.value;
|
|
2050
|
-
Date.now() >= l && !d.loadMoreLocked && e &&
|
|
2071
|
+
Date.now() >= l && !d.loadMoreLocked && e && Y(e) && f("loadMore");
|
|
2051
2072
|
}
|
|
2052
2073
|
O(() => d.items.length, (e, t) => {
|
|
2053
2074
|
e > 0 && e < t && (l = Date.now() + mn);
|
|
@@ -2064,13 +2085,13 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2064
2085
|
}), P.observe(e)));
|
|
2065
2086
|
}), O(p, (e) => {
|
|
2066
2087
|
F?.disconnect(), F = null, e && (de(), !(typeof ResizeObserver > "u") && (F = new ResizeObserver(de), F.observe(e)));
|
|
2067
|
-
}), O(
|
|
2088
|
+
}), O(K, (e) => {
|
|
2068
2089
|
z = e.items;
|
|
2069
2090
|
}, { flush: "sync" }), O([
|
|
2070
|
-
|
|
2071
|
-
|
|
2091
|
+
H,
|
|
2092
|
+
K,
|
|
2072
2093
|
() => d.masonry
|
|
2073
|
-
],
|
|
2094
|
+
], le, { flush: "post" }), v(() => {
|
|
2074
2095
|
P?.disconnect(), F?.disconnect(), I !== null && cancelAnimationFrame(I), L !== null && cancelAnimationFrame(L);
|
|
2075
2096
|
}), n({
|
|
2076
2097
|
getScrollElement: he,
|
|
@@ -2084,14 +2105,14 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2084
2105
|
"data-layout-mode": "masonry",
|
|
2085
2106
|
"aria-hidden": t.suspended || void 0,
|
|
2086
2107
|
inert: t.suspended || void 0,
|
|
2087
|
-
onScrollPassive:
|
|
2108
|
+
onScrollPassive: Q
|
|
2088
2109
|
}, [c("section", {
|
|
2089
2110
|
ref_key: "masonryElement",
|
|
2090
2111
|
ref: g,
|
|
2091
2112
|
class: h(["masonry", { "masonry--ready": y.value > 0 }]),
|
|
2092
|
-
style: _(
|
|
2113
|
+
style: _(J.value),
|
|
2093
2114
|
"aria-label": "Media gallery"
|
|
2094
|
-
}, [(b(!0), s(e, null, S(
|
|
2115
|
+
}, [(b(!0), s(e, null, S(ie.value, ({ fetchPriority: e, item: n, index: r }) => (b(), a(an, {
|
|
2095
2116
|
key: n.postId,
|
|
2096
2117
|
class: "masonry-item",
|
|
2097
2118
|
entering: t.enteringPostIds.has(n.postId),
|
|
@@ -2100,20 +2121,21 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2100
2121
|
"card-footer": t.cardFooter,
|
|
2101
2122
|
"card-header": t.cardHeader,
|
|
2102
2123
|
"media-card": t.mediaCard,
|
|
2103
|
-
"in-viewport":
|
|
2124
|
+
"in-viewport": re.value.has(r),
|
|
2104
2125
|
index: r,
|
|
2105
2126
|
item: n,
|
|
2106
|
-
"item-style":
|
|
2127
|
+
"item-style": Z(r),
|
|
2107
2128
|
interactive: "",
|
|
2108
2129
|
layout: "masonry",
|
|
2109
2130
|
"loaded-count": t.items.length,
|
|
2110
2131
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2111
|
-
"preview-state": t.previewStates.get(E(
|
|
2132
|
+
"preview-state": t.previewStates.get(E(W)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2112
2133
|
total: t.total,
|
|
2113
2134
|
onActivate: (e) => f("activate", n.postId, e),
|
|
2114
2135
|
onMediaChange: (e) => f("mediaChange", n.postId, e),
|
|
2115
2136
|
onReady: (e) => f("ready", n.postId, e),
|
|
2116
|
-
onError: (e) => f("error", n.postId, e)
|
|
2137
|
+
onError: (e) => f("error", n.postId, e),
|
|
2138
|
+
onMediaError: (e) => f("mediaError", n.postId, e)
|
|
2117
2139
|
}, null, 8, [
|
|
2118
2140
|
"entering",
|
|
2119
2141
|
"leaving",
|
|
@@ -2132,9 +2154,10 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2132
2154
|
"onActivate",
|
|
2133
2155
|
"onMediaChange",
|
|
2134
2156
|
"onReady",
|
|
2135
|
-
"onError"
|
|
2157
|
+
"onError",
|
|
2158
|
+
"onMediaError"
|
|
2136
2159
|
]))), 128))], 6)], 42, un),
|
|
2137
|
-
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext &&
|
|
2160
|
+
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext && ne.value || !t.hasNext && t.canRetryEnd ? (b(), s("div", dn, [u(oe, {
|
|
2138
2161
|
actions: t.feedFooterActions,
|
|
2139
2162
|
"can-retry-end": t.canRetryEnd,
|
|
2140
2163
|
"feed-footer": t.feedFooter,
|
|
@@ -2142,7 +2165,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2142
2165
|
"has-next": t.hasNext,
|
|
2143
2166
|
"is-loading": t.isLoadingMore,
|
|
2144
2167
|
"load-more-locked": t.loadMoreLocked,
|
|
2145
|
-
"show-load-more":
|
|
2168
|
+
"show-load-more": ne.value,
|
|
2146
2169
|
state: t.state,
|
|
2147
2170
|
onLoadMore: r[0] ||= (e) => f("loadMore"),
|
|
2148
2171
|
onRetryEnd: r[1] ||= (e) => f("retryEnd")
|
|
@@ -2158,7 +2181,7 @@ var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
|
2158
2181
|
"state"
|
|
2159
2182
|
])])) : o("", !0),
|
|
2160
2183
|
u(Le, {
|
|
2161
|
-
"content-size":
|
|
2184
|
+
"content-size": K.value.height,
|
|
2162
2185
|
"controls-id": m,
|
|
2163
2186
|
"scroll-element": p.value,
|
|
2164
2187
|
suspended: t.suspended
|
|
@@ -2241,6 +2264,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2241
2264
|
emits: [
|
|
2242
2265
|
"activeChange",
|
|
2243
2266
|
"error",
|
|
2267
|
+
"mediaError",
|
|
2244
2268
|
"loadMore",
|
|
2245
2269
|
"mediaChange",
|
|
2246
2270
|
"ready",
|
|
@@ -2261,8 +2285,8 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2261
2285
|
return e === void 0 ? 0 : u.mediaIndices.get(e) ?? 0;
|
|
2262
2286
|
}), z = r(() => {
|
|
2263
2287
|
let e = F.value;
|
|
2264
|
-
return e === void 0 ? "loading" : u.previewStates.get(
|
|
2265
|
-
}), B = r(() => I.value ?
|
|
2288
|
+
return e === void 0 ? "loading" : u.previewStates.get(W(e, R.value)) ?? "loading";
|
|
2289
|
+
}), B = r(() => I.value ? U(I.value, R.value) : null), H = r(() => B.value ? ee(B.value, u.mediaSource ?? "preview") : null), G = r(() => z.value === "ready" && !!(H.value && L(H.value.type, H.value.src))), K = r(() => [
|
|
2266
2290
|
F.value,
|
|
2267
2291
|
R.value,
|
|
2268
2292
|
u.items.length,
|
|
@@ -2270,47 +2294,47 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2270
2294
|
u.reelAutoAdvance.enabled,
|
|
2271
2295
|
u.reelAutoAdvance.includePostItems,
|
|
2272
2296
|
u.reelAutoAdvance.intervalMs
|
|
2273
|
-
].join(":")),
|
|
2274
|
-
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && R.value <
|
|
2297
|
+
].join(":")), te = r(() => {
|
|
2298
|
+
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && R.value < V(e).length - 1), n = u.reelAutoAdvance.intervalMs / 1e3;
|
|
2275
2299
|
return `Auto advance to the next ${t ? "post item" : "post"} in ${n}s`;
|
|
2276
|
-
}),
|
|
2277
|
-
function
|
|
2300
|
+
}), q = r(() => u.reelAutoAdvance.enabled && u.reelForward.status === "idle" && I.value !== void 0 && z.value !== "loading" && !G.value), J = r(() => !u.infiniteScroll || u.items.length <= 1), ne = r(() => u.reelForward.status === "end" && u.hasNext && !u.infiniteScroll && !u.loadMoreLocked), re = r(() => u.reelForward.status === "loading" ? "Loading the next media…" : u.reelForward.status === "error" ? "Unable to load the next media." : ne.value ? "Load the next page to continue." : "You reached the end of this feed.");
|
|
2301
|
+
function ie(e) {
|
|
2278
2302
|
return { gridRow: `${e + 1}` };
|
|
2279
2303
|
}
|
|
2280
|
-
function
|
|
2304
|
+
function ae(e) {
|
|
2281
2305
|
let t = k || e.clientHeight;
|
|
2282
2306
|
return t <= 0 || u.items.length === 0 ? 0 : Math.min(u.items.length - 1, Math.max(0, Math.round(e.scrollTop / t)));
|
|
2283
2307
|
}
|
|
2284
|
-
function
|
|
2308
|
+
function se(e) {
|
|
2285
2309
|
let t = e.currentTarget;
|
|
2286
2310
|
if (!t) return;
|
|
2287
2311
|
let n = k || t.clientHeight, r = Math.max(0, u.items.length - 1) * n;
|
|
2288
|
-
C.value = u.items.length > 0 && t.scrollTop > r + 1, D.value || (x.value =
|
|
2312
|
+
C.value = u.items.length > 0 && t.scrollTop > r + 1, D.value || (x.value = ae(t)), Date.now() >= l && !u.loadMoreLocked && u.infiniteScroll && Y(t) && d("loadMore");
|
|
2289
2313
|
}
|
|
2290
|
-
function
|
|
2314
|
+
function ce() {
|
|
2291
2315
|
let e = f.value;
|
|
2292
|
-
e && (C.value = !1,
|
|
2316
|
+
e && (C.value = !1, Z(!0), k = e.clientHeight, e.scrollTop = x.value * k, j !== null && cancelAnimationFrame(j), j = requestAnimationFrame(() => {
|
|
2293
2317
|
e.scrollTop = x.value * e.clientHeight, k = e.clientHeight, j = null;
|
|
2294
|
-
}),
|
|
2318
|
+
}), le());
|
|
2295
2319
|
}
|
|
2296
|
-
function
|
|
2320
|
+
function le() {
|
|
2297
2321
|
M !== null && clearTimeout(M), M = setTimeout(() => {
|
|
2298
2322
|
M = null;
|
|
2299
2323
|
let e = f.value;
|
|
2300
|
-
e && (k = e.clientHeight, e.scrollTop = x.value * k),
|
|
2324
|
+
e && (k = e.clientHeight, e.scrollTop = x.value * k), Z(!1);
|
|
2301
2325
|
}, 120);
|
|
2302
2326
|
}
|
|
2303
|
-
function
|
|
2304
|
-
|
|
2327
|
+
function X() {
|
|
2328
|
+
Z(!0);
|
|
2305
2329
|
let e = f.value;
|
|
2306
|
-
e && (k = e.clientHeight, e.scrollTop = x.value * k),
|
|
2330
|
+
e && (k = e.clientHeight, e.scrollTop = x.value * k), le();
|
|
2307
2331
|
}
|
|
2308
|
-
function
|
|
2332
|
+
function Z(e) {
|
|
2309
2333
|
D.value = e, f.value?.toggleAttribute("data-resizing", e);
|
|
2310
2334
|
}
|
|
2311
2335
|
function ue() {
|
|
2312
2336
|
let e = f.value;
|
|
2313
|
-
Date.now() >= l && !u.loadMoreLocked && e &&
|
|
2337
|
+
Date.now() >= l && !u.loadMoreLocked && e && Y(e) && d("loadMore");
|
|
2314
2338
|
}
|
|
2315
2339
|
O(() => u.items.length, (e, t) => {
|
|
2316
2340
|
e > 0 && e < t && (l = Date.now() + Tn);
|
|
@@ -2318,7 +2342,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2318
2342
|
function de(e) {
|
|
2319
2343
|
let t = I.value;
|
|
2320
2344
|
if (!t) return !1;
|
|
2321
|
-
let n =
|
|
2345
|
+
let n = V(t).length;
|
|
2322
2346
|
if (n <= 1) return !1;
|
|
2323
2347
|
let r = (R.value + e + n) % n;
|
|
2324
2348
|
return d("mediaChange", t.postId, r), !0;
|
|
@@ -2327,18 +2351,18 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2327
2351
|
let t = x.value + e;
|
|
2328
2352
|
return !f.value || t < 0 || t >= u.items.length ? !1 : (he(t), !0);
|
|
2329
2353
|
}
|
|
2330
|
-
function
|
|
2354
|
+
function pe(e, t) {
|
|
2331
2355
|
let n = u.items.findIndex((t) => t.postId === e), r = u.items[n];
|
|
2332
2356
|
return !f.value || !r || t < 0 || t > r.items.length ? !1 : ((u.mediaIndices.get(e) ?? 0) !== t && d("mediaChange", e, t), n !== x.value && he(n), !0);
|
|
2333
2357
|
}
|
|
2334
|
-
function
|
|
2358
|
+
function Q() {
|
|
2335
2359
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2336
2360
|
}
|
|
2337
2361
|
function me(e) {
|
|
2338
2362
|
let t = f.value;
|
|
2339
2363
|
if (!t) return Promise.resolve();
|
|
2340
2364
|
let n = e * (k || t.clientHeight);
|
|
2341
|
-
return x.value = e, _n(t, n,
|
|
2365
|
+
return x.value = e, _n(t, n, Q());
|
|
2342
2366
|
}
|
|
2343
2367
|
function he(e) {
|
|
2344
2368
|
me(e);
|
|
@@ -2348,13 +2372,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2348
2372
|
return t < 0 || t === x.value ? !1 : (await me(t), !0);
|
|
2349
2373
|
}
|
|
2350
2374
|
async function _e(e) {
|
|
2351
|
-
return de(e) ? (
|
|
2375
|
+
return de(e) ? (Q() || await new Promise((e) => setTimeout(e, wn)), !0) : !1;
|
|
2352
2376
|
}
|
|
2353
2377
|
function ve() {
|
|
2354
2378
|
if (!u.reelAutoAdvance.enabled) return;
|
|
2355
2379
|
let e = I.value;
|
|
2356
2380
|
if (!e) return;
|
|
2357
|
-
if (u.reelAutoAdvance.includePostItems && R.value <
|
|
2381
|
+
if (u.reelAutoAdvance.includePostItems && R.value < V(e).length - 1) {
|
|
2358
2382
|
d("mediaChange", e.postId, R.value + 1);
|
|
2359
2383
|
return;
|
|
2360
2384
|
}
|
|
@@ -2366,26 +2390,26 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2366
2390
|
u.reelAutoAdvance.includePostItems && (u.mediaIndices.get(n.postId) ?? 0) !== 0 && d("mediaChange", n.postId, 0), he(t);
|
|
2367
2391
|
}
|
|
2368
2392
|
function ye(e, t) {
|
|
2369
|
-
!u.reelAutoAdvance.enabled || e !== F.value || t !== R.value || !
|
|
2393
|
+
!u.reelAutoAdvance.enabled || e !== F.value || t !== R.value || !G.value || ve();
|
|
2370
2394
|
}
|
|
2371
2395
|
return O(f, (e) => {
|
|
2372
|
-
A?.disconnect(), A = null, e && (k = e.clientHeight, !(typeof ResizeObserver > "u") && (A = new ResizeObserver(
|
|
2396
|
+
A?.disconnect(), A = null, e && (k = e.clientHeight, !(typeof ResizeObserver > "u") && (A = new ResizeObserver(ce), A.observe(e)));
|
|
2373
2397
|
}), O(() => u.items.length, async (e) => {
|
|
2374
2398
|
let t = u.initialPostId, n = t == null ? -1 : u.items.findIndex(({ postId: e }) => e === t);
|
|
2375
|
-
x.value = n >= 0 ? n : Math.min(x.value, Math.max(0, e - 1)), await m(),
|
|
2399
|
+
x.value = n >= 0 ? n : Math.min(x.value, Math.max(0, e - 1)), await m(), ce();
|
|
2376
2400
|
}), O(F, (e) => {
|
|
2377
2401
|
e !== void 0 && d("activeChange", e);
|
|
2378
2402
|
}, { immediate: !0 }), y(() => {
|
|
2379
|
-
window.addEventListener("resize",
|
|
2403
|
+
window.addEventListener("resize", X), window.addEventListener("orientationchange", X), g >= 0 && m(ce);
|
|
2380
2404
|
}), v(() => {
|
|
2381
|
-
window.removeEventListener("resize",
|
|
2405
|
+
window.removeEventListener("resize", X), window.removeEventListener("orientationchange", X), A?.disconnect(), j !== null && cancelAnimationFrame(j), M !== null && clearTimeout(M);
|
|
2382
2406
|
}), n({
|
|
2383
2407
|
activeIndex: x,
|
|
2384
2408
|
activePostId: F,
|
|
2385
2409
|
changeActiveMedia: de,
|
|
2386
2410
|
loadIfNearBottom: ue,
|
|
2387
2411
|
moveActivePost: fe,
|
|
2388
|
-
navigateToItem:
|
|
2412
|
+
navigateToItem: pe,
|
|
2389
2413
|
transitionActiveMedia: _e,
|
|
2390
2414
|
transitionActivePost: ge
|
|
2391
2415
|
}), (n, r) => (b(), s("main", {
|
|
@@ -2423,7 +2447,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2423
2447
|
class: "gallery-shell reel-feed",
|
|
2424
2448
|
"data-active-post-id": F.value,
|
|
2425
2449
|
"data-active-media-index": R.value,
|
|
2426
|
-
onScrollPassive:
|
|
2450
|
+
onScrollPassive: se
|
|
2427
2451
|
}, [t.reelForward.status === "idle" ? (b(), s("section", {
|
|
2428
2452
|
key: 1,
|
|
2429
2453
|
class: "reel-track",
|
|
@@ -2438,13 +2462,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2438
2462
|
"fetch-priority": e,
|
|
2439
2463
|
index: i,
|
|
2440
2464
|
item: n,
|
|
2441
|
-
"item-style":
|
|
2465
|
+
"item-style": ie(i),
|
|
2442
2466
|
"media-card": t.mediaCard,
|
|
2443
2467
|
layout: "reel",
|
|
2444
2468
|
"loaded-count": t.items.length,
|
|
2445
2469
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2446
2470
|
"media-source": t.mediaSource,
|
|
2447
|
-
"preview-state": t.previewStates.get(E(
|
|
2471
|
+
"preview-state": t.previewStates.get(E(W)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2448
2472
|
"reel-controls-target": p.value,
|
|
2449
2473
|
"reel-audio-state": t.reelAudioState,
|
|
2450
2474
|
"stationary-reel-controls": "",
|
|
@@ -2453,7 +2477,8 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2453
2477
|
onEnded: (e) => ye(n.postId, e),
|
|
2454
2478
|
onReady: (e) => d("ready", n.postId, e),
|
|
2455
2479
|
onReelAudioChange: r[1] ||= (e) => d("reelAudioChange", e),
|
|
2456
|
-
onError: (e) => d("error", n.postId, e)
|
|
2480
|
+
onError: (e) => d("error", n.postId, e),
|
|
2481
|
+
onMediaError: (e) => d("mediaError", n.postId, e)
|
|
2457
2482
|
}, null, 8, [
|
|
2458
2483
|
"active",
|
|
2459
2484
|
"advance-on-media-end",
|
|
@@ -2472,19 +2497,20 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2472
2497
|
"onMediaChange",
|
|
2473
2498
|
"onEnded",
|
|
2474
2499
|
"onReady",
|
|
2475
|
-
"onError"
|
|
2500
|
+
"onError",
|
|
2501
|
+
"onMediaError"
|
|
2476
2502
|
]))), 128))], 4)) : (b(), s("div", {
|
|
2477
2503
|
key: 0,
|
|
2478
2504
|
class: "reel-forward-status",
|
|
2479
2505
|
role: t.reelForward.status === "error" ? "alert" : "status",
|
|
2480
2506
|
"data-status": t.reelForward.status
|
|
2481
|
-
}, [c("p", null, T(
|
|
2507
|
+
}, [c("p", null, T(re.value), 1), t.reelForward.status === "error" || t.reelForward.status === "end" ? (b(), s("button", {
|
|
2482
2508
|
key: 0,
|
|
2483
2509
|
class: "reel-forward-retry",
|
|
2484
2510
|
type: "button",
|
|
2485
2511
|
disabled: t.loadMoreLocked,
|
|
2486
2512
|
onClick: r[0] ||= (e) => d("retryForward")
|
|
2487
|
-
}, T(
|
|
2513
|
+
}, T(ne.value ? "Load more" : "Retry"), 9, Cn)) : o("", !0)], 8, Sn)), t.reelForward.status === "idle" ? (b(), a(oe, {
|
|
2488
2514
|
key: 2,
|
|
2489
2515
|
actions: t.feedFooterActions,
|
|
2490
2516
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -2493,7 +2519,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2493
2519
|
"has-next": t.hasNext,
|
|
2494
2520
|
"is-loading": t.isLoadingMore,
|
|
2495
2521
|
"load-more-locked": t.loadMoreLocked,
|
|
2496
|
-
"show-load-more":
|
|
2522
|
+
"show-load-more": J.value,
|
|
2497
2523
|
state: t.state,
|
|
2498
2524
|
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2499
2525
|
onRetryEnd: r[3] ||= (e) => d("retryEnd")
|
|
@@ -2535,10 +2561,10 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2535
2561
|
"style",
|
|
2536
2562
|
"total"
|
|
2537
2563
|
])) : o("", !0),
|
|
2538
|
-
|
|
2539
|
-
key:
|
|
2564
|
+
q.value ? (b(), a(yn, {
|
|
2565
|
+
key: K.value,
|
|
2540
2566
|
"duration-ms": t.reelAutoAdvance.intervalMs,
|
|
2541
|
-
label:
|
|
2567
|
+
label: te.value,
|
|
2542
2568
|
onComplete: ve
|
|
2543
2569
|
}, null, 8, ["duration-ms", "label"])) : o("", !0)
|
|
2544
2570
|
], 2));
|
|
@@ -2590,6 +2616,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2590
2616
|
"activeChange",
|
|
2591
2617
|
"closeInfoSheet",
|
|
2592
2618
|
"error",
|
|
2619
|
+
"mediaError",
|
|
2593
2620
|
"loadMore",
|
|
2594
2621
|
"mediaChange",
|
|
2595
2622
|
"ready",
|
|
@@ -2612,9 +2639,9 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2612
2639
|
item: e,
|
|
2613
2640
|
layout: "reel",
|
|
2614
2641
|
loadedCount: l.items.length,
|
|
2615
|
-
mediaCount:
|
|
2642
|
+
mediaCount: V(e).length,
|
|
2616
2643
|
mediaIndex: D.value,
|
|
2617
|
-
mediaItem:
|
|
2644
|
+
mediaItem: U(e, D.value),
|
|
2618
2645
|
mediaSource: l.mediaSource ?? "preview",
|
|
2619
2646
|
origin: l.origin,
|
|
2620
2647
|
total: l.total
|
|
@@ -2647,7 +2674,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2647
2674
|
function B(e, t) {
|
|
2648
2675
|
d("mediaChange", e, t);
|
|
2649
2676
|
}
|
|
2650
|
-
function
|
|
2677
|
+
function ee(e, t) {
|
|
2651
2678
|
d("ready", e, t);
|
|
2652
2679
|
}
|
|
2653
2680
|
return O(() => ({
|
|
@@ -2705,12 +2732,13 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2705
2732
|
total: e.total,
|
|
2706
2733
|
onActiveChange: r[0] ||= (e) => d("activeChange", e),
|
|
2707
2734
|
onError: z,
|
|
2708
|
-
|
|
2735
|
+
onMediaError: r[1] ||= (e, t) => d("mediaError", e, t),
|
|
2736
|
+
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2709
2737
|
onMediaChange: B,
|
|
2710
|
-
onReady:
|
|
2711
|
-
onRetryEnd: r[
|
|
2712
|
-
onRetryForward: r[
|
|
2713
|
-
onReelAudioChange: r[
|
|
2738
|
+
onReady: ee,
|
|
2739
|
+
onRetryEnd: r[3] ||= (e) => d("retryEnd"),
|
|
2740
|
+
onRetryForward: r[4] ||= (e) => d("retryForward"),
|
|
2741
|
+
onReelAudioChange: r[5] ||= (e) => d("reelAudioChange", e)
|
|
2714
2742
|
}, null, 8, [
|
|
2715
2743
|
"can-retry-end",
|
|
2716
2744
|
"card-footer",
|
|
@@ -2753,7 +2781,7 @@ var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
|
2753
2781
|
function Mn(e, t, n, r, i) {
|
|
2754
2782
|
let a = e.items.findIndex((e) => e.postId === t), o = e.items[a];
|
|
2755
2783
|
if (!o) return null;
|
|
2756
|
-
let s =
|
|
2784
|
+
let s = H(o, n), c = U(o, s);
|
|
2757
2785
|
return {
|
|
2758
2786
|
item: o,
|
|
2759
2787
|
layout: r,
|
|
@@ -2788,7 +2816,7 @@ function Pn(e, t) {
|
|
|
2788
2816
|
n.clear(), l.clear(), i.value = /* @__PURE__ */ new Map(), a.value = /* @__PURE__ */ new Map(), o.value = /* @__PURE__ */ new Map();
|
|
2789
2817
|
}
|
|
2790
2818
|
function d(e, t, n, r) {
|
|
2791
|
-
let i =
|
|
2819
|
+
let i = W(t, n);
|
|
2792
2820
|
e.value.get(i) !== r && (e.value = new Map(e.value).set(i, r));
|
|
2793
2821
|
}
|
|
2794
2822
|
function f(t, n, r, i) {
|
|
@@ -2798,32 +2826,39 @@ function Pn(e, t) {
|
|
|
2798
2826
|
let a = f(e, n, r, i);
|
|
2799
2827
|
a && t.ready(a);
|
|
2800
2828
|
}
|
|
2801
|
-
function m(
|
|
2802
|
-
|
|
2829
|
+
function m(n, r, i) {
|
|
2830
|
+
let a = f(n, r.mediaIndex, i, i === "reel" ? e.reelOrigin ?? "reel" : null);
|
|
2831
|
+
a && r.src && t.error({
|
|
2832
|
+
...a,
|
|
2833
|
+
...r
|
|
2834
|
+
});
|
|
2803
2835
|
}
|
|
2804
2836
|
function h(e, t) {
|
|
2805
|
-
d(i, e, t, "
|
|
2837
|
+
d(i, e, t, "error");
|
|
2806
2838
|
}
|
|
2807
2839
|
function g(e, t) {
|
|
2840
|
+
d(i, e, t, "ready"), p(e, t, "masonry", null);
|
|
2841
|
+
}
|
|
2842
|
+
function _(e, t) {
|
|
2808
2843
|
d(s(), e, t, "error");
|
|
2809
2844
|
}
|
|
2810
|
-
function
|
|
2845
|
+
function v(t, n) {
|
|
2811
2846
|
d(s(), t, n, "ready"), p(t, n, "reel", e.reelOrigin ?? "reel");
|
|
2812
2847
|
}
|
|
2813
|
-
function
|
|
2814
|
-
let r =
|
|
2848
|
+
function y(e, n) {
|
|
2849
|
+
let r = W(e, n);
|
|
2815
2850
|
if (l.has(r)) return;
|
|
2816
2851
|
let i = f(e, n, "masonry", null);
|
|
2817
2852
|
i && (l.add(r), t.visible(i));
|
|
2818
2853
|
}
|
|
2819
|
-
function
|
|
2820
|
-
let o = [i,
|
|
2854
|
+
function b(e, r, i, a) {
|
|
2855
|
+
let o = [i, W(e, r)].join(":");
|
|
2821
2856
|
if (n.has(o)) return;
|
|
2822
2857
|
let s = f(e, r, i, a);
|
|
2823
2858
|
s && (n.add(o), t.fullyVisible(s));
|
|
2824
2859
|
}
|
|
2825
|
-
function
|
|
2826
|
-
|
|
2860
|
+
function x(e, t) {
|
|
2861
|
+
b(e, t, "masonry", null);
|
|
2827
2862
|
}
|
|
2828
2863
|
return Nn(e, t.reelChange), O(() => {
|
|
2829
2864
|
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null, n = t === null ? 0 : e.mediaIndices.get(t) ?? 0;
|
|
@@ -2831,17 +2866,18 @@ function Pn(e, t) {
|
|
|
2831
2866
|
mediaIndex: n,
|
|
2832
2867
|
origin: e.reelOrigin ?? "reel",
|
|
2833
2868
|
postId: t,
|
|
2834
|
-
ready: t !== null && c.value.get(
|
|
2869
|
+
ready: t !== null && c.value.get(W(t, n)) === "ready"
|
|
2835
2870
|
};
|
|
2836
2871
|
}, (e, t) => {
|
|
2837
|
-
e.postId === null || !e.ready || t?.ready && t.postId === e.postId && t.mediaIndex === e.mediaIndex && t.origin === e.origin ||
|
|
2872
|
+
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);
|
|
2838
2873
|
}, { flush: "post" }), {
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2874
|
+
markMediaError: m,
|
|
2875
|
+
markMasonryFullyVisible: x,
|
|
2876
|
+
markMasonryVisible: y,
|
|
2877
|
+
markPreviewError: h,
|
|
2878
|
+
markPreviewReady: g,
|
|
2879
|
+
markReelError: _,
|
|
2880
|
+
markReelReady: v,
|
|
2845
2881
|
originalStates: a,
|
|
2846
2882
|
previewStates: i,
|
|
2847
2883
|
reelStates: c,
|
|
@@ -2928,6 +2964,7 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
2928
2964
|
"closeReel",
|
|
2929
2965
|
"loadMore",
|
|
2930
2966
|
"mediaFullyVisible",
|
|
2967
|
+
"mediaError",
|
|
2931
2968
|
"mediaReady",
|
|
2932
2969
|
"mediaVisible",
|
|
2933
2970
|
"openReel",
|
|
@@ -2938,55 +2975,56 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
2938
2975
|
"retryForward"
|
|
2939
2976
|
],
|
|
2940
2977
|
setup(t, { expose: i, emit: c }) {
|
|
2941
|
-
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(() =>
|
|
2978
|
+
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(() => te(l.state, T.value)), { markMediaError: A, markMasonryFullyVisible: j, markMasonryVisible: M, markPreviewError: N, markPreviewReady: P, markReelError: F, markReelReady: I, originalStates: L, previewStates: R, reelStates: z, resetMediaLifecycle: B } = Pn(l.state, {
|
|
2979
|
+
error: (e) => d("mediaError", e),
|
|
2942
2980
|
fullyVisible: (e) => d("mediaFullyVisible", e),
|
|
2943
2981
|
ready: (e) => d("mediaReady", e),
|
|
2944
2982
|
reelChange: (e) => d("reelMediaChange", e),
|
|
2945
2983
|
visible: (e) => d("mediaVisible", e)
|
|
2946
|
-
}),
|
|
2984
|
+
}), ee = new Set(l.state.items.map((e) => e.postId)), U = null, W = null, G = !1;
|
|
2947
2985
|
function K() {
|
|
2948
2986
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2949
2987
|
}
|
|
2950
2988
|
function q() {
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2989
|
+
U !== null && cancelAnimationFrame(U), U = requestAnimationFrame(() => {
|
|
2990
|
+
U = requestAnimationFrame(() => {
|
|
2991
|
+
U = null, y.value = /* @__PURE__ */ new Set();
|
|
2954
2992
|
});
|
|
2955
2993
|
});
|
|
2956
2994
|
}
|
|
2957
|
-
function
|
|
2995
|
+
function J(e, t) {
|
|
2958
2996
|
let n = l.state.items.find((t) => t.postId === e);
|
|
2959
2997
|
if (!n) return;
|
|
2960
|
-
let r =
|
|
2998
|
+
let r = H(n, t);
|
|
2961
2999
|
(l.state.mediaIndices.get(e) ?? 0) !== r && (l.state.mediaIndices = new Map(l.state.mediaIndices).set(e, r));
|
|
2962
3000
|
}
|
|
2963
|
-
async function
|
|
3001
|
+
async function ne() {
|
|
2964
3002
|
await m(), (l.state.layout === "reel" || l.state.reelOrigin === "masonry" ? p.value : f.value)?.loadIfNearBottom();
|
|
2965
3003
|
}
|
|
2966
|
-
function
|
|
3004
|
+
function re(e) {
|
|
2967
3005
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.changeActiveMedia?.(e) ?? !1;
|
|
2968
3006
|
}
|
|
2969
|
-
function
|
|
3007
|
+
function ie(e) {
|
|
2970
3008
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.moveActivePost?.(e) ?? !1;
|
|
2971
3009
|
}
|
|
2972
|
-
function
|
|
3010
|
+
function ae(e) {
|
|
2973
3011
|
if (!(l.state.layout === "reel" || l.state.reelOrigin === "masonry") || l.state.isLoading) return "reel-inactive";
|
|
2974
3012
|
let t = l.state.items.find((t) => t.postId === e.postId);
|
|
2975
3013
|
if (!t) return "not-found";
|
|
2976
|
-
let n =
|
|
3014
|
+
let n = V(t).findIndex((t) => t.mediaId === e.mediaId);
|
|
2977
3015
|
return n < 0 ? "not-found" : p.value?.navigateToItem?.(e.postId, n) ? "navigated" : "reel-inactive";
|
|
2978
3016
|
}
|
|
2979
|
-
function
|
|
3017
|
+
function oe() {
|
|
2980
3018
|
return l.state.layout !== "masonry" || l.state.reelOrigin === "masonry" ? null : f.value?.getScrollElement?.() ?? null;
|
|
2981
3019
|
}
|
|
2982
|
-
function
|
|
3020
|
+
function se(e, t) {
|
|
2983
3021
|
W = e, G = t === "keyboard", d("openReel", e), m(() => h.value?.focus());
|
|
2984
3022
|
}
|
|
2985
|
-
function
|
|
3023
|
+
function ce(e) {
|
|
2986
3024
|
let t = g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [];
|
|
2987
3025
|
return Array.from(t).find((t) => t.dataset.postId === String(e)) ?? null;
|
|
2988
3026
|
}
|
|
2989
|
-
function
|
|
3027
|
+
function Y(e, t) {
|
|
2990
3028
|
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null || K()) return 0;
|
|
2991
3029
|
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)));
|
|
2992
3030
|
if (i.length === 0) return 0;
|
|
@@ -2995,11 +3033,11 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
2995
3033
|
a.set(e, t * o);
|
|
2996
3034
|
}), y.value = new Set([...y.value].filter((e) => !i.includes(e))), S.value = new Set([...S.value, ...n]), C.value = a, Bn + (i.length - 1) * o;
|
|
2997
3035
|
}
|
|
2998
|
-
function
|
|
3036
|
+
function X() {
|
|
2999
3037
|
S.value = /* @__PURE__ */ new Set(), C.value = /* @__PURE__ */ new Map();
|
|
3000
3038
|
}
|
|
3001
3039
|
async function Z(e, t) {
|
|
3002
|
-
if (t.aborted ||
|
|
3040
|
+
if (t.aborted || Y(e, { staggerMs: 0 }) === 0 || (await m(), t.aborted)) return;
|
|
3003
3041
|
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) ?? []));
|
|
3004
3042
|
await new Promise((e) => {
|
|
3005
3043
|
let n = () => {
|
|
@@ -3008,23 +3046,23 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3008
3046
|
t.addEventListener("abort", n, { once: !0 }), t.aborted ? n() : Promise.allSettled(r.map((e) => e.finished)).then(n);
|
|
3009
3047
|
});
|
|
3010
3048
|
}
|
|
3011
|
-
function
|
|
3012
|
-
let n =
|
|
3049
|
+
function ue(e, t) {
|
|
3050
|
+
let n = ce(e), r = n?.querySelector(".media-card-activator") ?? n;
|
|
3013
3051
|
r && (r.classList.toggle("media-card-focus-silent", !t), t || r.addEventListener("blur", () => {
|
|
3014
3052
|
r.classList.remove("media-card-focus-silent");
|
|
3015
3053
|
}, { once: !0 }), r?.focus({ preventScroll: !0 }));
|
|
3016
3054
|
}
|
|
3017
|
-
function
|
|
3055
|
+
function de() {
|
|
3018
3056
|
l.state.reelOrigin === "masonry" && (W ??= l.state.activeReelPostId, _.value = !0, d("closeReel"));
|
|
3019
3057
|
}
|
|
3020
|
-
function
|
|
3058
|
+
function fe() {
|
|
3021
3059
|
let e = W, t = G;
|
|
3022
3060
|
_.value = !1, W = null, G = !1, m(() => {
|
|
3023
|
-
e !== null &&
|
|
3061
|
+
e !== null && ue(e, t);
|
|
3024
3062
|
});
|
|
3025
3063
|
}
|
|
3026
3064
|
return Rn({
|
|
3027
|
-
closeMasonryReel:
|
|
3065
|
+
closeMasonryReel: de,
|
|
3028
3066
|
element: () => g.value,
|
|
3029
3067
|
isReelLeaving: () => _.value,
|
|
3030
3068
|
reelRenderer: () => p.value,
|
|
@@ -3034,8 +3072,8 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3034
3072
|
let e = l.state.items;
|
|
3035
3073
|
return [e, e.length];
|
|
3036
3074
|
}, ([e]) => {
|
|
3037
|
-
let t = e.map((e) => e.postId), n = t.filter((e) => !
|
|
3038
|
-
if (
|
|
3075
|
+
let t = e.map((e) => e.postId), n = t.filter((e) => !ee.has(e)), r = new Set(t);
|
|
3076
|
+
if (ee = 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 || K()) return;
|
|
3039
3077
|
let i = /* @__PURE__ */ new Map();
|
|
3040
3078
|
t.forEach((e) => {
|
|
3041
3079
|
let t = x.value.get(e);
|
|
@@ -3044,17 +3082,17 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3044
3082
|
i.set(e, t * zn);
|
|
3045
3083
|
}), x.value = i, y.value = new Set([...y.value, ...n]), q();
|
|
3046
3084
|
}, { flush: "sync" }), v(() => {
|
|
3047
|
-
|
|
3085
|
+
U !== null && cancelAnimationFrame(U);
|
|
3048
3086
|
}), i({
|
|
3049
3087
|
animateItemRemoval: Z,
|
|
3050
|
-
cancelItemRemoval:
|
|
3051
|
-
changeActiveReelMedia:
|
|
3052
|
-
getAutoScrollElement:
|
|
3053
|
-
loadIfNearBottom:
|
|
3054
|
-
moveActiveReelPost:
|
|
3055
|
-
navigateToReelItem:
|
|
3056
|
-
resetMediaLifecycle:
|
|
3057
|
-
startItemRemoval:
|
|
3088
|
+
cancelItemRemoval: X,
|
|
3089
|
+
changeActiveReelMedia: re,
|
|
3090
|
+
getAutoScrollElement: oe,
|
|
3091
|
+
loadIfNearBottom: ne,
|
|
3092
|
+
moveActiveReelPost: ie,
|
|
3093
|
+
navigateToReelItem: ae,
|
|
3094
|
+
resetMediaLifecycle: B,
|
|
3095
|
+
startItemRemoval: Y,
|
|
3058
3096
|
transitionActiveReelMedia: (e) => p.value?.transitionActiveMedia?.(e) ?? Promise.resolve(!1),
|
|
3059
3097
|
transitionActiveReelPost: (e) => p.value?.transitionActivePost?.(e) ?? Promise.resolve(!1)
|
|
3060
3098
|
}), (r, i) => (b(), s("div", {
|
|
@@ -3086,7 +3124,7 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3086
3124
|
"info-sheet-overlay": t.state.reelInfoSheetOverlay,
|
|
3087
3125
|
"next-page-error": !!t.state.nextPageError,
|
|
3088
3126
|
origin: "reel",
|
|
3089
|
-
"preview-states": E(
|
|
3127
|
+
"preview-states": E(z),
|
|
3090
3128
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3091
3129
|
"reel-audio-state": t.reelAudioState,
|
|
3092
3130
|
"reel-forward": t.state.reelForward,
|
|
@@ -3094,21 +3132,22 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3094
3132
|
total: t.state.total,
|
|
3095
3133
|
onActiveChange: i[0] ||= (e) => d("activeReelChange", e),
|
|
3096
3134
|
onCloseInfoSheet: i[1] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3097
|
-
onError: E(
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3135
|
+
onError: E(F),
|
|
3136
|
+
onMediaError: i[2] ||= (e, t) => E(A)(e, t, "reel"),
|
|
3137
|
+
onLoadMore: i[3] ||= (e) => d("loadMore"),
|
|
3138
|
+
onMediaChange: J,
|
|
3139
|
+
onReady: E(I),
|
|
3140
|
+
onRetryEnd: i[4] ||= (e) => d("retryEnd"),
|
|
3141
|
+
onRetryForward: i[5] ||= (e) => d("retryForward"),
|
|
3142
|
+
onReelAudioChange: i[6] ||= (e) => d("reelAudioChange", e)
|
|
3143
|
+
}, null, 8, /* @__PURE__ */ "can-retry-end.has-next.card-footer.card-header.feed-footer.feed-footer-actions.forward-index.forward-item.media-card.infinite-scroll.is-loading-more.items.load-more-locked.media-source.media-indices.initial-post-id.info-sheet.info-sheet-enabled.info-sheet-overlay.next-page-error.preview-states.reel-auto-advance.reel-audio-state.reel-forward.state.total.onError.onReady".split("."))) : t.state.error || t.state.isLoading || t.state.items.length === 0 && t.state.reelForward.status === "idle" ? (b(), a(le, {
|
|
3105
3144
|
key: 1,
|
|
3106
3145
|
actions: t.feedFooterActions,
|
|
3107
3146
|
"can-retry-end": t.canRetryEnd,
|
|
3108
3147
|
"feed-footer": t.feedFooter,
|
|
3109
3148
|
state: D.value,
|
|
3110
|
-
onLoadMore: i[
|
|
3111
|
-
onRetryEnd: i[
|
|
3149
|
+
onLoadMore: i[7] ||= (e) => d("loadMore"),
|
|
3150
|
+
onRetryEnd: i[8] ||= (e) => d("retryEnd")
|
|
3112
3151
|
}, null, 8, [
|
|
3113
3152
|
"actions",
|
|
3114
3153
|
"can-retry-end",
|
|
@@ -3135,21 +3174,22 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3135
3174
|
"load-more-locked": t.state.loadMoreLocked,
|
|
3136
3175
|
"media-indices": t.state.mediaIndices,
|
|
3137
3176
|
"next-page-error": !!t.state.nextPageError,
|
|
3138
|
-
"preview-states": E(
|
|
3177
|
+
"preview-states": E(R),
|
|
3139
3178
|
suspended: t.state.reelOrigin === "masonry" || _.value,
|
|
3140
3179
|
state: D.value,
|
|
3141
3180
|
total: t.state.total,
|
|
3142
|
-
onActivate:
|
|
3143
|
-
onError: E(
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3181
|
+
onActivate: se,
|
|
3182
|
+
onError: E(N),
|
|
3183
|
+
onMediaError: i[9] ||= (e, t) => E(A)(e, t, "masonry"),
|
|
3184
|
+
onFullyVisible: E(j),
|
|
3185
|
+
onLoadMore: i[10] ||= (e) => d("loadMore"),
|
|
3186
|
+
onMediaChange: J,
|
|
3187
|
+
onReady: E(P),
|
|
3188
|
+
onRetryEnd: i[11] ||= (e) => d("retryEnd"),
|
|
3189
|
+
onVisible: E(M)
|
|
3150
3190
|
}, 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, {
|
|
3151
3191
|
name: "vibe-reel-viewer",
|
|
3152
|
-
onAfterLeave:
|
|
3192
|
+
onAfterLeave: fe
|
|
3153
3193
|
}, {
|
|
3154
3194
|
default: k(() => [t.state.reelOrigin === "masonry" ? (b(), s("section", {
|
|
3155
3195
|
key: 0,
|
|
@@ -3184,21 +3224,22 @@ var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
|
3184
3224
|
"media-source": "original",
|
|
3185
3225
|
"next-page-error": !!t.state.nextPageError,
|
|
3186
3226
|
origin: "masonry",
|
|
3187
|
-
"preview-states": E(
|
|
3227
|
+
"preview-states": E(L),
|
|
3188
3228
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3189
3229
|
"reel-audio-state": t.reelAudioState,
|
|
3190
3230
|
"reel-forward": t.state.reelForward,
|
|
3191
3231
|
state: D.value,
|
|
3192
3232
|
total: t.state.total,
|
|
3193
|
-
onActiveChange: i[
|
|
3194
|
-
onCloseInfoSheet: i[
|
|
3195
|
-
onError: E(
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3233
|
+
onActiveChange: i[12] ||= (e) => d("activeReelChange", e),
|
|
3234
|
+
onCloseInfoSheet: i[13] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3235
|
+
onError: E(F),
|
|
3236
|
+
onMediaError: i[14] ||= (e, t) => E(A)(e, t, "reel"),
|
|
3237
|
+
onLoadMore: i[15] ||= (e) => d("loadMore"),
|
|
3238
|
+
onMediaChange: J,
|
|
3239
|
+
onReady: E(I),
|
|
3240
|
+
onRetryEnd: i[16] ||= (e) => d("retryEnd"),
|
|
3241
|
+
onRetryForward: i[17] ||= (e) => d("retryForward"),
|
|
3242
|
+
onReelAudioChange: i[18] ||= (e) => d("reelAudioChange", e)
|
|
3202
3243
|
}, null, 8, /* @__PURE__ */ "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.onError.onReady".split("."))], 512)) : o("", !0)]),
|
|
3203
3244
|
_: 1
|
|
3204
3245
|
})], 64))], 512));
|
|
@@ -4331,7 +4372,7 @@ var ti = class {
|
|
|
4331
4372
|
let e = this.options.surface()?.getAutoScrollElement();
|
|
4332
4373
|
e && (e.scrollTop = 0);
|
|
4333
4374
|
}
|
|
4334
|
-
e.mediaIndices = new Map(a.map((t) => [t.postId,
|
|
4375
|
+
e.mediaIndices = new Map(a.map((t) => [t.postId, H(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({
|
|
4335
4376
|
...n,
|
|
4336
4377
|
items: a
|
|
4337
4378
|
});
|
|
@@ -4522,7 +4563,7 @@ var ui = class {
|
|
|
4522
4563
|
li(e);
|
|
4523
4564
|
let t = this.state.items.findIndex(({ postId: t }) => t === e.postId), n = this.state.items[t];
|
|
4524
4565
|
if (!n) return null;
|
|
4525
|
-
let r = [...
|
|
4566
|
+
let r = [...V(n)], i = r[e.mediaIndex];
|
|
4526
4567
|
if (!i) return null;
|
|
4527
4568
|
let a = Object.freeze({
|
|
4528
4569
|
media: i,
|
|
@@ -4561,7 +4602,7 @@ var ui = class {
|
|
|
4561
4602
|
return this.state.layout === "reel" || this.state.reelOrigin === "masonry";
|
|
4562
4603
|
}
|
|
4563
4604
|
restoreIntoPost(e, t) {
|
|
4564
|
-
let n = this.state.items[e], r = [...
|
|
4605
|
+
let n = this.state.items[e], r = [...V(n)], i = Math.min(t.mediaIndex, r.length);
|
|
4565
4606
|
if (r.splice(i, 0, t.media), this.state.items[e] = ci(n, r), this.state.activeReelPostId !== t.postId) return;
|
|
4566
4607
|
let a = this.state.mediaIndices.get(t.postId) ?? 0;
|
|
4567
4608
|
a >= i && this.state.mediaIndices.set(t.postId, a + 1);
|
|
@@ -4569,7 +4610,7 @@ var ui = class {
|
|
|
4569
4610
|
updateMediaIndexAfterRemoval(e, t, n) {
|
|
4570
4611
|
let r = this.state.items.find((t) => t.postId === e);
|
|
4571
4612
|
if (!r) return;
|
|
4572
|
-
let i =
|
|
4613
|
+
let i = V(r).length, a = this.state.mediaIndices.get(e) ?? 0, o = a;
|
|
4573
4614
|
n ? o = t < i ? t : 0 : t < a && (o = a - 1), this.state.mediaIndices.set(e, Math.min(o, i - 1));
|
|
4574
4615
|
}
|
|
4575
4616
|
};
|
|
@@ -4801,7 +4842,7 @@ var mi = 20, hi = class {
|
|
|
4801
4842
|
if (!n) return;
|
|
4802
4843
|
let r = t.mediaIndices.get(e.postId) ?? 0;
|
|
4803
4844
|
if (e.mediaIndex === r) {
|
|
4804
|
-
if (
|
|
4845
|
+
if (V(n).length > 1) {
|
|
4805
4846
|
await this.options.transitionMedia(1);
|
|
4806
4847
|
return;
|
|
4807
4848
|
}
|
|
@@ -4970,7 +5011,7 @@ function Oi(e) {
|
|
|
4970
5011
|
return String(e);
|
|
4971
5012
|
}
|
|
4972
5013
|
function ki(e, t) {
|
|
4973
|
-
let n =
|
|
5014
|
+
let n = V(t).length;
|
|
4974
5015
|
(e.mediaIndices.get(t.postId) ?? 0) >= n && e.mediaIndices.set(t.postId, Math.max(0, n - 1));
|
|
4975
5016
|
}
|
|
4976
5017
|
function Ai(e, t) {
|
|
@@ -5015,7 +5056,7 @@ var ji = class {
|
|
|
5015
5056
|
constructor(e) {
|
|
5016
5057
|
this.options = e, Qr(e);
|
|
5017
5058
|
let t = e.layout ?? "masonry";
|
|
5018
|
-
this.state = x(Yr(e, t)), this.reelAudio = new Ei(e), this.lastLoadedCursor = e.initialPage ? Kn(e.initialPage) : null, this.notificationItems =
|
|
5059
|
+
this.state = x(Yr(e, t)), this.reelAudio = new Ei(e), this.lastLoadedCursor = e.initialPage ? Kn(e.initialPage) : null, this.notificationItems = G(this.state), this.autoScroll = new yr({
|
|
5019
5060
|
getScrollElement: () => this.surface?.getAutoScrollElement() ?? null,
|
|
5020
5061
|
state: this.state.autoScroll
|
|
5021
5062
|
}), this.autofillController = new pr({
|
|
@@ -5077,6 +5118,7 @@ var ji = class {
|
|
|
5077
5118
|
mediaCard: this.options.mediaCard,
|
|
5078
5119
|
masonry: this.options.masonry,
|
|
5079
5120
|
onMediaFullyVisible: this.options.onMediaFullyVisible,
|
|
5121
|
+
onMediaError: this.options.onMediaError,
|
|
5080
5122
|
onMediaReady: this.options.onMediaReady,
|
|
5081
5123
|
onMediaVisible: this.options.onMediaVisible,
|
|
5082
5124
|
onReelMediaChange: this.options.onReelMediaChange,
|
|
@@ -5107,7 +5149,7 @@ var ji = class {
|
|
|
5107
5149
|
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;
|
|
5108
5150
|
}
|
|
5109
5151
|
getState() {
|
|
5110
|
-
return
|
|
5152
|
+
return te(this.state);
|
|
5111
5153
|
}
|
|
5112
5154
|
getReelAudioState() {
|
|
5113
5155
|
return this.reelAudio.get();
|
|
@@ -5369,7 +5411,7 @@ var ji = class {
|
|
|
5369
5411
|
}
|
|
5370
5412
|
startStateNotifications() {
|
|
5371
5413
|
let e = this.options.onStateChange;
|
|
5372
|
-
!e || this.stopStateWatcher || (this.stopStateWatcher =
|
|
5414
|
+
!e || this.stopStateWatcher || (this.stopStateWatcher = K(this.state, this.notificationItems, e));
|
|
5373
5415
|
}
|
|
5374
5416
|
setCurrentCursor(e) {
|
|
5375
5417
|
this.lastLoadedCursor = this.state.current = e;
|