"use strict"; (self.webpackChunk_N_E = self.webpackChunk_N_E || []).push([ [6136], { 22199: (e, t, r) => { r.d(t, { Nn: () => g, Ok: () => C, Zp: () => x, b1: () => D, iy: () => R, kR: () => b }); let i = ["prod", "gray", "pre", "daily", "local"], s = { realtime_entry_click: "用户点击 create/explore,创建本次进入实时生成的端到端 trace 起点。", realtime_entry_prefetch: "实时生成入口预加载触发,用于判断 route/module prefetch 是否提前命中。", realtime_reservation_create_start: "前端开始调用预约创建接口。", realtime_reservation_create_success: "预约创建接口返回成功,可能是 PENDING 或 ACTIVE。", realtime_reservation_active: "预约已进入 ACTIVE,可跳转或继续进入实时生成页面。", realtime_create_world_start: "create 路径开始创建 World/Preset。", realtime_create_world_task_created: "create 路径已拿到异步创建任务 ID。", realtime_create_world_task_success: "create 路径异步创建任务完成,已拿到 preset_id。", realtime_route_push_start: "前端开始跳转到实时生成播放页。", realtime_page_mount: "实时生成播放页客户端已挂载,开始校验缓存、预约和页面数据。", realtime_page_bootstrap_ready: "实时生成播放页启动数据已就绪,可以挂载播放器。", realtime_page_enter: "实时生成组件已挂载,准备建立 WebSocket 连接。", realtime_ws_connect_start: "前端开始建立实时生成 WebSocket 连接。", realtime_ws_connect_timeout: "WebSocket 连接在阈值内未打开。", realtime_ws_open: "WebSocket 已打开,前端可以接收 session_init。", realtime_ws_close: "WebSocket 已关闭,用于判断是否在首帧前异常断开。", realtime_ws_error: "WebSocket 连接或收发出现错误。", realtime_session_init_received: "前端收到服务端 session_init,拿到 Agora 入会配置。", realtime_session_resumed: "前端收到 session_resumed,恢复已有实时生成会话。", realtime_agora_config_set: "前端已写入 Agora app/channel/token/uid 配置。", realtime_agora_role_ready: "Agora client role 设置完成或失败。", realtime_agora_join_success: "Agora 入会成功,开始等待或订阅远端推流。", realtime_agora_join_error: "Agora 入会失败。", realtime_agora_join_timeout: "Agora 入会在阈值内未成功。", realtime_agora_user_published: "Agora 远端用户发布 audio/video,用于判断媒体流是否恢复。", realtime_agora_user_unpublished: "Agora 远端用户取消发布 audio/video,用于定位黑屏或无声风险。", realtime_agora_user_unpublished_timeout: "Agora 远端媒体取消发布后长时间未恢复,video 类型通常对应黑屏风险。", realtime_network_quality_first_sent: "首个网络质量上报已发送到服务端。", realtime_init_message_attempt: "前端准备发送 init_message,启动生成初始化。", realtime_init_message_success: "init_message 已成功写入 WebSocket。", realtime_init_message_fail: "init_message 发送失败或被前端前置校验拦截。", realtime_generation_started: "服务端下发 generation_started;R2 链路下可近似视为 Pusher/生成任务已启动。", realtime_first_remote_video_published: "Agora 首次发现远端视频轨道发布。", realtime_first_video_frame_visible: "前端首次把远端视频轨道挂载到播放器,用户应能看到首帧。", realtime_ws_open_no_init_timeout: "WebSocket 已打开但 init_message 在阈值内未发送。", realtime_reservation_close: "用户离开、刷新或回退时关闭实时生成预约。", realtime_retry: "用户触发实时生成重连。", realtime_black_screen: "实时生成播放过程中检测到黑屏风险。", realtime_slow_request: "实时生成链路中检测到慢请求。", realtime_js_error: "实时生成链路中捕获到前端 JavaScript 异常。" }, n = !1, a = null, o = null, l = [], c = [], u = [], _ = !1, m = new Set, d = (e, t, r) => { if (!m.has(e) && (m.add(e), void 0 === r)) return }, p = () => { if (!(() => { let e = "pixverse-production".trim(), t = "pixverse-production".trim(); return !!e && !!t && e === t })()) return null; let e = (() => { let e = "https://proj-xtrace-e24493df886b549ceb363feb034ec7-us-west-1.us-west-1.log.aliyuncs.com/rum/web/v2".trim(); if (!e) return ""; let t = "default-cms-1231290438989032-us-west-1".trim(), r = "c4gf0oeajs@eb392831a2727a59c58f8".trim(); if (!t && !r) return e; try { let i = new URL(e); return t && i.searchParams.set("workspace", t), r && i.searchParams.set("service_id", r), i.toString() } catch (e) { return "" } })(), t = (() => { let e = "prod".trim(); return i.includes(e) ? e : null })(); return e && t ? { endpoint: e, env: t, tracing: !0 } : null }, g = () => !!p(), f = () => { var e; let t = null == (e = window.RumSDK) ? void 0 : e.default; return t && "function" == typeof t.init && "function" == typeof t.sendCustom ? t : null }, v = (e, t) => { if ("function" == typeof e.sendException) return void e.sendException({ name: t.name, message: t.message, properties: t.properties }); d("send-exception-fallback", "sendException 不可用,告警事件降级为 sendCustom。"), e.sendCustom({ type: "alert", group: "alert", name: t.name, value: 1, properties: { ...t.properties, alert_message: t.message } }) }, w = (e, t) => { if ("function" == typeof e.sendResource) return void e.sendResource({ name: t.name, type: t.type, duration: t.duration, success: t.success, method: t.method, status_code: t.status_code, message: t.message, url: t.url, properties: t.properties }); d("send-resource-fallback", "sendResource 不可用,告警事件降级为 sendCustom。"), e.sendCustom({ type: "alert", group: "alert", name: t.name, value: 1, properties: t.properties }) }, h = async () => { let e = Date.now() + 1500; for (; Date.now() <= e;) { let e = f(); if (e) return e; if (_) return null; await new Promise(e => { window.setTimeout(e, 50) }) } return f() }, b = e => { _ = !0, a = null, o = null, l = [], c = [], u = [], d("script-load-error", "官方 CDN SDK 加载失败,已跳过 ARMS 初始化。", e) }, y = function() { let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = {}; return Object.entries(e).forEach(e => { let [r, i] = e; if (void 0 !== i) { if ("string" == typeof i) { t[r] = i.slice(0, 256); return } t[r] = i } }), t }, k = e => ({ event_client_ts: e, event_client_time: new Date(e).toISOString() }), S = e => e.length > 100 ? e.slice(-100) : e, C = async () => { let e = p(); return !!e && (!!n || a || (a = (async () => { let t = await h(); if (!t) return a = null, d("sdk-unavailable", "window.RumSDK.default 不可用,已跳过本次初始化。"), !1; try { return await t.init({ endpoint: e.endpoint, env: e.env, spaMode: "history", collectors: { perf: !0, webVitals: !0, api: !0, staticResource: !0, jsError: !0, consoleError: !0, action: !0 }, tracing: e.tracing }), n = !0, A(), !0 } catch (e) { return n = !1, a = null, d("init-failed", "SDK 初始化失败,已保留自定义事件队列等待后续重试。", e), !1 } })())) }; function A() { return p() ? o || (o = (async () => { if (!await C()) return; let e = f(); if (e) { for (; c.length > 0;) { let t = c[0]; if (!t) { c.shift(); continue } try { v(e, t), c.shift() } catch (e) { d("send-exception-failed", "sendException 上报失败,已保留队列等待重试。", e); break } } for (; u.length > 0;) { let t = u[0]; if (!t) { u.shift(); continue } try { w(e, t), u.shift() } catch (e) { d("send-resource-failed", "sendResource 上报失败,已保留队列等待重试。", e); break } } for (; l.length > 0;) { let t = l[0]; if (!t) { l.shift(); continue } try { e.sendCustom({ type: t.type, name: t.name, group: t.group, value: t.value, properties: t.properties }), l.shift() } catch (e) { d("send-custom-failed", "sendCustom 上报失败,已保留队列等待重试。", e); break } } } })().catch(() => {}).finally(() => { o = null })) : (l = [], c = [], u = [], Promise.resolve()) } let E = async e => { if (p()) { var t; t = (e => { let { name: t, type: r, group: i, value: s = 1, properties: n } = e, a = Date.now(); return { name: t, type: r, group: i, value: s, queuedAt: a, properties: y({ ...k(a), ...n }) } })(e), l = S([...l, t]), A() } }, D = e => { var t; if (!p()) return; let r = Date.now(); t = { name: e.name, message: e.message.slice(0, 256), properties: y({ ...k(r), ...e.properties }), queuedAt: r }, c = S([...c, t]), A() }, R = e => { var t; if (!p()) return; let r = Date.now(); t = { ...e, properties: y({ ...k(r), ...e.properties }), queuedAt: r }, u = S([...u, t]), A() }, x = (e, t, r) => E({ type: "realtime", group: "realtime", name: e, value: r, properties: { event_desc_zh: s[e], ...t } }) }, 52286: (e, t, r) => { r.d(t, { AB: () => m, CF: () => u, GN: () => l, eq: () => f, jv: () => _, nN: () => v, us: () => g, x2: () => p, xE: () => c, ye: () => d }); let i = "", s = "", n = !1, a = !1, o = !1, l = e => { i = null != e && "" !== String(e) ? String(e) : "" }, c = e => { let t = null == e ? void 0 : e.trim(); s = null != t ? t : "" }, u = () => i, _ = () => s, m = e => { n = e }, d = e => { a = e }, p = e => { o = e }, g = () => n, f = () => a, v = () => o }, 76136: (e, t, r) => { r.d(t, { Tm: () => o, cS: () => a, cq: () => l }); var i = r(52286), s = r(22199); function n(e) { var t, r, s, n; let a = String(null != (r = null != (t = null == e ? void 0 : e.db_session_id) ? t : (0, i.CF)()) ? r : "").trim(), o = String(null != (n = null != (s = null == e ? void 0 : e.trace_id) ? s : (0, i.jv)()) ? n : "").trim(), l = "".concat(window.location.pathname).concat(window.location.search); return { ...e, ...a ? { db_session_id: a } : {}, ...o ? { trace_id: o } : {}, ...l ? { page: l } : {} } } function a(e) { let { stage: t, timeoutMs: r, code: i, source: a, details: o, dbSessionId: l, traceId: c, presetId: u, wsConnected: _, sessionInitReceived: m, hasAgoraConfig: d, agoraConnected: p } = e, g = n({ ...o, stage: t, ...i ? { code: i } : {}, ...a ? { source: a } : {}, timeout_ms: r, ...null != l ? { db_session_id: String(l) } : {}, ...null != c ? { trace_id: c } : {}, ...null != u ? { preset_id: String(u) } : {}, ...null != _ ? { ws_connected: +!!_ } : {}, ...null != m ? { session_init_received: +!!m } : {}, ...null != d ? { has_agora_config: +!!d } : {}, ...null != p ? { agora_connected: +!!p } : {} }); (0, s.b1)({ name: "RealtimeBlackScreen", message: "black screen | stage=".concat(t, " | code=").concat(i || "black_screen", " | timeout=").concat(r, "ms").slice(0, 256), properties: g }) } function o(e) { let { url: t, method: r, duration: i, status: a, traceId: o, dbSessionId: l } = e, c = n({ duration_ms: i, ...null != a ? { status: String(a) } : {}, ...null != o ? { trace_id: o } : {}, ...null != l ? { db_session_id: String(l) } : {} }); (0, s.iy)({ name: "realtime_slow_request", type: "api", duration: i, success: 0, method: r.toUpperCase(), status_code: null != a ? a : "slow", message: "slow request ".concat(r.toUpperCase(), " ").concat(t).slice(0, 256), url: t, properties: c }) } function l(e) { let { message: t, type: r, digest: i, traceId: a, dbSessionId: o } = e, l = n({ error_type: r, ...i ? { digest: i } : {}, ...null != a ? { trace_id: a } : {}, ...null != o ? { db_session_id: String(o) } : {} }); (0, s.b1)({ name: "RealtimeJsError", message: t.slice(0, 256), properties: l }) } } } ]);