@wyxos/vibe 5.2.1 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/MasonryFeed.vue.d.ts +4 -2
- package/lib/components/MediaCard.vue.d.ts +2 -2
- package/lib/components/ReelFeed.vue.d.ts +2 -2
- package/lib/components/ReelLayout.vue.d.ts +2 -2
- package/lib/components/VibeSurface.vue.d.ts +2 -0
- package/lib/components/useMediaLifecycle.d.ts +19 -0
- package/lib/core/autofill.d.ts +4 -2
- package/lib/core/autofillController.d.ts +2 -0
- package/lib/core/fill.d.ts +7 -3
- package/lib/core/fillController.d.ts +2 -0
- package/lib/core/removalReconciliationController.d.ts +7 -1
- package/lib/core/runtime.d.ts +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.js +894 -752
- package/lib/types.d.ts +7 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -13,39 +13,8 @@ function F(e, t) {
|
|
|
13
13
|
return `${String(e)}:${t}`;
|
|
14
14
|
}
|
|
15
15
|
//#endregion
|
|
16
|
-
//#region src/core/mediaLifecycle.ts
|
|
17
|
-
function I(e, t, n, r, i) {
|
|
18
|
-
let a = e.items.findIndex((e) => e.postId === t), o = e.items[a];
|
|
19
|
-
if (!o) return null;
|
|
20
|
-
let s = N(o, n), c = P(o, s);
|
|
21
|
-
return {
|
|
22
|
-
item: o,
|
|
23
|
-
layout: r,
|
|
24
|
-
media: c,
|
|
25
|
-
mediaId: c.mediaId ?? null,
|
|
26
|
-
mediaIndex: s,
|
|
27
|
-
origin: i,
|
|
28
|
-
postId: o.postId,
|
|
29
|
-
postIndex: a
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function L(e, t) {
|
|
33
|
-
O(() => {
|
|
34
|
-
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null;
|
|
35
|
-
return {
|
|
36
|
-
mediaIndex: t === null ? 0 : e.mediaIndices.get(t) ?? 0,
|
|
37
|
-
origin: e.reelOrigin ?? "reel",
|
|
38
|
-
postId: t
|
|
39
|
-
};
|
|
40
|
-
}, (n, r) => {
|
|
41
|
-
if (n.postId === null || n.postId === r?.postId && n.mediaIndex === r.mediaIndex && n.origin === r.origin) return;
|
|
42
|
-
let i = I(e, n.postId, n.mediaIndex, "reel", n.origin);
|
|
43
|
-
i && t(i);
|
|
44
|
-
}, { flush: "sync" });
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
16
|
//#region src/core/runtime.ts
|
|
48
|
-
function
|
|
17
|
+
function I(e) {
|
|
49
18
|
return {
|
|
50
19
|
activeReelPostId: e.activeReelPostId,
|
|
51
20
|
autoScroll: { ...e.autoScroll },
|
|
@@ -64,6 +33,7 @@ function R(e) {
|
|
|
64
33
|
loadMoreLocked: e.loadMoreLocked,
|
|
65
34
|
next: e.next,
|
|
66
35
|
nextPageError: e.nextPageError,
|
|
36
|
+
phoneMode: e.phoneMode,
|
|
67
37
|
reelAutoAdvance: { ...e.reelAutoAdvance },
|
|
68
38
|
reelForward: { ...e.reelForward },
|
|
69
39
|
reelInfoSheet: { ...e.reelInfoSheet },
|
|
@@ -73,17 +43,17 @@ function R(e) {
|
|
|
73
43
|
}
|
|
74
44
|
//#endregion
|
|
75
45
|
//#region src/components/GalleryFooter.vue?vue&type=script&setup=true&lang.ts
|
|
76
|
-
var
|
|
46
|
+
var L = {
|
|
77
47
|
key: 0,
|
|
78
48
|
class: "gallery-footer"
|
|
79
|
-
},
|
|
49
|
+
}, R = {
|
|
80
50
|
key: 0,
|
|
81
51
|
class: "load-more-status",
|
|
82
52
|
role: "status"
|
|
83
|
-
},
|
|
53
|
+
}, z = ["disabled"], B = {
|
|
84
54
|
key: 2,
|
|
85
55
|
class: "end-feed"
|
|
86
|
-
},
|
|
56
|
+
}, V = ["disabled"], H = /* @__PURE__ */ d({
|
|
87
57
|
__name: "GalleryFooter",
|
|
88
58
|
props: {
|
|
89
59
|
canRetryEnd: { type: Boolean },
|
|
@@ -99,14 +69,14 @@ var z = {
|
|
|
99
69
|
function i() {
|
|
100
70
|
n.loadMoreLocked || (n.hasNext ? r("loadMore") : r("retryEnd"));
|
|
101
71
|
}
|
|
102
|
-
return (t, n) => e.isLoading || e.hasError || e.hasNext && e.showLoadMore || !e.hasNext && e.canRetryEnd ? (b(), s("footer",
|
|
72
|
+
return (t, n) => e.isLoading || e.hasError || e.hasNext && e.showLoadMore || !e.hasNext && e.canRetryEnd ? (b(), s("footer", L, [e.isLoading ? (b(), s("p", R, " Loading more… ")) : e.hasError || e.hasNext && e.showLoadMore ? (b(), s("button", {
|
|
103
73
|
key: 1,
|
|
104
74
|
"data-test": "load-more",
|
|
105
75
|
class: "load-more-button",
|
|
106
76
|
type: "button",
|
|
107
77
|
disabled: e.loadMoreLocked,
|
|
108
78
|
onClick: i
|
|
109
|
-
}, T(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9,
|
|
79
|
+
}, T(e.hasError ? "Try again" : e.loadMoreLocked ? "Loading paused" : "Load more"), 9, z)) : (b(), s("div", B, [n[1] ||= c("p", {
|
|
110
80
|
class: "end-feed-message",
|
|
111
81
|
role: "status"
|
|
112
82
|
}, " You've reached the end. ", -1), c("button", {
|
|
@@ -115,9 +85,9 @@ var z = {
|
|
|
115
85
|
type: "button",
|
|
116
86
|
disabled: e.loadMoreLocked,
|
|
117
87
|
onClick: n[0] ||= (e) => t.$emit("retryEnd")
|
|
118
|
-
}, " Check for more ", 8,
|
|
88
|
+
}, " Check for more ", 8, V)]))])) : o("", !0);
|
|
119
89
|
}
|
|
120
|
-
}),
|
|
90
|
+
}), U = /* @__PURE__ */ d({
|
|
121
91
|
__name: "FeedFooter",
|
|
122
92
|
props: {
|
|
123
93
|
actions: {},
|
|
@@ -154,7 +124,7 @@ var z = {
|
|
|
154
124
|
"can-retry-end",
|
|
155
125
|
"show-load-more",
|
|
156
126
|
"state"
|
|
157
|
-
])) : (b(), a(
|
|
127
|
+
])) : (b(), a(H, {
|
|
158
128
|
key: 1,
|
|
159
129
|
"can-retry-end": e.canRetryEnd,
|
|
160
130
|
"has-error": e.hasError,
|
|
@@ -173,7 +143,7 @@ var z = {
|
|
|
173
143
|
"show-load-more"
|
|
174
144
|
]));
|
|
175
145
|
}
|
|
176
|
-
}),
|
|
146
|
+
}), W = ["role"], G = { class: "gallery-status" }, ee = /* @__PURE__ */ d({
|
|
177
147
|
__name: "FeedStatus",
|
|
178
148
|
props: {
|
|
179
149
|
actions: {},
|
|
@@ -187,7 +157,7 @@ var z = {
|
|
|
187
157
|
return (n, u) => (b(), s("main", {
|
|
188
158
|
class: "gallery-shell",
|
|
189
159
|
role: r.state.error ? "alert" : r.state.isLoading ? "status" : void 0
|
|
190
|
-
}, [c("p",
|
|
160
|
+
}, [c("p", G, [r.state.error ? (b(), s(e, { key: 0 }, [l(" Unable to load media. ")], 64)) : r.state.isLoading ? (b(), s(e, { key: 1 }, [l(" Loading media… ")], 64)) : (b(), s(e, { key: 2 }, [l(" No media found. ")], 64))]), t.feedFooter ? (b(), a(U, {
|
|
191
161
|
key: 0,
|
|
192
162
|
actions: t.actions,
|
|
193
163
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -209,36 +179,36 @@ var z = {
|
|
|
209
179
|
"is-loading",
|
|
210
180
|
"load-more-locked",
|
|
211
181
|
"state"
|
|
212
|
-
])) : o("", !0)], 8,
|
|
182
|
+
])) : o("", !0)], 8, W));
|
|
213
183
|
}
|
|
214
184
|
});
|
|
215
|
-
function
|
|
185
|
+
function K(e) {
|
|
216
186
|
return e.scrollHeight - e.scrollTop - e.clientHeight <= 240;
|
|
217
187
|
}
|
|
218
188
|
//#endregion
|
|
219
189
|
//#region src/core/masonry.ts
|
|
220
|
-
function
|
|
190
|
+
function q(e) {
|
|
221
191
|
let t = e.preview.width ?? e.width, n = e.preview.height ?? e.height;
|
|
222
192
|
return !t || !n || t <= 0 || n <= 0 ? 1 : n / t;
|
|
223
193
|
}
|
|
224
|
-
function
|
|
194
|
+
function te(e) {
|
|
225
195
|
return e.reduce((t, n, r) => n < e[t] ? r : t, 0);
|
|
226
196
|
}
|
|
227
|
-
function
|
|
197
|
+
function ne(e) {
|
|
228
198
|
return Math.max(0, e.containerHeight) + Math.max(0, e.gap);
|
|
229
199
|
}
|
|
230
|
-
function
|
|
200
|
+
function re(e, t) {
|
|
231
201
|
let n = Math.max(0, t.overscan), r = t.scrollTop - n, i = t.scrollTop + Math.max(0, t.viewportHeight) + n;
|
|
232
202
|
return e.reduce((e, t, n) => (t.y + t.height >= r && t.y <= i && e.push(n), e), []);
|
|
233
203
|
}
|
|
234
|
-
function
|
|
204
|
+
function ie(e, t, n) {
|
|
235
205
|
if (t <= 0 || e.length === 0) return {
|
|
236
206
|
columns: 0,
|
|
237
207
|
height: 0,
|
|
238
208
|
items: []
|
|
239
209
|
};
|
|
240
210
|
let r = Math.max(0, n.gap), i = Number.isFinite(n.additionalHeight) ? Math.max(0, n.additionalHeight ?? 0) : 0, a = Math.max(1, n.minColumnWidth), o = Math.max(1, Math.floor((t + r) / (a + r))), s = (t - r * (o - 1)) / o, c = Array.from({ length: o }, () => 0), l = e.map((e) => {
|
|
241
|
-
let t =
|
|
211
|
+
let t = te(c), n = s * q(e) + i, a = {
|
|
242
212
|
x: t * (s + r),
|
|
243
213
|
y: c[t],
|
|
244
214
|
width: s,
|
|
@@ -254,10 +224,10 @@ function K(e, t, n) {
|
|
|
254
224
|
}
|
|
255
225
|
//#endregion
|
|
256
226
|
//#region src/core/scrollbar.ts
|
|
257
|
-
function
|
|
227
|
+
function ae(e, t, n) {
|
|
258
228
|
return Math.min(n, Math.max(t, e));
|
|
259
229
|
}
|
|
260
|
-
function
|
|
230
|
+
function oe({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize: r, viewportSize: i }) {
|
|
261
231
|
let a = Math.max(0, e), o = Math.max(0, r), s = Math.max(0, i), c = Math.max(0, a - s);
|
|
262
232
|
if (!(c > 0 && o > 0)) return {
|
|
263
233
|
maximumScrollPosition: c,
|
|
@@ -266,23 +236,23 @@ function ce({ contentSize: e, minimumThumbSize: t, scrollPosition: n, trackSize:
|
|
|
266
236
|
thumbSize: o,
|
|
267
237
|
thumbTravel: 0
|
|
268
238
|
};
|
|
269
|
-
let l =
|
|
239
|
+
let l = ae(s / a * o, Math.min(Math.max(0, t), o), o), u = Math.max(0, o - l);
|
|
270
240
|
return {
|
|
271
241
|
maximumScrollPosition: c,
|
|
272
242
|
scrollable: !0,
|
|
273
|
-
thumbOffset: u * (
|
|
243
|
+
thumbOffset: u * (ae(n, 0, c) / c),
|
|
274
244
|
thumbSize: l,
|
|
275
245
|
thumbTravel: u
|
|
276
246
|
};
|
|
277
247
|
}
|
|
278
248
|
//#endregion
|
|
279
249
|
//#region src/components/GalleryScrollbar.vue?vue&type=script&setup=true&lang.ts
|
|
280
|
-
var
|
|
250
|
+
var se = ["aria-hidden"], J = [
|
|
281
251
|
"aria-controls",
|
|
282
252
|
"aria-valuemax",
|
|
283
253
|
"aria-valuenow",
|
|
284
254
|
"tabindex"
|
|
285
|
-
],
|
|
255
|
+
], ce = 32, Y = 40, le = 120, ue = /* @__PURE__ */ d({
|
|
286
256
|
__name: "GalleryScrollbar",
|
|
287
257
|
props: {
|
|
288
258
|
contentSize: {},
|
|
@@ -304,16 +274,16 @@ var le = ["aria-hidden"], J = [
|
|
|
304
274
|
function k() {
|
|
305
275
|
g !== null && clearTimeout(g), g = setTimeout(() => {
|
|
306
276
|
g = null, o.value || (l.value = !1);
|
|
307
|
-
},
|
|
277
|
+
}, le);
|
|
308
278
|
}
|
|
309
279
|
function A() {
|
|
310
280
|
l.value = !0, k();
|
|
311
281
|
}
|
|
312
282
|
function j() {
|
|
313
283
|
let e = t.scrollElement, r = i.value;
|
|
314
|
-
return !e || !r ? n :
|
|
284
|
+
return !e || !r ? n : oe({
|
|
315
285
|
contentSize: e.scrollHeight,
|
|
316
|
-
minimumThumbSize:
|
|
286
|
+
minimumThumbSize: ce,
|
|
317
287
|
scrollPosition: e.scrollTop,
|
|
318
288
|
trackSize: r.clientHeight,
|
|
319
289
|
viewportSize: e.clientHeight
|
|
@@ -366,7 +336,7 @@ var le = ["aria-hidden"], J = [
|
|
|
366
336
|
}
|
|
367
337
|
function z(e) {
|
|
368
338
|
if (!E.value) return;
|
|
369
|
-
let n = t.scrollElement?.clientHeight ?? 0, r = t.scrollElement?.scrollTop ?? 0, i = e.key === "ArrowUp" ? r -
|
|
339
|
+
let n = t.scrollElement?.clientHeight ?? 0, r = t.scrollElement?.scrollTop ?? 0, i = e.key === "ArrowUp" ? r - Y : e.key === "ArrowDown" ? r + Y : e.key === "PageUp" ? r - n : e.key === "PageDown" ? r + n : e.key === "Home" ? 0 : e.key === "End" ? a.value.maximumScrollPosition : null;
|
|
370
340
|
i !== null && (e.preventDefault(), A(), P(i));
|
|
371
341
|
}
|
|
372
342
|
function B(e) {
|
|
@@ -412,15 +382,15 @@ var le = ["aria-hidden"], J = [
|
|
|
412
382
|
onPointerdown: I,
|
|
413
383
|
onPointermove: L,
|
|
414
384
|
onPointerup: R
|
|
415
|
-
}, null, 44, J)], 42,
|
|
385
|
+
}, null, 44, J)], 42, se));
|
|
416
386
|
}
|
|
417
|
-
}),
|
|
387
|
+
}), de = (e) => {
|
|
418
388
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
419
389
|
return !1;
|
|
420
|
-
},
|
|
421
|
-
let t =
|
|
390
|
+
}, fe = (e) => e === "", pe = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), X = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), me = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), he = (e) => {
|
|
391
|
+
let t = me(e);
|
|
422
392
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
423
|
-
},
|
|
393
|
+
}, ge = {
|
|
424
394
|
xmlns: "http://www.w3.org/2000/svg",
|
|
425
395
|
width: 24,
|
|
426
396
|
height: 24,
|
|
@@ -430,27 +400,27 @@ var le = ["aria-hidden"], J = [
|
|
|
430
400
|
"stroke-width": 2,
|
|
431
401
|
"stroke-linecap": "round",
|
|
432
402
|
"stroke-linejoin": "round"
|
|
433
|
-
},
|
|
434
|
-
...
|
|
403
|
+
}, _e = ({ name: e, iconNode: t, absoluteStrokeWidth: n, "absolute-stroke-width": r, strokeWidth: i, "stroke-width": a, size: o = ge.width, color: s = ge.stroke, ...c }, { slots: l }) => p("svg", {
|
|
404
|
+
...ge,
|
|
435
405
|
...c,
|
|
436
406
|
width: o,
|
|
437
407
|
height: o,
|
|
438
408
|
stroke: s,
|
|
439
|
-
"stroke-width":
|
|
440
|
-
class:
|
|
441
|
-
...!l.default && !
|
|
442
|
-
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]),
|
|
409
|
+
"stroke-width": fe(n) || fe(r) || n === !0 || r === !0 ? Number(i || a || ge["stroke-width"]) * 24 / Number(o) : i || a || ge["stroke-width"],
|
|
410
|
+
class: pe("lucide", c.class, ...e ? [`lucide-${X(he(e))}-icon`, `lucide-${X(e)}`] : ["lucide-icon"]),
|
|
411
|
+
...!l.default && !de(c) && { "aria-hidden": "true" }
|
|
412
|
+
}, [...t.map((e) => p(...e)), ...l.default ? [l.default()] : []]), ve = (e, t) => (n, { slots: r, attrs: i }) => p(_e, {
|
|
443
413
|
...i,
|
|
444
414
|
...n,
|
|
445
415
|
iconNode: t,
|
|
446
416
|
name: e
|
|
447
|
-
}, r),
|
|
417
|
+
}, r), ye = ve("chevron-left", [["path", {
|
|
448
418
|
d: "m15 18-6-6 6-6",
|
|
449
419
|
key: "1wnfg3"
|
|
450
|
-
}]]),
|
|
420
|
+
}]]), be = ve("chevron-right", [["path", {
|
|
451
421
|
d: "m9 18 6-6-6-6",
|
|
452
422
|
key: "mthhwq"
|
|
453
|
-
}]]),
|
|
423
|
+
}]]), xe = ve("pause", [["rect", {
|
|
454
424
|
x: "14",
|
|
455
425
|
y: "3",
|
|
456
426
|
width: "5",
|
|
@@ -464,10 +434,10 @@ var le = ["aria-hidden"], J = [
|
|
|
464
434
|
height: "18",
|
|
465
435
|
rx: "1",
|
|
466
436
|
key: "1wsw3u"
|
|
467
|
-
}]]),
|
|
437
|
+
}]]), Se = ve("play", [["path", {
|
|
468
438
|
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",
|
|
469
439
|
key: "10ikf1"
|
|
470
|
-
}]]),
|
|
440
|
+
}]]), Ce = ve("volume-2", [
|
|
471
441
|
["path", {
|
|
472
442
|
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",
|
|
473
443
|
key: "uqj9uw"
|
|
@@ -480,7 +450,7 @@ var le = ["aria-hidden"], J = [
|
|
|
480
450
|
d: "M19.364 18.364a9 9 0 0 0 0-12.728",
|
|
481
451
|
key: "ijwkga"
|
|
482
452
|
}]
|
|
483
|
-
]),
|
|
453
|
+
]), we = ve("volume-x", [
|
|
484
454
|
["path", {
|
|
485
455
|
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",
|
|
486
456
|
key: "uqj9uw"
|
|
@@ -499,32 +469,32 @@ var le = ["aria-hidden"], J = [
|
|
|
499
469
|
y2: "15",
|
|
500
470
|
key: "5ykzw1"
|
|
501
471
|
}]
|
|
502
|
-
]),
|
|
472
|
+
]), Te = {
|
|
503
473
|
401: "Authentication required",
|
|
504
474
|
403: "Access forbidden",
|
|
505
475
|
404: "Preview not found",
|
|
506
476
|
419: "Session expired",
|
|
507
477
|
500: "Server error"
|
|
508
478
|
};
|
|
509
|
-
function
|
|
479
|
+
function Ee(e) {
|
|
510
480
|
return e.match(/\/demo-errors\/(401|403|404|419|500)\//)?.[1] ?? "Error";
|
|
511
481
|
}
|
|
512
|
-
function
|
|
513
|
-
return
|
|
482
|
+
function De(e) {
|
|
483
|
+
return Te[Ee(e)] ?? "Preview unavailable";
|
|
514
484
|
}
|
|
515
485
|
//#endregion
|
|
516
486
|
//#region src/core/mediaType.ts
|
|
517
|
-
var
|
|
518
|
-
function
|
|
487
|
+
var Oe = /\.(aac|flac|m4a|mp3|mp4|mov|ogg|opus|wav|webm)$/i;
|
|
488
|
+
function ke(e) {
|
|
519
489
|
try {
|
|
520
|
-
return
|
|
490
|
+
return Oe.test(new URL(e).pathname);
|
|
521
491
|
} catch {
|
|
522
|
-
return
|
|
492
|
+
return Oe.test(e.split("?")[0] ?? e);
|
|
523
493
|
}
|
|
524
494
|
}
|
|
525
495
|
//#endregion
|
|
526
496
|
//#region src/components/CardRegion.vue
|
|
527
|
-
var
|
|
497
|
+
var Ae = /* @__PURE__ */ d({
|
|
528
498
|
__name: "CardRegion",
|
|
529
499
|
props: {
|
|
530
500
|
index: {},
|
|
@@ -571,18 +541,18 @@ var Me = /* @__PURE__ */ d({
|
|
|
571
541
|
"total"
|
|
572
542
|
]))], 38));
|
|
573
543
|
}
|
|
574
|
-
}),
|
|
544
|
+
}), je = [
|
|
575
545
|
"max",
|
|
576
546
|
"value",
|
|
577
547
|
"aria-valuetext",
|
|
578
548
|
"disabled"
|
|
579
|
-
],
|
|
549
|
+
], Me = {
|
|
580
550
|
key: 0,
|
|
581
551
|
class: "media-controls-row"
|
|
582
|
-
},
|
|
552
|
+
}, Ne = ["aria-label", "title"], Pe = { class: "media-controls-audio" }, Fe = ["aria-label", "title"], Ie = ["value", "aria-valuetext"], Le = {
|
|
583
553
|
class: "media-control-time",
|
|
584
554
|
"aria-live": "off"
|
|
585
|
-
},
|
|
555
|
+
}, Re = /* @__PURE__ */ d({
|
|
586
556
|
__name: "MediaControls",
|
|
587
557
|
props: {
|
|
588
558
|
currentTime: {},
|
|
@@ -630,35 +600,35 @@ var Me = /* @__PURE__ */ d({
|
|
|
630
600
|
"aria-valuetext": `${u(p.value)} of ${u(f.value)}`,
|
|
631
601
|
disabled: f.value <= 0,
|
|
632
602
|
onInput: n[0] ||= (e) => i("seek", d(e))
|
|
633
|
-
}, null, 44,
|
|
603
|
+
}, null, 44, je), e.layout === "reel" ? (b(), s("div", Me, [
|
|
634
604
|
c("button", {
|
|
635
605
|
type: "button",
|
|
636
606
|
class: "media-control-button media-control-playback",
|
|
637
607
|
"aria-label": e.playing ? "Pause video" : "Play video",
|
|
638
608
|
title: e.playing ? "Pause" : "Play",
|
|
639
609
|
onClick: n[1] ||= (e) => i("togglePlayback")
|
|
640
|
-
}, [e.playing ? (b(), a(E(
|
|
610
|
+
}, [e.playing ? (b(), a(E(xe), {
|
|
641
611
|
key: 0,
|
|
642
612
|
size: 18,
|
|
643
613
|
fill: "currentColor"
|
|
644
|
-
})) : (b(), a(E(
|
|
614
|
+
})) : (b(), a(E(Se), {
|
|
645
615
|
key: 1,
|
|
646
616
|
size: 18,
|
|
647
617
|
fill: "currentColor"
|
|
648
|
-
}))], 8,
|
|
649
|
-
c("div",
|
|
618
|
+
}))], 8, Ne),
|
|
619
|
+
c("div", Pe, [c("button", {
|
|
650
620
|
type: "button",
|
|
651
621
|
class: "media-control-button",
|
|
652
622
|
"aria-label": e.muted ? "Unmute video" : "Mute video",
|
|
653
623
|
title: e.muted ? "Unmute" : "Mute",
|
|
654
624
|
onClick: n[2] ||= (e) => i("toggleMute")
|
|
655
|
-
}, [e.muted || e.volume === 0 ? (b(), a(E(
|
|
625
|
+
}, [e.muted || e.volume === 0 ? (b(), a(E(we), {
|
|
656
626
|
key: 0,
|
|
657
627
|
size: 18
|
|
658
|
-
})) : (b(), a(E(
|
|
628
|
+
})) : (b(), a(E(Ce), {
|
|
659
629
|
key: 1,
|
|
660
630
|
size: 18
|
|
661
|
-
}))], 8,
|
|
631
|
+
}))], 8, Fe), c("input", {
|
|
662
632
|
class: "media-control-range media-control-volume",
|
|
663
633
|
type: "range",
|
|
664
634
|
min: "0",
|
|
@@ -669,14 +639,14 @@ var Me = /* @__PURE__ */ d({
|
|
|
669
639
|
"aria-label": "Video volume",
|
|
670
640
|
"aria-valuetext": `${Math.round(e.volume * 100)} percent`,
|
|
671
641
|
onInput: n[3] ||= (e) => i("volumeChange", d(e))
|
|
672
|
-
}, null, 44,
|
|
673
|
-
c("output",
|
|
642
|
+
}, null, 44, Ie)]),
|
|
643
|
+
c("output", Le, T(u(p.value)) + " / " + T(u(f.value)), 1)
|
|
674
644
|
])) : o("", !0)], 34));
|
|
675
645
|
}
|
|
676
646
|
});
|
|
677
647
|
//#endregion
|
|
678
648
|
//#region src/components/useReelVideoActivity.ts
|
|
679
|
-
function
|
|
649
|
+
function ze(e) {
|
|
680
650
|
let t = r(() => e.layout() !== "reel" || e.active() === !0), n = r(() => t.value ? e.videoIsMuted.value : !0);
|
|
681
651
|
function i() {
|
|
682
652
|
if (!t.value) {
|
|
@@ -710,7 +680,7 @@ function Ve(e) {
|
|
|
710
680
|
}
|
|
711
681
|
//#endregion
|
|
712
682
|
//#region src/components/MediaCard.vue?vue&type=script&setup=true&lang.ts
|
|
713
|
-
var
|
|
683
|
+
var Be = [
|
|
714
684
|
"data-post-id",
|
|
715
685
|
"data-media-index",
|
|
716
686
|
"aria-hidden",
|
|
@@ -718,12 +688,12 @@ var He = [
|
|
|
718
688
|
"inert",
|
|
719
689
|
"role",
|
|
720
690
|
"tabindex"
|
|
721
|
-
],
|
|
691
|
+
], Ve = { class: "media-card-content" }, He = ["data-media-direction"], Ue = ["data-media-index"], We = {
|
|
722
692
|
key: 0,
|
|
723
693
|
"data-test": "media-loading",
|
|
724
694
|
class: "media-loading",
|
|
725
695
|
"aria-hidden": "true"
|
|
726
|
-
},
|
|
696
|
+
}, Ge = ["aria-label"], Ke = { class: "media-error-code" }, qe = [
|
|
727
697
|
"src",
|
|
728
698
|
"width",
|
|
729
699
|
"height",
|
|
@@ -731,12 +701,12 @@ var He = [
|
|
|
731
701
|
"loop",
|
|
732
702
|
"muted",
|
|
733
703
|
"preload"
|
|
734
|
-
],
|
|
704
|
+
], Je = [
|
|
735
705
|
"src",
|
|
736
706
|
"width",
|
|
737
707
|
"height",
|
|
738
708
|
"fetchpriority"
|
|
739
|
-
],
|
|
709
|
+
], Ye = ["aria-label"], Xe = ["aria-label"], Ze = ["aria-label"], Qe = 40, $e = 160, et = 24, tt = /* @__PURE__ */ d({
|
|
740
710
|
__name: "MediaCard",
|
|
741
711
|
props: {
|
|
742
712
|
active: { type: Boolean },
|
|
@@ -772,52 +742,52 @@ var He = [
|
|
|
772
742
|
function S(e = !1, t = "pointer") {
|
|
773
743
|
e && x("activate", t);
|
|
774
744
|
}
|
|
775
|
-
let C = r(() => M(l.item)), D = r(() => N(l.item, l.mediaIndex)), O = r(() => P(l.item, D.value)), F = r(() => l.mediaSource === "original" ? O.value.src : O.value.preview.src), I = r(() => l.mediaSource === "original" ? O.value.width : O.value.preview.width), L = r(() => l.mediaSource === "original" ? O.value.height : O.value.preview.height), R = w(null), z = w(0), B = w(0), V = w(l.mediaCard?.videoMuted ?? l.layout === "masonry"), H = w(!1),
|
|
745
|
+
let C = r(() => M(l.item)), D = r(() => N(l.item, l.mediaIndex)), O = r(() => P(l.item, D.value)), F = r(() => l.mediaSource === "original" ? O.value.src : O.value.preview.src), I = r(() => l.mediaSource === "original" ? O.value.width : O.value.preview.width), L = r(() => l.mediaSource === "original" ? O.value.height : O.value.preview.height), R = w(null), z = w(0), B = w(0), V = w(l.mediaCard?.videoMuted ?? l.layout === "masonry"), H = w(!1), U = w(1), W = 1, { effectiveMuted: G, onPlaying: ee, playbackAllowed: K } = ze({
|
|
776
746
|
active: () => l.active,
|
|
777
747
|
layout: () => l.layout,
|
|
778
748
|
videoElement: R,
|
|
779
749
|
videoIsMuted: V,
|
|
780
750
|
videoIsPlaying: H
|
|
781
|
-
}),
|
|
782
|
-
function
|
|
751
|
+
}), q = r(() => l.interactive && !!(l.cardHeader || l.cardFooter));
|
|
752
|
+
function te(e) {
|
|
783
753
|
return e.detail === 0 ? "keyboard" : "pointer";
|
|
784
754
|
}
|
|
785
|
-
function
|
|
755
|
+
function ne(e, t) {
|
|
786
756
|
let n = C.value.length, r = (e + n) % n;
|
|
787
757
|
r !== D.value && (y.value = e < D.value ? "previous" : "next", x("mediaChange", r), t && t.detail > 0 && t.currentTarget?.blur());
|
|
788
758
|
}
|
|
789
|
-
function
|
|
759
|
+
function re(e, t, n) {
|
|
790
760
|
return t === 1 ? e * 16 : t === 2 ? e * n : e;
|
|
791
761
|
}
|
|
792
|
-
function
|
|
762
|
+
function ie() {
|
|
793
763
|
f = 0, p = !1, d !== null && clearTimeout(d), d = null;
|
|
794
764
|
}
|
|
795
|
-
function
|
|
796
|
-
d !== null && clearTimeout(d), d = setTimeout(
|
|
765
|
+
function ae() {
|
|
766
|
+
d !== null && clearTimeout(d), d = setTimeout(ie, $e);
|
|
797
767
|
}
|
|
798
|
-
function
|
|
768
|
+
function oe(e) {
|
|
799
769
|
if (C.value.length <= 1) return;
|
|
800
|
-
let t = e.currentTarget?.clientWidth || 1, n =
|
|
801
|
-
if (n === 0 || (e.preventDefault(),
|
|
770
|
+
let t = e.currentTarget?.clientWidth || 1, n = re(e.deltaX, e.deltaMode, t);
|
|
771
|
+
if (n === 0 || (e.preventDefault(), ae(), p) || (f += n, Math.abs(f) < et)) return;
|
|
802
772
|
let r = Math.sign(f);
|
|
803
|
-
f = 0, p = !0,
|
|
773
|
+
f = 0, p = !0, ne(D.value + r);
|
|
804
774
|
}
|
|
805
|
-
function
|
|
775
|
+
function se(e) {
|
|
806
776
|
let t = e.touches[0];
|
|
807
777
|
l.layout !== "reel" || !t || (m = t.clientX, g = t.clientY);
|
|
808
778
|
}
|
|
809
|
-
function
|
|
779
|
+
function J(e) {
|
|
810
780
|
let t = e.changedTouches[0];
|
|
811
781
|
if (m === null || g === null || !t) return;
|
|
812
782
|
let n = m - t.clientX, r = g - t.clientY;
|
|
813
|
-
m = null, g = null, !(Math.abs(n) <= Math.abs(r)) && (Math.abs(n) <
|
|
783
|
+
m = null, g = null, !(Math.abs(n) <= Math.abs(r)) && (Math.abs(n) < Qe || ne(D.value + Math.sign(n)));
|
|
814
784
|
}
|
|
815
|
-
let
|
|
816
|
-
function
|
|
817
|
-
l.layout === "reel" && (e.stopPropagation(),
|
|
785
|
+
let ce = r(() => ke(F.value)), Y = r(() => l.layout === "reel" && l.stationaryReelControls === !0), le = r(() => ce.value && l.previewState === "ready" && (!Y.value || !!(l.active && l.reelControlsTarget))), ue = r(() => `${l.item.postId}:${D.value}:${F.value}`);
|
|
786
|
+
function de(e) {
|
|
787
|
+
l.layout === "reel" && (e.stopPropagation(), fe());
|
|
818
788
|
}
|
|
819
|
-
async function
|
|
820
|
-
if (!(!R.value || !
|
|
789
|
+
async function fe() {
|
|
790
|
+
if (!(!R.value || !K.value)) {
|
|
821
791
|
if (H.value) {
|
|
822
792
|
R.value.pause();
|
|
823
793
|
return;
|
|
@@ -829,12 +799,12 @@ var He = [
|
|
|
829
799
|
}
|
|
830
800
|
}
|
|
831
801
|
}
|
|
832
|
-
function
|
|
802
|
+
function pe(e) {
|
|
833
803
|
return Number.isFinite(e) ? Math.max(0, e) : 0;
|
|
834
804
|
}
|
|
835
805
|
function X(e) {
|
|
836
806
|
let t = e?.currentTarget ?? R.value;
|
|
837
|
-
t && (z.value =
|
|
807
|
+
t && (z.value = pe(t.currentTime), B.value = pe(t.duration), K.value && (V.value = t.muted), U.value = t.volume, t.volume > 0 && (W = t.volume));
|
|
838
808
|
}
|
|
839
809
|
function me(e) {
|
|
840
810
|
X(e), x("ready", D.value);
|
|
@@ -844,20 +814,20 @@ var He = [
|
|
|
844
814
|
}
|
|
845
815
|
function ge(e) {
|
|
846
816
|
let t = R.value;
|
|
847
|
-
!t || !Number.isFinite(e) || (t.currentTime = Math.min(
|
|
817
|
+
!t || !Number.isFinite(e) || (t.currentTime = Math.min(pe(t.duration), Math.max(0, e)), z.value = t.currentTime);
|
|
848
818
|
}
|
|
849
819
|
function _e(e) {
|
|
850
820
|
let t = R.value;
|
|
851
821
|
if (!t || !Number.isFinite(e)) return;
|
|
852
822
|
let n = Math.min(1, Math.max(0, e));
|
|
853
|
-
t.volume = n, t.muted = n === 0, n > 0 && (
|
|
823
|
+
t.volume = n, t.muted = n === 0, n > 0 && (W = n), X();
|
|
854
824
|
}
|
|
855
825
|
function ve() {
|
|
856
826
|
let e = R.value;
|
|
857
|
-
e && (e.muted && e.volume === 0 && (e.volume =
|
|
827
|
+
e && (e.muted && e.volume === 0 && (e.volume = W), e.muted = !e.muted, X());
|
|
858
828
|
}
|
|
859
829
|
return v(() => {
|
|
860
|
-
|
|
830
|
+
ie();
|
|
861
831
|
}), (r, i) => (b(), s("article", {
|
|
862
832
|
"data-post-id": e.item.postId,
|
|
863
833
|
"data-media-index": D.value,
|
|
@@ -871,12 +841,12 @@ var He = [
|
|
|
871
841
|
"aria-hidden": e.leaving || void 0,
|
|
872
842
|
"aria-busy": e.previewState === "loading",
|
|
873
843
|
inert: e.leaving || void 0,
|
|
874
|
-
role: e.interactive && !e.leaving && !
|
|
875
|
-
tabindex: e.interactive && !e.leaving && !
|
|
876
|
-
onClick: i[11] ||= (t) => S(e.interactive && !
|
|
877
|
-
onKeydown: [i[12] ||= A((t) => S(e.interactive && !
|
|
878
|
-
}, [c("div",
|
|
879
|
-
e.cardHeader ? (b(), a(
|
|
844
|
+
role: e.interactive && !e.leaving && !q.value ? "button" : void 0,
|
|
845
|
+
tabindex: e.interactive && !e.leaving && !q.value ? 0 : void 0,
|
|
846
|
+
onClick: i[11] ||= (t) => S(e.interactive && !q.value, te(t)),
|
|
847
|
+
onKeydown: [i[12] ||= A((t) => S(e.interactive && !q.value, "keyboard"), ["enter"]), i[13] ||= A(j((t) => S(e.interactive && !q.value, "keyboard"), ["prevent"]), ["space"])]
|
|
848
|
+
}, [c("div", Ve, [
|
|
849
|
+
e.cardHeader ? (b(), a(Ae, {
|
|
880
850
|
key: 0,
|
|
881
851
|
index: e.index,
|
|
882
852
|
item: e.item,
|
|
@@ -902,22 +872,22 @@ var He = [
|
|
|
902
872
|
c("div", {
|
|
903
873
|
class: h(["media-card-media", { "media-card-media--carousel": e.layout === "reel" && C.value.length > 1 }]),
|
|
904
874
|
"data-media-direction": y.value,
|
|
905
|
-
onWheel:
|
|
906
|
-
onTouchstartPassive:
|
|
907
|
-
onTouchendPassive:
|
|
875
|
+
onWheel: oe,
|
|
876
|
+
onTouchstartPassive: se,
|
|
877
|
+
onTouchendPassive: J
|
|
908
878
|
}, [
|
|
909
879
|
u(n, { name: `media-slide-${y.value}` }, {
|
|
910
880
|
default: k(() => [(b(), s("div", {
|
|
911
881
|
key: `${e.item.postId}:${O.value.src}:${e.mediaSource ?? "preview"}`,
|
|
912
882
|
class: "media-card-frame",
|
|
913
883
|
"data-media-index": D.value
|
|
914
|
-
}, [e.previewState === "loading" ? (b(), s("div",
|
|
884
|
+
}, [e.previewState === "loading" ? (b(), s("div", We, [...i[14] ||= [c("span", { class: "media-loading-shimmer" }, null, -1)]])) : e.previewState === "error" ? (b(), s("div", {
|
|
915
885
|
key: 1,
|
|
916
886
|
"data-test": "media-error",
|
|
917
887
|
class: "media-error",
|
|
918
888
|
role: "img",
|
|
919
|
-
"aria-label": `${E(
|
|
920
|
-
}, [c("strong",
|
|
889
|
+
"aria-label": `${E(Ee)(F.value)} ${E(De)(F.value)}`
|
|
890
|
+
}, [c("strong", Ke, T(E(Ee)(F.value)), 1), c("span", null, T(E(De)(F.value)), 1)], 8, Ge)) : o("", !0), ce.value ? (b(), s("video", {
|
|
921
891
|
key: 2,
|
|
922
892
|
ref_key: "videoElement",
|
|
923
893
|
ref: R,
|
|
@@ -928,21 +898,21 @@ var He = [
|
|
|
928
898
|
src: F.value,
|
|
929
899
|
width: I.value ?? void 0,
|
|
930
900
|
height: L.value ?? void 0,
|
|
931
|
-
autoplay: E(
|
|
901
|
+
autoplay: E(K),
|
|
932
902
|
loop: !e.advanceOnMediaEnd,
|
|
933
|
-
muted: E(
|
|
903
|
+
muted: E(G),
|
|
934
904
|
playsinline: "",
|
|
935
905
|
preload: e.fetchPriority === "high" ? "auto" : "metadata",
|
|
936
906
|
onLoadedmetadata: me,
|
|
937
907
|
onDurationchange: X,
|
|
938
908
|
onTimeupdate: X,
|
|
939
909
|
onVolumechange: X,
|
|
940
|
-
onPlaying: i[0] ||= (...e) => E(
|
|
910
|
+
onPlaying: i[0] ||= (...e) => E(ee) && E(ee)(...e),
|
|
941
911
|
onPause: i[1] ||= (e) => H.value = !1,
|
|
942
912
|
onEnded: he,
|
|
943
|
-
onClick:
|
|
913
|
+
onClick: de,
|
|
944
914
|
onError: i[2] ||= (e) => r.$emit("error", D.value)
|
|
945
|
-
}, null, 42,
|
|
915
|
+
}, null, 42, qe)) : (b(), s("img", {
|
|
946
916
|
key: 3,
|
|
947
917
|
class: h(["media-preview", { "media-preview--ready": e.previewState === "ready" }]),
|
|
948
918
|
src: F.value,
|
|
@@ -954,28 +924,28 @@ var He = [
|
|
|
954
924
|
loading: "eager",
|
|
955
925
|
onLoad: i[3] ||= (e) => r.$emit("ready", D.value),
|
|
956
926
|
onError: i[4] ||= (e) => r.$emit("error", D.value)
|
|
957
|
-
}, null, 42,
|
|
927
|
+
}, null, 42, Je))], 8, Ue))]),
|
|
958
928
|
_: 1
|
|
959
929
|
}, 8, ["name"]),
|
|
960
930
|
(b(), a(t, {
|
|
961
|
-
disabled: !
|
|
931
|
+
disabled: !Y.value || !e.reelControlsTarget,
|
|
962
932
|
to: e.reelControlsTarget ?? "body"
|
|
963
933
|
}, [u(n, {
|
|
964
934
|
name: "vibe-reel-media-controls",
|
|
965
|
-
css:
|
|
935
|
+
css: Y.value
|
|
966
936
|
}, {
|
|
967
|
-
default: k(() => [
|
|
968
|
-
key:
|
|
937
|
+
default: k(() => [le.value ? (b(), a(Re, {
|
|
938
|
+
key: ue.value,
|
|
969
939
|
"current-time": z.value,
|
|
970
|
-
"data-control-post-id":
|
|
940
|
+
"data-control-post-id": Y.value ? e.item.postId : void 0,
|
|
971
941
|
duration: B.value,
|
|
972
942
|
layout: e.layout,
|
|
973
943
|
muted: V.value,
|
|
974
944
|
playing: H.value,
|
|
975
|
-
volume:
|
|
945
|
+
volume: U.value,
|
|
976
946
|
onSeek: ge,
|
|
977
947
|
onToggleMute: ve,
|
|
978
|
-
onTogglePlayback:
|
|
948
|
+
onTogglePlayback: fe,
|
|
979
949
|
onVolumeChange: _e
|
|
980
950
|
}, null, 8, [
|
|
981
951
|
"current-time",
|
|
@@ -996,25 +966,25 @@ var He = [
|
|
|
996
966
|
type: "button",
|
|
997
967
|
class: "media-carousel-control media-carousel-control--previous",
|
|
998
968
|
"aria-label": `Previous media for post ${e.item.postId}`,
|
|
999
|
-
onClick: i[5] ||= j((e) =>
|
|
969
|
+
onClick: i[5] ||= j((e) => ne(D.value - 1, e), ["stop"]),
|
|
1000
970
|
onKeydown: i[6] ||= j(() => {}, ["stop"])
|
|
1001
|
-
}, [u(E(
|
|
971
|
+
}, [u(E(ye), { size: 20 })], 40, Ye), c("button", {
|
|
1002
972
|
type: "button",
|
|
1003
973
|
class: "media-carousel-control media-carousel-control--next",
|
|
1004
974
|
"aria-label": `Next media for post ${e.item.postId}`,
|
|
1005
|
-
onClick: i[7] ||= j((e) =>
|
|
975
|
+
onClick: i[7] ||= j((e) => ne(D.value + 1, e), ["stop"]),
|
|
1006
976
|
onKeydown: i[8] ||= j(() => {}, ["stop"])
|
|
1007
|
-
}, [u(E(
|
|
1008
|
-
|
|
977
|
+
}, [u(E(be), { size: 20 })], 40, Xe)], 2)) : o("", !0),
|
|
978
|
+
q.value ? (b(), s("button", {
|
|
1009
979
|
key: 1,
|
|
1010
980
|
class: "media-card-activator",
|
|
1011
981
|
type: "button",
|
|
1012
982
|
"aria-label": `Open post ${e.item.postId}`,
|
|
1013
|
-
onClick: i[9] ||= j((e) => r.$emit("activate",
|
|
983
|
+
onClick: i[9] ||= j((e) => r.$emit("activate", te(e)), ["stop"]),
|
|
1014
984
|
onKeydown: i[10] ||= j(() => {}, ["stop"])
|
|
1015
|
-
}, null, 40,
|
|
1016
|
-
], 42,
|
|
1017
|
-
e.cardFooter ? (b(), a(
|
|
985
|
+
}, null, 40, Ze)) : o("", !0)
|
|
986
|
+
], 42, He),
|
|
987
|
+
e.cardFooter ? (b(), a(Ae, {
|
|
1018
988
|
key: 1,
|
|
1019
989
|
index: e.index,
|
|
1020
990
|
item: e.item,
|
|
@@ -1037,9 +1007,9 @@ var He = [
|
|
|
1037
1007
|
"style",
|
|
1038
1008
|
"total"
|
|
1039
1009
|
])) : o("", !0)
|
|
1040
|
-
])], 46,
|
|
1010
|
+
])], 46, Be));
|
|
1041
1011
|
}
|
|
1042
|
-
}),
|
|
1012
|
+
}), nt = { class: "masonry-feed-shell" }, rt = ["aria-hidden", "inert"], it = 240, at = 6, ot = 12, st = 800, ct = 1.5, lt = /* @__PURE__ */ d({
|
|
1043
1013
|
__name: "MasonryFeed",
|
|
1044
1014
|
props: {
|
|
1045
1015
|
enteringPostIds: {},
|
|
@@ -1070,55 +1040,81 @@ var He = [
|
|
|
1070
1040
|
"loadMore",
|
|
1071
1041
|
"mediaChange",
|
|
1072
1042
|
"ready",
|
|
1073
|
-
"retryEnd"
|
|
1043
|
+
"retryEnd",
|
|
1044
|
+
"visible"
|
|
1074
1045
|
],
|
|
1075
1046
|
setup(t, { expose: n, emit: i }) {
|
|
1076
|
-
let o = t, l = i, d = w(null), f = `vibe-masonry-${D()}`, p = w(null), m = w(0), g = w(
|
|
1047
|
+
let o = t, l = i, d = w(null), f = `vibe-masonry-${D()}`, p = w(null), m = w(0), g = w(at), y = w(0), x = w(0), C = w(0), T = null, k = null, A = null, j = r(() => ie(o.items, m.value, {
|
|
1077
1048
|
additionalHeight: (o.cardHeader?.height ?? 0) + (o.cardFooter?.height ?? 0),
|
|
1078
1049
|
gap: g.value,
|
|
1079
|
-
minColumnWidth:
|
|
1050
|
+
minColumnWidth: it
|
|
1080
1051
|
})), M = r(() => {
|
|
1081
1052
|
let e = j.value;
|
|
1082
1053
|
if (o.leavingPostIds.size === 0) return e;
|
|
1083
|
-
let t = o.items.filter((e) => !o.leavingPostIds.has(e.postId)), n =
|
|
1054
|
+
let t = o.items.filter((e) => !o.leavingPostIds.has(e.postId)), n = ie(t, m.value, {
|
|
1084
1055
|
additionalHeight: (o.cardHeader?.height ?? 0) + (o.cardFooter?.height ?? 0),
|
|
1085
1056
|
gap: g.value,
|
|
1086
|
-
minColumnWidth:
|
|
1057
|
+
minColumnWidth: it
|
|
1087
1058
|
}), r = new Map(t.map((e, t) => [e.postId, n.items[t]]));
|
|
1088
1059
|
return {
|
|
1089
1060
|
...n,
|
|
1090
1061
|
items: o.items.map((t, n) => o.leavingPostIds.has(t.postId) ? e.items[n] : r.get(t.postId) ?? e.items[n])
|
|
1091
1062
|
};
|
|
1092
1063
|
}), N = r(() => ({ height: `${o.leavingPostIds.size === 0 ? M.value.height : j.value.height}px` })), P = r(() => !o.infiniteScroll || x.value > 0 && C.value + M.value.height <= x.value + 1), I = r(() => {
|
|
1093
|
-
|
|
1064
|
+
if (o.suspended) return /* @__PURE__ */ new Set();
|
|
1065
|
+
let e = {
|
|
1066
|
+
scrollTop: y.value - C.value,
|
|
1067
|
+
viewportHeight: x.value
|
|
1068
|
+
}, t = re(M.value.items, {
|
|
1069
|
+
...e,
|
|
1070
|
+
overscan: 0
|
|
1071
|
+
}), n = o.leavingPostIds.size === 0 ? [] : re(j.value.items, {
|
|
1072
|
+
...e,
|
|
1073
|
+
overscan: 0
|
|
1074
|
+
});
|
|
1075
|
+
return new Set([...t, ...n]);
|
|
1076
|
+
}), L = r(() => {
|
|
1077
|
+
let e = Math.max(st, x.value * ct), t = {
|
|
1094
1078
|
scrollTop: y.value - C.value,
|
|
1095
1079
|
viewportHeight: x.value
|
|
1096
|
-
}, n =
|
|
1080
|
+
}, n = re(M.value.items, {
|
|
1097
1081
|
...t,
|
|
1098
1082
|
overscan: e
|
|
1099
|
-
}), r = o.leavingPostIds.size === 0 ? [] :
|
|
1083
|
+
}), r = o.leavingPostIds.size === 0 ? [] : re(j.value.items, {
|
|
1100
1084
|
...t,
|
|
1101
1085
|
overscan: e
|
|
1102
|
-
})
|
|
1103
|
-
|
|
1104
|
-
overscan: 0
|
|
1105
|
-
}), s = o.leavingPostIds.size === 0 ? [] : G(j.value.items, {
|
|
1106
|
-
...t,
|
|
1107
|
-
overscan: 0
|
|
1108
|
-
}), c = new Set([...a, ...s]);
|
|
1109
|
-
return i.flatMap((e) => {
|
|
1086
|
+
});
|
|
1087
|
+
return [...new Set([...n, ...r])].sort((e, t) => e - t).flatMap((e) => {
|
|
1110
1088
|
let t = o.items[e];
|
|
1111
1089
|
return t ? [{
|
|
1112
|
-
fetchPriority:
|
|
1090
|
+
fetchPriority: I.value.has(e) ? "high" : "low",
|
|
1113
1091
|
index: e,
|
|
1114
1092
|
item: t
|
|
1115
1093
|
}] : [];
|
|
1116
1094
|
});
|
|
1095
|
+
}), R = /* @__PURE__ */ new Set();
|
|
1096
|
+
O(() => [...I.value].flatMap((e) => {
|
|
1097
|
+
let t = o.items[e];
|
|
1098
|
+
if (!t) return [];
|
|
1099
|
+
let n = o.mediaIndices.get(t.postId) ?? 0, r = F(t.postId, n);
|
|
1100
|
+
return o.previewStates.get(r) === "ready" ? [{
|
|
1101
|
+
key: r,
|
|
1102
|
+
mediaIndex: n,
|
|
1103
|
+
postId: t.postId
|
|
1104
|
+
}] : [];
|
|
1105
|
+
}), (e) => {
|
|
1106
|
+
let t = new Set(e.map(({ key: e }) => e));
|
|
1107
|
+
e.forEach(({ key: e, mediaIndex: t, postId: n }) => {
|
|
1108
|
+
R.has(e) || l("visible", n, t);
|
|
1109
|
+
}), R = t;
|
|
1110
|
+
}, {
|
|
1111
|
+
immediate: !0,
|
|
1112
|
+
flush: "post"
|
|
1117
1113
|
});
|
|
1118
|
-
function
|
|
1114
|
+
function z(e) {
|
|
1119
1115
|
let t = M.value.items[e], n = o.items[e]?.postId;
|
|
1120
1116
|
if (!t) return {};
|
|
1121
|
-
let r = n !== void 0 && o.enteringPostIds.has(n), i = n !== void 0 && o.leavingPostIds.has(n), a = r || i ?
|
|
1117
|
+
let r = n !== void 0 && o.enteringPostIds.has(n), i = n !== void 0 && o.leavingPostIds.has(n), a = r || i ? ne({
|
|
1122
1118
|
containerHeight: j.value.height,
|
|
1123
1119
|
gap: g.value
|
|
1124
1120
|
}) : 0, s = n === void 0 ? 0 : i ? o.removalDelays.get(n) ?? 0 : r ? o.entryDelays.get(n) ?? 0 : 0;
|
|
@@ -1129,43 +1125,43 @@ var He = [
|
|
|
1129
1125
|
transform: `translate3d(${t.x}px, ${t.y + a}px, 0)`
|
|
1130
1126
|
};
|
|
1131
1127
|
}
|
|
1132
|
-
function
|
|
1128
|
+
function B() {
|
|
1133
1129
|
let e = d.value;
|
|
1134
1130
|
if (!e) return;
|
|
1135
1131
|
y.value = e.scrollTop, x.value = e.clientHeight;
|
|
1136
1132
|
let t = p.value;
|
|
1137
1133
|
t && (C.value = t.getBoundingClientRect().top - e.getBoundingClientRect().top + e.scrollTop);
|
|
1138
1134
|
}
|
|
1139
|
-
function
|
|
1135
|
+
function V(e) {
|
|
1140
1136
|
let t = e.ownerDocument.documentElement.clientWidth;
|
|
1141
|
-
m.value = e.clientWidth, g.value = Math.min(
|
|
1137
|
+
m.value = e.clientWidth, g.value = Math.min(ot, Math.max(at, t * .0075)), B();
|
|
1142
1138
|
}
|
|
1143
|
-
function
|
|
1139
|
+
function H(e) {
|
|
1144
1140
|
let t = e.currentTarget;
|
|
1145
|
-
t && (y.value = t.scrollTop, !o.loadMoreLocked && o.infiniteScroll &&
|
|
1141
|
+
t && (y.value = t.scrollTop, !o.loadMoreLocked && o.infiniteScroll && K(t) && l("loadMore"));
|
|
1146
1142
|
}
|
|
1147
|
-
function
|
|
1143
|
+
function W() {
|
|
1148
1144
|
let e = d.value;
|
|
1149
|
-
!o.loadMoreLocked && e &&
|
|
1145
|
+
!o.loadMoreLocked && e && K(e) && l("loadMore");
|
|
1150
1146
|
}
|
|
1151
|
-
function
|
|
1147
|
+
function G() {
|
|
1152
1148
|
return d.value;
|
|
1153
1149
|
}
|
|
1154
1150
|
return O(p, (e) => {
|
|
1155
|
-
T?.disconnect(), T = null, A !== null && cancelAnimationFrame(A), e && (
|
|
1151
|
+
T?.disconnect(), T = null, A !== null && cancelAnimationFrame(A), e && (V(e), !(typeof ResizeObserver > "u") && (T = new ResizeObserver(([t]) => {
|
|
1156
1152
|
let n = t?.contentRect.width ?? e.clientWidth;
|
|
1157
1153
|
Math.abs(n - m.value) < .5 || (A = requestAnimationFrame(() => {
|
|
1158
|
-
A = null,
|
|
1154
|
+
A = null, V(e);
|
|
1159
1155
|
}));
|
|
1160
1156
|
}), T.observe(e)));
|
|
1161
1157
|
}), O(d, (e) => {
|
|
1162
|
-
k?.disconnect(), k = null, e && (
|
|
1158
|
+
k?.disconnect(), k = null, e && (B(), !(typeof ResizeObserver > "u") && (k = new ResizeObserver(B), k.observe(e)));
|
|
1163
1159
|
}), v(() => {
|
|
1164
1160
|
T?.disconnect(), k?.disconnect(), A !== null && cancelAnimationFrame(A);
|
|
1165
1161
|
}), n({
|
|
1166
|
-
getScrollElement:
|
|
1167
|
-
loadIfNearBottom:
|
|
1168
|
-
}), (n, r) => (b(), s("div",
|
|
1162
|
+
getScrollElement: G,
|
|
1163
|
+
loadIfNearBottom: W
|
|
1164
|
+
}), (n, r) => (b(), s("div", nt, [c("main", {
|
|
1169
1165
|
id: f,
|
|
1170
1166
|
ref_key: "galleryElement",
|
|
1171
1167
|
ref: d,
|
|
@@ -1173,14 +1169,14 @@ var He = [
|
|
|
1173
1169
|
"data-layout-mode": "masonry",
|
|
1174
1170
|
"aria-hidden": t.suspended || void 0,
|
|
1175
1171
|
inert: t.suspended || void 0,
|
|
1176
|
-
onScrollPassive:
|
|
1172
|
+
onScrollPassive: H
|
|
1177
1173
|
}, [c("section", {
|
|
1178
1174
|
ref_key: "masonryElement",
|
|
1179
1175
|
ref: p,
|
|
1180
1176
|
class: h(["masonry", { "masonry--ready": m.value > 0 }]),
|
|
1181
1177
|
style: _(N.value),
|
|
1182
1178
|
"aria-label": "Media gallery"
|
|
1183
|
-
}, [(b(!0), s(e, null, S(
|
|
1179
|
+
}, [(b(!0), s(e, null, S(L.value, ({ fetchPriority: e, item: n, index: r }) => (b(), a(tt, {
|
|
1184
1180
|
key: n.postId,
|
|
1185
1181
|
class: "masonry-item",
|
|
1186
1182
|
entering: t.enteringPostIds.has(n.postId),
|
|
@@ -1191,7 +1187,7 @@ var He = [
|
|
|
1191
1187
|
"media-card": t.mediaCard,
|
|
1192
1188
|
index: r,
|
|
1193
1189
|
item: n,
|
|
1194
|
-
"item-style":
|
|
1190
|
+
"item-style": z(r),
|
|
1195
1191
|
interactive: "",
|
|
1196
1192
|
layout: "masonry",
|
|
1197
1193
|
"loaded-count": t.items.length,
|
|
@@ -1220,7 +1216,7 @@ var He = [
|
|
|
1220
1216
|
"onMediaChange",
|
|
1221
1217
|
"onReady",
|
|
1222
1218
|
"onError"
|
|
1223
|
-
]))), 128))], 6), u(
|
|
1219
|
+
]))), 128))], 6), u(U, {
|
|
1224
1220
|
actions: t.feedFooterActions,
|
|
1225
1221
|
"can-retry-end": t.canRetryEnd,
|
|
1226
1222
|
"feed-footer": t.feedFooter,
|
|
@@ -1242,7 +1238,7 @@ var He = [
|
|
|
1242
1238
|
"load-more-locked",
|
|
1243
1239
|
"show-load-more",
|
|
1244
1240
|
"state"
|
|
1245
|
-
])], 42,
|
|
1241
|
+
])], 42, rt), u(ue, {
|
|
1246
1242
|
"content-size": M.value.height,
|
|
1247
1243
|
"controls-id": f,
|
|
1248
1244
|
"scroll-element": d.value,
|
|
@@ -1253,8 +1249,8 @@ var He = [
|
|
|
1253
1249
|
"suspended"
|
|
1254
1250
|
])]));
|
|
1255
1251
|
}
|
|
1256
|
-
}),
|
|
1257
|
-
function
|
|
1252
|
+
}), ut = 300;
|
|
1253
|
+
function dt(e, t, n) {
|
|
1258
1254
|
let r = e.scrollTop;
|
|
1259
1255
|
if (n || Math.abs(r - t) <= 1) return e.scrollTop = t, Promise.resolve();
|
|
1260
1256
|
e.setAttribute("data-transitioning", "");
|
|
@@ -1262,7 +1258,7 @@ function pt(e, t, n) {
|
|
|
1262
1258
|
return new Promise((n) => {
|
|
1263
1259
|
let o = (s) => {
|
|
1264
1260
|
a += 1;
|
|
1265
|
-
let c = Math.max(s - i, 1e3 / 60 * a), l = Math.min(1, c /
|
|
1261
|
+
let c = Math.max(s - i, 1e3 / 60 * a), l = Math.min(1, c / ut), u = 1 - (1 - l) ** 3;
|
|
1266
1262
|
if (e.scrollTop = r + (t - r) * u, l < 1) {
|
|
1267
1263
|
requestAnimationFrame(o);
|
|
1268
1264
|
return;
|
|
@@ -1274,7 +1270,7 @@ function pt(e, t, n) {
|
|
|
1274
1270
|
}
|
|
1275
1271
|
//#endregion
|
|
1276
1272
|
//#region src/components/ReelAutoAdvanceProgress.vue?vue&type=script&setup=true&lang.ts
|
|
1277
|
-
var
|
|
1273
|
+
var ft = ["aria-label"], pt = /* @__PURE__ */ d({
|
|
1278
1274
|
__name: "ReelAutoAdvanceProgress",
|
|
1279
1275
|
props: {
|
|
1280
1276
|
durationMs: {},
|
|
@@ -1292,9 +1288,9 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1292
1288
|
class: "reel-auto-advance-progress",
|
|
1293
1289
|
style: _(a.value),
|
|
1294
1290
|
onAnimationend: n[0] ||= (e) => i("complete")
|
|
1295
|
-
}, null, 36)], 8,
|
|
1291
|
+
}, null, 36)], 8, ft));
|
|
1296
1292
|
}
|
|
1297
|
-
}),
|
|
1293
|
+
}), mt = { class: "reel-viewport" }, ht = ["data-active-post-id", "data-active-media-index"], gt = ["role", "data-status"], _t = 2, vt = 300, yt = /* @__PURE__ */ d({
|
|
1298
1294
|
__name: "ReelFeed",
|
|
1299
1295
|
props: {
|
|
1300
1296
|
initialPostId: {},
|
|
@@ -1332,7 +1328,7 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1332
1328
|
],
|
|
1333
1329
|
setup(t, { expose: n, emit: i }) {
|
|
1334
1330
|
let l = t, u = i, d = w(null), f = w(null), p = l.initialPostId === null || l.initialPostId === void 0 ? -1 : l.items.findIndex((e) => e.postId === l.initialPostId), g = w(Math.max(0, p)), x = w(!1), C = w(!1), D = 0, k = null, A = null, j = null, N = r(() => ({ gridTemplateRows: `repeat(${l.items.length}, 100cqh)` })), I = r(() => {
|
|
1335
|
-
let e = Math.max(0, g.value -
|
|
1331
|
+
let e = Math.max(0, g.value - _t), t = Math.min(l.items.length - 1, g.value + _t);
|
|
1336
1332
|
return l.items.slice(e, t + 1).map((t, n) => ({
|
|
1337
1333
|
fetchPriority: e + n === g.value ? "high" : "low",
|
|
1338
1334
|
index: e + n,
|
|
@@ -1349,7 +1345,7 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1349
1345
|
if (!e) return "";
|
|
1350
1346
|
let t = P(e, z.value);
|
|
1351
1347
|
return l.mediaSource === "original" ? t.src : t.preview.src;
|
|
1352
|
-
}), H = r(() => B.value === "ready" &&
|
|
1348
|
+
}), H = r(() => B.value === "ready" && ke(V.value)), W = r(() => [
|
|
1353
1349
|
L.value,
|
|
1354
1350
|
z.value,
|
|
1355
1351
|
l.items.length,
|
|
@@ -1357,49 +1353,49 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1357
1353
|
l.reelAutoAdvance.enabled,
|
|
1358
1354
|
l.reelAutoAdvance.includePostItems,
|
|
1359
1355
|
l.reelAutoAdvance.intervalMs
|
|
1360
|
-
].join(":")),
|
|
1356
|
+
].join(":")), G = r(() => {
|
|
1361
1357
|
let e = R.value, t = !!(e && l.reelAutoAdvance.includePostItems && z.value < M(e).length - 1), n = l.reelAutoAdvance.intervalMs / 1e3;
|
|
1362
1358
|
return `Auto advance to the next ${t ? "post item" : "post"} in ${n}s`;
|
|
1363
|
-
}),
|
|
1364
|
-
function
|
|
1359
|
+
}), ee = r(() => l.reelAutoAdvance.enabled && l.reelForward.status === "idle" && R.value !== void 0 && B.value !== "loading" && !H.value), q = r(() => !l.infiniteScroll || l.items.length <= 1), te = r(() => l.reelForward.status === "loading" ? "Loading the next media…" : l.reelForward.status === "error" ? "Unable to load the next media." : "You reached the end of this feed.");
|
|
1360
|
+
function ne(e) {
|
|
1365
1361
|
return { gridRow: `${e + 1}` };
|
|
1366
1362
|
}
|
|
1367
|
-
function
|
|
1363
|
+
function re(e) {
|
|
1368
1364
|
let t = D || e.clientHeight;
|
|
1369
1365
|
return t <= 0 || l.items.length === 0 ? 0 : Math.min(l.items.length - 1, Math.max(0, Math.round(e.scrollTop / t)));
|
|
1370
1366
|
}
|
|
1371
|
-
function
|
|
1367
|
+
function ie(e) {
|
|
1372
1368
|
let t = e.currentTarget;
|
|
1373
1369
|
if (!t) return;
|
|
1374
1370
|
let n = D || t.clientHeight, r = Math.max(0, l.items.length - 1) * n;
|
|
1375
|
-
x.value = l.items.length > 0 && t.scrollTop > r + 1, C.value || (g.value =
|
|
1371
|
+
x.value = l.items.length > 0 && t.scrollTop > r + 1, C.value || (g.value = re(t)), !l.loadMoreLocked && l.infiniteScroll && K(t) && u("loadMore");
|
|
1376
1372
|
}
|
|
1377
|
-
function
|
|
1373
|
+
function ae() {
|
|
1378
1374
|
let e = d.value;
|
|
1379
|
-
e && (x.value = !1,
|
|
1375
|
+
e && (x.value = !1, J(!0), D = e.clientHeight, e.scrollTop = g.value * D, A !== null && cancelAnimationFrame(A), A = requestAnimationFrame(() => {
|
|
1380
1376
|
e.scrollTop = g.value * e.clientHeight, D = e.clientHeight, A = null;
|
|
1381
|
-
}),
|
|
1377
|
+
}), oe());
|
|
1382
1378
|
}
|
|
1383
|
-
function
|
|
1379
|
+
function oe() {
|
|
1384
1380
|
j !== null && clearTimeout(j), j = setTimeout(() => {
|
|
1385
1381
|
j = null;
|
|
1386
1382
|
let e = d.value;
|
|
1387
|
-
e && (D = e.clientHeight, e.scrollTop = g.value * D),
|
|
1383
|
+
e && (D = e.clientHeight, e.scrollTop = g.value * D), J(!1);
|
|
1388
1384
|
}, 120);
|
|
1389
1385
|
}
|
|
1390
|
-
function
|
|
1391
|
-
|
|
1386
|
+
function se() {
|
|
1387
|
+
J(!0);
|
|
1392
1388
|
let e = d.value;
|
|
1393
|
-
e && (D = e.clientHeight, e.scrollTop = g.value * D),
|
|
1389
|
+
e && (D = e.clientHeight, e.scrollTop = g.value * D), oe();
|
|
1394
1390
|
}
|
|
1395
|
-
function
|
|
1391
|
+
function J(e) {
|
|
1396
1392
|
C.value = e, d.value?.toggleAttribute("data-resizing", e);
|
|
1397
1393
|
}
|
|
1398
|
-
function
|
|
1394
|
+
function ce() {
|
|
1399
1395
|
let e = d.value;
|
|
1400
|
-
!l.loadMoreLocked && e &&
|
|
1396
|
+
!l.loadMoreLocked && e && K(e) && u("loadMore");
|
|
1401
1397
|
}
|
|
1402
|
-
function
|
|
1398
|
+
function Y(e) {
|
|
1403
1399
|
let t = R.value;
|
|
1404
1400
|
if (!t) return !1;
|
|
1405
1401
|
let n = M(t).length;
|
|
@@ -1407,32 +1403,32 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1407
1403
|
let r = (z.value + e + n) % n;
|
|
1408
1404
|
return u("mediaChange", t.postId, r), !0;
|
|
1409
1405
|
}
|
|
1410
|
-
function
|
|
1406
|
+
function le(e) {
|
|
1411
1407
|
let t = g.value + e;
|
|
1412
|
-
return !d.value || t < 0 || t >= l.items.length ? !1 : (
|
|
1408
|
+
return !d.value || t < 0 || t >= l.items.length ? !1 : (pe(t), !0);
|
|
1413
1409
|
}
|
|
1414
|
-
function
|
|
1410
|
+
function ue(e, t) {
|
|
1415
1411
|
let n = l.items.findIndex((t) => t.postId === e), r = l.items[n];
|
|
1416
|
-
return !d.value || !r || t < 0 || t > r.items.length ? !1 : ((l.mediaIndices.get(e) ?? 0) !== t && u("mediaChange", e, t), n !== g.value &&
|
|
1412
|
+
return !d.value || !r || t < 0 || t > r.items.length ? !1 : ((l.mediaIndices.get(e) ?? 0) !== t && u("mediaChange", e, t), n !== g.value && pe(n), !0);
|
|
1417
1413
|
}
|
|
1418
|
-
function
|
|
1414
|
+
function de() {
|
|
1419
1415
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1420
1416
|
}
|
|
1421
|
-
function
|
|
1417
|
+
function fe(e) {
|
|
1422
1418
|
let t = d.value;
|
|
1423
1419
|
if (!t) return Promise.resolve();
|
|
1424
1420
|
let n = e * (D || t.clientHeight);
|
|
1425
|
-
return g.value = e,
|
|
1421
|
+
return g.value = e, dt(t, n, de());
|
|
1426
1422
|
}
|
|
1427
|
-
function
|
|
1428
|
-
|
|
1423
|
+
function pe(e) {
|
|
1424
|
+
fe(e);
|
|
1429
1425
|
}
|
|
1430
1426
|
async function X(e) {
|
|
1431
1427
|
let t = l.items.findIndex((t) => t.postId === e);
|
|
1432
|
-
return t < 0 || t === g.value ? !1 : (await
|
|
1428
|
+
return t < 0 || t === g.value ? !1 : (await fe(t), !0);
|
|
1433
1429
|
}
|
|
1434
1430
|
async function me(e) {
|
|
1435
|
-
return
|
|
1431
|
+
return Y(e) ? (de() || await new Promise((e) => setTimeout(e, vt)), !0) : !1;
|
|
1436
1432
|
}
|
|
1437
1433
|
function he() {
|
|
1438
1434
|
if (!l.reelAutoAdvance.enabled) return;
|
|
@@ -1447,29 +1443,29 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1447
1443
|
l.hasNext && !l.loadMoreLocked && u("loadMore");
|
|
1448
1444
|
return;
|
|
1449
1445
|
}
|
|
1450
|
-
l.reelAutoAdvance.includePostItems && (l.mediaIndices.get(n.postId) ?? 0) !== 0 && u("mediaChange", n.postId, 0),
|
|
1446
|
+
l.reelAutoAdvance.includePostItems && (l.mediaIndices.get(n.postId) ?? 0) !== 0 && u("mediaChange", n.postId, 0), pe(t);
|
|
1451
1447
|
}
|
|
1452
1448
|
function ge(e, t) {
|
|
1453
1449
|
!l.reelAutoAdvance.enabled || e !== L.value || t !== z.value || !H.value || he();
|
|
1454
1450
|
}
|
|
1455
1451
|
return O(d, (e) => {
|
|
1456
|
-
k?.disconnect(), k = null, e && (D = e.clientHeight, !(typeof ResizeObserver > "u") && (k = new ResizeObserver(
|
|
1452
|
+
k?.disconnect(), k = null, e && (D = e.clientHeight, !(typeof ResizeObserver > "u") && (k = new ResizeObserver(ae), k.observe(e)));
|
|
1457
1453
|
}), O(() => l.items.length, async (e) => {
|
|
1458
1454
|
let t = l.initialPostId, n = t == null ? -1 : l.items.findIndex(({ postId: e }) => e === t);
|
|
1459
|
-
g.value = n >= 0 ? n : Math.min(g.value, Math.max(0, e - 1)), await m(),
|
|
1455
|
+
g.value = n >= 0 ? n : Math.min(g.value, Math.max(0, e - 1)), await m(), ae();
|
|
1460
1456
|
}), O(L, (e) => {
|
|
1461
1457
|
e !== void 0 && u("activeChange", e);
|
|
1462
1458
|
}, { immediate: !0 }), y(() => {
|
|
1463
|
-
window.addEventListener("resize",
|
|
1459
|
+
window.addEventListener("resize", se), window.addEventListener("orientationchange", se), p >= 0 && m(ae);
|
|
1464
1460
|
}), v(() => {
|
|
1465
|
-
window.removeEventListener("resize",
|
|
1461
|
+
window.removeEventListener("resize", se), window.removeEventListener("orientationchange", se), k?.disconnect(), A !== null && cancelAnimationFrame(A), j !== null && clearTimeout(j);
|
|
1466
1462
|
}), n({
|
|
1467
1463
|
activeIndex: g,
|
|
1468
1464
|
activePostId: L,
|
|
1469
|
-
changeActiveMedia:
|
|
1470
|
-
loadIfNearBottom:
|
|
1471
|
-
moveActivePost:
|
|
1472
|
-
navigateToItem:
|
|
1465
|
+
changeActiveMedia: Y,
|
|
1466
|
+
loadIfNearBottom: ce,
|
|
1467
|
+
moveActivePost: le,
|
|
1468
|
+
navigateToItem: ue,
|
|
1473
1469
|
transitionActiveMedia: me,
|
|
1474
1470
|
transitionActivePost: X
|
|
1475
1471
|
}), (n, r) => (b(), s("main", {
|
|
@@ -1479,7 +1475,7 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1479
1475
|
}]),
|
|
1480
1476
|
"data-layout-mode": "reel"
|
|
1481
1477
|
}, [
|
|
1482
|
-
t.cardHeader && R.value && t.reelForward.status === "idle" ? (b(), a(
|
|
1478
|
+
t.cardHeader && R.value && t.reelForward.status === "idle" ? (b(), a(Ae, {
|
|
1483
1479
|
key: 0,
|
|
1484
1480
|
index: g.value,
|
|
1485
1481
|
item: R.value,
|
|
@@ -1501,19 +1497,19 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1501
1497
|
"style",
|
|
1502
1498
|
"total"
|
|
1503
1499
|
])) : o("", !0),
|
|
1504
|
-
c("div",
|
|
1500
|
+
c("div", mt, [c("div", {
|
|
1505
1501
|
ref_key: "galleryElement",
|
|
1506
1502
|
ref: d,
|
|
1507
1503
|
class: "gallery-shell reel-feed",
|
|
1508
1504
|
"data-active-post-id": L.value,
|
|
1509
1505
|
"data-active-media-index": z.value,
|
|
1510
|
-
onScrollPassive:
|
|
1506
|
+
onScrollPassive: ie
|
|
1511
1507
|
}, [t.reelForward.status === "idle" ? (b(), s("section", {
|
|
1512
1508
|
key: 1,
|
|
1513
1509
|
class: "reel-track",
|
|
1514
1510
|
style: _(N.value),
|
|
1515
1511
|
"aria-label": "Media gallery"
|
|
1516
|
-
}, [(b(!0), s(e, null, S(I.value, ({ fetchPriority: e, item: n, index: r }) => (b(), a(
|
|
1512
|
+
}, [(b(!0), s(e, null, S(I.value, ({ fetchPriority: e, item: n, index: r }) => (b(), a(tt, {
|
|
1517
1513
|
key: n.postId,
|
|
1518
1514
|
active: r === g.value && !x.value,
|
|
1519
1515
|
"advance-on-media-end": l.reelAutoAdvance.enabled && r === g.value,
|
|
@@ -1522,7 +1518,7 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1522
1518
|
"fetch-priority": e,
|
|
1523
1519
|
index: r,
|
|
1524
1520
|
item: n,
|
|
1525
|
-
"item-style":
|
|
1521
|
+
"item-style": ne(r),
|
|
1526
1522
|
"media-card": t.mediaCard,
|
|
1527
1523
|
layout: "reel",
|
|
1528
1524
|
"loaded-count": t.items.length,
|
|
@@ -1559,12 +1555,12 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1559
1555
|
class: "reel-forward-status",
|
|
1560
1556
|
role: t.reelForward.status === "error" ? "alert" : "status",
|
|
1561
1557
|
"data-status": t.reelForward.status
|
|
1562
|
-
}, [c("p", null, T(
|
|
1558
|
+
}, [c("p", null, T(te.value), 1), t.reelForward.status === "error" || t.reelForward.status === "end" ? (b(), s("button", {
|
|
1563
1559
|
key: 0,
|
|
1564
1560
|
class: "reel-forward-retry",
|
|
1565
1561
|
type: "button",
|
|
1566
1562
|
onClick: r[0] ||= (e) => u("retryForward")
|
|
1567
|
-
}, " Retry ")) : o("", !0)], 8,
|
|
1563
|
+
}, " Retry ")) : o("", !0)], 8, gt)), t.reelForward.status === "idle" ? (b(), a(U, {
|
|
1568
1564
|
key: 2,
|
|
1569
1565
|
actions: t.feedFooterActions,
|
|
1570
1566
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -1573,7 +1569,7 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1573
1569
|
"has-next": t.hasNext,
|
|
1574
1570
|
"is-loading": t.isLoadingMore,
|
|
1575
1571
|
"load-more-locked": t.loadMoreLocked,
|
|
1576
|
-
"show-load-more":
|
|
1572
|
+
"show-load-more": q.value,
|
|
1577
1573
|
state: t.state,
|
|
1578
1574
|
onLoadMore: r[1] ||= (e) => u("loadMore"),
|
|
1579
1575
|
onRetryEnd: r[2] ||= (e) => u("retryEnd")
|
|
@@ -1587,13 +1583,13 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1587
1583
|
"load-more-locked",
|
|
1588
1584
|
"show-load-more",
|
|
1589
1585
|
"state"
|
|
1590
|
-
])) : o("", !0)], 40,
|
|
1586
|
+
])) : o("", !0)], 40, ht), c("div", {
|
|
1591
1587
|
ref_key: "reelControlsElement",
|
|
1592
1588
|
ref: f,
|
|
1593
1589
|
class: "reel-media-controls-host",
|
|
1594
1590
|
"data-test": "reel-media-controls-host"
|
|
1595
1591
|
}, null, 512)]),
|
|
1596
|
-
t.cardFooter && R.value && t.reelForward.status === "idle" ? (b(), a(
|
|
1592
|
+
t.cardFooter && R.value && t.reelForward.status === "idle" ? (b(), a(Ae, {
|
|
1597
1593
|
key: 1,
|
|
1598
1594
|
index: g.value,
|
|
1599
1595
|
item: R.value,
|
|
@@ -1615,24 +1611,24 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1615
1611
|
"style",
|
|
1616
1612
|
"total"
|
|
1617
1613
|
])) : o("", !0),
|
|
1618
|
-
|
|
1619
|
-
key:
|
|
1614
|
+
ee.value ? (b(), a(pt, {
|
|
1615
|
+
key: W.value,
|
|
1620
1616
|
"duration-ms": t.reelAutoAdvance.intervalMs,
|
|
1621
|
-
label:
|
|
1617
|
+
label: G.value,
|
|
1622
1618
|
onComplete: he
|
|
1623
1619
|
}, null, 8, ["duration-ms", "label"])) : o("", !0)
|
|
1624
1620
|
], 2));
|
|
1625
1621
|
}
|
|
1626
|
-
}),
|
|
1622
|
+
}), bt = ["data-info-sheet-open", "data-info-sheet-mode"], xt = ["aria-hidden", "inert"], St = {
|
|
1627
1623
|
key: 0,
|
|
1628
1624
|
class: "reel-info-sheet-layer",
|
|
1629
1625
|
"data-test": "reel-info-sheet"
|
|
1630
|
-
},
|
|
1626
|
+
}, Ct = [
|
|
1631
1627
|
"role",
|
|
1632
1628
|
"aria-modal",
|
|
1633
1629
|
"tabindex",
|
|
1634
1630
|
"data-active-post-id"
|
|
1635
|
-
],
|
|
1631
|
+
], wt = /* @__PURE__ */ d({
|
|
1636
1632
|
__name: "ReelLayout",
|
|
1637
1633
|
props: {
|
|
1638
1634
|
forwardIndex: { default: null },
|
|
@@ -1725,7 +1721,7 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1725
1721
|
function H(e, t) {
|
|
1726
1722
|
d("mediaChange", e, t);
|
|
1727
1723
|
}
|
|
1728
|
-
function
|
|
1724
|
+
function U(e, t) {
|
|
1729
1725
|
d("ready", e, t);
|
|
1730
1726
|
}
|
|
1731
1727
|
return O(() => ({
|
|
@@ -1757,7 +1753,7 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1757
1753
|
class: "reel-layout-main",
|
|
1758
1754
|
"aria-hidden": e.infoSheetOverlay && A.value || void 0,
|
|
1759
1755
|
inert: e.infoSheetOverlay && A.value || void 0
|
|
1760
|
-
}, [u(
|
|
1756
|
+
}, [u(yt, {
|
|
1761
1757
|
ref_key: "reelFeed",
|
|
1762
1758
|
ref: p,
|
|
1763
1759
|
"can-retry-end": e.canRetryEnd,
|
|
@@ -1784,7 +1780,7 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1784
1780
|
onError: V,
|
|
1785
1781
|
onLoadMore: r[1] ||= (e) => d("loadMore"),
|
|
1786
1782
|
onMediaChange: H,
|
|
1787
|
-
onReady:
|
|
1783
|
+
onReady: U,
|
|
1788
1784
|
onRetryEnd: r[2] ||= (e) => d("retryEnd"),
|
|
1789
1785
|
onRetryForward: r[3] ||= (e) => d("retryForward")
|
|
1790
1786
|
}, null, 8, [
|
|
@@ -1808,8 +1804,8 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1808
1804
|
"reel-forward",
|
|
1809
1805
|
"state",
|
|
1810
1806
|
"total"
|
|
1811
|
-
])], 8,
|
|
1812
|
-
default: k(() => [A.value && e.infoSheet && j.value ? (b(), s("div",
|
|
1807
|
+
])], 8, xt), u(n, { name: "vibe-info-sheet" }, {
|
|
1808
|
+
default: k(() => [A.value && e.infoSheet && j.value ? (b(), s("div", St, [c("aside", {
|
|
1813
1809
|
ref_key: "sheetElement",
|
|
1814
1810
|
ref: _,
|
|
1815
1811
|
class: "reel-info-sheet",
|
|
@@ -1818,20 +1814,109 @@ var mt = ["aria-label"], ht = /* @__PURE__ */ d({
|
|
|
1818
1814
|
"aria-modal": e.infoSheetOverlay ? "true" : void 0,
|
|
1819
1815
|
tabindex: e.infoSheetOverlay ? -1 : void 0,
|
|
1820
1816
|
"data-active-post-id": T.value?.postId
|
|
1821
|
-
}, [(b(), a(C(e.infoSheet.component), g(f(j.value)), null, 16))], 8,
|
|
1817
|
+
}, [(b(), a(C(e.infoSheet.component), g(f(j.value)), null, 16))], 8, Ct)])) : o("", !0)]),
|
|
1822
1818
|
_: 1
|
|
1823
|
-
})], 10,
|
|
1819
|
+
})], 10, bt));
|
|
1824
1820
|
}
|
|
1825
|
-
})
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1821
|
+
});
|
|
1822
|
+
//#endregion
|
|
1823
|
+
//#region src/core/mediaLifecycle.ts
|
|
1824
|
+
function Tt(e, t, n, r, i) {
|
|
1825
|
+
let a = e.items.findIndex((e) => e.postId === t), o = e.items[a];
|
|
1826
|
+
if (!o) return null;
|
|
1827
|
+
let s = N(o, n), c = P(o, s);
|
|
1828
|
+
return {
|
|
1829
|
+
item: o,
|
|
1830
|
+
layout: r,
|
|
1831
|
+
media: c,
|
|
1832
|
+
mediaId: c.mediaId ?? null,
|
|
1833
|
+
mediaIndex: s,
|
|
1834
|
+
origin: i,
|
|
1835
|
+
phoneMode: e.phoneMode,
|
|
1836
|
+
postId: o.postId,
|
|
1837
|
+
postIndex: a
|
|
1830
1838
|
};
|
|
1831
1839
|
}
|
|
1840
|
+
function Et(e, t) {
|
|
1841
|
+
O(() => {
|
|
1842
|
+
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null;
|
|
1843
|
+
return {
|
|
1844
|
+
mediaIndex: t === null ? 0 : e.mediaIndices.get(t) ?? 0,
|
|
1845
|
+
origin: e.reelOrigin ?? "reel",
|
|
1846
|
+
postId: t
|
|
1847
|
+
};
|
|
1848
|
+
}, (n, r) => {
|
|
1849
|
+
if (n.postId === null || n.postId === r?.postId && n.mediaIndex === r.mediaIndex && n.origin === r.origin) return;
|
|
1850
|
+
let i = Tt(e, n.postId, n.mediaIndex, "reel", n.origin);
|
|
1851
|
+
i && t(i);
|
|
1852
|
+
}, { flush: "sync" });
|
|
1853
|
+
}
|
|
1854
|
+
//#endregion
|
|
1855
|
+
//#region src/components/useMediaLifecycle.ts
|
|
1856
|
+
function Dt(e, t) {
|
|
1857
|
+
let n = w(/* @__PURE__ */ new Map()), i = w(/* @__PURE__ */ new Map()), a = r(() => e.reelMediaSource === "original" ? i.value : n.value);
|
|
1858
|
+
function o(e, t, n, r) {
|
|
1859
|
+
let i = F(t, n);
|
|
1860
|
+
e.value.get(i) !== r && (e.value = new Map(e.value).set(i, r));
|
|
1861
|
+
}
|
|
1862
|
+
function s(t, n, r, i) {
|
|
1863
|
+
return Tt(e, t, n, r, i);
|
|
1864
|
+
}
|
|
1865
|
+
function c(e, n, r, i) {
|
|
1866
|
+
let a = s(e, n, r, i);
|
|
1867
|
+
a && t.ready(a);
|
|
1868
|
+
}
|
|
1869
|
+
function l(e, t) {
|
|
1870
|
+
o(n, e, t, "error");
|
|
1871
|
+
}
|
|
1872
|
+
function u(e, t) {
|
|
1873
|
+
o(n, e, t, "ready"), c(e, t, "masonry", null);
|
|
1874
|
+
}
|
|
1875
|
+
function d(t, r) {
|
|
1876
|
+
o(e.reelMediaSource === "original" ? i : n, t, r, "error");
|
|
1877
|
+
}
|
|
1878
|
+
function f(t, r) {
|
|
1879
|
+
o(e.reelMediaSource === "original" ? i : n, t, r, "ready"), c(t, r, "reel", e.reelOrigin ?? "reel");
|
|
1880
|
+
}
|
|
1881
|
+
function p(e, n) {
|
|
1882
|
+
let r = s(e, n, "masonry", null);
|
|
1883
|
+
r && t.visible(r);
|
|
1884
|
+
}
|
|
1885
|
+
return Et(e, t.reelChange), O(() => {
|
|
1886
|
+
let t = e.layout === "reel" || e.reelOrigin === "masonry" ? e.activeReelPostId : null, n = t === null ? 0 : e.mediaIndices.get(t) ?? 0;
|
|
1887
|
+
return {
|
|
1888
|
+
mediaIndex: n,
|
|
1889
|
+
origin: e.reelOrigin ?? "reel",
|
|
1890
|
+
postId: t,
|
|
1891
|
+
ready: t !== null && a.value.get(F(t, n)) === "ready"
|
|
1892
|
+
};
|
|
1893
|
+
}, (e, n) => {
|
|
1894
|
+
if (e.postId === null || !e.ready || n?.ready && n.postId === e.postId && n.mediaIndex === e.mediaIndex && n.origin === e.origin) return;
|
|
1895
|
+
let r = s(e.postId, e.mediaIndex, "reel", e.origin);
|
|
1896
|
+
r && t.visible(r);
|
|
1897
|
+
}, { flush: "post" }), {
|
|
1898
|
+
markMasonryVisible: p,
|
|
1899
|
+
markPreviewError: l,
|
|
1900
|
+
markPreviewReady: u,
|
|
1901
|
+
markReelError: d,
|
|
1902
|
+
markReelReady: f,
|
|
1903
|
+
originalStates: i,
|
|
1904
|
+
previewStates: n,
|
|
1905
|
+
reelStates: a
|
|
1906
|
+
};
|
|
1907
|
+
}
|
|
1908
|
+
//#endregion
|
|
1909
|
+
//#region src/core/reelEscapeStack.ts
|
|
1910
|
+
var Ot = [];
|
|
1832
1911
|
function kt(e) {
|
|
1912
|
+
return Ot.push(e), () => {
|
|
1913
|
+
let t = Ot.indexOf(e);
|
|
1914
|
+
t >= 0 && Ot.splice(t, 1);
|
|
1915
|
+
};
|
|
1916
|
+
}
|
|
1917
|
+
function At(e) {
|
|
1833
1918
|
if (!e.isActive()) return !1;
|
|
1834
|
-
let t =
|
|
1919
|
+
let t = Ot.filter((e) => e.isActive()), n = e.element();
|
|
1835
1920
|
return n !== null && t.some((t) => {
|
|
1836
1921
|
if (t === e) return !1;
|
|
1837
1922
|
let r = t.element();
|
|
@@ -1847,14 +1932,14 @@ function kt(e) {
|
|
|
1847
1932
|
}
|
|
1848
1933
|
//#endregion
|
|
1849
1934
|
//#region src/components/useReelKeyboard.ts
|
|
1850
|
-
function
|
|
1935
|
+
function jt(e) {
|
|
1851
1936
|
let t = {
|
|
1852
1937
|
element: e.element,
|
|
1853
1938
|
isActive: () => e.state.layout === "reel" || e.state.reelOrigin === "masonry"
|
|
1854
1939
|
}, n = null;
|
|
1855
1940
|
function r(n) {
|
|
1856
1941
|
let r = t.isActive();
|
|
1857
|
-
if (n.key === "Escape" && r && !
|
|
1942
|
+
if (n.key === "Escape" && r && !At(t)) return;
|
|
1858
1943
|
if (n.key === "Escape" && e.state.reelOrigin === "masonry") {
|
|
1859
1944
|
n.preventDefault(), e.state.reelInfoSheetOverlay && e.state.reelInfoSheet.enabled && e.setReelInfoSheet(!1), e.closeMasonryReel();
|
|
1860
1945
|
return;
|
|
@@ -1874,14 +1959,14 @@ function At(e) {
|
|
|
1874
1959
|
a !== 0 && e.reelRenderer()?.changeActiveMedia?.(a) && n.preventDefault();
|
|
1875
1960
|
}
|
|
1876
1961
|
y(() => {
|
|
1877
|
-
n =
|
|
1962
|
+
n = kt(t), window.addEventListener("keydown", r);
|
|
1878
1963
|
}), v(() => {
|
|
1879
1964
|
window.removeEventListener("keydown", r), n?.(), n = null;
|
|
1880
1965
|
});
|
|
1881
1966
|
}
|
|
1882
1967
|
//#endregion
|
|
1883
1968
|
//#region src/components/VibeSurface.vue?vue&type=script&setup=true&lang.ts
|
|
1884
|
-
var
|
|
1969
|
+
var Mt = 35, Nt = 420, Pt = /* @__PURE__ */ d({
|
|
1885
1970
|
__name: "VibeSurface",
|
|
1886
1971
|
props: {
|
|
1887
1972
|
canRetryEnd: { type: Boolean },
|
|
@@ -1898,6 +1983,7 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
1898
1983
|
"closeReel",
|
|
1899
1984
|
"loadMore",
|
|
1900
1985
|
"mediaReady",
|
|
1986
|
+
"mediaVisible",
|
|
1901
1987
|
"openReel",
|
|
1902
1988
|
"reelMediaChange",
|
|
1903
1989
|
"reelInfoSheetChange",
|
|
@@ -1905,97 +1991,70 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
1905
1991
|
"retryForward"
|
|
1906
1992
|
],
|
|
1907
1993
|
setup(t, { expose: i, emit: c }) {
|
|
1908
|
-
let l = t, d = c, f = w(null), p = w(null), h = w(null), g = w(null), y = w({}), x = w(!1), S = w(/* @__PURE__ */ new Set()), C = w(/* @__PURE__ */ new Map()), T = w(/* @__PURE__ */ new Set()),
|
|
1909
|
-
|
|
1994
|
+
let l = t, d = c, f = w(null), p = w(null), h = w(null), g = w(null), y = w({}), x = w(!1), S = w(/* @__PURE__ */ new Set()), C = w(/* @__PURE__ */ new Map()), T = w(/* @__PURE__ */ new Set()), D = w(/* @__PURE__ */ new Map()), A = r(() => I(l.state)), { markMasonryVisible: j, markPreviewError: P, markPreviewReady: F, markReelError: L, markReelReady: R, originalStates: z, previewStates: B, reelStates: V } = Dt(l.state, {
|
|
1995
|
+
ready: (e) => d("mediaReady", e),
|
|
1996
|
+
reelChange: (e) => d("reelMediaChange", e),
|
|
1997
|
+
visible: (e) => d("mediaVisible", e)
|
|
1998
|
+
}), H = new Set(l.state.items.map((e) => e.postId)), U = null, W = null, G = !1;
|
|
1999
|
+
function K() {
|
|
1910
2000
|
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1911
2001
|
}
|
|
1912
|
-
function
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
2002
|
+
function q() {
|
|
2003
|
+
U !== null && cancelAnimationFrame(U), U = requestAnimationFrame(() => {
|
|
2004
|
+
U = requestAnimationFrame(() => {
|
|
2005
|
+
U = null, S.value = /* @__PURE__ */ new Set();
|
|
1916
2006
|
});
|
|
1917
2007
|
});
|
|
1918
2008
|
}
|
|
1919
|
-
function
|
|
1920
|
-
let r = F(e, t);
|
|
1921
|
-
D.value.get(r) !== n && (D.value = new Map(D.value).set(r, n));
|
|
1922
|
-
}
|
|
1923
|
-
function re(e, t, n) {
|
|
1924
|
-
let r = F(e, t);
|
|
1925
|
-
A.value.get(r) !== n && (A.value = new Map(A.value).set(r, n));
|
|
1926
|
-
}
|
|
1927
|
-
function ie(e, t) {
|
|
1928
|
-
ne(e, t, "error");
|
|
1929
|
-
}
|
|
1930
|
-
function ae(e, t) {
|
|
1931
|
-
ne(e, t, "ready"), G(e, t, "masonry", null);
|
|
1932
|
-
}
|
|
1933
|
-
function W(e, t) {
|
|
1934
|
-
re(e, t, "error");
|
|
1935
|
-
}
|
|
1936
|
-
function oe(e, t) {
|
|
1937
|
-
if (l.state.reelMediaSource === "original") {
|
|
1938
|
-
W(e, t);
|
|
1939
|
-
return;
|
|
1940
|
-
}
|
|
1941
|
-
ie(e, t);
|
|
1942
|
-
}
|
|
1943
|
-
function se(e, t) {
|
|
1944
|
-
l.state.reelMediaSource === "original" ? re(e, t, "ready") : ne(e, t, "ready"), G(e, t, "reel", l.state.reelOrigin ?? "reel");
|
|
1945
|
-
}
|
|
1946
|
-
function G(e, t, n, r) {
|
|
1947
|
-
let i = I(l.state, e, t, n, r);
|
|
1948
|
-
i && d("mediaReady", i);
|
|
1949
|
-
}
|
|
1950
|
-
function K(e, t) {
|
|
2009
|
+
function te(e, t) {
|
|
1951
2010
|
let n = l.state.items.find((t) => t.postId === e);
|
|
1952
2011
|
if (!n) return;
|
|
1953
2012
|
let r = N(n, t);
|
|
1954
2013
|
(l.state.mediaIndices.get(e) ?? 0) !== r && (l.state.mediaIndices = new Map(l.state.mediaIndices).set(e, r));
|
|
1955
2014
|
}
|
|
1956
|
-
async function
|
|
2015
|
+
async function ne() {
|
|
1957
2016
|
await m(), (l.state.layout === "reel" || l.state.reelOrigin === "masonry" ? p.value : f.value)?.loadIfNearBottom();
|
|
1958
2017
|
}
|
|
1959
|
-
function
|
|
2018
|
+
function re(e) {
|
|
1960
2019
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.changeActiveMedia?.(e) ?? !1;
|
|
1961
2020
|
}
|
|
1962
|
-
function
|
|
2021
|
+
function ie(e) {
|
|
1963
2022
|
return l.state.isLoading || l.state.items.length === 0 || l.state.layout !== "reel" && l.state.reelOrigin !== "masonry" ? !1 : p.value?.moveActivePost?.(e) ?? !1;
|
|
1964
2023
|
}
|
|
1965
|
-
function
|
|
2024
|
+
function ae(e) {
|
|
1966
2025
|
if (!(l.state.layout === "reel" || l.state.reelOrigin === "masonry") || l.state.isLoading) return "reel-inactive";
|
|
1967
2026
|
let t = l.state.items.find((t) => t.postId === e.postId);
|
|
1968
2027
|
if (!t) return "not-found";
|
|
1969
2028
|
let n = M(t).findIndex((t) => t.mediaId === e.mediaId);
|
|
1970
2029
|
return n < 0 ? "not-found" : p.value?.navigateToItem?.(e.postId, n) ? "navigated" : "reel-inactive";
|
|
1971
2030
|
}
|
|
1972
|
-
function
|
|
2031
|
+
function oe() {
|
|
1973
2032
|
return l.state.layout !== "masonry" || l.state.reelOrigin === "masonry" ? null : f.value?.getScrollElement?.() ?? null;
|
|
1974
2033
|
}
|
|
1975
|
-
function
|
|
1976
|
-
|
|
2034
|
+
function se(e, t) {
|
|
2035
|
+
W = e, G = t === "keyboard", y.value = le(e), d("openReel", e), m(() => h.value?.focus());
|
|
1977
2036
|
}
|
|
1978
|
-
function
|
|
2037
|
+
function J(e) {
|
|
1979
2038
|
let t = g.value?.querySelectorAll(".masonry-feed [data-post-id]") ?? [];
|
|
1980
2039
|
return Array.from(t).find((t) => t.dataset.postId === String(e)) ?? null;
|
|
1981
2040
|
}
|
|
1982
|
-
function
|
|
1983
|
-
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null ||
|
|
1984
|
-
let t = [...new Set(e)], n = t.filter(
|
|
2041
|
+
function ce(e) {
|
|
2042
|
+
if (l.state.layout !== "masonry" || l.state.reelOrigin !== null || K()) return 0;
|
|
2043
|
+
let t = [...new Set(e)], n = t.filter(J);
|
|
1985
2044
|
if (n.length === 0) return 0;
|
|
1986
|
-
let r = new Map(
|
|
2045
|
+
let r = new Map(D.value);
|
|
1987
2046
|
return n.forEach((e, t) => {
|
|
1988
|
-
r.set(e, t *
|
|
1989
|
-
}), S.value = new Set([...S.value].filter((e) => !n.includes(e))), T.value = new Set([...T.value, ...t]),
|
|
2047
|
+
r.set(e, t * Mt);
|
|
2048
|
+
}), S.value = new Set([...S.value].filter((e) => !n.includes(e))), T.value = new Set([...T.value, ...t]), D.value = r, Nt + (n.length - 1) * Mt;
|
|
1990
2049
|
}
|
|
1991
2050
|
function Y(e, t) {
|
|
1992
|
-
let n =
|
|
2051
|
+
let n = J(e), r = n?.querySelector(".media-card-activator") ?? n;
|
|
1993
2052
|
r && (r.classList.toggle("media-card-focus-silent", !t), t || r.addEventListener("blur", () => {
|
|
1994
2053
|
r.classList.remove("media-card-focus-silent");
|
|
1995
2054
|
}, { once: !0 }), r?.focus({ preventScroll: !0 }));
|
|
1996
2055
|
}
|
|
1997
|
-
function
|
|
1998
|
-
let t = g.value, n =
|
|
2056
|
+
function le(e) {
|
|
2057
|
+
let t = g.value, n = J(e);
|
|
1999
2058
|
if (t === null || n === null) return {};
|
|
2000
2059
|
let r = t.getBoundingClientRect(), i = n.getBoundingClientRect();
|
|
2001
2060
|
return {
|
|
@@ -2005,48 +2064,48 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
2005
2064
|
"--vibe-reel-origin-left": `${Math.max(0, i.left - r.left)}px`
|
|
2006
2065
|
};
|
|
2007
2066
|
}
|
|
2008
|
-
function
|
|
2009
|
-
l.state.reelOrigin === "masonry" && (
|
|
2067
|
+
function ue() {
|
|
2068
|
+
l.state.reelOrigin === "masonry" && (W ??= l.state.activeReelPostId, x.value = !0, d("closeReel"));
|
|
2010
2069
|
}
|
|
2011
|
-
function
|
|
2012
|
-
let e =
|
|
2013
|
-
x.value = !1,
|
|
2070
|
+
function de() {
|
|
2071
|
+
let e = W, t = G;
|
|
2072
|
+
x.value = !1, W = null, G = !1, y.value = {}, m(() => {
|
|
2014
2073
|
e !== null && Y(e, t);
|
|
2015
2074
|
});
|
|
2016
2075
|
}
|
|
2017
|
-
return
|
|
2018
|
-
closeMasonryReel:
|
|
2076
|
+
return jt({
|
|
2077
|
+
closeMasonryReel: ue,
|
|
2019
2078
|
element: () => g.value,
|
|
2020
2079
|
isReelLeaving: () => x.value,
|
|
2021
2080
|
reelRenderer: () => p.value,
|
|
2022
2081
|
setReelInfoSheet: (e) => d("reelInfoSheetChange", e),
|
|
2023
2082
|
state: l.state
|
|
2024
|
-
}),
|
|
2025
|
-
let t = e.filter((e) => !
|
|
2026
|
-
if (
|
|
2083
|
+
}), O(() => l.state.items.map((e) => e.postId), (e) => {
|
|
2084
|
+
let t = e.filter((e) => !H.has(e)), n = new Set(e);
|
|
2085
|
+
if (H = new Set(e), T.value = new Set([...T.value].filter((e) => n.has(e))), D.value = new Map([...D.value].filter(([e]) => n.has(e))), t.length === 0 || K()) return;
|
|
2027
2086
|
let r = /* @__PURE__ */ new Map();
|
|
2028
2087
|
e.forEach((e) => {
|
|
2029
2088
|
let t = C.value.get(e);
|
|
2030
2089
|
t !== void 0 && r.set(e, t);
|
|
2031
2090
|
}), t.forEach((e, t) => {
|
|
2032
|
-
r.set(e, t *
|
|
2033
|
-
}), C.value = r, S.value = new Set([...S.value, ...t]),
|
|
2091
|
+
r.set(e, t * Mt);
|
|
2092
|
+
}), C.value = r, S.value = new Set([...S.value, ...t]), q();
|
|
2034
2093
|
}, { flush: "sync" }), v(() => {
|
|
2035
|
-
|
|
2094
|
+
U !== null && cancelAnimationFrame(U);
|
|
2036
2095
|
}), i({
|
|
2037
|
-
changeActiveReelMedia:
|
|
2038
|
-
getAutoScrollElement:
|
|
2039
|
-
loadIfNearBottom:
|
|
2040
|
-
moveActiveReelPost:
|
|
2041
|
-
navigateToReelItem:
|
|
2042
|
-
startItemRemoval:
|
|
2096
|
+
changeActiveReelMedia: re,
|
|
2097
|
+
getAutoScrollElement: oe,
|
|
2098
|
+
loadIfNearBottom: ne,
|
|
2099
|
+
moveActiveReelPost: ie,
|
|
2100
|
+
navigateToReelItem: ae,
|
|
2101
|
+
startItemRemoval: ce,
|
|
2043
2102
|
transitionActiveReelMedia: (e) => p.value?.transitionActiveMedia?.(e) ?? Promise.resolve(!1),
|
|
2044
2103
|
transitionActiveReelPost: (e) => p.value?.transitionActivePost?.(e) ?? Promise.resolve(!1)
|
|
2045
2104
|
}), (r, i) => (b(), s("div", {
|
|
2046
2105
|
ref_key: "surfaceElement",
|
|
2047
2106
|
ref: g,
|
|
2048
2107
|
class: "vibe-surface"
|
|
2049
|
-
}, [t.state.layout === "reel" && (t.state.items.length > 0 || t.state.reelForward.status !== "idle") ? (b(), a(
|
|
2108
|
+
}, [t.state.layout === "reel" && (t.state.items.length > 0 || t.state.reelForward.status !== "idle") ? (b(), a(wt, {
|
|
2050
2109
|
key: 0,
|
|
2051
2110
|
ref_key: "reelRenderer",
|
|
2052
2111
|
ref: p,
|
|
@@ -2071,51 +2130,25 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
2071
2130
|
"info-sheet-overlay": t.state.reelInfoSheetOverlay,
|
|
2072
2131
|
"next-page-error": !!t.state.nextPageError,
|
|
2073
2132
|
origin: "reel",
|
|
2074
|
-
"preview-states":
|
|
2133
|
+
"preview-states": E(V),
|
|
2075
2134
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
2076
2135
|
"reel-forward": t.state.reelForward,
|
|
2077
|
-
state:
|
|
2136
|
+
state: A.value,
|
|
2078
2137
|
total: t.state.total,
|
|
2079
2138
|
onActiveChange: i[0] ||= (e) => d("activeReelChange", e),
|
|
2080
2139
|
onCloseInfoSheet: i[1] ||= (e) => d("reelInfoSheetChange", !1),
|
|
2081
|
-
onError:
|
|
2140
|
+
onError: E(L),
|
|
2082
2141
|
onLoadMore: i[2] ||= (e) => d("loadMore"),
|
|
2083
|
-
onMediaChange:
|
|
2084
|
-
onReady:
|
|
2142
|
+
onMediaChange: te,
|
|
2143
|
+
onReady: E(R),
|
|
2085
2144
|
onRetryEnd: i[3] ||= (e) => d("retryEnd"),
|
|
2086
2145
|
onRetryForward: i[4] ||= (e) => d("retryForward")
|
|
2087
|
-
}, null, 8,
|
|
2088
|
-
"can-retry-end",
|
|
2089
|
-
"has-next",
|
|
2090
|
-
"card-footer",
|
|
2091
|
-
"card-header",
|
|
2092
|
-
"feed-footer",
|
|
2093
|
-
"feed-footer-actions",
|
|
2094
|
-
"forward-index",
|
|
2095
|
-
"forward-item",
|
|
2096
|
-
"media-card",
|
|
2097
|
-
"infinite-scroll",
|
|
2098
|
-
"is-loading-more",
|
|
2099
|
-
"items",
|
|
2100
|
-
"load-more-locked",
|
|
2101
|
-
"media-source",
|
|
2102
|
-
"media-indices",
|
|
2103
|
-
"initial-post-id",
|
|
2104
|
-
"info-sheet",
|
|
2105
|
-
"info-sheet-enabled",
|
|
2106
|
-
"info-sheet-overlay",
|
|
2107
|
-
"next-page-error",
|
|
2108
|
-
"preview-states",
|
|
2109
|
-
"reel-auto-advance",
|
|
2110
|
-
"reel-forward",
|
|
2111
|
-
"state",
|
|
2112
|
-
"total"
|
|
2113
|
-
])) : t.state.error || t.state.isLoading || t.state.items.length === 0 && t.state.reelForward.status === "idle" ? (b(), a(U, {
|
|
2146
|
+
}, 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-forward.state.total.onError.onReady".split("."))) : t.state.error || t.state.isLoading || t.state.items.length === 0 && t.state.reelForward.status === "idle" ? (b(), a(ee, {
|
|
2114
2147
|
key: 1,
|
|
2115
2148
|
actions: t.feedFooterActions,
|
|
2116
2149
|
"can-retry-end": t.canRetryEnd,
|
|
2117
2150
|
"feed-footer": t.feedFooter,
|
|
2118
|
-
state:
|
|
2151
|
+
state: A.value,
|
|
2119
2152
|
onLoadMore: i[5] ||= (e) => d("loadMore"),
|
|
2120
2153
|
onRetryEnd: i[6] ||= (e) => d("retryEnd")
|
|
2121
2154
|
}, null, 8, [
|
|
@@ -2123,14 +2156,14 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
2123
2156
|
"can-retry-end",
|
|
2124
2157
|
"feed-footer",
|
|
2125
2158
|
"state"
|
|
2126
|
-
])) : (b(), s(e, { key: 2 }, [u(
|
|
2159
|
+
])) : (b(), s(e, { key: 2 }, [u(lt, {
|
|
2127
2160
|
ref_key: "masonryRenderer",
|
|
2128
2161
|
ref: f,
|
|
2129
2162
|
"can-retry-end": t.canRetryEnd,
|
|
2130
2163
|
"entering-post-ids": S.value,
|
|
2131
2164
|
"entry-delays": C.value,
|
|
2132
2165
|
"leaving-post-ids": T.value,
|
|
2133
|
-
"removal-delays":
|
|
2166
|
+
"removal-delays": D.value,
|
|
2134
2167
|
"card-footer": t.cardFooter,
|
|
2135
2168
|
"card-header": t.cardHeader,
|
|
2136
2169
|
"feed-footer": t.feedFooter,
|
|
@@ -2143,16 +2176,17 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
2143
2176
|
"load-more-locked": t.state.loadMoreLocked,
|
|
2144
2177
|
"media-indices": t.state.mediaIndices,
|
|
2145
2178
|
"next-page-error": !!t.state.nextPageError,
|
|
2146
|
-
"preview-states":
|
|
2179
|
+
"preview-states": E(B),
|
|
2147
2180
|
suspended: t.state.reelOrigin === "masonry" || x.value,
|
|
2148
|
-
state:
|
|
2181
|
+
state: A.value,
|
|
2149
2182
|
total: t.state.total,
|
|
2150
|
-
onActivate:
|
|
2151
|
-
onError:
|
|
2183
|
+
onActivate: se,
|
|
2184
|
+
onError: E(P),
|
|
2152
2185
|
onLoadMore: i[7] ||= (e) => d("loadMore"),
|
|
2153
|
-
onMediaChange:
|
|
2154
|
-
onReady:
|
|
2155
|
-
onRetryEnd: i[8] ||= (e) => d("retryEnd")
|
|
2186
|
+
onMediaChange: te,
|
|
2187
|
+
onReady: E(F),
|
|
2188
|
+
onRetryEnd: i[8] ||= (e) => d("retryEnd"),
|
|
2189
|
+
onVisible: E(j)
|
|
2156
2190
|
}, null, 8, [
|
|
2157
2191
|
"can-retry-end",
|
|
2158
2192
|
"entering-post-ids",
|
|
@@ -2174,10 +2208,13 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
2174
2208
|
"preview-states",
|
|
2175
2209
|
"suspended",
|
|
2176
2210
|
"state",
|
|
2177
|
-
"total"
|
|
2211
|
+
"total",
|
|
2212
|
+
"onError",
|
|
2213
|
+
"onReady",
|
|
2214
|
+
"onVisible"
|
|
2178
2215
|
]), u(n, {
|
|
2179
2216
|
name: "vibe-reel-viewer",
|
|
2180
|
-
onAfterLeave:
|
|
2217
|
+
onAfterLeave: de
|
|
2181
2218
|
}, {
|
|
2182
2219
|
default: k(() => [t.state.reelOrigin === "masonry" ? (b(), s("section", {
|
|
2183
2220
|
key: 0,
|
|
@@ -2189,7 +2226,7 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
2189
2226
|
"aria-modal": "true",
|
|
2190
2227
|
tabindex: "-1",
|
|
2191
2228
|
style: _(y.value)
|
|
2192
|
-
}, [u(
|
|
2229
|
+
}, [u(wt, {
|
|
2193
2230
|
ref_key: "reelRenderer",
|
|
2194
2231
|
ref: p,
|
|
2195
2232
|
"can-retry-end": t.canRetryEnd,
|
|
@@ -2213,52 +2250,27 @@ var jt = 35, Mt = 420, Nt = /* @__PURE__ */ d({
|
|
|
2213
2250
|
"media-source": "original",
|
|
2214
2251
|
"next-page-error": !!t.state.nextPageError,
|
|
2215
2252
|
origin: "masonry",
|
|
2216
|
-
"preview-states":
|
|
2253
|
+
"preview-states": E(z),
|
|
2217
2254
|
"reel-auto-advance": t.state.reelAutoAdvance,
|
|
2218
2255
|
"reel-forward": t.state.reelForward,
|
|
2219
|
-
state:
|
|
2256
|
+
state: A.value,
|
|
2220
2257
|
total: t.state.total,
|
|
2221
2258
|
onActiveChange: i[9] ||= (e) => d("activeReelChange", e),
|
|
2222
2259
|
onCloseInfoSheet: i[10] ||= (e) => d("reelInfoSheetChange", !1),
|
|
2223
|
-
onError:
|
|
2260
|
+
onError: E(L),
|
|
2224
2261
|
onLoadMore: i[11] ||= (e) => d("loadMore"),
|
|
2225
|
-
onMediaChange:
|
|
2226
|
-
onReady:
|
|
2262
|
+
onMediaChange: te,
|
|
2263
|
+
onReady: E(R),
|
|
2227
2264
|
onRetryEnd: i[12] ||= (e) => d("retryEnd"),
|
|
2228
2265
|
onRetryForward: i[13] ||= (e) => d("retryForward")
|
|
2229
|
-
}, null, 8,
|
|
2230
|
-
"can-retry-end",
|
|
2231
|
-
"card-footer",
|
|
2232
|
-
"card-header",
|
|
2233
|
-
"feed-footer",
|
|
2234
|
-
"feed-footer-actions",
|
|
2235
|
-
"forward-index",
|
|
2236
|
-
"forward-item",
|
|
2237
|
-
"media-card",
|
|
2238
|
-
"has-next",
|
|
2239
|
-
"infinite-scroll",
|
|
2240
|
-
"initial-post-id",
|
|
2241
|
-
"info-sheet",
|
|
2242
|
-
"info-sheet-enabled",
|
|
2243
|
-
"info-sheet-overlay",
|
|
2244
|
-
"is-loading-more",
|
|
2245
|
-
"items",
|
|
2246
|
-
"load-more-locked",
|
|
2247
|
-
"media-indices",
|
|
2248
|
-
"next-page-error",
|
|
2249
|
-
"preview-states",
|
|
2250
|
-
"reel-auto-advance",
|
|
2251
|
-
"reel-forward",
|
|
2252
|
-
"state",
|
|
2253
|
-
"total"
|
|
2254
|
-
])], 4)) : o("", !0)]),
|
|
2266
|
+
}, null, 8, /* @__PURE__ */ "can-retry-end.card-footer.card-header.feed-footer.feed-footer-actions.forward-index.forward-item.media-card.has-next.infinite-scroll.initial-post-id.info-sheet.info-sheet-enabled.info-sheet-overlay.is-loading-more.items.load-more-locked.media-indices.next-page-error.preview-states.reel-auto-advance.reel-forward.state.total.onError.onReady".split("."))], 4)) : o("", !0)]),
|
|
2255
2267
|
_: 1
|
|
2256
2268
|
})], 64))], 512));
|
|
2257
2269
|
}
|
|
2258
2270
|
});
|
|
2259
2271
|
//#endregion
|
|
2260
2272
|
//#region src/core/page.ts
|
|
2261
|
-
function
|
|
2273
|
+
function Ft(e) {
|
|
2262
2274
|
if (!e || typeof e != "object" || !Array.isArray(e.items)) throw TypeError("Vibe loadPage must resolve to a page with an items array.");
|
|
2263
2275
|
if (e.next !== null && typeof e.next != "string" && typeof e.next != "number") throw TypeError("Vibe page next must be a string, number, or null.");
|
|
2264
2276
|
if (e.total !== void 0 && (!Number.isFinite(e.total) || e.total < 0)) throw TypeError("Vibe page total must be a non-negative number when provided.");
|
|
@@ -2270,32 +2282,32 @@ function Z(e, t) {
|
|
|
2270
2282
|
}
|
|
2271
2283
|
//#endregion
|
|
2272
2284
|
//#region src/core/requestDelay.ts
|
|
2273
|
-
var
|
|
2285
|
+
var It = 2e3, Lt = 1e4, Rt = 250, zt = {
|
|
2274
2286
|
delayRemainingMs: null,
|
|
2275
2287
|
nextRequestAt: null
|
|
2276
2288
|
};
|
|
2277
|
-
function
|
|
2289
|
+
function Bt(e, t) {
|
|
2278
2290
|
return e === void 0 ? t : Math.floor(e);
|
|
2279
2291
|
}
|
|
2280
|
-
function
|
|
2292
|
+
function Vt(e, t) {
|
|
2281
2293
|
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.`);
|
|
2282
2294
|
}
|
|
2283
|
-
function
|
|
2284
|
-
let n =
|
|
2295
|
+
function Ht(e, t = {}) {
|
|
2296
|
+
let n = Bt(t.delayStepMs, It), r = Bt(t.delayMaxMs, Lt);
|
|
2285
2297
|
return Math.min(Math.max(0, e) * n, r);
|
|
2286
2298
|
}
|
|
2287
2299
|
function Q(e) {
|
|
2288
|
-
if (e == null || !Number.isFinite(e)) return { ...
|
|
2300
|
+
if (e == null || !Number.isFinite(e)) return { ...zt };
|
|
2289
2301
|
let t = Math.max(0, Math.floor(e - Date.now()));
|
|
2290
2302
|
return t > 0 ? {
|
|
2291
2303
|
delayRemainingMs: t,
|
|
2292
2304
|
nextRequestAt: e
|
|
2293
|
-
} : { ...
|
|
2305
|
+
} : { ...zt };
|
|
2294
2306
|
}
|
|
2295
|
-
async function
|
|
2307
|
+
async function Ut({ delayMs: e, onChange: t, signal: n }) {
|
|
2296
2308
|
if (n.aborted) throw new DOMException("Aborted", "AbortError");
|
|
2297
2309
|
if (e <= 0) {
|
|
2298
|
-
t({ ...
|
|
2310
|
+
t({ ...zt });
|
|
2299
2311
|
return;
|
|
2300
2312
|
}
|
|
2301
2313
|
let r = Date.now() + e;
|
|
@@ -2303,9 +2315,9 @@ async function Ht({ delayMs: e, onChange: t, signal: n }) {
|
|
|
2303
2315
|
delayRemainingMs: e,
|
|
2304
2316
|
nextRequestAt: r
|
|
2305
2317
|
}), await new Promise((i, a) => {
|
|
2306
|
-
let o = !1, s = setInterval(f,
|
|
2318
|
+
let o = !1, s = setInterval(f, Rt), c = setTimeout(() => u(), e);
|
|
2307
2319
|
function l() {
|
|
2308
|
-
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...
|
|
2320
|
+
clearInterval(s), clearTimeout(c), n.removeEventListener("abort", d), t({ ...zt });
|
|
2309
2321
|
}
|
|
2310
2322
|
function u(e) {
|
|
2311
2323
|
o || (o = !0, l(), e ? a(e) : i());
|
|
@@ -2320,13 +2332,13 @@ async function Ht({ delayMs: e, onChange: t, signal: n }) {
|
|
|
2320
2332
|
n.addEventListener("abort", d, { once: !0 });
|
|
2321
2333
|
});
|
|
2322
2334
|
}
|
|
2323
|
-
var
|
|
2335
|
+
var Wt = class {
|
|
2324
2336
|
interval = null;
|
|
2325
2337
|
constructor(e) {
|
|
2326
2338
|
this.onChange = e;
|
|
2327
2339
|
}
|
|
2328
2340
|
clear() {
|
|
2329
|
-
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...
|
|
2341
|
+
this.interval !== null && clearInterval(this.interval), this.interval = null, this.onChange({ ...zt });
|
|
2330
2342
|
}
|
|
2331
2343
|
sync(e) {
|
|
2332
2344
|
this.clear();
|
|
@@ -2334,22 +2346,22 @@ var Ut = class {
|
|
|
2334
2346
|
this.onChange(t), t.delayRemainingMs !== null && (this.interval = setInterval(() => {
|
|
2335
2347
|
let t = Q(e);
|
|
2336
2348
|
this.onChange(t), t.delayRemainingMs === null && this.clear();
|
|
2337
|
-
},
|
|
2349
|
+
}, Rt));
|
|
2338
2350
|
}
|
|
2339
2351
|
};
|
|
2340
|
-
function
|
|
2352
|
+
function Gt(e, t = !0) {
|
|
2341
2353
|
return e.maxAdditionalPages === "unlimited" ? Infinity : (e.maxAdditionalPages ?? 10) + (t ? 1 : 0);
|
|
2342
2354
|
}
|
|
2343
|
-
function
|
|
2355
|
+
function Kt(e) {
|
|
2344
2356
|
return `${typeof e}:${String(e)}`;
|
|
2345
2357
|
}
|
|
2346
|
-
function
|
|
2358
|
+
function qt(e, t) {
|
|
2347
2359
|
if (!Number.isInteger(e) || e <= 0) throw TypeError(`Vibe ${t} must be a positive integer.`);
|
|
2348
2360
|
}
|
|
2349
|
-
function
|
|
2361
|
+
function Jt(e) {
|
|
2350
2362
|
if (!e) return;
|
|
2351
|
-
if (
|
|
2352
|
-
|
|
2363
|
+
if (qt(e.pageSize, "autofill pageSize"), e.strategy === "frontend") {
|
|
2364
|
+
Vt(e, "frontend autofill");
|
|
2353
2365
|
let t = e.maxAdditionalPages;
|
|
2354
2366
|
if (t !== void 0 && t !== "unlimited" && (!Number.isInteger(t) || t < 0)) throw TypeError("Vibe autofill maxAdditionalPages must be a non-negative integer or \"unlimited\".");
|
|
2355
2367
|
return;
|
|
@@ -2361,7 +2373,7 @@ function qt(e) {
|
|
|
2361
2373
|
if (t.pageSize !== e.pageSize) throw TypeError("Vibe backend autofill initialSession pageSize must match autofill pageSize.");
|
|
2362
2374
|
}
|
|
2363
2375
|
}
|
|
2364
|
-
function
|
|
2376
|
+
function Yt(e, t, n = !0) {
|
|
2365
2377
|
if (!e) return {
|
|
2366
2378
|
cycleId: null,
|
|
2367
2379
|
delayRemainingMs: null,
|
|
@@ -2395,7 +2407,7 @@ function Jt(e, t, n = !0) {
|
|
|
2395
2407
|
strategy: e.strategy
|
|
2396
2408
|
};
|
|
2397
2409
|
}
|
|
2398
|
-
function
|
|
2410
|
+
function Xt(e) {
|
|
2399
2411
|
return [
|
|
2400
2412
|
"cancelling",
|
|
2401
2413
|
"filling",
|
|
@@ -2403,9 +2415,9 @@ function Yt(e) {
|
|
|
2403
2415
|
"waiting"
|
|
2404
2416
|
].includes(e.status);
|
|
2405
2417
|
}
|
|
2406
|
-
async function
|
|
2418
|
+
async function Zt(e, t, n) {
|
|
2407
2419
|
let r = t.autofill;
|
|
2408
|
-
if (!
|
|
2420
|
+
if (!Xt(r) || !r.cycleId) return;
|
|
2409
2421
|
let i = {
|
|
2410
2422
|
cycleId: r.cycleId,
|
|
2411
2423
|
feedKey: r.feedKey ?? "",
|
|
@@ -2418,76 +2430,92 @@ async function Xt(e, t, n) {
|
|
|
2418
2430
|
throw r.error = e, r.status = "error", e;
|
|
2419
2431
|
}
|
|
2420
2432
|
}
|
|
2421
|
-
function
|
|
2433
|
+
function Qt(e, t, n) {
|
|
2422
2434
|
return e?.strategy === "backend" && t.feedKey === e.feedKey && t.sessionId === n.sessionId;
|
|
2423
2435
|
}
|
|
2424
|
-
async function
|
|
2425
|
-
let
|
|
2426
|
-
for (;
|
|
2427
|
-
let e =
|
|
2428
|
-
if (
|
|
2429
|
-
|
|
2430
|
-
delayMs:
|
|
2436
|
+
async function $t({ 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 }) {
|
|
2437
|
+
let f = [], p = [...e], m = /* @__PURE__ */ new Set(), h = r ?? Gt(s), g = t, _ = t, v = t, y = 0, b = [], x;
|
|
2438
|
+
for (; y < h;) {
|
|
2439
|
+
let e = Kt(g);
|
|
2440
|
+
if (m.has(e)) throw Error("Vibe autofill received a repeated cursor.");
|
|
2441
|
+
if (m.add(e), await Ut({
|
|
2442
|
+
delayMs: Ht(l + y, s),
|
|
2431
2443
|
onChange: a,
|
|
2432
|
-
signal:
|
|
2433
|
-
})
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2444
|
+
signal: d
|
|
2445
|
+
}), y > 0 && u()) return {
|
|
2446
|
+
items: f,
|
|
2447
|
+
lastCursor: _,
|
|
2448
|
+
missing: Math.max(0, s.pageSize - c - f.length),
|
|
2449
|
+
next: v,
|
|
2450
|
+
pages: b,
|
|
2451
|
+
received: c + f.length,
|
|
2452
|
+
requests: l + y,
|
|
2453
|
+
status: "paused",
|
|
2454
|
+
total: x
|
|
2455
|
+
};
|
|
2456
|
+
let t = Ft(await n({
|
|
2457
|
+
cursor: g,
|
|
2458
|
+
signal: d
|
|
2437
2459
|
}));
|
|
2438
|
-
|
|
2439
|
-
let r = Z(
|
|
2440
|
-
|
|
2460
|
+
y += 1, _ = g;
|
|
2461
|
+
let r = Z(p, t.items).slice(p.length);
|
|
2462
|
+
b.push({
|
|
2441
2463
|
contributionIds: r.map(({ postId: e }) => e),
|
|
2442
|
-
cursor:
|
|
2464
|
+
cursor: g,
|
|
2443
2465
|
next: t.next,
|
|
2444
2466
|
returnedIds: t.items.map(({ postId: e }) => e)
|
|
2445
|
-
}),
|
|
2446
|
-
let
|
|
2447
|
-
missing: Math.max(0, s.pageSize - c -
|
|
2448
|
-
next:
|
|
2449
|
-
received: c +
|
|
2450
|
-
requests: l +
|
|
2467
|
+
}), p.push(...r), f.push(...r), v = t.next, t.total !== void 0 && (x = t.total);
|
|
2468
|
+
let h = {
|
|
2469
|
+
missing: Math.max(0, s.pageSize - c - f.length),
|
|
2470
|
+
next: v,
|
|
2471
|
+
received: c + f.length,
|
|
2472
|
+
requests: l + y
|
|
2451
2473
|
};
|
|
2452
|
-
o(
|
|
2453
|
-
let
|
|
2454
|
-
...
|
|
2455
|
-
items: [...
|
|
2456
|
-
lastCursor:
|
|
2457
|
-
|
|
2474
|
+
o(h);
|
|
2475
|
+
let S = {
|
|
2476
|
+
...h,
|
|
2477
|
+
items: [...f],
|
|
2478
|
+
lastCursor: _,
|
|
2479
|
+
pages: [...b],
|
|
2480
|
+
total: x
|
|
2458
2481
|
};
|
|
2459
|
-
if (i(
|
|
2460
|
-
...
|
|
2461
|
-
pages:
|
|
2482
|
+
if (i(S), h.missing === 0) return {
|
|
2483
|
+
...S,
|
|
2484
|
+
pages: b,
|
|
2462
2485
|
status: "complete"
|
|
2463
2486
|
};
|
|
2464
|
-
if (
|
|
2465
|
-
...
|
|
2466
|
-
pages:
|
|
2487
|
+
if (v === null) return {
|
|
2488
|
+
...S,
|
|
2489
|
+
pages: b,
|
|
2467
2490
|
status: "exhausted"
|
|
2468
2491
|
};
|
|
2469
|
-
|
|
2492
|
+
if (u()) return {
|
|
2493
|
+
...S,
|
|
2494
|
+
pages: b,
|
|
2495
|
+
status: "paused"
|
|
2496
|
+
};
|
|
2497
|
+
g = v;
|
|
2470
2498
|
}
|
|
2471
2499
|
return {
|
|
2472
|
-
items:
|
|
2473
|
-
lastCursor:
|
|
2474
|
-
missing: Math.max(0, s.pageSize - c -
|
|
2475
|
-
next:
|
|
2476
|
-
pages:
|
|
2477
|
-
received: c +
|
|
2478
|
-
requests: l +
|
|
2500
|
+
items: f,
|
|
2501
|
+
lastCursor: _,
|
|
2502
|
+
missing: Math.max(0, s.pageSize - c - f.length),
|
|
2503
|
+
next: v,
|
|
2504
|
+
pages: b,
|
|
2505
|
+
received: c + f.length,
|
|
2506
|
+
requests: l + y,
|
|
2479
2507
|
status: "exhausted",
|
|
2480
|
-
total:
|
|
2508
|
+
total: x
|
|
2481
2509
|
};
|
|
2482
2510
|
}
|
|
2483
2511
|
//#endregion
|
|
2484
2512
|
//#region src/core/autofillController.ts
|
|
2485
|
-
var
|
|
2513
|
+
var en = class {
|
|
2486
2514
|
collection = null;
|
|
2487
2515
|
cycle = 0;
|
|
2488
2516
|
delayCountdown;
|
|
2489
2517
|
constructor(e) {
|
|
2490
|
-
this.context = e, this.delayCountdown = new
|
|
2518
|
+
this.context = e, this.delayCountdown = new Wt((t) => Object.assign(e.state.autofill, t)), this.syncCountdown();
|
|
2491
2519
|
}
|
|
2492
2520
|
beginCycle() {
|
|
2493
2521
|
let { options: e, state: t } = this.context;
|
|
@@ -2495,14 +2523,14 @@ var $t = class {
|
|
|
2495
2523
|
this.clear();
|
|
2496
2524
|
let n = `vibe-autofill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
2497
2525
|
return t.autofill = {
|
|
2498
|
-
...
|
|
2526
|
+
...Yt(e, void 0, !1),
|
|
2499
2527
|
cycleId: n,
|
|
2500
2528
|
status: "filling"
|
|
2501
2529
|
}, n;
|
|
2502
2530
|
}
|
|
2503
2531
|
async cancel() {
|
|
2504
2532
|
let { cancelRequest: e, options: t, state: n } = this.context;
|
|
2505
|
-
await
|
|
2533
|
+
await Zt(t, n, e), this.commitCollection();
|
|
2506
2534
|
}
|
|
2507
2535
|
captureCollection(e, t) {
|
|
2508
2536
|
t && (this.collection = e);
|
|
@@ -2524,36 +2552,36 @@ var $t = class {
|
|
|
2524
2552
|
let { onLastCursor: e, options: t, state: n } = this.context;
|
|
2525
2553
|
if (t?.strategy !== "frontend") return;
|
|
2526
2554
|
let r = this.collection;
|
|
2527
|
-
this.collection = null, r && (n.items = Z(n.items, r.items), e(r.lastCursor), n.next = r.next, r.total !== void 0 && (n.total = r.total), Object.assign(n.autofill, {
|
|
2555
|
+
this.collection = null, r && (n.items = Z(n.items, r.items), e(r.lastCursor), this.context.onPages(r.pages), n.next = r.next, r.total !== void 0 && (n.total = r.total), Object.assign(n.autofill, {
|
|
2528
2556
|
missing: r.missing,
|
|
2529
2557
|
received: r.received,
|
|
2530
2558
|
requests: r.requests
|
|
2531
2559
|
}));
|
|
2532
2560
|
}
|
|
2533
|
-
},
|
|
2534
|
-
function
|
|
2561
|
+
}, tn = 100;
|
|
2562
|
+
function nn(e, t) {
|
|
2535
2563
|
if (!Number.isFinite(t) || t <= 0) throw TypeError(`Vibe ${e} must be a positive number.`);
|
|
2536
2564
|
}
|
|
2537
|
-
function
|
|
2565
|
+
function rn(e, t, n) {
|
|
2538
2566
|
return Math.min(n, Math.max(t, e));
|
|
2539
2567
|
}
|
|
2540
|
-
function
|
|
2568
|
+
function an(e) {
|
|
2541
2569
|
if (!e) return;
|
|
2542
2570
|
let t = e.minSpeedPxPerSecond ?? 20, n = e.maxSpeedPxPerSecond ?? 240;
|
|
2543
|
-
if (
|
|
2544
|
-
e.speedPxPerSecond !== void 0 &&
|
|
2571
|
+
if (nn("autoScroll.minSpeedPxPerSecond", t), nn("autoScroll.maxSpeedPxPerSecond", n), t > n) throw TypeError("Vibe autoScroll.minSpeedPxPerSecond cannot exceed maxSpeedPxPerSecond.");
|
|
2572
|
+
e.speedPxPerSecond !== void 0 && nn("autoScroll.speedPxPerSecond", e.speedPxPerSecond);
|
|
2545
2573
|
}
|
|
2546
|
-
function
|
|
2574
|
+
function on(e) {
|
|
2547
2575
|
let t = e?.minSpeedPxPerSecond ?? 20, n = e?.maxSpeedPxPerSecond ?? 240;
|
|
2548
2576
|
return {
|
|
2549
2577
|
enabled: e?.enabled ?? !1,
|
|
2550
2578
|
maxSpeedPxPerSecond: n,
|
|
2551
2579
|
minSpeedPxPerSecond: t,
|
|
2552
2580
|
paused: !1,
|
|
2553
|
-
speedPxPerSecond:
|
|
2581
|
+
speedPxPerSecond: rn(e?.speedPxPerSecond ?? 80, t, n)
|
|
2554
2582
|
};
|
|
2555
2583
|
}
|
|
2556
|
-
var
|
|
2584
|
+
var sn = class {
|
|
2557
2585
|
frame = null;
|
|
2558
2586
|
lastTimestamp = null;
|
|
2559
2587
|
mounted = !1;
|
|
@@ -2573,9 +2601,9 @@ var on = class {
|
|
|
2573
2601
|
this.options.state.enabled && (this.options.state.paused = e, this.lastTimestamp = null, e ? this.cancelFrame() : this.schedule());
|
|
2574
2602
|
}
|
|
2575
2603
|
setSpeed(e) {
|
|
2576
|
-
|
|
2604
|
+
nn("auto-scroll speed", e);
|
|
2577
2605
|
let t = this.options.state;
|
|
2578
|
-
t.speedPxPerSecond =
|
|
2606
|
+
t.speedPxPerSecond = rn(e, t.minSpeedPxPerSecond, t.maxSpeedPxPerSecond);
|
|
2579
2607
|
}
|
|
2580
2608
|
tick = (e) => {
|
|
2581
2609
|
this.frame = null;
|
|
@@ -2587,7 +2615,7 @@ var on = class {
|
|
|
2587
2615
|
return;
|
|
2588
2616
|
}
|
|
2589
2617
|
if (this.lastTimestamp !== null) {
|
|
2590
|
-
let r = Math.min(
|
|
2618
|
+
let r = Math.min(tn, Math.max(0, e - this.lastTimestamp)), i = Math.max(0, n.scrollHeight - n.clientHeight);
|
|
2591
2619
|
n.scrollTop = Math.min(i, n.scrollTop + t.speedPxPerSecond * r / 1e3);
|
|
2592
2620
|
}
|
|
2593
2621
|
this.lastTimestamp = e, this.schedule();
|
|
@@ -2601,7 +2629,7 @@ var on = class {
|
|
|
2601
2629
|
};
|
|
2602
2630
|
//#endregion
|
|
2603
2631
|
//#region src/core/backendAutofill.ts
|
|
2604
|
-
async function
|
|
2632
|
+
async function cn(e, t, n, r) {
|
|
2605
2633
|
let i = await e.onUnderfilled(n);
|
|
2606
2634
|
if (!r()) return;
|
|
2607
2635
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend autofill requires a sessionId.");
|
|
@@ -2615,19 +2643,19 @@ async function sn(e, t, n, r) {
|
|
|
2615
2643
|
status: "waiting"
|
|
2616
2644
|
});
|
|
2617
2645
|
}
|
|
2618
|
-
function
|
|
2646
|
+
function ln(e, t) {
|
|
2619
2647
|
["complete", "exhausted"].includes(t.status) && t.items && (e.items = Z(e.items, t.items)), t.next !== void 0 && (e.next = t.next), t.total !== void 0 && (e.total = t.total);
|
|
2620
2648
|
}
|
|
2621
|
-
function
|
|
2649
|
+
function un(e, t, n) {
|
|
2622
2650
|
let r = t.autofill;
|
|
2623
|
-
return !
|
|
2651
|
+
return !Qt(e, n, r) || n.sequence <= r.sequence || ["cancelled", "cancelling"].includes(r.status) || ["complete", "exhausted"].includes(n.status) && n.next === void 0 ? !1 : (ln(t, n), Object.assign(r, Q(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);
|
|
2624
2652
|
}
|
|
2625
|
-
function
|
|
2626
|
-
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill =
|
|
2653
|
+
function dn(e, t, n) {
|
|
2654
|
+
return e?.strategy !== "backend" || n.feedKey !== e.feedKey || n.pageSize !== e.pageSize ? !1 : (t.autofill = Yt(e, n), ln(t, n), !0);
|
|
2627
2655
|
}
|
|
2628
2656
|
//#endregion
|
|
2629
2657
|
//#region src/core/initialAutofill.ts
|
|
2630
|
-
async function
|
|
2658
|
+
async function fn({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r, onPages: i, options: a, signal: o, state: s }) {
|
|
2631
2659
|
let c = a.autofill;
|
|
2632
2660
|
if (!c) return;
|
|
2633
2661
|
let l = s.items.length;
|
|
@@ -2640,7 +2668,7 @@ async function dn({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
2640
2668
|
return;
|
|
2641
2669
|
}
|
|
2642
2670
|
if (c.strategy === "backend") {
|
|
2643
|
-
await
|
|
2671
|
+
await cn(c, s, {
|
|
2644
2672
|
cycleId: e,
|
|
2645
2673
|
feedKey: c.feedKey,
|
|
2646
2674
|
items: [...s.items],
|
|
@@ -2657,11 +2685,11 @@ async function dn({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
2657
2685
|
s.autofill.status = "exhausted";
|
|
2658
2686
|
return;
|
|
2659
2687
|
}
|
|
2660
|
-
let u = await
|
|
2688
|
+
let u = await $t({
|
|
2661
2689
|
existingItems: s.items,
|
|
2662
2690
|
initialCursor: s.next,
|
|
2663
2691
|
loadPage: a.loadPage,
|
|
2664
|
-
maximumRequests:
|
|
2692
|
+
maximumRequests: Gt(c, !1),
|
|
2665
2693
|
onCollection: n,
|
|
2666
2694
|
onDelayChange: (e) => {
|
|
2667
2695
|
t() && Object.assign(s.autofill, e);
|
|
@@ -2672,6 +2700,7 @@ async function dn({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
2672
2700
|
options: c,
|
|
2673
2701
|
receivedOffset: l,
|
|
2674
2702
|
requestOffset: 1,
|
|
2703
|
+
shouldPause: () => s.loadMoreLocked,
|
|
2675
2704
|
signal: o
|
|
2676
2705
|
});
|
|
2677
2706
|
t() && (s.items = Z(s.items, u.items), s.next = u.next, u.total !== void 0 && (s.total = u.total), r(u.lastCursor), i(u.pages), Object.assign(s.autofill, {
|
|
@@ -2683,13 +2712,13 @@ async function dn({ cycleId: e, isCurrent: t, onCollection: n, onLastCursor: r,
|
|
|
2683
2712
|
}
|
|
2684
2713
|
//#endregion
|
|
2685
2714
|
//#region src/core/fill.ts
|
|
2686
|
-
function
|
|
2715
|
+
function pn(e) {
|
|
2687
2716
|
return "pages" in e ? { pages: e.pages } : { until: "end" };
|
|
2688
2717
|
}
|
|
2689
|
-
function
|
|
2718
|
+
function mn(e) {
|
|
2690
2719
|
return `${typeof e}:${String(e)}`;
|
|
2691
2720
|
}
|
|
2692
|
-
function
|
|
2721
|
+
function hn(e) {
|
|
2693
2722
|
if (!e || typeof e != "object") throw TypeError("Vibe fill target must be an object.");
|
|
2694
2723
|
if ("pages" in e) {
|
|
2695
2724
|
if (!Number.isInteger(e.pages) || e.pages <= 0) throw TypeError("Vibe fill pages must be a positive integer.");
|
|
@@ -2698,20 +2727,20 @@ function mn(e) {
|
|
|
2698
2727
|
if ("until" in e && e.until === "end") return { until: "end" };
|
|
2699
2728
|
throw TypeError("Vibe fill target must be { pages } or { until: 'end' }.");
|
|
2700
2729
|
}
|
|
2701
|
-
function
|
|
2730
|
+
function gn(e) {
|
|
2702
2731
|
if (!e) return;
|
|
2703
2732
|
if (e.strategy === "frontend") {
|
|
2704
|
-
|
|
2733
|
+
Vt(e, "frontend fill");
|
|
2705
2734
|
return;
|
|
2706
2735
|
}
|
|
2707
2736
|
if (!e.feedKey.trim()) throw TypeError("Vibe backend fill requires a feedKey.");
|
|
2708
2737
|
let t = e.initialSession;
|
|
2709
2738
|
if (t) {
|
|
2710
2739
|
if (t.feedKey !== e.feedKey) throw TypeError("Vibe backend fill initialSession feedKey must match fill feedKey.");
|
|
2711
|
-
|
|
2740
|
+
hn(t.target);
|
|
2712
2741
|
}
|
|
2713
2742
|
}
|
|
2714
|
-
function
|
|
2743
|
+
function _n(e, t, n = !0) {
|
|
2715
2744
|
let r = e?.strategy === "backend" && n ? e.initialSession : void 0, i = t ?? r, a = Q(i?.nextRequestAt);
|
|
2716
2745
|
return {
|
|
2717
2746
|
completedPages: i?.completedPages ?? 0,
|
|
@@ -2725,10 +2754,10 @@ function gn(e, t, n = !0) {
|
|
|
2725
2754
|
sessionId: i?.sessionId ?? null,
|
|
2726
2755
|
status: i?.status ?? "idle",
|
|
2727
2756
|
strategy: e?.strategy ?? null,
|
|
2728
|
-
target: i ?
|
|
2757
|
+
target: i ? pn(i.target) : null
|
|
2729
2758
|
};
|
|
2730
2759
|
}
|
|
2731
|
-
function
|
|
2760
|
+
function vn(e) {
|
|
2732
2761
|
return [
|
|
2733
2762
|
"cancelling",
|
|
2734
2763
|
"filling",
|
|
@@ -2736,67 +2765,94 @@ function _n(e) {
|
|
|
2736
2765
|
"waiting"
|
|
2737
2766
|
].includes(e.status);
|
|
2738
2767
|
}
|
|
2739
|
-
async function
|
|
2740
|
-
let
|
|
2741
|
-
for (;
|
|
2742
|
-
let e =
|
|
2743
|
-
if (
|
|
2744
|
-
|
|
2745
|
-
delayMs:
|
|
2746
|
-
onChange:
|
|
2747
|
-
signal:
|
|
2748
|
-
})
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2768
|
+
async function yn({ existingItems: e, initialCursor: t, loadPage: n, onCollection: r = () => void 0, onDelayChange: i, onProgress: a, options: o, shouldPause: s = () => !1, signal: c, target: l }) {
|
|
2769
|
+
let u = [], d = [], f = [...e], p = /* @__PURE__ */ new Set(), m = 0, h = t, g = t, _ = t, v = 0, y;
|
|
2770
|
+
for (; _ !== null;) {
|
|
2771
|
+
let e = mn(h);
|
|
2772
|
+
if (p.has(e)) throw Error("Vibe fill received a repeated cursor.");
|
|
2773
|
+
if (p.add(e), await Ut({
|
|
2774
|
+
delayMs: Ht(m, o),
|
|
2775
|
+
onChange: i,
|
|
2776
|
+
signal: c
|
|
2777
|
+
}), m > 0 && s()) return {
|
|
2778
|
+
completedPages: m,
|
|
2779
|
+
items: u,
|
|
2780
|
+
lastCursor: g,
|
|
2781
|
+
next: _,
|
|
2782
|
+
pages: d,
|
|
2783
|
+
received: v,
|
|
2784
|
+
status: "paused",
|
|
2785
|
+
total: y
|
|
2786
|
+
};
|
|
2787
|
+
let t = Ft(await n({
|
|
2788
|
+
cursor: h,
|
|
2789
|
+
signal: c
|
|
2752
2790
|
}));
|
|
2753
|
-
|
|
2754
|
-
let
|
|
2755
|
-
if (
|
|
2756
|
-
contributionIds:
|
|
2757
|
-
cursor:
|
|
2791
|
+
m += 1, g = h;
|
|
2792
|
+
let b = Z(f, t.items).slice(f.length);
|
|
2793
|
+
if (d.push({
|
|
2794
|
+
contributionIds: b.map(({ postId: e }) => e),
|
|
2795
|
+
cursor: h,
|
|
2758
2796
|
next: t.next,
|
|
2759
2797
|
returnedIds: t.items.map(({ postId: e }) => e)
|
|
2760
|
-
}),
|
|
2761
|
-
completedPages:
|
|
2762
|
-
next:
|
|
2763
|
-
received:
|
|
2764
|
-
}),
|
|
2765
|
-
completedPages:
|
|
2766
|
-
items:
|
|
2767
|
-
lastCursor:
|
|
2768
|
-
next:
|
|
2769
|
-
pages:
|
|
2770
|
-
received:
|
|
2798
|
+
}), f.push(...b), u.push(...b), v = u.length, _ = t.next, t.total !== void 0 && (y = t.total), a({
|
|
2799
|
+
completedPages: m,
|
|
2800
|
+
next: _,
|
|
2801
|
+
received: v
|
|
2802
|
+
}), r({
|
|
2803
|
+
completedPages: m,
|
|
2804
|
+
items: [...u],
|
|
2805
|
+
lastCursor: h,
|
|
2806
|
+
next: _,
|
|
2807
|
+
pages: [...d],
|
|
2808
|
+
received: v,
|
|
2809
|
+
total: y
|
|
2810
|
+
}), "pages" in l && m >= l.pages) return {
|
|
2811
|
+
completedPages: m,
|
|
2812
|
+
items: u,
|
|
2813
|
+
lastCursor: h,
|
|
2814
|
+
next: _,
|
|
2815
|
+
pages: d,
|
|
2816
|
+
received: v,
|
|
2771
2817
|
status: "complete",
|
|
2772
|
-
total:
|
|
2818
|
+
total: y
|
|
2819
|
+
};
|
|
2820
|
+
if (_ === null) return {
|
|
2821
|
+
completedPages: m,
|
|
2822
|
+
items: u,
|
|
2823
|
+
lastCursor: h,
|
|
2824
|
+
next: _,
|
|
2825
|
+
pages: d,
|
|
2826
|
+
received: v,
|
|
2827
|
+
status: "pages" in l ? "exhausted" : "complete",
|
|
2828
|
+
total: y
|
|
2773
2829
|
};
|
|
2774
|
-
if (
|
|
2775
|
-
completedPages:
|
|
2776
|
-
items:
|
|
2777
|
-
lastCursor:
|
|
2778
|
-
next:
|
|
2779
|
-
pages:
|
|
2780
|
-
received:
|
|
2781
|
-
status: "
|
|
2782
|
-
total:
|
|
2830
|
+
if (s()) return {
|
|
2831
|
+
completedPages: m,
|
|
2832
|
+
items: u,
|
|
2833
|
+
lastCursor: h,
|
|
2834
|
+
next: _,
|
|
2835
|
+
pages: d,
|
|
2836
|
+
received: v,
|
|
2837
|
+
status: "paused",
|
|
2838
|
+
total: y
|
|
2783
2839
|
};
|
|
2784
|
-
|
|
2840
|
+
h = _;
|
|
2785
2841
|
}
|
|
2786
2842
|
return {
|
|
2787
|
-
completedPages:
|
|
2788
|
-
items:
|
|
2789
|
-
lastCursor:
|
|
2843
|
+
completedPages: m,
|
|
2844
|
+
items: u,
|
|
2845
|
+
lastCursor: h,
|
|
2790
2846
|
next: null,
|
|
2791
|
-
pages:
|
|
2792
|
-
received:
|
|
2793
|
-
status: "pages" in
|
|
2794
|
-
total:
|
|
2847
|
+
pages: d,
|
|
2848
|
+
received: v,
|
|
2849
|
+
status: "pages" in l ? "exhausted" : "complete",
|
|
2850
|
+
total: y
|
|
2795
2851
|
};
|
|
2796
2852
|
}
|
|
2797
2853
|
//#endregion
|
|
2798
2854
|
//#region src/core/backendFill.ts
|
|
2799
|
-
async function
|
|
2855
|
+
async function bn(e, t, n, r) {
|
|
2800
2856
|
let i = await e.onStart(n);
|
|
2801
2857
|
if (r()) {
|
|
2802
2858
|
if (!i.sessionId.trim()) throw TypeError("Vibe backend fill requires a sessionId.");
|
|
@@ -2810,22 +2866,22 @@ async function yn(e, t, n, r) {
|
|
|
2810
2866
|
});
|
|
2811
2867
|
}
|
|
2812
2868
|
}
|
|
2813
|
-
function
|
|
2869
|
+
function xn(e, t, n) {
|
|
2814
2870
|
return e?.strategy === "backend" && n.feedKey === e.feedKey && n.sessionId === t.fill.sessionId;
|
|
2815
2871
|
}
|
|
2816
|
-
function
|
|
2872
|
+
function Sn(e) {
|
|
2817
2873
|
return Number.isInteger(e.completedPages) && e.completedPages >= 0 && Number.isInteger(e.received) && e.received >= 0 && Number.isInteger(e.sequence) && e.sequence >= 0;
|
|
2818
2874
|
}
|
|
2819
|
-
function
|
|
2875
|
+
function Cn(e, t) {
|
|
2820
2876
|
if (!["complete", "exhausted"].includes(t.status)) return !0;
|
|
2821
2877
|
let n = e.fill.target;
|
|
2822
2878
|
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;
|
|
2823
2879
|
}
|
|
2824
|
-
function
|
|
2880
|
+
function wn(e, t, n) {
|
|
2825
2881
|
t.total !== void 0 && (e.total = t.total), ["complete", "exhausted"].includes(t.status) && (e.items = Z(e.items, t.items ?? []), e.next = t.next ?? null, n(t.lastCursor ?? null));
|
|
2826
2882
|
}
|
|
2827
|
-
function
|
|
2828
|
-
return !
|
|
2883
|
+
function Tn(e, t, n, r) {
|
|
2884
|
+
return !xn(e, t, n) || !Sn(n) || n.sequence <= t.fill.sequence || ["cancelled", "cancelling"].includes(t.fill.status) || !Cn(t, n) ? !1 : (wn(t, n, r), Object.assign(t.fill, {
|
|
2829
2885
|
...Q(n.status === "waiting" ? n.nextRequestAt : null),
|
|
2830
2886
|
completedPages: n.completedPages,
|
|
2831
2887
|
error: n.error ?? null,
|
|
@@ -2834,41 +2890,42 @@ function wn(e, t, n, r) {
|
|
|
2834
2890
|
status: n.status
|
|
2835
2891
|
}), !0);
|
|
2836
2892
|
}
|
|
2837
|
-
function
|
|
2893
|
+
function En(e, t, n, r) {
|
|
2838
2894
|
if (e?.strategy !== "backend" || n.feedKey !== e.feedKey) return !1;
|
|
2839
2895
|
let i = t.fill;
|
|
2840
|
-
return t.fill =
|
|
2896
|
+
return t.fill = _n(e, n), !Sn(n) || !Cn(t, n) ? (t.fill = i, !1) : (wn(t, n, r), !0);
|
|
2841
2897
|
}
|
|
2842
2898
|
//#endregion
|
|
2843
2899
|
//#region src/core/fillController.ts
|
|
2844
|
-
var
|
|
2900
|
+
var Dn = class {
|
|
2845
2901
|
abortController = null;
|
|
2846
2902
|
cycle = 0;
|
|
2847
2903
|
delayCountdown;
|
|
2848
2904
|
requestVersion = 0;
|
|
2905
|
+
collection = null;
|
|
2849
2906
|
constructor(e) {
|
|
2850
|
-
this.options = e, this.delayCountdown = new
|
|
2907
|
+
this.options = e, this.delayCountdown = new Wt((e) => {
|
|
2851
2908
|
Object.assign(this.options.state.fill, e);
|
|
2852
2909
|
}), this.syncBackendCountdown();
|
|
2853
2910
|
}
|
|
2854
2911
|
isActive() {
|
|
2855
|
-
return
|
|
2912
|
+
return vn(this.options.state.fill);
|
|
2856
2913
|
}
|
|
2857
2914
|
applyUpdate(e) {
|
|
2858
|
-
let t =
|
|
2915
|
+
let t = Tn(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
2859
2916
|
return t && this.syncBackendCountdown(), t;
|
|
2860
2917
|
}
|
|
2861
2918
|
restoreSession(e) {
|
|
2862
|
-
let t =
|
|
2919
|
+
let t = En(this.options.fill, this.options.state, e, this.options.onLastCursor);
|
|
2863
2920
|
return t && this.syncBackendCountdown(), t;
|
|
2864
2921
|
}
|
|
2865
2922
|
async start(e) {
|
|
2866
2923
|
let t = this.options.fill;
|
|
2867
2924
|
if (!t) throw Error("Vibe fill is not configured.");
|
|
2868
2925
|
if (this.isActive()) throw Error("Vibe fill is already active.");
|
|
2869
|
-
let n =
|
|
2926
|
+
let n = hn(e), r = `vibe-fill-${Date.now().toString(36)}-${++this.cycle}`;
|
|
2870
2927
|
if (this.options.state.fill = {
|
|
2871
|
-
...
|
|
2928
|
+
..._n(t, void 0, !1),
|
|
2872
2929
|
cycleId: r,
|
|
2873
2930
|
status: "filling",
|
|
2874
2931
|
target: n
|
|
@@ -2879,7 +2936,7 @@ var En = class {
|
|
|
2879
2936
|
let i = ++this.requestVersion, a = new AbortController();
|
|
2880
2937
|
this.abortController = a;
|
|
2881
2938
|
try {
|
|
2882
|
-
t.strategy === "frontend" ? await this.startFrontend(t, n, a, i) : (await
|
|
2939
|
+
t.strategy === "frontend" ? await this.startFrontend(t, n, a, i) : (await bn(t, this.options.state, {
|
|
2883
2940
|
cycleId: r,
|
|
2884
2941
|
feedKey: t.feedKey,
|
|
2885
2942
|
items: [...this.options.state.items],
|
|
@@ -2897,13 +2954,13 @@ var En = class {
|
|
|
2897
2954
|
}
|
|
2898
2955
|
async cancel() {
|
|
2899
2956
|
let { fill: e, state: t } = this.options;
|
|
2900
|
-
if (!
|
|
2957
|
+
if (!vn(t.fill) || !t.fill.cycleId) return;
|
|
2901
2958
|
let n = {
|
|
2902
2959
|
cycleId: t.fill.cycleId,
|
|
2903
2960
|
feedKey: t.fill.feedKey ?? "",
|
|
2904
2961
|
sessionId: t.fill.sessionId
|
|
2905
2962
|
};
|
|
2906
|
-
t.fill.status = "cancelling", this.delayCountdown.clear(), this.abortController?.abort(), this.requestVersion += 1, this.abortController = null, t.isLoadingMore = !1;
|
|
2963
|
+
t.fill.status = "cancelling", this.delayCountdown.clear(), this.abortController?.abort(), this.requestVersion += 1, this.abortController = null, t.isLoadingMore = !1, this.commitCollection();
|
|
2907
2964
|
try {
|
|
2908
2965
|
e?.strategy === "backend" && await e.onCancel(n), t.fill.error = null, t.fill.status = "cancelled";
|
|
2909
2966
|
} catch (e) {
|
|
@@ -2911,7 +2968,7 @@ var En = class {
|
|
|
2911
2968
|
}
|
|
2912
2969
|
}
|
|
2913
2970
|
reset() {
|
|
2914
|
-
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill =
|
|
2971
|
+
this.abortLocalRequest(), this.delayCountdown.clear(), this.options.state.fill = _n(this.options.fill, void 0, !1), this.collection = null;
|
|
2915
2972
|
}
|
|
2916
2973
|
destroy() {
|
|
2917
2974
|
this.abortLocalRequest(), this.delayCountdown.clear();
|
|
@@ -2927,10 +2984,13 @@ var En = class {
|
|
|
2927
2984
|
if (!i) throw Error("Vibe frontend fill requires loadPage.");
|
|
2928
2985
|
let a = this.options.state;
|
|
2929
2986
|
a.isLoadingMore = !0;
|
|
2930
|
-
let o = await
|
|
2987
|
+
let o = await yn({
|
|
2931
2988
|
existingItems: a.items,
|
|
2932
2989
|
initialCursor: a.next,
|
|
2933
2990
|
loadPage: i,
|
|
2991
|
+
onCollection: (e) => {
|
|
2992
|
+
this.isCurrent(r) && (this.collection = e);
|
|
2993
|
+
},
|
|
2934
2994
|
onDelayChange: (e) => {
|
|
2935
2995
|
this.isCurrent(r) && Object.assign(a.fill, e);
|
|
2936
2996
|
},
|
|
@@ -2938,6 +2998,7 @@ var En = class {
|
|
|
2938
2998
|
this.isCurrent(r) && Object.assign(a.fill, e);
|
|
2939
2999
|
},
|
|
2940
3000
|
options: e,
|
|
3001
|
+
shouldPause: () => a.loadMoreLocked,
|
|
2941
3002
|
signal: n.signal,
|
|
2942
3003
|
target: t
|
|
2943
3004
|
});
|
|
@@ -2945,7 +3006,16 @@ var En = class {
|
|
|
2945
3006
|
completedPages: o.completedPages,
|
|
2946
3007
|
received: o.received,
|
|
2947
3008
|
status: o.status
|
|
2948
|
-
}));
|
|
3009
|
+
}), this.collection = null);
|
|
3010
|
+
}
|
|
3011
|
+
commitCollection() {
|
|
3012
|
+
let e = this.collection;
|
|
3013
|
+
if (this.collection = null, !e || this.options.fill?.strategy !== "frontend") return;
|
|
3014
|
+
let t = this.options.state;
|
|
3015
|
+
t.items = Z(t.items, e.items), t.next = e.next, e.total !== void 0 && (t.total = e.total), this.options.onLastCursor(e.lastCursor), this.options.onPages(e.pages), Object.assign(t.fill, {
|
|
3016
|
+
completedPages: e.completedPages,
|
|
3017
|
+
received: e.received
|
|
3018
|
+
});
|
|
2949
3019
|
}
|
|
2950
3020
|
syncBackendCountdown() {
|
|
2951
3021
|
let e = this.options.state.fill;
|
|
@@ -2954,7 +3024,7 @@ var En = class {
|
|
|
2954
3024
|
};
|
|
2955
3025
|
//#endregion
|
|
2956
3026
|
//#region src/core/feedFooter.ts
|
|
2957
|
-
function
|
|
3027
|
+
function On(e) {
|
|
2958
3028
|
return {
|
|
2959
3029
|
cancelAutofill: () => e.cancelAutofill(),
|
|
2960
3030
|
loadMore: () => e.loadNext(),
|
|
@@ -2962,45 +3032,45 @@ function Dn(e) {
|
|
|
2962
3032
|
retryEnd: () => e.retryEnd()
|
|
2963
3033
|
};
|
|
2964
3034
|
}
|
|
2965
|
-
function On(e) {
|
|
2966
|
-
if (!Number.isFinite(e) || e <= 0) throw TypeError("Vibe reelAutoAdvance.intervalMs must be a positive number.");
|
|
2967
|
-
}
|
|
2968
3035
|
function kn(e) {
|
|
2969
|
-
e
|
|
3036
|
+
if (!Number.isFinite(e) || e <= 0) throw TypeError("Vibe reelAutoAdvance.intervalMs must be a positive number.");
|
|
2970
3037
|
}
|
|
2971
3038
|
function An(e) {
|
|
3039
|
+
e?.intervalMs !== void 0 && kn(e.intervalMs);
|
|
3040
|
+
}
|
|
3041
|
+
function jn(e) {
|
|
2972
3042
|
return {
|
|
2973
3043
|
enabled: e?.enabled ?? !1,
|
|
2974
3044
|
includePostItems: e?.includePostItems ?? !1,
|
|
2975
3045
|
intervalMs: e?.intervalMs ?? 5e3
|
|
2976
3046
|
};
|
|
2977
3047
|
}
|
|
2978
|
-
function
|
|
3048
|
+
function Mn(e, t) {
|
|
2979
3049
|
if (typeof t == "boolean") {
|
|
2980
3050
|
e.enabled = t;
|
|
2981
3051
|
return;
|
|
2982
3052
|
}
|
|
2983
|
-
|
|
3053
|
+
An(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);
|
|
2984
3054
|
}
|
|
2985
3055
|
//#endregion
|
|
2986
3056
|
//#region src/core/reelInfoSheet.ts
|
|
2987
|
-
function
|
|
3057
|
+
function Nn(e) {
|
|
2988
3058
|
return { enabled: e?.enabled ?? !1 };
|
|
2989
3059
|
}
|
|
2990
|
-
function
|
|
3060
|
+
function Pn(e, t, n) {
|
|
2991
3061
|
if (n && !t) throw Error("Vibe cannot enable reelInfoSheet without a configured component.");
|
|
2992
3062
|
e.enabled = n;
|
|
2993
3063
|
}
|
|
2994
3064
|
//#endregion
|
|
2995
3065
|
//#region src/core/initialRuntimeState.ts
|
|
2996
|
-
function
|
|
3066
|
+
function Fn(e, t) {
|
|
2997
3067
|
let n = e.initialPage;
|
|
2998
3068
|
return {
|
|
2999
3069
|
activeReelPostId: null,
|
|
3000
|
-
autoScroll:
|
|
3001
|
-
autofill:
|
|
3070
|
+
autoScroll: on(e.autoScroll),
|
|
3071
|
+
autofill: Yt(e.autofill),
|
|
3002
3072
|
error: null,
|
|
3003
|
-
fill:
|
|
3073
|
+
fill: _n(e.fill),
|
|
3004
3074
|
infiniteScroll: e.infiniteScroll ?? !0,
|
|
3005
3075
|
isLoading: !n,
|
|
3006
3076
|
isLoadingMore: !1,
|
|
@@ -3010,14 +3080,15 @@ function Pn(e, t) {
|
|
|
3010
3080
|
mediaIndices: /* @__PURE__ */ new Map(),
|
|
3011
3081
|
next: n?.next ?? null,
|
|
3012
3082
|
nextPageError: null,
|
|
3013
|
-
|
|
3083
|
+
phoneMode: !1,
|
|
3084
|
+
reelAutoAdvance: jn(e.reelAutoAdvance),
|
|
3014
3085
|
reelForward: {
|
|
3015
3086
|
error: null,
|
|
3016
3087
|
status: "idle"
|
|
3017
3088
|
},
|
|
3018
3089
|
reelForwardIndex: null,
|
|
3019
3090
|
reelForwardItem: null,
|
|
3020
|
-
reelInfoSheet:
|
|
3091
|
+
reelInfoSheet: Nn(e.reelInfoSheet),
|
|
3021
3092
|
reelInfoSheetOverlay: !1,
|
|
3022
3093
|
reelMediaSource: "original",
|
|
3023
3094
|
reelOrigin: null,
|
|
@@ -3026,20 +3097,20 @@ function Pn(e, t) {
|
|
|
3026
3097
|
}
|
|
3027
3098
|
//#endregion
|
|
3028
3099
|
//#region src/core/options.ts
|
|
3029
|
-
function
|
|
3100
|
+
function In(e, t) {
|
|
3030
3101
|
if (t) {
|
|
3031
3102
|
if (!Number.isFinite(t.height) || t.height <= 0) throw TypeError(`Vibe ${e} height must be a positive number.`);
|
|
3032
3103
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe ${e} background must be "default" or "transparent".`);
|
|
3033
3104
|
}
|
|
3034
3105
|
}
|
|
3035
|
-
function
|
|
3106
|
+
function Ln(e, t) {
|
|
3036
3107
|
if (t) {
|
|
3037
3108
|
if (t.background !== void 0 && t.background !== "default" && t.background !== "transparent") throw TypeError(`Vibe mediaCard ${e} background must be "default" or "transparent".`);
|
|
3038
3109
|
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.`);
|
|
3039
3110
|
}
|
|
3040
3111
|
}
|
|
3041
|
-
function
|
|
3042
|
-
if (
|
|
3112
|
+
function Rn(e) {
|
|
3113
|
+
if (an(e.autoScroll), In("cardHeader", e.cardHeader), In("cardFooter", e.cardFooter), Ln("header", e.mediaCard?.header), Ln("footer", e.mediaCard?.footer), Jt(e.autofill), gn(e.fill), An(e.reelAutoAdvance), e.removalReconciliation) {
|
|
3043
3114
|
if (!Number.isInteger(e.removalReconciliation.pageSize) || e.removalReconciliation.pageSize <= 0) throw TypeError("Vibe removalReconciliation pageSize must be a positive integer.");
|
|
3044
3115
|
let t = e.removalReconciliation.maxReplayPages ?? 5;
|
|
3045
3116
|
if (!Number.isInteger(t) || t <= 0) throw TypeError("Vibe removalReconciliation maxReplayPages must be a positive integer.");
|
|
@@ -3053,7 +3124,7 @@ function Ln(e) {
|
|
|
3053
3124
|
if (e.fill?.strategy === "frontend" && !e.loadPage) throw TypeError("Vibe frontend fill requires loadPage.");
|
|
3054
3125
|
if (e.fill?.strategy === "backend" && e.fill.initialSession && !e.initialPage) throw TypeError("Vibe backend fill restoration requires initialPage.");
|
|
3055
3126
|
}
|
|
3056
|
-
function
|
|
3127
|
+
function zn(e) {
|
|
3057
3128
|
if (typeof e != "string") return e;
|
|
3058
3129
|
if (typeof document > "u") throw Error("Vibe cannot resolve a selector without a document.");
|
|
3059
3130
|
let t = document.querySelector(e);
|
|
@@ -3062,14 +3133,23 @@ function Rn(e) {
|
|
|
3062
3133
|
}
|
|
3063
3134
|
//#endregion
|
|
3064
3135
|
//#region src/core/pageRequest.ts
|
|
3065
|
-
async function
|
|
3066
|
-
let u = s.autofill, d = u
|
|
3136
|
+
async function Bn({ append: e, autofillController: t, cursor: n, isCurrent: r, loadPage: i, onLastCursor: a, onPages: o, options: s, signal: c, state: l }) {
|
|
3137
|
+
let u = s.autofill, d = e && u?.strategy === "frontend" && l.autofill.status === "paused", f = d ? {
|
|
3138
|
+
received: l.autofill.received,
|
|
3139
|
+
requests: l.autofill.requests
|
|
3140
|
+
} : null, p = u ? d ? l.autofill.cycleId : t.beginCycle() : null;
|
|
3141
|
+
d && Object.assign(l.autofill, {
|
|
3142
|
+
error: null,
|
|
3143
|
+
status: "filling"
|
|
3144
|
+
});
|
|
3145
|
+
let m = !1;
|
|
3067
3146
|
try {
|
|
3068
3147
|
if (u?.strategy === "frontend") {
|
|
3069
|
-
let s = await
|
|
3148
|
+
let s = await $t({
|
|
3070
3149
|
existingItems: e ? l.items : [],
|
|
3071
3150
|
initialCursor: n,
|
|
3072
3151
|
loadPage: i,
|
|
3152
|
+
maximumRequests: f ? Math.max(0, Gt(u) - f.requests) : void 0,
|
|
3073
3153
|
onCollection: (e) => t.captureCollection(e, r()),
|
|
3074
3154
|
onDelayChange: (e) => {
|
|
3075
3155
|
r() && Object.assign(l.autofill, e);
|
|
@@ -3078,6 +3158,9 @@ async function zn({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
3078
3158
|
r() && Object.assign(l.autofill, e, { status: "filling" });
|
|
3079
3159
|
},
|
|
3080
3160
|
options: u,
|
|
3161
|
+
receivedOffset: f?.received,
|
|
3162
|
+
requestOffset: f?.requests,
|
|
3163
|
+
shouldPause: () => l.loadMoreLocked,
|
|
3081
3164
|
signal: c
|
|
3082
3165
|
});
|
|
3083
3166
|
if (!r()) return;
|
|
@@ -3089,41 +3172,41 @@ async function zn({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
3089
3172
|
}), o(s.pages), t.clearCollection();
|
|
3090
3173
|
return;
|
|
3091
3174
|
}
|
|
3092
|
-
let s =
|
|
3175
|
+
let s = Ft(await i({
|
|
3093
3176
|
cursor: n,
|
|
3094
3177
|
signal: c
|
|
3095
3178
|
}));
|
|
3096
3179
|
if (!r()) return;
|
|
3097
|
-
let
|
|
3098
|
-
if (l.items =
|
|
3099
|
-
contributionIds:
|
|
3180
|
+
let d = e ? l.items : [], h = Z(d, s.items), g = h.length - d.length;
|
|
3181
|
+
if (l.items = h, a(n), o([{
|
|
3182
|
+
contributionIds: h.slice(d.length).map(({ postId: e }) => e),
|
|
3100
3183
|
cursor: n,
|
|
3101
3184
|
next: s.next,
|
|
3102
3185
|
returnedIds: s.items.map(({ postId: e }) => e)
|
|
3103
|
-
}]), l.next = s.next, s.total !== void 0 && (l.total = s.total),
|
|
3186
|
+
}]), l.next = s.next, s.total !== void 0 && (l.total = s.total), m = !0, u?.strategy === "backend" && p) {
|
|
3104
3187
|
if (Object.assign(l.autofill, {
|
|
3105
|
-
missing: Math.max(0, u.pageSize -
|
|
3106
|
-
received:
|
|
3188
|
+
missing: Math.max(0, u.pageSize - g),
|
|
3189
|
+
received: g,
|
|
3107
3190
|
requests: 1
|
|
3108
|
-
}),
|
|
3191
|
+
}), g >= u.pageSize) {
|
|
3109
3192
|
l.autofill.status = "complete";
|
|
3110
3193
|
return;
|
|
3111
3194
|
}
|
|
3112
|
-
await
|
|
3113
|
-
cycleId:
|
|
3195
|
+
await cn(u, l, {
|
|
3196
|
+
cycleId: p,
|
|
3114
3197
|
feedKey: u.feedKey,
|
|
3115
|
-
items:
|
|
3116
|
-
missing: u.pageSize -
|
|
3198
|
+
items: h.slice(d.length),
|
|
3199
|
+
missing: u.pageSize - g,
|
|
3117
3200
|
next: s.next,
|
|
3118
3201
|
pageSize: u.pageSize,
|
|
3119
|
-
received:
|
|
3202
|
+
received: g,
|
|
3120
3203
|
signal: c,
|
|
3121
3204
|
total: l.total
|
|
3122
3205
|
}, r), t.syncCountdown();
|
|
3123
3206
|
}
|
|
3124
3207
|
} catch (t) {
|
|
3125
3208
|
if (c.aborted || !r()) return;
|
|
3126
|
-
u && (l.autofill.error = t, l.autofill.status = "error"),
|
|
3209
|
+
u && (l.autofill.error = t, l.autofill.status = "error"), m || (e ? l.nextPageError = t : l.error = t);
|
|
3127
3210
|
} finally {
|
|
3128
3211
|
r() && (t.clearCollection(), l.isLoading = !1, l.isLoadingMore = !1);
|
|
3129
3212
|
}
|
|
@@ -3133,18 +3216,19 @@ async function zn({ append: e, autofillController: t, cursor: n, isCurrent: r, l
|
|
|
3133
3216
|
function $(e) {
|
|
3134
3217
|
return `${typeof e}:${String(e)}`;
|
|
3135
3218
|
}
|
|
3136
|
-
function
|
|
3219
|
+
function Vn(e) {
|
|
3137
3220
|
return `${typeof e}:${String(e)}`;
|
|
3138
3221
|
}
|
|
3139
|
-
function
|
|
3222
|
+
function Hn(e) {
|
|
3140
3223
|
return e.map(({ postId: e }) => e);
|
|
3141
3224
|
}
|
|
3142
|
-
var
|
|
3225
|
+
var Un = class {
|
|
3143
3226
|
delay;
|
|
3144
3227
|
enabled;
|
|
3145
3228
|
maxReplayPages;
|
|
3146
3229
|
pageSize;
|
|
3147
3230
|
pages = [];
|
|
3231
|
+
pending = null;
|
|
3148
3232
|
tombstones = /* @__PURE__ */ new Set();
|
|
3149
3233
|
constructor(e) {
|
|
3150
3234
|
let t = e.removalReconciliation;
|
|
@@ -3154,13 +3238,16 @@ var Hn = class {
|
|
|
3154
3238
|
};
|
|
3155
3239
|
}
|
|
3156
3240
|
completeReconciliation(e) {
|
|
3157
|
-
this.pages = [...this.pages.slice(0, e.replaceFrom), ...e.pages].slice(-this.maxReplayPages);
|
|
3241
|
+
e.status === "complete" && (this.pages = [...this.pages.slice(0, e.replaceFrom), ...e.pages].slice(-this.maxReplayPages), this.pending = null);
|
|
3158
3242
|
}
|
|
3159
3243
|
filterItems(e) {
|
|
3160
3244
|
return !this.enabled || this.tombstones.size === 0 ? [...e] : e.filter(({ postId: e }) => !this.tombstones.has($(e)));
|
|
3161
3245
|
}
|
|
3162
3246
|
needsReconciliation(e) {
|
|
3163
|
-
return this.findUnderfilledPage(e) >= 0;
|
|
3247
|
+
return this.pending !== null || this.findUnderfilledPage(e) >= 0;
|
|
3248
|
+
}
|
|
3249
|
+
hasPendingSession() {
|
|
3250
|
+
return this.pending !== null;
|
|
3164
3251
|
}
|
|
3165
3252
|
recordPages(e) {
|
|
3166
3253
|
!this.enabled || e.length === 0 || (e.forEach((e) => this.recordPage(e)), this.pages = this.pages.slice(-this.maxReplayPages));
|
|
@@ -3169,45 +3256,65 @@ var Hn = class {
|
|
|
3169
3256
|
this.enabled && e.forEach((e) => this.tombstones.add($(e)));
|
|
3170
3257
|
}
|
|
3171
3258
|
reset() {
|
|
3172
|
-
this.pages = [], this.tombstones.clear();
|
|
3259
|
+
this.pages = [], this.pending = null, this.tombstones.clear();
|
|
3173
3260
|
}
|
|
3174
3261
|
restore(e) {
|
|
3175
3262
|
this.enabled && e.forEach((e) => this.tombstones.delete($(e)));
|
|
3176
3263
|
}
|
|
3177
|
-
async reconcile({ existingItems: e, loadPage: t,
|
|
3178
|
-
let
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
p.add(r), await Ht({
|
|
3185
|
-
delayMs: Vt(e, this.delay),
|
|
3264
|
+
async reconcile({ existingItems: e, loadPage: t, shouldPause: n = () => !1, signal: r }) {
|
|
3265
|
+
let i = this.pending ?? this.createSession(e);
|
|
3266
|
+
for (this.pending = i; i.remainingRequests > 0;) {
|
|
3267
|
+
let e = Vn(i.cursor);
|
|
3268
|
+
if (i.seenCursors.has(e)) throw Error("Vibe removal reconciliation received a repeated cursor.");
|
|
3269
|
+
if (await Ut({
|
|
3270
|
+
delayMs: Ht(i.pages.length, this.delay),
|
|
3186
3271
|
onChange: () => void 0,
|
|
3187
|
-
signal:
|
|
3188
|
-
});
|
|
3189
|
-
let
|
|
3190
|
-
cursor:
|
|
3191
|
-
signal:
|
|
3192
|
-
}))
|
|
3193
|
-
|
|
3272
|
+
signal: r
|
|
3273
|
+
}), i.pages.length > 0 && n()) return this.result(i, "paused");
|
|
3274
|
+
let a = Ft(await t({
|
|
3275
|
+
cursor: i.cursor,
|
|
3276
|
+
signal: r
|
|
3277
|
+
}));
|
|
3278
|
+
i.seenCursors.add(e);
|
|
3279
|
+
let o = this.filterItems(a.items), s = [];
|
|
3280
|
+
if (o.forEach((e) => {
|
|
3194
3281
|
let t = $(e.postId);
|
|
3195
|
-
|
|
3196
|
-
}),
|
|
3197
|
-
contributionIds:
|
|
3198
|
-
cursor:
|
|
3199
|
-
next:
|
|
3200
|
-
returnedIds:
|
|
3201
|
-
}),
|
|
3202
|
-
m = g;
|
|
3282
|
+
i.attributed.has(t) || (i.attributed.add(t), s.push(e.postId)), i.appended.has(t) || (i.appended.add(t), i.items.push(e));
|
|
3283
|
+
}), i.pages.push({
|
|
3284
|
+
contributionIds: s,
|
|
3285
|
+
cursor: i.cursor,
|
|
3286
|
+
next: a.next,
|
|
3287
|
+
returnedIds: Hn(o)
|
|
3288
|
+
}), i.lastCursor = i.cursor, i.next = a.next, --i.remainingRequests, a.total !== void 0 && (i.total = a.total), i.next === null ? i.remainingRequests = 0 : i.cursor = i.next, i.remainingRequests > 0 && n()) return this.result(i, "paused");
|
|
3203
3289
|
}
|
|
3290
|
+
return this.result(i, "complete");
|
|
3291
|
+
}
|
|
3292
|
+
createSession(e) {
|
|
3293
|
+
let t = this.findUnderfilledPage(e), n = t < 0 ? [] : this.pages.slice(t), r = n[0];
|
|
3294
|
+
if (!r) throw Error("Vibe has no underfilled provider page to reconcile.");
|
|
3295
|
+
let i = new Set(n.flatMap(({ contributionIds: e }) => e.map($))), a = new Set(e.map(({ postId: e }) => $(e)).filter((e) => !i.has(e)));
|
|
3204
3296
|
return {
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3297
|
+
appended: new Set(e.map(({ postId: e }) => $(e))),
|
|
3298
|
+
attributed: new Set(a),
|
|
3299
|
+
cursor: r.cursor,
|
|
3300
|
+
items: [],
|
|
3301
|
+
lastCursor: r.cursor,
|
|
3302
|
+
next: r.cursor,
|
|
3303
|
+
pages: [],
|
|
3304
|
+
remainingRequests: n.length,
|
|
3305
|
+
replaceFrom: t,
|
|
3306
|
+
seenCursors: /* @__PURE__ */ new Set()
|
|
3307
|
+
};
|
|
3308
|
+
}
|
|
3309
|
+
result(e, t) {
|
|
3310
|
+
return {
|
|
3311
|
+
items: [...e.items],
|
|
3312
|
+
lastCursor: e.lastCursor,
|
|
3313
|
+
next: e.next,
|
|
3314
|
+
pages: [...e.pages],
|
|
3315
|
+
replaceFrom: e.replaceFrom,
|
|
3316
|
+
status: t,
|
|
3317
|
+
total: e.total
|
|
3211
3318
|
};
|
|
3212
3319
|
}
|
|
3213
3320
|
findUnderfilledPage(e) {
|
|
@@ -3216,7 +3323,7 @@ var Hn = class {
|
|
|
3216
3323
|
return this.pages.findIndex(({ contributionIds: e }) => e.filter((e) => t.has($(e))).length < this.pageSize);
|
|
3217
3324
|
}
|
|
3218
3325
|
recordPage(e) {
|
|
3219
|
-
let t =
|
|
3326
|
+
let t = Vn(e.cursor), n = this.pages.findIndex(({ cursor: e }) => Vn(e) === t);
|
|
3220
3327
|
n >= 0 && (this.pages = this.pages.slice(0, n)), this.pages.push({
|
|
3221
3328
|
...e,
|
|
3222
3329
|
contributionIds: [...e.contributionIds],
|
|
@@ -3226,7 +3333,7 @@ var Hn = class {
|
|
|
3226
3333
|
};
|
|
3227
3334
|
//#endregion
|
|
3228
3335
|
//#region src/core/activeItemRemoval.ts
|
|
3229
|
-
function
|
|
3336
|
+
function Wn(e, t, n, r, i) {
|
|
3230
3337
|
let a = new Set(t.map(({ item: e }) => e.postId));
|
|
3231
3338
|
if (e.activeReelPostId === null || !a.has(e.activeReelPostId)) return;
|
|
3232
3339
|
let o = e.items[Math.max(n, 0)];
|
|
@@ -3239,7 +3346,7 @@ function Un(e, t, n, r, i) {
|
|
|
3239
3346
|
}
|
|
3240
3347
|
//#endregion
|
|
3241
3348
|
//#region src/core/exactMediaRemovalController.ts
|
|
3242
|
-
function
|
|
3349
|
+
function Gn(e, t) {
|
|
3243
3350
|
let [n, ...r] = t;
|
|
3244
3351
|
if (!n) throw Error("Vibe items must contain at least one media asset.");
|
|
3245
3352
|
return {
|
|
@@ -3248,10 +3355,10 @@ function Wn(e, t) {
|
|
|
3248
3355
|
items: r
|
|
3249
3356
|
};
|
|
3250
3357
|
}
|
|
3251
|
-
function
|
|
3358
|
+
function Kn(e) {
|
|
3252
3359
|
if (!Number.isInteger(e.mediaIndex) || e.mediaIndex < 0) throw TypeError("Vibe mediaIndex must be a non-negative integer.");
|
|
3253
3360
|
}
|
|
3254
|
-
var
|
|
3361
|
+
var qn = class {
|
|
3255
3362
|
generation = 0;
|
|
3256
3363
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
3257
3364
|
state;
|
|
@@ -3259,7 +3366,7 @@ var Kn = class {
|
|
|
3259
3366
|
this.options = e, this.state = e.state;
|
|
3260
3367
|
}
|
|
3261
3368
|
remove(e) {
|
|
3262
|
-
|
|
3369
|
+
Kn(e);
|
|
3263
3370
|
let t = this.state.items.findIndex(({ postId: t }) => t === e.postId), n = this.state.items[t];
|
|
3264
3371
|
if (!n) return null;
|
|
3265
3372
|
let r = [...M(n)], i = r[e.mediaIndex];
|
|
@@ -3276,7 +3383,7 @@ var Kn = class {
|
|
|
3276
3383
|
restored: !1
|
|
3277
3384
|
});
|
|
3278
3385
|
let o = this.state.mediaIndices.get(n.postId) ?? 0, s = this.isReelOpen() && this.state.activeReelPostId === n.postId, c = s && o === e.mediaIndex;
|
|
3279
|
-
return r.splice(e.mediaIndex, 1), r.length > 0 ? (this.state.items[t] =
|
|
3386
|
+
return r.splice(e.mediaIndex, 1), r.length > 0 ? (this.state.items[t] = Gn(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);
|
|
3280
3387
|
}
|
|
3281
3388
|
reset() {
|
|
3282
3389
|
this.generation += 1;
|
|
@@ -3302,7 +3409,7 @@ var Kn = class {
|
|
|
3302
3409
|
}
|
|
3303
3410
|
restoreIntoPost(e, t) {
|
|
3304
3411
|
let n = this.state.items[e], r = [...M(n)], i = Math.min(t.mediaIndex, r.length);
|
|
3305
|
-
if (r.splice(i, 0, t.media), this.state.items[e] =
|
|
3412
|
+
if (r.splice(i, 0, t.media), this.state.items[e] = Gn(n, r), this.state.activeReelPostId !== t.postId) return;
|
|
3306
3413
|
let a = this.state.mediaIndices.get(t.postId) ?? 0;
|
|
3307
3414
|
a >= i && this.state.mediaIndices.set(t.postId, a + 1);
|
|
3308
3415
|
}
|
|
@@ -3315,18 +3422,18 @@ var Kn = class {
|
|
|
3315
3422
|
};
|
|
3316
3423
|
//#endregion
|
|
3317
3424
|
//#region src/core/itemPlacement.ts
|
|
3318
|
-
function
|
|
3425
|
+
function Jn(e, t) {
|
|
3319
3426
|
let n = new Set(t);
|
|
3320
3427
|
return e.flatMap((e, t) => n.has(e.postId) ? [{
|
|
3321
3428
|
index: t,
|
|
3322
3429
|
item: e
|
|
3323
3430
|
}] : []);
|
|
3324
3431
|
}
|
|
3325
|
-
function
|
|
3432
|
+
function Yn(e, t) {
|
|
3326
3433
|
let n = new Set(t.map(({ item: e }) => e.postId));
|
|
3327
3434
|
return e.filter((e) => !n.has(e.postId));
|
|
3328
3435
|
}
|
|
3329
|
-
function
|
|
3436
|
+
function Xn(e, t) {
|
|
3330
3437
|
t.forEach(({ index: e }) => {
|
|
3331
3438
|
if (!Number.isInteger(e) || e < 0) throw Error("Vibe item restore indexes must be non-negative integers.");
|
|
3332
3439
|
});
|
|
@@ -3337,7 +3444,7 @@ function Yn(e, t) {
|
|
|
3337
3444
|
}
|
|
3338
3445
|
//#endregion
|
|
3339
3446
|
//#region src/core/itemRemovalController.ts
|
|
3340
|
-
var
|
|
3447
|
+
var Zn = 20, Qn = class {
|
|
3341
3448
|
generation = 0;
|
|
3342
3449
|
historyLimit;
|
|
3343
3450
|
metadata = /* @__PURE__ */ new WeakMap();
|
|
@@ -3346,7 +3453,7 @@ var Xn = 20, Zn = class {
|
|
|
3346
3453
|
itemOrder;
|
|
3347
3454
|
stopItemsWatcher;
|
|
3348
3455
|
constructor(e) {
|
|
3349
|
-
this.options = e, this.historyLimit = e.historyLimit ??
|
|
3456
|
+
this.options = e, this.historyLimit = e.historyLimit ?? Zn, 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" });
|
|
3350
3457
|
}
|
|
3351
3458
|
destroy() {
|
|
3352
3459
|
this.reset(), this.stopItemsWatcher();
|
|
@@ -3359,7 +3466,7 @@ var Xn = 20, Zn = class {
|
|
|
3359
3466
|
let i = this.options.startRemoval(r);
|
|
3360
3467
|
if (i > 0 && await new Promise((e) => setTimeout(e, i)), this.metadata.get(n)?.generation !== this.generation) return n;
|
|
3361
3468
|
let a = this.state.items.findIndex((e) => e.postId === this.state.activeReelPostId), o = new Set(t.map(({ item: e }) => e.postId)), s = a < 0 ? 0 : this.state.items.slice(0, a).filter(({ postId: e }) => o.has(e)).length, c = Math.max(a - s, 0);
|
|
3362
|
-
return this.state.items =
|
|
3469
|
+
return this.state.items = Yn(this.state.items, t), this.options.onItemsRemoved(n, t, c), this.record(n), n;
|
|
3363
3470
|
}
|
|
3364
3471
|
reset() {
|
|
3365
3472
|
this.generation += 1, this.history = [], this.itemOrder = [];
|
|
@@ -3370,7 +3477,7 @@ var Xn = 20, Zn = class {
|
|
|
3370
3477
|
this.restoreRemoval(t);
|
|
3371
3478
|
return;
|
|
3372
3479
|
}
|
|
3373
|
-
let n =
|
|
3480
|
+
let n = Xn(this.state.items, e);
|
|
3374
3481
|
this.registerExternalPlacements(e), this.state.items = n;
|
|
3375
3482
|
}
|
|
3376
3483
|
restoreRemoval(e) {
|
|
@@ -3396,7 +3503,7 @@ var Xn = 20, Zn = class {
|
|
|
3396
3503
|
}
|
|
3397
3504
|
collectOrderedPlacements(e) {
|
|
3398
3505
|
let t = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
3399
|
-
return
|
|
3506
|
+
return Jn(this.state.items, e).map((e) => ({
|
|
3400
3507
|
index: t.get(e.item.postId) ?? e.index,
|
|
3401
3508
|
item: e.item
|
|
3402
3509
|
}));
|
|
@@ -3427,7 +3534,7 @@ var Xn = 20, Zn = class {
|
|
|
3427
3534
|
let r = new Map(this.itemOrder.map((e, t) => [e, t]));
|
|
3428
3535
|
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;
|
|
3429
3536
|
}
|
|
3430
|
-
},
|
|
3537
|
+
}, $n = class {
|
|
3431
3538
|
forward = null;
|
|
3432
3539
|
forwardPromise = null;
|
|
3433
3540
|
forwardVersion = 0;
|
|
@@ -3505,7 +3612,7 @@ var Xn = 20, Zn = class {
|
|
|
3505
3612
|
}
|
|
3506
3613
|
}
|
|
3507
3614
|
}
|
|
3508
|
-
},
|
|
3615
|
+
}, er = class {
|
|
3509
3616
|
generation = 0;
|
|
3510
3617
|
pending = Promise.resolve();
|
|
3511
3618
|
constructor(e) {
|
|
@@ -3555,24 +3662,24 @@ var Xn = 20, Zn = class {
|
|
|
3555
3662
|
};
|
|
3556
3663
|
//#endregion
|
|
3557
3664
|
//#region src/core/removalControllers.ts
|
|
3558
|
-
function
|
|
3559
|
-
let t = new
|
|
3665
|
+
function tr(e) {
|
|
3666
|
+
let t = new $n(e), n = new er({
|
|
3560
3667
|
state: e.state,
|
|
3561
3668
|
transitionMedia: (t) => e.surface()?.transitionActiveReelMedia(t) ?? Promise.resolve(!1),
|
|
3562
3669
|
transitionPost: (t) => e.surface()?.transitionActiveReelPost(t) ?? Promise.resolve(!1)
|
|
3563
3670
|
});
|
|
3564
3671
|
return {
|
|
3565
|
-
exactMediaRemoval: new
|
|
3672
|
+
exactMediaRemoval: new qn({
|
|
3566
3673
|
onActivate: e.onActivate,
|
|
3567
3674
|
onPostRemoved: (t) => e.onItemsRemoved([t]),
|
|
3568
3675
|
onPostRestored: (t) => e.onItemsRestored([t]),
|
|
3569
3676
|
reelForward: t,
|
|
3570
3677
|
state: e.state
|
|
3571
3678
|
}),
|
|
3572
|
-
itemRemoval: new
|
|
3679
|
+
itemRemoval: new Qn({
|
|
3573
3680
|
historyLimit: e.historyLimit,
|
|
3574
3681
|
onItemsRemoved: (n, r, i) => {
|
|
3575
|
-
e.onItemsRemoved(r.map(({ item: e }) => e.postId)),
|
|
3682
|
+
e.onItemsRemoved(r.map(({ item: e }) => e.postId)), Wn(e.state, r, i, e.onActivate, (e, r) => t.start(n, e, r));
|
|
3576
3683
|
},
|
|
3577
3684
|
onRemovalRestored: (n) => {
|
|
3578
3685
|
e.onItemsRestored(n.map(({ item: e }) => e.postId));
|
|
@@ -3587,17 +3694,17 @@ function er(e) {
|
|
|
3587
3694
|
reelRemoval: n
|
|
3588
3695
|
};
|
|
3589
3696
|
}
|
|
3590
|
-
var
|
|
3591
|
-
function
|
|
3697
|
+
var nr = 1.5;
|
|
3698
|
+
function rr(e) {
|
|
3592
3699
|
let t = Math.min(e.screenWidth, e.screenHeight);
|
|
3593
3700
|
if (t > 0 && t < 600) return !0;
|
|
3594
|
-
let n = Math.min(e.viewportWidth, e.viewportHeight), r = t >= n *
|
|
3701
|
+
let n = Math.min(e.viewportWidth, e.viewportHeight), r = t >= n * nr;
|
|
3595
3702
|
return !e.hasHover && n > 0 && n < 600 && r;
|
|
3596
3703
|
}
|
|
3597
|
-
function rr(e) {
|
|
3598
|
-
return nr(e) ? "reel" : "masonry";
|
|
3599
|
-
}
|
|
3600
3704
|
function ir(e) {
|
|
3705
|
+
return rr(e) ? "reel" : "masonry";
|
|
3706
|
+
}
|
|
3707
|
+
function ar(e) {
|
|
3601
3708
|
let t = e.ownerDocument.defaultView, n = e.ownerDocument.documentElement;
|
|
3602
3709
|
return {
|
|
3603
3710
|
hasHover: typeof t?.matchMedia == "function" && t.matchMedia("(hover: hover)").matches,
|
|
@@ -3607,15 +3714,15 @@ function ir(e) {
|
|
|
3607
3714
|
viewportWidth: n.clientWidth
|
|
3608
3715
|
};
|
|
3609
3716
|
}
|
|
3610
|
-
function ar(e) {
|
|
3611
|
-
return nr(ir(e));
|
|
3612
|
-
}
|
|
3613
3717
|
function or(e) {
|
|
3614
|
-
return rr(
|
|
3718
|
+
return rr(ar(e));
|
|
3719
|
+
}
|
|
3720
|
+
function sr(e) {
|
|
3721
|
+
return ir(ar(e));
|
|
3615
3722
|
}
|
|
3616
3723
|
//#endregion
|
|
3617
3724
|
//#region src/core/responsiveLayoutController.ts
|
|
3618
|
-
var
|
|
3725
|
+
var cr = class {
|
|
3619
3726
|
layoutMode;
|
|
3620
3727
|
resizeObserver = null;
|
|
3621
3728
|
target = null;
|
|
@@ -3640,10 +3747,10 @@ var sr = class {
|
|
|
3640
3747
|
}
|
|
3641
3748
|
handleResponsiveLayout = () => {
|
|
3642
3749
|
if (!this.target) return;
|
|
3643
|
-
let e =
|
|
3644
|
-
this.state.
|
|
3750
|
+
let e = sr(this.target);
|
|
3751
|
+
this.state.phoneMode = or(this.target), this.state.reelInfoSheetOverlay = this.state.phoneMode, this.state.reelMediaSource = e === "reel" ? "preview" : "original", this.layoutMode === "responsive" && this.applyLayout(e);
|
|
3645
3752
|
};
|
|
3646
|
-
},
|
|
3753
|
+
}, lr = class {
|
|
3647
3754
|
routedReelPostId = null;
|
|
3648
3755
|
reelRouteIsActive = !1;
|
|
3649
3756
|
constructor(e, t) {
|
|
@@ -3670,7 +3777,7 @@ var sr = class {
|
|
|
3670
3777
|
let i = this.reelRouteIsActive ? "replace" : "push";
|
|
3671
3778
|
this.reelRouteIsActive = !0, this.routedReelPostId = e, this.options.router[i](r);
|
|
3672
3779
|
}
|
|
3673
|
-
},
|
|
3780
|
+
}, ur = class {
|
|
3674
3781
|
app = null;
|
|
3675
3782
|
autoScroll;
|
|
3676
3783
|
autofillController;
|
|
@@ -3690,19 +3797,20 @@ var sr = class {
|
|
|
3690
3797
|
lastLoadedCursor = null;
|
|
3691
3798
|
state;
|
|
3692
3799
|
constructor(e) {
|
|
3693
|
-
this.options = e,
|
|
3800
|
+
this.options = e, Rn(e);
|
|
3694
3801
|
let t = e.layout ?? "masonry";
|
|
3695
|
-
this.state = x(
|
|
3802
|
+
this.state = x(Fn(e, t)), this.autoScroll = new sn({
|
|
3696
3803
|
getScrollElement: () => this.surface?.getAutoScrollElement() ?? null,
|
|
3697
3804
|
state: this.state.autoScroll
|
|
3698
|
-
}), this.autofillController = new
|
|
3805
|
+
}), this.autofillController = new en({
|
|
3699
3806
|
cancelRequest: () => this.cancelRequest(),
|
|
3700
3807
|
onLastCursor: (e) => {
|
|
3701
3808
|
this.lastLoadedCursor = e;
|
|
3702
3809
|
},
|
|
3810
|
+
onPages: (e) => this.removalReconciliation.recordPages(e),
|
|
3703
3811
|
options: e.autofill,
|
|
3704
3812
|
state: this.state
|
|
3705
|
-
}), this.removalReconciliation = new
|
|
3813
|
+
}), this.removalReconciliation = new Un(e), this.fillController = new Dn({
|
|
3706
3814
|
fill: e.fill,
|
|
3707
3815
|
loadPage: e.loadPage ? (e) => this.loadFilteredPage(e) : void 0,
|
|
3708
3816
|
onLastCursor: (e) => {
|
|
@@ -3710,8 +3818,8 @@ var sr = class {
|
|
|
3710
3818
|
},
|
|
3711
3819
|
onPages: (e) => this.removalReconciliation.recordPages(e),
|
|
3712
3820
|
state: this.state
|
|
3713
|
-
}), this.routing = new
|
|
3714
|
-
let n =
|
|
3821
|
+
}), this.routing = new lr(e.routing, this.state);
|
|
3822
|
+
let n = tr({
|
|
3715
3823
|
historyLimit: e.removalHistoryLimit,
|
|
3716
3824
|
loadNext: () => this.loadNext(),
|
|
3717
3825
|
onActivate: (e) => this.setActiveReelPost(e),
|
|
@@ -3721,22 +3829,23 @@ var sr = class {
|
|
|
3721
3829
|
state: this.state,
|
|
3722
3830
|
surface: () => this.surface
|
|
3723
3831
|
});
|
|
3724
|
-
this.exactMediaRemoval = n.exactMediaRemoval, this.itemRemoval = n.itemRemoval, this.reelForward = n.reelForward, this.reelRemoval = n.reelRemoval, this.responsiveLayout = new
|
|
3832
|
+
this.exactMediaRemoval = n.exactMediaRemoval, this.itemRemoval = n.itemRemoval, this.reelForward = n.reelForward, this.reelRemoval = n.reelRemoval, this.responsiveLayout = new cr(t, this.state, () => {
|
|
3725
3833
|
this.routing.syncFeed();
|
|
3726
3834
|
}), this.startStateNotifications();
|
|
3727
3835
|
}
|
|
3728
3836
|
async mount() {
|
|
3729
3837
|
if (this.app) throw Error("Vibe is already mounted.");
|
|
3730
3838
|
this.startStateNotifications();
|
|
3731
|
-
let e =
|
|
3732
|
-
this.responsiveLayout.mount(e), this.app = i(
|
|
3839
|
+
let e = zn(this.options.target);
|
|
3840
|
+
this.responsiveLayout.mount(e), this.app = i(Pt, {
|
|
3733
3841
|
canRetryEnd: !!this.options.loadPage,
|
|
3734
3842
|
cardFooter: this.options.cardFooter,
|
|
3735
3843
|
cardHeader: this.options.cardHeader,
|
|
3736
3844
|
feedFooter: this.options.feedFooter,
|
|
3737
|
-
feedFooterActions:
|
|
3845
|
+
feedFooterActions: On(this),
|
|
3738
3846
|
mediaCard: this.options.mediaCard,
|
|
3739
3847
|
onMediaReady: this.options.onMediaReady,
|
|
3848
|
+
onMediaVisible: this.options.onMediaVisible,
|
|
3740
3849
|
onReelMediaChange: this.options.onReelMediaChange,
|
|
3741
3850
|
reelInfoSheet: this.options.reelInfoSheet,
|
|
3742
3851
|
state: this.state,
|
|
@@ -3755,13 +3864,13 @@ var sr = class {
|
|
|
3755
3864
|
onRetryForward: () => {
|
|
3756
3865
|
this.retryReelForward();
|
|
3757
3866
|
}
|
|
3758
|
-
}), this.surface = this.app.mount(e), this.autoScroll.mount(), this.options.initialPage ? this.options.autofill && this.state.autofill.status === "idle" && !this.fillController.isActive() && await this.startInitialAutofill() : await this.reload();
|
|
3867
|
+
}), this.surface = this.app.mount(e), this.autoScroll.mount(), this.options.initialPage ? this.options.autofill && this.state.autofill.status === "idle" && !this.fillController.isActive() && !this.state.loadMoreLocked && await this.startInitialAutofill() : await this.reload();
|
|
3759
3868
|
}
|
|
3760
3869
|
destroy() {
|
|
3761
3870
|
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;
|
|
3762
3871
|
}
|
|
3763
3872
|
getState() {
|
|
3764
|
-
return
|
|
3873
|
+
return I(this.state);
|
|
3765
3874
|
}
|
|
3766
3875
|
removeMedia(e) {
|
|
3767
3876
|
return this.exactMediaRemoval.remove(e);
|
|
@@ -3815,12 +3924,23 @@ var sr = class {
|
|
|
3815
3924
|
this.autoScroll.setSpeed(e);
|
|
3816
3925
|
}
|
|
3817
3926
|
applyAutofillUpdate(e) {
|
|
3818
|
-
let t =
|
|
3927
|
+
let t = un(this.options.autofill, this.state, e);
|
|
3819
3928
|
return t && this.autofillController.syncCountdown(), t;
|
|
3820
3929
|
}
|
|
3821
3930
|
cancelAutofill() {
|
|
3822
3931
|
return this.autofillController.cancel();
|
|
3823
3932
|
}
|
|
3933
|
+
async cancelLoading() {
|
|
3934
|
+
if (this.state.loadMoreLocked = !1, this.fillController.isActive()) {
|
|
3935
|
+
await this.cancelFill();
|
|
3936
|
+
return;
|
|
3937
|
+
}
|
|
3938
|
+
if (Xt(this.state.autofill)) {
|
|
3939
|
+
await this.cancelAutofill();
|
|
3940
|
+
return;
|
|
3941
|
+
}
|
|
3942
|
+
this.cancelRequest();
|
|
3943
|
+
}
|
|
3824
3944
|
applyFillUpdate(e) {
|
|
3825
3945
|
return this.fillController.applyUpdate(e);
|
|
3826
3946
|
}
|
|
@@ -3828,11 +3948,13 @@ var sr = class {
|
|
|
3828
3948
|
return this.fillController.cancel();
|
|
3829
3949
|
}
|
|
3830
3950
|
async fill(e) {
|
|
3831
|
-
if (this.
|
|
3832
|
-
|
|
3951
|
+
if (!this.state.loadMoreLocked) {
|
|
3952
|
+
if (this.pendingRequest || Xt(this.state.autofill)) throw Error("Vibe cannot fill while another page operation is active.");
|
|
3953
|
+
await this.fillController.start(e);
|
|
3954
|
+
}
|
|
3833
3955
|
}
|
|
3834
3956
|
restoreAutofillSession(e) {
|
|
3835
|
-
let t =
|
|
3957
|
+
let t = dn(this.options.autofill, this.state, e);
|
|
3836
3958
|
return t && this.autofillController.syncCountdown(), t;
|
|
3837
3959
|
}
|
|
3838
3960
|
restoreFillSession(e) {
|
|
@@ -3840,7 +3962,7 @@ var sr = class {
|
|
|
3840
3962
|
}
|
|
3841
3963
|
async loadNext() {
|
|
3842
3964
|
if (this.pendingRequest) return this.pendingRequest;
|
|
3843
|
-
if (this.state.loadMoreLocked ||
|
|
3965
|
+
if (this.state.loadMoreLocked || Xt(this.state.autofill) || this.fillController.isActive() || !this.options.loadPage || this.state.next === null && !this.removalReconciliation.needsReconciliation(this.state.items)) return;
|
|
3844
3966
|
this.state.isLoadingMore = !0, this.state.nextPageError = null;
|
|
3845
3967
|
let e = this.loadNextSequence();
|
|
3846
3968
|
return this.pendingRequest = e, e.finally(() => {
|
|
@@ -3855,19 +3977,19 @@ var sr = class {
|
|
|
3855
3977
|
}
|
|
3856
3978
|
async replaceFeed(e, t) {
|
|
3857
3979
|
if (!this.options.loadPage) throw Error(`Vibe cannot ${t} without loadPage.`);
|
|
3858
|
-
return
|
|
3980
|
+
return Xt(this.state.autofill) && await this.cancelAutofill(), this.fillController.isActive() && await this.cancelFill(), this.cancelRequest(), this.state.autofill = Yt(this.options.autofill, void 0, !1), this.fillController.reset(), this.reelForward.reset(), this.reelRemoval.reset(), this.exactMediaRemoval.reset(), this.itemRemoval.reset(), this.removalReconciliation.reset(), this.state.error = null, this.state.isLoading = !0, this.state.items = [], this.state.next = null, this.state.nextPageError = null, this.state.total = null, this.startRequest(e, !1);
|
|
3859
3981
|
}
|
|
3860
3982
|
async loadFilteredPage(e) {
|
|
3861
3983
|
let t = this.options.loadPage;
|
|
3862
3984
|
if (!t) throw Error("Vibe cannot load a page without loadPage.");
|
|
3863
|
-
let n =
|
|
3985
|
+
let n = Ft(await t(e));
|
|
3864
3986
|
return {
|
|
3865
3987
|
...n,
|
|
3866
3988
|
items: this.removalReconciliation.filterItems(n.items)
|
|
3867
3989
|
};
|
|
3868
3990
|
}
|
|
3869
3991
|
async loadNextSequence() {
|
|
3870
|
-
this.removalReconciliation.needsReconciliation(this.state.items) && !await this.reconcileBeforeNext() || this.state.next !== null && await this.fetchPage(this.state.next, !0);
|
|
3992
|
+
this.removalReconciliation.needsReconciliation(this.state.items) && !await this.reconcileBeforeNext() || this.state.loadMoreLocked || this.state.next !== null && await this.fetchPage(this.state.next, !0);
|
|
3871
3993
|
}
|
|
3872
3994
|
async reconcileBeforeNext() {
|
|
3873
3995
|
let e = this.options.loadPage;
|
|
@@ -3878,9 +4000,10 @@ var sr = class {
|
|
|
3878
4000
|
let r = await this.removalReconciliation.reconcile({
|
|
3879
4001
|
existingItems: this.state.items,
|
|
3880
4002
|
loadPage: e,
|
|
4003
|
+
shouldPause: () => this.state.loadMoreLocked,
|
|
3881
4004
|
signal: n.signal
|
|
3882
4005
|
});
|
|
3883
|
-
return t === this.requestVersion ? (this.state.items = Z(this.state.items, r.items), this.state.next = r.next, this.lastLoadedCursor = r.lastCursor, r.total !== void 0 && (this.state.total = r.total), this.removalReconciliation.completeReconciliation(r),
|
|
4006
|
+
return t === this.requestVersion ? (this.state.items = Z(this.state.items, r.items), this.state.next = r.next, this.lastLoadedCursor = r.lastCursor, r.total !== void 0 && (this.state.total = r.total), this.removalReconciliation.completeReconciliation(r), r.status === "complete") : !1;
|
|
3884
4007
|
} catch (e) {
|
|
3885
4008
|
return !n.signal.aborted && t === this.requestVersion && (this.state.nextPageError = e), !1;
|
|
3886
4009
|
} finally {
|
|
@@ -3889,19 +4012,38 @@ var sr = class {
|
|
|
3889
4012
|
}
|
|
3890
4013
|
async retryEnd() {
|
|
3891
4014
|
if (this.pendingRequest) return this.pendingRequest;
|
|
3892
|
-
if (!this.state.loadMoreLocked && !(
|
|
4015
|
+
if (!this.state.loadMoreLocked && !(Xt(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);
|
|
3893
4016
|
}
|
|
3894
4017
|
setInfiniteScroll(e) {
|
|
3895
4018
|
this.state.infiniteScroll = e, e && m(() => this.surface?.loadIfNearBottom());
|
|
3896
4019
|
}
|
|
3897
4020
|
setLoadMoreLocked(e) {
|
|
3898
|
-
this.state.loadMoreLocked !== e && (this.state.loadMoreLocked = e, !e
|
|
4021
|
+
if (this.state.loadMoreLocked !== e && (this.state.loadMoreLocked = e, !e)) {
|
|
4022
|
+
let e = this.state.fill.status === "paused" ? this.state.fill.target : null;
|
|
4023
|
+
if (e) {
|
|
4024
|
+
let t = "pages" in e ? e.pages - this.state.fill.completedPages : null;
|
|
4025
|
+
if (t === null || t > 0) {
|
|
4026
|
+
this.fillController.start(t === null ? { until: "end" } : { pages: t });
|
|
4027
|
+
return;
|
|
4028
|
+
}
|
|
4029
|
+
}
|
|
4030
|
+
if (this.state.autofill.status === "paused" || this.removalReconciliation.hasPendingSession()) {
|
|
4031
|
+
let e = this.pendingRequest;
|
|
4032
|
+
e ? e.finally(() => {
|
|
4033
|
+
this.loadNext();
|
|
4034
|
+
}) : this.loadNext();
|
|
4035
|
+
} else this.state.infiniteScroll && m(() => this.surface?.loadIfNearBottom());
|
|
4036
|
+
}
|
|
4037
|
+
}
|
|
4038
|
+
setTotal(e) {
|
|
4039
|
+
if (e !== null && (!Number.isInteger(e) || e < 0)) throw TypeError("Vibe total must be a non-negative integer or null.");
|
|
4040
|
+
this.state.total = e;
|
|
3899
4041
|
}
|
|
3900
4042
|
setReelAutoAdvance(e) {
|
|
3901
|
-
|
|
4043
|
+
Mn(this.state.reelAutoAdvance, e);
|
|
3902
4044
|
}
|
|
3903
4045
|
setReelInfoSheet(e) {
|
|
3904
|
-
|
|
4046
|
+
Pn(this.state.reelInfoSheet, this.options.reelInfoSheet, e);
|
|
3905
4047
|
}
|
|
3906
4048
|
setLayout(e) {
|
|
3907
4049
|
this.responsiveLayout.setLayout(e);
|
|
@@ -3921,7 +4063,7 @@ var sr = class {
|
|
|
3921
4063
|
async fetchPage(e, t) {
|
|
3922
4064
|
if (!this.options.loadPage) return;
|
|
3923
4065
|
let n = ++this.requestVersion, r = new AbortController();
|
|
3924
|
-
this.abortController = r, await
|
|
4066
|
+
this.abortController = r, await Bn({
|
|
3925
4067
|
append: t,
|
|
3926
4068
|
autofillController: this.autofillController,
|
|
3927
4069
|
cursor: e,
|
|
@@ -3945,7 +4087,7 @@ var sr = class {
|
|
|
3945
4087
|
startInitialAutofill() {
|
|
3946
4088
|
let e = ++this.requestVersion, t = new AbortController(), n = this.autofillController.beginCycle();
|
|
3947
4089
|
this.abortController = t, this.state.isLoadingMore = !0;
|
|
3948
|
-
let r =
|
|
4090
|
+
let r = fn({
|
|
3949
4091
|
cycleId: n,
|
|
3950
4092
|
isCurrent: () => e === this.requestVersion,
|
|
3951
4093
|
onCollection: (t) => this.autofillController.captureCollection(t, e === this.requestVersion),
|
|
@@ -3971,8 +4113,8 @@ var sr = class {
|
|
|
3971
4113
|
}));
|
|
3972
4114
|
}
|
|
3973
4115
|
};
|
|
3974
|
-
function
|
|
3975
|
-
return new
|
|
4116
|
+
function dr(e) {
|
|
4117
|
+
return new ur(e);
|
|
3976
4118
|
}
|
|
3977
4119
|
//#endregion
|
|
3978
|
-
export {
|
|
4120
|
+
export { dr as createVibe };
|