6136-8412f4474e1f6640.js 21.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491
"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
                })
            }
        }
    }
]);