"use strict"; (self.webpackChunk_N_E = self.webpackChunk_N_E || []).push([ [7429], { 5284: (e, t, n) => { n.d(t, { K: () => r }); var i = n(25771), l = n(87163), a = n(51529); let s = "#ffffff", r = e => { let { size: t = 20, width: n, height: r, className: o, color1: c = s, color2: d = s, color3: u = s } = e, m = [c, d, u], h = null != n ? n : t, x = null != r ? r : t, p = Math.min(h, x), f = Math.max(1, Math.round(2 * p / 20)), v = Math.max(1, Math.round(2 * p / 20)), w = Math.max(2, Math.round(5 * p / 20)), b = (0, l.useMemo)(() => [Math.max(1, Math.round(8 * p / 20)), Math.max(1, Math.round(10 * p / 20)), Math.max(1, Math.round(2 * p / 20))], [p]), g = Math.max(...b), [j, y] = (0, l.useState)(0); (0, l.useEffect)(() => { let e = window.setInterval(() => { y(e => (e + 1) % b.length) }, 300); return () => window.clearInterval(e) }, [b.length]); let N = [0, 1, 2].map(e => b[(e + j) % b.length]); return (0, i.jsx)("div", { className: (0, a.cn)("bg-gradient box-border flex shrink-0 items-center justify-center overflow-hidden", o), style: { width: h, height: x, borderRadius: w }, "aria-hidden": !0, children: (0, i.jsx)("div", { className: "flex items-end justify-center", style: { height: g, width: "100%", gap: v }, children: N.map((e, t) => (0, i.jsx)("span", { className: "block shrink-0 rounded-full", style: { width: f, height: e, backgroundColor: m[t], transition: "height 0.22s cubic-bezier(0.45, 0.05, 0.55, 0.95)" } }, t)) }) }) } }, 10915: (e, t, n) => { n.d(t, { Bc: () => s, ZI: () => c, k$: () => o, m_: () => r }); var i = n(25771); n(87163); var l = n(43423), a = n(51529); function s(e) { let { delayDuration: t = 0, ...n } = e; return (0, i.jsx)(l.Kq, { "data-slot": "tooltip-provider", delayDuration: t, ...n }) } function r(e) { let { ...t } = e; return (0, i.jsx)(s, { children: (0, i.jsx)(l.bL, { "data-slot": "tooltip", ...t }) }) } function o(e) { let { ...t } = e; return (0, i.jsx)(l.l9, { "data-slot": "tooltip-trigger", ...t }) } function c(e) { let { className: t, sideOffset: n = 0, children: s, ...r } = e; return (0, i.jsx)(l.ZL, { children: (0, i.jsxs)(l.UC, { "data-slot": "tooltip-content", sideOffset: n, className: (0, a.cn)("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) px-3 py-1.5", "bg-background-alpha-primary rounded-[8px] border border-white/10 text-xs text-wrap text-white backdrop-blur-[400px]", "shadow-[0px_8px_12px_0px_rgba(0,0,0,0.4)]", t), ...r, children: [s, (0, i.jsx)(l.i3, { className: (0, a.cn)("z-50 size-2.5 translate-y-[calc(-50%)] rotate-45", "bg-background-alpha-primary fill-background-alpha-primary text-background-alpha-primary", "invisible") })] }) }) } }, 17429: (e, t, n) => { n.r(t), n.d(t, { DefaultLive: () => et }); var i = n(25771), l = n(87163), a = n(95113), s = n(34438), r = n(51529), o = n(85151), c = n(30990), d = n(39270), u = n(30008), m = n(8640), h = n(99351), x = n(18708), p = n(25781), f = n(10407); let v = (0, r.cn)("pointer-events-auto box-border flex w-[60%] min-w-[600px] gap-[10px] rounded-2xl border border-button-secondary-hover bg-black/72 px-4 py-3", "shadow-live-panel backdrop-blur-[100px]"); function w() { let { t: e } = (0, o.Bd)(), [t, n] = (0, l.useState)(""), a = (0, l.useRef)(null), s = (0, p.kH)(e => e.userInfo), { sessionState: w } = u.Z.useData(), b = "end" === w || "block" === w, { send: g } = u.Z.useEvents(), j = s.loading || b, { run: y, loading: N } = (0, c.A)(async () => { if (!N && "end" !== w && "block" !== w && !s.loading && "" !== t.trim() && await (0, f.Zm)(!0)) try { await g("prompt", t), n(""), setTimeout(() => { var e; null == (e = a.current) || e.focus({ preventScroll: !0 }) }, 0) } catch (t) { d.o.error((null == t ? void 0 : t.message) || e("global.common.sendFailed")) } }, { manual: !0 }), k = async () => { if (j || N) return !1; let e = await (0, f.Zm)(!0); if (!e) { var t; null == (t = a.current) || t.blur() } return e }, C = !t.trim() || N || s.loading || b; return (0, i.jsx)("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 z-20 flex justify-center px-4 pt-12 pb-4", children: (0, i.jsxs)("div", { className: (0, r.cn)(v, "relative min-h-[106px] items-end"), children: [(0, i.jsx)(x.T, { ref: a, value: t, onChange: e => { var t; t = e.target.value, j || N || n(t) }, onFocus: () => { k() }, placeholder: e("components.discover.worldLiveDetail.promptPlaceholder"), rows: 2, maxLength: 100, disabled: j, readOnly: N, "aria-busy": N, className: (0, r.cn)("block h-full flex-1 resize-none rounded-none border-0 bg-transparent p-0 text-sm leading-snug text-white shadow-none dark:bg-transparent", "field-sizing-content", "placeholder:text-white/40", "disabled:cursor-not-allowed disabled:opacity-50"), onKeyDown: e => { N || s.loading || b || "Enter" !== e.key || e.shiftKey || e.nativeEvent.isComposing || (e.preventDefault(), y()) } }), (0, i.jsx)(m.$, { disabled: C, type: "gradient", size: "small", shape: "default", icon: (0, i.jsx)(h.J, { className: "relative right-0.5" }), className: "shrink-0", onClick: y, loading: N, children: e("components.discover.worldLiveDetail.create") })] }) }) } var b = n(92539), g = n(67036), j = n(25675), y = n(20622), N = n(91665), k = n(57425); let C = { body: '', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }, z = e => { let { className: t = "", ...n } = e; return (0, i.jsx)("div", { className: t, style: { height: "1em", aspectRatio: 1 }, children: (0, i.jsx)(k.In, { ...n, icon: C, height: "1em" }) }) }; var M = n(89232); let D = (0, r.cn)("flex items-center gap-[10px] rounded-sm border border-button-secondary-hover bg-black/72 px-3 py-3", "shadow-live-panel backdrop-blur-[100px]"); function A(e) { var t, n, i; return [null != (t = e.uid) ? t : "", e.chat, null != (i = null != (n = e.sent_at) ? n : e.timestamp) ? i : ""].join("\x1f") } function S(e) { let { open: t, onOpenChange: n } = e, { t: a } = (0, o.Bd)(), [x, v] = (0, l.useState)(""), [w, k] = (0, l.useState)(0), C = (0, l.useRef)(null), { send: S } = u.Z.useEvents(), { sessionState: L } = u.Z.useData(), { userInfo: _ } = (0, p.kH)(), { recordComment: E } = (0, M.r)(), { messages: Z } = u.Z.useMessages(), R = "end" === L || "block" === L, T = (0, l.useRef)(null), P = (0, l.useRef)(!0), I = (0, l.useRef)(0), { userNumber: B } = u.Z.useData(), H = (0, l.useRef)(0); (0, b.A)(() => { H.current = Number(B) }, [B]); let O = (0, l.useCallback)(() => { let e = T.current; if (!e) return; let t = e.scrollHeight - e.scrollTop - e.clientHeight <= 48; P.current = t, t && k(0) }, []), F = (0, l.useCallback)(function() { let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "smooth", t = T.current; t && (t.scrollTo({ top: t.scrollHeight, behavior: e }), P.current = !0, k(0)) }, []); (0, l.useLayoutEffect)(() => { let e = T.current, t = I.current, n = Z.length, i = n - t; if (I.current = n, 0 === n) return void k(0); i <= 0 || (P.current || 0 === t ? (null == e || e.scrollTo({ top: e.scrollHeight, behavior: "auto" }), k(0)) : k(e => e + i)) }, [Z.length]), (0, l.useLayoutEffect)(() => { if (!t) return; let e = T.current; e && 0 !== Z.length && (e.scrollTop = e.scrollHeight, P.current = !0, k(0)) }, [t]); let { run: $, loading: K } = (0, c.A)(async () => { if (!K && "end" !== L && "block" !== L && !_.loading && "" !== x.trim() && await (0, f.Zm)()) try { await S("chat", x), E(), v(""), setTimeout(() => { var e; null == (e = C.current) || e.focus({ preventScroll: !0 }) }, 0) } catch (e) { d.o.error((null == e ? void 0 : e.message) || a("global.common.sendFailed")) } }, { manual: !0 }), q = _.loading || R, W = async () => { if (q || K) return !1; let e = await (0, f.Zm)(); if (!e) { var t; null == (t = C.current) || t.blur() } return e }, G = K || !x.trim() || R || _.loading; return (0, i.jsxs)(s.P.aside, { className: "relative z-10 flex min-h-0 min-w-0 shrink-0 flex-col self-stretch overflow-hidden border-l border-white/15 bg-black", initial: !1, animate: { width: t ? "20%" : 60 }, transition: { type: "spring", stiffness: 380, damping: 36, mass: .9 }, children: [(0, i.jsxs)(s.P.div, { "aria-hidden": !0, className: "pointer-events-none absolute inset-0 z-0 overflow-hidden", initial: !1, animate: { opacity: +!!t }, transition: { duration: .28, ease: [.25, .1, .25, 1] }, children: [(0, i.jsx)(j.default, { src: "/righttop.svg", alt: "", unoptimized: !0, className: "absolute top-0 right-0 object-contain select-none", width: 490, height: 275 }), (0, i.jsx)(j.default, { src: "/rightbottom.png", alt: "", unoptimized: !0, className: "absolute right-0 bottom-0 object-contain select-none", width: 490, height: 307 })] }), t ? (0, i.jsxs)(s.P.div, { className: "relative z-10 flex min-h-0 min-w-0 flex-1 flex-col", initial: !1, animate: { opacity: 1 }, transition: { duration: .2, ease: [.25, .1, .25, 1], delay: .05 }, children: [(0, i.jsx)("header", { className: "flex h-14 shrink-0 items-center gap-2 border-b border-white/15 px-4 select-none", children: (0, i.jsxs)("div", { className: "flex min-w-0 items-center gap-2", children: [(0, i.jsx)(z, { className: "text-xl text-white/70" }), (0, i.jsxs)("div", { className: "truncate text-[16px] text-white/80", children: [a("components.discover.worldLiveDetail.chatTitle"), (0, i.jsx)("span", { className: "mr-2" }), "(", (0, i.jsx)(N.A, { className: "mx-[2px] font-bold", duration: .03, to: Number(B), from: H.current }), (0, i.jsx)("span", { className: "text-[10px]", children: a("components.discover.worldLiveDetail.users") }), " ", ")"] })] }) }), (0, i.jsx)("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: 0 === Z.length ? (0, i.jsx)("div", { className: "flex min-h-0 flex-1 flex-col items-center justify-center px-4 text-center", children: (0, i.jsx)("p", { className: "text-sm leading-relaxed text-white/45", children: a("components.discover.worldLiveDetail.emptyChat") }) }) : (0, i.jsxs)("div", { className: "relative min-h-0 min-w-0 flex-1 p-4 pt-3", children: [w > 0 ? (0, i.jsx)("div", { className: "pointer-events-none absolute bottom-3 left-0 z-20 flex w-full justify-center px-4", children: (0, i.jsxs)("button", { type: "button", onClick: () => F("smooth"), className: "pointer-events-auto flex items-center gap-1.5 rounded-full border border-white/15 bg-black/80 px-3 py-1.5 text-xs font-medium text-white shadow-lg backdrop-blur-md transition-colors hover:bg-black/90", children: [(0, i.jsx)(g.A, { className: "size-3.5 shrink-0 opacity-90", "aria-hidden": !0 }), a("components.discover.worldLiveDetail.chatNewMessages", { count: w })] }) }) : null, (0, i.jsx)("ul", { ref: T, onScroll: O, className: "flex h-full w-full min-w-0 flex-col gap-3 overflow-x-hidden overflow-y-auto overscroll-contain", "aria-label": a("components.discover.worldLiveDetail.chatTitle"), children: Z.map(e => { let t = e.uid === (null == _ ? void 0 : _.accountId) ? a("components.discover.worldLiveDetail.chatYouSuffix") : ""; return 1 === e.msg_type ? (0, i.jsx)("li", { className: "min-w-0 shrink-0", children: (0, i.jsx)("p", { className: "text-sm leading-relaxed wrap-break-word text-white/55", children: a("components.discover.worldLiveDetail.chatUserJoined", { name: e.name, self: t }) }) }, A(e)) : (0, i.jsx)("li", { className: "min-w-0 shrink-0", children: (0, i.jsxs)("div", { className: "flex min-w-0 items-start gap-2", children: [(0, i.jsx)(y.e, { src: e.avatar, size: 24, className: "mt-0.5 shrink-0 rounded-full object-cover ring-1 ring-white/10" }), (0, i.jsxs)("div", { className: "min-w-0 flex-1 text-sm leading-relaxed wrap-break-word whitespace-pre-wrap", children: [(0, i.jsxs)("span", { className: "text-text-grey-light-secondary font-medium", children: ["@", e.name, t] }), (0, i.jsxs)("span", { className: "text-text-grey-light-primary", children: [" ", e.chat] })] })] }) }, A(e)) }) })] }) }), (0, i.jsxs)("footer", { className: "relative z-10 shrink-0 p-3", children: [(0, i.jsx)("p", { className: "mb-2 ml-1 text-[12px] leading-snug text-white/60", children: a("components.discover.worldLiveDetail.chatHint") }), (0, i.jsxs)("div", { className: (0, r.cn)(D, "relative h-12 items-center"), children: [(0, i.jsx)("input", { ref: C, maxLength: 100, type: "text", value: x, onChange: e => { var t; t = e.target.value, q || K || v(t) }, onFocus: () => { W() }, placeholder: a("components.discover.worldLiveDetail.chatPlaceholder"), className: "min-w-0 flex-1 border-0 bg-transparent text-sm text-white shadow-none outline-none placeholder:text-white/40 read-only:cursor-default disabled:cursor-not-allowed disabled:opacity-50", disabled: q, readOnly: K, "aria-busy": K, onKeyDown: e => { K || _.loading || R || "Enter" !== e.key || e.shiftKey || e.nativeEvent.isComposing || (e.preventDefault(), $()) } }), (0, i.jsx)(m.$, { type: "gradient", size: "small", shape: "round", icon: (0, i.jsx)(h.J, { className: "relative right-0.5" }), "aria-label": a("components.discover.worldLiveDetail.sendChat"), onClick: $, disabled: G, loading: K })] })] })] }) : (0, i.jsx)("div", { className: "relative z-10 flex min-h-0 flex-1 flex-col items-center pt-3", children: (0, i.jsx)(m.$, { type: "secondary", size: "small", shape: "round", onClick: () => n(!0), "aria-label": a("components.discover.worldLiveDetail.openChat"), icon: (0, i.jsx)(z, { className: "text-2xl text-white" }) }) })] }) } var L = n(88355), _ = n(89671), E = n(52054), Z = n(5284), R = n(28858); function T() { var e, t, n, r; let { liveInfo: c } = u.Z.useOptions(), { t: d } = (0, o.Bd)(), h = null != (n = null == c || null == (e = c.preset_info) ? void 0 : e.title) ? n : "", x = null != (r = null == c || null == (t = c.creator) ? void 0 : t.avatar) ? r : null, p = (0, R.kE)(), { recordShare: f, reportExit: v } = (0, M.r)(), { shareLiveItem: w } = (0, R.nV)(), [b, g] = (0, l.useState)(!0), [j, N] = (0, l.useState)(0); return (0, l.useEffect)(() => { let e = window.setTimeout(() => N(1), 5e3), t = window.setTimeout(() => g(!1), 1e4); return () => { window.clearTimeout(e), window.clearTimeout(t) } }, []), (0, i.jsxs)("header", { className: "pointer-events-none absolute top-0 right-0 left-0 z-20 px-4 pb-28 sm:pb-36", children: [(0, i.jsx)("div", { className: "pointer-events-none absolute inset-0 -z-10", "aria-hidden": !0 }), (0, i.jsxs)("div", { className: "relative flex h-14 items-center gap-2 sm:gap-3", children: [(0, i.jsxs)("div", { className: "pointer-events-auto flex max-w-[40%] min-w-0 shrink-0 items-center gap-2", children: [(0, i.jsx)(m.$, { type: "secondary", size: "small", shape: "round", icon: (0, i.jsx)(_.A, { className: "size-5 text-white" }), "aria-label": d("components.discover.worldLiveDetail.back"), onClick: () => { v("back_prev_page"), p.push("/discover/gallery/") } }), (0, i.jsxs)("div", { className: "flex items-center gap-2 rounded-full bg-black/40 px-2 py-1 backdrop-blur-md", children: [(0, i.jsx)(y.e, { src: x, size: 24, className: "shrink-0 rounded-full object-cover ring-1 ring-white/10" }), (0, i.jsx)("div", { children: (0, i.jsx)("p", { className: "min-w-0 truncate text-sm font-medium text-white", children: h }) })] })] }), (0, i.jsx)(a.N, { children: b ? (0, i.jsx)(s.P.div, { className: (0, L.A)("mx-auto flex min-h-9 w-full max-w-[min(100%,30rem)] items-center justify-center overflow-hidden rounded-[12px] px-4 py-2 text-center text-xs text-white shadow-md sm:text-sm", "bg-live-viewer-banner"), initial: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -12 }, transition: { duration: .55, ease: [.22, 1, .36, 1] }, role: "status", "aria-live": "polite", children: (0, i.jsx)(a.N, { mode: "wait", children: 0 === j ? (0, i.jsxs)(s.P.div, { className: "flex min-w-0 items-center justify-center gap-0", initial: !1, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -8 }, transition: { duration: .38, ease: [.22, 1, .36, 1] }, children: [(0, i.jsx)(Z.K, { className: "shrink-0 bg-transparent" }), (0, i.jsx)("span", { className: "min-w-0", children: d("components.discover.worldLiveDetail.viewerPromptBanner1") })] }, "viewer-banner-1") : (0, i.jsxs)(s.P.div, { className: "flex min-w-0 items-center justify-center gap-0", initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -8 }, transition: { duration: .38, ease: [.22, 1, .36, 1] }, children: [(0, i.jsx)(Z.K, { className: "shrink-0 bg-transparent" }), d("components.discover.worldLiveDetail.viewerPromptBanner2")] }, "viewer-banner-2") }) }, "viewer-prompt-banner") : null }), (0, i.jsx)("div", { className: "pointer-events-auto ml-auto flex items-center justify-center", children: (0, i.jsx)(m.$, { type: "secondary", size: "small", shape: "round", className: "ml-3", icon: (0, i.jsx)(E.G, { className: "text-lg text-white" }), onClick: () => { var e, t; f(), w({ sessionId: null == c ? void 0 : c.db_session_id, liveType: null == c || null == (e = c.extra) ? void 0 : e.extraType, presetId: null == c || null == (t = c.preset_info) ? void 0 : t.preset_id, from: "share" }) } }) })] })] }) } var P = n(11353), I = n(62902), B = n(93397), H = n(15313), O = n(11656), F = n(25234); function $(e) { let { detailAudioMuted: t, videoPublisherUid: n } = e, l = (0, P.iT)(), a = !t, s = l.filter(e => null != n && Number(e.uid) === Number(n)).map(e => (0, i.jsx)(P.aG, { user: e, playVideo: !0, playAudio: a, className: (0, L.$)("h-full w-full", "object-cover", { "rounded-lg": !0 }) }, e.uid)); return (0, i.jsx)("div", { className: (0, L.$)("flex h-full min-h-0 w-full min-w-0 flex-col"), children: s }) } function K(e) { let { state: t } = e; return (0, i.jsxs)("div", { className: (0, L.$)("relative z-1 flex h-full w-full items-center justify-center"), children: [(0, i.jsx)(I.A, { className: (0, L.$)("absolute! top-0 left-0 z-0 h-full w-full"), color1: "#423900", color2: "#040024", color3: "#3b006b", timeSpeed: 1.45, colorBalance: -.02, warpStrength: 1.4, warpFrequency: 5, warpSpeed: 2.3, warpAmplitude: 36, blendAngle: -94, blendSoftness: .29, rotationAmount: 480, noiseScale: 2.35, grainAmount: .18, grainScale: 2.2, grainAnimated: !1, contrast: 1.55, gamma: 1.6, saturation: 1.65, centerX: -.02, centerY: 0, zoom: 1.65 }), "connecting" === t ? (0, i.jsx)(F.R, {}) : "block" === t ? (0, i.jsx)(B.e, {}) : "error" === t ? (0, i.jsx)(O.$, {}) : (0, i.jsx)(H.o, {})] }) } function q(e) { let { detailAudioMuted: t } = e, { sessionState: n } = u.Z.useData(), { liveInfo: l } = u.Z.useOptions(), a = null == l ? void 0 : l.server_uid; return "playing" === n ? (0, i.jsx)($, { detailAudioMuted: t, videoPublisherUid: a }, "playing") : (0, i.jsx)(K, { state: n }, "fallback") } var W = n(4273); function G() { return (0, i.jsx)("div", { className: "pointer-events-none absolute top-3 right-3 z-35 flex items-center justify-center gap-1 rounded bg-white/10 px-2 py-1 text-xs text-white/60", children: (0, i.jsx)("span", { children: "HD" }) }) } function J(e) { let { muted: t, onToggle: n } = e; return (0, i.jsx)("div", { className: "pointer-events-none absolute inset-0 z-40 flex items-end justify-end p-3", children: (0, i.jsxs)("button", { type: "button", onClick: () => n(), className: "pointer-events-auto absolute right-3 bottom-3 rounded-full bg-black/60 p-2 text-white transition hover:bg-black/80", children: [(0, i.jsx)(W.A, { className: "h-4 w-4" }), t && (0, i.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: (0, i.jsx)("div", { className: "h-5 w-0.5 origin-center rotate-45 bg-white/80" }) })] }) }) } var U = n(43423), Y = n(10915); function V(e) { return Math.min(Math.max(e, 0), 1) } function X() { let { danmakuItems: e, completeDanmakuScroll: t } = u.Z.useData(), { on: n, off: a } = u.Z.useEvents(), s = (0, l.useRef)(null), [r, o] = (0, l.useState)(1), c = function(e, t) { let n = (0, l.useRef)(new Map).current, i = (0, l.useRef)(t); i.current !== t && (i.current = t, n.clear()); let a = Math.max(1, t), s = new Set(e.map(e => e.id)); for (let e of n.keys()) s.has(e) || n.delete(e); for (let t of e) if (!n.has(t.id)) { let e = Array(a).fill(0); for (let t of n.values()) t >= 0 && t < a && e[t]++; let i = 0; for (let t = 1; t < a; t++) e[t] < e[i] && (i = t); n.set(t.id, i) } return n }(e, r), [d, m] = (0, l.useState)(() => Date.now()), [h, x] = (0, l.useState)({}), [p, f] = (0, l.useState)({}); return (0, l.useEffect)(() => { let e = 0, t = () => { m(Date.now()), e = requestAnimationFrame(t) }; return e = requestAnimationFrame(t), () => cancelAnimationFrame(e) }, []), (0, l.useEffect)(() => { let e = e => { var t; let n = "string" == typeof e.prompt_id ? e.prompt_id.trim() : String(null != (t = e.prompt_id) ? t : "").trim(); if (!n) return; let i = 2e3 + 1e3 * Math.random(); x(e => ({ ...e, [n]: { until: Date.now() + i, durationMs: i } })), f(e => e[n] ? e : { ...e, [n]: !0 }) }; return n("prompt-responded", e), () => a("prompt-responded", e) }, [n, a]), (0, l.useEffect)(() => { x(e => { if (0 === Object.keys(e).length) return e; let t = {}; for (let [n, i] of Object.entries(e)) i.until > d && (t[n] = i); return Object.keys(t).length === Object.keys(e).length ? e : t }) }, [d]), (0, l.useLayoutEffect)(() => { let e = s.current; if (!e) return; let t = () => { let t = e.getBoundingClientRect().height; if (t <= 0) return; let n = Math.max(1, Math.floor(t / 52)); o(e => e === n ? e : n) }; t(); let n = new ResizeObserver(t); return n.observe(e), () => n.disconnect() }, []), (0, i.jsx)(Y.Bc, { delayDuration: 280, children: (0, i.jsx)("div", { ref: s, className: "pointer-events-none absolute inset-0 z-30 overflow-visible", style: { containerType: "inline-size" }, "aria-hidden": !0, children: e.map(e => { var n; return (0, i.jsx)(Q, { item: e, track: null != (n = c.get(e.id)) ? n : 0, trackCount: r, now: d, respondEffect: h[e.prompt_id], pickedShown: !!p[e.prompt_id], onScrollComplete: () => t({ id: e.id, prompt_id: e.prompt_id }) }, e.id) }) }) }) } function Q(e) { var t, n; let a, s, { item: c, track: d, trackCount: u, now: m, respondEffect: h, pickedShown: x, onScrollComplete: f } = e, { t: v } = (0, o.Bd)(), { userInfo: w } = (0, p.kH)(), b = 100 / Math.max(1, u), [g, j] = (0, l.useState)(!1), N = (0, l.useRef)(0), k = (0, l.useRef)(null), C = (0, l.useRef)(null), z = (0, l.useRef)(!1), M = m - c.timestamp, D = V(M / 3e4), A = (0, l.useCallback)(() => { N.current = V((Date.now() - c.timestamp) / 3e4), j(!0) }, [c.timestamp]), S = (0, l.useCallback)(() => { let e = Date.now(), t = V((e + 500 - c.timestamp) / 3e4); k.current = { startAt: e, fromP: N.current, toP: t }, j(!1) }, [c.timestamp]), _ = k.current; if (_ && (m - _.startAt) / 500 >= 1 && (k.current = null), g) a = N.current, s = 1; else if (k.current) { let e = k.current, n = 1 - (1 - V((m - e.startAt) / 500)) ** 3; t = e.fromP, a = t + (e.toP - t) * n, s = 1 } else if (M >= 3e4) { if (!C.current) { let e = D >= .999; C.current = { startAt: m, fromP: D, fade: e } } let e = C.current, t = (m - e.startAt) / 500; if (t < 1) { let i = 1 - (1 - V(t)) ** 3; e.fade ? (a = 1, s = 1 + -1 * i) : (a = (n = e.fromP) + (1 - n) * i, s = 1) } else a = 1, s = +!e.fade } else a = D, s = 1; (0, l.useEffect)(() => { if (z.current) return; let e = C.current; e && (m - e.startAt < 500 || (z.current = !0, f())) }, [m, f]); let E = !w.loading && w.accountId > 0 && null == w.error && Number(w.accountId) === Number(c.uid), Z = E ? "@You" : "@".concat(c.name || "—"), R = "translateY(-50%) translateX(calc(".concat(1 - a, " * 100cqw - ").concat(a, " * 100% - ").concat(a, " * 100cqw))"), T = null != h && m < h.until, P = T && h ? { "--danmaku-respond-ms": "".concat(h.durationMs, "ms"), "--danmaku-text-sweep-ms": "".concat(Math.round(2.15 * h.durationMs), "ms") } : void 0; return (0, i.jsx)("div", { className: "absolute right-0 left-0 overflow-visible", style: { top: "".concat(d * b, "%"), height: "".concat(b, "%") }, children: (0, i.jsx)("div", { role: "presentation", className: "pointer-events-auto absolute top-1/2 left-0 will-change-transform", style: { transform: R, opacity: s }, children: (0, i.jsxs)(U.bL, { children: [(0, i.jsx)(U.l9, { asChild: !0, children: (0, i.jsxs)("div", { className: (0, r.cn)("flex max-w-[min(45cqw,100%)] min-w-0 cursor-default items-center gap-2 rounded-full px-2 py-2 pr-3 text-sm", E && "bg-black/40 shadow-sm ring-1 ring-white/10", T && "danmaku-respond-pulse"), style: P, onPointerEnter: A, onPointerLeave: S, children: [(0, i.jsx)(y.e, { src: c.avatar, size: 28, className: "shrink-0 rounded-full object-cover ring-1 ring-white/25" }), (0, i.jsxs)("span", { className: "flex min-w-0 flex-1 items-center gap-2", children: [(0, i.jsx)("span", { className: (0, L.A)("mr-1 shrink-0 font-medium", { "text-amber-200/95": E, "font-medium text-white": !E }), children: Z }), (0, i.jsx)("span", { className: (0, r.cn)("min-w-0 flex-1 overflow-x-hidden rounded-sm text-ellipsis whitespace-nowrap", T ? "danmaku-respond-text-gradient-sweep" : "text-white/95"), children: c.prompt }), x && (0, i.jsx)("span", { className: (0, r.cn)("danmaku-picked-badge shrink-0 text-white", T && "danmaku-picked-badge-enter"), style: { background: "rgba(251, 191, 36, 0.45)" }, children: v("components.discover.worldLiveDetail.picked") })] })] }, T && h ? "r-".concat(h.until) : "idle") }), (0, i.jsx)(Y.ZI, { side: "top", sideOffset: 6, className: "max-w-[min(85vw,22rem)] text-left", children: (0, i.jsx)("span", { className: "block text-xs leading-relaxed wrap-break-word", children: c.prompt }) })] }) }) }) } function ee(e) { var t; let { detailAudioMuted: n, onDetailAudioMutedChange: a } = e, { liveInfo: s } = u.Z.useOptions(), r = (null == s || null == (t = s.preset_info) ? void 0 : t.aspect_ratio) === "16:9", o = (0, l.useMemo)(() => (0, i.jsx)("div", { className: "pointer-events-none absolute inset-0 z-30 overflow-visible", children: (0, i.jsx)(X, {}) }), []); return (0, i.jsxs)("div", { className: "relative flex min-h-0 flex-1", children: [(0, i.jsx)("div", { className: "pointer-events-none absolute inset-0 z-0 bg-black" }), (0, i.jsx)("div", { className: "relative z-10 flex min-h-0 min-w-0 flex-1 items-center justify-center py-9", style: { paddingLeft: 36, paddingRight: 36 }, children: (0, i.jsx)("div", { className: "relative mx-auto aspect-video max-h-full min-h-0 w-full shrink-0 overflow-visible", style: { maxWidth: 1280 }, children: (0, i.jsxs)("div", { className: "relative h-full w-full overflow-visible", children: [r ? (0, i.jsxs)("div", { className: "absolute inset-0 overflow-visible", children: [(0, i.jsx)("div", { className: "absolute inset-0 overflow-hidden bg-black", children: (0, i.jsx)(q, { detailAudioMuted: n }) }), o, (0, i.jsx)(G, {})] }) : (0, i.jsxs)("div", { className: "absolute inset-0 flex items-center justify-center overflow-visible bg-black", children: [(0, i.jsxs)("div", { className: "relative aspect-9/16 h-full w-auto max-w-full shrink-0 overflow-visible", children: [(0, i.jsx)(q, { detailAudioMuted: n }), (0, i.jsx)(G, {})] }), o] }), (0, i.jsx)("div", { className: "pointer-events-none absolute inset-0 z-40 overflow-visible", children: (0, i.jsx)(J, { muted: n, onToggle: () => { a(!n) } }) })] }) }) })] }) } function et(e) { let { detailAudioMuted: t, onDetailAudioMutedChange: n } = e, [o, c] = (0, l.useState)(!0); return (0, i.jsx)(a.N, { children: (0, i.jsx)(s.P.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, className: (0, r.cn)("fixed inset-0 top-0 right-0 bottom-0 left-0 z-1002 bg-black text-white"), children: (0, i.jsx)("div", { className: "h-dvh max-h-dvh w-full touch-pan-y overflow-auto overscroll-contain md:h-screen md:max-h-screen", style: { WebkitOverflowScrolling: "touch" }, children: (0, i.jsxs)("div", { className: "bg-default-live-shell-bg mx-auto box-border flex h-full max-h-full min-h-0 w-full min-w-0 flex-row items-stretch", style: { minWidth: 960, maxWidth: 1920, minHeight: 560 }, children: [(0, i.jsxs)("section", { className: "relative flex min-h-0 min-w-0 flex-1 flex-col self-stretch", children: [(0, i.jsx)(T, {}), (0, i.jsx)("div", { className: "relative flex min-h-0 flex-1 flex-col", children: (0, i.jsx)(ee, { detailAudioMuted: t, onDetailAudioMutedChange: n }) }), (0, i.jsx)(w, {})] }), (0, i.jsx)(S, { open: o, onOpenChange: c })] }) }) }) }) } }, 18708: (e, t, n) => { n.d(t, { T: () => s }); var i = n(25771), l = n(87163), a = n(51529); let s = l.forwardRef(function(e, t) { let { className: n, ...l } = e; return (0, i.jsx)("textarea", { ref: t, "data-slot": "textarea", className: (0, a.cn)("placeholder:text-muted-foreground aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-lg border bg-transparent p-4 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", n), ...l }) }) }, 20622: (e, t, n) => { n.d(t, { e: () => o }); var i = n(25771), l = n(87163), a = n(51529), s = n(57425); let r = e => { let { className: t = "", ...n } = e, a = (0, l.useMemo)(() => ({ body: '', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }), []); return (0, i.jsx)("div", { className: t, style: { height: "1em", aspectRatio: 1 }, children: (0, i.jsx)(s.In, { ...n, icon: a, height: "1em" }) }) }; function o(e) { let { src: t, size: n = 40, fallbackIconSize: s = 28, alt: o = "", className: c, loading: d = "lazy" } = e, u = "string" == typeof t ? t.trim() : "", m = "" !== u, [h, x] = (0, l.useState)(!1); return (0, l.useEffect)(() => { x(!1) }, [u]), (0, i.jsx)("div", { className: (0, a.cn)("relative box-border flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-700 text-neutral-400 ring-1 ring-white/10", c), style: { width: n, height: n, fontSize: s }, children: m && !h ? (0, i.jsx)("img", { src: u, alt: o, width: n, height: n, className: "h-full w-full object-cover", onError: () => x(!0), loading: d, fetchPriority: "low", decoding: "async" }) : (0, i.jsx)(r, { className: "shrink-0 rounded-full object-cover opacity-[0.16]" }) }) } }, 52054: (e, t, n) => { n.d(t, { G: () => s }); var i = n(25771); n(87163); var l = n(57425); let a = { body: '', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }, s = e => { let { className: t = "", ...n } = e; return (0, i.jsx)("div", { className: t, style: { height: "1em", aspectRatio: 1 }, children: (0, i.jsx)(l.In, { ...n, icon: a, height: "1em" }) }) } }, 91665: (e, t, n) => { n.d(t, { A: () => o }); var i = n(25771), l = n(87163), a = n(54638), s = n(58787), r = n(77760); function o(e) { let { to: t, from: n = 0, direction: o = "up", delay: c = 0, duration: d = 2, className: u = "", startWhen: m = !0, separator: h = "", onStart: x, onEnd: p } = e, f = (0, l.useRef)(null), v = (0, a.d)("down" === o ? t : n), w = (0, s.z)(v, { damping: 20 + 1 / d * 40, stiffness: 1 / d * 100 }), b = (0, r.W)(f, { once: !0, margin: "0px" }), g = e => { let t = e.toString(); if (t.includes(".")) { let e = t.split(".")[1]; if (0 !== parseInt(e)) return e.length } return 0 }, j = Math.max(g(n), g(t)), y = (0, l.useCallback)(e => { let t = j > 0, n = Intl.NumberFormat("en-US", { useGrouping: !!h, minimumFractionDigits: t ? j : 0, maximumFractionDigits: t ? j : 0 }).format(e); return h ? n.replace(/,/g, h) : n }, [j, h]); return (0, l.useEffect)(() => { f.current && (f.current.textContent = y("down" === o ? t : n)) }, [n, t, o, y]), (0, l.useEffect)(() => { if (b && m) { "function" == typeof x && x(); let e = setTimeout(() => { v.set("down" === o ? n : t) }, 1e3 * c), i = setTimeout(() => { "function" == typeof p && p() }, 1e3 * c + 1e3 * d); return () => { clearTimeout(e), clearTimeout(i) } } }, [b, m, v, o, n, t, c, x, p, d]), (0, l.useEffect)(() => { let e = w.on("change", e => { f.current && (f.current.textContent = y(Number(e))) }); return () => e() }, [w, y]), (0, i.jsx)("span", { className: u, ref: f }) } }, 99351: (e, t, n) => { n.d(t, { J: () => s }); var i = n(25771); n(87163); var l = n(57425); let a = { body: '', viewBox: { left: 0, top: 0, width: 24, height: 24 }, left: 0, top: 0, width: 24, height: 24 }, s = e => { let { className: t = "", ...n } = e; return (0, i.jsx)("div", { className: t, style: { height: "1em", aspectRatio: 1 }, children: (0, i.jsx)(l.In, { ...n, icon: a, height: "1em" }) }) } } } ]);