@wyxos/vibe 5.17.0 → 5.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/lib/core/reelScrollTransition.d.ts +1 -2
- package/lib/index.cjs +2 -2
- package/lib/index.d.ts +0 -2
- package/lib/index.js +1037 -1211
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/components/VibeControlledReel.vue.d.ts +0 -24
- package/lib/core/controlledReel.d.ts +0 -41
- package/lib/core/reelViewport.d.ts +0 -2
package/lib/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Fragment as e, Teleport as t, Transition as n, computed as r, createApp as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p,
|
|
1
|
+
import { Fragment as e, Teleport as t, Transition as n, computed as r, createApp as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, guardReactiveProps as f, h as p, nextTick as m, normalizeClass as h, normalizeProps as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, openBlock as b, reactive as x, renderList as S, resolveDynamicComponent as C, shallowRef as w, toDisplayString as T, unref as E, useId as D, watch as O, withCtx as k, withKeys as A, withModifiers as j } from "vue";
|
|
2
2
|
//#region src/core/mediaType.ts
|
|
3
|
-
var
|
|
4
|
-
function
|
|
3
|
+
var M = /\.(aac|flac|m4a|mp3|oga|ogg|opus|wav)$/i, N = /\.(m4v|mkv|mov|mp4|ogv|webm)$/i;
|
|
4
|
+
function P(e) {
|
|
5
5
|
try {
|
|
6
6
|
return new URL(e).pathname;
|
|
7
7
|
} catch {
|
|
8
8
|
return e.split(/[?#]/)[0] ?? e;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
let t =
|
|
13
|
-
return
|
|
11
|
+
function F(e) {
|
|
12
|
+
let t = P(e);
|
|
13
|
+
return M.test(t) ? "audio" : N.test(t) ? "video" : "image";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return e ??
|
|
15
|
+
function I(e, t) {
|
|
16
|
+
return e ?? F(t);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function L(e, t) {
|
|
19
|
+
return I(e, t) !== "image";
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/core/mediaAsset.ts
|
|
23
|
-
function
|
|
23
|
+
function R(e) {
|
|
24
24
|
return {
|
|
25
25
|
height: e.height,
|
|
26
26
|
src: e.src,
|
|
@@ -28,9 +28,9 @@ function B(e) {
|
|
|
28
28
|
width: e.width
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function z(e, t) {
|
|
32
32
|
if (t === "preview" && e.preview) {
|
|
33
|
-
let t =
|
|
33
|
+
let t = I(e.type, e.src) === "audio" ? I(e.preview.type, e.preview.src) : e.preview.type ?? e.type;
|
|
34
34
|
return {
|
|
35
35
|
...e.preview,
|
|
36
36
|
type: t
|
|
@@ -39,45 +39,45 @@ function V(e, t) {
|
|
|
39
39
|
return t === "mobile" && e.mobile ? {
|
|
40
40
|
...e.mobile,
|
|
41
41
|
type: e.mobile.type ?? e.type
|
|
42
|
-
} :
|
|
42
|
+
} : R(e);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function B(e) {
|
|
45
45
|
let t = e.preview;
|
|
46
|
-
return !t?.src || t.src === e.src ||
|
|
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
|
|
52
|
-
return
|
|
51
|
+
function ee(e, t) {
|
|
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
|
+
} : 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 Y(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 te = {
|
|
|
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 ? (
|
|
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
|
-
},
|
|
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 te = {
|
|
|
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: {},
|
|
@@ -173,7 +173,7 @@ var te = {
|
|
|
173
173
|
function o() {
|
|
174
174
|
n.actions?.retry();
|
|
175
175
|
}
|
|
176
|
-
return (t, n) => e.feedFooter && e.actions && e.state ? (
|
|
176
|
+
return (t, n) => e.feedFooter && e.actions && e.state ? (b(), a(C(e.feedFooter.component), {
|
|
177
177
|
key: 0,
|
|
178
178
|
actions: e.actions,
|
|
179
179
|
"can-retry-end": e.canRetryEnd,
|
|
@@ -188,7 +188,7 @@ var te = {
|
|
|
188
188
|
"can-retry-end",
|
|
189
189
|
"show-load-more",
|
|
190
190
|
"state"
|
|
191
|
-
])) : (
|
|
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 te = {
|
|
|
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: {},
|
|
@@ -218,10 +218,10 @@ var te = {
|
|
|
218
218
|
emits: ["loadMore", "retryEnd"],
|
|
219
219
|
setup(t, { emit: n }) {
|
|
220
220
|
let r = t, i = n;
|
|
221
|
-
return (n, u) => (
|
|
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,37 +243,37 @@ var te = {
|
|
|
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, 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 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
|
-
function
|
|
261
|
+
function ue(e) {
|
|
262
262
|
return Math.max(0, e.containerHeight) + Math.max(0, e.gap);
|
|
263
263
|
}
|
|
264
|
-
var
|
|
265
|
-
function
|
|
264
|
+
var de = .8, fe = .5;
|
|
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;
|
|
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 *
|
|
273
|
-
return o +
|
|
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 * de;
|
|
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 {
|
|
@@ -283,8 +283,8 @@ function he(e, t) {
|
|
|
283
283
|
itemWidth: (e - n * (a - 1)) / a
|
|
284
284
|
};
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
let r =
|
|
286
|
+
function me(e, t, n) {
|
|
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,
|
|
@@ -292,48 +292,48 @@ function ge(e, t, n) {
|
|
|
292
292
|
};
|
|
293
293
|
return t[r] += i + n.gap, a;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function he(e, t) {
|
|
296
296
|
let n = Array.from({ length: t.columns }, () => 0), r = t.itemWidth + t.gap;
|
|
297
297
|
return e.forEach((e) => {
|
|
298
298
|
let i = r === 0 ? 0 : Math.round(e.x / r);
|
|
299
299
|
i < 0 || i >= t.columns || (n[i] = Math.max(n[i], e.y + e.height + t.gap));
|
|
300
300
|
}), n;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function ge(e, t) {
|
|
303
303
|
return e.length === 0 ? 0 : Math.max(0, Math.max(...e) - t);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
let r =
|
|
305
|
+
function _e(e, t, n) {
|
|
306
|
+
let r = Q(t, n);
|
|
307
307
|
if (!r || e.length === 0) return {
|
|
308
308
|
columns: 0,
|
|
309
309
|
height: 0,
|
|
310
310
|
items: []
|
|
311
311
|
};
|
|
312
|
-
let i = Array.from({ length: r.columns }, () => 0), a = e.map((e) =>
|
|
312
|
+
let i = Array.from({ length: r.columns }, () => 0), a = e.map((e) => me(e, i, r));
|
|
313
313
|
return {
|
|
314
314
|
columns: r.columns,
|
|
315
|
-
height:
|
|
315
|
+
height: ge(i, r.gap),
|
|
316
316
|
items: a
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
let o =
|
|
319
|
+
function ve(e, t, n, r, i, a) {
|
|
320
|
+
let o = Q(t, n);
|
|
321
321
|
if (!o || e.length === 0) return {
|
|
322
322
|
columns: 0,
|
|
323
323
|
height: 0,
|
|
324
324
|
items: []
|
|
325
325
|
};
|
|
326
|
-
if (r.columns !== o.columns || i > 0 && r.items.length < i) return
|
|
327
|
-
let s = Math.max(0, i), c = a?.untilIndex ?? e.length, l = a?.untilBottom, u = a?.throughIndex ?? s, d = s === 0 ? [] : r.items.slice(0, s), f = s === 0 ? Array.from({ length: o.columns }, () => 0) :
|
|
328
|
-
for (let t = s; t < e.length && t < c && !(l !== void 0 && t > s && t > u && f.every((e) => e >= l)); t += 1) d.push(
|
|
326
|
+
if (r.columns !== o.columns || i > 0 && r.items.length < i) return _e(e, t, n);
|
|
327
|
+
let s = Math.max(0, i), c = a?.untilIndex ?? e.length, l = a?.untilBottom, u = a?.throughIndex ?? s, d = s === 0 ? [] : r.items.slice(0, s), f = s === 0 ? Array.from({ length: o.columns }, () => 0) : he(d, o);
|
|
328
|
+
for (let t = s; t < e.length && t < c && !(l !== void 0 && t > s && t > u && f.every((e) => e >= l)); t += 1) d.push(me(e[t], f, o));
|
|
329
329
|
return {
|
|
330
330
|
columns: o.columns,
|
|
331
|
-
height:
|
|
331
|
+
height: ge(f, o.gap),
|
|
332
332
|
items: d
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
function
|
|
336
|
-
let o =
|
|
335
|
+
function ye(e, t, n, r, i, a) {
|
|
336
|
+
let o = Q(t, n);
|
|
337
337
|
if (!o || e.length === 0) return {
|
|
338
338
|
columns: 0,
|
|
339
339
|
fromIndex: 0,
|
|
@@ -342,7 +342,7 @@ function xe(e, t, n, r, i, a) {
|
|
|
342
342
|
retainedIndices: []
|
|
343
343
|
};
|
|
344
344
|
if (r.items.length !== e.length || r.columns !== o.columns) {
|
|
345
|
-
let a = e.map((e, t) => t).filter((e) => !i(e)), o =
|
|
345
|
+
let a = e.map((e, t) => t).filter((e) => !i(e)), o = _e(a.map((t) => e[t]), t, n), s = e.map((e, t) => r.items[t] ?? {
|
|
346
346
|
height: 0,
|
|
347
347
|
width: 0,
|
|
348
348
|
x: 0,
|
|
@@ -367,10 +367,10 @@ function xe(e, t, n, r, i, a) {
|
|
|
367
367
|
};
|
|
368
368
|
let c = r.items.slice(), l = [];
|
|
369
369
|
for (let e = 0; e < s; e += 1) l.push(e);
|
|
370
|
-
let u = a?.untilBottom, d = a?.throughIndex ?? s, f =
|
|
370
|
+
let u = a?.untilBottom, d = a?.throughIndex ?? s, f = he(c.slice(0, s), o);
|
|
371
371
|
for (let t = s; t < e.length; t += 1) if (!i(t)) {
|
|
372
372
|
if (u !== void 0 && l.length > s && t > d && f.every((e) => e >= u)) break;
|
|
373
|
-
c[t] =
|
|
373
|
+
c[t] = me(e[t], f, o), l.push(t);
|
|
374
374
|
}
|
|
375
375
|
let p = new Set(l);
|
|
376
376
|
for (let t = s; t < e.length; t += 1) i(t) || p.has(t) || (c[t] = {
|
|
@@ -382,17 +382,17 @@ function xe(e, t, n, r, i, a) {
|
|
|
382
382
|
return {
|
|
383
383
|
columns: o.columns,
|
|
384
384
|
fromIndex: s,
|
|
385
|
-
height:
|
|
385
|
+
height: ge(f, o.gap),
|
|
386
386
|
items: c,
|
|
387
387
|
retainedIndices: l
|
|
388
388
|
};
|
|
389
389
|
}
|
|
390
390
|
//#endregion
|
|
391
391
|
//#region src/core/masonryViewportIndex.ts
|
|
392
|
-
function
|
|
392
|
+
function be(e) {
|
|
393
393
|
return { columns: [...e.entries()].sort(([e], [t]) => e - t).map(([, e]) => e.sort((e, t) => e.top - t.top || e.index - t.index)) };
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function xe(e, t, n) {
|
|
396
396
|
let r = e.get(t.x) ?? [];
|
|
397
397
|
r.push({
|
|
398
398
|
bottom: t.y + t.height,
|
|
@@ -400,14 +400,14 @@ function Ce(e, t, n) {
|
|
|
400
400
|
top: t.y
|
|
401
401
|
}), e.set(t.x, r);
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Se(e, t) {
|
|
404
404
|
let n = /* @__PURE__ */ new Map();
|
|
405
405
|
return e.forEach((e, r) => {
|
|
406
|
-
|
|
407
|
-
}),
|
|
406
|
+
xe(n, e, t?.[r] ?? r);
|
|
407
|
+
}), be(n);
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
if (n <= 0) return
|
|
409
|
+
function Ce(e, t, n, r) {
|
|
410
|
+
if (n <= 0) return Se(e, r);
|
|
411
411
|
let i = /* @__PURE__ */ new Map();
|
|
412
412
|
t.columns.forEach((t) => {
|
|
413
413
|
t.forEach((t) => {
|
|
@@ -418,11 +418,11 @@ function Te(e, t, n, r) {
|
|
|
418
418
|
a.push(t), i.set(r.x, a);
|
|
419
419
|
});
|
|
420
420
|
});
|
|
421
|
-
for (let t = n; t < e.length; t += 1)
|
|
422
|
-
return
|
|
421
|
+
for (let t = n; t < e.length; t += 1) xe(i, e[t], r?.[t] ?? t);
|
|
422
|
+
return be(i);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
if (r <= 0) return
|
|
424
|
+
function we(e, t, n, r) {
|
|
425
|
+
if (r <= 0) return Se(t.map((t) => e[t]), t);
|
|
426
426
|
let i = /* @__PURE__ */ new Map();
|
|
427
427
|
return n.columns.forEach((t) => {
|
|
428
428
|
t.forEach((t) => {
|
|
@@ -433,10 +433,10 @@ function Ee(e, t, n, r) {
|
|
|
433
433
|
a.push(t), i.set(n.x, a);
|
|
434
434
|
});
|
|
435
435
|
}), t.forEach((t) => {
|
|
436
|
-
t < r ||
|
|
437
|
-
}),
|
|
436
|
+
t < r || xe(i, e[t], t);
|
|
437
|
+
}), be(i);
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function Te(e, t) {
|
|
440
440
|
let n = 0, r = 0, i = e.length;
|
|
441
441
|
for (; r < i;) {
|
|
442
442
|
let a = Math.floor((r + i) / 2);
|
|
@@ -447,10 +447,10 @@ function De(e, t) {
|
|
|
447
447
|
inspected: n
|
|
448
448
|
};
|
|
449
449
|
}
|
|
450
|
-
function
|
|
450
|
+
function Ee(e, t) {
|
|
451
451
|
let n = Math.max(0, t.overscan), r = t.scrollTop - n, i = t.scrollTop + Math.max(0, t.viewportHeight) + n, a = [], o = 0;
|
|
452
452
|
return e.columns.forEach((e) => {
|
|
453
|
-
let t =
|
|
453
|
+
let t = Te(e, r);
|
|
454
454
|
o += t.inspected;
|
|
455
455
|
for (let n = t.index; n < e.length; n += 1) {
|
|
456
456
|
let t = e[n];
|
|
@@ -462,14 +462,14 @@ function Oe(e, t) {
|
|
|
462
462
|
inspected: o
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function De(e) {
|
|
466
466
|
return e?.minColumnWidth ?? 240;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function Oe(e, t) {
|
|
469
469
|
let n = e?.overscan?.minimumPx ?? 800, r = e?.overscan?.viewportMultiplier ?? 1.5, i = Math.max(n, t * r), a = e?.overscan?.maximumPx;
|
|
470
470
|
return a === void 0 ? i : Math.min(i, a);
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function ke(e) {
|
|
473
473
|
for (let t of ["bottomSpacePx", "loadMoreThresholdPx"]) {
|
|
474
474
|
let n = e?.[t];
|
|
475
475
|
if (n !== void 0 && (!Number.isFinite(n) || n < 0)) throw TypeError(`Vibe masonry ${t} must be a finite non-negative number.`);
|
|
@@ -487,10 +487,10 @@ function je(e) {
|
|
|
487
487
|
}
|
|
488
488
|
//#endregion
|
|
489
489
|
//#region src/core/scrollbar.ts
|
|
490
|
-
function
|
|
490
|
+
function Ae(e, t, n) {
|
|
491
491
|
return Math.min(n, Math.max(t, e));
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function je({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize: r, viewportSize: i }) {
|
|
494
494
|
let a = Math.max(0, e), o = Math.max(0, r), s = Math.max(0, i), c = Math.max(0, a - s);
|
|
495
495
|
if (!(c > 0 && o > 0)) return {
|
|
496
496
|
maximumScrollPosition: c,
|
|
@@ -499,23 +499,23 @@ function Ne({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize:
|
|
|
499
499
|
thumbSize: o,
|
|
500
500
|
thumbTravel: 0
|
|
501
501
|
};
|
|
502
|
-
let l =
|
|
502
|
+
let l = Ae(s / a * o, Math.min(Math.max(0, t), o), o), u = Math.max(0, o - l);
|
|
503
503
|
return {
|
|
504
504
|
maximumScrollPosition: c,
|
|
505
505
|
scrollable: !0,
|
|
506
|
-
thumbOffset: u * (
|
|
506
|
+
thumbOffset: u * (Ae(n, 0, c) / c),
|
|
507
507
|
thumbSize: l,
|
|
508
508
|
thumbTravel: u
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
511
|
//#endregion
|
|
512
512
|
//#region src/components/GalleryScrollbar.vue?vue&type=script&setup=true&lang.ts
|
|
513
|
-
var
|
|
513
|
+
var Me = ["aria-hidden"], Ne = [
|
|
514
514
|
"aria-controls",
|
|
515
515
|
"aria-valuemax",
|
|
516
516
|
"aria-valuenow",
|
|
517
517
|
"tabindex"
|
|
518
|
-
],
|
|
518
|
+
], Pe = 32, Fe = 40, Ie = 120, Le = /* @__PURE__ */ d({
|
|
519
519
|
__name: "GalleryScrollbar",
|
|
520
520
|
props: {
|
|
521
521
|
contentSize: {},
|
|
@@ -530,23 +530,23 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
530
530
|
thumbOffset: 0,
|
|
531
531
|
thumbSize: 0,
|
|
532
532
|
thumbTravel: 0
|
|
533
|
-
}, i =
|
|
533
|
+
}, i = w(null), a = w(n), o = w(!1), l = w(!1), u = w(!1), d = null, f = 0, p = 0, g = null, y = null, x = null, S = null, C = !1, T = null, E = r(() => a.value.scrollable && !t.suspended), D = r(() => ({
|
|
534
534
|
height: `${a.value.thumbSize}px`,
|
|
535
535
|
transform: `translate3d(0, ${a.value.thumbOffset}px, 0)`
|
|
536
536
|
}));
|
|
537
|
-
function O() {
|
|
538
|
-
m !== null && clearTimeout(m), m = setTimeout(() => {
|
|
539
|
-
m = null, o.value || (l.value = !1);
|
|
540
|
-
}, Re);
|
|
541
|
-
}
|
|
542
537
|
function k() {
|
|
543
|
-
|
|
538
|
+
g !== null && clearTimeout(g), g = setTimeout(() => {
|
|
539
|
+
g = null, o.value || (l.value = !1);
|
|
540
|
+
}, Ie);
|
|
541
|
+
}
|
|
542
|
+
function A() {
|
|
543
|
+
l.value = !0, k();
|
|
544
544
|
}
|
|
545
545
|
function j() {
|
|
546
546
|
let e = t.scrollElement, r = i.value;
|
|
547
|
-
return !e || !r ? n :
|
|
547
|
+
return !e || !r ? n : je({
|
|
548
548
|
contentSize: e.scrollHeight,
|
|
549
|
-
minimumThumbSize:
|
|
549
|
+
minimumThumbSize: Pe,
|
|
550
550
|
scrollPosition: e.scrollTop,
|
|
551
551
|
trackSize: r.clientHeight,
|
|
552
552
|
viewportSize: e.clientHeight
|
|
@@ -567,27 +567,27 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
567
567
|
};
|
|
568
568
|
return;
|
|
569
569
|
}
|
|
570
|
-
a.value = j(), !(u.value ||
|
|
571
|
-
|
|
570
|
+
a.value = j(), !(u.value || y !== null) && (y = requestAnimationFrame(() => {
|
|
571
|
+
y = null, u.value = !0;
|
|
572
572
|
}));
|
|
573
573
|
}
|
|
574
574
|
function N() {
|
|
575
|
-
|
|
575
|
+
A(), M("scroll");
|
|
576
576
|
}
|
|
577
577
|
function P(e) {
|
|
578
578
|
let n = t.scrollElement;
|
|
579
579
|
n && (n.scrollTop = Math.min(a.value.maximumScrollPosition, Math.max(0, e)), M("scroll"));
|
|
580
580
|
}
|
|
581
581
|
function F(e) {
|
|
582
|
-
if (!
|
|
582
|
+
if (!E.value || e.target !== e.currentTarget) return;
|
|
583
583
|
let t = i.value;
|
|
584
584
|
if (!t || a.value.thumbTravel <= 0) return;
|
|
585
|
-
e.preventDefault(),
|
|
585
|
+
e.preventDefault(), A();
|
|
586
586
|
let n = e.clientY - t.getBoundingClientRect().top - a.value.thumbSize / 2;
|
|
587
587
|
P(Math.min(1, Math.max(0, n / a.value.thumbTravel)) * a.value.maximumScrollPosition);
|
|
588
588
|
}
|
|
589
589
|
function I(e) {
|
|
590
|
-
|
|
590
|
+
E.value && (e.preventDefault(), e.stopPropagation(), e.currentTarget.setPointerCapture?.(e.pointerId), d = e.pointerId, f = e.clientY, p = t.scrollElement?.scrollTop ?? 0, o.value = !0, l.value = !0, g !== null && clearTimeout(g), g = null);
|
|
591
591
|
}
|
|
592
592
|
function L(e) {
|
|
593
593
|
if (!o.value || e.pointerId !== d || (e.preventDefault(), a.value.thumbTravel <= 0)) return;
|
|
@@ -595,12 +595,12 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
595
595
|
P(p + t);
|
|
596
596
|
}
|
|
597
597
|
function R(e) {
|
|
598
|
-
!o.value || e.pointerId !== d || (e.currentTarget.releasePointerCapture?.(e.pointerId), d = null, o.value = !1, C && (C = !1, M("content")),
|
|
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
600
|
function z(e) {
|
|
601
|
-
if (!
|
|
602
|
-
let n = t.scrollElement?.clientHeight ?? 0, r = t.scrollElement?.scrollTop ?? 0, i = e.key === "ArrowUp" ? r -
|
|
603
|
-
i !== null && (e.preventDefault(),
|
|
601
|
+
if (!E.value) return;
|
|
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
|
+
i !== null && (e.preventDefault(), A(), P(i));
|
|
604
604
|
}
|
|
605
605
|
function B(e) {
|
|
606
606
|
if (S?.disconnect(), !(typeof ResizeObserver > "u")) {
|
|
@@ -608,26 +608,26 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
608
608
|
for (let t of e.children) S.observe(t);
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
return
|
|
612
|
-
t?.removeEventListener("scroll", N),
|
|
613
|
-
|
|
614
|
-
}),
|
|
611
|
+
return O(() => t.scrollElement, (e, t) => {
|
|
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
|
+
A(), M("resize");
|
|
614
|
+
}), T.observe(e), B(e)), e && typeof MutationObserver < "u" && (x = new MutationObserver(() => {
|
|
615
615
|
B(e), M("content");
|
|
616
|
-
}),
|
|
617
|
-
}, { immediate: !0 }),
|
|
618
|
-
|
|
619
|
-
}),
|
|
620
|
-
t.scrollElement?.removeEventListener("scroll", N),
|
|
621
|
-
}), (t, n) => (
|
|
616
|
+
}), x.observe(e, { childList: !0 })), m(() => M("resize"));
|
|
617
|
+
}, { immediate: !0 }), O(() => t.contentSize, () => {
|
|
618
|
+
m(() => M("content"));
|
|
619
|
+
}), v(() => {
|
|
620
|
+
t.scrollElement?.removeEventListener("scroll", N), x?.disconnect(), S?.disconnect(), T?.disconnect(), g !== null && clearTimeout(g), y !== null && cancelAnimationFrame(y);
|
|
621
|
+
}), (t, n) => (b(), s("div", {
|
|
622
622
|
ref_key: "trackElement",
|
|
623
623
|
ref: i,
|
|
624
|
-
class:
|
|
624
|
+
class: h(["gallery-scrollbar", {
|
|
625
625
|
"gallery-scrollbar--dragging": o.value,
|
|
626
626
|
"gallery-scrollbar--interacting": l.value,
|
|
627
627
|
"gallery-scrollbar--ready": u.value,
|
|
628
|
-
"gallery-scrollbar--visible":
|
|
628
|
+
"gallery-scrollbar--visible": E.value
|
|
629
629
|
}]),
|
|
630
|
-
"aria-hidden": !
|
|
630
|
+
"aria-hidden": !E.value || void 0,
|
|
631
631
|
onPointerdown: F
|
|
632
632
|
}, [c("div", {
|
|
633
633
|
class: "gallery-scrollbar-thumb",
|
|
@@ -638,22 +638,22 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
638
638
|
"aria-valuemin": "0",
|
|
639
639
|
"aria-valuenow": Math.round(e.scrollElement?.scrollTop ?? 0),
|
|
640
640
|
role: "scrollbar",
|
|
641
|
-
style:
|
|
642
|
-
tabindex:
|
|
641
|
+
style: _(D.value),
|
|
642
|
+
tabindex: E.value ? 0 : -1,
|
|
643
643
|
onKeydown: z,
|
|
644
644
|
onPointercancel: R,
|
|
645
645
|
onPointerdown: I,
|
|
646
646
|
onPointermove: L,
|
|
647
647
|
onPointerup: R
|
|
648
|
-
}, null, 44,
|
|
648
|
+
}, null, 44, Ne)], 42, Me));
|
|
649
649
|
}
|
|
650
|
-
}),
|
|
650
|
+
}), Re = (e) => {
|
|
651
651
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
652
652
|
return !1;
|
|
653
|
-
},
|
|
654
|
-
let t =
|
|
653
|
+
}, ze = (e) => e === "", Be = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), Ve = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), He = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), Ue = (e) => {
|
|
654
|
+
let t = He(e);
|
|
655
655
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
656
|
-
},
|
|
656
|
+
}, We = {
|
|
657
657
|
xmlns: "http://www.w3.org/2000/svg",
|
|
658
658
|
width: 24,
|
|
659
659
|
height: 24,
|
|
@@ -663,27 +663,27 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
663
663
|
"stroke-width": 2,
|
|
664
664
|
"stroke-linecap": "round",
|
|
665
665
|
"stroke-linejoin": "round"
|
|
666
|
-
},
|
|
667
|
-
...
|
|
666
|
+
}, Ge = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = We.width, color: s = We.stroke, ...c }, { slots: l }) => p("svg", {
|
|
667
|
+
...We,
|
|
668
668
|
...c,
|
|
669
669
|
width: o,
|
|
670
670
|
height: o,
|
|
671
671
|
stroke: s,
|
|
672
|
-
"stroke-width":
|
|
673
|
-
class:
|
|
674
|
-
...!l.default && !
|
|
675
|
-
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]),
|
|
672
|
+
"stroke-width": ze(n) || ze(r) || n === !0 || r === !0 ? Number(i || a || We["stroke-width"]) * 24 / Number(o) : i || a || We["stroke-width"],
|
|
673
|
+
class: Be("lucide", c.class, ...e ? [`lucide-${Ve(Ue(e))}-icon`, `lucide-${Ve(e)}`] : ["lucide-icon"]),
|
|
674
|
+
...!l.default && !Re(c) && { "aria-hidden": "true" }
|
|
675
|
+
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), Ke = (e, t) => (n, { slots: r, attrs: i }) => p(Ge, {
|
|
676
676
|
...i,
|
|
677
677
|
...n,
|
|
678
678
|
iconNode: t,
|
|
679
679
|
name: e
|
|
680
|
-
}, r),
|
|
680
|
+
}, r), qe = Ke("chevron-left", [["path", {
|
|
681
681
|
d: "m15 18-6-6 6-6",
|
|
682
682
|
key: "1wnfg3"
|
|
683
|
-
}]]),
|
|
683
|
+
}]]), Je = Ke("chevron-right", [["path", {
|
|
684
684
|
d: "m9 18 6-6-6-6",
|
|
685
685
|
key: "mthhwq"
|
|
686
|
-
}]]),
|
|
686
|
+
}]]), Ye = Ke("disc-3", [
|
|
687
687
|
["circle", {
|
|
688
688
|
cx: "12",
|
|
689
689
|
cy: "12",
|
|
@@ -704,7 +704,7 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
704
704
|
d: "M18 12c0 1.7-.7 3.2-1.8 4.2",
|
|
705
705
|
key: "1eah9h"
|
|
706
706
|
}]
|
|
707
|
-
]),
|
|
707
|
+
]), Xe = Ke("pause", [["rect", {
|
|
708
708
|
x: "14",
|
|
709
709
|
y: "3",
|
|
710
710
|
width: "5",
|
|
@@ -718,10 +718,10 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
718
718
|
height: "18",
|
|
719
719
|
rx: "1",
|
|
720
720
|
key: "1wsw3u"
|
|
721
|
-
}]]),
|
|
721
|
+
}]]), Ze = Ke("play", [["path", {
|
|
722
722
|
d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
|
|
723
723
|
key: "10ikf1"
|
|
724
|
-
}]]),
|
|
724
|
+
}]]), Qe = Ke("volume-2", [
|
|
725
725
|
["path", {
|
|
726
726
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
727
727
|
key: "uqj9uw"
|
|
@@ -734,7 +734,7 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
734
734
|
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
735
735
|
key: "ijwkga"
|
|
736
736
|
}]
|
|
737
|
-
]),
|
|
737
|
+
]), $e = Ke("volume-x", [
|
|
738
738
|
["path", {
|
|
739
739
|
d: "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",
|
|
740
740
|
key: "uqj9uw"
|
|
@@ -753,22 +753,22 @@ var Pe = ["aria-hidden"], Fe = [
|
|
|
753
753
|
y2: "15",
|
|
754
754
|
key: "5ykzw1"
|
|
755
755
|
}]
|
|
756
|
-
]),
|
|
756
|
+
]), et = {
|
|
757
757
|
401: "Authentication required",
|
|
758
758
|
403: "Access forbidden",
|
|
759
759
|
404: "Preview not found",
|
|
760
760
|
419: "Session expired",
|
|
761
761
|
500: "Server error"
|
|
762
762
|
};
|
|
763
|
-
function
|
|
763
|
+
function tt(e) {
|
|
764
764
|
return e.match(/\/demo-errors\/(401|403|404|419|500)\//)?.[1] ?? "Error";
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
return
|
|
766
|
+
function nt(e) {
|
|
767
|
+
return et[tt(e)] ?? "Preview unavailable";
|
|
768
768
|
}
|
|
769
769
|
//#endregion
|
|
770
770
|
//#region src/components/CardRegion.vue
|
|
771
|
-
var
|
|
771
|
+
var rt = /* @__PURE__ */ d({
|
|
772
772
|
__name: "CardRegion",
|
|
773
773
|
props: {
|
|
774
774
|
index: {},
|
|
@@ -783,17 +783,17 @@ var at = /* @__PURE__ */ d({
|
|
|
783
783
|
total: {}
|
|
784
784
|
},
|
|
785
785
|
setup(e) {
|
|
786
|
-
let t = e, n = r(() =>
|
|
786
|
+
let t = e, n = r(() => H(t.item, t.mediaIndex)), i = r(() => V(t.item)), o = r(() => U(t.item, n.value)), c = r(() => ({
|
|
787
787
|
height: `${t.region.height}px`,
|
|
788
788
|
paddingBlock: t.style?.paddingY === void 0 ? void 0 : `${t.style.paddingY}px`,
|
|
789
789
|
paddingInline: t.style?.paddingX === void 0 ? void 0 : `${t.style.paddingX}px`
|
|
790
790
|
})), l = r(() => t.style?.background ?? t.region.background);
|
|
791
|
-
return (t, r) => (
|
|
792
|
-
class:
|
|
793
|
-
style:
|
|
794
|
-
onClick: r[0] ||=
|
|
795
|
-
onKeydown: r[1] ||=
|
|
796
|
-
}, [(
|
|
791
|
+
return (t, r) => (b(), s("div", {
|
|
792
|
+
class: h(["media-card-region", [`media-card-${e.placement}`, { "media-card-region--transparent": l.value === "transparent" }]]),
|
|
793
|
+
style: _(c.value),
|
|
794
|
+
onClick: r[0] ||= j(() => {}, ["stop"]),
|
|
795
|
+
onKeydown: r[1] ||= j(() => {}, ["stop"])
|
|
796
|
+
}, [(b(), a(C(e.region.component), {
|
|
797
797
|
index: e.index,
|
|
798
798
|
item: e.item,
|
|
799
799
|
layout: e.layout,
|
|
@@ -815,7 +815,7 @@ var at = /* @__PURE__ */ d({
|
|
|
815
815
|
"total"
|
|
816
816
|
]))], 38));
|
|
817
817
|
}
|
|
818
|
-
}),
|
|
818
|
+
}), it = ["aria-busy", "aria-label"], at = { class: "media-error-code" }, ot = ["disabled"], st = /* @__PURE__ */ d({
|
|
819
819
|
__name: "MediaError",
|
|
820
820
|
props: {
|
|
821
821
|
component: {},
|
|
@@ -829,18 +829,18 @@ var at = /* @__PURE__ */ d({
|
|
|
829
829
|
function o() {
|
|
830
830
|
r.retrying || i("retry");
|
|
831
831
|
}
|
|
832
|
-
return (n, r) => (
|
|
832
|
+
return (n, r) => (b(), s("div", {
|
|
833
833
|
"data-test": "media-error",
|
|
834
834
|
class: "media-error",
|
|
835
835
|
role: "group",
|
|
836
836
|
"aria-busy": t.retrying,
|
|
837
837
|
"aria-label": `${t.status} ${t.label}`
|
|
838
|
-
}, [t.component ? (
|
|
838
|
+
}, [t.component ? (b(), s("div", {
|
|
839
839
|
key: 0,
|
|
840
840
|
class: "media-error-component",
|
|
841
|
-
onClick: r[0] ||=
|
|
842
|
-
onKeydown: r[1] ||=
|
|
843
|
-
}, [(
|
|
841
|
+
onClick: r[0] ||= j(() => {}, ["stop"]),
|
|
842
|
+
onKeydown: r[1] ||= j(() => {}, ["stop"])
|
|
843
|
+
}, [(b(), a(C(t.component), {
|
|
844
844
|
label: t.label,
|
|
845
845
|
retry: o,
|
|
846
846
|
retrying: t.retrying,
|
|
@@ -849,36 +849,36 @@ var at = /* @__PURE__ */ d({
|
|
|
849
849
|
"label",
|
|
850
850
|
"retrying",
|
|
851
851
|
"status"
|
|
852
|
-
]))], 32)) : (
|
|
853
|
-
c("strong",
|
|
854
|
-
c("span", null,
|
|
852
|
+
]))], 32)) : (b(), s(e, { key: 1 }, [
|
|
853
|
+
c("strong", at, T(t.status), 1),
|
|
854
|
+
c("span", null, T(t.label), 1),
|
|
855
855
|
c("button", {
|
|
856
856
|
"data-test": "media-retry",
|
|
857
857
|
class: "media-error-retry",
|
|
858
858
|
type: "button",
|
|
859
859
|
disabled: t.retrying,
|
|
860
|
-
onClick:
|
|
861
|
-
onKeydown: r[2] ||=
|
|
862
|
-
},
|
|
863
|
-
], 64))], 8,
|
|
860
|
+
onClick: j(o, ["stop"]),
|
|
861
|
+
onKeydown: r[2] ||= j(() => {}, ["stop"])
|
|
862
|
+
}, T(t.retrying ? "Retrying…" : "Retry"), 41, ot)
|
|
863
|
+
], 64))], 8, it));
|
|
864
864
|
}
|
|
865
|
-
}),
|
|
865
|
+
}), ct = ["aria-label"], lt = [
|
|
866
866
|
"max",
|
|
867
867
|
"value",
|
|
868
868
|
"aria-label",
|
|
869
869
|
"aria-valuetext",
|
|
870
870
|
"disabled"
|
|
871
|
-
],
|
|
871
|
+
], ut = {
|
|
872
872
|
key: 0,
|
|
873
873
|
class: "media-controls-row"
|
|
874
|
-
},
|
|
874
|
+
}, dt = ["aria-label", "title"], ft = { class: "media-controls-audio" }, pt = ["aria-label", "title"], mt = [
|
|
875
875
|
"value",
|
|
876
876
|
"aria-label",
|
|
877
877
|
"aria-valuetext"
|
|
878
|
-
],
|
|
878
|
+
], ht = {
|
|
879
879
|
class: "media-control-time",
|
|
880
880
|
"aria-live": "off"
|
|
881
|
-
},
|
|
881
|
+
}, gt = /* @__PURE__ */ d({
|
|
882
882
|
__name: "MediaControls",
|
|
883
883
|
props: {
|
|
884
884
|
currentTime: {},
|
|
@@ -910,75 +910,75 @@ var at = /* @__PURE__ */ d({
|
|
|
910
910
|
function f(e) {
|
|
911
911
|
e.key !== "Escape" && e.stopPropagation();
|
|
912
912
|
}
|
|
913
|
-
let p = r(() => Math.max(0, n.duration)), m = r(() => n.mediaType === "audio" ? "audio" : "video"),
|
|
914
|
-
return (t, n) => (
|
|
915
|
-
class:
|
|
913
|
+
let p = r(() => Math.max(0, n.duration)), m = r(() => n.mediaType === "audio" ? "audio" : "video"), g = r(() => n.mediaType === "audio" ? "Audio" : "Video"), v = r(() => l(n.currentTime, p.value)), y = r(() => ({ "--media-range-progress": `${p.value > 0 ? v.value / p.value * 100 : 0}%` })), x = r(() => ({ "--media-range-progress": `${l(n.volume) * 100}%` }));
|
|
914
|
+
return (t, n) => (b(), s("div", {
|
|
915
|
+
class: h(["media-controls", `media-controls--${e.layout}`]),
|
|
916
916
|
role: "group",
|
|
917
|
-
"aria-label": `${
|
|
918
|
-
onClick: n[4] ||=
|
|
919
|
-
onDblclick: n[5] ||=
|
|
917
|
+
"aria-label": `${g.value} controls`,
|
|
918
|
+
onClick: n[4] ||= j(() => {}, ["stop"]),
|
|
919
|
+
onDblclick: n[5] ||= j(() => {}, ["stop"]),
|
|
920
920
|
onKeydown: f,
|
|
921
|
-
onWheel: n[6] ||=
|
|
921
|
+
onWheel: n[6] ||= j(() => {}, ["stop"])
|
|
922
922
|
}, [c("input", {
|
|
923
923
|
class: "media-control-range media-control-seek",
|
|
924
924
|
type: "range",
|
|
925
925
|
min: "0",
|
|
926
926
|
max: p.value || 0,
|
|
927
927
|
step: "0.1",
|
|
928
|
-
value:
|
|
929
|
-
style:
|
|
928
|
+
value: v.value,
|
|
929
|
+
style: _(y.value),
|
|
930
930
|
"aria-label": `Seek ${m.value}`,
|
|
931
|
-
"aria-valuetext": `${u(
|
|
931
|
+
"aria-valuetext": `${u(v.value)} of ${u(p.value)}`,
|
|
932
932
|
disabled: p.value <= 0,
|
|
933
933
|
onInput: n[0] ||= (e) => i("seek", d(e))
|
|
934
|
-
}, null, 44,
|
|
934
|
+
}, null, 44, lt), e.layout === "reel" ? (b(), s("div", ut, [
|
|
935
935
|
c("button", {
|
|
936
936
|
type: "button",
|
|
937
937
|
class: "media-control-button media-control-playback",
|
|
938
938
|
"aria-label": e.playing ? `Pause ${m.value}` : `Play ${m.value}`,
|
|
939
939
|
title: e.playing ? "Pause" : "Play",
|
|
940
940
|
onClick: n[1] ||= (e) => i("togglePlayback")
|
|
941
|
-
}, [e.playing ? (
|
|
941
|
+
}, [e.playing ? (b(), a(E(Xe), {
|
|
942
942
|
key: 0,
|
|
943
943
|
size: 18,
|
|
944
944
|
fill: "currentColor"
|
|
945
|
-
})) : (
|
|
945
|
+
})) : (b(), a(E(Ze), {
|
|
946
946
|
key: 1,
|
|
947
947
|
size: 18,
|
|
948
948
|
fill: "currentColor"
|
|
949
|
-
}))], 8,
|
|
950
|
-
c("div",
|
|
949
|
+
}))], 8, dt),
|
|
950
|
+
c("div", ft, [c("button", {
|
|
951
951
|
type: "button",
|
|
952
952
|
class: "media-control-button",
|
|
953
953
|
"aria-label": e.muted ? `Unmute ${m.value}` : `Mute ${m.value}`,
|
|
954
954
|
title: e.muted ? "Unmute" : "Mute",
|
|
955
955
|
onClick: n[2] ||= (e) => i("toggleMute")
|
|
956
|
-
}, [e.muted || e.volume === 0 ? (
|
|
956
|
+
}, [e.muted || e.volume === 0 ? (b(), a(E($e), {
|
|
957
957
|
key: 0,
|
|
958
958
|
size: 18
|
|
959
|
-
})) : (
|
|
959
|
+
})) : (b(), a(E(Qe), {
|
|
960
960
|
key: 1,
|
|
961
961
|
size: 18
|
|
962
|
-
}))], 8,
|
|
962
|
+
}))], 8, pt), c("input", {
|
|
963
963
|
class: "media-control-range media-control-volume",
|
|
964
964
|
type: "range",
|
|
965
965
|
min: "0",
|
|
966
966
|
max: "1",
|
|
967
967
|
step: "0.05",
|
|
968
968
|
value: e.volume,
|
|
969
|
-
style:
|
|
970
|
-
"aria-label": `${
|
|
969
|
+
style: _(x.value),
|
|
970
|
+
"aria-label": `${g.value} volume`,
|
|
971
971
|
"aria-valuetext": `${Math.round(e.volume * 100)} percent`,
|
|
972
972
|
onInput: n[3] ||= (e) => i("volumeChange", d(e))
|
|
973
|
-
}, null, 44,
|
|
974
|
-
c("output",
|
|
975
|
-
])) : o("", !0)], 42,
|
|
973
|
+
}, null, 44, mt)]),
|
|
974
|
+
c("output", ht, T(u(v.value)) + " / " + T(u(p.value)), 1)
|
|
975
|
+
])) : o("", !0)], 42, ct));
|
|
976
976
|
}
|
|
977
|
-
}),
|
|
977
|
+
}), _t = {
|
|
978
978
|
key: 0,
|
|
979
979
|
class: "media-card-overlay-host",
|
|
980
980
|
"data-test": "media-card-overlay"
|
|
981
|
-
},
|
|
981
|
+
}, vt = /* @__PURE__ */ d({
|
|
982
982
|
__name: "MediaContextOverlay",
|
|
983
983
|
props: {
|
|
984
984
|
item: {},
|
|
@@ -988,7 +988,7 @@ var at = /* @__PURE__ */ d({
|
|
|
988
988
|
mediaSource: {}
|
|
989
989
|
},
|
|
990
990
|
setup(e) {
|
|
991
|
-
return (t, n) => e.mediaCard?.overlay?.component ? (
|
|
991
|
+
return (t, n) => e.mediaCard?.overlay?.component ? (b(), s("div", _t, [(b(), a(C(e.mediaCard.overlay.component), {
|
|
992
992
|
item: e.item,
|
|
993
993
|
"media-index": e.mediaIndex,
|
|
994
994
|
"media-item": e.mediaItem,
|
|
@@ -1000,26 +1000,26 @@ var at = /* @__PURE__ */ d({
|
|
|
1000
1000
|
"media-source"
|
|
1001
1001
|
]))])) : o("", !0);
|
|
1002
1002
|
}
|
|
1003
|
-
}),
|
|
1004
|
-
function
|
|
1005
|
-
let t =
|
|
1003
|
+
}), yt = 40, bt = 160, xt = 24;
|
|
1004
|
+
function St(e) {
|
|
1005
|
+
let t = w("next"), n = null, r = 0, i = !1, a = null, o = null;
|
|
1006
1006
|
function s(n, r) {
|
|
1007
|
-
let i =
|
|
1007
|
+
let i = V(e.item()).length, a = (n + i) % i;
|
|
1008
1008
|
a !== e.mediaIndex() && (t.value = n < e.mediaIndex() ? "previous" : "next", e.onChange(a), r?.detail && r.detail > 0 && r.currentTarget?.blur());
|
|
1009
1009
|
}
|
|
1010
1010
|
function c() {
|
|
1011
1011
|
r = 0, i = !1, n !== null && clearTimeout(n), n = null;
|
|
1012
1012
|
}
|
|
1013
1013
|
function l() {
|
|
1014
|
-
n !== null && clearTimeout(n), n = setTimeout(c,
|
|
1014
|
+
n !== null && clearTimeout(n), n = setTimeout(c, bt);
|
|
1015
1015
|
}
|
|
1016
1016
|
function u(e, t, n) {
|
|
1017
1017
|
return t === 1 ? e * 16 : t === 2 ? e * n : e;
|
|
1018
1018
|
}
|
|
1019
1019
|
function d(t) {
|
|
1020
|
-
if (
|
|
1020
|
+
if (V(e.item()).length <= 1) return;
|
|
1021
1021
|
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) <
|
|
1022
|
+
if (a === 0 || (t.preventDefault(), l(), i) || (r += a, Math.abs(r) < xt)) return;
|
|
1023
1023
|
let o = Math.sign(r);
|
|
1024
1024
|
r = 0, i = !0, s(e.mediaIndex() + o);
|
|
1025
1025
|
}
|
|
@@ -1031,9 +1031,9 @@ function wt(e) {
|
|
|
1031
1031
|
let n = t.changedTouches[0];
|
|
1032
1032
|
if (a === null || o === null || !n) return;
|
|
1033
1033
|
let r = a - n.clientX, i = o - n.clientY;
|
|
1034
|
-
a = null, o = null, !(Math.abs(r) <= Math.abs(i)) && (Math.abs(r) <
|
|
1034
|
+
a = null, o = null, !(Math.abs(r) <= Math.abs(i)) && (Math.abs(r) < yt || s(e.mediaIndex() + Math.sign(r)));
|
|
1035
1035
|
}
|
|
1036
|
-
return
|
|
1036
|
+
return v(c), {
|
|
1037
1037
|
change: s,
|
|
1038
1038
|
direction: t,
|
|
1039
1039
|
onTouchEnd: p,
|
|
@@ -1041,14 +1041,14 @@ function wt(e) {
|
|
|
1041
1041
|
onWheel: d
|
|
1042
1042
|
};
|
|
1043
1043
|
}
|
|
1044
|
-
var
|
|
1045
|
-
function
|
|
1044
|
+
var Ct = /* @__PURE__ */ new Map(), wt = [], Tt = 0, Et = 0;
|
|
1045
|
+
function Dt(e, t) {
|
|
1046
1046
|
return `${t ? "timed" : "image"}:${e}`;
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1049
|
-
let r =
|
|
1048
|
+
function Ot(e, t, n) {
|
|
1049
|
+
let r = V(e);
|
|
1050
1050
|
if (r.length < 2) return [];
|
|
1051
|
-
let i =
|
|
1051
|
+
let i = H(e, t), a = [];
|
|
1052
1052
|
for (let e = 1; e < r.length; e += 1) {
|
|
1053
1053
|
let t = i + e, n = i - e;
|
|
1054
1054
|
t < r.length && a.push(t), n >= 0 && a.push(n);
|
|
@@ -1057,9 +1057,9 @@ function At(e, t, n) {
|
|
|
1057
1057
|
return a.flatMap((e) => {
|
|
1058
1058
|
let t = r[e];
|
|
1059
1059
|
if (!t) return [];
|
|
1060
|
-
let i =
|
|
1060
|
+
let i = I(t.type, t.src) === "audio" ? B(t) : z(t, n);
|
|
1061
1061
|
if (!i) return [];
|
|
1062
|
-
let a =
|
|
1062
|
+
let a = L(i.type, i.src), s = Dt(i.src, a);
|
|
1063
1063
|
return o.has(s) ? [] : (o.add(s), [{
|
|
1064
1064
|
key: s,
|
|
1065
1065
|
src: i.src,
|
|
@@ -1067,22 +1067,22 @@ function At(e, t, n) {
|
|
|
1067
1067
|
}]);
|
|
1068
1068
|
});
|
|
1069
1069
|
}
|
|
1070
|
-
function
|
|
1070
|
+
function kt(e) {
|
|
1071
1071
|
let t = e.element;
|
|
1072
1072
|
e.element = null, t && (t instanceof HTMLVideoElement ? (t.pause(), t.removeAttribute("src"), t.load()) : t.removeAttribute("src"));
|
|
1073
1073
|
}
|
|
1074
|
-
function
|
|
1075
|
-
|
|
1076
|
-
let t =
|
|
1077
|
-
t >= 0 &&
|
|
1074
|
+
function At(e) {
|
|
1075
|
+
Ct.delete(e.key);
|
|
1076
|
+
let t = wt.indexOf(e);
|
|
1077
|
+
t >= 0 && wt.splice(t, 1), e.cancel?.(), e.cancel = null, kt(e);
|
|
1078
1078
|
}
|
|
1079
|
-
function
|
|
1080
|
-
e.state = "loading",
|
|
1079
|
+
function jt(e) {
|
|
1080
|
+
e.state = "loading", Tt += 1, e.timed && (Et += 1);
|
|
1081
1081
|
let t = !1, n = () => void 0, r = (r) => {
|
|
1082
|
-
t || (t = !0, n(), --
|
|
1082
|
+
t || (t = !0, n(), --Tt, e.timed && --Et, e.cancel = null, e.state = r, r === "failed" && kt(e), e.refs === 0 && At(e), Mt());
|
|
1083
1083
|
};
|
|
1084
1084
|
if (e.cancel = () => {
|
|
1085
|
-
t || (t = !0, n(), --
|
|
1085
|
+
t || (t = !0, n(), --Tt, e.timed && --Et, kt(e), Mt());
|
|
1086
1086
|
}, e.timed) {
|
|
1087
1087
|
let t = document.createElement("video"), i = () => r("ready"), a = () => r("failed");
|
|
1088
1088
|
n = () => {
|
|
@@ -1101,50 +1101,50 @@ function Nt(e) {
|
|
|
1101
1101
|
i.removeEventListener("load", a), i.removeEventListener("error", o);
|
|
1102
1102
|
}, 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
1103
|
}
|
|
1104
|
-
function
|
|
1105
|
-
for (;
|
|
1106
|
-
let e =
|
|
1104
|
+
function Mt() {
|
|
1105
|
+
for (; Tt < 6;) {
|
|
1106
|
+
let e = wt.findIndex((e) => e.refs > 0 && e.state === "queued" && (!e.timed || Et < 2));
|
|
1107
1107
|
if (e < 0) return;
|
|
1108
|
-
let [t] =
|
|
1109
|
-
t &&
|
|
1108
|
+
let [t] = wt.splice(e, 1);
|
|
1109
|
+
t && jt(t);
|
|
1110
1110
|
}
|
|
1111
1111
|
}
|
|
1112
|
-
function
|
|
1113
|
-
let t =
|
|
1112
|
+
function Nt(e) {
|
|
1113
|
+
let t = Ct.get(e.key);
|
|
1114
1114
|
t || (t = {
|
|
1115
1115
|
...e,
|
|
1116
1116
|
cancel: null,
|
|
1117
1117
|
element: null,
|
|
1118
1118
|
refs: 0,
|
|
1119
1119
|
state: "queued"
|
|
1120
|
-
},
|
|
1120
|
+
}, Ct.set(t.key, t), wt.push(t)), t.refs += 1, Mt();
|
|
1121
1121
|
let n = !1;
|
|
1122
1122
|
return () => {
|
|
1123
|
-
n || (n = !0, --t.refs, t.refs === 0 &&
|
|
1123
|
+
n || (n = !0, --t.refs, t.refs === 0 && At(t));
|
|
1124
1124
|
};
|
|
1125
1125
|
}
|
|
1126
1126
|
//#endregion
|
|
1127
1127
|
//#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 ?
|
|
1128
|
+
function Pt(e) {
|
|
1129
|
+
let t = r(() => e.layout() === "masonry" && e.inViewport() && e.mediaReady() && e.mediaCard()?.feedPreload === "visible-post"), n = r(() => t.value ? Ot(e.item(), e.mediaIndex(), e.mediaSource()) : []), i = /* @__PURE__ */ new Map();
|
|
1130
1130
|
function a() {
|
|
1131
1131
|
let e = new Map(n.value.map((e) => [e.key, e]));
|
|
1132
1132
|
i.forEach((t, n) => {
|
|
1133
1133
|
e.has(n) || (t(), i.delete(n));
|
|
1134
1134
|
}), n.value.forEach((e) => {
|
|
1135
|
-
i.has(e.key) || i.set(e.key,
|
|
1135
|
+
i.has(e.key) || i.set(e.key, Nt(e));
|
|
1136
1136
|
});
|
|
1137
1137
|
}
|
|
1138
|
-
|
|
1138
|
+
O(() => n.value.map(({ key: e }) => e).join("\n"), a, { immediate: !0 }), v(() => {
|
|
1139
1139
|
i.forEach((e) => e()), i.clear();
|
|
1140
1140
|
});
|
|
1141
1141
|
}
|
|
1142
1142
|
//#endregion
|
|
1143
1143
|
//#region src/components/useMediaLoading.ts
|
|
1144
|
-
function
|
|
1145
|
-
let t = r(() =>
|
|
1146
|
-
return
|
|
1147
|
-
n !== "none" || t === "none" ||
|
|
1144
|
+
function Ft(e) {
|
|
1145
|
+
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
|
+
return O(i, (t, n) => {
|
|
1147
|
+
n !== "none" || t === "none" || m(() => {
|
|
1148
1148
|
let t = e.mediaElement.value;
|
|
1149
1149
|
!t || e.playbackAllowed() || i.value === "none" || t.load();
|
|
1150
1150
|
});
|
|
@@ -1156,58 +1156,58 @@ function Lt(e) {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
//#endregion
|
|
1158
1158
|
//#region src/components/useMediaReadiness.ts
|
|
1159
|
-
function
|
|
1160
|
-
let t =
|
|
1161
|
-
function
|
|
1159
|
+
function It(e) {
|
|
1160
|
+
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
|
+
function h() {
|
|
1162
1162
|
l !== null && clearTimeout(l), l = null;
|
|
1163
1163
|
}
|
|
1164
1164
|
function g(e) {
|
|
1165
1165
|
return Number(e.currentTarget.dataset.sourceGeneration) === i.value;
|
|
1166
1166
|
}
|
|
1167
1167
|
function _() {
|
|
1168
|
-
|
|
1168
|
+
h(), l = setTimeout(() => x(), 15e3);
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1171
|
-
t && !g(t) || (
|
|
1170
|
+
function y(t) {
|
|
1171
|
+
t && !g(t) || (h(), o.value = !1, s.value = !1, c.value = !1, e.onReady(e.mediaIndex()));
|
|
1172
1172
|
}
|
|
1173
1173
|
function b() {
|
|
1174
1174
|
if (f) return;
|
|
1175
1175
|
let e = t.value;
|
|
1176
1176
|
if (e?.complete) {
|
|
1177
|
-
e.naturalWidth > 0 ?
|
|
1177
|
+
e.naturalWidth > 0 ? y() : x(void 0, !0);
|
|
1178
1178
|
return;
|
|
1179
1179
|
}
|
|
1180
1180
|
let r = n.value;
|
|
1181
1181
|
if (r && r.readyState >= HTMLMediaElement.HAVE_METADATA) {
|
|
1182
|
-
|
|
1182
|
+
y();
|
|
1183
1183
|
return;
|
|
1184
1184
|
}
|
|
1185
1185
|
_();
|
|
1186
1186
|
}
|
|
1187
1187
|
function x(t, n = !1) {
|
|
1188
1188
|
if (!f && !(t && !g(t)) && !(s.value && !c.value && (!t || d))) {
|
|
1189
|
-
if (
|
|
1190
|
-
a.value = 1, i.value += 1, o.value = !0,
|
|
1189
|
+
if (h(), !t && a.value === 0) {
|
|
1190
|
+
a.value = 1, i.value += 1, o.value = !0, m(b);
|
|
1191
1191
|
return;
|
|
1192
1192
|
}
|
|
1193
1193
|
o.value = !1, s.value = !0, c.value = !1, d = !!t || n, e.onError(e.mediaIndex(), d);
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
1196
|
function S() {
|
|
1197
|
-
c.value || p.value !== "error" || (d = !1, a.value = 0, s.value = !0, o.value = !0, c.value = !0, i.value += 1,
|
|
1197
|
+
c.value || p.value !== "error" || (d = !1, a.value = 0, s.value = !0, o.value = !0, c.value = !0, i.value += 1, m(b));
|
|
1198
1198
|
}
|
|
1199
1199
|
function C(e) {
|
|
1200
1200
|
g(e) && o.value && _();
|
|
1201
1201
|
}
|
|
1202
|
-
return
|
|
1203
|
-
|
|
1204
|
-
}, { immediate: !0 }),
|
|
1205
|
-
f = !0,
|
|
1202
|
+
return O(e.identity, () => {
|
|
1203
|
+
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);
|
|
1204
|
+
}, { immediate: !0 }), v(() => {
|
|
1205
|
+
f = !0, h();
|
|
1206
1206
|
}), {
|
|
1207
1207
|
effectivePreviewState: p,
|
|
1208
1208
|
failSourceAttempt: x,
|
|
1209
1209
|
imageElement: t,
|
|
1210
|
-
markSourceReady:
|
|
1210
|
+
markSourceReady: y,
|
|
1211
1211
|
noteSourceActivity: C,
|
|
1212
1212
|
retrySource: S,
|
|
1213
1213
|
retrying: c,
|
|
@@ -1217,30 +1217,30 @@ function Rt(e) {
|
|
|
1217
1217
|
}
|
|
1218
1218
|
//#endregion
|
|
1219
1219
|
//#region src/core/reelAudio.ts
|
|
1220
|
-
var
|
|
1220
|
+
var Lt = {
|
|
1221
1221
|
lastAudibleVolume: 1,
|
|
1222
1222
|
muted: !1,
|
|
1223
1223
|
volume: 1
|
|
1224
1224
|
};
|
|
1225
|
-
function
|
|
1225
|
+
function Rt(e, t) {
|
|
1226
1226
|
return typeof e == "number" && Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : t;
|
|
1227
1227
|
}
|
|
1228
|
-
function
|
|
1229
|
-
let n =
|
|
1228
|
+
function zt(e, t = Lt) {
|
|
1229
|
+
let n = Rt(e?.volume, t.volume), r = Rt(e?.lastAudibleVolume, n > 0 ? n : t.lastAudibleVolume);
|
|
1230
1230
|
return {
|
|
1231
|
-
lastAudibleVolume: r > 0 ? r :
|
|
1231
|
+
lastAudibleVolume: r > 0 ? r : Lt.lastAudibleVolume,
|
|
1232
1232
|
muted: typeof e?.muted == "boolean" ? e.muted : n === 0 || t.muted,
|
|
1233
1233
|
volume: n
|
|
1234
1234
|
};
|
|
1235
1235
|
}
|
|
1236
1236
|
//#endregion
|
|
1237
1237
|
//#region src/components/useMediaCardAudio.ts
|
|
1238
|
-
function
|
|
1239
|
-
let t =
|
|
1238
|
+
function Bt(e) {
|
|
1239
|
+
let t = zt(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
1240
|
function o() {
|
|
1241
1241
|
let t = e.mediaElement.value, n = e.reelAudioState();
|
|
1242
1242
|
if (!t || e.layout() !== "reel" || !n) return;
|
|
1243
|
-
let o =
|
|
1243
|
+
let o = zt(n);
|
|
1244
1244
|
a = o.lastAudibleVolume, i.value = o.volume, r.value = o.muted, t.volume = o.volume, t.muted = e.active() === !1 ? !0 : o.muted;
|
|
1245
1245
|
}
|
|
1246
1246
|
function s(e, t) {
|
|
@@ -1248,7 +1248,7 @@ function Ht(e) {
|
|
|
1248
1248
|
}
|
|
1249
1249
|
function c(t) {
|
|
1250
1250
|
if (e.layout() !== "reel") return;
|
|
1251
|
-
let n =
|
|
1251
|
+
let n = zt({
|
|
1252
1252
|
lastAudibleVolume: a,
|
|
1253
1253
|
muted: t.muted,
|
|
1254
1254
|
volume: t.volume
|
|
@@ -1265,7 +1265,7 @@ function Ht(e) {
|
|
|
1265
1265
|
let t = e.mediaElement.value;
|
|
1266
1266
|
t && (t.muted && t.volume === 0 && (t.volume = a), t.muted = !t.muted, s(t, !0), c(t));
|
|
1267
1267
|
}
|
|
1268
|
-
return
|
|
1268
|
+
return O([
|
|
1269
1269
|
e.active,
|
|
1270
1270
|
e.layout,
|
|
1271
1271
|
() => e.reelAudioState()?.lastAudibleVolume,
|
|
@@ -1283,7 +1283,7 @@ function Ht(e) {
|
|
|
1283
1283
|
}
|
|
1284
1284
|
//#endregion
|
|
1285
1285
|
//#region src/components/useReelVideoActivity.ts
|
|
1286
|
-
function
|
|
1286
|
+
function Vt(e) {
|
|
1287
1287
|
let t = r(() => e.layout() === "reel" ? e.active() === !0 : e.inViewport()), n = r(() => t.value ? e.mediaIsMuted.value : !0);
|
|
1288
1288
|
function i() {
|
|
1289
1289
|
if (!t.value) {
|
|
@@ -1292,13 +1292,13 @@ function Ut(e) {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
e.mediaIsPlaying.value = !0;
|
|
1294
1294
|
}
|
|
1295
|
-
return
|
|
1295
|
+
return O(t, (n) => {
|
|
1296
1296
|
let r = e.mediaElement.value;
|
|
1297
1297
|
if (!n) {
|
|
1298
1298
|
r?.pause(), r && (r.muted = !0), e.mediaIsPlaying.value = !1;
|
|
1299
1299
|
return;
|
|
1300
1300
|
}
|
|
1301
|
-
|
|
1301
|
+
m().then(async () => {
|
|
1302
1302
|
let n = e.mediaElement.value;
|
|
1303
1303
|
if (!(!n || !t.value)) {
|
|
1304
1304
|
n.muted = e.mediaIsMuted.value;
|
|
@@ -1317,18 +1317,18 @@ function Ut(e) {
|
|
|
1317
1317
|
}
|
|
1318
1318
|
//#endregion
|
|
1319
1319
|
//#region src/components/useTimedMediaCard.ts
|
|
1320
|
-
function
|
|
1320
|
+
function Ht(e) {
|
|
1321
1321
|
return Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1324
|
-
let t =
|
|
1323
|
+
function Ut(e) {
|
|
1324
|
+
let t = w(0), n = w(0), r = w(!1), { apply: i, setVolume: a, sync: o, toggleMute: s, videoIsMuted: c, videoVolume: l } = Bt({
|
|
1325
1325
|
active: e.active,
|
|
1326
1326
|
layout: e.layout,
|
|
1327
1327
|
mediaCard: e.mediaCard,
|
|
1328
1328
|
mediaElement: e.mediaElement,
|
|
1329
1329
|
onChange: e.onAudioChange,
|
|
1330
1330
|
reelAudioState: e.reelAudioState
|
|
1331
|
-
}), { effectiveMuted: u, onPlaying: d, playbackAllowed: f } =
|
|
1331
|
+
}), { effectiveMuted: u, onPlaying: d, playbackAllowed: f } = Vt({
|
|
1332
1332
|
active: e.active,
|
|
1333
1333
|
inViewport: e.inViewport,
|
|
1334
1334
|
layout: e.layout,
|
|
@@ -1338,7 +1338,7 @@ function Gt(e) {
|
|
|
1338
1338
|
});
|
|
1339
1339
|
function p(r) {
|
|
1340
1340
|
let i = r?.currentTarget ?? e.mediaElement.value;
|
|
1341
|
-
i && (t.value =
|
|
1341
|
+
i && (t.value = Ht(i.currentTime), n.value = Ht(i.duration), o(i, f.value));
|
|
1342
1342
|
}
|
|
1343
1343
|
function m(t) {
|
|
1344
1344
|
i(), p(t), e.onReady(t);
|
|
@@ -1348,7 +1348,7 @@ function Gt(e) {
|
|
|
1348
1348
|
}
|
|
1349
1349
|
function g(n) {
|
|
1350
1350
|
let r = e.mediaElement.value;
|
|
1351
|
-
!r || !Number.isFinite(n) || (r.currentTime = Math.min(
|
|
1351
|
+
!r || !Number.isFinite(n) || (r.currentTime = Math.min(Ht(r.duration), Math.max(0, n)), t.value = r.currentTime);
|
|
1352
1352
|
}
|
|
1353
1353
|
async function _() {
|
|
1354
1354
|
let t = e.mediaElement.value;
|
|
@@ -1364,7 +1364,7 @@ function Gt(e) {
|
|
|
1364
1364
|
}
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
|
-
return
|
|
1367
|
+
return O(e.mediaElement, () => {
|
|
1368
1368
|
t.value = 0, n.value = 0, r.value = !1;
|
|
1369
1369
|
}, { flush: "sync" }), {
|
|
1370
1370
|
currentTime: t,
|
|
@@ -1386,7 +1386,7 @@ function Gt(e) {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
//#endregion
|
|
1388
1388
|
//#region src/components/MediaCard.vue?vue&type=script&setup=true&lang.ts
|
|
1389
|
-
var
|
|
1389
|
+
var Wt = [
|
|
1390
1390
|
"data-post-id",
|
|
1391
1391
|
"data-media-index",
|
|
1392
1392
|
"aria-hidden",
|
|
@@ -1394,19 +1394,19 @@ var Kt = [
|
|
|
1394
1394
|
"inert",
|
|
1395
1395
|
"role",
|
|
1396
1396
|
"tabindex"
|
|
1397
|
-
],
|
|
1397
|
+
], Gt = { class: "media-card-content" }, Kt = ["data-media-direction"], qt = ["data-media-index"], Jt = {
|
|
1398
1398
|
key: 0,
|
|
1399
1399
|
"data-test": "media-loading",
|
|
1400
1400
|
class: "media-loading",
|
|
1401
1401
|
"aria-hidden": "true"
|
|
1402
|
-
},
|
|
1402
|
+
}, Yt = [
|
|
1403
1403
|
"data-source-generation",
|
|
1404
1404
|
"src",
|
|
1405
1405
|
"autoplay",
|
|
1406
1406
|
"loop",
|
|
1407
1407
|
"muted",
|
|
1408
1408
|
"preload"
|
|
1409
|
-
],
|
|
1409
|
+
], Xt = ["aria-label", "disabled"], Zt = [
|
|
1410
1410
|
"data-cover-identity",
|
|
1411
1411
|
"data-source-generation",
|
|
1412
1412
|
"src",
|
|
@@ -1414,11 +1414,11 @@ var Kt = [
|
|
|
1414
1414
|
"height",
|
|
1415
1415
|
"fetchpriority",
|
|
1416
1416
|
"loading"
|
|
1417
|
-
],
|
|
1417
|
+
], Qt = {
|
|
1418
1418
|
key: 1,
|
|
1419
1419
|
class: "media-audio-fallback",
|
|
1420
1420
|
"aria-hidden": "true"
|
|
1421
|
-
},
|
|
1421
|
+
}, $t = [
|
|
1422
1422
|
"data-source-generation",
|
|
1423
1423
|
"src",
|
|
1424
1424
|
"width",
|
|
@@ -1427,14 +1427,14 @@ var Kt = [
|
|
|
1427
1427
|
"loop",
|
|
1428
1428
|
"muted",
|
|
1429
1429
|
"preload"
|
|
1430
|
-
],
|
|
1430
|
+
], en = [
|
|
1431
1431
|
"data-source-generation",
|
|
1432
1432
|
"src",
|
|
1433
1433
|
"width",
|
|
1434
1434
|
"height",
|
|
1435
1435
|
"fetchpriority",
|
|
1436
1436
|
"loading"
|
|
1437
|
-
],
|
|
1437
|
+
], tn = ["aria-label"], nn = ["aria-label"], rn = ["aria-label"], an = /* @__PURE__ */ d({
|
|
1438
1438
|
__name: "MediaCard",
|
|
1439
1439
|
props: {
|
|
1440
1440
|
active: { type: Boolean },
|
|
@@ -1474,105 +1474,105 @@ var Kt = [
|
|
|
1474
1474
|
function f(e = !1, t = "pointer") {
|
|
1475
1475
|
e && d("activate", t);
|
|
1476
1476
|
}
|
|
1477
|
-
let p = r(() =>
|
|
1478
|
-
identity: () => `${l.item.postId}:${
|
|
1479
|
-
mediaIndex: () =>
|
|
1477
|
+
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({
|
|
1478
|
+
identity: () => `${l.item.postId}:${g.value}:${l.mediaSource ?? "preview"}:${D.value}:${M.value ?? ""}`,
|
|
1479
|
+
mediaIndex: () => g.value,
|
|
1480
1480
|
onError: (e, t) => {
|
|
1481
1481
|
if (d("error", e), !t) return;
|
|
1482
1482
|
let n = l.mediaSource ?? "preview";
|
|
1483
1483
|
d("mediaError", {
|
|
1484
1484
|
mediaIndex: e,
|
|
1485
|
-
source: n === "preview" && !S.value &&
|
|
1486
|
-
src:
|
|
1485
|
+
source: n === "preview" && !S.value && v.value.preview ? "preview" : n === "mobile" && D.value === v.value.mobile?.src ? "mobile" : "original",
|
|
1486
|
+
src: D.value
|
|
1487
1487
|
});
|
|
1488
1488
|
},
|
|
1489
1489
|
onReady: (e) => d("ready", e),
|
|
1490
1490
|
previewState: () => l.previewState
|
|
1491
1491
|
});
|
|
1492
|
-
|
|
1492
|
+
Pt({
|
|
1493
1493
|
inViewport: () => l.inViewport === !0,
|
|
1494
1494
|
item: () => l.item,
|
|
1495
1495
|
layout: () => l.layout,
|
|
1496
1496
|
mediaCard: () => l.mediaCard,
|
|
1497
|
-
mediaIndex: () =>
|
|
1498
|
-
mediaReady: () =>
|
|
1497
|
+
mediaIndex: () => g.value,
|
|
1498
|
+
mediaReady: () => G.value === "ready",
|
|
1499
1499
|
mediaSource: () => l.mediaSource ?? "preview"
|
|
1500
1500
|
});
|
|
1501
|
-
let { currentTime:
|
|
1501
|
+
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({
|
|
1502
1502
|
active: () => l.active,
|
|
1503
1503
|
inViewport: () => l.inViewport === !0,
|
|
1504
1504
|
layout: () => l.layout,
|
|
1505
1505
|
mediaCard: () => l.mediaCard,
|
|
1506
|
-
mediaElement:
|
|
1506
|
+
mediaElement: ae,
|
|
1507
1507
|
onAudioChange: (e) => d("reelAudioChange", e),
|
|
1508
|
-
onEnded: () => d("ended",
|
|
1509
|
-
onReady:
|
|
1508
|
+
onEnded: () => d("ended", g.value),
|
|
1509
|
+
onReady: q,
|
|
1510
1510
|
reelAudioState: () => l.reelAudioState
|
|
1511
1511
|
}), _e = r(() => l.interactive && !!(l.cardHeader || l.cardFooter));
|
|
1512
1512
|
function ve(e) {
|
|
1513
1513
|
return e.detail === 0 ? "keyboard" : "pointer";
|
|
1514
1514
|
}
|
|
1515
|
-
let { change: ye, direction: be, onTouchEnd: xe, onTouchStart: Se, onWheel: Ce } =
|
|
1515
|
+
let { change: ye, direction: be, onTouchEnd: xe, onTouchStart: Se, onWheel: Ce } = St({
|
|
1516
1516
|
item: () => l.item,
|
|
1517
1517
|
layout: () => l.layout,
|
|
1518
|
-
mediaIndex: () =>
|
|
1518
|
+
mediaIndex: () => g.value,
|
|
1519
1519
|
onChange: (e) => d("mediaChange", e)
|
|
1520
|
-
}), { imageLoading: we, mediaIsTimed: Te, timedMediaPreload: Ee } =
|
|
1520
|
+
}), { imageLoading: we, mediaIsTimed: Te, timedMediaPreload: Ee } = Ft({
|
|
1521
1521
|
active: () => l.active,
|
|
1522
1522
|
fetchPriority: () => l.fetchPriority,
|
|
1523
1523
|
layout: () => l.layout,
|
|
1524
|
-
mediaSource: () =>
|
|
1525
|
-
mediaType: () =>
|
|
1526
|
-
mediaElement:
|
|
1524
|
+
mediaSource: () => D.value,
|
|
1525
|
+
mediaType: () => M.value,
|
|
1526
|
+
mediaElement: ae,
|
|
1527
1527
|
playbackAllowed: () => de.value
|
|
1528
|
-
}), De = r(() => l.layout === "reel" && l.stationaryReelControls === !0), Oe = r(() => Te.value && (!S.value || l.layout === "reel") &&
|
|
1528
|
+
}), 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}`);
|
|
1529
1529
|
function Ae(e) {
|
|
1530
1530
|
l.layout === "reel" && (e.stopPropagation(), he());
|
|
1531
1531
|
}
|
|
1532
1532
|
function je(e) {
|
|
1533
|
-
e.currentTarget.dataset.coverIdentity !==
|
|
1534
|
-
mediaIndex:
|
|
1533
|
+
e.currentTarget.dataset.coverIdentity !== L.value || R.value || (d("mediaError", {
|
|
1534
|
+
mediaIndex: g.value,
|
|
1535
1535
|
source: "preview",
|
|
1536
1536
|
src: F.value?.src ?? ""
|
|
1537
|
-
}),
|
|
1537
|
+
}), R.value = !0, l.layout === "masonry" && q());
|
|
1538
1538
|
}
|
|
1539
|
-
return
|
|
1540
|
-
|
|
1541
|
-
}),
|
|
1539
|
+
return O(L, () => {
|
|
1540
|
+
R.value = !1;
|
|
1541
|
+
}), O([
|
|
1542
1542
|
S,
|
|
1543
1543
|
() => l.layout,
|
|
1544
|
-
|
|
1544
|
+
W
|
|
1545
1545
|
], ([e, t, n]) => {
|
|
1546
|
-
e && t === "masonry" && !n &&
|
|
1547
|
-
}, { immediate: !0 }), (r, i) => (
|
|
1546
|
+
e && t === "masonry" && !n && m(() => q());
|
|
1547
|
+
}, { immediate: !0 }), (r, i) => (b(), s("article", {
|
|
1548
1548
|
"data-post-id": e.item.postId,
|
|
1549
|
-
"data-media-index":
|
|
1550
|
-
class:
|
|
1549
|
+
"data-media-index": g.value,
|
|
1550
|
+
class: h(["media-card", {
|
|
1551
1551
|
"media-card--entering": e.entering,
|
|
1552
1552
|
"media-card--leaving": e.leaving,
|
|
1553
|
-
"media-card--error":
|
|
1553
|
+
"media-card--error": E(G) === "error",
|
|
1554
1554
|
"media-card--transparent-chrome": e.mediaCard?.header?.background === "transparent" || e.mediaCard?.footer?.background === "transparent" || e.cardHeader?.background === "transparent" || e.cardFooter?.background === "transparent"
|
|
1555
1555
|
}]),
|
|
1556
|
-
style:
|
|
1556
|
+
style: _(e.itemStyle),
|
|
1557
1557
|
"aria-hidden": e.leaving || void 0,
|
|
1558
|
-
"aria-busy":
|
|
1558
|
+
"aria-busy": E(G) === "loading" || E(re),
|
|
1559
1559
|
inert: e.leaving || void 0,
|
|
1560
1560
|
role: e.interactive && !e.leaving && !_e.value ? "button" : void 0,
|
|
1561
1561
|
tabindex: e.interactive && !e.leaving && !_e.value ? 0 : void 0,
|
|
1562
1562
|
onClick: i[34] ||= (t) => f(e.interactive && !_e.value, ve(t)),
|
|
1563
|
-
onKeydown: [i[35] ||=
|
|
1564
|
-
}, [c("div",
|
|
1565
|
-
e.cardHeader ? (
|
|
1563
|
+
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", Gt, [
|
|
1565
|
+
e.cardHeader ? (b(), a(rt, {
|
|
1566
1566
|
key: 0,
|
|
1567
1567
|
index: e.index,
|
|
1568
1568
|
item: e.item,
|
|
1569
1569
|
layout: e.layout,
|
|
1570
1570
|
"loaded-count": e.loadedCount,
|
|
1571
|
-
"media-index":
|
|
1571
|
+
"media-index": g.value,
|
|
1572
1572
|
"media-source": e.mediaSource,
|
|
1573
1573
|
placement: "header",
|
|
1574
1574
|
region: e.cardHeader,
|
|
1575
|
-
style:
|
|
1575
|
+
style: _(e.mediaCard?.header),
|
|
1576
1576
|
total: e.total
|
|
1577
1577
|
}, null, 8, [
|
|
1578
1578
|
"index",
|
|
@@ -1586,28 +1586,28 @@ var Kt = [
|
|
|
1586
1586
|
"total"
|
|
1587
1587
|
])) : o("", !0),
|
|
1588
1588
|
c("div", {
|
|
1589
|
-
class:
|
|
1590
|
-
"data-media-direction":
|
|
1591
|
-
onWheel: i[31] ||= (...e) =>
|
|
1592
|
-
onTouchstartPassive: i[32] ||= (...e) =>
|
|
1593
|
-
onTouchendPassive: i[33] ||= (...e) =>
|
|
1589
|
+
class: h(["media-card-media", { "media-card-media--carousel": e.layout === "reel" && p.value.length > 1 }]),
|
|
1590
|
+
"data-media-direction": E(be),
|
|
1591
|
+
onWheel: i[31] ||= (...e) => E(Ce) && E(Ce)(...e),
|
|
1592
|
+
onTouchstartPassive: i[32] ||= (...e) => E(Se) && E(Se)(...e),
|
|
1593
|
+
onTouchendPassive: i[33] ||= (...e) => E(xe) && E(xe)(...e)
|
|
1594
1594
|
}, [
|
|
1595
1595
|
u(n, {
|
|
1596
|
-
css: !
|
|
1597
|
-
name: `media-slide-${
|
|
1596
|
+
css: !E(re),
|
|
1597
|
+
name: `media-slide-${E(be)}`
|
|
1598
1598
|
}, {
|
|
1599
|
-
default:
|
|
1600
|
-
key: `${e.item.postId}:${
|
|
1599
|
+
default: k(() => [(b(), s("div", {
|
|
1600
|
+
key: `${e.item.postId}:${v.value.src}:${e.mediaSource ?? "preview"}:${E(ie)}`,
|
|
1601
1601
|
class: "media-card-frame",
|
|
1602
|
-
"data-media-index":
|
|
1602
|
+
"data-media-index": g.value
|
|
1603
1603
|
}, [
|
|
1604
|
-
|
|
1604
|
+
E(G) === "loading" ? (b(), s("div", Jt, [...i[37] ||= [c("span", { class: "media-loading-shimmer" }, null, -1)]])) : E(G) === "error" ? (b(), a(st, {
|
|
1605
1605
|
key: 1,
|
|
1606
1606
|
component: e.mediaCard?.error?.component,
|
|
1607
|
-
label:
|
|
1608
|
-
retrying:
|
|
1609
|
-
status:
|
|
1610
|
-
onRetry:
|
|
1607
|
+
label: E(nt)(D.value),
|
|
1608
|
+
retrying: E(re),
|
|
1609
|
+
status: E(tt)(D.value),
|
|
1610
|
+
onRetry: E(ne)
|
|
1611
1611
|
}, null, 8, [
|
|
1612
1612
|
"component",
|
|
1613
1613
|
"label",
|
|
@@ -1615,106 +1615,106 @@ var Kt = [
|
|
|
1615
1615
|
"status",
|
|
1616
1616
|
"onRetry"
|
|
1617
1617
|
])) : o("", !0),
|
|
1618
|
-
S.value && e.layout === "reel" ? (
|
|
1618
|
+
S.value && e.layout === "reel" ? (b(), s("audio", {
|
|
1619
1619
|
key: 2,
|
|
1620
1620
|
ref_key: "mediaElement",
|
|
1621
|
-
ref:
|
|
1622
|
-
"data-source-generation":
|
|
1621
|
+
ref: ae,
|
|
1622
|
+
"data-source-generation": E(ie),
|
|
1623
1623
|
class: "media-audio-element",
|
|
1624
|
-
src:
|
|
1625
|
-
autoplay:
|
|
1624
|
+
src: D.value,
|
|
1625
|
+
autoplay: E(de),
|
|
1626
1626
|
loop: !e.advanceOnMediaEnd,
|
|
1627
|
-
muted:
|
|
1628
|
-
preload:
|
|
1629
|
-
onLoadedmetadata: i[0] ||= (...e) =>
|
|
1630
|
-
onProgress: i[1] ||= (...e) =>
|
|
1631
|
-
onLoadeddata: i[2] ||= (...e) =>
|
|
1632
|
-
onCanplay: i[3] ||= (...e) =>
|
|
1633
|
-
onDurationchange: i[4] ||= (...e) =>
|
|
1634
|
-
onTimeupdate: i[5] ||= (...e) =>
|
|
1635
|
-
onVolumechange: i[6] ||= (...e) =>
|
|
1636
|
-
onPlaying: i[7] ||= (...e) =>
|
|
1637
|
-
onPause: i[8] ||= (e) =>
|
|
1638
|
-
onEnded: i[9] ||= (...e) =>
|
|
1639
|
-
onError: i[10] ||= (...e) =>
|
|
1640
|
-
}, null, 40,
|
|
1641
|
-
S.value ? (
|
|
1627
|
+
muted: E(ce),
|
|
1628
|
+
preload: E(Ee),
|
|
1629
|
+
onLoadedmetadata: i[0] ||= (...e) => E(Z) && E(Z)(...e),
|
|
1630
|
+
onProgress: i[1] ||= (...e) => E(J) && E(J)(...e),
|
|
1631
|
+
onLoadeddata: i[2] ||= (...e) => E(J) && E(J)(...e),
|
|
1632
|
+
onCanplay: i[3] ||= (...e) => E(J) && E(J)(...e),
|
|
1633
|
+
onDurationchange: i[4] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1634
|
+
onTimeupdate: i[5] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1635
|
+
onVolumechange: i[6] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1636
|
+
onPlaying: i[7] ||= (...e) => E(ue) && E(ue)(...e),
|
|
1637
|
+
onPause: i[8] ||= (e) => Y.value = !1,
|
|
1638
|
+
onEnded: i[9] ||= (...e) => E(X) && E(X)(...e),
|
|
1639
|
+
onError: i[10] ||= (...e) => E(K) && E(K)(...e)
|
|
1640
|
+
}, null, 40, Yt)) : o("", !0),
|
|
1641
|
+
S.value ? (b(), s("button", {
|
|
1642
1642
|
key: 3,
|
|
1643
1643
|
type: "button",
|
|
1644
|
-
class:
|
|
1645
|
-
"aria-label": e.layout === "reel" ?
|
|
1644
|
+
class: h(["media-audio-artwork media-preview", { "media-preview--ready": E(G) === "ready" }]),
|
|
1645
|
+
"aria-label": e.layout === "reel" ? E(Y) ? "Pause audio" : "Play audio" : "Audio",
|
|
1646
1646
|
disabled: e.layout !== "reel",
|
|
1647
1647
|
onClick: Ae
|
|
1648
|
-
}, [
|
|
1649
|
-
key:
|
|
1650
|
-
"data-cover-identity":
|
|
1651
|
-
"data-source-generation":
|
|
1648
|
+
}, [W.value ? (b(), s("img", {
|
|
1649
|
+
key: L.value,
|
|
1650
|
+
"data-cover-identity": L.value,
|
|
1651
|
+
"data-source-generation": E(ie),
|
|
1652
1652
|
class: "media-audio-cover",
|
|
1653
|
-
src:
|
|
1654
|
-
width:
|
|
1655
|
-
height:
|
|
1653
|
+
src: W.value.src,
|
|
1654
|
+
width: W.value.width ?? void 0,
|
|
1655
|
+
height: W.value.height ?? void 0,
|
|
1656
1656
|
fetchpriority: e.fetchPriority,
|
|
1657
1657
|
alt: "",
|
|
1658
1658
|
decoding: "async",
|
|
1659
|
-
loading:
|
|
1660
|
-
onLoad: i[11] ||= (t) => e.layout === "masonry" &&
|
|
1659
|
+
loading: E(we),
|
|
1660
|
+
onLoad: i[11] ||= (t) => e.layout === "masonry" && E(q)(t),
|
|
1661
1661
|
onError: je
|
|
1662
|
-
}, null, 40,
|
|
1662
|
+
}, null, 40, Zt)) : (b(), s("span", Qt, [u(E(Ye), {
|
|
1663
1663
|
size: 64,
|
|
1664
1664
|
"stroke-width": 1.5
|
|
1665
|
-
})]))], 10,
|
|
1665
|
+
})]))], 10, Xt)) : E(Te) ? (b(), s("video", {
|
|
1666
1666
|
key: 4,
|
|
1667
1667
|
ref_key: "mediaElement",
|
|
1668
|
-
ref:
|
|
1669
|
-
"data-source-generation":
|
|
1670
|
-
class:
|
|
1671
|
-
"media-preview--ready":
|
|
1668
|
+
ref: ae,
|
|
1669
|
+
"data-source-generation": E(ie),
|
|
1670
|
+
class: h(["media-preview", {
|
|
1671
|
+
"media-preview--ready": E(G) === "ready",
|
|
1672
1672
|
"media-preview--reel-video": e.layout === "reel"
|
|
1673
1673
|
}]),
|
|
1674
|
-
src:
|
|
1675
|
-
width:
|
|
1674
|
+
src: D.value,
|
|
1675
|
+
width: N.value ?? void 0,
|
|
1676
1676
|
height: P.value ?? void 0,
|
|
1677
|
-
autoplay:
|
|
1677
|
+
autoplay: E(de),
|
|
1678
1678
|
loop: !e.advanceOnMediaEnd,
|
|
1679
|
-
muted:
|
|
1679
|
+
muted: E(ce),
|
|
1680
1680
|
playsinline: "",
|
|
1681
|
-
preload:
|
|
1682
|
-
onLoadedmetadata: i[12] ||= (...e) =>
|
|
1683
|
-
onProgress: i[13] ||= (...e) =>
|
|
1684
|
-
onLoadeddata: i[14] ||= (...e) =>
|
|
1685
|
-
onCanplay: i[15] ||= (...e) =>
|
|
1686
|
-
onDurationchange: i[16] ||= (...e) =>
|
|
1687
|
-
onTimeupdate: i[17] ||= (...e) =>
|
|
1688
|
-
onVolumechange: i[18] ||= (...e) =>
|
|
1689
|
-
onPlaying: i[19] ||= (...e) =>
|
|
1690
|
-
onPause: i[20] ||= (e) =>
|
|
1691
|
-
onEnded: i[21] ||= (...e) =>
|
|
1681
|
+
preload: E(Ee),
|
|
1682
|
+
onLoadedmetadata: i[12] ||= (...e) => E(Z) && E(Z)(...e),
|
|
1683
|
+
onProgress: i[13] ||= (...e) => E(J) && E(J)(...e),
|
|
1684
|
+
onLoadeddata: i[14] ||= (...e) => E(J) && E(J)(...e),
|
|
1685
|
+
onCanplay: i[15] ||= (...e) => E(J) && E(J)(...e),
|
|
1686
|
+
onDurationchange: i[16] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1687
|
+
onTimeupdate: i[17] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1688
|
+
onVolumechange: i[18] ||= (...e) => E(Q) && E(Q)(...e),
|
|
1689
|
+
onPlaying: i[19] ||= (...e) => E(ue) && E(ue)(...e),
|
|
1690
|
+
onPause: i[20] ||= (e) => Y.value = !1,
|
|
1691
|
+
onEnded: i[21] ||= (...e) => E(X) && E(X)(...e),
|
|
1692
1692
|
onClick: Ae,
|
|
1693
|
-
onError: i[22] ||= (...e) =>
|
|
1694
|
-
}, null, 42,
|
|
1693
|
+
onError: i[22] ||= (...e) => E(K) && E(K)(...e)
|
|
1694
|
+
}, null, 42, $t)) : S.value ? o("", !0) : (b(), s("img", {
|
|
1695
1695
|
key: 5,
|
|
1696
1696
|
ref_key: "imageElement",
|
|
1697
|
-
ref:
|
|
1698
|
-
"data-source-generation":
|
|
1699
|
-
class:
|
|
1700
|
-
src:
|
|
1701
|
-
width:
|
|
1697
|
+
ref: te,
|
|
1698
|
+
"data-source-generation": E(ie),
|
|
1699
|
+
class: h(["media-preview", { "media-preview--ready": E(G) === "ready" }]),
|
|
1700
|
+
src: D.value,
|
|
1701
|
+
width: N.value ?? void 0,
|
|
1702
1702
|
height: P.value ?? void 0,
|
|
1703
1703
|
fetchpriority: e.fetchPriority,
|
|
1704
1704
|
alt: "",
|
|
1705
1705
|
decoding: "async",
|
|
1706
|
-
loading:
|
|
1707
|
-
onLoad: i[23] ||= (...e) =>
|
|
1708
|
-
onError: i[24] ||= (...e) =>
|
|
1709
|
-
}, null, 42,
|
|
1710
|
-
], 8,
|
|
1706
|
+
loading: E(we),
|
|
1707
|
+
onLoad: i[23] ||= (...e) => E(q) && E(q)(...e),
|
|
1708
|
+
onError: i[24] ||= (...e) => E(K) && E(K)(...e)
|
|
1709
|
+
}, null, 42, en))
|
|
1710
|
+
], 8, qt))]),
|
|
1711
1711
|
_: 1
|
|
1712
1712
|
}, 8, ["css", "name"]),
|
|
1713
|
-
u(
|
|
1713
|
+
u(vt, {
|
|
1714
1714
|
item: e.item,
|
|
1715
1715
|
"media-card": e.mediaCard,
|
|
1716
|
-
"media-index":
|
|
1717
|
-
"media-item":
|
|
1716
|
+
"media-index": g.value,
|
|
1717
|
+
"media-item": v.value,
|
|
1718
1718
|
"media-source": e.mediaSource ?? "preview"
|
|
1719
1719
|
}, null, 8, [
|
|
1720
1720
|
"item",
|
|
@@ -1723,27 +1723,27 @@ var Kt = [
|
|
|
1723
1723
|
"media-item",
|
|
1724
1724
|
"media-source"
|
|
1725
1725
|
]),
|
|
1726
|
-
(
|
|
1726
|
+
(b(), a(t, {
|
|
1727
1727
|
disabled: !De.value || !e.reelControlsTarget,
|
|
1728
1728
|
to: e.reelControlsTarget ?? "body"
|
|
1729
1729
|
}, [u(n, {
|
|
1730
1730
|
name: "vibe-reel-media-controls",
|
|
1731
1731
|
css: De.value
|
|
1732
1732
|
}, {
|
|
1733
|
-
default:
|
|
1733
|
+
default: k(() => [Oe.value ? (b(), a(gt, {
|
|
1734
1734
|
key: ke.value,
|
|
1735
|
-
"current-time":
|
|
1735
|
+
"current-time": E(oe),
|
|
1736
1736
|
"data-control-post-id": De.value ? e.item.postId : void 0,
|
|
1737
|
-
duration:
|
|
1737
|
+
duration: E(se),
|
|
1738
1738
|
layout: e.layout,
|
|
1739
1739
|
"media-type": S.value ? "audio" : "video",
|
|
1740
|
-
muted:
|
|
1741
|
-
playing:
|
|
1742
|
-
volume:
|
|
1743
|
-
onSeek:
|
|
1744
|
-
onToggleMute:
|
|
1745
|
-
onTogglePlayback:
|
|
1746
|
-
onVolumeChange:
|
|
1740
|
+
muted: E(le),
|
|
1741
|
+
playing: E(Y),
|
|
1742
|
+
volume: E(ge),
|
|
1743
|
+
onSeek: E(fe),
|
|
1744
|
+
onToggleMute: E(me),
|
|
1745
|
+
onTogglePlayback: E(he),
|
|
1746
|
+
onVolumeChange: E(pe)
|
|
1747
1747
|
}, null, 8, [
|
|
1748
1748
|
"current-time",
|
|
1749
1749
|
"data-control-post-id",
|
|
@@ -1760,43 +1760,43 @@ var Kt = [
|
|
|
1760
1760
|
])) : o("", !0)]),
|
|
1761
1761
|
_: 1
|
|
1762
1762
|
}, 8, ["css"])], 8, ["disabled", "to"])),
|
|
1763
|
-
p.value.length > 1 ? (
|
|
1763
|
+
p.value.length > 1 ? (b(), s("div", {
|
|
1764
1764
|
key: 0,
|
|
1765
|
-
class:
|
|
1765
|
+
class: h(["media-carousel-controls", { "media-carousel-controls--persistent": e.layout === "reel" }]),
|
|
1766
1766
|
"aria-label": "Media navigation"
|
|
1767
1767
|
}, [c("button", {
|
|
1768
1768
|
type: "button",
|
|
1769
1769
|
class: "media-carousel-control media-carousel-control--previous",
|
|
1770
1770
|
"aria-label": `Previous media for post ${e.item.postId}`,
|
|
1771
|
-
onClick: i[25] ||=
|
|
1772
|
-
onKeydown: i[26] ||=
|
|
1773
|
-
}, [u(
|
|
1771
|
+
onClick: i[25] ||= j((e) => E(ye)(g.value - 1, e), ["stop"]),
|
|
1772
|
+
onKeydown: i[26] ||= j(() => {}, ["stop"])
|
|
1773
|
+
}, [u(E(qe), { size: 20 })], 40, tn), c("button", {
|
|
1774
1774
|
type: "button",
|
|
1775
1775
|
class: "media-carousel-control media-carousel-control--next",
|
|
1776
1776
|
"aria-label": `Next media for post ${e.item.postId}`,
|
|
1777
|
-
onClick: i[27] ||=
|
|
1778
|
-
onKeydown: i[28] ||=
|
|
1779
|
-
}, [u(
|
|
1780
|
-
_e.value ? (
|
|
1777
|
+
onClick: i[27] ||= j((e) => E(ye)(g.value + 1, e), ["stop"]),
|
|
1778
|
+
onKeydown: i[28] ||= j(() => {}, ["stop"])
|
|
1779
|
+
}, [u(E(Je), { size: 20 })], 40, nn)], 2)) : o("", !0),
|
|
1780
|
+
_e.value ? (b(), s("button", {
|
|
1781
1781
|
key: 1,
|
|
1782
1782
|
class: "media-card-activator",
|
|
1783
1783
|
type: "button",
|
|
1784
1784
|
"aria-label": `Open post ${e.item.postId}`,
|
|
1785
|
-
onClick: i[29] ||=
|
|
1786
|
-
onKeydown: i[30] ||=
|
|
1787
|
-
}, null, 40,
|
|
1788
|
-
], 42,
|
|
1789
|
-
e.cardFooter ? (
|
|
1785
|
+
onClick: i[29] ||= j((e) => r.$emit("activate", ve(e)), ["stop"]),
|
|
1786
|
+
onKeydown: i[30] ||= j(() => {}, ["stop"])
|
|
1787
|
+
}, null, 40, rn)) : o("", !0)
|
|
1788
|
+
], 42, Kt),
|
|
1789
|
+
e.cardFooter ? (b(), a(rt, {
|
|
1790
1790
|
key: 1,
|
|
1791
1791
|
index: e.index,
|
|
1792
1792
|
item: e.item,
|
|
1793
1793
|
layout: e.layout,
|
|
1794
1794
|
"loaded-count": e.loadedCount,
|
|
1795
|
-
"media-index":
|
|
1795
|
+
"media-index": g.value,
|
|
1796
1796
|
"media-source": e.mediaSource,
|
|
1797
1797
|
placement: "footer",
|
|
1798
1798
|
region: e.cardFooter,
|
|
1799
|
-
style:
|
|
1799
|
+
style: _(e.mediaCard?.footer),
|
|
1800
1800
|
total: e.total
|
|
1801
1801
|
}, null, 8, [
|
|
1802
1802
|
"index",
|
|
@@ -1809,17 +1809,17 @@ var Kt = [
|
|
|
1809
1809
|
"style",
|
|
1810
1810
|
"total"
|
|
1811
1811
|
])) : o("", !0)
|
|
1812
|
-
])], 46,
|
|
1812
|
+
])], 46, Wt));
|
|
1813
1813
|
}
|
|
1814
1814
|
});
|
|
1815
1815
|
//#endregion
|
|
1816
1816
|
//#region src/components/useMasonryMediaVisibility.ts
|
|
1817
|
-
function
|
|
1817
|
+
function on(e) {
|
|
1818
1818
|
function t(t) {
|
|
1819
1819
|
return t.flatMap((t) => {
|
|
1820
1820
|
let n = e.items()[t];
|
|
1821
1821
|
if (!n) return [];
|
|
1822
|
-
let r = e.mediaIndices().get(n.postId) ?? 0, i =
|
|
1822
|
+
let r = e.mediaIndices().get(n.postId) ?? 0, i = W(n.postId, r);
|
|
1823
1823
|
return e.previewStates().get(i) === "ready" ? [{
|
|
1824
1824
|
key: i,
|
|
1825
1825
|
mediaIndex: r,
|
|
@@ -1829,7 +1829,7 @@ function cn(e) {
|
|
|
1829
1829
|
}
|
|
1830
1830
|
function n(e, n) {
|
|
1831
1831
|
let r = /* @__PURE__ */ new Set();
|
|
1832
|
-
|
|
1832
|
+
O(() => t(e()), (e) => {
|
|
1833
1833
|
let t = new Set(e.map(({ key: e }) => e));
|
|
1834
1834
|
e.forEach(({ key: e, mediaIndex: t, postId: i }) => {
|
|
1835
1835
|
r.has(e) || n(i, t);
|
|
@@ -1843,14 +1843,14 @@ function cn(e) {
|
|
|
1843
1843
|
}
|
|
1844
1844
|
//#endregion
|
|
1845
1845
|
//#region src/components/useSettledMasonryFeedLayout.ts
|
|
1846
|
-
var
|
|
1847
|
-
function
|
|
1848
|
-
let t =
|
|
1846
|
+
var sn = 1500;
|
|
1847
|
+
function cn(e) {
|
|
1848
|
+
let t = w(0), n = 0, i = null, a = 0, o = 0, s = null, c = 0, l = null, u = null, d = 0;
|
|
1849
1849
|
function f() {
|
|
1850
1850
|
s !== null && (cancelAnimationFrame(s), s = null);
|
|
1851
1851
|
}
|
|
1852
1852
|
function p(e, t, n, r) {
|
|
1853
|
-
return i = e, l = t.slice(), u =
|
|
1853
|
+
return i = e, l = t.slice(), u = Ce(e.items, u ?? Se(r.items), n), c = e.items.length < t.length ? Math.max(c, r.height, e.height) : 0, e.items.length < t.length && e.items.length > n && m(), e;
|
|
1854
1854
|
}
|
|
1855
1855
|
function m() {
|
|
1856
1856
|
s === null && (s = requestAnimationFrame(() => {
|
|
@@ -1858,13 +1858,13 @@ function un(e) {
|
|
|
1858
1858
|
let n = e.items(), r = i;
|
|
1859
1859
|
if (!r || r.items.length >= n.length) return;
|
|
1860
1860
|
let a = r.items.length;
|
|
1861
|
-
p(
|
|
1861
|
+
p(ve(n, e.width.value, {
|
|
1862
1862
|
additionalHeight: e.additionalHeight.value,
|
|
1863
1863
|
gap: e.gap.value,
|
|
1864
1864
|
minColumnWidth: e.minColumnWidth.value
|
|
1865
1865
|
}, r, a, {
|
|
1866
1866
|
throughIndex: e.packThroughIndex(),
|
|
1867
|
-
untilIndex: a +
|
|
1867
|
+
untilIndex: a + sn
|
|
1868
1868
|
}), n, a, r), t.value += 1;
|
|
1869
1869
|
}));
|
|
1870
1870
|
}
|
|
@@ -1878,22 +1878,22 @@ function un(e) {
|
|
|
1878
1878
|
if (g && l && d === s && a === h.gap && n === h.additionalHeight && o === h.minColumnWidth) {
|
|
1879
1879
|
let t = 0, n = l, i = Math.min(n.length, r.length);
|
|
1880
1880
|
for (; t < i && n[t] === r[t];) t += 1;
|
|
1881
|
-
return t === r.length && t === n.length ? (g.items.length > 0 && g.items.length < r.length && m(), g) : (f(), p(
|
|
1881
|
+
return t === r.length && t === n.length ? (g.items.length > 0 && g.items.length < r.length && m(), g) : (f(), p(ve(r, s, h, g, t, {
|
|
1882
1882
|
throughIndex: e.packThroughIndex(),
|
|
1883
1883
|
untilBottom: e.packUntilBottom()
|
|
1884
1884
|
}), r, t, g));
|
|
1885
1885
|
}
|
|
1886
1886
|
f();
|
|
1887
|
-
let _ =
|
|
1888
|
-
return i = _, l = r.slice(), d = s, a = h.gap, n = h.additionalHeight, o = h.minColumnWidth, u =
|
|
1889
|
-
}), g = r(() => (h.value, u ??
|
|
1890
|
-
return
|
|
1887
|
+
let _ = _e(r, s, h);
|
|
1888
|
+
return i = _, l = r.slice(), d = s, a = h.gap, n = h.additionalHeight, o = h.minColumnWidth, u = Se(_.items), c = 0, _;
|
|
1889
|
+
}), g = r(() => (h.value, u ?? Se(h.value.items)));
|
|
1890
|
+
return v(f), {
|
|
1891
1891
|
ensurePackedThrough(n) {
|
|
1892
1892
|
let r = e.items(), a = i;
|
|
1893
1893
|
if (!a || a.items.length >= r.length || a.height >= n) return;
|
|
1894
1894
|
f();
|
|
1895
1895
|
let o = a.items.length;
|
|
1896
|
-
p(
|
|
1896
|
+
p(ve(r, e.width.value, {
|
|
1897
1897
|
additionalHeight: e.additionalHeight.value,
|
|
1898
1898
|
gap: e.gap.value,
|
|
1899
1899
|
minColumnWidth: e.minColumnWidth.value
|
|
@@ -1909,10 +1909,10 @@ function un(e) {
|
|
|
1909
1909
|
}
|
|
1910
1910
|
//#endregion
|
|
1911
1911
|
//#region src/components/MasonryFeed.vue?vue&type=script&setup=true&lang.ts
|
|
1912
|
-
var
|
|
1912
|
+
var ln = { class: "masonry-feed-shell" }, un = ["aria-hidden", "inert"], dn = {
|
|
1913
1913
|
key: 0,
|
|
1914
1914
|
class: "masonry-feed-status-overlay"
|
|
1915
|
-
},
|
|
1915
|
+
}, fn = 6, pn = 12, mn = 250, hn = /* @__PURE__ */ d({
|
|
1916
1916
|
__name: "MasonryFeed",
|
|
1917
1917
|
props: {
|
|
1918
1918
|
enteringPostIds: {},
|
|
@@ -1951,31 +1951,31 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
1951
1951
|
"visible"
|
|
1952
1952
|
],
|
|
1953
1953
|
setup(t, { expose: n, emit: i }) {
|
|
1954
|
-
let l = 0, d = t, f = i, p =
|
|
1954
|
+
let l = 0, d = t, f = i, p = w(null), m = `vibe-masonry-${D()}`, g = w(null), y = w(0), x = w(fn), 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
1955
|
additionalHeight: (d.cardHeader?.height ?? 0) + (d.cardFooter?.height ?? 0),
|
|
1956
|
-
gap:
|
|
1957
|
-
minColumnWidth:
|
|
1956
|
+
gap: x.value,
|
|
1957
|
+
minColumnWidth: De(d.masonry)
|
|
1958
1958
|
})), z = [];
|
|
1959
1959
|
function B() {
|
|
1960
|
-
let e = N -
|
|
1960
|
+
let e = N - k.value + C.value + Oe(d.masonry, C.value), t = M.value.reduce((e, t) => {
|
|
1961
1961
|
let n = z[t];
|
|
1962
1962
|
return n ? Math.max(e, n.y + n.height) : e;
|
|
1963
1963
|
}, 0);
|
|
1964
1964
|
return Math.max(e, t);
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1966
|
+
function ee() {
|
|
1967
1967
|
return M.value.reduce((e, t) => Math.max(e, t), -1);
|
|
1968
1968
|
}
|
|
1969
|
-
let
|
|
1969
|
+
let V = cn({
|
|
1970
1970
|
additionalHeight: r(() => R.value.additionalHeight),
|
|
1971
|
-
gap:
|
|
1971
|
+
gap: x,
|
|
1972
1972
|
items: () => d.items,
|
|
1973
1973
|
minColumnWidth: r(() => R.value.minColumnWidth),
|
|
1974
|
-
packThroughIndex:
|
|
1974
|
+
packThroughIndex: ee,
|
|
1975
1975
|
packUntilBottom: B,
|
|
1976
|
-
width:
|
|
1977
|
-
}),
|
|
1978
|
-
throughIndex:
|
|
1976
|
+
width: y
|
|
1977
|
+
}), 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), {
|
|
1978
|
+
throughIndex: ee(),
|
|
1979
1979
|
untilBottom: B()
|
|
1980
1980
|
})), K = r(() => {
|
|
1981
1981
|
let e = G.value;
|
|
@@ -1983,33 +1983,33 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
1983
1983
|
columns: e.columns,
|
|
1984
1984
|
height: e.height,
|
|
1985
1985
|
items: e.items
|
|
1986
|
-
} :
|
|
1987
|
-
}),
|
|
1986
|
+
} : H.value;
|
|
1987
|
+
}), te = r(() => {
|
|
1988
1988
|
let e = G.value;
|
|
1989
|
-
return e ?
|
|
1990
|
-
}),
|
|
1989
|
+
return e ? we(e.items, e.retainedIndices, U.value, e.fromIndex) : null;
|
|
1990
|
+
}), 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) => {
|
|
1991
1991
|
let t = d.items[e], n = K.value.items[e];
|
|
1992
1992
|
return !t || !n || n.width <= 0 || n.height <= 0 ? [] : [{
|
|
1993
|
-
fetchPriority:
|
|
1993
|
+
fetchPriority: re.value.has(e) ? "high" : "low",
|
|
1994
1994
|
index: e,
|
|
1995
1995
|
item: t
|
|
1996
1996
|
}];
|
|
1997
1997
|
}));
|
|
1998
|
-
function
|
|
1998
|
+
function ae(e, t) {
|
|
1999
1999
|
return [...new Set([...e, ...t])].sort((e, t) => e - t);
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function se(e, t) {
|
|
2002
2002
|
return e.length === t.length && e.every((e, n) => e === t[n]);
|
|
2003
2003
|
}
|
|
2004
|
-
function
|
|
2004
|
+
function ce(e) {
|
|
2005
2005
|
let t = {
|
|
2006
|
-
scrollTop: N -
|
|
2007
|
-
viewportHeight:
|
|
2008
|
-
}, n =
|
|
2006
|
+
scrollTop: N - k.value,
|
|
2007
|
+
viewportHeight: C.value
|
|
2008
|
+
}, n = te.value, r = Ee(n ?? U.value, {
|
|
2009
2009
|
...t,
|
|
2010
2010
|
overscan: e
|
|
2011
2011
|
}).indices;
|
|
2012
|
-
return
|
|
2012
|
+
return ae(r, d.leavingPostIds.size === 0 ? [] : Ee(U.value, {
|
|
2013
2013
|
...t,
|
|
2014
2014
|
overscan: e
|
|
2015
2015
|
}).indices.filter((e) => {
|
|
@@ -2017,28 +2017,28 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
2017
2017
|
return t !== void 0 && d.leavingPostIds.has(t.postId);
|
|
2018
2018
|
}));
|
|
2019
2019
|
}
|
|
2020
|
-
function
|
|
2021
|
-
let e =
|
|
2022
|
-
|
|
2023
|
-
let n =
|
|
2020
|
+
function le() {
|
|
2021
|
+
let e = ce(0), t = ce(Oe(d.masonry, C.value));
|
|
2022
|
+
se(j.value, e) || (j.value = e);
|
|
2023
|
+
let n = pe(K.value.items, e.filter((e) => {
|
|
2024
2024
|
let t = d.items[e];
|
|
2025
2025
|
return t && !d.leavingPostIds.has(t.postId);
|
|
2026
2026
|
}), {
|
|
2027
|
-
scrollTop: N -
|
|
2028
|
-
viewportHeight:
|
|
2027
|
+
scrollTop: N - k.value,
|
|
2028
|
+
viewportHeight: C.value
|
|
2029
2029
|
});
|
|
2030
|
-
|
|
2030
|
+
se(A.value, n) || (A.value = n), se(M.value, t) || (M.value = t);
|
|
2031
2031
|
}
|
|
2032
2032
|
function X() {
|
|
2033
2033
|
if (L !== null) return;
|
|
2034
2034
|
L = -1;
|
|
2035
2035
|
let e = requestAnimationFrame(() => {
|
|
2036
|
-
L = null,
|
|
2036
|
+
L = null, le();
|
|
2037
2037
|
});
|
|
2038
2038
|
L !== null && (L = e);
|
|
2039
2039
|
}
|
|
2040
|
-
|
|
2041
|
-
fullyVisibleIndices: () =>
|
|
2040
|
+
on({
|
|
2041
|
+
fullyVisibleIndices: () => A.value,
|
|
2042
2042
|
items: () => d.items,
|
|
2043
2043
|
mediaIndices: () => d.mediaIndices,
|
|
2044
2044
|
onFullyVisible: (e, t) => f("fullyVisible", e, t),
|
|
@@ -2046,12 +2046,12 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
2046
2046
|
previewStates: () => d.previewStates,
|
|
2047
2047
|
visibleIndices: () => j.value
|
|
2048
2048
|
});
|
|
2049
|
-
function
|
|
2049
|
+
function Z(e) {
|
|
2050
2050
|
let t = K.value.items[e], n = d.items[e]?.postId;
|
|
2051
2051
|
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(
|
|
2054
|
-
gap:
|
|
2052
|
+
let r = n !== void 0 && d.enteringPostIds.has(n), i = n !== void 0 && d.leavingPostIds.has(n), a = r || i ? ue({
|
|
2053
|
+
containerHeight: Math.max(T.value, H.value.height),
|
|
2054
|
+
gap: x.value
|
|
2055
2055
|
}) : 0, o = n === void 0 ? 0 : i ? d.removalDelays.get(n) ?? 0 : r ? d.entryDelays.get(n) ?? 0 : 0;
|
|
2056
2056
|
return {
|
|
2057
2057
|
"--masonry-entry-delay": `${o}ms`,
|
|
@@ -2060,70 +2060,70 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
2060
2060
|
transform: `translate3d(${t.x}px, ${t.y + a}px, 0)`
|
|
2061
2061
|
};
|
|
2062
2062
|
}
|
|
2063
|
-
function
|
|
2063
|
+
function de() {
|
|
2064
2064
|
let e = p.value;
|
|
2065
2065
|
if (!e) return;
|
|
2066
|
-
N = e.scrollTop,
|
|
2066
|
+
N = e.scrollTop, C.value = e.clientHeight;
|
|
2067
2067
|
let t = e.ownerDocument.defaultView?.getComputedStyle(e), n = (Number.parseFloat(t?.paddingTop ?? "") || 0) + (Number.parseFloat(t?.paddingBottom ?? "") || 0);
|
|
2068
|
-
|
|
2069
|
-
let r =
|
|
2070
|
-
r && (
|
|
2068
|
+
T.value = Math.max(0, e.clientHeight - n);
|
|
2069
|
+
let r = g.value;
|
|
2070
|
+
r && (k.value = r.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop, le());
|
|
2071
2071
|
}
|
|
2072
|
-
function
|
|
2072
|
+
function fe(e) {
|
|
2073
2073
|
let t = e.ownerDocument.documentElement.clientWidth;
|
|
2074
|
-
|
|
2074
|
+
y.value = e.clientWidth, x.value = Math.min(pn, Math.max(fn, t * .0075)), de();
|
|
2075
2075
|
}
|
|
2076
|
-
function
|
|
2076
|
+
function Q(e) {
|
|
2077
2077
|
let t = e.currentTarget;
|
|
2078
|
-
t && (N = t.scrollTop,
|
|
2078
|
+
t && (N = t.scrollTop, V.ensurePackedThrough(B()), X(), Date.now() >= l && !d.loadMoreLocked && d.infiniteScroll && Y(t, d.masonry?.loadMoreThresholdPx) && f("loadMore"));
|
|
2079
2079
|
}
|
|
2080
|
-
function
|
|
2080
|
+
function me() {
|
|
2081
2081
|
let e = p.value;
|
|
2082
|
-
Date.now() >= l && !d.loadMoreLocked && e &&
|
|
2082
|
+
Date.now() >= l && !d.loadMoreLocked && e && Y(e, d.masonry?.loadMoreThresholdPx) && f("loadMore");
|
|
2083
2083
|
}
|
|
2084
|
-
|
|
2085
|
-
e > 0 && e < t && (l = Date.now() +
|
|
2084
|
+
O(() => d.items.length, (e, t) => {
|
|
2085
|
+
e > 0 && e < t && (l = Date.now() + mn);
|
|
2086
2086
|
});
|
|
2087
2087
|
function he() {
|
|
2088
2088
|
return p.value;
|
|
2089
2089
|
}
|
|
2090
|
-
return
|
|
2091
|
-
P?.disconnect(), P = null, I !== null && cancelAnimationFrame(I), e && (
|
|
2090
|
+
return O(g, (e) => {
|
|
2091
|
+
P?.disconnect(), P = null, I !== null && cancelAnimationFrame(I), e && (fe(e), !(typeof ResizeObserver > "u") && (P = new ResizeObserver(([t]) => {
|
|
2092
2092
|
let n = t?.contentRect.width ?? e.clientWidth;
|
|
2093
|
-
Math.abs(n -
|
|
2094
|
-
I = null,
|
|
2093
|
+
Math.abs(n - y.value) < .5 || (I = requestAnimationFrame(() => {
|
|
2094
|
+
I = null, fe(e);
|
|
2095
2095
|
}));
|
|
2096
2096
|
}), P.observe(e)));
|
|
2097
|
-
}),
|
|
2098
|
-
F?.disconnect(), F = null, e && (
|
|
2099
|
-
}),
|
|
2097
|
+
}), O(p, (e) => {
|
|
2098
|
+
F?.disconnect(), F = null, e && (de(), !(typeof ResizeObserver > "u") && (F = new ResizeObserver(de), F.observe(e)));
|
|
2099
|
+
}), O(K, (e) => {
|
|
2100
2100
|
z = e.items;
|
|
2101
|
-
}, { flush: "sync" }),
|
|
2102
|
-
|
|
2101
|
+
}, { flush: "sync" }), O([
|
|
2102
|
+
H,
|
|
2103
2103
|
K,
|
|
2104
2104
|
() => d.masonry
|
|
2105
|
-
],
|
|
2105
|
+
], le, { flush: "post" }), v(() => {
|
|
2106
2106
|
P?.disconnect(), F?.disconnect(), I !== null && cancelAnimationFrame(I), L !== null && cancelAnimationFrame(L);
|
|
2107
2107
|
}), n({
|
|
2108
2108
|
getScrollElement: he,
|
|
2109
|
-
loadIfNearBottom:
|
|
2110
|
-
}), (n, r) => (
|
|
2109
|
+
loadIfNearBottom: me
|
|
2110
|
+
}), (n, r) => (b(), s("div", ln, [
|
|
2111
2111
|
c("main", {
|
|
2112
2112
|
id: m,
|
|
2113
2113
|
ref_key: "galleryElement",
|
|
2114
2114
|
ref: p,
|
|
2115
|
-
class:
|
|
2115
|
+
class: h(["gallery-shell masonry-feed", { "masonry-feed--suspended": t.suspended }]),
|
|
2116
2116
|
"data-layout-mode": "masonry",
|
|
2117
2117
|
"aria-hidden": t.suspended || void 0,
|
|
2118
2118
|
inert: t.suspended || void 0,
|
|
2119
|
-
onScrollPassive:
|
|
2119
|
+
onScrollPassive: Q
|
|
2120
2120
|
}, [c("section", {
|
|
2121
2121
|
ref_key: "masonryElement",
|
|
2122
|
-
ref:
|
|
2123
|
-
class:
|
|
2124
|
-
style:
|
|
2122
|
+
ref: g,
|
|
2123
|
+
class: h(["masonry", { "masonry--ready": y.value > 0 }]),
|
|
2124
|
+
style: _(J.value),
|
|
2125
2125
|
"aria-label": "Media gallery"
|
|
2126
|
-
}, [(
|
|
2126
|
+
}, [(b(!0), s(e, null, S(ie.value, ({ fetchPriority: e, item: n, index: r }) => (b(), a(an, {
|
|
2127
2127
|
key: n.postId,
|
|
2128
2128
|
class: "masonry-item",
|
|
2129
2129
|
entering: t.enteringPostIds.has(n.postId),
|
|
@@ -2132,15 +2132,15 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
2132
2132
|
"card-footer": t.cardFooter,
|
|
2133
2133
|
"card-header": t.cardHeader,
|
|
2134
2134
|
"media-card": t.mediaCard,
|
|
2135
|
-
"in-viewport":
|
|
2135
|
+
"in-viewport": re.value.has(r),
|
|
2136
2136
|
index: r,
|
|
2137
2137
|
item: n,
|
|
2138
|
-
"item-style":
|
|
2138
|
+
"item-style": Z(r),
|
|
2139
2139
|
interactive: "",
|
|
2140
2140
|
layout: "masonry",
|
|
2141
2141
|
"loaded-count": t.items.length,
|
|
2142
2142
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2143
|
-
"preview-state": t.previewStates.get(
|
|
2143
|
+
"preview-state": t.previewStates.get(E(W)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2144
2144
|
total: t.total,
|
|
2145
2145
|
onActivate: (e) => f("activate", n.postId, e),
|
|
2146
2146
|
onMediaChange: (e) => f("mediaChange", n.postId, e),
|
|
@@ -2167,13 +2167,13 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
2167
2167
|
"onReady",
|
|
2168
2168
|
"onError",
|
|
2169
2169
|
"onMediaError"
|
|
2170
|
-
]))), 128))], 6), t.masonry?.bottomSpacePx ? (
|
|
2170
|
+
]))), 128))], 6), t.masonry?.bottomSpacePx ? (b(), s("div", {
|
|
2171
2171
|
key: 0,
|
|
2172
2172
|
class: "masonry-bottom-space",
|
|
2173
2173
|
"aria-hidden": "true",
|
|
2174
|
-
style:
|
|
2175
|
-
}, null, 4)) : o("", !0)], 42,
|
|
2176
|
-
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext &&
|
|
2174
|
+
style: _({ flex: `0 0 ${t.masonry.bottomSpacePx}px` })
|
|
2175
|
+
}, null, 4)) : o("", !0)], 42, un),
|
|
2176
|
+
t.feedFooter || t.isLoadingMore || t.nextPageError || t.hasNext && ne.value || !t.hasNext && t.canRetryEnd ? (b(), s("div", dn, [u(oe, {
|
|
2177
2177
|
actions: t.feedFooterActions,
|
|
2178
2178
|
"can-retry-end": t.canRetryEnd,
|
|
2179
2179
|
"feed-footer": t.feedFooter,
|
|
@@ -2181,7 +2181,7 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
2181
2181
|
"has-next": t.hasNext,
|
|
2182
2182
|
"is-loading": t.isLoadingMore,
|
|
2183
2183
|
"load-more-locked": t.loadMoreLocked,
|
|
2184
|
-
"show-load-more":
|
|
2184
|
+
"show-load-more": ne.value,
|
|
2185
2185
|
state: t.state,
|
|
2186
2186
|
onLoadMore: r[0] ||= (e) => f("loadMore"),
|
|
2187
2187
|
onRetryEnd: r[1] ||= (e) => f("retryEnd")
|
|
@@ -2196,7 +2196,7 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
2196
2196
|
"show-load-more",
|
|
2197
2197
|
"state"
|
|
2198
2198
|
])])) : o("", !0),
|
|
2199
|
-
u(
|
|
2199
|
+
u(Le, {
|
|
2200
2200
|
"content-size": K.value.height,
|
|
2201
2201
|
"controls-id": m,
|
|
2202
2202
|
"scroll-element": p.value,
|
|
@@ -2208,41 +2208,28 @@ var dn = { class: "masonry-feed-shell" }, fn = ["aria-hidden", "inert"], pn = {
|
|
|
2208
2208
|
])
|
|
2209
2209
|
]));
|
|
2210
2210
|
}
|
|
2211
|
-
}),
|
|
2212
|
-
function
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
function bn(e, t, n, r) {
|
|
2216
|
-
if (r?.aborted) return Promise.resolve();
|
|
2217
|
-
let i = e.scrollTop;
|
|
2218
|
-
if (n || Math.abs(i - t) <= 1) return e.scrollTop = t, Promise.resolve();
|
|
2211
|
+
}), gn = 300;
|
|
2212
|
+
function _n(e, t, n) {
|
|
2213
|
+
let r = e.scrollTop;
|
|
2214
|
+
if (n || Math.abs(r - t) <= 1) return e.scrollTop = t, Promise.resolve();
|
|
2219
2215
|
e.setAttribute("data-transitioning", "");
|
|
2220
|
-
let
|
|
2216
|
+
let i = performance.now(), a = 0;
|
|
2221
2217
|
return new Promise((n) => {
|
|
2222
|
-
let
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
o += 1;
|
|
2228
|
-
let r = Math.max(n - a, 1e3 / 60 * o), u = Math.min(1, r / vn), d = 1 - (1 - u) ** 3;
|
|
2229
|
-
if (e.scrollTop = i + (t - i) * d, u < 1) {
|
|
2230
|
-
s = requestAnimationFrame(l);
|
|
2218
|
+
let o = (s) => {
|
|
2219
|
+
a += 1;
|
|
2220
|
+
let c = Math.max(s - i, 1e3 / 60 * a), l = Math.min(1, c / gn), u = 1 - (1 - l) ** 3;
|
|
2221
|
+
if (e.scrollTop = r + (t - r) * u, l < 1) {
|
|
2222
|
+
requestAnimationFrame(o);
|
|
2231
2223
|
return;
|
|
2232
2224
|
}
|
|
2233
|
-
e.scrollTop = t,
|
|
2225
|
+
e.removeAttribute("data-transitioning"), e.scrollTop = t, n();
|
|
2234
2226
|
};
|
|
2235
|
-
|
|
2227
|
+
requestAnimationFrame(o);
|
|
2236
2228
|
});
|
|
2237
2229
|
}
|
|
2238
2230
|
//#endregion
|
|
2239
|
-
//#region src/core/reelViewport.ts
|
|
2240
|
-
function xn(e, t, n) {
|
|
2241
|
-
return t <= 0 || n <= 0 ? 0 : Math.min(n - 1, Math.max(0, Math.round(e / t)));
|
|
2242
|
-
}
|
|
2243
|
-
//#endregion
|
|
2244
2231
|
//#region src/components/ReelAutoAdvanceProgress.vue?vue&type=script&setup=true&lang.ts
|
|
2245
|
-
var
|
|
2232
|
+
var vn = ["aria-label"], yn = /* @__PURE__ */ d({
|
|
2246
2233
|
__name: "ReelAutoAdvanceProgress",
|
|
2247
2234
|
props: {
|
|
2248
2235
|
durationMs: {},
|
|
@@ -2251,18 +2238,18 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2251
2238
|
emits: ["complete"],
|
|
2252
2239
|
setup(e, { emit: t }) {
|
|
2253
2240
|
let n = e, i = t, a = r(() => ({ "--vibe-reel-auto-advance-duration": `${n.durationMs}ms` }));
|
|
2254
|
-
return (t, n) => (
|
|
2241
|
+
return (t, n) => (b(), s("div", {
|
|
2255
2242
|
class: "reel-auto-advance",
|
|
2256
2243
|
"data-test": "reel-auto-advance",
|
|
2257
2244
|
role: "timer",
|
|
2258
2245
|
"aria-label": e.label
|
|
2259
2246
|
}, [c("span", {
|
|
2260
2247
|
class: "reel-auto-advance-progress",
|
|
2261
|
-
style:
|
|
2248
|
+
style: _(a.value),
|
|
2262
2249
|
onAnimationend: n[0] ||= (e) => i("complete")
|
|
2263
|
-
}, null, 36)], 8,
|
|
2250
|
+
}, null, 36)], 8, vn));
|
|
2264
2251
|
}
|
|
2265
|
-
}),
|
|
2252
|
+
}), bn = { class: "reel-viewport" }, xn = ["data-active-post-id", "data-active-media-index"], Sn = ["role", "data-status"], Cn = ["disabled"], wn = 300, Tn = 250, En = /* @__PURE__ */ d({
|
|
2266
2253
|
__name: "ReelFeed",
|
|
2267
2254
|
props: {
|
|
2268
2255
|
initialPostId: {},
|
|
@@ -2302,160 +2289,163 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2302
2289
|
"retryForward"
|
|
2303
2290
|
],
|
|
2304
2291
|
setup(t, { expose: n, emit: i }) {
|
|
2305
|
-
let l = 0, u = t, d = i, f =
|
|
2306
|
-
let e = Math.max(0,
|
|
2292
|
+
let l = 0, u = t, d = i, f = w(null), p = w(null), g = u.initialPostId === null || u.initialPostId === void 0 ? -1 : u.items.findIndex((e) => e.postId === u.initialPostId), x = w(Math.max(0, g)), C = w(!1), D = w(!1), k = 0, A = null, j = null, M = null, N = r(() => ({ gridTemplateRows: `repeat(${u.items.length}, 100cqh)` })), P = r(() => {
|
|
2293
|
+
let e = Math.max(0, x.value - 2), t = Math.min(u.items.length - 1, x.value + 2);
|
|
2307
2294
|
return u.items.slice(e, t + 1).map((t, n) => ({
|
|
2308
|
-
fetchPriority: e + n ===
|
|
2295
|
+
fetchPriority: e + n === x.value ? "high" : "low",
|
|
2309
2296
|
index: e + n,
|
|
2310
2297
|
item: t
|
|
2311
2298
|
}));
|
|
2312
|
-
}), F = r(() => u.items[
|
|
2299
|
+
}), F = r(() => u.items[x.value]?.postId), I = r(() => u.items[x.value]), R = r(() => {
|
|
2313
2300
|
let e = F.value;
|
|
2314
2301
|
return e === void 0 ? 0 : u.mediaIndices.get(e) ?? 0;
|
|
2315
|
-
}),
|
|
2302
|
+
}), z = r(() => {
|
|
2316
2303
|
let e = F.value;
|
|
2317
|
-
return e === void 0 ? "loading" : u.previewStates.get(
|
|
2318
|
-
}), B = r(() => I.value ?
|
|
2304
|
+
return e === void 0 ? "loading" : u.previewStates.get(W(e, R.value)) ?? "loading";
|
|
2305
|
+
}), 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(() => [
|
|
2319
2306
|
F.value,
|
|
2320
|
-
|
|
2307
|
+
R.value,
|
|
2321
2308
|
u.items.length,
|
|
2322
2309
|
u.loadMoreLocked,
|
|
2323
2310
|
u.reelAutoAdvance.enabled,
|
|
2324
2311
|
u.reelAutoAdvance.includePostItems,
|
|
2325
2312
|
u.reelAutoAdvance.intervalMs
|
|
2326
|
-
].join(":")),
|
|
2327
|
-
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems &&
|
|
2313
|
+
].join(":")), te = r(() => {
|
|
2314
|
+
let e = I.value, t = !!(e && u.reelAutoAdvance.includePostItems && R.value < V(e).length - 1), n = u.reelAutoAdvance.intervalMs / 1e3;
|
|
2328
2315
|
return `Auto advance to the next ${t ? "post item" : "post"} in ${n}s`;
|
|
2329
|
-
}),
|
|
2330
|
-
function re(e) {
|
|
2331
|
-
return { gridRow: `${e + 1}` };
|
|
2332
|
-
}
|
|
2316
|
+
}), 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.");
|
|
2333
2317
|
function ie(e) {
|
|
2334
|
-
|
|
2335
|
-
return xn(e.scrollTop, t, u.items.length);
|
|
2318
|
+
return { gridRow: `${e + 1}` };
|
|
2336
2319
|
}
|
|
2337
2320
|
function ae(e) {
|
|
2321
|
+
let t = k || e.clientHeight;
|
|
2322
|
+
return t <= 0 || u.items.length === 0 ? 0 : Math.min(u.items.length - 1, Math.max(0, Math.round(e.scrollTop / t)));
|
|
2323
|
+
}
|
|
2324
|
+
function se(e) {
|
|
2338
2325
|
let t = e.currentTarget;
|
|
2339
2326
|
if (!t) return;
|
|
2340
|
-
let n =
|
|
2341
|
-
|
|
2327
|
+
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 || (x.value = ae(t)), Date.now() >= l && !u.loadMoreLocked && u.infiniteScroll && Y(t) && d("loadMore");
|
|
2342
2329
|
}
|
|
2343
|
-
function
|
|
2330
|
+
function ce() {
|
|
2344
2331
|
let e = f.value;
|
|
2345
|
-
e && (
|
|
2346
|
-
e.scrollTop =
|
|
2347
|
-
}),
|
|
2332
|
+
e && (C.value = !1, Z(!0), k = e.clientHeight, e.scrollTop = x.value * k, j !== null && cancelAnimationFrame(j), j = requestAnimationFrame(() => {
|
|
2333
|
+
e.scrollTop = x.value * e.clientHeight, k = e.clientHeight, j = null;
|
|
2334
|
+
}), le());
|
|
2348
2335
|
}
|
|
2349
|
-
function
|
|
2336
|
+
function le() {
|
|
2350
2337
|
M !== null && clearTimeout(M), M = setTimeout(() => {
|
|
2351
2338
|
M = null;
|
|
2352
2339
|
let e = f.value;
|
|
2353
|
-
e && (
|
|
2340
|
+
e && (k = e.clientHeight, e.scrollTop = x.value * k), Z(!1);
|
|
2354
2341
|
}, 120);
|
|
2355
2342
|
}
|
|
2356
2343
|
function X() {
|
|
2357
|
-
|
|
2344
|
+
Z(!0);
|
|
2358
2345
|
let e = f.value;
|
|
2359
|
-
e && (
|
|
2346
|
+
e && (k = e.clientHeight, e.scrollTop = x.value * k), le();
|
|
2360
2347
|
}
|
|
2361
|
-
function
|
|
2362
|
-
|
|
2348
|
+
function Z(e) {
|
|
2349
|
+
D.value = e, f.value?.toggleAttribute("data-resizing", e);
|
|
2363
2350
|
}
|
|
2364
|
-
function
|
|
2351
|
+
function ue() {
|
|
2365
2352
|
let e = f.value;
|
|
2366
|
-
Date.now() >= l && !u.loadMoreLocked && e &&
|
|
2353
|
+
Date.now() >= l && !u.loadMoreLocked && e && Y(e) && d("loadMore");
|
|
2367
2354
|
}
|
|
2368
|
-
|
|
2369
|
-
e > 0 && e < t && (l = Date.now() +
|
|
2355
|
+
O(() => u.items.length, (e, t) => {
|
|
2356
|
+
e > 0 && e < t && (l = Date.now() + Tn);
|
|
2370
2357
|
});
|
|
2371
2358
|
function de(e) {
|
|
2372
2359
|
let t = I.value;
|
|
2373
2360
|
if (!t) return !1;
|
|
2374
|
-
let n =
|
|
2361
|
+
let n = V(t).length;
|
|
2375
2362
|
if (n <= 1) return !1;
|
|
2376
|
-
let r = (
|
|
2363
|
+
let r = (R.value + e + n) % n;
|
|
2377
2364
|
return d("mediaChange", t.postId, r), !0;
|
|
2378
2365
|
}
|
|
2379
2366
|
function fe(e) {
|
|
2380
|
-
let t =
|
|
2381
|
-
return !f.value || t < 0 || t >= u.items.length ? !1 : (
|
|
2367
|
+
let t = x.value + e;
|
|
2368
|
+
return !f.value || t < 0 || t >= u.items.length ? !1 : (he(t), !0);
|
|
2382
2369
|
}
|
|
2383
2370
|
function pe(e, t) {
|
|
2384
2371
|
let n = u.items.findIndex((t) => t.postId === e), r = u.items[n];
|
|
2385
|
-
return !f.value || !r || t < 0 || t > r.items.length ? !1 : ((u.mediaIndices.get(e) ?? 0) !== t && d("mediaChange", e, t), n !==
|
|
2372
|
+
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);
|
|
2386
2373
|
}
|
|
2387
|
-
function Q(
|
|
2374
|
+
function Q() {
|
|
2375
|
+
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2376
|
+
}
|
|
2377
|
+
function me(e) {
|
|
2388
2378
|
let t = f.value;
|
|
2389
2379
|
if (!t) return Promise.resolve();
|
|
2390
|
-
let n = e * (
|
|
2391
|
-
return
|
|
2380
|
+
let n = e * (k || t.clientHeight);
|
|
2381
|
+
return x.value = e, _n(t, n, Q());
|
|
2392
2382
|
}
|
|
2393
|
-
function
|
|
2394
|
-
|
|
2383
|
+
function he(e) {
|
|
2384
|
+
me(e);
|
|
2395
2385
|
}
|
|
2396
|
-
async function
|
|
2386
|
+
async function ge(e) {
|
|
2397
2387
|
let t = u.items.findIndex((t) => t.postId === e);
|
|
2398
|
-
return t < 0 || t ===
|
|
2388
|
+
return t < 0 || t === x.value ? !1 : (await me(t), !0);
|
|
2399
2389
|
}
|
|
2400
|
-
async function
|
|
2401
|
-
return de(e) ? (
|
|
2390
|
+
async function _e(e) {
|
|
2391
|
+
return de(e) ? (Q() || await new Promise((e) => setTimeout(e, wn)), !0) : !1;
|
|
2402
2392
|
}
|
|
2403
|
-
function
|
|
2393
|
+
function ve() {
|
|
2404
2394
|
if (!u.reelAutoAdvance.enabled) return;
|
|
2405
2395
|
let e = I.value;
|
|
2406
2396
|
if (!e) return;
|
|
2407
|
-
if (u.reelAutoAdvance.includePostItems &&
|
|
2408
|
-
d("mediaChange", e.postId,
|
|
2397
|
+
if (u.reelAutoAdvance.includePostItems && R.value < V(e).length - 1) {
|
|
2398
|
+
d("mediaChange", e.postId, R.value + 1);
|
|
2409
2399
|
return;
|
|
2410
2400
|
}
|
|
2411
|
-
let t =
|
|
2401
|
+
let t = x.value + 1, n = u.items[t];
|
|
2412
2402
|
if (!n) {
|
|
2413
2403
|
u.hasNext && u.infiniteScroll && !u.loadMoreLocked && d("loadMore");
|
|
2414
2404
|
return;
|
|
2415
2405
|
}
|
|
2416
|
-
u.reelAutoAdvance.includePostItems && (u.mediaIndices.get(n.postId) ?? 0) !== 0 && d("mediaChange", n.postId, 0),
|
|
2406
|
+
u.reelAutoAdvance.includePostItems && (u.mediaIndices.get(n.postId) ?? 0) !== 0 && d("mediaChange", n.postId, 0), he(t);
|
|
2417
2407
|
}
|
|
2418
|
-
function
|
|
2419
|
-
!u.reelAutoAdvance.enabled || e !== F.value || t !==
|
|
2408
|
+
function ye(e, t) {
|
|
2409
|
+
!u.reelAutoAdvance.enabled || e !== F.value || t !== R.value || !G.value || ve();
|
|
2420
2410
|
}
|
|
2421
|
-
return
|
|
2422
|
-
|
|
2423
|
-
}),
|
|
2411
|
+
return O(f, (e) => {
|
|
2412
|
+
A?.disconnect(), A = null, e && (k = e.clientHeight, !(typeof ResizeObserver > "u") && (A = new ResizeObserver(ce), A.observe(e)));
|
|
2413
|
+
}), O(() => u.items.length, async (e) => {
|
|
2424
2414
|
let t = u.initialPostId, n = t == null ? -1 : u.items.findIndex(({ postId: e }) => e === t);
|
|
2425
|
-
|
|
2426
|
-
}),
|
|
2415
|
+
x.value = n >= 0 ? n : Math.min(x.value, Math.max(0, e - 1)), await m(), ce();
|
|
2416
|
+
}), O(F, (e) => {
|
|
2427
2417
|
e !== void 0 && d("activeChange", e);
|
|
2428
|
-
}, { immediate: !0 }),
|
|
2429
|
-
window.addEventListener("resize", X), window.addEventListener("orientationchange", X),
|
|
2430
|
-
}),
|
|
2431
|
-
window.removeEventListener("resize", X), window.removeEventListener("orientationchange", X),
|
|
2418
|
+
}, { immediate: !0 }), y(() => {
|
|
2419
|
+
window.addEventListener("resize", X), window.addEventListener("orientationchange", X), g >= 0 && m(ce);
|
|
2420
|
+
}), v(() => {
|
|
2421
|
+
window.removeEventListener("resize", X), window.removeEventListener("orientationchange", X), A?.disconnect(), j !== null && cancelAnimationFrame(j), M !== null && clearTimeout(M);
|
|
2432
2422
|
}), n({
|
|
2433
|
-
activeIndex:
|
|
2423
|
+
activeIndex: x,
|
|
2434
2424
|
activePostId: F,
|
|
2435
2425
|
changeActiveMedia: de,
|
|
2436
|
-
loadIfNearBottom:
|
|
2426
|
+
loadIfNearBottom: ue,
|
|
2437
2427
|
moveActivePost: fe,
|
|
2438
2428
|
navigateToItem: pe,
|
|
2439
|
-
transitionActiveMedia:
|
|
2440
|
-
transitionActivePost:
|
|
2441
|
-
}), (n, r) => (
|
|
2442
|
-
class:
|
|
2429
|
+
transitionActiveMedia: _e,
|
|
2430
|
+
transitionActivePost: ge
|
|
2431
|
+
}), (n, r) => (b(), s("main", {
|
|
2432
|
+
class: h(["reel-shell", {
|
|
2443
2433
|
"reel-shell--has-footer": !!t.cardFooter,
|
|
2444
2434
|
"reel-shell--has-header": !!t.cardHeader
|
|
2445
2435
|
}]),
|
|
2446
2436
|
"data-layout-mode": "reel"
|
|
2447
2437
|
}, [
|
|
2448
|
-
t.cardHeader && I.value && t.reelForward.status === "idle" ? (
|
|
2438
|
+
t.cardHeader && I.value && t.reelForward.status === "idle" ? (b(), a(rt, {
|
|
2449
2439
|
key: 0,
|
|
2450
|
-
index:
|
|
2440
|
+
index: x.value,
|
|
2451
2441
|
item: I.value,
|
|
2452
2442
|
layout: "reel",
|
|
2453
2443
|
"loaded-count": t.items.length,
|
|
2454
|
-
"media-index":
|
|
2444
|
+
"media-index": R.value,
|
|
2455
2445
|
"media-source": t.mediaSource,
|
|
2456
2446
|
placement: "header",
|
|
2457
2447
|
region: t.cardHeader,
|
|
2458
|
-
style:
|
|
2448
|
+
style: _(t.mediaCard?.header),
|
|
2459
2449
|
total: t.total
|
|
2460
2450
|
}, null, 8, [
|
|
2461
2451
|
"index",
|
|
@@ -2467,40 +2457,40 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2467
2457
|
"style",
|
|
2468
2458
|
"total"
|
|
2469
2459
|
])) : o("", !0),
|
|
2470
|
-
c("div",
|
|
2460
|
+
c("div", bn, [c("div", {
|
|
2471
2461
|
ref_key: "galleryElement",
|
|
2472
2462
|
ref: f,
|
|
2473
2463
|
class: "gallery-shell reel-feed",
|
|
2474
2464
|
"data-active-post-id": F.value,
|
|
2475
|
-
"data-active-media-index":
|
|
2476
|
-
onScrollPassive:
|
|
2477
|
-
}, [t.reelForward.status === "idle" ? (
|
|
2465
|
+
"data-active-media-index": R.value,
|
|
2466
|
+
onScrollPassive: se
|
|
2467
|
+
}, [t.reelForward.status === "idle" ? (b(), s("section", {
|
|
2478
2468
|
key: 1,
|
|
2479
2469
|
class: "reel-track",
|
|
2480
|
-
style:
|
|
2470
|
+
style: _(N.value),
|
|
2481
2471
|
"aria-label": "Media gallery"
|
|
2482
|
-
}, [(
|
|
2472
|
+
}, [(b(!0), s(e, null, S(P.value, ({ fetchPriority: e, item: n, index: i }) => (b(), a(an, {
|
|
2483
2473
|
key: n.postId,
|
|
2484
|
-
active: i ===
|
|
2485
|
-
"advance-on-media-end": u.reelAutoAdvance.enabled && i ===
|
|
2474
|
+
active: i === x.value && !C.value,
|
|
2475
|
+
"advance-on-media-end": u.reelAutoAdvance.enabled && i === x.value,
|
|
2486
2476
|
class: "reel-item",
|
|
2487
2477
|
entering: !1,
|
|
2488
2478
|
"fetch-priority": e,
|
|
2489
2479
|
index: i,
|
|
2490
2480
|
item: n,
|
|
2491
|
-
"item-style":
|
|
2481
|
+
"item-style": ie(i),
|
|
2492
2482
|
"media-card": t.mediaCard,
|
|
2493
2483
|
layout: "reel",
|
|
2494
2484
|
"loaded-count": t.items.length,
|
|
2495
2485
|
"media-index": t.mediaIndices.get(n.postId) ?? 0,
|
|
2496
2486
|
"media-source": t.mediaSource,
|
|
2497
|
-
"preview-state": t.previewStates.get(
|
|
2487
|
+
"preview-state": t.previewStates.get(E(W)(n.postId, t.mediaIndices.get(n.postId) ?? 0)) ?? "loading",
|
|
2498
2488
|
"reel-controls-target": p.value,
|
|
2499
2489
|
"reel-audio-state": t.reelAudioState,
|
|
2500
2490
|
"stationary-reel-controls": "",
|
|
2501
2491
|
total: t.total,
|
|
2502
2492
|
onMediaChange: (e) => d("mediaChange", n.postId, e),
|
|
2503
|
-
onEnded: (e) =>
|
|
2493
|
+
onEnded: (e) => ye(n.postId, e),
|
|
2504
2494
|
onReady: (e) => d("ready", n.postId, e),
|
|
2505
2495
|
onReelAudioChange: r[1] ||= (e) => d("reelAudioChange", e),
|
|
2506
2496
|
onError: (e) => d("error", n.postId, e),
|
|
@@ -2525,18 +2515,18 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2525
2515
|
"onReady",
|
|
2526
2516
|
"onError",
|
|
2527
2517
|
"onMediaError"
|
|
2528
|
-
]))), 128))], 4)) : (
|
|
2518
|
+
]))), 128))], 4)) : (b(), s("div", {
|
|
2529
2519
|
key: 0,
|
|
2530
2520
|
class: "reel-forward-status",
|
|
2531
2521
|
role: t.reelForward.status === "error" ? "alert" : "status",
|
|
2532
2522
|
"data-status": t.reelForward.status
|
|
2533
|
-
}, [c("p", null,
|
|
2523
|
+
}, [c("p", null, T(re.value), 1), t.reelForward.status === "error" || t.reelForward.status === "end" ? (b(), s("button", {
|
|
2534
2524
|
key: 0,
|
|
2535
2525
|
class: "reel-forward-retry",
|
|
2536
2526
|
type: "button",
|
|
2537
2527
|
disabled: t.loadMoreLocked,
|
|
2538
2528
|
onClick: r[0] ||= (e) => d("retryForward")
|
|
2539
|
-
},
|
|
2529
|
+
}, T(ne.value ? "Load more" : "Retry"), 9, Cn)) : o("", !0)], 8, Sn)), t.reelForward.status === "idle" ? (b(), a(oe, {
|
|
2540
2530
|
key: 2,
|
|
2541
2531
|
actions: t.feedFooterActions,
|
|
2542
2532
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -2545,7 +2535,7 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2545
2535
|
"has-next": t.hasNext,
|
|
2546
2536
|
"is-loading": t.isLoadingMore,
|
|
2547
2537
|
"load-more-locked": t.loadMoreLocked,
|
|
2548
|
-
"show-load-more":
|
|
2538
|
+
"show-load-more": J.value,
|
|
2549
2539
|
state: t.state,
|
|
2550
2540
|
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2551
2541
|
onRetryEnd: r[3] ||= (e) => d("retryEnd")
|
|
@@ -2559,23 +2549,23 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2559
2549
|
"load-more-locked",
|
|
2560
2550
|
"show-load-more",
|
|
2561
2551
|
"state"
|
|
2562
|
-
])) : o("", !0)], 40,
|
|
2552
|
+
])) : o("", !0)], 40, xn), c("div", {
|
|
2563
2553
|
ref_key: "reelControlsElement",
|
|
2564
2554
|
ref: p,
|
|
2565
2555
|
class: "reel-media-controls-host",
|
|
2566
2556
|
"data-test": "reel-media-controls-host"
|
|
2567
2557
|
}, null, 512)]),
|
|
2568
|
-
t.cardFooter && I.value && t.reelForward.status === "idle" ? (
|
|
2558
|
+
t.cardFooter && I.value && t.reelForward.status === "idle" ? (b(), a(rt, {
|
|
2569
2559
|
key: 1,
|
|
2570
|
-
index:
|
|
2560
|
+
index: x.value,
|
|
2571
2561
|
item: I.value,
|
|
2572
2562
|
layout: "reel",
|
|
2573
2563
|
"loaded-count": t.items.length,
|
|
2574
|
-
"media-index":
|
|
2564
|
+
"media-index": R.value,
|
|
2575
2565
|
"media-source": t.mediaSource,
|
|
2576
2566
|
placement: "footer",
|
|
2577
2567
|
region: t.cardFooter,
|
|
2578
|
-
style:
|
|
2568
|
+
style: _(t.mediaCard?.footer),
|
|
2579
2569
|
total: t.total
|
|
2580
2570
|
}, null, 8, [
|
|
2581
2571
|
"index",
|
|
@@ -2587,24 +2577,24 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2587
2577
|
"style",
|
|
2588
2578
|
"total"
|
|
2589
2579
|
])) : o("", !0),
|
|
2590
|
-
|
|
2591
|
-
key:
|
|
2580
|
+
q.value ? (b(), a(yn, {
|
|
2581
|
+
key: K.value,
|
|
2592
2582
|
"duration-ms": t.reelAutoAdvance.intervalMs,
|
|
2593
|
-
label:
|
|
2594
|
-
onComplete:
|
|
2583
|
+
label: te.value,
|
|
2584
|
+
onComplete: ve
|
|
2595
2585
|
}, null, 8, ["duration-ms", "label"])) : o("", !0)
|
|
2596
2586
|
], 2));
|
|
2597
2587
|
}
|
|
2598
|
-
}),
|
|
2588
|
+
}), Dn = ["data-info-sheet-open", "data-info-sheet-mode"], On = ["aria-hidden", "inert"], kn = {
|
|
2599
2589
|
key: 0,
|
|
2600
2590
|
class: "reel-info-sheet-layer",
|
|
2601
2591
|
"data-test": "reel-info-sheet"
|
|
2602
|
-
},
|
|
2592
|
+
}, An = [
|
|
2603
2593
|
"role",
|
|
2604
2594
|
"aria-modal",
|
|
2605
2595
|
"tabindex",
|
|
2606
2596
|
"data-active-post-id"
|
|
2607
|
-
],
|
|
2597
|
+
], jn = /* @__PURE__ */ d({
|
|
2608
2598
|
__name: "ReelLayout",
|
|
2609
2599
|
props: {
|
|
2610
2600
|
forwardIndex: { default: null },
|
|
@@ -2651,23 +2641,23 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2651
2641
|
"retryForward"
|
|
2652
2642
|
],
|
|
2653
2643
|
setup(e, { expose: t, emit: i }) {
|
|
2654
|
-
let l = e, d = i, p =
|
|
2644
|
+
let l = e, d = i, p = w(null), _ = w(null), y = null, x = r(() => {
|
|
2655
2645
|
let e = l.initialPostId === null || l.initialPostId === void 0 ? -1 : l.items.findIndex((e) => e.postId === l.initialPostId);
|
|
2656
2646
|
return Math.max(0, e);
|
|
2657
|
-
}), S = r(() => l.items[
|
|
2658
|
-
let e =
|
|
2647
|
+
}), S = r(() => l.items[x.value]), T = r(() => S.value ?? (l.reelForward.status === "idle" ? void 0 : l.forwardItem ?? void 0)), E = r(() => S.value ? x.value : l.forwardIndex ?? 0), D = r(() => {
|
|
2648
|
+
let e = T.value?.postId;
|
|
2659
2649
|
return e === void 0 ? 0 : l.mediaIndices.get(e) ?? 0;
|
|
2660
|
-
}),
|
|
2661
|
-
let e =
|
|
2650
|
+
}), A = r(() => !!(l.infoSheet && l.infoSheetEnabled && T.value)), j = r(() => {
|
|
2651
|
+
let e = T.value;
|
|
2662
2652
|
return e ? {
|
|
2663
2653
|
close: M,
|
|
2664
|
-
index:
|
|
2654
|
+
index: E.value,
|
|
2665
2655
|
item: e,
|
|
2666
2656
|
layout: "reel",
|
|
2667
2657
|
loadedCount: l.items.length,
|
|
2668
|
-
mediaCount:
|
|
2658
|
+
mediaCount: V(e).length,
|
|
2669
2659
|
mediaIndex: D.value,
|
|
2670
|
-
mediaItem:
|
|
2660
|
+
mediaItem: U(e, D.value),
|
|
2671
2661
|
mediaSource: l.mediaSource ?? "preview",
|
|
2672
2662
|
origin: l.origin,
|
|
2673
2663
|
total: l.total
|
|
@@ -2700,23 +2690,23 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2700
2690
|
function B(e, t) {
|
|
2701
2691
|
d("mediaChange", e, t);
|
|
2702
2692
|
}
|
|
2703
|
-
function
|
|
2693
|
+
function ee(e, t) {
|
|
2704
2694
|
d("ready", e, t);
|
|
2705
2695
|
}
|
|
2706
|
-
return
|
|
2696
|
+
return O(() => ({
|
|
2707
2697
|
overlay: l.infoSheetOverlay,
|
|
2708
|
-
visible:
|
|
2698
|
+
visible: A.value
|
|
2709
2699
|
}), async (e, t) => {
|
|
2710
2700
|
if (e.visible && !t?.visible) {
|
|
2711
|
-
|
|
2701
|
+
y = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.overlay && (await m(), _.value?.focus({ preventScroll: !0 }));
|
|
2712
2702
|
return;
|
|
2713
2703
|
}
|
|
2714
|
-
if (!e.visible && t?.visible &&
|
|
2715
|
-
let e =
|
|
2716
|
-
|
|
2704
|
+
if (!e.visible && t?.visible && y?.isConnected) {
|
|
2705
|
+
let e = y;
|
|
2706
|
+
y = null, await m(), e.focus({ preventScroll: !0 });
|
|
2717
2707
|
}
|
|
2718
|
-
}),
|
|
2719
|
-
|
|
2708
|
+
}), v(() => {
|
|
2709
|
+
y = null;
|
|
2720
2710
|
}), t({
|
|
2721
2711
|
changeActiveMedia: N,
|
|
2722
2712
|
loadIfNearBottom: P,
|
|
@@ -2724,15 +2714,15 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2724
2714
|
navigateToItem: I,
|
|
2725
2715
|
transitionActiveMedia: L,
|
|
2726
2716
|
transitionActivePost: R
|
|
2727
|
-
}), (t, r) => (
|
|
2728
|
-
class:
|
|
2729
|
-
"data-info-sheet-open":
|
|
2717
|
+
}), (t, r) => (b(), s("section", {
|
|
2718
|
+
class: h(["reel-layout", `reel-layout--${e.infoSheetOverlay ? "overlay" : "layout"}`]),
|
|
2719
|
+
"data-info-sheet-open": A.value || void 0,
|
|
2730
2720
|
"data-info-sheet-mode": e.infoSheetOverlay ? "overlay" : "layout"
|
|
2731
2721
|
}, [c("div", {
|
|
2732
2722
|
class: "reel-layout-main",
|
|
2733
|
-
"aria-hidden": e.infoSheetOverlay &&
|
|
2734
|
-
inert: e.infoSheetOverlay &&
|
|
2735
|
-
}, [u(
|
|
2723
|
+
"aria-hidden": e.infoSheetOverlay && A.value || void 0,
|
|
2724
|
+
inert: e.infoSheetOverlay && A.value || void 0
|
|
2725
|
+
}, [u(En, {
|
|
2736
2726
|
ref_key: "reelFeed",
|
|
2737
2727
|
ref: p,
|
|
2738
2728
|
"can-retry-end": e.canRetryEnd,
|
|
@@ -2761,7 +2751,7 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2761
2751
|
onMediaError: r[1] ||= (e, t) => d("mediaError", e, t),
|
|
2762
2752
|
onLoadMore: r[2] ||= (e) => d("loadMore"),
|
|
2763
2753
|
onMediaChange: B,
|
|
2764
|
-
onReady:
|
|
2754
|
+
onReady: ee,
|
|
2765
2755
|
onRetryEnd: r[3] ||= (e) => d("retryEnd"),
|
|
2766
2756
|
onRetryForward: r[4] ||= (e) => d("retryForward"),
|
|
2767
2757
|
onReelAudioChange: r[5] ||= (e) => d("reelAudioChange", e)
|
|
@@ -2787,27 +2777,27 @@ var Sn = ["aria-label"], Cn = /* @__PURE__ */ d({
|
|
|
2787
2777
|
"reel-forward",
|
|
2788
2778
|
"state",
|
|
2789
2779
|
"total"
|
|
2790
|
-
])], 8,
|
|
2791
|
-
default:
|
|
2780
|
+
])], 8, On), u(n, { name: "vibe-info-sheet" }, {
|
|
2781
|
+
default: k(() => [A.value && e.infoSheet && j.value ? (b(), s("div", kn, [c("aside", {
|
|
2792
2782
|
ref_key: "sheetElement",
|
|
2793
|
-
ref:
|
|
2783
|
+
ref: _,
|
|
2794
2784
|
class: "reel-info-sheet",
|
|
2795
2785
|
role: e.infoSheetOverlay ? "dialog" : "complementary",
|
|
2796
2786
|
"aria-label": "Reel information",
|
|
2797
2787
|
"aria-modal": e.infoSheetOverlay ? "true" : void 0,
|
|
2798
2788
|
tabindex: e.infoSheetOverlay ? -1 : void 0,
|
|
2799
|
-
"data-active-post-id":
|
|
2800
|
-
}, [(
|
|
2789
|
+
"data-active-post-id": T.value?.postId
|
|
2790
|
+
}, [(b(), a(C(e.infoSheet.component), g(f(j.value)), null, 16))], 8, An)])) : o("", !0)]),
|
|
2801
2791
|
_: 1
|
|
2802
|
-
})], 10,
|
|
2792
|
+
})], 10, Dn));
|
|
2803
2793
|
}
|
|
2804
2794
|
});
|
|
2805
2795
|
//#endregion
|
|
2806
2796
|
//#region src/core/mediaLifecycle.ts
|
|
2807
|
-
function
|
|
2797
|
+
function Mn(e, t, n, r, i) {
|
|
2808
2798
|
let a = e.items.findIndex((e) => e.postId === t), o = e.items[a];
|
|
2809
2799
|
if (!o) return null;
|
|
2810
|
-
let s =
|
|
2800
|
+
let s = H(o, n), c = U(o, s);
|
|
2811
2801
|
return {
|
|
2812
2802
|
item: o,
|
|
2813
2803
|
layout: r,
|
|
@@ -2820,8 +2810,8 @@ function In(e, t, n, r, i) {
|
|
|
2820
2810
|
postIndex: a
|
|
2821
2811
|
};
|
|
2822
2812
|
}
|
|
2823
|
-
function
|
|
2824
|
-
|
|
2813
|
+
function Nn(e, t) {
|
|
2814
|
+
O(() => {
|
|
2825
2815
|
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null;
|
|
2826
2816
|
return {
|
|
2827
2817
|
mediaIndex: t === null ? 0 : e.mediaIndices.get(t) ?? 0,
|
|
@@ -2830,23 +2820,23 @@ function Ln(e, t) {
|
|
|
2830
2820
|
};
|
|
2831
2821
|
}, (n, r) => {
|
|
2832
2822
|
if (n.postId === null || n.postId === r?.postId && n.mediaIndex === r.mediaIndex && n.origin === r.origin) return;
|
|
2833
|
-
let i =
|
|
2823
|
+
let i = Mn(e, n.postId, n.mediaIndex, "reel", n.origin);
|
|
2834
2824
|
i && t(i);
|
|
2835
2825
|
}, { flush: "sync" });
|
|
2836
2826
|
}
|
|
2837
2827
|
//#endregion
|
|
2838
2828
|
//#region src/components/useMediaLifecycle.ts
|
|
2839
|
-
function
|
|
2840
|
-
let n = /* @__PURE__ */ new Set(), i =
|
|
2829
|
+
function Pn(e, t) {
|
|
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();
|
|
2841
2831
|
function u() {
|
|
2842
2832
|
n.clear(), l.clear(), i.value = /* @__PURE__ */ new Map(), a.value = /* @__PURE__ */ new Map(), o.value = /* @__PURE__ */ new Map();
|
|
2843
2833
|
}
|
|
2844
2834
|
function d(e, t, n, r) {
|
|
2845
|
-
let i =
|
|
2835
|
+
let i = W(t, n);
|
|
2846
2836
|
e.value.get(i) !== r && (e.value = new Map(e.value).set(i, r));
|
|
2847
2837
|
}
|
|
2848
2838
|
function f(t, n, r, i) {
|
|
2849
|
-
return
|
|
2839
|
+
return Mn(e, t, n, r, i);
|
|
2850
2840
|
}
|
|
2851
2841
|
function p(e, n, r, i) {
|
|
2852
2842
|
let a = f(e, n, r, i);
|
|
@@ -2872,13 +2862,13 @@ function Rn(e, t) {
|
|
|
2872
2862
|
d(s(), t, n, "ready"), p(t, n, "reel", e.reelOrigin ?? "reel");
|
|
2873
2863
|
}
|
|
2874
2864
|
function y(e, n) {
|
|
2875
|
-
let r =
|
|
2865
|
+
let r = W(e, n);
|
|
2876
2866
|
if (l.has(r)) return;
|
|
2877
2867
|
let i = f(e, n, "masonry", null);
|
|
2878
2868
|
i && (l.add(r), t.visible(i));
|
|
2879
2869
|
}
|
|
2880
2870
|
function b(e, r, i, a) {
|
|
2881
|
-
let o = [i,
|
|
2871
|
+
let o = [i, W(e, r)].join(":");
|
|
2882
2872
|
if (n.has(o)) return;
|
|
2883
2873
|
let s = f(e, r, i, a);
|
|
2884
2874
|
s && (n.add(o), t.fullyVisible(s));
|
|
@@ -2886,13 +2876,13 @@ function Rn(e, t) {
|
|
|
2886
2876
|
function x(e, t) {
|
|
2887
2877
|
b(e, t, "masonry", null);
|
|
2888
2878
|
}
|
|
2889
|
-
return
|
|
2879
|
+
return Nn(e, t.reelChange), O(() => {
|
|
2890
2880
|
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null, n = t === null ? 0 : e.mediaIndices.get(t) ?? 0;
|
|
2891
2881
|
return {
|
|
2892
2882
|
mediaIndex: n,
|
|
2893
2883
|
origin: e.reelOrigin ?? "reel",
|
|
2894
2884
|
postId: t,
|
|
2895
|
-
ready: t !== null && c.value.get(
|
|
2885
|
+
ready: t !== null && c.value.get(W(t, n)) === "ready"
|
|
2896
2886
|
};
|
|
2897
2887
|
}, (e, t) => {
|
|
2898
2888
|
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);
|
|
@@ -2912,16 +2902,16 @@ function Rn(e, t) {
|
|
|
2912
2902
|
}
|
|
2913
2903
|
//#endregion
|
|
2914
2904
|
//#region src/core/reelEscapeStack.ts
|
|
2915
|
-
var
|
|
2916
|
-
function
|
|
2917
|
-
return
|
|
2918
|
-
let t =
|
|
2919
|
-
t >= 0 &&
|
|
2905
|
+
var Fn = [];
|
|
2906
|
+
function In(e) {
|
|
2907
|
+
return Fn.push(e), () => {
|
|
2908
|
+
let t = Fn.indexOf(e);
|
|
2909
|
+
t >= 0 && Fn.splice(t, 1);
|
|
2920
2910
|
};
|
|
2921
2911
|
}
|
|
2922
|
-
function
|
|
2912
|
+
function Ln(e) {
|
|
2923
2913
|
if (!e.isActive()) return !1;
|
|
2924
|
-
let t =
|
|
2914
|
+
let t = Fn.filter((e) => e.isActive()), n = e.element();
|
|
2925
2915
|
return n !== null && t.some((t) => {
|
|
2926
2916
|
if (t === e) return !1;
|
|
2927
2917
|
let r = t.element();
|
|
@@ -2937,14 +2927,14 @@ function Vn(e) {
|
|
|
2937
2927
|
}
|
|
2938
2928
|
//#endregion
|
|
2939
2929
|
//#region src/components/useReelKeyboard.ts
|
|
2940
|
-
function
|
|
2930
|
+
function Rn(e) {
|
|
2941
2931
|
let t = {
|
|
2942
2932
|
element: e.element,
|
|
2943
2933
|
isActive: () => e.state.layout === "reel" || e.state.reelOrigin === "masonry"
|
|
2944
2934
|
}, n = null;
|
|
2945
2935
|
function r(n) {
|
|
2946
2936
|
let r = t.isActive();
|
|
2947
|
-
if (n.key === "Escape" && r && !
|
|
2937
|
+
if (n.key === "Escape" && r && !Ln(t)) return;
|
|
2948
2938
|
if (n.key === "Escape" && e.state.reelOrigin === "masonry") {
|
|
2949
2939
|
n.preventDefault(), e.state.reelInfoSheetOverlay && e.state.reelInfoSheet.enabled && e.setReelInfoSheet(!1), e.closeMasonryReel();
|
|
2950
2940
|
return;
|
|
@@ -2963,15 +2953,15 @@ function Hn(e) {
|
|
|
2963
2953
|
let a = n.key === "ArrowLeft" ? -1 : n.key === "ArrowRight" ? 1 : 0;
|
|
2964
2954
|
a !== 0 && e.reelRenderer()?.changeActiveMedia?.(a) && n.preventDefault();
|
|
2965
2955
|
}
|
|
2966
|
-
|
|
2967
|
-
n =
|
|
2968
|
-
}),
|
|
2956
|
+
y(() => {
|
|
2957
|
+
n = In(t), window.addEventListener("keydown", r);
|
|
2958
|
+
}), v(() => {
|
|
2969
2959
|
window.removeEventListener("keydown", r), n?.(), n = null;
|
|
2970
2960
|
});
|
|
2971
2961
|
}
|
|
2972
2962
|
//#endregion
|
|
2973
2963
|
//#region src/components/VibeSurface.vue?vue&type=script&setup=true&lang.ts
|
|
2974
|
-
var
|
|
2964
|
+
var zn = 35, Bn = 420, Vn = /* @__PURE__ */ d({
|
|
2975
2965
|
__name: "VibeSurface",
|
|
2976
2966
|
props: {
|
|
2977
2967
|
canRetryEnd: { type: Boolean },
|
|
@@ -3001,69 +2991,69 @@ var Un = 35, Wn = 420, Gn = /* @__PURE__ */ d({
|
|
|
3001
2991
|
"retryForward"
|
|
3002
2992
|
],
|
|
3003
2993
|
setup(t, { expose: i, emit: c }) {
|
|
3004
|
-
let l = t, d = c, f =
|
|
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(() => 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, {
|
|
3005
2995
|
error: (e) => d("mediaError", e),
|
|
3006
2996
|
fullyVisible: (e) => d("mediaFullyVisible", e),
|
|
3007
2997
|
ready: (e) => d("mediaReady", e),
|
|
3008
2998
|
reelChange: (e) => d("reelMediaChange", e),
|
|
3009
2999
|
visible: (e) => d("mediaVisible", e)
|
|
3010
|
-
}),
|
|
3011
|
-
function
|
|
3000
|
+
}), ee = new Set(l.state.items.map((e) => e.postId)), U = null, W = null, G = !1;
|
|
3001
|
+
function K() {
|
|
3012
3002
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
3013
3003
|
}
|
|
3014
|
-
function
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3004
|
+
function q() {
|
|
3005
|
+
U !== null && cancelAnimationFrame(U), U = requestAnimationFrame(() => {
|
|
3006
|
+
U = requestAnimationFrame(() => {
|
|
3007
|
+
U = null, y.value = /* @__PURE__ */ new Set();
|
|
3018
3008
|
});
|
|
3019
3009
|
});
|
|
3020
3010
|
}
|
|
3021
3011
|
function J(e, t) {
|
|
3022
3012
|
let n = l.state.items.find((t) => t.postId === e);
|
|
3023
3013
|
if (!n) return;
|
|
3024
|
-
let r =
|
|
3014
|
+
let r = H(n, t);
|
|
3025
3015
|
(l.state.mediaIndices.get(e) ?? 0) !== r && (l.state.mediaIndices = new Map(l.state.mediaIndices).set(e, r));
|
|
3026
3016
|
}
|
|
3027
|
-
async function
|
|
3028
|
-
await
|
|
3017
|
+
async function ne() {
|
|
3018
|
+
await m(), (l.state.layout === "reel" || l.state.reelOrigin === "masonry" ? p.value : f.value)?.loadIfNearBottom();
|
|
3029
3019
|
}
|
|
3030
|
-
function
|
|
3020
|
+
function re(e) {
|
|
3031
3021
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.changeActiveMedia?.(e) ?? !1;
|
|
3032
3022
|
}
|
|
3033
|
-
function
|
|
3023
|
+
function ie(e) {
|
|
3034
3024
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.moveActivePost?.(e) ?? !1;
|
|
3035
3025
|
}
|
|
3036
|
-
function
|
|
3026
|
+
function ae(e) {
|
|
3037
3027
|
if (!(l.state.layout === "reel" || l.state.reelOrigin === "masonry") || l.state.isLoading) return "reel-inactive";
|
|
3038
3028
|
let t = l.state.items.find((t) => t.postId === e.postId);
|
|
3039
3029
|
if (!t) return "not-found";
|
|
3040
|
-
let n =
|
|
3030
|
+
let n = V(t).findIndex((t) => t.mediaId === e.mediaId);
|
|
3041
3031
|
return n < 0 ? "not-found" : p.value?.navigateToItem?.(e.postId, n) ? "navigated" : "reel-inactive";
|
|
3042
3032
|
}
|
|
3043
|
-
function
|
|
3033
|
+
function oe() {
|
|
3044
3034
|
return l.state.layout !== "masonry" || l.state.reelOrigin === "masonry" ? null : f.value?.getScrollElement?.() ?? null;
|
|
3045
3035
|
}
|
|
3046
|
-
function
|
|
3047
|
-
|
|
3036
|
+
function se(e, t) {
|
|
3037
|
+
W = e, G = t === "keyboard", d("openReel", e), m(() => h.value?.focus());
|
|
3048
3038
|
}
|
|
3049
|
-
function
|
|
3039
|
+
function ce(e) {
|
|
3050
3040
|
let t = g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [];
|
|
3051
3041
|
return Array.from(t).find((t) => t.dataset.postId === String(e)) ?? null;
|
|
3052
3042
|
}
|
|
3053
|
-
function
|
|
3054
|
-
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null ||
|
|
3043
|
+
function Y(e, t) {
|
|
3044
|
+
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null || K()) return 0;
|
|
3055
3045
|
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)));
|
|
3056
3046
|
if (i.length === 0) return 0;
|
|
3057
|
-
let a = new Map(C.value), o = t?.staggerMs ??
|
|
3047
|
+
let a = new Map(C.value), o = t?.staggerMs ?? zn;
|
|
3058
3048
|
return i.forEach((e, t) => {
|
|
3059
3049
|
a.set(e, t * o);
|
|
3060
|
-
}),
|
|
3050
|
+
}), 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;
|
|
3061
3051
|
}
|
|
3062
3052
|
function X() {
|
|
3063
3053
|
S.value = /* @__PURE__ */ new Set(), C.value = /* @__PURE__ */ new Map();
|
|
3064
3054
|
}
|
|
3065
|
-
async function
|
|
3066
|
-
if (t.aborted ||
|
|
3055
|
+
async function Z(e, t) {
|
|
3056
|
+
if (t.aborted || Y(e, { staggerMs: 0 }) === 0 || (await m(), t.aborted)) return;
|
|
3067
3057
|
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) ?? []));
|
|
3068
3058
|
await new Promise((e) => {
|
|
3069
3059
|
let n = () => {
|
|
@@ -3072,60 +3062,60 @@ var Un = 35, Wn = 420, Gn = /* @__PURE__ */ d({
|
|
|
3072
3062
|
t.addEventListener("abort", n, { once: !0 }), t.aborted ? n() : Promise.allSettled(r.map((e) => e.finished)).then(n);
|
|
3073
3063
|
});
|
|
3074
3064
|
}
|
|
3075
|
-
function
|
|
3076
|
-
let n =
|
|
3065
|
+
function ue(e, t) {
|
|
3066
|
+
let n = ce(e), r = n?.querySelector(".media-card-activator") ?? n;
|
|
3077
3067
|
r && (r.classList.toggle("media-card-focus-silent", !t), t || r.addEventListener("blur", () => {
|
|
3078
3068
|
r.classList.remove("media-card-focus-silent");
|
|
3079
3069
|
}, { once: !0 }), r?.focus({ preventScroll: !0 }));
|
|
3080
3070
|
}
|
|
3081
3071
|
function de() {
|
|
3082
|
-
l.state.reelOrigin === "masonry" && (
|
|
3072
|
+
l.state.reelOrigin === "masonry" && (W ??= l.state.activeReelPostId, _.value = !0, d("closeReel"));
|
|
3083
3073
|
}
|
|
3084
3074
|
function fe() {
|
|
3085
|
-
let e =
|
|
3086
|
-
_.value = !1,
|
|
3087
|
-
e !== null &&
|
|
3075
|
+
let e = W, t = G;
|
|
3076
|
+
_.value = !1, W = null, G = !1, m(() => {
|
|
3077
|
+
e !== null && ue(e, t);
|
|
3088
3078
|
});
|
|
3089
3079
|
}
|
|
3090
|
-
return
|
|
3080
|
+
return Rn({
|
|
3091
3081
|
closeMasonryReel: de,
|
|
3092
3082
|
element: () => g.value,
|
|
3093
3083
|
isReelLeaving: () => _.value,
|
|
3094
3084
|
reelRenderer: () => p.value,
|
|
3095
3085
|
setReelInfoSheet: (e) => d("reelInfoSheetChange", e),
|
|
3096
3086
|
state: l.state
|
|
3097
|
-
}),
|
|
3087
|
+
}), O(() => {
|
|
3098
3088
|
let e = l.state.items;
|
|
3099
3089
|
return [e, e.length];
|
|
3100
3090
|
}, ([e]) => {
|
|
3101
|
-
let t = e.map((e) => e.postId), n = t.filter((e) => !
|
|
3102
|
-
if (
|
|
3091
|
+
let t = e.map((e) => e.postId), n = t.filter((e) => !ee.has(e)), r = new Set(t);
|
|
3092
|
+
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;
|
|
3103
3093
|
let i = /* @__PURE__ */ new Map();
|
|
3104
3094
|
t.forEach((e) => {
|
|
3105
|
-
let t =
|
|
3095
|
+
let t = x.value.get(e);
|
|
3106
3096
|
t !== void 0 && i.set(e, t);
|
|
3107
3097
|
}), n.forEach((e, t) => {
|
|
3108
|
-
i.set(e, t *
|
|
3109
|
-
}),
|
|
3110
|
-
}, { flush: "sync" }),
|
|
3111
|
-
|
|
3098
|
+
i.set(e, t * zn);
|
|
3099
|
+
}), x.value = i, y.value = new Set([...y.value, ...n]), q();
|
|
3100
|
+
}, { flush: "sync" }), v(() => {
|
|
3101
|
+
U !== null && cancelAnimationFrame(U);
|
|
3112
3102
|
}), i({
|
|
3113
|
-
animateItemRemoval:
|
|
3103
|
+
animateItemRemoval: Z,
|
|
3114
3104
|
cancelItemRemoval: X,
|
|
3115
|
-
changeActiveReelMedia:
|
|
3116
|
-
getAutoScrollElement:
|
|
3117
|
-
loadIfNearBottom:
|
|
3118
|
-
moveActiveReelPost:
|
|
3119
|
-
navigateToReelItem:
|
|
3105
|
+
changeActiveReelMedia: re,
|
|
3106
|
+
getAutoScrollElement: oe,
|
|
3107
|
+
loadIfNearBottom: ne,
|
|
3108
|
+
moveActiveReelPost: ie,
|
|
3109
|
+
navigateToReelItem: ae,
|
|
3120
3110
|
resetMediaLifecycle: B,
|
|
3121
|
-
startItemRemoval:
|
|
3111
|
+
startItemRemoval: Y,
|
|
3122
3112
|
transitionActiveReelMedia: (e) => p.value?.transitionActiveMedia?.(e) ?? Promise.resolve(!1),
|
|
3123
3113
|
transitionActiveReelPost: (e) => p.value?.transitionActivePost?.(e) ?? Promise.resolve(!1)
|
|
3124
|
-
}), (r, i) => (
|
|
3114
|
+
}), (r, i) => (b(), s("div", {
|
|
3125
3115
|
ref_key: "surfaceElement",
|
|
3126
3116
|
ref: g,
|
|
3127
3117
|
class: "vibe-surface"
|
|
3128
|
-
}, [t.state.layout === "reel" && (t.state.items.length > 0 || t.state.reelForward.status !== "idle") ? (
|
|
3118
|
+
}, [t.state.layout === "reel" && (t.state.items.length > 0 || t.state.reelForward.status !== "idle") ? (b(), a(jn, {
|
|
3129
3119
|
key: 0,
|
|
3130
3120
|
ref_key: "reelRenderer",
|
|
3131
3121
|
ref: p,
|
|
@@ -3150,28 +3140,28 @@ var Un = 35, Wn = 420, Gn = /* @__PURE__ */ d({
|
|
|
3150
3140
|
"info-sheet-overlay": t.state.reelInfoSheetOverlay,
|
|
3151
3141
|
"next-page-error": !!t.state.nextPageError,
|
|
3152
3142
|
origin: "reel",
|
|
3153
|
-
"preview-states":
|
|
3143
|
+
"preview-states": E(z),
|
|
3154
3144
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3155
3145
|
"reel-audio-state": t.reelAudioState,
|
|
3156
3146
|
"reel-forward": t.state.reelForward,
|
|
3157
|
-
state:
|
|
3147
|
+
state: D.value,
|
|
3158
3148
|
total: t.state.total,
|
|
3159
3149
|
onActiveChange: i[0] ||= (e) => d("activeReelChange", e),
|
|
3160
3150
|
onCloseInfoSheet: i[1] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3161
|
-
onError:
|
|
3162
|
-
onMediaError: i[2] ||= (e, t) =>
|
|
3151
|
+
onError: E(F),
|
|
3152
|
+
onMediaError: i[2] ||= (e, t) => E(A)(e, t, "reel"),
|
|
3163
3153
|
onLoadMore: i[3] ||= (e) => d("loadMore"),
|
|
3164
3154
|
onMediaChange: J,
|
|
3165
|
-
onReady:
|
|
3155
|
+
onReady: E(I),
|
|
3166
3156
|
onRetryEnd: i[4] ||= (e) => d("retryEnd"),
|
|
3167
3157
|
onRetryForward: i[5] ||= (e) => d("retryForward"),
|
|
3168
3158
|
onReelAudioChange: i[6] ||= (e) => d("reelAudioChange", e)
|
|
3169
|
-
}, 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" ? (
|
|
3159
|
+
}, 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, {
|
|
3170
3160
|
key: 1,
|
|
3171
3161
|
actions: t.feedFooterActions,
|
|
3172
3162
|
"can-retry-end": t.canRetryEnd,
|
|
3173
3163
|
"feed-footer": t.feedFooter,
|
|
3174
|
-
state:
|
|
3164
|
+
state: D.value,
|
|
3175
3165
|
onLoadMore: i[7] ||= (e) => d("loadMore"),
|
|
3176
3166
|
onRetryEnd: i[8] ||= (e) => d("retryEnd")
|
|
3177
3167
|
}, null, 8, [
|
|
@@ -3179,12 +3169,12 @@ var Un = 35, Wn = 420, Gn = /* @__PURE__ */ d({
|
|
|
3179
3169
|
"can-retry-end",
|
|
3180
3170
|
"feed-footer",
|
|
3181
3171
|
"state"
|
|
3182
|
-
])) : (
|
|
3172
|
+
])) : (b(), s(e, { key: 2 }, [u(hn, {
|
|
3183
3173
|
ref_key: "masonryRenderer",
|
|
3184
3174
|
ref: f,
|
|
3185
3175
|
"can-retry-end": t.canRetryEnd,
|
|
3186
|
-
"entering-post-ids":
|
|
3187
|
-
"entry-delays":
|
|
3176
|
+
"entering-post-ids": y.value,
|
|
3177
|
+
"entry-delays": x.value,
|
|
3188
3178
|
"leaving-post-ids": S.value,
|
|
3189
3179
|
"removal-delays": C.value,
|
|
3190
3180
|
"card-footer": t.cardFooter,
|
|
@@ -3200,33 +3190,33 @@ var Un = 35, Wn = 420, Gn = /* @__PURE__ */ d({
|
|
|
3200
3190
|
"load-more-locked": t.state.loadMoreLocked,
|
|
3201
3191
|
"media-indices": t.state.mediaIndices,
|
|
3202
3192
|
"next-page-error": !!t.state.nextPageError,
|
|
3203
|
-
"preview-states":
|
|
3193
|
+
"preview-states": E(R),
|
|
3204
3194
|
suspended: t.state.reelOrigin === "masonry" || _.value,
|
|
3205
|
-
state:
|
|
3195
|
+
state: D.value,
|
|
3206
3196
|
total: t.state.total,
|
|
3207
|
-
onActivate:
|
|
3208
|
-
onError:
|
|
3209
|
-
onMediaError: i[9] ||= (e, t) =>
|
|
3210
|
-
onFullyVisible:
|
|
3197
|
+
onActivate: se,
|
|
3198
|
+
onError: E(N),
|
|
3199
|
+
onMediaError: i[9] ||= (e, t) => E(A)(e, t, "masonry"),
|
|
3200
|
+
onFullyVisible: E(j),
|
|
3211
3201
|
onLoadMore: i[10] ||= (e) => d("loadMore"),
|
|
3212
3202
|
onMediaChange: J,
|
|
3213
|
-
onReady:
|
|
3203
|
+
onReady: E(P),
|
|
3214
3204
|
onRetryEnd: i[11] ||= (e) => d("retryEnd"),
|
|
3215
|
-
onVisible:
|
|
3205
|
+
onVisible: E(M)
|
|
3216
3206
|
}, 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, {
|
|
3217
3207
|
name: "vibe-reel-viewer",
|
|
3218
3208
|
onAfterLeave: fe
|
|
3219
3209
|
}, {
|
|
3220
|
-
default:
|
|
3210
|
+
default: k(() => [t.state.reelOrigin === "masonry" ? (b(), s("section", {
|
|
3221
3211
|
key: 0,
|
|
3222
3212
|
ref_key: "reelOverlay",
|
|
3223
|
-
ref:
|
|
3213
|
+
ref: h,
|
|
3224
3214
|
class: "vibe-reel-overlay",
|
|
3225
3215
|
role: "dialog",
|
|
3226
3216
|
"aria-label": "Media viewer",
|
|
3227
3217
|
"aria-modal": "true",
|
|
3228
3218
|
tabindex: "-1"
|
|
3229
|
-
}, [u(
|
|
3219
|
+
}, [u(jn, {
|
|
3230
3220
|
ref_key: "reelRenderer",
|
|
3231
3221
|
ref: p,
|
|
3232
3222
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -3250,19 +3240,19 @@ var Un = 35, Wn = 420, Gn = /* @__PURE__ */ d({
|
|
|
3250
3240
|
"media-source": "original",
|
|
3251
3241
|
"next-page-error": !!t.state.nextPageError,
|
|
3252
3242
|
origin: "masonry",
|
|
3253
|
-
"preview-states":
|
|
3243
|
+
"preview-states": E(L),
|
|
3254
3244
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
3255
3245
|
"reel-audio-state": t.reelAudioState,
|
|
3256
3246
|
"reel-forward": t.state.reelForward,
|
|
3257
|
-
state:
|
|
3247
|
+
state: D.value,
|
|
3258
3248
|
total: t.state.total,
|
|
3259
3249
|
onActiveChange: i[12] ||= (e) => d("activeReelChange", e),
|
|
3260
3250
|
onCloseInfoSheet: i[13] ||= (e) => d("reelInfoSheetChange", !1),
|
|
3261
|
-
onError:
|
|
3262
|
-
onMediaError: i[14] ||= (e, t) =>
|
|
3251
|
+
onError: E(F),
|
|
3252
|
+
onMediaError: i[14] ||= (e, t) => E(A)(e, t, "reel"),
|
|
3263
3253
|
onLoadMore: i[15] ||= (e) => d("loadMore"),
|
|
3264
3254
|
onMediaChange: J,
|
|
3265
|
-
onReady:
|
|
3255
|
+
onReady: E(I),
|
|
3266
3256
|
onRetryEnd: i[16] ||= (e) => d("retryEnd"),
|
|
3267
3257
|
onRetryForward: i[17] ||= (e) => d("retryForward"),
|
|
3268
3258
|
onReelAudioChange: i[18] ||= (e) => d("reelAudioChange", e)
|
|
@@ -3273,7 +3263,7 @@ var Un = 35, Wn = 420, Gn = /* @__PURE__ */ d({
|
|
|
3273
3263
|
});
|
|
3274
3264
|
//#endregion
|
|
3275
3265
|
//#region src/core/page.ts
|
|
3276
|
-
function
|
|
3266
|
+
function Hn(e) {
|
|
3277
3267
|
if (!e || typeof e != "object" || !Array.isArray(e.items)) throw TypeError("Vibe loadPage must resolve to a page with an items array.");
|
|
3278
3268
|
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.");
|
|
3279
3269
|
if (e.next !== null && typeof e.next != "string" && typeof e.next != "number") throw TypeError("Vibe page next must be a string, number, or null.");
|
|
@@ -3284,22 +3274,22 @@ function $(e, t) {
|
|
|
3284
3274
|
let n = new Set(e.map((e) => e.postId));
|
|
3285
3275
|
return [...e, ...t.filter((e) => n.has(e.postId) ? !1 : (n.add(e.postId), !0))];
|
|
3286
3276
|
}
|
|
3287
|
-
function
|
|
3277
|
+
function Un(e) {
|
|
3288
3278
|
return `${typeof e}:${String(e)}`;
|
|
3289
3279
|
}
|
|
3290
|
-
function
|
|
3291
|
-
return e.mediaId === void 0 ? `source:${e.src}\u0000${e.preview?.src ?? ""}` : `id:${
|
|
3280
|
+
function Wn(e) {
|
|
3281
|
+
return e.mediaId === void 0 ? `source:${e.src}\u0000${e.preview?.src ?? ""}` : `id:${Un(e.mediaId)}`;
|
|
3292
3282
|
}
|
|
3293
|
-
function
|
|
3294
|
-
let n = [...e], r = new Map(e.map((e, t) => [
|
|
3283
|
+
function Gn(e, t) {
|
|
3284
|
+
let n = [...e], r = new Map(e.map((e, t) => [Un(e.postId), t]));
|
|
3295
3285
|
return t.forEach((e) => {
|
|
3296
|
-
let t =
|
|
3286
|
+
let t = Un(e.postId), i = r.get(t);
|
|
3297
3287
|
if (i === void 0) {
|
|
3298
3288
|
r.set(t, n.length), n.push(e);
|
|
3299
3289
|
return;
|
|
3300
3290
|
}
|
|
3301
|
-
let a = n[i], o = new Set([a, ...a.items].map(
|
|
3302
|
-
let t =
|
|
3291
|
+
let a = n[i], o = new Set([a, ...a.items].map(Wn)), s = [e, ...e.items].filter((e) => {
|
|
3292
|
+
let t = Wn(e);
|
|
3303
3293
|
return o.has(t) ? !1 : (o.add(t), !0);
|
|
3304
3294
|
});
|
|
3305
3295
|
s.length > 0 && (n[i] = {
|
|
@@ -3308,14 +3298,14 @@ function Yn(e, t) {
|
|
|
3308
3298
|
});
|
|
3309
3299
|
}), n;
|
|
3310
3300
|
}
|
|
3311
|
-
function
|
|
3301
|
+
function Kn(e) {
|
|
3312
3302
|
return Object.prototype.hasOwnProperty.call(e, "current") ? e.current ?? null : e.next;
|
|
3313
3303
|
}
|
|
3314
3304
|
//#endregion
|
|
3315
3305
|
//#region src/core/appendPage.ts
|
|
3316
|
-
function
|
|
3317
|
-
let i =
|
|
3318
|
-
t.items =
|
|
3306
|
+
function qn(e, t, n, r) {
|
|
3307
|
+
let i = Hn(e), a = n.filterItems(i.items), o = Kn(i);
|
|
3308
|
+
t.items = Gn(t.items, a), t.next = i.next, i.total !== void 0 && (t.total = i.total), r(o), n.recordPages([{
|
|
3319
3309
|
contributionIds: a.map(({ postId: e }) => e),
|
|
3320
3310
|
cursor: o,
|
|
3321
3311
|
next: i.next,
|
|
@@ -3324,32 +3314,32 @@ function Zn(e, t, n, r) {
|
|
|
3324
3314
|
}
|
|
3325
3315
|
//#endregion
|
|
3326
3316
|
//#region src/core/requestDelay.ts
|
|
3327
|
-
var
|
|
3317
|
+
var Jn = 2e3, Yn = 1e4, Xn = 250, Zn = {
|
|
3328
3318
|
delayRemainingMs: null,
|
|
3329
3319
|
nextRequestAt: null
|
|
3330
3320
|
};
|
|
3331
|
-
function
|
|
3321
|
+
function Qn(e, t) {
|
|
3332
3322
|
return e === void 0 ? t : Math.floor(e);
|
|
3333
3323
|
}
|
|
3334
|
-
function
|
|
3324
|
+
function $n(e, t) {
|
|
3335
3325
|
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.`);
|
|
3336
3326
|
}
|
|
3337
|
-
function
|
|
3338
|
-
let n =
|
|
3327
|
+
function er(e, t = {}) {
|
|
3328
|
+
let n = Qn(t.delayStepMs, Jn), r = Qn(t.delayMaxMs, Yn);
|
|
3339
3329
|
return Math.min(Math.max(0, e) * n, r);
|
|
3340
3330
|
}
|
|
3341
|
-
function
|
|
3342
|
-
if (e == null || !Number.isFinite(e)) return { ...
|
|
3331
|
+
function tr(e) {
|
|
3332
|
+
if (e == null || !Number.isFinite(e)) return { ...Zn };
|
|
3343
3333
|
let t = Math.max(0, Math.floor(e - Date.now()));
|
|
3344
3334
|
return t > 0 ? {
|
|
3345
3335
|
delayRemainingMs: t,
|
|
3346
3336
|
nextRequestAt: e
|
|
3347
|
-
} : { ...
|
|
3337
|
+
} : { ...Zn };
|
|
3348
3338
|
}
|
|
3349
|
-
async function
|
|
3339
|
+
async function nr({ delayMs: e, onChange: t, signal: n }) {
|
|
3350
3340
|
if (n.aborted) throw new DOMException("Aborted", "AbortError");
|
|
3351
3341
|
if (e <= 0) {
|
|
3352
|
-
t({ ...
|
|
3342
|
+
t({ ...Zn });
|
|
3353
3343
|
return;
|
|
3354
3344
|
}
|
|
3355
3345
|
let r = Date.now() + e;
|
|
@@ -3357,9 +3347,9 @@ async function or({ delayMs: e, onChange: t, signal: n }) {
|
|
|
3357
3347
|
delayRemainingMs: e,
|
|
3358
3348
|
nextRequestAt: r
|
|
3359
3349
|
}), await new Promise((i, a) => {
|
|
3360
|
-
let o = !1, s = setInterval(f,
|
|
3350
|
+
let o = !1, s = setInterval(f, Xn), c = setTimeout(() => u(), e);
|
|
3361
3351
|
function l() {
|
|
3362
|
-
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...
|
|
3352
|
+
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...Zn });
|
|
3363
3353
|
}
|
|
3364
3354
|
function u(e) {
|
|
3365
3355
|
o || (o = !0, l(), e ? a(e) : i());
|
|
@@ -3368,42 +3358,42 @@ async function or({ delayMs: e, onChange: t, signal: n }) {
|
|
|
3368
3358
|
u(new DOMException("Aborted", "AbortError"));
|
|
3369
3359
|
}
|
|
3370
3360
|
function f() {
|
|
3371
|
-
let e =
|
|
3361
|
+
let e = tr(r);
|
|
3372
3362
|
t(e), e.delayRemainingMs === null && u();
|
|
3373
3363
|
}
|
|
3374
3364
|
n.addEventListener("abort", d, { once: !0 });
|
|
3375
3365
|
});
|
|
3376
3366
|
}
|
|
3377
|
-
var
|
|
3367
|
+
var rr = class {
|
|
3378
3368
|
interval = null;
|
|
3379
3369
|
constructor(e) {
|
|
3380
3370
|
this.onChange = e;
|
|
3381
3371
|
}
|
|
3382
3372
|
clear() {
|
|
3383
|
-
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...
|
|
3373
|
+
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...Zn });
|
|
3384
3374
|
}
|
|
3385
3375
|
sync(e) {
|
|
3386
3376
|
this.clear();
|
|
3387
|
-
let t =
|
|
3377
|
+
let t = tr(e);
|
|
3388
3378
|
this.onChange(t), t.delayRemainingMs !== null && (this.interval = setInterval(() => {
|
|
3389
|
-
let t =
|
|
3379
|
+
let t = tr(e);
|
|
3390
3380
|
this.onChange(t), t.delayRemainingMs === null && this.clear();
|
|
3391
|
-
},
|
|
3381
|
+
}, Xn));
|
|
3392
3382
|
}
|
|
3393
3383
|
};
|
|
3394
|
-
function
|
|
3384
|
+
function ir(e, t = !0) {
|
|
3395
3385
|
return e.maxAdditionalPages === "unlimited" ? Infinity : (e.maxAdditionalPages ?? 10) + (t ? 1 : 0);
|
|
3396
3386
|
}
|
|
3397
|
-
function
|
|
3387
|
+
function ar(e) {
|
|
3398
3388
|
return `${typeof e}:${String(e)}`;
|
|
3399
3389
|
}
|
|
3400
|
-
function
|
|
3390
|
+
function or(e, t) {
|
|
3401
3391
|
if (!Number.isInteger(e) || e <= 0) throw TypeError(`Vibe ${t} must be a positive integer.`);
|
|
3402
3392
|
}
|
|
3403
|
-
function
|
|
3393
|
+
function sr(e) {
|
|
3404
3394
|
if (!e) return;
|
|
3405
|
-
if (
|
|
3406
|
-
|
|
3395
|
+
if (or(e.pageSize, "autofill pageSize"), e.strategy === "frontend") {
|
|
3396
|
+
$n(e, "frontend autofill");
|
|
3407
3397
|
let t = e.maxAdditionalPages;
|
|
3408
3398
|
if (t !== void 0 && t !== "unlimited" && (!Number.isInteger(t) || t < 0)) throw TypeError("Vibe autofill maxAdditionalPages must be a non-negative integer or \"unlimited\".");
|
|
3409
3399
|
return;
|
|
@@ -3415,7 +3405,7 @@ function dr(e) {
|
|
|
3415
3405
|
if (t.pageSize !== e.pageSize) throw TypeError("Vibe backend autofill initialSession pageSize must match autofill pageSize.");
|
|
3416
3406
|
}
|
|
3417
3407
|
}
|
|
3418
|
-
function
|
|
3408
|
+
function cr(e, t, n = !0) {
|
|
3419
3409
|
if (!e) return {
|
|
3420
3410
|
cycleId: null,
|
|
3421
3411
|
delayRemainingMs: null,
|
|
@@ -3432,7 +3422,7 @@ function fr(e, t, n = !0) {
|
|
|
3432
3422
|
status: "idle",
|
|
3433
3423
|
strategy: null
|
|
3434
3424
|
};
|
|
3435
|
-
let r = e.strategy === "backend" ? t ?? (n ? e.initialSession : void 0) : void 0, i = r?.received ?? 0, a =
|
|
3425
|
+
let r = e.strategy === "backend" ? t ?? (n ? e.initialSession : void 0) : void 0, i = r?.received ?? 0, a = tr(r?.nextRequestAt);
|
|
3436
3426
|
return {
|
|
3437
3427
|
cycleId: r?.cycleId ?? null,
|
|
3438
3428
|
...a,
|
|
@@ -3449,7 +3439,7 @@ function fr(e, t, n = !0) {
|
|
|
3449
3439
|
strategy: e.strategy
|
|
3450
3440
|
};
|
|
3451
3441
|
}
|
|
3452
|
-
function
|
|
3442
|
+
function lr(e) {
|
|
3453
3443
|
return [
|
|
3454
3444
|
"cancelling",
|
|
3455
3445
|
"filling",
|
|
@@ -3457,9 +3447,9 @@ function pr(e) {
|
|
|
3457
3447
|
"waiting"
|
|
3458
3448
|
].includes(e.status);
|
|
3459
3449
|
}
|
|
3460
|
-
async function
|
|
3450
|
+
async function ur(e, t, n) {
|
|
3461
3451
|
let r = t.autofill;
|
|
3462
|
-
if (!
|
|
3452
|
+
if (!lr(r) || !r.cycleId) return;
|
|
3463
3453
|
let i = {
|
|
3464
3454
|
cycleId: r.cycleId,
|
|
3465
3455
|
feedKey: r.feedKey ?? "",
|
|
@@ -3472,16 +3462,16 @@ async function mr(e, t, n) {
|
|
|
3472
3462
|
throw r.error = e, r.status = "error", e;
|
|
3473
3463
|
}
|
|
3474
3464
|
}
|
|
3475
|
-
function
|
|
3465
|
+
function dr(e, t, n) {
|
|
3476
3466
|
return e?.strategy === "backend" && t.feedKey === e.feedKey && t.sessionId === n.sessionId;
|
|
3477
3467
|
}
|
|
3478
|
-
async function
|
|
3479
|
-
let f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = r ??
|
|
3468
|
+
async function fr({ 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 }) {
|
|
3469
|
+
let f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = r ?? ir(s), g = t, _ = t, v = t, y = 0, b = [], x;
|
|
3480
3470
|
for (; y < h;) {
|
|
3481
|
-
let e =
|
|
3471
|
+
let e = ar(g);
|
|
3482
3472
|
if (m.has(e)) throw Error("Vibe autofill received a repeated cursor.");
|
|
3483
|
-
if (m.add(e), await
|
|
3484
|
-
delayMs:
|
|
3473
|
+
if (m.add(e), await nr({
|
|
3474
|
+
delayMs: er(l + y, s),
|
|
3485
3475
|
onChange: a,
|
|
3486
3476
|
signal: d
|
|
3487
3477
|
}), y > 0 && u()) return {
|
|
@@ -3495,7 +3485,7 @@ async function gr({ existingItems: e, initialCursor: t, loadPage: n, maximumRequ
|
|
|
3495
3485
|
status: "paused",
|
|
3496
3486
|
total: x
|
|
3497
3487
|
};
|
|
3498
|
-
let t =
|
|
3488
|
+
let t = Hn(await n({
|
|
3499
3489
|
cursor: g,
|
|
3500
3490
|
signal: d
|
|
3501
3491
|
}));
|
|
@@ -3552,12 +3542,12 @@ async function gr({ existingItems: e, initialCursor: t, loadPage: n, maximumRequ
|
|
|
3552
3542
|
}
|
|
3553
3543
|
//#endregion
|
|
3554
3544
|
//#region src/core/autofillController.ts
|
|
3555
|
-
var
|
|
3545
|
+
var pr = class {
|
|
3556
3546
|
collection = null;
|
|
3557
3547
|
cycle = 0;
|
|
3558
3548
|
delayCountdown;
|
|
3559
3549
|
constructor(e) {
|
|
3560
|
-
this.context = e, this.delayCountdown = new
|
|
3550
|
+
this.context = e, this.delayCountdown = new rr((t) => Object.assign(e.state.autofill, t)), this.syncCountdown();
|
|
3561
3551
|
}
|
|
3562
3552
|
beginCycle() {
|
|
3563
3553
|
let { options: e, state: t } = this.context;
|
|
@@ -3565,14 +3555,14 @@ var _r = class {
|
|
|
3565
3555
|
this.clear();
|
|
3566
3556
|
let n = `vibe-autofill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
3567
3557
|
return t.autofill = {
|
|
3568
|
-
...
|
|
3558
|
+
...cr(e, void 0, !1),
|
|
3569
3559
|
cycleId: n,
|
|
3570
3560
|
status: "filling"
|
|
3571
3561
|
}, n;
|
|
3572
3562
|
}
|
|
3573
3563
|
async cancel() {
|
|
3574
3564
|
let { cancelRequest: e, options: t, state: n } = this.context;
|
|
3575
|
-
await
|
|
3565
|
+
await ur(t, n, e), this.commitCollection();
|
|
3576
3566
|
}
|
|
3577
3567
|
captureCollection(e, t) {
|
|
3578
3568
|
t && (this.collection = e);
|
|
@@ -3600,30 +3590,30 @@ var _r = class {
|
|
|
3600
3590
|
requests: r.requests
|
|
3601
3591
|
}), !0) : !1;
|
|
3602
3592
|
}
|
|
3603
|
-
},
|
|
3604
|
-
function
|
|
3593
|
+
}, mr = 100;
|
|
3594
|
+
function hr(e, t) {
|
|
3605
3595
|
if (!Number.isFinite(t) || t <= 0) throw TypeError(`Vibe ${e} must be a positive number.`);
|
|
3606
3596
|
}
|
|
3607
|
-
function
|
|
3597
|
+
function gr(e, t, n) {
|
|
3608
3598
|
return Math.min(n, Math.max(t, e));
|
|
3609
3599
|
}
|
|
3610
|
-
function
|
|
3600
|
+
function _r(e) {
|
|
3611
3601
|
if (!e) return;
|
|
3612
3602
|
let t = e.minSpeedPxPerSecond ?? 20, n = e.maxSpeedPxPerSecond ?? 240;
|
|
3613
|
-
if (
|
|
3614
|
-
e.speedPxPerSecond !== void 0 &&
|
|
3603
|
+
if (hr("autoScroll.minSpeedPxPerSecond", t), hr("autoScroll.maxSpeedPxPerSecond", n), t > n) throw TypeError("Vibe autoScroll.minSpeedPxPerSecond cannot exceed maxSpeedPxPerSecond.");
|
|
3604
|
+
e.speedPxPerSecond !== void 0 && hr("autoScroll.speedPxPerSecond", e.speedPxPerSecond);
|
|
3615
3605
|
}
|
|
3616
|
-
function
|
|
3606
|
+
function vr(e) {
|
|
3617
3607
|
let t = e?.minSpeedPxPerSecond ?? 20, n = e?.maxSpeedPxPerSecond ?? 240;
|
|
3618
3608
|
return {
|
|
3619
3609
|
enabled: e?.enabled ?? !1,
|
|
3620
3610
|
maxSpeedPxPerSecond: n,
|
|
3621
3611
|
minSpeedPxPerSecond: t,
|
|
3622
3612
|
paused: !1,
|
|
3623
|
-
speedPxPerSecond:
|
|
3613
|
+
speedPxPerSecond: gr(e?.speedPxPerSecond ?? 80, t, n)
|
|
3624
3614
|
};
|
|
3625
3615
|
}
|
|
3626
|
-
var
|
|
3616
|
+
var yr = class {
|
|
3627
3617
|
frame = null;
|
|
3628
3618
|
lastTimestamp = null;
|
|
3629
3619
|
mounted = !1;
|
|
@@ -3643,9 +3633,9 @@ var Cr = class {
|
|
|
3643
3633
|
this.options.state.enabled && (this.options.state.paused = e, this.lastTimestamp = null, e ? this.cancelFrame() : this.schedule());
|
|
3644
3634
|
}
|
|
3645
3635
|
setSpeed(e) {
|
|
3646
|
-
|
|
3636
|
+
hr("auto-scroll speed", e);
|
|
3647
3637
|
let t = this.options.state;
|
|
3648
|
-
t.speedPxPerSecond =
|
|
3638
|
+
t.speedPxPerSecond = gr(e, t.minSpeedPxPerSecond, t.maxSpeedPxPerSecond);
|
|
3649
3639
|
}
|
|
3650
3640
|
tick = (e) => {
|
|
3651
3641
|
this.frame = null;
|
|
@@ -3657,7 +3647,7 @@ var Cr = class {
|
|
|
3657
3647
|
return;
|
|
3658
3648
|
}
|
|
3659
3649
|
if (this.lastTimestamp !== null) {
|
|
3660
|
-
let r = Math.min(
|
|
3650
|
+
let r = Math.min(mr, Math.max(0, e - this.lastTimestamp)), i = Math.max(0, n.scrollHeight - n.clientHeight);
|
|
3661
3651
|
n.scrollTop = Math.min(i, n.scrollTop + t.speedPxPerSecond * r / 1e3);
|
|
3662
3652
|
}
|
|
3663
3653
|
this.lastTimestamp = e, this.schedule();
|
|
@@ -3671,13 +3661,13 @@ var Cr = class {
|
|
|
3671
3661
|
};
|
|
3672
3662
|
//#endregion
|
|
3673
3663
|
//#region src/core/backendAutofill.ts
|
|
3674
|
-
async function
|
|
3664
|
+
async function br(e, t, n, r) {
|
|
3675
3665
|
let i = await e.onUnderfilled(n);
|
|
3676
3666
|
if (!r()) return;
|
|
3677
3667
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend autofill requires a sessionId.");
|
|
3678
3668
|
let a = Math.max(n.received, i.received ?? n.received);
|
|
3679
3669
|
Object.assign(t.autofill, {
|
|
3680
|
-
...
|
|
3670
|
+
...tr(i.nextRequestAt),
|
|
3681
3671
|
missing: Math.max(0, e.pageSize - a),
|
|
3682
3672
|
received: a,
|
|
3683
3673
|
sequence: i.sequence ?? 0,
|
|
@@ -3685,19 +3675,19 @@ async function wr(e, t, n, r) {
|
|
|
3685
3675
|
status: "waiting"
|
|
3686
3676
|
});
|
|
3687
3677
|
}
|
|
3688
|
-
function
|
|
3678
|
+
function xr(e, t) {
|
|
3689
3679
|
["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);
|
|
3690
3680
|
}
|
|
3691
|
-
function
|
|
3681
|
+
function Sr(e, t, n) {
|
|
3692
3682
|
let r = t.autofill;
|
|
3693
|
-
return !
|
|
3683
|
+
return !dr(e, n, r) || n.sequence <= r.sequence || ["cancelled", "cancelling"].includes(r.status) || ["complete", "exhausted"].includes(n.status) && n.next === void 0 ? !1 : (xr(t, n), Object.assign(r, tr(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);
|
|
3694
3684
|
}
|
|
3695
|
-
function
|
|
3696
|
-
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill =
|
|
3685
|
+
function Cr(e, t, n) {
|
|
3686
|
+
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill = cr(e, n), xr(t, n), !0);
|
|
3697
3687
|
}
|
|
3698
3688
|
//#endregion
|
|
3699
3689
|
//#region src/core/backlogRestore.ts
|
|
3700
|
-
async function
|
|
3690
|
+
async function wr(e, t, n) {
|
|
3701
3691
|
if (!e) return;
|
|
3702
3692
|
let r = new AbortController();
|
|
3703
3693
|
n(r);
|
|
@@ -3712,7 +3702,7 @@ async function Or(e, t, n) {
|
|
|
3712
3702
|
}
|
|
3713
3703
|
//#endregion
|
|
3714
3704
|
//#region src/core/initialAutofill.ts
|
|
3715
|
-
async function
|
|
3705
|
+
async function Tr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r, onPages: i, options: a, signal: o, state: s }) {
|
|
3716
3706
|
let c = a.autofill;
|
|
3717
3707
|
if (!c) return;
|
|
3718
3708
|
let l = s.items.length;
|
|
@@ -3725,7 +3715,7 @@ async function kr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3725
3715
|
return;
|
|
3726
3716
|
}
|
|
3727
3717
|
if (c.strategy === "backend") {
|
|
3728
|
-
await
|
|
3718
|
+
await br(c, s, {
|
|
3729
3719
|
cycleId: e,
|
|
3730
3720
|
feedKey: c.feedKey,
|
|
3731
3721
|
items: [...s.items],
|
|
@@ -3742,11 +3732,11 @@ async function kr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3742
3732
|
s.autofill.status = "exhausted";
|
|
3743
3733
|
return;
|
|
3744
3734
|
}
|
|
3745
|
-
let u = await
|
|
3735
|
+
let u = await fr({
|
|
3746
3736
|
existingItems: s.items,
|
|
3747
3737
|
initialCursor: s.next,
|
|
3748
3738
|
loadPage: a.loadPage,
|
|
3749
|
-
maximumRequests:
|
|
3739
|
+
maximumRequests: ir(c, !1),
|
|
3750
3740
|
onCollection: n,
|
|
3751
3741
|
onDelayChange: (e) => {
|
|
3752
3742
|
t() && Object.assign(s.autofill, e);
|
|
@@ -3769,13 +3759,13 @@ async function kr({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
3769
3759
|
}
|
|
3770
3760
|
//#endregion
|
|
3771
3761
|
//#region src/core/fill.ts
|
|
3772
|
-
function
|
|
3762
|
+
function Er(e) {
|
|
3773
3763
|
return "items" in e ? { items: e.items } : "pages" in e ? { pages: e.pages } : { until: "end" };
|
|
3774
3764
|
}
|
|
3775
|
-
function
|
|
3765
|
+
function Dr(e) {
|
|
3776
3766
|
return `${typeof e}:${String(e)}`;
|
|
3777
3767
|
}
|
|
3778
|
-
function
|
|
3768
|
+
function Or(e) {
|
|
3779
3769
|
if (!e || typeof e != "object") throw TypeError("Vibe fill target must be an object.");
|
|
3780
3770
|
if ("pages" in e) {
|
|
3781
3771
|
if (!Number.isInteger(e.pages) || e.pages <= 0) throw TypeError("Vibe fill pages must be a positive integer.");
|
|
@@ -3788,21 +3778,21 @@ function Mr(e) {
|
|
|
3788
3778
|
if ("until" in e && e.until === "end") return { until: "end" };
|
|
3789
3779
|
throw TypeError("Vibe fill target must be { items }, { pages }, or { until: 'end' }.");
|
|
3790
3780
|
}
|
|
3791
|
-
function
|
|
3781
|
+
function kr(e) {
|
|
3792
3782
|
if (!e) return;
|
|
3793
3783
|
if (e.strategy === "frontend") {
|
|
3794
|
-
|
|
3784
|
+
$n(e, "frontend fill");
|
|
3795
3785
|
return;
|
|
3796
3786
|
}
|
|
3797
3787
|
if (!e.feedKey.trim()) throw TypeError("Vibe backend fill requires a feedKey.");
|
|
3798
3788
|
let t = e.initialSession;
|
|
3799
3789
|
if (t) {
|
|
3800
3790
|
if (t.feedKey !== e.feedKey) throw TypeError("Vibe backend fill initialSession feedKey must match fill feedKey.");
|
|
3801
|
-
|
|
3791
|
+
Or(t.target);
|
|
3802
3792
|
}
|
|
3803
3793
|
}
|
|
3804
|
-
function
|
|
3805
|
-
let r = e?.strategy === "backend" && n ? e.initialSession : void 0, i = t ?? r, a =
|
|
3794
|
+
function Ar(e, t, n = !0) {
|
|
3795
|
+
let r = e?.strategy === "backend" && n ? e.initialSession : void 0, i = t ?? r, a = tr(i?.nextRequestAt);
|
|
3806
3796
|
return {
|
|
3807
3797
|
completedPages: i?.completedPages ?? 0,
|
|
3808
3798
|
cycleId: i?.cycleId ?? null,
|
|
@@ -3815,10 +3805,10 @@ function Pr(e, t, n = !0) {
|
|
|
3815
3805
|
sessionId: i?.sessionId ?? null,
|
|
3816
3806
|
status: i?.status ?? "idle",
|
|
3817
3807
|
strategy: e?.strategy ?? null,
|
|
3818
|
-
target: i ?
|
|
3808
|
+
target: i ? Er(i.target) : null
|
|
3819
3809
|
};
|
|
3820
3810
|
}
|
|
3821
|
-
function
|
|
3811
|
+
function jr(e) {
|
|
3822
3812
|
return [
|
|
3823
3813
|
"cancelling",
|
|
3824
3814
|
"filling",
|
|
@@ -3826,7 +3816,7 @@ function Fr(e) {
|
|
|
3826
3816
|
"waiting"
|
|
3827
3817
|
].includes(e.status);
|
|
3828
3818
|
}
|
|
3829
|
-
async function
|
|
3819
|
+
async function Mr({ 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 }) {
|
|
3830
3820
|
let d = [], f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = 0, g = n, _ = n, v = n, y = 0, b, x = () => t?.() ?? p.length;
|
|
3831
3821
|
if ("items" in u && x() >= u.items) return {
|
|
3832
3822
|
completedPages: h,
|
|
@@ -3838,10 +3828,10 @@ async function Ir({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3838
3828
|
status: "complete"
|
|
3839
3829
|
};
|
|
3840
3830
|
for (; v !== null;) {
|
|
3841
|
-
let e =
|
|
3831
|
+
let e = Dr(g);
|
|
3842
3832
|
if (m.has(e)) throw Error("Vibe fill received a repeated cursor.");
|
|
3843
|
-
if (m.add(e), await
|
|
3844
|
-
delayMs:
|
|
3833
|
+
if (m.add(e), await nr({
|
|
3834
|
+
delayMs: er(h, s),
|
|
3845
3835
|
onChange: a,
|
|
3846
3836
|
signal: l
|
|
3847
3837
|
}), h > 0 && c()) return {
|
|
@@ -3854,7 +3844,7 @@ async function Ir({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3854
3844
|
status: "paused",
|
|
3855
3845
|
total: b
|
|
3856
3846
|
};
|
|
3857
|
-
let t =
|
|
3847
|
+
let t = Hn(await r({
|
|
3858
3848
|
cursor: g,
|
|
3859
3849
|
signal: l
|
|
3860
3850
|
}));
|
|
@@ -3922,12 +3912,12 @@ async function Ir({ existingItems: e, getLoadedItemCount: t, initialCursor: n, l
|
|
|
3922
3912
|
}
|
|
3923
3913
|
//#endregion
|
|
3924
3914
|
//#region src/core/backendFill.ts
|
|
3925
|
-
async function
|
|
3915
|
+
async function Nr(e, t, n, r) {
|
|
3926
3916
|
let i = await e.onStart(n);
|
|
3927
3917
|
if (r()) {
|
|
3928
3918
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend fill requires a sessionId.");
|
|
3929
3919
|
Object.assign(t.fill, {
|
|
3930
|
-
...
|
|
3920
|
+
...tr(i.nextRequestAt),
|
|
3931
3921
|
completedPages: i.completedPages ?? 0,
|
|
3932
3922
|
received: i.received ?? 0,
|
|
3933
3923
|
sequence: i.sequence ?? 0,
|
|
@@ -3936,23 +3926,23 @@ async function Lr(e, t, n, r) {
|
|
|
3936
3926
|
});
|
|
3937
3927
|
}
|
|
3938
3928
|
}
|
|
3939
|
-
function
|
|
3929
|
+
function Pr(e, t, n) {
|
|
3940
3930
|
return e?.strategy === "backend" && n.feedKey === e.feedKey && n.sessionId === t.fill.sessionId;
|
|
3941
3931
|
}
|
|
3942
|
-
function
|
|
3932
|
+
function Fr(e) {
|
|
3943
3933
|
return Number.isInteger(e.completedPages) && e.completedPages >= 0 && Number.isInteger(e.received) && e.received >= 0 && Number.isInteger(e.sequence) && e.sequence >= 0;
|
|
3944
3934
|
}
|
|
3945
|
-
function
|
|
3935
|
+
function Ir(e, t) {
|
|
3946
3936
|
if (!["complete", "exhausted"].includes(t.status)) return !0;
|
|
3947
3937
|
let n = e.fill.target;
|
|
3948
3938
|
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;
|
|
3949
3939
|
}
|
|
3950
|
-
function
|
|
3940
|
+
function Lr(e, t, n) {
|
|
3951
3941
|
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));
|
|
3952
3942
|
}
|
|
3953
|
-
function
|
|
3954
|
-
return !
|
|
3955
|
-
...
|
|
3943
|
+
function Rr(e, t, n, r) {
|
|
3944
|
+
return !Pr(e, t, n) || !Fr(n) || n.sequence <= t.fill.sequence || ["cancelled", "cancelling"].includes(t.fill.status) || !Ir(t, n) ? !1 : (Lr(t, n, r), Object.assign(t.fill, {
|
|
3945
|
+
...tr(n.status === "waiting" ? n.nextRequestAt : null),
|
|
3956
3946
|
completedPages: n.completedPages,
|
|
3957
3947
|
error: n.error ?? null,
|
|
3958
3948
|
received: n.received,
|
|
@@ -3960,45 +3950,45 @@ function Hr(e, t, n, r) {
|
|
|
3960
3950
|
status: n.status
|
|
3961
3951
|
}), !0);
|
|
3962
3952
|
}
|
|
3963
|
-
function
|
|
3953
|
+
function zr(e, t, n, r) {
|
|
3964
3954
|
if (e?.strategy !== "backend" || n.feedKey !== e.feedKey) return !1;
|
|
3965
3955
|
let i = t.fill;
|
|
3966
|
-
return t.fill =
|
|
3956
|
+
return t.fill = Ar(e, n), !Fr(n) || !Ir(t, n) ? (t.fill = i, !1) : (Lr(t, n, r), !0);
|
|
3967
3957
|
}
|
|
3968
3958
|
//#endregion
|
|
3969
3959
|
//#region src/core/fillController.ts
|
|
3970
|
-
var
|
|
3960
|
+
var Br = class {
|
|
3971
3961
|
abortController = null;
|
|
3972
3962
|
cycle = 0;
|
|
3973
3963
|
delayCountdown;
|
|
3974
3964
|
requestVersion = 0;
|
|
3975
3965
|
collection = null;
|
|
3976
3966
|
constructor(e) {
|
|
3977
|
-
this.options = e, this.delayCountdown = new
|
|
3967
|
+
this.options = e, this.delayCountdown = new rr((e) => {
|
|
3978
3968
|
Object.assign(this.options.state.fill, e);
|
|
3979
3969
|
}), this.syncBackendCountdown();
|
|
3980
3970
|
}
|
|
3981
3971
|
isActive() {
|
|
3982
|
-
return
|
|
3972
|
+
return jr(this.options.state.fill);
|
|
3983
3973
|
}
|
|
3984
3974
|
applyUpdate(e) {
|
|
3985
|
-
let t =
|
|
3975
|
+
let t = Rr(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
3986
3976
|
return t && this.syncBackendCountdown(), t;
|
|
3987
3977
|
}
|
|
3988
3978
|
restoreSession(e) {
|
|
3989
|
-
let t =
|
|
3979
|
+
let t = zr(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
3990
3980
|
return t && this.syncBackendCountdown(), t;
|
|
3991
3981
|
}
|
|
3992
3982
|
async start(e, t = {}) {
|
|
3993
3983
|
let n = this.options.fill;
|
|
3994
3984
|
if (!n) throw Error("Vibe fill is not configured.");
|
|
3995
3985
|
if (this.isActive()) throw Error("Vibe fill is already active.");
|
|
3996
|
-
let r =
|
|
3986
|
+
let r = Or(e), i = Or(t.target ?? r), a = t.progressOffset ?? {
|
|
3997
3987
|
completedPages: 0,
|
|
3998
3988
|
received: 0
|
|
3999
3989
|
}, o = t.cycleId ?? `vibe-fill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
4000
3990
|
if (this.options.state.fill = {
|
|
4001
|
-
...
|
|
3991
|
+
...Ar(n, void 0, !1),
|
|
4002
3992
|
completedPages: a.completedPages,
|
|
4003
3993
|
cycleId: o,
|
|
4004
3994
|
received: a.received,
|
|
@@ -4011,7 +4001,7 @@ var Wr = class {
|
|
|
4011
4001
|
let s = ++this.requestVersion, c = new AbortController();
|
|
4012
4002
|
this.abortController = c;
|
|
4013
4003
|
try {
|
|
4014
|
-
n.strategy === "frontend" ? await this.startFrontend(n, r, c, s, t.prepareFrontend !== !1, a) : (await
|
|
4004
|
+
n.strategy === "frontend" ? await this.startFrontend(n, r, c, s, t.prepareFrontend !== !1, a) : (await Nr(n, this.options.state, {
|
|
4015
4005
|
cycleId: o,
|
|
4016
4006
|
feedKey: n.feedKey,
|
|
4017
4007
|
items: [...this.options.state.items],
|
|
@@ -4029,7 +4019,7 @@ var Wr = class {
|
|
|
4029
4019
|
}
|
|
4030
4020
|
async cancel() {
|
|
4031
4021
|
let { fill: e, state: t } = this.options;
|
|
4032
|
-
if (!
|
|
4022
|
+
if (!jr(t.fill) || !t.fill.cycleId) return;
|
|
4033
4023
|
let n = {
|
|
4034
4024
|
cycleId: t.fill.cycleId,
|
|
4035
4025
|
feedKey: t.fill.feedKey ?? "",
|
|
@@ -4073,7 +4063,7 @@ var Wr = class {
|
|
|
4073
4063
|
});
|
|
4074
4064
|
}
|
|
4075
4065
|
reset() {
|
|
4076
|
-
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill =
|
|
4066
|
+
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill = Ar(this.options.fill, void 0, !1), this.collection = null;
|
|
4077
4067
|
}
|
|
4078
4068
|
destroy() {
|
|
4079
4069
|
this.abortLocalRequest(), this.delayCountdown.clear();
|
|
@@ -4108,7 +4098,7 @@ var Wr = class {
|
|
|
4108
4098
|
s.fill.status = "until" in t ? "complete" : "exhausted";
|
|
4109
4099
|
return;
|
|
4110
4100
|
}
|
|
4111
|
-
let c = await
|
|
4101
|
+
let c = await Mr({
|
|
4112
4102
|
existingItems: s.items,
|
|
4113
4103
|
getLoadedItemCount: () => s.items.length,
|
|
4114
4104
|
initialCursor: s.next,
|
|
@@ -4160,7 +4150,7 @@ var Wr = class {
|
|
|
4160
4150
|
};
|
|
4161
4151
|
//#endregion
|
|
4162
4152
|
//#region src/core/fillReconciliation.ts
|
|
4163
|
-
async function
|
|
4153
|
+
async function Vr({ controller: e, isCurrent: t, loadPage: n, onDelayChange: r, pauseWhenManual: i = !1, setLastCursor: a, signal: o, state: s }) {
|
|
4164
4154
|
if (!e.needsReconciliation(s.items)) return "skipped";
|
|
4165
4155
|
let c = await e.reconcile({
|
|
4166
4156
|
existingItems: s.items,
|
|
@@ -4173,7 +4163,7 @@ async function Gr({ controller: e, isCurrent: t, loadPage: n, onDelayChange: r,
|
|
|
4173
4163
|
}
|
|
4174
4164
|
//#endregion
|
|
4175
4165
|
//#region src/core/feedFooter.ts
|
|
4176
|
-
function
|
|
4166
|
+
function Hr(e) {
|
|
4177
4167
|
return {
|
|
4178
4168
|
cancelAutofill: () => e.cancelAutofill(),
|
|
4179
4169
|
loadMore: () => e.loadNext(),
|
|
@@ -4185,46 +4175,46 @@ function Kr(e) {
|
|
|
4185
4175
|
retryFill: () => e.retryFill()
|
|
4186
4176
|
};
|
|
4187
4177
|
}
|
|
4188
|
-
function
|
|
4178
|
+
function Ur(e) {
|
|
4189
4179
|
if (!Number.isFinite(e) || e <= 0) throw TypeError("Vibe reelAutoAdvance.intervalMs must be a positive number.");
|
|
4190
4180
|
}
|
|
4191
|
-
function
|
|
4192
|
-
e?.intervalMs !== void 0 &&
|
|
4181
|
+
function Wr(e) {
|
|
4182
|
+
e?.intervalMs !== void 0 && Ur(e.intervalMs);
|
|
4193
4183
|
}
|
|
4194
|
-
function
|
|
4184
|
+
function Gr(e) {
|
|
4195
4185
|
return {
|
|
4196
4186
|
enabled: e?.enabled ?? !1,
|
|
4197
4187
|
includePostItems: e?.includePostItems ?? !1,
|
|
4198
4188
|
intervalMs: e?.intervalMs ?? 5e3
|
|
4199
4189
|
};
|
|
4200
4190
|
}
|
|
4201
|
-
function
|
|
4191
|
+
function Kr(e, t) {
|
|
4202
4192
|
if (typeof t == "boolean") {
|
|
4203
4193
|
e.enabled = t;
|
|
4204
4194
|
return;
|
|
4205
4195
|
}
|
|
4206
|
-
|
|
4196
|
+
Wr(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);
|
|
4207
4197
|
}
|
|
4208
4198
|
//#endregion
|
|
4209
4199
|
//#region src/core/reelInfoSheet.ts
|
|
4210
|
-
function
|
|
4200
|
+
function qr(e) {
|
|
4211
4201
|
return { enabled: e?.enabled ?? !1 };
|
|
4212
4202
|
}
|
|
4213
|
-
function
|
|
4203
|
+
function Jr(e, t, n) {
|
|
4214
4204
|
if (n && !t) throw Error("Vibe cannot enable reelInfoSheet without a configured component.");
|
|
4215
4205
|
e.enabled = n;
|
|
4216
4206
|
}
|
|
4217
4207
|
//#endregion
|
|
4218
4208
|
//#region src/core/initialRuntimeState.ts
|
|
4219
|
-
function
|
|
4209
|
+
function Yr(e, t) {
|
|
4220
4210
|
let n = e.initialPage;
|
|
4221
4211
|
return {
|
|
4222
4212
|
activeReelPostId: null,
|
|
4223
|
-
autoScroll:
|
|
4224
|
-
autofill:
|
|
4213
|
+
autoScroll: vr(e.autoScroll),
|
|
4214
|
+
autofill: cr(e.autofill),
|
|
4225
4215
|
current: n?.current ?? null,
|
|
4226
4216
|
error: null,
|
|
4227
|
-
fill:
|
|
4217
|
+
fill: Ar(e.fill),
|
|
4228
4218
|
infiniteScroll: e.infiniteScroll ?? !0,
|
|
4229
4219
|
isLoading: !n,
|
|
4230
4220
|
isLoadingMore: !1,
|
|
@@ -4235,14 +4225,14 @@ function $r(e, t) {
|
|
|
4235
4225
|
next: n?.next ?? null,
|
|
4236
4226
|
nextPageError: null,
|
|
4237
4227
|
phoneMode: !1,
|
|
4238
|
-
reelAutoAdvance:
|
|
4228
|
+
reelAutoAdvance: Gr(e.reelAutoAdvance),
|
|
4239
4229
|
reelForward: {
|
|
4240
4230
|
error: null,
|
|
4241
4231
|
status: "idle"
|
|
4242
4232
|
},
|
|
4243
4233
|
reelForwardIndex: null,
|
|
4244
4234
|
reelForwardItem: null,
|
|
4245
|
-
reelInfoSheet:
|
|
4235
|
+
reelInfoSheet: qr(e.reelInfoSheet),
|
|
4246
4236
|
reelInfoSheetOverlay: !1,
|
|
4247
4237
|
reelMediaSource: "original",
|
|
4248
4238
|
reelOrigin: null,
|
|
@@ -4251,21 +4241,21 @@ function $r(e, t) {
|
|
|
4251
4241
|
}
|
|
4252
4242
|
//#endregion
|
|
4253
4243
|
//#region src/core/options.ts
|
|
4254
|
-
function
|
|
4244
|
+
function Xr(e, t) {
|
|
4255
4245
|
if (t) {
|
|
4256
4246
|
if (!Number.isFinite(t.height) || t.height <= 0) throw TypeError(`Vibe ${e} height must be a positive number.`);
|
|
4257
4247
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe ${e} background must be "default" or "transparent".`);
|
|
4258
4248
|
}
|
|
4259
4249
|
}
|
|
4260
|
-
function
|
|
4250
|
+
function Zr(e, t) {
|
|
4261
4251
|
if (t) {
|
|
4262
4252
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe mediaCard ${e} background must be "default" or "transparent".`);
|
|
4263
4253
|
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.`);
|
|
4264
4254
|
}
|
|
4265
4255
|
}
|
|
4266
|
-
function
|
|
4267
|
-
if (
|
|
4268
|
-
if (
|
|
4256
|
+
function Qr(e) {
|
|
4257
|
+
if (_r(e.autoScroll), Xr("cardHeader", e.cardHeader), Xr("cardFooter", e.cardFooter), Zr("header", e.mediaCard?.header), Zr("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\".");
|
|
4258
|
+
if (sr(e.autofill), kr(e.fill), ke(e.masonry), Wr(e.reelAutoAdvance), e.removalReconciliation) {
|
|
4269
4259
|
if (!Number.isInteger(e.removalReconciliation.pageSize) || e.removalReconciliation.pageSize <= 0) throw TypeError("Vibe removalReconciliation pageSize must be a positive integer.");
|
|
4270
4260
|
let t = e.removalReconciliation.maxReplayPages ?? 5;
|
|
4271
4261
|
if (!Number.isInteger(t) || t <= 0) throw TypeError("Vibe removalReconciliation maxReplayPages must be a positive integer.");
|
|
@@ -4280,7 +4270,7 @@ function ni(e) {
|
|
|
4280
4270
|
if (e.fill?.strategy === "frontend" && !e.loadPage) throw TypeError("Vibe frontend fill requires loadPage.");
|
|
4281
4271
|
if (e.fill?.strategy === "backend" && e.fill.initialSession && !e.initialPage) throw TypeError("Vibe backend fill restoration requires initialPage.");
|
|
4282
4272
|
}
|
|
4283
|
-
function
|
|
4273
|
+
function $r(e) {
|
|
4284
4274
|
if (typeof e != "string") return e;
|
|
4285
4275
|
if (typeof document > "u") throw Error("Vibe cannot resolve a selector without a document.");
|
|
4286
4276
|
let t = document.querySelector(e);
|
|
@@ -4289,7 +4279,7 @@ function ri(e) {
|
|
|
4289
4279
|
}
|
|
4290
4280
|
//#endregion
|
|
4291
4281
|
//#region src/core/pageRequest.ts
|
|
4292
|
-
async function
|
|
4282
|
+
async function ei({ append: e, autofillController: t, cursor: n, isCurrent: r, loadPage: i, onLastCursor: a, onPages: o, options: s, signal: c, state: l }) {
|
|
4293
4283
|
let u = s.autofill, d = e && u?.strategy === "frontend" && (l.autofill.status === "paused" || l.autofill.status === "error"), f = d ? {
|
|
4294
4284
|
received: l.autofill.received,
|
|
4295
4285
|
requests: l.autofill.requests
|
|
@@ -4301,11 +4291,11 @@ async function ii({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4301
4291
|
let m = !1;
|
|
4302
4292
|
try {
|
|
4303
4293
|
if (u?.strategy === "frontend") {
|
|
4304
|
-
let s = await
|
|
4294
|
+
let s = await fr({
|
|
4305
4295
|
existingItems: e ? l.items : [],
|
|
4306
4296
|
initialCursor: n,
|
|
4307
4297
|
loadPage: i,
|
|
4308
|
-
maximumRequests: f ? Math.max(0,
|
|
4298
|
+
maximumRequests: f ? Math.max(0, ir(u) - f.requests) : void 0,
|
|
4309
4299
|
onCollection: (e) => t.captureCollection(e, r()),
|
|
4310
4300
|
onDelayChange: (e) => {
|
|
4311
4301
|
r() && Object.assign(l.autofill, e);
|
|
@@ -4328,7 +4318,7 @@ async function ii({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4328
4318
|
}), o(s.pages), t.clearCollection();
|
|
4329
4319
|
return;
|
|
4330
4320
|
}
|
|
4331
|
-
let s =
|
|
4321
|
+
let s = Hn(await i({
|
|
4332
4322
|
cursor: n,
|
|
4333
4323
|
signal: c
|
|
4334
4324
|
}));
|
|
@@ -4348,7 +4338,7 @@ async function ii({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4348
4338
|
l.autofill.status = "complete";
|
|
4349
4339
|
return;
|
|
4350
4340
|
}
|
|
4351
|
-
await
|
|
4341
|
+
await br(u, l, {
|
|
4352
4342
|
cycleId: p,
|
|
4353
4343
|
feedKey: u.feedKey,
|
|
4354
4344
|
items: h.slice(d.length),
|
|
@@ -4370,7 +4360,7 @@ async function ii({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
4370
4360
|
}
|
|
4371
4361
|
//#endregion
|
|
4372
4362
|
//#region src/core/pageReplacement.ts
|
|
4373
|
-
var
|
|
4363
|
+
var ti = class {
|
|
4374
4364
|
controller = null;
|
|
4375
4365
|
constructor(e) {
|
|
4376
4366
|
this.options = e;
|
|
@@ -4382,7 +4372,7 @@ var ai = class {
|
|
|
4382
4372
|
this.controller?.abort(), this.controller = null, this.options.surface()?.cancelItemRemoval();
|
|
4383
4373
|
}
|
|
4384
4374
|
async replace(e, t) {
|
|
4385
|
-
let n =
|
|
4375
|
+
let n = Hn(e);
|
|
4386
4376
|
this.cancel();
|
|
4387
4377
|
let r = new AbortController();
|
|
4388
4378
|
this.controller = r;
|
|
@@ -4402,7 +4392,7 @@ var ai = class {
|
|
|
4402
4392
|
let e = this.options.surface()?.getAutoScrollElement();
|
|
4403
4393
|
e && (e.scrollTop = 0);
|
|
4404
4394
|
}
|
|
4405
|
-
e.mediaIndices = new Map(a.map((t) => [t.postId,
|
|
4395
|
+
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({
|
|
4406
4396
|
...n,
|
|
4407
4397
|
items: a
|
|
4408
4398
|
});
|
|
@@ -4413,7 +4403,7 @@ var ai = class {
|
|
|
4413
4403
|
};
|
|
4414
4404
|
//#endregion
|
|
4415
4405
|
//#region src/core/loadingLock.ts
|
|
4416
|
-
function
|
|
4406
|
+
function ni(e, t, n) {
|
|
4417
4407
|
if (e.loadMoreLocked !== t && (e.loadMoreLocked = t, !t)) {
|
|
4418
4408
|
if (e.fill.status === "paused" && e.fill.target) {
|
|
4419
4409
|
n.resumeFill();
|
|
@@ -4424,21 +4414,21 @@ function oi(e, t, n) {
|
|
|
4424
4414
|
e ? e.finally(() => {
|
|
4425
4415
|
n.loadNext();
|
|
4426
4416
|
}) : n.loadNext();
|
|
4427
|
-
} else e.infiniteScroll &&
|
|
4417
|
+
} else e.infiniteScroll && m(n.loadIfNearBottom);
|
|
4428
4418
|
}
|
|
4429
4419
|
}
|
|
4430
4420
|
//#endregion
|
|
4431
4421
|
//#region src/core/removalReconciliationController.ts
|
|
4432
|
-
function
|
|
4422
|
+
function ri(e) {
|
|
4433
4423
|
return `${typeof e}:${String(e)}`;
|
|
4434
4424
|
}
|
|
4435
|
-
function
|
|
4425
|
+
function ii(e) {
|
|
4436
4426
|
return `${typeof e}:${String(e)}`;
|
|
4437
4427
|
}
|
|
4438
|
-
function
|
|
4428
|
+
function ai(e) {
|
|
4439
4429
|
return e.map(({ postId: e }) => e);
|
|
4440
4430
|
}
|
|
4441
|
-
var
|
|
4431
|
+
var oi = class {
|
|
4442
4432
|
delay;
|
|
4443
4433
|
enabled;
|
|
4444
4434
|
maxReplayPages;
|
|
@@ -4457,7 +4447,7 @@ var ui = class {
|
|
|
4457
4447
|
e.status === "complete" && (this.pages = [...this.pages.slice(0, e.replaceFrom), ...e.pages].slice(-this.maxReplayPages), this.pending = null);
|
|
4458
4448
|
}
|
|
4459
4449
|
filterItems(e) {
|
|
4460
|
-
return this.tombstones.size === 0 ? [...e] : e.filter(({ postId: e }) => !this.tombstones.has(
|
|
4450
|
+
return this.tombstones.size === 0 ? [...e] : e.filter(({ postId: e }) => !this.tombstones.has(ri(e)));
|
|
4461
4451
|
}
|
|
4462
4452
|
needsReconciliation(e) {
|
|
4463
4453
|
return this.pending !== null || this.findUnderfilledPage(e) >= 0;
|
|
@@ -4470,45 +4460,45 @@ var ui = class {
|
|
|
4470
4460
|
}
|
|
4471
4461
|
recordInitialPage(e) {
|
|
4472
4462
|
e && this.recordPages([{
|
|
4473
|
-
contributionIds:
|
|
4474
|
-
cursor:
|
|
4463
|
+
contributionIds: ai(e.items),
|
|
4464
|
+
cursor: Kn(e),
|
|
4475
4465
|
next: e.next,
|
|
4476
|
-
returnedIds:
|
|
4466
|
+
returnedIds: ai(e.items)
|
|
4477
4467
|
}]);
|
|
4478
4468
|
}
|
|
4479
4469
|
remove(e) {
|
|
4480
|
-
e.forEach((e) => this.tombstones.add(
|
|
4470
|
+
e.forEach((e) => this.tombstones.add(ri(e)));
|
|
4481
4471
|
}
|
|
4482
4472
|
reset() {
|
|
4483
4473
|
this.pages = [], this.pending = null, this.tombstones.clear();
|
|
4484
4474
|
}
|
|
4485
4475
|
restore(e) {
|
|
4486
|
-
e.forEach((e) => this.tombstones.delete(
|
|
4476
|
+
e.forEach((e) => this.tombstones.delete(ri(e)));
|
|
4487
4477
|
}
|
|
4488
4478
|
async reconcile({ existingItems: e, loadPage: t, onDelayChange: n = () => void 0, shouldPause: r = () => !1, signal: i }) {
|
|
4489
4479
|
let a = this.pending ?? this.createSession(e);
|
|
4490
4480
|
for (this.pending = a; a.remainingRequests > 0;) {
|
|
4491
|
-
let e =
|
|
4481
|
+
let e = ii(a.cursor);
|
|
4492
4482
|
if (a.seenCursors.has(e)) throw Error("Vibe removal reconciliation received a repeated cursor.");
|
|
4493
|
-
if (await
|
|
4494
|
-
delayMs:
|
|
4483
|
+
if (await nr({
|
|
4484
|
+
delayMs: er(a.pages.length, this.delay),
|
|
4495
4485
|
onChange: n,
|
|
4496
4486
|
signal: i
|
|
4497
4487
|
}), a.pages.length > 0 && r()) return this.result(a, "paused");
|
|
4498
|
-
let o =
|
|
4488
|
+
let o = Hn(await t({
|
|
4499
4489
|
cursor: a.cursor,
|
|
4500
4490
|
signal: i
|
|
4501
4491
|
}));
|
|
4502
4492
|
a.seenCursors.add(e);
|
|
4503
4493
|
let s = this.filterItems(o.items), c = [];
|
|
4504
4494
|
if (s.forEach((e) => {
|
|
4505
|
-
let t =
|
|
4495
|
+
let t = ri(e.postId);
|
|
4506
4496
|
a.attributed.has(t) || (a.attributed.add(t), c.push(e.postId)), a.appended.has(t) || (a.appended.add(t), a.items.push(e));
|
|
4507
4497
|
}), a.pages.push({
|
|
4508
4498
|
contributionIds: c,
|
|
4509
4499
|
cursor: a.cursor,
|
|
4510
4500
|
next: o.next,
|
|
4511
|
-
returnedIds:
|
|
4501
|
+
returnedIds: ai(s)
|
|
4512
4502
|
}), 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");
|
|
4513
4503
|
}
|
|
4514
4504
|
return this.result(a, "complete");
|
|
@@ -4516,9 +4506,9 @@ var ui = class {
|
|
|
4516
4506
|
createSession(e) {
|
|
4517
4507
|
let t = this.findUnderfilledPage(e), n = t < 0 ? [] : this.pages.slice(t), r = n[0];
|
|
4518
4508
|
if (!r) throw Error("Vibe has no underfilled provider page to reconcile.");
|
|
4519
|
-
let i = new Set(n.flatMap(({ contributionIds: e }) => e.map(
|
|
4509
|
+
let i = new Set(n.flatMap(({ contributionIds: e }) => e.map(ri))), a = new Set(e.map(({ postId: e }) => ri(e)).filter((e) => !i.has(e)));
|
|
4520
4510
|
return {
|
|
4521
|
-
appended: new Set(e.map(({ postId: e }) =>
|
|
4511
|
+
appended: new Set(e.map(({ postId: e }) => ri(e))),
|
|
4522
4512
|
attributed: new Set(a),
|
|
4523
4513
|
cursor: r.cursor,
|
|
4524
4514
|
items: [],
|
|
@@ -4543,11 +4533,11 @@ var ui = class {
|
|
|
4543
4533
|
}
|
|
4544
4534
|
findUnderfilledPage(e) {
|
|
4545
4535
|
if (!this.enabled || this.pages.length === 0) return -1;
|
|
4546
|
-
let t = new Set(e.map(({ postId: e }) =>
|
|
4547
|
-
return this.pages.findIndex(({ contributionIds: e }) => e.filter((e) => t.has(
|
|
4536
|
+
let t = new Set(e.map(({ postId: e }) => ri(e)));
|
|
4537
|
+
return this.pages.findIndex(({ contributionIds: e }) => e.filter((e) => t.has(ri(e))).length < this.pageSize);
|
|
4548
4538
|
}
|
|
4549
4539
|
recordPage(e) {
|
|
4550
|
-
let t =
|
|
4540
|
+
let t = ii(e.cursor), n = this.pages.findIndex(({ cursor: e }) => ii(e) === t);
|
|
4551
4541
|
n >= 0 && (this.pages = this.pages.slice(0, n)), this.pages.push({
|
|
4552
4542
|
...e,
|
|
4553
4543
|
contributionIds: [...e.contributionIds],
|
|
@@ -4557,7 +4547,7 @@ var ui = class {
|
|
|
4557
4547
|
};
|
|
4558
4548
|
//#endregion
|
|
4559
4549
|
//#region src/core/activeItemRemoval.ts
|
|
4560
|
-
function
|
|
4550
|
+
function si(e, t, n, r, i) {
|
|
4561
4551
|
let a = new Set(t.map(({ item: e }) => e.postId));
|
|
4562
4552
|
if (e.activeReelPostId === null || !a.has(e.activeReelPostId)) return;
|
|
4563
4553
|
let o = e.items[Math.max(n, 0)];
|
|
@@ -4570,7 +4560,7 @@ function di(e, t, n, r, i) {
|
|
|
4570
4560
|
}
|
|
4571
4561
|
//#endregion
|
|
4572
4562
|
//#region src/core/exactMediaRemovalController.ts
|
|
4573
|
-
function
|
|
4563
|
+
function ci(e, t) {
|
|
4574
4564
|
let [n, ...r] = t;
|
|
4575
4565
|
if (!n) throw Error("Vibe items must contain at least one media asset.");
|
|
4576
4566
|
return {
|
|
@@ -4579,10 +4569,10 @@ function fi(e, t) {
|
|
|
4579
4569
|
items: r
|
|
4580
4570
|
};
|
|
4581
4571
|
}
|
|
4582
|
-
function
|
|
4572
|
+
function li(e) {
|
|
4583
4573
|
if (!Number.isInteger(e.mediaIndex) || e.mediaIndex < 0) throw TypeError("Vibe mediaIndex must be a non-negative integer.");
|
|
4584
4574
|
}
|
|
4585
|
-
var
|
|
4575
|
+
var ui = class {
|
|
4586
4576
|
generation = 0;
|
|
4587
4577
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
4588
4578
|
state;
|
|
@@ -4590,10 +4580,10 @@ var mi = class {
|
|
|
4590
4580
|
this.options = e, this.state = e.state;
|
|
4591
4581
|
}
|
|
4592
4582
|
remove(e) {
|
|
4593
|
-
|
|
4583
|
+
li(e);
|
|
4594
4584
|
let t = this.state.items.findIndex(({ postId: t }) => t === e.postId), n = this.state.items[t];
|
|
4595
4585
|
if (!n) return null;
|
|
4596
|
-
let r = [...
|
|
4586
|
+
let r = [...V(n)], i = r[e.mediaIndex];
|
|
4597
4587
|
if (!i) return null;
|
|
4598
4588
|
let a = Object.freeze({
|
|
4599
4589
|
media: i,
|
|
@@ -4607,7 +4597,7 @@ var mi = class {
|
|
|
4607
4597
|
restored: !1
|
|
4608
4598
|
});
|
|
4609
4599
|
let o = this.state.mediaIndices.get(n.postId) ?? 0, s = this.isReelOpen() && this.state.activeReelPostId === n.postId, c = s && o === e.mediaIndex;
|
|
4610
|
-
return r.splice(e.mediaIndex, 1), r.length > 0 ? (this.state.items[t] =
|
|
4600
|
+
return r.splice(e.mediaIndex, 1), r.length > 0 ? (this.state.items[t] = ci(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);
|
|
4611
4601
|
}
|
|
4612
4602
|
reset() {
|
|
4613
4603
|
this.generation += 1;
|
|
@@ -4632,32 +4622,32 @@ var mi = class {
|
|
|
4632
4622
|
return this.state.layout === "reel" || this.state.reelOrigin === "masonry";
|
|
4633
4623
|
}
|
|
4634
4624
|
restoreIntoPost(e, t) {
|
|
4635
|
-
let n = this.state.items[e], r = [...
|
|
4636
|
-
if (r.splice(i, 0, t.media), this.state.items[e] =
|
|
4625
|
+
let n = this.state.items[e], r = [...V(n)], i = Math.min(t.mediaIndex, r.length);
|
|
4626
|
+
if (r.splice(i, 0, t.media), this.state.items[e] = ci(n, r), this.state.activeReelPostId !== t.postId) return;
|
|
4637
4627
|
let a = this.state.mediaIndices.get(t.postId) ?? 0;
|
|
4638
4628
|
a >= i && this.state.mediaIndices.set(t.postId, a + 1);
|
|
4639
4629
|
}
|
|
4640
4630
|
updateMediaIndexAfterRemoval(e, t, n) {
|
|
4641
4631
|
let r = this.state.items.find((t) => t.postId === e);
|
|
4642
4632
|
if (!r) return;
|
|
4643
|
-
let i =
|
|
4633
|
+
let i = V(r).length, a = this.state.mediaIndices.get(e) ?? 0, o = a;
|
|
4644
4634
|
n ? o = t < i ? t : 0 : t < a && (o = a - 1), this.state.mediaIndices.set(e, Math.min(o, i - 1));
|
|
4645
4635
|
}
|
|
4646
4636
|
};
|
|
4647
4637
|
//#endregion
|
|
4648
4638
|
//#region src/core/itemPlacement.ts
|
|
4649
|
-
function
|
|
4639
|
+
function di(e, t) {
|
|
4650
4640
|
let n = new Set(t);
|
|
4651
4641
|
return e.flatMap((e, t) => n.has(e.postId) ? [{
|
|
4652
4642
|
index: t,
|
|
4653
4643
|
item: e
|
|
4654
4644
|
}] : []);
|
|
4655
4645
|
}
|
|
4656
|
-
function
|
|
4646
|
+
function fi(e, t) {
|
|
4657
4647
|
let n = new Set(t.map(({ item: e }) => e.postId));
|
|
4658
4648
|
return e.filter((e) => !n.has(e.postId));
|
|
4659
4649
|
}
|
|
4660
|
-
function
|
|
4650
|
+
function pi(e, t) {
|
|
4661
4651
|
t.forEach(({ index: e }) => {
|
|
4662
4652
|
if (!Number.isInteger(e) || e < 0) throw Error("Vibe item restore indexes must be non-negative integers.");
|
|
4663
4653
|
});
|
|
@@ -4668,7 +4658,7 @@ function _i(e, t) {
|
|
|
4668
4658
|
}
|
|
4669
4659
|
//#endregion
|
|
4670
4660
|
//#region src/core/itemRemovalController.ts
|
|
4671
|
-
var
|
|
4661
|
+
var mi = 20, hi = class {
|
|
4672
4662
|
generation = 0;
|
|
4673
4663
|
historyLimit;
|
|
4674
4664
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
@@ -4677,7 +4667,7 @@ var vi = 20, yi = class {
|
|
|
4677
4667
|
itemOrder;
|
|
4678
4668
|
stopItemsWatcher;
|
|
4679
4669
|
constructor(e) {
|
|
4680
|
-
this.options = e, this.historyLimit = e.historyLimit ??
|
|
4670
|
+
this.options = e, this.historyLimit = e.historyLimit ?? mi, 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" });
|
|
4681
4671
|
}
|
|
4682
4672
|
destroy() {
|
|
4683
4673
|
this.reset(), this.stopItemsWatcher();
|
|
@@ -4691,7 +4681,7 @@ var vi = 20, yi = class {
|
|
|
4691
4681
|
let a = this.options.startRemoval(i, t);
|
|
4692
4682
|
if (a > 0 && await new Promise((e) => setTimeout(e, a)), this.metadata.get(r)?.generation !== this.generation) return r;
|
|
4693
4683
|
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);
|
|
4694
|
-
return this.state.items =
|
|
4684
|
+
return this.state.items = fi(this.state.items, n), this.options.onItemsRemoved(r, n, l), this.record(r), r;
|
|
4695
4685
|
}
|
|
4696
4686
|
reset() {
|
|
4697
4687
|
this.generation += 1, this.history = [], this.itemOrder = [];
|
|
@@ -4702,7 +4692,7 @@ var vi = 20, yi = class {
|
|
|
4702
4692
|
this.restoreRemoval(t);
|
|
4703
4693
|
return;
|
|
4704
4694
|
}
|
|
4705
|
-
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 =
|
|
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 = pi(this.state.items, r);
|
|
4706
4696
|
this.registerExternalPlacements(r), this.state.items = i, r.length > 0 && this.options.onRemovalRestored(r);
|
|
4707
4697
|
}
|
|
4708
4698
|
restoreRemoval(e) {
|
|
@@ -4728,7 +4718,7 @@ var vi = 20, yi = class {
|
|
|
4728
4718
|
}
|
|
4729
4719
|
collectOrderedPlacements(e) {
|
|
4730
4720
|
let t = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
4731
|
-
return
|
|
4721
|
+
return di(this.state.items, e).map((e) => ({
|
|
4732
4722
|
index: t.get(e.item.postId) ?? e.index,
|
|
4733
4723
|
item: e.item
|
|
4734
4724
|
}));
|
|
@@ -4759,7 +4749,7 @@ var vi = 20, yi = class {
|
|
|
4759
4749
|
let r = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
4760
4750
|
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;
|
|
4761
4751
|
}
|
|
4762
|
-
},
|
|
4752
|
+
}, gi = class {
|
|
4763
4753
|
forward = null;
|
|
4764
4754
|
forwardPromise = null;
|
|
4765
4755
|
forwardVersion = 0;
|
|
@@ -4855,7 +4845,7 @@ var vi = 20, yi = class {
|
|
|
4855
4845
|
}
|
|
4856
4846
|
}
|
|
4857
4847
|
}
|
|
4858
|
-
},
|
|
4848
|
+
}, _i = class {
|
|
4859
4849
|
generation = 0;
|
|
4860
4850
|
pending = Promise.resolve();
|
|
4861
4851
|
constructor(e) {
|
|
@@ -4872,7 +4862,7 @@ var vi = 20, yi = class {
|
|
|
4872
4862
|
if (!n) return;
|
|
4873
4863
|
let r = t.mediaIndices.get(e.postId) ?? 0;
|
|
4874
4864
|
if (e.mediaIndex === r) {
|
|
4875
|
-
if (
|
|
4865
|
+
if (V(n).length > 1) {
|
|
4876
4866
|
await this.options.transitionMedia(1);
|
|
4877
4867
|
return;
|
|
4878
4868
|
}
|
|
@@ -4905,24 +4895,24 @@ var vi = 20, yi = class {
|
|
|
4905
4895
|
};
|
|
4906
4896
|
//#endregion
|
|
4907
4897
|
//#region src/core/removalControllers.ts
|
|
4908
|
-
function
|
|
4909
|
-
let t = new
|
|
4898
|
+
function vi(e) {
|
|
4899
|
+
let t = new gi(e), n = new _i({
|
|
4910
4900
|
state: e.state,
|
|
4911
4901
|
transitionMedia: (t) => e.surface()?.transitionActiveReelMedia(t) ?? Promise.resolve(!1),
|
|
4912
4902
|
transitionPost: (t) => e.surface()?.transitionActiveReelPost(t) ?? Promise.resolve(!1)
|
|
4913
4903
|
});
|
|
4914
4904
|
return {
|
|
4915
|
-
exactMediaRemoval: new
|
|
4905
|
+
exactMediaRemoval: new ui({
|
|
4916
4906
|
onActivate: e.onActivate,
|
|
4917
4907
|
onPostRemoved: (t) => e.onItemsRemoved([t]),
|
|
4918
4908
|
onPostRestored: (t) => e.onItemsRestored([t]),
|
|
4919
4909
|
reelForward: t,
|
|
4920
4910
|
state: e.state
|
|
4921
4911
|
}),
|
|
4922
|
-
itemRemoval: new
|
|
4912
|
+
itemRemoval: new hi({
|
|
4923
4913
|
historyLimit: e.historyLimit,
|
|
4924
4914
|
onItemsRemoved: (n, r, i) => {
|
|
4925
|
-
e.onItemsRemoved(r.map(({ item: e }) => e.postId)),
|
|
4915
|
+
e.onItemsRemoved(r.map(({ item: e }) => e.postId)), si(e.state, r, i, e.onActivate, (e, r) => t.start(n, e, r));
|
|
4926
4916
|
},
|
|
4927
4917
|
onRemovalRestored: (n) => {
|
|
4928
4918
|
e.onItemsRestored(n.map(({ item: e }) => e.postId));
|
|
@@ -4937,17 +4927,17 @@ function Si(e) {
|
|
|
4937
4927
|
reelRemoval: n
|
|
4938
4928
|
};
|
|
4939
4929
|
}
|
|
4940
|
-
var
|
|
4941
|
-
function
|
|
4930
|
+
var yi = 1.5;
|
|
4931
|
+
function bi(e) {
|
|
4942
4932
|
let t = Math.min(e.screenWidth, e.screenHeight);
|
|
4943
4933
|
if (t > 0 && t < 600) return !0;
|
|
4944
|
-
let n = Math.min(e.viewportWidth, e.viewportHeight), r = t >= n *
|
|
4934
|
+
let n = Math.min(e.viewportWidth, e.viewportHeight), r = t >= n * yi;
|
|
4945
4935
|
return !e.hasHover && n > 0 && n < 600 && r;
|
|
4946
4936
|
}
|
|
4947
|
-
function
|
|
4948
|
-
return
|
|
4937
|
+
function xi(e) {
|
|
4938
|
+
return bi(e) ? "reel" : "masonry";
|
|
4949
4939
|
}
|
|
4950
|
-
function
|
|
4940
|
+
function Si(e) {
|
|
4951
4941
|
let t = e.ownerDocument.defaultView, n = e.ownerDocument.documentElement;
|
|
4952
4942
|
return {
|
|
4953
4943
|
hasHover: typeof t?.matchMedia == "function" && t.matchMedia("(hover: hover)").matches,
|
|
@@ -4957,15 +4947,15 @@ function Ei(e) {
|
|
|
4957
4947
|
viewportWidth: n.clientWidth
|
|
4958
4948
|
};
|
|
4959
4949
|
}
|
|
4960
|
-
function
|
|
4961
|
-
return
|
|
4950
|
+
function Ci(e) {
|
|
4951
|
+
return bi(Si(e));
|
|
4962
4952
|
}
|
|
4963
|
-
function
|
|
4964
|
-
return
|
|
4953
|
+
function wi(e) {
|
|
4954
|
+
return xi(Si(e));
|
|
4965
4955
|
}
|
|
4966
4956
|
//#endregion
|
|
4967
4957
|
//#region src/core/responsiveLayoutController.ts
|
|
4968
|
-
var
|
|
4958
|
+
var Ti = class {
|
|
4969
4959
|
layoutMode;
|
|
4970
4960
|
resizeObserver = null;
|
|
4971
4961
|
target = null;
|
|
@@ -4990,13 +4980,13 @@ var ki = class {
|
|
|
4990
4980
|
}
|
|
4991
4981
|
handleResponsiveLayout = () => {
|
|
4992
4982
|
if (!this.target) return;
|
|
4993
|
-
let e =
|
|
4994
|
-
this.state.phoneMode =
|
|
4983
|
+
let e = wi(this.target);
|
|
4984
|
+
this.state.phoneMode = Ci(this.target), this.state.reelInfoSheetOverlay = this.state.phoneMode, this.state.reelMediaSource = this.state.phoneMode ? "mobile" : "original", this.layoutMode === "responsive" && this.applyLayout(e);
|
|
4995
4985
|
};
|
|
4996
|
-
},
|
|
4986
|
+
}, Ei = class {
|
|
4997
4987
|
state;
|
|
4998
4988
|
constructor(e) {
|
|
4999
|
-
this.options = e, this.state =
|
|
4989
|
+
this.options = e, this.state = x(zt({
|
|
5000
4990
|
...e.initialReelAudioState,
|
|
5001
4991
|
muted: e.initialReelAudioState?.muted ?? e.mediaCard?.videoMuted ?? !1
|
|
5002
4992
|
}));
|
|
@@ -5005,9 +4995,9 @@ var ki = class {
|
|
|
5005
4995
|
return { ...this.state };
|
|
5006
4996
|
}
|
|
5007
4997
|
set(e, t = !1) {
|
|
5008
|
-
Object.assign(this.state,
|
|
4998
|
+
Object.assign(this.state, zt(e, this.state)), t && this.options.onReelAudioStateChange?.(this.get());
|
|
5009
4999
|
}
|
|
5010
|
-
},
|
|
5000
|
+
}, Di = class {
|
|
5011
5001
|
routedReelPostId = null;
|
|
5012
5002
|
reelRouteIsActive = !1;
|
|
5013
5003
|
constructor(e, t) {
|
|
@@ -5037,30 +5027,30 @@ var ki = class {
|
|
|
5037
5027
|
};
|
|
5038
5028
|
//#endregion
|
|
5039
5029
|
//#region src/core/updateItems.ts
|
|
5040
|
-
function
|
|
5030
|
+
function Oi(e) {
|
|
5041
5031
|
return String(e);
|
|
5042
5032
|
}
|
|
5043
|
-
function
|
|
5044
|
-
let n =
|
|
5033
|
+
function ki(e, t) {
|
|
5034
|
+
let n = V(t).length;
|
|
5045
5035
|
(e.mediaIndices.get(t.postId) ?? 0) >= n && e.mediaIndices.set(t.postId, Math.max(0, n - 1));
|
|
5046
5036
|
}
|
|
5047
|
-
function
|
|
5037
|
+
function Ai(e, t) {
|
|
5048
5038
|
let n = /* @__PURE__ */ new Map();
|
|
5049
|
-
if (t.forEach((e) => n.set(
|
|
5039
|
+
if (t.forEach((e) => n.set(Oi(e.postId), e)), n.size === 0) return [];
|
|
5050
5040
|
let r = [], i = e.items.map((t) => {
|
|
5051
|
-
let i = n.get(
|
|
5041
|
+
let i = n.get(Oi(t.postId));
|
|
5052
5042
|
if (!i) return t;
|
|
5053
5043
|
let a = {
|
|
5054
5044
|
...i,
|
|
5055
5045
|
postId: t.postId
|
|
5056
5046
|
};
|
|
5057
|
-
return
|
|
5047
|
+
return ki(e, a), e.reelForwardItem && Oi(e.reelForwardItem.postId) === Oi(t.postId) && (e.reelForwardItem = a), r.push(t.postId), a;
|
|
5058
5048
|
});
|
|
5059
5049
|
return r.length > 0 && (e.items = i), r;
|
|
5060
5050
|
}
|
|
5061
5051
|
//#endregion
|
|
5062
5052
|
//#region src/core/createVibe.ts
|
|
5063
|
-
var
|
|
5053
|
+
var ji = class {
|
|
5064
5054
|
app = null;
|
|
5065
5055
|
autoScroll;
|
|
5066
5056
|
autofillController;
|
|
@@ -5084,25 +5074,25 @@ var Fi = class {
|
|
|
5084
5074
|
state;
|
|
5085
5075
|
pageReplacement;
|
|
5086
5076
|
constructor(e) {
|
|
5087
|
-
this.options = e,
|
|
5077
|
+
this.options = e, Qr(e);
|
|
5088
5078
|
let t = e.layout ?? "masonry";
|
|
5089
|
-
this.state =
|
|
5079
|
+
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({
|
|
5090
5080
|
getScrollElement: () => this.surface?.getAutoScrollElement() ?? null,
|
|
5091
5081
|
state: this.state.autoScroll
|
|
5092
|
-
}), this.autofillController = new
|
|
5082
|
+
}), this.autofillController = new pr({
|
|
5093
5083
|
cancelRequest: () => this.cancelRequest(!this.pageReplacement?.isActive()),
|
|
5094
5084
|
onLastCursor: (e) => this.setCurrentCursor(e),
|
|
5095
5085
|
onPages: (e) => this.removalReconciliation.recordPages(e),
|
|
5096
5086
|
options: e.autofill,
|
|
5097
5087
|
state: this.state
|
|
5098
|
-
}), this.removalReconciliation = new
|
|
5088
|
+
}), this.removalReconciliation = new oi(e), this.removalReconciliation.recordInitialPage(e.initialPage), this.fillController = new Br({
|
|
5099
5089
|
filterItems: (e) => this.removalReconciliation.filterItems(e),
|
|
5100
5090
|
fill: e.fill,
|
|
5101
5091
|
loadPage: e.loadPage ? (e) => this.loadFilteredPage(e) : void 0,
|
|
5102
5092
|
needsFrontendPreparation: () => this.removalReconciliation.needsReconciliation(this.state.items),
|
|
5103
5093
|
onLastCursor: (e) => this.setCurrentCursor(e),
|
|
5104
5094
|
onPages: (e) => this.removalReconciliation.recordPages(e),
|
|
5105
|
-
prepareFrontend: ({ isCurrent: t, onDelayChange: n, signal: r }) =>
|
|
5095
|
+
prepareFrontend: ({ isCurrent: t, onDelayChange: n, signal: r }) => Vr({
|
|
5106
5096
|
controller: this.removalReconciliation,
|
|
5107
5097
|
isCurrent: t,
|
|
5108
5098
|
loadPage: e.loadPage,
|
|
@@ -5112,8 +5102,8 @@ var Fi = class {
|
|
|
5112
5102
|
state: this.state
|
|
5113
5103
|
}),
|
|
5114
5104
|
state: this.state
|
|
5115
|
-
}), this.routing = new
|
|
5116
|
-
let n =
|
|
5105
|
+
}), this.routing = new Di(e.routing, this.state);
|
|
5106
|
+
let n = vi({
|
|
5117
5107
|
historyLimit: e.removalHistoryLimit,
|
|
5118
5108
|
onActivate: (e) => this.setActiveReelPost(e),
|
|
5119
5109
|
onCloseReel: () => this.closeMasonryReel(),
|
|
@@ -5123,29 +5113,29 @@ var Fi = class {
|
|
|
5123
5113
|
state: this.state,
|
|
5124
5114
|
surface: () => this.surface
|
|
5125
5115
|
});
|
|
5126
|
-
this.exactMediaRemoval = n.exactMediaRemoval, this.itemRemoval = n.itemRemoval, this.reelForward = n.reelForward, this.reelRemoval = n.reelRemoval, this.pageReplacement = new
|
|
5116
|
+
this.exactMediaRemoval = n.exactMediaRemoval, this.itemRemoval = n.itemRemoval, this.reelForward = n.reelForward, this.reelRemoval = n.reelRemoval, this.pageReplacement = new ti({
|
|
5127
5117
|
state: this.state,
|
|
5128
5118
|
surface: () => this.surface,
|
|
5129
5119
|
prepare: async () => {
|
|
5130
|
-
this.cancelRequest(!1),
|
|
5120
|
+
this.cancelRequest(!1), lr(this.state.autofill) && await this.cancelAutofill(), this.fillController.isActive() && await this.cancelFill();
|
|
5131
5121
|
},
|
|
5132
5122
|
commit: (e) => {
|
|
5133
|
-
this.resetFeedVisit(), this.setCurrentCursor(
|
|
5123
|
+
this.resetFeedVisit(), this.setCurrentCursor(Kn(e)), this.removalReconciliation.recordInitialPage(e), this.state.reelOrigin === null && this.routing.syncFeed();
|
|
5134
5124
|
}
|
|
5135
|
-
}), this.responsiveLayout = new
|
|
5125
|
+
}), this.responsiveLayout = new Ti(t, this.state, () => {
|
|
5136
5126
|
this.routing.syncFeed();
|
|
5137
5127
|
}), this.startStateNotifications();
|
|
5138
5128
|
}
|
|
5139
5129
|
async mount() {
|
|
5140
5130
|
if (this.app) throw Error("Vibe is already mounted.");
|
|
5141
5131
|
this.startStateNotifications();
|
|
5142
|
-
let e =
|
|
5143
|
-
this.responsiveLayout.mount(e), this.app = i(
|
|
5132
|
+
let e = $r(this.options.target);
|
|
5133
|
+
this.responsiveLayout.mount(e), this.app = i(Vn, {
|
|
5144
5134
|
canRetryEnd: !!this.options.loadPage,
|
|
5145
5135
|
cardFooter: this.options.cardFooter,
|
|
5146
5136
|
cardHeader: this.options.cardHeader,
|
|
5147
5137
|
feedFooter: this.options.feedFooter,
|
|
5148
|
-
feedFooterActions:
|
|
5138
|
+
feedFooterActions: Hr(this),
|
|
5149
5139
|
mediaCard: this.options.mediaCard,
|
|
5150
5140
|
masonry: this.options.masonry,
|
|
5151
5141
|
onMediaFullyVisible: this.options.onMediaFullyVisible,
|
|
@@ -5172,7 +5162,7 @@ var Fi = class {
|
|
|
5172
5162
|
onRetryForward: () => {
|
|
5173
5163
|
this.retryReelForward();
|
|
5174
5164
|
}
|
|
5175
|
-
}), this.surface = this.app.mount(e), this.autoScroll.mount(), await
|
|
5165
|
+
}), this.surface = this.app.mount(e), this.autoScroll.mount(), await wr(this.options.restoreBacklog, (e) => this.appendPage(e), (e) => {
|
|
5176
5166
|
this.restoreController = e;
|
|
5177
5167
|
}), !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();
|
|
5178
5168
|
}
|
|
@@ -5180,7 +5170,7 @@ var Fi = class {
|
|
|
5180
5170
|
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;
|
|
5181
5171
|
}
|
|
5182
5172
|
getState() {
|
|
5183
|
-
return
|
|
5173
|
+
return te(this.state);
|
|
5184
5174
|
}
|
|
5185
5175
|
getReelAudioState() {
|
|
5186
5176
|
return this.reelAudio.get();
|
|
@@ -5207,7 +5197,7 @@ var Fi = class {
|
|
|
5207
5197
|
return this.itemRemoval.restoreRemoval(e);
|
|
5208
5198
|
}
|
|
5209
5199
|
updateItems(e) {
|
|
5210
|
-
return
|
|
5200
|
+
return Ai(this.state, e);
|
|
5211
5201
|
}
|
|
5212
5202
|
retryReelForward() {
|
|
5213
5203
|
return this.reelForward.retry();
|
|
@@ -5246,7 +5236,7 @@ var Fi = class {
|
|
|
5246
5236
|
this.autoScroll.setSpeed(e);
|
|
5247
5237
|
}
|
|
5248
5238
|
applyAutofillUpdate(e) {
|
|
5249
|
-
let t =
|
|
5239
|
+
let t = Sr(this.options.autofill, this.state, e);
|
|
5250
5240
|
return t && this.autofillController.syncCountdown(), t;
|
|
5251
5241
|
}
|
|
5252
5242
|
cancelAutofill() {
|
|
@@ -5257,7 +5247,7 @@ var Fi = class {
|
|
|
5257
5247
|
await this.cancelFill();
|
|
5258
5248
|
return;
|
|
5259
5249
|
}
|
|
5260
|
-
if (
|
|
5250
|
+
if (lr(this.state.autofill)) {
|
|
5261
5251
|
await this.cancelAutofill();
|
|
5262
5252
|
return;
|
|
5263
5253
|
}
|
|
@@ -5270,12 +5260,12 @@ var Fi = class {
|
|
|
5270
5260
|
}
|
|
5271
5261
|
async fill(e) {
|
|
5272
5262
|
if (!(this.state.loadMoreLocked || this.pageReplacement.isActive())) {
|
|
5273
|
-
if (this.pendingRequest ||
|
|
5263
|
+
if (this.pendingRequest || lr(this.state.autofill)) throw Error("Vibe cannot fill while another page operation is active.");
|
|
5274
5264
|
await this.fillController.start(e);
|
|
5275
5265
|
}
|
|
5276
5266
|
}
|
|
5277
5267
|
restoreAutofillSession(e) {
|
|
5278
|
-
let t =
|
|
5268
|
+
let t = Cr(this.options.autofill, this.state, e);
|
|
5279
5269
|
return t && this.autofillController.syncCountdown(), t;
|
|
5280
5270
|
}
|
|
5281
5271
|
restoreFillSession(e) {
|
|
@@ -5285,7 +5275,7 @@ var Fi = class {
|
|
|
5285
5275
|
return this.startLoadMore(() => this.loadNextSequence());
|
|
5286
5276
|
}
|
|
5287
5277
|
appendPage(e) {
|
|
5288
|
-
|
|
5278
|
+
qn(e, this.state, this.removalReconciliation, (e) => this.setCurrentCursor(e));
|
|
5289
5279
|
}
|
|
5290
5280
|
replenishAfterRemoval(e = !0) {
|
|
5291
5281
|
return this.startLoadMore(() => this.replenishAfterRemovalSequence(e));
|
|
@@ -5293,7 +5283,7 @@ var Fi = class {
|
|
|
5293
5283
|
async startLoadMore(e) {
|
|
5294
5284
|
if (this.pageReplacement.isActive()) return;
|
|
5295
5285
|
if (this.pendingRequest) return this.pendingRequest;
|
|
5296
|
-
if (this.state.loadMoreLocked ||
|
|
5286
|
+
if (this.state.loadMoreLocked || lr(this.state.autofill) || this.fillController.isActive() || !this.options.loadPage || this.state.next === null && !this.removalReconciliation.needsReconciliation(this.state.items)) return;
|
|
5297
5287
|
this.state.isLoadingMore = !0, this.state.nextPageError = null;
|
|
5298
5288
|
let t = e();
|
|
5299
5289
|
return this.pendingRequest = t, t.finally(() => {
|
|
@@ -5311,15 +5301,15 @@ var Fi = class {
|
|
|
5311
5301
|
}
|
|
5312
5302
|
async replaceFeed(e, t) {
|
|
5313
5303
|
if (!this.options.loadPage) throw Error(`Vibe cannot ${t} without loadPage.`);
|
|
5314
|
-
return
|
|
5304
|
+
return lr(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);
|
|
5315
5305
|
}
|
|
5316
5306
|
resetFeedVisit() {
|
|
5317
|
-
this.state.autofill =
|
|
5307
|
+
this.state.autofill = cr(this.options.autofill, void 0, !1), this.fillController.reset(), this.reelForward.reset(), this.reelRemoval.reset(), this.exactMediaRemoval.reset(), this.itemRemoval.reset(), this.removalReconciliation.reset();
|
|
5318
5308
|
}
|
|
5319
5309
|
async loadFilteredPage(e) {
|
|
5320
5310
|
let t = this.options.loadPage;
|
|
5321
5311
|
if (!t) throw Error("Vibe cannot load a page without loadPage.");
|
|
5322
|
-
let n =
|
|
5312
|
+
let n = Hn(await t(e));
|
|
5323
5313
|
return {
|
|
5324
5314
|
...n,
|
|
5325
5315
|
items: this.removalReconciliation.filterItems(n.items)
|
|
@@ -5339,7 +5329,7 @@ var Fi = class {
|
|
|
5339
5329
|
let n = ++this.requestVersion, r = new AbortController();
|
|
5340
5330
|
this.abortController = r;
|
|
5341
5331
|
try {
|
|
5342
|
-
let i = await
|
|
5332
|
+
let i = await Vr({
|
|
5343
5333
|
controller: this.removalReconciliation,
|
|
5344
5334
|
isCurrent: () => n === this.requestVersion,
|
|
5345
5335
|
loadPage: t,
|
|
@@ -5359,14 +5349,14 @@ var Fi = class {
|
|
|
5359
5349
|
async retryEnd() {
|
|
5360
5350
|
if (!this.pageReplacement.isActive()) {
|
|
5361
5351
|
if (this.pendingRequest) return this.pendingRequest;
|
|
5362
|
-
if (!this.state.loadMoreLocked && !(
|
|
5352
|
+
if (!this.state.loadMoreLocked && !(lr(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);
|
|
5363
5353
|
}
|
|
5364
5354
|
}
|
|
5365
5355
|
setInfiniteScroll(e) {
|
|
5366
|
-
this.state.infiniteScroll = e, e &&
|
|
5356
|
+
this.state.infiniteScroll = e, e && m(() => this.surface?.loadIfNearBottom());
|
|
5367
5357
|
}
|
|
5368
5358
|
setLoadMoreLocked(e) {
|
|
5369
|
-
|
|
5359
|
+
ni(this.state, e, {
|
|
5370
5360
|
getPending: () => this.pendingRequest,
|
|
5371
5361
|
hasPendingSession: () => this.removalReconciliation.hasPendingSession(),
|
|
5372
5362
|
loadNext: () => this.loadNext(),
|
|
@@ -5379,10 +5369,10 @@ var Fi = class {
|
|
|
5379
5369
|
this.state.total = e;
|
|
5380
5370
|
}
|
|
5381
5371
|
setReelAutoAdvance(e) {
|
|
5382
|
-
|
|
5372
|
+
Kr(this.state.reelAutoAdvance, e);
|
|
5383
5373
|
}
|
|
5384
5374
|
setReelInfoSheet(e) {
|
|
5385
|
-
|
|
5375
|
+
Jr(this.state.reelInfoSheet, this.options.reelInfoSheet, e);
|
|
5386
5376
|
}
|
|
5387
5377
|
setLayout(e) {
|
|
5388
5378
|
this.responsiveLayout.setLayout(e);
|
|
@@ -5402,7 +5392,7 @@ var Fi = class {
|
|
|
5402
5392
|
async fetchPage(e, t) {
|
|
5403
5393
|
if (!this.options.loadPage) return;
|
|
5404
5394
|
let n = ++this.requestVersion, r = new AbortController();
|
|
5405
|
-
this.abortController = r, await
|
|
5395
|
+
this.abortController = r, await ei({
|
|
5406
5396
|
append: t,
|
|
5407
5397
|
autofillController: this.autofillController,
|
|
5408
5398
|
cursor: e,
|
|
@@ -5424,7 +5414,7 @@ var Fi = class {
|
|
|
5424
5414
|
startInitialAutofill() {
|
|
5425
5415
|
let e = ++this.requestVersion, t = new AbortController(), n = this.autofillController.beginCycle();
|
|
5426
5416
|
this.abortController = t, this.state.isLoadingMore = !0;
|
|
5427
|
-
let r =
|
|
5417
|
+
let r = Tr({
|
|
5428
5418
|
cycleId: n,
|
|
5429
5419
|
isCurrent: () => e === this.requestVersion,
|
|
5430
5420
|
onCollection: (t) => this.autofillController.captureCollection(t, e === this.requestVersion),
|
|
@@ -5442,175 +5432,11 @@ var Fi = class {
|
|
|
5442
5432
|
}
|
|
5443
5433
|
startStateNotifications() {
|
|
5444
5434
|
let e = this.options.onStateChange;
|
|
5445
|
-
!e || this.stopStateWatcher || (this.stopStateWatcher =
|
|
5435
|
+
!e || this.stopStateWatcher || (this.stopStateWatcher = K(this.state, this.notificationItems, e));
|
|
5446
5436
|
}
|
|
5447
5437
|
setCurrentCursor(e) {
|
|
5448
5438
|
this.lastLoadedCursor = this.state.current = e;
|
|
5449
5439
|
}
|
|
5450
|
-
},
|
|
5451
|
-
//#endregion
|
|
5452
|
-
//#region src/core/controlledReel.ts
|
|
5453
|
-
function Li(e, t) {
|
|
5454
|
-
let { signal: n } = t;
|
|
5455
|
-
return new Promise((r, i) => {
|
|
5456
|
-
let a = () => r(!1);
|
|
5457
|
-
n.addEventListener("abort", a, { once: !0 });
|
|
5458
|
-
let o = () => n.removeEventListener("abort", a);
|
|
5459
|
-
Promise.resolve().then(() => n.aborted ? !1 : e(t)).then((e) => {
|
|
5460
|
-
o(), r(e);
|
|
5461
|
-
}, (e) => {
|
|
5462
|
-
o(), i(e);
|
|
5463
|
-
}), n.aborted && (o(), r(!1));
|
|
5464
|
-
});
|
|
5465
|
-
}
|
|
5466
|
-
//#endregion
|
|
5467
|
-
//#region src/components/VibeControlledReel.vue?vue&type=script&setup=true&lang.ts
|
|
5468
|
-
var Ri = [
|
|
5469
|
-
"aria-label",
|
|
5470
|
-
"aria-busy",
|
|
5471
|
-
"data-current-id",
|
|
5472
|
-
"data-pending"
|
|
5473
|
-
], zi = {
|
|
5474
|
-
key: 0,
|
|
5475
|
-
class: "vibe-controlled-reel-frame",
|
|
5476
|
-
"aria-hidden": "true",
|
|
5477
|
-
inert: ""
|
|
5478
|
-
}, Bi = ["src"], Vi = { class: "vibe-controlled-reel-frame vibe-controlled-reel-current" }, Hi = {
|
|
5479
|
-
key: 1,
|
|
5480
|
-
class: "vibe-controlled-reel-frame",
|
|
5481
|
-
"aria-hidden": "true",
|
|
5482
|
-
inert: ""
|
|
5483
|
-
}, Ui = ["src"], Wi = {
|
|
5484
|
-
class: "vibe-controlled-reel-status",
|
|
5485
|
-
"aria-live": "polite"
|
|
5486
|
-
}, Gi = /* @__PURE__ */ d({
|
|
5487
|
-
__name: "VibeControlledReel",
|
|
5488
|
-
props: {
|
|
5489
|
-
state: {},
|
|
5490
|
-
onNavigate: {},
|
|
5491
|
-
label: { default: "Media queue" }
|
|
5492
|
-
},
|
|
5493
|
-
emits: ["navigationError"],
|
|
5494
|
-
setup(e, { expose: t, emit: n }) {
|
|
5495
|
-
let i = e, a = n, l = E(null), u = E(!1), d = null, f = null, p = !1, h = !1, g = !1, _ = r(() => i.state.current && i.state.canPrevious ? 1 : 0), v = [
|
|
5496
|
-
() => i.state.revision,
|
|
5497
|
-
() => i.state.current?.id,
|
|
5498
|
-
() => i.state.canPrevious,
|
|
5499
|
-
() => i.state.canNext
|
|
5500
|
-
], S = r(() => {
|
|
5501
|
-
let { position: e, total: t } = i.state;
|
|
5502
|
-
return e === void 0 ? "" : `${e + 1}${t === void 0 ? "" : ` of ${t}`}`;
|
|
5503
|
-
});
|
|
5504
|
-
function C() {
|
|
5505
|
-
let e = l.value;
|
|
5506
|
-
e && (e.scrollTop = _.value * e.clientHeight);
|
|
5507
|
-
}
|
|
5508
|
-
function T() {
|
|
5509
|
-
h && (g = !0), d?.abort(), d = null, u.value = !1;
|
|
5510
|
-
}
|
|
5511
|
-
async function k(e, t) {
|
|
5512
|
-
let n = l.value, r = i.state;
|
|
5513
|
-
if (!n || p || u.value || !r.current || !(e === "next" ? r.canNext : r.canPrevious)) return;
|
|
5514
|
-
let o = new AbortController();
|
|
5515
|
-
d = o, u.value = !0;
|
|
5516
|
-
let s = {
|
|
5517
|
-
direction: e,
|
|
5518
|
-
snapshot: Object.freeze({
|
|
5519
|
-
...r,
|
|
5520
|
-
current: Object.freeze({ ...r.current }),
|
|
5521
|
-
previous: r.previous ? Object.freeze({ ...r.previous }) : r.previous,
|
|
5522
|
-
next: r.next ? Object.freeze({ ...r.next }) : r.next
|
|
5523
|
-
}),
|
|
5524
|
-
signal: o.signal
|
|
5525
|
-
};
|
|
5526
|
-
try {
|
|
5527
|
-
if (t && await bn(n, (_.value + (e === "next" ? 1 : -1)) * n.clientHeight, yn(), o.signal), o.signal.aborted) return;
|
|
5528
|
-
await Li(i.onNavigate, s);
|
|
5529
|
-
} catch (e) {
|
|
5530
|
-
o.signal.aborted || a("navigationError", e);
|
|
5531
|
-
} finally {
|
|
5532
|
-
d === o && (await bn(n, _.value * n.clientHeight, yn(), o.signal), d === o && (d = null, u.value = !1));
|
|
5533
|
-
}
|
|
5534
|
-
}
|
|
5535
|
-
function j(e) {
|
|
5536
|
-
return k(e, !0);
|
|
5537
|
-
}
|
|
5538
|
-
function M() {
|
|
5539
|
-
let e = l.value;
|
|
5540
|
-
if (g) {
|
|
5541
|
-
C();
|
|
5542
|
-
return;
|
|
5543
|
-
}
|
|
5544
|
-
if (!e || u.value || e.clientHeight <= 0) return;
|
|
5545
|
-
let t = xn(e.scrollTop, e.clientHeight, _.value + 1 + (i.state.canNext ? 1 : 0));
|
|
5546
|
-
t !== _.value && k(t > _.value ? "next" : "previous", !1);
|
|
5547
|
-
}
|
|
5548
|
-
function N() {
|
|
5549
|
-
h = !0, g = !1;
|
|
5550
|
-
}
|
|
5551
|
-
function P() {
|
|
5552
|
-
h = !1, g && C();
|
|
5553
|
-
}
|
|
5554
|
-
function F(e) {
|
|
5555
|
-
if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
5556
|
-
let t = e.target;
|
|
5557
|
-
if (t instanceof HTMLElement && (t.isContentEditable || [
|
|
5558
|
-
"INPUT",
|
|
5559
|
-
"SELECT",
|
|
5560
|
-
"TEXTAREA",
|
|
5561
|
-
"BUTTON",
|
|
5562
|
-
"A",
|
|
5563
|
-
"VIDEO",
|
|
5564
|
-
"AUDIO"
|
|
5565
|
-
].includes(t.tagName))) return;
|
|
5566
|
-
let n = e.key === "ArrowDown" || e.key === "PageDown" ? "next" : e.key === "ArrowUp" || e.key === "PageUp" ? "previous" : null;
|
|
5567
|
-
n && (e.preventDefault(), j(n));
|
|
5568
|
-
}
|
|
5569
|
-
return A(v, T, { flush: "sync" }), A(v, C, { flush: "post" }), b(() => {
|
|
5570
|
-
C(), typeof ResizeObserver < "u" && (f = new ResizeObserver(C), l.value && f.observe(l.value));
|
|
5571
|
-
}), y(() => {
|
|
5572
|
-
p = !0, d?.abort(), d = null, f?.disconnect();
|
|
5573
|
-
}), t({ navigate: j }), (t, n) => (x(), s("section", {
|
|
5574
|
-
ref_key: "viewport",
|
|
5575
|
-
ref: l,
|
|
5576
|
-
class: "vibe-controlled-reel",
|
|
5577
|
-
"aria-label": e.label,
|
|
5578
|
-
"aria-busy": u.value,
|
|
5579
|
-
"data-current-id": e.state.current?.id,
|
|
5580
|
-
"data-pending": u.value || void 0,
|
|
5581
|
-
tabindex: "0",
|
|
5582
|
-
onScrollPassive: M,
|
|
5583
|
-
onTouchstartPassive: N,
|
|
5584
|
-
onTouchendPassive: P,
|
|
5585
|
-
onTouchcancelPassive: P,
|
|
5586
|
-
onWheelPassive: n[0] ||= (e) => !O(h) && (m(g) ? g.value = !1 : g = !1),
|
|
5587
|
-
onKeydown: F
|
|
5588
|
-
}, [
|
|
5589
|
-
e.state.current && e.state.canPrevious ? (x(), s("div", zi, [w(t.$slots, "previous", {
|
|
5590
|
-
item: e.state.previous ?? null,
|
|
5591
|
-
pending: u.value
|
|
5592
|
-
}, () => [e.state.previous?.artwork ? (x(), s("img", {
|
|
5593
|
-
key: 0,
|
|
5594
|
-
src: e.state.previous.artwork,
|
|
5595
|
-
alt: "",
|
|
5596
|
-
draggable: "false"
|
|
5597
|
-
}, null, 8, Bi)) : o("", !0)])])) : o("", !0),
|
|
5598
|
-
c("div", Vi, [w(t.$slots, "default", {
|
|
5599
|
-
item: e.state.current,
|
|
5600
|
-
pending: u.value
|
|
5601
|
-
})]),
|
|
5602
|
-
e.state.current && e.state.canNext ? (x(), s("div", Hi, [w(t.$slots, "next", {
|
|
5603
|
-
item: e.state.next ?? null,
|
|
5604
|
-
pending: u.value
|
|
5605
|
-
}, () => [e.state.next?.artwork ? (x(), s("img", {
|
|
5606
|
-
key: 0,
|
|
5607
|
-
src: e.state.next.artwork,
|
|
5608
|
-
alt: "",
|
|
5609
|
-
draggable: "false"
|
|
5610
|
-
}, null, 8, Ui)) : o("", !0)])])) : o("", !0),
|
|
5611
|
-
c("span", Wi, D(S.value), 1)
|
|
5612
|
-
], 40, Ri));
|
|
5613
|
-
}
|
|
5614
|
-
});
|
|
5440
|
+
}, Mi = (e) => new ji(e);
|
|
5615
5441
|
//#endregion
|
|
5616
|
-
export {
|
|
5442
|
+
export { Mi as createVibe };
|