@dimina-kit/devtools 0.3.1-dev.20260517100756 → 0.3.1-dev.20260518054451
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -7
- package/dist/main/index.bundle.js +106 -27
- package/dist/main/ipc/session.js +9 -1
- package/dist/main/menu/index.js +11 -0
- package/dist/main/services/projects/thumbnail.d.ts +4 -0
- package/dist/main/services/projects/thumbnail.js +32 -0
- package/dist/main/services/workspace/workspace-service.d.ts +2 -0
- package/dist/main/services/workspace/workspace-service.js +20 -0
- package/dist/main/utils/sender-policy.d.ts +7 -5
- package/dist/main/utils/sender-policy.js +8 -6
- package/dist/preload/runtime/custom-apis.js +32 -3
- package/dist/preload/windows/simulator.js +26 -5
- package/dist/renderer/assets/index-BFdItKBK.js +46 -0
- package/dist/renderer/assets/{input-C5M5Wxn6.js → input-AH9UDYmj.js} +2 -2
- package/dist/renderer/assets/{ipc-transport-CUsl-fS2.js → ipc-transport-DNgBM6Qz.js} +2 -2
- package/dist/renderer/assets/ipc-transport-Dvmd5JZj.css +1 -0
- package/dist/renderer/assets/{popover-BSBPVO0o.js → popover-D1hoVYiY.js} +2 -2
- package/dist/renderer/assets/{select-B1tF3UAc.js → select-BgDHRj6r.js} +2 -2
- package/dist/renderer/assets/{settings-api-BjJalghB.js → settings-api-DBKlNKV3.js} +2 -2
- package/dist/renderer/assets/{settings-7w54H6p-.js → settings-m-tcmZy_.js} +2 -2
- package/dist/renderer/assets/{workbenchSettings-q2_-nc8t.js → workbenchSettings-CGacu-pI.js} +2 -2
- package/dist/renderer/entries/main/index.html +5 -5
- package/dist/renderer/entries/popover/index.html +5 -5
- package/dist/renderer/entries/settings/index.html +5 -5
- package/dist/renderer/entries/workbench-settings/index.html +4 -4
- package/dist/shared/ipc-channels.d.ts +6 -0
- package/dist/shared/ipc-channels.js +19 -0
- package/dist/shared/ipc-schemas.d.ts +4 -0
- package/dist/shared/ipc-schemas.js +4 -0
- package/package.json +4 -4
- package/dist/renderer/assets/index-DW_0thr-.js +0 -46
- package/dist/renderer/assets/ipc-transport-CltRuvhi.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=settings-
|
|
1
|
+
import{C as e,D as t,E as n,w as r}from"./ipc-transport-DNgBM6Qz.js";import{t as i}from"./input-AH9UDYmj.js";import{a,n as o,t as s}from"./settings-api-DBKlNKV3.js";var c=t(r(),1),l=t(n(),1),u=e(),d=[{id:`local`,label:`本地设置`},{id:`project`,label:`项目配置`}];function f(){let[e,t]=(0,l.useState)(`local`),[n,r]=(0,l.useState)(``),[c,f]=(0,l.useState)({startPage:``,scene:1001,queryParams:[]}),[p,m]=(0,l.useState)({uploadWithSourceMap:!1});(0,l.useEffect)(()=>a(e=>{r(e.projectPath),f(e.config),m({uploadWithSourceMap:!!e.projectSettings?.uploadWithSourceMap})}),[]);function h(e){let t={...c,...e};f(t),o(t)}function g(e){let t={...p,...e};m(t),s(t)}function _(e,t,n){return(0,u.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`w-full flex items-center gap-3 px-3 py-2.5 rounded-md border border-border bg-bg hover:bg-surface-3 transition-colors text-left`,children:[(0,u.jsx)(`span`,{className:`h-4 w-4 rounded-sm border flex items-center justify-center text-[11px] ${t?`bg-accent border-accent text-white`:`border-border bg-surface text-transparent`}`,children:`✓`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text`,children:e})]})}return(0,u.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,u.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:d.map(n=>(0,u.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${e===n.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>t(n.id),children:n.label},n.id))}),(0,u.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[e===`local`&&(0,u.jsxs)(`div`,{className:`space-y-3`,children:[(0,u.jsx)(`div`,{className:`text-[12px] text-text-secondary`,children:`本地设置`}),_(`上传时启用 Sourcemap`,p.uploadWithSourceMap,e=>g({uploadWithSourceMap:e}))]}),e===`project`&&(0,u.jsxs)(`div`,{className:`space-y-4`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between py-2 border-b border-border`,children:[(0,u.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`本地目录`}),(0,u.jsx)(`span`,{className:`text-[12px] text-text truncate ml-4 max-w-[180px]`,title:n,children:n})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`启动页面`}),(0,u.jsx)(i,{value:c.startPage,onChange:e=>h({startPage:e.target.value}),className:`w-full h-8 px-2 text-[12px]`})]}),(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`label`,{className:`block text-[12px] text-text-secondary mb-1`,children:`Scene`}),(0,u.jsx)(i,{type:`number`,value:c.scene,onChange:e=>h({scene:parseInt(e.target.value||`1001`,10)}),className:`w-full h-8 px-2 text-[12px]`})]})]})]})]})}c.createRoot(document.getElementById(`root`)).render((0,u.jsx)(f,{}));
|
|
2
|
+
//# sourceMappingURL=settings-m-tcmZy_.js.map
|
package/dist/renderer/assets/{workbenchSettings-q2_-nc8t.js → workbenchSettings-CGacu-pI.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as e,D as t,E as n,w as r}from"./ipc-transport-DNgBM6Qz.js";import{c as i,i as a,o,r as s,s as c}from"./settings-api-DBKlNKV3.js";var l=t(r(),1),u=t(n(),1),d=e(),f=[{id:`general`,label:`通用`},{id:`debug`,label:`调试`},{id:`mcp`,label:`MCP`}];function p({checked:e,onClick:t}){return(0,d.jsx)(`button`,{type:`button`,onClick:t,className:`relative inline-flex h-5 w-9 shrink-0 rounded-full transition-colors`,style:{background:e?`var(--color-accent)`:`var(--color-surface-3)`},children:(0,d.jsx)(`span`,{className:`inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform`,style:{marginTop:3,transform:e?`translateX(18px)`:`translateX(3px)`}})})}function m(){let[e,t]=(0,u.useState)({cdp:{enabled:!1,port:9222},mcp:{enabled:!1,port:7789},compile:{watch:!0},theme:`system`}),[n,r]=(0,u.useState)(null),[l,m]=(0,u.useState)(`general`),[h,g]=(0,u.useState)(!1),[_,v]=(0,u.useState)(`9222`),[y,b]=(0,u.useState)(`7789`);(0,u.useEffect)(()=>{let e=o(e=>{t(e.settings),v(String(e.settings.cdp.port)),b(String(e.settings.mcp.port))});return a().then(e=>{t(e),v(String(e.cdp.port)),b(String(e.mcp.port))}),s().then(r),e},[]);function x(){g(!0),window.setTimeout(()=>g(!1),2e3)}function S(){t(e=>({...e,cdp:{...e.cdp,enabled:!e.cdp.enabled}}))}function C(){t(e=>({...e,mcp:{...e.mcp,enabled:!e.mcp.enabled}}))}function w(n){let r={...e,theme:n};t(r),i(n),c(r)}function T(n){let r={...e,compile:{...e.compile,watch:n}};t(r),c(r).then(x)}async function E(){let n=parseInt(_,10);if(Number.isNaN(n)||n<1024||n>65535)return;let i=parseInt(y,10);if(Number.isNaN(i)||i<1024||i>65535)return;let a={...e,cdp:{...e.cdp,port:n},mcp:{...e.mcp,port:i}};t(a),await c(a),r(await s()),x()}let D=n&&!n.implicitDevDefault&&(e.cdp.enabled!==n.active||e.cdp.enabled&&n.active&&e.cdp.port!==n.activePort);return(0,d.jsxs)(`div`,{className:`flex flex-col h-screen bg-surface text-text`,children:[(0,d.jsx)(`div`,{className:`flex items-center border-b border-border shrink-0`,children:f.map(e=>(0,d.jsx)(`button`,{className:`flex-1 py-2.5 text-[12px] text-center transition-colors ${l===e.id?`text-accent border-b-2 border-accent`:`text-text-secondary hover:text-text`}`,onClick:()=>m(e.id),children:e.label},e.id))}),(0,d.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:[l===`general`&&(0,d.jsxs)(`div`,{className:`space-y-4`,children:[(0,d.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`编译`}),(0,d.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`开启后,打开项目时会监听源文件改动并自动重新编译。关闭则只在打开/手动重新编译时构建。配置在下次打开项目时生效。`})]}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`监听文件变化自动编译`}),(0,d.jsx)(p,{checked:e.compile.watch,onClick:()=>T(!e.compile.watch)})]})]}),(0,d.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-3 bg-bg`,children:[(0,d.jsx)(`div`,{children:(0,d.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`外观`})}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`颜色模式`}),(0,d.jsx)(`div`,{className:`flex rounded overflow-hidden border border-border text-[11px]`,children:[`system`,`dark`,`light`].map((t,n)=>{let r=t===`system`?`跟随系统`:t===`dark`?`深色`:`浅色`,i=e.theme===t;return(0,d.jsx)(`button`,{onClick:()=>w(t),className:[`px-3 py-1 transition-colors`,n>0?`border-l border-border`:``,i?`bg-accent text-white`:`text-text-secondary hover:text-text hover:bg-surface-3`].join(` `),children:r},t)})})]})]}),h&&(0,d.jsx)(`div`,{className:`text-[11px] text-status-success`,children:`已保存`})]}),l===`debug`&&(0,d.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`DevTools Protocol`}),(0,d.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`开启后可通过 DevTools Protocol 连接调试模拟器。配置变更需要重启应用后生效。`})]}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`启用 DevTools Protocol`}),(0,d.jsx)(p,{checked:e.cdp.enabled,onClick:S})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`label`,{className:`text-[12px] shrink-0 w-16 text-text-secondary`,children:`调试端口`}),(0,d.jsx)(`input`,{type:`number`,min:1024,max:65535,value:_,onChange:e=>v(e.target.value),disabled:!e.cdp.enabled,className:`w-24 h-7 px-2 rounded text-[12px] outline-none bg-surface border border-border text-text`,style:{opacity:e.cdp.enabled?1:.4}}),(0,d.jsx)(`span`,{className:`text-[11px] text-text-dim`,children:`默认 9222`})]}),(0,d.jsxs)(`div`,{className:`rounded p-3 space-y-2 border border-border bg-surface`,children:[(0,d.jsx)(`div`,{className:`text-[11px] font-medium text-text-secondary`,children:`当前状态`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,d.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-full`,style:{background:n?.active?`var(--color-status-success)`:`var(--color-text-dim)`}}),(0,d.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:n?.active?`CDP 已激活 - 端口 ${n.activePort}`:`CDP 未激活`})]}),n?.implicitDevDefault&&(0,d.jsx)(`div`,{className:`text-[11px] text-text-dim`,children:`当前为开发模式默认端口`}),n?.active&&(0,d.jsxs)(`div`,{className:`text-[11px] text-text-dim font-mono`,children:[`调试地址: http://localhost:`,n.activePort]})]}),D&&(0,d.jsx)(`div`,{className:`rounded px-3 py-2 text-[12px] border bg-warn-bg text-[var(--color-status-warn)]`,children:`配置已变更,需要重启应用后生效`}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`button`,{onClick:E,className:`h-7 px-4 rounded text-[13px] font-medium text-white bg-accent hover:bg-accent-hover`,children:`保存`}),h&&(0,d.jsx)(`span`,{className:`text-[11px] text-status-success`,children:`已保存`})]})]}),l===`mcp`&&(0,d.jsxs)(`section`,{className:`rounded-lg border border-border p-4 space-y-4 bg-bg`,children:[(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`h2`,{className:`text-[13px] font-medium mb-1`,children:`MCP 配置`}),(0,d.jsx)(`p`,{className:`text-[11px] leading-relaxed text-text-secondary`,children:`AI 助手可以通过 MCP 连接当前开发工具,读取 console、截图、执行 JS、查看 DOM / Storage / 网络请求。启用后开发工具启动时会自动监听 SSE 端点,并自动启用 CDP。`})]}),(0,d.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,d.jsx)(`span`,{className:`text-[12px] text-text-secondary`,children:`启用 MCP 服务`}),(0,d.jsx)(p,{checked:e.mcp.enabled,onClick:C})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`label`,{className:`text-[12px] shrink-0 w-16 text-text-secondary`,children:`SSE 端口`}),(0,d.jsx)(`input`,{type:`number`,min:1024,max:65535,value:y,onChange:e=>b(e.target.value),disabled:!e.mcp.enabled,className:`w-24 h-7 px-2 rounded text-[12px] outline-none bg-surface border border-border text-text`,style:{opacity:e.mcp.enabled?1:.4}}),(0,d.jsx)(`span`,{className:`text-[11px] text-text-dim`,children:`默认 7789`})]}),(0,d.jsxs)(`div`,{className:`rounded p-3 border border-border bg-surface`,children:[(0,d.jsx)(`div`,{className:`text-[11px] font-medium mb-2 text-text-secondary`,children:"`.mcp.json` 示例(SSE 传输)"}),(0,d.jsx)(`pre`,{className:`text-[11px] whitespace-pre-wrap leading-relaxed text-[var(--color-code-blue)] font-mono`,children:`{
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"dimina-devtools": {
|
|
4
4
|
"url": "http://127.0.0.1:${e.mcp.port}/sse"
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
}`})]}),(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(`button`,{onClick:E,className:`h-7 px-4 rounded text-[13px] font-medium text-white bg-accent hover:bg-accent-hover`,children:`保存`}),h&&(0,d.jsx)(`span`,{className:`text-[11px] text-status-success`,children:`已保存`})]})]})]})]})}l.createRoot(document.getElementById(`root`)).render((0,d.jsx)(m,{}));
|
|
8
|
-
//# sourceMappingURL=workbenchSettings-
|
|
8
|
+
//# sourceMappingURL=workbenchSettings-CGacu-pI.js.map
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
|
|
12
12
|
<title>Dimina DevTools</title>
|
|
13
|
-
<script type="module" crossorigin src="../../assets/index-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="../../assets/input-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="../../assets/select-
|
|
17
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
13
|
+
<script type="module" crossorigin src="../../assets/index-BFdItKBK.js"></script>
|
|
14
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DNgBM6Qz.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="../../assets/input-AH9UDYmj.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="../../assets/select-BgDHRj6r.js">
|
|
17
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Dvmd5JZj.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body>
|
|
20
20
|
<div id="root"></div>
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
<style>
|
|
9
9
|
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: transparent !important; }
|
|
10
10
|
</style>
|
|
11
|
-
<script type="module" crossorigin src="../../assets/popover-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="../../assets/input-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="../../assets/select-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
11
|
+
<script type="module" crossorigin src="../../assets/popover-D1hoVYiY.js"></script>
|
|
12
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DNgBM6Qz.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="../../assets/input-AH9UDYmj.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="../../assets/select-BgDHRj6r.js">
|
|
15
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Dvmd5JZj.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
<!-- See main/index.html for CSP rationale. -->
|
|
6
6
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
|
|
7
7
|
<title>Settings</title>
|
|
8
|
-
<script type="module" crossorigin src="../../assets/settings-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="../../assets/input-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="../../assets/settings-api-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
8
|
+
<script type="module" crossorigin src="../../assets/settings-m-tcmZy_.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DNgBM6Qz.js">
|
|
10
|
+
<link rel="modulepreload" crossorigin href="../../assets/input-AH9UDYmj.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="../../assets/settings-api-DBKlNKV3.js">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Dvmd5JZj.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
<!-- See entries/main/index.html for CSP rationale. -->
|
|
7
7
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: http: https:; font-src 'self' data:; media-src 'self' blob: http: https:; connect-src 'self' http: https: ws: wss:;" />
|
|
8
8
|
<title>开发工具设置</title>
|
|
9
|
-
<script type="module" crossorigin src="../../assets/workbenchSettings-
|
|
10
|
-
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="../../assets/settings-api-
|
|
12
|
-
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-
|
|
9
|
+
<script type="module" crossorigin src="../../assets/workbenchSettings-CGacu-pI.js"></script>
|
|
10
|
+
<link rel="modulepreload" crossorigin href="../../assets/ipc-transport-DNgBM6Qz.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="../../assets/settings-api-DBKlNKV3.js">
|
|
12
|
+
<link rel="stylesheet" crossorigin href="../../assets/ipc-transport-Dvmd5JZj.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
15
15
|
<div id="root"></div>
|
|
@@ -19,6 +19,10 @@ export declare const SimulatorCustomApiChannel: {
|
|
|
19
19
|
readonly List: "simulator:custom-apis:list";
|
|
20
20
|
readonly Invoke: "simulator:custom-apis:invoke";
|
|
21
21
|
};
|
|
22
|
+
export declare const SimulatorCustomApiBridgeChannel: {
|
|
23
|
+
readonly Request: "simulator:custom-apis:bridge-request";
|
|
24
|
+
readonly Response: "simulator:custom-apis:bridge-response";
|
|
25
|
+
};
|
|
22
26
|
export declare const SimulatorStorageChannel: {
|
|
23
27
|
readonly GetSnapshot: "simulator:storage:snapshot";
|
|
24
28
|
readonly GetActivePrefix: "simulator:storage:activePrefix";
|
|
@@ -96,6 +100,8 @@ export declare const ProjectChannel: {
|
|
|
96
100
|
readonly GetCompileConfig: "project:getCompileConfig";
|
|
97
101
|
readonly SaveCompileConfig: "project:saveCompileConfig";
|
|
98
102
|
readonly Status: "project:status";
|
|
103
|
+
readonly CaptureThumbnail: "project:captureThumbnail";
|
|
104
|
+
readonly GetThumbnail: "project:getThumbnail";
|
|
99
105
|
};
|
|
100
106
|
export declare const ProjectsChannel: {
|
|
101
107
|
readonly List: "projects:list";
|
|
@@ -19,10 +19,27 @@ export const SimulatorChannel = {
|
|
|
19
19
|
// ── Custom simulator APIs (downstream-registered, main-process handlers) ──
|
|
20
20
|
// list: simulator queries the names registered via @dimina-kit/devtools/simulator-apis.
|
|
21
21
|
// invoke: simulator forwards an API call to the registry; result/reject propagates.
|
|
22
|
+
//
|
|
23
|
+
// These are ipcMain.handle channels invoked by the **main-window renderer**
|
|
24
|
+
// only (trusted host). The simulator <webview> never reaches them directly —
|
|
25
|
+
// it proxies through the host via the bridge channels below, so the
|
|
26
|
+
// sender-policy can keep the webview off the IPC white-list.
|
|
22
27
|
export const SimulatorCustomApiChannel = {
|
|
23
28
|
List: 'simulator:custom-apis:list',
|
|
24
29
|
Invoke: 'simulator:custom-apis:invoke',
|
|
25
30
|
};
|
|
31
|
+
// ── Custom APIs bridge proxy (simulator <webview> ↔ main-window renderer) ──
|
|
32
|
+
// Request: webview → host via `ipcRenderer.sendToHost`,
|
|
33
|
+
// payload = { id, op: 'list' } | { id, op: 'invoke', name, params }
|
|
34
|
+
// Response: host → webview via `<webview>.send`,
|
|
35
|
+
// payload = { id, result } | { id, error }
|
|
36
|
+
//
|
|
37
|
+
// Request/response are correlated by `id` so multiple concurrent invokes can
|
|
38
|
+
// be in flight at once.
|
|
39
|
+
export const SimulatorCustomApiBridgeChannel = {
|
|
40
|
+
Request: 'simulator:custom-apis:bridge-request',
|
|
41
|
+
Response: 'simulator:custom-apis:bridge-response',
|
|
42
|
+
};
|
|
26
43
|
// ── Storage (CDP-backed; main process attaches the debugger to the
|
|
27
44
|
// simulator <webview> and forwards DOMStorage events to the renderer) ──
|
|
28
45
|
export const SimulatorStorageChannel = {
|
|
@@ -62,6 +79,8 @@ export const ProjectChannel = {
|
|
|
62
79
|
GetCompileConfig: 'project:getCompileConfig',
|
|
63
80
|
SaveCompileConfig: 'project:saveCompileConfig',
|
|
64
81
|
Status: 'project:status',
|
|
82
|
+
CaptureThumbnail: 'project:captureThumbnail',
|
|
83
|
+
GetThumbnail: 'project:getThumbnail',
|
|
65
84
|
};
|
|
66
85
|
// ── Project list / workspace ─────────────────────────────────────────────
|
|
67
86
|
export const ProjectsChannel = {
|
|
@@ -110,4 +110,8 @@ export declare const SettingsProjectSettingsChangedSchema: z.ZodTuple<[z.ZodObje
|
|
|
110
110
|
}, z.core.$loose>], null>;
|
|
111
111
|
/** panel:select — single panel id string. */
|
|
112
112
|
export declare const PanelSelectSchema: z.ZodTuple<[z.ZodString], null>;
|
|
113
|
+
/** project:captureThumbnail — absolute project path. */
|
|
114
|
+
export declare const ProjectCaptureThumbnailSchema: z.ZodTuple<[z.ZodString], null>;
|
|
115
|
+
/** project:getThumbnail — absolute project path. */
|
|
116
|
+
export declare const ProjectGetThumbnailSchema: z.ZodTuple<[z.ZodString], null>;
|
|
113
117
|
//# sourceMappingURL=ipc-schemas.d.ts.map
|
|
@@ -125,4 +125,8 @@ export const SettingsProjectSettingsChangedSchema = z.tuple([
|
|
|
125
125
|
]);
|
|
126
126
|
/** panel:select — single panel id string. */
|
|
127
127
|
export const PanelSelectSchema = z.tuple([z.string().min(1).max(200)]);
|
|
128
|
+
/** project:captureThumbnail — absolute project path. */
|
|
129
|
+
export const ProjectCaptureThumbnailSchema = z.tuple([AbsolutePath]);
|
|
130
|
+
/** project:getThumbnail — absolute project path. */
|
|
131
|
+
export const ProjectGetThumbnailSchema = z.tuple([AbsolutePath]);
|
|
128
132
|
//# sourceMappingURL=ipc-schemas.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dimina-kit/devtools",
|
|
3
|
-
"version": "0.3.1-dev.
|
|
3
|
+
"version": "0.3.1-dev.20260518054451",
|
|
4
4
|
"description": "Dimina DevTools - modular developer tools for mini app debugging",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dimina",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"chrome-remote-interface": "^0.34.0",
|
|
117
117
|
"ws": "^8.20.0",
|
|
118
118
|
"zod": "^4.3.6",
|
|
119
|
-
"@dimina-kit/devkit": "0.1.1-dev.
|
|
119
|
+
"@dimina-kit/devkit": "0.1.1-dev.20260518054451"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
122
|
"@playwright/test": "^1.59.1",
|
|
@@ -159,8 +159,8 @@
|
|
|
159
159
|
"typescript": "5.9.2",
|
|
160
160
|
"vite": "^8.0.8",
|
|
161
161
|
"vitest": "^4.1.4",
|
|
162
|
-
"@dimina-kit/
|
|
163
|
-
"@dimina-kit/
|
|
162
|
+
"@dimina-kit/typescript-config": "0.1.0",
|
|
163
|
+
"@dimina-kit/eslint-config": "0.1.0"
|
|
164
164
|
},
|
|
165
165
|
"peerDependencies": {
|
|
166
166
|
"electron": ">=36"
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import{C as e,S as t,T as n,_ as r,a as i,d as a,h as o,m as s,n as c,o as l,p as u,r as d,s as f,t as p,u as m,w as h,x as g}from"./ipc-transport-CUsl-fS2.js";import{n as _,r as v,t as y}from"./input-C5M5Wxn6.js";import{_ as b,a as x,b as S,c as C,d as ee,f as w,g as te,h as ne,i as re,m as ie,n as ae,o as oe,p as se,r as ce,s as le,t as ue,u as de,v as fe,x as T,y as pe}from"./select-B1tF3UAc.js";var me=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),he=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ge=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ye=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=n(h()),be=(0,E.createContext)({}),xe=()=>(0,E.useContext)(be),Se=(0,E.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=xe()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,E.createElement)(`svg`,{ref:c,...ve,width:t??l??ve.width,height:t??l??ve.height,stroke:e??f,strokeWidth:m,className:me(`lucide`,p,i),...!a&&!ye(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,E.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ce=(e,t)=>{let n=(0,E.forwardRef)(({className:n,...r},i)=>(0,E.createElement)(Se,{ref:i,iconNode:t,className:me(`lucide-${he(_e(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_e(e),n},we=Ce(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Te=Ce(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ee=n(t(),1),D=g();function De({project:e,onOpen:t,onRemove:n}){let[r,i]=(0,E.useState)(!1);return(0,D.jsxs)(`div`,{className:`relative bg-surface border border-border rounded-lg overflow-hidden cursor-pointer transition-all duration-150 hover:border-accent hover:-translate-y-0.5`,onClick:()=>t(e),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[(0,D.jsx)(`div`,{className:`h-20 bg-surface-thumb`}),(0,D.jsxs)(`div`,{className:`p-3`,children:[(0,D.jsx)(`div`,{className:`text-sm font-medium text-text-white mb-1 truncate`,title:e.name,children:e.name}),(0,D.jsx)(`div`,{className:`text-[11px] text-text-secondary truncate`,title:e.path,children:e.path}),(0,D.jsx)(`div`,{className:`text-[11px] text-text-dim mt-1.5`,children:v(e.lastOpened)})]}),r&&(0,D.jsx)(T,{variant:`danger`,size:`icon-sm`,className:`absolute top-1.5 right-1.5 w-5 h-5 rounded-full bg-overlay text-text-secondary leading-none hover:text-status-error hover:bg-danger-bg`,onClick:t=>{t.stopPropagation(),n(e)},title:`移除`,children:`×`})]})}function Oe({projects:e,onAdd:t,onOpen:n,onRemove:r}){let[i,a]=(0,E.useState)(``),o=(0,E.useMemo)(()=>{if(!i.trim())return e;let t=i.trim().toLowerCase();return e.filter(e=>(e.name||``).toLowerCase().includes(t)||(e.path||``).toLowerCase().includes(t))},[e,i]);return(0,D.jsx)(`div`,{className:`flex flex-col h-screen bg-bg`,children:(0,D.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between mb-6 gap-4`,children:[(0,D.jsx)(`div`,{className:`flex items-center flex-1 max-w-xs min-w-0`,children:(0,D.jsxs)(`div`,{className:`relative w-full`,children:[(0,D.jsx)(we,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`}),(0,D.jsx)(y,{placeholder:`搜索`,value:i,onChange:e=>a(e.target.value),className:`w-full h-8 pl-8 pr-3 rounded-md text-sm`})]})}),(0,D.jsx)(T,{variant:`ghost`,size:`sm`,onClick:t,className:`shrink-0 text-accent hover:text-accent-hover hover:bg-transparent`,children:`导入`})]}),e.length>0?o.length>0?(0,D.jsx)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`},children:o.map(e=>(0,D.jsx)(De,{project:e,onOpen:n,onRemove:r},e.path))}):(0,D.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-72 text-text-dim gap-3`,children:[(0,D.jsx)(`span`,{className:`text-5xl opacity-40`,children:`🔍`}),(0,D.jsx)(`span`,{className:`text-sm`,children:`未找到匹配的项目`})]}):(0,D.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-72 text-text-dim gap-3`,children:[(0,D.jsx)(`span`,{className:`text-5xl opacity-40`,children:`📁`}),(0,D.jsx)(`span`,{className:`text-sm`,children:`暂无项目,点击「导入」添加`})]})]})})}function ke(){return p(i.GetBranding)}function Ae(){return c(i.GetPreloadPath)}function je(){return c(a.List)}function Me(){return p(f.OpenDirectory)}function Ne(e){return c(a.Add,e)}function Pe(e){return p(a.Remove,e)}function Fe(e){return c(m.Open,e)}function Ie(e){return c(m.GetPages,e)}function Le(e){return c(m.GetCompileConfig,e)}function Re(e,t){return c(m.SaveCompileConfig,e,t)}function ze(e){return d(m.Status,t=>e(t))}var Be={selected:`simulator`,simulatorVisible:!0};function Ve(e){return e+48}function He(e,t){return Math.max(200,Math.min(t-200,e))}function O(e){return e.current}function Ue(e){let{initialDevice:t,simulatorRef:n}=e,[r,i]=(0,E.useState)(t),[a,o]=(0,E.useState)(100),[s,c]=(0,E.useState)(()=>Ve(t.width)),l=(0,E.useRef)(null),u=(0,E.useRef)(s),d=(0,E.useRef)(s),f=(0,E.useRef)(r);(0,E.useEffect)(()=>{u.current=s,d.current=s},[s]),(0,E.useEffect)(()=>{f.current=r},[r]),(0,E.useEffect)(()=>()=>{l.current!==null&&window.cancelAnimationFrame(l.current)},[]);let p=(0,E.useCallback)(e=>{u.current=e,l.current===null&&(l.current=window.requestAnimationFrame(()=>{l.current=null,ie(u.current)}))},[]),m=(0,E.useCallback)(e=>{let t=O(n);try{t?.send?.(`device:change`,{brand:`Apple`,model:e.name,pixelRatio:e.pixelRatio,screenWidth:e.width,screenHeight:e.height,statusBarHeight:e.statusBarHeight,system:e.system,platform:`ios`,safeAreaBottom:e.safeAreaBottom})}catch{}},[n]);return{device:r,zoom:a,simPanelWidth:s,setSimPanelWidth:c,handleDeviceChange:(0,E.useCallback)(e=>{let t=pe.find(t=>t.name===e.target.value)??pe[1];i(t),m(t);let n=Ve(t.width);c(n),p(n)},[p,m]),handleZoomChange:(0,E.useCallback)(e=>{o(Number(e.target.value))},[]),handleSplitterDrag:(0,E.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=d.current,r=e=>{let r=He(n+e.clientX-t,window.innerWidth);c(r),p(r)},i=()=>{window.removeEventListener(`mousemove`,r),window.removeEventListener(`mouseup`,i)};window.addEventListener(`mousemove`,r),window.addEventListener(`mouseup`,i)},[p]),sendDeviceInfo:m,simPanelWidthRef:d,deviceRef:f,scheduleResize:p}}function We(e,t,n,r){let i=t.startPage||`pages/index/index`,a=(t.queryParams||[]).filter(e=>e.key).map(e=>`${encodeURIComponent(e.key)}=${encodeURIComponent(e.value)}`);return a.push(`scene=${t.scene||1001}`),`http://localhost:${n}/simulator.html${r?.length?`?apiNamespaces=${r.join(`,`)}`:``}#${e}|${i}?${a.join(`&`)}`}function Ge(e){let t=e.split(`#`)[1];if(!t)return``;let n=t.indexOf(`|`);return n===-1?t.split(`?`)[0].split(`/`).slice(1).join(`/`):t.slice(n+1).split(`?`)[0]}function Ke(e){let[t,n]=e.split(`#`);if(!n)return e;let[r,i]=n.split(`?`),a=r.split(`|`);return a.length<=2?e:`${t}#${`${a[0]}|${a[a.length-1]}`}${i?`?${i}`:``}`}function qe(e){let{projectPath:t,simulatorRef:n}=e,[r,i]=(0,E.useState)({status:`compiling`,message:`正在编译...`}),[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)([]),[l,u]=(0,E.useState)(0),[d,f]=(0,E.useState)({startPage:``,scene:ae,queryParams:[]}),[p,m]=(0,E.useState)(``);(0,E.useEffect)(()=>{let e=!1;async function n(){try{let n=await Fe(t);if(e)return;if(!n.success){i({status:`error`,message:n.error});return}let[r,a]=await Promise.all([Ie(t),Le(t)]);if(e)return;o(n.appInfo),u(n.port),c(r.pages),f({startPage:a.startPage||r.entryPagePath||r.pages[0]||``,scene:a.scene??1001,queryParams:a.queryParams||[]}),i({status:`ready`,message:`编译完成`})}catch(t){if(e)return;i({status:`error`,message:t instanceof Error?t.message:String(t)})}}return n(),()=>{e=!0}},[t]),(0,E.useEffect)(()=>{Ae().then(m)},[]),(0,E.useEffect)(()=>ze(e=>{if(i(e),e.hotReload){let e=O(n);if(!e)return;let t=e.getURL?.()??``,r=Ke(t);r===t?e.reload?.():(e.loadURL?.(r),setTimeout(()=>e.reload?.(),100))}}),[n]);let h=(0,E.useRef)(!1),g=(0,E.useRef)(null);return(0,E.useEffect)(()=>()=>{g.current?.()},[]),{compileStatus:r,appInfo:a,port:l,pages:s,compileConfig:d,preloadPath:p,relaunch:(0,E.useCallback)(async(e=d)=>{try{if(!a?.appId||h.current)return;let r=O(n);if(!r)return;g.current?.(),g.current=null,h.current=!0,await Re(t,e),i({status:`ready`,message:`正在刷新...`});let o=We(a.appId,e,l),s=r.getURL?.(),c=!1,u=null,d=(t,n)=>{c||(c=!0,h.current=!1,g.current=null,u&&clearTimeout(u),r.removeEventListener?.(`did-finish-load`,p),r.removeEventListener?.(`did-stop-loading`,p),r.removeEventListener?.(`did-fail-load`,m),f(e),i({status:t,message:n}))},p=()=>{let e=r.getURL?.()??``,t=o.split(`#`)[1]??``,n=e.split(`#`)[1]??``;t&&n!==t||d(`ready`,`刷新完成`)},m=e=>{e.errorCode!==-3&&d(`error`,`刷新失败`)};r.addEventListener?.(`did-finish-load`,p),r.addEventListener?.(`did-stop-loading`,p),r.addEventListener?.(`did-fail-load`,m),g.current=()=>d(`error`,`已取消`),u=setTimeout(()=>{d(`error`,`刷新超时`)},3e4),s===o?r.reload?.():(r.loadURL?.(o),setTimeout(()=>r.reload?.(),100))}catch(e){h.current=!1,i({status:`error`,message:e instanceof Error?e.message:`刷新失败`})}},[a,d,l,t,n])}}function Je(e){let{compileStatus:t,sendDeviceInfo:n,simulatorRef:r,simPanelWidthRef:i,deviceRef:a,appInfo:o,compileConfig:s,port:c}=e,l=(0,E.useMemo)(()=>!o||!c?``:We(o.appId,s,c),[o,s,c]),[u,d]=(0,E.useState)(()=>Ge(l));return(0,E.useEffect)(()=>{d(Ge(l))},[l]),(0,E.useEffect)(()=>{if(t.status!==`ready`)return;let e=O(r);if(!e){n(a.current);return}let o=!1,s=!1,c=null,u=0,f=t=>{let n=t;if(!n)try{n=e.getURL?.()}catch{}d(Ge(n??l))},p=()=>{if(o||s)return;if(u++,u>50){console.warn(`[simulator] Max attach retries exceeded, giving up`),c!==null&&(window.clearInterval(c),c=null);return}let t;try{t=e.getWebContentsId?.()}catch{return}t&&(s=!0,c!==null&&(window.clearInterval(c),c=null),ce(t,i.current),n(a.current),f())},m=e=>{f(e.url)},h=()=>{o||(f(),n(a.current),p())};return e.addEventListener?.(`did-navigate`,m),e.addEventListener?.(`did-navigate-in-page`,m),e.addEventListener?.(`dom-ready`,h),e.addEventListener?.(`did-finish-load`,h),c=window.setInterval(p,200),p(),()=>{o=!0,c!==null&&window.clearInterval(c),e.removeEventListener?.(`did-navigate`,m),e.removeEventListener?.(`did-navigate-in-page`,m),e.removeEventListener?.(`dom-ready`,h),e.removeEventListener?.(`did-finish-load`,h)}},[t.status,n,l,r,i,a]),{simulatorUrl:l,currentPage:u}}var Ye={bridges:[],activeBridgeId:null,entries:{}};function Xe(e){let{compileStatus:t,simulatorRef:n}=e,[r,i]=(0,E.useState)(!0),[a,c]=(0,E.useState)(null),[f,m]=(0,E.useState)(Ye),[h,g]=(0,E.useState)([]),_=(0,E.useCallback)(e=>{m(t=>t.bridges.some(t=>t.id===e)&&t.activeBridgeId!==e?{...t,activeBridgeId:e}:t)},[]);(0,E.useEffect)(()=>{if(t.status!==`ready`)return;let e=e=>{let{channel:t,args:n}=e;if(t===u.Wxml)c(n[0]);else if(t===u.AppData){let e=n[0];if(!e.bridgeId||!e.moduleId)return;let{bridgeId:t,moduleId:r,componentPath:i,data:a}=e,o=i||r;m(e=>{let n=e.bridges.find(e=>e.id===t),s=r.startsWith(`page_`)&&!!i,c=s?i??null:n?.pagePath??null,l=n?e.bridges.map(e=>e.id===t?{...e,pagePath:c}:e):[...e.bridges,{id:t,pagePath:c}],u={...e.entries[t]??{},[o]:a},d={...e.entries,[t]:u};return{bridges:l,activeBridgeId:s||e.activeBridgeId===null?t:e.activeBridgeId,entries:d}})}else if(t===u.AppDataAll){let e=n[0],t=e?.bridges??[],r=e?.entries??{};m(e=>({bridges:t,activeBridgeId:e.activeBridgeId&&t.some(t=>t.id===e.activeBridgeId)?e.activeBridgeId:t.at(-1)?.id??null,entries:r}))}},r=()=>i(!1),a=()=>i(!0),o=null,s=null,l=0,d=()=>{if(o)return;let t=O(n);if(!t){l+=1,l>=50&&s!==null&&(window.clearInterval(s),s=null);return}o=t,s!==null&&(window.clearInterval(s),s=null),i(!0),t.addEventListener(`ipc-message`,e),t.addEventListener(`crashed`,r),t.addEventListener(`did-start-loading`,a)};return d(),o||(s=window.setInterval(d,200)),()=>{s!==null&&(window.clearInterval(s),s=null),o&&(o.removeEventListener(`ipc-message`,e),o.removeEventListener(`crashed`,r),o.removeEventListener(`did-start-loading`,a))}},[t.status,n]),(0,E.useEffect)(()=>se(()=>{i(!0),c(null),m(Ye),g([])}),[]);let v=(0,E.useCallback)(()=>{O(n)?.send?.(l.WxmlRefreshRequest)},[n]),y=(0,E.useCallback)(()=>{O(n)?.send?.(l.AppDataGetAllRequest)},[n]),b=(0,E.useCallback)(async()=>{let e=await p(o.GetSnapshot);e&&g(e)},[]),x=(0,E.useCallback)(async(e,t)=>await p(o.Set,{key:e,value:t})??{ok:!1,error:`ipc transport failed`},[]),S=(0,E.useCallback)(async e=>await p(o.Remove,{key:e})??{ok:!1,error:`ipc transport failed`},[]),C=(0,E.useCallback)(async()=>await p(o.Clear)??{ok:!1,error:`ipc transport failed`},[]),ee=(0,E.useCallback)(async()=>await p(o.ClearAll)??{ok:!1,error:`ipc transport failed`},[]),w=(0,E.useCallback)(async()=>await p(o.GetActivePrefix)??``,[]),te=(0,E.useCallback)(async e=>await p(s.Inspect,e),[]),ne=(0,E.useCallback)(async()=>{await p(s.Clear)},[]);return(0,E.useEffect)(()=>d(o.Event,e=>{e.type===`cleared`?g([]):e.type===`added`||e.type===`updated`?g(t=>{let n=t.findIndex(t=>t.key===e.key),r=n>=0?[...t]:[...t,{key:e.key,value:e.newValue}];return n>=0&&(r[n]={key:e.key,value:e.newValue}),r}):e.type===`removed`&&g(t=>t.filter(t=>t.key!==e.key))}),[]),{connected:r,wxmlTree:a,appData:f,storageItems:h,refreshWxml:v,refreshAppData:y,setActiveAppDataBridge:_,refreshStorage:b,setStorageItem:x,removeStorageItem:S,clearStorage:C,clearAllStorage:ee,getStoragePrefix:w,inspectWxmlElement:te,clearWxmlElementInspection:ne}}function Ze(e){let{initialRightPane:t,simPanelWidthRef:n}=e,[r,i]=(0,E.useState)(t),a=(0,E.useCallback)((e,t)=>{if(e.selected===`simulator`){if(e.simulatorVisible){ne();return}te(!1,t);return}te(!1,t)},[]);return{rightPane:r,selectRightPane:(0,E.useCallback)(e=>{let t={selected:e,simulatorVisible:!0};i(t),a(t,n.current)},[a,n]),toggleRightPaneVisible:(0,E.useCallback)(()=>{i(e=>{let t={...e,simulatorVisible:!e.simulatorVisible};return a(t,n.current),t})},[a,n])}}function Qe(e){let{relaunch:t,compileConfig:n,pages:r,compileDropdownRef:i}=e,[a,o]=(0,E.useState)(!1),s=(0,E.useRef)(t);(0,E.useEffect)(()=>{s.current=t},[t]),(0,E.useEffect)(()=>{let e=C(()=>o(!1)),t=de(e=>{o(!1),s.current(e)});return()=>{e(),t()}},[]);let c=(0,E.useRef)(n),l=(0,E.useRef)(r);return(0,E.useEffect)(()=>{c.current=n},[n]),(0,E.useEffect)(()=>{l.current=r},[r]),{showCompilePanel:a,toggleCompilePanel:(0,E.useCallback)(()=>{o(e=>{if(e)return x(),!1;let t=i.current;if(!t)return e;let n=t.getBoundingClientRect();return b({top:Math.round(n.bottom-40+6),left:Math.round(n.left),config:c.current,pages:l.current}),!0})},[i])}}function $e(e){let{projectPath:t,initialDevice:n=pe[1],initialRightPane:r=Be}=e,i=(0,E.useRef)(null),a=(0,E.useRef)(null),o=Ue({initialDevice:n,simulatorRef:i}),s=qe({projectPath:t,simulatorRef:i});(0,E.useEffect)(()=>{s.compileStatus.status===`ready`&&o.setSimPanelWidth(o.device.width+48)},[o.device.width,s.compileStatus.status,o.setSimPanelWidth]);let c=Je({compileStatus:s.compileStatus,sendDeviceInfo:o.sendDeviceInfo,simulatorRef:i,simPanelWidthRef:o.simPanelWidthRef,deviceRef:o.deviceRef,appInfo:s.appInfo,compileConfig:s.compileConfig,port:s.port}),l=Xe({compileStatus:s.compileStatus,simulatorRef:i}),u=Ze({initialRightPane:r,simPanelWidthRef:o.simPanelWidthRef}),d=Qe({relaunch:s.relaunch,compileConfig:s.compileConfig,pages:s.pages,compileDropdownRef:a});return{session:{compileStatus:s.compileStatus,appInfo:s.appInfo,port:s.port,pages:s.pages,compileConfig:s.compileConfig,preloadPath:s.preloadPath,relaunch:s.relaunch},device:{device:o.device,zoom:o.zoom,simPanelWidth:o.simPanelWidth,setSimPanelWidth:o.setSimPanelWidth,handleDeviceChange:o.handleDeviceChange,handleZoomChange:o.handleZoomChange,handleSplitterDrag:o.handleSplitterDrag,sendDeviceInfo:o.sendDeviceInfo},simulator:{simulatorRef:i,simulatorUrl:c.simulatorUrl,currentPage:c.currentPage},panelData:{connected:l.connected,wxmlTree:l.wxmlTree,appData:l.appData,storageItems:l.storageItems,refreshWxml:l.refreshWxml,refreshAppData:l.refreshAppData,setActiveAppDataBridge:l.setActiveAppDataBridge,refreshStorage:l.refreshStorage,setStorageItem:l.setStorageItem,removeStorageItem:l.removeStorageItem,clearStorage:l.clearStorage,clearAllStorage:l.clearAllStorage,getStoragePrefix:l.getStoragePrefix,inspectWxmlElement:l.inspectWxmlElement,clearWxmlElementInspection:l.clearWxmlElementInspection},rightPane:{rightPane:u.rightPane,selectRightPane:u.selectRightPane,toggleRightPaneVisible:u.toggleRightPaneVisible},popover:{compileDropdownRef:a,showCompilePanel:d.showCompilePanel,toggleCompilePanel:d.toggleCompilePanel}}}typeof window<`u`&&window.document&&window.document.createElement;function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function et(e,t){let n=E.createContext(t),r=e=>{let{children:t,...r}=e,i=E.useMemo(()=>r,Object.values(r));return(0,D.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=E.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function tt(e,t=[]){let n=[];function r(t,r){let i=E.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=E.useMemo(()=>o,Object.values(o));return(0,D.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=E.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>E.createContext(e));return function(n){let r=n?.[e]||t;return E.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,nt(i,...t)]}function nt(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function rt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function it(...e){return t=>{let n=!1,r=e.map(e=>{let r=rt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():rt(e[t],null)}}}}function A(...e){return E.useCallback(it(...e),e)}function at(e){let t=ot(e),n=E.forwardRef((e,n)=>{let{children:r,...i}=e,a=E.Children.toArray(r),o=a.find(ct);if(o){let e=o.props.children,r=a.map(t=>t===o?E.Children.count(e)>1?E.Children.only(null):E.isValidElement(e)?e.props.children:null:t);return(0,D.jsx)(t,{...i,ref:n,children:E.isValidElement(e)?E.cloneElement(e,void 0,r):null})}return(0,D.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function ot(e){let t=E.forwardRef((e,t)=>{let{children:n,...r}=e;if(E.isValidElement(n)){let e=ut(n),i=lt(r,n.props);return n.type!==E.Fragment&&(i.ref=t?it(t,e):e),E.cloneElement(n,i)}return E.Children.count(n)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var st=Symbol(`radix.slottable`);function ct(e){return E.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===st}function lt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function ut(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function dt(e){let t=e+`CollectionProvider`,[n,r]=tt(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=E.useRef(null),a=E.useRef(new Map).current;return(0,D.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=at(s),l=E.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,D.jsx)(c,{ref:A(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=at(u),p=E.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=E.useRef(null),s=A(t,o),c=a(u,n);return E.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,D.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return E.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var j=globalThis?.document?E.useLayoutEffect:()=>{},ft=E.useId||(()=>void 0),pt=0;function M(e){let[t,n]=E.useState(ft());return j(()=>{e||n(e=>e??String(pt++))},[e]),e||(t?`radix-${t}`:``)}var mt=n(e(),1),N=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=at(`Primitive.${t}`),r=E.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,D.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ht(e,t){e&&mt.flushSync(()=>e.dispatchEvent(t))}function P(e){let t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...e)=>t.current?.(...e),[])}var gt=E.useInsertionEffect||j;function _t({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=vt({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=E.useRef(e!==void 0);E.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,E.useCallback(t=>{if(s){let n=yt(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function vt({defaultProp:e,onChange:t}){let[n,r]=E.useState(e),i=E.useRef(n),a=E.useRef(t);return gt(()=>{a.current=t},[t]),E.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function yt(e){return typeof e==`function`}var bt=E.createContext(void 0);function xt(e){let t=E.useContext(bt);return e||t||`ltr`}var St=`rovingFocusGroup.onEntryFocus`,Ct={bubbles:!1,cancelable:!0},wt=`RovingFocusGroup`,[Tt,Et,Dt]=dt(wt),[Ot,kt]=tt(wt,[Dt]),[At,jt]=Ot(wt),Mt=E.forwardRef((e,t)=>(0,D.jsx)(Tt.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Tt.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Nt,{...e,ref:t})})}));Mt.displayName=wt;var Nt=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=E.useRef(null),p=A(t,f),m=xt(a),[h,g]=_t({prop:o,defaultProp:s??null,onChange:c,caller:wt}),[_,v]=E.useState(!1),y=P(l),b=Et(n),x=E.useRef(!1),[S,C]=E.useState(0);return E.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(St,y),()=>e.removeEventListener(St,y)},[y]),(0,D.jsx)(At,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:E.useCallback(e=>g(e),[g]),onItemShiftTab:E.useCallback(()=>v(!0),[]),onFocusableItemAdd:E.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:E.useCallback(()=>C(e=>e-1),[]),children:(0,D.jsx)(N.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:k(e.onMouseDown,()=>{x.current=!0}),onFocus:k(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(St,Ct);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);zt([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:k(e.onBlur,()=>v(!1))})})}),Pt=`RovingFocusGroupItem`,Ft=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=M(),l=a||c,u=jt(Pt,n),d=u.currentTabStopId===l,f=Et(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return E.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,D.jsx)(Tt.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,D.jsx)(N.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:k(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:k(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:k(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Rt(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Bt(n,r+1):n.slice(r+1)}setTimeout(()=>zt(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});Ft.displayName=Pt;var It={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Lt(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Rt(e,t,n){let r=Lt(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return It[r]}function zt(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Bt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Vt=Mt,Ht=Ft;function Ut(e,t){return E.useReducer((e,n)=>t[e][n]??e,e)}var Wt=e=>{let{present:t,children:n}=e,r=Gt(t),i=typeof n==`function`?n({present:r.isPresent}):E.Children.only(n),a=A(r.ref,qt(i));return typeof n==`function`||r.isPresent?E.cloneElement(i,{ref:a}):null};Wt.displayName=`Presence`;function Gt(e){let[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),a=E.useRef(`none`),[o,s]=Ut(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return E.useEffect(()=>{let e=Kt(r.current);a.current=o===`mounted`?e:`none`},[o]),j(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Kt(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),j(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Kt(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Kt(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:E.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Kt(e){return e?.animationName||`none`}function qt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jt=`Tabs`,[Yt,Xt]=tt(Jt,[kt]),Zt=kt(),[Qt,$t]=Yt(Jt),en=E.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=xt(s),[d,f]=_t({prop:r,onChange:i,defaultProp:a??``,caller:Jt});return(0,D.jsx)(Qt,{scope:n,baseId:M(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,D.jsx)(N.div,{dir:u,"data-orientation":o,...l,ref:t})})});en.displayName=Jt;var tn=`TabsList`,nn=E.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=$t(tn,n),o=Zt(n);return(0,D.jsx)(Vt,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,D.jsx)(N.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});nn.displayName=tn;var rn=`TabsTrigger`,an=E.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=$t(rn,n),s=Zt(n),c=cn(o.baseId,r),l=ln(o.baseId,r),u=r===o.value;return(0,D.jsx)(Ht,{asChild:!0,...s,focusable:!i,active:u,children:(0,D.jsx)(N.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:k(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:k(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:k(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});an.displayName=rn;var on=`TabsContent`,sn=E.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=$t(on,n),c=cn(s.baseId,r),l=ln(s.baseId,r),u=r===s.value,d=E.useRef(u);return E.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,D.jsx)(Wt,{present:i||u,children:({present:n})=>(0,D.jsx)(N.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});sn.displayName=on;function cn(e,t){return`${e}-trigger-${t}`}function ln(e,t){return`${e}-content-${t}`}var un=en,dn=nn,fn=an,pn=sn,mn=un,hn=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(dn,{ref:n,className:_(`inline-flex h-7 items-center justify-center rounded-md bg-surface-2 p-1 text-text-muted`,e),...t}));hn.displayName=dn.displayName;var gn=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(fn,{ref:n,className:_(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-bg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-surface-selected data-[state=active]:text-text data-[state=active]:shadow-sm`,e),...t}));gn.displayName=fn.displayName;var _n=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(pn,{ref:n,className:_(`mt-2 ring-offset-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2`,e),...t}));_n.displayName=pn.displayName;var vn={compiling:`bg-status-warn animate-[pulse_1s_infinite]`,ready:`bg-accent`,error:`bg-status-error`};function yn({status:e}){return(0,D.jsx)(`span`,{className:_(`w-1.5 h-1.5 rounded-full shrink-0`,vn[e]??`bg-border`)})}function bn({compileDropdownRef:e,showCompilePanel:t,onToggleCompilePanel:n,onRelaunch:r,compileStatus:i,rightPane:a,onToggleRightPaneVisible:o,onSelectRightPane:s}){let[c,l]=(0,E.useState)([]),[u,d]=(0,E.useState)([]),f=()=>{re().then(e=>{l(Array.isArray(e)?e:[])}).catch(e=>{console.debug(`[toolbar] getActions not available`,e)})};return(0,E.useEffect)(()=>(f(),le().then(e=>{e?.length&&d(e)}).catch(e=>{console.warn(`[toolbar] panel:list failed`,e)}),ee(()=>f())),[]),(0,D.jsxs)(`div`,{className:`flex flex-col shrink-0`,children:[c.length>0&&(0,D.jsx)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1 bg-surface-2 border-b border-border`,children:c.map(e=>(0,D.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>oe(e.id),disabled:i.status===`compiling`,children:e.label},e.id))}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 bg-surface-2 border-b border-border shrink-0`,style:{height:40},children:[(0,D.jsx)(`div`,{ref:e,children:(0,D.jsxs)(T,{variant:`outline`,size:`sm`,onClick:n,className:_(t&&`border-accent`),children:[`普通编译 `,(0,D.jsx)(`span`,{className:`text-[10px] text-text-secondary`,children:`▾`})]})}),(0,D.jsx)(T,{variant:`icon`,size:`icon`,onClick:()=>{r()},disabled:i.status===`compiling`,title:`重新编译`,children:`↺`}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1.5 shrink-0`,children:[(0,D.jsx)(yn,{status:i.status}),(0,D.jsx)(`span`,{className:`text-[11px] text-text-muted max-w-28 truncate`,children:i.message})]}),(0,D.jsx)(`div`,{className:`flex-1 min-w-2`}),u.length>0&&(0,D.jsx)(mn,{value:a.selected,onValueChange:e=>s(e),children:(0,D.jsxs)(hn,{className:`h-auto gap-px bg-bg border border-border p-0`,children:[(0,D.jsx)(gn,{value:`simulator`,className:`px-2 py-0.5 text-[11px] rounded-none data-[state=active]:shadow-none`,children:`DevTools`}),u.map(e=>(0,D.jsx)(gn,{value:e.id,className:`px-2 py-0.5 text-[11px] rounded-none data-[state=active]:shadow-none`,children:e.label},e.id))]})}),(0,D.jsx)(T,{variant:`icon`,size:`icon`,onClick:o,title:a.simulatorVisible?`隐藏面板`:`显示面板`,className:`text-base`,children:a.simulatorVisible?`⊟`:`⊞`})]})]})}function xn({simPanelWidth:e,device:t,zoom:n,onDeviceChange:r,onZoomChange:i,compileStatus:a,preloadPath:o,simulatorUrl:s,simulatorRef:c,currentPage:l,copied:u,onCopyPagePath:d}){let f=n/100;return(0,D.jsxs)(`div`,{className:`bg-sim-bg flex flex-col overflow-hidden shrink-0`,style:{width:e,minWidth:e},children:[(0,D.jsxs)(`div`,{className:`flex-1 overflow-auto flex items-start justify-center p-5`,children:[a.status===`compiling`&&!o&&(0,D.jsx)(`div`,{className:`flex items-center justify-center min-h-48 w-full text-text-dim text-[13px]`,children:`正在编译中...`}),a.status===`error`&&!s&&(0,D.jsxs)(`div`,{className:`flex flex-col items-center justify-center min-h-48 w-full text-status-error text-[13px] gap-2 p-4`,children:[(0,D.jsx)(`span`,{children:`编译失败`}),(0,D.jsx)(`small`,{className:`text-status-error text-[11px]`,children:a.message})]}),(a.status===`ready`||s)&&(0,D.jsxs)(`div`,{className:`flex flex-col items-center gap-6`,children:[(0,D.jsx)(`div`,{className:`shrink-0 overflow-visible`,style:{borderRadius:44,boxShadow:`0 0 0 8px var(--color-phone-shell), 0 0 0 10px var(--color-phone-border), 0 24px 60px var(--color-overlay-heavy)`,background:`var(--color-phone-shell)`,width:Math.round(t.width*f),height:Math.round(t.height*f)},children:(0,D.jsx)(`div`,{className:`bg-black relative overflow-hidden shrink-0`,style:{borderRadius:36,width:t.width,height:t.height,transform:`scale(${f})`,transformOrigin:`top left`},children:o&&s&&(0,D.jsx)(`webview`,{ref:c,src:s,partition:`persist:simulator`,allowpopups:``,style:{display:`flex`,flexDirection:`column`,width:t.width,height:t.height}})})}),a.status===`compiling`&&s&&(0,D.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/50 rounded-[36px] z-10`,children:(0,D.jsx)(`div`,{className:`text-text-dim text-[13px]`,children:`正在编译中...`})}),a.status===`error`&&s&&(0,D.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/70 rounded-[36px] z-10`,children:(0,D.jsxs)(`div`,{className:`text-center p-4`,children:[(0,D.jsx)(`div`,{className:`text-status-error text-[14px] font-medium mb-2`,children:`编译失败`}),(0,D.jsx)(`div`,{className:`text-status-error text-[11px] max-w-[280px] break-words`,children:a.message})]})}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(ue,{value:t.name,onChange:r,children:pe.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,D.jsx)(ue,{value:n,onChange:i,className:`max-w-16`,children:S.map(e=>(0,D.jsxs)(`option`,{value:e,children:[e,`%`]},e))})]})]})]}),(0,D.jsx)(`div`,{className:`flex items-center px-2.5 bg-sim-bottom border-t border-border-subtle shrink-0 h-[30px] min-w-0`,children:(0,D.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,D.jsx)(`span`,{className:`text-[11px] text-text-dim truncate min-w-0`,children:l||`—`}),l&&(0,D.jsx)(`button`,{className:_(`shrink-0 flex items-center justify-center w-4 h-4 rounded transition-colors`,u?`text-accent`:`text-text-dim hover:text-text`),onClick:d,title:`复制路径`,children:u?(0,D.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,children:(0,D.jsx)(`polyline`,{points:`1.5,5 4,7.5 8.5,2.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}):(0,D.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,children:[(0,D.jsx)(`rect`,{x:`1`,y:`3`,width:`6`,height:`6.5`,rx:`1`,stroke:`currentColor`,strokeWidth:`1`}),(0,D.jsx)(`path`,{d:`M3 3V2a1 1 0 011-1h4a1 1 0 011 1v5a1 1 0 01-1 1H7`,stroke:`currentColor`,strokeWidth:`1`})]})})]})})]})}function Sn(e){return!!(e.tagName===`#shadow-root`||e.tagName.includes(`/`))}function Cn({node:e,depth:t,inspectedSid:n,onInspect:r}){let[i,a]=(0,E.useState)(()=>Sn(e)),o=t*16,s=!!(e.sid&&e.sid===n),c=`py-px leading-[18px] hover:bg-surface-2${s?` bg-surface-2`:``}`,l=()=>{e.sid&&r?.(e)};if(e.tagName===`#text`)return(0,D.jsxs)(`div`,{className:`py-px leading-[18px] hover:bg-surface-2`,style:{paddingLeft:o},children:[(0,D.jsx)(`span`,{className:`w-3 inline-block`}),(0,D.jsx)(`span`,{className:`text-text`,children:e.text})]});if(e.tagName===`#fragment`)return(0,D.jsx)(D.Fragment,{children:(e.children??[]).map((e,i)=>(0,D.jsx)(Cn,{node:e,depth:t,inspectedSid:n,onInspect:r},i))});if(e.tagName===`#shadow-root`){let s=(e.children??[]).length>0;return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`py-px leading-[18px] hover:bg-surface-2 cursor-pointer`,style:{paddingLeft:o},onClick:()=>s&&a(!i),children:[(0,D.jsx)(`span`,{className:`text-text-dim w-3 shrink-0 inline-block text-center select-none`,children:s?i?`▾`:`▸`:` `}),(0,D.jsx)(`span`,{className:`text-text-dim italic`,children:`#shadow-root`})]}),i&&e.children.map((e,i)=>(0,D.jsx)(Cn,{node:e,depth:t+1,inspectedSid:n,onInspect:r},i))]})}let u=(e.children??[]).length>0,d=Object.entries(e.attrs),f=u&&e.children.length===1&&e.children[0].tagName===`#text`?e.children[0].text:null;return f?(0,D.jsxs)(`div`,{className:c,style:{paddingLeft:o},onMouseEnter:l,"data-wxml-sid":e.sid,children:[(0,D.jsx)(`span`,{className:`w-3 inline-block`}),(0,D.jsxs)(`span`,{className:`text-code-keyword`,children:[`<`,e.tagName]}),d.map(([e,t])=>(0,D.jsxs)(`span`,{children:[` `,(0,D.jsx)(`span`,{className:`text-code-blue`,children:e}),(0,D.jsx)(`span`,{className:`text-text-dim`,children:`=`}),(0,D.jsxs)(`span`,{className:`text-code-orange`,children:[`"`,t,`"`]})]},e)),(0,D.jsx)(`span`,{className:`text-code-keyword`,children:`>`}),(0,D.jsx)(`span`,{className:`text-text`,children:f}),(0,D.jsxs)(`span`,{className:`text-code-keyword`,children:[`</`,e.tagName,`>`]})]}):(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-start hover:bg-surface-2 py-px leading-[18px]${u?` cursor-pointer`:``}${s?` bg-surface-2`:``}`,style:{paddingLeft:o},onMouseEnter:l,onClick:()=>{u&&a(!i)},"data-wxml-sid":e.sid,children:[(0,D.jsx)(`span`,{className:`text-text-dim w-3 shrink-0 text-center select-none`,children:u?i?`▾`:`▸`:` `}),(0,D.jsxs)(`span`,{children:[(0,D.jsxs)(`span`,{className:`text-code-keyword`,children:[`<`,e.tagName]}),d.map(([e,t])=>(0,D.jsxs)(`span`,{children:[` `,(0,D.jsx)(`span`,{className:`text-code-blue`,children:e}),(0,D.jsx)(`span`,{className:`text-text-dim`,children:`=`}),(0,D.jsxs)(`span`,{className:`text-code-orange`,children:[`"`,t,`"`]})]},e)),(0,D.jsx)(`span`,{className:`text-code-keyword`,children:u?`>`:` />`})]})]}),i&&u&&(0,D.jsxs)(D.Fragment,{children:[e.children.map((e,i)=>(0,D.jsx)(Cn,{node:e,depth:t+1,inspectedSid:n,onInspect:r},i)),(0,D.jsxs)(`div`,{style:{paddingLeft:o},className:`py-px leading-[18px]`,children:[(0,D.jsx)(`span`,{className:`w-3 inline-block`}),(0,D.jsxs)(`span`,{className:`text-code-keyword`,children:[`</`,e.tagName,`>`]})]})]})]})}function wn({inspection:e}){if(!e)return null;let{rect:t,style:n}=e,r=[n.display,n.position===`static`?null:n.position,n.boxSizing].filter(Boolean);return(0,D.jsxs)(`div`,{className:`border-t border-border-subtle bg-bg-panel px-2.5 py-1.5 font-mono text-[11px] text-text-dim shrink-0`,children:[(0,D.jsx)(`span`,{className:`text-text`,children:`box`}),` `,Math.round(t.width),` x `,Math.round(t.height),` @ `,Math.round(t.x),`, `,Math.round(t.y),(0,D.jsx)(`span`,{className:`mx-2 text-border-subtle`,children:`|`}),r.join(` / `),(0,D.jsx)(`span`,{className:`mx-2 text-border-subtle`,children:`|`}),`font `,n.fontSize]})}function Tn({tree:e,onRefresh:t,onInspectElement:n,onClearInspection:r}){let[i,a]=(0,E.useState)(null),o=(0,E.useRef)(0),s=(0,E.useRef)(null);(0,E.useEffect)(()=>()=>{s.current!==null&&cancelAnimationFrame(s.current)},[]);let c=(0,E.useCallback)(e=>{if(!e.sid||!n)return;let t=e.sid;s.current!==null&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{s.current=null;let e=++o.current;n(t).then(t=>{e===o.current&&a(t)}).catch(()=>{e===o.current&&a(null)})})},[n]),l=(0,E.useCallback)(()=>{s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),o.current++,a(null),r?.()},[r]);return e?(0,D.jsxs)(`div`,{className:`flex flex-col flex-1 overflow-hidden`,onMouseLeave:l,"data-testid":`wxml-panel`,children:[(0,D.jsx)(`div`,{className:`flex items-center px-2.5 py-1.5 border-b border-border-subtle shrink-0 bg-bg-panel`,children:(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:t,className:`hover:border-accent hover:text-accent`,children:`↻ 刷新`})}),(0,D.jsx)(`div`,{className:`flex-1 overflow-y-auto p-2 font-mono text-[12px]`,children:(0,D.jsx)(Cn,{node:e,depth:0,inspectedSid:i?.sid??null,onInspect:c})}),(0,D.jsx)(wn,{inspection:i})]}):(0,D.jsxs)(`div`,{className:`flex flex-col flex-1 overflow-hidden`,"data-testid":`wxml-panel`,children:[(0,D.jsx)(`div`,{className:`flex items-center px-2.5 py-1.5 border-b border-border-subtle shrink-0 bg-bg-panel`,children:(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:t,className:`hover:border-accent hover:text-accent`,children:`↻ 刷新`})}),(0,D.jsx)(`div`,{className:`text-[12px] text-text-dim text-center px-4 py-6`,children:`等待小程序加载...`})]})}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F.apply(null,arguments)}function I(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var En={},Dn=(0,E.createContext)(En),On=(e,t)=>F({},e,t),kn=()=>(0,E.useContext)(Dn),An=(0,E.createContext)(()=>{});An.displayName=`JVR.DispatchShowTools`;function jn(){return(0,E.useReducer)(On,En)}function Mn(){return(0,E.useContext)(An)}var Nn=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(Dn.Provider,{value:t,children:(0,D.jsx)(An.Provider,{value:n,children:r})})};Nn.displayName=`JVR.ShowTools`;var Pn={},Fn=(0,E.createContext)(Pn),In=(e,t)=>F({},e,t),Ln=()=>(0,E.useContext)(Fn),Rn=(0,E.createContext)(()=>{});Rn.displayName=`JVR.DispatchExpands`;function zn(){return(0,E.useReducer)(In,Pn)}function Bn(){return(0,E.useContext)(Rn)}var Vn=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(Fn.Provider,{value:t,children:(0,D.jsx)(Rn.Provider,{value:n,children:r})})};Vn.displayName=`JVR.Expands`;var Hn={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},Un=(0,E.createContext)(Hn),Wn=(e,t)=>F({},e,t),L=()=>(0,E.useContext)(Un),Gn=(0,E.createContext)(()=>{});Gn.displayName=`JVR.DispatchTypes`;function Kn(){return(0,E.useReducer)(Wn,Hn)}function qn(){return(0,E.useContext)(Gn)}function Jn(e){var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(Un.Provider,{value:t,children:(0,D.jsx)(Gn.Provider,{value:n,children:r})})}Jn.displayName=`JVR.Types`;var Yn=[`style`];function Xn(e){var{style:t}=e,n=I(e,Yn);return(0,D.jsx)(`svg`,F({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:F({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,D.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}Xn.displayName=`JVR.TriangleArrow`;var Zn={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,D.jsx)(Xn,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},Qn=(0,E.createContext)(Zn),$n=(e,t)=>F({},e,t),R=()=>(0,E.useContext)(Qn),er=(0,E.createContext)(()=>{});er.displayName=`JVR.DispatchSymbols`;function tr(){return(0,E.useReducer)($n,Zn)}function nr(){return(0,E.useContext)(er)}var rr=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(Qn.Provider,{value:t,children:(0,D.jsx)(er.Provider,{value:n,children:r})})};rr.displayName=`JVR.Symbols`;var ir={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},ar=(0,E.createContext)(ir),or=(e,t)=>F({},e,t),z=()=>(0,E.useContext)(ar),sr=(0,E.createContext)(()=>{});sr.displayName=`JVR.DispatchSection`;function cr(){return(0,E.useReducer)(or,ir)}function lr(){return(0,E.useContext)(sr)}var ur=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(ar.Provider,{value:t,children:(0,D.jsx)(sr.Provider,{value:n,children:r})})};ur.displayName=`JVR.Section`;var dr={objectSortKeys:!1,indentWidth:15},fr=(0,E.createContext)(dr);fr.displayName=`JVR.Context`;var pr=(0,E.createContext)(()=>{});pr.displayName=`JVR.DispatchContext`;function mr(e,t){return F({},e,t)}var B=()=>(0,E.useContext)(fr),hr=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,E.useReducer)(mr,Object.assign({},dr,n)),[o,s]=jn(),[c,l]=zn(),[u,d]=Kn(),[f,p]=tr(),[m,h]=cr();return(0,E.useEffect)(()=>a(F({},n)),[n]),(0,D.jsx)(fr.Provider,{value:i,children:(0,D.jsx)(pr.Provider,{value:a,children:(0,D.jsx)(Nn,{initial:o,dispatch:s,children:(0,D.jsx)(Vn,{initial:c,dispatch:l,children:(0,D.jsx)(Jn,{initial:F({},u,r),dispatch:d,children:(0,D.jsx)(rr,{initial:f,dispatch:p,children:(0,D.jsx)(ur,{initial:m,dispatch:h,children:t})})})})})})})};hr.displayName=`JVR.Provider`;function gr(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var _r=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],vr=[`as`,`render`],yr=[`as`,`render`],br=[`as`,`render`],xr=[`as`,`style`,`render`],Sr=[`as`,`render`],Cr=[`as`,`render`],wr=[`as`,`render`],Tr=[`as`,`render`],Er=e=>{var{Quote:t={}}=R(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=I(e,_r);if(n)return null;var{as:c,render:l}=t,u=I(t,vr),d=c||`span`,f=F({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,D.jsx)(d,F({},f))};Er.displayName=`JVR.Quote`;var V=e=>{var{ValueQuote:t={}}=R(),n=F({},(gr(e),e)),{as:r,render:i}=t,a=I(t,yr),o=r||`span`,s=F({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,D.jsx)(o,F({},s))};V.displayName=`JVR.ValueQuote`;var Dr=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=R(),{as:o,render:s}=a,c=I(a,br),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,D.jsx)(l,F({},c))};Dr.displayName=`JVR.Colon`;var Or=e=>{var{Arrow:t={}}=R(),n=Ln(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=I(t,xr),m=u||`span`,h=f&&typeof f==`function`,g=F({},p,{"data-expanded":l,style:F({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,D.jsx)(m,F({},p,{style:F({},d,i)}))};Or.displayName=`JVR.Arrow`;var kr=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=R(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=I(o,Sr),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,D.jsx)(f,F({},d))}var{as:p,render:m}=s,h=I(s,Cr),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,D.jsx)(g,F({},h))};kr.displayName=`JVR.BracketsOpen`;var Ar=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=R();if(t){var{as:u,render:d}=c,f=I(c,wr),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,D.jsx)(p,F({},f))}var{as:m,render:h}=l,g=I(l,Tr),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,D.jsx)(_,F({},g))};Ar.displayName=`JVR.BracketsClose`;var jr=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=Ln(),{collapsed:c,shouldExpandNodeInitially:l}=B(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,D.jsx)(`div`,{style:m,children:(0,D.jsx)(Ar,F({isBrackets:g||_},h,{isVisiable:!0}))})};jr.displayName=`JVR.NestedClose`;var Mr=[`as`,`render`],Nr=[`as`,`render`],Pr=[`as`,`render`],Fr=[`as`,`render`],Ir=[`as`,`render`],Lr=[`as`,`render`],Rr=[`as`,`render`],zr=[`as`,`render`],Br=[`as`,`render`],Vr=[`as`,`render`],Hr=[`as`,`render`],Ur=[`as`,`render`],Wr=[`as`,`render`],Gr=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},Kr=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=L();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=I(r,Mr);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,D.jsx)(a||`span`,F({},s))};Kr.displayName=`JVR.SetComp`;var qr=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=L();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=I(r,Nr);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,D.jsx)(a||`span`,F({},s))};qr.displayName=`JVR.MapComp`;var H={opacity:.75,paddingRight:4},Jr=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=L(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=B(),{as:c,render:l}=i,u=I(i,Pr),d=t,[f,p]=(0,E.useState)(o&&d.length>o);(0,E.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,h=F({},H,i.style||{});o>0&&(u.style=F({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var g=f?``+d.slice(0,o)+s:d,_=l&&typeof l==`function`,v=_&&l(F({},u,{style:h}),{type:`type`,value:t,keyName:n,keys:r}),y=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,b=_&&l(F({},u,{children:g,className:y}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(v||(0,D.jsx)(m,F({},u,{style:h}))),b||(0,D.jsxs)(E.Fragment,{children:[(0,D.jsx)(V,{}),(0,D.jsx)(m,F({},u,{className:y,children:g})),(0,D.jsx)(V,{})]})]})};Jr.displayName=`JVR.TypeString`;var Yr=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Fr),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p||(0,D.jsx)(l,F({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Yr.displayName=`JVR.TypeTrue`;var Xr=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Ir),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p||(0,D.jsx)(l,F({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Xr.displayName=`JVR.TypeFalse`;var Zr=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Lr),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p||(0,D.jsx)(l,F({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Zr.displayName=`JVR.TypeFloat`;var Qr=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Rr),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p||(0,D.jsx)(l,F({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};Qr.displayName=`JVR.TypeInt`;var $r=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,zr),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p||(0,D.jsx)(l,F({},c,{className:`w-rjv-value`,children:Gr(t?.toString())}))]})};$r.displayName=`JVR.TypeFloat`;var ei=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Br),l=o||`span`,u=F({},H,i.style),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p||(0,D.jsxs)(`a`,F({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,D.jsx)(V,{}),t?.href,(0,D.jsx)(V,{})]}))]})};ei.displayName=`JVR.TypeUrl`;var ti=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Vr),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(F({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),m||(0,D.jsx)(l,F({},c,{className:`w-rjv-value`,children:p}))]})};ti.displayName=`JVR.TypeDate`;var ni=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Hr),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p]})};ni.displayName=`JVR.TypeUndefined`;var ri=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Ur),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p]})};ri.displayName=`JVR.TypeNull`;var ii=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=L(),{as:o,render:s}=i,c=I(i,Wr),l=o||`span`,u=F({},H,i.style||{}),d=s&&typeof s==`function`,f=d&&s(F({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(F({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,F({},c,{style:u}))),p]})};ii.displayName=`JVR.TypeNan`;var ai=e=>Number(e)===e&&e%1!=0||isNaN(e),oi=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,D.jsx)(ei,F({},i,{children:t})):typeof t==`string`?(0,D.jsx)(Jr,F({},i,{children:t})):t===!0?(0,D.jsx)(Yr,F({},i,{children:t})):t===!1?(0,D.jsx)(Xr,F({},i,{children:t})):t===null?(0,D.jsx)(ri,F({},i,{children:t})):t===void 0?(0,D.jsx)(ni,F({},i,{children:t})):t instanceof Date?(0,D.jsx)(ti,F({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,D.jsx)(ii,F({},i,{children:t})):typeof t==`number`&&ai(t)?(0,D.jsx)(Zr,F({},i,{children:t})):typeof t==`bigint`?(0,D.jsx)($r,F({},i,{children:t})):typeof t==`number`?(0,D.jsx)(Qr,F({},i,{children:t})):null};oi.displayName=`JVR.Value`;function U(e,t,n){var r=nr(),i=F({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:F({},e.style,t.style),children:t.children||e.children});(0,E.useEffect)(()=>r({[n]:i}),[t])}function W(e,t,n){var r=qn(),i=F({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:F({},e.style,t.style),children:t.children||e.children});(0,E.useEffect)(()=>r({[n]:i}),[t])}function G(e,t,n){var r=lr(),i=F({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:F({},e.style,t.style),children:t.children||e.children});(0,E.useEffect)(()=>r({[n]:i}),[t])}var si=[`as`,`render`],ci=e=>{var{KeyName:t={}}=z();return G(t,e,`KeyName`),null};ci.displayName=`JVR.KeyName`;var li=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=z(),{as:c,render:l}=s,u=I(s,si);u.style=F({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(F({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,D.jsx)(d,F({},u,{children:t}))};li.displayName=`JVR.KeyNameComp`;var ui=[`children`,`value`,`parentValue`,`keyName`,`keys`],di=[`as`,`render`,`children`],fi=e=>{var{Row:t={}}=z();return G(t,e,`Row`),null};fi.displayName=`JVR.Row`;var pi=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=I(e,ui),{Row:s={}}=z(),{as:c,render:l}=s,u=I(s,di),d=c||`div`;return l&&typeof l==`function`&&l(F({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,D.jsx)(d,F({},o,u,{children:t}))};pi.displayName=`JVR.RowComp`;function mi(e){var t=(0,E.useRef)();return(0,E.useEffect)(()=>{t.current=e}),t.current}function hi(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=mi(t),a=(0,E.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,E.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var gi=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],_i=[`as`,`render`],vi=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=I(e,gi),{onCopied:c,enableClipboard:l,beforeCopy:u}=B(),d=kn()[i],[f,p]=(0,E.useState)(!1),{Copied:m={}}=z(),h=m?.beforeCopy;if(l===!1||!d)return null;var g={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?Gr(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?Gr(t):t,2);var l=o||h||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:_}=m,v=I(m,_i),y=F({},v,s,g,{style:F({},v.style,s.style,g.style)});return _&&typeof _==`function`&&_(F({},y,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,D.jsx)(`svg`,F({viewBox:`0 0 32 36`},y,{children:(0,D.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,D.jsx)(`svg`,F({viewBox:`0 0 32 36`},y,{children:(0,D.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};vi.displayName=`JVR.Copied`;function yi(){var e=(0,E.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var bi=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=Ln(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=B(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,D.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,D.jsx)(Si,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};bi.displayName=`JVR.KeyValues`;var xi=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=B(),o=typeof t==`number`,s=(0,E.useRef)(null);hi({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,D.jsxs)(E.Fragment,{children:[(0,D.jsxs)(`span`,{ref:s,children:[(0,D.jsx)(Er,F({isNumber:o,"data-placement":`left`},c)),(0,D.jsx)(li,F({},c,{children:t})),(0,D.jsx)(Er,F({isNumber:o,"data-placement":`right`},c))]}),(0,D.jsx)(Dr,F({},c))]})};xi.displayName=`JVR.KayName`;var Si=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=Mn(),s=yi(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,D.jsx)(Ii,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,D.jsxs)(pi,F({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,D.jsx)(xi,{keyName:t,value:n,keys:a,parentValue:r}),(0,D.jsx)(oi,{keyName:t,value:n,keys:a}),(0,D.jsx)(vi,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Si.displayName=`JVR.KeyValuesItem`;var Ci=[`value`,`keyName`],wi=[`as`,`render`],Ti=e=>{var{CountInfoExtra:t={}}=z();return G(t,e,`CountInfoExtra`),null};Ti.displayName=`JVR.CountInfoExtra`;var Ei=e=>{var{value:t={},keyName:n}=e,r=I(e,Ci),{CountInfoExtra:i={}}=z(),{as:a,render:o}=i,s=I(i,wi);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=F({},s,r);return l&&o(u,{value:t,keyName:n})||(0,D.jsx)(c,F({},u))};Ei.displayName=`JVR.CountInfoExtraComps`;var Di=[`value`,`keyName`],Oi=[`as`,`render`],ki=e=>{var{CountInfo:t={}}=z();return G(t,e,`CountInfo`),null};ki.displayName=`JVR.CountInfo`;var Ai=e=>{var{value:t={},keyName:n}=e,r=I(e,Di),{displayObjectSize:i}=B(),{CountInfo:a={}}=z();if(!i)return null;var{as:o,render:s}=a,c=I(a,Oi),l=o||`span`;c.style=F({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=F({},c,r);return s&&typeof s==`function`&&s(F({},d,{"data-length":u}),{value:t,keyName:n})||(0,D.jsx)(l,F({},d))};Ai.displayName=`JVR.CountInfoComp`;var ji=[`as`,`render`],Mi=e=>{var{Ellipsis:t={}}=z();return G(t,e,`Ellipsis`),null};Mi.displayName=`JVR.Ellipsis`;var Ni=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=z(),{as:a,render:o}=i,s=I(i,ji),c=a||`span`;return o&&typeof o==`function`&&o(F({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,D.jsx)(c,F({},s)))};Ni.displayName=`JVR.EllipsisComp`;var Pi=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=Ln(),l=Bn(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=B(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),ee={style:_};C&&(ee.onClick=g);var w={keyName:t,value:a,keys:r,parentValue:o};return(0,D.jsxs)(`span`,F({},ee,{children:[C&&(0,D.jsx)(Or,F({style:v,expandKey:n},w)),(t||typeof t==`number`)&&(0,D.jsx)(xi,F({},w)),(0,D.jsx)(Kr,{value:i,keyName:t}),(0,D.jsx)(qr,{value:i,keyName:t}),(0,D.jsx)(kr,F({isBrackets:x||S},w)),(0,D.jsx)(Ni,{keyName:t,value:a,isExpanded:m}),(0,D.jsx)(Ar,F({isVisiable:m||!C,isBrackets:x||S},w)),(0,D.jsx)(Ai,{value:a,keyName:t}),(0,D.jsx)(Ei,{value:a,keyName:t}),(0,D.jsx)(vi,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};Pi.displayName=`JVR.NestedOpen`;var Fi=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],Ii=(0,E.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=I(e,Fi),u=Mn(),d=yi();return(0,D.jsxs)(`div`,F({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,D.jsx)(Pi,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,D.jsx)(bi,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,D.jsx)(jr,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});Ii.displayName=`JVR.Container`;var Li=e=>{var{BraceLeft:t={}}=R();return U(t,e,`BraceLeft`),null};Li.displayName=`JVR.BraceLeft`;var Ri=e=>{var{BraceRight:t={}}=R();return U(t,e,`BraceRight`),null};Ri.displayName=`JVR.BraceRight`;var zi=e=>{var{BracketsLeft:t={}}=R();return U(t,e,`BracketsLeft`),null};zi.displayName=`JVR.BracketsLeft`;var Bi=e=>{var{BracketsRight:t={}}=R();return U(t,e,`BracketsRight`),null};Bi.displayName=`JVR.BracketsRight`;var Vi=e=>{var{Arrow:t={}}=R();return U(t,e,`Arrow`),null};Vi.displayName=`JVR.Arrow`;var Hi=e=>{var{Colon:t={}}=R();return U(t,e,`Colon`),null};Hi.displayName=`JVR.Colon`;var Ui=e=>{var{Quote:t={}}=R();return U(t,e,`Quote`),null};Ui.displayName=`JVR.Quote`;var Wi=e=>{var{ValueQuote:t={}}=R();return U(t,e,`ValueQuote`),null};Wi.displayName=`JVR.ValueQuote`;var Gi=e=>{var{Bigint:t={}}=L();return W(t,e,`Bigint`),null};Gi.displayName=`JVR.Bigint`;var Ki=e=>{var{Date:t={}}=L();return W(t,e,`Date`),null};Ki.displayName=`JVR.Date`;var qi=e=>{var{False:t={}}=L();return W(t,e,`False`),null};qi.displayName=`JVR.False`;var Ji=e=>{var{Float:t={}}=L();return W(t,e,`Float`),null};Ji.displayName=`JVR.Float`;var Yi=e=>{var{Int:t={}}=L();return W(t,e,`Int`),null};Yi.displayName=`JVR.Int`;var Xi=e=>{var{Map:t={}}=L();return W(t,e,`Map`),null};Xi.displayName=`JVR.Map`;var Zi=e=>{var{Nan:t={}}=L();return W(t,e,`Nan`),null};Zi.displayName=`JVR.Nan`;var Qi=e=>{var{Null:t={}}=L();return W(t,e,`Null`),null};Qi.displayName=`JVR.Null`;var $i=e=>{var{Set:t={}}=L();return W(t,e,`Set`),null};$i.displayName=`JVR.Set`;var ea=e=>{var{Str:t={}}=L();return W(t,e,`Str`),null};ea.displayName=`JVR.StringText`;var ta=e=>{var{True:t={}}=L();return W(t,e,`True`),null};ta.displayName=`JVR.True`;var na=e=>{var{Undefined:t={}}=L();return W(t,e,`Undefined`),null};na.displayName=`JVR.Undefined`;var ra=e=>{var{Url:t={}}=L();return W(t,e,`Url`),null};ra.displayName=`JVR.Url`;var ia=e=>{var{Copied:t={}}=z();return G(t,e,`Copied`),null};ia.displayName=`JVR.Copied`;var aa=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],K=(0,E.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=I(e,aa),b=F({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,D.jsxs)(hr,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,D.jsx)(Ii,F({value:i},y,{ref:t,className:x,style:b})),a]})});K.Bigint=Gi,K.Date=Ki,K.False=qi,K.Float=Ji,K.Int=Yi,K.Map=Xi,K.Nan=Zi,K.Null=Qi,K.Set=$i,K.String=ea,K.True=ta,K.Undefined=na,K.Url=ra,K.ValueQuote=Wi,K.Arrow=Vi,K.Colon=Hi,K.Quote=Ui,K.Ellipsis=Mi,K.BraceLeft=Li,K.BraceRight=Ri,K.BracketsLeft=zi,K.BracketsRight=Bi,K.Copied=ia,K.CountInfo=ki,K.CountInfoExtra=Ti,K.KeyName=ci,K.Row=fi,K.displayName=`JVR.JsonView`;function oa(e){return e.pagePath??e.id}var sa={"--w-rjv-font-family":`var(--font-family-mono)`,"--w-rjv-background-color":`transparent`,"--w-rjv-color":`var(--color-code-blue)`,"--w-rjv-key-string":`var(--color-code-blue)`,"--w-rjv-line-color":`var(--color-border-subtle)`,"--w-rjv-arrow-color":`var(--color-text-secondary)`,"--w-rjv-info-color":`var(--color-code-label)`,"--w-rjv-curlybraces-color":`var(--color-text-secondary)`,"--w-rjv-brackets-color":`var(--color-text-secondary)`,"--w-rjv-quotes-color":`var(--color-code-orange)`,"--w-rjv-quotes-string-color":`var(--color-code-orange)`,"--w-rjv-type-string-color":`var(--color-code-orange)`,"--w-rjv-type-int-color":`var(--color-code-number)`,"--w-rjv-type-float-color":`var(--color-code-number)`,"--w-rjv-type-bigint-color":`var(--color-code-number)`,"--w-rjv-type-boolean-color":`var(--color-code-keyword)`,"--w-rjv-type-null-color":`var(--color-code-keyword)`,"--w-rjv-type-nan-color":`var(--color-code-keyword)`,"--w-rjv-type-undefined-color":`var(--color-code-keyword)`,"--w-rjv-type-date-color":`var(--color-code-label)`,"--w-rjv-type-url-color":`var(--color-code-blue)`,fontSize:12,padding:`6px 8px`,wordBreak:`break-all`,whiteSpace:`pre-wrap`};function ca({state:e,onRefresh:t,onSelectBridge:n}){let{bridges:r,activeBridgeId:i,entries:a}=e,o=i&&r.some(e=>e.id===i)?i:r.at(-1)?.id??null,s=r.some(e=>Object.keys(a[e.id]??{}).length>0);return(0,D.jsxs)(`div`,{className:`flex flex-col overflow-hidden flex-1`,children:[(0,D.jsx)(`div`,{className:`flex items-center px-2.5 py-1.5 border-b border-border-subtle shrink-0 bg-bg-panel`,children:(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:t,className:`hover:border-accent hover:text-accent`,children:`↻ 刷新`})}),r.length>1&&(0,D.jsx)(`div`,{className:`flex gap-1 px-2 py-1 border-b border-border-subtle shrink-0 overflow-x-auto bg-bg-panel`,children:r.map(e=>{let t=e.id===o;return(0,D.jsx)(`button`,{onClick:()=>n(e.id),title:e.id,className:`shrink-0 px-2 py-0.5 text-[11px] rounded border transition-colors `+(t?`border-accent text-accent bg-surface-3`:`border-border-subtle text-text-dim hover:border-accent hover:text-accent`),children:oa(e)},e.id)})}),r.length===0||!s?(0,D.jsx)(`div`,{className:`text-[12px] text-text-dim text-center px-4 py-6`,children:`暂无页面数据(仅显示 Page 级 data)`}):(0,D.jsx)(`div`,{className:`flex-1 overflow-hidden relative`,children:r.map(e=>{let t=e.id===o,n=a[e.id]??{},r=Object.keys(n);return(0,D.jsx)(`div`,{className:`absolute inset-0 flex flex-col gap-2 p-2 overflow-y-auto`,style:{display:t?`flex`:`none`},children:r.length===0?(0,D.jsx)(`div`,{className:`text-[12px] text-text-dim text-center px-4 py-6`,children:`暂无页面数据(仅显示 Page 级 data)`}):r.map(t=>(0,D.jsxs)(`div`,{className:`border border-border-subtle rounded overflow-hidden shrink-0`,children:[(0,D.jsx)(`div`,{className:`bg-surface-3 px-2 py-0.5 text-[11px] text-code-label truncate`,children:t}),(0,D.jsx)(K,{value:n[t]??{},collapsed:1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,indentWidth:12,style:sa})]},`${e.id}::${t}`))},e.id)})})]})}function la(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function ua({items:e,onRefresh:t,onSet:n,onRemove:r,onClear:i,onClearAll:a,getPrefix:o}){let[s,c]=(0,E.useState)(null),[l,u]=(0,E.useState)(null),[d,f]=(0,E.useState)(!1),[p,m]=(0,E.useState)(``),[h,g]=(0,E.useState)(``),[_,v]=(0,E.useState)(``);(0,E.useEffect)(()=>{let e=!1;return o().then(t=>{e||m(t)}),()=>{e=!0}},[o]);async function y(e){f(!0),u(null);try{let t=await e();return t.ok?t:(u(t.error),null)}finally{f(!1)}}function b(e){c({key:e.key,draft:la(e.value)})}async function x(){if(!s)return;let{key:e,draft:t}=s;c(null),await y(()=>n(e,t))}async function S(e){await y(()=>r(e))}async function C(){e.length!==0&&await y(()=>i())}async function ee(){typeof window<`u`&&!window.confirm(`清空 simulator 中所有 appId 的 Storage 数据?该操作不可撤销。`)||await y(()=>a())}async function w(){let e=h.trim();if(!e){u(`key 不能为空`);return}let t=p+e;await y(()=>n(t,_))&&(g(``),v(``))}return(0,D.jsxs)(`div`,{className:`flex flex-col overflow-hidden flex-1`,"data-testid":`storage-panel`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1.5 border-b border-border-subtle shrink-0 bg-bg-panel`,children:[(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:t,disabled:d,className:`hover:border-accent hover:text-accent`,children:`↻ 刷新`}),(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:C,disabled:d||e.length===0,className:`hover:border-destructive hover:text-destructive`,title:`仅清空当前 appId 的 Storage`,children:`清空`}),(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:ee,disabled:d,className:`hover:border-destructive hover:text-destructive`,title:`清空 simulator 中所有 appId 的 Storage`,children:`清空所有`}),l&&(0,D.jsx)(`span`,{className:`ml-2 text-[11px] text-destructive truncate`,title:l,children:l})]}),(0,D.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,D.jsxs)(`table`,{className:`w-full border-collapse text-[12px]`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{children:[(0,D.jsx)(`th`,{className:`text-left text-code-label font-normal px-2.5 py-1 border-b border-border-subtle text-[11px] sticky top-0 bg-bg z-10`,children:`Key`}),(0,D.jsx)(`th`,{className:`text-left text-code-label font-normal px-2.5 py-1 border-b border-border-subtle text-[11px] sticky top-0 bg-bg z-10`,children:`Value`}),(0,D.jsx)(`th`,{className:`w-px sticky top-0 bg-bg z-10 border-b border-border-subtle`})]})}),(0,D.jsx)(`tbody`,{children:e.length===0?(0,D.jsx)(`tr`,{children:(0,D.jsx)(`td`,{colSpan:3,className:`text-[12px] text-text-dim text-center px-4 py-6`,children:`暂无 Storage 数据`})}):e.map(e=>{let t=s?.key===e.key;return(0,D.jsxs)(`tr`,{className:`hover:[&>td]:bg-surface`,children:[(0,D.jsx)(`td`,{className:`px-2.5 py-0.5 border-b border-border-subtle font-mono text-code-blue whitespace-nowrap w-px pr-5 align-top`,children:e.key}),(0,D.jsx)(`td`,{className:`px-2.5 py-0.5 border-b border-border-subtle font-mono text-code-orange break-all align-top cursor-text`,onClick:()=>{t||b(e)},children:t?(0,D.jsx)(`input`,{autoFocus:!0,type:`text`,value:s.draft,onChange:t=>c({key:e.key,draft:t.target.value}),onBlur:x,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),x()):e.key===`Escape`&&(e.preventDefault(),c(null))},className:`w-full bg-transparent outline-none border border-accent/60 rounded px-1 py-0 font-mono text-code-orange`}):la(e.value)}),(0,D.jsx)(`td`,{className:`px-1 py-0.5 border-b border-border-subtle align-top`,children:(0,D.jsx)(`button`,{type:`button`,onClick:()=>S(e.key),disabled:d,title:`删除`,className:`text-text-dim hover:text-destructive px-1 leading-none`,children:`×`})})]},e.key)})})]})}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1.5 border-t border-border-subtle shrink-0 bg-bg-panel`,children:[p&&(0,D.jsx)(`span`,{className:`font-mono text-[11px] text-text-dim shrink-0`,title:`active appId prefix`,children:p}),(0,D.jsx)(`input`,{type:`text`,placeholder:`key`,value:h,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),w())},className:`w-32 bg-transparent border border-border-subtle rounded px-1.5 py-0.5 text-[12px] font-mono outline-none focus:border-accent`}),(0,D.jsx)(`input`,{type:`text`,placeholder:`value`,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),w())},className:`flex-1 bg-transparent border border-border-subtle rounded px-1.5 py-0.5 text-[12px] font-mono outline-none focus:border-accent`}),(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:()=>void w(),disabled:d||!h.trim(),className:`hover:border-accent hover:text-accent`,children:`+ 新增`})]})]})}function da({project:e}){let t=(0,E.useRef)(null),[n,r]=(0,E.useState)(!1),{session:i,device:a,simulator:o,panelData:s,rightPane:c,popover:l}=$e({projectPath:e.path});(0,E.useEffect)(()=>{let t=`Dimina DevTools`;return document.title=`${e.name} - ${t}`,ke().then(n=>{n?.appName&&(t=n.appName,document.title=`${e.name} - ${t}`)}).catch(()=>{}),()=>{document.title=t}},[e.name]),(0,E.useEffect)(()=>()=>{t.current!==null&&window.clearTimeout(t.current)},[]);async function u(){if(o.currentPage)try{await navigator.clipboard.writeText(o.currentPage),r(!0),t.current!==null&&window.clearTimeout(t.current),t.current=window.setTimeout(()=>r(!1),fe)}catch{r(!1)}}return(0,D.jsxs)(`div`,{className:`flex flex-col h-screen`,children:[(0,D.jsx)(bn,{compileDropdownRef:l.compileDropdownRef,showCompilePanel:l.showCompilePanel,onToggleCompilePanel:l.toggleCompilePanel,onRelaunch:()=>i.relaunch(),compileStatus:i.compileStatus,rightPane:c.rightPane,onToggleRightPaneVisible:c.toggleRightPaneVisible,onSelectRightPane:c.selectRightPane}),(0,D.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,D.jsx)(xn,{simPanelWidth:a.simPanelWidth,device:a.device,zoom:a.zoom,onDeviceChange:a.handleDeviceChange,onZoomChange:a.handleZoomChange,compileStatus:i.compileStatus,preloadPath:i.preloadPath,simulatorUrl:o.simulatorUrl,simulatorRef:o.simulatorRef,currentPage:o.currentPage,copied:n,onCopyPagePath:u}),(0,D.jsx)(`div`,{className:`w-1 bg-surface-splitter border-l border-r border-border-subtle cursor-col-resize shrink-0 transition-colors hover:bg-accent active:bg-accent`,onMouseDown:a.handleSplitterDrag}),(0,D.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[c.rightPane.selected===`wxml`&&(0,D.jsx)(Tn,{tree:s.wxmlTree,onRefresh:s.refreshWxml,onInspectElement:s.inspectWxmlElement,onClearInspection:s.clearWxmlElementInspection}),(0,D.jsx)(`div`,{className:`flex flex-1 overflow-hidden`,style:{display:c.rightPane.selected===`appdata`?`flex`:`none`},children:(0,D.jsx)(ca,{state:s.appData,onRefresh:s.refreshAppData,onSelectBridge:s.setActiveAppDataBridge})}),c.rightPane.selected===`storage`&&(0,D.jsx)(ua,{items:s.storageItems,onRefresh:s.refreshStorage,onSet:s.setStorageItem,onRemove:s.removeStorageItem,onClear:s.clearStorage,onClearAll:s.clearAllStorage,getPrefix:s.getStoragePrefix}),c.rightPane.selected===`simulator`&&(0,D.jsx)(`div`,{className:`flex-1`})]})]})]})}function fa(e,t=globalThis?.document){let n=P(e);E.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var pa=`DismissableLayer`,ma=`dismissableLayer.update`,ha=`dismissableLayer.pointerDownOutside`,ga=`dismissableLayer.focusOutside`,_a,va=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ya=E.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=E.useContext(va),[u,d]=E.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=E.useState({}),m=A(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Sa(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Ca(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return fa(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),E.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(_a=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),wa(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=_a)}},[u,f,n,l]),E.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),wa())},[u,l]),E.useEffect(()=>{let e=()=>p({});return document.addEventListener(ma,e),()=>document.removeEventListener(ma,e)},[]),(0,D.jsx)(N.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:k(e.onFocusCapture,S.onFocusCapture),onBlurCapture:k(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,x.onPointerDownCapture)})});ya.displayName=pa;var ba=`DismissableLayerBranch`,xa=E.forwardRef((e,t)=>{let n=E.useContext(va),r=E.useRef(null),i=A(t,r);return E.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,D.jsx)(N.div,{...e,ref:i})});xa.displayName=ba;function Sa(e,t=globalThis?.document){let n=P(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Ta(ha,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ca(e,t=globalThis?.document){let n=P(e),r=E.useRef(!1);return E.useEffect(()=>{let e=e=>{e.target&&!r.current&&Ta(ga,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function wa(){let e=new CustomEvent(ma);document.dispatchEvent(e)}function Ta(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ht(i,a):i.dispatchEvent(a)}var Ea=`focusScope.autoFocusOnMount`,Da=`focusScope.autoFocusOnUnmount`,Oa={bubbles:!1,cancelable:!0},ka=`FocusScope`,Aa=E.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=E.useState(null),l=P(i),u=P(a),d=E.useRef(null),f=A(t,e=>c(e)),p=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:q(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||q(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&q(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),E.useEffect(()=>{if(s){La.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Ea,Oa);s.addEventListener(Ea,l),s.dispatchEvent(t),t.defaultPrevented||(ja(Ba(Na(s)),{select:!0}),document.activeElement===e&&q(s))}return()=>{s.removeEventListener(Ea,l),setTimeout(()=>{let t=new CustomEvent(Da,Oa);s.addEventListener(Da,u),s.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),s.removeEventListener(Da,u),La.remove(p)},0)}}},[s,l,u,p]);let m=E.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ma(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&q(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&q(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,D.jsx)(N.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Aa.displayName=ka;function ja(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(q(r,{select:t}),document.activeElement!==n)return}function Ma(e){let t=Na(e);return[Pa(t,e),Pa(t.reverse(),e)]}function Na(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Pa(e,t){for(let n of e)if(!Fa(n,{upTo:t}))return n}function Fa(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Ia(e){return e instanceof HTMLInputElement&&`select`in e}function q(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ia(e)&&t&&e.select()}}var La=Ra();function Ra(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=za(e,t),e.unshift(t)},remove(t){e=za(e,t),e[0]?.resume()}}}function za(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ba(e){return e.filter(e=>e.tagName!==`A`)}var Va=`Portal`,Ha=E.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=E.useState(!1);j(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?mt.createPortal((0,D.jsx)(N.div,{...r,ref:t}),o):null});Ha.displayName=Va;var Ua=0;function Wa(){E.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Ga()),document.body.insertAdjacentElement(`beforeend`,e[1]??Ga()),Ua++,()=>{Ua===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Ua--}},[])}function Ga(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var J=function(){return J=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},J.apply(this,arguments)};function Ka(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function qa(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ja=`right-scroll-bar-position`,Ya=`width-before-scroll-bar`,Xa=`with-scroll-bars-hidden`,Za=`--removed-body-scroll-bar-size`;function Qa(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function $a(e,t){var n=(0,E.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var eo=typeof window<`u`?E.useLayoutEffect:E.useEffect,to=new WeakMap;function no(e,t){var n=$a(t||null,function(t){return e.forEach(function(e){return Qa(e,t)})});return eo(function(){var t=to.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Qa(e,null)}),i.forEach(function(e){r.has(e)||Qa(e,a)})}to.set(n,e)},[e]),n}function ro(e){return e}function io(e,t){t===void 0&&(t=ro);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ao(e){e===void 0&&(e={});var t=io(null);return t.options=J({async:!0,ssr:!1},e),t}var oo=function(e){var t=e.sideCar,n=Ka(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return E.createElement(r,J({},n))};oo.isSideCarExport=!0;function so(e,t){return e.useMedium(t),oo}var co=ao(),lo=function(){},uo=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:lo,onWheelCapture:lo,onTouchMoveCapture:lo}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Ka(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=no([n,t]),C=J(J({},b),i);return E.createElement(E.Fragment,null,u&&E.createElement(x,{sideCar:co,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?E.cloneElement(E.Children.only(s),J(J({},C),{ref:S})):E.createElement(v,J({},C,{className:c,ref:S}),s))});uo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},uo.classNames={fullWidth:Ya,zeroRight:Ja};var fo,po=function(){if(fo)return fo;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function mo(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=po();return t&&e.setAttribute(`nonce`,t),e}function ho(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function go(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var _o=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mo())&&(ho(t,n),go(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vo=function(){var e=_o();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yo=function(){var e=vo();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},bo={left:0,top:0,right:0,gap:0},xo=function(e){return parseInt(e||``,10)||0},So=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[xo(n),xo(r),xo(i)]},Co=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return bo;var t=So(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wo=yo(),To=`data-scroll-locked`,Eo=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
.${Xa} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${To}] {
|
|
7
|
-
overflow: hidden ${r};
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
-
padding-left: ${i}px;
|
|
11
|
-
padding-top: ${a}px;
|
|
12
|
-
padding-right: ${o}px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: ${s}px ${r};
|
|
16
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.${Ja} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${Ya} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${Ja} .${Ja} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${Ya} .${Ya} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${To}] {
|
|
36
|
-
${Za}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},Do=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Oo=function(){E.useEffect(function(){return document.body.setAttribute(To,(Do()+1).toString()),function(){var e=Do()-1;e<=0?document.body.removeAttribute(To):document.body.setAttribute(To,e.toString())}},[])},ko=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Oo();var a=E.useMemo(function(){return Co(i)},[i]);return E.createElement(wo,{styles:Eo(a,!t,i,n?``:`!important`)})},Ao=!1;if(typeof window<`u`)try{var jo=Object.defineProperty({},`passive`,{get:function(){return Ao=!0,!0}});window.addEventListener(`test`,jo,jo),window.removeEventListener(`test`,jo,jo)}catch{Ao=!1}var Y=Ao?{passive:!1}:!1,Mo=function(e){return e.tagName===`TEXTAREA`},No=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Mo(e)&&n[t]===`visible`)},Po=function(e){return No(e,`overflowY`)},Fo=function(e){return No(e,`overflowX`)},Io=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),zo(e,r)){var i=Bo(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lo=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ro=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},zo=function(e,t){return e===`v`?Po(t):Fo(t)},Bo=function(e,t){return e===`v`?Lo(t):Ro(t)},Vo=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ho=function(e,t,n,r,i){var a=Vo(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Bo(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&zo(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Uo=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wo=function(e){return[e.deltaX,e.deltaY]},Go=function(e){return e&&`current`in e?e.current:e},Ko=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qo=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},Jo=0,X=[];function Yo(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(Jo++)[0],a=E.useState(yo)[0],o=E.useRef(e);E.useEffect(function(){o.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=qa([e.lockRef.current],(e.shards||[]).map(Go),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Uo(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Io(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Io(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ho(h,t,e,h===`h`?s:c,!0)},[]),c=E.useCallback(function(e){var n=e;if(!(!X.length||X[X.length-1]!==a)){var r=`deltaY`in n?Wo(n):Uo(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ko(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Go).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=E.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Xo(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=E.useCallback(function(e){n.current=Uo(e),r.current=void 0},[]),d=E.useCallback(function(t){l(t.type,Wo(t),t.target,s(t,e.lockRef.current))},[]),f=E.useCallback(function(t){l(t.type,Uo(t),t.target,s(t,e.lockRef.current))},[]);E.useEffect(function(){return X.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Y),document.addEventListener(`touchmove`,c,Y),document.addEventListener(`touchstart`,u,Y),function(){X=X.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Y),document.removeEventListener(`touchmove`,c,Y),document.removeEventListener(`touchstart`,u,Y)}},[]);var p=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(a,{styles:qo(i)}):null,p?E.createElement(ko,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Xo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Zo=so(co,Yo),Qo=E.forwardRef(function(e,t){return E.createElement(uo,J({},e,{ref:t,sideCar:Zo}))});Qo.classNames=uo.classNames;var $o=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Z=new WeakMap,es=new WeakMap,ts={},ns=0,rs=function(e){return e&&(e.host||rs(e.parentNode))},is=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=rs(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},as=function(e,t,n,r){var i=is(t,Array.isArray(e)?e:[e]);ts[n]||(ts[n]=new WeakMap);var a=ts[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Z.get(e)||0)+1,l=(a.get(e)||0)+1;Z.set(e,c),a.set(e,l),o.push(e),c===1&&i&&es.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ns++,function(){o.forEach(function(e){var t=Z.get(e)-1,i=a.get(e)-1;Z.set(e,t),a.set(e,i),t||(es.has(e)||e.removeAttribute(r),es.delete(e)),i||e.removeAttribute(n)}),ns--,ns||(Z=new WeakMap,Z=new WeakMap,es=new WeakMap,ts={})}},os=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||$o(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),as(r,i,n,`aria-hidden`)):function(){return null}},ss=`Dialog`,[cs,ls]=tt(ss),[us,Q]=cs(ss),ds=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=E.useRef(null),c=E.useRef(null),[l,u]=_t({prop:r,defaultProp:i??!1,onChange:a,caller:ss});return(0,D.jsx)(us,{scope:t,triggerRef:s,contentRef:c,contentId:M(),titleId:M(),descriptionId:M(),open:l,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};ds.displayName=ss;var fs=`DialogTrigger`,ps=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(fs,n),a=A(t,i.triggerRef);return(0,D.jsx)(N.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ms(i.open),...r,ref:a,onClick:k(e.onClick,i.onOpenToggle)})});ps.displayName=fs;var ms=`DialogPortal`,[hs,gs]=cs(ms,{forceMount:void 0}),_s=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Q(ms,t);return(0,D.jsx)(hs,{scope:t,forceMount:n,children:E.Children.map(r,e=>(0,D.jsx)(Wt,{present:n||a.open,children:(0,D.jsx)(Ha,{asChild:!0,container:i,children:e})}))})};_s.displayName=ms;var vs=`DialogOverlay`,ys=E.forwardRef((e,t)=>{let n=gs(vs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q(vs,e.__scopeDialog);return a.modal?(0,D.jsx)(Wt,{present:r||a.open,children:(0,D.jsx)(xs,{...i,ref:t})}):null});ys.displayName=vs;var bs=at(`DialogOverlay.RemoveScroll`),xs=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(vs,n);return(0,D.jsx)(Qo,{as:bs,allowPinchZoom:!0,shards:[i.contentRef],children:(0,D.jsx)(N.div,{"data-state":Ms(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),$=`DialogContent`,Ss=E.forwardRef((e,t)=>{let n=gs($,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q($,e.__scopeDialog);return(0,D.jsx)(Wt,{present:r||a.open,children:a.modal?(0,D.jsx)(Cs,{...i,ref:t}):(0,D.jsx)(ws,{...i,ref:t})})});Ss.displayName=$;var Cs=E.forwardRef((e,t)=>{let n=Q($,e.__scopeDialog),r=E.useRef(null),i=A(t,n.contentRef,r);return E.useEffect(()=>{let e=r.current;if(e)return os(e)},[]),(0,D.jsx)(Ts,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:k(e.onFocusOutside,e=>e.preventDefault())})}),ws=E.forwardRef((e,t)=>{let n=Q($,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return(0,D.jsx)(Ts,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Ts=E.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Q($,n),c=E.useRef(null),l=A(t,c);return Wa(),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Aa,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,D.jsx)(ya,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Ms(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Is,{titleId:s.titleId}),(0,D.jsx)(Rs,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Es=`DialogTitle`,Ds=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(Es,n);return(0,D.jsx)(N.h2,{id:i.titleId,...r,ref:t})});Ds.displayName=Es;var Os=`DialogDescription`,ks=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(Os,n);return(0,D.jsx)(N.p,{id:i.descriptionId,...r,ref:t})});ks.displayName=Os;var As=`DialogClose`,js=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(As,n);return(0,D.jsx)(N.button,{type:`button`,...r,ref:t,onClick:k(e.onClick,()=>i.onOpenChange(!1))})});js.displayName=As;function Ms(e){return e?`open`:`closed`}var Ns=`DialogTitleWarning`,[Ps,Fs]=et(Ns,{contentName:$,titleName:Es,docsSlug:`dialog`}),Is=({titleId:e})=>{let t=Fs(Ns),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
-
|
|
43
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
-
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ls=`DialogDescriptionWarning`,Rs=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fs(Ls).contentName}}.`;return E.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},zs=ds,Bs=_s,Vs=ys,Hs=Ss,Us=Ds,Ws=ks,Gs=js,Ks=zs,qs=Bs,Js=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(Vs,{ref:n,className:_(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Js.displayName=Vs.displayName;var Ys=E.forwardRef(({className:e,children:t,...n},r)=>(0,D.jsxs)(qs,{children:[(0,D.jsx)(Js,{}),(0,D.jsxs)(Hs,{ref:r,className:_(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-surface text-text p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,D.jsxs)(Gs,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-bg transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-surface-active data-[state=open]:text-text-muted`,children:[(0,D.jsx)(Te,{className:`h-4 w-4`}),(0,D.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Ys.displayName=Hs.displayName;var Xs=({className:e,...t})=>(0,D.jsx)(`div`,{className:_(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});Xs.displayName=`DialogHeader`;var Zs=({className:e,...t})=>(0,D.jsx)(`div`,{className:_(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Zs.displayName=`DialogFooter`;var Qs=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(Us,{ref:n,className:_(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Qs.displayName=Us.displayName;var $s=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(Ws,{ref:n,className:_(`text-sm text-text-muted`,e),...t}));$s.displayName=Ws.displayName;function ec(){let[e,t]=(0,E.useState)(!1),[n,i]=(0,E.useState)(null),[a,o]=(0,E.useState)(`prompt`),[s,l]=(0,E.useState)(0),[u,f]=(0,E.useState)(``);(0,E.useEffect)(()=>d(r.Available,e=>{i(e),o(`prompt`),l(0),f(``),t(!0)}),[]),(0,E.useEffect)(()=>d(r.DownloadProgress,e=>{l(Math.round(e.percent))}),[]);let p=(0,E.useCallback)(async()=>{o(`downloading`),l(0);try{let e=await c(r.Download);e.success?o(`ready`):(f(e.error||`Download failed`),o(`error`))}catch(e){f(e instanceof Error?e.message:String(e)),o(`error`)}},[]),m=(0,E.useCallback)(()=>{c(r.Install).catch(e=>{console.warn(`[update] install failed:`,e)})},[]),h=(0,E.useCallback)(()=>{n?.mandatory&&a!==`ready`||t(!1)},[n,a]);return n?(0,D.jsx)(Ks,{open:e,onOpenChange:e=>{!e&&n?.mandatory&&a!==`ready`||t(e)},children:(0,D.jsxs)(Ys,{className:`max-w-md`,children:[(0,D.jsxs)(Xs,{children:[(0,D.jsx)(Qs,{children:a===`ready`?`Ready to Install`:`Update Available`}),(0,D.jsxs)($s,{children:[a===`prompt`&&`New version ${n.version} is available.`,a===`downloading`&&`Downloading... ${s}%`,a===`ready`&&`Download complete. Click install to restart and apply the update.`,a===`error`&&`Download failed: ${u}`]})]}),n.releaseNotes&&a===`prompt`&&(0,D.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded border border-border bg-surface-2 p-3 text-xs text-text-secondary whitespace-pre-wrap`,children:n.releaseNotes}),a===`downloading`&&(0,D.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-surface-3`,children:(0,D.jsx)(`div`,{className:`h-full bg-accent transition-all duration-300`,style:{width:`${s}%`}})}),(0,D.jsxs)(Zs,{children:[a===`prompt`&&(0,D.jsxs)(D.Fragment,{children:[!n.mandatory&&(0,D.jsx)(T,{variant:`outline`,onClick:h,children:`Later`}),(0,D.jsx)(T,{onClick:p,children:`Download`})]}),a===`ready`&&(0,D.jsx)(T,{onClick:m,children:`Install & Restart`}),a===`error`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(T,{variant:`outline`,onClick:h,children:`Close`}),(0,D.jsx)(T,{onClick:p,children:`Retry`})]})]})]})}):null}var tc=`Dimina DevTools`;function nc(){let[e,t]=(0,E.useState)(`list`),[n,r]=(0,E.useState)(null),[i,a]=(0,E.useState)([]),[o,s]=(0,E.useState)(tc);async function c(){a(await je())}(0,E.useEffect)(()=>{c(),ke().then(e=>{e?.appName&&(s(e.appName),document.title=e.appName)}).catch(()=>{})},[]),(0,E.useEffect)(()=>w(()=>{document.title=o,t(`list`),r(null),je().then(a)}),[o]);async function l(){let e=await Me();if(!e)return;let t;try{t=await Ne(e)}catch{return}await c(),d(t)}async function u(e){await Pe(e.path),await c()}function d(e){r(e),t(`project`)}return e===`list`?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(ec,{}),(0,D.jsx)(Oe,{projects:i,onAdd:l,onOpen:d,onRemove:u})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(ec,{}),(0,D.jsx)(da,{project:n},n?.path)]})}Ee.createRoot(document.getElementById(`root`)).render((0,D.jsx)(nc,{}));
|
|
46
|
-
//# sourceMappingURL=index-DW_0thr-.js.map
|