From e6c351efc226fae0e589b66d70c4a085ec47d55d Mon Sep 17 00:00:00 2001 From: Manus AI Date: Mon, 10 Aug 2026 05:39:59 +0800 Subject: [PATCH] fix: map nested device telemetry in console --- sdk/android-ui/src/lib/consoleApi.ts | 323 ++++++++++++++++++ .../{index-BzwMJihg.js => index-_B4qz-iN.js} | 14 +- sdk/app/static/console/index.html | 2 +- .../20260810_NAS设备详情字段映射修复.md | 24 ++ 4 files changed, 355 insertions(+), 8 deletions(-) create mode 100644 sdk/android-ui/src/lib/consoleApi.ts rename sdk/app/static/console/assets/{index-BzwMJihg.js => index-_B4qz-iN.js} (54%) create mode 100644 开发文档/8、部署/06-存客宝宝塔/20260810_NAS设备详情字段映射修复.md diff --git a/sdk/android-ui/src/lib/consoleApi.ts b/sdk/android-ui/src/lib/consoleApi.ts new file mode 100644 index 0000000000..0d1124d964 --- /dev/null +++ b/sdk/android-ui/src/lib/consoleApi.ts @@ -0,0 +1,323 @@ +import { + EMPTY_CONSOLE_DATA, + emptyResource, + type ApiResource, + type AuthorizationGrant, + type AIOperationSummary, + type ConsoleApiData, + type ConsoleDevice, + type ConsoleDeviceGroup, + type ConsoleOverview, + type ConsoleRelease, + type EngineSummary, + type IntegrationApplication, + type IntegrationUsage, + type OverviewMetric, + type SecurityModule, + type SecurityModuleState, +} from "../types/console"; + +type RecordValue = Record; + +const isRecord = (value: unknown): value is RecordValue => + typeof value === "object" && value !== null && !Array.isArray(value); + +const text = (value: unknown): string | undefined => { + if (typeof value === "string" && value.trim()) return value; + if (typeof value === "number") return String(value); + return undefined; +}; + +const boolean = (value: unknown): boolean | undefined => { + if (typeof value === "boolean") return value; + if (["true", "1", "online", "connected", "running", "ready"].includes(String(value).toLowerCase())) return true; + if (["false", "0", "offline", "disconnected", "stopped"].includes(String(value).toLowerCase())) return false; + return undefined; +}; + +const number = (value: unknown): number | undefined => { + if (value === null || value === undefined || value === "") return undefined; + const parsed = typeof value === "number" ? value : Number(value); + return Number.isFinite(parsed) ? parsed : undefined; +}; + +const unwrap = (payload: unknown): unknown => { + if (!isRecord(payload)) return payload; + return payload.data ?? payload; +}; + +const errorMessage = (payload: unknown, fallback: string) => { + if (isRecord(payload)) { + const detail = payload.detail; + if (isRecord(detail)) return text(detail.message) || text(payload.message) || fallback; + return text(payload.message) || text(detail) || fallback; + } + return fallback; +}; + +const sourceTime = (value: unknown): string | undefined => { + if (!isRecord(value)) return undefined; + return text(value.sampled_at) || text(value.sampledAt) || text(value.server_time) || text(value.serverTime) || text(value.updated_at) || text(value.updatedAt); +}; + +async function readJson(path: string): Promise<{ ok: true; payload: unknown; status: number } | { ok: false; status: number; message: string }> { + try { + const response = await fetch(path, { method: "GET", credentials: "same-origin", headers: { Accept: "application/json" } }); + const payload = await response.json().catch(() => ({})); + if (!response.ok) return { ok: false, status: response.status, message: errorMessage(payload, `读取接口失败(${response.status})`) }; + return { ok: true, payload, status: response.status }; + } catch (error) { + return { ok: false, status: 0, message: error instanceof Error ? error.message : "读取接口失败" }; + } +} + +async function writeJson(path: string, method: "POST" | "PUT" | "DELETE", body?: unknown): Promise { + const response = await fetch(path, { method, credentials: "same-origin", headers: { Accept: "application/json", "Content-Type": "application/json", "X-Actor-Id": "console" }, body: body === undefined ? undefined : JSON.stringify(body) }); + const payload = await response.json().catch(() => ({})); + if (!response.ok) throw new Error(errorMessage(payload, `操作失败(${response.status})`)); + return unwrap(payload); +} + +export async function readSecurityModules(): Promise { + const result = await readJson("/api/v3/security/modules"); + if (!result.ok) throw new Error(result.message); + const value = unwrap(result.payload); + if (!isRecord(value) || !Array.isArray(value.modules)) throw new Error("安全模块接口返回格式错误"); + return value as unknown as SecurityModuleState; +} + +export async function setSecurityGlobal(enabled: boolean): Promise { + return await writeJson("/api/v3/security/modules/global", "PUT", { enabled }) as SecurityModuleState; +} + +export async function updateSecurityModule(id: string, body: { enabled?: boolean; name?: string; description?: string; config?: Record }): Promise { + return await writeJson(`/api/v3/security/modules/${encodeURIComponent(id)}`, "PUT", body) as SecurityModule; +} + +export async function createSecurityModule(body: { id: string; name: string; description: string; runtime_binding: string; config: Record }): Promise { + return await writeJson("/api/v3/security/modules", "POST", body) as SecurityModule; +} + +export async function removeSecurityModule(id: string): Promise { + await writeJson(`/api/v3/security/modules/${encodeURIComponent(id)}`, "DELETE"); +} + +const resource = (source: string, result: Awaited>, data?: T, sourceAt?: string): ApiResource => { + if (result.ok) return { state: "ready", data, source, sourceAt, status: result.status }; + return { + state: result.status === 401 || result.status === 403 ? "forbidden" : "unavailable", + source, + status: result.status, + error: result.message, + }; +}; + +async function readFirst(paths: string[], source: string, parse: (payload: unknown) => { data?: T; sourceAt?: string }): Promise> { + let last: Awaited> | undefined; + for (const path of paths) { + const result = await readJson(path); + if (result.ok) { + const parsed = parse(unwrap(result.payload)); + return resource(`GET ${path}`, result, parsed.data, parsed.sourceAt || sourceTime(unwrap(result.payload))); + } + last = result; + if (result.status !== 404) break; + } + return resource(source, last || { ok: false, status: 0, message: "读取接口失败" }); +} + +const asList = (value: unknown, keys: string[]): unknown[] => { + if (Array.isArray(value)) return value; + if (!isRecord(value)) return []; + for (const key of keys) if (Array.isArray(value[key])) return value[key] as unknown[]; + return []; +}; + +const stringList = (value: unknown): string[] | undefined => { + if (!Array.isArray(value)) return undefined; + const values = value.filter((item): item is string => typeof item === "string" && item.trim().length > 0); + return values.length ? values : undefined; +}; + +const normalizeDevice = (item: unknown): ConsoleDevice | undefined => { + if (!isRecord(item)) return undefined; + const deviceId = text(item.device_id) || text(item.deviceId) || text(item.id); + if (!deviceId) return undefined; + const rawWechat = isRecord(item.wechat) ? item.wechat : {}; + const rawAgent = isRecord(item.agent) ? item.agent : {}; + const rawHook = isRecord(item.hook) ? item.hook : {}; + // NAS 设备目录保留注册档案和心跳快照;控制台必须同时读取这两层真实上报。 + const deviceProfile = isRecord(item.device_profile) ? item.device_profile : {}; + const quickStatus = isRecord(item.quick_status) ? item.quick_status : {}; + const lastStatus = isRecord(item.last_status) ? item.last_status : {}; + const runtime = Object.keys(quickStatus).length ? quickStatus : lastStatus; + return { + deviceId, + name: text(item.name) || text(item.device_name) || text(deviceProfile.name), + model: text(item.model) || text(item.model_name) || text(deviceProfile.model), + androidVersion: text(item.android_version) || text(item.androidVersion) || text(item.os_version) || text(deviceProfile.android_version) || text(deviceProfile.os_version), + projectId: text(item.project_id) || text(item.projectId), + groupId: text(item.group_id) || text(item.groupId) || text(item.project_id), + status: text(item.status), + online: boolean(item.online) ?? boolean(item.ws_online) ?? (text(item.status) === "online" ? true : undefined), + agentVersion: text(item.agent_version) || text(item.agentVersion) || text(item.app_version) || text(deviceProfile.app_version), + agentRunning: boolean(item.agent_running) ?? boolean(rawAgent.running) ?? boolean(runtime.agent_running), + hookAvailable: boolean(item.hook_available) ?? boolean(item.supports_hook) ?? boolean(rawHook.available), + wechatRunning: boolean(item.wechat_running) ?? boolean(rawWechat.running) ?? boolean(runtime.wechat_running) ?? boolean(isRecord(runtime.wechat) ? runtime.wechat.running : undefined), + wechatId: text(item.wxid) || text(item.wechat_id) || text(rawWechat.id) || text(rawWechat.wechat_id) || text(runtime.wxid) || text(runtime.wechat_id), + friendCount: number(item.friend_count) ?? number(rawWechat.friend_count) ?? number(runtime.friend_count), + wechatVersion: text(item.wechat_version) || text(rawWechat.version) || text(runtime.wechat_version) || text(deviceProfile.wechat_version), + batteryPercent: number(item.battery_percent) ?? number(item.batteryPercent) ?? number(isRecord(item.battery) ? item.battery.percent : undefined) ?? number(runtime.battery_level) ?? number(runtime.battery), + networkType: text(item.network_type) || text(item.networkType) || text(isRecord(item.network) ? item.network.type : undefined) || text(runtime.network_type), + healthScore: number(item.health_score) ?? number(item.healthScore) ?? number(isRecord(item.health) ? item.health.score : undefined) ?? number(runtime.health_score), + tags: stringList(item.tags) || stringList(item.labels) || stringList(item.tag_names), + lastHeartbeat: text(item.last_heartbeat) || text(item.lastHeartbeat), + sourceAt: sourceTime(item) || text(item.last_heartbeat), + capabilities: Array.isArray(item.capabilities) ? item.capabilities.filter((entry): entry is string => typeof entry === "string") : undefined, + sourceKind: item.source_kind === "history" || item.sourceKind === "history" ? "history" : item.source_kind === "fixture" || item.sourceKind === "fixture" ? "fixture" : "live", + sourceLabel: text(item.source_label) || text(item.sourceLabel), + statusSource: text(item.status_source) || text(item.statusSource), + raw: item, + }; +}; + +const parseDevices = (value: unknown) => { + const rows = asList(value, ["devices", "items"]); + return rows.flatMap((item) => { + const normalized = normalizeDevice(item); + return normalized ? [normalized] : []; + }); +}; + +const readReadonlyDeviceStateFixture = (): { label: string; devices: ConsoleDevice[] } | undefined => { + const encoded = new URLSearchParams(window.location.search).get("device_state_fixture"); + if (!encoded) return undefined; + try { + const payload = JSON.parse(decodeURIComponent(escape(window.atob(encoded)))) as RecordValue; + if (payload.mode !== "readonly_fixture" || typeof payload.label !== "string") return undefined; + const devices = parseDevices(payload.devices).map((device) => ({ ...device, sourceKind: device.sourceKind || "fixture" })); + return { label: payload.label, devices }; + } catch { + return undefined; + } +}; + +const parseGroups = (value: unknown): ConsoleDeviceGroup[] => asList(value, ["items", "groups"]).flatMap((item) => { + if (!isRecord(item)) return []; + const groupId = text(item.group_id) || text(item.groupId) || text(item.id); + if (!groupId) return []; + return [{ + groupId, + name: text(item.name) || groupId, + memberCount: number(item.member_count) ?? number(item.memberCount), + deviceIds: Array.isArray(item.device_ids) ? item.device_ids.filter((entry): entry is string => typeof entry === "string") : undefined, + sourceAt: sourceTime(item), + }]; +}); + +const parseMetric = (value: unknown): unknown => value; + +export async function readConsoleData(): Promise { + const [overview, devices, groups, release, aiStatus, aiTasks, brain, connection, process, integrationHealth, applications, authorizations, usage, manifest, documents, knowledge] = await Promise.all([ + readFirst(["/api/v3/workbench/overview"], "GET /api/v3/workbench/overview", (value) => ({ data: isRecord(value) ? value as ConsoleOverview : undefined, sourceAt: sourceTime(value) })), + readFirst(["/api/v3/fleet/devices", "/api/v3/devices"], "GET /api/v3/fleet/devices", (value) => ({ data: parseDevices(value), sourceAt: sourceTime(value) })), + readFirst(["/api/v3/device-groups"], "GET /api/v3/device-groups", (value) => ({ data: parseGroups(value), sourceAt: sourceTime(value) })), + readFirst(["/api/v3/releases/latest"], "GET /api/v3/releases/latest", (value) => ({ data: isRecord(value) ? value as ConsoleRelease : undefined, sourceAt: sourceTime(value) || (isRecord(value) ? text(value.published_at) : undefined) })), + readFirst(["/api/v3/ai/status"], "GET /api/v3/ai/status", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst(["/api/v3/ai/tasks?limit=20"], "GET /api/v3/ai/tasks", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst(["/api/v3/ai/brain/dashboard"], "GET /api/v3/ai/brain/dashboard", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst(["/api/v3/connection/status"], "GET /api/v3/connection/status", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst(["/api/v3/process/status"], "GET /api/v3/process/status", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst(["/api/v3/integration/health"], "GET /api/v3/integration/health", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst(["/api/v3/integrations/apps", "/api/v3/integrations/clients"], "GET /api/v3/integrations/apps", (value) => ({ data: asList(value, ["items", "applications"]) as IntegrationApplication[], sourceAt: sourceTime(value) })), + readFirst(["/api/v3/integrations/authorizations", "/api/v3/authorization-grants"], "GET /api/v3/integrations/authorizations", (value) => ({ data: asList(value, ["items", "grants"]) as AuthorizationGrant[], sourceAt: sourceTime(value) })), + readFirst(["/api/v3/integrations/usage"], "GET /api/v3/integrations/usage", (value) => ({ data: isRecord(value) ? value as IntegrationUsage : undefined, sourceAt: sourceTime(value) })), + readFirst(["/api/v3/integration/manifest"], "GET /api/v3/integration/manifest", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst>>(["/api/v3/integrations/docs/catalog", "/api/v3/docs/catalog"], "GET /api/v3/integrations/docs/catalog", (value) => ({ data: asList(value, ["items", "documents"]) as Array>, sourceAt: sourceTime(value) })), + readFirst>>(["/api/v3/kb/search?limit=10"], "GET /api/v3/kb/search", (value) => ({ data: asList(value, ["items", "results", "documents"]) as Array>, sourceAt: sourceTime(value) })), + ]); + + const readonlyFixture = readReadonlyDeviceStateFixture(); + const deviceResource: ApiResource = readonlyFixture && devices.state === "ready" + ? { + ...devices, + source: `${devices.source} + readonly_fixture:${readonlyFixture.label}`, + data: [...(devices.data || []), ...readonlyFixture.devices], + } + : devices; + + const hookDeviceId = deviceResource.data?.[0]?.deviceId; + const hookStatus = hookDeviceId + ? await readFirst( + [`/api/v3/wechat/hook/status?device_id=${encodeURIComponent(hookDeviceId)}`], + "GET /api/v3/wechat/hook/status", + (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) }), + ) + : emptyResource("GET /api/v3/wechat/hook/status"); + + const taskItems = aiTasks.state === "ready" ? asList(aiTasks.data, ["items", "tasks"]) as Array> : []; + const selectedTaskId = taskItems.length && isRecord(taskItems[0]) ? text(taskItems[0].task_id) : undefined; + const [taskDetail, taskLogs, taskAudit] = selectedTaskId + ? await Promise.all([ + readFirst([`/api/v3/ai/tasks/${encodeURIComponent(selectedTaskId)}`], "GET /api/v3/ai/tasks/{task_id}", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst([`/api/v3/ai/tasks/${encodeURIComponent(selectedTaskId)}/logs`], "GET /api/v3/ai/tasks/{task_id}/logs", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + readFirst([`/api/v3/ai/tasks/${encodeURIComponent(selectedTaskId)}/audit`], "GET /api/v3/ai/tasks/{task_id}/audit", (value) => ({ data: isRecord(value) ? value : undefined, sourceAt: sourceTime(value) })), + ]) + : [emptyResource("GET /api/v3/ai/tasks/{task_id}"), emptyResource("GET /api/v3/ai/tasks/{task_id}/logs"), emptyResource("GET /api/v3/ai/tasks/{task_id}/audit")]; + const aiOperations: ApiResource = aiTasks.state === "ready" + ? { + state: "ready", + source: "GET /api/v3/ai/tasks + /logs + /audit", + sourceAt: [aiTasks.sourceAt, taskDetail.sourceAt, taskLogs.sourceAt, taskAudit.sourceAt].filter(Boolean).sort().at(-1), + data: { + items: taskItems, + selected: taskDetail.data, + logs: asList(taskLogs.data, ["items", "logs"]) as Array>, + audit: asList(taskAudit.data, ["items", "audit"]) as Array>, + }, + } + : { state: aiTasks.state, source: aiTasks.source, status: aiTasks.status, error: aiTasks.error }; + + const engineResource: ApiResource = + aiStatus.state === "ready" || brain.state === "ready" || connection.state === "ready" || process.state === "ready" || integrationHealth.state === "ready" + ? { + state: "ready", + source: "GET /api/v3/ai/status + /api/v3/ai/brain/dashboard + /api/v3/connection/status + /api/v3/process/status", + sourceAt: [aiStatus.sourceAt, brain.sourceAt, connection.sourceAt, process.sourceAt, integrationHealth.sourceAt].filter(Boolean).sort().at(-1), + data: { aiStatus: aiStatus.data, brain: brain.data, connection: connection.data, process: process.data, integrationHealth: integrationHealth.data }, + } + : { state: aiStatus.state === "forbidden" ? "forbidden" : "unavailable", source: "GET /api/v3/ai/status + /api/v3/ai/brain/dashboard", error: aiStatus.error || brain.error, status: aiStatus.status || brain.status }; + + return { + overview, + devices: deviceResource, + hookStatus, + groups, + release, + engine: engineResource, + aiOperations, + integrations: { applications, authorizations, usage, manifest, documents, knowledge }, + readAt: new Date().toISOString(), + }; +} + +export const apiMetric = (metric: unknown): OverviewMetric => { + if (!isRecord(metric)) return {}; + return { + value: metric.value as string | number | null | undefined, + display: text(metric.display), + status: text(metric.status), + source: text(metric.source), + sampled_at: text(metric.sampled_at), + }; +}; + +export const stale = (sourceAt?: string, maxAgeMinutes = 15) => { + if (!sourceAt) return false; + const timestamp = Date.parse(sourceAt); + return Number.isFinite(timestamp) && Date.now() - timestamp > maxAgeMinutes * 60 * 1000; +}; + +export const readFailureReason = (item: ApiResource) => item.error || (item.status === 403 ? "当前账号没有读取权限" : item.status === 401 ? "登录状态已失效" : "接口未接通或暂无数据"); + +export { EMPTY_CONSOLE_DATA }; diff --git a/sdk/app/static/console/assets/index-BzwMJihg.js b/sdk/app/static/console/assets/index-_B4qz-iN.js similarity index 54% rename from sdk/app/static/console/assets/index-BzwMJihg.js rename to sdk/app/static/console/assets/index-_B4qz-iN.js index 2e50924db2..1bbb8f868f 100644 --- a/sdk/app/static/console/assets/index-BzwMJihg.js +++ b/sdk/app/static/console/assets/index-_B4qz-iN.js @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var lc;function jf(){if(lc)return le;lc=1;var o=Symbol.for("react.element"),u=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),z=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),X=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),Y=Symbol.iterator;function R(h){return h===null||typeof h!="object"?null:(h=Y&&h[Y]||h["@@iterator"],typeof h=="function"?h:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},te=Object.assign,J={};function b(h,j,E){this.props=h,this.context=j,this.refs=J,this.updater=E||O}b.prototype.isReactComponent={},b.prototype.setState=function(h,j){if(typeof h!="object"&&typeof h!="function"&&h!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,h,j,"setState")},b.prototype.forceUpdate=function(h){this.updater.enqueueForceUpdate(this,h,"forceUpdate")};function Le(){}Le.prototype=b.prototype;function ze(h,j,E){this.props=h,this.context=j,this.refs=J,this.updater=E||O}var Ie=ze.prototype=new Le;Ie.constructor=ze,te(Ie,b.prototype),Ie.isPureReactComponent=!0;var fe=Array.isArray,ge=Object.prototype.hasOwnProperty,he={current:null},pe={key:!0,ref:!0,__self:!0,__source:!0};function we(h,j,E){var C,A={},ee=null,re=null;if(j!=null)for(C in j.ref!==void 0&&(re=j.ref),j.key!==void 0&&(ee=""+j.key),j)ge.call(j,C)&&!pe.hasOwnProperty(C)&&(A[C]=j[C]);var ue=arguments.length-2;if(ue===1)A.children=E;else if(1>>1,j=P[h];if(0<_(j,B))P[h]=B,P[L]=j,L=h;else break e}}function d(P){return P.length===0?null:P[0]}function y(P){if(P.length===0)return null;var B=P[0],L=P.pop();if(L!==B){P[0]=L;e:for(var h=0,j=P.length,E=j>>>1;h_(A,L))ee_(re,A)?(P[h]=re,P[ee]=L,h=ee):(P[h]=A,P[C]=L,h=C);else if(ee_(re,L))P[h]=re,P[ee]=L,h=ee;else break e}}return B}function _(P,B){var L=P.sortIndex-B.sortIndex;return L!==0?L:P.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var x=performance;o.unstable_now=function(){return x.now()}}else{var z=Date,I=z.now();o.unstable_now=function(){return z.now()-I}}var F=[],X=[],q=1,Y=null,R=3,O=!1,te=!1,J=!1,b=typeof setTimeout=="function"?setTimeout:null,Le=typeof clearTimeout=="function"?clearTimeout:null,ze=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ie(P){for(var B=d(X);B!==null;){if(B.callback===null)y(X);else if(B.startTime<=P)y(X),B.sortIndex=B.expirationTime,u(F,B);else break;B=d(X)}}function fe(P){if(J=!1,Ie(P),!te)if(d(F)!==null)te=!0,Ee(ge);else{var B=d(X);B!==null&&ie(fe,B.startTime-P)}}function ge(P,B){te=!1,J&&(J=!1,Le(we),we=-1),O=!0;var L=R;try{for(Ie(B),Y=d(F);Y!==null&&(!(Y.expirationTime>B)||P&&!Fe());){var h=Y.callback;if(typeof h=="function"){Y.callback=null,R=Y.priorityLevel;var j=h(Y.expirationTime<=B);B=o.unstable_now(),typeof j=="function"?Y.callback=j:Y===d(F)&&y(F),Ie(B)}else y(F);Y=d(F)}if(Y!==null)var E=!0;else{var C=d(X);C!==null&&ie(fe,C.startTime-B),E=!1}return E}finally{Y=null,R=L,O=!1}}var he=!1,pe=null,we=-1,Oe=5,je=-1;function Fe(){return!(o.unstable_now()-jeP||125h?(P.sortIndex=L,u(X,P),d(F)===null&&P===d(X)&&(J?(Le(we),we=-1):J=!0,ie(fe,L-h))):(P.sortIndex=j,u(F,P),te||O||(te=!0,Ee(ge))),P},o.unstable_shouldYield=Fe,o.unstable_wrapCallback=function(P){var B=R;return function(){var L=R;R=B;try{return P.apply(this,arguments)}finally{R=L}}}})(so)),so}var uc;function Nf(){return uc||(uc=1,io.exports=Ef()),io.exports}/** + */var ac;function Ef(){return ac||(ac=1,(function(o){function u(P,W){var M=P.length;P.push(W);e:for(;0>>1,j=P[h];if(0<_(j,W))P[h]=W,P[M]=j,M=h;else break e}}function d(P){return P.length===0?null:P[0]}function y(P){if(P.length===0)return null;var W=P[0],M=P.pop();if(M!==W){P[0]=M;e:for(var h=0,j=P.length,E=j>>>1;h_(L,M))ee_(re,L)?(P[h]=re,P[ee]=M,h=ee):(P[h]=L,P[C]=M,h=C);else if(ee_(re,M))P[h]=re,P[ee]=M,h=ee;else break e}}return W}function _(P,W){var M=P.sortIndex-W.sortIndex;return M!==0?M:P.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var x=performance;o.unstable_now=function(){return x.now()}}else{var z=Date,I=z.now();o.unstable_now=function(){return z.now()-I}}var A=[],Y=[],Z=1,X=null,O=3,F=!1,te=!1,J=!1,b=typeof setTimeout=="function"?setTimeout:null,Le=typeof clearTimeout=="function"?clearTimeout:null,ze=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ie(P){for(var W=d(Y);W!==null;){if(W.callback===null)y(Y);else if(W.startTime<=P)y(Y),W.sortIndex=W.expirationTime,u(A,W);else break;W=d(Y)}}function fe(P){if(J=!1,Ie(P),!te)if(d(A)!==null)te=!0,Ee(ge);else{var W=d(Y);W!==null&&ie(fe,W.startTime-P)}}function ge(P,W){te=!1,J&&(J=!1,Le(we),we=-1),F=!0;var M=O;try{for(Ie(W),X=d(A);X!==null&&(!(X.expirationTime>W)||P&&!Fe());){var h=X.callback;if(typeof h=="function"){X.callback=null,O=X.priorityLevel;var j=h(X.expirationTime<=W);W=o.unstable_now(),typeof j=="function"?X.callback=j:X===d(A)&&y(A),Ie(W)}else y(A);X=d(A)}if(X!==null)var E=!0;else{var C=d(Y);C!==null&&ie(fe,C.startTime-W),E=!1}return E}finally{X=null,O=M,F=!1}}var he=!1,pe=null,we=-1,Oe=5,je=-1;function Fe(){return!(o.unstable_now()-jeP||125h?(P.sortIndex=M,u(Y,P),d(A)===null&&P===d(Y)&&(J?(Le(we),we=-1):J=!0,ie(fe,M-h))):(P.sortIndex=j,u(A,P),te||F||(te=!0,Ee(ge))),P},o.unstable_shouldYield=Fe,o.unstable_wrapCallback=function(P){var W=O;return function(){var M=O;O=W;try{return P.apply(this,arguments)}finally{O=M}}}})(so)),so}var uc;function Nf(){return uc||(uc=1,io.exports=Ef()),io.exports}/** * @license React * react-dom.production.min.js * @@ -30,11 +30,11 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var cc;function Cf(){if(cc)return at;cc=1;var o=ao(),u=Nf();function d(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),F=Object.prototype.hasOwnProperty,X=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,q={},Y={};function R(e){return F.call(Y,e)?!0:F.call(q,e)?!1:X.test(e)?Y[e]=!0:(q[e]=!0,!1)}function O(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function te(e,t,n,r){if(t===null||typeof t>"u"||O(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function J(e,t,n,r,l,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new J(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new J(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new J(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new J(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new J(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new J(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new J(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new J(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new J(e,5,!1,e.toLowerCase(),null,!1,!1)});var Le=/[\-:]([a-z])/g;function ze(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Le,ze);b[t]=new J(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Le,ze);b[t]=new J(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Le,ze);b[t]=new J(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new J(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new J(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ie(e,t,n,r){var l=b.hasOwnProperty(t)?b[t]:null;(l!==null?l.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),A=Object.prototype.hasOwnProperty,Y=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Z={},X={};function O(e){return A.call(X,e)?!0:A.call(Z,e)?!1:Y.test(e)?X[e]=!0:(Z[e]=!0,!1)}function F(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function te(e,t,n,r){if(t===null||typeof t>"u"||F(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function J(e,t,n,r,l,s,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=a}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new J(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];b[t]=new J(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new J(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new J(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new J(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new J(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new J(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new J(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new J(e,5,!1,e.toLowerCase(),null,!1,!1)});var Le=/[\-:]([a-z])/g;function ze(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Le,ze);b[t]=new J(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Le,ze);b[t]=new J(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Le,ze);b[t]=new J(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new J(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new J("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new J(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ie(e,t,n,r){var l=b.hasOwnProperty(t)?b[t]:null;(l!==null?l.type!==0:r||!(2c||l[a]!==s[c]){var f=` -`+l[a].replace(" at new "," at ");return e.displayName&&f.includes("")&&(f=f.replace("",e.displayName)),f}while(1<=a&&0<=c);break}}}finally{E=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?j(e):""}function A(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=C(e.type,!1),e;case 11:return e=C(e.type.render,!1),e;case 1:return e=C(e.type,!0),e;default:return""}}function ee(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case pe:return"Fragment";case he:return"Portal";case Oe:return"Profiler";case we:return"StrictMode";case w:return"Suspense";case Be:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Fe:return(e.displayName||"Context")+".Consumer";case je:return(e._context.displayName||"Context")+".Provider";case _e:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case Ee:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}function re(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(t);case 8:return t===we?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ue(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ke(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ut(e){var t=ke(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qr(e){e._valueTracker||(e._valueTracker=ut(e))}function uo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ke(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ui(e,t){var n=t.checked;return L({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function co(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ue(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function fo(e,t){t=t.checked,t!=null&&Ie(e,"checked",t,!1)}function ci(e,t){fo(e,t);var n=ue(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?di(e,t.type,n):t.hasOwnProperty("defaultValue")&&di(e,t.type,ue(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function po(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function di(e,t,n){(t!=="number"||Kr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var nr=Array.isArray;function zn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Yr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var lr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_c=["Webkit","ms","Moz","O"];Object.keys(lr).forEach(function(e){_c.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),lr[t]=lr[e]})});function xo(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||lr.hasOwnProperty(e)&&lr[e]?(""+t).trim():t+"px"}function wo(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=xo(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ec=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function hi(e,t){if(t){if(Ec[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(d(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(d(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(d(61))}if(t.style!=null&&typeof t.style!="object")throw Error(d(62))}}function mi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vi=null;function gi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yi=null,An=null,Ln=null;function jo(e){if(e=Nr(e)){if(typeof yi!="function")throw Error(d(280));var t=e.stateNode;t&&(t=gl(t),yi(e.stateNode,e.type,t))}}function ko(e){An?Ln?Ln.push(e):Ln=[e]:An=e}function So(){if(An){var e=An,t=Ln;if(Ln=An=null,jo(e),t)for(e=0;e>>=0,e===0?32:31-(Oc(e)/Fc|0)|0}var br=64,el=4194304;function ar(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function tl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var c=a&~l;c!==0?r=ar(c):(s&=a,s!==0&&(r=ar(s)))}else a=n&~l,a!==0?r=ar(a):s!==0&&(r=ar(s));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ur(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function Vc(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=gr),qo=" ",Jo=!1;function bo(e,t){switch(e){case"keyup":return md.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ea(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var In=!1;function gd(e,t){switch(e){case"compositionend":return ea(t);case"keypress":return t.which!==32?null:(Jo=!0,qo);case"textInput":return e=t.data,e===qo&&Jo?null:e;default:return null}}function yd(e,t){if(In)return e==="compositionend"||!Oi&&bo(e,t)?(e=Go(),sl=zi=qt=null,In=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=oa(n)}}function ua(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ua(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ca(){for(var e=window,t=Kr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kr(e.document)}return t}function $i(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Cd(e){var t=ca(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ua(n.ownerDocument.documentElement,n)){if(r!==null&&$i(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=aa(n,s);var a=aa(n,r);l&&a&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,On=null,Ui=null,jr=null,Vi=!1;function da(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vi||On==null||On!==Kr(r)||(r=On,"selectionStart"in r&&$i(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&wr(jr,r)||(jr=r,r=hl(Ui,"onSelect"),0Vn||(e.current=bi[Vn],bi[Vn]=null,Vn--)}function ve(e,t){Vn++,bi[Vn]=e.current,e.current=t}var tn={},qe=en(tn),rt=en(!1),vn=tn;function Hn(e,t){var n=e.type.contextTypes;if(!n)return tn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function lt(e){return e=e.childContextTypes,e!=null}function yl(){xe(rt),xe(qe)}function Na(e,t,n){if(qe.current!==tn)throw Error(d(168));ve(qe,t),ve(rt,n)}function Ca(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(d(108,re(e)||"Unknown",l));return L({},n,r)}function xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,vn=qe.current,ve(qe,e),ve(rt,rt.current),!0}function Ta(e,t,n){var r=e.stateNode;if(!r)throw Error(d(169));n?(e=Ca(e,t,vn),r.__reactInternalMemoizedMergedChildContext=e,xe(rt),xe(qe),ve(qe,e)):xe(rt),ve(rt,n)}var Dt=null,wl=!1,es=!1;function Pa(e){Dt===null?Dt=[e]:Dt.push(e)}function $d(e){wl=!0,Pa(e)}function nn(){if(!es&&Dt!==null){es=!0;var e=0,t=de;try{var n=Dt;for(de=1;e>=a,l-=a,$t=1<<32-jt(t)+l|n<Z?(Qe=K,K=null):Qe=K.sibling;var ae=k(m,K,v[Z],T);if(ae===null){K===null&&(K=Qe);break}e&&K&&ae.alternate===null&&t(m,K),p=s(ae,p,Z),Q===null?V=ae:Q.sibling=ae,Q=ae,K=Qe}if(Z===v.length)return n(m,K),Se&&yn(m,Z),V;if(K===null){for(;ZZ?(Qe=K,K=null):Qe=K.sibling;var fn=k(m,K,ae.value,T);if(fn===null){K===null&&(K=Qe);break}e&&K&&fn.alternate===null&&t(m,K),p=s(fn,p,Z),Q===null?V=fn:Q.sibling=fn,Q=fn,K=Qe}if(ae.done)return n(m,K),Se&&yn(m,Z),V;if(K===null){for(;!ae.done;Z++,ae=v.next())ae=N(m,ae.value,T),ae!==null&&(p=s(ae,p,Z),Q===null?V=ae:Q.sibling=ae,Q=ae);return Se&&yn(m,Z),V}for(K=r(m,K);!ae.done;Z++,ae=v.next())ae=M(K,m,Z,ae.value,T),ae!==null&&(e&&ae.alternate!==null&&K.delete(ae.key===null?Z:ae.key),p=s(ae,p,Z),Q===null?V=ae:Q.sibling=ae,Q=ae);return e&&K.forEach(function(wf){return t(m,wf)}),Se&&yn(m,Z),V}function Re(m,p,v,T){if(typeof v=="object"&&v!==null&&v.type===pe&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case ge:e:{for(var V=v.key,Q=p;Q!==null;){if(Q.key===V){if(V=v.type,V===pe){if(Q.tag===7){n(m,Q.sibling),p=l(Q,v.props.children),p.return=m,m=p;break e}}else if(Q.elementType===V||typeof V=="object"&&V!==null&&V.$$typeof===Ee&&Ia(V)===Q.type){n(m,Q.sibling),p=l(Q,v.props),p.ref=Cr(m,Q,v),p.return=m,m=p;break e}n(m,Q);break}else t(m,Q);Q=Q.sibling}v.type===pe?(p=Nn(v.props.children,m.mode,T,v.key),p.return=m,m=p):(T=Yl(v.type,v.key,v.props,null,m.mode,T),T.ref=Cr(m,p,v),T.return=m,m=T)}return a(m);case he:e:{for(Q=v.key;p!==null;){if(p.key===Q)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(m,p.sibling),p=l(p,v.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=qs(v,m.mode,T),p.return=m,m=p}return a(m);case Ee:return Q=v._init,Re(m,p,Q(v._payload),T)}if(nr(v))return $(m,p,v,T);if(B(v))return U(m,p,v,T);_l(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,p!==null&&p.tag===6?(n(m,p.sibling),p=l(p,v),p.return=m,m=p):(n(m,p),p=Zs(v,m.mode,T),p.return=m,m=p),a(m)):n(m,p)}return Re}var Qn=Oa(!0),Fa=Oa(!1),El=en(null),Nl=null,Kn=null,ss=null;function os(){ss=Kn=Nl=null}function as(e){var t=El.current;xe(El),e._currentValue=t}function us(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yn(e,t){Nl=e,ss=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(it=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(ss!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(Nl===null)throw Error(d(308));Kn=e,Nl.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var xn=null;function cs(e){xn===null?xn=[e]:xn.push(e)}function Da(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,cs(t)):(n.next=l.next,l.next=n),t.interleaved=n,Vt(e,r)}function Vt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rn=!1;function ds(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $a(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ht(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ln(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(oe&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Vt(e,n)}return l=r.interleaved,l===null?(t.next=t,cs(r)):(t.next=l.next,l.next=t),r.interleaved=t,Vt(e,n)}function Cl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ei(e,n)}}function Ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Tl(e,t,n,r){var l=e.updateQueue;rn=!1;var s=l.firstBaseUpdate,a=l.lastBaseUpdate,c=l.shared.pending;if(c!==null){l.shared.pending=null;var f=c,g=f.next;f.next=null,a===null?s=g:a.next=g,a=f;var S=e.alternate;S!==null&&(S=S.updateQueue,c=S.lastBaseUpdate,c!==a&&(c===null?S.firstBaseUpdate=g:c.next=g,S.lastBaseUpdate=f))}if(s!==null){var N=l.baseState;a=0,S=g=f=null,c=s;do{var k=c.lane,M=c.eventTime;if((r&k)===k){S!==null&&(S=S.next={eventTime:M,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var $=e,U=c;switch(k=t,M=n,U.tag){case 1:if($=U.payload,typeof $=="function"){N=$.call(M,N,k);break e}N=$;break e;case 3:$.flags=$.flags&-65537|128;case 0:if($=U.payload,k=typeof $=="function"?$.call(M,N,k):$,k==null)break e;N=L({},N,k);break e;case 2:rn=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,k=l.effects,k===null?l.effects=[c]:k.push(c))}else M={eventTime:M,lane:k,tag:c.tag,payload:c.payload,callback:c.callback,next:null},S===null?(g=S=M,f=N):S=S.next=M,a|=k;if(c=c.next,c===null){if(c=l.shared.pending,c===null)break;k=c,c=k.next,k.next=null,l.lastBaseUpdate=k,l.shared.pending=null}}while(!0);if(S===null&&(f=N),l.baseState=f,l.firstBaseUpdate=g,l.lastBaseUpdate=S,t=l.shared.interleaved,t!==null){l=t;do a|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);kn|=a,e.lanes=a,e.memoizedState=N}}function Va(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vs.transition;vs.transition={};try{e(!1),t()}finally{de=n,vs.transition=r}}function su(){return gt().memoizedState}function Bd(e,t,n){var r=un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ou(e))au(t,n);else if(n=Da(e,t,n,r),n!==null){var l=nt();Ct(n,e,r,l),uu(n,t,r)}}function Wd(e,t,n){var r=un(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ou(e))au(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,c=s(a,n);if(l.hasEagerState=!0,l.eagerState=c,kt(c,a)){var f=t.interleaved;f===null?(l.next=l,cs(t)):(l.next=f.next,f.next=l),t.interleaved=l;return}}catch{}finally{}n=Da(e,t,l,r),n!==null&&(l=nt(),Ct(n,e,r,l),uu(n,t,r))}}function ou(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function au(e,t){Ar=Al=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uu(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ei(e,n)}}var Rl={readContext:vt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},Gd={readContext:vt,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:Ja,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ll(4194308,4,tu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ll(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ll(4,2,e,t)},useMemo:function(e,t){var n=At();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=At();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Bd.bind(null,Ce,e),[r.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:Za,useDebugValue:Ss,useDeferredValue:function(e){return At().memoizedState=e},useTransition:function(){var e=Za(!1),t=e[0];return e=Hd.bind(null,e[1]),At().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ce,l=At();if(Se){if(n===void 0)throw Error(d(407));n=n()}else{if(n=t(),Ge===null)throw Error(d(349));(jn&30)!==0||Ga(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,Ja(Ka.bind(null,r,s,e),[e]),r.flags|=2048,Rr(9,Qa.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=At(),t=Ge.identifierPrefix;if(Se){var n=Ut,r=$t;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Lr++,0")&&(f=f.replace("",e.displayName)),f}while(1<=a&&0<=c);break}}}finally{E=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?j(e):""}function L(e){switch(e.tag){case 5:return j(e.type);case 16:return j("Lazy");case 13:return j("Suspense");case 19:return j("SuspenseList");case 0:case 2:case 15:return e=C(e.type,!1),e;case 11:return e=C(e.type.render,!1),e;case 1:return e=C(e.type,!0),e;default:return""}}function ee(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case pe:return"Fragment";case he:return"Portal";case Oe:return"Profiler";case we:return"StrictMode";case w:return"Suspense";case Be:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Fe:return(e.displayName||"Context")+".Consumer";case je:return(e._context.displayName||"Context")+".Provider";case _e:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case Ee:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}function re(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(t);case 8:return t===we?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ce(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ke(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ct(e){var t=ke(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(a){r=""+a,s.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qr(e){e._valueTracker||(e._valueTracker=ct(e))}function uo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ke(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ui(e,t){var n=t.checked;return M({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function co(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ce(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function fo(e,t){t=t.checked,t!=null&&Ie(e,"checked",t,!1)}function ci(e,t){fo(e,t);var n=ce(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?di(e,t.type,n):t.hasOwnProperty("defaultValue")&&di(e,t.type,ce(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function po(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function di(e,t,n){(t!=="number"||Kr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var nr=Array.isArray;function zn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Yr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var lr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_c=["Webkit","ms","Moz","O"];Object.keys(lr).forEach(function(e){_c.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),lr[t]=lr[e]})});function xo(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||lr.hasOwnProperty(e)&&lr[e]?(""+t).trim():t+"px"}function wo(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=xo(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Ec=M({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function hi(e,t){if(t){if(Ec[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(d(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(d(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(d(61))}if(t.style!=null&&typeof t.style!="object")throw Error(d(62))}}function mi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var vi=null;function gi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yi=null,An=null,Ln=null;function jo(e){if(e=Nr(e)){if(typeof yi!="function")throw Error(d(280));var t=e.stateNode;t&&(t=gl(t),yi(e.stateNode,e.type,t))}}function ko(e){An?Ln?Ln.push(e):Ln=[e]:An=e}function So(){if(An){var e=An,t=Ln;if(Ln=An=null,jo(e),t)for(e=0;e>>=0,e===0?32:31-(Oc(e)/Fc|0)|0}var br=64,el=4194304;function ar(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function tl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,s=e.pingedLanes,a=n&268435455;if(a!==0){var c=a&~l;c!==0?r=ar(c):(s&=a,s!==0&&(r=ar(s)))}else a=n&~l,a!==0?r=ar(a):s!==0&&(r=ar(s));if(r===0)return 0;if(t!==0&&t!==r&&(t&l)===0&&(l=r&-r,s=t&-t,l>=s||l===16&&(s&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ur(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-St(t),e[t]=n}function Vc(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=gr),Zo=" ",Jo=!1;function bo(e,t){switch(e){case"keyup":return md.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ea(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var In=!1;function gd(e,t){switch(e){case"compositionend":return ea(t);case"keypress":return t.which!==32?null:(Jo=!0,Zo);case"textInput":return e=t.data,e===Zo&&Jo?null:e;default:return null}}function yd(e,t){if(In)return e==="compositionend"||!Oi&&bo(e,t)?(e=Go(),sl=zi=Zt=null,In=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=oa(n)}}function ua(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ua(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ca(){for(var e=window,t=Kr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kr(e.document)}return t}function $i(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Cd(e){var t=ca(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ua(n.ownerDocument.documentElement,n)){if(r!==null&&$i(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,s=Math.min(r.start,l);r=r.end===void 0?s:Math.min(r.end,l),!e.extend&&s>r&&(l=r,r=s,s=l),l=aa(n,s);var a=aa(n,r);l&&a&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,On=null,Ui=null,jr=null,Vi=!1;function da(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vi||On==null||On!==Kr(r)||(r=On,"selectionStart"in r&&$i(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jr&&wr(jr,r)||(jr=r,r=hl(Ui,"onSelect"),0Vn||(e.current=bi[Vn],bi[Vn]=null,Vn--)}function ve(e,t){Vn++,bi[Vn]=e.current,e.current=t}var tn={},Ze=en(tn),rt=en(!1),vn=tn;function Hn(e,t){var n=e.type.contextTypes;if(!n)return tn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},s;for(s in n)l[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function lt(e){return e=e.childContextTypes,e!=null}function yl(){xe(rt),xe(Ze)}function Na(e,t,n){if(Ze.current!==tn)throw Error(d(168));ve(Ze,t),ve(rt,n)}function Ca(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(d(108,re(e)||"Unknown",l));return M({},n,r)}function xl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tn,vn=Ze.current,ve(Ze,e),ve(rt,rt.current),!0}function Ta(e,t,n){var r=e.stateNode;if(!r)throw Error(d(169));n?(e=Ca(e,t,vn),r.__reactInternalMemoizedMergedChildContext=e,xe(rt),xe(Ze),ve(Ze,e)):xe(rt),ve(rt,n)}var $t=null,wl=!1,es=!1;function Pa(e){$t===null?$t=[e]:$t.push(e)}function $d(e){wl=!0,Pa(e)}function nn(){if(!es&&$t!==null){es=!0;var e=0,t=de;try{var n=$t;for(de=1;e>=a,l-=a,Ut=1<<32-St(t)+l|n<q?(Qe=K,K=null):Qe=K.sibling;var ue=k(m,K,v[q],T);if(ue===null){K===null&&(K=Qe);break}e&&K&&ue.alternate===null&&t(m,K),p=s(ue,p,q),Q===null?H=ue:Q.sibling=ue,Q=ue,K=Qe}if(q===v.length)return n(m,K),Se&&yn(m,q),H;if(K===null){for(;qq?(Qe=K,K=null):Qe=K.sibling;var fn=k(m,K,ue.value,T);if(fn===null){K===null&&(K=Qe);break}e&&K&&fn.alternate===null&&t(m,K),p=s(fn,p,q),Q===null?H=fn:Q.sibling=fn,Q=fn,K=Qe}if(ue.done)return n(m,K),Se&&yn(m,q),H;if(K===null){for(;!ue.done;q++,ue=v.next())ue=N(m,ue.value,T),ue!==null&&(p=s(ue,p,q),Q===null?H=ue:Q.sibling=ue,Q=ue);return Se&&yn(m,q),H}for(K=r(m,K);!ue.done;q++,ue=v.next())ue=R(K,m,q,ue.value,T),ue!==null&&(e&&ue.alternate!==null&&K.delete(ue.key===null?q:ue.key),p=s(ue,p,q),Q===null?H=ue:Q.sibling=ue,Q=ue);return e&&K.forEach(function(wf){return t(m,wf)}),Se&&yn(m,q),H}function Re(m,p,v,T){if(typeof v=="object"&&v!==null&&v.type===pe&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case ge:e:{for(var H=v.key,Q=p;Q!==null;){if(Q.key===H){if(H=v.type,H===pe){if(Q.tag===7){n(m,Q.sibling),p=l(Q,v.props.children),p.return=m,m=p;break e}}else if(Q.elementType===H||typeof H=="object"&&H!==null&&H.$$typeof===Ee&&Ia(H)===Q.type){n(m,Q.sibling),p=l(Q,v.props),p.ref=Cr(m,Q,v),p.return=m,m=p;break e}n(m,Q);break}else t(m,Q);Q=Q.sibling}v.type===pe?(p=Nn(v.props.children,m.mode,T,v.key),p.return=m,m=p):(T=Yl(v.type,v.key,v.props,null,m.mode,T),T.ref=Cr(m,p,v),T.return=m,m=T)}return a(m);case he:e:{for(Q=v.key;p!==null;){if(p.key===Q)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(m,p.sibling),p=l(p,v.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=Zs(v,m.mode,T),p.return=m,m=p}return a(m);case Ee:return Q=v._init,Re(m,p,Q(v._payload),T)}if(nr(v))return U(m,p,v,T);if(W(v))return V(m,p,v,T);_l(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,p!==null&&p.tag===6?(n(m,p.sibling),p=l(p,v),p.return=m,m=p):(n(m,p),p=qs(v,m.mode,T),p.return=m,m=p),a(m)):n(m,p)}return Re}var Qn=Oa(!0),Fa=Oa(!1),El=en(null),Nl=null,Kn=null,ss=null;function os(){ss=Kn=Nl=null}function as(e){var t=El.current;xe(El),e._currentValue=t}function us(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Yn(e,t){Nl=e,ss=Kn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(it=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(ss!==e)if(e={context:e,memoizedValue:t,next:null},Kn===null){if(Nl===null)throw Error(d(308));Kn=e,Nl.dependencies={lanes:0,firstContext:e}}else Kn=Kn.next=e;return t}var xn=null;function cs(e){xn===null?xn=[e]:xn.push(e)}function Da(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,cs(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ht(e,r)}function Ht(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var rn=!1;function ds(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $a(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ln(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(ae&2)!==0){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ht(e,n)}return l=r.interleaved,l===null?(t.next=t,cs(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ht(e,n)}function Cl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ei(e,n)}}function Ua(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?l=s=a:s=s.next=a,n=n.next}while(n!==null);s===null?l=s=t:s=s.next=t}else l=s=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Tl(e,t,n,r){var l=e.updateQueue;rn=!1;var s=l.firstBaseUpdate,a=l.lastBaseUpdate,c=l.shared.pending;if(c!==null){l.shared.pending=null;var f=c,g=f.next;f.next=null,a===null?s=g:a.next=g,a=f;var S=e.alternate;S!==null&&(S=S.updateQueue,c=S.lastBaseUpdate,c!==a&&(c===null?S.firstBaseUpdate=g:c.next=g,S.lastBaseUpdate=f))}if(s!==null){var N=l.baseState;a=0,S=g=f=null,c=s;do{var k=c.lane,R=c.eventTime;if((r&k)===k){S!==null&&(S=S.next={eventTime:R,lane:0,tag:c.tag,payload:c.payload,callback:c.callback,next:null});e:{var U=e,V=c;switch(k=t,R=n,V.tag){case 1:if(U=V.payload,typeof U=="function"){N=U.call(R,N,k);break e}N=U;break e;case 3:U.flags=U.flags&-65537|128;case 0:if(U=V.payload,k=typeof U=="function"?U.call(R,N,k):U,k==null)break e;N=M({},N,k);break e;case 2:rn=!0}}c.callback!==null&&c.lane!==0&&(e.flags|=64,k=l.effects,k===null?l.effects=[c]:k.push(c))}else R={eventTime:R,lane:k,tag:c.tag,payload:c.payload,callback:c.callback,next:null},S===null?(g=S=R,f=N):S=S.next=R,a|=k;if(c=c.next,c===null){if(c=l.shared.pending,c===null)break;k=c,c=k.next,k.next=null,l.lastBaseUpdate=k,l.shared.pending=null}}while(!0);if(S===null&&(f=N),l.baseState=f,l.firstBaseUpdate=g,l.lastBaseUpdate=S,t=l.shared.interleaved,t!==null){l=t;do a|=l.lane,l=l.next;while(l!==t)}else s===null&&(l.shared.lanes=0);kn|=a,e.lanes=a,e.memoizedState=N}}function Va(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=vs.transition;vs.transition={};try{e(!1),t()}finally{de=n,vs.transition=r}}function su(){return yt().memoizedState}function Bd(e,t,n){var r=un(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ou(e))au(t,n);else if(n=Da(e,t,n,r),n!==null){var l=nt();Pt(n,e,r,l),uu(n,t,r)}}function Wd(e,t,n){var r=un(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ou(e))au(t,l);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var a=t.lastRenderedState,c=s(a,n);if(l.hasEagerState=!0,l.eagerState=c,_t(c,a)){var f=t.interleaved;f===null?(l.next=l,cs(t)):(l.next=f.next,f.next=l),t.interleaved=l;return}}catch{}finally{}n=Da(e,t,l,r),n!==null&&(l=nt(),Pt(n,e,r,l),uu(n,t,r))}}function ou(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function au(e,t){Ar=Al=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uu(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ei(e,n)}}var Rl={readContext:gt,useCallback:Je,useContext:Je,useEffect:Je,useImperativeHandle:Je,useInsertionEffect:Je,useLayoutEffect:Je,useMemo:Je,useReducer:Je,useRef:Je,useState:Je,useDebugValue:Je,useDeferredValue:Je,useTransition:Je,useMutableSource:Je,useSyncExternalStore:Je,useId:Je,unstable_isNewReconciler:!1},Gd={readContext:gt,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Ja,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ll(4194308,4,tu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ll(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ll(4,2,e,t)},useMemo:function(e,t){var n=Mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Bd.bind(null,Ce,e),[r.memoizedState,e]},useRef:function(e){var t=Mt();return e={current:e},t.memoizedState=e},useState:qa,useDebugValue:Ss,useDeferredValue:function(e){return Mt().memoizedState=e},useTransition:function(){var e=qa(!1),t=e[0];return e=Hd.bind(null,e[1]),Mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ce,l=Mt();if(Se){if(n===void 0)throw Error(d(407));n=n()}else{if(n=t(),Ge===null)throw Error(d(349));(jn&30)!==0||Ga(r,t,n)}l.memoizedState=n;var s={value:n,getSnapshot:t};return l.queue=s,Ja(Ka.bind(null,r,s,e),[e]),r.flags|=2048,Rr(9,Qa.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Mt(),t=Ge.identifierPrefix;if(Se){var n=Vt,r=Ut;n=(r&~(1<<32-St(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Lr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Pt]=t,e[Er]=r,Pu(e,t,!1,!1),t.stateNode=e;e:{switch(a=mi(n,r),n){case"dialog":ye("cancel",e),ye("close",e),l=r;break;case"iframe":case"object":case"embed":ye("load",e),l=r;break;case"video":case"audio":for(l=0;lbn&&(t.flags|=128,r=!0,Ir(s,!1),t.lanes=4194304)}else{if(!r)if(e=Pl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ir(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Se)return be(t),null}else 2*Me()-s.renderingStartTime>bn&&n!==1073741824&&(t.flags|=128,r=!0,Ir(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Me(),t.sibling=null,n=Ne.current,ve(Ne,r?n&1|2:n&1),t):(be(t),null);case 22:case 23:return Ks(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(pt&1073741824)!==0&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(d(156,t.tag))}function bd(e,t){switch(ns(t),t.tag){case 1:return lt(t.type)&&yl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xn(),xe(rt),xe(qe),ms(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ps(t),null;case 13:if(xe(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(Ne),null;case 4:return Xn(),null;case 10:return as(t.type._context),null;case 22:case 23:return Ks(),null;case 24:return null;default:return null}}var Dl=!1,et=!1,ef=typeof WeakSet=="function"?WeakSet:Set,D=null;function qn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ae(e,t,r)}else n.current=null}function Is(e,t,n){try{n()}catch(r){Ae(e,t,r)}}var Lu=!1;function tf(e,t){if(Ki=ll,e=ca(),$i(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,c=-1,f=-1,g=0,S=0,N=e,k=null;t:for(;;){for(var M;N!==n||l!==0&&N.nodeType!==3||(c=a+l),N!==s||r!==0&&N.nodeType!==3||(f=a+r),N.nodeType===3&&(a+=N.nodeValue.length),(M=N.firstChild)!==null;)k=N,N=M;for(;;){if(N===e)break t;if(k===n&&++g===l&&(c=a),k===s&&++S===r&&(f=a),(M=N.nextSibling)!==null)break;N=k,k=N.parentNode}N=M}n=c===-1||f===-1?null:{start:c,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yi={focusedElem:e,selectionRange:n},ll=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;try{var $=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if($!==null){var U=$.memoizedProps,Re=$.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?U:_t(t.type,U),Re);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(d(163))}}catch(T){Ae(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return $=Lu,Lu=!1,$}function Or(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&Is(t,n,s)}l=l.next}while(l!==r)}}function $l(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Os(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Mu(e){var t=e.alternate;t!==null&&(e.alternate=null,Mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pt],delete t[Er],delete t[Ji],delete t[Fd],delete t[Dd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ru(e){return e.tag===5||e.tag===3||e.tag===4}function Iu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ru(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vl));else if(r!==4&&(e=e.child,e!==null))for(Fs(e,t,n),e=e.sibling;e!==null;)Fs(e,t,n),e=e.sibling}function Ds(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ds(e,t,n),e=e.sibling;e!==null;)Ds(e,t,n),e=e.sibling}var Ye=null,Et=!1;function sn(e,t,n){for(n=n.child;n!==null;)Ou(e,t,n),n=n.sibling}function Ou(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Jr,n)}catch{}switch(n.tag){case 5:et||qn(n,t);case 6:var r=Ye,l=Et;Ye=null,sn(e,t,n),Ye=r,Et=l,Ye!==null&&(Et?(e=Ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ye.removeChild(n.stateNode));break;case 18:Ye!==null&&(Et?(e=Ye,n=n.stateNode,e.nodeType===8?qi(e.parentNode,n):e.nodeType===1&&qi(e,n),hr(e)):qi(Ye,n.stateNode));break;case 4:r=Ye,l=Et,Ye=n.stateNode.containerInfo,Et=!0,sn(e,t,n),Ye=r,Et=l;break;case 0:case 11:case 14:case 15:if(!et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,a=s.destroy;s=s.tag,a!==void 0&&((s&2)!==0||(s&4)!==0)&&Is(n,t,a),l=l.next}while(l!==r)}sn(e,t,n);break;case 1:if(!et&&(qn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){Ae(n,t,c)}sn(e,t,n);break;case 21:sn(e,t,n);break;case 22:n.mode&1?(et=(r=et)||n.memoizedState!==null,sn(e,t,n),et=r):sn(e,t,n);break;default:sn(e,t,n)}}function Fu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ef),t.forEach(function(r){var l=df.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=a),r&=~s}if(r=l,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rf(r/1960))-r,10e?16:e,an===null)var r=!1;else{if(e=an,an=null,Wl=0,(oe&6)!==0)throw Error(d(331));var l=oe;for(oe|=4,D=e.current;D!==null;){var s=D,a=s.child;if((D.flags&16)!==0){var c=s.deletions;if(c!==null){for(var f=0;fMe()-Vs?_n(e,0):Us|=n),ot(e,t)}function Zu(e,t){t===0&&((e.mode&1)===0?t=1:(t=el,el<<=1,(el&130023424)===0&&(el=4194304)));var n=nt();e=Vt(e,t),e!==null&&(ur(e,t,n),ot(e,n))}function cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function df(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(d(314))}r!==null&&r.delete(t),Zu(e,n)}var qu;qu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)it=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return it=!1,qd(e,t,n);it=(e.flags&131072)!==0}else it=!1,Se&&(t.flags&1048576)!==0&&za(t,kl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fl(e,t),e=t.pendingProps;var l=Hn(t,qe.current);Yn(t,n),l=ys(null,t,r,e,l,n);var s=xs();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(s=!0,xl(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ds(t),l.updater=Il,t.stateNode=l,l._reactInternals=t,Es(t,r,e,n),t=Ps(null,t,r,!0,s,n)):(t.tag=0,Se&&s&&ts(t),tt(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=pf(r),e=_t(r,e),l){case 0:t=Ts(null,t,r,e,n);break e;case 1:t=Su(null,t,r,e,n);break e;case 11:t=yu(null,t,r,e,n);break e;case 14:t=xu(null,t,r,_t(r.type,e),n);break e}throw Error(d(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:_t(r,l),Ts(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:_t(r,l),Su(e,t,r,l,n);case 3:e:{if(_u(t),e===null)throw Error(d(387));r=t.pendingProps,s=t.memoizedState,l=s.element,$a(e,t),Tl(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=Zn(Error(d(423)),t),t=Eu(e,t,r,n,l);break e}else if(r!==l){l=Zn(Error(d(424)),t),t=Eu(e,t,r,n,l);break e}else for(ft=bt(t.stateNode.containerInfo.firstChild),dt=t,Se=!0,St=null,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gn(),r===l){t=Bt(e,t,n);break e}tt(e,t,r,n)}t=t.child}return t;case 5:return Ha(t),e===null&&ls(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,a=l.children,Xi(r,l)?a=null:s!==null&&Xi(r,s)&&(t.flags|=32),ku(e,t),tt(e,t,a,n),t.child;case 6:return e===null&&ls(t),null;case 13:return Nu(e,t,n);case 4:return fs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qn(t,null,r,n):tt(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:_t(r,l),yu(e,t,r,l,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,a=l.value,ve(El,r._currentValue),r._currentValue=a,s!==null)if(kt(s.value,a)){if(s.children===l.children&&!rt.current){t=Bt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var c=s.dependencies;if(c!==null){a=s.child;for(var f=c.firstContext;f!==null;){if(f.context===r){if(s.tag===1){f=Ht(-1,n&-n),f.tag=2;var g=s.updateQueue;if(g!==null){g=g.shared;var S=g.pending;S===null?f.next=f:(f.next=S.next,S.next=f),g.pending=f}}s.lanes|=n,f=s.alternate,f!==null&&(f.lanes|=n),us(s.return,n,t),c.lanes|=n;break}f=f.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(d(341));a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),us(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}tt(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yn(t,n),l=vt(l),r=r(l),t.flags|=1,tt(e,t,r,n),t.child;case 14:return r=t.type,l=_t(r,t.pendingProps),l=_t(r.type,l),xu(e,t,r,l,n);case 15:return wu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:_t(r,l),Fl(e,t),t.tag=1,lt(r)?(e=!0,xl(t)):e=!1,Yn(t,n),du(t,r,l),Es(t,r,l,n),Ps(null,t,r,!0,e,n);case 19:return Tu(e,t,n);case 22:return ju(e,t,n)}throw Error(d(156,t.tag))};function Ju(e,t){return Ao(e,t)}function ff(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xt(e,t,n,r){return new ff(e,t,n,r)}function Xs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pf(e){if(typeof e=="function")return Xs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_e)return 11;if(e===G)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Yl(e,t,n,r,l,s){var a=2;if(r=e,typeof e=="function")Xs(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case pe:return Nn(n.children,l,s,t);case we:a=8,l|=8;break;case Oe:return e=xt(12,n,t,l|2),e.elementType=Oe,e.lanes=s,e;case w:return e=xt(13,n,t,l),e.elementType=w,e.lanes=s,e;case Be:return e=xt(19,n,t,l),e.elementType=Be,e.lanes=s,e;case ie:return Xl(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case je:a=10;break e;case Fe:a=9;break e;case _e:a=11;break e;case G:a=14;break e;case Ee:a=16,r=null;break e}throw Error(d(130,e==null?e:typeof e,""))}return t=xt(a,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Nn(e,t,n,r){return e=xt(7,e,r,t),e.lanes=n,e}function Xl(e,t,n,r){return e=xt(22,e,r,t),e.elementType=ie,e.lanes=n,e.stateNode={isHidden:!1},e}function Zs(e,t,n){return e=xt(6,e,null,t),e.lanes=n,e}function qs(e,t,n){return t=xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_i(0),this.expirationTimes=_i(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_i(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Js(e,t,n,r,l,s,a,c,f){return e=new hf(e,t,n,c,f),t===1?(t=1,s===!0&&(t|=8)):t=0,s=xt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ds(s),e}function mf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(u){console.error(u)}}return o(),lo.exports=Cf(),lo.exports}var fc;function Pf(){if(fc)return ni;fc=1;var o=Tf();return ni.createRoot=o.createRoot,ni.hydrateRoot=o.hydrateRoot,ni}var zf=Pf();const Af=yc(zf);function se({name:o,size:u=24,...d}){const y={agent:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"5",y:"8",width:"14",height:"11",rx:"4"}),i.jsx("path",{d:"M12 8V4m0 0-2-2m2 2 2-2M8.5 13h.01m6.99 0h.01M9 17h6M5 12H3v4h2m14-4h2v4h-2"})]}),battery:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"5",y:"3",width:"12",height:"18",rx:"2.5"}),i.jsx("path",{d:"M9 1h4M17 9h2v6h-2M8 17l4-8v5h4l-5 7"})]}),bell:i.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4"}),check:i.jsx("path",{d:"m5 12 4 4L19 6"}),chart:i.jsx("path",{d:"M4 19V9m5 10V5m5 14v-7m5 7V3"}),chevron:i.jsx("path",{d:"m9 5 7 7-7 7"}),cloud:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M7 18h10a4 4 0 0 0 .7-7.94A6 6 0 0 0 6.2 8.3 4.8 4.8 0 0 0 7 18Z"}),i.jsx("path",{d:"M9 14h6"})]}),code:i.jsx("path",{d:"m8 9-3 3 3 3m8-6 3 3-3 3m-3-9-2 12"}),copy:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),i.jsx("path",{d:"M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3"})]}),download:i.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M5 20h14"}),device:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"6",y:"2",width:"12",height:"20",rx:"2.5"}),i.jsx("path",{d:"M10 5h4m-4 14h4"})]}),fingerprint:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M12 11a2 2 0 0 1 2 2c0 3-.5 5.5-1.5 8"}),i.jsx("path",{d:"M8.5 21c1-2 1.5-5 1.5-8a2 2 0 0 1 4 0c0 4-.8 7-1.4 8.5"}),i.jsx("path",{d:"M6 19c.8-2.1 1-4 1-6a5 5 0 0 1 10 0c0 3-.3 5.2-1 7.5"}),i.jsx("path",{d:"M4 16v-3a8 8 0 0 1 16 0c0 2-.1 3.5-.5 5"})]}),grid:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]}),book:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M4 5.5A2.5 2.5 0 0 1 6.5 3H20v16H6.5A2.5 2.5 0 0 0 4 21V5.5Z"}),i.jsx("path",{d:"M4 5.5V21m4-14h8m-8 4h6"})]}),heartbeat:i.jsx("path",{d:"M3 12h4l2-7 4 14 2-7h6"}),home:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"m3 11 9-8 9 8"}),i.jsx("path",{d:"M5 10v10h14V10M9 20v-6h6v6"})]}),link:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M10 13a5 5 0 0 0 7.1 0l2-2a5 5 0 0 0-7.1-7.1l-1.1 1.1"}),i.jsx("path",{d:"M14 11a5 5 0 0 0-7.1 0l-2 2A5 5 0 0 0 12 20.1l1.1-1.1"})]}),lock:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"5",y:"10",width:"14",height:"11",rx:"2.5"}),i.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3m-4 4v3"})]}),power:i.jsx("path",{d:"M12 2v10m5.7-7.7a9 9 0 1 1-11.4 0"}),qr:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),i.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),i.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),i.jsx("path",{d:"M14 14h3v3h-3zm4 4h3v3h-3zm0-4h3m-7 7h2"})]}),refresh:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M20 7V3h-4"}),i.jsx("path",{d:"M20 3a9 9 0 1 0 2 9"})]}),route:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"6",cy:"18",r:"2"}),i.jsx("circle",{cx:"18",cy:"6",r:"2"}),i.jsx("path",{d:"M8 18h3a3 3 0 0 0 3-3V9a3 3 0 0 1 3-3h-1M8 6h3m-5-2v4"})]}),scan:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m13-5h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3m13 5h3a2 2 0 0 0 2-2v-3"}),i.jsx("path",{d:"M7 12h10"})]}),search:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.8"}),i.jsx("path",{d:"m16 16 5 5"})]}),server:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"3",y:"3",width:"18",height:"7",rx:"2"}),i.jsx("rect",{x:"3",y:"14",width:"18",height:"7",rx:"2"}),i.jsx("path",{d:"M7 6.5h.01M7 17.5h.01M11 6.5h6M11 17.5h6"})]}),settings:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.86 2.86-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1v.1H9.5V21a1.7 1.7 0 0 0-1.1-1.6 1.7 1.7 0 0 0-1.88.34l-.06.06-2.86-2.86.06-.06A1.7 1.7 0 0 0 4 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1-.4h-.1V9.5h.1A1.7 1.7 0 0 0 4 8.4a1.7 1.7 0 0 0-.34-1.88l-.06-.06L6.46 3.6l.06.06A1.7 1.7 0 0 0 8.4 4a1.7 1.7 0 0 0 1-.6 1.7 1.7 0 0 0 .4-1v-.1h4.1v.1A1.7 1.7 0 0 0 15 4a1.7 1.7 0 0 0 1.88-.34l.06-.06 2.86 2.86-.06.06A1.7 1.7 0 0 0 19.4 8c.14.38.36.72.66 1 .3.27.68.42 1.08.43h.1v4.1h-.1A1.7 1.7 0 0 0 19.4 15Z"})]}),shield:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M12 3 5 6v5c0 4.7 2.9 8.2 7 10 4.1-1.8 7-5.3 7-10V6l-7-3Z"}),i.jsx("path",{d:"m9 12 2 2 4-5"})]}),storage:i.jsxs(i.Fragment,{children:[i.jsx("ellipse",{cx:"12",cy:"5",rx:"7",ry:"3"}),i.jsx("path",{d:"M5 5v7c0 1.7 3.1 3 7 3s7-1.3 7-3V5M5 12v7c0 1.7 3.1 3 7 3s7-1.3 7-3v-7"})]}),temperature:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M9 14.8V5a3 3 0 0 1 6 0v9.8a5 5 0 1 1-6 0Z"}),i.jsx("path",{d:"M12 7v9"})]}),token:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"8",cy:"15",r:"4"}),i.jsx("path",{d:"m11 12 8-8m-3 3 2 2m-5 1 2 2"})]}),users:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"9",cy:"8",r:"3"}),i.jsx("path",{d:"M3.5 20a5.5 5.5 0 0 1 11 0M16 5.5a3 3 0 0 1 0 5.8M17 14a5.2 5.2 0 0 1 3.5 5"})]}),wechat:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M14 7a6 5 0 1 0-3.2 4.4L14 13l-.8-2A4.8 4.8 0 0 0 14 7Z"}),i.jsx("path",{d:"M12 13.5a5 4.2 0 1 0 3-3.9M16 17l-.7 1.8 2.8-1.3"}),i.jsx("path",{d:"M6.5 6.8h.01m3 0h.01m5 6.7h.01m2.6 0h.01"})]}),wifi:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M4 10a12 12 0 0 1 16 0M7 13a7.5 7.5 0 0 1 10 0m-7 3a3 3 0 0 1 4 0"}),i.jsx("circle",{cx:"12",cy:"19",r:"1",fill:"currentColor",stroke:"none"})]})};return i.jsx("svg",{"aria-hidden":"true",fill:"none",height:u,viewBox:"0 0 24 24",width:u,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",...d,children:y[o]})}const Ze=o=>({state:"unavailable",source:o}),Lf={overview:Ze("GET /api/v3/workbench/overview"),devices:Ze("GET /api/v3/fleet/devices"),hookStatus:Ze("GET /api/v3/wechat/hook/status"),groups:Ze("GET /api/v3/device-groups"),release:Ze("GET /api/v3/releases/latest"),engine:Ze("GET /api/v3/ai/status + /api/v3/ai/brain/dashboard"),aiOperations:Ze("GET /api/v3/ai/tasks"),integrations:{applications:Ze("GET /api/v3/integrations/apps"),authorizations:Ze("GET /api/v3/integrations/authorizations"),usage:Ze("GET /api/v3/integrations/usage"),manifest:Ze("GET /api/v3/integration/manifest"),documents:Ze("GET /api/v3/integrations/docs/catalog"),knowledge:Ze("GET /api/v3/kb/search")}},ce=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),W=o=>{if(typeof o=="string"&&o.trim())return o;if(typeof o=="number")return String(o)},Gt=o=>{if(typeof o=="boolean")return o;if(["true","1","online","connected","running","ready"].includes(String(o).toLowerCase()))return!0;if(["false","0","offline","disconnected","stopped"].includes(String(o).toLowerCase()))return!1},Rt=o=>{if(o==null||o==="")return;const u=typeof o=="number"?o:Number(o);return Number.isFinite(u)?u:void 0},li=o=>ce(o)?o.data??o:o,xc=(o,u)=>{if(ce(o)){const d=o.detail;return ce(d)?W(d.message)||W(o.message)||u:W(o.message)||W(d)||u}return u},Te=o=>{if(ce(o))return W(o.sampled_at)||W(o.sampledAt)||W(o.server_time)||W(o.serverTime)||W(o.updated_at)||W(o.updatedAt)};async function wc(o){try{const u=await fetch(o,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}),d=await u.json().catch(()=>({}));return u.ok?{ok:!0,payload:d,status:u.status}:{ok:!1,status:u.status,message:xc(d,`读取接口失败(${u.status})`)}}catch(u){return{ok:!1,status:0,message:u instanceof Error?u.message:"读取接口失败"}}}async function ai(o,u,d){const y=await fetch(o,{method:u,credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json","X-Actor-Id":"console"},body:d===void 0?void 0:JSON.stringify(d)}),_=await y.json().catch(()=>({}));if(!y.ok)throw new Error(xc(_,`操作失败(${y.status})`));return li(_)}async function Mf(){const o=await wc("/api/v3/security/modules");if(!o.ok)throw new Error(o.message);const u=li(o.payload);if(!ce(u)||!Array.isArray(u.modules))throw new Error("安全模块接口返回格式错误");return u}async function Rf(o){return await ai("/api/v3/security/modules/global","PUT",{enabled:o})}async function If(o,u){return await ai(`/api/v3/security/modules/${encodeURIComponent(o)}`,"PUT",u)}async function Of(o){return await ai("/api/v3/security/modules","POST",o)}async function Ff(o){await ai(`/api/v3/security/modules/${encodeURIComponent(o)}`,"DELETE")}const pc=(o,u,d,y)=>u.ok?{state:"ready",data:d,source:o,sourceAt:y,status:u.status}:{state:u.status===401||u.status===403?"forbidden":"unavailable",source:o,status:u.status,error:u.message};async function $e(o,u,d){let y;for(const _ of o){const x=await wc(_);if(x.ok){const z=d(li(x.payload));return pc(`GET ${_}`,x,z.data,z.sourceAt||Te(li(x.payload)))}if(y=x,x.status!==404)break}return pc(u,y||{ok:!1,status:0,message:"读取接口失败"})}const Qt=(o,u)=>{if(Array.isArray(o))return o;if(!ce(o))return[];for(const d of u)if(Array.isArray(o[d]))return o[d];return[]},oo=o=>{if(!Array.isArray(o))return;const u=o.filter(d=>typeof d=="string"&&d.trim().length>0);return u.length?u:void 0},Df=o=>{if(!ce(o))return;const u=W(o.device_id)||W(o.deviceId)||W(o.id);if(!u)return;const d=ce(o.wechat)?o.wechat:{},y=ce(o.agent)?o.agent:{},_=ce(o.hook)?o.hook:{};return{deviceId:u,name:W(o.name)||W(o.device_name),model:W(o.model)||W(o.model_name),androidVersion:W(o.android_version)||W(o.androidVersion)||W(o.os_version),projectId:W(o.project_id)||W(o.projectId),groupId:W(o.group_id)||W(o.groupId)||W(o.project_id),status:W(o.status),online:Gt(o.online)??Gt(o.ws_online)??(W(o.status)==="online"?!0:void 0),agentVersion:W(o.agent_version)||W(o.agentVersion)||W(o.app_version),agentRunning:Gt(o.agent_running)??Gt(y.running),hookAvailable:Gt(o.hook_available)??Gt(o.supports_hook)??Gt(_.available),wechatRunning:Gt(o.wechat_running)??Gt(d.running),wechatId:W(o.wxid)||W(o.wechat_id)||W(d.id)||W(d.wechat_id),friendCount:Rt(o.friend_count)??Rt(d.friend_count),wechatVersion:W(o.wechat_version)||W(d.version),batteryPercent:Rt(o.battery_percent)??Rt(o.batteryPercent)??Rt(ce(o.battery)?o.battery.percent:void 0),networkType:W(o.network_type)||W(o.networkType)||W(ce(o.network)?o.network.type:void 0),healthScore:Rt(o.health_score)??Rt(o.healthScore)??Rt(ce(o.health)?o.health.score:void 0),tags:oo(o.tags)||oo(o.labels)||oo(o.tag_names),lastHeartbeat:W(o.last_heartbeat)||W(o.lastHeartbeat),sourceAt:Te(o)||W(o.last_heartbeat),capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(x=>typeof x=="string"):void 0,sourceKind:o.source_kind==="history"||o.sourceKind==="history"?"history":o.source_kind==="fixture"||o.sourceKind==="fixture"?"fixture":"live",sourceLabel:W(o.source_label)||W(o.sourceLabel),statusSource:W(o.status_source)||W(o.statusSource),raw:o}},jc=o=>Qt(o,["devices","items"]).flatMap(d=>{const y=Df(d);return y?[y]:[]}),$f=()=>{const o=new URLSearchParams(window.location.search).get("device_state_fixture");if(o)try{const u=JSON.parse(decodeURIComponent(escape(window.atob(o))));if(u.mode!=="readonly_fixture"||typeof u.label!="string")return;const d=jc(u.devices).map(y=>({...y,sourceKind:y.sourceKind||"fixture"}));return{label:u.label,devices:d}}catch{return}},Uf=o=>Qt(o,["items","groups"]).flatMap(u=>{if(!ce(u))return[];const d=W(u.group_id)||W(u.groupId)||W(u.id);return d?[{groupId:d,name:W(u.name)||d,memberCount:Rt(u.member_count)??Rt(u.memberCount),deviceIds:Array.isArray(u.device_ids)?u.device_ids.filter(y=>typeof y=="string"):void 0,sourceAt:Te(u)}]:[]});async function Vf(){var Fe,_e;const[o,u,d,y,_,x,z,I,F,X,q,Y,R,O,te,J]=await Promise.all([$e(["/api/v3/workbench/overview"],"GET /api/v3/workbench/overview",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/fleet/devices","/api/v3/devices"],"GET /api/v3/fleet/devices",w=>({data:jc(w),sourceAt:Te(w)})),$e(["/api/v3/device-groups"],"GET /api/v3/device-groups",w=>({data:Uf(w),sourceAt:Te(w)})),$e(["/api/v3/releases/latest"],"GET /api/v3/releases/latest",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)||(ce(w)?W(w.published_at):void 0)})),$e(["/api/v3/ai/status"],"GET /api/v3/ai/status",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/ai/tasks?limit=20"],"GET /api/v3/ai/tasks",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/ai/brain/dashboard"],"GET /api/v3/ai/brain/dashboard",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/connection/status"],"GET /api/v3/connection/status",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/process/status"],"GET /api/v3/process/status",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/integration/health"],"GET /api/v3/integration/health",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/integrations/apps","/api/v3/integrations/clients"],"GET /api/v3/integrations/apps",w=>({data:Qt(w,["items","applications"]),sourceAt:Te(w)})),$e(["/api/v3/integrations/authorizations","/api/v3/authorization-grants"],"GET /api/v3/integrations/authorizations",w=>({data:Qt(w,["items","grants"]),sourceAt:Te(w)})),$e(["/api/v3/integrations/usage"],"GET /api/v3/integrations/usage",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/integration/manifest"],"GET /api/v3/integration/manifest",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/integrations/docs/catalog","/api/v3/docs/catalog"],"GET /api/v3/integrations/docs/catalog",w=>({data:Qt(w,["items","documents"]),sourceAt:Te(w)})),$e(["/api/v3/kb/search?limit=10"],"GET /api/v3/kb/search",w=>({data:Qt(w,["items","results","documents"]),sourceAt:Te(w)}))]),b=$f(),Le=b&&u.state==="ready"?{...u,source:`${u.source} + readonly_fixture:${b.label}`,data:[...u.data||[],...b.devices]}:u,ze=(_e=(Fe=Le.data)==null?void 0:Fe[0])==null?void 0:_e.deviceId,Ie=ze?await $e([`/api/v3/wechat/hook/status?device_id=${encodeURIComponent(ze)}`],"GET /api/v3/wechat/hook/status",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})):Ze("GET /api/v3/wechat/hook/status"),fe=x.state==="ready"?Qt(x.data,["items","tasks"]):[],ge=fe.length&&ce(fe[0])?W(fe[0].task_id):void 0,[he,pe,we]=ge?await Promise.all([$e([`/api/v3/ai/tasks/${encodeURIComponent(ge)}`],"GET /api/v3/ai/tasks/{task_id}",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e([`/api/v3/ai/tasks/${encodeURIComponent(ge)}/logs`],"GET /api/v3/ai/tasks/{task_id}/logs",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)})),$e([`/api/v3/ai/tasks/${encodeURIComponent(ge)}/audit`],"GET /api/v3/ai/tasks/{task_id}/audit",w=>({data:ce(w)?w:void 0,sourceAt:Te(w)}))]):[Ze("GET /api/v3/ai/tasks/{task_id}"),Ze("GET /api/v3/ai/tasks/{task_id}/logs"),Ze("GET /api/v3/ai/tasks/{task_id}/audit")],Oe=x.state==="ready"?{state:"ready",source:"GET /api/v3/ai/tasks + /logs + /audit",sourceAt:[x.sourceAt,he.sourceAt,pe.sourceAt,we.sourceAt].filter(Boolean).sort().at(-1),data:{items:fe,selected:he.data,logs:Qt(pe.data,["items","logs"]),audit:Qt(we.data,["items","audit"])}}:{state:x.state,source:x.source,status:x.status,error:x.error},je=_.state==="ready"||z.state==="ready"||I.state==="ready"||F.state==="ready"||X.state==="ready"?{state:"ready",source:"GET /api/v3/ai/status + /api/v3/ai/brain/dashboard + /api/v3/connection/status + /api/v3/process/status",sourceAt:[_.sourceAt,z.sourceAt,I.sourceAt,F.sourceAt,X.sourceAt].filter(Boolean).sort().at(-1),data:{aiStatus:_.data,brain:z.data,connection:I.data,process:F.data,integrationHealth:X.data}}:{state:_.state==="forbidden"?"forbidden":"unavailable",source:"GET /api/v3/ai/status + /api/v3/ai/brain/dashboard",error:_.error||z.error,status:_.status||z.status};return{overview:o,devices:Le,hookStatus:Ie,groups:d,release:y,engine:je,aiOperations:Oe,integrations:{applications:q,authorizations:Y,usage:R,manifest:O,documents:te,knowledge:J},readAt:new Date().toISOString()}}const Hf=o=>ce(o)?{value:o.value,display:W(o.display),status:W(o.status),source:W(o.source),sampled_at:W(o.sampled_at)}:{},Gr=(o,u=15)=>{if(!o)return!1;const d=Date.parse(o);return Number.isFinite(d)&&Date.now()-d>u*60*1e3},Tn=o=>o.error||(o.status===403?"当前账号没有读取权限":o.status===401?"登录状态已失效":"接口未接通或暂无数据"),ii={device:{},agent:{},platform:{},binding:{},wechat:{},services:{},permissions:[],events:[],agentLogs:[]},Pn=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),kc=o=>{if(typeof o!="string")return o;try{return JSON.parse(o)}catch{return o}},Bf=(o,u)=>{let d=o;for(const y of u.split(".")){if(!Pn(d)||!(y in d))return;d=d[y]}return d},H=(o,u)=>{for(const d of u){const y=Bf(o,d);if(y!=null&&y!=="")return y}},me=o=>{if(typeof o=="string")return o;if(typeof o=="number")return String(o)},Mt=o=>{const u=typeof o=="number"?o:Number(o);return Number.isFinite(u)?u:void 0},Ke=o=>{if(typeof o=="boolean")return o;if(o===1||o==="1"||o==="true"||o==="online"||o==="connected"||o==="running")return!0;if(o===0||o==="0"||o==="false"||o==="offline"||o==="disconnected"||o==="stopped")return!1},hc=o=>Array.isArray(o)?o.flatMap((u,d)=>{if(typeof u=="string")return[{id:String(d),message:u}];if(!Pn(u))return[];const y=me(H(u,["message","content","text","event","title"]));if(!y)return[];const _=me(H(u,["level","status","type"])),x=_==="success"||_==="warning"||_==="error"||_==="info"?_:void 0;return[{id:me(H(u,["id"]))??String(d),time:me(H(u,["time","timestamp","created_at","createdAt"])),message:y,level:x}]}):[],Wf=o=>Array.isArray(o)?o.flatMap((u,d)=>Pn(u)?[{key:me(H(u,["key","id","name"]))??String(d),name:me(H(u,["label","name","title"]))??`权限 ${d+1}`,granted:Ke(H(u,["granted","enabled","available","status"]))}]:[]):Pn(o)?Object.entries(o).map(([u,d])=>({key:u,name:u,granted:Ke(d)})):[],Gf=o=>{const u=Pn(o)?o:{};return{capturedAt:me(H(u,["capturedAt","captured_at","timestamp"])),device:{id:me(H(u,["device.id","device.deviceId","device.device_id","deviceId","device_id","id"])),name:me(H(u,["device.name","device.deviceName","device_name","name"])),model:me(H(u,["device.model","device.modelName","device.model_name","model"])),androidVersion:me(H(u,["device.androidVersion","device.android_version","androidVersion","android_version"])),imeiMasked:me(H(u,["device.imeiMasked","device.imei_masked","imeiMasked","imei_masked","binding.encryptedImei"])),fingerprint:me(H(u,["device.fingerprint","device.deviceFingerprint","device_fingerprint","fingerprint"])),serialNumber:me(H(u,["device.serialNumber","device.serial_number","serialNumber","serial_number","serial"])),batteryPercent:Mt(H(u,["device.batteryPercent","device.battery_percent","battery.percent","batteryPercent","battery"])),temperatureC:Mt(H(u,["device.temperatureC","device.temperature_c","temperature.celsius","temperatureC","temperature"])),storageFreeGB:Mt(H(u,["device.storageFreeGB","device.storage_free_gb","storage.freeGB","storageFreeGB","storage_free_gb"])),healthScore:Mt(H(u,["device.healthScore","device.health_score","health.score","healthScore","health_score"])),projectGroup:me(H(u,["device.projectGroup","device.project_group","projectGroup","project_group"])),tags:Array.isArray(H(u,["device.tags","tags"]))?H(u,["device.tags","tags"]).filter(d=>typeof d=="string"):void 0,networkType:me(H(u,["device.networkType","device.network_type","network.type","networkType","network_type"]))},agent:{running:Ke(H(u,["agent.running","agent.isRunning","agent_running","running"])),connected:Ke(H(u,["agent.connected","agent.online","agent_connected","wsConnected","ws_connected"])),uptimeSeconds:Mt(H(u,["agent.uptimeSeconds","agent.uptime_seconds","uptimeSeconds","uptime_seconds"])),host:me(H(u,["agent.host","agent.currentHost","agent.current_host","host"])),latencyMs:Mt(H(u,["agent.latencyMs","agent.latency_ms","latencyMs","latency_ms"])),autoDiscovery:Ke(H(u,["agent.autoDiscovery","agent.auto_discovery","automation.autoDiscovery"])),autoRoute:Ke(H(u,["agent.autoRoute","agent.auto_route","automation.autoRoute"])),autoReconnect:Ke(H(u,["agent.autoReconnect","agent.auto_reconnect","automation.autoReconnect"])),heartbeatKeepAlive:Ke(H(u,["agent.heartbeatKeepAlive","agent.heartbeat_keep_alive","automation.heartbeatKeepAlive"])),selfHealing:Ke(H(u,["agent.selfHealing","agent.self_healing","automation.selfHealing"])),bootStart:Ke(H(u,["agent.bootStart","agent.boot_start","automation.bootStart"]))},platform:{connected:Ke(H(u,["platform.connected","platform.online","platform_connected","server.connected"])),name:me(H(u,["platform.name","platform.platformName","platform_name","binding.platformName"])),serverUrl:me(H(u,["platform.serverUrl","platform.server_url","server.url","server_url"])),port:Mt(H(u,["platform.port","server.port","port"])),tlsEnabled:Ke(H(u,["platform.tlsEnabled","platform.tls_enabled","server.tls","tls_enabled"])),tokenMasked:me(H(u,["platform.tokenMasked","platform.token_masked","server.tokenMasked","token_masked"])),latencyMs:Mt(H(u,["platform.latencyMs","platform.latency_ms","server.latencyMs","server_latency_ms"]))},binding:{bound:Ke(H(u,["binding.bound","binding.isBound","bound","is_bound"])),platformName:me(H(u,["binding.platformName","binding.platform_name","platform.name"])),encryptedImei:me(H(u,["binding.encryptedImei","binding.encrypted_imei","device.imeiMasked","imei_masked"])),lastHeartbeat:me(H(u,["binding.lastHeartbeat","binding.last_heartbeat","lastHeartbeat","last_heartbeat"]))},wechat:{running:Ke(H(u,["wechat.running","wechat.isRunning","wechat_running"])),idMasked:me(H(u,["wechat.idMasked","wechat.id_masked","wechatIdMasked","wechat_id_masked","wechat.id"])),version:me(H(u,["wechat.version","wechat_version"])),friendCount:Mt(H(u,["wechat.friendCount","wechat.friend_count","friendCount","friend_count"]))},services:{sdkConnected:Ke(H(u,["services.sdkConnected","services.sdk_connected","sdk.connected","sdk_connected"])),fridaRunning:Ke(H(u,["services.fridaRunning","services.frida_running","frida.running","frida_running"])),hookAvailable:Ke(H(u,["services.hookAvailable","services.hook_available","hook.available","hook_available"]))},permissions:Wf(H(u,["permissions","device.permissions","runtime.permissions"])),version:me(H(u,["version","app.version","app_version"])),events:hc(H(u,["events","recentEvents","recent_events"])),agentLogs:hc(H(u,["agentLogs","agent_logs","logs"]))}},Qf=async()=>{const o=window.NativeAgent;if(!(o!=null&&o.getSnapshot))return{bridgeAvailable:!1,snapshot:ii,error:"NativeAgent.getSnapshot() 未接入"};try{const u=await Promise.resolve(o.getSnapshot()),d=kc(u);if(!Pn(d))throw new Error("快照格式不是 JSON 对象");return{bridgeAvailable:!0,snapshot:Gf(d)}}catch(u){return{bridgeAvailable:!0,snapshot:ii,error:u instanceof Error?u.message:"读取设备快照失败"}}},Kf=async o=>{const u=window.NativeAgent;if(!(u!=null&&u.performAction))return{success:!1,message:"NativeAgent.performAction(action) 未接入",code:"BRIDGE_UNAVAILABLE"};try{const d=await Promise.resolve(u.performAction(o)),y=kc(d);if(typeof y=="string")return{success:!0,message:y};if(!Pn(y))return{success:!0,message:"操作已提交",data:y};const _=Ke(H(y,["success","ok"])),x=H(y,["code","error_code"]),z=Mt(x),I=z!==void 0&&z>=400,F=me(H(y,["message","error_message","msg"]))??(_===!1?"操作执行失败":"操作已提交");return{success:_!==!1&&!I,message:F,data:y.data,code:typeof x=="string"||typeof x=="number"?x:void 0}}catch(d){return{success:!1,message:d instanceof Error?d.message:"原生操作执行失败",code:"ACTION_ERROR"}}},Yf=(o,u="")=>o===void 0||o===""?"—":`${o}${u}`;function Xf({value:o}){return i.jsx("span",{className:`status-dot ${o===!0?"is-online":o===!1?"is-offline":"is-unknown"}`})}function si({value:o,online:u="正常",offline:d="异常"}){return i.jsxs("span",{className:`status-text ${o===!0?"is-online":o===!1?"is-offline":"is-unknown"}`,children:[i.jsx(Xf,{value:o}),o===!0?u:o===!1?d:"不可用"]})}function Br({children:o}){return i.jsx("h2",{className:"section-title",children:o})}function Pe({children:o,className:u=""}){return i.jsx("section",{className:`card ${u}`,children:o})}function pn({title:o,detail:u}){return i.jsxs("div",{className:"empty-notice",children:[i.jsx(se,{name:"link",size:22}),i.jsxs("div",{children:[i.jsx("strong",{children:o}),i.jsx("span",{children:u})]})]})}function Zf({icon:o,children:u,secondary:d,...y}){return i.jsxs("button",{className:`action-button ${d?"is-secondary":""}`,...y,children:[i.jsx(se,{name:o,size:20}),i.jsx("span",{children:u})]})}const qf=[{icon:"agent",title:"任务智能",detail:"把任务拆清楚,再交给明确设备执行。",key:"tasks"},{icon:"wechat",title:"业务能力",detail:"按普通人看得懂的业务动作组织能力。",key:"skills"},{icon:"heartbeat",title:"稳定连接",detail:"先确认连接、心跳和探针,再谈执行。",key:"connection"},{icon:"shield",title:"运行治理",detail:"风险、审批、审计和回读都留下证据。",key:"governance"}];function Ot(o){return o==null||o===""?"未获取":String(o)}function Hr(o,u){return typeof o=="object"&&o!==null&&!Array.isArray(o)?o[u]:void 0}function Jf({icon:o,title:u,detail:d,sectionKey:y,api:_}){const x=_.engine.data,z=(x==null?void 0:x.brain)||{},I=z.skills||{},F=z.channels,X=(x==null?void 0:x.connection)||{},q=(x==null?void 0:x.integrationHealth)||{},Y=_.engine.sourceAt,R=Gr(Y),O=R?"数据已过期":y==="skills"?`${Ot(I.total_skills)} 个技能 / ${Ot(I.total_actions)} 个动作`:y==="connection"?`${Ot(X.online_ws_count)} 台 WSS 在线`:y==="governance"?q.ok===!0?"健康检查通过":q.ok===!1?"存在异常":"未获取":"暂无任务样本",te=y==="skills"?[`能做的事:${Ot(I.total_skills)}`,`可以调用的动作:${Ot(I.total_actions)}`,`连接方式:${F?Object.keys(F).length:"未获取"}`,"能力详情来自真实接口"]:y==="connection"?[`WSS 在线:${Ot(X.online_ws_count)}`,`连接设备:${Array.isArray(X.devices)?X.devices.length:"未获取"}`,`进程状态:${Ot(((x==null?void 0:x.process)||{}).state)}`,"不触发设备命令"]:y==="governance"?[`集成健康:${q.ok===!0?"正常":q.ok===!1?"异常":"未获取"}`,"权限与审计:读取对应 GET 结果","风险状态:总览接口聚合","业务回读:写任务页面单独验收"]:["任务状态:暂无样本","任务步骤:等待 AI 任务查询接口","目标设备:不自动选择","失败回执:写任务单独查看"];return i.jsxs(Pe,{className:"engine-section-card",children:[i.jsxs("div",{className:"engine-section-head",children:[i.jsx("span",{className:"engine-icon",children:i.jsx(se,{name:o,size:22})}),i.jsxs("div",{children:[i.jsx("h3",{children:u}),i.jsx("p",{children:d})]}),i.jsx("strong",{className:"engine-section-value",children:O})]}),i.jsx("ul",{children:te.map(J=>i.jsxs("li",{children:[i.jsx("span",{className:"status-dot is-unknown"}),J,i.jsx("b",{children:R?"数据已过期":_.engine.state==="ready"?"已读取":"未获取"})]},J))})]})}function bf({snapshot:o,api:u,busyAction:d,onAction:y}){var x,z,I,F,X,q,Y,R,O;const _=u.engine.sourceAt||u.readAt;return i.jsxs("main",{className:"console-page console-engine",children:[i.jsxs("header",{className:"console-page-header",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"能力中心 / 任务与治理"}),i.jsx("h1",{children:"智能引擎"}),i.jsx("p",{children:"把“能做什么、谁来做、结果怎么确认”分成四块。"})]}),i.jsx(Zf,{icon:"refresh",secondary:!0,disabled:d==="refresh_snapshot",onClick:()=>y("refresh_snapshot"),children:"刷新数据"})]}),u.engine.state==="forbidden"&&i.jsx(pn,{title:"智能引擎数据无权限",detail:Tn(u.engine)}),u.engine.state==="unavailable"&&i.jsx(pn,{title:"智能引擎接口未接通",detail:`${Tn(u.engine)};不展示虚构的技能数、操作数或在线设备数。`}),i.jsxs(Pe,{className:"engine-hero",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"执行前先确认"}),i.jsx("h2",{children:"先选任务,再选设备,最后看回执"}),i.jsx("p",{children:"单机和批量任务都必须有明确目标设备、权限、风险等级和业务回读。"})]}),i.jsxs("div",{className:"engine-connection",children:[i.jsx(si,{value:o.agent.connected,online:"WSS 在线",offline:"WSS 离线"}),i.jsx(si,{value:o.services.hookAvailable,online:"Hook 已挂载",offline:"Hook 未挂载"})]})]}),i.jsx(Br,{children:"四个能力分区"}),i.jsx("div",{className:"engine-grid",children:qf.map(te=>i.jsx(Jf,{icon:te.icon,title:te.title,detail:te.detail,sectionKey:te.key,api:u},te.title))}),i.jsx(Br,{children:"AI 操作记录"}),u.aiOperations.state!=="ready"&&i.jsx(pn,{title:"AI 操作记录暂未获取",detail:Tn(u.aiOperations)}),u.aiOperations.state==="ready"&&i.jsxs(Pe,{className:"engine-operation-card",children:[i.jsxs("div",{className:"engine-section-head",children:[i.jsxs("div",{children:[i.jsx("h3",{children:"任务、步骤与审计"}),i.jsx("p",{children:"这里只读取任务记录,不会向设备派发命令。"})]}),i.jsxs("strong",{children:[((x=u.aiOperations.data)==null?void 0:x.items.length)||0," 条"]})]}),!((z=u.aiOperations.data)!=null&&z.items.length)&&i.jsx("p",{className:"muted-text",children:"暂无任务样本"}),!!((I=u.aiOperations.data)!=null&&I.items.length)&&i.jsxs("ul",{children:[i.jsxs("li",{children:["任务:",Ot(Hr((F=u.aiOperations.data)==null?void 0:F.selected,"task_id"))]}),i.jsxs("li",{children:["状态:",Ot(Hr((X=u.aiOperations.data)==null?void 0:X.selected,"status"))]}),i.jsxs("li",{children:["目标设备:",Ot(Hr((q=u.aiOperations.data)==null?void 0:q.selected,"target_device_ids"))]}),i.jsxs("li",{children:["确认要求:",String(Hr(Hr((Y=u.aiOperations.data)==null?void 0:Y.selected,"precheck"),"confirm_required")??"未获取")]}),i.jsxs("li",{children:["步骤记录:",((R=u.aiOperations.data)==null?void 0:R.logs.length)||0," 条"]}),i.jsxs("li",{children:["审计记录:",((O=u.aiOperations.data)==null?void 0:O.audit.length)||0," 条"]})]}),i.jsx("div",{className:"integration-footnote",children:"来源:GET /api/v3/ai/tasks、/logs、/audit · confirm_required 只展示,不在本页确认"})]}),i.jsx(Br,{children:"当前连接摘要"}),i.jsxs("div",{className:"engine-facts",children:[i.jsxs(Pe,{children:[i.jsx("span",{children:"Agent"}),i.jsx("strong",{children:o.agent.running===!0?"运行中":o.agent.running===!1?"已停止":"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("span",{children:"Hook 探针"}),i.jsx("strong",{children:o.services.hookAvailable===!0?"可用":o.services.hookAvailable===!1?"不可用":"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("span",{children:"最近心跳"}),i.jsx("strong",{children:o.binding.lastHeartbeat||"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("span",{children:"任务队列"}),i.jsx("strong",{children:u.engine.state==="ready"?"暂无样本":"未获取"})]})]}),i.jsxs("div",{className:"integration-footnote",children:["来源:GET /api/v3/ai/status、/api/v3/ai/brain/dashboard、/api/v3/connection/status、/api/v3/process/status · 读取于 ",_||"未获取"]})]})}const ep="https://wpsdk.quwanzhi.com/static/downloads/workphone-agent-latest.apk",tr=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),It=o=>o===void 0||o===""?"未获取":String(o),Wr=(o,u="正常",d="异常")=>o===!0?u:o===!1?d:"未获取",wt=o=>o.status==="pending_authorization"||o.status==="pending_auth"?"待授权":o.online===!0||o.status==="online"?"在线":o.online===!1||o.status==="offline"?"离线":"未获取",oi=o=>wt(o)==="在线"?"is-online":wt(o)==="离线"?"is-offline":wt(o)==="待授权"?"is-pending":"is-unknown",tp=o=>o.sourceKind==="history"?"历史 Agent 记录":o.sourceKind==="fixture"?"安全测试夹具":"实时接口",np="ws://192.168.110.101:8899/ws/device",rp=()=>{const o=window.location.hostname;return/^(?:10\.|192\.168\.|172\.(?:1[6-9]|2\d|3[01])\.)/.test(o)?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/device`:np},lp=()=>{var o,u;return((u=(o=window.crypto)==null?void 0:o.randomUUID)==null?void 0:u.call(o))||`console-${Date.now()}-${Math.random().toString(16).slice(2)}`};function ip({device:o,sourceAt:u,onOpen:d}){const y=wt(o),_=Gr(o.sourceAt||u);return i.jsxs("button",{className:"device-summary-card",type:"button",onClick:d,children:[i.jsxs("span",{className:`device-summary-icon ${oi(o)}`,children:[i.jsx(se,{name:"device",size:28}),i.jsx("i",{})]}),i.jsxs("span",{className:"device-summary-main",children:[i.jsxs("span",{className:"device-summary-title",children:[i.jsx("strong",{children:o.name||o.model||"未命名手机"}),i.jsx("b",{className:oi(o),children:y})]}),i.jsxs("span",{className:"device-summary-sub",children:[It(o.model)," · Android ",It(o.androidVersion)]}),i.jsx("span",{className:"device-summary-id",children:o.deviceId}),i.jsxs("span",{className:"device-summary-facts",children:[i.jsxs("em",{children:[i.jsx(se,{name:"wechat",size:15}),o.wechatId||(o.wechatRunning?"微信运行中":"未绑定微信")]}),i.jsxs("em",{children:[i.jsx(se,{name:"agent",size:15}),"Agent ",Wr(o.agentRunning)]}),i.jsxs("em",{children:[i.jsx(se,{name:"link",size:15}),"Hook ",Wr(o.hookAvailable,"已挂载","未挂载")]})]})]}),i.jsxs("span",{className:"device-summary-side",children:[i.jsx("span",{children:o.groupId||o.projectId||"未分组"}),i.jsx("small",{className:_?"is-expired":"",children:_?"数据已过期":o.sourceAt||u||"未获取采样时间"}),i.jsxs("b",{children:["查看管理 ",i.jsx(se,{name:"chevron",size:16})]})]})]})}function He({label:o,value:u}){return i.jsxs("div",{className:"device-detail-item",children:[i.jsx("span",{children:o}),i.jsx("strong",{children:u})]})}function sp({api:o,loading:u,onRefresh:d}){var h,j;const[y,_]=ne.useState(""),[x,z]=ne.useState("all"),[I,F]=ne.useState("all"),[X,q]=ne.useState(),[Y,R]=ne.useState(!1),[O,te]=ne.useState(!1),[J,b]=ne.useState(!1),[Le,ze]=ne.useState(),[Ie,fe]=ne.useState("cunkebao"),[ge,he]=ne.useState("工作手机"),[pe,we]=ne.useState(rp),[Oe,je]=ne.useState(""),[Fe,_e]=ne.useState(""),w=o.devices.data||[],Be=o.groups.data||[],G=w.find(E=>E.deviceId===X),Ee=ne.useMemo(()=>w.filter(E=>{const C=`${E.name||""} ${E.model||""} ${E.deviceId} ${E.wechatId||""}`.toLowerCase(),A=wt(E),ee=x==="all"||x==="online"&&A==="在线"||x==="offline"&&A==="离线"||x==="pending"&&A==="待授权";return C.includes(y.trim().toLowerCase())&&ee&&(I==="all"||E.groupId===I||E.projectId===I)}),[w,I,y,x]),ie=o.devices.sourceAt||o.readAt,P={online:w.filter(E=>wt(E)==="在线").length,pending:w.filter(E=>wt(E)==="待授权").length,offline:w.filter(E=>wt(E)==="离线").length},B=async()=>{b(!0),_e(""),je("");try{const E=await fetch("/api/v3/qrcode/generate",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_id:Ie.trim()||"cunkebao",project_name:ge.trim()||"工作手机",server:pe.trim()})}),C=await E.json().catch(()=>({}));if(!E.ok){const re=tr(C)?C.message||C.detail||C.error:void 0;throw new Error(typeof re=="string"?re:`二维码生成失败(${E.status})`)}const A=tr(C)&&tr(C.data)?C.data:C;if(!tr(A))throw new Error("二维码响应格式错误");const ee=typeof A.image_data_url=="string"?A.image_data_url:typeof A.image_base64=="string"?`data:image/png;base64,${A.image_base64}`:"";if(!ee)throw new Error(typeof A.message=="string"?A.message:"服务未返回二维码图片");je(ee)}catch(E){_e(E instanceof Error?E.message:"二维码生成失败")}finally{b(!1)}},L=async()=>{if(!(!G||wt(G)!=="离线")){b(!0),ze(void 0);try{const E=await fetch(`/api/v3/devices/${encodeURIComponent(G.deviceId)}?confirm=true`,{method:"DELETE",credentials:"same-origin",headers:{"Idempotency-Key":lp(),"X-Actor-Id":"console-admin","X-Authenticated":"true","X-Permissions":"device.delete"}}),C=await E.json().catch(()=>({}));if(!E.ok||tr(C)&&C.success===!1){const A=tr(C)?C.message||C.error_message||C.detail:void 0;throw new Error(typeof A=="string"?A:`删除失败(${E.status})`)}te(!1),q(void 0),ze({success:!0,message:"手机设备已删除,历史任务和审计记录继续保留。"}),await d()}catch(E){ze({success:!1,message:E instanceof Error?E.message:"删除设备失败"})}finally{b(!1)}}};return i.jsxs("main",{className:"console-page console-devices",children:[i.jsxs("header",{className:"console-page-header device-page-heading",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"手机管理"}),i.jsx("h1",{children:"手机设备"}),i.jsx("p",{children:"外层只看手机状态;点击一台手机,再查看参数、运行记录和删除操作。"})]}),i.jsxs("button",{className:"primary-action device-add-button",type:"button",onClick:()=>R(!0),children:[i.jsx(se,{name:"qr",size:18}),"添加手机"]})]}),Le&&i.jsx("div",{className:`device-page-notice ${Le.success?"is-success":"is-error"}`,children:Le.message}),o.devices.state==="forbidden"&&i.jsx(pn,{title:"手机列表无权限",detail:Tn(o.devices)}),o.devices.state==="unavailable"&&i.jsx(pn,{title:"手机设备列表还没有真实数据",detail:`${Tn(o.devices)};不展示演示设备卡片。`}),i.jsxs(Pe,{className:"device-management-bar",children:[i.jsxs("div",{className:"device-counts",children:[i.jsxs("button",{className:x==="all"?"is-active":"",onClick:()=>z("all"),children:["全部 ",i.jsx("b",{children:w.length})]}),i.jsxs("button",{className:x==="online"?"is-active":"",onClick:()=>z("online"),children:[i.jsx("i",{className:"online"}),"在线 ",i.jsx("b",{children:P.online})]}),i.jsxs("button",{className:x==="pending"?"is-active":"",onClick:()=>z("pending"),children:[i.jsx("i",{className:"pending"}),"待授权 ",i.jsx("b",{children:P.pending})]}),i.jsxs("button",{className:x==="offline"?"is-active":"",onClick:()=>z("offline"),children:[i.jsx("i",{className:"offline"}),"离线 ",i.jsx("b",{children:P.offline})]})]}),i.jsxs("div",{className:"device-filter-compact",children:[i.jsxs("label",{children:[i.jsx(se,{name:"search",size:17}),i.jsx("input",{value:y,onChange:E=>_(E.target.value),placeholder:"搜索手机、设备 ID 或微信号"})]}),i.jsxs("select",{value:I,onChange:E=>F(E.target.value),children:[i.jsx("option",{value:"all",children:"全部分组"}),Be.map(E=>i.jsx("option",{value:E.groupId,children:E.name},E.groupId))]}),i.jsxs("button",{type:"button",onClick:()=>void d(),disabled:u,children:[i.jsx(se,{name:"refresh",size:17}),"刷新"]})]})]}),i.jsxs("div",{className:"device-list-heading",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"手机列表"}),i.jsx("h2",{children:o.devices.state==="ready"?`${Ee.length} 台手机`:"暂无手机"})]}),i.jsxs("span",{className:"data-source-note",children:[o.devices.source," · ",ie||"未获取采样时间"]})]}),Ee.length?i.jsx("div",{className:"device-summary-list",children:Ee.map(E=>i.jsx(ip,{device:E,sourceAt:ie,onOpen:()=>q(E.deviceId)},E.deviceId))}):i.jsxs(Pe,{className:"device-empty-card",children:[i.jsx(se,{name:"device",size:28}),i.jsx("strong",{children:o.devices.state==="ready"?"没有匹配的手机":"暂无手机"}),i.jsx("span",{children:o.devices.state==="ready"?"更换状态、分组或搜索词试试。":"点击“添加手机”,完成下载、安装和扫码绑定。"})]}),G&&i.jsx("div",{className:"device-overlay",role:"dialog","aria-modal":"true","aria-label":"手机管理详情",onMouseDown:E=>{E.target===E.currentTarget&&q(void 0)},children:i.jsxs("aside",{className:"device-detail-drawer",children:[i.jsxs("header",{children:[i.jsx("button",{type:"button",className:"drawer-close",onClick:()=>q(void 0),children:"×"}),i.jsxs("span",{className:`device-summary-icon ${oi(G)}`,children:[i.jsx(se,{name:"device",size:28}),i.jsx("i",{})]}),i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"手机管理"}),i.jsx("h2",{children:G.name||G.model||"未命名手机"}),i.jsx("p",{children:G.deviceId})]}),i.jsx("b",{className:oi(G),children:wt(G)})]}),i.jsxs("section",{children:[i.jsx("h3",{children:"运行状态"}),i.jsxs("div",{className:"device-detail-grid",children:[i.jsx(He,{label:"WSS",value:wt(G)}),i.jsx(He,{label:"Agent",value:Wr(G.agentRunning)}),i.jsx(He,{label:"Hook",value:Wr(G.hookAvailable,"已挂载","未挂载")}),i.jsx(He,{label:"最后心跳",value:G.lastHeartbeat||"未获取"})]})]}),i.jsxs("section",{children:[i.jsx("h3",{children:"微信"}),i.jsxs("div",{className:"device-detail-grid",children:[i.jsx(He,{label:"运行状态",value:Wr(G.wechatRunning,"运行中","未运行")}),i.jsx(He,{label:"微信号",value:G.wechatId||"未绑定微信号"}),i.jsx(He,{label:"好友数",value:It(G.friendCount)}),i.jsx(He,{label:"微信版本",value:It(G.wechatVersion)})]})]}),i.jsxs("section",{children:[i.jsx("h3",{children:"手机信息"}),i.jsxs("div",{className:"device-detail-grid",children:[i.jsx(He,{label:"型号",value:It(G.model)}),i.jsx(He,{label:"Android",value:It(G.androidVersion)}),i.jsx(He,{label:"项目 / 分组",value:It(G.groupId||G.projectId)}),i.jsx(He,{label:"网络",value:It(G.networkType)}),i.jsx(He,{label:"电量",value:G.batteryPercent===void 0?"未获取":`${G.batteryPercent}%`}),i.jsx(He,{label:"健康度",value:It(G.healthScore)})]})]}),i.jsxs("details",{className:"device-advanced",children:[i.jsx("summary",{children:"查看技术参数"}),i.jsxs("div",{children:[i.jsx(He,{label:"数据类型",value:tp(G)}),i.jsx(He,{label:"Agent 版本",value:It(G.agentVersion)}),i.jsx(He,{label:"状态来源",value:G.statusSource||o.devices.source}),i.jsx(He,{label:"采样时间",value:G.sourceAt||ie||"未获取"}),i.jsx(He,{label:"能力",value:(h=G.capabilities)!=null&&h.length?G.capabilities.join("、"):"未获取"})]})]}),i.jsxs("footer",{children:[i.jsxs("button",{className:"quiet-button",type:"button",onClick:()=>void d(),disabled:u,children:[i.jsx(se,{name:"refresh",size:17}),"刷新状态"]}),wt(G)==="离线"?i.jsxs("button",{className:"danger-button",type:"button",onClick:()=>te(!0),children:[i.jsx(se,{name:"power",size:17}),"删除手机"]}):i.jsx("span",{children:"在线手机需先下线,才能删除。"})]})]})}),Y&&i.jsx("div",{className:"device-overlay",role:"dialog","aria-modal":"true","aria-label":"添加手机",onMouseDown:E=>{E.target===E.currentTarget&&R(!1)},children:i.jsxs("section",{className:"device-add-modal",children:[i.jsxs("header",{children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"添加手机"}),i.jsx("h2",{children:"下载、安装并扫码绑定"}),i.jsx("p",{children:"二维码直接由后台生成,不依赖浏览器 NativeAgent。"})]}),i.jsx("button",{type:"button",className:"drawer-close",onClick:()=>R(!1),children:"×"})]}),i.jsxs("div",{className:"device-add-steps",children:[i.jsxs("div",{children:[i.jsx("span",{children:"1"}),i.jsx("strong",{children:"下载 APK"}),i.jsx("a",{href:((j=o.release.data)==null?void 0:j.download_url)||ep,children:"下载当前安装包"})]}),i.jsxs("div",{children:[i.jsx("span",{children:"2"}),i.jsx("strong",{children:"手机安装"}),i.jsx("small",{children:"打开工作手机 Agent"})]}),i.jsxs("div",{children:[i.jsx("span",{children:"3"}),i.jsx("strong",{children:"扫码绑定"}),i.jsx("small",{children:"用 Agent 扫描右侧二维码"})]})]}),i.jsxs("div",{className:"device-bind-layout",children:[i.jsxs("div",{className:"device-bind-form",children:[i.jsxs("label",{children:["项目",i.jsx("input",{value:Ie,onChange:E=>fe(E.target.value)})]}),i.jsxs("label",{children:["手机名称",i.jsx("input",{value:ge,onChange:E=>he(E.target.value)})]}),i.jsxs("label",{children:["服务器地址",i.jsx("input",{value:pe,onChange:E=>we(E.target.value)})]}),i.jsxs("button",{className:"primary-action",type:"button",disabled:J||!pe.trim(),onClick:()=>void B(),children:[i.jsx(se,{name:"qr",size:18}),J?"生成中…":Oe?"重新生成二维码":"生成绑定二维码"]})]}),i.jsx("div",{className:"device-qr-area",children:Oe?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Oe,alt:"手机绑定二维码"}),i.jsx("strong",{children:ge||"工作手机"}),i.jsx("small",{children:pe})]}):Fe?i.jsxs(i.Fragment,{children:[i.jsx(se,{name:"link",size:28}),i.jsx("strong",{children:"生成失败"}),i.jsx("small",{className:"is-error",children:Fe})]}):i.jsxs(i.Fragment,{children:[i.jsx(se,{name:"qr",size:42}),i.jsx("strong",{children:"等待生成二维码"}),i.jsx("small",{children:"填写服务器地址后点击生成"})]})})]}),i.jsxs("footer",{children:[i.jsx("span",{children:"绑定成功后,手机会自动出现在列表中。"}),i.jsx("button",{className:"quiet-button",type:"button",onClick:()=>{R(!1),d()},children:"完成并刷新"})]})]})}),O&&G&&i.jsx("div",{className:"device-overlay device-confirm-layer",role:"alertdialog","aria-modal":"true",children:i.jsxs("section",{className:"device-confirm-modal",children:[i.jsx("span",{className:"danger-symbol",children:i.jsx(se,{name:"power",size:25})}),i.jsx("h2",{children:"确认删除这台手机?"}),i.jsxs("p",{children:[i.jsx("strong",{children:G.name||G.model||G.deviceId}),i.jsx("br",{}),"设备登记将删除,历史任务和审计记录继续保留。"]}),i.jsxs("div",{children:[i.jsx("button",{className:"quiet-button",type:"button",onClick:()=>te(!1),children:"取消"}),i.jsx("button",{className:"danger-button",type:"button",disabled:J,onClick:()=>void L(),children:J?"删除中…":"确认删除"})]})]})})]})}const mc=(o,u,d)=>o.state==="forbidden"?"无权限":o.state!=="ready"?"未获取":o.data&&(Array.isArray(o.data)?o.data.length:Object.keys(o.data).length)?u:d,vc=o=>`来源:${o.source} · 读取于 ${o.sourceAt||"未获取"}`,op=[{icon:"users",title:"第三方应用",detail:"应用、负责人、用途、环境、凭证和到期时间",key:"applications"},{icon:"lock",title:"接口授权",detail:"Scope、设备范围、文档范围、期限、额度和 IP 白名单",key:"authorizations"},{icon:"heartbeat",title:"用量统计",detail:"接口、设备、文档、成功率、失败原因和额度消耗",key:"usage"},{icon:"code",title:"接口目录",detail:"动作、参数、权限、错误码、请求与响应示例",key:"manifest"},{icon:"download",title:"SDK / APK",detail:"版本、校验、下载、升级和回滚入口",key:"documents"},{icon:"book",title:"知识库与项目文档",detail:"手册、架构、部署、排错、需求、进度和验收证据",key:"knowledge"}];function ap({api:o,loading:u}){var q,Y;const d=o.integrations,y=(q=d.applications.data)==null?void 0:q.length,_=(Y=d.authorizations.data)==null?void 0:Y.length,x=d.usage.data,z=d.manifest.data,I=(z==null?void 0:z.total_endpoints)??(z==null?void 0:z.endpoint_count)??(z==null?void 0:z.module_count),F=x==null?void 0:x.blocked,X=[d.applications,d.authorizations,d.usage].filter(R=>R.state==="forbidden");return i.jsxs("main",{className:"console-page console-integrations",children:[i.jsxs("header",{className:"console-page-header",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"接入管理 / 权限与用量"}),i.jsx("h1",{children:"统一接入中心"}),i.jsx("p",{children:"第三方从这里登记、授权、查看用量、下载 SDK 和查文档。"})]}),i.jsx("span",{className:"badge badge-blue",children:"默认 deny_all"})]}),X.length>0&&i.jsx(pn,{title:"部分授权或用量数据无权限",detail:X.map(R=>`${R.source}:${Tn(R)}`).join(";")}),u&&i.jsx("div",{className:"integration-footnote",children:"正在读取接入中心 GET 数据…"}),i.jsxs(Pe,{className:"integration-banner",children:[i.jsx("div",{className:"integration-banner-icon",children:i.jsx(se,{name:"link",size:28})}),i.jsxs("div",{children:[i.jsx("h2",{children:"一套接口目录,一套授权口径"}),i.jsx("p",{children:"新第三方默认没有设备和写接口权限;设备范围为空就是没有设备,不解释成全部设备。"})]}),i.jsxs("div",{className:"integration-status",children:[i.jsx("span",{className:"status-dot is-unknown"}),"授权服务 ",i.jsx("strong",{children:mc(d.authorizations,`${_} 条授权`,"暂无样本")})]})]}),i.jsx(Br,{children:"接入中心分区"}),i.jsx("div",{className:"integration-grid",children:op.map(R=>{var J,b;const O=d[R.key],te=R.key==="applications"?`${y} 个应用`:R.key==="authorizations"?`${_} 条授权`:R.key==="usage"?`${(x==null?void 0:x.total_requests)??0} 次请求`:R.key==="manifest"?`${I??0} 个条目`:R.key==="documents"?`${((J=d.documents.data)==null?void 0:J.length)??0} 份文档`:`${((b=d.knowledge.data)==null?void 0:b.length)??0} 条结果`;return i.jsxs(Pe,{className:"integration-card",children:[i.jsx("span",{className:"integration-icon",children:i.jsx(se,{name:R.icon,size:22})}),i.jsxs("div",{children:[i.jsx("h3",{children:R.title}),i.jsx("p",{children:R.detail}),i.jsx("small",{children:vc(O)})]}),i.jsxs("span",{className:`integration-state ${O.state==="forbidden"?"is-forbidden":""}`,children:[mc(O,te,"暂无样本"),i.jsx(se,{name:"chevron",size:16})]})]},R.title)})}),i.jsx(Br,{children:"用量只读摘要"}),i.jsxs("div",{className:"permission-template-grid",children:[i.jsxs(Pe,{children:[i.jsx("strong",{children:"调用总数"}),i.jsx("span",{children:d.usage.state==="forbidden"?Tn(d.usage):(x==null?void 0:x.total_requests)??"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("strong",{children:"成功 / 业务失败"}),i.jsx("span",{children:d.usage.state==="ready"?`${(x==null?void 0:x.success)??0} / ${(x==null?void 0:x.business_failure)??(x==null?void 0:x.failed)??0}`:d.usage.state==="forbidden"?"无权限":"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("strong",{children:"鉴权拦截"}),i.jsx("span",{children:d.usage.state==="ready"?F??0:d.usage.state==="forbidden"?"无权限":"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("strong",{children:"去重设备数"}),i.jsx("span",{children:d.usage.state==="ready"?(x==null?void 0:x.unique_devices)??0:d.usage.state==="forbidden"?"无权限":"未获取"})]})]}),i.jsxs(Pe,{className:"integration-note",children:[i.jsx(se,{name:"shield",size:20}),i.jsxs("div",{children:[i.jsx("strong",{children:"安全边界"}),i.jsx("span",{children:"在线测试必须标明测试环境;密钥、服务器配置、内部验收证据和完整微信号不会通过文档接口暴露。"})]})]}),i.jsxs("div",{className:"integration-footnote",children:[vc(d.usage),Gr(d.usage.sourceAt)?" · 数据已过期":""]})]})}const Sc=(o,u)=>u?"数据已过期":o===void 0||o===""?"未获取":String(o),up=o=>(o==null?void 0:o.display)||((o==null?void 0:o.value)===void 0||(o==null?void 0:o.value)===null?void 0:String(o.value)),cp=(o,u)=>(o==null?void 0:o.sampled_at)||u,dp=o=>{var d;if(!o)return;const u=[o,o.raw_rpc_receipt,(d=o.raw_rpc_receipt)==null?void 0:d.raw_rpc_receipt];for(const y of u){if(!y||typeof y!="object")continue;const _=y;if(typeof _.attached=="boolean")return _.attached;if(typeof _.supports_hook=="boolean")return _.supports_hook}if(o.success===!0&&o.verified===!0)return!0;if(o.success===!1||o.error_code||o.error)return!1};function Cn({icon:o,label:u,metric:d,fallbackAt:y}){const _=Hf(d),x=cp(_,y),z=Gr(x),I=Sc(up(_),z),F=z?"数据已过期":_.source?`来源:${_.source}`:x?`采样于 ${x}`:"暂无样本";return i.jsxs(Pe,{className:"console-metric-card",children:[i.jsx("span",{className:"console-metric-icon",children:i.jsx(se,{name:o,size:20})}),i.jsx("span",{className:"console-metric-label",children:u}),i.jsx("strong",{children:I}),i.jsx("small",{children:F})]})}function ri({label:o,value:u}){return i.jsxs("div",{className:"service-status-row",children:[i.jsx(si,{value:u,online:"正常",offline:"异常"}),i.jsx("span",{children:o})]})}function fp({snapshot:o,api:u,loading:d}){var ge,he,pe,we,Oe,je,Fe,_e,w,Be,G,Ee,ie,P;const y=u.overview.data,_=(y==null?void 0:y.sampled_at)||u.overview.sourceAt,x=Gr(_),z=(he=(ge=y==null?void 0:y.wechat)==null?void 0:ge.devices)==null?void 0:he[0],I=((pe=u.devices.data)==null?void 0:pe.find(B=>B.online===!0))||((we=u.devices.data)==null?void 0:we[0]),F=(Oe=u.engine.data)==null?void 0:Oe.connection,X=typeof(F==null?void 0:F.online_ws_count)=="number"?F.online_ws_count:void 0,q=X!==void 0?X>0:I==null?void 0:I.online,Y=I==null?void 0:I.agentRunning,R=dp(u.hookStatus.data)??(I==null?void 0:I.hookAvailable),O=!!(o.device.id||o.device.name||I!=null&&I.deviceId||z!=null&&z.device_id),te=B=>Sc(B,x),J=o.device.id||(I==null?void 0:I.deviceId)||(z==null?void 0:z.device_id),b=o.device.name||(I==null?void 0:I.name)||J||"当前设备",Le=(z==null?void 0:z.logged_in)??o.wechat.running,ze=(z==null?void 0:z.wechat_version)||o.wechat.version,Ie=(z==null?void 0:z.friend_count)??o.wechat.friendCount,fe=(z==null?void 0:z.sampled_at)||_;return i.jsxs("main",{className:"console-page console-overview",children:[i.jsxs("header",{className:"console-page-header",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"统一工作台 / 只读"}),i.jsx("h1",{children:"数据总览"}),i.jsx("p",{children:"只看真实数据,不在这里扫码、下载或控制设备。"})]}),i.jsxs("div",{className:"page-badges",children:[i.jsx("span",{className:"badge badge-blue",children:"只读页面"}),i.jsx("span",{className:"badge",children:x?"数据已过期":_?`采样于 ${_}`:d?"正在读取":"等待数据"})]})]}),u.overview.state==="unavailable"&&i.jsx(pn,{title:"总览接口未获取到数据",detail:u.overview.error||"不展示演示数量,等待 GET /api/v3/workbench/overview 返回真实数据。"}),x&&i.jsx(pn,{title:"总览数据已过期",detail:"保留接口最后采样时间,等下一次成功读取后更新。"}),i.jsxs("section",{className:"console-metric-grid","aria-label":"真实指标",children:[i.jsx(Cn,{icon:"device",label:"设备总数",metric:(je=y==null?void 0:y.devices)==null?void 0:je.total,fallbackAt:_}),i.jsx(Cn,{icon:"wifi",label:"WSS 在线",metric:(Fe=y==null?void 0:y.devices)==null?void 0:Fe.online,fallbackAt:_}),i.jsx(Cn,{icon:"heartbeat",label:"24h 任务成功率",metric:(_e=y==null?void 0:y.tasks)==null?void 0:_e.success_rate_24h,fallbackAt:_}),i.jsx(Cn,{icon:"shield",label:"待处理风险",metric:(w=y==null?void 0:y.risk_events)==null?void 0:w.unhandled,fallbackAt:_}),i.jsx(Cn,{icon:"wechat",label:"微信已登录",metric:(Be=y==null?void 0:y.wechat)==null?void 0:Be.logged_in_devices,fallbackAt:_}),i.jsx(Cn,{icon:"users",label:"微信好友数",metric:(G=y==null?void 0:y.wechat)==null?void 0:G.friend_count,fallbackAt:_}),i.jsx(Cn,{icon:"link",label:"第三方调用量",metric:(Ee=y==null?void 0:y.third_party)==null?void 0:Ee.calls,fallbackAt:_})]}),i.jsxs("section",{className:"console-two-column",children:[i.jsxs(Pe,{className:"console-panel trend-panel",children:[i.jsxs("div",{className:"panel-heading",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"只读采样"}),i.jsx("h2",{children:"近 24 小时在线设备趋势"})]}),i.jsx("span",{className:"panel-note",children:"暂无样本"})]}),i.jsxs("div",{className:"trend-empty",children:[i.jsx(se,{name:"chart",size:30}),i.jsx("strong",{children:"暂无样本"}),i.jsx("span",{children:u.overview.state==="ready"?"接口已接通,但当前响应未提供趋势样本。":"接入总控概览接口后显示趋势,不用静态柱状图冒充数据。"})]})]}),i.jsxs(Pe,{className:"console-panel",children:[i.jsx("div",{className:"panel-heading",children:i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"运行状态"}),i.jsx("h2",{children:"核心服务健康"})]})}),i.jsxs("div",{className:"service-status-grid",children:[i.jsx(ri,{label:"API 网关",value:(P=(ie=u.engine.data)==null?void 0:ie.integrationHealth)==null?void 0:P.ok}),i.jsx(ri,{label:"WSS Hub",value:q??o.agent.connected}),i.jsx(ri,{label:"Agent",value:Y??o.agent.running}),i.jsx(ri,{label:"Hook 探针",value:R??o.services.hookAvailable})]}),i.jsxs("div",{className:"panel-callout",children:[i.jsx(se,{name:"link",size:17}),i.jsx("span",{children:"设备下载、扫码绑定和单机控制都集中在“手机设备”页面。"})]})]})]}),i.jsxs(Pe,{className:"console-panel overview-table-panel",children:[i.jsxs("div",{className:"panel-heading",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"设备与微信运行摘要"}),i.jsx("h2",{children:"最近一次真实采样"})]}),i.jsx("span",{className:"panel-note",children:"不触发命令"})]}),O?i.jsx("div",{className:"overview-table-wrap",children:i.jsxs("table",{className:"overview-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"设备"}),i.jsx("th",{children:"WSS"}),i.jsx("th",{children:"Agent / Hook"}),i.jsx("th",{children:"微信运行"}),i.jsx("th",{children:"微信号"}),i.jsx("th",{children:"好友数"}),i.jsx("th",{children:"微信版本"}),i.jsx("th",{children:"采样时间"})]})}),i.jsx("tbody",{children:i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:b}),i.jsx("small",{children:te(J)})]}),i.jsx("td",{children:i.jsx(si,{value:q??o.agent.connected,online:"在线",offline:"离线"})}),i.jsx("td",{children:Y===void 0&&R===void 0&&o.agent.running===void 0&&o.services.hookAvailable===void 0?"未获取":`${Y===!0||Y===void 0&&o.agent.running===!0?"正常":Y===!1||o.agent.running===!1?"异常":"未获取"} / ${R===!0||R===void 0&&o.services.hookAvailable===!0?"已挂载":R===!1||o.services.hookAvailable===!1?"未挂载":"未获取"}`}),i.jsx("td",{children:Le===!0?"已登录":Le===!1?"未登录":"未获取"}),i.jsx("td",{children:te(o.wechat.idMasked)==="未获取"?"已脱敏":te(o.wechat.idMasked)}),i.jsx("td",{children:te(Ie)}),i.jsx("td",{children:te(ze)}),i.jsx("td",{children:Yf(fe)})]})})]})}):i.jsxs("div",{className:"table-empty",children:[i.jsx(se,{name:"device",size:24}),i.jsx("strong",{children:"暂无样本"}),i.jsx("span",{children:"还没有可展示的设备快照,数据接入后这里会出现真实设备。"})]})]})]})}function pp(){const[o,u]=ne.useState(),[d,y]=ne.useState(""),[_,x]=ne.useState(""),[z,I]=ne.useState(!1),[F,X]=ne.useState({id:"",name:"",description:"",runtime_binding:"",config:"{}"}),q=ne.useCallback(async()=>{try{u(await Mf()),x("")}catch(O){x(O instanceof Error?O.message:"安全模块读取失败")}},[]);ne.useEffect(()=>{q()},[q]);const Y=async(O,te)=>{y(O),x("");try{await te(),await q()}catch(J){x(J instanceof Error?J.message:"操作失败")}finally{y("")}},R=async O=>{O.preventDefault(),await Y("add",async()=>{await Of({...F,config:JSON.parse(F.config)}),X({id:"",name:"",description:"",runtime_binding:"",config:"{}"}),I(!1)})};return i.jsxs("main",{className:"console-page security-page",children:[i.jsxs("header",{className:"console-page-header",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"SDK治理 / 可插拔安全"}),i.jsx("h1",{children:"安全模块"}),i.jsx("p",{children:"一个总开关控制全局,每项能力可以独立启停,自定义模块可以随时接入或移除。"})]}),i.jsx("span",{className:`badge ${o!=null&&o.global_enabled?"badge-blue":""}`,children:o!=null&&o.global_enabled?"全局已开启":"全局已关闭"})]}),_&&i.jsx("div",{className:"security-error",children:_}),o?i.jsxs(i.Fragment,{children:[i.jsxs(Pe,{className:`security-master ${o.global_enabled?"is-on":"is-off"}`,children:[i.jsx("span",{className:"security-master-icon",children:i.jsx(se,{name:"shield",size:29})}),i.jsxs("div",{children:[i.jsx("h2",{children:"SDK 安全总开关"}),i.jsx("p",{children:"关闭后,所有可选安全能力停止生效;本控制页登录保护仍保留,便于重新开启。"}),i.jsxs("small",{children:[o.enabled_count," / ",o.module_count," 项正在生效"]})]}),i.jsxs("button",{className:`switch-button ${o.global_enabled?"is-on":""}`,disabled:d==="global",onClick:()=>void Y("global",()=>Rf(!o.global_enabled)),children:[i.jsx("span",{}),o.global_enabled?"关闭全部":"开启全部"]})]}),i.jsxs("div",{className:"security-toolbar",children:[i.jsxs("strong",{children:["模块清单(",o.module_count,")"]}),i.jsxs("button",{onClick:()=>I(!z),children:[i.jsx(se,{name:"grid",size:16}),"添加模块"]})]}),z&&i.jsx(Pe,{className:"security-add-card",children:i.jsxs("form",{onSubmit:R,children:[i.jsx("input",{required:!0,placeholder:"模块ID,如 custom_guard",value:F.id,onChange:O=>X({...F,id:O.target.value})}),i.jsx("input",{required:!0,placeholder:"模块名称",value:F.name,onChange:O=>X({...F,name:O.target.value})}),i.jsx("input",{placeholder:"运行绑定,如 plugins.custom_guard",value:F.runtime_binding,onChange:O=>X({...F,runtime_binding:O.target.value})}),i.jsx("input",{placeholder:"功能说明",value:F.description,onChange:O=>X({...F,description:O.target.value})}),i.jsx("textarea",{"aria-label":"模块JSON配置",value:F.config,onChange:O=>X({...F,config:O.target.value})}),i.jsx("button",{type:"submit",disabled:d==="add",children:d==="add"?"保存中…":"保存并接入"})]})}),i.jsx("div",{className:"security-grid",children:o.modules.map(O=>i.jsxs(Pe,{className:`security-card ${O.effective_enabled?"is-on":""}`,children:[i.jsxs("div",{className:"security-card-head",children:[i.jsx("span",{children:i.jsx(se,{name:O.effective_enabled?"shield":"lock",size:20})}),i.jsxs("div",{children:[i.jsx("h3",{children:O.name}),i.jsxs("small",{children:[O.id," · ",O.category]})]}),i.jsx("button",{"aria-label":`${O.name}${O.enabled?"关闭":"开启"}`,className:`mini-switch ${O.enabled?"is-on":""}`,disabled:!!d,onClick:()=>void Y(O.id,()=>If(O.id,{enabled:!O.enabled})),children:i.jsx("i",{})})]}),i.jsx("p",{children:O.description}),i.jsx("code",{children:O.runtime_binding||"等待第三方绑定"}),i.jsxs("footer",{children:[i.jsx("span",{children:O.effective_enabled?"运行中":O.enabled?"等待总开关":"已停用"}),O.removable&&i.jsx("button",{disabled:!!d,onClick:()=>void Y(`remove-${O.id}`,()=>Ff(O.id)),children:"移除"})]})]},O.id))})]}):i.jsxs("div",{className:"security-skeleton",children:[i.jsx("i",{}),i.jsx("i",{}),i.jsx("i",{})]})]})}const gc=[{id:"overview",label:"数据总览",description:"真实指标 · 只读",icon:"chart"},{id:"devices",label:"手机设备",description:"设备列表 · 单机入口",icon:"device"},{id:"engine",label:"智能引擎",description:"任务 · 能力 · 治理",icon:"agent"},{id:"security",label:"安全模块",description:"总开关 · 可插拔治理",icon:"shield"},{id:"integrations",label:"统一接入中心",description:"授权 · 用量 · 文档",icon:"link"}],hp=()=>{const o=new URLSearchParams(window.location.search).get("tab");return o==="devices"||o==="device"?"devices":o==="engine"||o==="agent"?"engine":o==="integrations"?"integrations":o==="security"?"security":"overview"};function mp(){var h,j,E;const[o,u]=ne.useState(hp),[d,y]=ne.useState("checking"),[_,x]=ne.useState(""),[z,I]=ne.useState(""),[F,X]=ne.useState(""),[q,Y]=ne.useState(!1),[R,O]=ne.useState(ii),[te,J]=ne.useState(Lf),[b,Le]=ne.useState(!1),[ze,Ie]=ne.useState(),[fe,ge]=ne.useState(),[he,pe]=ne.useState(!1),[we,Oe]=ne.useState(),[je,Fe]=ne.useState(),_e=ne.useRef();ne.useEffect(()=>{let C=!0;return fetch("/api/v3/console/session",{credentials:"same-origin"}).then(async A=>{if(A.status===401)return{authenticated:!1};if(!A.ok)throw new Error("登录状态检查失败");return A.json()}).then(A=>{C&&y(A.authenticated===!0?"authenticated":"signed_out")}).catch(()=>{C&&(y("signed_out"),X("登录服务暂时不可用,请确认本地服务已启动。"))}),()=>{C=!1}},[]);const w=ne.useCallback(async(C=!1)=>{pe(!0);const[A,ee]=await Promise.all([Qf(),Vf()]);Le(A.bridgeAvailable),O(A.snapshot),Ie(A.bridgeAvailable?A.error:void 0),J(ee);const re=[ee.overview,ee.devices,ee.engine].find(ue=>ue.state!=="ready");ge(re==null?void 0:re.error),pe(!1),!C&&(A.bridgeAvailable&&A.error||re!=null&&re.error)&&Fe({id:Date.now(),success:!1,message:(A.bridgeAvailable?A.error:void 0)||(re==null?void 0:re.error)||"读取总控数据失败"})},[]);ne.useEffect(()=>{if(d!=="authenticated")return;w(!0);const C=window.setInterval(()=>void w(!0),3e4),A=()=>{document.visibilityState==="visible"&&w(!0)};return document.addEventListener("visibilitychange",A),()=>{window.clearInterval(C),document.removeEventListener("visibilitychange",A)}},[d,w]),ne.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"}),document.documentElement.scrollTop=0,document.body.scrollTop=0},[o]),ne.useEffect(()=>{if(je)return window.clearTimeout(_e.current),_e.current=window.setTimeout(()=>Fe(void 0),3200),()=>window.clearTimeout(_e.current)},[je]);const Be=ne.useCallback(async C=>{if(we)return;Oe(C);let A;try{A=await Kf(C),Fe({id:Date.now(),success:A.success,message:A.message}),await w(!0)}finally{Oe(void 0)}},[we,w]),G=async C=>{if(C.preventDefault(),!q){Y(!0),X("");try{const A=await fetch("/api/v3/console/login",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:_,password:z})}),ee=await A.json().catch(()=>({}));if(!A.ok||ee.code!==200){X(ee.message||"账号或密码错误");return}I(""),y("authenticated")}catch{X("登录服务暂时不可用,请确认本地服务已启动。")}finally{Y(!1)}}},Ee=async()=>{await fetch("/api/v3/console/logout",{method:"POST",credentials:"same-origin"}).catch(()=>{}),y("signed_out"),O(ii)},ie=((h=te.devices.data)==null?void 0:h.find(C=>C.online===!0))||((j=te.devices.data)==null?void 0:j[0]),P=(E=te.engine.data)==null?void 0:E.connection,B=typeof(P==null?void 0:P.online_ws_count)=="number"?P.online_ws_count:void 0,L=B!==void 0?B>0:ie==null?void 0:ie.online;return d!=="authenticated"?i.jsx("div",{className:"console-auth-shell",children:i.jsxs("div",{className:"console-auth-card",children:[i.jsx("div",{className:"brand-mark",children:i.jsx(se,{name:"settings",size:25})}),i.jsx("span",{className:"eyebrow",children:"工作手机总控平台"}),i.jsx("h1",{children:d==="checking"?"正在检查登录状态":"登录总控平台"}),i.jsx("p",{children:d==="checking"?"正在读取现有登录保护,请稍候。":"登录后查看设备、智能引擎和统一接入中心。"}),d==="checking"?i.jsxs("div",{className:"auth-loading",children:[i.jsx("span",{}),"正在检查…"]}):i.jsxs("form",{onSubmit:G,children:[i.jsxs("label",{children:["账号",i.jsx("input",{value:_,onChange:C=>x(C.target.value),autoComplete:"username",required:!0})]}),i.jsxs("label",{children:["密码",i.jsx("input",{value:z,onChange:C=>I(C.target.value),type:"password",autoComplete:"current-password",required:!0})]}),F&&i.jsx("div",{className:"auth-error",role:"alert",children:F}),i.jsx("button",{className:"auth-submit",type:"submit",disabled:q,children:q?"登录中…":"登录并加载平台"})]})]})}):i.jsxs("div",{className:"console-shell",children:[i.jsxs("header",{className:"console-topbar",children:[i.jsx("div",{className:"brand-mark",children:i.jsx(se,{name:"settings",size:25})}),i.jsxs("div",{className:"brand-copy",children:[i.jsx("strong",{children:"工作手机总控平台"}),i.jsx("span",{children:"设备管理 · 智能任务 · 统一接入 · 知识中心"})]}),i.jsxs("div",{className:"topbar-status",children:[i.jsxs("span",{children:[i.jsx("i",{}),"服务状态"]}),i.jsxs("b",{children:["WS ",L===!0?"在线":L===!1?"离线":R.agent.connected===!0?"在线":R.agent.connected===!1?"离线":"未获取"]}),i.jsx("b",{children:ie!=null&&ie.agentVersion?`v${ie.agentVersion.replace(/^v/,"")}`:R.version?`v${R.version.replace(/^v/,"")}`:"版本未获取"}),i.jsx("button",{className:"logout-button",onClick:()=>void Ee(),children:"退出登录"})]})]}),i.jsxs("div",{className:"console-layout",children:[i.jsxs("aside",{className:"console-sidebar",children:[i.jsx("div",{className:"sidebar-label",children:"统一工作台"}),gc.map(C=>i.jsxs(ne.Fragment,{children:[C.id==="security"&&i.jsx("div",{className:"sidebar-label sidebar-label-governance",children:"治理与接入"}),i.jsxs("button",{className:o===C.id?"is-active":"","aria-current":o===C.id?"page":void 0,onClick:()=>u(C.id),children:[i.jsx("span",{className:"nav-icon",children:i.jsx(se,{name:C.icon,size:21})}),i.jsxs("span",{children:[i.jsx("strong",{children:C.label}),i.jsx("small",{children:C.description})]})]})]},C.id))]}),i.jsxs("div",{className:"console-main",children:[i.jsx("nav",{className:"console-mobile-tabs","aria-label":"主菜单",children:gc.map(C=>i.jsxs("button",{className:o===C.id?"is-active":"",onClick:()=>u(C.id),children:[i.jsx(se,{name:C.icon,size:17}),C.label]},C.id))}),o==="overview"&&i.jsx(fp,{snapshot:R,bridgeAvailable:b,api:te,loading:he}),o==="devices"&&i.jsx(sp,{api:te,loading:he,onRefresh:()=>w(!0)}),o==="engine"&&i.jsx(bf,{snapshot:R,bridgeAvailable:b,api:te,busyAction:we,onAction:Be}),o==="integrations"&&i.jsx(ap,{snapshot:R,bridgeAvailable:b,api:te,loading:he}),o==="security"&&i.jsx(pp,{})]})]}),(ze||fe)&&i.jsxs("button",{className:"snapshot-error",onClick:()=>void w(),children:[i.jsx(se,{name:"refresh",size:16}),ze||fe]}),je&&i.jsxs("div",{className:`toast ${je.success?"is-success":"is-error"}`,role:"status",children:[i.jsx(se,{name:je.success?"check":"link",size:19}),i.jsx("span",{children:je.message})]})]})}Af.createRoot(document.getElementById("root")).render(i.jsx(_f.StrictMode,{children:i.jsx(mp,{})})); +`+s.stack}return{value:e,source:t,stack:l,digest:null}}function Ns(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Cs(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Yd=typeof WeakMap=="function"?WeakMap:Map;function pu(e,t,n){n=Bt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Hl||(Hl=!0,Hs=r),Cs(e,t)},n}function hu(e,t,n){n=Bt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Cs(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Cs(e,t),typeof r!="function"&&(on===null?on=new Set([this]):on.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function mu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yd;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=uf.bind(null,e,t,n),t.then(e,e))}function vu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function gu(e,t,n,r,l){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bt(-1,1),t.tag=2,ln(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=l,e)}var Xd=fe.ReactCurrentOwner,it=!1;function tt(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Qn(t,e.child,n,r)}function yu(e,t,n,r,l){n=n.render;var s=t.ref;return Yn(t,l),r=ys(e,t,n,r,s,l),n=xs(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Wt(e,t,l)):(Se&&n&&ts(t),t.flags|=1,tt(e,t,r,l),t.child)}function xu(e,t,n,r,l){if(e===null){var s=n.type;return typeof s=="function"&&!Xs(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,wu(e,t,s,r,l)):(e=Yl(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,(e.lanes&l)===0){var a=s.memoizedProps;if(n=n.compare,n=n!==null?n:wr,n(a,r)&&e.ref===t.ref)return Wt(e,t,l)}return t.flags|=1,e=dn(s,r),e.ref=t.ref,e.return=t,t.child=e}function wu(e,t,n,r,l){if(e!==null){var s=e.memoizedProps;if(wr(s,r)&&e.ref===t.ref)if(it=!1,t.pendingProps=r=s,(e.lanes&l)!==0)(e.flags&131072)!==0&&(it=!0);else return t.lanes=e.lanes,Wt(e,t,l)}return Ts(e,t,n,r,l)}function ju(e,t,n){var r=t.pendingProps,l=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(Jn,ht),ht|=n;else{if((n&1073741824)===0)return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(Jn,ht),ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ve(Jn,ht),ht|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ve(Jn,ht),ht|=r;return tt(e,t,l,n),t.child}function ku(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ts(e,t,n,r,l){var s=lt(n)?vn:Ze.current;return s=Hn(t,s),Yn(t,l),n=ys(e,t,n,r,s,l),r=xs(),e!==null&&!it?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Wt(e,t,l)):(Se&&r&&ts(t),t.flags|=1,tt(e,t,n,l),t.child)}function Su(e,t,n,r,l){if(lt(n)){var s=!0;xl(t)}else s=!1;if(Yn(t,l),t.stateNode===null)Fl(e,t),du(t,n,r),Es(t,n,r,l),r=!0;else if(e===null){var a=t.stateNode,c=t.memoizedProps;a.props=c;var f=a.context,g=n.contextType;typeof g=="object"&&g!==null?g=gt(g):(g=lt(n)?vn:Ze.current,g=Hn(t,g));var S=n.getDerivedStateFromProps,N=typeof S=="function"||typeof a.getSnapshotBeforeUpdate=="function";N||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(c!==r||f!==g)&&fu(t,a,r,g),rn=!1;var k=t.memoizedState;a.state=k,Tl(t,r,a,l),f=t.memoizedState,c!==r||k!==f||rt.current||rn?(typeof S=="function"&&(_s(t,n,S,r),f=t.memoizedState),(c=rn||cu(t,n,c,r,k,f,g))?(N||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=f),a.props=r,a.state=f,a.context=g,r=c):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,$a(e,t),c=t.memoizedProps,g=t.type===t.elementType?c:Nt(t.type,c),a.props=g,N=t.pendingProps,k=a.context,f=n.contextType,typeof f=="object"&&f!==null?f=gt(f):(f=lt(n)?vn:Ze.current,f=Hn(t,f));var R=n.getDerivedStateFromProps;(S=typeof R=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(c!==N||k!==f)&&fu(t,a,r,f),rn=!1,k=t.memoizedState,a.state=k,Tl(t,r,a,l);var U=t.memoizedState;c!==N||k!==U||rt.current||rn?(typeof R=="function"&&(_s(t,n,R,r),U=t.memoizedState),(g=rn||cu(t,n,g,r,k,U,f)||!1)?(S||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,U,f),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,U,f)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||c===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=U),a.props=r,a.state=U,a.context=f,r=g):(typeof a.componentDidUpdate!="function"||c===e.memoizedProps&&k===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||c===e.memoizedProps&&k===e.memoizedState||(t.flags|=1024),r=!1)}return Ps(e,t,n,r,s,l)}function Ps(e,t,n,r,l,s){ku(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return l&&Ta(t,n,!1),Wt(e,t,s);r=t.stateNode,Xd.current=t;var c=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Qn(t,e.child,null,s),t.child=Qn(t,null,c,s)):tt(e,t,c,s),t.memoizedState=r.state,l&&Ta(t,n,!0),t.child}function _u(e){var t=e.stateNode;t.pendingContext?Na(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Na(e,t.context,!1),fs(e,t.containerInfo)}function Eu(e,t,n,r,l){return Gn(),is(l),t.flags|=256,tt(e,t,n,r),t.child}var zs={dehydrated:null,treeContext:null,retryLane:0};function As(e){return{baseLanes:e,cachePool:null,transitions:null}}function Nu(e,t,n){var r=t.pendingProps,l=Ne.current,s=!1,a=(t.flags&128)!==0,c;if((c=a)||(c=e!==null&&e.memoizedState===null?!1:(l&2)!==0),c?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),ve(Ne,l&1),e===null)return ls(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(a=r.children,e=r.fallback,s?(r=t.mode,s=t.child,a={mode:"hidden",children:a},(r&1)===0&&s!==null?(s.childLanes=0,s.pendingProps=a):s=Xl(a,r,0,null),e=Nn(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=As(n),t.memoizedState=zs,e):Ls(t,a));if(l=e.memoizedState,l!==null&&(c=l.dehydrated,c!==null))return qd(e,t,a,r,c,l,n);if(s){s=r.fallback,a=t.mode,l=e.child,c=l.sibling;var f={mode:"hidden",children:r.children};return(a&1)===0&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=f,t.deletions=null):(r=dn(l,f),r.subtreeFlags=l.subtreeFlags&14680064),c!==null?s=dn(c,s):(s=Nn(s,a,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,a=e.child.memoizedState,a=a===null?As(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},s.memoizedState=a,s.childLanes=e.childLanes&~n,t.memoizedState=zs,r}return s=e.child,e=s.sibling,r=dn(s,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ls(e,t){return t=Xl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ol(e,t,n,r){return r!==null&&is(r),Qn(t,e.child,null,n),e=Ls(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function qd(e,t,n,r,l,s,a){if(n)return t.flags&256?(t.flags&=-257,r=Ns(Error(d(422))),Ol(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,l=t.mode,r=Xl({mode:"visible",children:r.children},l,0,null),s=Nn(s,l,a,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,(t.mode&1)!==0&&Qn(t,e.child,null,a),t.child.memoizedState=As(a),t.memoizedState=zs,s);if((t.mode&1)===0)return Ol(e,t,a,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var c=r.dgst;return r=c,s=Error(d(419)),r=Ns(s,r,void 0),Ol(e,t,a,r)}if(c=(a&e.childLanes)!==0,it||c){if(r=Ge,r!==null){switch(a&-a){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=(l&(r.suspendedLanes|a))!==0?0:l,l!==0&&l!==s.retryLane&&(s.retryLane=l,Ht(e,l),Pt(r,e,l,-1))}return Ys(),r=Ns(Error(d(421))),Ol(e,t,a,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=cf.bind(null,e),l._reactRetry=t,null):(e=s.treeContext,pt=bt(l.nextSibling),ft=t,Se=!0,Et=null,e!==null&&(mt[vt++]=Ut,mt[vt++]=Vt,mt[vt++]=gn,Ut=e.id,Vt=e.overflow,gn=t),t=Ls(t,r.children),t.flags|=4096,t)}function Cu(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),us(e.return,t,n)}function Ms(e,t,n,r,l){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=l)}function Tu(e,t,n){var r=t.pendingProps,l=r.revealOrder,s=r.tail;if(tt(e,t,r.children,n),r=Ne.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cu(e,n,t);else if(e.tag===19)Cu(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ve(Ne,r),(t.mode&1)===0)t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Pl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Ms(t,!1,l,n,s);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Pl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Ms(t,!0,n,null,s);break;case"together":Ms(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Fl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),kn|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(d(153));if(t.child!==null){for(e=t.child,n=dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Zd(e,t,n){switch(t.tag){case 3:_u(t),Gn();break;case 5:Ha(t);break;case 1:lt(t.type)&&xl(t);break;case 4:fs(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;ve(El,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ve(Ne,Ne.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?Nu(e,t,n):(ve(Ne,Ne.current&1),e=Wt(e,t,n),e!==null?e.sibling:null);ve(Ne,Ne.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Tu(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),ve(Ne,Ne.current),r)break;return null;case 22:case 23:return t.lanes=0,ju(e,t,n)}return Wt(e,t,n)}var Pu,Rs,zu,Au;Pu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Rs=function(){},zu=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,wn(Lt.current);var s=null;switch(n){case"input":l=ui(e,l),r=ui(e,r),s=[];break;case"select":l=M({},l,{value:void 0}),r=M({},r,{value:void 0}),s=[];break;case"textarea":l=fi(e,l),r=fi(e,r),s=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=vl)}hi(n,r);var a;n=null;for(g in l)if(!r.hasOwnProperty(g)&&l.hasOwnProperty(g)&&l[g]!=null)if(g==="style"){var c=l[g];for(a in c)c.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else g!=="dangerouslySetInnerHTML"&&g!=="children"&&g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(_.hasOwnProperty(g)?s||(s=[]):(s=s||[]).push(g,null));for(g in r){var f=r[g];if(c=l!=null?l[g]:void 0,r.hasOwnProperty(g)&&f!==c&&(f!=null||c!=null))if(g==="style")if(c){for(a in c)!c.hasOwnProperty(a)||f&&f.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in f)f.hasOwnProperty(a)&&c[a]!==f[a]&&(n||(n={}),n[a]=f[a])}else n||(s||(s=[]),s.push(g,n)),n=f;else g==="dangerouslySetInnerHTML"?(f=f?f.__html:void 0,c=c?c.__html:void 0,f!=null&&c!==f&&(s=s||[]).push(g,f)):g==="children"?typeof f!="string"&&typeof f!="number"||(s=s||[]).push(g,""+f):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&(_.hasOwnProperty(g)?(f!=null&&g==="onScroll"&&ye("scroll",e),s||c===f||(s=[])):(s=s||[]).push(g,f))}n&&(s=s||[]).push("style",n);var g=s;(t.updateQueue=g)&&(t.flags|=4)}},Au=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ir(e,t){if(!Se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function be(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Jd(e,t,n){var r=t.pendingProps;switch(ns(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(t),null;case 1:return lt(t.type)&&yl(),be(t),null;case 3:return r=t.stateNode,Xn(),xe(rt),xe(Ze),ms(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Sl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Et!==null&&(Gs(Et),Et=null))),Rs(e,t),be(t),null;case 5:ps(t);var l=wn(zr.current);if(n=t.type,e!==null&&t.stateNode!=null)zu(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(d(166));return be(t),null}if(e=wn(Lt.current),Sl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[At]=t,r[Er]=s,e=(t.mode&1)!==0,n){case"dialog":ye("cancel",r),ye("close",r);break;case"iframe":case"object":case"embed":ye("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[At]=t,e[Er]=r,Pu(e,t,!1,!1),t.stateNode=e;e:{switch(a=mi(n,r),n){case"dialog":ye("cancel",e),ye("close",e),l=r;break;case"iframe":case"object":case"embed":ye("load",e),l=r;break;case"video":case"audio":for(l=0;lbn&&(t.flags|=128,r=!0,Ir(s,!1),t.lanes=4194304)}else{if(!r)if(e=Pl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ir(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Se)return be(t),null}else 2*Me()-s.renderingStartTime>bn&&n!==1073741824&&(t.flags|=128,r=!0,Ir(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(n=s.last,n!==null?n.sibling=a:t.child=a,s.last=a)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Me(),t.sibling=null,n=Ne.current,ve(Ne,r?n&1|2:n&1),t):(be(t),null);case 22:case 23:return Ks(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(ht&1073741824)!==0&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(d(156,t.tag))}function bd(e,t){switch(ns(t),t.tag){case 1:return lt(t.type)&&yl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xn(),xe(rt),xe(Ze),ms(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return ps(t),null;case 13:if(xe(Ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(d(340));Gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(Ne),null;case 4:return Xn(),null;case 10:return as(t.type._context),null;case 22:case 23:return Ks(),null;case 24:return null;default:return null}}var Dl=!1,et=!1,ef=typeof WeakSet=="function"?WeakSet:Set,D=null;function Zn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ae(e,t,r)}else n.current=null}function Is(e,t,n){try{n()}catch(r){Ae(e,t,r)}}var Lu=!1;function tf(e,t){if(Ki=ll,e=ca(),$i(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var a=0,c=-1,f=-1,g=0,S=0,N=e,k=null;t:for(;;){for(var R;N!==n||l!==0&&N.nodeType!==3||(c=a+l),N!==s||r!==0&&N.nodeType!==3||(f=a+r),N.nodeType===3&&(a+=N.nodeValue.length),(R=N.firstChild)!==null;)k=N,N=R;for(;;){if(N===e)break t;if(k===n&&++g===l&&(c=a),k===s&&++S===r&&(f=a),(R=N.nextSibling)!==null)break;N=k,k=N.parentNode}N=R}n=c===-1||f===-1?null:{start:c,end:f}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yi={focusedElem:e,selectionRange:n},ll=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;try{var U=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(U!==null){var V=U.memoizedProps,Re=U.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?V:Nt(t.type,V),Re);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(d(163))}}catch(T){Ae(t,t.return,T)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return U=Lu,Lu=!1,U}function Or(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var s=l.destroy;l.destroy=void 0,s!==void 0&&Is(t,n,s)}l=l.next}while(l!==r)}}function $l(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Os(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Mu(e){var t=e.alternate;t!==null&&(e.alternate=null,Mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[At],delete t[Er],delete t[Ji],delete t[Fd],delete t[Dd])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ru(e){return e.tag===5||e.tag===3||e.tag===4}function Iu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ru(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Fs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vl));else if(r!==4&&(e=e.child,e!==null))for(Fs(e,t,n),e=e.sibling;e!==null;)Fs(e,t,n),e=e.sibling}function Ds(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ds(e,t,n),e=e.sibling;e!==null;)Ds(e,t,n),e=e.sibling}var Ye=null,Ct=!1;function sn(e,t,n){for(n=n.child;n!==null;)Ou(e,t,n),n=n.sibling}function Ou(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Jr,n)}catch{}switch(n.tag){case 5:et||Zn(n,t);case 6:var r=Ye,l=Ct;Ye=null,sn(e,t,n),Ye=r,Ct=l,Ye!==null&&(Ct?(e=Ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ye.removeChild(n.stateNode));break;case 18:Ye!==null&&(Ct?(e=Ye,n=n.stateNode,e.nodeType===8?Zi(e.parentNode,n):e.nodeType===1&&Zi(e,n),hr(e)):Zi(Ye,n.stateNode));break;case 4:r=Ye,l=Ct,Ye=n.stateNode.containerInfo,Ct=!0,sn(e,t,n),Ye=r,Ct=l;break;case 0:case 11:case 14:case 15:if(!et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var s=l,a=s.destroy;s=s.tag,a!==void 0&&((s&2)!==0||(s&4)!==0)&&Is(n,t,a),l=l.next}while(l!==r)}sn(e,t,n);break;case 1:if(!et&&(Zn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(c){Ae(n,t,c)}sn(e,t,n);break;case 21:sn(e,t,n);break;case 22:n.mode&1?(et=(r=et)||n.memoizedState!==null,sn(e,t,n),et=r):sn(e,t,n);break;default:sn(e,t,n)}}function Fu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ef),t.forEach(function(r){var l=df.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Tt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=a),r&=~s}if(r=l,r=Me()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rf(r/1960))-r,10e?16:e,an===null)var r=!1;else{if(e=an,an=null,Wl=0,(ae&6)!==0)throw Error(d(331));var l=ae;for(ae|=4,D=e.current;D!==null;){var s=D,a=s.child;if((D.flags&16)!==0){var c=s.deletions;if(c!==null){for(var f=0;fMe()-Vs?_n(e,0):Us|=n),ot(e,t)}function qu(e,t){t===0&&((e.mode&1)===0?t=1:(t=el,el<<=1,(el&130023424)===0&&(el=4194304)));var n=nt();e=Ht(e,t),e!==null&&(ur(e,t,n),ot(e,n))}function cf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function df(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(d(314))}r!==null&&r.delete(t),qu(e,n)}var Zu;Zu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||rt.current)it=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return it=!1,Zd(e,t,n);it=(e.flags&131072)!==0}else it=!1,Se&&(t.flags&1048576)!==0&&za(t,kl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fl(e,t),e=t.pendingProps;var l=Hn(t,Ze.current);Yn(t,n),l=ys(null,t,r,e,l,n);var s=xs();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(s=!0,xl(t)):s=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ds(t),l.updater=Il,t.stateNode=l,l._reactInternals=t,Es(t,r,e,n),t=Ps(null,t,r,!0,s,n)):(t.tag=0,Se&&s&&ts(t),tt(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=pf(r),e=Nt(r,e),l){case 0:t=Ts(null,t,r,e,n);break e;case 1:t=Su(null,t,r,e,n);break e;case 11:t=yu(null,t,r,e,n);break e;case 14:t=xu(null,t,r,Nt(r.type,e),n);break e}throw Error(d(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Nt(r,l),Ts(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Nt(r,l),Su(e,t,r,l,n);case 3:e:{if(_u(t),e===null)throw Error(d(387));r=t.pendingProps,s=t.memoizedState,l=s.element,$a(e,t),Tl(t,r,null,n);var a=t.memoizedState;if(r=a.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){l=qn(Error(d(423)),t),t=Eu(e,t,r,n,l);break e}else if(r!==l){l=qn(Error(d(424)),t),t=Eu(e,t,r,n,l);break e}else for(pt=bt(t.stateNode.containerInfo.firstChild),ft=t,Se=!0,Et=null,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Gn(),r===l){t=Wt(e,t,n);break e}tt(e,t,r,n)}t=t.child}return t;case 5:return Ha(t),e===null&&ls(t),r=t.type,l=t.pendingProps,s=e!==null?e.memoizedProps:null,a=l.children,Xi(r,l)?a=null:s!==null&&Xi(r,s)&&(t.flags|=32),ku(e,t),tt(e,t,a,n),t.child;case 6:return e===null&&ls(t),null;case 13:return Nu(e,t,n);case 4:return fs(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qn(t,null,r,n):tt(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Nt(r,l),yu(e,t,r,l,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,s=t.memoizedProps,a=l.value,ve(El,r._currentValue),r._currentValue=a,s!==null)if(_t(s.value,a)){if(s.children===l.children&&!rt.current){t=Wt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var c=s.dependencies;if(c!==null){a=s.child;for(var f=c.firstContext;f!==null;){if(f.context===r){if(s.tag===1){f=Bt(-1,n&-n),f.tag=2;var g=s.updateQueue;if(g!==null){g=g.shared;var S=g.pending;S===null?f.next=f:(f.next=S.next,S.next=f),g.pending=f}}s.lanes|=n,f=s.alternate,f!==null&&(f.lanes|=n),us(s.return,n,t),c.lanes|=n;break}f=f.next}}else if(s.tag===10)a=s.type===t.type?null:s.child;else if(s.tag===18){if(a=s.return,a===null)throw Error(d(341));a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),us(a,n,t),a=s.sibling}else a=s.child;if(a!==null)a.return=s;else for(a=s;a!==null;){if(a===t){a=null;break}if(s=a.sibling,s!==null){s.return=a.return,a=s;break}a=a.return}s=a}tt(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Yn(t,n),l=gt(l),r=r(l),t.flags|=1,tt(e,t,r,n),t.child;case 14:return r=t.type,l=Nt(r,t.pendingProps),l=Nt(r.type,l),xu(e,t,r,l,n);case 15:return wu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Nt(r,l),Fl(e,t),t.tag=1,lt(r)?(e=!0,xl(t)):e=!1,Yn(t,n),du(t,r,l),Es(t,r,l,n),Ps(null,t,r,!0,e,n);case 19:return Tu(e,t,n);case 22:return ju(e,t,n)}throw Error(d(156,t.tag))};function Ju(e,t){return Ao(e,t)}function ff(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wt(e,t,n,r){return new ff(e,t,n,r)}function Xs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function pf(e){if(typeof e=="function")return Xs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_e)return 11;if(e===G)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Yl(e,t,n,r,l,s){var a=2;if(r=e,typeof e=="function")Xs(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case pe:return Nn(n.children,l,s,t);case we:a=8,l|=8;break;case Oe:return e=wt(12,n,t,l|2),e.elementType=Oe,e.lanes=s,e;case w:return e=wt(13,n,t,l),e.elementType=w,e.lanes=s,e;case Be:return e=wt(19,n,t,l),e.elementType=Be,e.lanes=s,e;case ie:return Xl(n,l,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case je:a=10;break e;case Fe:a=9;break e;case _e:a=11;break e;case G:a=14;break e;case Ee:a=16,r=null;break e}throw Error(d(130,e==null?e:typeof e,""))}return t=wt(a,n,t,l),t.elementType=e,t.type=r,t.lanes=s,t}function Nn(e,t,n,r){return e=wt(7,e,r,t),e.lanes=n,e}function Xl(e,t,n,r){return e=wt(22,e,r,t),e.elementType=ie,e.lanes=n,e.stateNode={isHidden:!1},e}function qs(e,t,n){return e=wt(6,e,null,t),e.lanes=n,e}function Zs(e,t,n){return t=wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function hf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_i(0),this.expirationTimes=_i(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_i(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Js(e,t,n,r,l,s,a,c,f){return e=new hf(e,t,n,c,f),t===1?(t=1,s===!0&&(t|=8)):t=0,s=wt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ds(s),e}function mf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(u){console.error(u)}}return o(),lo.exports=Cf(),lo.exports}var fc;function Pf(){if(fc)return ni;fc=1;var o=Tf();return ni.createRoot=o.createRoot,ni.hydrateRoot=o.hydrateRoot,ni}var zf=Pf();const Af=yc(zf);function se({name:o,size:u=24,...d}){const y={agent:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"5",y:"8",width:"14",height:"11",rx:"4"}),i.jsx("path",{d:"M12 8V4m0 0-2-2m2 2 2-2M8.5 13h.01m6.99 0h.01M9 17h6M5 12H3v4h2m14-4h2v4h-2"})]}),battery:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"5",y:"3",width:"12",height:"18",rx:"2.5"}),i.jsx("path",{d:"M9 1h4M17 9h2v6h-2M8 17l4-8v5h4l-5 7"})]}),bell:i.jsx("path",{d:"M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4"}),check:i.jsx("path",{d:"m5 12 4 4L19 6"}),chart:i.jsx("path",{d:"M4 19V9m5 10V5m5 14v-7m5 7V3"}),chevron:i.jsx("path",{d:"m9 5 7 7-7 7"}),cloud:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M7 18h10a4 4 0 0 0 .7-7.94A6 6 0 0 0 6.2 8.3 4.8 4.8 0 0 0 7 18Z"}),i.jsx("path",{d:"M9 14h6"})]}),code:i.jsx("path",{d:"m8 9-3 3 3 3m8-6 3 3-3 3m-3-9-2 12"}),copy:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"8",y:"8",width:"11",height:"11",rx:"2"}),i.jsx("path",{d:"M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3"})]}),download:i.jsx("path",{d:"M12 3v11m0 0 4-4m-4 4-4-4M5 20h14"}),device:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"6",y:"2",width:"12",height:"20",rx:"2.5"}),i.jsx("path",{d:"M10 5h4m-4 14h4"})]}),fingerprint:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M12 11a2 2 0 0 1 2 2c0 3-.5 5.5-1.5 8"}),i.jsx("path",{d:"M8.5 21c1-2 1.5-5 1.5-8a2 2 0 0 1 4 0c0 4-.8 7-1.4 8.5"}),i.jsx("path",{d:"M6 19c.8-2.1 1-4 1-6a5 5 0 0 1 10 0c0 3-.3 5.2-1 7.5"}),i.jsx("path",{d:"M4 16v-3a8 8 0 0 1 16 0c0 2-.1 3.5-.5 5"})]}),grid:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),i.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]}),book:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M4 5.5A2.5 2.5 0 0 1 6.5 3H20v16H6.5A2.5 2.5 0 0 0 4 21V5.5Z"}),i.jsx("path",{d:"M4 5.5V21m4-14h8m-8 4h6"})]}),heartbeat:i.jsx("path",{d:"M3 12h4l2-7 4 14 2-7h6"}),home:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"m3 11 9-8 9 8"}),i.jsx("path",{d:"M5 10v10h14V10M9 20v-6h6v6"})]}),link:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M10 13a5 5 0 0 0 7.1 0l2-2a5 5 0 0 0-7.1-7.1l-1.1 1.1"}),i.jsx("path",{d:"M14 11a5 5 0 0 0-7.1 0l-2 2A5 5 0 0 0 12 20.1l1.1-1.1"})]}),lock:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"5",y:"10",width:"14",height:"11",rx:"2.5"}),i.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3m-4 4v3"})]}),power:i.jsx("path",{d:"M12 2v10m5.7-7.7a9 9 0 1 1-11.4 0"}),qr:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),i.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),i.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),i.jsx("path",{d:"M14 14h3v3h-3zm4 4h3v3h-3zm0-4h3m-7 7h2"})]}),refresh:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M20 7V3h-4"}),i.jsx("path",{d:"M20 3a9 9 0 1 0 2 9"})]}),route:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"6",cy:"18",r:"2"}),i.jsx("circle",{cx:"18",cy:"6",r:"2"}),i.jsx("path",{d:"M8 18h3a3 3 0 0 0 3-3V9a3 3 0 0 1 3-3h-1M8 6h3m-5-2v4"})]}),scan:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m13-5h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3m13 5h3a2 2 0 0 0 2-2v-3"}),i.jsx("path",{d:"M7 12h10"})]}),search:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"10.8",cy:"10.8",r:"6.8"}),i.jsx("path",{d:"m16 16 5 5"})]}),server:i.jsxs(i.Fragment,{children:[i.jsx("rect",{x:"3",y:"3",width:"18",height:"7",rx:"2"}),i.jsx("rect",{x:"3",y:"14",width:"18",height:"7",rx:"2"}),i.jsx("path",{d:"M7 6.5h.01M7 17.5h.01M11 6.5h6M11 17.5h6"})]}),settings:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"12",cy:"12",r:"3"}),i.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.86 2.86-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1v.1H9.5V21a1.7 1.7 0 0 0-1.1-1.6 1.7 1.7 0 0 0-1.88.34l-.06.06-2.86-2.86.06-.06A1.7 1.7 0 0 0 4 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1-.4h-.1V9.5h.1A1.7 1.7 0 0 0 4 8.4a1.7 1.7 0 0 0-.34-1.88l-.06-.06L6.46 3.6l.06.06A1.7 1.7 0 0 0 8.4 4a1.7 1.7 0 0 0 1-.6 1.7 1.7 0 0 0 .4-1v-.1h4.1v.1A1.7 1.7 0 0 0 15 4a1.7 1.7 0 0 0 1.88-.34l.06-.06 2.86 2.86-.06.06A1.7 1.7 0 0 0 19.4 8c.14.38.36.72.66 1 .3.27.68.42 1.08.43h.1v4.1h-.1A1.7 1.7 0 0 0 19.4 15Z"})]}),shield:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M12 3 5 6v5c0 4.7 2.9 8.2 7 10 4.1-1.8 7-5.3 7-10V6l-7-3Z"}),i.jsx("path",{d:"m9 12 2 2 4-5"})]}),storage:i.jsxs(i.Fragment,{children:[i.jsx("ellipse",{cx:"12",cy:"5",rx:"7",ry:"3"}),i.jsx("path",{d:"M5 5v7c0 1.7 3.1 3 7 3s7-1.3 7-3V5M5 12v7c0 1.7 3.1 3 7 3s7-1.3 7-3v-7"})]}),temperature:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M9 14.8V5a3 3 0 0 1 6 0v9.8a5 5 0 1 1-6 0Z"}),i.jsx("path",{d:"M12 7v9"})]}),token:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"8",cy:"15",r:"4"}),i.jsx("path",{d:"m11 12 8-8m-3 3 2 2m-5 1 2 2"})]}),users:i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"9",cy:"8",r:"3"}),i.jsx("path",{d:"M3.5 20a5.5 5.5 0 0 1 11 0M16 5.5a3 3 0 0 1 0 5.8M17 14a5.2 5.2 0 0 1 3.5 5"})]}),wechat:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M14 7a6 5 0 1 0-3.2 4.4L14 13l-.8-2A4.8 4.8 0 0 0 14 7Z"}),i.jsx("path",{d:"M12 13.5a5 4.2 0 1 0 3-3.9M16 17l-.7 1.8 2.8-1.3"}),i.jsx("path",{d:"M6.5 6.8h.01m3 0h.01m5 6.7h.01m2.6 0h.01"})]}),wifi:i.jsxs(i.Fragment,{children:[i.jsx("path",{d:"M4 10a12 12 0 0 1 16 0M7 13a7.5 7.5 0 0 1 10 0m-7 3a3 3 0 0 1 4 0"}),i.jsx("circle",{cx:"12",cy:"19",r:"1",fill:"currentColor",stroke:"none"})]})};return i.jsx("svg",{"aria-hidden":"true",fill:"none",height:u,viewBox:"0 0 24 24",width:u,stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.8",...d,children:y[o]})}const qe=o=>({state:"unavailable",source:o}),Lf={overview:qe("GET /api/v3/workbench/overview"),devices:qe("GET /api/v3/fleet/devices"),hookStatus:qe("GET /api/v3/wechat/hook/status"),groups:qe("GET /api/v3/device-groups"),release:qe("GET /api/v3/releases/latest"),engine:qe("GET /api/v3/ai/status + /api/v3/ai/brain/dashboard"),aiOperations:qe("GET /api/v3/ai/tasks"),integrations:{applications:qe("GET /api/v3/integrations/apps"),authorizations:qe("GET /api/v3/integrations/authorizations"),usage:qe("GET /api/v3/integrations/usage"),manifest:qe("GET /api/v3/integration/manifest"),documents:qe("GET /api/v3/integrations/docs/catalog"),knowledge:qe("GET /api/v3/kb/search")}},oe=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),$=o=>{if(typeof o=="string"&&o.trim())return o;if(typeof o=="number")return String(o)},jt=o=>{if(typeof o=="boolean")return o;if(["true","1","online","connected","running","ready"].includes(String(o).toLowerCase()))return!0;if(["false","0","offline","disconnected","stopped"].includes(String(o).toLowerCase()))return!1},ut=o=>{if(o==null||o==="")return;const u=typeof o=="number"?o:Number(o);return Number.isFinite(u)?u:void 0},li=o=>oe(o)?o.data??o:o,xc=(o,u)=>{if(oe(o)){const d=o.detail;return oe(d)?$(d.message)||$(o.message)||u:$(o.message)||$(d)||u}return u},Te=o=>{if(oe(o))return $(o.sampled_at)||$(o.sampledAt)||$(o.server_time)||$(o.serverTime)||$(o.updated_at)||$(o.updatedAt)};async function wc(o){try{const u=await fetch(o,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}),d=await u.json().catch(()=>({}));return u.ok?{ok:!0,payload:d,status:u.status}:{ok:!1,status:u.status,message:xc(d,`读取接口失败(${u.status})`)}}catch(u){return{ok:!1,status:0,message:u instanceof Error?u.message:"读取接口失败"}}}async function ai(o,u,d){const y=await fetch(o,{method:u,credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json","X-Actor-Id":"console"},body:d===void 0?void 0:JSON.stringify(d)}),_=await y.json().catch(()=>({}));if(!y.ok)throw new Error(xc(_,`操作失败(${y.status})`));return li(_)}async function Mf(){const o=await wc("/api/v3/security/modules");if(!o.ok)throw new Error(o.message);const u=li(o.payload);if(!oe(u)||!Array.isArray(u.modules))throw new Error("安全模块接口返回格式错误");return u}async function Rf(o){return await ai("/api/v3/security/modules/global","PUT",{enabled:o})}async function If(o,u){return await ai(`/api/v3/security/modules/${encodeURIComponent(o)}`,"PUT",u)}async function Of(o){return await ai("/api/v3/security/modules","POST",o)}async function Ff(o){await ai(`/api/v3/security/modules/${encodeURIComponent(o)}`,"DELETE")}const pc=(o,u,d,y)=>u.ok?{state:"ready",data:d,source:o,sourceAt:y,status:u.status}:{state:u.status===401||u.status===403?"forbidden":"unavailable",source:o,status:u.status,error:u.message};async function $e(o,u,d){let y;for(const _ of o){const x=await wc(_);if(x.ok){const z=d(li(x.payload));return pc(`GET ${_}`,x,z.data,z.sourceAt||Te(li(x.payload)))}if(y=x,x.status!==404)break}return pc(u,y||{ok:!1,status:0,message:"读取接口失败"})}const Qt=(o,u)=>{if(Array.isArray(o))return o;if(!oe(o))return[];for(const d of u)if(Array.isArray(o[d]))return o[d];return[]},oo=o=>{if(!Array.isArray(o))return;const u=o.filter(d=>typeof d=="string"&&d.trim().length>0);return u.length?u:void 0},Df=o=>{if(!oe(o))return;const u=$(o.device_id)||$(o.deviceId)||$(o.id);if(!u)return;const d=oe(o.wechat)?o.wechat:{},y=oe(o.agent)?o.agent:{},_=oe(o.hook)?o.hook:{},x=oe(o.device_profile)?o.device_profile:{},z=oe(o.quick_status)?o.quick_status:{},I=oe(o.last_status)?o.last_status:{},A=Object.keys(z).length?z:I;return{deviceId:u,name:$(o.name)||$(o.device_name)||$(x.name),model:$(o.model)||$(o.model_name)||$(x.model),androidVersion:$(o.android_version)||$(o.androidVersion)||$(o.os_version)||$(x.android_version)||$(x.os_version),projectId:$(o.project_id)||$(o.projectId),groupId:$(o.group_id)||$(o.groupId)||$(o.project_id),status:$(o.status),online:jt(o.online)??jt(o.ws_online)??($(o.status)==="online"?!0:void 0),agentVersion:$(o.agent_version)||$(o.agentVersion)||$(o.app_version)||$(x.app_version),agentRunning:jt(o.agent_running)??jt(y.running)??jt(A.agent_running),hookAvailable:jt(o.hook_available)??jt(o.supports_hook)??jt(_.available),wechatRunning:jt(o.wechat_running)??jt(d.running)??jt(A.wechat_running)??jt(oe(A.wechat)?A.wechat.running:void 0),wechatId:$(o.wxid)||$(o.wechat_id)||$(d.id)||$(d.wechat_id)||$(A.wxid)||$(A.wechat_id),friendCount:ut(o.friend_count)??ut(d.friend_count)??ut(A.friend_count),wechatVersion:$(o.wechat_version)||$(d.version)||$(A.wechat_version)||$(x.wechat_version),batteryPercent:ut(o.battery_percent)??ut(o.batteryPercent)??ut(oe(o.battery)?o.battery.percent:void 0)??ut(A.battery_level)??ut(A.battery),networkType:$(o.network_type)||$(o.networkType)||$(oe(o.network)?o.network.type:void 0)||$(A.network_type),healthScore:ut(o.health_score)??ut(o.healthScore)??ut(oe(o.health)?o.health.score:void 0)??ut(A.health_score),tags:oo(o.tags)||oo(o.labels)||oo(o.tag_names),lastHeartbeat:$(o.last_heartbeat)||$(o.lastHeartbeat),sourceAt:Te(o)||$(o.last_heartbeat),capabilities:Array.isArray(o.capabilities)?o.capabilities.filter(Y=>typeof Y=="string"):void 0,sourceKind:o.source_kind==="history"||o.sourceKind==="history"?"history":o.source_kind==="fixture"||o.sourceKind==="fixture"?"fixture":"live",sourceLabel:$(o.source_label)||$(o.sourceLabel),statusSource:$(o.status_source)||$(o.statusSource),raw:o}},jc=o=>Qt(o,["devices","items"]).flatMap(d=>{const y=Df(d);return y?[y]:[]}),$f=()=>{const o=new URLSearchParams(window.location.search).get("device_state_fixture");if(o)try{const u=JSON.parse(decodeURIComponent(escape(window.atob(o))));if(u.mode!=="readonly_fixture"||typeof u.label!="string")return;const d=jc(u.devices).map(y=>({...y,sourceKind:y.sourceKind||"fixture"}));return{label:u.label,devices:d}}catch{return}},Uf=o=>Qt(o,["items","groups"]).flatMap(u=>{if(!oe(u))return[];const d=$(u.group_id)||$(u.groupId)||$(u.id);return d?[{groupId:d,name:$(u.name)||d,memberCount:ut(u.member_count)??ut(u.memberCount),deviceIds:Array.isArray(u.device_ids)?u.device_ids.filter(y=>typeof y=="string"):void 0,sourceAt:Te(u)}]:[]});async function Vf(){var Fe,_e;const[o,u,d,y,_,x,z,I,A,Y,Z,X,O,F,te,J]=await Promise.all([$e(["/api/v3/workbench/overview"],"GET /api/v3/workbench/overview",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/fleet/devices","/api/v3/devices"],"GET /api/v3/fleet/devices",w=>({data:jc(w),sourceAt:Te(w)})),$e(["/api/v3/device-groups"],"GET /api/v3/device-groups",w=>({data:Uf(w),sourceAt:Te(w)})),$e(["/api/v3/releases/latest"],"GET /api/v3/releases/latest",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)||(oe(w)?$(w.published_at):void 0)})),$e(["/api/v3/ai/status"],"GET /api/v3/ai/status",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/ai/tasks?limit=20"],"GET /api/v3/ai/tasks",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/ai/brain/dashboard"],"GET /api/v3/ai/brain/dashboard",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/connection/status"],"GET /api/v3/connection/status",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/process/status"],"GET /api/v3/process/status",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/integration/health"],"GET /api/v3/integration/health",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/integrations/apps","/api/v3/integrations/clients"],"GET /api/v3/integrations/apps",w=>({data:Qt(w,["items","applications"]),sourceAt:Te(w)})),$e(["/api/v3/integrations/authorizations","/api/v3/authorization-grants"],"GET /api/v3/integrations/authorizations",w=>({data:Qt(w,["items","grants"]),sourceAt:Te(w)})),$e(["/api/v3/integrations/usage"],"GET /api/v3/integrations/usage",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/integration/manifest"],"GET /api/v3/integration/manifest",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e(["/api/v3/integrations/docs/catalog","/api/v3/docs/catalog"],"GET /api/v3/integrations/docs/catalog",w=>({data:Qt(w,["items","documents"]),sourceAt:Te(w)})),$e(["/api/v3/kb/search?limit=10"],"GET /api/v3/kb/search",w=>({data:Qt(w,["items","results","documents"]),sourceAt:Te(w)}))]),b=$f(),Le=b&&u.state==="ready"?{...u,source:`${u.source} + readonly_fixture:${b.label}`,data:[...u.data||[],...b.devices]}:u,ze=(_e=(Fe=Le.data)==null?void 0:Fe[0])==null?void 0:_e.deviceId,Ie=ze?await $e([`/api/v3/wechat/hook/status?device_id=${encodeURIComponent(ze)}`],"GET /api/v3/wechat/hook/status",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})):qe("GET /api/v3/wechat/hook/status"),fe=x.state==="ready"?Qt(x.data,["items","tasks"]):[],ge=fe.length&&oe(fe[0])?$(fe[0].task_id):void 0,[he,pe,we]=ge?await Promise.all([$e([`/api/v3/ai/tasks/${encodeURIComponent(ge)}`],"GET /api/v3/ai/tasks/{task_id}",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e([`/api/v3/ai/tasks/${encodeURIComponent(ge)}/logs`],"GET /api/v3/ai/tasks/{task_id}/logs",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)})),$e([`/api/v3/ai/tasks/${encodeURIComponent(ge)}/audit`],"GET /api/v3/ai/tasks/{task_id}/audit",w=>({data:oe(w)?w:void 0,sourceAt:Te(w)}))]):[qe("GET /api/v3/ai/tasks/{task_id}"),qe("GET /api/v3/ai/tasks/{task_id}/logs"),qe("GET /api/v3/ai/tasks/{task_id}/audit")],Oe=x.state==="ready"?{state:"ready",source:"GET /api/v3/ai/tasks + /logs + /audit",sourceAt:[x.sourceAt,he.sourceAt,pe.sourceAt,we.sourceAt].filter(Boolean).sort().at(-1),data:{items:fe,selected:he.data,logs:Qt(pe.data,["items","logs"]),audit:Qt(we.data,["items","audit"])}}:{state:x.state,source:x.source,status:x.status,error:x.error},je=_.state==="ready"||z.state==="ready"||I.state==="ready"||A.state==="ready"||Y.state==="ready"?{state:"ready",source:"GET /api/v3/ai/status + /api/v3/ai/brain/dashboard + /api/v3/connection/status + /api/v3/process/status",sourceAt:[_.sourceAt,z.sourceAt,I.sourceAt,A.sourceAt,Y.sourceAt].filter(Boolean).sort().at(-1),data:{aiStatus:_.data,brain:z.data,connection:I.data,process:A.data,integrationHealth:Y.data}}:{state:_.state==="forbidden"?"forbidden":"unavailable",source:"GET /api/v3/ai/status + /api/v3/ai/brain/dashboard",error:_.error||z.error,status:_.status||z.status};return{overview:o,devices:Le,hookStatus:Ie,groups:d,release:y,engine:je,aiOperations:Oe,integrations:{applications:Z,authorizations:X,usage:O,manifest:F,documents:te,knowledge:J},readAt:new Date().toISOString()}}const Hf=o=>oe(o)?{value:o.value,display:$(o.display),status:$(o.status),source:$(o.source),sampled_at:$(o.sampled_at)}:{},Gr=(o,u=15)=>{if(!o)return!1;const d=Date.parse(o);return Number.isFinite(d)&&Date.now()-d>u*60*1e3},Tn=o=>o.error||(o.status===403?"当前账号没有读取权限":o.status===401?"登录状态已失效":"接口未接通或暂无数据"),ii={device:{},agent:{},platform:{},binding:{},wechat:{},services:{},permissions:[],events:[],agentLogs:[]},Pn=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),kc=o=>{if(typeof o!="string")return o;try{return JSON.parse(o)}catch{return o}},Bf=(o,u)=>{let d=o;for(const y of u.split(".")){if(!Pn(d)||!(y in d))return;d=d[y]}return d},B=(o,u)=>{for(const d of u){const y=Bf(o,d);if(y!=null&&y!=="")return y}},me=o=>{if(typeof o=="string")return o;if(typeof o=="number")return String(o)},It=o=>{const u=typeof o=="number"?o:Number(o);return Number.isFinite(u)?u:void 0},Ke=o=>{if(typeof o=="boolean")return o;if(o===1||o==="1"||o==="true"||o==="online"||o==="connected"||o==="running")return!0;if(o===0||o==="0"||o==="false"||o==="offline"||o==="disconnected"||o==="stopped")return!1},hc=o=>Array.isArray(o)?o.flatMap((u,d)=>{if(typeof u=="string")return[{id:String(d),message:u}];if(!Pn(u))return[];const y=me(B(u,["message","content","text","event","title"]));if(!y)return[];const _=me(B(u,["level","status","type"])),x=_==="success"||_==="warning"||_==="error"||_==="info"?_:void 0;return[{id:me(B(u,["id"]))??String(d),time:me(B(u,["time","timestamp","created_at","createdAt"])),message:y,level:x}]}):[],Wf=o=>Array.isArray(o)?o.flatMap((u,d)=>Pn(u)?[{key:me(B(u,["key","id","name"]))??String(d),name:me(B(u,["label","name","title"]))??`权限 ${d+1}`,granted:Ke(B(u,["granted","enabled","available","status"]))}]:[]):Pn(o)?Object.entries(o).map(([u,d])=>({key:u,name:u,granted:Ke(d)})):[],Gf=o=>{const u=Pn(o)?o:{};return{capturedAt:me(B(u,["capturedAt","captured_at","timestamp"])),device:{id:me(B(u,["device.id","device.deviceId","device.device_id","deviceId","device_id","id"])),name:me(B(u,["device.name","device.deviceName","device_name","name"])),model:me(B(u,["device.model","device.modelName","device.model_name","model"])),androidVersion:me(B(u,["device.androidVersion","device.android_version","androidVersion","android_version"])),imeiMasked:me(B(u,["device.imeiMasked","device.imei_masked","imeiMasked","imei_masked","binding.encryptedImei"])),fingerprint:me(B(u,["device.fingerprint","device.deviceFingerprint","device_fingerprint","fingerprint"])),serialNumber:me(B(u,["device.serialNumber","device.serial_number","serialNumber","serial_number","serial"])),batteryPercent:It(B(u,["device.batteryPercent","device.battery_percent","battery.percent","batteryPercent","battery"])),temperatureC:It(B(u,["device.temperatureC","device.temperature_c","temperature.celsius","temperatureC","temperature"])),storageFreeGB:It(B(u,["device.storageFreeGB","device.storage_free_gb","storage.freeGB","storageFreeGB","storage_free_gb"])),healthScore:It(B(u,["device.healthScore","device.health_score","health.score","healthScore","health_score"])),projectGroup:me(B(u,["device.projectGroup","device.project_group","projectGroup","project_group"])),tags:Array.isArray(B(u,["device.tags","tags"]))?B(u,["device.tags","tags"]).filter(d=>typeof d=="string"):void 0,networkType:me(B(u,["device.networkType","device.network_type","network.type","networkType","network_type"]))},agent:{running:Ke(B(u,["agent.running","agent.isRunning","agent_running","running"])),connected:Ke(B(u,["agent.connected","agent.online","agent_connected","wsConnected","ws_connected"])),uptimeSeconds:It(B(u,["agent.uptimeSeconds","agent.uptime_seconds","uptimeSeconds","uptime_seconds"])),host:me(B(u,["agent.host","agent.currentHost","agent.current_host","host"])),latencyMs:It(B(u,["agent.latencyMs","agent.latency_ms","latencyMs","latency_ms"])),autoDiscovery:Ke(B(u,["agent.autoDiscovery","agent.auto_discovery","automation.autoDiscovery"])),autoRoute:Ke(B(u,["agent.autoRoute","agent.auto_route","automation.autoRoute"])),autoReconnect:Ke(B(u,["agent.autoReconnect","agent.auto_reconnect","automation.autoReconnect"])),heartbeatKeepAlive:Ke(B(u,["agent.heartbeatKeepAlive","agent.heartbeat_keep_alive","automation.heartbeatKeepAlive"])),selfHealing:Ke(B(u,["agent.selfHealing","agent.self_healing","automation.selfHealing"])),bootStart:Ke(B(u,["agent.bootStart","agent.boot_start","automation.bootStart"]))},platform:{connected:Ke(B(u,["platform.connected","platform.online","platform_connected","server.connected"])),name:me(B(u,["platform.name","platform.platformName","platform_name","binding.platformName"])),serverUrl:me(B(u,["platform.serverUrl","platform.server_url","server.url","server_url"])),port:It(B(u,["platform.port","server.port","port"])),tlsEnabled:Ke(B(u,["platform.tlsEnabled","platform.tls_enabled","server.tls","tls_enabled"])),tokenMasked:me(B(u,["platform.tokenMasked","platform.token_masked","server.tokenMasked","token_masked"])),latencyMs:It(B(u,["platform.latencyMs","platform.latency_ms","server.latencyMs","server_latency_ms"]))},binding:{bound:Ke(B(u,["binding.bound","binding.isBound","bound","is_bound"])),platformName:me(B(u,["binding.platformName","binding.platform_name","platform.name"])),encryptedImei:me(B(u,["binding.encryptedImei","binding.encrypted_imei","device.imeiMasked","imei_masked"])),lastHeartbeat:me(B(u,["binding.lastHeartbeat","binding.last_heartbeat","lastHeartbeat","last_heartbeat"]))},wechat:{running:Ke(B(u,["wechat.running","wechat.isRunning","wechat_running"])),idMasked:me(B(u,["wechat.idMasked","wechat.id_masked","wechatIdMasked","wechat_id_masked","wechat.id"])),version:me(B(u,["wechat.version","wechat_version"])),friendCount:It(B(u,["wechat.friendCount","wechat.friend_count","friendCount","friend_count"]))},services:{sdkConnected:Ke(B(u,["services.sdkConnected","services.sdk_connected","sdk.connected","sdk_connected"])),fridaRunning:Ke(B(u,["services.fridaRunning","services.frida_running","frida.running","frida_running"])),hookAvailable:Ke(B(u,["services.hookAvailable","services.hook_available","hook.available","hook_available"]))},permissions:Wf(B(u,["permissions","device.permissions","runtime.permissions"])),version:me(B(u,["version","app.version","app_version"])),events:hc(B(u,["events","recentEvents","recent_events"])),agentLogs:hc(B(u,["agentLogs","agent_logs","logs"]))}},Qf=async()=>{const o=window.NativeAgent;if(!(o!=null&&o.getSnapshot))return{bridgeAvailable:!1,snapshot:ii,error:"NativeAgent.getSnapshot() 未接入"};try{const u=await Promise.resolve(o.getSnapshot()),d=kc(u);if(!Pn(d))throw new Error("快照格式不是 JSON 对象");return{bridgeAvailable:!0,snapshot:Gf(d)}}catch(u){return{bridgeAvailable:!0,snapshot:ii,error:u instanceof Error?u.message:"读取设备快照失败"}}},Kf=async o=>{const u=window.NativeAgent;if(!(u!=null&&u.performAction))return{success:!1,message:"NativeAgent.performAction(action) 未接入",code:"BRIDGE_UNAVAILABLE"};try{const d=await Promise.resolve(u.performAction(o)),y=kc(d);if(typeof y=="string")return{success:!0,message:y};if(!Pn(y))return{success:!0,message:"操作已提交",data:y};const _=Ke(B(y,["success","ok"])),x=B(y,["code","error_code"]),z=It(x),I=z!==void 0&&z>=400,A=me(B(y,["message","error_message","msg"]))??(_===!1?"操作执行失败":"操作已提交");return{success:_!==!1&&!I,message:A,data:y.data,code:typeof x=="string"||typeof x=="number"?x:void 0}}catch(d){return{success:!1,message:d instanceof Error?d.message:"原生操作执行失败",code:"ACTION_ERROR"}}},Yf=(o,u="")=>o===void 0||o===""?"—":`${o}${u}`;function Xf({value:o}){return i.jsx("span",{className:`status-dot ${o===!0?"is-online":o===!1?"is-offline":"is-unknown"}`})}function si({value:o,online:u="正常",offline:d="异常"}){return i.jsxs("span",{className:`status-text ${o===!0?"is-online":o===!1?"is-offline":"is-unknown"}`,children:[i.jsx(Xf,{value:o}),o===!0?u:o===!1?d:"不可用"]})}function Br({children:o}){return i.jsx("h2",{className:"section-title",children:o})}function Pe({children:o,className:u=""}){return i.jsx("section",{className:`card ${u}`,children:o})}function pn({title:o,detail:u}){return i.jsxs("div",{className:"empty-notice",children:[i.jsx(se,{name:"link",size:22}),i.jsxs("div",{children:[i.jsx("strong",{children:o}),i.jsx("span",{children:u})]})]})}function qf({icon:o,children:u,secondary:d,...y}){return i.jsxs("button",{className:`action-button ${d?"is-secondary":""}`,...y,children:[i.jsx(se,{name:o,size:20}),i.jsx("span",{children:u})]})}const Zf=[{icon:"agent",title:"任务智能",detail:"把任务拆清楚,再交给明确设备执行。",key:"tasks"},{icon:"wechat",title:"业务能力",detail:"按普通人看得懂的业务动作组织能力。",key:"skills"},{icon:"heartbeat",title:"稳定连接",detail:"先确认连接、心跳和探针,再谈执行。",key:"connection"},{icon:"shield",title:"运行治理",detail:"风险、审批、审计和回读都留下证据。",key:"governance"}];function Ft(o){return o==null||o===""?"未获取":String(o)}function Hr(o,u){return typeof o=="object"&&o!==null&&!Array.isArray(o)?o[u]:void 0}function Jf({icon:o,title:u,detail:d,sectionKey:y,api:_}){const x=_.engine.data,z=(x==null?void 0:x.brain)||{},I=z.skills||{},A=z.channels,Y=(x==null?void 0:x.connection)||{},Z=(x==null?void 0:x.integrationHealth)||{},X=_.engine.sourceAt,O=Gr(X),F=O?"数据已过期":y==="skills"?`${Ft(I.total_skills)} 个技能 / ${Ft(I.total_actions)} 个动作`:y==="connection"?`${Ft(Y.online_ws_count)} 台 WSS 在线`:y==="governance"?Z.ok===!0?"健康检查通过":Z.ok===!1?"存在异常":"未获取":"暂无任务样本",te=y==="skills"?[`能做的事:${Ft(I.total_skills)}`,`可以调用的动作:${Ft(I.total_actions)}`,`连接方式:${A?Object.keys(A).length:"未获取"}`,"能力详情来自真实接口"]:y==="connection"?[`WSS 在线:${Ft(Y.online_ws_count)}`,`连接设备:${Array.isArray(Y.devices)?Y.devices.length:"未获取"}`,`进程状态:${Ft(((x==null?void 0:x.process)||{}).state)}`,"不触发设备命令"]:y==="governance"?[`集成健康:${Z.ok===!0?"正常":Z.ok===!1?"异常":"未获取"}`,"权限与审计:读取对应 GET 结果","风险状态:总览接口聚合","业务回读:写任务页面单独验收"]:["任务状态:暂无样本","任务步骤:等待 AI 任务查询接口","目标设备:不自动选择","失败回执:写任务单独查看"];return i.jsxs(Pe,{className:"engine-section-card",children:[i.jsxs("div",{className:"engine-section-head",children:[i.jsx("span",{className:"engine-icon",children:i.jsx(se,{name:o,size:22})}),i.jsxs("div",{children:[i.jsx("h3",{children:u}),i.jsx("p",{children:d})]}),i.jsx("strong",{className:"engine-section-value",children:F})]}),i.jsx("ul",{children:te.map(J=>i.jsxs("li",{children:[i.jsx("span",{className:"status-dot is-unknown"}),J,i.jsx("b",{children:O?"数据已过期":_.engine.state==="ready"?"已读取":"未获取"})]},J))})]})}function bf({snapshot:o,api:u,busyAction:d,onAction:y}){var x,z,I,A,Y,Z,X,O,F;const _=u.engine.sourceAt||u.readAt;return i.jsxs("main",{className:"console-page console-engine",children:[i.jsxs("header",{className:"console-page-header",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"能力中心 / 任务与治理"}),i.jsx("h1",{children:"智能引擎"}),i.jsx("p",{children:"把“能做什么、谁来做、结果怎么确认”分成四块。"})]}),i.jsx(qf,{icon:"refresh",secondary:!0,disabled:d==="refresh_snapshot",onClick:()=>y("refresh_snapshot"),children:"刷新数据"})]}),u.engine.state==="forbidden"&&i.jsx(pn,{title:"智能引擎数据无权限",detail:Tn(u.engine)}),u.engine.state==="unavailable"&&i.jsx(pn,{title:"智能引擎接口未接通",detail:`${Tn(u.engine)};不展示虚构的技能数、操作数或在线设备数。`}),i.jsxs(Pe,{className:"engine-hero",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"执行前先确认"}),i.jsx("h2",{children:"先选任务,再选设备,最后看回执"}),i.jsx("p",{children:"单机和批量任务都必须有明确目标设备、权限、风险等级和业务回读。"})]}),i.jsxs("div",{className:"engine-connection",children:[i.jsx(si,{value:o.agent.connected,online:"WSS 在线",offline:"WSS 离线"}),i.jsx(si,{value:o.services.hookAvailable,online:"Hook 已挂载",offline:"Hook 未挂载"})]})]}),i.jsx(Br,{children:"四个能力分区"}),i.jsx("div",{className:"engine-grid",children:Zf.map(te=>i.jsx(Jf,{icon:te.icon,title:te.title,detail:te.detail,sectionKey:te.key,api:u},te.title))}),i.jsx(Br,{children:"AI 操作记录"}),u.aiOperations.state!=="ready"&&i.jsx(pn,{title:"AI 操作记录暂未获取",detail:Tn(u.aiOperations)}),u.aiOperations.state==="ready"&&i.jsxs(Pe,{className:"engine-operation-card",children:[i.jsxs("div",{className:"engine-section-head",children:[i.jsxs("div",{children:[i.jsx("h3",{children:"任务、步骤与审计"}),i.jsx("p",{children:"这里只读取任务记录,不会向设备派发命令。"})]}),i.jsxs("strong",{children:[((x=u.aiOperations.data)==null?void 0:x.items.length)||0," 条"]})]}),!((z=u.aiOperations.data)!=null&&z.items.length)&&i.jsx("p",{className:"muted-text",children:"暂无任务样本"}),!!((I=u.aiOperations.data)!=null&&I.items.length)&&i.jsxs("ul",{children:[i.jsxs("li",{children:["任务:",Ft(Hr((A=u.aiOperations.data)==null?void 0:A.selected,"task_id"))]}),i.jsxs("li",{children:["状态:",Ft(Hr((Y=u.aiOperations.data)==null?void 0:Y.selected,"status"))]}),i.jsxs("li",{children:["目标设备:",Ft(Hr((Z=u.aiOperations.data)==null?void 0:Z.selected,"target_device_ids"))]}),i.jsxs("li",{children:["确认要求:",String(Hr(Hr((X=u.aiOperations.data)==null?void 0:X.selected,"precheck"),"confirm_required")??"未获取")]}),i.jsxs("li",{children:["步骤记录:",((O=u.aiOperations.data)==null?void 0:O.logs.length)||0," 条"]}),i.jsxs("li",{children:["审计记录:",((F=u.aiOperations.data)==null?void 0:F.audit.length)||0," 条"]})]}),i.jsx("div",{className:"integration-footnote",children:"来源:GET /api/v3/ai/tasks、/logs、/audit · confirm_required 只展示,不在本页确认"})]}),i.jsx(Br,{children:"当前连接摘要"}),i.jsxs("div",{className:"engine-facts",children:[i.jsxs(Pe,{children:[i.jsx("span",{children:"Agent"}),i.jsx("strong",{children:o.agent.running===!0?"运行中":o.agent.running===!1?"已停止":"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("span",{children:"Hook 探针"}),i.jsx("strong",{children:o.services.hookAvailable===!0?"可用":o.services.hookAvailable===!1?"不可用":"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("span",{children:"最近心跳"}),i.jsx("strong",{children:o.binding.lastHeartbeat||"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("span",{children:"任务队列"}),i.jsx("strong",{children:u.engine.state==="ready"?"暂无样本":"未获取"})]})]}),i.jsxs("div",{className:"integration-footnote",children:["来源:GET /api/v3/ai/status、/api/v3/ai/brain/dashboard、/api/v3/connection/status、/api/v3/process/status · 读取于 ",_||"未获取"]})]})}const ep="https://wpsdk.quwanzhi.com/static/downloads/workphone-agent-latest.apk",tr=o=>typeof o=="object"&&o!==null&&!Array.isArray(o),Ot=o=>o===void 0||o===""?"未获取":String(o),Wr=(o,u="正常",d="异常")=>o===!0?u:o===!1?d:"未获取",kt=o=>o.status==="pending_authorization"||o.status==="pending_auth"?"待授权":o.online===!0||o.status==="online"?"在线":o.online===!1||o.status==="offline"?"离线":"未获取",oi=o=>kt(o)==="在线"?"is-online":kt(o)==="离线"?"is-offline":kt(o)==="待授权"?"is-pending":"is-unknown",tp=o=>o.sourceKind==="history"?"历史 Agent 记录":o.sourceKind==="fixture"?"安全测试夹具":"实时接口",np="ws://192.168.110.101:8899/ws/device",rp=()=>{const o=window.location.hostname;return/^(?:10\.|192\.168\.|172\.(?:1[6-9]|2\d|3[01])\.)/.test(o)?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/device`:np},lp=()=>{var o,u;return((u=(o=window.crypto)==null?void 0:o.randomUUID)==null?void 0:u.call(o))||`console-${Date.now()}-${Math.random().toString(16).slice(2)}`};function ip({device:o,sourceAt:u,onOpen:d}){const y=kt(o),_=Gr(o.sourceAt||u);return i.jsxs("button",{className:"device-summary-card",type:"button",onClick:d,children:[i.jsxs("span",{className:`device-summary-icon ${oi(o)}`,children:[i.jsx(se,{name:"device",size:28}),i.jsx("i",{})]}),i.jsxs("span",{className:"device-summary-main",children:[i.jsxs("span",{className:"device-summary-title",children:[i.jsx("strong",{children:o.name||o.model||"未命名手机"}),i.jsx("b",{className:oi(o),children:y})]}),i.jsxs("span",{className:"device-summary-sub",children:[Ot(o.model)," · Android ",Ot(o.androidVersion)]}),i.jsx("span",{className:"device-summary-id",children:o.deviceId}),i.jsxs("span",{className:"device-summary-facts",children:[i.jsxs("em",{children:[i.jsx(se,{name:"wechat",size:15}),o.wechatId||(o.wechatRunning?"微信运行中":"未绑定微信")]}),i.jsxs("em",{children:[i.jsx(se,{name:"agent",size:15}),"Agent ",Wr(o.agentRunning)]}),i.jsxs("em",{children:[i.jsx(se,{name:"link",size:15}),"Hook ",Wr(o.hookAvailable,"已挂载","未挂载")]})]})]}),i.jsxs("span",{className:"device-summary-side",children:[i.jsx("span",{children:o.groupId||o.projectId||"未分组"}),i.jsx("small",{className:_?"is-expired":"",children:_?"数据已过期":o.sourceAt||u||"未获取采样时间"}),i.jsxs("b",{children:["查看管理 ",i.jsx(se,{name:"chevron",size:16})]})]})]})}function He({label:o,value:u}){return i.jsxs("div",{className:"device-detail-item",children:[i.jsx("span",{children:o}),i.jsx("strong",{children:u})]})}function sp({api:o,loading:u,onRefresh:d}){var h,j;const[y,_]=ne.useState(""),[x,z]=ne.useState("all"),[I,A]=ne.useState("all"),[Y,Z]=ne.useState(),[X,O]=ne.useState(!1),[F,te]=ne.useState(!1),[J,b]=ne.useState(!1),[Le,ze]=ne.useState(),[Ie,fe]=ne.useState("cunkebao"),[ge,he]=ne.useState("工作手机"),[pe,we]=ne.useState(rp),[Oe,je]=ne.useState(""),[Fe,_e]=ne.useState(""),w=o.devices.data||[],Be=o.groups.data||[],G=w.find(E=>E.deviceId===Y),Ee=ne.useMemo(()=>w.filter(E=>{const C=`${E.name||""} ${E.model||""} ${E.deviceId} ${E.wechatId||""}`.toLowerCase(),L=kt(E),ee=x==="all"||x==="online"&&L==="在线"||x==="offline"&&L==="离线"||x==="pending"&&L==="待授权";return C.includes(y.trim().toLowerCase())&&ee&&(I==="all"||E.groupId===I||E.projectId===I)}),[w,I,y,x]),ie=o.devices.sourceAt||o.readAt,P={online:w.filter(E=>kt(E)==="在线").length,pending:w.filter(E=>kt(E)==="待授权").length,offline:w.filter(E=>kt(E)==="离线").length},W=async()=>{b(!0),_e(""),je("");try{const E=await fetch("/api/v3/qrcode/generate",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_id:Ie.trim()||"cunkebao",project_name:ge.trim()||"工作手机",server:pe.trim()})}),C=await E.json().catch(()=>({}));if(!E.ok){const re=tr(C)?C.message||C.detail||C.error:void 0;throw new Error(typeof re=="string"?re:`二维码生成失败(${E.status})`)}const L=tr(C)&&tr(C.data)?C.data:C;if(!tr(L))throw new Error("二维码响应格式错误");const ee=typeof L.image_data_url=="string"?L.image_data_url:typeof L.image_base64=="string"?`data:image/png;base64,${L.image_base64}`:"";if(!ee)throw new Error(typeof L.message=="string"?L.message:"服务未返回二维码图片");je(ee)}catch(E){_e(E instanceof Error?E.message:"二维码生成失败")}finally{b(!1)}},M=async()=>{if(!(!G||kt(G)!=="离线")){b(!0),ze(void 0);try{const E=await fetch(`/api/v3/devices/${encodeURIComponent(G.deviceId)}?confirm=true`,{method:"DELETE",credentials:"same-origin",headers:{"Idempotency-Key":lp(),"X-Actor-Id":"console-admin","X-Authenticated":"true","X-Permissions":"device.delete"}}),C=await E.json().catch(()=>({}));if(!E.ok||tr(C)&&C.success===!1){const L=tr(C)?C.message||C.error_message||C.detail:void 0;throw new Error(typeof L=="string"?L:`删除失败(${E.status})`)}te(!1),Z(void 0),ze({success:!0,message:"手机设备已删除,历史任务和审计记录继续保留。"}),await d()}catch(E){ze({success:!1,message:E instanceof Error?E.message:"删除设备失败"})}finally{b(!1)}}};return i.jsxs("main",{className:"console-page console-devices",children:[i.jsxs("header",{className:"console-page-header device-page-heading",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"手机管理"}),i.jsx("h1",{children:"手机设备"}),i.jsx("p",{children:"外层只看手机状态;点击一台手机,再查看参数、运行记录和删除操作。"})]}),i.jsxs("button",{className:"primary-action device-add-button",type:"button",onClick:()=>O(!0),children:[i.jsx(se,{name:"qr",size:18}),"添加手机"]})]}),Le&&i.jsx("div",{className:`device-page-notice ${Le.success?"is-success":"is-error"}`,children:Le.message}),o.devices.state==="forbidden"&&i.jsx(pn,{title:"手机列表无权限",detail:Tn(o.devices)}),o.devices.state==="unavailable"&&i.jsx(pn,{title:"手机设备列表还没有真实数据",detail:`${Tn(o.devices)};不展示演示设备卡片。`}),i.jsxs(Pe,{className:"device-management-bar",children:[i.jsxs("div",{className:"device-counts",children:[i.jsxs("button",{className:x==="all"?"is-active":"",onClick:()=>z("all"),children:["全部 ",i.jsx("b",{children:w.length})]}),i.jsxs("button",{className:x==="online"?"is-active":"",onClick:()=>z("online"),children:[i.jsx("i",{className:"online"}),"在线 ",i.jsx("b",{children:P.online})]}),i.jsxs("button",{className:x==="pending"?"is-active":"",onClick:()=>z("pending"),children:[i.jsx("i",{className:"pending"}),"待授权 ",i.jsx("b",{children:P.pending})]}),i.jsxs("button",{className:x==="offline"?"is-active":"",onClick:()=>z("offline"),children:[i.jsx("i",{className:"offline"}),"离线 ",i.jsx("b",{children:P.offline})]})]}),i.jsxs("div",{className:"device-filter-compact",children:[i.jsxs("label",{children:[i.jsx(se,{name:"search",size:17}),i.jsx("input",{value:y,onChange:E=>_(E.target.value),placeholder:"搜索手机、设备 ID 或微信号"})]}),i.jsxs("select",{value:I,onChange:E=>A(E.target.value),children:[i.jsx("option",{value:"all",children:"全部分组"}),Be.map(E=>i.jsx("option",{value:E.groupId,children:E.name},E.groupId))]}),i.jsxs("button",{type:"button",onClick:()=>void d(),disabled:u,children:[i.jsx(se,{name:"refresh",size:17}),"刷新"]})]})]}),i.jsxs("div",{className:"device-list-heading",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"手机列表"}),i.jsx("h2",{children:o.devices.state==="ready"?`${Ee.length} 台手机`:"暂无手机"})]}),i.jsxs("span",{className:"data-source-note",children:[o.devices.source," · ",ie||"未获取采样时间"]})]}),Ee.length?i.jsx("div",{className:"device-summary-list",children:Ee.map(E=>i.jsx(ip,{device:E,sourceAt:ie,onOpen:()=>Z(E.deviceId)},E.deviceId))}):i.jsxs(Pe,{className:"device-empty-card",children:[i.jsx(se,{name:"device",size:28}),i.jsx("strong",{children:o.devices.state==="ready"?"没有匹配的手机":"暂无手机"}),i.jsx("span",{children:o.devices.state==="ready"?"更换状态、分组或搜索词试试。":"点击“添加手机”,完成下载、安装和扫码绑定。"})]}),G&&i.jsx("div",{className:"device-overlay",role:"dialog","aria-modal":"true","aria-label":"手机管理详情",onMouseDown:E=>{E.target===E.currentTarget&&Z(void 0)},children:i.jsxs("aside",{className:"device-detail-drawer",children:[i.jsxs("header",{children:[i.jsx("button",{type:"button",className:"drawer-close",onClick:()=>Z(void 0),children:"×"}),i.jsxs("span",{className:`device-summary-icon ${oi(G)}`,children:[i.jsx(se,{name:"device",size:28}),i.jsx("i",{})]}),i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"手机管理"}),i.jsx("h2",{children:G.name||G.model||"未命名手机"}),i.jsx("p",{children:G.deviceId})]}),i.jsx("b",{className:oi(G),children:kt(G)})]}),i.jsxs("section",{children:[i.jsx("h3",{children:"运行状态"}),i.jsxs("div",{className:"device-detail-grid",children:[i.jsx(He,{label:"WSS",value:kt(G)}),i.jsx(He,{label:"Agent",value:Wr(G.agentRunning)}),i.jsx(He,{label:"Hook",value:Wr(G.hookAvailable,"已挂载","未挂载")}),i.jsx(He,{label:"最后心跳",value:G.lastHeartbeat||"未获取"})]})]}),i.jsxs("section",{children:[i.jsx("h3",{children:"微信"}),i.jsxs("div",{className:"device-detail-grid",children:[i.jsx(He,{label:"运行状态",value:Wr(G.wechatRunning,"运行中","未运行")}),i.jsx(He,{label:"微信号",value:G.wechatId||"未绑定微信号"}),i.jsx(He,{label:"好友数",value:Ot(G.friendCount)}),i.jsx(He,{label:"微信版本",value:Ot(G.wechatVersion)})]})]}),i.jsxs("section",{children:[i.jsx("h3",{children:"手机信息"}),i.jsxs("div",{className:"device-detail-grid",children:[i.jsx(He,{label:"型号",value:Ot(G.model)}),i.jsx(He,{label:"Android",value:Ot(G.androidVersion)}),i.jsx(He,{label:"项目 / 分组",value:Ot(G.groupId||G.projectId)}),i.jsx(He,{label:"网络",value:Ot(G.networkType)}),i.jsx(He,{label:"电量",value:G.batteryPercent===void 0?"未获取":`${G.batteryPercent}%`}),i.jsx(He,{label:"健康度",value:Ot(G.healthScore)})]})]}),i.jsxs("details",{className:"device-advanced",children:[i.jsx("summary",{children:"查看技术参数"}),i.jsxs("div",{children:[i.jsx(He,{label:"数据类型",value:tp(G)}),i.jsx(He,{label:"Agent 版本",value:Ot(G.agentVersion)}),i.jsx(He,{label:"状态来源",value:G.statusSource||o.devices.source}),i.jsx(He,{label:"采样时间",value:G.sourceAt||ie||"未获取"}),i.jsx(He,{label:"能力",value:(h=G.capabilities)!=null&&h.length?G.capabilities.join("、"):"未获取"})]})]}),i.jsxs("footer",{children:[i.jsxs("button",{className:"quiet-button",type:"button",onClick:()=>void d(),disabled:u,children:[i.jsx(se,{name:"refresh",size:17}),"刷新状态"]}),kt(G)==="离线"?i.jsxs("button",{className:"danger-button",type:"button",onClick:()=>te(!0),children:[i.jsx(se,{name:"power",size:17}),"删除手机"]}):i.jsx("span",{children:"在线手机需先下线,才能删除。"})]})]})}),X&&i.jsx("div",{className:"device-overlay",role:"dialog","aria-modal":"true","aria-label":"添加手机",onMouseDown:E=>{E.target===E.currentTarget&&O(!1)},children:i.jsxs("section",{className:"device-add-modal",children:[i.jsxs("header",{children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"添加手机"}),i.jsx("h2",{children:"下载、安装并扫码绑定"}),i.jsx("p",{children:"二维码直接由后台生成,不依赖浏览器 NativeAgent。"})]}),i.jsx("button",{type:"button",className:"drawer-close",onClick:()=>O(!1),children:"×"})]}),i.jsxs("div",{className:"device-add-steps",children:[i.jsxs("div",{children:[i.jsx("span",{children:"1"}),i.jsx("strong",{children:"下载 APK"}),i.jsx("a",{href:((j=o.release.data)==null?void 0:j.download_url)||ep,children:"下载当前安装包"})]}),i.jsxs("div",{children:[i.jsx("span",{children:"2"}),i.jsx("strong",{children:"手机安装"}),i.jsx("small",{children:"打开工作手机 Agent"})]}),i.jsxs("div",{children:[i.jsx("span",{children:"3"}),i.jsx("strong",{children:"扫码绑定"}),i.jsx("small",{children:"用 Agent 扫描右侧二维码"})]})]}),i.jsxs("div",{className:"device-bind-layout",children:[i.jsxs("div",{className:"device-bind-form",children:[i.jsxs("label",{children:["项目",i.jsx("input",{value:Ie,onChange:E=>fe(E.target.value)})]}),i.jsxs("label",{children:["手机名称",i.jsx("input",{value:ge,onChange:E=>he(E.target.value)})]}),i.jsxs("label",{children:["服务器地址",i.jsx("input",{value:pe,onChange:E=>we(E.target.value)})]}),i.jsxs("button",{className:"primary-action",type:"button",disabled:J||!pe.trim(),onClick:()=>void W(),children:[i.jsx(se,{name:"qr",size:18}),J?"生成中…":Oe?"重新生成二维码":"生成绑定二维码"]})]}),i.jsx("div",{className:"device-qr-area",children:Oe?i.jsxs(i.Fragment,{children:[i.jsx("img",{src:Oe,alt:"手机绑定二维码"}),i.jsx("strong",{children:ge||"工作手机"}),i.jsx("small",{children:pe})]}):Fe?i.jsxs(i.Fragment,{children:[i.jsx(se,{name:"link",size:28}),i.jsx("strong",{children:"生成失败"}),i.jsx("small",{className:"is-error",children:Fe})]}):i.jsxs(i.Fragment,{children:[i.jsx(se,{name:"qr",size:42}),i.jsx("strong",{children:"等待生成二维码"}),i.jsx("small",{children:"填写服务器地址后点击生成"})]})})]}),i.jsxs("footer",{children:[i.jsx("span",{children:"绑定成功后,手机会自动出现在列表中。"}),i.jsx("button",{className:"quiet-button",type:"button",onClick:()=>{O(!1),d()},children:"完成并刷新"})]})]})}),F&&G&&i.jsx("div",{className:"device-overlay device-confirm-layer",role:"alertdialog","aria-modal":"true",children:i.jsxs("section",{className:"device-confirm-modal",children:[i.jsx("span",{className:"danger-symbol",children:i.jsx(se,{name:"power",size:25})}),i.jsx("h2",{children:"确认删除这台手机?"}),i.jsxs("p",{children:[i.jsx("strong",{children:G.name||G.model||G.deviceId}),i.jsx("br",{}),"设备登记将删除,历史任务和审计记录继续保留。"]}),i.jsxs("div",{children:[i.jsx("button",{className:"quiet-button",type:"button",onClick:()=>te(!1),children:"取消"}),i.jsx("button",{className:"danger-button",type:"button",disabled:J,onClick:()=>void M(),children:J?"删除中…":"确认删除"})]})]})})]})}const mc=(o,u,d)=>o.state==="forbidden"?"无权限":o.state!=="ready"?"未获取":o.data&&(Array.isArray(o.data)?o.data.length:Object.keys(o.data).length)?u:d,vc=o=>`来源:${o.source} · 读取于 ${o.sourceAt||"未获取"}`,op=[{icon:"users",title:"第三方应用",detail:"应用、负责人、用途、环境、凭证和到期时间",key:"applications"},{icon:"lock",title:"接口授权",detail:"Scope、设备范围、文档范围、期限、额度和 IP 白名单",key:"authorizations"},{icon:"heartbeat",title:"用量统计",detail:"接口、设备、文档、成功率、失败原因和额度消耗",key:"usage"},{icon:"code",title:"接口目录",detail:"动作、参数、权限、错误码、请求与响应示例",key:"manifest"},{icon:"download",title:"SDK / APK",detail:"版本、校验、下载、升级和回滚入口",key:"documents"},{icon:"book",title:"知识库与项目文档",detail:"手册、架构、部署、排错、需求、进度和验收证据",key:"knowledge"}];function ap({api:o,loading:u}){var Z,X;const d=o.integrations,y=(Z=d.applications.data)==null?void 0:Z.length,_=(X=d.authorizations.data)==null?void 0:X.length,x=d.usage.data,z=d.manifest.data,I=(z==null?void 0:z.total_endpoints)??(z==null?void 0:z.endpoint_count)??(z==null?void 0:z.module_count),A=x==null?void 0:x.blocked,Y=[d.applications,d.authorizations,d.usage].filter(O=>O.state==="forbidden");return i.jsxs("main",{className:"console-page console-integrations",children:[i.jsxs("header",{className:"console-page-header",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"接入管理 / 权限与用量"}),i.jsx("h1",{children:"统一接入中心"}),i.jsx("p",{children:"第三方从这里登记、授权、查看用量、下载 SDK 和查文档。"})]}),i.jsx("span",{className:"badge badge-blue",children:"默认 deny_all"})]}),Y.length>0&&i.jsx(pn,{title:"部分授权或用量数据无权限",detail:Y.map(O=>`${O.source}:${Tn(O)}`).join(";")}),u&&i.jsx("div",{className:"integration-footnote",children:"正在读取接入中心 GET 数据…"}),i.jsxs(Pe,{className:"integration-banner",children:[i.jsx("div",{className:"integration-banner-icon",children:i.jsx(se,{name:"link",size:28})}),i.jsxs("div",{children:[i.jsx("h2",{children:"一套接口目录,一套授权口径"}),i.jsx("p",{children:"新第三方默认没有设备和写接口权限;设备范围为空就是没有设备,不解释成全部设备。"})]}),i.jsxs("div",{className:"integration-status",children:[i.jsx("span",{className:"status-dot is-unknown"}),"授权服务 ",i.jsx("strong",{children:mc(d.authorizations,`${_} 条授权`,"暂无样本")})]})]}),i.jsx(Br,{children:"接入中心分区"}),i.jsx("div",{className:"integration-grid",children:op.map(O=>{var J,b;const F=d[O.key],te=O.key==="applications"?`${y} 个应用`:O.key==="authorizations"?`${_} 条授权`:O.key==="usage"?`${(x==null?void 0:x.total_requests)??0} 次请求`:O.key==="manifest"?`${I??0} 个条目`:O.key==="documents"?`${((J=d.documents.data)==null?void 0:J.length)??0} 份文档`:`${((b=d.knowledge.data)==null?void 0:b.length)??0} 条结果`;return i.jsxs(Pe,{className:"integration-card",children:[i.jsx("span",{className:"integration-icon",children:i.jsx(se,{name:O.icon,size:22})}),i.jsxs("div",{children:[i.jsx("h3",{children:O.title}),i.jsx("p",{children:O.detail}),i.jsx("small",{children:vc(F)})]}),i.jsxs("span",{className:`integration-state ${F.state==="forbidden"?"is-forbidden":""}`,children:[mc(F,te,"暂无样本"),i.jsx(se,{name:"chevron",size:16})]})]},O.title)})}),i.jsx(Br,{children:"用量只读摘要"}),i.jsxs("div",{className:"permission-template-grid",children:[i.jsxs(Pe,{children:[i.jsx("strong",{children:"调用总数"}),i.jsx("span",{children:d.usage.state==="forbidden"?Tn(d.usage):(x==null?void 0:x.total_requests)??"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("strong",{children:"成功 / 业务失败"}),i.jsx("span",{children:d.usage.state==="ready"?`${(x==null?void 0:x.success)??0} / ${(x==null?void 0:x.business_failure)??(x==null?void 0:x.failed)??0}`:d.usage.state==="forbidden"?"无权限":"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("strong",{children:"鉴权拦截"}),i.jsx("span",{children:d.usage.state==="ready"?A??0:d.usage.state==="forbidden"?"无权限":"未获取"})]}),i.jsxs(Pe,{children:[i.jsx("strong",{children:"去重设备数"}),i.jsx("span",{children:d.usage.state==="ready"?(x==null?void 0:x.unique_devices)??0:d.usage.state==="forbidden"?"无权限":"未获取"})]})]}),i.jsxs(Pe,{className:"integration-note",children:[i.jsx(se,{name:"shield",size:20}),i.jsxs("div",{children:[i.jsx("strong",{children:"安全边界"}),i.jsx("span",{children:"在线测试必须标明测试环境;密钥、服务器配置、内部验收证据和完整微信号不会通过文档接口暴露。"})]})]}),i.jsxs("div",{className:"integration-footnote",children:[vc(d.usage),Gr(d.usage.sourceAt)?" · 数据已过期":""]})]})}const Sc=(o,u)=>u?"数据已过期":o===void 0||o===""?"未获取":String(o),up=o=>(o==null?void 0:o.display)||((o==null?void 0:o.value)===void 0||(o==null?void 0:o.value)===null?void 0:String(o.value)),cp=(o,u)=>(o==null?void 0:o.sampled_at)||u,dp=o=>{var d;if(!o)return;const u=[o,o.raw_rpc_receipt,(d=o.raw_rpc_receipt)==null?void 0:d.raw_rpc_receipt];for(const y of u){if(!y||typeof y!="object")continue;const _=y;if(typeof _.attached=="boolean")return _.attached;if(typeof _.supports_hook=="boolean")return _.supports_hook}if(o.success===!0&&o.verified===!0)return!0;if(o.success===!1||o.error_code||o.error)return!1};function Cn({icon:o,label:u,metric:d,fallbackAt:y}){const _=Hf(d),x=cp(_,y),z=Gr(x),I=Sc(up(_),z),A=z?"数据已过期":_.source?`来源:${_.source}`:x?`采样于 ${x}`:"暂无样本";return i.jsxs(Pe,{className:"console-metric-card",children:[i.jsx("span",{className:"console-metric-icon",children:i.jsx(se,{name:o,size:20})}),i.jsx("span",{className:"console-metric-label",children:u}),i.jsx("strong",{children:I}),i.jsx("small",{children:A})]})}function ri({label:o,value:u}){return i.jsxs("div",{className:"service-status-row",children:[i.jsx(si,{value:u,online:"正常",offline:"异常"}),i.jsx("span",{children:o})]})}function fp({snapshot:o,api:u,loading:d}){var ge,he,pe,we,Oe,je,Fe,_e,w,Be,G,Ee,ie,P;const y=u.overview.data,_=(y==null?void 0:y.sampled_at)||u.overview.sourceAt,x=Gr(_),z=(he=(ge=y==null?void 0:y.wechat)==null?void 0:ge.devices)==null?void 0:he[0],I=((pe=u.devices.data)==null?void 0:pe.find(W=>W.online===!0))||((we=u.devices.data)==null?void 0:we[0]),A=(Oe=u.engine.data)==null?void 0:Oe.connection,Y=typeof(A==null?void 0:A.online_ws_count)=="number"?A.online_ws_count:void 0,Z=Y!==void 0?Y>0:I==null?void 0:I.online,X=I==null?void 0:I.agentRunning,O=dp(u.hookStatus.data)??(I==null?void 0:I.hookAvailable),F=!!(o.device.id||o.device.name||I!=null&&I.deviceId||z!=null&&z.device_id),te=W=>Sc(W,x),J=o.device.id||(I==null?void 0:I.deviceId)||(z==null?void 0:z.device_id),b=o.device.name||(I==null?void 0:I.name)||J||"当前设备",Le=(z==null?void 0:z.logged_in)??o.wechat.running,ze=(z==null?void 0:z.wechat_version)||o.wechat.version,Ie=(z==null?void 0:z.friend_count)??o.wechat.friendCount,fe=(z==null?void 0:z.sampled_at)||_;return i.jsxs("main",{className:"console-page console-overview",children:[i.jsxs("header",{className:"console-page-header",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"统一工作台 / 只读"}),i.jsx("h1",{children:"数据总览"}),i.jsx("p",{children:"只看真实数据,不在这里扫码、下载或控制设备。"})]}),i.jsxs("div",{className:"page-badges",children:[i.jsx("span",{className:"badge badge-blue",children:"只读页面"}),i.jsx("span",{className:"badge",children:x?"数据已过期":_?`采样于 ${_}`:d?"正在读取":"等待数据"})]})]}),u.overview.state==="unavailable"&&i.jsx(pn,{title:"总览接口未获取到数据",detail:u.overview.error||"不展示演示数量,等待 GET /api/v3/workbench/overview 返回真实数据。"}),x&&i.jsx(pn,{title:"总览数据已过期",detail:"保留接口最后采样时间,等下一次成功读取后更新。"}),i.jsxs("section",{className:"console-metric-grid","aria-label":"真实指标",children:[i.jsx(Cn,{icon:"device",label:"设备总数",metric:(je=y==null?void 0:y.devices)==null?void 0:je.total,fallbackAt:_}),i.jsx(Cn,{icon:"wifi",label:"WSS 在线",metric:(Fe=y==null?void 0:y.devices)==null?void 0:Fe.online,fallbackAt:_}),i.jsx(Cn,{icon:"heartbeat",label:"24h 任务成功率",metric:(_e=y==null?void 0:y.tasks)==null?void 0:_e.success_rate_24h,fallbackAt:_}),i.jsx(Cn,{icon:"shield",label:"待处理风险",metric:(w=y==null?void 0:y.risk_events)==null?void 0:w.unhandled,fallbackAt:_}),i.jsx(Cn,{icon:"wechat",label:"微信已登录",metric:(Be=y==null?void 0:y.wechat)==null?void 0:Be.logged_in_devices,fallbackAt:_}),i.jsx(Cn,{icon:"users",label:"微信好友数",metric:(G=y==null?void 0:y.wechat)==null?void 0:G.friend_count,fallbackAt:_}),i.jsx(Cn,{icon:"link",label:"第三方调用量",metric:(Ee=y==null?void 0:y.third_party)==null?void 0:Ee.calls,fallbackAt:_})]}),i.jsxs("section",{className:"console-two-column",children:[i.jsxs(Pe,{className:"console-panel trend-panel",children:[i.jsxs("div",{className:"panel-heading",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"只读采样"}),i.jsx("h2",{children:"近 24 小时在线设备趋势"})]}),i.jsx("span",{className:"panel-note",children:"暂无样本"})]}),i.jsxs("div",{className:"trend-empty",children:[i.jsx(se,{name:"chart",size:30}),i.jsx("strong",{children:"暂无样本"}),i.jsx("span",{children:u.overview.state==="ready"?"接口已接通,但当前响应未提供趋势样本。":"接入总控概览接口后显示趋势,不用静态柱状图冒充数据。"})]})]}),i.jsxs(Pe,{className:"console-panel",children:[i.jsx("div",{className:"panel-heading",children:i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"运行状态"}),i.jsx("h2",{children:"核心服务健康"})]})}),i.jsxs("div",{className:"service-status-grid",children:[i.jsx(ri,{label:"API 网关",value:(P=(ie=u.engine.data)==null?void 0:ie.integrationHealth)==null?void 0:P.ok}),i.jsx(ri,{label:"WSS Hub",value:Z??o.agent.connected}),i.jsx(ri,{label:"Agent",value:X??o.agent.running}),i.jsx(ri,{label:"Hook 探针",value:O??o.services.hookAvailable})]}),i.jsxs("div",{className:"panel-callout",children:[i.jsx(se,{name:"link",size:17}),i.jsx("span",{children:"设备下载、扫码绑定和单机控制都集中在“手机设备”页面。"})]})]})]}),i.jsxs(Pe,{className:"console-panel overview-table-panel",children:[i.jsxs("div",{className:"panel-heading",children:[i.jsxs("div",{children:[i.jsx("span",{className:"eyebrow",children:"设备与微信运行摘要"}),i.jsx("h2",{children:"最近一次真实采样"})]}),i.jsx("span",{className:"panel-note",children:"不触发命令"})]}),F?i.jsx("div",{className:"overview-table-wrap",children:i.jsxs("table",{className:"overview-table",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"设备"}),i.jsx("th",{children:"WSS"}),i.jsx("th",{children:"Agent / Hook"}),i.jsx("th",{children:"微信运行"}),i.jsx("th",{children:"微信号"}),i.jsx("th",{children:"好友数"}),i.jsx("th",{children:"微信版本"}),i.jsx("th",{children:"采样时间"})]})}),i.jsx("tbody",{children:i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("strong",{children:b}),i.jsx("small",{children:te(J)})]}),i.jsx("td",{children:i.jsx(si,{value:Z??o.agent.connected,online:"在线",offline:"离线"})}),i.jsx("td",{children:X===void 0&&O===void 0&&o.agent.running===void 0&&o.services.hookAvailable===void 0?"未获取":`${X===!0||X===void 0&&o.agent.running===!0?"正常":X===!1||o.agent.running===!1?"异常":"未获取"} / ${O===!0||O===void 0&&o.services.hookAvailable===!0?"已挂载":O===!1||o.services.hookAvailable===!1?"未挂载":"未获取"}`}),i.jsx("td",{children:Le===!0?"已登录":Le===!1?"未登录":"未获取"}),i.jsx("td",{children:te(o.wechat.idMasked)==="未获取"?"已脱敏":te(o.wechat.idMasked)}),i.jsx("td",{children:te(Ie)}),i.jsx("td",{children:te(ze)}),i.jsx("td",{children:Yf(fe)})]})})]})}):i.jsxs("div",{className:"table-empty",children:[i.jsx(se,{name:"device",size:24}),i.jsx("strong",{children:"暂无样本"}),i.jsx("span",{children:"还没有可展示的设备快照,数据接入后这里会出现真实设备。"})]})]})]})}function pp(){const[o,u]=ne.useState(),[d,y]=ne.useState(""),[_,x]=ne.useState(""),[z,I]=ne.useState(!1),[A,Y]=ne.useState({id:"",name:"",description:"",runtime_binding:"",config:"{}"}),Z=ne.useCallback(async()=>{try{u(await Mf()),x("")}catch(F){x(F instanceof Error?F.message:"安全模块读取失败")}},[]);ne.useEffect(()=>{Z()},[Z]);const X=async(F,te)=>{y(F),x("");try{await te(),await Z()}catch(J){x(J instanceof Error?J.message:"操作失败")}finally{y("")}},O=async F=>{F.preventDefault(),await X("add",async()=>{await Of({...A,config:JSON.parse(A.config)}),Y({id:"",name:"",description:"",runtime_binding:"",config:"{}"}),I(!1)})};return i.jsxs("main",{className:"console-page security-page",children:[i.jsxs("header",{className:"console-page-header",children:[i.jsxs("div",{children:[i.jsx("div",{className:"eyebrow",children:"SDK治理 / 可插拔安全"}),i.jsx("h1",{children:"安全模块"}),i.jsx("p",{children:"一个总开关控制全局,每项能力可以独立启停,自定义模块可以随时接入或移除。"})]}),i.jsx("span",{className:`badge ${o!=null&&o.global_enabled?"badge-blue":""}`,children:o!=null&&o.global_enabled?"全局已开启":"全局已关闭"})]}),_&&i.jsx("div",{className:"security-error",children:_}),o?i.jsxs(i.Fragment,{children:[i.jsxs(Pe,{className:`security-master ${o.global_enabled?"is-on":"is-off"}`,children:[i.jsx("span",{className:"security-master-icon",children:i.jsx(se,{name:"shield",size:29})}),i.jsxs("div",{children:[i.jsx("h2",{children:"SDK 安全总开关"}),i.jsx("p",{children:"关闭后,所有可选安全能力停止生效;本控制页登录保护仍保留,便于重新开启。"}),i.jsxs("small",{children:[o.enabled_count," / ",o.module_count," 项正在生效"]})]}),i.jsxs("button",{className:`switch-button ${o.global_enabled?"is-on":""}`,disabled:d==="global",onClick:()=>void X("global",()=>Rf(!o.global_enabled)),children:[i.jsx("span",{}),o.global_enabled?"关闭全部":"开启全部"]})]}),i.jsxs("div",{className:"security-toolbar",children:[i.jsxs("strong",{children:["模块清单(",o.module_count,")"]}),i.jsxs("button",{onClick:()=>I(!z),children:[i.jsx(se,{name:"grid",size:16}),"添加模块"]})]}),z&&i.jsx(Pe,{className:"security-add-card",children:i.jsxs("form",{onSubmit:O,children:[i.jsx("input",{required:!0,placeholder:"模块ID,如 custom_guard",value:A.id,onChange:F=>Y({...A,id:F.target.value})}),i.jsx("input",{required:!0,placeholder:"模块名称",value:A.name,onChange:F=>Y({...A,name:F.target.value})}),i.jsx("input",{placeholder:"运行绑定,如 plugins.custom_guard",value:A.runtime_binding,onChange:F=>Y({...A,runtime_binding:F.target.value})}),i.jsx("input",{placeholder:"功能说明",value:A.description,onChange:F=>Y({...A,description:F.target.value})}),i.jsx("textarea",{"aria-label":"模块JSON配置",value:A.config,onChange:F=>Y({...A,config:F.target.value})}),i.jsx("button",{type:"submit",disabled:d==="add",children:d==="add"?"保存中…":"保存并接入"})]})}),i.jsx("div",{className:"security-grid",children:o.modules.map(F=>i.jsxs(Pe,{className:`security-card ${F.effective_enabled?"is-on":""}`,children:[i.jsxs("div",{className:"security-card-head",children:[i.jsx("span",{children:i.jsx(se,{name:F.effective_enabled?"shield":"lock",size:20})}),i.jsxs("div",{children:[i.jsx("h3",{children:F.name}),i.jsxs("small",{children:[F.id," · ",F.category]})]}),i.jsx("button",{"aria-label":`${F.name}${F.enabled?"关闭":"开启"}`,className:`mini-switch ${F.enabled?"is-on":""}`,disabled:!!d,onClick:()=>void X(F.id,()=>If(F.id,{enabled:!F.enabled})),children:i.jsx("i",{})})]}),i.jsx("p",{children:F.description}),i.jsx("code",{children:F.runtime_binding||"等待第三方绑定"}),i.jsxs("footer",{children:[i.jsx("span",{children:F.effective_enabled?"运行中":F.enabled?"等待总开关":"已停用"}),F.removable&&i.jsx("button",{disabled:!!d,onClick:()=>void X(`remove-${F.id}`,()=>Ff(F.id)),children:"移除"})]})]},F.id))})]}):i.jsxs("div",{className:"security-skeleton",children:[i.jsx("i",{}),i.jsx("i",{}),i.jsx("i",{})]})]})}const gc=[{id:"overview",label:"数据总览",description:"真实指标 · 只读",icon:"chart"},{id:"devices",label:"手机设备",description:"设备列表 · 单机入口",icon:"device"},{id:"engine",label:"智能引擎",description:"任务 · 能力 · 治理",icon:"agent"},{id:"security",label:"安全模块",description:"总开关 · 可插拔治理",icon:"shield"},{id:"integrations",label:"统一接入中心",description:"授权 · 用量 · 文档",icon:"link"}],hp=()=>{const o=new URLSearchParams(window.location.search).get("tab");return o==="devices"||o==="device"?"devices":o==="engine"||o==="agent"?"engine":o==="integrations"?"integrations":o==="security"?"security":"overview"};function mp(){var h,j,E;const[o,u]=ne.useState(hp),[d,y]=ne.useState("checking"),[_,x]=ne.useState(""),[z,I]=ne.useState(""),[A,Y]=ne.useState(""),[Z,X]=ne.useState(!1),[O,F]=ne.useState(ii),[te,J]=ne.useState(Lf),[b,Le]=ne.useState(!1),[ze,Ie]=ne.useState(),[fe,ge]=ne.useState(),[he,pe]=ne.useState(!1),[we,Oe]=ne.useState(),[je,Fe]=ne.useState(),_e=ne.useRef();ne.useEffect(()=>{let C=!0;return fetch("/api/v3/console/session",{credentials:"same-origin"}).then(async L=>{if(L.status===401)return{authenticated:!1};if(!L.ok)throw new Error("登录状态检查失败");return L.json()}).then(L=>{C&&y(L.authenticated===!0?"authenticated":"signed_out")}).catch(()=>{C&&(y("signed_out"),Y("登录服务暂时不可用,请确认本地服务已启动。"))}),()=>{C=!1}},[]);const w=ne.useCallback(async(C=!1)=>{pe(!0);const[L,ee]=await Promise.all([Qf(),Vf()]);Le(L.bridgeAvailable),F(L.snapshot),Ie(L.bridgeAvailable?L.error:void 0),J(ee);const re=[ee.overview,ee.devices,ee.engine].find(ce=>ce.state!=="ready");ge(re==null?void 0:re.error),pe(!1),!C&&(L.bridgeAvailable&&L.error||re!=null&&re.error)&&Fe({id:Date.now(),success:!1,message:(L.bridgeAvailable?L.error:void 0)||(re==null?void 0:re.error)||"读取总控数据失败"})},[]);ne.useEffect(()=>{if(d!=="authenticated")return;w(!0);const C=window.setInterval(()=>void w(!0),3e4),L=()=>{document.visibilityState==="visible"&&w(!0)};return document.addEventListener("visibilitychange",L),()=>{window.clearInterval(C),document.removeEventListener("visibilitychange",L)}},[d,w]),ne.useEffect(()=>{window.scrollTo({top:0,behavior:"auto"}),document.documentElement.scrollTop=0,document.body.scrollTop=0},[o]),ne.useEffect(()=>{if(je)return window.clearTimeout(_e.current),_e.current=window.setTimeout(()=>Fe(void 0),3200),()=>window.clearTimeout(_e.current)},[je]);const Be=ne.useCallback(async C=>{if(we)return;Oe(C);let L;try{L=await Kf(C),Fe({id:Date.now(),success:L.success,message:L.message}),await w(!0)}finally{Oe(void 0)}},[we,w]),G=async C=>{if(C.preventDefault(),!Z){X(!0),Y("");try{const L=await fetch("/api/v3/console/login",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:_,password:z})}),ee=await L.json().catch(()=>({}));if(!L.ok||ee.code!==200){Y(ee.message||"账号或密码错误");return}I(""),y("authenticated")}catch{Y("登录服务暂时不可用,请确认本地服务已启动。")}finally{X(!1)}}},Ee=async()=>{await fetch("/api/v3/console/logout",{method:"POST",credentials:"same-origin"}).catch(()=>{}),y("signed_out"),F(ii)},ie=((h=te.devices.data)==null?void 0:h.find(C=>C.online===!0))||((j=te.devices.data)==null?void 0:j[0]),P=(E=te.engine.data)==null?void 0:E.connection,W=typeof(P==null?void 0:P.online_ws_count)=="number"?P.online_ws_count:void 0,M=W!==void 0?W>0:ie==null?void 0:ie.online;return d!=="authenticated"?i.jsx("div",{className:"console-auth-shell",children:i.jsxs("div",{className:"console-auth-card",children:[i.jsx("div",{className:"brand-mark",children:i.jsx(se,{name:"settings",size:25})}),i.jsx("span",{className:"eyebrow",children:"工作手机总控平台"}),i.jsx("h1",{children:d==="checking"?"正在检查登录状态":"登录总控平台"}),i.jsx("p",{children:d==="checking"?"正在读取现有登录保护,请稍候。":"登录后查看设备、智能引擎和统一接入中心。"}),d==="checking"?i.jsxs("div",{className:"auth-loading",children:[i.jsx("span",{}),"正在检查…"]}):i.jsxs("form",{onSubmit:G,children:[i.jsxs("label",{children:["账号",i.jsx("input",{value:_,onChange:C=>x(C.target.value),autoComplete:"username",required:!0})]}),i.jsxs("label",{children:["密码",i.jsx("input",{value:z,onChange:C=>I(C.target.value),type:"password",autoComplete:"current-password",required:!0})]}),A&&i.jsx("div",{className:"auth-error",role:"alert",children:A}),i.jsx("button",{className:"auth-submit",type:"submit",disabled:Z,children:Z?"登录中…":"登录并加载平台"})]})]})}):i.jsxs("div",{className:"console-shell",children:[i.jsxs("header",{className:"console-topbar",children:[i.jsx("div",{className:"brand-mark",children:i.jsx(se,{name:"settings",size:25})}),i.jsxs("div",{className:"brand-copy",children:[i.jsx("strong",{children:"工作手机总控平台"}),i.jsx("span",{children:"设备管理 · 智能任务 · 统一接入 · 知识中心"})]}),i.jsxs("div",{className:"topbar-status",children:[i.jsxs("span",{children:[i.jsx("i",{}),"服务状态"]}),i.jsxs("b",{children:["WS ",M===!0?"在线":M===!1?"离线":O.agent.connected===!0?"在线":O.agent.connected===!1?"离线":"未获取"]}),i.jsx("b",{children:ie!=null&&ie.agentVersion?`v${ie.agentVersion.replace(/^v/,"")}`:O.version?`v${O.version.replace(/^v/,"")}`:"版本未获取"}),i.jsx("button",{className:"logout-button",onClick:()=>void Ee(),children:"退出登录"})]})]}),i.jsxs("div",{className:"console-layout",children:[i.jsxs("aside",{className:"console-sidebar",children:[i.jsx("div",{className:"sidebar-label",children:"统一工作台"}),gc.map(C=>i.jsxs(ne.Fragment,{children:[C.id==="security"&&i.jsx("div",{className:"sidebar-label sidebar-label-governance",children:"治理与接入"}),i.jsxs("button",{className:o===C.id?"is-active":"","aria-current":o===C.id?"page":void 0,onClick:()=>u(C.id),children:[i.jsx("span",{className:"nav-icon",children:i.jsx(se,{name:C.icon,size:21})}),i.jsxs("span",{children:[i.jsx("strong",{children:C.label}),i.jsx("small",{children:C.description})]})]})]},C.id))]}),i.jsxs("div",{className:"console-main",children:[i.jsx("nav",{className:"console-mobile-tabs","aria-label":"主菜单",children:gc.map(C=>i.jsxs("button",{className:o===C.id?"is-active":"",onClick:()=>u(C.id),children:[i.jsx(se,{name:C.icon,size:17}),C.label]},C.id))}),o==="overview"&&i.jsx(fp,{snapshot:O,bridgeAvailable:b,api:te,loading:he}),o==="devices"&&i.jsx(sp,{api:te,loading:he,onRefresh:()=>w(!0)}),o==="engine"&&i.jsx(bf,{snapshot:O,bridgeAvailable:b,api:te,busyAction:we,onAction:Be}),o==="integrations"&&i.jsx(ap,{snapshot:O,bridgeAvailable:b,api:te,loading:he}),o==="security"&&i.jsx(pp,{})]})]}),(ze||fe)&&i.jsxs("button",{className:"snapshot-error",onClick:()=>void w(),children:[i.jsx(se,{name:"refresh",size:16}),ze||fe]}),je&&i.jsxs("div",{className:`toast ${je.success?"is-success":"is-error"}`,role:"status",children:[i.jsx(se,{name:je.success?"check":"link",size:19}),i.jsx("span",{children:je.message})]})]})}Af.createRoot(document.getElementById("root")).render(i.jsx(_f.StrictMode,{children:i.jsx(mp,{})})); diff --git a/sdk/app/static/console/index.html b/sdk/app/static/console/index.html index 2c2f86c0e1..802d331430 100644 --- a/sdk/app/static/console/index.html +++ b/sdk/app/static/console/index.html @@ -6,7 +6,7 @@ 工作手机总控平台 - + diff --git a/开发文档/8、部署/06-存客宝宝塔/20260810_NAS设备详情字段映射修复.md b/开发文档/8、部署/06-存客宝宝塔/20260810_NAS设备详情字段映射修复.md new file mode 100644 index 0000000000..fee6e82b95 --- /dev/null +++ b/开发文档/8、部署/06-存客宝宝塔/20260810_NAS设备详情字段映射修复.md @@ -0,0 +1,24 @@ +# NAS 设备详情字段映射修复 + +- 日期:2026-08-10 +- 入口:`http://open.quwanzhi.com:8899/?tab=devices` +- 设备:工作手机 Android(WSS Agent 在线) + +## 已修复 + +控制台设备详情此前只读取顶层字段,而 NAS 设备上报将注册档案放在 `device_profile`、实时心跳放在 `quick_status`。现已合并读取两层数据,详情页可显示: + +- Android 版本、型号、厂商、Agent 版本 +- 微信运行状态与微信版本 +- 电量、网络、屏幕/前台应用等实时状态 +- 设备能力与心跳时间 + +## 微信号与好友数 + +这两个字段必须由微信 Frida Hook 只读回读。真机回执显示 Frida 已注入,当前处于短暂附着冷却,采集接口返回 `attach_in_progress`;控制台保持“未获取”,不会用历史或模拟数据填充。Hook 完成附着后,资料与联系人计数会通过同一 WSS 链路回传。 + +## 验收 + +- 新控制台静态资源:`/static/console/assets/index-_B4qz-iN.js` +- NAS 设备列表接口:HTTP 200 +- NAS SDK:健康探针通过后可用